Skip to content

Commit 0e22f4d

Browse files
author
Nicholas K. Dionysopoulos
committed
Allow CLI scripts to run from a symlinked site
1 parent 6cf6876 commit 0e22f4d

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

component/cli/datacompliance_account_delete.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
define('_JEXEC', 1);
1313

14-
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
14+
// Setup and import the base CLI script
15+
$curdir = __DIR__;
16+
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
1517

1618
if (file_exists($path))
1719
{
@@ -41,7 +43,7 @@ public function execute()
4143
// Logger format. "echo" passes the log message verbatim.
4244
'logger' => 'callback',
4345
'callback' => function (LogEntry $entry) {
44-
$priorities = array(
46+
$priorities = [
4547
Log::EMERGENCY => 'EMERGENCY',
4648
Log::ALERT => 'ALERT',
4749
Log::CRITICAL => 'CRITICAL',
@@ -50,7 +52,7 @@ public function execute()
5052
Log::NOTICE => 'NOTICE',
5153
Log::INFO => 'INFO',
5254
Log::DEBUG => 'DEBUG',
53-
);
55+
];
5456

5557
$priority = $priorities[$entry->priority];
5658
$date = $entry->date->format(JText::_('DATE_FORMAT_FILTER_DATETIME'));

component/cli/datacompliance_account_lifecycle.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
define('_JEXEC', 1);
1212

13-
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
13+
// Setup and import the base CLI script
14+
$curdir = __DIR__;
15+
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
1416

1517
if (file_exists($path))
1618
{

component/cli/datacompliance_lifecycle_notify.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
define('_JEXEC', 1);
1515

16-
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
16+
// Setup and import the base CLI script
17+
$curdir = __DIR__;
18+
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
1719

1820
if (file_exists($path))
1921
{

0 commit comments

Comments
 (0)