本文整理汇总了PHP中StringHelper::MaskCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP StringHelper::MaskCheck方法的具体用法?PHP StringHelper::MaskCheck怎么用?PHP StringHelper::MaskCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringHelper
的用法示例。
在下文中一共展示了StringHelper::MaskCheck方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetFiles
public static function GetFiles($directory, $ignoreFiles = null, $ignoreMasks = null)
{
if (!is_dir($directory)) {
return false;
}
$items = new \RecursiveDirectoryIterator($directory);
$files = array();
foreach (new \RecursiveIteratorIterator($items) as $filename => $current) {
if (!is_dir($filename) && !in_array($current->GetFileName(), $ignoreFiles) && !\StringHelper::MaskCheck($filename, $ignoreMasks)) {
$files[] = $filename;
}
}
return $files;
}
示例2: ProcessSiteFolder
private function ProcessSiteFolder($source, $dest, $folderPermissions, $filePermissions, $ignoreFiles = null, $ignoreMasks = null)
{
// Check for symlinks
if (is_link($source)) {
// No support for symlinks
return true;
// return symlink(readlink($source), $dest);
}
// If it truly is a file
if (is_file($source)) {
// Check file is a Blueprint, ignore if it is and add it to the views, else copy it.
$check = strpos(file_get_contents($source), TAG_START . TAG_BLUEPRINT);
if ($check !== false) {
$this->views[] = new View($this, $source);
return true;
}
// Is this file a compress-ible file?
if ($this->getGlobalCompression()) {
// Copy / Return the already minimized versions of libraries
if (strpos($source, ".min.") || strpos($source, "-min.")) {
Core::Output(INFO, "Not Compressing " . $source);
return copy($source, $dest);
}
switch (strtolower(pathinfo($dest, PATHINFO_EXTENSION))) {
case 'js':
$minifier = new Minify\JS($source);
Core::Output(INFO, "Compressing " . $source);
return file_put_contents($dest, $minifier->minify());
case 'css':
$minifier = new Minify\CSS($source);
Core::Output(INFO, "Compressing " . $source);
return file_put_contents($dest, $minifier->minify());
default:
return copy($source, $dest);
}
} else {
return copy($source, $dest);
}
}
// Make destination directory
if (!is_dir($dest)) {
mkdir($dest, $folderPermissions, true);
}
// Loop through the folder
$dir = dir($source);
while (false !== ($entry = $dir->read())) {
// Skip pointers
if ($entry == '.' || $entry == '..' || in_array($entry, $ignoreFiles) || \StringHelper::MaskCheck($entry, $ignoreMasks)) {
continue;
}
// Deep copy directories
$this->ProcessSiteFolder("{$source}/{$entry}", "{$dest}/{$entry}", $folderPermissions, $filePermissions, $ignoreFiles, $ignoreMasks);
}
// Clean up
$dir->close();
return true;
}