Deprecated Code Reference (ongoing)

Deprecated Code Reference (ongoing)

This doc holds a reference list of commonly used code that is deprecated, and their replacements. These functions may still work and exist now, but can be removed from future versions of concrete5 and thus cause problems in the future.

This is a work in progress. This list will change as new functions are found and new versions are released.

Note:

In the replacements you will sometimes find references to $app. You can access the application in some controllers with $this->app, or if it’s not available, retrieve it with:

Class Aliases

Version 5.7 introduced class aliases to make some of the commonly used core code easily available for developers. This idea was mostly due to the old 5.6 architecture where this was very common. This has, however, caused more confusion than benefit since people are finding it hard to follow where the code originates from.

Therefore, class aliases have been deprecated and full namespaces should be used in the future. A full list of aliases can be found from the concrete/config/app.php file.

PageController::post() - deprecated since 5.7

PageController::get() can still be used to fetch the variables that have been made available through PageController::set(). In case you are fetching HTTP request parameters, you should be using the above method insteead.

Permissions

FilePermissions::getGlobal() - deprecated since 5.7

replacement:

$fp = new Permissions(FileSet::getGlobal());

TaskPermission() - deprecated since 5.7

replacement:

$tp = new Permissions();

Request

Request::getInstance()

replacement:

$r = $app->make(\Concrete\Core\Http\Request::class);

UserInfo

UserInfo::getByID()

Marketplace Packages

If you are developing packages for the marketplace, please note that unless stated otherwise, the above guidance refers to the latest concrete5 core version. If your marketplace package provides compatibility with previous core versions, you may need to use deprecated code in order to maintain backward compatibility with both the core API and supported PHP versions.

Full list from source

Unfortunately this page can lag behind the status of the current concrete5 core.
From the linux command line, you can get a list of lines by navigating to the /concrete/ directory and running: