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";
    }