/** * Validates given archive for existance and ability to be installed/updated. If you set the * second parameter $deepInspection to "false", the system will only check if the archive * looks fine, this is useful for a rough check during upload when a more detailed check will * be performed afterwards. * * @param string $archive * @param boolean $deepInspection * @return boolean */ public function validate($archive, $deepInspection) { $this->virtualPackageList = array(); $this->packageValidationArchive = new PackageValidationArchive($archive); if ($deepInspection) { if (!$this->packageValidationArchive->validate(self::VALIDATION_RECURSIVE)) { return false; } return $this->packageValidationArchive->validate(self::VALIDATION_EXCLUSION); } return $this->packageValidationArchive->validate(self::VALIDATION_WEAK); }
/** * Returns the iteratable package archive list. * * @return \RecursiveIteratorIterator */ public function getPackageValidationArchiveList() { $packageValidationArchive = new PackageValidationArchive(''); $packageValidationArchive->setChildren(array($this->packageValidationArchive)); return new \RecursiveIteratorIterator($packageValidationArchive, \RecursiveIteratorIterator::SELF_FIRST); }