本文整理汇总了PHP中fs::find_subitems方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::find_subitems方法的具体用法?PHP fs::find_subitems怎么用?PHP fs::find_subitems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs
的用法示例。
在下文中一共展示了fs::find_subitems方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
function _get_ini_cache_size()
{
$size = 0;
$files = fs :: find_subitems(CACHE_DIR, 'f');
foreach($files as $file)
$size += filesize($file);
return $size;
}
示例2: _add_project_controllers
function _add_project_controllers(&$result)
{
$items = fs::find_subitems(PROJECT_DIR . '/core/controllers/', 'f', '', false);
sort($items);
foreach ($items as $item) {
$class = $this->_clean_class_path($item);
$result[$class] = $class;
}
}
示例3: foreach
function _add_project_site_objects(&$result)
{
$items = fs :: find_subitems(PROJECT_DIR . '/core/model/site_objects/', 'f', '', false);
foreach($items as $item)
{
$class = $this->_clean_class_path($item);
$result[$class] = $class;
}
}
示例4: perform
function perform(&$request, &$response)
{
$files = fs::find_subitems(CACHE_DIR, 'f');
foreach ($files as $file) {
unlink($file);
}
if ($request->has_attribute('popup')) {
$response->write(close_popup_response($request));
}
$request->set_status(REQUEST_STATUS_SUCCESS);
}
示例5: get_cache_size
function get_cache_size()
{
fs::mkdir(PAGE_CACHE_DIR);
$files = fs::find_subitems(PAGE_CACHE_DIR, 'f', '~^[^p]~');
$size = 0;
foreach ($files as $file) {
$size += filesize($file);
}
return $size;
}
示例6: foreach
function get_cache_size()
{
$files = fs :: find_subitems(IMAGE_CACHE_DIR, 'f');
$size = 0;
foreach($files as $file)
{
$size += (filesize($file));
}
return $size;
}
示例7:
function find_subdirs($dir, $full_path = false, $include_hidden = false, $exclude_items = false)
{
return fs :: find_subitems($dir, 'd', $full_path, $include_hidden, $exclude_items);
}
示例8:
function test_find_subitems()
{
$this->_create_file_system();
$res = fs :: find_subitems(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey');
sort($res);
$this->assertEqual(
$res,
array(
fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_1'),
fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_2'),
fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_3')
)
);
$res = fs :: find_subitems(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/', 'f', '/^test2_1$/');
sort($res);
$this->assertEqual(
$res,
array(
fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_2'),
fs :: clean_path(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_3'),
)
);
$this->_remove_file_system();
}
示例9: test_flush
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_subitems(PAGE_CACHE_DIR);
$this->assertEqual(sizeof($files), 1);
$file = reset($files);
$this->assertEqual(fs::clean_path($file), fs::clean_path(PAGE_CACHE_DIR . fs::separator() . 'not_page_file'));
$this->_clean_simple_cache('not_page_file');
}
示例10: clean
/**
* Clean the cache
*
* if no group is specified all cache files will be destroyed
* else only cache files of the specified group will be destroyed
*
* @param string $group name of the cache group
* @return boolean true if no problem
* @access public
*/
function clean($group = false)
{
if ($this->_file_name_protection) {
$motif = $group ? 'cache_' . md5($group) . '_' : 'cache_';
} else {
$motif = $group ? 'cache_' . $group . '_' : 'cache_';
}
if ($this->_memory_caching) {
while (list($key, $value) = each($this->_memory_caching)) {
if (strpos($key, $motif, 0)) {
unset($this->_memory_caching[$key]);
$this->_memory_caching_counter = $this->_memory_caching_counter - 1;
}
}
if ($this->_only_memory_caching) {
return true;
}
}
$items = fs::find_subitems($this->_cache_dir, 'f');
foreach ($items as $file) {
if (strpos($file, $motif) !== false) {
if (!@unlink($file)) {
debug::write_error('Unable to remove cache !', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
return false;
}
}
}
clearstatcache();
return true;
}