| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
| informatique:php [08/09/2023 07:41] – [Outillage] cyrille | informatique:php [26/04/2026 17:21] (Version actuelle) – [Syntaxe] cyrille |
|---|
| ==== Dans les plus connus ==== | ==== Dans les plus connus ==== |
| |
| | * [[informatique:php:laravel_1|Laravel]] |
| | * [[/informatique/php/symfony|Symfony]] |
| * [[http://framework.zend.com|Zend Framework]] : [[/informatique/php/Zend Framework]], [[wpfr>Zend Framework]], [[http://zend-framework.developpez.com/|ZF sur Developpez.com]] | * [[http://framework.zend.com|Zend Framework]] : [[/informatique/php/Zend Framework]], [[wpfr>Zend Framework]], [[http://zend-framework.developpez.com/|ZF sur Developpez.com]] |
| * [[http://www.symfony-project.org/|Symfony]] : [[/informatique/php/Symfony|Symfony]], [[wpfr>Symfony]] | |
| * Prado | * Prado |
| * [[/informatique/php/laravel|Laravel]] The PHP Framework For Web Artisans. | * [[informatique:php:laravel_1|Laravel]] The PHP Framework For Web Artisans. |
| * [[http://mouf-php.com|Mouf]] | * [[http://mouf-php.com|Mouf]] |
| * [[http://codeigniter.com/user_guide/toc.html|CodeIgniter]] | * [[http://codeigniter.com/user_guide/toc.html|CodeIgniter]] |
| 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. | 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]] | * [[https://scotch.io/tutorials/understanding-php-generators|Understanding PHP Generators]] |
| | * [[https://doeken.org/blog/coroutines-in-php|Exploring Coroutines in PHP]] |
| | ===== Syntaxe ===== |
| | |
| | Les closures et les classes anonymes |
| | * [[https://www.php.net/manual/en/language.oop5.anonymous.php|Php OOP Anonymous classes]] |
| | * [[https://www.pierre-giraud.com/php-mysql-apprendre-coder-cours/oriente-objet-closure-classe-anonyme/|Les closures et les classes anonymes en PHP objet]] par Pierre Giraud |
| | |
| | ==== Les Enums (avec valeurs) ==== |
| | |
| | <code php> |
| | enum DocumentFragmentType: string |
| | { |
| | case Sujet = 'sujet'; |
| | case Situation = 'situation'; |
| | public function priority() |
| | { |
| | /* pas besoin 😉 |
| | return match ($this) { |
| | DocumentFragmentType::Sujet => DocumentFragmentTypePriority::Sujet, |
| | DocumentFragmentType::Situation => DocumentFragmentTypePriority::Situation, |
| | }; |
| | */ |
| | return DocumentFragmentTypePriority::from($this->value); |
| | } |
| | }; |
| | enum DocumentFragmentTypePriority: int |
| | { |
| | case Sujet = 1; |
| | case Situation = 3; |
| | }; |
| | |
| | </code> |
| | |
| ===== Outillage ===== | ===== Outillage ===== |
| |
| |
| [[http://carbon.nesbot.com/|Carbon]] a simple PHP API extension for DateTime. | [[http://carbon.nesbot.com/|Carbon]] a simple PHP API extension for DateTime. |
| | |
| | ==== Console ==== |
| | |
| | * https://github.com/yannoff/console |
| | * A lightweight, simple alternative to symfony/console, designed for easy PHP applications development. |
| | * Aucune dépendence |
| |
| ==== Cron ==== | ==== Cron ==== |