/** * Set package location and temp path. */ protected function set_package_paths() { $this->package->set_temp_path($this->ext_config->__get('contrib_temp_path'), true)->set_source($this->attachment->get_filepath()); }
/** * Generate Composer package. * * @param string $composer_package Path to package destination */ protected function generate_composer_package($composer_package) { $package = new package(); $package->set_source($this->ext_config->upload_path . $this->file['physical_filename']); $package->set_temp_path($this->ext_config->contrib_temp_path, true); $ext_base_path = $package->find_directory(array('files' => array('required' => 'composer.json', 'optional' => 'ext.php')), 'vendor'); $package->restore_root($ext_base_path, $this->id); $filesystem = new Filesystem(); $filesystem->copy($package->get_source(), $this->ext_config->upload_path . $composer_package); $package->set_source($package->get_source() . '.composer'); $package->repack(true); $package->cleanup(); }