readFile() public method

Reads file from server. Paths are absolute.
public readFile ( $remote, $local ) : void
return void
示例#1
0
 /**
  * Downloads and decodes .htdeployment from the server.
  * @return void
  */
 private function loadDeploymentFile()
 {
     $root = $this->server->getDir();
     $tempFile = tempnam($this->tempDir, 'deploy');
     try {
         $this->server->readFile($root . '/' . $this->deploymentFile, $tempFile);
     } catch (ServerException $e) {
         return FALSE;
     }
     $content = gzinflate(file_get_contents($tempFile));
     $res = [];
     foreach (explode("\n", $content) as $item) {
         if (count($item = explode('=', $item, 2)) === 2) {
             $res[$item[1]] = $item[0] === '1' ? TRUE : $item[0];
         }
     }
     return $res;
 }