Example #1
0
 /**
  * Update the file permissions per configured path.
  *
  * @param ConnectionAdapterInterface $connection
  * @param string                     $releasePath
  * @param string                     $path
  * @param string                     $pathSettings
  *
  * @return bool
  */
 private function updateFilePermissions(ConnectionAdapterInterface $connection, $releasePath, $path, $pathSettings)
 {
     $path = $releasePath . '/' . $path;
     if (isset($pathSettings['permissions']) === false) {
         return false;
     }
     $permissions = FilePermissionCalculator::fromStringRepresentation(str_pad($pathSettings['permissions'], 10, '-'))->getMode();
     $recursive = false;
     if (isset($pathSettings['recursive'])) {
         $recursive = $pathSettings['recursive'];
     }
     return $connection->changePermissions($path, $permissions, $recursive);
 }
 /**
  * Test if creating from mode string fails with empty string.
  *
  * @expectedException InvalidArgumentException
  */
 public function testGetModeFromStringRepresentationFailsOnShortArgument()
 {
     FilePermissionCalculator::getModeFromStringRepresentation('');
 }