title: Codeigniter: how do I roll out features to controlled (beta) groups of users?
body: <h2>Explanation</h2>
  
  <p>I'm working on a web application build in CodeIgniter. Since I'm continuously adding new features, some of them might be unstable. Therefore I would like to have a way of 'rolling out' these features to specified groups first. If all goes well I would make the feature available for the full user community.</p>
  
  <p>The solution I'm thinking of now consists of a config file that has feature arrays in them for every release group:</p>
  
  <pre><code>alpha = array(
      "feature A" =&gt; true,
      "feature B" =&gt; true,
      "feature C" =&gt; true
      );
  
  beta = array(
      "feature A" =&gt; true,
      "feature B" =&gt; true,
      "feature C" =&gt; false
      );
  
  production = array(
      "feature A" =&gt; false,
      "feature B" =&gt; false,
      "feature C" =&gt; false
      );
  </code></pre>
  
  <p>The users in my application are then divided into groups (alpha, beta, production) and the system would make the applicable features available for the current user.</p>
  
  <p>This part of 'making available the applicable feature' I'm now thinking about doing with a (ugly) construction as the following:</p>
  
  <pre><code>if ($feature_array["feature A"])
  {
     /* run the code for feature A */
  }
  </code></pre>
  
  <p>Thing with that construction is, though, that if the feature is rolled out to all the users this code is no longer necessary but will still sit there.</p>
  
  <h2>My question</h2>
  
  <p>Is there a solution/standard setup/library for this kind of functionality and avoids me having to go back and delete these 'if statements' when a feature is fully rolled out?</p>