• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Script\CommandEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


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


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


示例18: executeCommand

 protected static function executeCommand(CommandEvent $event, $appDir, $cmd, $timeout = 300)
 {
     $php = escapeshellarg(self::getPhp());
     $console = escapeshellarg($appDir . '/console');
     if ($event->getIO()->isDecorated()) {
         $console .= ' --ansi';
     }
     $process = new Process($php . ' ' . $console . ' ' . $cmd, null, null, null, $timeout);
     $process->run(function ($type, $buffer) {
         echo $buffer;
     });
     if (!$process->isSuccessful()) {
         throw new \RuntimeException(sprintf('An error occurred when executing the "%s" command.', escapeshellarg($cmd)));
     }
 }
开发者ID:ulakjira,项目名称:ojs,代码行数:15,代码来源:InstallCommand.php


示例19: setPermissions

 public static function setPermissions(CommandEvent $event)
 {
     $event->getIO()->write('Setting up permissions.');
     try {
         self::setPermissionsSetfacl($event);
         return;
     } catch (ProcessFailedException $setfaclException) {
     }
     try {
         self::setPermissionsChmod($event);
         return;
     } catch (ProcessFailedException $chmodException) {
     }
     throw $setfaclException;
 }
开发者ID:borNfreee,项目名称:PermissionsHandler,代码行数:15,代码来源:ScriptHandler.php


示例20: deleteCache

 public static function deleteCache(CommandEvent $event)
 {
     $options = array_merge(array('symfony-app-dir' => 'app'), $event->getComposer()->getPackage()->getExtra());
     $cacheDir = $options['symfony-app-dir'] . '/cache';
     $event->getIO()->write('Clearing the cache...');
     static::removeContentFrom($cacheDir);
 }
开发者ID:ngydat,项目名称:CoreBundle,代码行数:7,代码来源:Refresher.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Script\Event类代码示例发布时间:2022-05-23
下一篇:
PHP Repository\RepositoryManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap