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


PHP LibraryInstaller::__construct方法代码示例

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


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

示例1: __construct

 /**
  * Initializes library installer.
  *
  * @param IOInterface $io The input/output handler
  * @param Composer $composer The composer instance being run
  * @param string $type The type
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library')
 {
     parent::__construct($io, $composer, $type);
     //
     // We can now parse our 'extra' configuration key for all our related information.
     //
     $extra = $this->composer->getPackage()->getExtra();
     $this->mapFile = getcwd() . DIRECTORY_SEPARATOR . self::NAME . '.map';
     $this->framework = $composer->getPackage()->getName();
     $this->integrity = 'medium';
     if (isset($extra[self::NAME]['options'])) {
         $options = $extra[self::NAME]['options'];
         $this->externalMapping = isset($options['external-mapping']) ? (bool) $options['external-mapping'] : FALSE;
         if (isset($options['framework'])) {
             $this->framework = $options['framework'];
             //
             // Previous versions were noted as enabled if they set a framework.  This will
             // re-establish that, but will get overloaded later if enabled is explicitly set.
             //
             $this->enabled = TRUE;
         }
         if (isset($options['integrity'])) {
             $options['integrity'] = strtolower($options['integrity']);
             $valid_levels = array('low', 'medium', 'high');
             $this->integrity = in_array($options['integrity'], $valid_levels) ? $options['integrity'] : 'medium';
         }
     }
     if (isset($extra[self::NAME]['enabled'])) {
         $this->enabled = $extra[self::NAME]['enabled'];
     }
 }
开发者ID:imarc,项目名称:opus,代码行数:38,代码来源:Processor.php

示例2:

 function __construct(IOInterface $io, Composer $composer, array $installInfo)
 {
     // fill in install info defaults
     $installInfo += ['wordpress-path' => false, 'wp-content-path' => false, 'wpmu-plugin-dir' => false, 'path-mapping' => [], 'symlink-wp-content' => true, 'mu-plugin-autoloader' => true, 'dev-first' => false];
     // wp content path - either set or default
     $wpContent = $installInfo['wp-content-path'] ?: self::wp_content;
     // default paths for plugins and themes
     $installInfo['default-paths'] = ['wordpress-plugin' => "{$wpContent}/plugins", 'wordpress-muplugin' => "{$wpContent}/mu-plugins", 'wordpress-theme' => "{$wpContent}/themes"];
     // if the wp-content path was explicitly set, add to the path mapping for plugins/themes
     if ($installInfo['wp-content-path']) {
         $installInfo['path-mapping'] += $installInfo['default-paths'];
     } else {
         // set the default wp-content path for mapping and symlinking
         $installInfo['wp-content-path'] = $wpContent;
     }
     // add a mapping for core if wordpress path is set
     if ($installInfo['wordpress-path']) {
         $installInfo['path-mapping']['wordpress-core'] = $installInfo['wordpress-path'];
     } else {
         $installInfo['wordpress-path'] = $installInfo['default-paths']['wordpress-core'] = self::wordpress;
     }
     // wpmu-plugin-dir supersedes the default wp-content based path
     if ($installInfo['wpmu-plugin-dir']) {
         $installInfo['path-mapping']['wordpress-muplugin'] = $installInfo['wpmu-plugin-dir'];
     } else {
         $installInfo['wpmu-plugin-dir'] = $installInfo['default-paths']['wordpress-muplugin'];
     }
     $this->installInfo = $installInfo;
     parent::__construct($io, $composer);
 }
开发者ID:balbuf,项目名称:composer-wp,代码行数:30,代码来源:WordPressInstaller.php

示例3: __construct

 public function __construct(IOInterface $io, Composer $composer, $type = null)
 {
     if ($composer->getConfig()->has('composer-global-installer')) {
         $this->_isInUse = true;
         $this->_config = $composer->getConfig()->get('composer-global-installer');
         if (isset($this->_config['vendor-global-dir'])) {
             $this->_globalDir = $this->_config['vendor-global-dir'];
         }
         if (isset($this->_config['vendor-global-types'])) {
             // Bad format, use default
             // @todo throw exception
             if (is_array($this->_config['vendor-global-types'])) {
                 $this->_supportedTypes = $this->_config['vendor-global-types'];
             }
         }
         if ($composer->getConfig()->has('vendor-global-packages')) {
             // Bad format, use default
             // @todo throw exception
             if (is_array($composer->getConfig()->get('vendor-global-packages'))) {
                 $this->_globalPackages = $composer->getConfig()->get('vendor-global-packages');
             }
         }
     }
     parent::__construct($io, $composer, $type);
 }
开发者ID:itscaro,项目名称:composer-global-installer,代码行数:25,代码来源:GlobalInstaller.php

示例4: __construct

 public function __construct(IOInterface $io, Composer $composer, array $compound_generators, EmptyGenerator $empty_generator, ReflectionGenerator $reflection_generator)
 {
     parent::__construct($io, $composer);
     $this->compound_generators = $compound_generators;
     $this->empty_generator = $empty_generator;
     $this->reflection_generator = $reflection_generator;
 }
开发者ID:hostnet,项目名称:entity-plugin-lib,代码行数:7,代码来源:Installer.php

示例5: __construct

 /**
  * @param IOInterface $io
  * @param Composer    $composer
  * @param string      $type
  * @param Filesystem  $filesystem
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null)
 {
     parent::__construct($io, $composer, $type, $filesystem);
     if ($extra = $this->composer->getPackage()->getExtra()) {
         $this->paths = isset($extra['courier-paths']) ? $extra['courier-paths'] : array();
     }
 }
开发者ID:akimsko,项目名称:courier,代码行数:13,代码来源:Installer.php

示例6: __construct

 /**
  * {@inheritDoc}
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null)
 {
     parent::__construct($io, $composer, $type, $filesystem);
     $this->loadCommandList();
     // TODO: Build this list correctly
     $this->packages['firehed/plow'] = ['classes' => ['Firehed\\Plow\\Plow'], 'version' => 'dev-lol'];
 }
开发者ID:firehed,项目名称:plow,代码行数:10,代码来源:CommandInstaller.php

示例7: __construct

 /**
  * @param IOInterface                  $io
  * @param Composer                     $composer
  * @param SymlinkFilesystem            $filesystem
  * @param PackageDataManagerInterface  $dataManager
  * @param SharedPackageInstallerConfig $config
  */
 public function __construct(IOInterface $io, Composer $composer, SymlinkFilesystem $filesystem, PackageDataManagerInterface $dataManager, SharedPackageInstallerConfig $config)
 {
     $this->filesystem = $filesystem;
     parent::__construct($io, $composer, 'library', $this->filesystem);
     $this->config = $config;
     $this->vendorDir = $this->config->getVendorDir();
     $this->packageDataManager = $dataManager;
     $this->packageDataManager->setVendorDir($this->vendorDir);
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:16,代码来源:SharedPackageInstaller.php

示例8: __construct

 /**
  * Constructor.
  *
  * @param IOInterface        $io
  * @param Composer           $composer
  * @param AssetTypeInterface $assetType
  * @param Filesystem         $filesystem
  */
 public function __construct(IOInterface $io, Composer $composer, AssetTypeInterface $assetType, Filesystem $filesystem = null)
 {
     parent::__construct($io, $composer, $assetType->getComposerType(), $filesystem);
     $extra = $composer->getPackage()->getExtra();
     if (!empty($extra['asset-installer-paths'][$this->type])) {
         $this->vendorDir = rtrim($extra['asset-installer-paths'][$this->type], '/');
     } else {
         $this->vendorDir = rtrim($this->vendorDir . '/' . $assetType->getComposerVendorName(), '/');
     }
 }
开发者ID:cychenyin,项目名称:postmill,代码行数:18,代码来源:AssetInstaller.php

示例9: __construct

 /**
  * @param   string                      $vendorDir  relative path for packages home
  * @param   string                      $binDir     relative path for binaries
  * @param   DownloadManager             $dm         download manager
  * @param   WritableRepositoryInterface $repository repository controller
  * @param   IOInterface                 $io         io instance
  */
 public function __construct($vendorDir, $binDir, DownloadManager $dm, WritableRepositoryInterface $repository, IOInterface $io, InstallationManager $im)
 {
     parent::__construct($vendorDir, $binDir, $dm, $repository, $io, 'composer-installer');
     $this->installationManager = $im;
     foreach ($repository->getPackages() as $package) {
         if ('composer-installer' === $package->getType()) {
             $this->registerInstaller($package);
         }
     }
 }
开发者ID:natxet,项目名称:composer,代码行数:17,代码来源:InstallerInstaller.php

示例10: __construct

 public function __construct(IOInterface $io, Composer $composer)
 {
     parent::__construct($io, $composer);
     $extra = $this->composer->getPackage()->getExtra();
     $extra += array('drupal-libraries' => array(), 'drupal-modules' => array(), 'drupal-themes' => array(), 'drupal-root' => 'core');
     $this->drupalLibraries = $extra['drupal-libraries'] + array('ckeditor/ckeditor' => "");
     $this->drupalModules = $extra['drupal-modules'] + array('drupal/*' => 'contrib');
     $this->drupalThemes = $extra['drupal-themes'] + array('drupal/*' => 'contrib');
     $this->drupalRoot = $extra['drupal-root'];
     $this->cached = array();
 }
开发者ID:jbrauer,项目名称:drupal-composer-installer,代码行数:11,代码来源:DrupalInstaller.php

示例11: __construct

 /**
  * Initializes Installer installer.
  *
  * @param IOInterface $io
  * @param Composer    $composer
  * @param string      $type
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library')
 {
     parent::__construct($io, $composer, 'composer-installer');
     $this->installationManager = $composer->getInstallationManager();
     $repo = $composer->getRepositoryManager()->getLocalRepository();
     foreach ($repo->getPackages() as $package) {
         if ('composer-installer' === $package->getType()) {
             $this->registerInstaller($package);
         }
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:18,代码来源:InstallerInstaller.php

示例12: __construct

 public function __construct(IOInterface $io, Composer $composer, $type, Filesystem $filesystem = null)
 {
     parent::__construct($io, $composer, $type, $filesystem);
     switch ($type) {
         case 'wordpress-plugin':
             $this->vendorDir = 'wp-content/plugins';
             break;
         case 'wordpress-theme':
             $this->vendorDir = 'wp-content/themes';
             break;
     }
 }
开发者ID:rjelierse,项目名称:composer-plugin-wordpress,代码行数:12,代码来源:WordpressInstaller.php

示例13: __construct

 public function __construct(Composer $composer, IOInterface $io, $type = 'library', Filesystem $filesystem = null)
 {
     $this->composer = $composer;
     $this->config = $composer->getConfig();
     $this->io = $io;
     $this->root = realpath(dirname(Factory::getComposerFile()));
     if (!file_exists($this->root . '/config/modules.php')) {
         touch($this->root . '/config/modules.php');
         chmod($this->root . '/config/modules.php', 0775);
     }
     parent::__construct($io, $composer, $type, $filesystem);
 }
开发者ID:DaGhostman,项目名称:pxb-composer,代码行数:12,代码来源:ModuleInstaller.php

示例14: __construct

 /**
  * @param   string                      $vendorDir  relative path for packages home
  * @param   string                      $binDir     relative path for binaries
  * @param   DownloadManager             $dm         download manager
  * @param   IOInterface                 $io         io instance
  * @param   InstallationManager         $im         installation manager
  * @param   array                       $localRepositories array of WritableRepositoryInterface
  */
 public function __construct($vendorDir, $binDir, DownloadManager $dm, IOInterface $io, InstallationManager $im, array $localRepositories)
 {
     parent::__construct($vendorDir, $binDir, $dm, $io, 'composer-installer');
     $this->installationManager = $im;
     foreach ($localRepositories as $repo) {
         foreach ($repo->getPackages() as $package) {
             if ('composer-installer' === $package->getType()) {
                 $this->registerInstaller($package);
             }
         }
     }
 }
开发者ID:nlegoff,项目名称:composer,代码行数:20,代码来源:InstallerInstaller.php

示例15: __construct

 /**
  * {@inheritDoc}
  */
 public function __construct(IOInterface $io, Composer $composer, $type = 'library', Filesystem $filesystem = null)
 {
     parent::__construct($io, $composer, $type, $filesystem);
     $extra = $composer->getPackage()->getExtra();
     $this->setLocalDirs(isset($extra['local-dirs']) ? $extra['local-dirs'] : dirname(getcwd()));
     if (isset($extra['local-vendors'])) {
         $this->setLocalVendors($extra['local-vendors']);
     }
     if (isset($extra['local-packages'])) {
         $this->setLocalPackages($extra['local-packages']);
     }
 }
开发者ID:piwi,项目名称:composer-symlinker,代码行数:15,代码来源:LocalInstaller.php


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