Older blog entries for mglazer (starting at number 485)

4 Aug 2003 (updated 4 Aug 2011 at 17:43 UTC) »
4 Aug 2003 (updated 4 Aug 2011 at 17:43 UTC) »
19 Jul 2003 (updated 4 Aug 2011 at 17:44 UTC) »
17 Jul 2003 (updated 4 Aug 2011 at 17:44 UTC) »
15 Jul 2003 (updated 4 Aug 2011 at 17:44 UTC) »
10 Jun 2003 (updated 4 Aug 2011 at 17:44 UTC) »
27 May 2003 (updated 28 May 2003 at 00:10 UTC) »
Singleton Objects in PHP

static $obj;
if ( ! is_a ( $obj["$class"] , $class ) ) {
	$obj["$class"] = new $class;
}
return $obj["$class"];
The Problem in PHP 4.3

The issue:

Some PHP software that worked on PHP 4.2 and below can crash a server within PHP 4.3. This is due to the PHP program not handling memory management the same way and can basically overload the computers ram.

Coding exceptions that were previously handled well are now capable of memeory overload.

I believe this is what is wrong:

It has memory (RAM) management storage issues. Specifically in regards to referencing values.

This doesn't mean it is a bug just enough of a difference from previous versions which can lead to catastrophic backwards compatibiliy.

When you reference a object which contains lots of data from a parent object to a child and vice versa within each others constructors it can cause severe memory overload.

Of course one should never do this, but it seems this is a issue better handled in previous PHP versions or you might say a user error better controlled in previous versions.

20 May 2003 (updated 4 Aug 2011 at 17:45 UTC) »
19 May 2003 (updated 19 May 2003 at 19:41 UTC) »

I may have just created my greatest piece of code yet!

Using my Montros concepts sprinkled with my new love of AOP and PHPortal as a framework backdrop I created within PHP a abstract layer for independent reuse of code within code at infinite levels of cross cutting.

The toughest part is the maintenance of parameters and returns' integrity both in numbers and types.

With my recent impetus, due to incompatibilities of PHPortal with PHP 4.3x, I have been motivated to write more AOP.

There are four steps to create a code layer between your code flow and your code.

1. Create your code run / flow (template)

2. Create your mappings based on your code template. Mappings are an array of placeholders to other independent code that you will interdisperse through your code run or code template.

3. The controller or layer that will handle the gateway communication between your code template and your code placeholders or pointers. Integrity (types and amounts) of parameter input (arguments) and outputs are a must.

4. You abstract / independent code that can now cross cut each other and your core flow template. These can be functions (procedural) and or classes (OOP) but they should both be independent as well as able to maintain the intgerity of its recieving parameters (input) and its outgoing throughput. This is the msot important factor because when you intercect code into other code anonymously you do not want to disrupt future expectant code flow.

My mantra is:

"Intercepted parameters must be returned to the expectant recipient as expected"

This is for both in type and numbers.

Think of it as a template for your application similar to a website template in a single skeleton layout form.

I will release a sample application soon on 4Arrow.com under the name PHP-AOP.

Code -> Call -> Layer -> Code -> Mappings -> Code -> Call

Its recursive thus has an infinite level of depth or as much as your processor can take.

This uses a very simple prepend and append methodology for cross-cutting.

I am thinking of adding the ability to embed, statically as well as dynamically, custom pointers to where you want to disperse code.

Statically this is a non-starter, outside of your code flow template, so work on dynamically embedding pointers is the way to go.

476 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!