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


PHP Phing::explodeIncludePath方法代码示例

本文整理汇总了PHP中Phing::explodeIncludePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Phing::explodeIncludePath方法的具体用法?PHP Phing::explodeIncludePath怎么用?PHP Phing::explodeIncludePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phing的用法示例。


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

示例1: __import

 /**
  * Import a PHP file
  *
  * @param  string $path      Path to the PHP file
  * @param  mixed  $classpath String or object supporting __toString()
  *
  * @throws ConfigurationException
  */
 public static function __import($path, $classpath = null)
 {
     if ($classpath) {
         // Apparently casting to (string) no longer invokes __toString() automatically.
         if (is_object($classpath)) {
             $classpath = $classpath->__toString();
         }
         // classpaths are currently additive, but we also don't want to just
         // indiscriminantly prepand/append stuff to the include_path.  This means
         // we need to parse current incldue_path, and prepend any
         // specified classpath locations that are not already in the include_path.
         //
         // NOTE:  the reason why we do it this way instead of just changing include_path
         // and then changing it back, is that in many cases applications (e.g. Propel) will
         // include/require class files from within method calls.  This means that not all
         // necessary files will be included in this import() call, and hence we can't
         // change the include_path back without breaking those apps.  While this method could
         // be more expensive than switching & switching back (not sure, but maybe), it makes it
         // possible to write far less expensive run-time applications (e.g. using Propel), which is
         // really where speed matters more.
         $curr_parts = Phing::explodeIncludePath();
         $add_parts = Phing::explodeIncludePath($classpath);
         $new_parts = array_diff($add_parts, $curr_parts);
         if ($new_parts) {
             set_include_path(implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
         }
     }
     $ret = (include_once $path);
     if ($ret === false) {
         $msg = "Error importing {$path}";
         if (self::getMsgOutputLevel() >= Project::MSG_DEBUG) {
             $x = new Exception("for-path-trace-only");
             $msg .= $x->getTraceAsString();
         }
         throw new ConfigurationException($msg);
     }
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:45,代码来源:Phing.php

示例2: init

 /**
  * The init method: check if Net_FTP is available
  */
 public function init()
 {
     require_once 'PEAR.php';
     $paths = Phing::explodeIncludePath();
     foreach ($paths as $path) {
         if (file_exists($path . DIRECTORY_SEPARATOR . 'Net' . DIRECTORY_SEPARATOR . 'FTP.php')) {
             return true;
         }
     }
     throw new BuildException('The FTP Deploy task requires the Net_FTP PEAR package.');
 }
开发者ID:alangalipaud,项目名称:ProjetQCM,代码行数:14,代码来源:FtpDeployTask.php

示例3: initializePhpDocumentor

 /**
  * Finds and initializes the phpDocumentor installation
  */
 private function initializePhpDocumentor()
 {
     $phpDocumentorPath = null;
     foreach (Phing::explodeIncludePath() as $path) {
         $testPhpDocumentorPath = $path . DIRECTORY_SEPARATOR . 'phpDocumentor' . DIRECTORY_SEPARATOR . 'src';
         if (file_exists($testPhpDocumentorPath)) {
             $phpDocumentorPath = $testPhpDocumentorPath;
         }
     }
     if (empty($phpDocumentorPath)) {
         throw new BuildException("Please make sure PhpDocumentor 2 is installed and on the include_path.", $this->getLocation());
     }
     set_include_path($phpDocumentorPath . PATH_SEPARATOR . get_include_path());
     require_once $phpDocumentorPath . '/phpDocumentor/Bootstrap.php';
     \phpDocumentor\Bootstrap::createInstance()->initialize();
     $this->phpDocumentorPath = $phpDocumentorPath;
 }
开发者ID:ramonornela,项目名称:phing,代码行数:20,代码来源:PhpDocumentor2Wrapper.php

示例4: findPhpDocumentorInstall

 /**
  * Searches include_path for PhpDocumentor install and adjusts include_path appropriately.
  * @throws BuildException - if unable to find PhpDocumentor on include_path
  */
 protected function findPhpDocumentorInstall()
 {
     $found = null;
     foreach (Phing::explodeIncludePath() as $path) {
         $testpath = $path . DIRECTORY_SEPARATOR . 'PhpDocumentor';
         if (file_exists($testpath)) {
             $found = $testpath;
             break;
         }
     }
     if (!$found) {
         throw new BuildException("PhpDocumentor task depends on PhpDocumentor being installed and on include_path.", $this->getLocation());
     }
     // otherwise, adjust the include_path to path to include the PhpDocumentor directory ...
     set_include_path(get_include_path() . PATH_SEPARATOR . $found);
     include_once "phpDocumentor/Setup.inc.php";
     if (!class_exists('phpDocumentor_setup')) {
         throw new BuildException("Error including PhpDocumentor setup class file.");
     }
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:24,代码来源:PhpDocumentorTask.php

示例5: main

 /** Main entry point */
 public function main()
 {
     // Apparently casting to (string) no longer invokes __toString() automatically.
     if (is_object($this->classpath)) {
         $classpath = $this->classpath->__toString();
     }
     if (empty($classpath)) {
         throw new BuildException("Provided classpath was empty.");
     }
     $curr_parts = Phing::explodeIncludePath();
     $add_parts = Phing::explodeIncludePath($classpath);
     $new_parts = array_diff($add_parts, $curr_parts);
     if ($new_parts) {
         $this->log("Prepending new include_path components: " . implode(PATH_SEPARATOR, $new_parts), Project::MSG_VERBOSE);
         set_include_path(implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts)));
     }
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:18,代码来源:IncludePathTask.php

示例6: findPhpDocumentorPath

 /**
  * Find the correct php documentor path
  *
  * @return null|string
  */
 private function findPhpDocumentorPath()
 {
     $phpDocumentorPath = null;
     $directories = array('phpDocumentor', 'phpdocumentor');
     foreach ($directories as $directory) {
         foreach (Phing::explodeIncludePath() as $path) {
             $testPhpDocumentorPath = $path . DIRECTORY_SEPARATOR . $directory . DIRECTORY_SEPARATOR . 'src';
             if (file_exists($testPhpDocumentorPath)) {
                 $phpDocumentorPath = $testPhpDocumentorPath;
             }
         }
     }
     return $phpDocumentorPath;
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:19,代码来源:PhpDocumentor2Wrapper.php

示例7: main

 /** Main entry point */
 public function main()
 {
     // Apparently casting to (string) no longer invokes __toString() automatically.
     if (is_object($this->classpath)) {
         $classpath = $this->classpath->__toString();
     }
     if (empty($classpath)) {
         throw new BuildException("Provided classpath was empty.");
     }
     $curr_parts = Phing::explodeIncludePath();
     $add_parts = Phing::explodeIncludePath($classpath);
     $new_parts = array_diff($add_parts, $curr_parts);
     if ($new_parts) {
         $this->updateIncludePath($new_parts, $curr_parts);
     }
 }
开发者ID:xxspartan16,项目名称:BMS-Market,代码行数:17,代码来源:IncludePathTask.php

示例8: initializeDocBlox

 /**
  * Finds and initializes the DocBlox installation
  */
 private function initializeDocBlox()
 {
     $docbloxPath = null;
     foreach (Phing::explodeIncludePath() as $path) {
         $testDocBloxPath = $path . DIRECTORY_SEPARATOR . 'DocBlox' . DIRECTORY_SEPARATOR . 'src';
         if (file_exists($testDocBloxPath)) {
             $docbloxPath = $testDocBloxPath;
         }
     }
     if (empty($docbloxPath)) {
         throw new BuildException("Please make sure DocBlox is installed and on the include_path.", $this->getLocation());
     }
     set_include_path($docbloxPath . PATH_SEPARATOR . get_include_path());
     require_once $docbloxPath . '/DocBlox/Bootstrap.php';
     $bootstrap = DocBlox_Bootstrap::createInstance();
     $autoloader = $bootstrap->registerAutoloader();
     if ($this->quiet) {
         DocBlox_Core_Abstract::config()->logging->level = 'quiet';
     } else {
         DocBlox_Core_Abstract::config()->logging->level = 'debug';
     }
     $bootstrap->registerPlugins($autoloader);
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:26,代码来源:DocBloxTask.php


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