[switchyard] r784 committed - Fixed a dumb bug in bootstrap.php.

0 views
Skip to first unread message

codesite...@google.com

unread,
Sep 30, 2009, 5:35:01 PM9/30/09
to switchy...@googlegroups.com
Revision: 784
Author: intuiworx
Date: Wed Sep 30 14:33:57 2009
Log: Fixed a dumb bug in bootstrap.php.
http://code.google.com/p/switchyard/source/detail?r=784

Modified:
/framework/trunk/app/core/bootstrap.php
/framework/trunk/index.php

=======================================
--- /framework/trunk/app/core/bootstrap.php Wed Sep 30 13:47:44 2009
+++ /framework/trunk/app/core/bootstrap.php Wed Sep 30 14:33:57 2009
@@ -10,7 +10,6 @@

// Define some necessary constants.
define('SY_ROOTDIR', str_replace('/app/core', '', dirname(__FILE__)));
-define('SY_HTTPDIR', str_replace('/app/core', '', dirname(__FILE__)));
define('SY_APPDIR', SY_ROOTDIR.'/app');
define('SY_CNFDIR', SY_APPDIR.'/conf');
define('SY_COREDIR', SY_APPDIR.'/core');
@@ -21,6 +20,16 @@
define('SY_PLUGINDIR', SY_APPDIR.'/plugins');
define('SY_THEMEDIR', SY_ROOTDIR.'/themes');

+if (preg_match('/index\.php$/', $_SERVER['SCRIPT_FILENAME'])) {
+ $rootdir = str_replace(SY_ROOTDIR, str_replace('/index.php', '',
$_SERVER['SCRIPT_FILENAME']));
+ if (empty($rootdir)) $rootdir = '/';
+ define('SY_CLI', false);
+ define('SY_HTTPDIR', $rootdir);
+} else {
+ define('SY_CLI', true);
+ define('SY_HTTPDIR', false);
+}
+
// Define these constants so we can quickly find out how the page was
requested.
define('POST', ($_SERVER['REQUEST_METHOD'] == 'POST')?true:false);
define('GET', ($_SERVER['REQUEST_METHOD'] == 'GET')?true:false);
=======================================
--- /framework/trunk/index.php Mon Sep 28 08:06:48 2009
+++ /framework/trunk/index.php Wed Sep 30 14:33:57 2009
@@ -3,12 +3,12 @@
/**
* SwitchYard Master Controller Script
* @author Jeremy Clifton <j.cl...@4-8-4.com>
- * @version 3.1.3
+ * @version 3.1.4
* @copyright 2005-2009 4-8-4 Software Works, LLC
* @license BSD
*/

-define('SY_VERSION', '3.1.3');
+define('SY_VERSION', '3.1.4');
require 'app/core/bootstrap.php';
SwitchYard::$router = new SwitchYard_Router();
SwitchYard::$router->dispatch();

Reply all
Reply to author
Forward
0 new messages