| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
| info:php [2025/11/10 07:15] – [Cake] radeff | info:php [2026/03/05 10:06] (Version actuelle) – radeff |
|---|
| ====== PHP ====== | ====== PHP ====== |
| Mes liens php [[http://radeff.red/links/search.php?hp=1&disc=php]] | <note>j'ai commencé à bricoler avec PHP en 1999, avec mon guru DKS qui avait sacrément le nez pour identifier des langages émergents</note> |
| |
| Ma page [[.mysql:start]] | <note tip>"THE" book, en français: **Rigaux, Philippe**: //Pratique de MySQ et PHP 3e ed// Très pratique, contient en plus des tas d'informations sur les CGI, HTML, CSS, XML, la programmation orientée objet, les fonctions, etc. - le bouquin d'info à emporter partout</note> |
| | |
| "THE" book, en français: **Rigaux, Philippe**: //Pratique de MySQ et PHP 3e ed// Très pratique, contient en plus des tas d'informations sur les CGI, HTML, CSS, XML, la programmation orientée objet, les fonctions, etc. - le bouquin d'info à emporter partout | |
| | |
| <note tip>[[info:myphp:cruddiy| Cruddiy is a free no-code PHP Bootstrap CRUD generator with foreign key support.]]</note> | |
| | |
| ====== nouvelle syntaxe echo php7.4+ ====== | |
| <code php> | |
| <?php | |
| echo "Bonjour, le monde!"; | |
| ?> | |
| </php> | |
| Avec PHP 7.4, une nouvelle syntaxe courte pour echo a été introduite appelée "short echo tag" et s'écrit simplement : | |
| <code php> | |
| <?= "Bonjour, le monde!"; ?> | |
| </code> | |
| ====== Ma page de scripts php ====== | |
| |
| {{namespace>:info:myphp&linkonly&title}} | {{namespace>:info:myphp&linkonly&title}} |
| |
| ====== Divers ====== | |
| * [[info:xml#php_xml|php & xml]] | |
| * [[regexp|regexp / ereg / expressions régulières]] | |
| * [[run php as a cgi|Pour utiliser php comme un shell-scripting (cgi)]] | |
| * [[https://www.arthurweill.fr/guide-des-bonnes-pratiques-php/|Arthur Weill, 10 bonnes pratiques en PHP]] | |
| |
| ===== Debug ===== | |
| * [[https://extendsclass.com/php-tester.html|PHP Code Checker - Online syntax check]] | |
| <code php> | |
| //debug begin | |
| ini_set('display_startup_errors', 1); | |
| ini_set('display_errors', 1); | |
| error_reporting(-1); // Report all PHP errors | |
| |
| // Report simple running errors | |
| //error_reporting(E_ERROR | E_WARNING | E_PARSE); | |
| |
| // Reporting E_NOTICE can be good too (to report uninitialized | |
| // variables or catch variable name misspellings ...) | |
| //error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); | |
| |
| // Report all errors except E_NOTICE | |
| //error_reporting(E_ALL & ~E_NOTICE); | |
| |
| // Report no errors (no debug, prod) | |
| //error_reporting(0); | |
| |
| //echo "<p></p>test error</p>"; exit; | |
| //debug end | |
| </code> | |
| ===== Editeurs ===== | ===== Editeurs ===== |
| | * [[info:code:start|Code (Visual studio code)]] ma préférence depuis 2024 |
| * [[info:atom|Atom]] l'éditeur né avec github | * [[info:atom|Atom]] l'éditeur né avec github |
| * [[info:code:start|Code (Visual studio code)]] | |
| ===== Frameworks ===== | |
| * http://www.journaldunet.com/developpeur/tutoriel/php/060313-php-panorama-frameworks.shtml | |
| * http://www.svay.com/blog/index/2006/03/20/369-quel-framework-php-choisir | |
| * [[http://fr.wikipedia.org/wiki/Liste_de_frameworks_PHP|Liste de frameworks PHP]] | |
| * http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks | |
| * http://g-rossolini.developpez.com/comparatifs/php/cake-zf/ comparatif cake / zend | |
| * [[http://freemind.sourceforge.net/wiki/extensions/freemind/flashwindow.php?initLoadFile=/wiki/images/4/40/Comparaison_de_frameworks_PHP.mm&startCollapsedToLevel=5&mm_title=Comparaison_de_frameworks_PHP.mm|une comparaison très synthétique avec freemind]] | |
| |
| ===== pear ===== | |
| |
| [[pear]] | |
| |
| ===== Cake ===== | |
| [[cake|CakePHP]] est un framework libre écrit en PHP. Il suit le motif de conception Modèle-Vue-Contrôleur et imite le fonctionnement de Ruby on Rails. | |
| |
| ===== Laravel ===== | |
| [[laravel:start|Laravel]] est un framework web open-source écrit en PHP[1] respectant le principe modèle-vue-contrôleur et entièrement développé en programmation orientée objet. | |
| ===== Zend ===== | |
| |
| http://framework.zend.com/ | |
| |
| http://en.wikipedia.org/wiki/Zend_Framework | |
| |
| http://framework.zend.com/manual/fr/ le manuel en français | |
| |
| ===== Symfony ===== | |
| |
| [[Symfony]] | |
| |
| ===== Images ===== | |
| * [[http://mtodorovic.developpez.com/php/gd/|La manipulation d'images avec PHP : librairie GD]] | |
| |
| * [[http://www.siteduzero.com/tuto-3-166-1-creer-des-images-en-php.html|Créer des images en PHP]] | |
| |
| * [[http://www.siteduzero.com/tuto-3-166-1-creer-des-images-en-php.html#ss_part_3|Texte et couleur]] | |
| |
| [[http://www.phpdebutant.org/article111.php | Images dynamiques, Tuto écrit par Nykoh , revu en août 2004 par Molokai et Raf]] | |
| |
| http://www.lephpfacile.com/cours/22-la-librairie-gd | |
| |
| Images sur le site officiel de php: http://fr.php.net/gd | |
| |
| [[http://www.libgd.org/ | GD library]] | |
| |
| Sur Macintosh, on peut visiblement s'en sortir en utilisant MAMP pour OS X http://www.mamp.info/ | |
| |
| ===== Sécurité ===== | |
| [[Sécurité php]] | |
| |
| ===== Register global ===== | |
| voir [[php variables globales]] | |
| |
| ===== allow_url_fopen / allow_url_include ===== | |
| Ce procédé est aujourd'hui utilisé pratiquement à 100% pour des tentatives de piratages ou de phishing et n'est que rarement nécessaire. | |
| |
| il est possible de les activer si nécessaire en introduisant l'une des valeurs suivantes dans un fichier .htaccess : | |
| |
| <code bash> | |
| php_flag "allow_url_fopen" "On" | |
| php_flag "allow_url_include" "On" | |
| </code> | |
| ===== PHP tools ===== | |
| * [[https://zonetuto.fr/php/comment-installer-nativephp-pour-faire-des-applications-de-bureau/|Comment installer NativePHP pour faire des applications de bureau]] | |
| {{namespace>info:php&linkonly&title}} | |