CSS Utils.
More...
|
static | filterReferences ($content, $callback) |
| Filters all references – url() and "@import" – through a callable. More...
|
|
static | filterUrls ($content, $callback) |
| Filters all CSS url()'s through a callable. More...
|
|
static | filterImports ($content, $callback, $includeUrl=true) |
| Filters all CSS imports through a callable. More...
|
|
static | filterIEFilters ($content, $callback) |
| Filters all IE filters (AlphaImageLoader filter) through a callable. More...
|
|
static | filterCommentless ($content, $callback) |
| Filters each non-comment part through a callable. More...
|
|
static | extractImports ($content) |
| Extracts all references from the supplied CSS content. More...
|
|
◆ __construct()
Assetic\Util\CssUtils::__construct |
( |
| ) |
|
|
finalprivate |
◆ extractImports()
static Assetic\Util\CssUtils::extractImports |
( |
|
$content | ) |
|
|
static |
◆ filterCommentless()
static Assetic\Util\CssUtils::filterCommentless |
( |
|
$content, |
|
|
|
$callback |
|
) |
| |
|
static |
Filters each non-comment part through a callable.
- Parameters
-
string | $content | The CSS |
callable | $callback | A PHP callable |
- Returns
- string The filtered CSS
Definition at line 104 of file CssUtils.php.
105 {
108 if (!preg_match(static::REGEX_COMMENTS, $part, $match) || $part != $match[0]) {
109 $part = call_user_func($callback, $part);
110 }
111
113 }
114
116 }
echo;exit;}function LogoutNotification($SessionID) { global $ilDB; $q="SELECT session_id, data FROM usr_session WHERE expires > (\w+)\|/" PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE
References $result, and PREG_SPLIT_DELIM_CAPTURE.
◆ filterIEFilters()
static Assetic\Util\CssUtils::filterIEFilters |
( |
|
$content, |
|
|
|
$callback |
|
) |
| |
|
static |
Filters all IE filters (AlphaImageLoader filter) through a callable.
- Parameters
-
string | $content | The CSS |
callable | $callback | A PHP callable |
- Returns
- string The filtered CSS
Definition at line 87 of file CssUtils.php.
88 {
89 $pattern = static::REGEX_IE_FILTERS;
90
91 return static::filterCommentless($content, function ($part) use (& $callback, $pattern) {
92 return preg_replace_callback($pattern, $callback, $part);
93 });
94 }
Referenced by Assetic\Filter\BaseCssFilter\filterIEFilters().
◆ filterImports()
static Assetic\Util\CssUtils::filterImports |
( |
|
$content, |
|
|
|
$callback, |
|
|
|
$includeUrl = true |
|
) |
| |
|
static |
Filters all CSS imports through a callable.
- Parameters
-
string | $content | The CSS |
callable | $callback | A PHP callable |
Boolean | $includeUrl | Whether to include url() in the pattern |
- Returns
- string The filtered CSS
Definition at line 70 of file CssUtils.php.
71 {
72 $pattern = $includeUrl ? static::REGEX_IMPORTS : static::REGEX_IMPORTS_NO_URLS;
73
74 return static::filterCommentless($content, function ($part) use (& $callback, $pattern) {
75 return preg_replace_callback($pattern, $callback, $part);
76 });
77 }
Referenced by Assetic\Filter\BaseCssFilter\filterImports().
◆ filterReferences()
static Assetic\Util\CssUtils::filterReferences |
( |
|
$content, |
|
|
|
$callback |
|
) |
| |
|
static |
Filters all references – url() and "@import" – through a callable.
- Parameters
-
string | $content | The CSS |
callable | $callback | A PHP callable |
- Returns
- string The filtered CSS
Definition at line 35 of file CssUtils.php.
36 {
37 $content = static::filterUrls($content, $callback);
38 $content = static::filterImports($content, $callback, false);
39 $content = static::filterIEFilters($content, $callback);
40
41 return $content;
42 }
Referenced by Assetic\Filter\BaseCssFilter\filterReferences().
◆ filterUrls()
static Assetic\Util\CssUtils::filterUrls |
( |
|
$content, |
|
|
|
$callback |
|
) |
| |
|
static |
Filters all CSS url()'s through a callable.
- Parameters
-
string | $content | The CSS |
callable | $callback | A PHP callable |
- Returns
- string The filtered CSS
Definition at line 52 of file CssUtils.php.
53 {
54 $pattern = static::REGEX_URLS;
55
56 return static::filterCommentless($content, function ($part) use (& $callback, $pattern) {
57 return preg_replace_callback($pattern, $callback, $part);
58 });
59 }
Referenced by Assetic\Filter\BaseCssFilter\filterUrls().
◆ REGEX_COMMENTS
const Assetic\Util\CssUtils::REGEX_COMMENTS = '/(\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)/' |
◆ REGEX_IE_FILTERS
const Assetic\Util\CssUtils::REGEX_IE_FILTERS = '/src=(["\']?)(?P<url>.*?)\\1/' |
◆ REGEX_IMPORTS
const Assetic\Util\CssUtils::REGEX_IMPORTS = '/@import (?:url\()?(\'|"|)(?P<url>[^\'"\)\n\r]*)\1\)?;?/' |
◆ REGEX_IMPORTS_NO_URLS
const Assetic\Util\CssUtils::REGEX_IMPORTS_NO_URLS = '/@import (?!url\()(\'|"|)(?P<url>[^\'"\)\n\r]*)\1;?/' |
◆ REGEX_URLS
const Assetic\Util\CssUtils::REGEX_URLS = '/url\((["\']?)(?P<url>.*?)(\\1)\)/' |
The documentation for this class was generated from the following file:
- libs/composer/vendor/kriswallsmith/assetic/src/Assetic/Util/CssUtils.php