Table des matières

PHP

Sources d'information :

PHP8 Attributes

Compiler PHP et PECL pour Windows

Installer différentes versions de Php grâce au dépôt de Ondřej Surý (un développeur Debian) :

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Application Frameworks

InfoWorld review: Fabulous PHP frameworks, Zend Framework, Symfony, CodeIgniter, CakePHP, and other PHP frameworks conquer Web development with extensive features, powerful tools, and superior ease Review By Rick Grehan, InfoWorld, 2011-01-26.

The no-framework PHP MVC framework: Une petit leçon d'architecture PHP à lire absolument avant de commencer une petite application qui n'a pas les grandes ambitions d'un CMS.

Un code permettant de faire des benchmarks sur quelques framework: https://github.com/pmjones/php-framework-benchmarks par Paul M. Jones

PHP Component and Library API Design Overview by Ralph Schindler (2011-01-08)

Dans les plus connus

Light MVC

Les “bons” frameworks c'est bien, mais quand on veut des performances pour un petit projet hébergé pour pas cher tout en ne ré-inventant pas la roue, il faudrait un framework léger.

Dependency Injector

Un bon article de Fabien Potencier sur l'usage de l'injection de dépendance (en Php), notamment pour ceux qui ont du mal à voir l'utilité de l'IoC/DI.

Sur Wikipedia il y a toutes une liste de frameworks php qui implémentent le pattern Dependency Injection. Il faudrait jeter un oeil à tout ce petit monde: Dependency_injection.

Un tout simple:

Autres qui semblent tout neuf et sans communauté:

Autres qui semblent inactifs ou pas finis:

Performance

Performance

Cache

Multithread

Les generators “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.

Outillage

Liste d'outils/extension affectant le comportement de Php: Affecting PHP's Behaviour.

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: PHP Tool Integration (PTI)

AOP Aspect Oriented Programming avec Php

phpUnderControl

phpUnderControl - Continuous Integration for PHP.

Phing

Phing: Le ANT (make like) pour Php.

Debug with Eclipse/PDT and Zend Debugger

Voir Eclipse PDT

config XDebug dans le php.ini :

zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.1.100
xdebug.remote_port=9000
xdebug.remote_mode=req

Alternative sans Eclipse: xdebugclient : http://code.google.com/p/xdebugclient/

FirePHP

http://www.firephp.org

FirePHP extends the aforementioned Firebug's capabilities to the server side, allowing you to easily log messages and other data hailing from a PHP script. This can be tremendously useful when debugging Ajax-driven features, or when you simply want to inspect the contents of an object or array without having to repeatedly insert and delete echo or var_dump statements. Like Firebug, FirePHP is also a Firefox extension. However you'll also need to install a simple PHP library on the server running your PHP-driven website. This script serves as the bridge for communications between the server and Firebug/FirePHP. Learn more at the official website, and be sure to check out the Developer.com article Firebug: Add Browser-based Debugging to Your Ajax Development.

SimpleTest

http://www.simpletest.org

It is a PHP unit test and web test framework. Users of JUnit will be familiar with most of the interface. The JWebUnit style functionality is more complete now. It has support for SSL, forms, frames, proxies and basic authentication. The idea is that common but fiddly PHP tasks, such as logging into a site, can be tested easily.

PhpUnit

http://www.phpunit.de

Features

Voir:

PHPDocumentor

http://www.phpdoc.org

For API documentation generation.

PHP_CodeSniffer

http://pear.php.net/package/PHP_CodeSniffer

PHP_CodeSniffer is a PHP5 script that tokenises and “sniffs” PHP, JavaScript and CSS files to detect violations of a defined coding standard. It is an essential development tool that ensures your code remains clean and consistent. It can also help prevent some common semantic errors made by developers.

Librairies

Générale

SPL Standard Php Library

PHP5 possède un modèle objet 'non vide' : il est agrémenté de classes et d'interfaces internes, réunies dans ce qu'on appelle la SPL, ou Standard PHP Library. Nous allons voir en quoi ils peuvent s'avérer très utiles dans des développements orientés objets en PHP, de plus en plus nécéssaires de nos jours, afin de maintenir une cohérence logique dans ses programmes.

Intégrée : la SPL est en réalité une extension PHP, mais qui est très souvent (pour ne pas dire tout le temps) compilée dans PHP, quelle qu'en soit la distribution (Win, packages Linux…), ce qui donne l'impression de la nativité de ses fonctionnalités. La SPL rend beaucoup de services, et de plus en plus d'extensions PHP en sont dépendantes. Ainsi, à partir de PHP5.3, il ne sera plus possible de désactiver l'intégration de la SPL via la commande de compilation. Elle sera réellement “nativement” intégrée.

Outre une approche procédurale conservée, il est désormais possible avec PHP5 de développer des pages et des processus entièrement orientés objets. La SPL, ou Standard PHP Library, est un ensemble de classes disponibles, prêtes à être utilisées ou implémentées.

De nombreux patrons de conception (design pattern) sont fournis par la SPL.

Voir:

Date Time

Carbon a simple PHP API extension for DateTime.

Cron

crunz

https://github.com/lavary/crunz

Ce package semble bien géré et pérenne ;-)

