[Solar-svn] Revision 3254
pmjones at solarphp.com
pmjones at solarphp.com
Sat Jul 26 12:28:37 CDT 2008
add a non-secure index.php for first-timers
Added: system/index.php
===================================================================
--- system/index.php (rev 0)
+++ system/index.php 2008-07-26 17:28:37 UTC (rev 3254)
@@ -0,0 +1,42 @@
+<?php
+/**
+ *
+ * This bootstrap file is intended only for first-time users who have dumped
+ * the system directly into their document root. We make some special
+ * allowances for that in this file, even though it is **not secure at all**.
+ *
+ * When you're ready to really get going, point your web server document root
+ * to `system/docroot/` and turn on mod_rewrite.
+ *
+ */
+
+// Solar system directory
+$system = dirname(__FILE__);
+
+// set the include-path for the system
+set_include_path(".:..:$system/include");
+
+// load Solar
+require_once 'Solar.php';
+
+// get the system config array
+$config = require "$system/config/Solar.config.php";
+
+// fake the Action and Public URI path configs
+$path = $_SERVER['REQUEST_URI'];
+$pos = strpos($path, "/index.php");
+if ($pos !== false) {
+ $path = substr($path, 0, $pos);
+}
+$config['Solar_Uri_Action']['path'] = "$path/index.php";
+$config['Solar_Uri_Public']['path'] = "$path/docroot/public";
+
+// start Solar with the modified config values
+Solar::start($config);
+
+// instantiate and run the front controller
+$front = Solar::factory('Solar_Controller_Front');
+$front->display();
+
+// Done!
+Solar::stop();
More information about the Solar-svn
mailing list