boîte à outils de Germain “Ashorlivs” Guglielmetti
PHP/JavaBridge est une interface permettant de faire communiquer PHP avec une machine virtuelle Java. Pré-requis PHP5 et une version récente de Java : ashorlivs:webapps ashorlivs$ java -version java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode) (...) (Lire la suite )
J’ai bien aimé cette fonction trouvé sur Dev Zone, mais il manquait quelques trucs pour qu’elle satisfasse tous mes besoins. Pluriel de "Month"... oui je sais je chipote Deuxième modification : retour en remplaçant des arguments d’une chaine utilisable par sprintf Troisième modification (à venir) : internationalisation pour le framework Kohana. /** * (...) (Lire la suite )
ATTENTION : technique de porcasse inside™ ! Vous avez un vieux site, que vous tentez de migrer sous PHP5.3 par exemple, et ça donne ça ? Deprecated: Function ereg() is deprecated (...) Vous voulez les enlever ? Solution 1 : modifier le php.ini error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED Solution 2 : faire un .htaccess php_value (...) (Lire la suite )
Goal of the application You create a CMS where you can register Pages Each page has a slug URL, i.e. : "nananana.com/slug" /** * Enable or disable hooks. */ $config[’enable_hooks’] = TRUE ; Create a hook file named my_errors in /application/hooks folder. In /application/hooks/my_errors.php : Checking the Main Controller First things first, you can (...) (Lire la suite )
Provoquer une erreur 404 Event ::run(’system.404’) ; Désactiver le buffer de sortie Dans MY_Controller.php : public function __construct() parent ::__construct() ; Kohana ::close_buffers() ; Attention, si placé à cet endroit le buffer sera désactivé partout, ce qui provoquera la nullité de url ::redirect. Pour un usage ponctuel, placer simplement Kohana (...) (Lire la suite )
URL http://prod-client.host.fr/client/files/2011/05/test.zip Domaine preg_match('@^(?:http://)?([^/]+)@i', $url, $matches); $test = print_r($matches, true); Télécharger Valeur de $test : Array ( [0] => http://prod-client.host.fr [1] => prod-client.host.fr ) Path preg_match('@http://[^/]+/(.*)@i', $row['guid'], (...) (Lire la suite )
Preamble I wrote this script to migrate the following configurations : Local WordPress running on http://localhost Distant server is configurable Runs updates on Multisites WPML translation plugin can be enabled Disclaimer This is a beta version, suitable for a particular project. I haven’t had the opportunity to test it with another setup, it just (...) (Lire la suite )
Scope This article is intended for use with Kohana 2.x version. I have tested only with the latest, which is 2.3.4 as of today. Kohana’s "Feed" helper The official documentation of the helper is located here : http://docs.kohanaphp.com/helpers/feed With this helper you can easily create an RSS feed, however the method doesn’t natively support nested tags. (...) (Lire la suite )
Pré-requis Vous utilisez une barre de mise en forme comme TinyMCE, qui génère un code source comme ça : Je suis le texte en français. Nullam iaculis fermentum pulvinar. Praesent a rhoncus dui. Maecenas eget lacus vitae sapien scelerisque tempus. Nulla ultricies erat ac mi hendrerit porta bibendum est interdum. Phasellus a enim turpis. Coucou ! Ce que vous (...) (Lire la suite )
Créer le script suivant (et le lire pour comprendre) #!/usr/bin/perl use FCGI; $count = 0; while (FCGI::accept >= 0) print "Content-type: text/html\r\n\r\n"; $count++; print "This will only count up if you are running under fastcgi: $count\n"; (Lire la suite )
page suivante