本文整理汇总了PHP中eZSys::globBrace方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSys::globBrace方法的具体用法?PHP eZSys::globBrace怎么用?PHP eZSys::globBrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSys
的用法示例。
在下文中一共展示了eZSys::globBrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGlobBraceSupported
public function testGlobBraceSupported()
{
if (!defined('GLOB_BRACE')) {
self::markAsSkipped("This test can only be run on systems supporting GLOB_BRACE.");
}
$pattern = "kernel/classes/ez{content,url}*.php";
$eZSysGlob = eZSys::globBrace($pattern);
$phpGlob = glob($pattern, GLOB_BRACE);
self::assertEquals($eZSysGlob, $phpGlob, "Comparing glob() with eZSys::glob() using GLOB_BRACE");
$eZSysGlob = eZSys::globBrace($pattern, GLOB_NOSORT);
$phpGlob = glob($pattern, GLOB_NOSORT | GLOB_BRACE);
self::assertEquals($eZSysGlob, $phpGlob, "Comparing glob() with eZSys::glob() using GLOB_MARK | GLOB_BRACE");
}
示例2: fileDeleteByDirList
/**
* Delete files located in a directories from dirList, with common prefix specified by
* commonPath, and common suffix with added wildcard at the end
*
* \public
* \static
*/
function fileDeleteByDirList($dirList, $commonPath, $commonSuffix)
{
eZDebugSetting::writeDebug('kernel-clustering', "fs::fileDeleteByDirList( '" . implode(",", $dirList) . "', '{$commonPath}', '{$commonSuffix}' )", __METHOD__);
eZDebug::accumulatorStart('dbfile', false, 'dbfile');
foreach ($dirList as $dir) {
$unlinkArray = eZSys::globBrace("{$commonPath}/{$dir}/{$commonSuffix}*");
if ($unlinkArray !== false) {
array_map('unlink', $unlinkArray);
}
}
eZDebug::accumulatorStop('dbfile');
}
示例3: fileDeleteByDirList
/**
* Delete files located in a directories from dirList, with common prefix specified by
* commonPath, and common suffix with added wildcard at the end
*
* \public
* \static
* \sa fileDeleteByRegex()
*/
function fileDeleteByDirList( $dirList, $commonPath, $commonSuffix )
{
$dirs = implode( ',', $dirList );
$wildcard = $commonPath .'/{' . $dirs . '}/' . $commonSuffix . '*';
eZDebugSetting::writeDebug( 'kernel-clustering', "fs::fileDeleteByDirList( '".implode(', ', $dirList)."', '$commonPath', '$commonSuffix' )", __METHOD__ );
eZDebug::accumulatorStart( 'dbfile', false, 'dbfile' );
array_map( array( __CLASS__, '_expire' ), eZSys::globBrace( $wildcard ) );
eZDebug::accumulatorStop( 'dbfile' );
}