Skip to content

Commit

Permalink
Allow CLI scripts to run from a symlinked site
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas K. Dionysopoulos committed Jul 12, 2019
1 parent 6cf6876 commit 0e22f4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions component/cli/datacompliance_account_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

define('_JEXEC', 1);

$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
// Setup and import the base CLI script
$curdir = __DIR__;
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';

if (file_exists($path))
{
Expand Down Expand Up @@ -41,7 +43,7 @@ public function execute()
// Logger format. "echo" passes the log message verbatim.
'logger' => 'callback',
'callback' => function (LogEntry $entry) {
$priorities = array(
$priorities = [
Log::EMERGENCY => 'EMERGENCY',
Log::ALERT => 'ALERT',
Log::CRITICAL => 'CRITICAL',
Expand All @@ -50,7 +52,7 @@ public function execute()
Log::NOTICE => 'NOTICE',
Log::INFO => 'INFO',
Log::DEBUG => 'DEBUG',
);
];

$priority = $priorities[$entry->priority];
$date = $entry->date->format(JText::_('DATE_FORMAT_FILTER_DATETIME'));
Expand Down
4 changes: 3 additions & 1 deletion component/cli/datacompliance_account_lifecycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

define('_JEXEC', 1);

$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
// Setup and import the base CLI script
$curdir = __DIR__;
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';

if (file_exists($path))
{
Expand Down
4 changes: 3 additions & 1 deletion component/cli/datacompliance_lifecycle_notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

define('_JEXEC', 1);

$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';
// Setup and import the base CLI script
$curdir = __DIR__;
$path = __DIR__ . '/../administrator/components/com_datacompliance/assets/cli/base.php';

if (file_exists($path))
{
Expand Down

0 comments on commit 0e22f4d

Please sign in to comment.