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

Sameer Borate's Blog:
Simulating Packages in PHP
Nov 05, 2009 @ 13:52:20

Sameer Borate has a new post to his blog looking at the idea of simulating the idea of packages that several other languages have (like Java) with similar functionality to use them.

Most modern languages have a concept of packages, wherein related classes are stored together. PHP sadly doesn’t have a similar concept. [...] But in the spirit of 'programming into the language', what we can do is try to simulate a 'package-like' concept in PHP.

Wanting to stick with the "import()" function call, he's created a bit of sample code to mimic Java's loading method. The function more or less does what the auloading included in PHP can accomplish and he points out two issues with it - it doesn't really do a real "import" just an include and that, how it stands, you cannot tell what order the files will be included in (no sorting at all).

tagged: import package simulate tutorial

Link:

ThinkPHP Blog:
Using LDIF to simulate LDAP transactions with PHP
Jul 01, 2008 @ 13:45:18

On the ThinkPHP blog today, there's a new post from Stephanie Ehrling about simulating an LDAP connection and data request to PHP with LDIF.

An LDIF file is a simple text file that can contain those LDAP information, which can be separated into two groups. On the one hand, it can hold exported LDAP data in a text format. The other purpose of LDIF is to use it for importing data into an LDAP based system. So it can contain data to be imported or just commands that shall be processed. This is an important fact, because that opens the door to an interesting workaround.

This workaround allows you to import large amounts of data quickly and easy by dumping it into the server via a simple PHP script. The code is included in the post, but you'll need to have the binaries to get the LDIF and LDAP functionality working together.

tagged: ldif simulate ldap connection data import binaries ldapmodify

Link:

DevShed:
Generating View from MySQL to Simulate the Model-View-Controller Schema in PHP
Aug 21, 2006 @ 13:46:30

DevShed has posted part three in their "Simulating the Model-View-Controller Schema in PHP" series today, this time focusing on the last of the three, the View.

All right, after refreshing the topics covered previously, as well as clarifying some key concepts with reference to the concrete subject of this series, this journey will continue by constructing yet another practical example to expand your overall knowledge of object-based programming with PHP. In particular, it's designed to show you to use a MVC-driven relationship in another real-world situation.

If you're wondering to what other cases this relationship can be specifically applied, then I have good news for you. In this final article, I'll show you how to implement the MVC schema, in order to generate different outputs (or views) from a given MySQL data set.

They start over with their code, generating a new schema based around a MySQL processing class. The controller pulls its information from the database (our model) as to how the results should be displayed. Next they describe the model to help interface with the actual table and finishing it off with the output class, resulting in either XML or plain-text output of the user information.

tagged: model view controller simulate mysql part3 schema tutorial model view controller simulate mysql part3 schema tutorial

Link:

DevShed:
Generating View from MySQL to Simulate the Model-View-Controller Schema in PHP
Aug 21, 2006 @ 13:46:30

DevShed has posted part three in their "Simulating the Model-View-Controller Schema in PHP" series today, this time focusing on the last of the three, the View.

All right, after refreshing the topics covered previously, as well as clarifying some key concepts with reference to the concrete subject of this series, this journey will continue by constructing yet another practical example to expand your overall knowledge of object-based programming with PHP. In particular, it's designed to show you to use a MVC-driven relationship in another real-world situation.

If you're wondering to what other cases this relationship can be specifically applied, then I have good news for you. In this final article, I'll show you how to implement the MVC schema, in order to generate different outputs (or views) from a given MySQL data set.

They start over with their code, generating a new schema based around a MySQL processing class. The controller pulls its information from the database (our model) as to how the results should be displayed. Next they describe the model to help interface with the actual table and finishing it off with the output class, resulting in either XML or plain-text output of the user information.

tagged: model view controller simulate mysql part3 schema tutorial model view controller simulate mysql part3 schema tutorial

Link:

DevShed:
An Introduction to Simulating the Model-View-Controller Schema in PHP
Aug 07, 2006 @ 12:38:18

