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


PHP Console::write方法代码示例

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


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

示例1: _showError

 protected function _showError($message, $exit = true, $exitCode = 99)
 {
     $this->console->write('ERROR: ', ColorInterface::LIGHT_RED);
     $this->_showLine($message);
     if ($exit) {
         $this->_exit($exitCode);
     }
 }
开发者ID:ivan-novakov,项目名称:php-perun-api,代码行数:8,代码来源:perun-client.php

示例2: save

 /**
  * Save an XML file to the Solr index using the specified configuration.
  *
  * @param string $xmlFile    XML file to transform.
  * @param string $properties Properties file.
  * @param string $index      Solr index to use.
  * @param bool   $testMode   Are we in test-only mode?
  *
  * @throws \Exception
  * @return void
  */
 public function save($xmlFile, $properties, $index = 'Solr', $testMode = false)
 {
     // Process the file:
     $xml = $this->generateXML($xmlFile, $properties);
     // Save the results (or just display them, if in test mode):
     if (!$testMode) {
         $solr = $this->getServiceLocator()->get('VuFind\\Solr\\Writer');
         $solr->save($index, new RawXMLDocument($xml));
     } else {
         Console::write($xml . "\n");
     }
 }
开发者ID:tillk,项目名称:vufind,代码行数:23,代码来源:Importer.php

示例3: save

 /**
  * Save an XML file to the Solr index using the specified configuration.
  *
  * @param string $xmlFile    XML file to transform.
  * @param string $properties Properties file.
  * @param string $index      Solr index to use.
  * @param bool   $testMode   Are we in test-only mode?
  *
  * @throws \Exception
  * @return void
  */
 public function save($xmlFile, $properties, $index = 'Solr', $testMode = false)
 {
     // Process the file:
     $xml = $this->generateXML($xmlFile, $properties);
     // Save the results (or just display them, if in test mode):
     if (!$testMode) {
         $solr = ConnectionManager::connectToIndex($index);
         $result = $solr->saveRecord($xml);
     } else {
         Console::write($xml . "\n");
     }
 }
开发者ID:no-reply,项目名称:cbpl-vufind,代码行数:23,代码来源:Importer.php

示例4: write

 /**
  * Write a string to the Console.
  *
  * @param string $str String to write.
  *
  * @return void
  */
 protected function write($str)
 {
     // Bypass output when testing:
     if (defined('VUFIND_PHPUNIT_RUNNING')) {
         return;
     }
     Console::write($str);
 }
开发者ID:guenterh,项目名称:vufind,代码行数:15,代码来源:OAI.php

示例5: loadSetNames

 /**
  * Load set list from the server.
  *
  * @return void
  */
 protected function loadSetNames()
 {
     Console::write("Loading set list... ");
     // On the first pass through the following loop, we want to get the
     // first page of sets without using a resumption token:
     $params = array();
     // Grab set information until we have it all (at which point we will
     // break out of this otherwise-infinite loop):
     while (true) {
         // Process current page of results:
         $response = $this->sendRequest('ListSets', $params);
         if (isset($response->ListSets->set)) {
             foreach ($response->ListSets->set as $current) {
                 $spec = (string) $current->setSpec;
                 $name = (string) $current->setName;
                 if (!empty($spec)) {
                     $this->setNames[$spec] = $name;
                 }
             }
         }
         // Is there a resumption token?  If so, continue looping; if not,
         // we're done!
         if (isset($response->ListSets->resumptionToken) && !empty($response->ListSets->resumptionToken)) {
             $params['resumptionToken'] = (string) $response->ListSets->resumptionToken;
         } else {
             Console::writeLine("found " . count($this->setNames));
             return;
         }
     }
 }
开发者ID:no-reply,项目名称:cbpl-vufind,代码行数:35,代码来源:OAI.php

示例6: mergemarcAction

 /**
  * Merge harvested MARC records into a single <collection>
  *
  * @return \Zend\Console\Response
  * @author Thomas Schwaerzler <thomas.schwaerzler@uibk.ac.at>
  */
 public function mergemarcAction()
 {
     $this->checkLocalSetting();
     $argv = $this->consoleOpts->getRemainingArgs();
     $dir = isset($argv[0]) ? rtrim($argv[0], '/') : '';
     if (empty($dir)) {
         $scriptName = $this->getRequest()->getScriptName();
         Console::writeLine('Merge MARC XML files into a single <collection>;');
         Console::writeLine('writes to stdout.');
         Console::writeLine('');
         Console::writeLine('Usage: ' . $scriptName . ' <path_to_directory>');
         Console::writeLine('<path_to_directory>: a directory containing MARC XML files to merge');
         return $this->getFailureResponse();
     }
     if (!($handle = opendir($dir))) {
         Console::writeLine("Cannot open directory: {$dir}");
         return $this->getFailureResponse();
     }
     Console::writeLine('<collection>');
     while (false !== ($file = readdir($handle))) {
         // Only operate on XML files:
         if (pathinfo($file, PATHINFO_EXTENSION) === "xml") {
             // get file content
             $filePath = $dir . '/' . $file;
             $fileContent = file_get_contents($filePath);
             // output content:
             Console::writeLine("<!-- {$filePath} -->");
             Console::write($fileContent);
         }
     }
     Console::writeLine('</collection>');
 }
开发者ID:bbeckman,项目名称:NDL-VuFind2,代码行数:38,代码来源:HarvestController.php


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