<?php require_once './controller.php'; require_once './classes/Model.php'; $mark = ['nazwa' => 'Samochod', 'latitude' => 14, 'longitude' => 16, 'opis' => 'jakis opis2']; $obj = (object) $mark; Controller::handle($obj)->removeMarker(); $a = 'dodano';
</dl> </div> </body> </html> <?php die; } function numbat_session_stats() { $time = microtime(true) - $GLOBALS['numbat_start_time']; return 'Rendered in ' . round($time, 3) . ' seconds, with ' . Database::instance()->get_count() . ' queries'; } /** Load app configuration if it exists */ if (file_exists(NUMBAT_APPPATH . '/config.php')) { include NUMBAT_APPPATH . '/config.php'; } else { numbat_primative_die("Couldn't load configuration", 'config'); } /** Make sure constant is defined */ if (!defined('NUMBAT_SHOW_DB_ERRORS')) { define('NUMBAT_SHOW_DB_ERRORS', false); } /** Undo magic quotes **/ if (get_magic_quotes_gpc()) { list($_GET, $_POST, $_COOKIE, $_REQUEST) = stripslashes_deep(array($_GET, $_POST, $_COOKIE, $_REQUEST)); } // Connect to database Database::instance(Config::instance()->get('db')); Controller::parse(); Controller::handle();
*/ if (file_exists('bootstrap.php')) { require 'bootstrap.php'; } /** * Initialize the built-in cache support. Provides a * consistent cache API (based on Memcache) so we can always * include caching in our handlers and in the front controller. */ if (!isset($memcache) || !is_object($memcache)) { $memcache = Cache::init(conf('Cache')); } /** * Route the request to the appropriate handler and get * the handler's response. */ if ($i18n->url_includes_lang) { $handler = $controller->route($i18n->new_request_uri); } else { $handler = $controller->route($_SERVER['REQUEST_URI']); } $page->body = $controller->handle($handler, false); /** * Render and send the output to the client, using gzip * compression if conf[General][compress_output] is true. */ $out = $page->render($tpl); if (conf('General', 'compress_output') && extension_loaded('zlib')) { ob_start('ob_gzhandler'); } echo $out;
<?php require_once './controller.php'; require_once './classes/Model.php'; if (!isset($_REQUEST['json'])) { echo 'brak przekazanych danych'; die; } $data = json_decode($_REQUEST['json']); $action = isset($data->action) ? $data->action : ''; if (empty($action)) { echo 'błąd przekazanej akcji'; die; } try { echo json_encode(Controller::handle($data)->{$action}()); } catch (Exception $e) { echo 'Przekazano niepoprawną akcję'; }
/** * Run an internal request from one handler to another. */ public function run($uri, $data = array(), $internal = true) { $c = new Controller(count(self::$hooks) > 0 ? self::$hooks : conf('Hooks')); $c->page($this->_page); $c->i18n($this->_i18n); $c->template($this->_tpl); $c->cache($this->_cache); $handler = $c->route($uri); if (!isset(self::$called[$uri])) { self::$called[$uri] = 1; } else { self::$called[$uri]++; } return $c->handle($handler, $internal, $data); }
/** * Run an internal request from one handler to another. */ public function run($uri, $data = array()) { $c = new Controller(); $handler = $c->route($uri); if (!isset(self::$called[$uri])) { self::$called[$uri] = 1; } else { self::$called[$uri]++; } return $c->handle($handler, true, $data); }