From 20ca4e9e509a111f8de0069feeac54e3b31098ee Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Fri, 19 Apr 2013 13:28:19 +0100 Subject: [PATCH] Allow usage in a subdir of a host. --- README.rst | 6 ++++ data/config.default.php | 1 + data/config.php.dist | 1 + data/templates/base.htm | 29 ++++++++-------- data/templates/display-sidebar-history.htm | 2 +- data/templates/exception.htm | 5 +-- data/templates/forbidden.htm | 2 +- data/templates/fork-remote-multiple.htm | 2 +- data/templates/fork-remote-new.htm | 2 +- data/templates/login.htm | 6 ++-- data/templates/new.htm | 2 +- src/phorkie/File.php | 6 ++-- src/phorkie/Html/Pager.php | 2 +- src/phorkie/HtmlHelper.php | 4 +-- src/phorkie/Repository.php | 14 ++++---- src/phorkie/Search/Result.php | 2 +- src/phorkie/Tools.php | 4 +-- www/.htaccess | 40 +++++++++++----------- www/css/openid.css | 6 ++-- www/delete.php | 2 +- www/edit.php | 2 +- www/feed-new.php | 4 +-- www/feed-updated.php | 4 +-- www/fork-remote.php | 2 +- www/fork.php | 2 +- www/index.php | 2 +- www/list.php | 2 +- www/login.php | 12 +++---- www/new.php | 2 +- www/search.php | 2 +- www/www-header.php | 4 +++ 31 files changed, 95 insertions(+), 81 deletions(-) diff --git a/README.rst b/README.rst index ede03d0..0e8cadf 100644 --- a/README.rst +++ b/README.rst @@ -61,6 +61,12 @@ Installation Look at ``config.default.php`` for values that you may adjust. 5. Set your web server's document root to ``/path/to/phorkie/www/`` + Alternatively, you can add a symlink to the ``www`` folder into your + web server's existing document root tree (being careful to keep + main phorkie folder outside the document root for security purposes) + and ensure you set the ``baseurl`` config option appropriately. You + must also set the ``RewriteBase`` in the ``.htaccess`` file or adjust + the nginx configuration accordingly. 6. Open phorkie in your web browser diff --git a/data/config.default.php b/data/config.default.php index a589924..56ddc43 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -4,6 +4,7 @@ $GLOBALS['phorkie']['cfg'] = array( 'gitdir' => __DIR__ . '/../repos/git/', 'workdir' => __DIR__ . '/../repos/work/', 'tpl' => __DIR__ . '/templates/', + 'baseurl' => '/', 'css' => '', 'title' => 'phorkie', 'topbar' => '', diff --git a/data/config.php.dist b/data/config.php.dist index ced993f..77d2005 100644 --- a/data/config.php.dist +++ b/data/config.php.dist @@ -1,4 +1,5 @@ - + + - - - + + + {% if css %} {% endif %} {% block title %}{% endblock %} - {{title}} - - - + + + {% block meta %}{% endblock %} @@ -22,17 +23,17 @@