Changeset 938

Show
Ignore:
Timestamp:
06/06/10 17:46:03 (20 months ago)
Author:
ort
Message:

удаление остатков от custom классов

Location:
trunk/engine/classes
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/engine/classes/Engine.class.php

    r926 r938  
    4343        protected $iTimeInit=null; 
    4444         
    45         /** 
    46          * Массив содержит меппер кастомизации сущностей 
    47          * 
    48          * @var arrat 
    49          */ 
    50         static protected $aEntityCustoms=array(); 
    51          
     45                 
    5246        /** 
    5347         * При создании объекта делаем инициализацию 
     
    486480                                throw new Exception("Unknown entity '{$sName}' given."); 
    487481                } 
    488                  
    489                 /** 
    490                  * Проверяем наличие сущности в меппере кастомизации 
    491                  */ 
    492                 if(array_key_exists($sName,self::$aEntityCustoms)) { 
    493                         $sEntity = (self::$aEntityCustoms[$sName]=='custom') 
    494                                 ? $sEntity.'_custom' 
    495                                 : $sEntity; 
    496                 } else { 
    497                         $sFileDefaultClass=isset($sPlugin) 
    498                                 ? Config::get('path.root.server').'/plugins/'.strtolower($sPlugin).'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php' 
    499                                 : Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.php';              
    500                          
    501                         $sFileCustomClass=isset($sPlugin)  
    502                                 ? Config::get('path.root.server').'/plugins/'.strtolower($sPlugin).'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php' 
    503                                 : Config::get('path.root.server').'/classes/modules/'.strtolower($sModule).'/entity/'.$sEntity.'.entity.class.custom.php'; 
    504                          
    505                         /** 
    506                          * Пытаемся найти кастомизированную сущность 
    507                          */ 
    508                         if(file_exists($sFileCustomClass)) { 
    509                                 $sFileClass=$sFileCustomClass; 
    510                                 $sEntity.='_custom'; 
    511                                 self::$aEntityCustoms[$sName]='custom';  
    512                         } elseif(file_exists($sFileDefaultClass)) { 
    513                                 $sFileClass=$sFileDefaultClass; 
    514                                 self::$aEntityCustoms[$sName]='default'; 
    515                         } else { 
    516                                 throw new Exception('Entity class not found'); 
    517                                 return null; 
    518                         } 
    519                         /** 
    520                          * Подгружаем нужный файл 
    521                          */ 
    522                         require_once($sFileClass); 
    523                 } 
    524                  
     482                                                 
    525483                $sClass=isset($sPlugin) 
    526484                        ? 'Plugin'.$sPlugin.'_Module'.$sModule.'_Entity'.$sEntity 
     
    549507                $tm1=microtime(true);    
    550508                 
    551                 $sFileClass= (substr($aMatch[2],-7)=='_custom')  
    552                         ? Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.substr($aMatch[2],0,strlen($aMatch[2])-7).'.entity.class.custom.php' 
    553                         : Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.$aMatch[2].'.entity.class.php'; 
     509                $sFileClass=Config::get('path.root.server').'/classes/modules/'.strtolower($aMatch[1]).'/entity/'.$aMatch[2].'.entity.class.php'; 
    554510                         
    555511                if (file_exists($sFileClass)) { 
  • trunk/engine/classes/Router.class.php

    r915 r938  
    180180                if(!preg_match('/^Plugin([\w]+)_Action([\w]+)$/i',$sActionClass,$aMatches)) { 
    181181                        require_once(Config::Get('path.root.server').'/classes/actions/'.$sActionClass.'.class.php'); 
    182                         $sPrefixCustom=''; 
    183                         if (file_exists(Config::Get('path.root.server')."/classes/actions/".$sActionClass.'.class.custom.php')) { 
    184                                 require_once(Config::Get('path.root.server')."/classes/actions/".$sActionClass.'.class.custom.php'); 
    185                                 $sPrefixCustom='_custom'; 
    186                         } 
    187182                } else { 
    188183                        require_once(Config::Get('path.root.server').'/plugins/'.strtolower($aMatches[1]).'/classes/actions/Action'.ucfirst($aMatches[2]).'.class.php'); 
    189                         $sPrefixCustom=''; 
    190                 } 
    191                  
    192                 $sClassName=$sActionClass.$sPrefixCustom;                
     184                } 
     185                 
     186                $sClassName=$sActionClass; 
    193187                $this->oAction=new $sClassName($this->oEngine,self::$sAction); 
    194188