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


PHP fs::find方法代码示例

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

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

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

示例4: find

  function get_cache_size()
  {
    $files = fs :: find(IMAGE_CACHE_DIR, '~^f~');

    $size = 0;
    foreach($files as $file)
      $size += (filesize($file));

    return $size;
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:image_cache_manager.class.php

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

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

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

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


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