本文整理汇总了PHP中Cache_Lite::raiseError方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache_Lite::raiseError方法的具体用法?PHP Cache_Lite::raiseError怎么用?PHP Cache_Lite::raiseError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cache_Lite
的用法示例。
在下文中一共展示了Cache_Lite::raiseError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _create_dir_structure
/**
* 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: _create_dir_structure
/**
* 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: _write
/**
* 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: _create_dir_structure
/**
* 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);
}
}
}