13 $files=\glob($pattern, $flags);
14 foreach ( \glob(\dirname($pattern) .
'/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir ) {
15 $files=\array_merge($files, self::glob_recursive($dir .
'/' . \basename($pattern), $flags));
21 $files=\glob($folder .
'/*');
22 foreach ( $files as $file ) {
29 if (\file_exists($filename))
30 return \unlink($filename);
36 return \mkdir($dir, 0777,
true);
43 $path=\str_replace(
"\\", DS, $path);
45 $path=\str_replace(
"/", DS, $path);
46 $path=\str_replace(DS . DS, DS, $path);
57 $path=\str_replace(
"\\", DS, $path);
59 $path=\str_replace(
"/", DS, $path);
60 $path=\str_replace(DS . DS, DS, $path);
67 $str=\file_get_contents(
$source);
68 return self::replaceFromTemplate($str, $keyAndValues);
74 if (($str=self::openReplaceInTemplateFile(
$source, $keyAndValues))) {
75 return \file_put_contents($destination, $str, LOCK_EX);
81 array_walk($keyAndValues,
function (&$item) {
83 $item=\implode(
"\n", $item);
85 $str=\str_replace(array_keys($keyAndValues), array_values($keyAndValues), $content);
90 return \file_put_contents($destination, self::replaceFromTemplate($content, $keyAndValues), LOCK_EX);
94 if (\file_exists($file)) {
102 return \filemtime($filename);
105 public static function load($filename){
106 if (\file_exists($filename)) {
107 return \file_get_contents($filename);
112 public static function save($filename,$content,$flags=LOCK_EX){
113 return \file_put_contents($filename, $content, $flags);
117 return ROOT . DS . str_replace (
"\\", DS, $ns );
$source
Project: doxygen-php-filters Author: Alex Schickedanz (AbcAeffchen) Date: 05.03.2015 License: GPL v2...
static glob_recursive($pattern, $flags=0)
static tryToRequire($file)
static cleanFilePathname($path)
static getDirFromNamespace($ns)
static cleanPathname($path)
static lastModified($filename)
static openReplaceWriteFromTemplateFile($source, $destination, $keyAndValues)
static openReplaceInTemplateFile($source, $keyAndValues)
static replaceWriteFromContent($content, $destination, $keyAndValues)
static endswith($hay, $needle)
static deleteFile($filename)
static replaceFromTemplate($content, $keyAndValues)
static deleteAllFilesFromFolder($folder)
static save($filename, $content, $flags=LOCK_EX)