function _removeFileCache($group = false, $key = false) { if($key) { @unlink($this->_getCacheFilePath($group, $key)); } else { $files = Fs :: find($this->cache_dir, 'f', '~^' . preg_quote($this->_getCacheFilePrefix($group)) . '~'); foreach($files as $file) @unlink($file); } }
function testFind() { $this->_createFileSystem(); $res = Fs :: find(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey'); sort($res); $this->assertEqual( $res, array( Fs :: normalizePath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_1'), Fs :: normalizePath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/hey/test3_2'), Fs :: normalizePath(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 :: normalizePath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_2'), Fs :: normalizePath(TEST_DIR_ABSOLUTE_PATH . '/tmp/wow/test2_3'), ) ); $this->_removeFileSystem(); }
function _doRecursiveFind($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; } }