Skip to content
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6cf2c32
Add deprecate messages for container access in the Factory
laoneo Nov 28, 2017
f9571d6
Fix grammer
wilsonge Feb 2, 2018
7c92c23
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Feb 19, 2018
f8e5223
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Mar 23, 2018
5e14d87
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Apr 7, 2018
5a8cc43
Merge branch '4.0-dev' into j4/deprecate/container
laoneo May 15, 2018
bbfdf9e
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Jun 20, 2018
823612d
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Jul 17, 2018
5aad517
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Aug 7, 2018
2ca60cb
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Aug 15, 2018
2601d70
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Aug 21, 2018
d589795
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Aug 23, 2018
9c3c135
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Aug 31, 2018
d6b808c
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Oct 17, 2018
e654022
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Nov 23, 2018
e460f03
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Dec 19, 2018
d495463
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Jan 10, 2019
b3265fe
Merge branch '4.0-dev' into j4/deprecate/container
laoneo Apr 18, 2019
bf39951
Revert deprecated tags and add better documentation
laoneo Apr 18, 2019
ebdff32
Merge branch '4.0-dev' into j4/deprecate/container
wilsonge Apr 18, 2019
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
16 changes: 16 additions & 0 deletions libraries/src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,22 @@ public static function getConfig($file = null, $type = 'PHP', $namespace = '')
*
* Returns the global service container object, only creating it if it doesn't already exist.
*
* This method is only suggested for use in code whose responsibility is to create new services
* and needs to be able to resolve the dependencies, and should therefore only be used when the
* container is not accessible by other means. Valid uses of this method include:
*
* - A static `getInstance()` method calling a factory service from the container,
* see `Joomla\CMS\Toolbar\Toolbar::getInstance()` as an example
* - An application front controller loading and executing the Joomla application class,
* see the `cli/joomla.php` file as an example
* - Retrieving optional constructor dependencies when not injected into a class during a transitional
* period to retain backward compatibility, in this case a deprecation notice should also be emitted to
* notify developers of changes needed in their code
*
* This method is not suggested for use as a one-for-one replacement of static calls, such as
* replacing calls to `Factory::getDbo()` with calls to `Factory::getContainer()->get('db')`, code
* should be refactored to support dependency injection instead of making this change.
*
* @return Container
*
* @since 4.0
Expand Down