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 deprecated isCli function #44611

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 all commits
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
17 changes: 0 additions & 17 deletions installation/src/Application/CliInstallationApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,4 @@ public function isClient($identifier)
{
return 'cli_installation' === $identifier;
}

/**
* Flag if the application instance is a CLI or web based application.
*
* Helper function, you should use the native PHP functions to detect if it is a CLI application.
*
* @return boolean
*
* @since 4.3.0
*
* @deprecated 4.3 will be removed in 5.0
* Use $app->isClient('cli_installation') instead
*/
public function isCli()
{
return $this->isClient('cli_installation');
}
}
17 changes: 0 additions & 17 deletions libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -1239,23 +1239,6 @@ public function checkToken($method = 'post')
return $session::checkToken($method);
}

/**
* Flag if the application instance is a CLI or web based application.
*
* Helper function, you should use the native PHP functions to detect if it is a CLI application.
*
* @return boolean
*
* @since 4.0.0
*
* @deprecated 4.0 will be removed in 6.0
* Will be removed without replacements
*/
public function isCli()
{
return false;
}

/**
* No longer used
*
Expand Down
14 changes: 0 additions & 14 deletions libraries/src/Application/CMSApplicationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,6 @@ public function getMessageQueue();
*/
public function isClient($identifier);

/**
* Flag if the application instance is a CLI or web based application.
*
* Helper function, you should use the native PHP functions to detect if it is a CLI application.
*
* @return boolean
*
* @since 4.0.0
*
* @deprecated 4.0 will be removed in 6.0
* Will be removed without replacement. CLI will be handled by the joomla/console package instead
*/
public function isCli();

/**
* Get the application identity.
*
Expand Down
17 changes: 0 additions & 17 deletions libraries/src/Application/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,23 +387,6 @@ public function isClient($identifier)
return $this->getName() === $identifier;
}

/**
* Flag if the application instance is a CLI or web based application.
*
* Helper function, you should use the native PHP functions to detect if it is a CLI application.
*
* @return boolean
*
* @since 4.0.0
*
* @deprecated 4.0 will be removed in 6.0
* Will be removed without replacement. CLI will be handled by the joomla/console package instead
*/
public function isCli()
{
return true;
}

/**
* Sets the session for the application to use, if required.
*
Expand Down
10 changes: 2 additions & 8 deletions libraries/src/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Joomla\CMS\User;

use Joomla\CMS\Access\Access;
use Joomla\CMS\Application\ConsoleApplication;
use Joomla\CMS\Event\User\AfterDeleteEvent;
use Joomla\CMS\Event\User\AfterSaveEvent;
use Joomla\CMS\Event\User\BeforeDeleteEvent;
Expand Down Expand Up @@ -745,15 +746,8 @@ public function save($updateOnly = false)
$iAmRehashingSuperadmin = true;
}

// Check if we are using a CLI application
$isCli = false;

if (Factory::getApplication()->isCli()) {
$isCli = true;
}

// We are only worried about edits to this account if I am not a Super Admin.
if ($iAmSuperAdmin != true && $iAmRehashingSuperadmin != true && $isCli != true) {
if ($iAmSuperAdmin != true && $iAmRehashingSuperadmin != true && !Factory::getApplication() instanceof ConsoleApplication) {
// I am not a Super Admin, and this one is, so fail.
if (!$isNew && Access::check($this->id, 'core.admin')) {
throw new \RuntimeException('User not Super Administrator');
Expand Down