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


PHP CommandEvent::isDevMode方法代码示例

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


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

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

示例2: createDoctrineSchema

 /**
  * Creates the doctrine schema.
  *
  * @param CommandEvent $event
  */
 public static function createDoctrineSchema(CommandEvent $event)
 {
     if (PreInstallHandler::$firstInstall) {
         $envs = $event->isDevMode() ? ['dev', 'test'] : ['prod'];
         self::dropDoctrineSchema($event, $envs);
         foreach ($envs as $env) {
             static::executeCommand($event, static::getConsoleDir($event, 'create doctrine schema'), sprintf('doctrine:schema:create --env=%s', $env));
         }
     }
 }
开发者ID:thomasmodeneis,项目名称:Sententiaregum,代码行数:15,代码来源:ScriptHandler.php

示例3: setupDatabase

 /**
  * Sets up the shop database.
  *
  * @param CommandEvent $event CommandEvent instance
  * @throws \RuntimeException If an error occured
  */
 public static function setupDatabase(CommandEvent $event)
 {
     $options = $env = array();
     if ($event->isDevMode()) {
         $options[] = '--option=setup/default/demo:1';
     } else {
         $env[] = '--env=prod';
     }
     self::executeCommand($event, 'aimeos:setup', $options + $env);
     self::executeCommand($event, 'aimeos:cache', $env);
 }
开发者ID:gvandencruche,项目名称:aimeos-symfony,代码行数:17,代码来源:ScriptHandler.php

示例4: postInstall

 /**
  * Updates the Puli repository after Composer installations/updates.
  *
  * @param CommandEvent $event The Composer event.
  */
 public function postInstall(CommandEvent $event)
 {
     // Plugin has been uninstalled
     if (!file_exists(__FILE__)) {
         return;
     }
     if (!$this->initialized) {
         $this->initialize($event->getComposer(), $event->getIO());
     }
     // This method is called twice. Run it only once.
     if (!$this->runPostInstall) {
         return;
     }
     $this->runPostInstall = false;
     $io = $event->getIO();
     $io->write('<info>Looking for updated Puli packages</info>');
     $rootPackage = $event->getComposer()->getPackage();
     $composerPackages = $this->loadComposerPackages($event->getComposer());
     $prodPackageNames = $this->filterProdPackageNames($composerPackages, $rootPackage);
     $env = $event->isDevMode() ? PuliPackage::ENV_DEV : PuliPackage::ENV_PROD;
     try {
         $puliPackages = $this->loadPuliPackages();
     } catch (PuliRunnerException $e) {
         $this->printWarning($io, 'Could not load Puli packages', $e);
         return;
     }
     // Don't remove non-existing packages in production environment
     // Removed packages could be dev dependencies (i.e. "require-dev"
     // of the root package or "require" of another dev dependency), and
     // we can't find out whether they are since Composer doesn't load them
     if (PuliPackage::ENV_PROD !== $env) {
         $this->removeRemovedPackages($composerPackages, $puliPackages, $io);
     }
     $this->installNewPackages($composerPackages, $prodPackageNames, $puliPackages, $io, $event->getComposer());
     // Don't print warnings for non-existing packages in production
     if (PuliPackage::ENV_PROD !== $env) {
         $this->checkForNotFoundErrors($puliPackages, $io);
     }
     $this->checkForNotLoadableErrors($puliPackages, $io);
     $this->adoptComposerName($puliPackages, $io, $event->getComposer());
     $this->buildPuli($io);
 }
开发者ID:issei-m,项目名称:composer-plugin,代码行数:47,代码来源:PuliPlugin.php

示例5: onInstallOrUpdate

 /**
  * Handle an event callback for an install or update command by checking
  * for "merge-patterns" in the "extra" data and merging package contents
  * if found.
  *
  * @param CommandEvent $event
  */
 public function onInstallOrUpdate(CommandEvent $event)
 {
     $config = $this->readConfig($this->composer->getPackage());
     if (isset($config['recurse'])) {
         $this->recurse = (bool) $config['recurse'];
     }
     if ($config['include']) {
         $this->loader = new ArrayLoader();
         $this->duplicateLinks = array('require' => array(), 'require-dev' => array());
         $this->devMode = $event->isDevMode();
         $this->mergePackages($config);
     }
 }
开发者ID:Sedles,项目名称:WikiToLearn,代码行数:20,代码来源:MergePlugin.php


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