Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] Remove the JPATH_PLATFORM constant #44638

Open
wants to merge 3 commits into
base: 6.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove the JPATH_PLATFORM constant
  • Loading branch information
laoneo committed Dec 19, 2024
commit 88a7fb9ec116ad159d7cf7ee093298b5c0c44fc2
1 change: 0 additions & 1 deletion build/phpstan/joomla-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*/

\define('_JEXEC', 1);
\define('JPATH_PLATFORM', 1);
\define('JPATH_BASE', \dirname(__DIR__, 2));

// Load the Joomla environment
Expand Down
4 changes: 0 additions & 4 deletions build/psr12/clean_errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
"defined('_JEXEC') or die();",
"\defined('_JEXEC') or die;",
"defined('_JEXEC') or die;",
"\defined('JPATH_PLATFORM') or die();",
"defined('JPATH_PLATFORM') or die();",
"\defined('JPATH_PLATFORM') or die;",
"defined('JPATH_PLATFORM') or die;",
"\defined('JPATH_BASE') or die();",
"defined('JPATH_BASE') or die();",
"\defined('JPATH_BASE') or die;",
Expand Down
8 changes: 0 additions & 8 deletions libraries/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@

defined('_JEXEC') or die;

/**
* Set the platform root path as a constant if necessary.
*
* @deprecated 4.4.0 will be removed in 6.0
* Use defined('_JEXEC') or die; to detect if the CMS is loaded correctly
**/
defined('JPATH_PLATFORM') or define('JPATH_PLATFORM', __DIR__);

// Detect the native operating system type.
$os = strtoupper(substr(PHP_OS, 0, 3));

Expand Down
10 changes: 0 additions & 10 deletions libraries/cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@
E_USER_DEPRECATED
);

/**
* Set the platform root path as a constant if necessary.
*
* @deprecated 4.4.0 will be removed in 6.0
* Use defined('_JEXEC') or die; to detect if the CMS is loaded correctly
**/
if (!defined('JPATH_PLATFORM')) {
define('JPATH_PLATFORM', __DIR__);
}

// Import the library loader if necessary
if (!class_exists('JLoader')) {
require_once JPATH_LIBRARIES . '/loader.php';
Expand Down
10 changes: 0 additions & 10 deletions libraries/import.legacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
E_USER_DEPRECATED
);

/**
* Set the platform root path as a constant if necessary.
*
* @deprecated 4.4.0 will be removed in 6.0
* Use defined('_JEXEC') or die; to detect if the CMS is loaded correctly
**/
if (!defined('JPATH_PLATFORM')) {
define('JPATH_PLATFORM', __DIR__);
}

// Detect the native operating system type.
$os = strtoupper(substr(PHP_OS, 0, 3));

Expand Down
10 changes: 0 additions & 10 deletions libraries/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
E_USER_DEPRECATED
);

/**
* Set the platform root path as a constant if necessary.
*
* @deprecated 4.4.0 will be removed in 6.0
* Use defined('_JEXEC') or die; to detect if the CMS is loaded correctly
**/
if (!defined('JPATH_PLATFORM')) {
define('JPATH_PLATFORM', __DIR__);
}

// Detect the native operating system type.
$os = strtoupper(substr(PHP_OS, 0, 3));

Expand Down
2 changes: 1 addition & 1 deletion libraries/namespacemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected function writeNamespaceFile($elements)
$error_reporting = error_reporting(0);

try {
File::write($this->file, implode("\n", $content));
$b = implode("\n", $content);File::write($this->file, $b);
} catch (Exception $e) {
Log::add('Could not save ' . $this->file, Log::WARNING);

Expand Down
7 changes: 0 additions & 7 deletions tests/Unit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@
\define('JPATH_ROOT', JPATH_BASE);
}

/**
* @deprecated 4.4.0 will be removed in 6.0
**/
if (!\defined('JPATH_PLATFORM')) {
\define('JPATH_PLATFORM', JPATH_BASE . DIRECTORY_SEPARATOR . 'libraries');
}

if (!\defined('JPATH_LIBRARIES')) {
\define('JPATH_LIBRARIES', JPATH_BASE . DIRECTORY_SEPARATOR . 'libraries');
}
Expand Down