 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
DevShed: Working Out of the Object Context to Build Loader Apps in PHP
by Chris Cornutt June 26, 2009 @ 07:56:54
New on DevShed there's the latest part of a series of tutorials they've written up (fifth of eight) about building automatic loading functionality into your applications. This time they change up their class to make the their loading function accessible outside of a class object.
To avoid an eventual (and unnecessary) instantiation of the loader class, it would be helpful to declare the mentioned "load()" method static. Thus, bearing in mind this important concept, in this fifth part of the series I'm going to enhance the signature of the "Loader" class created previously by turning its loading method into a static one.
They change the definition of the function to be "public static" making it callable both through the "self" keyword and outside the class with the "::" operator.
voice your opinion now!
static tutorial application loader
DevShed: Including Files Recursively with Loader Applications in PHP
by Chris Cornutt June 11, 2009 @ 12:43:23
DevShed continues their "loaders in applications" series with this fourth part, a look at including files recursively.
This series uses a variety of code samples to teach you how to create modular programs. These programs are capable of recursively including files required by a given application, without having to explicitly call any "include()/include_once()" or "require()/require_once()" PHP function.
In their example they show how to use their loader class (built up from previous parts of the series) and modify it slightly to allow the script to set the file path, set the files to include and pull them in.
voice your opinion now!
loader recursive tutorial include
DevShed: Using Static Methods to Build Loader Apps in PHP
by Chris Cornutt June 04, 2009 @ 10:27:42
Continuing their look at static methods in PHP, DevShed has posted this new tutorial (the second in the series) focusing on using the methods to create a simple loader application.
As its name suggests, a file loading program (or a resource loading program, to express the concept more accurately), is simply a PHP module that takes care of including, usually via its set of "include()/require() native functions, files that are required by an application to make it work as expected. [...] It's worthwhile to mention, however, that it was necessary to create an instance of the aforementioned class to load a determined file. This is a process that can be completely avoided in terms of good coding habits. But how can this be achieved? Well, it's feasible to statically call the class's load()" method, preventing its unwanted instantiation.
The code examples of the simple loader class (a require_once wrapped in a try/catch) and a usage example.
voice your opinion now!
loader static tutorial
DevShed: Building Loader Apps in PHP
by Chris Cornutt May 28, 2009 @ 09:37:51
In this first part of a new series in application development, DevShed looks at building a loader for various resources inside your app.
Loading sources on the fly is one of the most common tasks that PHP programmers have to tackle during the development of web applications. This typical situation must be faced independently of the scale of the programs being created. This means a loader mechanism must be developed.
Their basic loader class uses a call to a load() method to do two things - check to ensure that a file exists and, if it does, include it (technically a require_once). They also put a bit of exception handling around it to help catch any errors thrown on the include.
voice your opinion now!
include loader tutorial
Stubbles Blog: My wishlist for PHP6, pt4 static initializers
by Chris Cornutt March 26, 2007 @ 09:16:00
In a continuation of their "wishlist" series of posts for PHP6, Stephan Schmidt has postted this new item today taking about something he wishes PHP could do - initialize a property when defining an object.
But how could this be solved, when you never create an instance of Foo but only use static method calls?
I propose a new feature, we implemented in the Stubbles class loader and has been shamelessly ripped from the XP framework. If you need to initialize some properties with objects and are developing with Stubbles, you only need to implement a method called __static() in your class. If your class is loaded by the Stubbles class loader, it will check, whether this method has been implemented and call it. As every class is only loaded once, this enables you to add code to your class, that is also only executed once, if the class is imported into your application.
His solution allows for the creation of such objects with little more than the use of a __static call that could get the object and change the property defined on it.
voice your opinion now!
static initializers php6 wishlist class loader static initializers php6 wishlist class loader
Community News: EncoderCompare.com Launched
by Chris Cornutt September 11, 2006 @ 11:06:00
When it comes to protecting your code, you definitely want to find the right product for your needs. Finding the information on all of the encoders out there can be a task in itself, though. Fortunately, EncoderCompare.com has been created to give you a quick and easy reference.
Whilst we would always recommend the use of the ionCube Encoder product to protect your PHP source code when distributing your product to customers and users, there are several other products available to choose from.
To help with this, we have launched a comparison website which lists the available encoders and compares their features. The feature set is standardised so that it is possible to compare like for like in a clear manner.
Currently, there's fifteen encoders listed with all of their stats - protection types, restrictions available, what OSes it has loaders for, the availability of licensing, and the pricing. There's links to get more specific information on each as well.
voice your opinion now!
encoder compare grid name protection restriction loader licensing pricing encoder compare grid name protection restriction loader licensing pricing
|
Community Events
Don't see your event here? Let us know!
|