Elgg  Version 4.3
PublicContainer.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Di;
4 
29 
33  public function __call($name, $arguments) {
34  $proxies = [
35  'echo' => ['translator', 'translate'],
36  ];
37 
38  if (!empty($proxies[$name])) {
39  $svc = $proxies[$name][0];
40  $method = $proxies[$name][1];
41 
42  elgg_deprecated_notice('Using the proxy elgg()->echo() has been deprecated. Use elgg_echo or elgg()->translator->translate()', '4.1');
43 
44  return call_user_func_array([$this->$svc, $method], $arguments);
45  }
46  }
47 
51  public static function getDefinitionSources(): array {
52  return [\Elgg\Project\Paths::elgg() . 'engine/public_services.php'];
53  }
54 }
static elgg()
Get the Elgg codebase path with "/".
Definition: Paths.php:44
elgg_deprecated_notice(string $msg, string $dep_version)
Log a notice about deprecated use of a function, view, etc.
Definition: deprecation.php:52
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
Base DI Container class.
Definition: DiContainer.php:13
__call($name, $arguments)
{}