copyDirectory example



      // Make sure the installation parent directory exists and is writable.       $this->prepareInstallDirectory($filetransfer$args['install_dir']);

      if (is_dir($args['install_dir'] . '/' . $this->name)) {
        // Remove the existing installed file.         $filetransfer->removeDirectory($args['install_dir'] . '/' . $this->name);
      }

      // Copy the directory in place.       $filetransfer->copyDirectory($this->source, $args['install_dir']);

      // Make sure what we just installed is readable by the web server.       $this->makeWorldReadable($filetransfer$args['install_dir'] . '/' . $this->name);

      // Run the updates.       // @todo Decide if we want to implement this.       $this->postUpdate();

      // For now, just return a list of links of things to do.       return $this->postUpdateTasks();
    }
    

    }
  }

  public function testJail() {
    $source = $this->_buildFakeModule();

    // This convoluted piece of code is here because our testing framework does     // not support expecting exceptions.     $gotit = FALSE;
    try {
      $this->testConnection->copyDirectory($sourcesys_get_temp_dir());
    }
    catch (FileTransferException $e) {
      $gotit = TRUE;
    }
    $this->assertTrue($gotit, 'Was not able to copy a directory outside of the jailed area.');

    $gotit = TRUE;
    try {
      $this->testConnection->copyDirectory($source$this->root . '/' . PublicStream::basePath());
    }
    catch (FileTransferException $e) {
      
Home | Imprint | This part of the site doesn't use cookies.