當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommandEvent::getIO方法代碼示例

本文整理匯總了PHP中Composer\Script\CommandEvent::getIO方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommandEvent::getIO方法的具體用法?PHP CommandEvent::getIO怎麽用?PHP CommandEvent::getIO使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Composer\Script\CommandEvent的用法示例。


在下文中一共展示了CommandEvent::getIO方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 protected function __construct(CommandEvent $event)
 {
     $this->composerEvent = $event;
     $this->io = $this->composerEvent->getIO();
     $this->extras = $this->composerEvent->getComposer()->getPackage()->getExtra();
     $this->fs = new Filesystem();
 }
開發者ID:opencontent,項目名稱:opencontent-project-installer,代碼行數:7,代碼來源:ScriptHandler.php

示例2: postUpdateAndInstall

 /**
  * Called from composer
  *
  * @param CommandEvent $event
  * @return void
  */
 public static function postUpdateAndInstall(CommandEvent $event)
 {
     $scriptName = self::isWindowsOs() ? 'typo3cms.bat' : 'typo3cms';
     $success = self::safeCopy($scriptName, './');
     if (!$success) {
         $event->getIO()->write(sprintf(self::COPY_FAILED_MESSAGE_TITLE, $scriptName));
         $event->getIO()->write(sprintf(self::COPY_FAILED_MESSAGE, $scriptName));
     }
 }
開發者ID:raimundlandig,項目名稱:winkel.de-DEV,代碼行數:15,代碼來源:InstallerScripts.php

示例3: runCommand

 protected static function runCommand(CommandEvent $event, Tool $tool, $command)
 {
     if ($event->getIO()->isVerbose()) {
         $event->getIO()->write($command);
     }
     $process = new Process($command, getcwd(), null, null, $tool->getTimeout());
     $process->run(function ($type, $buffer) use($event) {
         if ($event->getIO()->isVerbose()) {
             $event->getIO()->write($buffer, false);
         }
     });
     return $process;
 }
開發者ID:EHLOVader,項目名稱:CodeQualityThreshold,代碼行數:13,代碼來源:ScriptHandler.php

示例4: executeCommand

 /**
  * Executes a command
  *
  * @param CommandEvent $event      Event
  * @param string       $consoleDir Console dir
  * @param string       $cmd        Command
  * @param int          $timeout    Timeout
  *
  * @return void
  */
 protected static function executeCommand(CommandEvent $event, $consoleDir, $cmd, $timeout = 300)
 {
     $php = escapeshellarg(self::getPhp(false));
     $console = escapeshellarg($consoleDir . '/console');
     if ($event->getIO()->isDecorated()) {
         $console .= ' --ansi';
     }
     $process = new Process($php . ' ' . $console . ' ' . $cmd, null, null, null, $timeout);
     $process->run(function ($type, $buffer) use($event) {
         $event->getIO()->write($buffer, false);
     });
     if (!$process->isSuccessful()) {
         throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command.', escapeshellarg($cmd)));
     }
 }
開發者ID:alebon,項目名稱:graviton,代碼行數:25,代碼來源:ScriptHandlerBase.php

示例5: executeCommand

 protected static function executeCommand(CommandEvent $event, $consoleDir, $cmd, $timeout = 300)
 {
     $php = escapeshellarg(static::getPhp(false));
     $phpArgs = implode(' ', array_map('escapeshellarg', static::getPhpArguments()));
     $console = escapeshellarg($consoleDir . '/console');
     if ($event->getIO()->isDecorated()) {
         $console .= ' --ansi';
     }
     $process = new Process($php . ($phpArgs ? ' ' . $phpArgs : '') . ' ' . $console . ' ' . $cmd, null, null, null, $timeout);
     $process->run(function ($type, $buffer) use($event) {
         $event->getIO()->write($buffer, false);
     });
     if (!$process->isSuccessful()) {
         throw new \RuntimeException(sprintf("An error occurred when executing the \"%s\" command:\n\n%s\n\n%s.", escapeshellarg($cmd), $process->getOutput(), $process->getErrorOutput()));
     }
 }
開發者ID:kissifrot,項目名稱:CrawlTrackBundle,代碼行數:16,代碼來源:ScriptHandler.php

示例6: enableInstallMode

 public static function enableInstallMode(CommandEvent $event)
 {
     if (!file_exists(SystemUtil::getInstallDoneFilePath())) {
         SystemUtil::enableInstallMode();
     }
     $event->getIO()->write('CampaignChain: Enabled install mode.');
 }
開發者ID:CampaignChain,項目名稱:core,代碼行數:7,代碼來源:ScriptHandler.php

