Skip to content

Commit

Permalink
JPATH_BASE and redundant _JDEFINES in index.php
Browse files Browse the repository at this point in the history
Where sense define custom JPATH_BASE in custom defines.php? Then, if move plugins/modules/etc dir, site will be broken and joomla update process not will be worked correctly. Also .css and .js from many plurins and modules, whatever, load from root "/" url.

Custom JPATH_BASE in custom defines.php - ok... And why define redundant _JDEFINES constant, when you can just use "if(){}else{}" construction? when defines.php must be included in any case!

#8281
  • Loading branch information
remoteshaman.com committed Nov 6, 2015
1 parent 2cfcc7c commit f8cb6d3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@
* define() is used in the installation folder rather than "const" to not error for PHP 5.2 and lower
*/
define('_JEXEC', 1);
define('JPATH_BASE', __DIR__);

if (file_exists(__DIR__ . '/defines.php'))
if (file_exists(JPATH_BASE . '/defines.php'))
{
include_once __DIR__ . '/defines.php';
}

if (!defined('_JDEFINES'))
{
define('JPATH_BASE', __DIR__);
include_once JPATH_BASE . '/defines.php';
} else {
require_once JPATH_BASE . '/includes/defines.php';
}

Expand Down

0 comments on commit f8cb6d3

Please sign in to comment.