function testJoinpath() { $this->assertEquals('foo/bar', SimpleAssetUtil::joinpath('foo', 'bar')); $this->assertEquals('foo/bar', SimpleAssetUtil::joinpath('foo/', '/bar')); $this->assertEquals('foo/bar', SimpleAssetUtil::joinpath('foo', '', 'bar')); $this->assertEquals('foo/bar', SimpleAssetUtil::joinpath(null, 'foo', null, 'bar', null)); $this->assertEquals('foo/bar', SimpleAssetUtil::joinpath('', 'foo', null, 'bar', '')); }
/** * @return array */ function glob($dir = null) { if (!$dir) { $config = SimpleAsset::config(); $dir = $config['asset_dir']; } $files = glob(SimpleAssetUtil::joinpath($dir, "*.{{$this->suffix_brace}}"), GLOB_BRACE); $dirs = array_filter(glob(SimpleAssetUtil::joinpath($dir, "*")), 'is_dir'); if (sizeof($dirs) > 0) { foreach ($dirs as $dir) { $files = array_merge($files, $this->glob($dir)); } } return array_map(array($this, '_strip_asset_dir'), $files); }
/** * @param string $path * @return string */ function _digestFile($path) { return SimpleAssetUtil::joinpath($this->config['store_dir'], $path . ".md5"); }