Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • ModuleInstaller
 1 <?php
 2 
 3 /*
 4  * This file is part of the ICanBoogie package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace ICanBoogie\Composer;
13 
14 use Composer\Package\PackageInterface;
15 use Composer\Installer\LibraryInstaller;
16 
17 class ModuleInstaller extends LibraryInstaller
18 {
19     const PACKAGE_PREFIX = 'module-';
20 
21     /**
22      * {@inheritDoc}
23      */
24     public function getInstallPath(PackageInterface $package)
25     {
26         $name = $package->getPrettyName();
27         $name = basename($name);
28 
29         if (strpos($name, self::PACKAGE_PREFIX) !== 0)
30         {
31             throw new \InvalidArgumentException
32             (
33                 'Unable to install module, ICanBoogie module should always start their package name with "' . self::PACKAGE_PREFIX . '"'
34             );
35         }
36 
37         $module_id = strtr(substr($name, strlen(self::PACKAGE_PREFIX)), '-', '.');
38 
39         return ($this->vendorDir ? $this->vendorDir . '/' : '') . 'icanboogie-modules/' . $module_id;
40     }
41 
42     /**
43      * {@inheritDoc}
44      */
45     public function supports($packageType)
46     {
47         return 'icanboogie-module' === $packageType;
48     }
49 }
Autodoc API documentation generated by ApiGen 2.8.0