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


PHP Script\CommandEvent类代码示例

本文整理汇总了PHP中Composer\Script\CommandEvent的典型用法代码示例。如果您正苦于以下问题:PHP CommandEvent类的具体用法?PHP CommandEvent怎么用?PHP CommandEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: 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

示例2: __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

示例3: 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

示例4: copyBootstrapFiles

 /**
  * Checks for the twitter/bootstrap package and copys all necessary files into the specified directory.
  *
  * Where the files are copied into must be specified in the extra section in the project's `composer.json`.
  *
  * 		"extra": {
  * 			"bootstrap-public-dir": "src/Acme/MyBundle/Resources/public",
  * 			...
  * 		}
  *
  * @param CommandEvent $event
  */
 public static function copyBootstrapFiles(CommandEvent $event)
 {
     /** @var RootPackage $package */
     $package = $event->getComposer()->getPackage();
     /** @var Link[] $requires */
     $requires = $package->getRequires();
     // Show error if package was not found
     if (!in_array(self::$bootstrapPackageKey, array_keys($requires))) {
         echo PHP_EOL . "\tError: Could not find the Twitter Bootstrap package \"twitter/bootstrap\"." . PHP_EOL . PHP_EOL;
         return;
     }
     $fs = new Filesystem();
     // Check for package path
     $packagePath = static::_getPackagePath($event->getComposer());
     if (is_null($packagePath) or !$fs->exists($packagePath)) {
         echo PHP_EOL . "\tError: The twitter bootstrap package doesn't seem to be installed." . PHP_EOL . PHP_EOL;
         return;
     }
     $bootstrapPath = $packagePath . '/dist/';
     // Check the public path where it should be copied to
     $extra = $package->getExtra();
     if (!isset($extra['bootstrap-public-dir']) or !$fs->exists($extra['bootstrap-public-dir'])) {
         echo PHP_EOL . "\tError: Given bootstrap public directory doesn't exist: " . $extra['bootstrap-public-dir'] . PHP_EOL . PHP_EOL;
         return;
     }
     $bootstrapPublicPath = $extra['bootstrap-public-dir'];
     echo sprintf('Installing twitter bootstrap files into %s%s', $bootstrapPublicPath, PHP_EOL);
     $files = array('js/bootstrap.js', 'js/bootstrap.min.js', 'fonts/glyphicons-halflings-regular.eot', 'fonts/glyphicons-halflings-regular.svg', 'fonts/glyphicons-halflings-regular.ttf', 'fonts/glyphicons-halflings-regular.woff');
     foreach ($files as $file) {
         $fs->copy($bootstrapPath . $file, $bootstrapPublicPath . '/' . $file, true);
     }
 }
开发者ID:holloway87,项目名称:hw-basics-bundle,代码行数:44,代码来源:ScriptHandler.php

示例5: getOptions

 protected static function getOptions(CommandEvent $event)
 {
     $options = array_merge(array('symfony-app-dir' => 'app', 'symfony-web-dir' => 'web', 'symfony-assets-install' => 'hard'), $event->getComposer()->getPackage()->getExtra());
     $options['symfony-assets-install'] = getenv('SYMFONY_ASSETS_INSTALL') ?: $options['symfony-assets-install'];
     $options['process-timeout'] = $event->getComposer()->getConfig()->get('process-timeout');
     return $options;
 }
开发者ID:jmsteinmetz,项目名称:Dime,代码行数:7,代码来源:ScriptHandler.php

示例6: exec

 public static function exec(CommandEvent $event)
 {
     $composer = $event->getComposer();
     $installManager = $composer->getInstallationManager();
     $repoManager = $composer->getRepositoryManager();
     $packages = $repoManager->getLocalRepository()->getPackages();
     foreach ($packages as $package) {
         $path = $installManager->getInstallPath($package);
         $extra = $package->getExtra();
         if (array_key_exists('clean', $extra)) {
             // we have things to remove, try to take them out
             foreach ($extra['clean'] as $remove) {
                 $resolvePath = realpath($path . '/' . $remove);
                 if ($resolvePath !== false) {
                     if (is_dir($resolvePath)) {
                         self::unlinkDirectory($resolvePath);
                         // rmdir($resolvePath);
                     } elseif (is_file($resolvePath)) {
                         // unlink($resolvePath);
                         self::unlinkFile($resolvePath);
                     }
                 }
             }
         }
     }
 }
