cvs: pear /PHP_Compat package.xml /PHP_Compat/Compat/Function str_rot13.php /PHP_Compat/tests/function str_rot13.phpt
| From: | Aidan Lister | Date: | Thu, 08 Jul 2004 01:41:05 +0000 |
| Subject: | cvs: pear /PHP_Compat package.xml /PHP_Compat/Compat/Function str_rot13.php /PHP_Compat/tests/function str_rot13.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21621@lists.php.net to get a copy of this message | ||
aidan Wed Jul 7 21:41:05 2004 EDT
Added files:
/pear/PHP_Compat/Compat/Function str_rot13.php
/pear/PHP_Compat/tests/function str_rot13.phpt
Modified files:
/pear/PHP_Compat package.xml
Log:
Added str_rot13
http://cvs.php.net/diff.php/pear/PHP_Compat/package.xml?r1=1.47&r2=1.48&ty=u
Index: pear/PHP_Compat/package.xml
diff -u pear/PHP_Compat/package.xml:1.47 pear/PHP_Compat/package.xml:1.48
--- pear/PHP_Compat/package.xml:1.47 Sat Jun 26 07:28:50 2004
+++ pear/PHP_Compat/package.xml Wed Jul 7 21:41:05 2004
@@ -120,7 +120,8 @@
<license>PHP License</license>
<state>stable</state>
<notes>Added more components:
-* str_word_count</notes>
+* str_word_count
+* str_rot13</notes>
<filelist>
<dir name="/" baseinstalldir="PHP" role="php">
<file>Compat.php</file>
@@ -157,6 +158,7 @@
<file>str_ireplace.php</file>
<file>str_split.php</file>
<file>str_word_count.php</file>
+ <file>str_rot13.php</file>
<file>stripos.php</file>
<file>strripos.php</file>
<file>var_export.php</file>
@@ -194,6 +196,7 @@
<file>str_ireplace.phpt</file>
<file>str_split.phpt</file>
<file>str_word_count.phpt</file>
+ <file>str_rot13.phpt</file>
<file>stripos.phpt</file>
<file>strripos.phpt</file>
<file>var_export.phpt</file>
http://cvs.php.net/co.php/pear/PHP_Compat/Compat/Function/str_rot13.php?r=1.1&p=1
Index: pear/PHP_Compat/Compat/Function/str_rot13.php
+++ pear/PHP_Compat/Compat/Function/str_rot13.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Alan Morey <alan@caint.com> |
// | Aidan Lister <aidan@php.net> |
// +----------------------------------------------------------------------+
//
// $Id: str_rot13.php,v 1.1 2004/07/08 01:41:05 aidan Exp $
//
/**
* Replace str_rot13()
*
* @category PHP
* @package PHP_Compat
* @link http://php.net/function.str_rot13
* @author Alan Morey <alan@caint.com>
* @author Aidan Lister <aidan@php.net>
* @version $Revision: 1.1 $
* @since PHP 4.2.0
*/
if (!function_exists('str_rot13'))
{
function str_rot13($str)
{
$from = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$to = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM';
return strtr($str, $from, $to);
}
}
?>
http://cvs.php.net/co.php/pear/PHP_Compat/tests/function/str_rot13.phpt?r=1.1&p=1
Index: pear/PHP_Compat/tests/function/str_rot13.phpt
+++ pear/PHP_Compat/tests/function/str_rot13.phpt
--TEST--
Function -- str_rot13
--SKIPIF--
<?php if (function_exists('str_rot13')) { echo 'skip'; } ?>
--FILE--
<?php
require_once 'PHP/Compat.php';
PHP_Compat::loadFunction('str_rot13');
$str = "The quick brown fox jumped over the lazy dog.";
echo str_rot13($str);
?>
--EXPECT--
Gur dhvpx oebja sbk whzcrq bire gur ynml qbt.