Elgg  Version 3.0
ServiceProvider.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Di;
4 
13 use Elgg\Config;
14 use Elgg\Cron;
18 use Elgg\Invoker;
19 use Elgg\Logger;
25 
134 
141  public function __construct(Config $config) {
142 
143  $this->setFactory('autoloadManager', function(ServiceProvider $c) {
144  $manager = new \Elgg\AutoloadManager($c->classLoader);
145 
146  if (!$c->config->AutoloaderManager_skip_storage) {
147  $manager->setCache($c->fileCache);
148  $manager->loadCache();
149  }
150 
151  return $manager;
152  });
153 
154  $this->setFactory('accessCache', function(ServiceProvider $c) {
155  return $this->sessionCache->access;
156  });
157 
158  $this->setFactory('accessCollections', function(ServiceProvider $c) {
159  return new \Elgg\Database\AccessCollections(
160  $c->config,
161  $c->db,
162  $c->entityTable,
163  $c->userCapabilities,
164  $c->accessCache,
165  $c->hooks,
166  $c->session,
167  $c->translator
168  );
169  });
170 
171  $this->setFactory('actions', function(ServiceProvider $c) {
172  return new \Elgg\ActionsService($c->routes, $c->handlers);
173  });
174 
175  $this->setFactory('accounts', function(ServiceProvider $c) {
176  return new \Elgg\Users\Accounts($c->config, $c->translator, $c->passwords, $c->usersTable, $c->hooks);
177  });
178 
179  $this->setClassName('adminNotices', \Elgg\Database\AdminNotices::class);
180 
181  $this->setFactory('ajax', function(ServiceProvider $c) {
182  return new \Elgg\Ajax\Service($c->hooks, $c->systemMessages, $c->request, $c->amdConfig);
183  });
184 
185  $this->setFactory('amdConfig', function(ServiceProvider $c) {
186  $obj = new \Elgg\Amd\Config($c->hooks);
187  $obj->setBaseUrl($c->simpleCache->getRoot());
188  return $obj;
189  });
190 
191  $this->setFactory('annotationsTable', function(ServiceProvider $c) {
192  return new \Elgg\Database\AnnotationsTable($c->db, $c->events);
193  });
194 
195  $this->setClassName('autoP', \ElggAutoP::class);
196 
197  $this->setFactory('boot', function (ServiceProvider $c) {
199  $cache = new CompositeCache("elgg_boot", $c->config, $flags);
200  $boot = new \Elgg\BootService($cache);
201  if ($c->config->enable_profiling) {
202  $boot->setTimer($c->timer);
203  }
204  return $boot;
205  });
206 
207  $this->setFactory('cacheHandler', function(ServiceProvider $c) {
208  $simplecache_enabled = $c->config->simplecache_enabled;
209  if ($simplecache_enabled === null) {
210  $simplecache_enabled = $c->configTable->get('simplecache_enabled');
211  }
212  return new \Elgg\Application\CacheHandler($c->config, $c->request, $simplecache_enabled);
213  });
214 
215  $this->setFactory('cssCompiler', function(ServiceProvider $c) {
216  return new CssCompiler($c->config, $c->hooks);
217  });
218 
219  $this->setFactory('csrf', function(ServiceProvider $c) {
220  return new Csrf(
221  $c->config,
222  $c->session,
223  $c->crypto,
224  $c->hmac
225  );
226  });
227 
228  $this->setFactory('classLoader', function(ServiceProvider $c) {
229  $loader = new \Elgg\ClassLoader(new \Elgg\ClassMap());
230  $loader->register();
231  return $loader;
232  });
233 
234  $this->setFactory('cli', function(ServiceProvider $c) {
235  $version = elgg_get_version(true);
236 
237  $console = new \Elgg\Cli\Application('Elgg', $version);
238  $console->setup($c->cli_input, $c->cli_output);
239 
240  return new \Elgg\Cli(
241  $console,
242  $c->hooks,
243  $c->cli_input,
244  $c->cli_output
245  );
246  });
247 
248  $this->setFactory('cli_input', function(ServiceProvider $c) {
249  return Application::getStdIn();
250  });
251 
252  $this->setFactory('cli_output', function(ServiceProvider $c) {
253  return Application::getStdOut();
254  });
255 
256  $this->setFactory('cli_progress', function(ServiceProvider $c) {
257  return new Progress($c->cli_output);
258  });
259 
260  $this->setFactory('config', function (ServiceProvider $sp) use ($config) {
261  $this->initConfig($config, $sp);
262  return $config;
263  });
264 
265  $this->setFactory('configTable', function(ServiceProvider $c) {
266  return new \Elgg\Database\ConfigTable($c->db, $c->boot, $c->logger);
267  });
268 
269  $this->setFactory('cron', function(ServiceProvider $c) {
270  return new Cron($c->hooks, $c->logger, $c->events);
271  });
272 
273  $this->setClassName('crypto', \ElggCrypto::class);
274 
275  $this->setFactory('dataCache', function (ServiceProvider $c) {
276  return new DataCache($c->config);
277  });
278 
279  $this->setFactory('db', function (ServiceProvider $c) {
280  $db = new \Elgg\Database($c->dbConfig, $c->queryCache);
281  $db->setLogger($c->logger);
282 
283  if ($c->config->profiling_sql) {
284  $db->setTimer($c->timer);
285  }
286 
287  return $db;
288  });
289 
290  $this->setFactory('dbConfig', function(ServiceProvider $c) {
291  $config = $c->config;
292  $db_config = \Elgg\Database\DbConfig::fromElggConfig($config);
293 
294  // get this stuff out of config!
295  unset($config->db);
296  unset($config->dbname);
297  unset($config->dbhost);
298  unset($config->dbuser);
299  unset($config->dbpass);
300 
301  return $db_config;
302  });
303 
304  $this->setFactory('deprecation', function(ServiceProvider $c) {
305  return new \Elgg\DeprecationService($c->logger);
306  });
307 
308  $this->setFactory('dic', function (ServiceProvider $c) {
309  $definitions = $c->dic_loader->getDefinitions();
310  foreach ($definitions as $definition) {
311  $c->dic_builder->addDefinitions($definition);
312  }
313  return $c->dic_builder->build();
314  });
315 
316  $this->setFactory('dic_builder', function(ServiceProvider $c) {
317  $dic_builder = new ContainerBuilder(PublicContainer::class);
318  $dic_builder->useAnnotations(false);
319  $dic_builder->setDefinitionCache($c->dic_cache);
320 
321  return $dic_builder;
322  });
323 
324  $this->setFactory('dic_cache', function (ServiceProvider $c) {
325  $cache = new CompositeCache(
326  'dic',
327  $c->config,
332  );
333 
334  return new \Elgg\Di\DefinitionCache($cache);
335  });
336 
337  $this->setFactory('dic_loader', function(ServiceProvider $c) {
338  return new \Elgg\Di\DefinitionLoader($c->plugins);
339  });
340 
341  $this->setFactory('emails', function(ServiceProvider $c) {
342  return new \Elgg\EmailService($c->config, $c->hooks, $c->mailer, $c->logger);
343  });
344 
345  $this->setFactory('entityCache', function(ServiceProvider $c) {
346  return new \Elgg\Cache\EntityCache($c->session, $c->sessionCache->entities);
347  });
348 
349  $this->setFactory('entityPreloader', function(ServiceProvider $c) {
350  return new \Elgg\EntityPreloader($c->entityTable);
351  });
352 
353  $this->setFactory('entityTable', function(ServiceProvider $c) {
354  return new \Elgg\Database\EntityTable(
355  $c->config,
356  $c->db,
357  $c->entityCache,
358  $c->metadataCache,
359  $c->privateSettingsCache,
360  $c->events,
361  $c->session,
362  $c->translator,
363  $c->logger
364  );
365  });
366 
367  $this->setFactory('events', function(ServiceProvider $c) {
368  $events = new \Elgg\EventsService($c->handlers);
369  if ($c->config->enable_profiling) {
370  $events->setTimer($c->timer);
371  }
372 
373  return $events;
374  });
375 
376  $this->setClassName('externalFiles', \Elgg\Assets\ExternalFiles::class);
377 
378  $this->setFactory('fileCache', function(ServiceProvider $c) {
380  return new CompositeCache("elgg_system_cache", $c->config, $flags);
381  });
382 
383  $this->setFactory('filestore', function(ServiceProvider $c) {
384  return new \ElggDiskFilestore($c->config->dataroot);
385  });
386 
387  $this->setFactory('forms', function(ServiceProvider $c) {
388  return new \Elgg\FormsService($c->views, $c->logger);
389  });
390 
391  $this->setFactory('gatekeeper', function(ServiceProvider $c) {
392  return new \Elgg\Gatekeeper(
393  $c->session,
394  $c->request,
395  $c->redirects,
396  $c->entityTable,
397  $c->accessCollections,
398  $c->translator
399  );
400  });
401 
402  $this->setFactory('group_tools', function(ServiceProvider $c) {
403  return new Tools($c->hooks);
404  });
405 
406  $this->setClassName('handlers', \Elgg\HandlersService::class);
407 
408  $this->setFactory('hmac', function(ServiceProvider $c) {
409  return new \Elgg\Security\HmacFactory($c->siteSecret, $c->crypto);
410  });
411 
412  $this->setFactory('html_formatter', function(ServiceProvider $c) {
413  return new \Elgg\Views\HtmlFormatter(
414  $c->logger,
415  $c->views,
416  $c->hooks,
417  $c->autoP
418  );
419  });
420 
421  $this->setFactory('hooks', function(ServiceProvider $c) {
422  return new \Elgg\PluginHooksService($c->events);
423  });
424 
425  $this->setFactory('iconService', function(ServiceProvider $c) {
426  return new \Elgg\EntityIconService($c->config, $c->hooks, $c->request, $c->logger, $c->entityTable, $c->uploads, $c->imageService);
427  });
428 
429  $this->setFactory('imageService', function(ServiceProvider $c) {
430  switch ($c->config->image_processor) {
431  case 'imagick':
432  if (extension_loaded('imagick')) {
433  $imagine = new \Imagine\Imagick\Imagine();
434  break;
435  }
436  default:
437  // default use GD
438  $imagine = new \Imagine\Gd\Imagine();
439  break;
440  }
441 
442  return new \Elgg\ImageService($imagine, $c->config);
443  });
444 
445  $this->setFactory('invoker', function(ServiceProvider $c) {
446  return new Invoker($c->session, $c->dic);
447  });
448 
449  $this->setFactory('localeService', function(ServiceProvider $c) {
450  return new LocaleService($c->config);
451  });
452 
453  $this->setFactory('logger', function (ServiceProvider $c) {
454  $logger = Logger::factory($c->cli_input, $c->cli_output);
455 
456  $logger->setLevel($c->config->debug);
457  $logger->setHooks($c->hooks);
458 
459  return $logger;
460  });
461 
462  $this->setClassName('mailer', 'Zend\Mail\Transport\Sendmail');
463 
464  $this->setFactory('menus', function(ServiceProvider $c) {
465  return new \Elgg\Menu\Service($c->hooks, $c->config);
466  });
467 
468  $this->setFactory('metadataCache', function (ServiceProvider $c) {
469  $cache = $c->dataCache->metadata;
470  return new \Elgg\Cache\MetadataCache($cache);
471  });
472 
473  $this->setFactory('metadataTable', function(ServiceProvider $c) {
474  // TODO(ewinslow): Use Pool instead of MetadataCache for caching
475  return new \Elgg\Database\MetadataTable($c->metadataCache, $c->db, $c->events);
476  });
477 
478  $this->setFactory('mutex', function(ServiceProvider $c) {
479  return new \Elgg\Database\Mutex(
480  $c->db,
481  $c->logger
482  );
483  });
484 
485  $this->setFactory('notifications', function(ServiceProvider $c) {
486  // @todo move queue in service provider
488  $queue = new \Elgg\Queue\DatabaseQueue($queue_name, $c->db);
489  $sub = new \Elgg\Notifications\SubscriptionsService($c->db);
490  return new \Elgg\Notifications\NotificationsService($sub, $queue, $c->hooks, $c->session, $c->translator, $c->entityTable, $c->logger);
491  });
492 
493  $this->setFactory('persistentLogin', function(ServiceProvider $c) {
494  $global_cookies_config = $c->config->getCookieConfig();
495  $cookie_config = $global_cookies_config['remember_me'];
496  $cookie_name = $cookie_config['name'];
497  $cookie_token = $c->request->cookies->get($cookie_name, '');
498  return new \Elgg\PersistentLoginService(
499  $c->db, $c->session, $c->crypto, $cookie_config, $cookie_token);
500  });
501 
502  $this->setClassName('passwords', \Elgg\PasswordService::class);
503 
504  $this->setFactory('plugins', function(ServiceProvider $c) {
505  $cache = new CompositeCache('plugins', $c->config, ELGG_CACHE_RUNTIME);
506  $plugins = new \Elgg\Database\Plugins(
507  $cache,
508  $c->db,
509  $c->session,
510  $c->events,
511  $c->translator,
512  $c->views,
513  $c->privateSettingsCache,
514  $c->config,
515  $c->systemMessages,
516  $c->request->getContextStack()
517  );
518  if ($c->config->enable_profiling) {
519  $plugins->setTimer($c->timer);
520  }
521  return $plugins;
522  });
523 
524  $this->setFactory('privateSettingsCache', function(ServiceProvider $c) {
525  $cache = $c->dataCache->private_settings;
526  return new \Elgg\Cache\PrivateSettingsCache($cache);
527  });
528 
529  $this->setFactory('privateSettings', function (ServiceProvider $c) {
530  return new \Elgg\Database\PrivateSettingsTable($c->db, $c->entityTable, $c->privateSettingsCache);
531  });
532 
533  $this->setFactory('publicDb', function(ServiceProvider $c) {
534  return new \Elgg\Application\Database($c->db);
535  });
536 
537  $this->setFactory('queryCache', function(ServiceProvider $c) {
538  // @todo maybe make this a configurable value
539  $cache_size = 50;
540 
541  $config_disabled = $c->config->db_disable_query_cache === true;
542 
543  $cache = new \Elgg\Cache\QueryCache($cache_size, $config_disabled);
544  $cache->setLogger($c->logger);
545 
546  return $cache;
547  });
548 
549  $this->setFactory('redirects', function(ServiceProvider $c) {
551  $is_xhr = $c->request->isXmlHttpRequest();
552  return new \Elgg\RedirectService($c->session, $is_xhr, $c->config->wwwroot, $url);
553  });
554 
555  $this->setFactory('relationshipsTable', function(ServiceProvider $c) {
556  return new \Elgg\Database\RelationshipsTable($c->db, $c->entityTable, $c->metadataTable, $c->events);
557  });
558 
559  $this->setFactory('request', [\Elgg\Http\Request::class, 'createFromGlobals']);
560 
561  $this->setFactory('requestContext', function(ServiceProvider $c) {
562  $context = new \Elgg\Router\RequestContext();
563  $context->fromRequest($c->request);
564  return $context;
565  });
566 
567  $this->setFactory('responseFactory', function(ServiceProvider $c) {
568  $transport = Application::getResponseTransport();
569  return new \Elgg\Http\ResponseFactory($c->request, $c->hooks, $c->ajax, $transport, $c->events);
570  });
571 
572  $this->setFactory('routeCollection', function(ServiceProvider $c) {
573  return new \Elgg\Router\RouteCollection();
574  });
575 
576  $this->setFactory('routes', function(ServiceProvider $c) {
577  return new RouteRegistrationService(
578  $c->hooks,
579  $c->logger,
580  $c->routeCollection,
581  $c->urlGenerator
582  );
583  });
584 
585  $this->setFactory('router', function (ServiceProvider $c) {
586  $router = new \Elgg\Router(
587  $c->hooks,
588  $c->routeCollection,
589  $c->urlMatcher,
590  $c->handlers,
591  $c->responseFactory
592  );
593  if ($c->config->enable_profiling) {
594  $router->setTimer($c->timer);
595  }
596 
597  return $router;
598  });
599 
600  $this->setFactory('search', function(ServiceProvider $c) {
601  return new \Elgg\Search\SearchService($c->config, $c->hooks, $c->db);
602  });
603 
604  $this->setFactory('seeder', function(ServiceProvider $c) {
605  return new \Elgg\Database\Seeder($c->hooks, $c->cli_progress);
606  });
607 
608  $this->setFactory('serveFileHandler', function(ServiceProvider $c) {
609  return new \Elgg\Application\ServeFileHandler($c->hmac, $c->config);
610  });
611 
612  $this->setFactory('session', function(ServiceProvider $c) {
613  return \ElggSession::fromDatabase($c->config, $c->db);
614  });
615 
616  $this->setFactory('sessionCache', function (ServiceProvider $c) {
617  return new SessionCache($c->config);
618  });
619 
620  $this->initSiteSecret($config);
621 
622  $this->setFactory('simpleCache', function(ServiceProvider $c) {
623  return new \Elgg\Cache\SimpleCache($c->config, $c->views);
624  });
625 
626  $this->setClassName('stickyForms', \Elgg\Forms\StickyForms::class);
627 
628  $this->setFactory('systemCache', function (ServiceProvider $c) {
629  $cache = new \Elgg\Cache\SystemCache($c->fileCache, $c->config);
630  if ($c->config->enable_profiling) {
631  $cache->setTimer($c->timer);
632  }
633  return $cache;
634  });
635 
636  $this->setFactory('systemMessages', function(ServiceProvider $c) {
637  return new \Elgg\SystemMessagesService($c->session);
638  });
639 
640  $this->setClassName('table_columns', \Elgg\Views\TableColumn\ColumnFactory::class);
641 
642  $this->setClassName('temp_filestore', \ElggTempDiskFilestore::class);
643 
644  $this->setClassName('timer', \Elgg\Timer::class);
645 
646  $this->setFactory('translator', function(ServiceProvider $c) {
647  return new \Elgg\I18n\Translator($c->config, $c->localeService);
648  });
649 
650  $this->setFactory('uploads', function(ServiceProvider $c) {
651  return new \Elgg\UploadService($c->request);
652  });
653 
654  $this->setFactory('upgrades', function(ServiceProvider $c) {
655  return new \Elgg\UpgradeService(
656  $c->upgradeLocator,
657  $c->translator,
658  $c->events,
659  $c->config,
660  $c->logger,
661  $c->mutex,
662  $c->systemMessages,
663  $c->cli_progress
664  );
665  });
666 
667  $this->setFactory('urlGenerator', function(ServiceProvider $c) {
668  return new \Elgg\Router\UrlGenerator(
669  $c->routeCollection,
670  $c->requestContext
671  );
672  });
673 
674  $this->setFactory('urlMatcher', function(ServiceProvider $c) {
675  return new \Elgg\Router\UrlMatcher(
676  $c->routeCollection,
677  $c->requestContext
678  );
679  });
680 
681  $this->setClassName('urlSigner', \Elgg\Security\UrlSigner::class);
682 
683  $this->setFactory('userCapabilities', function(ServiceProvider $c) {
684  return new \Elgg\UserCapabilities($c->hooks, $c->entityTable, $c->session);
685  });
686 
687  $this->setFactory('usersTable', function(ServiceProvider $c) {
688  return new \Elgg\Database\UsersTable(
689  $c->config,
690  $c->db,
691  $c->metadataTable
692  );
693  });
694 
695  $this->setFactory('upgradeLocator', function(ServiceProvider $c) {
696  return new \Elgg\Upgrade\Locator(
697  $c->plugins,
698  $c->logger
699  );
700  });
701 
702  $this->setFactory('views', function(ServiceProvider $c) {
703  return new \Elgg\ViewsService($c->hooks, $c->logger, $c->request);
704  });
705 
706  $this->setFactory('viewCacher', function(ServiceProvider $c) {
707  return new \Elgg\Cache\ViewCacher($c->views, $c->config);
708  });
709 
710  $this->setClassName('widgets', \Elgg\WidgetsService::class);
711  }
712 
719  protected function initSiteSecret(Config $config) {
720  // Try the config, because if it's there we want to remove it to isolate who can see it.
721  $secret = SiteSecret::fromConfig($config);
722  if ($secret) {
723  $this->setValue('siteSecret', $secret);
724  $config->elgg_config_set_secret = true;
725  return;
726  }
727 
728  $this->setFactory('siteSecret', function (ServiceProvider $c) {
729  return SiteSecret::fromDatabase($c->configTable);
730  });
731  }
732 
742  public function initConfig(Config $config, ServiceProvider $sp) {
743  if ($config->elgg_config_locks === null) {
744  $config->elgg_config_locks = true;
745  }
746 
747  if ($config->elgg_config_locks) {
748  $lock = function ($name) use ($config) {
749  $config->lock($name);
750  };
751  } else {
752  // the installer needs to build an application with defaults then update
753  // them after they're validated, so we don't want to lock them.
754  $lock = function () {
755  };
756  }
757 
758  $sp->timer->begin([]);
759 
760  if ($config->dataroot) {
761  $config->dataroot = Paths::sanitize($config->dataroot);
762  } else {
763  if (!$config->installer_running) {
764  throw new ConfigurationException('Config value "dataroot" is required.');
765  }
766  }
767  $lock('dataroot');
768 
769  if ($config->cacheroot) {
770  $config->cacheroot = Paths::sanitize($config->cacheroot);
771  } else {
772  $config->cacheroot = Paths::sanitize($config->dataroot . 'caches');
773  }
774  $lock('cacheroot');
775 
776  if ($config->assetroot) {
777  $config->assetroot = Paths::sanitize($config->assetroot);
778  } else {
779  $config->assetroot = Paths::sanitize($config->cacheroot . 'views_simplecache');
780  }
781  $lock('assetroot');
782 
783  if ($config->wwwroot) {
784  $config->wwwroot = rtrim($config->wwwroot, '/') . '/';
785  } else {
786  $config->wwwroot = $sp->request->sniffElggUrl();
787  }
788  $lock('wwwroot');
789 
790  if (!$config->language) {
791  $config->language = Application::DEFAULT_LANG;
792  }
793 
794  if ($config->default_limit) {
795  $lock('default_limit');
796  } else {
797  $config->default_limit = Application::DEFAULT_LIMIT;
798  }
799 
800  if ($config->plugins_path) {
801  $plugins_path = rtrim($config->plugins_path, '/') . '/';
802  } else {
803  $plugins_path = Paths::project() . 'mod/';
804  }
805 
806  $locked_props = [
807  'site_guid' => 1,
808  'path' => Paths::project(),
809  'plugins_path' => $plugins_path,
810  'pluginspath' => $plugins_path,
811  'url' => $config->wwwroot,
812  ];
813  foreach ($locked_props as $name => $value) {
814  $config->$name = $value;
815  $lock($name);
816  }
817 
818  // move sensitive credentials into isolated services
819  $sp->setValue('dbConfig', DbConfig::fromElggConfig($config));
820 
821  // get this stuff out of config!
822  unset($config->db);
823  unset($config->dbname);
824  unset($config->dbhost);
825  unset($config->dbuser);
826  unset($config->dbpass);
827 
828  $config->boot_complete = false;
829  }
830 }
static fromDatabase(ConfigTable $table)
Create from config/storage.
Definition: SiteSecret.php:125
static project()
Get the project root (where composer is installed) path with "/".
Definition: Paths.php:25
$context
Definition: add.php:8
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
static fromElggConfig(Config $config)
Construct from an Elgg Config.
Definition: DbConfig.php:52
initSiteSecret(Config $config)
Extract the site secret from config or set up its factory.
__construct(Config $config)
Constructor.
Container holding values which can be resolved upon reading and optionally stored and shared across r...
Definition: DiContainer.php:29
static getStdOut()
Load console output interface.
static factory(InputInterface $input=null, OutputInterface $output=null)
Build a new logger.
Definition: Logger.php:82
Group tools service.
Definition: Tools.php:14
current_page_url()
Returns the current page&#39;s complete URL.
Definition: input.php:94
$plugins
Definition: categories.php:3
initConfig(Config $config, ServiceProvider $sp)
Validate, normalize, fill in missing values, and lock some.
A map of class names to absolute file paths.
Definition: ClassMap.php:13
$config
Advanced site settings, debugging section.
Definition: debugging.php:6
Provides locale related features.
const ELGG_CACHE_APC
Definition: constants.php:151
Composite cache pool.
Cron.
Definition: Cron.php:14
Configuration exception.
const ELGG_CACHE_RUNTIME
Definition: constants.php:148
static getResponseTransport()
Build a transport for sending responses.
lock($name)
Make a value read-only.
Definition: Config.php:427
static fromConfig(ElggConfig $config)
Create from a config value.
Definition: SiteSecret.php:141
CLI Progress reporter.
Definition: Progress.php:11
setClassName($name, $class_name, $shared=true)
Set a factory based on instantiating a class with no arguments.
$url
Definition: default.php:33
setValue($name, $value)
Set a value to be returned without modification.
Definition: DiContainer.php:92
Compile CSS with CSSCrush.
Definition: CssCompiler.php:15
static getStdIn()
Load console input interface.
$value
Definition: debugging.php:7
setFactory($name, $callable, $shared=true)
Set a factory to generate a value when the container is read.
elgg_get_version($human_readable=false)
Get the current Elgg version information.
Definition: elgglib.php:814
const ELGG_CACHE_PERSISTENT
Definition: constants.php:150
const ELGG_CACHE_FILESYSTEM
Definition: constants.php:149
class
Definition: placeholder.php:21
static sanitize($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
Definition: Paths.php:76
CSRF Protection.
Definition: Csrf.php:15
$version
Definition: version.php:14
$loader
Definition: ajax_loader.php:27
Invocation service.
Definition: Invoker.php:12