当前位置: 首页>>代码示例>>PHP>>正文


PHP fs::find_subitems方法代码示例

本文整理汇总了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;  
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:display_cache_manager_action.class.php

示例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;
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:controllers_classes_options_datasource.class.php

示例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;
    }
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:site_objects_classes_options_datasource.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:11,代码来源:flush_ini_cache_action.class.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:partial_page_cache_manager.class.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:image_cache_manager.class.php

示例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);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:4,代码来源:fs.class.php

示例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();
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:29,代码来源:fs_test.class.php

示例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');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:full_page_cache_manager_test.class.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:40,代码来源:cache_lite.class.php


注:本文中的fs::find_subitems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。