Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 127 changed files with 2,067 additions and 607 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
"zendframework/zend-i18n": "Zend\\I18n component",
"zendframework/zend-servicemanager": "Zend\\ServiceManager component",
"zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter",
"zendframework/zend-validator": "Zend\\Validator component"
"zendframework/zend-validator": "Zend\\Validator component",
"zendframework/zend-stdlib": "Zend\\Stdlib component"
},
"extra": {
"branch-alias": {
"dev-master": "2.4-dev",
"dev-develop": "2.5-dev"
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
},
"autoload-dev": {
Expand Down
27 changes: 4 additions & 23 deletions src/AbstractFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter;

use Traversable;
use Zend\Stdlib\ErrorHandler;
use Zend\Stdlib\StringUtils;

/**
* @category Zend
* @package Zend_Filter
*/
abstract class AbstractFilter implements FilterInterface
{
/**
Expand All @@ -26,27 +21,13 @@ abstract class AbstractFilter implements FilterInterface
*/
protected $options = array();

/**
* Is PCRE is compiled with UTF-8 and Unicode support
*
* @var boolean
**/
protected static $hasPcreUnicodeSupport = null;

/**
* @return bool
* @deprecated Since 2.1.0
*/
public static function hasPcreUnicodeSupport()
{
if (static::$hasPcreUnicodeSupport === null) {
static::$hasPcreUnicodeSupport = false;
ErrorHandler::start();
if (defined('PREG_BAD_UTF8_OFFSET_ERROR') && preg_match('/\pL/u', 'a') == 1) {
static::$hasPcreUnicodeSupport = true;
}
ErrorHandler::stop();
}
return static::$hasPcreUnicodeSupport;
return StringUtils::hasPcreUnicodeSupport();
}

/**
Expand Down
7 changes: 1 addition & 6 deletions src/AbstractUnicode.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter;

/**
* @category Zend
* @package Zend_Filter
*/
abstract class AbstractUnicode extends AbstractFilter
{
/**
Expand Down
7 changes: 1 addition & 6 deletions src/BaseName.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter;

/**
* @category Zend
* @package Zend_Filter
*/
class BaseName extends AbstractFilter
{
/**
Expand Down
21 changes: 8 additions & 13 deletions src/Boolean.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter;

use Traversable;
use Zend\Stdlib\ArrayUtils;

/**
* @category Zend
* @package Zend_Filter
*/
class Boolean extends AbstractFilter
{
const TYPE_BOOLEAN = 1;
Expand Down Expand Up @@ -93,9 +88,9 @@ public function __construct($typeOrOptions = null, $casting = true, $translation
/**
* Set boolean types
*
* @param integer|array $type
* @param int|array $type
* @throws Exception\InvalidArgumentException
* @return Boolean
* @return bool
*/
public function setType($type = null)
{
Expand Down Expand Up @@ -139,21 +134,21 @@ public function getType()
/**
* Set the working mode
*
* @param boolean $flag When true this filter works like cast
* @param bool $flag When true this filter works like cast
* When false it recognises only true and false
* and all other values are returned as is
* @return Boolean
* @return bool
*/
public function setCasting($flag = true)
{
$this->options['casting'] = (boolean) $flag;
$this->options['casting'] = (bool) $flag;
return $this;
}

/**
* Returns the casting option
*
* @return boolean
* @return bool
*/
public function getCasting()
{
Expand All @@ -163,7 +158,7 @@ public function getCasting()
/**
* @param array|Traversable $translations
* @throws Exception\InvalidArgumentException
* @return Boolean
* @return bool
*/
public function setTranslations($translations)
{
Expand Down
7 changes: 1 addition & 6 deletions src/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter;

use Traversable;

/**
* @category Zend
* @package Zend_Filter
*/
class Callback extends AbstractFilter
{
/**
Expand Down
6 changes: 1 addition & 5 deletions src/Compress.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter;
Expand All @@ -15,9 +14,6 @@

/**
* Compresses a given string
*
* @category Zend
* @package Zend_Filter
*/
class Compress extends AbstractFilter
{
Expand Down
6 changes: 1 addition & 5 deletions src/Compress/AbstractCompressionAlgorithm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter\Compress;
Expand All @@ -15,9 +14,6 @@

/**
* Abstract compression adapter
*
* @category Zend
* @package Zend_Filter
*/
abstract class AbstractCompressionAlgorithm implements CompressionAlgorithmInterface
{
Expand Down
10 changes: 3 additions & 7 deletions src/Compress/Bz2.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter\Compress;
Expand All @@ -14,9 +13,6 @@

/**
* Compression adapter for Bz2
*
* @category Zend
* @package Zend_Filter
*/
class Bz2 extends AbstractCompressionAlgorithm
{
Expand Down Expand Up @@ -51,7 +47,7 @@ public function __construct($options = null)
/**
* Returns the set blocksize
*
* @return integer
* @return int
*/
public function getBlocksize()
{
Expand All @@ -61,7 +57,7 @@ public function getBlocksize()
/**
* Sets a new blocksize
*
* @param integer $blocksize
* @param int $blocksize
* @throws Exception\InvalidArgumentException
* @return Bz2
*/
Expand Down
6 changes: 1 addition & 5 deletions src/Compress/CompressionAlgorithmInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter\Compress;

/**
* Compression interface
*
* @category Zend
* @package Zend_Filter
*/
interface CompressionAlgorithmInterface
{
Expand Down
10 changes: 3 additions & 7 deletions src/Compress/Gz.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter\Compress;
Expand All @@ -14,9 +13,6 @@

/**
* Compression adapter for Gzip (ZLib)
*
* @category Zend
* @package Zend_Filter
*/
class Gz extends AbstractCompressionAlgorithm
{
Expand Down Expand Up @@ -53,7 +49,7 @@ public function __construct($options = null)
/**
* Returns the set compression level
*
* @return integer
* @return int
*/
public function getLevel()
{
Expand All @@ -63,7 +59,7 @@ public function getLevel()
/**
* Sets a new compression level
*
* @param integer $level
* @param int $level
* @throws Exception\InvalidArgumentException
* @return Gz
*/
Expand Down
6 changes: 1 addition & 5 deletions src/Compress/Lzf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter\Compress;
Expand All @@ -14,9 +13,6 @@

/**
* Compression adapter for Lzf
*
* @category Zend
* @package Zend_Filter
*/
class Lzf implements CompressionAlgorithmInterface
{
Expand Down
10 changes: 2 additions & 8 deletions src/Compress/Rar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Filter
*/

namespace Zend\Filter\Compress;
Expand All @@ -14,9 +13,6 @@

/**
* Compression adapter for Rar
*
* @category Zend
* @package Zend_Filter
*/
class Rar extends AbstractCompressionAlgorithm
{
Expand Down Expand Up @@ -182,14 +178,12 @@ public function compress($content)
* Decompresses the given content
*
* @param string $content
* @return boolean
* @return bool
* @throws Exception\RuntimeException if archive not found, cannot be opened,
* or error during decompression
*/
public function decompress($content)
{
$archive = $this->getArchive();

if (!file_exists($content)) {
throw new Exception\RuntimeException('RAR Archive not found');
}
Expand Down
Loading

0 comments on commit b1e478c

Please sign in to comment.