Skip to content

Instantly share code, notes, and snippets.

@nsams
Created February 3, 2015 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsams/e6cb18e4628df2143da5 to your computer and use it in GitHub Desktop.
Save nsams/e6cb18e4628df2143da5 to your computer and use it in GitHub Desktop.
xhgui patch
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..fd089c6
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^ webroot/index.php [QSA,L]
+</IfModule>
diff --git a/cache/.gitignore b/cache/.gitignore
index cde8069..761a85b 100755
--- a/cache/.gitignore
+++ b/cache/.gitignore
@@ -1 +1,3 @@
*.php
+*
+
diff --git a/config/config.php b/config/config.php
new file mode 100644
index 0000000..c071c30
--- /dev/null
+++ b/config/config.php
@@ -0,0 +1,14 @@
+<?php
+/**
+ * Default configuration for Xhgui
+ */
+return array(
+ // Profile 1 in 100 requests.
+ // You can return true to profile every request.
+ 'profiler.enable' => function() {
+ return true;
+ //return rand(0, 100) === 42;
+ },
+
+
+);
diff --git a/src/bootstrap.php b/src/bootstrap.php
index c5fcc71..c3eaba3 100644
--- a/src/bootstrap.php
+++ b/src/bootstrap.php
@@ -1,4 +1,8 @@
<?php
+$_SERVER['DOCUMENT_ROOT'] = '/var/www/xhgui';
+$_SERVER['PHP_SELF'] = '/webroot/index.php';
+$_SERVER['SCRIPT_NAME'] = '/webroot/index.php';
+$_SERVER['DOCUMENT_ROOT'] = '/var/www/xhgui';
/**
* Boostrapping and common utility definition.
*/
diff --git a/webroot/index.php b/webroot/index.php
index dcf3800..e757a95 100644
--- a/webroot/index.php
+++ b/webroot/index.php
@@ -1,4 +1,5 @@
<?php
+ini_set('memory_limit', '512M');
require dirname(__DIR__) . '/src/bootstrap.php';
$di = new Xhgui_ServiceContainer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment