Difference between revisions of "PHP"

From Freephile Wiki
Jump to navigation Jump to search
(adds feature documentation about magic methods)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Who wrote PHP?==
 
https://www.php.net/credits.php
 
  
==How do you upgrade?==
+
= Resource Sites =
See the [https://www.php.net/manual/en/ migrating appendices in the manual]
+
# Aidan Lister from Autstralia has a nice site online (source provided to make your own similar site) which lists many classes and PHP functions for doing routine things that you will inevitabably face in programming.  Things like making a directory structure recursively, or checking the size of a directory and it's contents.  http://aidanlister.com/
 +
# Jeroen (John) Post created http://onlinephpfunctions.com/ which lets you play with PHP code in the browser, and specifically test that code with multiple versions of PHP.
  
== mod_php vs php-fpm ==
 
See the [https://www.zend.com/blog/apache-phpfpm-modphp#how-to-choose-between-mod-php-and-php-fpm article by Matthew Weier-O'Phinney on Zend.com]
 
  
==Resource Sites==
+
== Language Features ==
 
+
* [https://github.com/guidovanbiemen/setngeti SetnGeti] - an implementation of Magic Methods for getting and setting based on traits and DocBlock comments.
#Aidan Lister from Autstralia has a nice site online (source provided to make your own similar site) which lists many classes and PHP functions for doing routine things that you will inevitabably face in programming.  Things like making a directory structure recursively, or checking the size of a directory and it's contents.  http://aidanlister.com/
+
* [https://cspray.github.io/2012/05/13/stop-calling-them-getters-setters Don't do it the wrong way]
#Jeroen (John) Post created http://onlinephpfunctions.com/ which lets you play with PHP code in the browser, and specifically test that code with multiple versions of PHP.
 
 
 
 
 
==Language Features==
 
 
 
===Magic Methods===
 
 
 
*[https://github.com/guidovanbiemen/setngeti SetnGeti] - an implementation of Magic Methods for getting and setting based on traits and DocBlock comments.
 
*[https://cspray.github.io/2012/05/13/stop-calling-them-getters-setters Don't do it the wrong way]
 
 
 
===JSON===
 
 
 
With <code>[https://php.net/manual/en/function.json-decode.php json_decode()]</code>, you either get an object, or using the optional second
 
parameter, you can force the return value to an array. In the former case, you access the content using object notation. In the latter case, you use array notation.
 
ie.
 
<source lang="php">
 
$data = json_decode($data);
 
$version = $data->query->general->generator;
 
    // or   
 
$data = json_decode($data, true);
 
$version = $data['query']['general']['generator'];
 
 
 
</source>
 
 
 
 
 
==ToDo==
 
 
 
*implement the codesniffer locally https://github.com/wikimedia/mediawiki-tools-codesniffer
 
  
 
[[Category:PHP]]
 
[[Category:PHP]]

Revision as of 15:09, 1 July 2015

Resource Sites[edit | edit source]

  1. Aidan Lister from Autstralia has a nice site online (source provided to make your own similar site) which lists many classes and PHP functions for doing routine things that you will inevitabably face in programming. Things like making a directory structure recursively, or checking the size of a directory and it's contents. http://aidanlister.com/
  2. Jeroen (John) Post created http://onlinephpfunctions.com/ which lets you play with PHP code in the browser, and specifically test that code with multiple versions of PHP.


Language Features[edit | edit source]