DNEnvironment::getFullName PHP 메소드

getFullName() 공개 메소드

Return a name for this environment.
public getFullName ( string $separator = ':' ) : string
$separator string The string used when concatenating project with env name
리턴 string
    public function getFullName($separator = ':')
    {
        return sprintf('%s%s%s', $this->Project()->Name, $separator, $this->Name);
    }

Usage Example

 /**
  * Use snowcake to do the deployment
  */
 public function deploy(DNEnvironment $environment, $sha, DeploynautLogFile $log, DNProject $project, $leaveMaintenancePage = false)
 {
     $log->write(sprintf('Deploying "%s" to "%s"', $sha, $environment->getFullName()));
     if (!defined('SNOWCAKE_PATH')) {
         $log->write('SNOWCAKE_PATH is not defined');
         throw new RuntimeException('SNOWCAKE_PATH is not defined');
     }
     // Construct our snowcake command
     $name = $environment->SnowcakeName . '-' . substr($sha, 0, 8) . '-' . mt_rand();
     // Filter invalid characters out of $name (Value 'ssorg_uat-fdceda2e-1400725889-bake' at 'stackName' failed to satisfy constraint:
     // "Member must satisfy regular expression pattern: [a-zA-Z][-a-zA-Z0-9]*)"
     $name = str_replace('_', '-', $name);
     $command = sprintf('%s deploy %s %s %s', SNOWCAKE_PATH, $environment->SnowcakeName, $name, $sha);
     $log->write(sprintf('Running command: %s', $command));
     $process = new Process($command, dirname(dirname(SNOWCAKE_PATH)));
     $process->setTimeout(3600);
     $process->run(function ($type, $buffer) use($log) {
         $log->write($buffer);
     });
     if (!$process->isSuccessful()) {
         throw new RuntimeException($process->getErrorOutput());
     }
     $log->write(sprintf('Deploy of "%s" to "%s" finished', $sha, $environment->getFullName()));
 }
All Usage Examples Of DNEnvironment::getFullName