Esempio n. 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     //
     $path = $this->argument('path');
     $packager = new Packager($path);
     $packager->importAppFromPackage();
 }
Esempio n. 2
0
 /**
  * Handles POST action
  *
  * @return \DreamFactory\Core\Contracts\ServiceResponseInterface|\DreamFactory\Core\Utility\ServiceResponse|mixed
  * @throws \DreamFactory\Core\Exceptions\BadRequestException
  * @throws \Exception
  */
 protected function handlePOST()
 {
     $uploadedFiles = $this->request->getFile('file');
     $importUrl = $this->request->getPayloadData('import_url');
     $storageServiceId = $this->request->input('storage_service_id');
     $storageContainer = $this->request->input('storage_container');
     if (!empty($uploadedFiles)) {
         $package = new Packager($uploadedFiles);
         $results = $package->importAppFromPackage($storageServiceId, $storageContainer);
     } elseif (!empty($importUrl)) {
         $package = new Packager($importUrl);
         $results = $package->importAppFromPackage($storageServiceId, $storageContainer);
     } else {
         $results = parent::handlePOST();
     }
     return $results;
 }