public function saveEnvironment($environment) {
        $environment = (object) $environment;

        $environment_config = (array) $environment;
        unset($environment_config['app']);
        $this->config['apps'][$environment->app]['environments'][$environment->name] = $environment_config;
    }