本文整理匯總了PHP中file::folder方法的典型用法代碼示例。如果您正苦於以下問題:PHP file::folder方法的具體用法?PHP file::folder怎麽用?PHP file::folder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類file
的用法示例。
在下文中一共展示了file::folder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: is_exist
private static function is_exist($app_dir, $self_dir)
{
$save_dir = dc_file_file . trim($app_dir, '/') . '/';
if (trim($self_dir)) {
$save_dir .= trim($self_dir, '/') . '/';
}
if (!file_exists($save_dir)) {
file::folder($save_dir);
}
return $save_dir;
}
示例2: create_directory
private function create_directory()
{
file::folder(FILE_TEMP, 0777);
$cache_list = array('smarty/compile/', 'compile/', 'db/ini/', 'db/js/', 'db/php/', 'db/txt/', 'db/xml/', 'session/');
foreach ($cache_list as $path_cache) {
file::folder(PATH_CACHE . $path_cache, 0777);
}
$log_list = array('trace/', 'run/', 'topic/', 'sql/', 'mongo/', 'visit/', 'test/');
foreach ($log_list as $path_log) {
file::folder(PATH_LOG . $path_log, 0777);
}
}
示例3: save
function save($data)
{
//如果緩存目錄不存在則創建
if (!$this->is_exist(false)) {
file::folder($this->save_dir);
}
if ($this->ext == 'php') {
$data = '<?php' . "\r\n" . 'return ' . var_export($data, true) . ';';
}
if ($this->ext == 'js') {
$data = json_encode($data);
}
if ($this->ext == 'ini') {
$data = fun::arr_ini($data);
}
if ($this->ext == 'xml') {
$data = fun::xml($data);
}
if (is_array($data) && $this->ext == 'txt') {
$data = serialize($data);
}
return file::save($this->file_name, $data);
}
示例4: save
function save($data)
{
//如果緩存目錄不存在則創建
if (!$this->is_exist(false)) {
file::folder($this->save_dir);
}
if ($this->ext == 'php') {
$data = '<?php' . PHP_EOL . 'return ' . var_export($data, true) . ';';
}
if ($this->ext == 'js') {
$data = json_encode($data);
}
if ($this->ext == 'ini') {
$data = help::array_ini($data);
}
if ($this->ext == 'xml') {
$data = '<?xml version="1.0" encoding="utf-8"?><data>' . help::data_xml($data) . '</data>';
}
if (is_array($data) && $this->ext == 'txt') {
$data = serialize($data);
}
return file_write($this->file_name, $data);
}