6 use Friendica\Core\Cache\ICache;
7 use Friendica\Core\Config\Configuration;
8 use Friendica\Core\Config\PConfiguration;
9 use Friendica\Core\L10n\L10n;
10 use Friendica\Core\Lock\ILock;
11 use Friendica\Core\Session\ISession;
12 use Friendica\Database\Database;
13 use Friendica\Model\Notify;
14 use Friendica\Protocol\Activity;
15 use Friendica\Util\ACLFormatter;
16 use Friendica\Content;
17 use Friendica\Util\DateTimeFormat;
18 use Friendica\Util\FileSystem;
19 use Friendica\Util\Logger\WorkerLogger;
20 use Friendica\Util\Profiler;
21 use Psr\Log\LoggerInterface;
24 * This class is capable of getting all dynamic created classes
26 * There has to be a "method" phpDoc for each new class, containing result class for a proper matching
28 * @method static App app()
29 * @method static ACLFormatter aclFormatter()
30 * @method static Notify notify()
31 * @method static Activity activity()
32 * @method static Content\Item contentItem()
33 * @method static Content\Text\BBCode\Video bbCodeVideo()
34 * @method static DateTimeFormat dtFormat()
35 * @method static ICache cache()
36 * @method static Configuration config()
37 * @method static PConfiguration pConfig()
38 * @method static ILock lock()
39 * @method static L10n l10n()
40 * @method static LoggerInterface logger()
41 * @method static LoggerInterface devLogger()
42 * @method static LoggerInterface workerLogger()
43 * @method static Profiler profiler()
44 * @method static ISession session()
45 * @method static App\Authentication auth()
46 * @method static App\Arguments args()
47 * @method static App\BaseURL baseUrl()
48 * @method static App\Mode mode()
49 * @method static App\Module module()
50 * @method static App\Page page()
51 * @method static App\Router router()
52 * @method static Database dba()
53 * @method static FileSystem fs()
58 const CLASS_MAPPING = [
60 'aclFormatter' => ACLFormatter::class,
61 'auth' => App\Authentication::class,
62 'args' => App\Arguments::class,
63 'baseUrl' => App\BaseURL::class,
64 'mode' => App\Mode::class,
65 'module' => App\Module::class,
66 'page' => App\Page::class,
67 'router' => App\Router::class,
68 'notify' => Notify::class,
69 'activity' => Activity::class,
70 'contentItem' => Content\Item::class,
71 'bbCodeVideo' => Content\Text\BBCode\Video::class,
72 'dtFormat' => DateTimeFormat::class,
73 'cache' => ICache::class,
74 'config' => Configuration::class,
75 'pConfig' => PConfiguration::class,
76 'l10n' => L10n::class,
77 'lock' => ILock::class,
78 'logger' => LoggerInterface::class,
79 'workerLogger' => WorkerLogger::class,
80 'devLogger' => '$devLogger',
81 'session' => ISession::class,
82 'dba' => Database::class,
83 'fs' => FileSystem::class,
84 'profiler' => Profiler::class,
90 public static function init(Dice $dice)
95 public static function __callStatic($name, $arguments)
97 return self::$dice->create(self::CLASS_MAPPING[$name], $arguments);