Created
October 23, 2011 21:34
-
-
Save mrandyclark/1307914 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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