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 138 of file administrator/classloader.php.

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

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

smartAdminClassMapper::populateMap (  )  [protected]

Reimplemented from smartClassMapper.

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

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

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

smartAdminClassMapper::getClassPath ( classname  )  [protected]

Reimplemented from smartClassMapper.

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

References aliroDebug::getInstance().

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


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 Thu Apr 17 13:03:35 2008 for ALIRO by  doxygen 1.5.5