background preloader

PHP

Facebook Twitter

An Alternative to Perl: Shell Scripting With PHP. An Alternative to Perl: Shell Scripting With PHP - What are PHP Shell Scripts?

An Alternative to Perl: Shell Scripting With PHP

(Page 2 of 4 ) Normally shells are interactive, but not always. This means that the shell accepts commands from you through your keyboard and executes them. But instead of issuing command one by one, we can store this sequence of commands in a text file and tell PHP to execute this text file instead of entering the commands manually. This is known as PHP shell scripting. PHP shell scripts are just like batch files in MS-DOS, but they have more power than the MS-DOS batch file, thanks to PHP. Why Write Shell Scripts? CakePHP: the rapid development php framework. Pages. IP location XML API. IP Address Geolocation XML API The API returns the location of an IP address (country, region, city, zipcode, latitude, longitude) and the associated timezone in XML format.

IP location XML API

You can find below code samples with PHP, Javascript, Ruby, Python and ASP. Create daemons in PHP. Everyone knows PHP can be used to create websites.

Create daemons in PHP

But it can also be used to create desktop applications and commandline tools. And now with a class called System_Daemon, you can even create daemons using nothing but PHP. And did I mention it was easy? Update 4 Dec, 2012: Legacy Warning This class was relevant in 2009, and may still be to some people, but if you want to daemonize a php script nowadays, a 5-line Ubuntu upstart script should suffice.

If you're still convinced you need to do this with pure PHP, read on. What is a Daemon? A daemon is a Linux program that run in the background, just like a 'Service' on Windows. You reading this page, would not have been possible without them. Transformer un script PHP en Daemon ... - lindev : administration linux , développement php. 09 fév. 2009 Par Christophe de saint leger le lundi, février 9 2009, 09:32 - PHP - Lien permanent.

Transformer un script PHP en Daemon ... - lindev : administration linux , développement php

PHP cURL functions tutorial. By jatinder on September 7, 2007 cURL is a library which allows you to connect and communicate to many different types of servers with many different types of protocols. Using cURL you can: Implement payment gateways’ payment notification scripts. Download and upload files from remote servers. Login to other websites and access members only sections. PHP cURL library is definitely the odd man out. A typical PHP cURL usage follows the following sequence of steps. curl_init – Initializes the session and returns a cURL handle which can be passed to other cURL functions. curl_opt – This is the main work horse of cURL library. Curl_exec – Executes a cURL session. curl_close – Closes the current cURL session.

Below are some examples which should make the working of cURL more clearer. Caching PHP objects: how to do it in 4 easy steps. This week, my work for our top secret web app, has mainly revolved around caching.

Caching PHP objects: how to do it in 4 easy steps

This is work I really enjoy. I can sense the user experience of future customers improving each time I create a useful cache of information that speeds up a page’s load time. Screenshots: Setting remote folder permissions in Transmit (OS X FTP client) How to do it. Comprendre et utiliser un système de cache PHP. APC. PHP Class: Porter Stemming Algorithm: chuggnutt.com. The Porter Stemming Algorithm was developed by Martin Porter for reducing English words to their word stems.

PHP Class: Porter Stemming Algorithm: chuggnutt.com

For example, the word ”connections” would be reduced to its stem form “connect.” This PHP class is a fairly faithful implementation of the algorithm (the web page of which can be found here). The primary use of stemming words is in keyword indexing, if you’re building a search application. Thanks to Mike Boone for finding finding a fatal error in the is_consonant() function dealing with short word stems beginning with “Y”. I’ve updated the class accordingly. Additional thanks to Mark Plumbley for finding an additional problem with short words beginning with “Y”—the word “yves” for example. Thanks to Andrew Jeffries for discovering a bug for words beginning with “yy”—this would cause the is_consonant() method checking either of these first “y”s to fall into a recursive infinite loop and crash the program. Yeah, that’s arrogant; allow me some, okay? Nstrees library. PHP Dynamic Menu Tools. CoolMenus4 is the third and latest DHTML menu tool from Thomas Brattli, and is apparently his current project in the area.

PHP Dynamic Menu Tools

Like the others, this is not a PHP tool, it's just JavaScript. And unlike most of the JavaScript tools, coolMenus4 does not generate HTML but directly modifies the Document Object Model (DOM). It uses client-side browser detection to run with a wide variety of browsers and platforms. In fact a great deal of attention has been lavished on working around browser issues. The coding style for the CoolMenus core is remarkably dense in places -- perhaps intentionally obfuscated -- and devoid of almost all comments. The basic CoolMenus programming model (in JavaScript) is to instantiate a single top level menu object, then use a member function to create a submenu for each menu node.

Menu properties can be specified (in JavaScript) by level. XSLT (PHP4) GetText EDitor. [TUTORIEL][Général] gettext.