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


PHP Output::writeln方法代码示例

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


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

示例1: analyze

 /**
  * @param array $files
  */
 public function analyze(array $files)
 {
     $this->output->writeln('Got ' . count($files) . ' files');
     $this->output->writeln('Collect entities...');
     $this->classScanner->parseFilesForClassesAndInterfaces($files);
     $this->definedEntities = $this->classScanner->getDefinedEntities();
     $this->output->writeln('Got ' . count($this->definedEntities) . ' defined entities');
     $this->output->writeln('Check namespaces...');
     $progressbar = new Progressbar($this->output, count($files));
     foreach ($files as $file) {
         $this->analyzeFile($file);
         $progressbar->step();
     }
 }
开发者ID:researchgate,项目名称:phpnsc,代码行数:17,代码来源:NamespaceDependencyChecker.php

示例2: doDump

 /**
  * Write the data out to a file
  *
  * @param string $data The data to write
  * @param Output $output
  */
 private function doDump($data, $output)
 {
     if (!is_dir($dir = dirname($this->targetPath))) {
         $output->writeln('<info>[dir+]</info> ' . $dir);
         if (false === @mkdir($dir, 0777, true)) {
             throw new \RuntimeException('Unable to create directory ' . $dir);
         }
     }
     $output->writeln('<info>[file+]</info> ' . $this->targetPath);
     if (false === @file_put_contents($this->targetPath, $data)) {
         throw new \RuntimeException('Unable to write file ' . $this->targetPath);
     }
     $output->writeln('<info>Output written into ' . $this->targetPath . '</info>');
 }
开发者ID:Edadeal,项目名称:YamlExportBundle,代码行数:20,代码来源:YamlExportCommand.php

示例3: getConfiguration

 /**
  * get configration object for migration script
  *
  * This is based on antromattr/mongodb-migartion code but extends it so we can inject
  * non local stuff centrally.
  *
  * @param string $filepath path to configuration file
  * @param Output $output   ouput interface need by config parser to do stuff
  *
  * @return AntiMattr\MongoDB\Migrations\Configuration\Configuration
  */
 private function getConfiguration($filepath, $output)
 {
     $outputWriter = new OutputWriter(function ($message) use($output) {
         return $output->writeln($message);
     });
     $info = pathinfo($filepath);
     $namespace = 'AntiMattr\\MongoDB\\Migrations\\Configuration';
     $class = $info['extension'] === 'xml' ? 'XmlConfiguration' : 'YamlConfiguration';
     $class = sprintf('%s\\%s', $namespace, $class);
     $configuration = new $class($this->documentManager->getDocumentManager()->getConnection(), $outputWriter);
     // register databsae name before loading to ensure that loading does not fail
     $configuration->setMigrationsDatabaseName($this->databaseName);
     // load additional config from migrations.(yml|xml)
     $configuration->load($filepath);
     return $configuration;
 }
开发者ID:alebon,项目名称:graviton,代码行数:27,代码来源:MongodbMigrateCommand.php


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