示例7: installWelcomeText

    /**
     * Just dump welcome text on how to install eZ Platform.
     *
     * @param $event CommandEvent A instance
     */
    public static function installWelcomeText(CommandEvent $event)
    {
        $event->getIO()->write(<<<'EOT'

________________/\\\\\\\\\\\\\\\____________/\\\\\\\\\\\\\____/\\\\\\________________________________________/\\\\\_________________________________________________
 ________________\////////////\\\____________\/\\\/////////\\\_\////\\\______________________________________/\\\///__________________________________________________
  __________________________/\\\/_____________\/\\\_______\/\\\____\/\\\_______________________/\\\__________/\\\______________________________________________________
   _____/\\\\\\\\__________/\\\/_______________\/\\\\\\\\\\\\\/_____\/\\\_____/\\\\\\\\\_____/\\\\\\\\\\\__/\\\\\\\\\_______/\\\\\_____/\\/\\\\\\\_____/\\\\\__/\\\\\___
    ___/\\\/////\\\_______/\\\/_________________\/\\\/////////_______\/\\\____\////////\\\___\////\\\////__\////\\\//______/\\\///\\\__\/\\\/////\\\__/\\\///\\\\\///\\\_
     __/\\\\\\\\\\\______/\\\/___________________\/\\\________________\/\\\______/\\\\\\\\\\_____\/\\\_________\/\\\_______/\\\__\//\\\_\/\\\___\///__\/\\\_\//\\\__\/\\\_
      _\//\\///////_____/\\\/_____________________\/\\\________________\/\\\_____/\\\/////\\\_____\/\\\_/\\_____\/\\\______\//\\\__/\\\__\/\\\_________\/\\\__\/\\\__\/\\\_
       __\//\\\\\\\\\\__/\\\\\\\\\\\\\\\___________\/\\\______________/\\\\\\\\\_\//\\\\\\\\/\\____\//\\\\\______\/\\\_______\///\\\\\/___\/\\\_________\/\\\__\/\\\__\/\\\_
        ___\//////////__\///////////////____________\///______________\/////////___\////////\//______\/////_______\///__________\/////_____\///__________\///___\///___\///__


<fg=cyan>Welcome to eZ Platform!</fg=cyan>

<options=bold>You may now complete the eZ Platform installation with ezplatform:install command, example of use:</options=bold>
<comment>    $ php ezpublish/console ezplatform:install --env prod demo</comment>

<options=bold>After executing this, you can launch your browser* and get started.</options=bold>


* Assuming you have setup directory permissions and configured your web server (Apache/Nginx) correctly (see Install.md and doc/ folder in eZ Platform <root-directory>).
EOT
);
    }
開發者ID:Heyfara,項目名稱:ezpublish-kernel,代碼行數:32,代碼來源:ScriptHandler.php

示例8: installWelcomeText

    /**
     * Just dump welcome text on how to install eZ Platform.
     *
     * @param $event CommandEvent A instance
     */
    public static function installWelcomeText(CommandEvent $event)
    {
        $event->getIO()->write(<<<'EOT'

________________/\\\\\\\\\\\\\\\____________/\\\\\\\\\\\\\____/\\\\\\________________________________________/\\\\\_________________________________________________
 ________________\////////////\\\____________\/\\\/////////\\\_\////\\\______________________________________/\\\///__________________________________________________
  __________________________/\\\/_____________\/\\\_______\/\\\____\/\\\_______________________/\\\__________/\\\______________________________________________________
   _____/\\\\\\\\__________/\\\/_______________\/\\\\\\\\\\\\\/_____\/\\\_____/\\\\\\\\\_____/\\\\\\\\\\\__/\\\\\\\\\_______/\\\\\_____/\\/\\\\\\\_____/\\\\\__/\\\\\___
    ___/\\\/////\\\_______/\\\/_________________\/\\\/////////_______\/\\\____\////////\\\___\////\\\////__\////\\\//______/\\\///\\\__\/\\\/////\\\__/\\\///\\\\\///\\\_
     __/\\\\\\\\\\\______/\\\/___________________\/\\\________________\/\\\______/\\\\\\\\\\_____\/\\\_________\/\\\_______/\\\__\//\\\_\/\\\___\///__\/\\\_\//\\\__\/\\\_
      _\//\\///////_____/\\\/_____________________\/\\\________________\/\\\_____/\\\/////\\\_____\/\\\_/\\_____\/\\\______\//\\\__/\\\__\/\\\_________\/\\\__\/\\\__\/\\\_
       __\//\\\\\\\\\\__/\\\\\\\\\\\\\\\___________\/\\\______________/\\\\\\\\\_\//\\\\\\\\/\\____\//\\\\\______\/\\\_______\///\\\\\/___\/\\\_________\/\\\__\/\\\__\/\\\_
        ___\//////////__\///////////////____________\///______________\/////////___\////////\//______\/////_______\///__________\/////_____\///__________\///___\///___\///__


<fg=cyan>Welcome to eZ Platform!</fg=cyan>

<options=bold>Please read the INSTALL.md file to complete the installation.</options>

<options=bold>Assuming that your database information were correctly entered, you may install a clean database by running the install command:</options>
<comment>    $ php app/console --env=prod ezplatform:install clean</comment>

EOT
);
    }
開發者ID:Pixy,項目名稱:ezpublish-kernel,代碼行數:30,代碼來源:ScriptHandler.php

示例9: deployAssets

 public static function deployAssets(CommandEvent $event)
 {
     $io = $event->getIO();
     if (!$io->askConfirmation('Would you like to update assets? (Y/n) ', true)) {
         return false;
     }
 }