Validation

Respect/Validation

For a Validation framework, look at http://respect.li/Validation/

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, PHPVisio, PhpProject

https://github.com/PHPOffice

Graphique

PDF Parser

mPDF

https://mpdf.github.io/

Très fort pour les langues (Ko, Th, Zh …)

TCPDF

TCPDF library is a FPDF “fork”

http://www.tcpdf.org

jpgraph

http://jpgraph.net

07 Oct 2010, JpGraph 3.5.0b1

artishow

http://www.artichow.org

15/12/2006 - Artichow 2.0.0 alpha et 1.1.0

Communication

WSO2 WSF/PHP

WSO2 Web Services Framework/PHP (WSO2 WSF/PHP)

The Web Services Framework for PHP is a PHP extension that delivers comprehensive WS-* based Web Services support for the PHP world. With WSF/PHP, your php applications can acquire enterprise grade web services capabilities and seamlessly integrate with other Java or .Net systems using web services.WSO2 WSF/PHP is an open source framework for providing/consuming Web services in PHP and is the only extension that supports the full Web services (WS*-) stack including security and reliable messaging.

In addition to the ability to provide and consume web services, WSF/PHP provides comprehensive support for REST based web services allowing you to expose your soap services as REST services. It also provides the data services capability. WSF/PHP comes with comprehensive documentation and samples in addition to tooling support in the form of a code generation tool which allows the PHP user to get started with PHP web services in no time. As WSF/PHP is based on WSF/C web services framework, it comes with proven interoperability with other major web services stacks including .Net and Java.

nusoap

https://sourceforge.net/projects/nusoap/

wsdl-writer

http://www.placeoweb.com/fichiers/wsdl-writer-0.3-katy.htm

xmlrpc-epi-php

Html & DOM scraper

Simple HTML DOM

https://packagist.org/packages/voku/simple_html_dom

php-html-parser

https://packagist.org/packages/paquettg/php-html-parser

Goutte

Goutte is web crawling library for PHP. Goutte fourni un client programmable pour lire et interagir sur des pages html/xml.

http://github.com/fabpot/Goutte

// Require the Goutte phar file to use Goutte in a script:
require_once '/path/to/goutte.phar';
// Create a Goutte Client instance:
$client = new Client();
// Make requests
$crawler = $client->request('GET', 'http://www.symfony-project.org/');
// Click on links:
$link = $crawler->selectLink('Plugins')->link();
$crawler = $client->click($link);
// Submit forms:
$form = $crawler->selectButton('sign in')->form();
$crawler = $client->submit($form, array('signin[username]' => 'fabien', 'signin[password]' => 'xxxxxx'));
//Extract data:
$nodes = $crawler->filter('.error_list');
if ($nodes->count())
{
  die(sprintf("Authentification error: %s\n", $nodes->text()));
}
printf("Nb tasks: %d\n", $crawler->filter('#nb_tasks')->text());

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.

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 :

Templates engines

Blade

Used in Laravel https://laravel.com/docs/blade

Twig

http://www.twig-project.org

Encore une belle réalisation de Fabien Potencier/Sensios Labs.

Doc:

tips

Show all variables

Set the environment debug mode to true:

$twig = new Twig_Environment($loader, array('debug' => true));

Add this in your template file:

{% debug %}

Happy debugging!

removed the debug tag (should be done in an extension) It's now available in the Twig-Extensions repository: http://github.com/fabpot/Twig-extensions

Smarty

http://www.smarty.net/

Php::TAL

http://phptal.org (http://phptal.sourceforge.net, http://phptal.motion-twin.com)

PHPTAL is a templating engine for PHP5 that implements brilliant Zope Page Templates syntax:

 <div class="item" tal:repeat="item itemsArray">
     <span tal:condition="item/hasDate" tal:replace="item/getDate"/>
     <a href="${item/getUrl}" tal:content="item/getTitle"/>
   <p tal:content="value/getContent"/>
 </div>

PHPTAL is fast thanks to compiled templates and fine-grained caching. Makes it easy to generate well-formed XML/XHTML (protected against XSS attacks). PHPTAL's code is mature and improving. Released free under LGPL license.

PHPTAL is a PHP implementation of ZPT work. To be short, PHPTAL is a XML/XHTML template library for PHP.

While most web developpers continue to use ASP/JSP/PHP tags as the core language of their templates, the Zope community came with a refreshing idea named TAL. The idea was to move presentation actions inside XHTML attributes instead of using plain tags or elements.

ModeliXe

http://modelixe.phpedit.com/

BdD, DAL & ORM

Glossaire:

Pages:

ORM

Database schema

DatabaseSchema de eZ Components permet de gérer un schéma de BdD: reverse/create to xml,php array,SQL DDL. Comparing Database Schemas. Validating Schemas.

Desktop tools

MySQL Workbench

DBDesignerFork c'est pas du Php mais bien pratique pour designer. Last version 1.4 2007-07-31).

MySQL

MySQLnd Plugins: Writing a MySQL Query Logger in PHP with the help of the MySQLnd Userland Handler Extension (mysqlnd_uh) 2010-08-16

Other stuff

Streaming

Streaming Ajax response