Php: page 5
Getting gearman to install on Ubuntu
Getting gearman to install on Ubuntu Getting the gearman PHP PECL package to build on Ubuntu is problematic with many unaccounted for dependency issues. I only made a couple changes when following the instructions from JSJoy as I am running Karmic rather than Lucid I changed the apt-get sources to: deb http://ppa.launchpad.net/gearman-developers/ppa/ubuntu karmic main deb-src http://ppa.launchpad.net/gearman-developers/ppa/ubuntu karmic main My sources file was also located at /etc/apt/sources.list and not /etc/sources.list as stated in the original post from JSJoy. Read more ⇒
Drop Cap with PHP Regular Expression
This is a simple regular expression I wrote to convert the first letter of an article into a drop cap. It will surround the first letter with a span tag containing the class drop-cap. You can then apply any styling you like to the span with CSS. It will skip over any HTML encoded characters or tags at the beginning of the article as well so it always highlights the first letter of the content and not any HTML formatting. Read more ⇒
Updated: Back up Tumblr Blog and/or Disqus Comments
Updated: Back up Tumblr Blog and/or Disqus Comments A simple and somewhat dirty script for backing up Tumblr and/or Disqus via its API to an SQLite DB. It now handles backing up Disqus comments to SQLite as well. Read more ⇒
Backing up Tumblr blogs with PHP and SQLite
Backing up Tumblr blogs with PHP and SQLite I have knocked together a very simple and somewhat dirty PHP CLI script to download copies of an entire Tumblr blog through their API. I have imaginatively called it Tumblr Backup PHP. I will be adding extra features as and when I can. The first new feature on the list will be ability backup the associated Disqus comments at the same time. Read more ⇒
Agavi: Agavi on the Azure Platform
Agavi: Agavi on the Azure Platform The next release of Agavi will have initial support for running applications on the Microsoft Windows Azure platform, as well as a database adapter for the new ext/sqlsrv driver to communicate with Microsoft SQL Server and support for the IIS7 web server, which now finally has a very nice … Read more ⇒
Attaching the population filter without using form IDs (suitable where the current form is on the same page as the URL in forms action parameter) <?php // Like so $this->getContext()->getRequest()->setAttribute('populate', new AgaviParameterHolder(array( 'question[0]' => 'Can you eat cheese?', 'answer[0]' => 'No' )), 'org.agavi.filter.FormPopulationFilter'); // Or like so... $populate =& $this->getContext()->getRequest()->getAttribute('populate', 'org.agavi.filter.FormPopulationFilter'); $populate = new AgaviParameterHolder(array( 'question[0]' => 'Can you eat cheese?', 'answer[0]' => 'No' )); Use form ids to link the pre-population to a particular form Read more ⇒
To get Netbeans to listen for browser initiated debug sessions please consider the following steps: Go to Project Properties > Run Configuration > Advanced > Debug URL and choose the Do not open a web browser. Save. (you may like to setup Path Mapping, but it works for me without it) In the projects listing right click on your intended project and choose Debug, which will start Netbeans listening for connections. Read more ⇒
Bitextender backed Agavi is a very secure and helpful open source (LGPL) MVC framework with the core development being headed by David Zülke (Wombert) and Felix Gilcher (certainly in the IRC channel!). It can take some time to get the hang of the framework so I have put together all the resources I use or have used to help you get started. Documentation Resources: Official Agavi Tutorial - Incomplete at time of writing API Documentation Agavi Cookbook Official Agavi FAQ Unofficial Agavi FAQ – Very helpful Package Docs in SVN – You need to dig around these folders in the SVN source code viewer of Trac (some of it is also old) Veikko Mäkinen’s Blog: http://blog. Read more ⇒
Moving to git and setting up InDefero as a web frontend
Most of our development is done on Vista desktops (although I also run Ubuntu of course) and we wanted a web interface for easy browsing of code so I needed to use a pervasive and well supported VCS. After much hunting around and looking at Bazaar, Mercurial and git I decided to go with the latter due to its support in the community. There are still some reservations I have against git, which work well for Linux kernal development but not our day to day web development – the major one being that subversion would allow you to commit and update on a file by file basis where as git versions the entire repository at once as far as I am aware. Read more ⇒
Memcached and APC: Two Simple Techniques to Speed up your PHP Webpages
Memcached and APC are two tools that you can install on your server and gain almost instant gratification! APC basically caches executions that you send to a PHP process so that the next time you ask the parser to run your script it only has to look for some pre-chewed opcode in memory rather than parsing your PHP from the disk. APC also has another feature up its sleeve, memory object caching, which allows you to store objects such as results from a database table in memory. Read more ⇒