*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Validate / Sitemap / Loc.php
blob92d5272030e19fe3f2915c6b1ec72e7067e7e2e7
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Validate
17 * @subpackage Sitemap
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Loc.php 16971 2009-07-22 18:05:45Z mikaelkael $
23 /**
24 * @see Zend_Validate_Abstract
26 require_once 'Zend/Validate/Abstract.php';
28 /**
29 * @see Zend_Uri
31 require_once 'Zend/Uri.php';
33 /**
34 * Validates whether a given value is valid as a sitemap <loc> value
36 * @link http://www.sitemaps.org/protocol.php Sitemaps XML format
38 * @category Zend
39 * @package Zend_Validate
40 * @subpackage Sitemap
41 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
42 * @license http://framework.zend.com/license/new-bsd New BSD License
44 class Zend_Validate_Sitemap_Loc extends Zend_Validate_Abstract
46 /**
47 * Validation key for not valid
50 const NOT_VALID = 'invalidSitemapLoc';
52 /**
53 * Validation failure message template definitions
55 * @var array
57 protected $_messageTemplates = array(
58 self::NOT_VALID => "'%value%' is not a valid sitemap location",
61 /**
62 * Validates if a string is valid as a sitemap location
64 * @link http://www.sitemaps.org/protocol.php#locdef <loc>
66 * @param string $value value to validate
67 * @return boolean
69 public function isValid($value)
71 $this->_setValue($value);
73 if (!is_string($value)) {
74 return false;
77 return Zend_Uri::check($value);