本文整理汇总了PHP中Shell::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Shell::run方法的具体用法?PHP Shell::run怎么用?PHP Shell::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell::run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCount
public function testCount()
{
$gerador = new Gerador();
$vector = $gerador->gerar(500);
$shell = new Shell();
$array = Asort($vector);
$this->assertEquals($array, $shell->run($vector));
}
示例2: testRunShowModeHelp
public function testRunShowModeHelp()
{
$mode = $this->getMock('\\Migration\\Mode\\Data', [], [], '', false);
$mode->expects($this->any())->method('getUsageHelp')->willReturn('mode help');
$this->modeFactory->expects($this->once())->method('create')->with('data')->willReturn($mode);
$this->shell->setRawArgs(['data', 'help']);
ob_start();
$result = $this->shell->run();
$output = ob_get_contents();
ob_end_clean();
$this->assertSame($this->shell, $result);
$this->assertContains('Usage:', $output);
$this->assertContains('mode help', $output);
}
示例3: run
/** @var int $maxTries Max number of attempts */
$maxTries = 8;
/** @var string $parentDir */
$parentDir = DIRECTORY_SEPARATOR . '..';
/** @var string $abstract Assumed location of abstract.php */
$abstract = $parentDir . (strlen($htdocsDir) > 0 ? DIRECTORY_SEPARATOR . $htdocsDir : '') . DIRECTORY_SEPARATOR . 'shell' . DIRECTORY_SEPARATOR . 'abstract.php';
// Try one level up each time file is not found
while (!file_exists(dirname(__FILE__) . $abstract) && $tries++ < 8) {
$abstract = $parentDir . $abstract;
}
// Try to require file
require_once dirname(__FILE__) . $abstract;
}
class Shell extends Mage_Shell_Abstract
{
public function run()
{
/** @var Mage_CatalogSearch_Model_Fulltext $fulltextModel */
$fulltextModel = Mage::getModel('catalogsearch/fulltext');
/** @var string $queryText */
$queryText = 'shirt';
/** @var Mage_CatalogSearch_Model_Query $queryObject */
$queryObject = Mage::getModel('catalogsearch/query')->load(61);
/** @var St_SphinxSearch_Model_Resource_Fulltext $fulltextResource */
$fulltextResource = Mage::getResourceModel('st_sphinxsearch/fulltext');
$fulltextResource->prepareResult($fulltextModel, $queryText, $queryObject);
}
}
$shell = new Shell();
$shell->run();