本文整理汇总了PHP中fs::normalize_path方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::normalize_path方法的具体用法?PHP fs::normalize_path怎么用?PHP fs::normalize_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs
的用法示例。
在下文中一共展示了fs::normalize_path方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
function test_flush()
{
$this->_write_simple_cache('f_test1', $content1 = 'test-content1');
$this->_write_simple_cache('f_test2', $content2 ='test-content2');
$this->_write_simple_cache('not_page_file', $content3 ='test-content3');
$cache_manager =& new full_page_cache_manager();
$cache_manager->flush();
$files = fs :: find(PAGE_CACHE_DIR);
$this->assertEqual(sizeof($files), 1);
$file = reset($files);
$this->assertEqual(fs :: normalize_path($file), fs :: normalize_path(PAGE_CACHE_DIR . fs :: separator() . 'not_page_file'));
$this->_clean_simple_cache('not_page_file');
}
示例2: ActiveXObject
function _generate_debug_editor_link_html(&$code, $file_path)
{
if(!defined('WS_SCRIPT_WRITTEN'))
{
if(defined('TEMPLATE_EDITOR_PATH'))
$editor_path = TEMPLATE_EDITOR_PATH;
else
$editor_path = 'notepad.exe %s';
$code->write_html(" <SCRIPT LANGUAGE='JScript'>
function run_template_editor(path)
{
WS = new ActiveXObject('WScript.shell');
if(!WS) return;
editor = '{$editor_path}';
re = /%s/i;
editor = editor.replace(re, path);
WS.exec(editor);
}
</SCRIPT>");
define('WS_SCRIPT_WRITTEN', true);
}
$file_path = addslashes(fs :: normalize_path($file_path));
$code->write_html("<a href='#'><img onclick='run_template_editor(this.title)' class='debug-info-img' src='/shared/images/i.gif' alt='i' title='{$file_path}' border='0'></a>");
}
示例3: array
function walk_dir($dir, $function_def, $params=array(), $include_first=false)
{
$return_params = array();
$separator = fs :: separator();
$dir = fs :: normalize_path($dir);
$dir = fs :: chop($dir);
$params['separator'] = $separator;
fs :: _do_walk_dir($dir,
$separator,
$function_def,
$return_params,
$params,
$include_first);
return $return_params;
}
示例4: sort
function test_recursive_find()
{
$this->_create_file_system();
$res = fs :: recursive_find(TEST_DIR_ABSOLUTE_PATH . '/tmp/', 'fd', '~test\d_1~');
sort($res);
$this->assertEqual(
$res,
array(
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/test1_1'),
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_1'),
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_1'),
)
);
$this->_remove_file_system();
}
示例5: array
function &_getRecursiveFileList($directory, $file_test_function)
{
if(!is_dir($directory))
return array();
$dh = opendir($directory);
$file_list = array();
while ($file = readdir($dh))
{
$file_path = $directory . '/' . $file;
if (0 === strpos($file, '.'))
continue;
if (is_dir($file_path))
{
$file_list =
array_merge($file_list,
$this->_getRecursiveFileList(
$file_path,
$file_test_function));
}
if ($file_test_function[0]->$file_test_function[1]($file))
{
$file_list[] = fs :: normalize_path($file_path);
}
}
closedir($dh);
sort($file_list);
return $file_list;
}