/**
  * Initialize a list of given command options with their default values.
  *
  * @return $this
  */
 protected function initOptions()
 {
     $module = $this->module->getStudlyName();
     $ns = "Modules\\{$module}";
     $this->options = ['connection' => $this->getOption('connection', null), 'ignore' => $this->getOption('ignore', []), 'path' => $this->getOption('path', ''), 'templatePath' => $this->getOption('templatePath', ''), 'namespace' => $this->getOption('namespace', $ns), 'defaultIndexNames' => $this->getOption('defaultIndexNames', false), 'defaultFKNames' => $this->getOption('defaultFKNames', false), 'overwrite' => $this->getOption('overwrite', false)];
     return $this;
 }
예제 #2
0
 /**
  * Return a modules.
  *
  * @return \Illuminate\Support\Collection
  */
 public function get(Module $module)
 {
     $moduleName = $module->getName();
     if (Lang::has("{$moduleName}::module.title")) {
         $module->localname = Lang::get("{$moduleName}::module.title");
     } else {
         $module->localname = $module->getStudlyName();
     }
     if (Lang::has("{$moduleName}::module.description")) {
         $module->description = Lang::get("{$moduleName}::module.description");
     }
     $package = $this->packageVersion->getPackageInfo("societycms/module-{$moduleName}");
     if (isset($package->name) && strpos($package->name, '/')) {
         $module->vendor = explode('/', $package->name)[0];
     }
     $module->version = isset($package->version) ? $package->version : 'N/A';
     $module->versionUrl = '#';
     $module->isCore = $this->isCoreModule($module);
     if (isset($package->source->url)) {
         $packageUrl = str_replace('.git', '', $package->source->url);
         $module->versionUrl = $packageUrl . '/tree/' . $package->dist->reference;
     }
     $module->license = $package->license;
     return $module;
 }