開發者ID:solve,項目名稱:admin,代碼行數:7,代碼來源:Installer.php

示例10: bootstrap

 public static function bootstrap(CommandEvent $event)
 {
     $webroot = $event->getIO()->askConfirmation('<info>Do you want your web directory to be a separate folder to root? [y/n] </info>', false);
     if ($webroot) {
         $webname = $event->getIO()->ask('<info>What do you want your public directory to be named? [default: public] </info>', 'public');
         $webname = trim($webname, '/');
         $assetDir = './' . $webname;
     } else {
         $webname = null;
         $assetDir = '.';
     }
     $generator = new BootstrapGenerator($webroot, $webname);
     $generator->create();
     $options = array_merge(self::getOptions($event), ['bolt-web-dir' => $assetDir]);
     self::installAssets($event, $options);
     $event->getIO()->write('<info>Your project has been setup</info>');
 }
開發者ID:MenZil-Team,項目名稱:bolt,代碼行數:17,代碼來源:ScriptHandler.php

示例11: executeCheck

 protected static function executeCheck(CommandEvent $event, $appDir)
 {
     $phpFinder = new PhpExecutableFinder();
     $php = escapeshellarg($phpFinder->find());
     $check = escapeshellarg($appDir . '/check.php');
     $process = new Process($php . ' ' . $check);
     $process->run(function ($type, $buffer) use($event) {
         $event->getIO()->write($buffer, false);
     });
 }
開發者ID:bajke992,項目名稱:book-app,代碼行數:10,代碼來源:ScriptHandler.php

示例12: setPermissions

 public static function setPermissions(CommandEvent $event)
 {
     if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
         $event->getIO()->write('<info>No permissions setup is required on Windows.</info>');
         return;
     }
     $event->getIO()->write('Setting up permissions.');
     try {
         self::setPermissionsSetfacl($event);
         return;
     } catch (ProcessFailedException $setfaclException) {
         $event->getIO()->write(sprintf('<error>%s</error>', $setfaclException->getMessage()));
         $event->getIO()->write('<info>Trying chmod...</info>');
     }
     try {
         self::setPermissionsChmod($event);
         return;
     } catch (ProcessFailedException $chmodException) {
         $event->getIO()->write(sprintf('<error>%s</error>', $chmodException->getMessage()));
     }
 }
開發者ID:hason,項目名稱:PermissionsHandler,代碼行數:21,代碼來源:ScriptHandler.php

示例13: replaceViews

 public static function replaceViews(CommandEvent $event)
 {
     $event->getIO()->write('Copy ReCaptcha views to app/Resource/DS/ReCaptcha/views.');
     $directory = getcwd();
     self::$fileSystem = new Filesystem();
     $directory .= '/app/Resources';
     self::makeDirIfNOtExist($directory);
     $directory .= '/DS';
     self::makeDirIfNOtExist($directory);
     $directory .= '/ReCaptcha';
     self::makeDirIfNOtExist($directory);
     $directory .= '/views';
     self::makeDirIfNOtExist($directory);
     if (self::$fileSystem->exists($directory . '/form_div_layout.html.twig')) {
         if (!$event->getIO()->askConfirmation(sprintf('form_div_layout.html.twig already exist in %s. Would you like to rewrite this file? [y/N]  ', $directory), false)) {
             return;
         }
     }
     self::$fileSystem->copy(__DIR__ . '/../Resources/views/form_div_layout.html.twig', $directory . '/form_div_layout.html.twig', true);
     $event->getIO()->write('Files creation operation completed successfully.');
 }
開發者ID:EnoahNetzach,項目名稱:ReCaptchaValidator,代碼行數:21,代碼來源:ScriptHandler.php

示例14: checkAndInstall

 /**
  * @static
  *
  * @param \Composer\Script\CommandEvent $event
  */
 public static function checkAndInstall($event)
 {
     $appDir = getcwd() . '/app';
     $resourcesPath = $appDir . '/Resources';
     if (is_dir($resourcesPath)) {
         $filesystem = new Filesystem();
         $jackrabbitDir = $resourcesPath . '/java/jackrabbit';
         $filesystem->ensureDirectoryExists($jackrabbitDir);
         if (!self::check($jackrabbitDir) && false !== ($file = self::download($event->getIO(), $jackrabbitDir))) {
             self::install($file, $appDir);
         }
     }
 }
開發者ID:Cohros,項目名稱:KnowledgeBase,代碼行數:18,代碼來源:JackrabbitInstaller.php

示例15: removeGitStuff

 public static function removeGitStuff(CommandEvent $event)
 {
     if ($event->getIO()->askConfirmation('Remove the GIT related stuff? [Y/n] ')) {
         $fs = new Filesystem();
         foreach (static::getPath() as $path) {
             $filename = $path . '/.gitkeep';
             if ($fs->exists($filename)) {
                 $fs->remove($filename);
             }
         }
         $fs->remove(static::getPath('root') . '/.git');
     }
 }
開發者ID:d4rk4ng3l,項目名稱:aom,代碼行數:13,代碼來源:InstallationHelper.php


注:本文中的Composer\Script\CommandEvent::getIO方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。