Exemple #1
0
 function dataserviceHandler()
 {
     $this->response->useContentType('xml');
     $rest_url = $this->getLastPath();
     $list = explode('/', $rest_url);
     $content = "";
     if (!isset($list[0])) {
         $content = "<error>Database connection not supplied</error>";
     } else {
         if (!isset($list[1])) {
             $content = "<error>Database Table not supplied</error>";
         } else {
             if (!isset($list[2])) {
                 $content = "<error>Database Table Operation not supplied</error>";
             } else {
                 if (isBarren($list[2])) {
                     $content = "<error>Database Table Operation can not be empty</error>";
                 } else {
                     require_once __SITE_PATH . DIRECTORY_SEPARATOR . 'apps/restserver/ds/coreds.php';
                     $dscore = new coreds($this->reg);
                     $dscore->setParamList($list);
                     $dscore->setRequest(array($this->request, "XML"));
                     $content = $dscore->result();
                     $xml = $this->getSimpleX();
                     ArrayHelpers::ArrayToXMLRow($xml, $content, "row", 3);
                     $content = $xml->asXML();
                 }
             }
         }
     }
     $this->response->content = $content;
     return $this->response->send();
 }
Exemple #2
0
 private function Halt()
 {
     $request = $this->parseRequest();
     if (empty($request)) {
         $request = 'index';
     } else {
         /*** get the parts of the request ***/
         $parts = explode('/', $request);
         $this->controller = strtolower($parts[0]);
         if (isset($parts[1])) {
             $this->process = $parts[1];
         }
     }
     /*** Get trailers after controller ***/
     if (isBarren($this->process)) {
         $this->process = 'index';
     }
     $this->request_url = $request;
     $modul = $this->reg->maps->getModuleByName($this->controller);
     $this->route = $modul;
     if (!isBarren($modul)) {
         $this->url = $this->processMatch($modul);
     } else {
         // register Page Not found Event
         echo "<h1>Page Error</h1> Page not found";
     }
     $this->dispatch();
 }
Exemple #3
0
 function manage_css()
 {
     $ext = ".css";
     $reqrex = $this->getLastPath();
     $filename = realpath(__SITE_PATH . '/sys/templates/' . $reqrex . $ext);
     if (isBarren($reqrex) || !file_exists($filename)) {
         throw new Exception("Resources Not sent!");
     }
     $this->response->contenType = 'text/css';
     $this->response->content = file_get_contents($filename);
     $match;
     preg_match_all("/url\\(('?|\"?)([\\w\\d\\/\\.]*)('?|\"?)\\)/", file_get_contents($filename), $match);
     $path = $this->reg->cfg->config('domain') . '/' . 'sys/templates/dodeye/css';
     $afun = function ($match) use($path) {
         return "url('{$path}" . preg_replace("/('?|\"?)/", '', $match[1]) . "')";
     };
     $this->response->content = preg_replace_callback("%url\\(([\\w\\d\\/\\.'\"]*)\\)%", $afun, $this->response->content);
     // print_r($match);
     //exit;
     // $this->response->content = print_r($match,true);
     $this->response->ready(TRUE);
 }
Exemple #4
0
 public final function pushRoute()
 {
     $act1 = $this->reg->front->getAct();
     $dix = $this->reg->maps->getPathById($this->getNavName(), $act1);
     //@todo: Add validations here
     if (isBarren($dix)) {
         if (method_exists($this, $act1)) {
             call_user_func(array($this, $act1));
         } else {
             print "<h3>Routine Missing</h3>";
         }
     } else {
         $m_x = ArrayHelpers::XMLElemToArray($dix[0]);
         if (isset($m_x['method'])) {
             if (method_exists($this, $m_x['method'])) {
                 call_user_func(array($this, $m_x['method']));
             } else {
                 print "<h3>Routine Method Missing</h3>";
             }
         } else {
             print "<h3>Routine Missing in Class</h3>";
         }
     }
 }