62 $url = $this->urls->normalizeUrl(
$url);
116 $this->setupType(
$type);
124 $item->loaded =
true;
131 if ($this->views->viewExists(
$name)) {
132 $item->url = $this->simpleCache->getUrl(
$name);
133 $item->location = (
$type ===
'js') ?
'footer' :
'head';
149 if (!isset($this->files[
$type])) {
157 return $v->loaded ==
true && $v->location ==
$location;
160 $cache_ts = $this->config->lastcache;
161 $cache_url = $this->config->wwwroot .
"cache/{$cache_ts}/default/";
164 array_walk(
$items,
function(&$v, $k) use (
$type, $cache_url) {
165 $view = str_replace($cache_url,
'', $v->url);
166 $v->integrity = $this->getSubResourceIntegrity(
$type,
$view);
188 if (!isset($this->files[
$type])) {
189 $this->files[
$type] = [];
201 if (!$this->config->subresource_integrity_enabled) {
205 if (!isset($this->sri)) {
206 $this->sri = $this->serverCache->load(
'sri') ?? [];
if(! $user||! $user->canDelete()) $name
if(!empty($avatar) &&! $avatar->isValid()) elseif(empty($avatar)) if(! $owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
unregister(string $type, string $name)
Unregister an external file.
__construct(protected Config $config, protected Urls $urls, protected ViewsService $views, protected SimpleCache $simpleCache, protected ServerCache $serverCache)
Constructor.
load(string $type, string $name)
Load an external resource for use on this page.
setupType(string $type)
Bootstraps the externals data structure.
getLoadedResources(string $type, string $location)
Get external resource descriptors.
getSubResourceIntegrity(string $type, string $resource)
Returns the integrity related to the resource file.
reset()
Unregister all files.
Create, sanitize and compare urls.
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
$config
Advanced site settings, debugging section.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.