本文整理匯總了PHP中CSS::srcDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSS::srcDir方法的具體用法?PHP CSS::srcDir怎麽用?PHP CSS::srcDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSS
的用法示例。
在下文中一共展示了CSS::srcDir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_include_path
$minDir = get_include_path().DIRECTORY_SEPARATOR.Asset::minDir();
assert('is_dir($jsSrc)');
assert('is_dir($cssSrc)');
assert('is_dir($minDir)');
// generate new ids
$ids = array();
if(!$handle = opendir($jsSrc)) trigger_error("couldn't open $jsSrc", E_USER_ERROR);
while(false !== ($jsfile = readdir($handle))) {
if($jsfile == "." || $jsfile == "..") continue;
$ids[] = DIRECTORY_SEPARATOR.JS::srcDir().DIRECTORY_SEPARATOR.$jsfile;
}
if(!$handle = opendir($cssSrc)) trigger_error("couldn't open $cssSrc", E_USER_ERROR);
while(false !== ($cssfile = readdir($handle))) {
if($cssfile == "." || $cssfile == "..") continue;
$ids[] = DIRECTORY_SEPARATOR.CSS::srcDir().DIRECTORY_SEPARATOR.$cssfile;
}
// delete contents of AssetManager::mindir()
if(!$handle = opendir($minDir)) trigger_error("couldn't open $minDir", E_USER_ERROR);
while(false !== ($entry = readdir($handle))) {
if($entry == "." || $entry == "..") continue;
$path = $minDir.DIRECTORY_SEPARATOR.$entry;
echo "removing $path\n";
if(!unlink($path)) trigger_error("couldn't unlink $path", E_USER_ERROR);
}
// for each file in ids, make an asset, generate minifile
foreach($ids as $key => $src) {
$path = get_include_path().$src;
$minifile = $minDir.DIRECTORY_SEPARATOR.base_convert($key, 10, 36).".".base_convert(filesize($path), 10, 36);