mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-02-01 01:29:58 +09:00
Add CoolSMS PHP SDK, and update Composer dependencies
This commit is contained in:
parent
40c43e8fa0
commit
c719fc0500
242 changed files with 3487 additions and 28983 deletions
63
vendor/matthiasmullie/minify/src/Minify.php
vendored
63
vendor/matthiasmullie/minify/src/Minify.php
vendored
|
|
@ -11,7 +11,7 @@ use Psr\Cache\CacheItemInterface;
|
|||
* Please report bugs on https://github.com/matthiasmullie/minify/issues
|
||||
*
|
||||
* @author Matthias Mullie <minify@mullie.eu>
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved.
|
||||
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
|
||||
* @license MIT License
|
||||
*/
|
||||
abstract class Minify
|
||||
|
|
@ -53,7 +53,7 @@ abstract class Minify
|
|||
/**
|
||||
* Add a file or straight-up code to be minified.
|
||||
*
|
||||
* @param string $data
|
||||
* @param string|string[] $data
|
||||
*/
|
||||
public function add($data /* $data = null, ... */)
|
||||
{
|
||||
|
|
@ -65,6 +65,11 @@ abstract class Minify
|
|||
|
||||
// this method can be overloaded
|
||||
foreach ($args as $data) {
|
||||
if (is_array($data)) {
|
||||
call_user_func_array(array($this, 'add'), $data);
|
||||
continue;
|
||||
}
|
||||
|
||||
// redefine var
|
||||
$data = (string) $data;
|
||||
|
||||
|
|
@ -72,6 +77,10 @@ abstract class Minify
|
|||
$value = $this->load($data);
|
||||
$key = ($data != $value) ? $data : count($this->data);
|
||||
|
||||
// replace CR linefeeds etc.
|
||||
// @see https://github.com/matthiasmullie/minify/pull/139
|
||||
$value = str_replace(array("\r\n", "\r"), "\n", $value);
|
||||
|
||||
// store data
|
||||
$this->data[$key] = $value;
|
||||
}
|
||||
|
|
@ -80,9 +89,9 @@ abstract class Minify
|
|||
/**
|
||||
* Minify the data & (optionally) saves it to a file.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to.
|
||||
* @param string[optional] $path Path to write the data to
|
||||
*
|
||||
* @return string The minified data.
|
||||
* @return string The minified data
|
||||
*/
|
||||
public function minify($path = null)
|
||||
{
|
||||
|
|
@ -99,10 +108,10 @@ abstract class Minify
|
|||
/**
|
||||
* Minify & gzip the data & (optionally) saves it to a file.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to.
|
||||
* @param int[optional] $level Compression level, from 0 to 9.
|
||||
* @param string[optional] $path Path to write the data to
|
||||
* @param int[optional] $level Compression level, from 0 to 9
|
||||
*
|
||||
* @return string The minified & gzipped data.
|
||||
* @return string The minified & gzipped data
|
||||
*/
|
||||
public function gzip($path = null, $level = 9)
|
||||
{
|
||||
|
|
@ -120,9 +129,9 @@ abstract class Minify
|
|||
/**
|
||||
* Minify the data & write it to a CacheItemInterface object.
|
||||
*
|
||||
* @param CacheItemInterface $item Cache item to write the data to.
|
||||
* @param CacheItemInterface $item Cache item to write the data to
|
||||
*
|
||||
* @return CacheItemInterface Cache item with the minifier data.
|
||||
* @return CacheItemInterface Cache item with the minifier data
|
||||
*/
|
||||
public function cache(CacheItemInterface $item)
|
||||
{
|
||||
|
|
@ -135,16 +144,16 @@ abstract class Minify
|
|||
/**
|
||||
* Minify the data.
|
||||
*
|
||||
* @param string[optional] $path Path to write the data to.
|
||||
* @param string[optional] $path Path to write the data to
|
||||
*
|
||||
* @return string The minified data.
|
||||
* @return string The minified data
|
||||
*/
|
||||
abstract public function execute($path = null);
|
||||
|
||||
/**
|
||||
* Load data.
|
||||
*
|
||||
* @param string $data Either a path to a file or the content itself.
|
||||
* @param string $data Either a path to a file or the content itself
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -166,8 +175,8 @@ abstract class Minify
|
|||
/**
|
||||
* Save to file.
|
||||
*
|
||||
* @param string $content The minified data.
|
||||
* @param string $path The path to save the minified data to.
|
||||
* @param string $content The minified data
|
||||
* @param string $path The path to save the minified data to
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
|
|
@ -183,8 +192,8 @@ abstract class Minify
|
|||
/**
|
||||
* Register a pattern to execute against the source content.
|
||||
*
|
||||
* @param string $pattern PCRE pattern.
|
||||
* @param string|callable $replacement Replacement value for matched pattern.
|
||||
* @param string $pattern PCRE pattern
|
||||
* @param string|callable $replacement Replacement value for matched pattern
|
||||
*/
|
||||
protected function registerPattern($pattern, $replacement = '')
|
||||
{
|
||||
|
|
@ -202,9 +211,9 @@ abstract class Minify
|
|||
* The only way to accurately replace these pieces is to traverse the JS one
|
||||
* character at a time and try to find whatever starts first.
|
||||
*
|
||||
* @param string $content The content to replace patterns in.
|
||||
* @param string $content The content to replace patterns in
|
||||
*
|
||||
* @return string The (manipulated) content.
|
||||
* @return string The (manipulated) content
|
||||
*/
|
||||
protected function replace($content)
|
||||
{
|
||||
|
|
@ -284,9 +293,9 @@ abstract class Minify
|
|||
* This function will be called plenty of times, where $content will always
|
||||
* move up 1 character.
|
||||
*
|
||||
* @param string $pattern Pattern to match.
|
||||
* @param string|callable $replacement Replacement value.
|
||||
* @param string $content Content to match pattern against.
|
||||
* @param string $pattern Pattern to match
|
||||
* @param string|callable $replacement Replacement value
|
||||
* @param string $content Content to match pattern against
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
@ -382,15 +391,15 @@ abstract class Minify
|
|||
*/
|
||||
protected function canImportFile($path)
|
||||
{
|
||||
return strlen($path) < PHP_MAXPATHLEN && is_file($path) && is_readable($path);
|
||||
return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to open file specified by $path for writing.
|
||||
*
|
||||
* @param string $path The path to the file.
|
||||
* @param string $path The path to the file
|
||||
*
|
||||
* @return resource Specifier for the target file.
|
||||
* @return resource Specifier for the target file
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
|
|
@ -406,9 +415,9 @@ abstract class Minify
|
|||
/**
|
||||
* Attempts to write $content to the file specified by $handler. $path is used for printing exceptions.
|
||||
*
|
||||
* @param resource $handler The resource to write to.
|
||||
* @param string $content The content to write.
|
||||
* @param string $path The path to the file (for exception printing only).
|
||||
* @param resource $handler The resource to write to
|
||||
* @param string $content The content to write
|
||||
* @param string $path The path to the file (for exception printing only)
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue