/** * @param \Composer\Package\CompletePackage $package * @return CM_App_Package * @throws CM_Exception_Invalid */ protected function _getPackageFromComposerPackage(\Composer\Package\CompletePackage $package) { $pathRelative = ''; if (!$package instanceof \Composer\Package\RootPackage) { $vendorDir = $this->_getComposerVendorDir(); $pathRelative = $vendorDir . $package->getPrettyName() . '/'; } $extra = $package->getExtra(); $modules = array(); if (array_key_exists('cm-modules', $extra)) { $modules = $extra['cm-modules']; } return new CM_App_Package($package->getName(), $pathRelative, $modules); }