Skip to content

Commit

Permalink
trying to make this more portable
Browse files Browse the repository at this point in the history
  • Loading branch information
pjkix committed Mar 11, 2010
1 parent 5d61346 commit d8e1f6d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 41 deletions.
38 changes: 21 additions & 17 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?php
require_once('helpers/utility.php');
require_once('helpers/router.php');
require_once('config/config.php');
require_once('controllers/controller.php');
require_once('config/routes.php');



mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');

session_start();
<?php
// set inc path
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(__FILE__) );
chdir (dirname(__FILE__));

require_once('helpers/utility.php');
require_once('helpers/router.php');
require_once('config/config.php');
require_once('controllers/controller.php');
require_once('config/routes.php');



mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');

session_start();
3 changes: 2 additions & 1 deletion config/config.default.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
<?php
<?php
// this is no longer needed
define("SITE_PATH","/path/to/site");
44 changes: 23 additions & 21 deletions htdocs/_htaccess.default
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
php_value include_path .:/usr/local/php/lib/php:/path/to/my/site
php_value auto_prepend_file bootstrap.php
php_value magic_quotes_gpc 0
php_value register_globals 0

Options +FollowSymlinks

RewriteEngine on

#any URL request that doesn't have an extension will be redirected to index.php
RewriteRule !\.[a-z]{2,7}$ index.php

ErrorDocument 404 /404.php

<Files ~ "\.htaccess">
Order allow,deny
Deny from all
</Files>

#hopefully you aren't still using SVN?!?! :)
RedirectMatch 404 \.svn/?$
# THIS IS NO LONGER NEEDED!

php_value include_path .:/usr/local/php/lib/php:/path/to/my/site
php_value auto_prepend_file bootstrap.php
php_value magic_quotes_gpc 0
php_value register_globals 0

Options +FollowSymlinks

RewriteEngine on

#any URL request that doesn't have an extension will be redirected to index.php
RewriteRule !\.[a-z]{2,7}$ index.php

ErrorDocument 404 /404.php

<Files ~ "\.htaccess">
Order allow,deny
Deny from all
</Files>

#hopefully you aren't still using SVN?!?! :)
RedirectMatch 404 \.svn/?$
5 changes: 3 additions & 2 deletions htdocs/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php
router::route();
<?php
require_once '../bootstrap.php';
router::route();
exit;

0 comments on commit d8e1f6d

Please sign in to comment.