public static function load($file, $file2 = null, $glob_config = array()) { $GLOBALS['CONFIG'] = self::read($glob_config, $file, $file2); // print_r($GLOBALS ['CONFIG']['GLOBAL']); define_globals($GLOBALS['CONFIG']['GLOBAL']); define('Q', isset($_REQUEST['q']) ? $_REQUEST['q'] : NULL); $path_info = pathinfo($_SERVER['PHP_SELF']); $CONTEXT_PATH = Q == NULL ? strstr($_SERVER['PHP_SELF'], $path_info['basename'], TRUE) : strstr($_SERVER['REQUEST_URI'], Q, true); /** * TODO:- Fix it wth better solution */ if ($CONTEXT_PATH == null) { $CONTEXT_PATH = str_replace($path_info['basename'], "", $_SERVER['PHP_SELF']); } define('CONTEXT_PATH', $CONTEXT_PATH); define('APP_CONTEXT', resolve_path($CONTEXT_PATH . get_include_path())); Console::set(TRUE); }
* it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ require_once 'src/utils.inc'; define_globals(0); require_once 'src/resources.inc'; require_once 'src/authenticate.inc'; require_once 'src/transformation.inc'; require_once 'src/cache.inc'; function view($location, $args) { $resource = get_resource($location, $args); global $xeemes_current_resource; $xeemes_current_resource = $resource; if ($resource->exists()) { $auth_info = verify_view_authorization($resource); $cache = new XeemesResourceCache('cache/'); header('Content-Type: ' . $resource->getContentType()); // Problem: authenticate doesn't work then, because the browser // thinks it's a different directory.