开发者ID:enygma,项目名称:composerclean,代码行数:26,代码来源:Clean.php

示例7: 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

示例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: onPostInstallCMD

 /**
  * Listener to the POST_INSTALL_CMD, POST_UPDATE_CMD and POST_CREATE_PROJECT_CMD events
  * It contains the code that launch the execution of the finalize precedures
  *
  * @param  \Composer\Script\CommandEvent $event Event to handle
  *
  */
 public function onPostInstallCMD(CommandEvent $event)
 {
     $packages = $event->getComposer()->getRepositoryManager()->getLocalRepository()->getPackages();
     foreach ($packages as $package) {
         $this->onEventHandler($package, "finalize");
     }
     $this->doRetry();
 }
开发者ID:comodojo,项目名称:composer-events-handler,代码行数:15,代码来源:EventsListener.php

示例10: getConfigs

 protected static function getConfigs(CommandEvent $event)
 {
     $extras = array_merge(array('app-version-key' => 'version_number'), $event->getComposer()->getPackage()->getExtra());
     if (!isset($extras['incenteev-parameters'])) {
         throw new \InvalidArgumentException('The parameter handler needs to be configured through the extra.incenteev-parameters setting.');
     }
     $configs = $extras['incenteev-parameters'];
     return $configs;
 }
开发者ID:hkmshb,项目名称:OpitHrm,代码行数:9,代码来源:ScriptHandler.php

示例11: 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

示例12: postUpdateAndInstall

 /**
  * Post composer install or update tasks
  *
  * @param \Composer\Script\CommandEvent $event
  */
 public static function postUpdateAndInstall(CommandEvent $event)
 {
     $options = array();
     if ($event->isDevMode()) {
         $options['options'] = 'setup/default/demo:1';
     }
     \TYPO3\Flow\Core\Booting\Scripts::executeCommand('aimeos.shop:aimeos:setup', array(), true, $options);
     \TYPO3\Flow\Core\Booting\Scripts::executeCommand('aimeos.shop:aimeos:cache', array());
 }
开发者ID:nos3,项目名称:aimeos-flow,代码行数:14,代码来源:InstallerScripts.php

示例13: buildPathFromBase

 /**
  * Build a directory path starting on the project base
  *
  * @param CommandEvent $event
  * @param string       $directory
  */
 private static function buildPathFromBase(CommandEvent $event, $directory)
 {
     /** @var Package $package */
     $package = $event->getComposer()->getPackage();
     $extra = $package->getExtra();
     // Generate the complete path.
     $basePath = getcwd();
     $path = array_key_exists($directory, $extra) ? $extra[$directory] : self::$options[$directory];
     $completePath = sprintf('%s/%s', $basePath, $path);
     // Set values.
     self::$options[self::CONSOLE_APPLICATION_BASE_DIR] = $basePath;
     self::$options[$directory] = $completePath;
 }
开发者ID:ebidtech,项目名称:console-application,代码行数:19,代码来源:ScriptHandler.php

示例14: 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

示例15: spacingParametersYml

 private static function spacingParametersYml(CommandEvent $event)
 {
     if (!file_exists($file = 'vendor/incenteev/composer-parameter-handler/Processor.php')) {
         return;
     }
     $content = file_get_contents($file);
     $matches = 0;
     $content = str_replace('Yaml::dump($actualValues, 99)', 'Yaml::dump($actualValues, 99, 2)', $content, $matches);
     if ($matches) {
         file_put_contents($file, $content, LOCK_EX);
         $event->getIO()->write('Updated spacing for incenteev parameters');
     }
 }
开发者ID:TomasJancauskas,项目名称:HR,代码行数:13,代码来源:Composer.php


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