/** * @param $key * @return string */ protected function getCachePath($key) { $cacheDirectory = $this->config->getCacheDirectory(); if (!file_exists($cacheDirectory)) { mkdir($cacheDirectory, 0775, true); } return $cacheDirectory . DIRECTORY_SEPARATOR . $key . '.cache'; }
/** * Register the service provider. */ public function register() { $this->app->when('Synga\\ServiceProviderHelper\\ServiceProviderAdder')->needs('Synga\\InheritanceFinder\\InheritanceFinderInterface')->give(function () { $config = new FileConfig(); $config->setApplicationRoot(base_path()); $config->setCacheDirectory(\Config::get('providers.inheritance_finder_storage_path')); return InheritanceFinderFactory::getInheritanceFinder($config); }); $this->app->singleton('PhpParser\\Parser', function () { return (new ParserFactory())->create(ParserFactory::PREFER_PHP7); }); $this->commands([\Synga\ServiceProviderHelper\Command\AddServiceProviderCommand::class]); }