예제 #1
0
파일: Mail.php 프로젝트: point/cassea
 public static function createMail()
 {
     $className = nameToClass(Config::getInstance()->mail->transport . "Mail");
     if (!class_exists($className)) {
         throw new MailException("Cannot find class {$className}");
     }
     return new mailObject(new $className());
 }
예제 #2
0
파일: Language.php 프로젝트: point/cassea
 static function init()
 {
     $processor = Config::getInstance()->language->processor;
     $classname = nameToClass($processor) . 'LanguageProcessor';
     Autoload::addVendor('language', $processor);
     self::$processor = new $classname();
     self::$processor->init();
 }
예제 #3
0
파일: Session.php 프로젝트: point/cassea
 public function __construct()
 {
     $config = Config::getInstance();
     $this->trigger("BeforeInit", $this);
     $this->params2save += array("id", "user_id", "cast", "ip", "remember_me");
     $sessionEngine = Config::getInstance()->session->engine;
     $classname = nameToClass($sessionEngine);
     Autoload::addVendor("session", $sessionEngine);
     $classname .= "Session";
     $this->engine = new $classname();
     if (!$this->engine instanceof SessionEngine) {
         throw new SessionException("Class '{$classname}' is not valid session engine");
     }
     $this->engine->init();
     Controller::getInstance()->onBeforeHeadBodyTail = array($this, "save");
     $this->trigger("AfterInit", $this);
     register_shutdown_function(array($this, "save"));
 }
예제 #4
0
파일: Storage.php 프로젝트: point/cassea
 /**
  * Initialize storage-subsystem. Class to be used as
  * a storage engine is chosen on the base of config file.
  *
  * So, if in config string <code>storage_engine='foo'</code> 
  * exists, file/class FooStorage will be looked up 
  * int the vendors/storage directory.
  *
  * @param null
  * @return null
  */
 static function init()
 {
     $storageEngine = Config::get('STORAGE_ENGINE');
     self::$classname = nameToClass($storageEngine) . 'Storage';
     Autoload::addVendor('storage', $storageEngine);
 }
예제 #5
0
파일: Profile.php 프로젝트: point/cassea
 /**
  * Tries to calculate name of the class from config and add to vendor lookup
  * paths list retrieved directory.
  *
  * For performance reasons, obtained classname is memorized in internal private variable.
  *
  * @param null
  * @return string class name of the profile.
  */
 private static function getProfileClass()
 {
     if (self::$profile_classname) {
         return self::$profile_classname;
     }
     try {
         if ($_t = Config::getInstance()->profile->name != "cassea") {
             //for compatibility
             self::$profile_classname = $_t;
         }
     } catch (ConfigException $e) {
         //just normal. Using default profile class
     }
     Autoload::addVendor(self::$profile_classname);
     return self::$profile_classname = nameToClass($profile_classname);
 }