Skip to content

Commit

Permalink
Add isCli removal chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Dec 12, 2024
1 parent 2dd3ea4 commit aac12de
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions migrations/54-60/removed-backward-incompatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,20 @@ echo $article->get('title');
$article = $app->bootComponent('content')->getMVCFactory()->createModel('Article', 'Administrator')->getItem(1);
echo $article->title;
```

### Removed isCli function in application classes

- PR: https://github.com/joomla/joomla-cms/pull/44611
- Files: libraries/src/Application/CMSApplicationInterface.php
- Description: The deprecated `isCli` got removed from the application classes. It was introduced as transient flag which was deprecated right from the beginning and should never be used anyway. If an extension was still using it, then adapt the code as described below
```php
// Old:
if ($app->isCli()) {
// Do your stuff
}

// New:
if ($app instanceof \Joomla\CMS\Application\ConsoleApplication) {
// Do your stuff
}
```

0 comments on commit aac12de

Please sign in to comment.