Login   Register  
PHP Classes
elePHPant
Icontem

File: manuscript/6j.-Registry.md

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gjero Krsteski  >  PIMF  >  manuscript/6j.-Registry.md  >  Download  
File: manuscript/6j.-Registry.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PIMF
Framework for Web application development
Author: By
Last change:
Date: 1 month ago
Size: 1,275 bytes
 

Contents

Registry

A well-known object that other objects can use to find common objects and services. Acts also as a dependency injection container. Note that storing resources in a registry is not permitted!

Common access

`php $registry = new Pimf\Registry(); $registry->your_key = "123"; `

Static access

`php Pimf\Registry::set('your_key', "123") Pimf\Registry::get('your_key') `

Following objects are directly accessible and come out of the box:

conf represents the configuration list.

`php $conf = Pimf\Registry::get('conf') `

env represents Pimf\Environment object which delivers methods for server and execution environment information.

`php $env = Pimf\Registry::get('env') `

logger represents Pimf\Logger object which delivers methods for common logging options into a file.

`php $logger = Pimf\Registry::get('logger') `

em represents Pimf\EntityManager object which delivers methods for data persistence and object relational mapping.

`php $em = Pimf\Registry::get('em') `