O'Reilly logo

PHP 5 Social Networking by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the framework

Now that we know the best practices to use when building the framework for our social network, we can start to build it!

Registry

Let's start with our registry as this will be a very important aspect to our framework. The registry is made up of the registry object itself, and the various objects that we will store within it.

The registry object

The registry object itself is very straightforward; it needs to contain two arrays, one to store any settings and data we wish to centrally store within the registry, and one to store the core objects that we wish to access via the registry.

<?php
/**
* PHP Social Networking
* @author Michael Peacock
* Registry Class
*/
class Registry {
/** * Array of objects */ private $objects; /** ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required