diff options
author | sgiehl <stefan@piwik.org> | 2013-10-03 00:05:25 +0400 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2013-10-03 00:05:25 +0400 |
commit | e1de9e3fcafc11645092a8c818886a3b7353a97a (patch) | |
tree | 6108521f771ef2c33d083491c2d3581aa0cac48b /libs/Zend/Validate | |
parent | b9cb027df72c2e284a30538dab3f527c9b5e7c0b (diff) |
removed unused Zend_Validate_Sitemap
Diffstat (limited to 'libs/Zend/Validate')
-rw-r--r-- | libs/Zend/Validate/Sitemap/Changefreq.php | 95 | ||||
-rw-r--r-- | libs/Zend/Validate/Sitemap/Lastmod.php | 88 | ||||
-rw-r--r-- | libs/Zend/Validate/Sitemap/Priority.php | 82 |
3 files changed, 0 insertions, 265 deletions
diff --git a/libs/Zend/Validate/Sitemap/Changefreq.php b/libs/Zend/Validate/Sitemap/Changefreq.php deleted file mode 100644 index 3849ff2318..0000000000 --- a/libs/Zend/Validate/Sitemap/Changefreq.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Validate - * @subpackage Sitemap - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Changefreq.php 23775 2011-03-01 17:25:24Z ralph $ - */ - -/** - * @see Zend_Validate_Abstract - */ -// require_once 'Zend/Validate/Abstract.php'; - -/** - * Validates whether a given value is valid as a sitemap <changefreq> value - * - * @link http://www.sitemaps.org/protocol.php Sitemaps XML format - * - * @category Zend - * @package Zend_Validate - * @subpackage Sitemap - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Validate_Sitemap_Changefreq extends Zend_Validate_Abstract -{ - /** - * Validation key for not valid - * - */ - const NOT_VALID = 'sitemapChangefreqNotValid'; - const INVALID = 'sitemapChangefreqInvalid'; - - /** - * Validation failure message template definitions - * - * @var array - */ - protected $_messageTemplates = array( - self::NOT_VALID => "'%value%' is no valid sitemap changefreq", - self::INVALID => "Invalid type given. String expected", - ); - - /** - * Valid change frequencies - * - * @var array - */ - protected $_changeFreqs = array( - 'always', 'hourly', 'daily', 'weekly', - 'monthly', 'yearly', 'never' - ); - - /** - * Validates if a string is valid as a sitemap changefreq - * - * @link http://www.sitemaps.org/protocol.php#changefreqdef <changefreq> - * - * @param string $value value to validate - * @return boolean - */ - public function isValid($value) - { - if (!is_string($value)) { - $this->_error(self::INVALID); - return false; - } - - $this->_setValue($value); - if (!is_string($value)) { - return false; - } - - if (!in_array($value, $this->_changeFreqs, true)) { - $this->_error(self::NOT_VALID); - return false; - } - - return true; - } -} diff --git a/libs/Zend/Validate/Sitemap/Lastmod.php b/libs/Zend/Validate/Sitemap/Lastmod.php deleted file mode 100644 index 7b536b42b7..0000000000 --- a/libs/Zend/Validate/Sitemap/Lastmod.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Validate - * @subpackage Sitemap - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Lastmod.php 23775 2011-03-01 17:25:24Z ralph $ - */ - -/** - * @see Zend_Validate_Abstract - */ -// require_once 'Zend/Validate/Abstract.php'; - -/** - * Validates whether a given value is valid as a sitemap <lastmod> value - * - * @link http://www.sitemaps.org/protocol.php Sitemaps XML format - * - * @category Zend - * @package Zend_Validate - * @subpackage Sitemap - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Validate_Sitemap_Lastmod extends Zend_Validate_Abstract -{ - /** - * Regular expression to use when validating - * - */ - const LASTMOD_REGEX = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9])(:[0-5][0-9])?(\\+|-)([0-1][0-9]|2[0-3]):[0-5][0-9])?$/'; - - /** - * Validation key for not valid - * - */ - const NOT_VALID = 'sitemapLastmodNotValid'; - const INVALID = 'sitemapLastmodInvalid'; - - /** - * Validation failure message template definitions - * - * @var array - */ - protected $_messageTemplates = array( - self::NOT_VALID => "'%value%' is no valid sitemap lastmod", - self::INVALID => "Invalid type given. String expected", - ); - - /** - * Validates if a string is valid as a sitemap lastmod - * - * @link http://www.sitemaps.org/protocol.php#lastmoddef <lastmod> - * - * @param string $value value to validate - * @return boolean - */ - public function isValid($value) - { - if (!is_string($value)) { - $this->_error(self::INVALID); - return false; - } - - $this->_setValue($value); - $result = @preg_match(self::LASTMOD_REGEX, $value); - if ($result != 1) { - $this->_error(self::NOT_VALID); - return false; - } - - return true; - } -} diff --git a/libs/Zend/Validate/Sitemap/Priority.php b/libs/Zend/Validate/Sitemap/Priority.php deleted file mode 100644 index c01dd86203..0000000000 --- a/libs/Zend/Validate/Sitemap/Priority.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Validate - * @subpackage Sitemap - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Priority.php 23775 2011-03-01 17:25:24Z ralph $ - */ - -/** - * @see Zend_Validate_Abstract - */ -// require_once 'Zend/Validate/Abstract.php'; - -/** - * Validates whether a given value is valid as a sitemap <priority> value - * - * @link http://www.sitemaps.org/protocol.php Sitemaps XML format - * - * @category Zend - * @package Zend_Validate - * @subpackage Sitemap - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Validate_Sitemap_Priority extends Zend_Validate_Abstract -{ - /** - * Validation key for not valid - * - */ - const NOT_VALID = 'sitemapPriorityNotValid'; - const INVALID = 'sitemapPriorityInvalid'; - - /** - * Validation failure message template definitions - * - * @var array - */ - protected $_messageTemplates = array( - self::NOT_VALID => "'%value%' is no valid sitemap priority", - self::INVALID => "Invalid type given. Numeric string, integer or float expected", - ); - - /** - * Validates if a string is valid as a sitemap priority - * - * @link http://www.sitemaps.org/protocol.php#prioritydef <priority> - * - * @param string $value value to validate - * @return boolean - */ - public function isValid($value) - { - if (!is_numeric($value)) { - $this->_error(self::INVALID); - return false; - } - - $this->_setValue($value); - $value = (float) $value; - if ($value < 0 || $value > 1) { - $this->_error(self::NOT_VALID); - return false; - } - - return true; - } -} |