| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- class RouteBase {
- public function route() {
- $task = V::get('_task', '', $_REQUEST);
- if (empty($task)) {
- $this->defaultAction();
- return;
- }
- $methodName = "{$task}Action";
- if (method_exists($this, $methodName)) {
- $this->{$methodName}();
- } else {
- die("Task '{$task}' not exists");
- }
- }
- public function defaultAction() {
- die("default task not implemented");
- }
- public function parseMessageFromStorageTestAction() {
- $msgs = V::get('msgs', '', $_GET);
- //echo $this->parseMessageFromStorage($msg);
- Lib::loadClass('StorageException');
- if (is_array($msgs)) {
- foreach ($msgs as $vMsg) {
- try {
- throw new StorageException($vMsg);
- } catch (Exception $e) {
- $vParsedMsg = $e->getMessage();
- echo " MSG: {$vMsg}\n";
- echo "PARSED: {$vParsedMsg}\n";
- echo "isMsgParsed(" . ($vMsg != $vParsedMsg) . ")\n\n";
- }
- }
- } else {
- throw new StorageException($msgs);
- }
- echo "\n\n";
- die("parseMessageFromStorage end");
- }
- public function parseMessageFromStorage($msg) {
- return $msg;
- }
- public function parseMessageFromMsgsSystem($msg) {
- return $msg;
- }
- public function runByMessageFromMsgsSystem($msg, & $execNotes) {
- }
- public function handleAuth() {
- User::authByRequest();
- }
- }
|