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


PHP Command::execute方法代码示例

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


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

示例1: execute

 /**
  * @param  Context $context
  * @return boolean
  **/
 public function execute(Context $context)
 {
     if ($context->getCurrentCommand() != 'begin') {
         throw new \Exception('構文が正しくありません');
     }
     if (is_null($this->next_command)) {
         throw new \Exception('次のコマンドが指定されていません');
     }
     $this->next_command->execute($context->next());
     return true;
 }
开发者ID:app2641,项目名称:DesignPatternOnPHP,代码行数:15,代码来源:JobCommand.php

示例2: testParseDefaultValueIsDefined

 /**
  * Test that the default value is overwritten when the parameter
  * 	is defined.
  */
 public function testParseDefaultValueIsDefined()
 {
     $config = ['default' => ['test' => 'testing1234']];
     $arguments = ['script-name.php', '--test=foobar'];
     $cmd = new Command();
     $result = $cmd->execute($arguments, $config);
     $this->assertEquals('foobar', $result['test']);
 }
开发者ID:Stunt,项目名称:cmd,代码行数:12,代码来源:CommandTest.php

示例3: actionEditMarkdown

 /**
  * 编辑md文件 /docx/usage/start.md
  * @param $file
  * @param $route
  * @throws Exception
  */
 public function actionEditMarkdown($file, $route)
 {
     $title = DirectoryIndex::trimFileExtension(basename($file));
     if (!is_file($file)) {
         $cmd[] = sprintf("mkdir -p %s", dirname($file));
         $cmd[] = sprintf("echo '# %s%s-------------' > %s", $title, PHP_EOL, $file);
         $command = join(" && ", $cmd);
         $ret = Command::execute($command);
     }
     $content = file_get_contents($file);
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $content = $_POST['content'];
         $ret = file_put_contents($file, $content);
         $htmlFile = static::md2HtmlFile($route);
         $url = sprintf("/%s?action=%s", $htmlFile, static::PUSH_GIT_URL);
         $this->redirect($url);
     }
     $time = time();
     $this->render(static::VIEW_EDITOR, ['timestamp' => $time, 'token' => md5($this->_config['validationKey'] . $time), 'returnUrl' => DirectoryIndex::file2Url($file), 'title' => $title, 'content' => $content]);
 }
开发者ID:CheneyWong,项目名称:walden,代码行数:26,代码来源:Bootstrap.php

示例4: runCommand

 /**
  * Run a command that will talk to the transport
  *
  * @param Command $command
  * @return mixed
  */
 protected function runCommand(Command $command)
 {
     $result = $command->execute();
     return $result;
 }
开发者ID:BobLuo,项目名称:Neo4j,代码行数:11,代码来源:Client.php

示例5: execCommand

 /**
  * Run a command that will talk to the connection
  *
  * @param Command $command
  * @return boolean
  */
 public function execCommand(Command $command)
 {
     return $command->execute($this);
 }
开发者ID:dario1985,项目名称:adodb,代码行数:10,代码来源:Connection.php

示例6: intval

    Utils::redirect('login.php');
}
$actualUrl = Utils::getActualUrl();
$room = intval($_GET['id']);
if (!$room) {
    Utils::redirect('rooms.php');
}
Room::addUser($loggedUser['id'], $room);
$gameRepository = new GameRepository();
$game = $gameRepository->getOneByRoom($room);
if ($game) {
    $GLOBALS['smarty']->assign('game', $game);
}
if ($_POST && trim($_POST['message'])) {
    if (strpos($_POST['message'], '.') === 0) {
        $commandResult = Command::execute($_POST['message'], $game);
    } else {
        Chat::addMessage(trim($_POST['message']), $room);
    }
    Room::updateUserLastActivity($loggedUser['id'], $room);
    Utils::redirect($actualUrl);
}
$messages = Chat::getMessages($room, $loggedUser['id']);
$emoticons = Emoticons::getEmoticons();
$GLOBALS['smarty']->assign('loggedUser', $loggedUser);
$GLOBALS['smarty']->assign('room', $room);
$GLOBALS['smarty']->assign('messages', $messages);
$GLOBALS['smarty']->assign('users', Room::getUsers($room));
$GLOBALS['smarty']->assign('emoticonDir', EMOTICONS_DIR);
$GLOBALS['smarty']->assign('emoticons', $emoticons);
$GLOBALS['smarty']->assign('content', $GLOBALS['smarty']->fetch('room.tpl'));
开发者ID:Tomeno,项目名称:lulcobang,代码行数:31,代码来源:room.php

示例7: storeAndExecute

 public function storeAndExecute(Command $cmd)
 {
     $this->history[] = $cmd;
     // optional
     return $cmd->execute();
 }
开发者ID:ymnl007,项目名称:designpatterns,代码行数:6,代码来源:light.php

示例8: commandAction

 /**
  *
  */
 public static function commandAction()
 {
     if ($bundles = self::getBundles()) {
         foreach ($bundles as $name => $path) {
             $command_path = $path . '/command';
             if (is_dir($command_path)) {
                 if ($dh = opendir($command_path)) {
                     while (($file = readdir($dh)) !== false) {
                         if ($file != "." && $file != ".." && preg_match("/\\.php\$/", $file)) {
                             require_once $command_path . '/' . $file;
                             $command_name = pathinfo($file, PATHINFO_FILENAME);
                             CommandController::add($command_name);
                         }
                     }
                     closedir($dh);
                 }
             }
         }
     }
     Command::execute();
 }
开发者ID:ateliee,项目名称:pmp,代码行数:24,代码来源:application.php

示例9: execute

 public function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $jwks_file = $input->getArgument('jwks_file');
     if (!file_exists($jwks_file)) {
         $output->writeln('File not found: ' . $jwks_file);
         return 1;
     }
     $set = $this->loadKeySet(file_get_contents($jwks_file));
     $table = new Table($output);
     $table->setStyle('borderless');
     $table->setHeaders(array('ID', 'Type', 'Size', 'Use', 'Ops'));
     foreach ($set->getKeys() as $key) {
         $id = $key->getKeyId();
         if (strlen($id) > 7) {
             $id = substr($id, 0, 7) . '...';
         }
         $kty = $key->getKeyType();
         if (!$key->isPublic()) {
             $kty .= '*';
         }
         $size = $key->getSize();
         $use = $key->getUse();
         if ($use == null) {
             $use = '';
         }
         $ops = $key->getOperations();
         if ($ops == null) {
             $ops = array();
         }
         $ops = implode(',', $ops);
         $table->addRow(array($id, $kty, $size, $use, $ops));
     }
     $table->render();
 }
开发者ID:kelvinmo,项目名称:simplejwt,代码行数:35,代码来源:jwkstool.php


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