Esempio n. 1
0
 /**
  * 写日志
  * 
  * @param type $message 
  */
 public static function log($message, $type = 'error')
 {
     $now = time();
     $time = date('Y-m-d H:i:s', $now);
     $file_name = "{$type}_" . date('Ymd', $now);
     $message = "\n{$time}:  {$message}";
     if (self::$file_path) {
         if (!is_dir(self::$file_path)) {
             mkdir(self::$file_path, 0775, true);
         }
         $file_path = Star_Loader::getFilePath(array(self::$file_path, $file_name), '.txt');
     } else {
         $directory = Star_Loader::getModuleDirect(self::$directory_name);
         if (!is_dir($directory)) {
             mkdir($directory, 0775, true);
         }
         $file_path = Star_Loader::getFilePath(array($directory, $file_name), '.txt');
     }
     $handle = fopen($file_path, self::$model, false);
     fwrite($handle, $message);
     fclose($handle);
 }
Esempio n. 2
0
 /**
  * 返回controller目录
  * 
  * @return type 
  */
 public function getControllerDirectory()
 {
     if ($this->controller_directory == null) {
         $module = $this->request->getModuleName();
         if ($this->isValidModule($module)) {
             $this->controller_directory = $this->getModuleControllerDirectory($module);
         } else {
             $directory_name = Star_Loader::getLoadTypeByKey($this->getControllerkey());
             $this->controller_directory = Star_Loader::getModuleDirect($directory_name);
         }
     }
     return $this->controller_directory;
 }
Esempio n. 3
0
 /**
  * 返回controller目录
  * 
  * @return type 
  */
 public function getControllerDirectory()
 {
     if ($this->controller_directory == null) {
         if ($this->module_name) {
             $this->controller_directory = $this->getModuleControllerDirectory($this->module_name);
         } else {
             $directory_name = Star_Loader::getLoadTypeByKey($this->controller_key);
             $this->controller_directory = Star_Loader::getModuleDirect($directory_name);
         }
     }
     return $this->controller_directory;
 }