So, you've been hearing more and more about all of the PHP frameworks that are available (CakePHP, Zend Framework, etc) but feel left wondering what really powers them behind the scenes (what is MVC anyway?). Well, this new article from DevShed might help to shed some light on things.

Would you like to learn how to simulate an MVC-based system with PHP? If so, you've come to the right place. This is the first article in a three-part series that will show you how to build this schema in PHP by constructing a few classes that represent what is needed.

They start off introducing the Model/View/Controller style of development, showing it as a cleaner alternative for web site development. From there, they break out into the different parts of an application - first a look at the controller to handle the requests, then a basic model class to perform the logic, and then the view to show the results of the script on the page. Their simple application allows for some string manipulation (uppercase, lowercase, reversing, etc).

tagged: model view controller framework simulate tutorial part1 model view controller framework simulate tutorial part1

Link:

DevShed:
An Introduction to Simulating the Model-View-Controller Schema in PHP
Aug 07, 2006 @ 12:38:18

So, you've been hearing more and more about all of the PHP frameworks that are available (CakePHP, Zend Framework, etc) but feel left wondering what really powers them behind the scenes (what is MVC anyway?). Well, this new article from DevShed might help to shed some light on things.

Would you like to learn how to simulate an MVC-based system with PHP? If so, you've come to the right place. This is the first article in a three-part series that will show you how to build this schema in PHP by constructing a few classes that represent what is needed.

They start off introducing the Model/View/Controller style of development, showing it as a cleaner alternative for web site development. From there, they break out into the different parts of an application - first a look at the controller to handle the requests, then a basic model class to perform the logic, and then the view to show the results of the script on the page. Their simple application allows for some string manipulation (uppercase, lowercase, reversing, etc).

tagged: model view controller framework simulate tutorial part1 model view controller framework simulate tutorial part1

Link:

DevShed:
Simulating Events with PHP 5
Feb 21, 2006 @ 12:46:23

On DevShed today, there's this new tutorial aimed at more advanced PHP developers concerning how to simulate events in PHP5.

PHP has the drawback of not supporting events. Fortunately, a basic structure can be built to support events in PHP 5. This article tackles that problem with some proof of concept code.

It seemed reasonable to me that some sort of basic structure could be established to support events in PHP 5, so I set out to whip something up as quickly as possible as a proof of concept. The contents of this article are the work of roughly one programming hour and surely stand to be improved upon, but the basic idea is this: instantiate an object and attach event handlers; the handlers will be executed when the events they are associated with are raised.

They look first at how to create a simple object to store the information in and a "collection" class to manage those objects. They move on to the creation of the event handler class and a "collection" class for handling those as well. Finally, they get to the combination of the above items - a class that does an eval on the inputted string and creates an associative array.

tagged: simulate events php5 collection class trigger handler simulate events php5 collection class trigger handler

Link:

DevShed:
Simulating Events with PHP 5
Feb 21, 2006 @ 12:46:23

On DevShed today, there's this new tutorial aimed at more advanced PHP developers concerning how to simulate events in PHP5.

PHP has the drawback of not supporting events. Fortunately, a basic structure can be built to support events in PHP 5. This article tackles that problem with some proof of concept code.

It seemed reasonable to me that some sort of basic structure could be established to support events in PHP 5, so I set out to whip something up as quickly as possible as a proof of concept. The contents of this article are the work of roughly one programming hour and surely stand to be improved upon, but the basic idea is this: instantiate an object and attach event handlers; the handlers will be executed when the events they are associated with are raised.

They look first at how to create a simple object to store the information in and a "collection" class to manage those objects. They move on to the creation of the event handler class and a "collection" class for handling those as well. Finally, they get to the combination of the above items - a class that does an eval on the inputted string and creates an associative array.

tagged: simulate events php5 collection class trigger handler simulate events php5 collection class trigger handler

Link:


Trending Topics: