當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。