/** * Enable or disable features. $features can be a comma-separated list of feature names * @param String $features */ private function setFeatureStatus($features, $enabled) { $features = array_map('trim', explode(',', $features)); foreach ($features as $feature) { echo $feature; $this->service->updateFeatureFlag($feature, $enabled); } $this->service->flagEntries(); }
/** * Process request * @throws Tx_FeatureFlag_Service_Exception_ActionNotFound */ public function processRequest() { $action = GeneralUtility::_GP('action'); $featureName = GeneralUtility::_GP('feature'); $response = null; switch ($action) { case 'activate': $this->featureFlagService->updateFeatureFlag($featureName, true); break; case 'deactivate': $this->featureFlagService->updateFeatureFlag($featureName, false); break; case 'flagentries': $this->featureFlagService->flagEntries(); break; case 'status': $response = $this->featureFlagService->isFeatureEnabled($featureName); break; default: throw new Tx_FeatureFlag_Service_Exception_ActionNotFound('Action not found'); break; } echo json_encode(array('status' => 200, 'response' => $response)); }