| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?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;
- }
- }
|