/** * Register the module service provider. * * @param array $module * * @return void */ private function registerServiceProvider($module) { $serviceProvider = module_class($module['slug'], 'Providers\\ModuleServiceProvider'); if (class_exists($serviceProvider)) { $this->app->register($serviceProvider); } }
public static function compiles() { $modules = app()->make('modules')->all(); $files = []; foreach ($modules as $module) { $serviceProvider = module_class($module['slug'], 'Providers\\ModuleServiceProvider'); if (class_exists($serviceProvider)) { $files = array_merge($files, forward_static_call([$serviceProvider, 'compiles'])); } } return array_map('realpath', $files); }
/** * 非系统内置函数 * 用户可在这里添加自己的function * @author Sun < *****@*****.** > * @since Yii 2.0 */ function image($file, $option = null) { return module_class('image.Classes.image', $file, $option); }
/** * Get the default namespace for the class. * * @param string $rootNamespace * * @return string */ protected function getDefaultNamespace($rootNamespace) { return module_class($this->argument('slug'), 'Policies'); }
/** * Get the default namespace for the class. * * @param string $rootNamespace * * @return string */ protected function getDefaultNamespace($rootNamespace) { return module_class($this->argument('slug'), 'Http\\Requests'); }
/** * Replace namespace in seeder stub. * * @param string $name * * @return string */ protected function getNamespace($name) { return module_class($this->argument('slug'), 'Database\\Seeds'); }