protected static function getLibrary($id, $file = null)
    {
        if (null !== $file || array_key_exists($id, static::$libraries)) {
            $file = $file ?: static::$libraries[$id];

            //  Find the library
            foreach (static::$libraryPaths as $name => $path) {
                $filePath = $path . DIRECTORY_SEPARATOR . $file;

                if (file_exists($filePath) && is_readable($filePath)) {
                    return file_get_contents($filePath, 'r');
                }
            }
        }

        throw new \InvalidArgumentException('The library id "' . $id . '" could not be located.');
    }
protected static function getLibrary($id, $file = null)
    {
        if (null !== $file || array_key_exists($id, static::$libraries)) {
            $file = $file ?: static::$libraries[$id];

            //  Find the library
            foreach (static::$libraryPaths as $name => $path) {
                $filePath = $path . DIRECTORY_SEPARATOR . $file;

                if (file_exists($filePath) && is_readable($filePath)) {
                    return file_get_contents($filePath, 'r');
                }
            }
        }

        throw new \InvalidArgumentException('The library id "' . $id . '" could not be located.');
    }
protected static function getLibrary ( $ id , $ file = null ) { if ( null !== $ file || array_key_exists ( $ id , static :: $ libraries ) ) { $ file = $ file ? : static :: $ libraries [ $ id ] ; //  Find the library foreach ( static :: $ libraryPaths as $ name => $ path ) { $ filePath = $ path . DIRECTORY_SEPARATOR . $ file ; if ( file_exists ( $ filePath ) && is_readable ( $ filePath ) ) { return file_get_contents ( $ filePath , 'r' ) ; } } } throw new \ InvalidArgumentException ( 'The library id "' . $ id . '" could not be located.' ) ; }
Locates and loads a library returning the contents

@param string $id   The id of the library (i.e. "lodash", "underscore", etc.)
@param string $file The relative path/name of the library file

@return string
Locates and loads a library returning the contents