error(404, 'Only API v1 supported'); } $rest = substr($uri, 3); $parts = explode('/', $rest); $actionName = $parts[0]; $class = 'imagestore\Controller_Api_' . ucfirst($actionName); if (!class_exists($class)) { return $this->error(404, 'API method not supported'); } $action = new $class(); $action->handle(substr($rest, strlen($parts[0]) + 1)); } } ?>