Map svn inside another svn with svn:externals. Example with Zend Framework and Netbeans

SVN supports external definitions.

Basically, it allows to map a subdirectory of our SVN working copy to an URL of another SVN repository. See the link above for more details.

That’s can be useful for example to mount zend framework libraries in our repository, in order to have a smaller and faster svn as well as an automatic update of the libraries directly from the Zend repositories (instead of download them again and add to the working copy, that is a very long process with the ~3k ZF files).
Continue reading

Improve performances of any web site: cache pages with Zend Framework

Zend Framework is decoupled, so it’s possible to use only the needed features.

I had to improve the performances of an old site, with no cache at all. Changing all the database/file_get_contents requests would have been a long process, so I decided to enable the cache of the web pages with Zend Framework  FrontEnd Page Cache using only few lines of code at the beginning of each page.
That web site uses a header file so I placed there the code only once.
Continue reading

Dropbox, a swiss-knife tool for developers

dropbox Among the tools I consider useful, Dropbox is one ! It offers a free online storage space of 2 Gb with automatic synchronization with local directory and versioning ! I personally use to keep my digital books, guides, code snippets, software (php, apache, mysql, portable graphic software, IDEs, etc…) between two houses and workplace.

Nice features are the possibility to share contents with other dropbox users and get public links of the selected files (to let anyone to download that file). The second feature can be used to easily download our compressed files (custom libraries, frameworks) into our new hosting (wget via ssh).

Another feature I like is the “immediate upload“: if the same file (thanks probably to a hash of the file) is already on the dropbox servers (as uploaded by another dropbox user I suppose), the file is automatically copied online-to-online without the need to upload it.  Practically, any file downloaded online is probably already on dropbox, of course except personal files and compressed files. When saving the OpenOffice installer, it will be helpful.

Download and enjoy it ! (that’s an affiliate link, if you download from that link, I get  additional 250Mb of space, thanks 🙂 )

Using PHP Closures to get cached object with one call

Getting caching objects if a fairly frequent task when dealing with performative web applications.

Standard approach

if (cache object is valid)  {
return cached object
} else {
get fresh object (*)
save object into cache
return object

I don’t like that approach as there are a lots of LOC that wraps the only meaningful code (to get the fresh object).
Continue reading