public function on_start() { parent::on_start(); $this->entityManager = Package::getByHandle('migration_tool')->getEntityManager(); ini_set('memory_limit', -1); set_time_limit(0); }
public function skipItem() { $pkg = Package::getByHandle($this->object->getHandle()); return is_object($pkg); }
public function getPackageObject() { return Package::getByHandle($this->pkgHandle); }
public function register($filename, $args, $pkg = false) { if ($pkg != false) { if (!$pkg instanceof Package) { $pkg = Package::getByHandle($pkg); } $this->setPackageObject($pkg); } $this->setAssetIsLocal($args['local']); $this->mapAssetLocation($filename); if ($args['minify'] === true || $args['minify'] === false) { $this->setAssetSupportsMinification($args['minify']); } if ($args['combine'] === true || $args['combine'] === false) { $this->setAssetSupportsCombination($args['combine']); } if ($args['version']) { $this->setAssetVersion($args['version']); } if ($args['position']) { $this->setAssetPosition($args['position']); } }
public function downloadUpdate() { $pkg = Package::getByHandle($this->getHandle()); $fileURL = $this->getRemoteFileURL(); if (empty($fileURL)) { return array(Package::E_PACKAGE_NOT_FOUND); } $file = Marketplace::downloadRemoteFile($this->getRemoteFileURL()); if (empty($file) || $file == Package::E_PACKAGE_DOWNLOAD) { return array(Package::E_PACKAGE_DOWNLOAD); } else { if ($file == Package::E_PACKAGE_SAVE) { return array($file); } } $r = $pkg->backup(); if (is_array($r)) { return $r; } try { $am = new PackageArchive($this->getHandle()); $am->install($file, true); } catch (Exception $e) { $pkg->restore(); return array($e->getMessage()); } }
public function downloadUpdate() { $pkg = Package::getByHandle($this->getHandle()); $fileURL = $this->getRemoteFileURL(); if (empty($fileURL)) { return array(Package::E_PACKAGE_NOT_FOUND); } $file = Marketplace::downloadRemoteFile($this->getRemoteFileURL()); if (is_object($file)) { return $file; // error } $r = $pkg->backup(); if (is_object($r)) { return $r; } try { $am = new PackageArchive($this->getHandle()); $am->install($file, true); } catch (Exception $e) { $pkg->restore(); $error = \Core::make('error'); $error->add($e); return $error; } }