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


PHP Project::log方法代码示例

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


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

示例1: log

 /**
  * @param string $msg
  */
 public static function log($msg)
 {
     if (!self::$_project) {
         echo "{$msg}\n";
         return;
     }
     self::$_project->log($msg);
 }
开发者ID:thinkingmedia,项目名称:phing,代码行数:11,代码来源:GemsLog.php

示例2: parseFiles

 /**
  * Build a list of files (from the fileset elements)
  * and call the phpDocumentor parser
  *
  * @return string
  */
 private function parseFiles()
 {
     $parser = $this->app['parser'];
     $builder = $this->app['descriptor.builder'];
     $builder->createProjectDescriptor();
     $projectDescriptor = $builder->getProjectDescriptor();
     $projectDescriptor->setName($this->title);
     $paths = array();
     // filesets
     foreach ($this->filesets as $fs) {
         $ds = $fs->getDirectoryScanner($this->project);
         $dir = $fs->getDir($this->project);
         $srcFiles = $ds->getIncludedFiles();
         foreach ($srcFiles as $file) {
             $paths[] = $dir . FileSystem::getFileSystem()->getSeparator() . $file;
         }
     }
     $this->project->log("Will parse " . count($paths) . " file(s)", Project::MSG_VERBOSE);
     $files = new \phpDocumentor\Fileset\Collection();
     $files->addFiles($paths);
     $mapper = new \phpDocumentor\Descriptor\Cache\ProjectDescriptorMapper($this->app['descriptor.cache']);
     $mapper->garbageCollect($files);
     $mapper->populate($projectDescriptor);
     $parser->setPath($files->getProjectRoot());
     $parser->setDefaultPackageName($this->defaultPackageName);
     $parser->parse($builder, $files);
     $mapper->save($projectDescriptor);
     return $mapper;
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:35,代码来源:PhpDocumentor2Wrapper.php

示例3: run

 /**
  * Runs phpDocumentor 2 
  */
 public function run()
 {
     $this->initializePhpDocumentor();
     $cache = $this->app['descriptor.cache'];
     $cache->getOptions()->setCacheDir($this->destDir->getAbsolutePath());
     $this->parseFiles();
     $this->project->log("Transforming...", Project::MSG_VERBOSE);
     $this->transformFiles();
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:12,代码来源:PhpDocumentor2Wrapper.php

示例4: run

 /**
  * Runs phpDocumentor 2 
  */
 public function run()
 {
     $this->initializePhpDocumentor();
     $xml = $this->parseFiles();
     $this->project->log("Transforming...", Project::MSG_VERBOSE);
     $transformer = new phpDocumentor\Transformer\Transformer();
     $transformer->setTemplatesPath($this->phpDocumentorPath . '/../data/templates');
     $transformer->setTemplates($this->template);
     $transformer->setSource($xml);
     $transformer->setTarget($this->destDir->getAbsolutePath());
     $transformer->execute();
 }
开发者ID:ramonornela,项目名称:phing,代码行数:15,代码来源:PhpDocumentor2Wrapper.php

示例5: main

 /**
  * The entry point for this class. Does some checking, then processes and
  * performs the tasks for this target.
  */
 public function main()
 {
     if ($this->testIfCondition() && $this->testUnlessCondition()) {
         foreach ($this->children as $o) {
             if ($o instanceof Task) {
                 // child is a task
                 $o->perform();
             } else {
                 // child is a RuntimeConfigurable
                 $o->maybeConfigure($this->project);
             }
         }
     } elseif (!$this->testIfCondition()) {
         $this->project->log("Skipped target '" . $this->name . "' because property '" . $this->ifCondition . "' not set.", Project::MSG_VERBOSE);
     } else {
         $this->project->log("Skipped target '" . $this->name . "' because property '" . $this->unlessCondition . "' set.", Project::MSG_VERBOSE);
     }
 }
开发者ID:kcornejo,项目名称:estadistica,代码行数:22,代码来源:Target.php

示例6: parse

 /**
  *
  * @throws BuildException
  * @return array
  */
 public function parse()
 {
     $this->properties = array();
     $contents = @file_get_contents($this->file);
     if ($contents === false) {
         $message = sprintf('Could not read file [%s].', $this->file);
         throw new BuildException($message);
     }
     $lines = explode("\n", $contents);
     $count = count($lines);
     $isMultiLine = false;
     for ($i = 0; $i < $count; $i++) {
         $line = $lines[$i];
         if ($isMultiLine) {
             $isMultiLine = $this->extractContinuedValue($line);
         } else {
             $this->name = null;
             $this->value = '';
             $isMultiLine = $this->extractNameAndValue($line);
         }
         if ($this->name !== null && !$isMultiLine) {
             if (array_key_exists($this->name, $this->properties)) {
                 $message = sprintf('Property [%s] overwritten: old value [%s], new value [%s].', $this->name, $this->properties[$this->name], $this->value);
                 $this->project->log($message, Project::MSG_WARN);
             }
             // Unescape backslashes.
             $this->value = str_replace('\\\\', '\\', $this->value);
             $this->properties[$this->name] = $this->value;
         }
     }
     if ($isMultiLine) {
         $message = sprintf('Last property looks like a multi-lined value, but end of file found. Name = [%s].', $this->name);
         throw new BuildException($message);
     }
     return $this->properties;
 }
开发者ID:kenguest,项目名称:phing,代码行数:41,代码来源:SonarConfigurationFileParser.php

示例7: createElement

 /**
  * Creates a named nested element. 
  * 
  * Valid creators can be in the form createFoo() or addFoo(Bar).
  * @return object Returns the nested element.
  * @throws BuildException
  */
 function createElement(Project $project, $element, $elementName)
 {
     $addMethod = "add" . strtolower($elementName);
     $createMethod = "create" . strtolower($elementName);
     $nestedElement = null;
     if (isset($this->nestedCreators[$createMethod])) {
         $method = $this->nestedCreators[$createMethod];
         try {
             // try to invoke the creator method on object
             $project->log("    -calling creator " . $method->getDeclaringClass()->getName() . "::" . $method->getName() . "()", PROJECT_MSG_DEBUG);
             $nestedElement = $method->invoke($element);
         } catch (Exception $exc) {
             throw new BuildException($exc);
         }
     } elseif (isset($this->nestedCreators[$addMethod])) {
         $method = $this->nestedCreators[$addMethod];
         // project components must use class hints to support the add methods
         try {
             // try to invoke the adder method on object
             $project->log("    -calling adder " . $method->getDeclaringClass()->getName() . "::" . $method->getName() . "()", PROJECT_MSG_DEBUG);
             // we've already assured that correct num of params
             // exist and that method is using class hints
             $params = $method->getParameters();
             $classname = null;
             if (($hint = $params[0]->getClass()) !== null) {
                 $classname = $hint->getName();
             }
             // create a new instance of the object and add it via $addMethod
             $nestedElement = new $classname();
             $method->invoke($element, $nestedElement);
         } catch (Exception $exc) {
             throw new BuildException($exc);
         }
     } else {
         $msg = $this->getElementName($project, $element) . " doesn't support the '{$elementName}' creator/adder.";
         throw new BuildException($msg);
     }
     if ($nestedElement instanceof ProjectComponent) {
         $nestedElement->setProject($project);
     }
     return $nestedElement;
 }
开发者ID:taryono,项目名称:school,代码行数:49,代码来源:IntrospectionHelper.php

示例8: log

 /**
  * Utility function for logging
  */
 function log($level, $msg)
 {
     $this->project->log($level, $msg);
 }
开发者ID:nhemsley,项目名称:phing,代码行数:7,代码来源:TokenReader.php

示例9: storeElement

 /**
  * Creates a named nested element.
  *
  * @param  Project        $project
  * @param  string         $element
  * @param  string         $child
  * @param  string|null    $elementName
  * @return void
  * @throws BuildException
  */
 public function storeElement($project, $element, $child, $elementName = null)
 {
     if ($elementName === null) {
         return;
     }
     $storer = "addconfigured" . strtolower($elementName);
     if (isset($this->nestedStorers[$storer])) {
         $method = $this->nestedStorers[$storer];
         try {
             $project->log("    -calling storer " . $method->getDeclaringClass()->getName() . "::" . $method->getName() . "()", Project::MSG_DEBUG);
             $method->invoke($element, $child);
         } catch (Exception $exc) {
             throw new BuildException($exc);
         }
     }
 }
开发者ID:alangalipaud,项目名称:ProjetQCM,代码行数:26,代码来源:IntrospectionHelper.php

示例10: log

 /**
  * Logs a message with the given priority.
  *
  * @param string  $msg   The message to be logged.
  * @param integer $level The message's priority at this message should have
  *
  * @return void
  */
 public function log($msg, $level = Project::MSG_INFO)
 {
     if ($this->project !== null) {
         $this->project->log($msg, $level);
     }
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:14,代码来源:ProjectComponent.php


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