Alexey Zakhlestin has written an ode to the mb_ereg functions – a set of regular expression based functions that are more than just for unicode strings:
There is a common misunderstanding, that mb_ereg_* functions are just unicode counterparts of ereg_* functions: slow and non-powerful. That’s as far from truth as it can be. mb_ereg_* functions are based on oniguruma regular expressions library. And oniguruma is one of the fastest and most capable regular expression libraries out there. Couple of years ago I made a little speed-test.
He talks about some of the options you can give it (ignore case, find-longest, multiline) and modes (grep, java, perl, etc). A few code examples are also included.
In a new post to his blog Manuel Pichler takes a look at the first release of the staticReflection component – his component provides a unified interface to both reflection versions, which makes it easy to switch between different implementations.
A few weeks ago I started just another script that utilized the tokenizer extension to extract some information from source code files. At that point I thought that the time had come to realize a project that was on my todo for a very long time. And here is the result of the first iteration.
He includes a few code examples and how to install it from the PHP_Depend PEAR channel (and, of course, how to report issues).
Robert Basic has a quick new tutorial about chaining routes in your Zend Framework applications:
On a forum, there was a question today, about adding language “support” to the routes using Zend Framework. The guy wanted routes like /en/foo/bar or /de/baz. I wrote there an example for that using Zend_Router_Routes_Chain, so just posting that example here, too.
Custom routing allows you to define routes specific to your application without having to change the core libraries. In his example, he shows how to set up the routing objects and how to add them to the request’s chain.
Pablo Viquez has written up a mini-tutorial on getting your Zend Framework application’s errors to log out to the Firebug panel (from the extension) with the help of FirePHP and Zend_Log.
I wanted to enable logging of exceptions to my PHP log file and also display them using FireBug. On a standard setup of Zend Framework, the Zend error handler plugin (Zend_Controller_Plugin_ErrorHandler) enable by default [...] I wanted to keep using the error handler plugin and didn’t want to log the exceptions by using: Zend_Controller_Front::throwExceptions() or Zend_Controller_Response_Abstract::renderExceptions() or any other way since eventually might get complicated, besides, I think that the error handler plugin works fine and if it gets updated in the future, I won’t have to do a major refactor.
He shows how to create the Zend_Log object to write out on the development system (based on the ini setting for the Zend Framework application), how to use it to send the log message out to the waiting client. Examples of the output – a screenshot of the Firebug panel and the error log output.
Fabien Potencier has written up a post detailing a PEAR channel server manager he’s developed, Pirum.
Pirum lets you setup PEAR channel servers in a matter of minutes. Pirum is best suited when you want to create small PEAR channels for a few packages written by a few developers. Pirum consists of just one file, a command line tool, written in PHP. There is no external dependencies, no not need for a database, no need to setup credentials, and nothing need to be installed or configured.
All you need to do to get the tool is download the pirum file and go. It includes features like per-channel HTML pages and Atmos feed release tracking along with several other standard PEAR channel features.
There’s already been one project that’s made the swtich – PHP_Depend.
On the IBuildings blog Cal Evans has taken a look at the Windows caching technology (some recently released) from a management perspective and where it fits in the overall Windows caching toolsets available.
As PHP extends its reach further into corporate networks, IT managers have yet another technology that they have to understand so that they can properly deploy. In many situations, PHP code is being developed that – running on its own – creates a bad user experience because of the nature of the language. [...] Much of this delay, and the user unhappiness that always accompanies it, can be mitigated with the proper opcode caching solution. The list in this article was compiled to help managers understand what their options they have. These are the most popular or recent PHP opcode caching solutions.
He lists three of the more popular choices – the Alternative PHP Cachie, Zend Optimizer+ and the WinCache – touching briefly on what each has to offer.
A new version of the Rediska library has been released today, version 0.2.1. Rediska is a PHP client for Redia, a key/value database system (written in C) that’s similar to memcache.
It can be used like memcached, in front of a traditional database, or on its own thanks to the fact that the in-memory datasets are not volatile but instead persisted on disk. One of the cool features is that you can store not only strings, but lists and sets supporting atomic operations to push/pop elements.
The library includes multiple server support, content hashing, keys as objects and full Zend Framework integration. You can find out more about the project on its site or just download the latest version.
On the CatsWhoCode.com blog there’s a new post looking at a few cool things (ten, to be precise) you can do with the cURL extension in PHP.
New to cURL? If yes, check out the following articles to learn the purposes and basics of cURL/libcurl. [...] Please note that some of the techniques shown here can be used for “blackhat” methods. The goal of this article is only educationnal, please do not use any of the snippets below for illegal stuff.
Their ten cool things incldue:
- Get download speed of your webserver
- Publish a post on your WordPress blog, using cURL
- Post comments on WordPress blogs
- Get feed subscribers count in full text
- Get the content of a webpage into a PHP variable