diff options
Diffstat (limited to 'lib/Zend/Filter/Word')
-rw-r--r-- | lib/Zend/Filter/Word/CamelCaseToDash.php | 44 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/CamelCaseToSeparator.php | 49 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/CamelCaseToUnderscore.php | 44 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/DashToCamelCase.php | 44 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/DashToSeparator.php | 42 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/DashToUnderscore.php | 45 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/Separator/Abstract.php | 76 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/SeparatorToCamelCase.php | 52 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/SeparatorToDash.php | 46 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/SeparatorToSeparator.php | 129 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/UnderscoreToCamelCase.php | 44 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/UnderscoreToDash.php | 45 | ||||
-rw-r--r-- | lib/Zend/Filter/Word/UnderscoreToSeparator.php | 45 |
13 files changed, 705 insertions, 0 deletions
diff --git a/lib/Zend/Filter/Word/CamelCaseToDash.php b/lib/Zend/Filter/Word/CamelCaseToDash.php new file mode 100644 index 0000000..c4717f2 --- /dev/null +++ b/lib/Zend/Filter/Word/CamelCaseToDash.php @@ -0,0 +1,44 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToDash.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_Interface + */ +require_once 'Zend/Filter/Word/CamelCaseToSeparator.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_CamelCaseToDash extends Zend_Filter_Word_CamelCaseToSeparator +{ + /** + * Constructor + * + * @return void + */ + public function __construct() + { + parent::__construct('-'); + } +} diff --git a/lib/Zend/Filter/Word/CamelCaseToSeparator.php b/lib/Zend/Filter/Word/CamelCaseToSeparator.php new file mode 100644 index 0000000..5dfa590 --- /dev/null +++ b/lib/Zend/Filter/Word/CamelCaseToSeparator.php @@ -0,0 +1,49 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToSeparator.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/Word/Separator/Abstract.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_CamelCaseToSeparator extends Zend_Filter_Word_Separator_Abstract +{ + + public function filter($value) + { + if (self::isUnicodeSupportEnabled()) { + parent::setMatchPattern(array('#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#','#(?<=(?:\p{Ll}))(\p{Lu})#')); + parent::setReplacement(array($this->_separator . '\1', $this->_separator . '\1')); + } else { + parent::setMatchPattern(array('#(?<=(?:[A-Z]))([A-Z]+)([A-Z][A-z])#', '#(?<=(?:[a-z]))([A-Z])#')); + parent::setReplacement(array('\1' . $this->_separator . '\2', $this->_separator . '\1')); + } + + return parent::filter($value); + } + +} diff --git a/lib/Zend/Filter/Word/CamelCaseToUnderscore.php b/lib/Zend/Filter/Word/CamelCaseToUnderscore.php new file mode 100644 index 0000000..659dfb4 --- /dev/null +++ b/lib/Zend/Filter/Word/CamelCaseToUnderscore.php @@ -0,0 +1,44 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToUnderscore.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_CamelCaseToSeparator + */ +require_once 'Zend/Filter/Word/CamelCaseToSeparator.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_CamelCaseToUnderscore extends Zend_Filter_Word_CamelCaseToSeparator +{ + /** + * Constructor + * + * @return void + */ + public function __construct() + { + parent::__construct('_'); + } +} diff --git a/lib/Zend/Filter/Word/DashToCamelCase.php b/lib/Zend/Filter/Word/DashToCamelCase.php new file mode 100644 index 0000000..a1ab8e7 --- /dev/null +++ b/lib/Zend/Filter/Word/DashToCamelCase.php @@ -0,0 +1,44 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToDash.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_Interface + */ +require_once 'Zend/Filter/Word/SeparatorToCamelCase.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_DashToCamelCase extends Zend_Filter_Word_SeparatorToCamelCase +{ + /** + * Constructor + * + * @return void + */ + public function __construct() + { + parent::__construct('-'); + } +} diff --git a/lib/Zend/Filter/Word/DashToSeparator.php b/lib/Zend/Filter/Word/DashToSeparator.php new file mode 100644 index 0000000..884ba1a --- /dev/null +++ b/lib/Zend/Filter/Word/DashToSeparator.php @@ -0,0 +1,42 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToSeparator.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/Word/Separator/Abstract.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_DashToSeparator extends Zend_Filter_Word_Separator_Abstract +{ + + public function filter($value) + { + $this->setMatchPattern('#-#'); + $this->setReplacement($this->_separator); + return parent::filter($value); + } +} diff --git a/lib/Zend/Filter/Word/DashToUnderscore.php b/lib/Zend/Filter/Word/DashToUnderscore.php new file mode 100644 index 0000000..404598a --- /dev/null +++ b/lib/Zend/Filter/Word/DashToUnderscore.php @@ -0,0 +1,45 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToSeparator.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/Word/SeparatorToSeparator.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_DashToUnderscore extends Zend_Filter_Word_SeparatorToSeparator +{ + /** + * Constructor + * + * @param string $separator Space by default + * @return void + */ + public function __construct() + { + parent::__construct('-', '_'); + } +}
\ No newline at end of file diff --git a/lib/Zend/Filter/Word/Separator/Abstract.php b/lib/Zend/Filter/Word/Separator/Abstract.php new file mode 100644 index 0000000..b33b96b --- /dev/null +++ b/lib/Zend/Filter/Word/Separator/Abstract.php @@ -0,0 +1,76 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToUnderscore.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/PregReplace.php'; + +/** + * @category Zend + * @package Zend_Filter + * @uses Zend_Filter_PregReplace + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +abstract class Zend_Filter_Word_Separator_Abstract extends Zend_Filter_PregReplace +{ + + protected $_separator = null; + + /** + * Constructor + * + * @param string $separator Space by default + * @return void + */ + public function __construct($separator = ' ') + { + $this->setSeparator($separator); + } + + /** + * Sets a new seperator + * + * @param string $separator Seperator + * @return $this + */ + public function setSeparator($separator) + { + if ($separator == null) { + require_once 'Zend/Filter/Exception.php'; + throw new Zend_Filter_Exception('"' . $separator . '" is not a valid separator.'); + } + $this->_separator = $separator; + return $this; + } + + /** + * Returns the actual set seperator + * + * @return string + */ + public function getSeparator() + { + return $this->_separator; + } + +}
\ No newline at end of file diff --git a/lib/Zend/Filter/Word/SeparatorToCamelCase.php b/lib/Zend/Filter/Word/SeparatorToCamelCase.php new file mode 100644 index 0000000..853ec1b --- /dev/null +++ b/lib/Zend/Filter/Word/SeparatorToCamelCase.php @@ -0,0 +1,52 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToSeparator.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/Word/Separator/Abstract.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_SeparatorToCamelCase extends Zend_Filter_Word_Separator_Abstract +{ + + public function filter($value) + { + // a unicode safe way of converting characters to \x00\x00 notation + $pregQuotedSeparator = preg_quote($this->_separator, '#'); + + if (self::isUnicodeSupportEnabled()) { + parent::setMatchPattern(array('#('.$pregQuotedSeparator.')(\p{L}{1})#e','#(^\p{Ll}{1})#e')); + parent::setReplacement(array("strtoupper('\\2')","strtoupper('\\1')")); + } else { + parent::setMatchPattern(array('#('.$pregQuotedSeparator.')([A-Z]{1})#e','#(^[a-z]{1})#e')); + parent::setReplacement(array("strtoupper('\\2')","strtoupper('\\1')")); + } + + return parent::filter($value); + } + +} diff --git a/lib/Zend/Filter/Word/SeparatorToDash.php b/lib/Zend/Filter/Word/SeparatorToDash.php new file mode 100644 index 0000000..d5eab06 --- /dev/null +++ b/lib/Zend/Filter/Word/SeparatorToDash.php @@ -0,0 +1,46 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToUnderscore.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_SeperatorToSeparator + */ +require_once 'Zend/Filter/Word/SeparatorToSeparator.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_SeparatorToDash extends Zend_Filter_Word_SeparatorToSeparator +{ + /** + * Constructor + * + * @param string $searchSeparator Seperator to search for change + * @return void + */ + public function __construct($searchSeparator = ' ') + { + parent::__construct($searchSeparator, '-'); + } + +}
\ No newline at end of file diff --git a/lib/Zend/Filter/Word/SeparatorToSeparator.php b/lib/Zend/Filter/Word/SeparatorToSeparator.php new file mode 100644 index 0000000..e70aaf3 --- /dev/null +++ b/lib/Zend/Filter/Word/SeparatorToSeparator.php @@ -0,0 +1,129 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToUnderscore.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/PregReplace.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_SeparatorToSeparator extends Zend_Filter_PregReplace +{ + + protected $_searchSeparator = null; + protected $_replacementSeparator = null; + + /** + * Constructor + * + * @param string $searchSeparator Seperator to search for + * @param string $replacementSeperator Seperator to replace with + * @return void + */ + public function __construct($searchSeparator = ' ', $replacementSeparator = '-') + { + $this->setSearchSeparator($searchSeparator); + $this->setReplacementSeparator($replacementSeparator); + } + + /** + * Sets a new seperator to search for + * + * @param string $separator Seperator to search for + * @return $this + */ + public function setSearchSeparator($separator) + { + $this->_searchSeparator = $separator; + return $this; + } + + /** + * Returns the actual set seperator to search for + * + * @return string + */ + public function getSearchSeparator() + { + return $this->_searchSeparator; + } + + /** + * Sets a new seperator which replaces the searched one + * + * @param string $separator Seperator which replaces the searched one + * @return $this + */ + public function setReplacementSeparator($separator) + { + $this->_replacementSeparator = $separator; + return $this; + } + + /** + * Returns the actual set seperator which replaces the searched one + * + * @return string + */ + public function getReplacementSeparator() + { + return $this->_replacementSeparator; + } + + /** + * Defined by Zend_Filter_Interface + * + * Returns the string $value, replacing the searched seperators with the defined ones + * + * @param string $value + * @return string + */ + public function filter($value) + { + return $this->_separatorToSeparatorFilter($value); + } + + /** + * Do the real work, replaces the seperator to search for with the replacement seperator + * + * Returns the replaced string + * + * @param string $value + * @return string + */ + protected function _separatorToSeparatorFilter($value) + { + if ($this->_searchSeparator == null) { + require_once 'Zend/Filter/Exception.php'; + throw new Zend_Filter_Exception('You must provide a search separator for this filter to work.'); + } + + $this->setMatchPattern('#' . preg_quote($this->_searchSeparator, '#') . '#'); + $this->setReplacement($this->_replacementSeparator); + return parent::filter($value); + } + +}
\ No newline at end of file diff --git a/lib/Zend/Filter/Word/UnderscoreToCamelCase.php b/lib/Zend/Filter/Word/UnderscoreToCamelCase.php new file mode 100644 index 0000000..aabbba9 --- /dev/null +++ b/lib/Zend/Filter/Word/UnderscoreToCamelCase.php @@ -0,0 +1,44 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToDash.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_Interface + */ +require_once 'Zend/Filter/Word/SeparatorToCamelCase.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_UnderscoreToCamelCase extends Zend_Filter_Word_SeparatorToCamelCase +{ + /** + * Constructor + * + * @return void + */ + public function __construct() + { + parent::__construct('_'); + } +} diff --git a/lib/Zend/Filter/Word/UnderscoreToDash.php b/lib/Zend/Filter/Word/UnderscoreToDash.php new file mode 100644 index 0000000..43326c4 --- /dev/null +++ b/lib/Zend/Filter/Word/UnderscoreToDash.php @@ -0,0 +1,45 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: CamelCaseToSeparator.php 6779 2007-11-08 15:10:41Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/Word/SeparatorToSeparator.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_UnderscoreToDash extends Zend_Filter_Word_SeparatorToSeparator +{ + /** + * Constructor + * + * @param string $separator Space by default + * @return void + */ + public function __construct() + { + parent::__construct('_', '-'); + } +}
\ No newline at end of file diff --git a/lib/Zend/Filter/Word/UnderscoreToSeparator.php b/lib/Zend/Filter/Word/UnderscoreToSeparator.php new file mode 100644 index 0000000..3fba924 --- /dev/null +++ b/lib/Zend/Filter/Word/UnderscoreToSeparator.php @@ -0,0 +1,45 @@ +<?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_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: UnderscoreToPathSeparator.php 6793 2007-11-09 18:10:06Z matthew $ + */ + +/** + * @see Zend_Filter_PregReplace + */ +require_once 'Zend/Filter/Word/SeparatorToSeparator.php'; + +/** + * @category Zend + * @package Zend_Filter + * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Filter_Word_UnderscoreToSeparator extends Zend_Filter_Word_SeparatorToSeparator +{ + /** + * Constructor + * + * @param string $separator Space by default + * @return void + */ + public function __construct($replacementSeparator = ' ') + { + parent::__construct('_', $replacementSeparator); + } +} |