App\Services\Deployment\DeployerServerListFileBuilder::put PHP Méthode

put() public méthode

Put a server list file.
public put ( ) : App\Services\ServerList\DeployerServerListFileBuilder
Résultat App\Services\ServerList\DeployerServerListFileBuilder $this
    public function put()
    {
        $fullPath = $this->deployerFile->getFullPath();
        $contents = $this->server->body;
        // Override settings in a server list file
        $serverList = $this->yamlParser->parse($contents);
        $projectAttributes = $this->project->attributes;
        if (!is_null($projectAttributes)) {
            foreach ($serverList as $i => $server) {
                if (!is_null($projectAttributes->getDeployPath())) {
                    $serverList[$i]['deploy_path'] = $projectAttributes->getDeployPath();
                }
            }
        }
        $newContents = $this->yamlDumper->dump($serverList);
        $this->fs->put($fullPath, $newContents);
        return $this;
    }