Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes |
informatique:php [15/01/2017 20:14] – [PhpUnit] Running PHPUnit tests in Eclipse PDT cyrille | informatique:php [27/12/2022 10:12] – [PHP] cyrille |
---|
[[/informatique/php/Build Win32|Compiler PHP et PECL pour Windows]] | [[/informatique/php/Build Win32|Compiler PHP et PECL pour Windows]] |
| |
Installer Php/Apache/Mod_SSL : voir [[:informatique:apache]] | |
| Installer différentes versions de Php grâce au [[https://launchpad.net/~ondrej/+archive/ubuntu/php|dépôt de Ondřej Surý]] (un développeur Debian) : |
| <code> |
| sudo apt install software-properties-common |
| sudo add-apt-repository ppa:ondrej/php |
| sudo apt update |
| </code> |
| |
===== Application Frameworks ===== | ===== Application Frameworks ===== |
* [[http://codeigniter.com/user_guide/toc.html|CodeIgniter]] | * [[http://codeigniter.com/user_guide/toc.html|CodeIgniter]] |
* [[http://ezcomponents.org|eZComponents]] et maintenant en incubation par ASF [[http://incubator.apache.org/zetacomponents|Apache Zeta Components]] | * [[http://ezcomponents.org|eZComponents]] et maintenant en incubation par ASF [[http://incubator.apache.org/zetacomponents|Apache Zeta Components]] |
* [[http://cakePhp.org|CakePHP]] : [[wpfr>CakePHP]] | * [[/informatique/php/CakePHP]] : [[wpfr>CakePHP]] |
* [[http://www.copix.org|Copix]] : [[wpfr>Copix]] | * [[http://www.copix.org|Copix]] : [[wpfr>Copix]] |
| |
[[/informatique/php/Multithread]] | [[/informatique/php/Multithread]] |
| |
| Les generators "[[https://www.php.net/manual/en/language.generators.syntax.php|generator function]]" permettent d'**économiser de la mémoire** lors d'une itération. Au lieu d'accumuler dans un ''tableau'' le résultat d'une fonction, avec ''yield'' les valeurs sont retrournées au fil de l'itération. |
| * [[https://scotch.io/tutorials/understanding-php-generators|Understanding PHP Generators]] |
===== Outillage ===== | ===== Outillage ===== |
| |
[[http://www.baptisteautin.com/projets-personnels/php_uml/comment-utiliser-php_uml/lang/fr/|PHP_UML]] est un parser de code PHP, un générateur de XMI, et un outil de production de documentation. Concrètement, grâce à PHP_UML, vous pourrez importer dans un atelier de génie logiciel (comme Rationale Rose™ ou ArgoUml), une représentation UML d’une application PHP existante. Vous obtiendrez ainsi une vue d’ensemble du code, avec toutes les fonctions habituelles de votre AGL préféré. | [[http://www.baptisteautin.com/projets-personnels/php_uml/comment-utiliser-php_uml/lang/fr/|PHP_UML]] est un parser de code PHP, un générateur de XMI, et un outil de production de documentation. Concrètement, grâce à PHP_UML, vous pourrez importer dans un atelier de génie logiciel (comme Rationale Rose™ ou ArgoUml), une représentation UML d’une application PHP existante. Vous obtiendrez ainsi une vue d’ensemble du code, avec toutes les fonctions habituelles de votre AGL préféré. |
| |
| Eclipse plugin: [[http://phpsrc.org/|PHP Tool Integration (PTI)]] |
==== phpUnderControl ==== | ==== phpUnderControl ==== |
| |
==== Debug with Eclipse/PDT and Zend Debugger ==== | ==== Debug with Eclipse/PDT and Zend Debugger ==== |
| |
Voir [[:informatique:eclipse:pdt|Eclipse PDT]] | Voir [[informatique:ide:eclipse:pdt|Eclipse PDT]] |
| |
config XDebug dans le php.ini : | config XDebug dans le php.ini : |
| |
[[http://carbon.nesbot.com/|Carbon]] a simple PHP API extension for DateTime. | [[http://carbon.nesbot.com/|Carbon]] a simple PHP API extension for DateTime. |
| |
| ==== Cron ==== |
| |
| === crunz === |
| |
| https://github.com/lavary/crunz |
| * Crunz is a framework-agnostic package to schedule periodic tasks (cron jobs) in PHP using a fluent API |
| * Install a cron job once and for all, manage the rest from the code |
| * Crunz is capable of executing any kind of executable command as well as PHP closures |
| |
| Ce package semble bien géré et pérenne ;-) |
| |
==== Validation ==== | ==== Validation ==== |
=== owasp-php-filters === | === owasp-php-filters === |
| |
| |
| ==== Office Excel/CSV ==== |
| |
| === Spout === |
| |
| http://opensource.box.com/spout/ |
| |
| Spout supports 3 types of spreadsheets: XLSX, ODS and CSV. |
| Spout provides a simple and unified API to read or create these different types of spreadsheets. Switching from one type to another is ridiculously easy! |
| |
| === PHPOffice === |
| |
| PhpSpreadsheet, PHPWord, PHPPresentation, <del>PHPVisio</del>, PhpProject |
| |
| https://github.com/PHPOffice |
| |
==== Graphique ==== | ==== Graphique ==== |
=== PDF Parser === | === PDF Parser === |
| |
http://pdfparser.org/ | |
| |
Une lib très simpliste pour extrait des éléments d'un PDF. C'est une sur-couche simplifiant l'API de TCPDF | * http://pdfparser.org/ |
| * Une lib très simpliste pour extrait des éléments d'un PDF. C'est une sur-couche simplifiant l'API de TCPDF |
| * https://github.com/smalot/pdfparser |
| * is a standalone PHP package that provides various tools to extract data from PDF files. |
| |
=== FPDF === | === mPDF === |
| |
| https://mpdf.github.io/ |
| |
| Très fort pour les langues (Ko, Th, Zh ...) |
| |
=== TCPDF === | === TCPDF === |
=== xmlrpc-epi-php === | === xmlrpc-epi-php === |
| |
==== Divers ==== | ==== Html & DOM scraper ==== |
| |
=== eZComponents Workflow=== | === Simple HTML DOM === |
| |
http://ezcomponents.org/docs/tutorials/Workflow | https://packagist.org/packages/voku/simple_html_dom |
| |
The Workflow component provides a virtual machine that executes workflows represented through object graphs. These object graphs can be created programmatically through the software component's Workflow Definition API. Alternatively, a workflow definition can be loaded from an XML file. Object graph and XML file are two different representations of a workflow definition that uses a backend language built on the workflow patterns. | === php-html-parser === |
| |
[[http://ezcomponents.org/docs/api/trunk/Workflow_theoretical_background.html|eZ Components - Workflow - Theoretical Background]] | https://packagist.org/packages/paquettg/php-html-parser |
| |
| |
===php_uploadprogress=== | |
| |
Une extension PECL en C qui permet de suivre la progression d'un upload (An extension to track progress of a file upload).\\ | |
http://pecl.php.net/package/uploadprogress | |
| |
See http://cvs.php.net/viewvc.cgi/pecl/uploadprogress/examples/ for a little example.\\ | |
It is only known to work on Apache with mod_php, other SAPI implementations unfortunately still have issues. | |
At least PHP 5.2 is needed. | |
| |
Articles : | |
* [[http://blog.liip.ch/archive/2009/06/20/upload-progress-meter-1-0-1-released.html|Upload Progress Meter 1.0.1 released]] by Christian Stocker @ 29.06.2009 | |
* [[http://blog.liip.ch/archive/2006/09/28/upload-progress-meter-extension-for-php-5-2.html|Upload Progress Meter extension for PHP 5.2]] by Christian Stocker @ 31.03.2009 | |
* [[http://blog.liip.ch/archive/2009/03/31/upload-progress-meter-common-issues-and-some-answers.html|Upload Progress Meter - Common issues and some answers]] by Christian Stocker @ 31.03.2009 | |
* [[http://blog.liip.ch/archive/2009/03/09/upload-progress-meter-for-windows-the-next-take.html|Upload Progress Meter for Windows - The next take]] by Christian Stocker @ 13.03.2009 | |
* [[http://blog.liip.ch/archive/2009/01/10/uploadprogress-0-9-2-released.html|Upload Progress Meter extension 0.9.2 released]] by Christian Stocker @ 22.01.2009 | |
* [[http://blog.liip.ch/archive/2006/12/05/upload-progress-meter-for-windows.html|Upload Progress Meter for Windows]] by Christian Stocker @ 06.12.2006 | |
* [[http://blog.liip.ch/archive/2006/12/12/upload-progress-meter-finally-in-pecl.html|Upload Progress Meter finally in PECL]] by Christian Stocker @ 05.12.2006 | |
| |
=== Goutte === | === Goutte === |
</code> | </code> |
| |
| |
| |
| |
| ==== Divers ==== |
| |
| === eZComponents Workflow=== |
| |
| http://ezcomponents.org/docs/tutorials/Workflow |
| |
| The Workflow component provides a virtual machine that executes workflows represented through object graphs. These object graphs can be created programmatically through the software component's Workflow Definition API. Alternatively, a workflow definition can be loaded from an XML file. Object graph and XML file are two different representations of a workflow definition that uses a backend language built on the workflow patterns. |
| |
| [[http://ezcomponents.org/docs/api/trunk/Workflow_theoretical_background.html|eZ Components - Workflow - Theoretical Background]] |
| |
| |
| ===php_uploadprogress=== |
| |
| Une extension PECL en C qui permet de suivre la progression d'un upload (An extension to track progress of a file upload).\\ |
| http://pecl.php.net/package/uploadprogress |
| |
| See http://cvs.php.net/viewvc.cgi/pecl/uploadprogress/examples/ for a little example.\\ |
| It is only known to work on Apache with mod_php, other SAPI implementations unfortunately still have issues. |
| At least PHP 5.2 is needed. |
| |
| Articles : |
| * [[http://blog.liip.ch/archive/2009/06/20/upload-progress-meter-1-0-1-released.html|Upload Progress Meter 1.0.1 released]] by Christian Stocker @ 29.06.2009 |
| * [[http://blog.liip.ch/archive/2006/09/28/upload-progress-meter-extension-for-php-5-2.html|Upload Progress Meter extension for PHP 5.2]] by Christian Stocker @ 31.03.2009 |
| * [[http://blog.liip.ch/archive/2009/03/31/upload-progress-meter-common-issues-and-some-answers.html|Upload Progress Meter - Common issues and some answers]] by Christian Stocker @ 31.03.2009 |
| * [[http://blog.liip.ch/archive/2009/03/09/upload-progress-meter-for-windows-the-next-take.html|Upload Progress Meter for Windows - The next take]] by Christian Stocker @ 13.03.2009 |
| * [[http://blog.liip.ch/archive/2009/01/10/uploadprogress-0-9-2-released.html|Upload Progress Meter extension 0.9.2 released]] by Christian Stocker @ 22.01.2009 |
| * [[http://blog.liip.ch/archive/2006/12/05/upload-progress-meter-for-windows.html|Upload Progress Meter for Windows]] by Christian Stocker @ 06.12.2006 |
| * [[http://blog.liip.ch/archive/2006/12/12/upload-progress-meter-finally-in-pecl.html|Upload Progress Meter finally in PECL]] by Christian Stocker @ 05.12.2006 |
| |
| |
===== Templates engines ===== | ===== Templates engines ===== |
| |
| ==== Blade ==== |
| |
| Used in Laravel https://laravel.com/docs/blade |
| |
==== Twig ==== | ==== Twig ==== |
| |
MySQLnd Plugins: [[http://blog.mayflower.de/archives/578-MySQLnd-Plugins-Writing-a-MySQL-Query-Logger-in-PHP.html|Writing a MySQL Query Logger in PHP with the help of the MySQLnd Userland Handler Extension (mysqlnd_uh)]] 2010-08-16 | MySQLnd Plugins: [[http://blog.mayflower.de/archives/578-MySQLnd-Plugins-Writing-a-MySQL-Query-Logger-in-PHP.html|Writing a MySQL Query Logger in PHP with the help of the MySQLnd Userland Handler Extension (mysqlnd_uh)]] 2010-08-16 |
| |
| ===== Other stuff ===== |
| |
| ==== Streaming ==== |
| |
| * When using nginx you need to disable fastcgi_buffering with header('X-Accel-Buffering: no'); |
| * Disabling the cache is useful to avoid caching the response header("Cache-Control: no-cache, must-revalidate"); |
| |
| Streaming Ajax response |
| * [[https://gist.github.com/sohelrana820/63f029d3aa12936afbc50eb785c496c0|Catch php output buffering data over jQuery AJAX]] |
| |
| |