本文整理汇总了PHP中Minify::handleRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Minify::handleRequest方法的具体用法?PHP Minify::handleRequest怎么用?PHP Minify::handleRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Minify
的用法示例。
在下文中一共展示了Minify::handleRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MinifyFileNotFoundException
$filepath = MINIFY_BASE_DIR . '/' . $file;
}
// Ensure that the file exists, that the path is under the base directory,
// that the file's extension is either '.css' or '.js', and that the file is
// actually readable.
if (!$filepath || !is_file($filepath) || !is_readable($filepath) || !preg_match('/^' . preg_quote(MINIFY_BASE_DIR, '/') . '/', $filepath) || !preg_match('/\\.(?:css|js)$/iD', $filepath)) {
// Even when the file exists, we still throw a
// MinifyFileNotFoundException in order to try to prevent an information
// disclosure vulnerability.
throw new MinifyFileNotFoundException("File not found: {$filepath} " . $file);
}
return $filepath;
}
}
// -- Exception Classes --------------------------------------------------------
class MinifyException extends Exception
{
}
class MinifyFileNotFoundException extends MinifyException
{
}
class MinifyInvalidArgumentException extends MinifyException
{
}
class MinifyInvalidUrlException extends MinifyException
{
}
// -- Global Scope -------------------------------------------------------------
if (realpath(__FILE__) == realpath($_SERVER['SCRIPT_FILENAME'])) {
Minify::handleRequest();
}