本文整理汇总了PHP中fs::find方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::find方法的具体用法?PHP fs::find怎么用?PHP fs::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs
的用法示例。
在下文中一共展示了fs::find方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
function _get_directory_file_size($dir)
{
$size = 0;
$files = fs :: find($dir, 'f');
foreach($files as $file)
$size += filesize($file);
return $size;
}
示例2: find
function _add_project_controllers(&$result)
{
$items = fs :: find(PROJECT_DIR . '/core/controllers/', 'f', null, null, false);
sort($items);
foreach($items as $item)
{
$class = $this->_clean_class_path($item);
$result[$class] = $class;
}
}
示例3: perform
function perform(&$request, &$response)
{
$files = fs :: find(VAR_DIR . '/compiled', 'f');
foreach($files as $file)
unlink($file);
if($request->has_attribute('popup'))
$response->write(close_popup_response($request));
$request->set_status(REQUEST_STATUS_SUCCESS);
}
示例4: find
function get_cache_size()
{
$files = fs :: find(IMAGE_CACHE_DIR, '~^f~');
$size = 0;
foreach($files as $file)
$size += (filesize($file));
return $size;
}
示例5: 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');
}
示例6: find
function _remove_file_cache($group = false, $key = false)
{
if($key)
{
@unlink($this->_get_cache_file_path($group, $key));
}
else
{
$files = fs :: find(CACHE_DIR, 'f', '~^' . preg_quote($this->_get_cache_file_prefix($group)) . '~');
foreach($files as $file)
@unlink($file);
}
}
示例7: find
function test_find()
{
$this->_create_file_system();
$res = fs :: find(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey');
$this->assertEqual(
$res,
array(
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_1'),
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_2'),
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_3')
)
);
$res = fs :: find(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/', 'f', null, '/^test2_1$/');
sort($res);
$this->assertEqual(
$res,
array(
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_2'),
fs :: normalize_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_3'),
)
);
$this->_remove_file_system();
}
示例8: find
function _do_recursive_find($dir, $file, $path, $params, &$return_params)
{
if(!is_dir($path))
return;
$items = fs :: find($path, $params['types'], $params['include_regex'], $params['exclude_regex'], $params['add_path'], $params['include_hidden']);
foreach($items as $item)
{
$return_params[] = $item;
}
}