57 $name =
trim(strtolower($name));
58 if (empty($name) || empty($url)) {
62 $url = $this->urls->normalizeUrl($url);
94 public function unregister(
string $type,
string $name): bool {
97 $name =
trim(strtolower($name));
99 if (!isset($this->
files[$type][$name])) {
103 unset($this->
files[$type][$name]);
115 public function load(
string $type,
string $name):
void {
118 $name =
trim(strtolower($name));
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])) {
156 $items = array_filter(
$items,
function($v) use ($location) {
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) {
188 if (!isset($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
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
reset()
Unregister all files.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
$config
Advanced site settings, debugging section.
load(string $type, string $name)
Load an external resource for use on this page.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition files
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.
setupType(string $type)
Bootstraps the externals data structure.
getSubResourceIntegrity(string $type, string $resource)
Returns the integrity related to the resource file.
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
__construct(protected Config $config, protected Urls $urls, protected ViewsService $views, protected SimpleCache $simpleCache, protected ServerCache $serverCache)
Constructor.
getLoadedResources(string $type, string $location)
Get external resource descriptors.
Create, sanitize and compare urls.