6 use Psr\Log\LoggerInterface;
9 * This class is capable of getting all dynamic created classes
11 * There has to be a "method" phpDoc for each new class, containing result class for a proper matching
13 * @method static App app()
14 * @method static App\Authentication auth()
15 * @method static App\Arguments args()
16 * @method static App\BaseURL baseUrl()
17 * @method static App\Mode mode()
18 * @method static App\Module module()
19 * @method static App\Page page()
20 * @method static App\Router router()
21 * @method static Content\Item contentItem()
22 * @method static Content\Text\BBCode\Video bbCodeVideo()
23 * @method static Core\Cache\ICache cache()
24 * @method static Core\Config\IConfiguration config()
25 * @method static Core\Config\IPConfiguration pConfig()
26 * @method static Core\Lock\ILock lock()
27 * @method static Core\L10n\L10n l10n()
28 * @method static Core\Process process()
29 * @method static Core\Session\ISession session()
30 * @method static Database\Database dba()
31 * @method static Model\User\Cookie cookie()
32 * @method static Model\Notify notify()
33 * @method static Model\Introduction intro()
34 * @method static Protocol\Activity activity()
35 * @method static Util\ACLFormatter aclFormatter()
36 * @method static Util\DateTimeFormat dtFormat()
37 * @method static Util\FileSystem fs()
38 * @method static Util\Profiler profiler()
39 * @method static LoggerInterface logger()
40 * @method static LoggerInterface devLogger()
41 * @method static LoggerInterface workerLogger()
46 const CLASS_MAPPING = [
48 'auth' => App\Authentication::class,
49 'args' => App\Arguments::class,
50 'baseUrl' => App\BaseURL::class,
51 'mode' => App\Mode::class,
52 'module' => App\Module::class,
53 'page' => App\Page::class,
54 'router' => App\Router::class,
55 'contentItem' => Content\Item::class,
56 'bbCodeVideo' => Content\Text\BBCode\Video::class,
57 'cache' => Core\Cache\ICache::class,
58 'config' => Core\Config\IConfiguration::class,
59 'pConfig' => Core\Config\IPConfiguration::class,
60 'l10n' => Core\L10n\L10n::class,
61 'lock' => Core\Lock\ILock::class,
62 'process' => Core\Process::class,
63 'session' => Core\Session\ISession::class,
64 'dba' => Database\Database::class,
65 'cookie' => Model\User\Cookie::class,
66 'notify' => Model\Notify::class,
67 'intro' => Model\Introduction::class,
68 'activity' => Protocol\Activity::class,
69 'aclFormatter' => Util\ACLFormatter::class,
70 'dtFormat' => Util\DateTimeFormat::class,
71 'fs' => Util\FileSystem::class,
72 'workerLogger' => Util\Logger\WorkerLogger::class,
73 'profiler' => Util\Profiler::class,
74 'logger' => LoggerInterface::class,
75 'devLogger' => '$devLogger',
81 public static function init(Dice $dice)
86 public static function __callStatic($name, $arguments)
88 return self::$dice->create(self::CLASS_MAPPING[$name], $arguments);