News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

Larry Garfield's Blog:
Drupal 7 gets introspective code registry
0 comments :: posted Thursday May 08, 2008 @ 12:53:14
voice your opinion now!

Larry Garfield talks about a new feature of Drupal 7 in a new post to his blog - the new introspective code registry that's been introduced in this latest version.

As a GHOP Task , Cornil did a performance analysis of Drupal and found its two largest performance drains were the bootstrap process and the theming layer. Quite simply, Drupal spends too much time including code. [...] Fortunately, Drupal 7's self-learning code registry system has just landed, which should obliterate most of the wasted bootstrap cost.

Larry describes the "heart of it all", the token_get_all call, that parses through an entire PHP file, splitting out things like classes included and functions called. This is passed through a function_exists call to the current script and, if it's already there, the file isn't included repetitively.

tagged with: drupal cms code registry tokengetall system functionexists


PHPit.net:
Using globals in PHP
0 comments :: posted Tuesday June 27, 2006 @ 14:53:34
voice your opinion now!

In this new tutorial from PHPit.net today, Dennis Pallett talks about using globals in PHP, desscribing what they are and how to use them.

Whenever you're developing a new large-scale PHP script, you're bound to use global variables, since some data needs to be used by multiple parts of your script. Good examples of global data are script settings, database connections, user credentials and more. There are many ways of making this data global, but the most commonly used way is to use the global keyword, which we will explore later on in this article.

It's good that he mentions right from the start that most global data is a bad idea, and can really start to clutter up an application. He does help the reader prevent this, though, through the use of a few handy techniques (and design patterns).

He looks first at the "global" keyword and its use, followed by three reasons that it's not all that favorable to use. He gives other options for the "just make it global" thinking, including passing the values in function calls, passing by reference, and using the Singleton and Registry patterns to contain things a bit more. He even includes a wrapper for the registry to handle the only other globals left - the superglobals - with the same registry functionality.

tagged with: globals using tutorial singleton registry reference argument globals using tutorial singleton registry reference argument


PEAR PHP5 framework releases release package application cakephp security zend ajax mysql book database pecl conference zendframework job developer code

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework