/** * Adds new package to info to Smuggler * * @param RemotePackage $remotePackage */ protected function addPackage(RemotePackage $remotePackage) { list($vendor, $name) = explode('/', $remotePackage->getName()); $package = new Package(); $package->setFullName($remotePackage->getName()); $package->setName($name); $package->setVendor($vendor); $this->getDoctrineHelper()->getEntityManager()->persist($package); }
/** * Get the readme file contents if one exists * @param Package $package * @return string */ private function getReadmeFileFor(Package $package) { $readmeLocation = 'storage/modules/' . $package->getName(); if ($this->diskFactory->disk('local')->exists($readmeLocation . '/readme.md')) { return $this->diskFactory->disk('local')->get($readmeLocation . '/readme.md'); } if ($this->diskFactory->disk('local')->exists($readmeLocation . '/README.md')) { return $this->diskFactory->disk('local')->get($readmeLocation . '/README.md'); } return ''; }