original_string: protected function getManifestFromZipFile()
      {
          $this->zip = new \ZipArchive();
          if (true !== $this->zip->open($this->zipFile)) {
              throw new InternalServerErrorException('Failed to open imported zip file.');
          }
  
          $password = $this->getPassword();
          if (!empty($password)) {
              $this->zip->setPassword($password);
          }
  
          $manifest = $this->zip->getFromName('package.json');
          if (false === $manifest) {
              throw new BadRequestException('Cannot read package manifest. A valid password is required if this is a secured package.');
          }
          $manifest = DataFormatter::jsonToArray($manifest);
  
          return $manifest;
      }
code: protected function getManifestFromZipFile()
      {
          $this->zip = new \ZipArchive();
          if (true !== $this->zip->open($this->zipFile)) {
              throw new InternalServerErrorException('Failed to open imported zip file.');
          }
  
          $password = $this->getPassword();
          if (!empty($password)) {
              $this->zip->setPassword($password);
          }
  
          $manifest = $this->zip->getFromName('package.json');
          if (false === $manifest) {
              throw new BadRequestException('Cannot read package manifest. A valid password is required if this is a secured package.');
          }
          $manifest = DataFormatter::jsonToArray($manifest);
  
          return $manifest;
      }
code_tokens: protected function getManifestFromZipFile ( ) { $ this -> zip = new \ ZipArchive ( ) ; if ( true !== $ this -> zip -> open ( $ this -> zipFile ) ) { throw new InternalServerErrorException ( 'Failed to open imported zip file.' ) ; } $ password = $ this -> getPassword ( ) ; if ( ! empty ( $ password ) ) { $ this -> zip -> setPassword ( $ password ) ; } $ manifest = $ this -> zip -> getFromName ( 'package.json' ) ; if ( false === $ manifest ) { throw new BadRequestException ( 'Cannot read package manifest. A valid password is required if this is a secured package.' ) ; } $ manifest = DataFormatter :: jsonToArray ( $ manifest ) ; return $ manifest ; }
docstring: Retrieves the manifest file from package file.
  
  @return array|string
  @throws \DreamFactory\Core\Exceptions\InternalServerErrorException
  @throws \DreamFactory\Core\Exceptions\BadRequestException
docstring_tokens: Retrieves the manifest file from package file .