当前位置: 首页>>代码示例>>PHP>>正文


PHP ezcBaseFile类代码示例

本文整理汇总了PHP中ezcBaseFile的典型用法代码示例。如果您正苦于以下问题:PHP ezcBaseFile类的具体用法?PHP ezcBaseFile怎么用?PHP ezcBaseFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ezcBaseFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testStatsEmptyArray

 public function testStatsEmptyArray()
 {
     $expected = array(0 => 'vendor/zetacomponents/unit-test/design/class_diagram.png');
     $stats = array();
     self::assertEquals($expected, ezcBaseFile::findRecursive("vendor/zetacomponents/unit-test", array('@/design/@'), array('@\\.svn@'), $stats));
     self::assertEquals(array('size' => 166066, 'count' => 1), $stats);
 }
开发者ID:corcre,项目名称:elabftw,代码行数:7,代码来源:file_find_recursive_test.php

示例2: getModuleList

 public static function getModuleList()
 {
     $ModulesDir = 'modules';
     $ModuleList = array();
     $dirSeparator = DIRECTORY_SEPARATOR;
     $Modules = ezcBaseFile::findRecursive($ModulesDir, array('@module.php@'));
     foreach ($Modules as $ModuleInclude) {
         include $ModuleInclude;
         $ModuleList[str_replace("modules{$dirSeparator}", '', dirname($ModuleInclude))] = array('name' => erTranslationClassLhTranslation::getInstance()->getTranslation('permission/editrole', $Module['name']));
     }
     // Add extensions modules
     $cfg = erConfigClassLhConfig::getInstance();
     $extensions = $cfg->getSetting('site', 'extensions');
     foreach ($extensions as $extension) {
         if (is_dir("extension/{$extension}/{$ModulesDir}")) {
             $Modules = ezcBaseFile::findRecursive("extension/{$extension}/{$ModulesDir}", array('@module.php@'));
             foreach ($Modules as $ModuleInclude) {
                 include $ModuleInclude;
                 if (isset($ModuleList[str_replace("extension/{$extension}/{$ModulesDir}{$dirSeparator}", '', dirname($ModuleInclude))]['name'])) {
                     $ModuleList[str_replace("extension/{$extension}/{$ModulesDir}{$dirSeparator}", '', dirname($ModuleInclude))]['name'] .= ', EX - ' . erTranslationClassLhTranslation::getInstance()->getTranslation('permission/editrole', $Module['name']);
                 } else {
                     $ModuleList[str_replace("extension/{$extension}/{$ModulesDir}{$dirSeparator}", '', dirname($ModuleInclude))] = array('name' => erTranslationClassLhTranslation::getInstance()->getTranslation('permission/editrole', $Module['name']));
                 }
             }
         }
     }
     return $ModuleList;
 }
开发者ID:AaronLuo3296,项目名称:livehelperchat,代码行数:28,代码来源:lhmodules.php

示例3: appendRecursive

function appendRecursive($archive, $sourceDir, $prefix)
{
    $context = new ArchiveContext();
    $context->archive = $archive;
    $context->prefix = $prefix;
    ezcBaseFile::walkRecursive($sourceDir, array(), array(), 'findRecursiveCallback', $context);
}
开发者ID:alex-fang,项目名称:Archive,代码行数:7,代码来源:tutorial_recursive.php

