Fixes for installation in a path

This commit is contained in:
Timothy Warren 2015-06-04 19:31:36 -04:00
parent ef1cbea4d4
commit 4bb6ca9711
4 changed files with 21 additions and 6 deletions

View File

@ -27,12 +27,23 @@
| Base Url
|--------------------------------------------------------------------------
|
| This is the url path where the framework is located. Requires trailing
| This is the url path of the domain. Requires trailing
| slash.
|
*/
define('BASE_URL', '//' . $_SERVER['HTTP_HOST'] . '/');
/*
|--------------------------------------------------------------------------
| Base Path
|--------------------------------------------------------------------------
|
| This is the url path where the framework is located. Requires trailing
| slash.
|
*/
define('BASE_PATH', 'meta/');
/*
|--------------------------------------------------------------------------
| Url index file
@ -41,7 +52,7 @@ define('BASE_URL', '//' . $_SERVER['HTTP_HOST'] . '/');
| This determines whether "index.php" is in generated urls
|
*/
define('URL_INDEX_FILE', '');
define('URL_INDEX_FILE', BASE_PATH . 'index.php/');
/*
|--------------------------------------------------------------------------
@ -51,7 +62,7 @@ define('URL_INDEX_FILE', '');
| This is the domain used for serving content, such as css, javascript.
|
*/
define('CONTENT_DOMAIN', BASE_URL);
define('CONTENT_DOMAIN', BASE_URL . BASE_PATH);
/*
|--------------------------------------------------------------------------
@ -73,7 +84,7 @@ define('STATIC_LIB_PATH', CONTENT_DOMAIN.'assets/');
| stylesheet minifier. This should not need to be changed.
|
*/
define('STYLE_PATH', STATIC_LIB_PATH . 'css.php/g/');
define('STYLE_PATH', STATIC_LIB_PATH . 'css.php?g=');
/*
|--------------------------------------------------------------------------
@ -84,7 +95,7 @@ define('STYLE_PATH', STATIC_LIB_PATH . 'css.php/g/');
| javascript minifier. This should not need to be changed.
|
*/
define('SCRIPT_PATH', STATIC_LIB_PATH . 'js.php/g/');
define('SCRIPT_PATH', STATIC_LIB_PATH . 'js.php?g=');
/*

View File

@ -25,6 +25,8 @@ class genre extends \miniMVC\Controller {
*/
public function index()
{
//$this->data_model->create_tables();
$data = array();
$data['genres'] = $this->data_model->get_genres();

View File

@ -223,7 +223,7 @@ $_.ext('center', function (sel){
$_.event.live('#edit_form', 'submit', meta.update_item);
// WYSIWYG on section/data pages
if (document.getElementsByTagName('textarea') != null)
if (document.getElementsByTagName('textarea').length > 0)
{
meta.initTINY('val');
}

View File

@ -286,6 +286,8 @@ function route()
// get the incoming request URL path
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$path = str_replace(URL_INDEX_FILE, '', $path);
$path = str_replace(BASE_PATH, '', $path);
// get the route based on the path and server
$route = $router->match($path, $_SERVER);