private function setSapi($sapi) { $reflection = new \ReflectionClass('Contao\\Environment'); $property = $reflection->getProperty('strSapi'); $property->setAccessible(true); $property->setValue($sapi); }