当前位置: 首页>>代码示例>>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;未经允许,请勿转载。