wiki:members/GRIP-UQAM/PHP

Version 51 (modified by Grip Uqam, 7 years ago) ( diff )

--

Development

PHP Development Tools

Debug bar

Static analyzer

About

Lists of tools

Tools

Compiling PHP (to be able to use recent versions)

PHPBrew

  • phpbrew/phpbrew Useless in 2016-10 follow official dowload instructions instead (php phar)
    • 2017: alone in an otherwise empty composer.json with minimum-stability: dev
      $ composer req phpbrew/phpbrew:@dev
      $ composer req corneltek/cliframework ~2.0.0@stable
      $ composer req corneltek/getoptionkit ~2.0.0@stable
      
      • composer.json
        {
            "require": {
                "phpbrew/phpbrew": "@dev",
                "corneltek/cliframework": "~2.0.0@stable",
                "corneltek/getoptionkit": "~2.0.0@stable"
            },
            "minimum-stability": "dev"
        }}}}
        * [https://github.com/phpbrew/phpbrew/wiki/Quick-Start Quick-Start]
        * [https://github.com/phpbrew/phpbrew/wiki/Extension-Installer Extension-Installer]
        * [https://github.com/phpbrew/phpbrew/wiki/Cookbook Cookbook]
        * PHPBrew can also install some other utilities for PHP (see ...).
        ==== About ====
        * [https://www.sitepoint.com/use-phpbrew-virtphp/ How to Use PHPbrew and VirtPHP]
        * [https://www.devsaran.com/blog/phpbrew-and-virtphp-two-incredibly-effective-tools-php-developers PHPbrew and VirtPHP - Two incredibly effective tools for PHP developers]
        ==== configure: error: Cannot find OpenSSL's libraries ====
        * [https://www.google.ca/search?q=configure%3A+error%3A+Cannot+find+OpenSSL%27s+libraries Google]
        * [https://github.com/phpbrew/phpbrew/issues/2 configure error under ubuntu #2]
        * [http://zgadzaj.com/how-to-install-php-53-and-52-together-on-ubuntu-1204 How to install PHP 5.3 and 5.2 together on Ubuntu 12.04]
        ==== Example ====
        {{{#!sh
        $ curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
        $ ./phpbrew
        $ ./phpbrew init
        Using root: /home/.../.phpbrew
        Initialization successfully finished!
        <=====================================================>
        Phpbrew environment is initialized, required directories are created under
        
            /home/jean-bernard/.phpbrew
        
        Paste the following line(s) to the end of your ~/.bashrc and start a
        new shell, phpbrew should be up and fully functional from there:
        
            source /home/jean-bernard/.phpbrew/bashrc
        
        To enable PHP version info in your shell prompt, please set PHPBREW_SET_PROMPT=1
        in your `~/.bashrc` before you source `~/.phpbrew/bashrc`
        
            export PHPBREW_SET_PROMPT=1
        
        To enable .phpbrewrc file searching, please export the following variable:
        
            export PHPBREW_RC_ENABLE=1
        
        
        For further instructions, simply run `phpbrew` to see the help message.
        
        Enjoy phpbrew at $HOME!!
        
        <=====================================================>
        
        # ./phpbrew install --with-openssl 7.0 +default -mcrypt +dbs +mb
        # ./phpbrew install 7.0 +default -mcrypt +dbs +mb --with-openssl
        $ ./phpbrew install 7.0 +default -mcrypt +dbs +mb -- --with-openssl
        # env PHPBREW_PHP=php-7.0.11 ./phpbrew ext install github:nikic/php-ast php7
        $ env PHPBREW_PHP=php-7.0.11 ./phpbrew ext install github:nikic/php-ast
        $ ~/.phpbrew/php/php-7.0.11/bin/php -i |less
        $ ~/.phpbrew/php/php-7.0.11/bin/php composer require etsy/phan
        $ ~/.phpbrew/php/php-7.0.11/bin/php vendor/bin/phan --help
        }}}
        = Help about PHP =
        * [http://www.php-fig.org/faqs/#can-you-help-me-with-my-php-code Can you help me with my PHP code?]
         * [http://reddit.com/r/phphelp Reddit]
         * [http://stackoverflow.com/questions/tagged/php Stack Overflow]
         * [http://php.net/manual/ PHP Manual] (especially the comments)
         * [http://phptherightway.com PHP: The Right Way]
        = Conferences =
        * [https://world.phparch.com/schedule/ PHP[WORLD]]
        = Web Articles =
        * //[http://fabien.potencier.org/on-php-5-3-lambda-functions-and-closures.html On PHP 5.3, Lambda Functions, and Closures]// Fabien Potencier 2009
        = Books =
        * php 7 programming [http://www.worldcat.org/search?q=php+7+programming WorldCat]
        * advanced php programming [http://www.worldcat.org/search?q=advanced+php+programming WorldCat]
        * //[http://www.worldcat.org/title/php-advanced-and-object-oriented-programming PHP advanced and object-oriented programming]// 2013
        * //[http://www.worldcat.org/title/php-and-postgresql-advanced-web-programming PHP and PostgreSQL : advanced Web programming]// 2002
        = Example code =
        * https://github.com/thephpleague/skeleton
         * Contains Travis CI configuration
        = PHP Syntax =
        == php double colon class ==
        * [https://www.google.ca/search?q=php+double+colon+class Google]
         * [http://stackoverflow.com/questions/3173501/whats-the-difference-between-double-colon-and-arrow-in-php/3173511 What's the difference between :: (double colon) and -> (arrow) in PHP?]
         * [https://laracasts.com/discuss/channels/tips/double-colon-class Double colon class]
        = What is new =
        == What is new in php 7==
        * [http://gophp7.org/gophp7-ext/ Home of the GoPHP7 extensions project]
        * [https://www.sitepoint.com/learn-php-7-find-out-whats-new-and-more/ Learn PHP 7, Find out What’s New, and More]
        = PHP Security Programming =
        * http://stackoverflow.com/questions/6474783/which-server-variables-are-safe
        * http://stackoverflow.com/questions/4247704/how-tamper-proof-is-the-server-variable-in-php
        = PHP Programming =
        * http://php.net/manual/en/language.constants.predefined.php
        * http://php.net/manual/en/function.getcwd.php
        * http://stackoverflow.com/questions/4645082/get-absolute-path-of-current-script
        * php+curent+directory
        * http://php.net/manual/en/reserved.variables.environment.php
        * http://php.net/manual/en/function.phpinfo.php
        * http://php.net/manual/en/function.readlink.php
        * http://stackoverflow.com/questions/12580330/php-dirname-returns-symlink-path
        * https://bugs.php.net/bug.php?id=46260
        * php+symlink+path
        * http://php.net/manual/en/function.dirname.php
        == Namespaces ==
        * https://www.youtube.com/results?search_query=php+namespaces
        * http://knpuniversity.com/screencast/php-namespaces-in-120-seconds
        = Testing =
        * testing [https://packagist.org/search/?q=testing Packagist]
        == BDD Testing ==
        * BDD testing [https://packagist.org/search/?q=BDD%20testing Packagist]
        * [https://packagist.org/packages/codeception/codeception codeception/codeception]
        == Unit Testing ==
        * unit testing [https://packagist.org/search/?q=unit%20testing packagist]
        * [https://packagist.org/packages/phpunit/phpunit phpunit/phpunit] [[Image(https://img.shields.io/packagist/dm/phpunit/phpunit.svg, link=https://packagist.org/packages/phpunit/phpunit, title=phpunit/phpunit)]] The PHP Unit Testing framework.
        * [https://packagist.org/packages/atoum/atoum atoum/atoum] [[Image(https://img.shields.io/packagist/dm/atoum/atoum.svg, link=https://packagist.org/packages/atoum/atoum, title=atoum/atoum)]] Simple modern and intuitive unit testing framework for PHP 5.3+
         * atoum [https://packagist.org/search/?q=atoum atoum] ... [https://packagist.org/packages/atoum/atoum-bundle atoum-bundle]
        == Functional or acceptance testing ==
        * [http://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html Developing web applications with behat and mink]
        * [https://packagist.org/packages/behat/mink behat/mink]
        * [https://packagist.org/packages/behat/mink-goutte-driver behat/mink-goutte-driver]
        It's 2016 now and there's Mink. It even supports different engines from headless pure-PHP "browser" (without JavaScript), over Selenium (which needs a browser like Firefox or Chrome) to a headless "browser.js" in NPM, which DOES support JavaScript. http://stackoverflow.com/questions/199045/is-there-a-php-equivalent-of-perls-wwwmechanize
        * Something similar is available in Python.
        == Coding Standards ==
        === About Coding Standards ===
        * [WikiPedia:Coding_conventions]
         * [http://pear.php.net/manual/en/standards.php Coding Standards] [https://pear.php.net/manual/en/standards.sample.php Sample File (including Docblock Comment standards)] (file doc comment)
         * [http://www.php-fig.org/psr/psr-1/ PSR-1: Basic Coding Standard] [http://www.php-fig.org/psr/psr-2/ PSR-2: Coding Style Guide]
         *
         * [https://www.drupal.org/docs/develop/standards Drupal]
         * [https://framework.zend.com/manual/1.12/en/coding-standard.html Zend Framework Coding Standard for PHP] [https://framework.zend.com/manual/1.11/en/coding-standard.coding-style.html Coding Style]
         * [http://symfony.com/doc/current/contributing/code/standards.html Symfony]
          * symfony3 coding standard [https://phppackages.org/s/symfony%20coding%20standard symfony coding standard] [https://packagist.org/search/?q=symfony3%20coding%20standard Packagist] [https://packagist.org/packages/escapestudios/symfony2-coding-standard escapestudios/symfony2-coding-standard] (bug: search files from executable folder, instead of current directory)
        * [https://www.tutorialspoint.com/php/php_coding_standard.htm PHP - Coding Standard]
        * [http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartV/CodingGuideLines/PHP.html PHP Coding Guidelines & Best Practices]
        * [http://stackoverflow.com/questions/139427/which-coding-convention-to-follow-for-php Which Coding convention to follow for PHP?]
        == Detecting coding standards' violations ==
        === PHP_CodeSniffer ===
        * PHP_CodeSniffer [https://packagist.org/search/?q=PHP_CodeSniffer Packagist] [DebianPackage:php-codesniffer] [[Image(https://qa.debian.org/cgi-bin/popcon-png?packages=php-codesniffer&show_installed=on&date_fmt=%25Y, 3%, link=https://tracker.debian.org/pkg/php-codesniffer, title="debian: php-codesniffer")]]
        * [https://packagist.org/packages/squizlabs/php_codesniffer squizlabs/php_codesniffer]
        * [https://phppackages.org/s/CodeSniffer%20Symfony CodeSniffer Symfony]
         * [https://packagist.org/packages/leaphub/phpcs-symfony2-standard leaphub/phpcs-symfony2-standard]
        * [https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically Fixing Errors Automatically]
        === php-cs-fixer ===
        * php-cs-fixer [https://packagist.org/search/?q=php-cs-fixer Packagist]
        * [https://packagist.org/packages/friendsofphp/php-cs-fixer friendsofphp/php-cs-fixer]
        * [https://packagist.org/packages/fabpot/php-cs-fixer fabpot/php-cs-fixer] Abandoned!
        * [http://cs.sensiolabs.org/ PHP Coding Standards Fixer]
        == Test framework ==
        * behat
        * [https://packagist.org/packages/peridot-php/peridot peridot-php/peridot]
        = how to manage object dependencies =
        * //[http://fabien.potencier.org/what-is-dependency-injection.html What is Dependency Injection?]// [http://fabien.potencier.org/ Fabien Potencier] 2009
        * //[http://ralphschindler.com/2011/05/18/learning-about-dependency-injection-and-php Learning About Dependency Injection and PHP]// [http://ralphschindler.com/ Ralph Schindler] 2011
        = People =
        * [https://r.je/ Tom Butler's Programming Blog. MVC, PHP, Best practices] [https://packagist.org/packages/level-2/dice level-2/dice] A minimalist Dependency injection container (DIC) for PHP
        
Note: See TracWiki for help on using the wiki.