CodeCanyon Registry Class 72561

CodeCanyon Registry Class 72561

CodeCanyon Registry Class 72561
PHP Script \ Miscellaneous
Sessions \ Store \ Variables \ Registry \ Data \ Global \ Class

PHP Script - Registry Class 72561 by Sitebase @ CodeCanyon

PHP Script \ Miscellaneous

Last Update: 27 November 09; Compatible Browsers: FireFox 2, FireFox 3, IE6, IE7, IE8, Safari; Software Version: PHP 5.x; Software Framework: N/A; Files Included: PHP.

This script is meant to store and retrieve variables in a central place. The values can be stored in three ways.

- Temp: Variables are accessible withing one script execution (like normal variables).

- Session: Variables that are accessible from all the pages for one user (saved in session).

- Application: Variables are accesible for all users from all pages (saved in file).

This way you have all your variables in one place and have a central place the get and set your different type of variables.


- Set and retrieve variables with the same method.

- Static methods so easy to use

- Binding variables in the registry to keep a reference

- Set and get to/from sessions/file/variables with the same method

- Auto serializing of arrays and objects before saved to file

How to use
The class is very easy to use because it uses static methods and uses the singleton pattern so there’s always only one instance from the class.

For example we want to save the username in a session so it’s accessible from every page in your website.

RegistrySet("username", "Sitebase", RegistryVAR_SESSION);
If I now want to access the username of the current user. You do this.

echo RegistryGet("username");
A second example is setting a variable that is accessible on every page and for every visitor on the website. The variables are stored in a ini file (in upcoming release it will also be possible to save to database). First we need to add a driver for the Ini file to the registry. This you do once in your index.php file.

$Driver = new Registry_Drivers_Ini();

To save a variable to the ini file you do this.

RegistrySet("localhost", "host", RegistryVAR_APPLICATION);
If I now want to access the the host variable you do this.

echo RegistryGet("host");
If you use an array or object as variable then these will automaticly be serialized before saving to the ini file. This way you can save whatever type of variable you want in the ini file.

Google Maps for Mobile Site PRO; Twitter Wall for Mobile Site PRO; Mobile Site PRO; News Widget for WordPress; Testimonials for WordPress; API Client; Html Helper Class.

Keywords: class, data, global, ini, registry, sessions, store, variables.

Tags: Registry, Class, Store, Variables, Sessions, Global

Premium CodeCanyon Registry Class 72561 WordPress Themes, Website Templates, Mobile Themes, Flash Templates & Scripts from creative professional designers. Full details of CodeCanyon Registry Class 72561 for digital design and education. CodeCanyon Registry Class 72561 desigen style information or anything related.


Add Comments:
Enter Code: *