@@ -96,7 +96,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
96
96
*/
97
97
public function __construct ($ appName , $ urlParams = [], ServerContainer $ server = null ) {
98
98
parent ::__construct ();
99
- $ this ['AppName ' ] = $ appName ;
99
+ $ this ['appName ' ] = $ appName ;
100
100
$ this ['urlParams ' ] = $ urlParams ;
101
101
102
102
$ this ->registerAlias ('Request ' , IRequest::class);
@@ -109,9 +109,12 @@ public function __construct($appName, $urlParams = [], ServerContainer $server =
109
109
$ this ->server ->registerAppContainer ($ appName , $ this );
110
110
111
111
// aliases
112
- $ this ->registerAlias ('appName ' , 'AppName ' );
113
- $ this ->registerAlias ('webRoot ' , 'WebRoot ' );
114
- $ this ->registerAlias ('userId ' , 'UserId ' );
112
+ /** @deprecated inject $appName */
113
+ $ this ->registerAlias ('AppName ' , 'appName ' );
114
+ /** @deprecated inject $webRoot*/
115
+ $ this ->registerAlias ('WebRoot ' , 'webRoot ' );
116
+ /** @deprecated inject $userId */
117
+ $ this ->registerAlias ('UserId ' , 'userId ' );
115
118
116
119
/**
117
120
* Core services
@@ -158,11 +161,11 @@ public function __construct($appName, $urlParams = [], ServerContainer $server =
158
161
$ this ->registerAlias (IAppContainer::class, ContainerInterface::class);
159
162
160
163
// commonly used attributes
161
- $ this ->registerService ('UserId ' , function (ContainerInterface $ c ) {
164
+ $ this ->registerService ('userId ' , function (ContainerInterface $ c ) {
162
165
return $ c ->get (IUserSession::class)->getSession ()->get ('user_id ' );
163
166
});
164
167
165
- $ this ->registerService ('WebRoot ' , function (ContainerInterface $ c ) {
168
+ $ this ->registerService ('webRoot ' , function (ContainerInterface $ c ) {
166
169
return $ c ->get (IServerContainer::class)->getWebRoot ();
167
170
});
168
171
0 commit comments