Skip to content

Instantly share code, notes, and snippets.

@mrandyclark
Created October 23, 2011 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrandyclark/1307914 to your computer and use it in GitHub Desktop.
Save mrandyclark/1307914 to your computer and use it in GitHub Desktop.
<?php
$action = $_GET['action'];
API::process_action($action);
?>
<?php
class API {
private static $all_actions = array('live','reminder','replay');
public static function process_action($action) {
if (is_numeric(array_search($action, API::$all_actions))) {
$f_name = "games_" . $action;
API::$f_name();
} else {
$this->error_msg = 'ACTION_NOT_ALLOWED';
}
}
private function games_live() {
return "live.";
}
private function games_replay() {
echo "replayed";
}
private function games_reminder() {
return "reminder";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment