raiseError() public method

Trigger error
public raiseError ( string $msg, integer $code )
$msg string error message
$code integer error code
コード例 #1
0
 /**
  * Create full directory structure, Ripped straight from the Smarty Template engine.
  * Version:     2.3.0
  * Copyright:   2001,2002 ispi of Lincoln, Inc.
  *
  * @param string $dir Full directory.
  * @access private
  */
 function _create_dir_structure($dir)
 {
     if (!@file_exists($dir)) {
         $dir_parts = preg_split('![\\/]+!', $dir, -1, PREG_SPLIT_NO_EMPTY);
         $new_dir = $dir[0] == DIR_SEP ? DIR_SEP : '';
         foreach ($dir_parts as $dir_part) {
             $new_dir .= $dir_part;
             if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) {
                 Cache_Lite::raiseError('Cache_Lite : problem creating directory \\"$dir\\" !', -3);
                 return false;
             }
             $new_dir .= DIR_SEP;
         }
     }
 }
コード例 #2
0
 /**
  * Create full directory structure, Ripped straight from the Smarty Template engine.
  * Version:     2.3.0
  * Copyright:   2001,2002 ispi of Lincoln, Inc.
  *
  * @param string $dir Full directory.
  * @access private
  */
 function _create_dir_structure($dir)
 {
     $dir = str_replace("\"", "", $dir);
     //Windows doesn't allow quotes in dir names like Linux does.
     if (!@file_exists($dir)) {
         $dir_parts = preg_split('![\\/]+!', $dir, -1, PREG_SPLIT_NO_EMPTY);
         $new_dir = $dir[0] == DIR_SEP ? DIR_SEP : '';
         foreach ($dir_parts as $dir_part) {
             $new_dir .= $dir_part;
             if (!file_exists($new_dir) && !mkdir($new_dir, 0771)) {
                 Cache_Lite::raiseError('Cache_Lite : problem creating directory \\"$dir\\" !', -3);
                 return false;
             }
             $new_dir .= DIR_SEP;
         }
     }
 }
コード例 #3
0
ファイル: Cache_Lite.php プロジェクト: illuminate3/dotproject
 /**
  * Write the given data in the cache file
  *
  * @param string $data data to put in cache
  * @return boolean true if ok
  * @access private
  */
 function _write($data)
 {
     $fp = @fopen($this->_file, "w");
     if ($fp) {
         if ($this->_fileLocking) {
             @flock($fp, LOCK_EX);
         }
         if ($this->_readControl) {
             @fwrite($fp, $this->_hash($data, $this->_readControlType), 32);
         }
         $len = strlen($data);
         @fwrite($fp, $data, $len);
         if ($this->_fileLocking) {
             @flock($fp, LOCK_UN);
         }
         @fclose($fp);
         return true;
     }
     Cache_Lite::raiseError('Cache_Lite : Unable to write cache !', -1);
     return false;
 }
コード例 #4
0
 /**
  * Create full directory structure, Ripped straight from the Smarty Template engine.
  * Version:     2.3.0
  * Copyright:   2001,2002 ispi of Lincoln, Inc.
  *
  * @param string $dir Full directory.
  * @access private
  */
 function _create_dir_structure($dir)
 {
     if (!@file_exists($dir)) {
         Hashed_Cache_Lite::_create_dir_structure(dirname($dir));
         if (!mkdir($dir, 0771)) {
             Cache_Lite::raiseError("Cache_Lite : problem creating directory \"{$dir}\" !", -3);
         }
     }
 }