/** * Sets the information for a path. * * If a compression mode other than `NONE` is set, the file contents are * automatically compressed using the respective compression scheme. * * @param string $path The name of the path. * @param PathInterface $manager The path manager. */ public function setPath($path, PathInterface $manager) { $this->replace('paths', ['path' => $path, 'type' => $manager->getType(), 'compression' => $this->compression, 'modified' => $manager->getModified(), 'permissions' => $manager->getPermissions(), 'contents' => $this->compress($manager->getContents())]); }
/** * Sets the attributes for an extracted path. * * @param string $path The path to modify. * @param PathInterface $manager The path manager. * * @throws SqonException If the attributes could not be set. */ private function setAttributes($path, PathInterface $manager) { if (!chmod($path, $manager->getPermissions())) { // @codeCoverageIgnoreStart throw new SqonException("The permissions could not be set for \"{$path}\"."); // @codeCoverageIgnoreEnd } if (!touch($path, $manager->getModified())) { // @codeCoverageIgnoreStart throw new SqonException("The modified timestamp could not be set for \"{$path}\"."); // @codeCoverageIgnoreEnd } }