本文整理汇总了PHP中fs::build_tree方法的典型用法代码示例。如果您正苦于以下问题:PHP fs::build_tree方法的具体用法?PHP fs::build_tree怎么用?PHP fs::build_tree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fs
的用法示例。
在下文中一共展示了fs::build_tree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clear_static
function clear_static()
{
if (!$this->get_domain()) {
return false;
}
$root = core::module('sat')->get_static_root($this);
$data = array();
fs::build_tree($root, $data);
foreach ($data['files'] as $f) {
fs::unlink($f);
}
$data['dirs'] = array_reverse($data['dirs']);
foreach ($data['dirs'] as $f) {
fs::unlink($f, true);
}
}
示例2: ob_implicit_flush
<?php
/**
* Runs test in concurrent queue
*
* @param chroot directory core/_tests/config
*/
use Symfony\Component\Process\Process;
require "loader.php";
ob_implicit_flush(true);
$out = array();
$sourceDir = __DIR__;
if (!empty($argv[1])) {
$sourceDir = loader::get_public('modules/' . $argv[1]);
}
fs::build_tree($sourceDir, $out, false, '\\.php$');
// убираем loader и ru-all.php
foreach ($out['files'] as $k => $v) {
if (preg_match('@(loader|run\\-all)\\.php$@', $v)) {
unset($out['files'][$k]);
}
}
// $files = array_splice($out['files'], 2);
$files = $out['files'];
test_assertions::$successed = 0;
test_assertions::$failed = 0;
test_assertions::$start_time = microtime(1);
$concurrent = 10;
$processes = [];
$file = null;
$kfile = 0;
示例3: dirname
<?php
// CONFIG
$dir_from = dirname(__FILE__);
$dir_to = 'C:/tmp/distr/moswar/htdocs/modules';
$copyright = 'http://moswar-2010.narod2.ru (moswar.2010@yandex.ru)';
// BEGIN
$data = array();
fs::build_tree($dir_from, $data);
obfuscator::head($copyright);
foreach ($data['files'] as $file) {
$to = str_replace($dir_from, $dir_to, $file);
if (substr($file, -4) == '.php') {
// obfuscate
printf("Convert %s\n", $file);
obfuscator::run($file, $to);
} else {
// just copy
printf("Copy %s\n", $file);
@mkdir(dirname($to), 0, true);
@copy($file, $to);
}
}
class obfuscator
{
private static $_IGNORED_TOKENS = array(T_COMMENT, T_DOC_COMMENT, T_WHITESPACE, T_ML_COMMENT);
private static $_head;
static function head($string)
{
self::$_head = sprintf("<?php\n/*\n%s\n*/\n?>", $string);
}