/** * Run by generate_page.php if module_api is defined in the request. * * What if nothing has content? */ function run_api() { if (!empty($this->section_to_module)) { foreach ($this->section_to_module as $section => $module) { $module =& $this->_get_module( $section ); $module->run_api(); } } else // LETS DO A 404 with text/html { $api = new CarlUtilAPI('html'); $api->run(); exit(); } }
/** * By default we run an API and do not set any content which should return a 404. */ function run_api() { $api = new CarlUtilAPI('html'); $api->run(); exit; }
/** * We will enforce the same basic rules in _cm_ok_to_run() but return generic API mode errors. * * @todo we should return a 403 when this capability is implemented in CarlUtilAPI */ function run_api() { if ($this->_cm_ok_to_run()) { $this->disco_item->run_api(); } else { // this will spit out a 404 - we should actually do a 403. $api = new CarlUtilAPI('html'); $api->run(); } exit; }