public function run($args)
    {
        if (!isset($args[0])) {
            $this->usageError('The environment id is not specified.');
        }
        $id = $args[0];

        $this->flush();

        echo "\nCopying environment files... \n";
        $environmentPath = $this->basePath . '/' . $this->environmentsDir . '/' . $id;
        if (!file_exists($environmentPath)) {
            throw new CException(sprintf("Failed to change environment. Unknown environment '%s'!", $id));
        }
        $fileList = $this->buildFileList($environmentPath, $this->basePath);
        $this->copyFiles($fileList);

        echo "\nEnvironment successfully changed to '{$id}'.\n";
    }
public function run($args)
    {
        if (!isset($args[0])) {
            $this->usageError('The environment id is not specified.');
        }
        $id = $args[0];

        $this->flush();

        echo "\nCopying environment files... \n";
        $environmentPath = $this->basePath . '/' . $this->environmentsDir . '/' . $id;
        if (!file_exists($environmentPath)) {
            throw new CException(sprintf("Failed to change environment. Unknown environment '%s'!", $id));
        }
        $fileList = $this->buildFileList($environmentPath, $this->basePath);
        $this->copyFiles($fileList);

        echo "\nEnvironment successfully changed to '{$id}'.\n";
    }
public function run ( $ args ) { if ( ! isset ( $ args [ 0 ] ) ) { $ this -> usageError ( 'The environment id is not specified.' ) ; } $ id = $ args [ 0 ] ; $ this -> flush ( ) ; echo "\nCopying environment files... \n" ; $ environmentPath = $ this -> basePath . '/' . $ this -> environmentsDir . '/' . $ id ; if ( ! file_exists ( $ environmentPath ) ) { throw new CException ( sprintf ( "Failed to change environment. Unknown environment '%s'!" , $ id ) ) ; } $ fileList = $ this -> buildFileList ( $ environmentPath , $ this -> basePath ) ; $ this -> copyFiles ( $ fileList ) ; echo "\nEnvironment successfully changed to '{$id}'.\n" ; }
Changes the current environment.
@param array $args the command-line arguments.
@throws CException if the environment path does not exist.
Changes the current environment .