settings = ApplicationFactory::getInstance()->getSettings(); } /** * @since 3.0 * * @param array $configurations */ public function set( array $configurations = [] ) { foreach ( $configurations as $key => $value ) { if ( array_key_exists( $key, $GLOBALS ) ) { $this->configurations[$key] = $GLOBALS[$key]; } else { $this->newKeys[] = $key; } $GLOBALS[$key] = $value; $this->settings->set( $key, $value ); } } /** * @since 3.0 */ public function reset() { foreach ( $this->configurations as $key => $value ) { $GLOBALS[$key] = $value; $this->settings->set( $key, $value ); } foreach ( $this->newKeys as $key ) { unset( $GLOBALS[$key] ); $this->settings->delete( $key ); } } }