1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-17 20:01:47 +02:00

library getPath() method added. Media class now caches local fontawesome file.

This commit is contained in:
Cameron
2017-02-03 08:36:49 -08:00
parent 71249c3f2c
commit 20b5db2cf9
2 changed files with 26 additions and 7 deletions

View File

@@ -709,7 +709,7 @@ class e_library_manager
// Check whether the library exists.
if(!isset($library['library_path']))
{
$library['library_path'] = $this->getPath($library['machine_name']);
$library['library_path'] = $this->detectPath($library['machine_name']);
}
$libraryPath = e107::getParser()->replaceConstants($library['library_path']);
@@ -1034,7 +1034,7 @@ class e_library_manager
* @return string
* The path to the specified library or FALSE if the library wasn't found.
*/
private function getPath($name)
private function detectPath($name)
{
static $libraries;
@@ -1096,6 +1096,24 @@ class e_library_manager
return varset($lib[$property], false);
}
/**
* Return full path to a library in different formats.
* @param string $library
* The library name eg. bootstrap
*
* @param null $mode
* The mode: null | 'full' | 'abs'
*
* @return string
*/
public function getPath($library, $mode=null)
{
$path = self::getProperty($library, 'library_path').'/'. self::getProperty($library, 'path');
return e107::getParser()->replaceConstants($path,$mode).'/';
}
/**
* Returns information about registered libraries.
*