smartAdminClassMapper Class Reference

Inheritance diagram for smartAdminClassMapper:

smartClassMapper cachedSingleton

List of all members.

Static Public Member Functions

static getInstance ()

Protected Member Functions

 populateMap ()
 getClassPath ($classname)

Static Private Attributes

static $instance = __CLASS__
static $adminmap


Detailed Description

Definition at line 49 of file administrator/classloader.php.


Member Function Documentation

static smartAdminClassMapper::getInstance (  )  [static]

Reimplemented from smartClassMapper.

Definition at line 139 of file administrator/classloader.php.

Referenced by aliro::classExists(), aliroExtensionInstaller::handleClasses(), aliro::requireClass(), and aliro::startup().

00139                                           {
00140         if (!is_object(self::$instance)) {
00141             self::$instance = parent::getCachedSingleton(self::$instance);
00142             self::$instance->reset();
00143         }
00144         self::$instance->checkDynamic();
00145         return self::$instance;
00146     }

smartAdminClassMapper::populateMap (  )  [protected]

Reimplemented from smartClassMapper.

Definition at line 148 of file administrator/classloader.php.

References criticalInfo::getInstance(), aliroCoreDatabase::getInstance(), and smartClassMapper::saveMap().

00148                                       {
00149         $database = aliroCoreDatabase::getInstance();
00150         $database->setQuery('SELECT * FROM #__classmap');
00151         $maps = $database->loadObjectList();
00152         $admindir = substr(criticalInfo::getInstance()->admin_dir, 1);
00153         if ($maps) foreach ($maps as $map) {
00154             switch ($map->type) {
00155                 case 'component':
00156                     $path = ($map->side == 'admin') ? $admindir.'/components/' : 'components/';
00157                     $path .= $map->formalname.'/';
00158                     break;
00159                 case 'module':
00160                     $path = ($map->side == 'admin') ? $admindir.'/modules/' : 'modules/';
00161                     $path .= $map->formalname.'/';
00162                     break;
00163                 case 'mambot':
00164                     $path = 'mambots/'.$map->formalname.'/';
00165                     break;
00166                 case 'template':
00167                     $path = ($map->side == 'admin') ? $admindir.'/templates/' : 'templates/';
00168                     $path .= $map->formalname.'/';
00169                     break;
00170                 default: continue;
00171             }
00172             $this->saveMap($path, $map);
00173         }
00174     }

smartAdminClassMapper::getClassPath ( classname  )  [protected]

Reimplemented from smartClassMapper.

Definition at line 176 of file administrator/classloader.php.

References aliroDebug::getInstance().

00176                                                  {
00177         if (isset(self::$adminmap[$classname])) {
00178             $debuginfo = aliroDebug::getInstance();
00179             $debuginfo->setDebugData ("About to load $classname, current free memory ".(is_callable('memory_get_usage') ? memory_get_usage() : 'not known').$this->timer->mark('seconds'));
00180             return str_replace('\\', '/', dirname(__FILE__)).'/classes/'.self::$adminmap[$classname].'.php';
00181         }
00182         return parent::getClassPath($classname);
00183     }


Member Data Documentation

smartAdminClassMapper::$instance = __CLASS__ [static, private]

Reimplemented from smartClassMapper.

Definition at line 50 of file administrator/classloader.php.

smartAdminClassMapper::$adminmap [static, private]

Definition at line 52 of file administrator/classloader.php.


The documentation for this class was generated from the following file:

Generated on Wed May 14 13:02:03 2008 for ALIRO by  doxygen 1.5.5