示例4: expireCache

 public function expireCache()
 {
     if (isset($_SESSION['lhc_chat_config'])) {
         unset($_SESSION['lhc_chat_config']);
     }
     if ($this->expiredInRuntime == false) {
         $this->expiredInRuntime = true;
         foreach ($this->expireOptions as $option) {
             $this->setSetting('cachetimestamps', $option, 0);
         }
         foreach ($this->sessionExpireOptions as $option) {
             if (isset($_SESSION[$option])) {
                 unset($_SESSION[$option]);
             }
         }
         $compiledModules = ezcBaseFile::findRecursive('cache/cacheconfig', array('@\\.cache\\.php@'));
         foreach ($compiledModules as $compiledClass) {
             unlink($compiledClass);
         }
         $compiledTemplates = ezcBaseFile::findRecursive('cache/compiledtemplates', array('@(\\.php|\\.js|\\.css)@'));
         foreach ($compiledTemplates as $compiledTemplate) {
             unlink($compiledTemplate);
         }
         $instance = CSCacheAPC::getMem();
         $instance->increaseImageManipulationCache();
         $this->save();
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:28,代码来源:lhcacheconfig.php

示例5: testStatsEmptyArray

 public function testStatsEmptyArray()
 {
     $expected = array(0 => 'File/design/class_diagram.png', 1 => 'File/design/design.txt', 2 => 'File/design/file.xml', 3 => 'File/design/file_operations.png', 4 => 'File/design/md5.png', 5 => 'File/design/requirements.txt');
     $stats = array();
     self::assertEquals($expected, ezcBaseFile::findRecursive("File", array('@/design/@'), array('@\\.svn@'), $stats));
     self::assertEquals(array('size' => 114282, 'count' => 6), $stats);
 }
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:7,代码来源:file_find_recursive_test.php

示例6: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $arr = \ezcBaseFile::findRecursive(SYSPATH . "/app/Api", array('@.*.php$@'));
     $apiHandler = new \Api\ApiHandler();
     $result = array();
     foreach ($arr as $file) {
         $method = basename($file, ".php");
         $class = $apiHandler->getClass($method);
         $rc = new \ReflectionClass($class);
         $txt = $rc->getDocComment();
         preg_match("|/\\*\\*\\s*( \\* [^-][^\n]+\n)+|i", $txt, $m);
         $txt = preg_replace(array("|/\\*\\*\n \\* |", "#\n ?\\* #"), array("", " "), $m[0]);
         $txt = trim($txt);
         $result[$method] = array($class, $txt);
     }
     $output->writeln("<comment>Список методов:</comment>");
     foreach ($result as $k => $v) {
         list($base) = explode(".", $k);
         if ($_base != $base) {
             $output->writeln("<comment>{$base}</comment>");
         }
         $_base = $base;
         $output->writeln(sprintf("  <info>%-24s</info> %s", $k, $v[1]));
     }
 }
开发者ID:fobiaweb,项目名称:api,代码行数:25,代码来源:ApiSearchCommand.php

示例7: testNonExistingDirectory

 public function testNonExistingDirectory()
 {
     $expected = array();
     try {
         ezcBaseFile::findRecursive("NotHere", array('@xxx@'));
     } catch (ezcBaseFileNotFoundException $e) {
         self::assertEquals("The directory file 'NotHere' could not be found.", $e->getMessage());
     }
 }
开发者ID:mediasadc,项目名称:alba,代码行数:9,代码来源:file_find_recursive_test.php

示例8: process

 /**
  * Processes the template with the variables added by the send() method.
  * The result of this action should be retrievable through the getResult() method.
  *
  * The $last parameter is set if the view handler is the last one in the
  * list of zones for a specific view.
  *
  * @param bool $last
  */
 public function process($last)
 {
     if (!file_exists($this->templateLocation)) {
         $fileName = ezcBaseFile::isAbsolutePath($this->templateLocation) ? $this->templateLocation : getcwd() . DIRECTORY_SEPARATOR . $this->templateLocation;
         throw new ezcBaseFileNotFoundException($fileName, 'php template');
     }
     ob_start();
     include $this->templateLocation;
     $this->result = ob_get_contents();
     ob_end_clean();
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:20,代码来源:php.php

示例9: testRelative3

 public function testRelative3()
 {
     $result = ezcBaseFile::calculateRelativePath('/foo/1/2/php.php', '/foo/bar');
     self::assertEquals('..' . DIRECTORY_SEPARATOR . '1' . DIRECTORY_SEPARATOR . '2' . DIRECTORY_SEPARATOR . 'php.php', $result);
     $result = ezcBaseFile::calculateRelativePath('/foo/bar/php.php', '/foo/bar');
     self::assertEquals('php.php', $result);
     $result = ezcBaseFile::calculateRelativePath('/php.php', '/foo/bar/1/2');
     self::assertEquals('..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'php.php', $result);
     $result = ezcBaseFile::calculateRelativePath('/bar/php.php', '/foo/bar/1/2');
     self::assertEquals('..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'bar' . DIRECTORY_SEPARATOR . 'php.php', $result);
 }
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:11,代码来源:file_calculate_relative_path_test.php

示例10: findRecursive

 public static function findRecursive($sourceDir, array $includeFilters = array(), array $excludeFilters = array())
 {
     // create the context, and then start walking over the array
     $context = new ezcBaseFileFindContext();
     ezcBaseFile::walkRecursive($sourceDir, $includeFilters, $excludeFilters, array('myProgressFinder', 'findRecursiveCallback'), $context);
     // collect the statistics (which we don't do anything with in this example)
     $statistics['size'] = $context->size;
     $statistics['count'] = $context->count;
     // return the found and pattern-matched files
     sort($context->elements);
     return $context->elements;
 }
开发者ID:corcre,项目名称:elabftw,代码行数:12,代码来源:tutorial_example_04.php

示例11: setUp

 public function setUp()
 {
     try {
         if (file_exists('/tmp/lucene')) {
             ezcBaseFile::removeRecursive('/tmp/lucene');
         }
         mkdir('/tmp/lucene');
         $this->backend = new ezcSearchZendLuceneHandler("/tmp/lucene");
     } catch (ezcSearchCanNotConnectException $e) {
         self::markTestSkipped('Couldn\'t open Zend Lucene.');
     }
     $this->testFilesDir = dirname(__FILE__) . '/../testfiles/';
 }
开发者ID:jacomyma,项目名称:GEXF-Atlas,代码行数:13,代码来源:zend_lucene_test.php

示例12: getFile

 /**
  * Check and return file
  *
  * Check for the files location, and return the absolute path to the file,
  * or thorw an exception, if the file could not be found.
  * 
  * @param string $file 
  * @return string
  */
 protected function getFile($file)
 {
     if (!ezcBaseFile::isAbsolutePath($file)) {
         // If path to file is not an absolute path, use the given relative
         // path relative to the currently processed document location.
         $file = $this->path . $file;
     }
     // @TODO: docutils performs automatic checks, that no system files
     // (like /etc/passwd) are included - do we want to do similar stuff
     // here?
     // Throw an exception, if we cannot find the referenced file
     if (!is_file($file) || !is_readable($file)) {
         throw new ezcBaseFileNotFoundException($file);
     }
     return $file;
 }
开发者ID:jackalope,项目名称:jr_cr_demo,代码行数:25,代码来源:include.php

示例13: setUp

 protected function setUp()
 {
     // truncates the ezsi_file table
     $db = eZDB::instance();
     $sql = 'TRUNCATE TABLE ' . self::SI_BLOCK_TABLE_NAME;
     if (!$db->query($sql)) {
         return false;
     }
     // removes files in the si-block directory
     if (is_dir(realpath(self::SI_BLOCK_STORAGE_DIR))) {
         try {
             ezcBaseFile::removeRecursive(self::SI_BLOCK_STORAGE_DIR);
         } catch (Exception $e) {
             echo 'Got Exception message : ' . $e->getMessage() . "\n";
             return false;
         }
     }
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:18,代码来源:ezsiblockfunction_test.php

示例14: clearStaticCache

 /**
  * Clears all static cache for a site
  * Removers all static cache, but not the static cache directory itself.
  *
  * Currently, this function only supports 'combined_host_url'
  *
  */
 static function clearStaticCache()
 {
     $ini = eZINI::instance('staticcache.ini');
     $storageDir = $ini->variable('CacheSettings', 'StaticStorageDir');
     // Check that we have combined_host_url hostmatching
     $siteIni = eZINI::instance();
     $matchType = $siteIni->variable('SiteAccessSettings', 'MatchOrder');
     if ($matchType !== 'combined_host_url') {
         throw new Exception('combined_host_url required for this workflow');
     }
     global $eZCurrentAccess;
     $siteAccess = $eZCurrentAccess['name'];
     //Get hostname part from siteaccess name (exclude for instance _eng or _admin)
     if (strpos($siteAccess, '_') === false) {
         $hostName = $siteAccess;
     } else {
         $hostName = substr($siteAccess, 0, strpos($siteAccess, '_'));
     }
     $staticCacheDir = eZDir::path(array($storageDir, $hostName));
     // Sanity checking, make sure we don't remove everyones static cache.
     if ($staticCacheDir == $storageDir) {
         throw new Exception("Failed to find correct static cache directory : {$staticCacheDir} \n");
     }
     $dirs = scandir($staticCacheDir);
     foreach ($dirs as $dir) {
         if ($dir !== '.' && $dir !== '..') {
             $fullPath = eZDir::path(array($staticCacheDir, $dir));
             if (is_dir($fullPath)) {
                 ezcBaseFile::removeRecursive($fullPath);
             } else {
                 if (!unlink($fullPath)) {
                     throw new ezsfFileCouldNotRemoveException($fullPath);
                 }
             }
         }
     }
 }
开发者ID:netbliss,项目名称:ezstyleeditor,代码行数:44,代码来源:ezstaticcacheoperations.php

示例15: testAbsoluteStreamWrapper

 public static function testAbsoluteStreamWrapper()
 {
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('phar://test.phar/foo'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('http://example.com/file'));
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:5,代码来源:file_is_absolute_path.php


注:本文中的ezcBaseFile类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。