本文整理匯總了PHP中IO::write方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::write方法的具體用法?PHP IO::write怎麽用?PHP IO::write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::write方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: set
function set($key, $value, $ttl = 0)
{
$vData = array($key => array('data' => $value, 'timeout' => TIMESTAMP + $ttl, 'ttl' => $ttl));
$formatData = "<?php die('Permission denied');?>\n" . serialize($vData);
$p = $this->_getSavePath($key);
//清除GET中的靜態緩存數據
$this->get($key, true);
return IO::write($p['p'], $formatData);
}
示例2: pick_log
function pick_log($msg, $args = array())
{
extract($args);
$log_dir = PICK_PATH . '/data/log/' . $pid . '/';
$log_file = $log_dir . date("Y-m-d", time()) . '.txt';
if (!is_dir($log_dir)) {
dmkdir($log_dir);
}
$msg = clear_ad_html($msg);
$msg = str_replace(milu_lang('loading'), '', $msg);
if ($memory) {
$m_str = 'memory:' . $memory;
}
$log_str .= date("Y-m-d H:i:s") . ' ' . $m_str . ' ' . strip_tags($msg) . "\r\n";
$log_str .= str_repeat('-', 100) . "\r\n";
require_once PICK_DIR . '/lib/cache.class.php';
IO::write($log_file, $log_str, 1);
}
示例3: save
/**
* Save cache data and metadata to file.
* @return boolean True if file saved ok, false if error.
*/
public function save()
{
$this->timeCreated = time();
$data = serialize(array('name' => $this->name, 'data' => $this->data, 'timeCreated' => $this->timeCreated, 'timeExpires' => $this->timeExpires, 'maxAge' => $this->maxAge));
$written = IO::write($this->fullPath, $data);
return $written;
}