News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Managing Gettext Translations on Shared Hosting
February 11, 2014 @ 13:09:19

On the SitePoint PHP blog today Aurelio De Rosa makes some recommendations about handing gettext translations on shared hosting. The problem with shared hosting is the need to reset the web server (Apache) to get it to read the updated translation files. His workarounds uses an external script that can dynamically pull in the latest translations without the restart.`

For serious translations we can use Gettext. This approach enables us to have different files for every targeted language which helps in maintaining separation between the business logic, the presentation layer, and the translations (which we can see as an add-on of the presentation layer). With Gettext, we can parallelize the process because while we're working on some features of the website, translators can still work on translations using software like gettext functionality to set the current language and extract a "HELLO_WORLD" string. He then moves on to the use of the Audero Shared Gettext library. This library creates a "mirror" of the translation file requested and forces those updates into the current domain. Code examples of its use are included showing a basic pull and merge process.

0 comments voice your opinion now!
gettext tranlsation dynamic loading webserver shared hosting tutorial

Link: http://www.sitepoint.com/managing-gettext-translations-shared-hosting

DevShed:
Lazy and Eager Loading in PHP 5
September 11, 2009 @ 12:49:30

On DevShed today there's the start of a new series looking at design patterns in PHP applications. In this first part of the series, they look at lazy and eager loading.

In the case of PHP 5, which is better suited for developing web-based programs, there are two complementary design patterns that can be of great help in building faster and more reliable applications. Of course, as this article's title suggests, I'm talking about the lazy and eager loading patterns. Despite their rather funny names, they are pretty easy to implement in PHP 5-controlled environments.

To illustrate, they've created a sample class that uses a few class properties and a __toString method to return the values.

0 comments voice your opinion now!
lazy eager loading tutorial designpattern


Stefan Esser's Blog:
Suhosin Updates - Improved Randomness & LAZY Symbol Loading
August 25, 2008 @ 12:06:01

Stefan Esser has released a new update (really two, but one is the latest) to his Suhosin patch for PHP - version 0.9.27.

The previous update (0.9.26) updated the utility with an improved randomness fixing a few issues with an ini setting and the uploadprogress extension as well as adding in a few new settings and updates to the randomizing functions that come included in PHP.

The 0.9.27 update (the most current) updates the patch with a lazy loading change that allows it to work correctly on systems that have it disabled by default (causing the previous patch to not work).

You can grab this latest release, 0.9.27, from the suhosin website.

0 comments voice your opinion now!
lazy loading improve random suhosin ini patch


Cormac's Blog:
Lazy loading of object variables in php using __get()
August 08, 2008 @ 14:22:51

Recently, Cormac posted this look at a method for lazy loading on variables in an object with the magic __get method.

I used the magic method __get() to load the images into the [Product] object when they were needed. __get() is called whenever something tries to access a variable that is not set or publically accessible, so basically I used that to load the images whenever some other piece of code tried to access Product::images.

He includes a quick bit of code that fires off an internal private method for the class that loads up the images. In his example, if they're already loaded, it never gets called.

0 comments voice your opinion now!
lazy loading get method image product



Community Events





Don't see your event here?
Let us know!


framework security voicesoftheelephpant language composer symfony introduction update laravel mvc package series podcast opinion community tool version library release interview

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