Elgg  Version 5.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Assets\ExternalFiles Class Reference

External files service. More...

Public Member Functions

 __construct (Config $config, Urls $urls, ViewsService $views, SimpleCache $simpleCache, SystemCache $serverCache)
 Constructor. More...
 
 register (string $type, string $name, string $url, string $location)
 Core registration function for external files. More...
 
 unregister (string $type, string $name)
 Unregister an external file. More...
 
 load (string $type, string $name)
 Load an external resource for use on this page. More...
 
 getLoadedResources (string $type, string $location)
 Get external resource descriptors. More...
 
 reset ()
 Unregister all files. More...
 

Protected Member Functions

 setupType (string $type)
 Bootstraps the externals data structure. More...
 
 getSubResourceIntegrity (string $type, string $resource)
 Returns the integrity related to the resource file. More...
 

Protected Attributes

 $files = []
 
 $sri
 
 $config
 
 $urls
 
 $views
 
 $simpleCache
 
 $serverCache
 

Detailed Description

External files service.

Definition at line 17 of file ExternalFiles.php.

Constructor & Destructor Documentation

Elgg\Assets\ExternalFiles::__construct ( Config  $config,
Urls  $urls,
ViewsService  $views,
SimpleCache  $simpleCache,
SystemCache  $serverCache 
)

Constructor.

Parameters
Config$configconfig
Urls$urlsurls service
ViewsService$viewsviews service
SimpleCache$simpleCachesimplecache
SystemCache$serverCacheserver cache

Definition at line 65 of file ExternalFiles.php.

Member Function Documentation

Elgg\Assets\ExternalFiles::getLoadedResources ( string  $type,
string  $location 
)

Get external resource descriptors.

Parameters
string$typeType of file: js or css
string$locationPage location
Returns
string[] Resources to load

Definition at line 175 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::getSubResourceIntegrity ( string  $type,
string  $resource 
)
protected

Returns the integrity related to the resource file.

Parameters
string$typetype of resource
string$resourcename of resource
Returns
string|NULL

Definition at line 227 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::load ( string  $type,
string  $name 
)

Load an external resource for use on this page.

Parameters
string$typeType of file: js or css
string$nameThe identifier for the file
Returns
void

Definition at line 142 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::register ( string  $type,
string  $name,
string  $url,
string  $location 
)

Core registration function for external files.

Parameters
string$typeType of external resource (js or css)
string$nameIdentifier used as key
string$urlURL
string$locationLocation in the page to include the file
Returns
bool

Definition at line 83 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::reset ( )

Unregister all files.

Returns
void

Definition at line 204 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::setupType ( string  $type)
protected

Bootstraps the externals data structure.

Parameters
string$typeThe type of external, js or css.
Returns
void

Definition at line 214 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::unregister ( string  $type,
string  $name 
)

Unregister an external file.

Parameters
string$typeType of file: js or css
string$nameThe identifier of the file
Returns
bool

Definition at line 121 of file ExternalFiles.php.

Member Data Documentation

Elgg\Assets\ExternalFiles::$config
protected

Definition at line 34 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::$files = []
protected

Definition at line 22 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::$serverCache
protected

Definition at line 54 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::$simpleCache
protected

Definition at line 49 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::$sri
protected

Definition at line 29 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::$urls
protected

Definition at line 39 of file ExternalFiles.php.

Elgg\Assets\ExternalFiles::$views
protected

Definition at line 44 of file ExternalFiles.php.


The documentation for this class was generated from the following file: