Ejemplo n.º 1
0
 public static function write($message, $type, $hasMark = true)
 {
     if (empty($message)) {
         trigger_error('$message dose not empty! ');
         return false;
     }
     if (empty($type)) {
         trigger_error('$type dose not empty! ');
         return false;
     }
     if (!isset(self::$type[$type])) {
         trigger_error('Unknow log type: ' . $type);
         return false;
     }
     $var = SYSTEM_VAR;
     $path = $var . '/log/' . self::$type[$type] . '/' . date('Y/m/d') . '.log';
     if ($hasMark) {
         $mark = "\n\n===========================================================================\n";
         $mark .= 'time:' . date('Y/m/d H:i:s') . "\n";
         $message = $mark . $message;
     }
     return LJL_File::write($message, $path, FILE_APPEND | LOCK_EX);
 }
Ejemplo n.º 2
0
 public static function setCache($html = null, $url = null)
 {
     $key = self::$_cacheKey;
     $html = is_null($html) ? self::$_html : $html;
     if (!$html) {
         return false;
     }
     $html = gzdeflate($html, 9);
     return LJL_File::write($html, $key);
 }
Ejemplo n.º 3
0
 public function buildStaticPage(array $data, $template, $filePath)
 {
     if (empty($data)) {
         trigger_error('$data dose not empty!');
         return false;
     }
     if (empty($template)) {
         trigger_error('$template dose not empty!');
         return false;
     }
     if (empty($filePath)) {
         trigger_error('$filePath dose not empty!');
         return false;
     }
     $output = new LJL_Response();
     $output->add($data);
     $output->template = $template;
     $view = new LJL_View_Simple($output);
     LJL_File::write($view->render(), $filePath);
     return false;
 }