[Svn-src-all:904] [version-2_5-dev 19792] #744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)
Seasoft
admin @ mail.ec-cube.net
2010年 12月 30日 (木) 16:59:43 JST
Subversion committed to /home/svn/open 19792
http://svn.ec-cube.net/open_trac/changeset/19792
┌────────────────────────────┐
│更新者 : Seasoft │
│更新日時: 2010-12-30 16:59:42 +0900 (木, 30 12月 2010)│
└────────────────────────────┘
Log:
--------------------------------------------------------
#744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)
Changed: [U:修正,A:追加,D:削除]
--------------------------------------------------------
A branches/version-2_5-dev/data/module/Compat/
A branches/version-2_5-dev/data/module/Compat/Compat/
A branches/version-2_5-dev/data/module/Compat/Compat/Components.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/DIRECTORY_SEPARATOR.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/E_STRICT.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/FILE.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/PATH_SEPARATOR.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/PHP_EOL.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/STD.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/T.php
A branches/version-2_5-dev/data/module/Compat/Compat/Constant/UPLOAD_ERR.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_change_key_case.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_chunk.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_combine.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_assoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_key.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_uassoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_ukey.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_assoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_key.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_uassoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_ukey.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_key_exists.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_product.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_search.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_assoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_uassoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_assoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_uassoc.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/array_walk_recursive.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/bcinvert.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/bcpowmod.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/call_user_func_array.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/clone.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/constant.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uudecode.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uuencode.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/debug_print_backtrace.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/file_get_contents.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/file_put_contents.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/floatval.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/fprintf.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/fputcsv.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/get_headers.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/get_include_path.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/html_entity_decode.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/htmlspecialchars_decode.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/http_build_query.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/ibase_timefmt.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/idate.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/image_type_to_mime_type.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_ntop.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_pton.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/ini_get_all.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/is_a.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/md5_file.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/mhash.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/mime_content_type.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_clean.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_flush.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_clean.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_flush.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_affected_rows.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_escape_bytea.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_unescape_bytea.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/php_strip_whitespace.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/restore_include_path.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/scandir.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/set_include_path.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/str_ireplace.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/str_rot13.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/str_shuffle.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/str_split.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/str_word_count.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/stripos.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/strpbrk.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/strripos.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/substr_compare.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/time_sleep_until.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/var_export.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/version_compare.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/vprintf.php
A branches/version-2_5-dev/data/module/Compat/Compat/Function/vsprintf.php
A branches/version-2_5-dev/data/module/Compat/Compat.php
A branches/version-2_5-dev/data/module/Compat/tests/
A branches/version-2_5-dev/data/module/Compat/tests/constant/
A branches/version-2_5-dev/data/module/Compat/tests/constant/directory_separator.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/e_strict.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/file.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/path_separator.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/php_eol.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/std.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/t.phpt
A branches/version-2_5-dev/data/module/Compat/tests/constant/upload_err.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/
A branches/version-2_5-dev/data/module/Compat/tests/function/array_change_key_case.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_chunk.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_combine.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_assoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_key.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_uassoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_ukey.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_assoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_key.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_uassoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_ukey.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_key_exists.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_product.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_search.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_assoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_uassoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_assoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_uassoc.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/array_walk_recursive.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/bcinvert.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/bcpowmod.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/call_user_func_array.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/clone.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/constant.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/convert_uudecode.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/convert_uuencode.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/debug_print_backtrace.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/file_get_contents.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/file_put_contents.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/floatval.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/fprintf.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/fputcsv.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/get_headers.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/get_include_path.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/html_entity_decode.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/htmlspecialchars_decode.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/http_build_query.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/ibase_timefmt.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/idate.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/image_type_to_mime_type.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/inet_ntop.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/inet_pton.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/ini_get_all.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/is_a.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/is_scalar.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/md5_file.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/mhash.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/mime_content_type.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/ob_clean.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/ob_flush.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_clean.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_flush.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/pg_affected_rows.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/pg_escape_bytea.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/pg_unescape_bytea.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/php_strip_whitespace.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/restore_include_path.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/scandir.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/set_include_path.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/str_ireplace.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/str_rot13.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/str_shuffle.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/str_split.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/str_word_count.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/stripos.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/strpbrk.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/strripos.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/substr_compare.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/time_sleep_until.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/var_export.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/version_compare.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/vprintf.phpt
A branches/version-2_5-dev/data/module/Compat/tests/function/vsprintf.phpt
A branches/version-2_5-dev/data/module/Compat/tests/loadconstant.phpt
A branches/version-2_5-dev/data/module/Compat/tests/loadfunction.phpt
A branches/version-2_5-dev/data/module/Compat/tests/loadversion.phpt
追加: branches/version-2_5-dev/data/module/Compat/Compat/Components.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Components.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Components.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,108 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Components.php,v 1.10 2005/12/05 14:49:56 aidan Exp $
+
+
+// Functions
+$components['function']['array_change_key_case'] = '4.2.0';
+$components['function']['array_chunk'] = '4.2.0';
+$components['function']['array_combine'] = '5.0.0';
+$components['function']['array_diff_assoc'] = '4.3.0';
+$components['function']['array_diff_key'] = '5.0.2';
+$components['function']['array_diff_uassoc'] = '5.0.0';
+$components['function']['array_diff_ukey'] = '5.0.2';
+$components['function']['array_intersect_assoc'] = '5.0.0';
+$components['function']['array_intersect_key'] = '5.0.2';
+$components['function']['array_intersect_uassoc'] = '5.0.0';
+$components['function']['array_intersect_ukey'] = '5.0.2';
+$components['function']['array_key_exists'] = '4.1.0';
+$components['function']['array_product'] = '5.1.0';
+$components['function']['array_search'] = '4.0.5';
+$components['function']['array_udiff'] = '5.0.0';
+$components['function']['array_udiff_assoc'] = '5.0.0';
+$components['function']['array_udiff_uassoc'] = '5.0.0';
+$components['function']['array_uintersect'] = '5.0.0';
+$components['function']['array_uintersect_assoc'] = '5.0.0';
+$components['function']['array_uintersect_uassoc'] = '5.0.0';
+$components['function']['array_walk_recursive'] = '5.0.0';
+$components['function']['bcinvert'] = '5.2.0';
+$components['function']['bcpowmod'] = '5.0.0';
+$components['function']['call_user_func_array'] = '4.0.4';
+$components['function']['clone'] = '5.0.0';
+$components['function']['constant'] = '4.0.4';
+$components['function']['convert_uudecode'] = '5.0.0';
+$components['function']['convert_uuencode'] = '5.0.0';
+$components['function']['debug_print_backtrace'] = '5.0.0';
+$components['function']['file_get_contents'] = '4.3.0';
+$components['function']['file_put_contents'] = '5.0.0';
+$components['function']['floatval'] = '4.2.0';
+$components['function']['fprintf'] = '5.0.0';
+$components['function']['fputcsv'] = '5.0.0';
+$components['function']['get_headers'] = '5.0.0';
+$components['function']['get_include_path'] = '4.3.0';
+$components['function']['html_entity_decode'] = '4.3.0';
+$components['function']['htmlspecialchars_decode'] = '5.1.0';
+$components['function']['http_build_query'] = '5.0.0';
+$components['function']['ibase_timefmt'] = '5.0.0';
+$components['function']['idate'] = '5.1.0';
+$components['function']['image_type_to_mime_type'] = '4.3.0';
+$components['function']['inet_ntop'] = '5.1.0';
+$components['function']['inet_pton'] = '5.1.0';
+$components['function']['ini_get_all'] = '4.2.0';
+$components['function']['is_a'] = '4.2.0';
+$components['function']['is_scalar'] = '4.0.5';
+$components['function']['md5_file'] = '4.2.0';
+$components['function']['mhash'] = '4.0.0';
+$components['function']['mime_content_type'] = '4.3.0';
+$components['function']['ob_clean'] = '4.2.0';
+$components['function']['ob_flush'] = '4.2.0';
+$components['function']['ob_get_clean'] = '4.3.0';
+$components['function']['ob_get_flush'] = '4.3.0';
+$components['function']['php_strip_whitespace'] = '5.0.0';
+$components['function']['property_exists'] = '5.1.0';
+$components['function']['pg_affected_rows'] = '4.2.0';
+$components['function']['pg_escape_bytea'] = '4.2.0';
+$components['function']['pg_unescape_bytea'] = '4.2.0';
+$components['function']['restore_include_path'] = '4.3.0';
+$components['function']['scandir'] = '5.0.0';
+$components['function']['set_include_path'] = '4.3.0';
+$components['function']['str_ireplace'] = '5.0.0';
+$components['function']['str_rot13'] = '4.2.0';
+$components['function']['str_shuffle'] = '4.3.0';
+$components['function']['str_split'] = '5.0.0';
+$components['function']['str_word_count'] = '4.3.0';
+$components['function']['stripos'] = '5.0.0';
+$components['function']['strpbrk'] = '5.0.0';
+$components['function']['strripos'] = '5.0.0';
+$components['function']['substr_compare'] = '5.0.0';
+$components['function']['time_sleep_until'] = '5.1.0';
+$components['function']['var_export'] = '4.2.0';
+$components['function']['version_compare'] = '4.1.0';
+$components['function']['vprintf'] = '4.1.0';
+$components['function']['vsprintf'] = '4.1.0';
+
+// Constants
+$components['constant']['DIRECTORY_SEPARATOR'] = '4.0.6';
+$components['constant']['E_STRICT'] = '5.0.0';
+$components['constant']['FILE'] = '4.3.0';
+$components['constant']['PATH_SEPARATOR'] = '4.3.0';
+$components['constant']['PHP_EOL'] = '5.0.1';
+$components['constant']['STD'] = '4.3.0';
+$components['constant']['T'] = '5.0.0';
+$components['constant']['UPLOAD_ERR'] = '4.3.0';
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/DIRECTORY_SEPARATOR.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/DIRECTORY_SEPARATOR.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/DIRECTORY_SEPARATOR.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: DIRECTORY_SEPARATOR.php,v 1.1 2004/11/28 03:55:28 aidan Exp $
+
+
+/**
+ * Replace constant DIRECTORY_SEPARATOR
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/reserved.constants.standard
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.1 $
+ * @since PHP 4.0.6
+ */
+if (!defined('DIRECTORY_SEPARATOR')) {
+ define('DIRECTORY_SEPARATOR',
+ strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/'
+ );
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/E_STRICT.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/E_STRICT.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/E_STRICT.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,35 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: E_STRICT.php,v 1.11 2004/08/19 10:09:52 aidan Exp $
+
+
+/**
+ * Replace constant E_STRICT
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/ref.errorfunc
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.11 $
+ * @since PHP 5
+ */
+if (!defined('E_STRICT')) {
+ define('E_STRICT', 2048);
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/FILE.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/FILE.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/FILE.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,51 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: FILE.php,v 1.8 2004/08/19 10:09:52 aidan Exp $
+
+
+/**
+ * Replace filesystem constants
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/ref.filesystem
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.8 $
+ * @since PHP 5
+ */
+if (!defined('FILE_USE_INCLUDE_PATH')) {
+ define('FILE_USE_INCLUDE_PATH', 1);
+}
+
+if (!defined('FILE_IGNORE_NEW_LINES')) {
+ define('FILE_IGNORE_NEW_LINES', 2);
+}
+
+if (!defined('FILE_SKIP_EMPTY_LINES')) {
+ define('FILE_SKIP_EMPTY_LINES', 4);
+}
+
+if (!defined('FILE_APPEND')) {
+ define('FILE_APPEND', 8);
+}
+
+if (!defined('FILE_NO_DEFAULT_CONTEXT')) {
+ define('FILE_NO_DEFAULT_CONTEXT', 16);
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/PATH_SEPARATOR.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/PATH_SEPARATOR.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/PATH_SEPARATOR.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: PATH_SEPARATOR.php,v 1.13 2004/11/14 16:10:18 aidan Exp $
+
+
+/**
+ * Replace constant PATH_SEPARATOR
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/ref.dir
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.13 $
+ * @since PHP 4.3.0
+ */
+if (!defined('PATH_SEPARATOR')) {
+ define('PATH_SEPARATOR',
+ strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? ';' : ':'
+ );
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/PHP_EOL.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/PHP_EOL.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/PHP_EOL.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: PHP_EOL.php,v 1.2 2004/10/10 13:58:09 aidan Exp $
+
+
+/**
+ * Replace PHP_EOL constant
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/reserved.constants.core
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5.0.2
+ */
+if (!defined('PHP_EOL')) {
+ switch (strtoupper(substr(PHP_OS, 0, 3))) {
+ // Windows
+ case 'WIN':
+ define('PHP_EOL', "\r\n");
+ break;
+
+ // Mac
+ case 'DAR':
+ define('PHP_EOL', "\r");
+ break;
+
+ // Unix
+ default:
+ define('PHP_EOL', "\n");
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/STD.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/STD.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/STD.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,43 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: STD.php,v 1.9 2004/08/19 10:09:52 aidan Exp $
+
+
+/**
+ * Replace commandline constants
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/features.commandline
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.9 $
+ * @since PHP 4.3.0
+ */
+if (!defined('STDIN')) {
+ define('STDIN', fopen('php://stdin', 'r'));
+}
+
+if (!defined('STDOUT')) {
+ define('STDOUT', fopen('php://stdout', 'w'));
+}
+
+if (!defined('STDERR')) {
+ define('STDERR', fopen('php://stderr', 'w'));
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/T.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/T.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/T.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,72 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: T.php,v 1.4 2004/11/14 16:43:40 aidan Exp $
+
+
+/**
+ * Replace tokenizer constants
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/ref.tokenizer
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 5
+ */
+if (!defined('T_ML_COMMENT')) {
+ define('T_ML_COMMENT', T_COMMENT);
+}
+if (!defined('T_DOC_COMMENT')) {
+ define('T_DOC_COMMENT', T_ML_COMMENT);
+}
+
+if (!defined('T_OLD_FUNCTION')) {
+ define('T_OLD_FUNCTION', -1);
+}
+if (!defined('T_ABSTRACT')) {
+ define('T_ABSTRACT', -1);
+}
+if (!defined('T_CATCH')) {
+ define('T_CATCH', -1);
+}
+if (!defined('T_FINAL')) {
+ define('T_FINAL', -1);
+}
+if (!defined('T_INSTANCEOF')) {
+ define('T_INSTANCEOF', -1);
+}
+if (!defined('T_PRIVATE')) {
+ define('T_PRIVATE', -1);
+}
+if (!defined('T_PROTECTED')) {
+ define('T_PROTECTED', -1);
+}
+if (!defined('T_PUBLIC')) {
+ define('T_PUBLIC', -1);
+}
+if (!defined('T_THROW')) {
+ define('T_THROW', -1);
+}
+if (!defined('T_TRY')) {
+ define('T_TRY', -1);
+}
+if (!defined('T_CLONE')) {
+ define('T_CLONE', -1);
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Constant/UPLOAD_ERR.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Constant/UPLOAD_ERR.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Constant/UPLOAD_ERR.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,51 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: UPLOAD_ERR.php,v 1.1 2004/10/12 08:41:11 aidan Exp $
+
+
+/**
+ * Replace upload error constants
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/features.file-upload.errors
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.1 $
+ * @since PHP 4.3.0
+ */
+if (!defined('UPLOAD_ERR_OK')) {
+ define('UPLOAD_ERR_OK', 0);
+}
+
+if (!defined('UPLOAD_ERR_INI_SIZE')) {
+ define('UPLOAD_ERR_INI_SIZE', 1);
+}
+
+if (!defined('UPLOAD_ERR_FORM_SIZE')) {
+ define('UPLOAD_ERR_FORM_SIZE', 2);
+}
+
+if (!defined('UPLOAD_ERR_PARTIAL')) {
+ define('UPLOAD_ERR_PARTIAL', 3);
+}
+
+if (!defined('UPLOAD_ERR_NO_FILE')) {
+ define('UPLOAD_ERR_NO_FILE', 4);
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_change_key_case.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_change_key_case.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_change_key_case.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,64 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_change_key_case.php,v 1.11 2005/12/07 21:08:57 aidan Exp $
+
+
+if (!defined('CASE_LOWER')) {
+ define('CASE_LOWER', 0);
+}
+
+if (!defined('CASE_UPPER')) {
+ define('CASE_UPPER', 1);
+}
+
+
+/**
+ * Replace array_change_key_case()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_change_key_case
+ * @author Stephan Schmidt <schst @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.11 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_change_key_case')) {
+ function array_change_key_case($input, $case = CASE_LOWER)
+ {
+ if (!is_array($input)) {
+ user_error('array_change_key_case(): The argument should be an array',
+ E_USER_WARNING);
+ return false;
+ }
+
+ $output = array ();
+ $keys = array_keys($input);
+ $casefunc = ($case == CASE_LOWER) ? 'strtolower' : 'strtoupper';
+
+ foreach ($keys as $key) {
+ $output[$casefunc($key)] = $input[$key];
+ }
+
+ return $output;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_chunk.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_chunk.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_chunk.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,72 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_chunk.php,v 1.14 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_combine()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_chunk
+ * @author Aidan Lister <aidan @ php.net>
+ * @author Thiemo M舩tig (http://maettig.com)
+ * @version $Revision: 1.14 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_chunk')) {
+ function array_chunk($input, $size, $preserve_keys = false)
+ {
+ if (!is_array($input)) {
+ user_error('array_chunk() expects parameter 1 to be array, ' .
+ gettype($input) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_numeric($size)) {
+ user_error('array_chunk() expects parameter 2 to be long, ' .
+ gettype($size) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ $size = (int)$size;
+ if ($size <= 0) {
+ user_error('array_chunk() Size parameter expected to be greater than 0',
+ E_USER_WARNING);
+ return;
+ }
+
+ $chunks = array();
+ $i = 0;
+
+ if ($preserve_keys !== false) {
+ foreach ($input as $key => $value) {
+ $chunks[(int)($i++ / $size)][$key] = $value;
+ }
+ } else {
+ foreach ($input as $value) {
+ $chunks[(int)($i++ / $size)][] = $value;
+ }
+ }
+
+ return $chunks;
+ }
+}
+
+?>
\ No newline at end of file
霑ス蜉 branches/version-2_5-dev/data/module/Compat/Compat/Function/array_combine.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_combine.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_combine.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,71 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_combine.php,v 1.21 2005/01/28 02:27:52 aidan Exp $
+
+
+/**
+ * Replace array_combine()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_combine
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.21 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_combine')) {
+ function array_combine($keys, $values)
+ {
+ if (!is_array($keys)) {
+ user_error('array_combine() expects parameter 1 to be array, ' .
+ gettype($keys) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_array($values)) {
+ user_error('array_combine() expects parameter 2 to be array, ' .
+ gettype($values) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ $key_count = count($keys);
+ $value_count = count($values);
+ if ($key_count !== $value_count) {
+ user_error('array_combine() Both parameters should have equal number of elements', E_USER_WARNING);
+ return false;
+ }
+
+ if ($key_count === 0 || $value_count === 0) {
+ user_error('array_combine() Both parameters should have number of elements at least 0', E_USER_WARNING);
+ return false;
+ }
+
+ $keys = array_values($keys);
+ $values = array_values($values);
+
+ $combined = array();
+ for ($i = 0; $i < $key_count; $i++) {
+ $combined[$keys[$i]] = $values[$i];
+ }
+
+ return $combined;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_assoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_assoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_assoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,76 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_diff_assoc.php,v 1.12 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+ * Replace array_diff_assoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_diff_assoc
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.12 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_diff_assoc')) {
+ function array_diff_assoc()
+ {
+ // Check we have enough arguments
+ $args = func_get_args();
+ $count = count($args);
+ if (count($args) < 2) {
+ user_error('Wrong parameter count for array_diff_assoc()', E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ for ($i = 0; $i < $count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_diff_assoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Get the comparison array
+ $array_comp = array_shift($args);
+ --$count;
+
+ // Traverse values of the first array
+ foreach ($array_comp as $key => $value) {
+ // Loop through the other arrays
+ for ($i = 0; $i < $count; $i++) {
+ // Loop through this arrays key/value pairs and compare
+ foreach ($args[$i] as $comp_key => $comp_value) {
+ if ((string)$key === (string)$comp_key &&
+ (string)$value === (string)$comp_value)
+ {
+
+ unset($array_comp[$key]);
+ }
+ }
+ }
+ }
+
+ return $array_comp;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_key.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_key.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_key.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,66 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_diff_key.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_diff_key()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_diff_key
+ * @author Tom Buskens <ortega @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 5.0.2
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_diff_key')) {
+ function array_diff_key()
+ {
+ $args = func_get_args();
+ if (count($args) < 2) {
+ user_error('Wrong parameter count for array_diff_key()', E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_diff_key() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ $result = $args[0];
+ foreach ($args[0] as $key1 => $value1) {
+ for ($i = 1; $i !== $array_count; $i++) {
+ foreach ($args[$i] as $key2 => $value2) {
+ if ((string) $key1 === (string) $key2) {
+ unset($result[$key2]);
+ break 2;
+ }
+ }
+ }
+ }
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_uassoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_uassoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_uassoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,83 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_diff_uassoc.php,v 1.2 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_diff_uassoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_diff_uassoc
+ * @version $Revision: 1.2 $
+ * @since PHP 5.0.0
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_diff_uassoc')) {
+ function array_diff_uassoc()
+ {
+ // Sanity check
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_diff_uassoc()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0] . '::' . $compare_func[1];
+ }
+ user_error('array_diff_uassoc() Not a valid callback ' .
+ $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_diff_uassoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $result = array();
+ foreach ($args[0] as $k => $v) {
+ for ($i = 1; $i < $array_count; $i++) {
+ foreach ($args[$i] as $kk => $vv) {
+ if ($v == $vv) {
+ $compare = call_user_func_array($compare_func, array($k, $kk));
+ if ($compare == 0) {
+ continue 3;
+ }
+ }
+ }
+ }
+
+ $result[$k] = $v;
+ }
+
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_ukey.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_ukey.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_diff_ukey.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,79 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_diff_ukey.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_diff_ukey()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_diff_ukey
+ * @author Tom Buskens <ortega @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 5.0.2
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_diff_ukey')) {
+ function array_diff_ukey()
+ {
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_diff_ukey()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0].'::'.$compare_func[1];
+ }
+ user_error('array_diff_ukey() Not a valid callback ' .
+ $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_diff_ukey() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $result = $args[0];
+ foreach ($args[0] as $key1 => $value1) {
+ for ($i = 1; $i !== $array_count; $i++) {
+ foreach ($args[$i] as $key2 => $value2) {
+ if (!(call_user_func($compare_func, (string) $key1, (string) $key2))) {
+ unset($result[$key1]);
+ break 2;
+ }
+ }
+ }
+ }
+
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_assoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_assoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_assoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,69 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_intersect_assoc.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_intersect_assoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_intersect_assoc
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_intersect_assoc')) {
+ function array_intersect_assoc()
+ {
+ // Sanity check
+ $args = func_get_args();
+ if (count($args) < 2) {
+ user_error('wrong parameter count for array_intersect_assoc()', E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_intersect_assoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $intersect = array();
+ foreach ($args[0] as $key => $value) {
+ $intersect[$key] = $value;
+
+ for ($i = 1; $i < $array_count; $i++) {
+ if (!isset($args[$i][$key]) || $args[$i][$key] != $value) {
+ unset($intersect[$key]);
+ break;
+ }
+ }
+ }
+
+ return $intersect;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_key.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_key.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_key.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,67 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_intersect_key.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_intersect_key()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_intersect_key
+ * @author Tom Buskens <ortega @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 5.0.2
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_intersect_key')) {
+ function array_intersect_key()
+ {
+ $args = func_get_args();
+ if (count($args) < 2) {
+ user_error('Wrong parameter count for array_intersect_key()', E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_intersect_key() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $result = array();
+ foreach ($args[0] as $key1 => $value1) {
+ for ($i = 1; $i !== $array_count; $i++) {
+ foreach ($args[$i] as $key2 => $value2) {
+ if ((string) $key1 === (string) $key2) {
+ $result[$key1] = $value1;
+ }
+ }
+ }
+ }
+
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_uassoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_uassoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_uassoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,90 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_intersect_uassoc.php,v 1.5 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_intersect_assoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_intersect_uassoc
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.5 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_intersect_uassoc')) {
+ function array_intersect_uassoc()
+ {
+ // Sanity check
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_intersect_ukey()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0] . '::' . $compare_func[1];
+ }
+ user_error('array_intersect_uassoc() Not a valid callback ' .
+ $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_intersect_uassoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $result = array();
+ foreach ($args[0] as $k => $v) {
+ for ($i = 0; $i < $array_count; $i++) {
+ $match = false;
+ foreach ($args[$i] as $kk => $vv) {
+ $compare = call_user_func_array($compare_func, array($k, $kk));
+ if ($compare === 0 && $v == $vv) {
+ $match = true;
+ continue 2;
+ }
+ }
+
+ if ($match === false) {
+ continue 2;
+ }
+ }
+
+ if ($match === true) {
+ $result[$k] = $v;
+ }
+ }
+
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_ukey.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_ukey.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_intersect_ukey.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,79 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_intersect_ukey.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_intersect_ukey()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_intersect_ukey
+ * @author Tom Buskens <ortega @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 5.0.2
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_intersect_ukey')) {
+ function array_intersect_ukey()
+ {
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_intersect_ukey()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0].'::'.$compare_func[1];
+ }
+ user_error('array_diff_ukey() Not a valid callback ' .
+ $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i !== $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_intersect_ukey() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $result = array();
+ foreach ($args[0] as $key1 => $value1) {
+ for ($i = 1; $i !== $array_count; $i++) {
+ foreach ($args[$i] as $key2 => $value2) {
+ if (!(call_user_func($compare_func, (string) $key1, (string) $key2))) {
+ $result[$key1] = $value1;
+ break 2;
+ }
+ }
+ }
+ }
+
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_key_exists.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_key_exists.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_key_exists.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,55 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_key_exists.php,v 1.7 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_key_exists()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_key_exists
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.7 $
+ * @since PHP 4.1.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_key_exists')) {
+ function array_key_exists($key, $search)
+ {
+ if (!is_scalar($key)) {
+ user_error('array_key_exists() The first argument should be either a string or an integer',
+ E_USER_WARNING);
+ return false;
+ }
+
+ if (is_object($search)) {
+ $search = get_object_vars($search);
+ }
+
+ if (!is_array($search)) {
+ user_error('array_key_exists() The second argument should be either an array or an object',
+ E_USER_WARNING);
+ return false;
+ }
+
+ return in_array($key, array_keys($search));
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_product.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_product.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_product.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,53 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Arpad Ray <arpad @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_product.php,v 1.1 2005/12/05 14:49:08 aidan Exp $
+
+
+/**
+ * Replace array_product()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/time_sleep_until
+ * @author Arpad Ray <arpad @ php.net>
+ * @version $Revision: 1.1 $
+ * @since PHP 5.1.0
+ * @require PHP 4.0.1 (trigger_error)
+ */
+if (!function_exists('array_product')) {
+ function array_product($array)
+ {
+ if (!is_array($array)) {
+ trigger_error('The argument should be an array', E_USER_WARNING);
+ return;
+ }
+
+ if (empty($array)) {
+ return 0;
+ }
+
+ $r = 1;
+ foreach ($array as $v) {
+ $r *= $v;
+ }
+
+ return $r;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_search.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_search.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_search.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,51 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_search.php,v 1.6 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_search()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_search
+ * @author Aidan Lister <aidan @ php.net>
+ * @author Thiemo M舩tig (http://maettig.com/)
+ * @version $Revision: 1.6 $
+ * @since PHP 4.0.5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('array_search')) {
+ function array_search($needle, $haystack, $strict = false)
+ {
+ if (!is_array($haystack)) {
+ user_error('array_search() Wrong datatype for second argument', E_USER_WARNING);
+ return false;
+ }
+
+ foreach ($haystack as $key => $value) {
+ if ($strict ? $value === $needle : $value == $needle) {
+ return $key;
+ }
+ }
+
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
霑ス蜉 branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,83 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_udiff.php,v 1.10 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_udiff()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_udiff
+ * @author Stephan Schmidt <schst @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.10 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_udiff')) {
+ function array_udiff()
+ {
+ $args = func_get_args();
+
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_udiff()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0] . '::' . $compare_func[1];
+ }
+ user_error('array_udiff() Not a valid callback ' .
+ $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $cnt = count($args);
+ for ($i = 0; $i < $cnt; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_udiff() Argument #' .
+ ($i + 1). ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ $diff = array ();
+ // Traverse values of the first array
+ foreach ($args[0] as $key => $value) {
+ // Check all arrays
+ for ($i = 1; $i < $cnt; $i++) {
+ foreach ($args[$i] as $cmp_value) {
+ $result = call_user_func($compare_func, $value, $cmp_value);
+ if ($result === 0) {
+ continue 3;
+ }
+ }
+ }
+ $diff[$key] = $value;
+ }
+ return $diff;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_assoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_assoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_assoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,85 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_udiff_assoc.php,v 1.14 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_udiff_assoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @author Stephan Schmidt <schst @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.14 $
+ * @link http://php.net/function.array-udiff-assoc
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_udiff_assoc')) {
+ function array_udiff_assoc()
+ {
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_udiff_assoc()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0] . '::' . $compare_func[1];
+ }
+ user_error('array_udiff_assoc() Not a valid callback ' .
+ $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $count = count($args);
+ for ($i = 0; $i < $count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_udiff_assoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ $diff = array ();
+ // Traverse values of the first array
+ foreach ($args[0] as $key => $value) {
+ // Check all arrays
+ for ($i = 1; $i < $count; $i++) {
+ if (!array_key_exists($key, $args[$i])) {
+ continue;
+ }
+ $result = call_user_func($compare_func, $value, $args[$i][$key]);
+ if ($result === 0) {
+ continue 2;
+ }
+ }
+
+ $diff[$key] = $value;
+ }
+
+ return $diff;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_uassoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_uassoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_udiff_uassoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,82 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_udiff_uassoc.php,v 1.8 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_udiff_uassoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_udiff_uassoc
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.8 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_udiff_uassoc')) {
+ function array_udiff_uassoc()
+ {
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('Wrong parameter count for array_udiff_uassoc()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $compare_func = array_pop($args);
+ if (!is_callable($compare_func)) {
+ if (is_array($compare_func)) {
+ $compare_func = $compare_func[0] . '::' . $compare_func[1];
+ }
+ user_error('array_udiff_uassoc() Not a valid callback ' . $compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $count = count($args);
+ for ($i = 0; $i < $count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_udiff_uassoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Traverse values of the first array
+ $diff = array ();
+ foreach ($args[0] as $key => $value) {
+ // Check all arrays
+ for ($i = 1; $i < $count; $i++) {
+ if (!array_key_exists($key, $args[$i])) {
+ continue;
+ }
+ $result = call_user_func($compare_func, $value, $args[$i][$key]);
+ if ($result === 0) {
+ continue 2;
+ }
+ }
+
+ $diff[$key] = $value;
+ }
+
+ return $diff;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,82 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Tom Buskens <ortega @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_uintersect.php,v 1.9 2005/05/10 12:05:48 aidan Exp $
+
+
+/**
+ * Replace array_uintersect()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_uintersect
+ * @author Tom Buskens <ortega @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.9 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_uintersect')) {
+ function array_uintersect()
+ {
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('wrong parameter count for array_uintersect()',
+ E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $user_func = array_pop($args);
+ if (!is_callable($user_func)) {
+ if (is_array($user_func)) {
+ $user_func = $user_func[0] . '::' . $user_func[1];
+ }
+ user_error('array_uintersect() Not a valid callback ' .
+ $user_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i < $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_uintersect() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $output = array();
+ foreach ($args[0] as $key => $item) {
+ for ($i = 1; $i !== $array_count; $i++) {
+ $array = $args[$i];
+ foreach($array as $key0 => $item0) {
+ if (!call_user_func($user_func, $item, $item0)) {
+ $output[$key] = $item;
+ }
+ }
+ }
+ }
+
+ return $output;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_assoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_assoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_assoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,81 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Tom Buskens <ortega @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_uintersect_assoc.php,v 1.9 2005/05/10 07:50:08 aidan Exp $
+
+
+/**
+ * Replace array_uintersect_assoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_uintersect_assoc
+ * @author Tom Buskens <ortega @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.9 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_uintersect_assoc')) {
+ function array_uintersect_assoc()
+ {
+ $args = func_get_args();
+ if (count($args) < 3) {
+ user_error('wrong parameter count for array_uintersect_assoc()', E_USER_WARNING);
+ return;
+ }
+
+ // Get compare function
+ $user_func = array_pop($args);
+ if (!is_callable($user_func)) {
+ if (is_array($user_func)) {
+ $user_func = $user_func[0] . '::' . $user_func[1];
+ }
+ user_error('array_uintersect_assoc() Not a valid callback ' .
+ $user_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $array_count = count($args);
+ for ($i = 0; $i < $array_count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_uintersect_assoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Compare entries
+ $output = array();
+ foreach ($args[0] as $key => $item) {
+ for ($i = 1; $i !== $array_count; $i++) {
+ if (array_key_exists($key, $args[$i])) {
+ $compare = call_user_func($user_func, $item, $args[$i][$key]);
+ if ($compare === 0) {
+ $output[$key] = $item;
+ }
+ }
+ }
+ }
+
+ return $output;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_uassoc.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_uassoc.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_uintersect_uassoc.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,97 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_uintersect_uassoc.php,v 1.12 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_uintersect_uassoc()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_uintersect_uassoc
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.12 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_uintersect_uassoc')) {
+ function array_uintersect_uassoc()
+ {
+ $args = func_get_args();
+ if (count($args) < 4) {
+ user_error('Wrong parameter count for array_uintersect_uassoc()',
+ E_USER_WARNING);
+ return;
+ }
+
+ // Get key_compare_func
+ $key_compare_func = array_pop($args);
+ if (!is_callable($key_compare_func)) {
+ if (is_array($key_compare_func)) {
+ $key_compare_func = $key_compare_func[0] . '::' . $key_compare_func[1];
+ }
+ user_error('array_uintersect_uassoc() Not a valid callback ' .
+ $key_compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Get data_compare_func
+ $data_compare_func = array_pop($args);
+ if (!is_callable($data_compare_func)) {
+ if (is_array($data_compare_func)) {
+ $data_compare_func = $data_compare_func[0] . '::' . $data_compare_func[1];
+ }
+ user_error('array_uintersect_uassoc() Not a valid callback '
+ . $data_compare_func, E_USER_WARNING);
+ return;
+ }
+
+ // Check arrays
+ $count = count($args);
+ for ($i = 0; $i !== $count; $i++) {
+ if (!is_array($args[$i])) {
+ user_error('array_uintersect_uassoc() Argument #' .
+ ($i + 1) . ' is not an array', E_USER_WARNING);
+ return;
+ }
+ }
+
+ // Traverse values of the first array
+ $intersect = array ();
+ foreach ($args[0] as $key => $value) {
+ // Check against each array
+ for ($i = 1; $i < $count; $i++) {
+ // Traverse each element in current array
+ foreach ($args[$i] as $ckey => $cvalue) {
+ // Compare key and value
+ if (call_user_func($key_compare_func, $key, $ckey) === 0 &&
+ call_user_func($data_compare_func, $value, $cvalue) === 0)
+ {
+
+ $intersect[$key] = $value;
+ continue;
+ }
+ }
+ }
+ }
+
+ return $intersect;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/array_walk_recursive.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/array_walk_recursive.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/array_walk_recursive.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,68 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Tom Buskens <ortega @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: array_walk_recursive.php,v 1.7 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace array_walk_recursive()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.array_walk_recursive
+ * @author Tom Buskens <ortega @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.7 $
+ * @since PHP 5
+ * @require PHP 4.0.6 (is_callable)
+ */
+if (!function_exists('array_walk_recursive')) {
+ function array_walk_recursive(&$input, $funcname)
+ {
+ if (!is_callable($funcname)) {
+ if (is_array($funcname)) {
+ $funcname = $funcname[0] . '::' . $funcname[1];
+ }
+ user_error('array_walk_recursive() Not a valid callback ' . $user_func,
+ E_USER_WARNING);
+ return;
+ }
+
+ if (!is_array($input)) {
+ user_error('array_walk_recursive() The argument should be an array',
+ E_USER_WARNING);
+ return;
+ }
+
+ $args = func_get_args();
+
+ foreach ($input as $key => $item) {
+ if (is_array($item)) {
+ array_walk_recursive($item, $funcname, $args);
+ $input[$key] = $item;
+ } else {
+ $args[0] = &$item;
+ $args[1] = &$key;
+ call_user_func_array($funcname, $args);
+ $input[$key] = $item;
+ }
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/bcinvert.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/bcinvert.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/bcinvert.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,76 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: bcinvert.php,v 1.2 2005/11/22 20:24:45 aidan Exp $
+
+
+/**
+ * Replace bcinvert()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.bcinvert
+ * @author Sara Golemon <pollita @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5.2.0
+ * @require PHP 4.0.4 (call_user_func_array)
+ */
+if (!function_exists('bcinvert')) {
+ function bcinvert($a, $n)
+ {
+ // Sanity check
+ if (!is_scalar($a)) {
+ user_error('bcinvert() expects parameter 1 to be string, ' .
+ gettype($a) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($n)) {
+ user_error('bcinvert() expects parameter 2 to be string, ' .
+ gettype($n) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ $u1 = $v2 = '1';
+ $u2 = $v1 = '0';
+ $u3 = $n;
+ $v3 = $a;
+
+ while (bccomp($v3, '0')) {
+ $q0 = bcdiv($u3, $v3);
+ $t1 = bcsub($u1, bcmul($q0, $v1));
+ $t2 = bcsub($u2, bcmul($q0, $v2));
+ $t3 = bcsub($u3, bcmul($q0, $v3));
+
+ $u1 = $v1;
+ $u2 = $v2;
+ $u3 = $v3;
+
+ $v1 = $t1;
+ $v2 = $t2;
+ $v3 = $t3;
+ }
+
+ if (bccomp($u2, '0') < 0) {
+ return bcadd($u2, $n);
+ } else {
+ return bcmod($u2, $n);
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/bcpowmod.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/bcpowmod.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/bcpowmod.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,75 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: bcpowmod.php,v 1.2 2005/11/22 20:24:45 aidan Exp $
+
+
+/**
+ * Replace bcpowmod()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.bcpowmod
+ * @author Sara Golemon <pollita @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5.0.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('bcpowmod')) {
+ function bcpowmod($x, $y, $modulus, $scale)
+ {
+ // Sanity check
+ if (!is_scalar($x)) {
+ user_error('bcpowmod() expects parameter 1 to be string, ' .
+ gettype($x) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($y)) {
+ user_error('bcpowmod() expects parameter 2 to be string, ' .
+ gettype($y) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($modulus)) {
+ user_error('bcpowmod() expects parameter 3 to be string, ' .
+ gettype($modulus) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($scale)) {
+ user_error('bcpowmod() expects parameter 4 to be integer, ' .
+ gettype($scale) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ $t = '1';
+ while (bccomp($y, '0')) {
+ if (bccomp(bcmod($y, '2'), '0')) {
+ $t = bcmod(bcmul($t, $x), $modulus);
+ $y = bcsub($y, '1');
+ }
+
+ $x = bcmod(bcmul($x, $x), $modulus);
+ $y = bcdiv($y, '2');
+ }
+
+ return $t;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/call_user_func_array.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/call_user_func_array.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/call_user_func_array.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,75 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: call_user_func_array.php,v 1.13 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace call_user_func_array()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.call_user_func_array
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.13 $
+ * @since PHP 4.0.4
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('call_user_func_array')) {
+ function call_user_func_array($function, $param_arr)
+ {
+ $param_arr = array_values((array) $param_arr);
+
+ // Sanity check
+ if (!is_callable($function)) {
+ if (is_array($function) && count($function) > 2) {
+ $function = $function[0] . '::' . $function[1];
+ }
+ $error = sprintf('call_user_func_array() First argument is expected ' .
+ 'to be a valid callback, \'%s\' was given', $function);
+ user_error($error, E_USER_WARNING);
+ return;
+ }
+
+ // Build argument string
+ $arg_string = '';
+ $comma = '';
+ for ($i = 0, $x = count($param_arr); $i < $x; $i++) {
+ $arg_string .= $comma . "\$param_arr[$i]";
+ $comma = ', ';
+ }
+
+ // Determine method of calling function
+ if (is_array($function)) {
+ $object =& $function[0];
+ $method = $function[1];
+
+ // Static vs method call
+ if (is_string($function[0])) {
+ eval("\$retval = $object::\$method($arg_string);");
+ } else {
+ eval("\$retval = \$object->\$method($arg_string);");
+ }
+ } else {
+ eval("\$retval = \$function($arg_string);");
+ }
+
+ return $retval;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/clone.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/clone.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/clone.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,56 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: clone.php,v 1.3 2005/05/01 10:40:59 aidan Exp $
+
+
+/**
+ * Replace clone()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/language.oop5.cloning
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.3 $
+ * @since PHP 5.0.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (version_compare(phpversion(), '5.0') === -1) {
+ // Needs to be wrapped in eval as clone is a keyword in PHP5
+ eval('
+ function clone($object)
+ {
+ // Sanity check
+ if (!is_object($object)) {
+ user_error(\'clone() __clone method called on non-object\', E_USER_WARNING);
+ return;
+ }
+
+ // Use serialize/unserialize trick to deep copy the object
+ $object = unserialize(serialize($object));
+
+ // If there is a __clone method call it on the "new" class
+ if (method_exists($object, \'__clone\')) {
+ $object->__clone();
+ }
+
+ return $object;
+ }
+ ');
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/constant.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/constant.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/constant.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,47 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: constant.php,v 1.7 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace constant()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.constant
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.7 $
+ * @since PHP 4.0.4
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('constant')) {
+ function constant($constant)
+ {
+ if (!defined($constant)) {
+ $error = sprintf('constant() Couldn\'t find constant %s', $constant);
+ user_error($error, E_USER_WARNING);
+ return false;
+ }
+
+ eval("\$value=$constant;");
+
+ return $value;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uudecode.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uudecode.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uudecode.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,79 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Michael Wallner <mike @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: convert_uudecode.php,v 1.8 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace convert_uudecode()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.convert_uudecode
+ * @author Michael Wallner <mike @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.8 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('convert_uudecode')) {
+ function convert_uudecode($string)
+ {
+ // Sanity check
+ if (!is_scalar($string)) {
+ user_error('convert_uuencode() expects parameter 1 to be string, ' .
+ gettype($string) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (strlen($string) < 8) {
+ user_error('convert_uuencode() The given parameter is not a valid uuencoded string', E_USER_WARNING);
+ return false;
+ }
+
+ $decoded = '';
+ foreach (explode("\n", $string) as $line) {
+
+ $c = count($bytes = unpack('c*', substr(trim($line), 1)));
+
+ while ($c % 4) {
+ $bytes[++$c] = 0;
+ }
+
+ foreach (array_chunk($bytes, 4) as $b) {
+ $b0 = $b[0] == 0x60 ? 0 : $b[0] - 0x20;
+ $b1 = $b[1] == 0x60 ? 0 : $b[1] - 0x20;
+ $b2 = $b[2] == 0x60 ? 0 : $b[2] - 0x20;
+ $b3 = $b[3] == 0x60 ? 0 : $b[3] - 0x20;
+
+ $b0 <<= 2;
+ $b0 |= ($b1 >> 4) & 0x03;
+ $b1 <<= 4;
+ $b1 |= ($b2 >> 2) & 0x0F;
+ $b2 <<= 6;
+ $b2 |= $b3 & 0x3F;
+
+ $decoded .= pack('c*', $b0, $b1, $b2);
+ }
+ }
+
+ return rtrim($decoded, "\0");
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uuencode.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uuencode.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/convert_uuencode.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,79 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Michael Wallner <mike @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: convert_uuencode.php,v 1.7 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace convert_uuencode()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.convert_uuencode
+ * @author Michael Wallner <mike @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.7 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('convert_uuencode')) {
+ function convert_uuencode($string)
+ {
+ // Sanity check
+ if (!is_scalar($string)) {
+ user_error('convert_uuencode() expects parameter 1 to be string, ' .
+ gettype($string) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ $u = 0;
+ $encoded = '';
+
+ while ($c = count($bytes = unpack('c*', substr($string, $u, 45)))) {
+ $u += 45;
+ $encoded .= pack('c', $c + 0x20);
+
+ while ($c % 3) {
+ $bytes[++$c] = 0;
+ }
+
+ foreach (array_chunk($bytes, 3) as $b) {
+ $b0 = ($b[0] & 0xFC) >> 2;
+ $b1 = (($b[0] & 0x03) << 4) + (($b[1] & 0xF0) >> 4);
+ $b2 = (($b[1] & 0x0F) << 2) + (($b[2] & 0xC0) >> 6);
+ $b3 = $b[2] & 0x3F;
+
+ $b0 = $b0 ? $b0 + 0x20 : 0x60;
+ $b1 = $b1 ? $b1 + 0x20 : 0x60;
+ $b2 = $b2 ? $b2 + 0x20 : 0x60;
+ $b3 = $b3 ? $b3 + 0x20 : 0x60;
+
+ $encoded .= pack('c*', $b0, $b1, $b2, $b3);
+ }
+
+ $encoded .= "\n";
+ }
+
+ // Add termination characters
+ $encoded .= "\x60\n";
+
+ return $encoded;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/debug_print_backtrace.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/debug_print_backtrace.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/debug_print_backtrace.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,67 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Laurent Laville <pear @ laurent-laville.org> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: debug_print_backtrace.php,v 1.3 2005/08/17 02:58:09 aidan Exp $
+
+
+/**
+ * Replace debug_print_backtrace()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.debug_print_backtrace
+ * @author Laurent Laville <pear @ laurent-laville.org>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.3 $
+ * @since PHP 5
+ * @require PHP 4.3.0 (debug_backtrace)
+ */
+if (!function_exists('debug_print_backtrace')) {
+ function debug_print_backtrace()
+ {
+ // Get backtrace
+ $backtrace = debug_backtrace();
+
+ // Unset call to debug_print_backtrace
+ array_shift($backtrace);
+
+ // Iterate backtrace
+ $calls = array();
+ foreach ($backtrace as $i => $call) {
+ $location = $call['file'] . ':' . $call['line'];
+ $function = (isset($call['class'])) ?
+ $call['class'] . '.' . $call['function'] :
+ $call['function'];
+
+ $params = '';
+ if (isset($call['args'])) {
+ $params = implode(', ', $call['args']);
+ }
+
+ $calls[] = sprintf('#%d %s(%s) called at [%s]',
+ $i,
+ $function,
+ $params,
+ $location);
+ }
+
+ echo implode("\n", $calls);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/file_get_contents.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/file_get_contents.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/file_get_contents.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,57 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: file_get_contents.php,v 1.21 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace file_get_contents()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.file_get_contents
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.21 $
+ * @internal resource_context is not supported
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('file_get_contents')) {
+ function file_get_contents($filename, $incpath = false, $resource_context = null)
+ {
+ if (false === $fh = fopen($filename, 'rb', $incpath)) {
+ user_error('file_get_contents() failed to open stream: No such file or directory',
+ E_USER_WARNING);
+ return false;
+ }
+
+ clearstatcache();
+ if ($fsize = @filesize($filename)) {
+ $data = fread($fh, $fsize);
+ } else {
+ $data = '';
+ while (!feof($fh)) {
+ $data .= fread($fh, 8192);
+ }
+ }
+
+ fclose($fh);
+ return $data;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/file_put_contents.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/file_put_contents.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/file_put_contents.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,116 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: file_put_contents.php,v 1.25 2005/12/05 09:25:15 aidan Exp $
+
+
+if (!defined('FILE_USE_INCLUDE_PATH')) {
+ define('FILE_USE_INCLUDE_PATH', 1);
+}
+
+if (!defined('LOCK_EX')) {
+ define('LOCK_EX', 2);
+}
+
+if (!defined('FILE_APPEND')) {
+ define('FILE_APPEND', 8);
+}
+
+
+/**
+ * Replace file_put_contents()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.file_put_contents
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.25 $
+ * @internal resource_context is not supported
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('file_put_contents')) {
+ function file_put_contents($filename, $content, $flags = null, $resource_context = null)
+ {
+ // If $content is an array, convert it to a string
+ if (is_array($content)) {
+ $content = implode('', $content);
+ }
+
+ // If we don't have a string, throw an error
+ if (!is_scalar($content)) {
+ user_error('file_put_contents() The 2nd parameter should be either a string or an array',
+ E_USER_WARNING);
+ return false;
+ }
+
+ // Get the length of data to write
+ $length = strlen($content);
+
+ // Check what mode we are using
+ $mode = ($flags & FILE_APPEND) ?
+ 'a' :
+ 'wb';
+
+ // Check if we're using the include path
+ $use_inc_path = ($flags & FILE_USE_INCLUDE_PATH) ?
+ true :
+ false;
+
+ // Open the file for writing
+ if (($fh = @fopen($filename, $mode, $use_inc_path)) === false) {
+ user_error('file_put_contents() failed to open stream: Permission denied',
+ E_USER_WARNING);
+ return false;
+ }
+
+ // Attempt to get an exclusive lock
+ $use_lock = ($flags & LOCK_EX) ? true : false ;
+ if ($use_lock === true) {
+ if (!flock($fh, LOCK_EX)) {
+ return false;
+ }
+ }
+
+ // Write to the file
+ $bytes = 0;
+ if (($bytes = @fwrite($fh, $content)) === false) {
+ $errormsg = sprintf('file_put_contents() Failed to write %d bytes to %s',
+ $length,
+ $filename);
+ user_error($errormsg, E_USER_WARNING);
+ return false;
+ }
+
+ // Close the handle
+ @fclose($fh);
+
+ // Check all the data was written
+ if ($bytes != $length) {
+ $errormsg = sprintf('file_put_contents() Only %d of %d bytes written, possibly out of free disk space.',
+ $bytes,
+ $length);
+ user_error($errormsg, E_USER_WARNING);
+ return false;
+ }
+
+ // Return length
+ return $bytes;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/floatval.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/floatval.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/floatval.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,39 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: floatval.php,v 1.2 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace floatval()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.floatval
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error) (Type Casting)
+ */
+if (!function_exists('floatval')) {
+ function floatval($var)
+ {
+ return (float) $var;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/fprintf.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/fprintf.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/fprintf.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,54 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: fprintf.php,v 1.13 2005/05/28 17:25:25 aidan Exp $
+
+
+/**
+ * Replace fprintf()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.fprintf
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.13 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('fprintf')) {
+ function fprintf() {
+ $args = func_get_args();
+
+ if (count($args) < 2) {
+ user_error('Wrong parameter count for fprintf()', E_USER_WARNING);
+ return;
+ }
+
+ $resource_handle = array_shift($args);
+ $format = array_shift($args);
+
+ if (!is_resource($resource_handle)) {
+ user_error('fprintf() supplied argument is not a valid stream resource',
+ E_USER_WARNING);
+ return false;
+ }
+
+ return fwrite($resource_handle, vsprintf($format, $args));
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/fputcsv.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/fputcsv.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/fputcsv.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,64 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: fputcsv.php,v 1.2 2005/11/22 08:28:16 aidan Exp $
+
+
+/**
+ * Replace fprintf()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.fprintf
+ * @author Twebb <twebb @ boisecenter.com>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('fputcsv')) {
+ function fputcsv($handle, $fields, $delimiter = ',', $enclosure = '"')
+ {
+ // Sanity Check
+ if (!is_resource($handle)) {
+ user_error('fputcsv() expects parameter 1 to be resource, ' .
+ gettype($handle) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+
+ $str = '';
+ foreach ($fields as $cell) {
+ $cell = str_replace($enclosure, $enclosure . $enclosure, $cell);
+
+ if (strchr($cell, $delimiter) !== false ||
+ strchr($cell, $enclosure) !== false ||
+ strchr($cell, "\n") !== false) {
+
+ $str .= $enclosure . $cell . $enclosure . $delimiter;
+ } else {
+ $str .= $cell . $delimiter;
+ }
+ }
+
+ fputs($handle, substr($str, 0, -1) . "\n");
+
+ return strlen($str);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/get_headers.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/get_headers.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/get_headers.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,77 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: get_headers.php,v 1.1 2005/05/10 07:50:53 aidan Exp $
+
+
+/**
+ * Replace get_headers()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.get_headers
+ * @author Aeontech <aeontech @ gmail.com>
+ * @author Cpurruc <cpurruc @ fh-landshut.de>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.1 $
+ * @since PHP 5.0.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('get_headers')) {
+ function get_headers($url, $format = 0)
+ {
+ // Init
+ $urlinfo = parse_url($url);
+ $port = isset($urlinfo['port']) ? $urlinfo['port'] : 80;
+
+ // Connect
+ $fp = fsockopen($urlinfo['host'], $port, $errno, $errstr, 30);
+ if ($fp === false) {
+ return false;
+ }
+
+ // Send request
+ $head = 'HEAD ' . $urlinfo['path'] .
+ (isset($urlinfo['query']) ? '?' . $urlinfo['query'] : '') .
+ ' HTTP/1.0' . "\r\n" .
+ 'Host: ' . $urlinfo['host'] . "\r\n\r\n";
+ fputs($fp, $head);
+
+ // Read
+ while (!feof($fp)) {
+ if ($header = trim(fgets($fp, 1024))) {
+ list($key) = explode(':', $header);
+
+ if ($format === 1) {
+ // First element is the HTTP header type, such as HTTP 200 OK
+ // It doesn't have a separate name, so check for it
+ if ($key == $header) {
+ $headers[] = $header;
+ } else {
+ $headers[$key] = substr($header, strlen($key)+2);
+ }
+ } else {
+ $headers[] = $header;
+ }
+ }
+ }
+
+ return $headers;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/get_include_path.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/get_include_path.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/get_include_path.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,39 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: get_include_path.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace get_include_path()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.get_include_path
+ * @author Stephan Schmidt <schst @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0
+ */
+if (!function_exists('get_include_path')) {
+ function get_include_path()
+ {
+ return ini_get('include_path');
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/html_entity_decode.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/html_entity_decode.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/html_entity_decode.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,73 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: David Irvine <dave @ codexweb.co.za> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: html_entity_decode.php,v 1.8 2005/12/07 21:08:57 aidan Exp $
+
+
+if (!defined('ENT_NOQUOTES')) {
+ define('ENT_NOQUOTES', 0);
+}
+
+if (!defined('ENT_COMPAT')) {
+ define('ENT_COMPAT', 2);
+}
+
+if (!defined('ENT_QUOTES')) {
+ define('ENT_QUOTES', 3);
+}
+
+
+/**
+ * Replace html_entity_decode()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.html_entity_decode
+ * @author David Irvine <dave @ codexweb.co.za>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.8 $
+ * @since PHP 4.3.0
+ * @internal Setting the charset will not do anything
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('html_entity_decode')) {
+ function html_entity_decode($string, $quote_style = ENT_COMPAT, $charset = null)
+ {
+ if (!is_int($quote_style)) {
+ user_error('html_entity_decode() expects parameter 2 to be long, ' .
+ gettype($quote_style) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+ $trans_tbl = array_flip($trans_tbl);
+
+ // Add single quote to translation table;
+ $trans_tbl['''] = '\'';
+
+ // Not translating double quotes
+ if ($quote_style & ENT_NOQUOTES) {
+ // Remove double quote from translation table
+ unset($trans_tbl['"']);
+ }
+
+ return strtr($string, $trans_tbl);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/htmlspecialchars_decode.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/htmlspecialchars_decode.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/htmlspecialchars_decode.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,67 @@
+<?PHP
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: htmlspecialchars_decode.php,v 1.3 2005/06/18 14:02:09 aidan Exp $
+
+
+/**
+ * Replace function htmlspecialchars_decode()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.htmlspecialchars_decode
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.3 $
+ * @since PHP 5.1.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('htmlspecialchars_decode')) {
+ function htmlspecialchars_decode($string, $quote_style = null)
+ {
+ // Sanity check
+ if (!is_scalar($string)) {
+ user_error('htmlspecialchars_decode() expects parameter 1 to be string, ' .
+ gettype($string) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_int($quote_style) && $quote_style !== null) {
+ user_error('htmlspecialchars_decode() expects parameter 2 to be integer, ' .
+ gettype($quote_style) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ // Init
+ $from = array('&', '<', '>');
+ $to = array('&', '<', '>');
+
+ // The function does not behave as documented
+ // This matches the actual behaviour of the function
+ if ($quote_style & ENT_COMPAT || $quote_style & ENT_QUOTES) {
+ $from[] = '"';
+ $to[] = '"';
+
+ $from[] = ''';
+ $to[] = "'";
+ }
+
+ return str_replace($from, $to, $string);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/http_build_query.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/http_build_query.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/http_build_query.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,100 @@
+<?PHP
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: http_build_query.php,v 1.16 2005/05/31 08:54:57 aidan Exp $
+
+
+/**
+ * Replace function http_build_query()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.http-build-query
+ * @author Stephan Schmidt <schst @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.16 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('http_build_query')) {
+ function http_build_query($formdata, $numeric_prefix = null)
+ {
+ // If $formdata is an object, convert it to an array
+ if (is_object($formdata)) {
+ $formdata = get_object_vars($formdata);
+ }
+
+ // Check we have an array to work with
+ if (!is_array($formdata)) {
+ user_error('http_build_query() Parameter 1 expected to be Array or Object. Incorrect value given.',
+ E_USER_WARNING);
+ return false;
+ }
+
+ // If the array is empty, return null
+ if (empty($formdata)) {
+ return;
+ }
+
+ // Argument seperator
+ $separator = ini_get('arg_separator.output');
+
+ // Start building the query
+ $tmp = array ();
+ foreach ($formdata as $key => $val) {
+ if (is_integer($key) && $numeric_prefix != null) {
+ $key = $numeric_prefix . $key;
+ }
+
+ if (is_scalar($val)) {
+ array_push($tmp, urlencode($key).'='.urlencode($val));
+ continue;
+ }
+
+ // If the value is an array, recursively parse it
+ if (is_array($val)) {
+ array_push($tmp, __http_build_query($val, urlencode($key)));
+ continue;
+ }
+ }
+
+ return implode($separator, $tmp);
+ }
+
+ // Helper function
+ function __http_build_query ($array, $name)
+ {
+ $tmp = array ();
+ foreach ($array as $key => $value) {
+ if (is_array($value)) {
+ array_push($tmp, __http_build_query($value, sprintf('%s[%s]', $name, $key)));
+ } elseif (is_scalar($value)) {
+ array_push($tmp, sprintf('%s[%s]=%s', $name, urlencode($key), urlencode($value)));
+ } elseif (is_object($value)) {
+ array_push($tmp, __http_build_query(get_object_vars($value), sprintf('%s[%s]', $name, $key)));
+ }
+ }
+
+ // Argument seperator
+ $separator = ini_get('arg_separator.output');
+
+ return implode($separator, $tmp);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/ibase_timefmt.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/ibase_timefmt.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/ibase_timefmt.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,56 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: ibase_timefmt.php,v 1.1 2005/05/10 07:51:07 aidan Exp $
+
+
+/**
+ * Replace function ibase_timefmt()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.ibase_timefmt
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.1 $
+ * @since PHP 5.0.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('ibase_timefmt')) {
+ function ibase_timefmt($format, $columntype = IBASE_TIMESTAMP)
+ {
+ switch ($columntype) {
+ case IBASE_TIMESTAMP:
+ ini_set('ibase.dateformat', $format);
+ break;
+
+ case IBASE_DATE:
+ ini_set('ibase.dateformat', $format);
+ break;
+
+ case IBASE_TIME:
+ ini_set('ibase.timeformat', $format);
+ break;
+
+ default:
+ return false;
+ }
+
+ return true;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/idate.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/idate.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/idate.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,52 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Arpad Ray <arpad @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: idate.php,v 1.2 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+ * Replace idate()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/idate
+ * @author Arpad Ray <arpad @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5.0.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('idate')) {
+ function idate($format, $timestamp = false)
+ {
+ if (strlen($format) !== 1) {
+ user_error('idate format is one char', E_USER_WARNING);
+ return false;
+ }
+
+ if (strpos('BdhHiILmstUwWyYzZ', $format) === false) {
+ return 0;
+ }
+
+ if ($timestamp === false) {
+ $timestamp = time();
+ }
+
+ return intval(date($format, $timestamp));
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/image_type_to_mime_type.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/image_type_to_mime_type.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/image_type_to_mime_type.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,147 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: image_type_to_mime_type.php,v 1.8 2005/01/26 04:55:13 aidan Exp $
+
+
+if (!defined('IMAGETYPE_GIF')) {
+ define('IMAGETYPE_GIF', 1);
+}
+
+if (!defined('IMAGETYPE_JPEG')) {
+ define('IMAGETYPE_JPEG', 2);
+}
+
+if (!defined('IMAGETYPE_PNG')) {
+ define('IMAGETYPE_PNG', 3);
+}
+
+if (!defined('IMAGETYPE_SWF')) {
+ define('IMAGETYPE_SWF', 4);
+}
+
+if (!defined('IMAGETYPE_PSD')) {
+ define('IMAGETYPE_PSD', 5);
+}
+
+if (!defined('IMAGETYPE_BMP')) {
+ define('IMAGETYPE_BMP', 6);
+}
+
+if (!defined('IMAGETYPE_TIFF_II')) {
+ define('IMAGETYPE_TIFF_II', 7);
+}
+
+if (!defined('IMAGETYPE_TIFF_MM')) {
+ define('IMAGETYPE_TIFF_MM', 8);
+}
+
+if (!defined('IMAGETYPE_JPC')) {
+ define('IMAGETYPE_JPC', 9);
+}
+
+if (!defined('IMAGETYPE_JP2')) {
+ define('IMAGETYPE_JP2', 10);
+}
+
+if (!defined('IMAGETYPE_JPX')) {
+ define('IMAGETYPE_JPX', 11);
+}
+
+if (!defined('IMAGETYPE_JB2')) {
+ define('IMAGETYPE_JB2', 12);
+}
+
+if (!defined('IMAGETYPE_SWC')) {
+ define('IMAGETYPE_SWC', 13);
+}
+
+if (!defined('IMAGETYPE_IFF')) {
+ define('IMAGETYPE_IFF', 14);
+}
+
+if (!defined('IMAGETYPE_WBMP')) {
+ define('IMAGETYPE_WBMP', 15);
+}
+
+if (!defined('IMAGETYPE_XBM')) {
+ define('IMAGETYPE_XBM', 16);
+}
+
+
+/**
+ * Replace image_type_to_mime_type()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.image_type_to_mime_type
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.8 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('image_type_to_mime_type')) {
+ function image_type_to_mime_type($imagetype)
+ {
+ switch ($imagetype):
+ case IMAGETYPE_GIF:
+ return 'image/gif';
+ break;
+ case IMAGETYPE_JPEG:
+ return 'image/jpeg';
+ break;
+ case IMAGETYPE_PNG:
+ return 'image/png';
+ break;
+ case IMAGETYPE_SWF:
+ case IMAGETYPE_SWC:
+ return 'application/x-shockwave-flash';
+ break;
+ case IMAGETYPE_PSD:
+ return 'image/psd';
+ break;
+ case IMAGETYPE_BMP:
+ return 'image/bmp';
+ break;
+ case IMAGETYPE_TIFF_MM:
+ case IMAGETYPE_TIFF_II:
+ return 'image/tiff';
+ break;
+ case IMAGETYPE_JP2:
+ return 'image/jp2';
+ break;
+ case IMAGETYPE_IFF:
+ return 'image/iff';
+ break;
+ case IMAGETYPE_WBMP:
+ return 'image/vnd.wap.wbmp';
+ break;
+ case IMAGETYPE_XBM:
+ return 'image/xbm';
+ break;
+ case IMAGETYPE_JPX:
+ case IMAGETYPE_JB2:
+ case IMAGETYPE_JPC:
+ default:
+ return 'application/octet-stream';
+ break;
+
+ endswitch;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_ntop.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_ntop.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_ntop.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,53 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Arpad Ray <arpad @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: inet_ntop.php,v 1.3 2005/12/05 14:49:40 aidan Exp $
+
+
+/**
+ * Replace inet_ntop()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/inet_ntop
+ * @author Arpad Ray <arpad @ php.net>
+ * @version $Revision: 1.3 $
+ * @since PHP 5.1.0
+ * @require PHP 4.0.0 (long2ip)
+ */
+if (!function_exists('inet_ntop')) {
+ function inet_ntop($in_addr)
+ {
+ switch (strlen($in_addr)) {
+ case 4:
+ list(,$r) = unpack('N', $in_addr);
+ return long2ip($r);
+
+ case 16:
+ $r = substr(chunk_split(bin2hex($in_addr), 4, ':'), 0, -1);
+ $r = preg_replace(
+ array('/(?::?\b0+\b:?){2,}/', '/\b0+([^0])/e'),
+ array('::', '(int)"$1"?"$1":"0$1"'),
+ $r);
+ return $r;
+ }
+
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_pton.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_pton.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/inet_pton.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,60 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Arpad Ray <arpad @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: inet_pton.php,v 1.2 2005/12/05 14:49:40 aidan Exp $
+
+
+/**
+ * Replace inet_pton()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/inet_pton
+ * @author Arpad Ray <arpad @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5.1.0
+ * @require PHP 4.2.0 (array_fill)
+ */
+if (!function_exists('inet_pton')) {
+ function inet_pton($address)
+ {
+ $r = ip2long($address);
+ if ($r !== false && $r != -1) {
+ return pack('N', $r);
+ }
+
+ $delim_count = substr_count($address, ':');
+ if ($delim_count < 1 || $delim_count > 7) {
+ return false;
+ }
+
+ $r = explode(':', $address);
+ $rcount = count($r);
+ if (($doub = array_search('', $r, 1)) !== false) {
+ $length = (!$doub || $doub == $rcount - 1 ? 2 : 1);
+ array_splice($r, $doub, $length, array_fill(0, 8 + $length - $rcount, 0));
+ }
+
+ $r = array_map('hexdec', $r);
+ array_unshift($r, 'n*');
+ $r = call_user_func_array('pack', $r);
+
+ return $r;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/ini_get_all.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/ini_get_all.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/ini_get_all.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,85 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: ini_get_all.php,v 1.3 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace ini_get_all()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.ini_get_all
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.3 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('ini_get_all')) {
+ function ini_get_all($extension = null)
+ {
+ // Sanity check
+ if (!is_scalar($extension)) {
+ user_error('ini_get_all() expects parameter 1 to be string, ' .
+ gettype($extension) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ // Get the location of php.ini
+ ob_start();
+ phpinfo(INFO_GENERAL);
+ $info = ob_get_contents();
+ ob_clean();
+ $info = explode("\n", $info);
+ $line = array_values(preg_grep('#php.ini#', $info));
+ list (, $value) = explode('<td class="v">', $line[0]);
+ $inifile = trim(strip_tags($value));
+
+ // Parse
+ if ($extension !== null) {
+ $ini_all = parse_ini_file($inifile, true);
+
+ // Lowercase extension keys
+ foreach ($ini_all as $key => $value) {
+ $ini_arr[strtolower($key)] = $value;
+ }
+
+ $ini = $ini_arr[$extension];
+ } else {
+ $ini = parse_ini_file($inifile);
+ }
+
+ // Order
+ $ini_lc = array_map('strtolower', array_keys($ini));
+ array_multisort($ini_lc, SORT_ASC, SORT_STRING, $ini);
+
+ // Format
+ $info = array();
+ foreach ($ini as $key => $value) {
+ $info[$key] = array(
+ 'global_value' => $value,
+ 'local_value' => ini_get($key),
+ // No way to know this
+ 'access' => -1
+ );
+ }
+
+ return $info;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/is_a.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/is_a.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/is_a.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,47 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: is_a.php,v 1.16 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace function is_a()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.is_a
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.16 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error) (is_subclass_of)
+ */
+if (!function_exists('is_a')) {
+ function is_a($object, $class)
+ {
+ if (!is_object($object)) {
+ return false;
+ }
+
+ if (get_class($object) == strtolower($class)) {
+ return true;
+ } else {
+ return is_subclass_of($object, $class);
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/md5_file.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/md5_file.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/md5_file.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,82 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: md5_file.php,v 1.3 2005/11/22 08:29:19 aidan Exp $
+
+
+/**
+ * Replace md5_file()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/md5_file
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.3 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('md5_file')) {
+ function md5_file($filename, $raw_output = false)
+ {
+ // Sanity check
+ if (!is_scalar($filename)) {
+ user_error('md5_file() expects parameter 1 to be string, ' .
+ gettype($filename) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_scalar($raw_output)) {
+ user_error('md5_file() expects parameter 2 to be bool, ' .
+ gettype($raw_output) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!file_exists($filename)) {
+ user_error('md5_file() Unable to open file', E_USER_WARNING);
+ return false;
+ }
+
+ // Read the file
+ if (false === $fh = fopen($filename, 'rb')) {
+ user_error('md5_file() failed to open stream: No such file or directory',
+ E_USER_WARNING);
+ return false;
+ }
+
+ clearstatcache();
+ if ($fsize = @filesize($filename)) {
+ $data = fread($fh, $fsize);
+ } else {
+ $data = '';
+ while (!feof($fh)) {
+ $data .= fread($fh, 8192);
+ }
+ }
+
+ fclose($fh);
+
+ // Return
+ $data = md5($data);
+ if ($raw_output === true) {
+ $data = pack('H*', $data);
+ }
+
+ return $data;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/mhash.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/mhash.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/mhash.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,115 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: mhash.php,v 1.1 2005/05/10 07:56:44 aidan Exp $
+
+
+if (!defined('MHASH_CRC32')) {
+ define('MHASH_CRC32', 0);
+}
+
+if (!defined('MHASH_MD5')) {
+ define('MHASH_MD5', 1);
+}
+
+if (!defined('MHASH_SHA1')) {
+ define('MHASH_SHA1', 2);
+}
+
+if (!defined('MHASH_HAVAL256')) {
+ define('MHASH_HAVAL256', 3);
+}
+
+if (!defined('MHASH_RIPEMD160')) {
+ define('MHASH_RIPEMD160', 5);
+}
+
+if (!defined('MHASH_TIGER')) {
+ define('MHASH_TIGER', 7);
+}
+
+if (!defined('MHASH_GOST')) {
+ define('MHASH_GOST', 8);
+}
+
+if (!defined('MHASH_CRC32B')) {
+ define('MHASH_CRC32B', 9);
+}
+
+if (!defined('MHASH_HAVAL192')) {
+ define('MHASH_HAVAL192', 11);
+}
+
+if (!defined('MHASH_HAVAL160')) {
+ define('MHASH_HAVAL160', 12);
+}
+
+if (!defined('MHASH_HAVAL128')) {
+ define('MHASH_HAVAL128', 13);
+}
+
+if (!defined('MHASH_TIGER128')) {
+ define('MHASH_TIGER128', 14);
+}
+
+if (!defined('MHASH_TIGER160')) {
+ define('MHASH_TIGER160', 15);
+}
+
+if (!defined('MHASH_MD4')) {
+ define('MHASH_MD4', 16);
+}
+
+if (!defined('MHASH_SHA256')) {
+ define('MHASH_SHA256', 17);
+}
+
+if (!defined('MHASH_ADLER32')) {
+ define('MHASH_ADLER32', 18);
+}
+
+
+/**
+ * Replace mhash()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.mhash
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.1 $
+ * @since PHP 4.1.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('mhash')) {
+ function mhash($hashtype, $data, $key = '')
+ {
+ switch ($hashtype) {
+ case MHASH_MD5:
+ $key = str_pad((strlen($key) > 64 ? pack("H*", md5($key)) : $key), 64, chr(0x00));
+ $k_opad = $key ^ (str_pad('', 64, chr(0x5c)));
+ $k_ipad = $key ^ (str_pad('', 64, chr(0x36)));
+ return pack("H*", md5($k_opad . pack("H*", md5($k_ipad . $data))));
+
+ default:
+ return false;
+
+ break;
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/mime_content_type.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/mime_content_type.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/mime_content_type.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,63 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Ian Eure <ieure @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: mime_content_type.php,v 1.3 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+* Replace mime_content_type()
+*
+* You will need the `file` command installed and present in your $PATH. If
+* `file` is not available, the type 'application/octet-stream' is returned
+* for all files.
+*
+* @category PHP
+* @package PHP_Compat
+* @link http://php.net/function.mime_content_type
+* @version $Revision: 1.3 $
+* @author Ian Eure <ieure @ php.net>
+* @since PHP 4.3.0
+* @require PHP 4.0.3 (escapeshellarg)
+*/
+if (!function_exists('mime_content_type')) {
+ function mime_content_type($filename)
+ {
+ // Sanity check
+ if (!file_exists($filename)) {
+ return false;
+ }
+
+ $filename = escapeshellarg($filename);
+ $out = `file -iL $filename 2>/dev/null`;
+ if (empty($out)) {
+ return 'application/octet-stream';
+ }
+
+ // Strip off filename
+ $t = substr($out, strpos($out, ':') + 2);
+
+ if (strpos($t, ';') !== false) {
+ // Strip MIME parameters
+ $t = substr($t, 0, strpos($t, ';'));
+ }
+
+ // Strip any remaining whitespace
+ return trim($t);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_clean.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_clean.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_clean.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,46 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: ob_clean.php,v 1.6 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace ob_clean()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.ob_clean
+ * @author Aidan Lister <aidan @ php.net>
+ * @author Thiemo M舩tig (http://maettig.com/)
+ * @version $Revision: 1.6 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('ob_clean')) {
+ function ob_clean()
+ {
+ if (@ob_end_clean()) {
+ return ob_start();
+ }
+
+ user_error("ob_clean() failed to delete buffer. No buffer to delete.", E_USER_NOTICE);
+
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
霑ス蜉 branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_flush.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_flush.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_flush.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,46 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: ob_flush.php,v 1.6 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace ob_flush()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.ob_flush
+ * @author Aidan Lister <aidan @ php.net>
+ * @author Thiemo M舩tig (http://maettig.com/)
+ * @version $Revision: 1.6 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('ob_flush')) {
+ function ob_flush()
+ {
+ if (@ob_end_flush()) {
+ return ob_start();
+ }
+
+ user_error("ob_flush() Failed to flush buffer. No buffer to flush.", E_USER_NOTICE);
+
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
霑ス蜉 branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_clean.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_clean.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_clean.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,46 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: ob_get_clean.php,v 1.6 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace ob_get_clean()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.ob_get_clean
+ * @author Aidan Lister <aidan @ php.net>
+ * @author Thiemo M舩tig (http://maettig.com/)
+ * @version $Revision: 1.6 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('ob_get_clean')) {
+ function ob_get_clean()
+ {
+ $contents = ob_get_contents();
+
+ if ($contents !== false) {
+ ob_end_clean();
+ }
+
+ return $contents;
+ }
+}
+
+?>
\ No newline at end of file
霑ス蜉 branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_flush.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_flush.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/ob_get_flush.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,46 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: ob_get_flush.php,v 1.6 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace ob_get_flush()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.ob_get_flush
+ * @author Aidan Lister <aidan @ php.net>
+ * @author Thiemo M舩tig (http://maettig.com/)
+ * @version $Revision: 1.6 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('ob_get_flush')) {
+ function ob_get_flush()
+ {
+ $contents = ob_get_contents();
+
+ if ($contents !== false) {
+ ob_end_flush();
+ }
+
+ return $contents;
+ }
+}
+
+?>
\ No newline at end of file
霑ス蜉 branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_affected_rows.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_affected_rows.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_affected_rows.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,40 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Ian Eure <ieure @ php.net> |
+// | Mocha (http://us4.php.net/pg_escape_bytea) |
+// +----------------------------------------------------------------------+
+//
+// $Id: pg_affected_rows.php,v 1.1 2005/05/10 07:56:51 aidan Exp $
+
+
+/**
+ * Replace pg_affected_rows()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.pg_affectd_rows
+ * @author Ian Eure <ieure @ php.net>
+ * @version $Revision@
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0
+ */
+if (!function_exists('pg_affected_rows')) {
+ function pg_affected_rows($resource)
+ {
+ return pg_cmdtuples($resource);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_escape_bytea.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_escape_bytea.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_escape_bytea.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,43 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Ian Eure <ieure @ php.net> |
+// | Mocha (http://us4.php.net/pg_escape_bytea) |
+// +----------------------------------------------------------------------+
+//
+// $Id: pg_escape_bytea.php,v 1.1 2005/05/10 07:56:51 aidan Exp $
+
+
+/**
+ * Replace pg_escape_bytea()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.pg_escape_bytea
+ * @author Ian Eure <ieure @ php.net>
+ * @version $Revision@
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0
+ */
+if (!function_exists('pg_escape_bytea')) {
+ function pg_escape_bytea($data)
+ {
+ return str_replace(
+ array(chr(92), chr(0), chr(39)),
+ array('\\\134', '\\\000', '\\\047'),
+ $data);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_unescape_bytea.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_unescape_bytea.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/pg_unescape_bytea.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,43 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Ian Eure <ieure @ php.net> |
+// | Tobias <php @ tobias.olsson.be> |
+// +----------------------------------------------------------------------+
+//
+// $Id: pg_unescape_bytea.php,v 1.2 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+ * Replace pg_unescape_bytea()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.pg_unescape_bytea
+ * @author Ian Eure <ieure @ php.net>
+ * @version $Revision@
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0
+ */
+if (!function_exists('pg_unescape_bytea')) {
+ function pg_unescape_bytea(&$data)
+ {
+ return str_replace(
+ array('$', '"'),
+ array('\\$', '\\"'),
+ $data);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/php_strip_whitespace.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/php_strip_whitespace.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/php_strip_whitespace.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,86 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: php_strip_whitespace.php,v 1.10 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace php_strip_whitespace()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.php_strip_whitespace
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.10 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error) + Tokenizer extension
+ */
+if (!function_exists('php_strip_whitespace')) {
+ function php_strip_whitespace($file)
+ {
+ // Sanity check
+ if (!is_scalar($file)) {
+ user_error('php_strip_whitespace() expects parameter 1 to be string, ' .
+ gettype($file) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ // Load file / tokens
+ $source = implode('', file($file));
+ $tokens = token_get_all($source);
+
+ // Init
+ $source = '';
+ $was_ws = false;
+
+ // Process
+ foreach ($tokens as $token) {
+ if (is_string($token)) {
+ // Single character tokens
+ $source .= $token;
+ } else {
+ list($id, $text) = $token;
+
+ switch ($id) {
+ // Skip all comments
+ case T_COMMENT:
+ case T_ML_COMMENT:
+ case T_DOC_COMMENT:
+ break;
+
+ // Remove whitespace
+ case T_WHITESPACE:
+ // We don't want more than one whitespace in a row replaced
+ if ($was_ws !== true) {
+ $source .= ' ';
+ }
+ $was_ws = true;
+ break;
+
+ default:
+ $was_ws = false;
+ $source .= $text;
+ break;
+ }
+ }
+ }
+
+ return $source;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/restore_include_path.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/restore_include_path.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/restore_include_path.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,38 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: restore_include_path.php,v 1.4 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+ * Replace restore_include_path()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.restore_include_path
+ * @author Stephan Schmidt <schst @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 4.3.0
+ */
+if (!function_exists('restore_include_path')) {
+ function restore_include_path()
+ {
+ return ini_restore('include_path');
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/scandir.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/scandir.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/scandir.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,69 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: scandir.php,v 1.18 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace scandir()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.scandir
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.18 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('scandir')) {
+ function scandir($directory, $sorting_order = 0)
+ {
+ if (!is_string($directory)) {
+ user_error('scandir() expects parameter 1 to be string, ' .
+ gettype($directory) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_int($sorting_order) && !is_bool($sorting_order)) {
+ user_error('scandir() expects parameter 2 to be long, ' .
+ gettype($sorting_order) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_dir($directory) || (false === $fh = @opendir($directory))) {
+ user_error('scandir() failed to open dir: Invalid argument', E_USER_WARNING);
+ return false;
+ }
+
+ $files = array ();
+ while (false !== ($filename = readdir($fh))) {
+ $files[] = $filename;
+ }
+
+ closedir($fh);
+
+ if ($sorting_order == 1) {
+ rsort($files);
+ } else {
+ sort($files);
+ }
+
+ return $files;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/set_include_path.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/set_include_path.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/set_include_path.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,38 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: set_include_path.php,v 1.4 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+ * Replace set_include_path()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.set_include_path
+ * @author Stephan Schmidt <schst @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 4.3.0
+ */
+if (!function_exists('set_include_path')) {
+ function set_include_path($new_include_path)
+ {
+ return ini_set('include_path', $new_include_path);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/str_ireplace.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/str_ireplace.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/str_ireplace.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,113 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: str_ireplace.php,v 1.18 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace str_ireplace()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.str_ireplace
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.18 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ * @note count not by returned by reference, to enable
+ * change '$count = null' to '&$count'
+ */
+if (!function_exists('str_ireplace')) {
+ function str_ireplace($search, $replace, $subject, $count = null)
+ {
+ // Sanity check
+ if (is_string($search) && is_array($replace)) {
+ user_error('Array to string conversion', E_USER_NOTICE);
+ $replace = (string) $replace;
+ }
+
+ // If search isn't an array, make it one
+ if (!is_array($search)) {
+ $search = array ($search);
+ }
+ $search = array_values($search);
+
+ // If replace isn't an array, make it one, and pad it to the length of search
+ if (!is_array($replace)) {
+ $replace_string = $replace;
+
+ $replace = array ();
+ for ($i = 0, $c = count($search); $i < $c; $i++) {
+ $replace[$i] = $replace_string;
+ }
+ }
+ $replace = array_values($replace);
+
+ // Check the replace array is padded to the correct length
+ $length_replace = count($replace);
+ $length_search = count($search);
+ if ($length_replace < $length_search) {
+ for ($i = $length_replace; $i < $length_search; $i++) {
+ $replace[$i] = '';
+ }
+ }
+
+ // If subject is not an array, make it one
+ $was_array = false;
+ if (!is_array($subject)) {
+ $was_array = true;
+ $subject = array ($subject);
+ }
+
+ // Loop through each subject
+ $count = 0;
+ foreach ($subject as $subject_key => $subject_value) {
+ // Loop through each search
+ foreach ($search as $search_key => $search_value) {
+ // Split the array into segments, in between each part is our search
+ $segments = explode(strtolower($search_value), strtolower($subject_value));
+
+ // The number of replacements done is the number of segments minus the first
+ $count += count($segments) - 1;
+ $pos = 0;
+
+ // Loop through each segment
+ foreach ($segments as $segment_key => $segment_value) {
+ // Replace the lowercase segments with the upper case versions
+ $segments[$segment_key] = substr($subject_value, $pos, strlen($segment_value));
+ // Increase the position relative to the initial string
+ $pos += strlen($segment_value) + strlen($search_value);
+ }
+
+ // Put our original string back together
+ $subject_value = implode($replace[$search_key], $segments);
+ }
+
+ $result[$subject_key] = $subject_value;
+ }
+
+ // Check if subject was initially a string and return it as a string
+ if ($was_array === true) {
+ return $result[0];
+ }
+
+ // Otherwise, just return the array
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/str_rot13.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/str_rot13.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/str_rot13.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,43 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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.4 2005/01/26 04:55:13 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.4 $
+ * @since PHP 4.0.0
+ */
+if (!function_exists('str_rot13')) {
+ function str_rot13($str)
+ {
+ $from = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ $to = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM';
+
+ return strtr($str, $from, $to);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/str_shuffle.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/str_shuffle.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/str_shuffle.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,52 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: str_shuffle.php,v 1.6 2005/08/14 03:24:16 aidan Exp $
+
+
+/**
+ * Replace str_shuffle()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.str_shuffle
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.6 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('str_shuffle')) {
+ function str_shuffle($str)
+ {
+ // Init
+ $str = (string) $str;
+
+ // Seed
+ list($usec, $sec) = explode(' ', microtime());
+ $seed = (float) $sec + ((float) $usec * 100000);
+ mt_srand($seed);
+
+ // Shuffle
+ for ($new = '', $len = strlen($str); $len > 0; $str{$p} = $str{$len}) {
+ $new .= $str{$p = mt_rand(0, --$len)};
+ }
+
+ return $new;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/str_split.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/str_split.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/str_split.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,71 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: str_split.php,v 1.15 2005/06/18 12:15:32 aidan Exp $
+
+
+/**
+ * Replace str_split()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.str_split
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.15 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('str_split')) {
+ function str_split($string, $split_length = 1)
+ {
+ if (!is_scalar($split_length)) {
+ user_error('str_split() expects parameter 2 to be long, ' .
+ gettype($split_length) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ $split_length = (int) $split_length;
+ if ($split_length < 1) {
+ user_error('str_split() The length of each segment must be greater than zero', E_USER_WARNING);
+ return false;
+ }
+
+ // Select split method
+ if ($split_length < 65536) {
+ // Faster, but only works for less than 2^16
+ preg_match_all('/.{1,' . $split_length . '}/s', $string, $matches);
+ return $matches[0];
+ } else {
+ // Required due to preg limitations
+ $arr = array();
+ $idx = 0;
+ $pos = 0;
+ $len = strlen($string);
+
+ while ($len > 0) {
+ $blk = ($len < $split_length) ? $len : $split_length;
+ $arr[$idx++] = substr($string, $pos, $blk);
+ $pos += $blk;
+ $len -= $blk;
+ }
+
+ return $arr;
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/str_word_count.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/str_word_count.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/str_word_count.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,68 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: str_word_count.php,v 1.9 2005/02/28 11:45:28 aidan Exp $
+
+
+/**
+ * Replace str_word_count()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.str_word_count
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.9 $
+ * @since PHP 4.3.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('str_word_count')) {
+ function str_word_count($string, $format = null)
+ {
+ if ($format !== 1 && $format !== 2 && $format !== null) {
+ user_error('str_word_count() The specified format parameter, "' . $format . '" is invalid',
+ E_USER_WARNING);
+ return false;
+ }
+
+ $word_string = preg_replace('/[0-9]+/', '', $string);
+ $word_array = preg_split('/[^A-Za-z0-9_\']+/', $word_string, -1, PREG_SPLIT_NO_EMPTY);
+
+ switch ($format) {
+ case null:
+ $result = count($word_array);
+ break;
+
+ case 1:
+ $result = $word_array;
+ break;
+
+ case 2:
+ $lastmatch = 0;
+ $word_assoc = array();
+ foreach ($word_array as $word) {
+ $word_assoc[$lastmatch = strpos($string, $word, $lastmatch)] = $word;
+ $lastmatch += strlen($word);
+ }
+ $result = $word_assoc;
+ break;
+ }
+
+ return $result;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/stripos.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/stripos.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/stripos.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,73 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: stripos.php,v 1.13 2005/05/30 20:33:03 aidan Exp $
+
+
+/**
+ * Replace stripos()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.stripos
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.13 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('stripos')) {
+ function stripos($haystack, $needle, $offset = null)
+ {
+ if (!is_scalar($haystack)) {
+ user_error('stripos() expects parameter 1 to be string, ' .
+ gettype($haystack) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($needle)) {
+ user_error('stripos() needle is not a string or an integer.', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_int($offset) && !is_bool($offset) && !is_null($offset)) {
+ user_error('stripos() expects parameter 3 to be long, ' .
+ gettype($offset) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ // Manipulate the string if there is an offset
+ $fix = 0;
+ if (!is_null($offset)) {
+ if ($offset > 0) {
+ $haystack = substr($haystack, $offset, strlen($haystack) - $offset);
+ $fix = $offset;
+ }
+ }
+
+ $segments = explode(strtolower($needle), strtolower($haystack), 2);
+
+ // Check there was a match
+ if (count($segments) === 1) {
+ return false;
+ }
+
+ $position = strlen($segments[0]) + $fix;
+ return $position;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/strpbrk.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/strpbrk.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/strpbrk.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,63 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Stephan Schmidt <schst @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: strpbrk.php,v 1.4 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace strpbrk()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.strpbrk
+ * @author Stephan Schmidt <schst @ php.net>
+ * @version $Revision: 1.4 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('strpbrk')) {
+ function strpbrk($haystack, $char_list)
+ {
+ if (!is_scalar($haystack)) {
+ user_error('strpbrk() expects parameter 1 to be string, ' .
+ gettype($haystack) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($char_list)) {
+ user_error('strpbrk() expects parameter 2 to be scalar, ' .
+ gettype($needle) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ $haystack = (string) $haystack;
+ $char_list = (string) $char_list;
+
+ $len = strlen($haystack);
+ for ($i = 0; $i < $len; $i++) {
+ $char = substr($haystack, $i, 1);
+ if (strpos($char_list, $char) === false) {
+ continue;
+ }
+ return substr($haystack, $i);
+ }
+
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/strripos.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/strripos.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/strripos.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,79 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// | Stephan Schmidt <schst @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: strripos.php,v 1.24 2005/08/10 10:19:59 aidan Exp $
+
+
+/**
+ * Replace strripos()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.strripos
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.24 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('strripos')) {
+ function strripos($haystack, $needle, $offset = null)
+ {
+ // Sanity check
+ if (!is_scalar($haystack)) {
+ user_error('strripos() expects parameter 1 to be scalar, ' .
+ gettype($haystack) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_scalar($needle)) {
+ user_error('strripos() expects parameter 2 to be scalar, ' .
+ gettype($needle) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ if (!is_int($offset) && !is_bool($offset) && !is_null($offset)) {
+ user_error('strripos() expects parameter 3 to be long, ' .
+ gettype($offset) . ' given', E_USER_WARNING);
+ return false;
+ }
+
+ // Initialise variables
+ $needle = strtolower($needle);
+ $haystack = strtolower($haystack);
+ $needle_fc = $needle{0};
+ $needle_len = strlen($needle);
+ $haystack_len = strlen($haystack);
+ $offset = (int) $offset;
+ $leftlimit = ($offset >= 0) ? $offset : 0;
+ $p = ($offset >= 0) ?
+ $haystack_len :
+ $haystack_len + $offset + 1;
+
+ // Reverse iterate haystack
+ while (--$p >= $leftlimit) {
+ if ($needle_fc === $haystack{$p} &&
+ substr($haystack, $p, $needle_len) === $needle) {
+ return $p;
+ }
+ }
+
+ return false;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/substr_compare.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/substr_compare.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/substr_compare.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,74 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Tom Buskens <ortega @ php.net> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: substr_compare.php,v 1.5 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace substr_compare()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.substr_compare
+ * @author Tom Buskens <ortega @ php.net>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.5 $
+ * @since PHP 5
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('substr_compare')) {
+ function substr_compare($main_str, $str, $offset, $length = null, $case_insensitive = false)
+ {
+ if (!is_string($main_str)) {
+ user_error('substr_compare() expects parameter 1 to be string, ' .
+ gettype($main_str) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_string($str)) {
+ user_error('substr_compare() expects parameter 2 to be string, ' .
+ gettype($str) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_int($offset)) {
+ user_error('substr_compare() expects parameter 3 to be long, ' .
+ gettype($offset) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (is_null($length)) {
+ $length = strlen($main_str) - $offset;
+ } elseif ($offset >= strlen($main_str)) {
+ user_error('substr_compare() The start position cannot exceed initial string length',
+ E_USER_WARNING);
+ return false;
+ }
+
+ $main_str = substr($main_str, $offset, $length);
+ $str = substr($str, 0, strlen($main_str));
+
+ if ($case_insensitive === false) {
+ return strcmp($main_str, $str);
+ } else {
+ return strcasecmp($main_str, $str);
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/time_sleep_until.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/time_sleep_until.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/time_sleep_until.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,48 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Arpad Ray <arpad @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: time_sleep_until.php,v 1.2 2005/12/07 21:08:57 aidan Exp $
+
+
+/**
+ * Replace time_sleep_until()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/time_sleep_until
+ * @author Arpad Ray <arpad @ php.net>
+ * @version $Revision: 1.2 $
+ * @since PHP 5.1.0
+ * @require PHP 4.0.1 (trigger_error)
+ */
+if (!function_exists('time_sleep_until')) {
+ function time_sleep_until($timestamp)
+ {
+ list($usec, $sec) = explode(' ', microtime());
+ $now = $sec + $usec;
+ if ($timestamp <= $now) {
+ user_error('Specified timestamp is in the past', E_USER_WARNING);
+ return false;
+ }
+
+ $diff = $timestamp - $now;
+ usleep($diff * 1000000);
+ return true;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/var_export.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/var_export.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/var_export.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,136 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: var_export.php,v 1.15 2005/12/05 14:24:27 aidan Exp $
+
+
+/**
+ * Replace var_export()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.var_export
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.15 $
+ * @since PHP 4.2.0
+ * @require PHP 4.0.0 (user_error)
+ */
+if (!function_exists('var_export')) {
+ function var_export($var, $return = false, $level = 0)
+ {
+ // Init
+ $indent = ' ';
+ $doublearrow = ' => ';
+ $lineend = ",\n";
+ $stringdelim = '\'';
+ $newline = "\n";
+ $find = array(null, '\\', '\'');
+ $replace = array('NULL', '\\\\', '\\\'');
+ $out = '';
+
+ // Indent
+ $level++;
+ for ($i = 1, $previndent = ''; $i < $level; $i++) {
+ $previndent .= $indent;
+ }
+
+ // Handle each type
+ switch (gettype($var)) {
+ // Array
+ case 'array':
+ $out = 'array (' . $newline;
+ foreach ($var as $key => $value) {
+ // Key
+ if (is_string($key)) {
+ // Make key safe
+ for ($i = 0, $c = count($find); $i < $c; $i++) {
+ $var = str_replace($find[$i], $replace[$i], $var);
+ }
+ $key = $stringdelim . $key . $stringdelim;
+ }
+
+ // Value
+ if (is_array($value)) {
+ $export = var_export($value, true, $level);
+ $value = $newline . $previndent . $indent . $export;
+ } else {
+ $value = var_export($value, true, $level);
+ }
+
+ // Piece line together
+ $out .= $previndent . $indent . $key . $doublearrow . $value . $lineend;
+ }
+
+ // End string
+ $out .= $previndent . ')';
+ break;
+
+ // String
+ case 'string':
+ // Make the string safe
+ for ($i = 0, $c = count($find); $i < $c; $i++) {
+ $var = str_replace($find[$i], $replace[$i], $var);
+ }
+ $out = $stringdelim . $var . $stringdelim;
+ break;
+
+ // Number
+ case 'integer':
+ case 'double':
+ $out = (string) $var;
+ break;
+
+ // Boolean
+ case 'boolean':
+ $out = $var ? 'true' : 'false';
+ break;
+
+ // NULLs
+ case 'NULL':
+ case 'resource':
+ $out = 'NULL';
+ break;
+
+ // Objects
+ case 'object':
+ // Start the object export
+ $out = $newline . $previndent . 'class ' . get_class($var) . ' {' . $newline;
+
+ // Export the object vars
+ foreach (get_object_vars($var) as $key => $val) {
+ $out .= $previndent . ' var $' . $key . ' = ';
+ if (is_array($val)) {
+ $export = var_export($val, true, $level);
+ $out .= $newline . $previndent . $indent . $export . ';' . $newline;
+ } else {
+ $out .= var_export($val, true, $level) . ';' . $newline;
+ }
+ }
+ $out .= $previndent . '}';
+ break;
+ }
+
+ // Method of output
+ if ($return === true) {
+ return $out;
+ } else {
+ echo $out;
+ }
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/version_compare.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/version_compare.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/version_compare.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,182 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Philippe Jausions <Philippe.Jausions @ 11abacus.com> |
+// | Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: version_compare.php,v 1.13 2005/08/01 12:21:14 aidan Exp $
+
+
+/**
+ * Replace version_compare()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.version_compare
+ * @author Philippe Jausions <Philippe.Jausions @ 11abacus.com>
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.13 $
+ * @since PHP 4.1.0
+ * @require PHP 4.0.5 (user_error)
+ */
+if (!function_exists('version_compare')) {
+ function version_compare($version1, $version2, $operator = '<')
+ {
+ // Check input
+ if (!is_scalar($version1)) {
+ user_error('version_compare() expects parameter 1 to be string, ' .
+ gettype($version1) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_scalar($version2)) {
+ user_error('version_compare() expects parameter 2 to be string, ' .
+ gettype($version2) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ if (!is_scalar($operator)) {
+ user_error('version_compare() expects parameter 3 to be string, ' .
+ gettype($operator) . ' given', E_USER_WARNING);
+ return;
+ }
+
+ // Standardise versions
+ $v1 = explode('.',
+ str_replace('..', '.',
+ preg_replace('/([^0-9\.]+)/', '.$1.',
+ str_replace(array('-', '_', '+'), '.',
+ trim($version1)))));
+
+ $v2 = explode('.',
+ str_replace('..', '.',
+ preg_replace('/([^0-9\.]+)/', '.$1.',
+ str_replace(array('-', '_', '+'), '.',
+ trim($version2)))));
+
+ // Replace empty entries at the start of the array
+ while (empty($v1[0]) && array_shift($v1)) {}
+ while (empty($v2[0]) && array_shift($v2)) {}
+
+ // Release state order
+ // '#' stands for any number
+ $versions = array(
+ 'dev' => 0,
+ 'alpha' => 1,
+ 'a' => 1,
+ 'beta' => 2,
+ 'b' => 2,
+ 'RC' => 3,
+ '#' => 4,
+ 'p' => 5,
+ 'pl' => 5);
+
+ // Loop through each segment in the version string
+ $compare = 0;
+ for ($i = 0, $x = min(count($v1), count($v2)); $i < $x; $i++) {
+ if ($v1[$i] == $v2[$i]) {
+ continue;
+ }
+ $i1 = $v1[$i];
+ $i2 = $v2[$i];
+ if (is_numeric($i1) && is_numeric($i2)) {
+ $compare = ($i1 < $i2) ? -1 : 1;
+ break;
+ }
+
+ // We use the position of '#' in the versions list
+ // for numbers... (so take care of # in original string)
+ if ($i1 == '#') {
+ $i1 = '';
+ } elseif (is_numeric($i1)) {
+ $i1 = '#';
+ }
+
+ if ($i2 == '#') {
+ $i2 = '';
+ } elseif (is_numeric($i2)) {
+ $i2 = '#';
+ }
+
+ if (isset($versions[$i1]) && isset($versions[$i2])) {
+ $compare = ($versions[$i1] < $versions[$i2]) ? -1 : 1;
+ } elseif (isset($versions[$i1])) {
+ $compare = 1;
+ } elseif (isset($versions[$i2])) {
+ $compare = -1;
+ } else {
+ $compare = 0;
+ }
+
+ break;
+ }
+
+ // If previous loop didn't find anything, compare the "extra" segments
+ if ($compare == 0) {
+ if (count($v2) > count($v1)) {
+ if (isset($versions[$v2[$i]])) {
+ $compare = ($versions[$v2[$i]] < 4) ? 1 : -1;
+ } else {
+ $compare = -1;
+ }
+ } elseif (count($v2) < count($v1)) {
+ if (isset($versions[$v1[$i]])) {
+ $compare = ($versions[$v1[$i]] < 4) ? -1 : 1;
+ } else {
+ $compare = 1;
+ }
+ }
+ }
+
+ // Compare the versions
+ if (func_num_args() > 2) {
+ switch ($operator) {
+ case '>':
+ case 'gt':
+ return (bool) ($compare > 0);
+ break;
+ case '>=':
+ case 'ge':
+ return (bool) ($compare >= 0);
+ break;
+ case '<=':
+ case 'le':
+ return (bool) ($compare <= 0);
+ break;
+ case '==':
+ case '=':
+ case 'eq':
+ return (bool) ($compare == 0);
+ break;
+ case '<>':
+ case '!=':
+ case 'ne':
+ return (bool) ($compare != 0);
+ break;
+ case '':
+ case '<':
+ case 'lt':
+ return (bool) ($compare < 0);
+ break;
+ default:
+ return;
+ }
+ }
+
+ return $compare;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/vprintf.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/vprintf.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/vprintf.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,45 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: vprintf.php,v 1.14 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace vprintf()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.vprintf
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.14 $
+ * @since PHP 4.1.0
+ * @require PHP 4.0.4 (call_user_func_array)
+ */
+if (!function_exists('vprintf')) {
+ function vprintf ($format, $args)
+ {
+ if (count($args) < 2) {
+ user_error('vprintf() Too few arguments', E_USER_WARNING);
+ return;
+ }
+
+ array_unshift($args, $format);
+ return call_user_func_array('printf', $args);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat/Function/vsprintf.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat/Function/vsprintf.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat/Function/vsprintf.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,45 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: vsprintf.php,v 1.10 2005/01/26 04:55:13 aidan Exp $
+
+
+/**
+ * Replace vsprintf()
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @link http://php.net/function.vsprintf
+ * @author Aidan Lister <aidan @ php.net>
+ * @version $Revision: 1.10 $
+ * @since PHP 4.1.0
+ * @require PHP 4.0.4 (call_user_func_array)
+ */
+if (!function_exists('vsprintf')) {
+ function vsprintf ($format, $args)
+ {
+ if (count($args) < 2) {
+ user_error('vsprintf() Too few arguments', E_USER_WARNING);
+ return;
+ }
+
+ array_unshift($args, $format);
+ return call_user_func_array('sprintf', $args);
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/Compat.php
===================================================================
--- branches/version-2_5-dev/data/module/Compat/Compat.php (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/Compat.php 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,133 @@
+<?php
+// +----------------------------------------------------------------------+
+// | 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: Aidan Lister <aidan @ php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id: Compat.php,v 1.19 2005/05/10 12:05:36 aidan Exp $
+
+
+/**
+ * Provides missing functionality in the form of constants and functions
+ * for older versions of PHP
+ *
+ * Optionally, you may simply include the file.
+ * e.g. require_once 'PHP/Compat/Function/scandir.php';
+ *
+ * @category PHP
+ * @package PHP_Compat
+ * @version $Revision: 1.19 $
+ * @author Aidan Lister <aidan @ php.net>
+ * @static
+ */
+class PHP_Compat
+{
+ /**
+ * Load a function, or array of functions
+ *
+ * @param string|array $function The function or functions to load
+ * @return bool|array TRUE if loaded, FALSE if not
+ */
+ function loadFunction($function)
+ {
+ // Recursiveness
+ if (is_array($function)) {
+ $res = array();
+ foreach ($function as $singlefunc) {
+ $res[$singlefunc] = PHP_Compat::loadFunction($singlefunc);
+ }
+
+ return $res;
+ }
+
+ // Load function
+ if (!function_exists($function)) {
+ $file = sprintf('PHP/Compat/Function/%s.php', $function);
+ if ((@include_once $file) !== false) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Load a constant, or array of constants
+ *
+ * @param string|array $constant The constant or constants to load
+ * @return bool|array TRUE if loaded, FALSE if not
+ */
+ function loadConstant($constant)
+ {
+ // Recursiveness
+ if (is_array($constant)) {
+ $res = array();
+ foreach ($constant as $singleconst) {
+ $res[$singleconst] = PHP_Compat::loadConstant($singleconst);
+ }
+
+ return $res;
+ }
+
+ // Load constant
+ $file = sprintf('PHP/Compat/Constant/%s.php', $constant);
+ if ((@include_once $file) !== false) {
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Load components for a PHP version
+ *
+ * @param string $version PHP Version to load
+ * @return array An associative array of component names loaded
+ */
+ function loadVersion($version = null)
+ {
+ // Include list of components
+ require 'PHP/Compat/Components.php';
+
+ // Include version_compare to work with older versions
+ PHP_Compat::loadFunction('version_compare');
+
+ // Init
+ $phpversion = phpversion();
+ $methods = array(
+ 'function' => 'loadFunction',
+ 'constant' => 'loadConstant');
+ $res = array();
+
+ // Iterate each component
+ foreach ($components as $type => $slice) {
+ foreach ($slice as $component => $compversion) {
+ if (($version === null &&
+ 1 === version_compare($compversion, $phpversion)) || // C > PHP
+ (0 === version_compare($compversion, $version) || // C = S
+ 1 === version_compare($compversion, $phpversion))) { // C > PHP
+
+ $res[$type][$component] =
+ call_user_func(array('PHP_Compat', $methods[$type]), $component);
+ }
+ }
+ }
+
+ return $res;
+ }
+}
+
+?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/directory_separator.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/directory_separator.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/directory_separator.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,15 @@
+--TEST--
+Constant -- DIRECTORY_SEPARATOR
+--SKIPIF--
+<?php if (defined('DIRECTORY_SEPARATOR')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('DIRECTORY_SEPARATOR');
+
+echo (DIRECTORY_SEPARATOR == '\\' || DIRECTORY_SEPARATOR == '/') ?
+ 'true' :
+ 'false';
+?>
+--EXPECT--
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/e_strict.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/e_strict.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/e_strict.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Constant -- E_STRICT
+--SKIPIF--
+<?php if (defined('E_STRICT')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('E_STRICT');
+
+echo E_STRICT;
+?>
+--EXPECT--
+2048
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/file.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/file.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/file.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Constant -- File System Constants
+--SKIPIF--
+<?php if (defined('FILE_USE_INCLUDE_PATH')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('FILE');
+
+echo FILE_USE_INCLUDE_PATH, "\n";
+echo FILE_IGNORE_NEW_LINES, "\n";
+echo FILE_SKIP_EMPTY_LINES, "\n";
+echo FILE_APPEND, "\n";
+echo FILE_NO_DEFAULT_CONTEXT
+?>
+--EXPECT--
+1
+2
+4
+8
+16
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/path_separator.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/path_separator.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/path_separator.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,15 @@
+--TEST--
+Constant -- PATH_SEPARATOR
+--SKIPIF--
+<?php if (defined('PATH_SEPARATOR')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('PATH_SEPARATOR');
+
+echo (PATH_SEPARATOR == ';' || PATH_SEPARATOR == ':') ?
+ 'true' :
+ 'false';
+?>
+--EXPECT--
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/php_eol.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/php_eol.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/php_eol.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,17 @@
+--TEST--
+Constant -- PHP_EOL
+--SKIPIF--
+<?php if (defined('PHP_EOL')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('PHP_EOL');
+
+if (PHP_EOL == "\n" || PHP_EOL == "\r\n" || PHP_EOL == "\r") {
+ echo 'true';
+} else {
+ echo 'false';
+}
+?>
+--EXPECT--
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/std.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/std.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/std.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,17 @@
+--TEST--
+Constant -- CLI Constants
+--SKIPIF--
+<?php if (defined('STDIN')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('STD');
+
+echo (is_resource(STDIN)) ? 'true' : 'false', "\n";
+echo (is_resource(STDOUT)) ? 'true' : 'false', "\n";
+echo (is_resource(STDERR)) ? 'true' : 'false';
+?>
+--EXPECT--
+true
+true
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/t.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/t.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/t.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,48 @@
+--TEST--
+Constant -- Tokenizer constants
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('T');
+
+$constants = array(
+ 'T_ML_COMMENT',
+ 'T_ML_COMMENT',
+ 'T_DOC_COMMENT',
+ 'T_OLD_FUNCTION',
+ 'T_ABSTRACT',
+ 'T_CATCH',
+ 'T_FINAL',
+ 'T_INSTANCEOF',
+ 'T_PRIVATE',
+ 'T_PROTECTED',
+ 'T_PUBLIC',
+ 'T_THROW',
+ 'T_TRY',
+ 'T_CLONE');
+
+foreach ($constants as $constant) {
+ if (defined($constant)) {
+ echo 'true';
+ } else {
+ echo 'false';
+ }
+ echo "\n";
+}
+
+?>
+--EXPECT--
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/constant/upload_err.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/constant/upload_err.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/constant/upload_err.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Constant -- Upload error constants
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+PHP_Compat::loadConstant('UPLOAD_ERR');
+
+echo UPLOAD_ERR_OK, "\n";
+echo UPLOAD_ERR_INI_SIZE, "\n";
+echo UPLOAD_ERR_FORM_SIZE, "\n";
+echo UPLOAD_ERR_PARTIAL, "\n";
+echo UPLOAD_ERR_NO_FILE;
+
+?>
+--EXPECT--
+0
+1
+2
+3
+4
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_change_key_case.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_change_key_case.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_change_key_case.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,100 @@
+--TEST--
+Function -- array_change_key_case
+--SKIPIF--
+<?php if (function_exists('array_change_key_case')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_change_key_case');
+
+$in = array('FirSt' => 1, 'SecOnd' => 4);
+print_r(array_change_key_case($in));
+print_r(array_change_key_case($in, CASE_LOWER));
+print_r(array_change_key_case($in, CASE_UPPER));
+$in = array('FIRST' => 1, 'SECOND' => 4);
+print_r(array_change_key_case($in));
+print_r(array_change_key_case($in, CASE_LOWER));
+print_r(array_change_key_case($in, CASE_UPPER));
+$in = array('first' => 1, 'second' => 4);
+print_r(array_change_key_case($in));
+print_r(array_change_key_case($in, CASE_LOWER));
+print_r(array_change_key_case($in, CASE_UPPER));
+$in = array('foo', 'bar');
+print_r(array_change_key_case($in));
+print_r(array_change_key_case($in, CASE_LOWER));
+print_r(array_change_key_case($in, CASE_UPPER));
+$in = array();
+print_r(array_change_key_case($in));
+print_r(array_change_key_case($in, CASE_LOWER));
+print_r(array_change_key_case($in, CASE_UPPER));
+?>
+--EXPECT--
+Array
+(
+ [first] => 1
+ [second] => 4
+)
+Array
+(
+ [first] => 1
+ [second] => 4
+)
+Array
+(
+ [FIRST] => 1
+ [SECOND] => 4
+)
+Array
+(
+ [first] => 1
+ [second] => 4
+)
+Array
+(
+ [first] => 1
+ [second] => 4
+)
+Array
+(
+ [FIRST] => 1
+ [SECOND] => 4
+)
+Array
+(
+ [first] => 1
+ [second] => 4
+)
+Array
+(
+ [first] => 1
+ [second] => 4
+)
+Array
+(
+ [FIRST] => 1
+ [SECOND] => 4
+)
+Array
+(
+ [0] => foo
+ [1] => bar
+)
+Array
+(
+ [0] => foo
+ [1] => bar
+)
+Array
+(
+ [0] => foo
+ [1] => bar
+)
+Array
+(
+)
+Array
+(
+)
+Array
+(
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_chunk.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_chunk.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_chunk.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,174 @@
+--TEST--
+Function -- array_chunk
+--SKIPIF--
+<?php if (function_exists('array_chunk')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_chunk');
+
+$input_array = array(2 => 'a', 3 => 'b', 4 => 'c', 5 => 'd', 6 => 'e');
+print_r(array_chunk($input_array, 2));
+print_r(array_chunk($input_array, 2, true));
+print_r(array_chunk($input_array, 3));
+print_r(array_chunk($input_array, 3, true));
+print_r(array_chunk($input_array, 4));
+print_r(array_chunk($input_array, 4, true));
+print_r(array_chunk($input_array, 5));
+print_r(array_chunk($input_array, 5, true));
+print_r(array_chunk($input_array, 6));
+print_r(array_chunk($input_array, 6, true));
+?>
+--EXPECT--
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ )
+
+ [1] => Array
+ (
+ [0] => c
+ [1] => d
+ )
+
+ [2] => Array
+ (
+ [0] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [2] => a
+ [3] => b
+ )
+
+ [1] => Array
+ (
+ [4] => c
+ [5] => d
+ )
+
+ [2] => Array
+ (
+ [6] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ [2] => c
+ )
+
+ [1] => Array
+ (
+ [0] => d
+ [1] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [2] => a
+ [3] => b
+ [4] => c
+ )
+
+ [1] => Array
+ (
+ [5] => d
+ [6] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ [2] => c
+ [3] => d
+ )
+
+ [1] => Array
+ (
+ [0] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [2] => a
+ [3] => b
+ [4] => c
+ [5] => d
+ )
+
+ [1] => Array
+ (
+ [6] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ [2] => c
+ [3] => d
+ [4] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [2] => a
+ [3] => b
+ [4] => c
+ [5] => d
+ [6] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [0] => a
+ [1] => b
+ [2] => c
+ [3] => d
+ [4] => e
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [2] => a
+ [3] => b
+ [4] => c
+ [5] => d
+ [6] => e
+ )
+
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_combine.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_combine.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_combine.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,22 @@
+--TEST--
+Function -- array_combine
+--SKIPIF--
+<?php if (function_exists('array_combine')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_combine');
+
+$a = array('green', 'red', 'yellow');
+$b = array('avocado', 'apple', 'banana');
+$c = array_combine($a, $b);
+
+print_r($c);
+?>
+--EXPECT--
+Array
+(
+ [green] => avocado
+ [red] => apple
+ [yellow] => banana
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_assoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_assoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_assoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Function -- array_diff_assoc
+--SKIPIF--
+<?php if (function_exists('array_diff_assoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_diff_assoc');
+
+$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
+$array2 = array("a" => "green", "yellow", "red");
+$result = array_diff_assoc($array1, $array2);
+print_r($result);
+?>
+--EXPECT--
+Array
+(
+ [b] => brown
+ [c] => blue
+ [0] => red
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_key.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_key.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_key.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Function -- array_diff_key
+--SKIPIF--
+<?php if (function_exists('array_diff_key')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_diff_key');
+
+$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
+$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
+
+print_r(array_diff_key($array1, $array2));
+
+?>
+--EXPECT--
+Array
+(
+ [red] => 2
+ [purple] => 4
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_uassoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_uassoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_uassoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,31 @@
+--TEST--
+Function -- array_diff_uassoc
+--SKIPIF--
+<?php if (function_exists('array_diff_uassoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_diff_uassoc');
+
+function key_compare_func($a, $b)
+{
+ if ($a === $b) {
+ return 0;
+ }
+
+ return ($a > $b) ? 1 : -1;
+}
+
+$array1 = array('a' => 'green', 'b' => 'brown', 'c' => 'blue', 'red');
+$array2 = array('a' => 'green', 'yellow', 'red');
+$result = array_diff_uassoc($array1, $array2, 'key_compare_func');
+print_r($result);
+
+?>
+--EXPECT--
+Array
+(
+ [b] => brown
+ [c] => blue
+ [0] => red
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_ukey.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_ukey.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_ukey.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,32 @@
+--TEST--
+Function -- array_diff_ukey
+--SKIPIF--
+<?php if (function_exists('array_diff_ukey')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_diff_ukey');
+
+function key_compare_func($key1, $key2)
+{
+ if ($key1 == $key2) {
+ return 0;
+ } elseif ($key1 > $key2) {
+ return 1;
+ } else {
+ return -1;
+ }
+}
+
+$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
+$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
+
+print_r(array_diff_ukey($array1, $array2, 'key_compare_func'));
+
+?>
+--EXPECT--
+Array
+(
+ [red] => 2
+ [purple] => 4
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_assoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_assoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_assoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- array_intersect_assoc
+--SKIPIF--
+<?php if (function_exists('array_intersect_assoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_intersect_assoc');
+
+$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
+$array2 = array("a" => "green", "yellow", "red");
+$result = array_intersect_assoc($array1, $array2);
+print_r($result);
+
+?>
+--EXPECT--
+Array
+(
+ [a] => green
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_key.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_key.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_key.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Function -- array_intersect_key
+--SKIPIF--
+<?php if (function_exists('array_intersect_key')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_intersect_key');
+
+$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
+$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
+
+print_r(array_intersect_key($array1, $array2));
+
+?>
+--EXPECT--
+Array
+(
+ [blue] => 1
+ [green] => 3
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_uassoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_uassoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_uassoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- array_intersect_uassoc
+--SKIPIF--
+<?php if (function_exists('array_intersect_uassoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_intersect_uassoc');
+
+$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
+$array2 = array("a" => "GREEN", "B" => "brown", "yellow", "red");
+
+print_r(array_intersect_uassoc($array1, $array2, "strcasecmp"));
+
+?>
+--EXPECT--
+Array
+(
+ [b] => brown
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_ukey.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_ukey.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_intersect_ukey.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,32 @@
+--TEST--
+Function -- array_intersect_ukey
+--SKIPIF--
+<?php if (function_exists('array_intersect_ukey')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_intersect_ukey');
+
+function key_compare_func($key1, $key2)
+{
+ if ($key1 == $key2) {
+ return 0;
+ } elseif ($key1 > $key2) {
+ return 1;
+ } else {
+ return -1;
+ }
+}
+
+$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
+$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
+
+print_r(array_intersect_ukey($array1, $array2, 'key_compare_func'));
+
+?>
+--EXPECT--
+Array
+(
+ [blue] => 1
+ [green] => 3
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_key_exists.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_key_exists.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_key_exists.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- array_key_exists
+--SKIPIF--
+<?php if (function_exists('array_key_exists')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_key_exists');
+
+$search_array = array("first" => 1, "second" => 4);
+if (array_key_exists("first", $search_array)) {
+ echo "The 'first' element is in the array";
+}
+?>
+--EXPECT--
+The 'first' element is in the array
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_product.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_product.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_product.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,55 @@
+--TEST--
+Function -- array_product
+--SKIPIF--
+<?php if (function_exists('array_product')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_product');
+
+function ehandler($no, $str)
+{
+ echo '(Warning) ';
+}
+set_error_handler('ehandler');
+
+$tests = array(
+ 'foo',
+ array(),
+ array(0),
+ array(3),
+ array(3, 3),
+ array(0.5, 2, 3)
+);
+
+foreach ($tests as $v) {
+ echo "testing: (", (is_array($v) ? implode(' * ', $v) : $v), ")\n result: ";
+ var_dump(array_product($v));
+ echo "\n\n";
+}
+
+restore_error_handler();
+?>
+--EXPECT--
+testing: (foo)
+ result: (Warning) NULL
+
+
+testing: ()
+ result: int(0)
+
+
+testing: (0)
+ result: int(0)
+
+
+testing: (3)
+ result: int(3)
+
+
+testing: (3 * 3)
+ result: int(9)
+
+
+testing: (0.5 * 2 * 3)
+ result: float(3)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_search.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_search.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_search.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,17 @@
+--TEST--
+Function -- array_search
+--SKIPIF--
+<?php if (function_exists('array_search')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_search');
+
+$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
+
+var_dump(array_search('green', $array));
+var_dump(array_search('red', $array));
+?>
+--EXPECT--
+int(2)
+int(1)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,31 @@
+--TEST--
+Function -- array_udiff
+--SKIPIF--
+<?php if (function_exists('array_udiff')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_udiff');
+
+class cr {
+ var $priv_member;
+ function cr($val)
+ {
+ $this->priv_member = $val;
+ }
+
+ function comp_func_cr($a, $b)
+ {
+ if ($a->priv_member === $b->priv_member) return 0;
+ return ($a->priv_member > $b->priv_member)? 1:-1;
+ }
+}
+
+$a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),);
+$b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr(3), 1=> new cr(4), 2 => new cr(-15),);
+
+$result = array_udiff($a, $b, array("cr", "comp_func_cr"));
+echo serialize($result);
+?>
+--EXPECT--
+a:2:{s:3:"0.5";O:2:"cr":1:{s:11:"priv_member";i:12;}i:0;O:2:"cr":1:{s:11:"priv_member";i:23;}}
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_assoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_assoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_assoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,31 @@
+--TEST--
+Function -- array_udiff_assoc
+--SKIPIF--
+<?php if (function_exists('array_udiff_assoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_udiff_assoc');
+
+class cr {
+ var $priv_member;
+ function cr($val)
+ {
+ $this->priv_member = $val;
+ }
+
+ function comp_func_cr($a, $b)
+ {
+ if ($a->priv_member === $b->priv_member) return 0;
+ return ($a->priv_member > $b->priv_member)? 1:-1;
+ }
+}
+
+$a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),);
+$b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr(3), 1=> new cr(4), 2 => new cr(-15),);
+
+$result = array_udiff_assoc($a, $b, array("cr", "comp_func_cr"));
+echo serialize($result);
+?>
+--EXPECT--
+a:3:{s:3:"0.1";O:2:"cr":1:{s:11:"priv_member";i:9;}s:3:"0.5";O:2:"cr":1:{s:11:"priv_member";i:12;}i:0;O:2:"cr":1:{s:11:"priv_member";i:23;}}
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_uassoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_uassoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_udiff_uassoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,56 @@
+--TEST--
+Function -- array_udiff_uassoc
+--SKIPIF--
+<?php if (function_exists('array_udiff_uassoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_udiff_uassoc');
+
+class cr
+{
+ var $val;
+
+ function cr($val)
+ {
+ $this->val = $val;
+ }
+
+ function comp_func_cr($a, $b)
+ {
+ if ($a->val === $b->val) return 0;
+ return ($a->val > $b->val) ? 1 : -1;
+ }
+
+ function comp_func_key($a, $b)
+ {
+ if ($a === $b) return 0;
+ return ($a > $b) ? 1 : -1;
+ }
+}
+
+$a = array('0.1' => new cr(9), '0.5' => new cr(12), 0 => new cr(23), 1 => new cr(4), 2 => new cr(-15));
+$b = array('0.2' => new cr(9), '0.5' => new cr(22), 0 => new cr(3), 1 => new cr(4), 2 => new cr(-15));
+
+$result = array_udiff_uassoc($a, $b, array('cr', 'comp_func_cr'), array('cr', 'comp_func_key'));
+print_r($result);
+?>
+--EXPECT--
+Array
+(
+ [0.1] => cr Object
+ (
+ [val] => 9
+ )
+
+ [0.5] => cr Object
+ (
+ [val] => 12
+ )
+
+ [0] => cr Object
+ (
+ [val] => 23
+ )
+
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Function -- array_uintersect
+--SKIPIF--
+<?php if (function_exists('array_uintersect')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_uintersect');
+
+$array1 = array('a' => 'green', 'b' => 'brown', 'c' => 'blue', 'red');
+$array2 = array('a' => 'GREEN', 'B' => 'brown', 'yellow', 'red');
+
+print_r(array_uintersect($array1, $array2, 'strcasecmp'));
+?>
+--EXPECT--
+Array
+(
+ [a] => green
+ [b] => brown
+ [0] => red
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_assoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_assoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_assoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,19 @@
+--TEST--
+Function -- array_uintersect_assoc
+--SKIPIF--
+<?php if (function_exists('array_uintersect_assoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_uintersect_assoc');
+
+$array1 = array('a' => 'green', 'b' => 'brown', 'c' => 'blue', 'red');
+$array2 = array('a' => 'GREEN', 'B' => 'brown', 'yellow', 'red');
+
+print_r(array_uintersect_assoc($array1, $array2, 'strcasecmp'));
+?>
+--EXPECT--
+Array
+(
+ [a] => green
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_uassoc.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_uassoc.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_uintersect_uassoc.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- array_uintersect_uassoc
+--SKIPIF--
+<?php if (function_exists('array_uintersect_uassoc')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_uintersect_uassoc');
+
+$array1 = array('a' => 'green', 'b' => 'brown', 'c' => 'blue', 'red');
+$array2 = array('a' => 'GREEN', 'B' => 'brown', 'yellow', 'red');
+
+print_r(array_uintersect_uassoc($array1, $array2, 'strcasecmp', 'strcasecmp'));
+?>
+--EXPECT--
+Array
+(
+ [a] => green
+ [b] => brown
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/array_walk_recursive.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/array_walk_recursive.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/array_walk_recursive.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,23 @@
+--TEST--
+Function -- array_walk_recursive
+--SKIPIF--
+<?php if (function_exists('array_walk_recursive')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('array_walk_recursive');
+
+$sweet = array('a' => 'apple', 'b' => 'banana');
+$fruits = array('sweet' => $sweet, 'sour' => 'lemon');
+
+function test_print($item, $key)
+{
+ echo "$key holds $item\n";
+}
+
+array_walk_recursive($fruits, 'test_print');
+?>
+--EXPECT--
+a holds apple
+b holds banana
+sour holds lemon
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/bcinvert.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/bcinvert.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/bcinvert.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- bcinvert
+--SKIPIF--
+<?php if (function_exists('bcinvert')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('bcinvert');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/bcpowmod.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/bcpowmod.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/bcpowmod.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- bcpowmod
+--SKIPIF--
+<?php if (function_exists('bcpowmod')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('bcpowmod');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/call_user_func_array.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/call_user_func_array.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/call_user_func_array.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- call_user_func_array
+--SKIPIF--
+<?php if (function_exists('call_user_func_array')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('call_user_func_array');
+
+function somefunc ($param1, $param2, $param3) {
+ echo $param1, "\n", $param2, "\n", $param3;
+}
+
+$args = array ('foo', 'bar', 'meta');
+call_user_func_array('somefunc', $args);
+?>
+--EXPECT--
+foo
+bar
+meta
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/clone.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/clone.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/clone.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,69 @@
+--TEST--
+Function -- clone
+--SKIPIF--
+<?php if (version_compare(phpversion(), '5.0') !== -1) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('clone');
+
+// Test classes
+class testclass
+{
+ var $foo = 'foo';
+}
+
+class testclass2
+{
+ var $foo = 'foo';
+
+ function __clone()
+ {
+ $this->foo = 'bar';
+ }
+}
+
+class testclass3
+{
+ var $bar;
+}
+
+class testclass4
+{
+ var $foo;
+ function __clone()
+ {
+ $this->foo = clone($this->foo);
+ }
+}
+
+// Test 1: Initial value
+$aa = new testclass;
+echo $aa->foo, "\n"; // foo
+
+// Test 2: Not referenced
+$bb = clone($aa);
+$bb->foo = 'baz';
+echo $aa->foo, "\n"; // foo
+
+// Test 3: __clone method
+$cc = new testclass2;
+echo $cc->foo, "\n"; // foo
+$dd = clone($cc);
+echo $dd->foo, "\n"; // bar
+
+// Test 4: Bug #3649
+$a = new testclass3;
+$a->foo =& new testclass4;
+$a->foo->bar = 'hello';
+$aclone = clone($a);
+$aclone->b->bar = 'goodbye';
+echo $a->foo->bar, "\n";
+
+?>
+--EXPECT--
+foo
+foo
+foo
+bar
+hello
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/constant.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/constant.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/constant.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,15 @@
+--TEST--
+Function -- constant
+--SKIPIF--
+<?php if (function_exists('constant')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('constant');
+
+$constant = 'BAR';
+define($constant, 'foo');
+echo constant($constant);
+?>
+--EXPECT--
+foo
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/convert_uudecode.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/convert_uudecode.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/convert_uudecode.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,14 @@
+--TEST--
+Function -- convert_uudecode
+--SKIPIF--
+<?php if (function_exists('convert_uudecode')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('convert_uudecode');
+
+$string = base64_decode('NTUmQUk8UiFJPFIhQSgnLUk7NyFMOTIhVDk3LVQKYAo=');
+echo convert_uudecode($string);
+?>
+--EXPECT--
+This is a simple test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/convert_uuencode.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/convert_uuencode.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/convert_uuencode.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,23 @@
+--TEST--
+Function -- convert_uuencode
+--SKIPIF--
+<?php if (function_exists('convert_uuencode')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('convert_uuencode');
+
+// Simple test
+echo md5(convert_uuencode('This is a simple test')), "\n";
+
+// Really messy test
+$string = '';
+for ($i = 0; 127 > $i; $i++) {
+ $string .= str_repeat(chr($i), 10);
+}
+echo md5(convert_uuencode($string));
+
+?>
+--EXPECT--
+d7974131c8970783f70851c83fe17767
+19acf7157a8345307ea5e5ea6878abb4
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/debug_print_backtrace.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/debug_print_backtrace.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/debug_print_backtrace.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- debug_print_backtrace
+--SKIPIF--
+<?php if (function_exists('debug_print_backtrace')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('debug_print_backtrace');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/file_get_contents.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/file_get_contents.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/file_get_contents.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- file_get_contents
+--SKIPIF--
+<?php if (function_exists('file_get_contents')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('file_get_contents');
+
+$tmpfname = tempnam('/tmp', 'php');
+$handle = fopen($tmpfname, 'w');
+fwrite($handle, "test test");
+fclose($handle);
+
+echo file_get_contents($tmpfname);
+
+unlink($tmpfname);
+?>
+--EXPECT--
+test test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/file_put_contents.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/file_put_contents.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/file_put_contents.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,47 @@
+--TEST--
+Function -- file_put_contents
+--SKIPIF--
+<?php if (function_exists('file_put_contents')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('file_put_contents');
+
+// Create a temp file
+$tmpfname = tempnam('/tmp', 'phpcompat');
+
+// With a string
+$string = "abcd";
+
+echo file_put_contents($tmpfname, $string), "\n";
+echo implode('', file($tmpfname)), "\n";
+
+// With an array
+$string = array('foo', 'bar');
+
+echo file_put_contents($tmpfname, $string), "\n";
+echo implode('', file($tmpfname)), "\n";
+
+// Test append
+$string = 'foobar';
+$string2 = 'testtest';
+$tmpfname = tempnam('/tmp', 'php');
+
+echo file_put_contents($tmpfname, $string), "\n";
+echo file_put_contents($tmpfname, $string2, FILE_APPEND), "\n";
+echo implode('', file($tmpfname)), "\n";
+echo file_put_contents($tmpfname, $string2), "\n";
+echo implode('', file($tmpfname));
+
+unlink($tmpfname);
+?>
+--EXPECT--
+4
+abcd
+6
+foobar
+6
+8
+foobartesttest
+8
+testtest
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/floatval.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/floatval.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/floatval.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,14 @@
+--TEST--
+Function -- floatval
+--SKIPIF--
+<?php if (function_exists('floatval')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('floatval');
+
+$var = '12312.123';
+var_dump(floatval($var));
+?>
+--EXPECT--
+float(12312.123)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/fprintf.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/fprintf.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/fprintf.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- fprintf
+--SKIPIF--
+<?php if (function_exists('fprintf')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('fprintf');
+
+$tmpfname = tempnam('/tmp', 'php');
+$handle = fopen($tmpfname, 'w');
+fprintf($handle, 'The %s went to the %s for %d days', 'dog', 'park', 2);
+fclose($handle);
+$data = implode('', file($tmpfname));
+unlink($tmpfname);
+
+echo $data;
+?>
+--EXPECT--
+The dog went to the park for 2 days
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/fputcsv.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/fputcsv.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/fputcsv.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- fputcsv
+--SKIPIF--
+<?php if (function_exists('fputcsv')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('fputcsv');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/get_headers.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/get_headers.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/get_headers.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- get_headers
+--SKIPIF--
+<?php if (function_exists('get_headers')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('get_headers');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/get_include_path.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/get_include_path.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/get_include_path.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,15 @@
+--TEST--
+Function -- get_include_path
+--SKIPIF--
+<?php if (function_exists('get_include_path')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('get_include_path');
+
+if (get_include_path() == ini_get('include_path')) {
+ echo 'true';
+}
+?>
+--EXPECT--
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/html_entity_decode.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/html_entity_decode.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/html_entity_decode.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- html_entity_decode
+--SKIPIF--
+<?php if (function_exists('html_entity_decode')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('html_entity_decode');
+
+$string = "I'll "walk" the <b>dog</b> now";
+echo html_entity_decode($string), "\n";
+echo html_entity_decode($string, ENT_COMPAT), "\n";
+echo html_entity_decode($string, ENT_QUOTES), "\n";
+echo html_entity_decode($string, ENT_NOQUOTES), "\n";
+?>
+--EXPECT--
+I'll "walk" the <b>dog</b> now
+I'll "walk" the <b>dog</b> now
+I'll "walk" the <b>dog</b> now
+I'll "walk" the <b>dog</b> now
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/htmlspecialchars_decode.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/htmlspecialchars_decode.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/htmlspecialchars_decode.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,23 @@
+--TEST--
+Function -- htmlspecialchars_decode
+--SKIPIF--
+<?php if (function_exists('htmlspecialchars_decode')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('htmlspecialchars_decode');
+
+$text = 'Text & " ' < > End Text';
+echo $text, "\n";
+echo htmlspecialchars_decode($text), "\n";
+echo htmlspecialchars_decode($text, ENT_COMPAT), "\n";
+echo htmlspecialchars_decode($text, ENT_QUOTES), "\n";
+echo htmlspecialchars_decode($text, ENT_NOQUOTES), "\n";
+
+?>
+--EXPECT--
+Text & " ' < > End Text
+Text & " ' < > End Text
+Text & " ' < > End Text
+Text & " ' < > End Text
+Text & " ' < > End Text
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/http_build_query.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/http_build_query.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/http_build_query.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,70 @@
+--TEST--
+Function -- http_build_query
+--SKIPIF--
+<?php if (function_exists('http_build_query')) { echo 'skip'; } ?>
+--INI--
+arg_separator.output=QQQ
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('http_build_query');
+
+// Simple
+$data = array('foo'=>'bar',
+ 'baz'=>'boom',
+ 'cow'=>'milk',
+ 'php'=>'hypertext processor');
+
+echo http_build_query($data), "\n";
+
+
+// With an object
+class myClass {
+ var $foo;
+ var $baz;
+
+ function myClass()
+ {
+ $this->foo = 'bar';
+ $this->baz = 'boom';
+ }
+}
+
+$data = new myClass();
+echo http_build_query($data), "\n";
+
+
+// With numerically indexed elements
+$data = array('foo', 'bar', 'baz', 'boom', 'cow' => 'milk', 'php' =>'hypertext processor');
+echo http_build_query($data), "\n";
+echo http_build_query($data, 'myvar_'), "\n";
+
+
+// With a complex array
+$data = array('user' => array(
+ 'name' => 'Bob Smith',
+ 'age' => 47,
+ 'sex' => 'M',
+ 'dob' => '5/12/1956'),
+ 'pastimes' => array(
+ 'golf',
+ 'opera',
+ 'poker',
+ 'rap'),
+ 'children' => array(
+ 'bobby' => array(
+ 'age' => 12,
+ 'sex' => 'M'),
+ 'sally' => array(
+ 'age' => 8,
+ 'sex'=>'F')),
+ 'CEO');
+
+echo http_build_query($data, 'flags_');
+?>
+--EXPECT--
+foo=barQQQbaz=boomQQQcow=milkQQQphp=hypertext+processor
+foo=barQQQbaz=boom
+0=fooQQQ1=barQQQ2=bazQQQ3=boomQQQcow=milkQQQphp=hypertext+processor
+myvar_0=fooQQQmyvar_1=barQQQmyvar_2=bazQQQmyvar_3=boomQQQcow=milkQQQphp=hypertext+processor
+user[name]=Bob+SmithQQQuser[age]=47QQQuser[sex]=MQQQuser[dob]=5%2F12%2F1956QQQpastimes[0]=golfQQQpastimes[1]=operaQQQpastimes[2]=pokerQQQpastimes[3]=rapQQQchildren[bobby][age]=12QQQchildren[bobby][sex]=MQQQchildren[sally][age]=8QQQchildren[sally][sex]=FQQQflags_0=CEO
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/ibase_timefmt.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/ibase_timefmt.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/ibase_timefmt.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- ibase_timefmt
+--SKIPIF--
+<?php if (function_exists('ibase_timefmt')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('ibase_timefmt');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/idate.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/idate.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/idate.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,159 @@
+--TEST--
+Function -- idate
+--SKIPIF--
+<?php if (function_exists('idate')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('idate');
+
+$tests = array(
+ 'B', // OK
+ 'd', // ...
+ 'h',
+ 'H',
+ 'i',
+ 'I',
+ 'L',
+ 'm',
+ 's',
+ 't',
+ 'U',
+ 'w',
+ 'W',
+ 'y',
+ 'Y',
+ 'z', // ...
+ 'Z', // OK
+
+ 'foo', // NOK
+ '', // NOK
+ '!', // NOK
+ '\\' // NOK
+);
+
+function ehandler($no, $str)
+{
+ echo '(Warning) ';
+}
+set_error_handler('ehandler');
+
+foreach ($tests as $v) {
+ echo 'testing: ';
+ var_dump($v);
+ echo "\nresult: ";
+ $res = idate($v);
+ if (!$res) {
+ var_dump($res);
+ } else {
+ echo "> 0\n";
+ }
+ echo "\n\n";
+}
+
+restore_error_handler();
+?>
+--EXPECT--
+testing: string(1) "B"
+
+result: > 0
+
+
+testing: string(1) "d"
+
+result: > 0
+
+
+testing: string(1) "h"
+
+result: > 0
+
+
+testing: string(1) "H"
+
+result: > 0
+
+
+testing: string(1) "i"
+
+result: > 0
+
+
+testing: string(1) "I"
+
+result: int(0)
+
+
+testing: string(1) "L"
+
+result: int(0)
+
+
+testing: string(1) "m"
+
+result: > 0
+
+
+testing: string(1) "s"
+
+result: > 0
+
+
+testing: string(1) "t"
+
+result: > 0
+
+
+testing: string(1) "U"
+
+result: > 0
+
+
+testing: string(1) "w"
+
+result: > 0
+
+
+testing: string(1) "W"
+
+result: > 0
+
+
+testing: string(1) "y"
+
+result: > 0
+
+
+testing: string(1) "Y"
+
+result: > 0
+
+
+testing: string(1) "z"
+
+result: > 0
+
+
+testing: string(1) "Z"
+
+result: int(0)
+
+
+testing: string(3) "foo"
+
+result: (Warning) bool(false)
+
+
+testing: string(0) ""
+
+result: (Warning) bool(false)
+
+
+testing: string(1) "!"
+
+result: int(0)
+
+
+testing: string(1) "\"
+
+result: int(0)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/image_type_to_mime_type.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/image_type_to_mime_type.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/image_type_to_mime_type.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,49 @@
+--TEST--
+Function -- image_type_to_mime_type
+--SKIPIF--
+<?php if (function_exists('image_type_to_mime_type')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('image_type_to_mime_type');
+
+$types = array (
+ IMAGETYPE_GIF,
+ IMAGETYPE_JPEG,
+ IMAGETYPE_PNG,
+ IMAGETYPE_SWF,
+ IMAGETYPE_PSD,
+ IMAGETYPE_BMP,
+ IMAGETYPE_TIFF_II,
+ IMAGETYPE_TIFF_MM,
+ IMAGETYPE_JPC,
+ IMAGETYPE_JP2,
+ IMAGETYPE_JPX,
+ IMAGETYPE_JB2,
+ IMAGETYPE_SWC,
+ IMAGETYPE_IFF,
+ IMAGETYPE_WBMP,
+ IMAGETYPE_XBM
+);
+
+foreach ($types as $type) {
+ echo image_type_to_mime_type($type), "\n";
+}
+?>
+--EXPECT--
+image/gif
+image/jpeg
+image/png
+application/x-shockwave-flash
+image/psd
+image/bmp
+image/tiff
+image/tiff
+application/octet-stream
+image/jp2
+application/octet-stream
+application/octet-stream
+application/x-shockwave-flash
+image/iff
+image/vnd.wap.wbmp
+image/xbm
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/inet_ntop.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/inet_ntop.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/inet_ntop.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,38 @@
+--TEST--
+Function -- inet_ntop
+--SKIPIF--
+<?php if (function_exists('inet_ntop')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('inet_ntop');
+
+$adds = array(
+ '127.0.0.1' => '7f000001',
+ '192.232.131.222' => 'c0e883de',
+ '::1' => '00000000000000000000000000000001',
+ '2001:260:0:10::1' => '20010260000000100000000000000001',
+ 'fe80::200:4cff:fe43:172f' => 'fe8000000000000002004cfffe43172f'
+);
+
+foreach ($adds as $k => $v) {
+ echo "\ntesting: $k\n ";
+ var_dump(inet_ntop(pack('H*', $v)));
+}
+
+?>
+--EXPECT--
+testing: 127.0.0.1
+ string(9) "127.0.0.1"
+
+testing: 192.232.131.222
+ string(15) "192.232.131.222"
+
+testing: ::1
+ string(3) "::1"
+
+testing: 2001:260:0:10::1
+ string(16) "2001:260:0:10::1"
+
+testing: fe80::200:4cff:fe43:172f
+ string(24) "fe80::200:4cff:fe43:172f"
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/inet_pton.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/inet_pton.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/inet_pton.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,38 @@
+--TEST--
+Function -- inet_pton
+--SKIPIF--
+<?php if (function_exists('inet_pton')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('inet_pton');
+
+$adds = array(
+ '127.0.0.1' => '7f000001',
+ '192.232.131.222' => 'c0e883de',
+ '::1' => '00000000000000000000000000000001',
+ '2001:260:0:10::1' => '20010260000000100000000000000001',
+ 'fe80::200:4cff:fe43:172f' => 'fe8000000000000002004cfffe43172f'
+);
+
+foreach ($adds as $k => $v) {
+ echo "\ntesting: $k\n ";
+ echo bin2hex(inet_pton($k)), "\n";
+}
+
+?>
+--EXPECT--
+testing: 127.0.0.1
+ 7f000001
+
+testing: 192.232.131.222
+ c0e883de
+
+testing: ::1
+ 00000000000000000000000000000001
+
+testing: 2001:260:0:10::1
+ 20010260000000100000000000000001
+
+testing: fe80::200:4cff:fe43:172f
+ fe8000000000000002004cfffe43172f
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/ini_get_all.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/ini_get_all.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/ini_get_all.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- ini_get_all
+--SKIPIF--
+<?php if (function_exists('ini_get_all')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('ini_get_all');
+
+if (is_array(ini_get_all())) {
+ echo "true\n";
+}
+
+if (is_array(ini_get_all('mysql'))) {
+ echo "true\n";
+}
+?>
+--EXPECT--
+true
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/is_a.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/is_a.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/is_a.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,22 @@
+--TEST--
+Function -- is_a
+--SKIPIF--
+<?php if (function_exists('is_a')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('is_a');
+
+class WidgetFactory
+{
+ var $oink = 'moo';
+}
+
+$wf = new WidgetFactory();
+
+if (is_a($wf, 'WidgetFactory')) {
+ echo 'true';
+}
+?>
+--EXPECT--
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/is_scalar.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/is_scalar.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/is_scalar.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- is_scalar
+--SKIPIF--
+<?php if (function_exists('is_scalar')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('is_scalar');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/md5_file.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/md5_file.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/md5_file.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- md5_file
+--SKIPIF--
+<?php if (function_exists('md5_file')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('md5_file');
+
+echo md5_file(__FILE__);
+?>
+--EXPECT--
+762a55bb01c6133a956599e6a51c49b0
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/mhash.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/mhash.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/mhash.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- mhash
+--SKIPIF--
+<?php if (function_exists('mhash')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('mhash');
+
+$input = "what do ya want for nothing?";
+
+$hash = mhash(MHASH_MD5, $input);
+echo bin2hex($hash) . "\n";
+
+$hash = mhash(MHASH_MD5, $input, "Jefe");
+echo bin2hex($hash) . "\n";
+?>
+--EXPECT--
+ae2e4b39f3b5ee2c8b585994294201ea
+750c783e6ab0b503eaa86e310a5db738
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/mime_content_type.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/mime_content_type.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/mime_content_type.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- inet_pton
+--SKIPIF--
+<?php if (function_exists('inet_pton')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('inet_pton');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/ob_clean.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/ob_clean.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/ob_clean.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,17 @@
+--TEST--
+Function -- ob_clean
+--SKIPIF--
+<?php if (function_exists('ob_clean')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('ob_clean');
+
+ob_start();
+echo 'foo';
+ob_clean();
+echo 'foo';
+ob_end_flush();
+?>
+--EXPECT--
+foo
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/ob_flush.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/ob_flush.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/ob_flush.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- ob_flush
+--SKIPIF--
+<?php if (function_exists('ob_flush')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('ob_flush');
+
+ob_start();
+echo 'foo';
+ob_flush();
+ob_end_clean();
+?>
+--EXPECT--
+foo
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_clean.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_clean.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_clean.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- ob_get_clean
+--SKIPIF--
+<?php if (function_exists('ob_get_clean')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('ob_get_clean');
+
+ob_start();
+echo 'foo';
+$buffer = ob_get_clean();
+echo $buffer;
+?>
+--EXPECT--
+foo
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_flush.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_flush.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/ob_get_flush.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- ob_get_flush
+--SKIPIF--
+<?php if (function_exists('ob_get_flush')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('ob_get_flush');
+
+ob_start();
+echo 'foo';
+$buffer = ob_get_flush();
+echo $buffer;
+?>
+--EXPECT--
+foofoo
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/pg_affected_rows.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/pg_affected_rows.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/pg_affected_rows.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- pg_affected_rows
+--SKIPIF--
+<?php if (function_exists('pg_affected_rows')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('pg_affected_rows');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/pg_escape_bytea.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/pg_escape_bytea.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/pg_escape_bytea.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- pg_escape_bytea
+--SKIPIF--
+<?php if (function_exists('pg_escape_bytea')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('pg_escape_bytea');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/pg_unescape_bytea.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/pg_unescape_bytea.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/pg_unescape_bytea.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,13 @@
+--TEST--
+Function -- pg_unescape_bytea
+--SKIPIF--
+<?php if (function_exists('pg_unescape_bytea')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('pg_unescape_bytea');
+
+echo 'test';
+?>
+--EXPECT--
+test
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/php_strip_whitespace.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/php_strip_whitespace.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/php_strip_whitespace.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,42 @@
+--TEST--
+Function -- php_strip_whitespace
+--SKIPIF--
+<?php
+if (function_exists('php_strip_whitespace') ||
+ !extension_loaded('tokenizer')) {
+
+ echo 'skip';
+}
+?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('php_strip_whitespace');
+
+// Here is some sample PHP code to write to the file
+$string = '<?php
+// PHP comment here
+
+/*
+ * Another PHP comment
+ */
+
+echo php_strip_whitespace($_SERVER[\'PHP_SELF\']);
+// Newlines are considered whitespace, and are removed too:
+do_nothing();
+?>';
+
+// Create a temp file
+$tmpfname = tempnam('/tmp', 'phpcompat');
+$fh = fopen($tmpfname, 'w');
+fwrite($fh, $string);
+
+// Test
+echo php_strip_whitespace($tmpfname);
+
+// Close
+fclose($fh);
+?>
+--EXPECT--
+<?php
+ echo php_strip_whitespace($_SERVER['PHP_SELF']); do_nothing(); ?>
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/restore_include_path.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/restore_include_path.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/restore_include_path.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,23 @@
+--TEST--
+Function -- restore_include_path
+--SKIPIF--
+<?php if (function_exists('restore_include_path')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('restore_include_path');
+
+$orig = ini_get('include_path');
+ini_set('include_path', 'foo');
+echo ini_get('include_path'), "\n";
+
+restore_include_path();
+$new = ini_get('include_path');
+
+if ($orig == $new) {
+ echo 'true';
+}
+?>
+--EXPECT--
+foo
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/scandir.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/scandir.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/scandir.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,45 @@
+--TEST--
+Function -- scandir
+--SKIPIF--
+<?php if (function_exists('scandir')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('scandir');
+
+// Create a folder and fill it with files
+mkdir('tmp');
+touch('tmp/test1');
+touch('tmp/test2');
+
+// Scan it
+$dir = 'tmp';
+// Not sorted
+$files = scandir($dir);
+// Sorted
+$files2 = scandir($dir, 1);
+
+// List the results
+print_r($files);
+print_r($files2);
+
+// Remove the files
+unlink('tmp/test1');
+unlink('tmp/test2');
+rmdir('tmp');
+?>
+--EXPECT--
+Array
+(
+ [0] => .
+ [1] => ..
+ [2] => test1
+ [3] => test2
+)
+Array
+(
+ [0] => test2
+ [1] => test1
+ [2] => ..
+ [3] => .
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/set_include_path.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/set_include_path.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/set_include_path.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,14 @@
+--TEST--
+Function -- set_include_path
+--SKIPIF--
+<?php if (function_exists('set_include_path')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('set_include_path');
+
+set_include_path('foo');
+echo ini_get('include_path');
+?>
+--EXPECT--
+foo
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/str_ireplace.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/str_ireplace.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/str_ireplace.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,113 @@
+--TEST--
+Function -- str_ireplace
+--SKIPIF--
+<?php if (function_exists('str_ireplace')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('str_ireplace');
+
+//
+// Simple
+//
+
+$search = '{object}';
+$replace = 'fence';
+$subject = 'The dog jumped over the {object}';
+
+echo str_ireplace($search, $replace, $subject), "\n";
+
+//
+// Test 1: With subject as array
+//
+
+// As a full array
+$search = '{SUBJECT}';
+$replace = 'Lady';
+$subject = array('A {subject}', 'The {subject}', 'My {subject}');
+print_r(str_ireplace($search, $replace, $subject));
+
+// As a single array
+$search = '{SUBJECT}';
+$replace = 'Lady';
+$subject = array('The dog jumped over the {object}');
+print_r(str_ireplace($search, $replace, $subject));
+
+
+//
+// Test 2: Search as string, replace as array
+//
+
+$search = '{object}';
+$replace = array('cat', 'dog', 'tiger');
+$subject = 'The dog jumped over the {object}';
+// Supress the error, no way of knowing how it'll turn out on the users machine
+echo @str_ireplace($search, $replace, $subject), "\n";
+
+
+//
+// Test 3: Search as array, Replace as string
+//
+
+$search = array('{ANIMAL}', '{OBJECT}', '{THING}');
+$replace = 'frog';
+$subject = 'The {animal} jumped over the {object} and the {thing}...';
+echo str_ireplace($search, $replace, $subject), "\n";
+
+
+//
+// Test 4: Search and Replace as arrays
+//
+
+// Simple
+$search = array('{ANIMAL}', '{OBJECT}');
+$replace = array('frog', 'gate');
+$subject = 'The {animal} jumped over the {object}';
+echo str_ireplace($search, $replace, $subject), "\n";
+
+// More in search
+$search = array('{ANIMAL}', '{OBJECT}', '{THING}');
+$replace = array('frog', 'gate');
+$subject = 'The {animal} jumped over the {object} and the {thing}...';
+echo str_ireplace($search, $replace, $subject), "\n";
+
+// More in replace
+$search = array('{ANIMAL}', '{OBJECT}');
+$replace = array('frog', 'gate', 'door');
+$subject = 'The {animal} jumped over the {object} and the {thing}...';
+echo str_ireplace($search, $replace, $subject), "\n";
+
+
+//
+// Test 5: All arrays
+//
+
+$search = array('{ANIMAL}', '{OBJECT}', '{THING}');
+$replace = array('frog', 'gate', 'beer');
+$subject = array('A {animal}', 'The {object}', 'My {thing}');
+print_r(str_ireplace($search, $replace, $subject));
+
+?>
+--EXPECT--
+The dog jumped over the fence
+Array
+(
+ [0] => A Lady
+ [1] => The Lady
+ [2] => My Lady
+)
+Array
+(
+ [0] => The dog jumped over the {object}
+)
+The dog jumped over the Array
+The frog jumped over the frog and the frog...
+The frog jumped over the gate
+The frog jumped over the gate and the ...
+The frog jumped over the gate and the {thing}...
+Array
+(
+ [0] => A frog
+ [1] => The gate
+ [2] => My beer
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/str_rot13.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/str_rot13.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/str_rot13.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,14 @@
+--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.
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/str_shuffle.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/str_shuffle.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/str_shuffle.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,20 @@
+--TEST--
+Function -- str_shuffle
+--SKIPIF--
+<?php if (function_exists('str_shuffle')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('str_shuffle');
+
+$string = str_shuffle('ab');
+if ($string == 'ab' ||
+ $string == 'ba' ||
+ $string == 'aa' ||
+ $string == 'bb') {
+
+ echo "true";
+}
+?>
+--EXPECT--
+true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/str_split.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/str_split.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/str_split.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,59 @@
+--TEST--
+Function -- str_split
+--SKIPIF--
+<?php if (function_exists('str_split')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('str_split');
+
+$str = "Hello Friend";
+
+// Simple
+$arr = str_split($str);
+print_r($arr);
+
+// With a chunk size specified
+$arr = str_split($str, 3);
+print_r($arr);
+
+// With chunk size bigger than the string
+$arr = str_split($str, 60);
+print_r($arr);
+
+// String that has a remainder less than the chunk size
+$arr = str_split($str, 11);
+print_r($arr);
+?>
+--EXPECT--
+Array
+(
+ [0] => H
+ [1] => e
+ [2] => l
+ [3] => l
+ [4] => o
+ [5] =>
+ [6] => F
+ [7] => r
+ [8] => i
+ [9] => e
+ [10] => n
+ [11] => d
+)
+Array
+(
+ [0] => Hel
+ [1] => lo
+ [2] => Fri
+ [3] => end
+)
+Array
+(
+ [0] => Hello Friend
+)
+Array
+(
+ [0] => Hello Frien
+ [1] => d
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/str_word_count.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/str_word_count.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/str_word_count.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,57 @@
+--TEST--
+Function -- str_word_count
+--SKIPIF--
+<?php if (function_exists('str_word_count')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('str_word_count');
+
+$str = "Hello friend, you're \r\nsdf\tlooking 3865\t9879 good to\"day, yes \"sir\" you am!";
+var_dump(str_word_count($str));
+print_r(str_word_count($str, 1));
+print_r(str_word_count($str, 2));
+
+$str = 'hello I am repeated repeated';
+print_r(str_word_count($str, 2));
+?>
+--EXPECT--
+int(12)
+Array
+(
+ [0] => Hello
+ [1] => friend
+ [2] => you're
+ [3] => sdf
+ [4] => looking
+ [5] => good
+ [6] => to
+ [7] => day
+ [8] => yes
+ [9] => sir
+ [10] => you
+ [11] => am
+)
+Array
+(
+ [0] => Hello
+ [6] => friend
+ [14] => you're
+ [23] => sdf
+ [27] => looking
+ [48] => good
+ [53] => to
+ [56] => day
+ [61] => yes
+ [66] => sir
+ [71] => you
+ [75] => am
+)
+Array
+(
+ [0] => hello
+ [6] => I
+ [8] => am
+ [11] => repeated
+ [20] => repeated
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/stripos.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/stripos.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/stripos.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,27 @@
+--TEST--
+Function -- stripos
+--SKIPIF--
+<?php if (function_exists('stripos')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('stripos');
+
+$haystack = 'Cat Dinner Dog Lion Mouse Sheep Wolf Cat Dog';
+$needle = 'DOG';
+
+// Simple
+var_dump(stripos($haystack, $needle));
+
+// With offset
+var_dump(stripos($haystack, $needle, 4));
+var_dump(stripos($haystack, $needle, 10));
+var_dump(stripos($haystack, $needle, 15));
+var_dump(stripos($haystack, 'idontexist', 15));
+?>
+--EXPECT--
+int(11)
+int(11)
+int(11)
+int(41)
+bool(false)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/strpbrk.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/strpbrk.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/strpbrk.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- strpbrk
+--SKIPIF--
+<?php if (function_exists('strpbrk')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('strpbrk');
+
+$haystack = 'To be or not to be';
+$char_list = 'jhdn';
+
+var_dump(strpbrk($haystack, $char_list));
+?>
+--EXPECT--
+string(9) "not to be"
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/strripos.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/strripos.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/strripos.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,48 @@
+--TEST--
+Function -- strripos
+--SKIPIF--
+<?php if (function_exists('strripos')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('strripos');
+
+$haystack = 'Cat Dinner Dog Lion Mouse Sheep Wolf Cat Dog Donut';
+$needle = 'DOG';
+
+// Simple
+var_dump(strripos($haystack, $needle));
+
+// With offset
+var_dump(strripos($haystack, $needle, 3));
+var_dump(strripos($haystack, $needle, 30));
+var_dump(strripos($haystack, $needle, 50));
+var_dump(strripos($haystack, $needle, -1));
+var_dump(strripos($haystack, $needle, -10));
+var_dump(strripos($haystack, $needle, -30));
+var_dump(strripos($haystack, $needle, -50));
+
+// Test for Bug xx
+var_dump(strripos($haystack, 'How about no'));
+
+// Test for negative offset scanning bug
+var_dump(strripos('abcdef', 'bc', -5));
+var_dump(strripos('aaafrogaa', 'frog', -5));
+
+// Bug #5049
+var_dump(strripos('testing', 'test'));
+
+?>
+--EXPECT--
+int(41)
+int(41)
+int(41)
+bool(false)
+int(41)
+int(11)
+int(11)
+bool(false)
+bool(false)
+int(1)
+int(3)
+int(0)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/substr_compare.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/substr_compare.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/substr_compare.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Function -- substr_compare
+--SKIPIF--
+<?php if (function_exists('substr_compare')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('substr_compare');
+
+echo substr_compare("abcde", "bc", 1, 2), "\n";
+echo substr_compare("abcde", "bcg", 1, 2), "\n";
+echo substr_compare("abcde", "BC", 1, 2, true), "\n";
+echo substr_compare("abcde", "bc", 1, 3), "\n";
+echo substr_compare("abcde", "cd", 1, 2);
+?>
+--EXPECT--
+0
+0
+0
+1
+-1
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/time_sleep_until.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/time_sleep_until.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/time_sleep_until.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,30 @@
+--TEST--
+Function -- time_sleep_until
+--SKIPIF--
+<?php if (function_exists('time_sleep_until')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('time_sleep_until');
+
+function ehandler($no, $str)
+{
+ echo '(Warning) ';
+}
+set_error_handler('ehandler');
+
+$time = time();
+time_sleep_until($time + 3);
+echo '3:', time() - $time;
+
+echo PHP_EOL;
+
+$time = time();
+time_sleep_until($time - 1);
+echo '-1:', time() - $time;
+
+restore_error_handler();
+?>
+--EXPECT--
+3:3
+(Warning) -1:0
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/var_export.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/var_export.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/var_export.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,123 @@
+--TEST--
+Function -- var_export
+--SKIPIF--
+<?php if (function_exists('var_export')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('var_export');
+
+// Simple
+var_export(true);
+echo "\n";
+
+var_export(false);
+echo "\n";
+
+var_export(null);
+echo "\n";
+
+$fp = fopen(__FILE__, 'r');
+var_export($fp);
+fclose($fp);
+echo "\n";
+
+var_export(array(1, array(2, array(3, 4), array(5, array(6, array(7))))));
+echo "\n";
+
+$a = array (1, 2, array ("a", "b", "c"));
+var_export($a);
+echo "\n\n";
+
+// With return
+echo var_export($a, true);
+echo "\n\n";
+
+// More complex
+$a = array(
+ null => null,
+ 'O\'neil',
+ 'He said "bar" ...' => 'He said "bar" ...',
+ 'Yes \ No' =>'Yes \ No O\'neil',
+ 'foo' => null,
+ );
+var_export($a);
+echo "\n\n";
+
+// Classes
+$var = new stdClass;
+$var->foo = 'foo';
+$var->bar = 'bar';
+$var = array(array($var));
+var_export($var);
+
+?>
+--EXPECT--
+true
+false
+NULL
+NULL
+array (
+ 0 => 1,
+ 1 =>
+ array (
+ 0 => 2,
+ 1 =>
+ array (
+ 0 => 3,
+ 1 => 4,
+ ),
+ 2 =>
+ array (
+ 0 => 5,
+ 1 =>
+ array (
+ 0 => 6,
+ 1 =>
+ array (
+ 0 => 7,
+ ),
+ ),
+ ),
+ ),
+)
+array (
+ 0 => 1,
+ 1 => 2,
+ 2 =>
+ array (
+ 0 => 'a',
+ 1 => 'b',
+ 2 => 'c',
+ ),
+)
+
+array (
+ 0 => 1,
+ 1 => 2,
+ 2 =>
+ array (
+ 0 => 'a',
+ 1 => 'b',
+ 2 => 'c',
+ ),
+)
+
+array (
+ '' => NULL,
+ 0 => 'O\'neil',
+ 'He said "bar" ...' => 'He said "bar" ...',
+ 'Yes \\ No' => 'Yes \\ No O\'neil',
+ 'foo' => NULL,
+)
+
+array (
+ 0 =>
+ array (
+ 0 =>
+ class stdClass {
+ var $foo = 'foo';
+ var $bar = 'bar';
+ },
+ ),
+)
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/version_compare.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/version_compare.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/version_compare.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,615 @@
+--TEST--
+Function -- version_compare
+--SKIPIF--
+<?php if (function_exists('version_compare')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('version_compare');
+
+// Basic
+print "testing basic\n";
+test('1', '2');
+test('10', '2');
+test('1.0', '1.1');
+test('1.2', '1.0.1');
+test('1.2.p3', '1.2.4');
+test('1.2.y', '1.2.z');
+
+// Comparisons
+print "testing compare\n";
+$special_forms = array("-dev", "a1", "b1", "RC1", "", "pl1");
+$operators = array(
+ "lt", "<",
+ "le", "<=",
+ "gt", ">",
+ "ge", ">=",
+ "eq", "=", "==",
+ "ne", "<>", "!="
+);
+
+foreach ($special_forms as $f1) {
+ foreach ($special_forms as $f2) {
+ test("1.0$f1", "1.0$f2");
+ }
+}
+
+// Operators
+print "testing operators\n";
+foreach ($special_forms as $f1) {
+ foreach ($special_forms as $f2) {
+ foreach ($operators as $op) {
+ $v1 = "1.0$f1";
+ $v2 = "1.0$f2";
+ $test = version_compare($v1, $v2, $op) ? "true" : "false";
+ printf("%7s %2s %-7s : %s\n", $v1, $op, $v2, $test);
+ }
+ }
+}
+
+function test($v1, $v2) {
+ $compare = version_compare($v1, $v2);
+ switch ($compare) {
+ case -1:
+ print "$v1 < $v2\n";
+ break;
+ case 1:
+ print "$v1 > $v2\n";
+ break;
+ case 0:
+ default:
+ print "$v1 = $v2\n";
+ break;
+ }
+}
+
+?>
+testing basic
+1 < 2
+10 > 2
+1.0 < 1.1
+1.2 > 1.0.1
+1.2.p3 > 1.2.4
+1.2.y = 1.2.z
+testing compare
+1.0-dev = 1.0-dev
+1.0-dev < 1.0a1
+1.0-dev < 1.0b1
+1.0-dev < 1.0RC1
+1.0-dev < 1.0
+1.0-dev < 1.0pl1
+1.0a1 > 1.0-dev
+1.0a1 = 1.0a1
+1.0a1 < 1.0b1
+1.0a1 < 1.0RC1
+1.0a1 < 1.0
+1.0a1 < 1.0pl1
+1.0b1 > 1.0-dev
+1.0b1 > 1.0a1
+1.0b1 = 1.0b1
+1.0b1 < 1.0RC1
+1.0b1 < 1.0
+1.0b1 < 1.0pl1
+1.0RC1 > 1.0-dev
+1.0RC1 > 1.0a1
+1.0RC1 > 1.0b1
+1.0RC1 = 1.0RC1
+1.0RC1 < 1.0
+1.0RC1 < 1.0pl1
+1.0 > 1.0-dev
+1.0 > 1.0a1
+1.0 > 1.0b1
+1.0 > 1.0RC1
+1.0 = 1.0
+1.0 < 1.0pl1
+1.0pl1 > 1.0-dev
+1.0pl1 > 1.0a1
+1.0pl1 > 1.0b1
+1.0pl1 > 1.0RC1
+1.0pl1 > 1.0
+1.0pl1 = 1.0pl1
+testing operators
+1.0-dev lt 1.0-dev : false
+1.0-dev < 1.0-dev : false
+1.0-dev le 1.0-dev : true
+1.0-dev <= 1.0-dev : true
+1.0-dev gt 1.0-dev : false
+1.0-dev > 1.0-dev : false
+1.0-dev ge 1.0-dev : true
+1.0-dev >= 1.0-dev : true
+1.0-dev eq 1.0-dev : true
+1.0-dev = 1.0-dev : true
+1.0-dev == 1.0-dev : true
+1.0-dev ne 1.0-dev : false
+1.0-dev <> 1.0-dev : false
+1.0-dev != 1.0-dev : false
+1.0-dev lt 1.0a1 : true
+1.0-dev < 1.0a1 : true
+1.0-dev le 1.0a1 : true
+1.0-dev <= 1.0a1 : true
+1.0-dev gt 1.0a1 : false
+1.0-dev > 1.0a1 : false
+1.0-dev ge 1.0a1 : false
+1.0-dev >= 1.0a1 : false
+1.0-dev eq 1.0a1 : false
+1.0-dev = 1.0a1 : false
+1.0-dev == 1.0a1 : false
+1.0-dev ne 1.0a1 : true
+1.0-dev <> 1.0a1 : true
+1.0-dev != 1.0a1 : true
+1.0-dev lt 1.0b1 : true
+1.0-dev < 1.0b1 : true
+1.0-dev le 1.0b1 : true
+1.0-dev <= 1.0b1 : true
+1.0-dev gt 1.0b1 : false
+1.0-dev > 1.0b1 : false
+1.0-dev ge 1.0b1 : false
+1.0-dev >= 1.0b1 : false
+1.0-dev eq 1.0b1 : false
+1.0-dev = 1.0b1 : false
+1.0-dev == 1.0b1 : false
+1.0-dev ne 1.0b1 : true
+1.0-dev <> 1.0b1 : true
+1.0-dev != 1.0b1 : true
+1.0-dev lt 1.0RC1 : true
+1.0-dev < 1.0RC1 : true
+1.0-dev le 1.0RC1 : true
+1.0-dev <= 1.0RC1 : true
+1.0-dev gt 1.0RC1 : false
+1.0-dev > 1.0RC1 : false
+1.0-dev ge 1.0RC1 : false
+1.0-dev >= 1.0RC1 : false
+1.0-dev eq 1.0RC1 : false
+1.0-dev = 1.0RC1 : false
+1.0-dev == 1.0RC1 : false
+1.0-dev ne 1.0RC1 : true
+1.0-dev <> 1.0RC1 : true
+1.0-dev != 1.0RC1 : true
+1.0-dev lt 1.0 : true
+1.0-dev < 1.0 : true
+1.0-dev le 1.0 : true
+1.0-dev <= 1.0 : true
+1.0-dev gt 1.0 : false
+1.0-dev > 1.0 : false
+1.0-dev ge 1.0 : false
+1.0-dev >= 1.0 : false
+1.0-dev eq 1.0 : false
+1.0-dev = 1.0 : false
+1.0-dev == 1.0 : false
+1.0-dev ne 1.0 : true
+1.0-dev <> 1.0 : true
+1.0-dev != 1.0 : true
+1.0-dev lt 1.0pl1 : true
+1.0-dev < 1.0pl1 : true
+1.0-dev le 1.0pl1 : true
+1.0-dev <= 1.0pl1 : true
+1.0-dev gt 1.0pl1 : false
+1.0-dev > 1.0pl1 : false
+1.0-dev ge 1.0pl1 : false
+1.0-dev >= 1.0pl1 : false
+1.0-dev eq 1.0pl1 : false
+1.0-dev = 1.0pl1 : false
+1.0-dev == 1.0pl1 : false
+1.0-dev ne 1.0pl1 : true
+1.0-dev <> 1.0pl1 : true
+1.0-dev != 1.0pl1 : true
+ 1.0a1 lt 1.0-dev : false
+ 1.0a1 < 1.0-dev : false
+ 1.0a1 le 1.0-dev : false
+ 1.0a1 <= 1.0-dev : false
+ 1.0a1 gt 1.0-dev : true
+ 1.0a1 > 1.0-dev : true
+ 1.0a1 ge 1.0-dev : true
+ 1.0a1 >= 1.0-dev : true
+ 1.0a1 eq 1.0-dev : false
+ 1.0a1 = 1.0-dev : false
+ 1.0a1 == 1.0-dev : false
+ 1.0a1 ne 1.0-dev : true
+ 1.0a1 <> 1.0-dev : true
+ 1.0a1 != 1.0-dev : true
+ 1.0a1 lt 1.0a1 : false
+ 1.0a1 < 1.0a1 : false
+ 1.0a1 le 1.0a1 : true
+ 1.0a1 <= 1.0a1 : true
+ 1.0a1 gt 1.0a1 : false
+ 1.0a1 > 1.0a1 : false
+ 1.0a1 ge 1.0a1 : true
+ 1.0a1 >= 1.0a1 : true
+ 1.0a1 eq 1.0a1 : true
+ 1.0a1 = 1.0a1 : true
+ 1.0a1 == 1.0a1 : true
+ 1.0a1 ne 1.0a1 : false
+ 1.0a1 <> 1.0a1 : false
+ 1.0a1 != 1.0a1 : false
+ 1.0a1 lt 1.0b1 : true
+ 1.0a1 < 1.0b1 : true
+ 1.0a1 le 1.0b1 : true
+ 1.0a1 <= 1.0b1 : true
+ 1.0a1 gt 1.0b1 : false
+ 1.0a1 > 1.0b1 : false
+ 1.0a1 ge 1.0b1 : false
+ 1.0a1 >= 1.0b1 : false
+ 1.0a1 eq 1.0b1 : false
+ 1.0a1 = 1.0b1 : false
+ 1.0a1 == 1.0b1 : false
+ 1.0a1 ne 1.0b1 : true
+ 1.0a1 <> 1.0b1 : true
+ 1.0a1 != 1.0b1 : true
+ 1.0a1 lt 1.0RC1 : true
+ 1.0a1 < 1.0RC1 : true
+ 1.0a1 le 1.0RC1 : true
+ 1.0a1 <= 1.0RC1 : true
+ 1.0a1 gt 1.0RC1 : false
+ 1.0a1 > 1.0RC1 : false
+ 1.0a1 ge 1.0RC1 : false
+ 1.0a1 >= 1.0RC1 : false
+ 1.0a1 eq 1.0RC1 : false
+ 1.0a1 = 1.0RC1 : false
+ 1.0a1 == 1.0RC1 : false
+ 1.0a1 ne 1.0RC1 : true
+ 1.0a1 <> 1.0RC1 : true
+ 1.0a1 != 1.0RC1 : true
+ 1.0a1 lt 1.0 : true
+ 1.0a1 < 1.0 : true
+ 1.0a1 le 1.0 : true
+ 1.0a1 <= 1.0 : true
+ 1.0a1 gt 1.0 : false
+ 1.0a1 > 1.0 : false
+ 1.0a1 ge 1.0 : false
+ 1.0a1 >= 1.0 : false
+ 1.0a1 eq 1.0 : false
+ 1.0a1 = 1.0 : false
+ 1.0a1 == 1.0 : false
+ 1.0a1 ne 1.0 : true
+ 1.0a1 <> 1.0 : true
+ 1.0a1 != 1.0 : true
+ 1.0a1 lt 1.0pl1 : true
+ 1.0a1 < 1.0pl1 : true
+ 1.0a1 le 1.0pl1 : true
+ 1.0a1 <= 1.0pl1 : true
+ 1.0a1 gt 1.0pl1 : false
+ 1.0a1 > 1.0pl1 : false
+ 1.0a1 ge 1.0pl1 : false
+ 1.0a1 >= 1.0pl1 : false
+ 1.0a1 eq 1.0pl1 : false
+ 1.0a1 = 1.0pl1 : false
+ 1.0a1 == 1.0pl1 : false
+ 1.0a1 ne 1.0pl1 : true
+ 1.0a1 <> 1.0pl1 : true
+ 1.0a1 != 1.0pl1 : true
+ 1.0b1 lt 1.0-dev : false
+ 1.0b1 < 1.0-dev : false
+ 1.0b1 le 1.0-dev : false
+ 1.0b1 <= 1.0-dev : false
+ 1.0b1 gt 1.0-dev : true
+ 1.0b1 > 1.0-dev : true
+ 1.0b1 ge 1.0-dev : true
+ 1.0b1 >= 1.0-dev : true
+ 1.0b1 eq 1.0-dev : false
+ 1.0b1 = 1.0-dev : false
+ 1.0b1 == 1.0-dev : false
+ 1.0b1 ne 1.0-dev : true
+ 1.0b1 <> 1.0-dev : true
+ 1.0b1 != 1.0-dev : true
+ 1.0b1 lt 1.0a1 : false
+ 1.0b1 < 1.0a1 : false
+ 1.0b1 le 1.0a1 : false
+ 1.0b1 <= 1.0a1 : false
+ 1.0b1 gt 1.0a1 : true
+ 1.0b1 > 1.0a1 : true
+ 1.0b1 ge 1.0a1 : true
+ 1.0b1 >= 1.0a1 : true
+ 1.0b1 eq 1.0a1 : false
+ 1.0b1 = 1.0a1 : false
+ 1.0b1 == 1.0a1 : false
+ 1.0b1 ne 1.0a1 : true
+ 1.0b1 <> 1.0a1 : true
+ 1.0b1 != 1.0a1 : true
+ 1.0b1 lt 1.0b1 : false
+ 1.0b1 < 1.0b1 : false
+ 1.0b1 le 1.0b1 : true
+ 1.0b1 <= 1.0b1 : true
+ 1.0b1 gt 1.0b1 : false
+ 1.0b1 > 1.0b1 : false
+ 1.0b1 ge 1.0b1 : true
+ 1.0b1 >= 1.0b1 : true
+ 1.0b1 eq 1.0b1 : true
+ 1.0b1 = 1.0b1 : true
+ 1.0b1 == 1.0b1 : true
+ 1.0b1 ne 1.0b1 : false
+ 1.0b1 <> 1.0b1 : false
+ 1.0b1 != 1.0b1 : false
+ 1.0b1 lt 1.0RC1 : true
+ 1.0b1 < 1.0RC1 : true
+ 1.0b1 le 1.0RC1 : true
+ 1.0b1 <= 1.0RC1 : true
+ 1.0b1 gt 1.0RC1 : false
+ 1.0b1 > 1.0RC1 : false
+ 1.0b1 ge 1.0RC1 : false
+ 1.0b1 >= 1.0RC1 : false
+ 1.0b1 eq 1.0RC1 : false
+ 1.0b1 = 1.0RC1 : false
+ 1.0b1 == 1.0RC1 : false
+ 1.0b1 ne 1.0RC1 : true
+ 1.0b1 <> 1.0RC1 : true
+ 1.0b1 != 1.0RC1 : true
+ 1.0b1 lt 1.0 : true
+ 1.0b1 < 1.0 : true
+ 1.0b1 le 1.0 : true
+ 1.0b1 <= 1.0 : true
+ 1.0b1 gt 1.0 : false
+ 1.0b1 > 1.0 : false
+ 1.0b1 ge 1.0 : false
+ 1.0b1 >= 1.0 : false
+ 1.0b1 eq 1.0 : false
+ 1.0b1 = 1.0 : false
+ 1.0b1 == 1.0 : false
+ 1.0b1 ne 1.0 : true
+ 1.0b1 <> 1.0 : true
+ 1.0b1 != 1.0 : true
+ 1.0b1 lt 1.0pl1 : true
+ 1.0b1 < 1.0pl1 : true
+ 1.0b1 le 1.0pl1 : true
+ 1.0b1 <= 1.0pl1 : true
+ 1.0b1 gt 1.0pl1 : false
+ 1.0b1 > 1.0pl1 : false
+ 1.0b1 ge 1.0pl1 : false
+ 1.0b1 >= 1.0pl1 : false
+ 1.0b1 eq 1.0pl1 : false
+ 1.0b1 = 1.0pl1 : false
+ 1.0b1 == 1.0pl1 : false
+ 1.0b1 ne 1.0pl1 : true
+ 1.0b1 <> 1.0pl1 : true
+ 1.0b1 != 1.0pl1 : true
+ 1.0RC1 lt 1.0-dev : false
+ 1.0RC1 < 1.0-dev : false
+ 1.0RC1 le 1.0-dev : false
+ 1.0RC1 <= 1.0-dev : false
+ 1.0RC1 gt 1.0-dev : true
+ 1.0RC1 > 1.0-dev : true
+ 1.0RC1 ge 1.0-dev : true
+ 1.0RC1 >= 1.0-dev : true
+ 1.0RC1 eq 1.0-dev : false
+ 1.0RC1 = 1.0-dev : false
+ 1.0RC1 == 1.0-dev : false
+ 1.0RC1 ne 1.0-dev : true
+ 1.0RC1 <> 1.0-dev : true
+ 1.0RC1 != 1.0-dev : true
+ 1.0RC1 lt 1.0a1 : false
+ 1.0RC1 < 1.0a1 : false
+ 1.0RC1 le 1.0a1 : false
+ 1.0RC1 <= 1.0a1 : false
+ 1.0RC1 gt 1.0a1 : true
+ 1.0RC1 > 1.0a1 : true
+ 1.0RC1 ge 1.0a1 : true
+ 1.0RC1 >= 1.0a1 : true
+ 1.0RC1 eq 1.0a1 : false
+ 1.0RC1 = 1.0a1 : false
+ 1.0RC1 == 1.0a1 : false
+ 1.0RC1 ne 1.0a1 : true
+ 1.0RC1 <> 1.0a1 : true
+ 1.0RC1 != 1.0a1 : true
+ 1.0RC1 lt 1.0b1 : false
+ 1.0RC1 < 1.0b1 : false
+ 1.0RC1 le 1.0b1 : false
+ 1.0RC1 <= 1.0b1 : false
+ 1.0RC1 gt 1.0b1 : true
+ 1.0RC1 > 1.0b1 : true
+ 1.0RC1 ge 1.0b1 : true
+ 1.0RC1 >= 1.0b1 : true
+ 1.0RC1 eq 1.0b1 : false
+ 1.0RC1 = 1.0b1 : false
+ 1.0RC1 == 1.0b1 : false
+ 1.0RC1 ne 1.0b1 : true
+ 1.0RC1 <> 1.0b1 : true
+ 1.0RC1 != 1.0b1 : true
+ 1.0RC1 lt 1.0RC1 : false
+ 1.0RC1 < 1.0RC1 : false
+ 1.0RC1 le 1.0RC1 : true
+ 1.0RC1 <= 1.0RC1 : true
+ 1.0RC1 gt 1.0RC1 : false
+ 1.0RC1 > 1.0RC1 : false
+ 1.0RC1 ge 1.0RC1 : true
+ 1.0RC1 >= 1.0RC1 : true
+ 1.0RC1 eq 1.0RC1 : true
+ 1.0RC1 = 1.0RC1 : true
+ 1.0RC1 == 1.0RC1 : true
+ 1.0RC1 ne 1.0RC1 : false
+ 1.0RC1 <> 1.0RC1 : false
+ 1.0RC1 != 1.0RC1 : false
+ 1.0RC1 lt 1.0 : true
+ 1.0RC1 < 1.0 : true
+ 1.0RC1 le 1.0 : true
+ 1.0RC1 <= 1.0 : true
+ 1.0RC1 gt 1.0 : false
+ 1.0RC1 > 1.0 : false
+ 1.0RC1 ge 1.0 : false
+ 1.0RC1 >= 1.0 : false
+ 1.0RC1 eq 1.0 : false
+ 1.0RC1 = 1.0 : false
+ 1.0RC1 == 1.0 : false
+ 1.0RC1 ne 1.0 : true
+ 1.0RC1 <> 1.0 : true
+ 1.0RC1 != 1.0 : true
+ 1.0RC1 lt 1.0pl1 : true
+ 1.0RC1 < 1.0pl1 : true
+ 1.0RC1 le 1.0pl1 : true
+ 1.0RC1 <= 1.0pl1 : true
+ 1.0RC1 gt 1.0pl1 : false
+ 1.0RC1 > 1.0pl1 : false
+ 1.0RC1 ge 1.0pl1 : false
+ 1.0RC1 >= 1.0pl1 : false
+ 1.0RC1 eq 1.0pl1 : false
+ 1.0RC1 = 1.0pl1 : false
+ 1.0RC1 == 1.0pl1 : false
+ 1.0RC1 ne 1.0pl1 : true
+ 1.0RC1 <> 1.0pl1 : true
+ 1.0RC1 != 1.0pl1 : true
+ 1.0 lt 1.0-dev : false
+ 1.0 < 1.0-dev : false
+ 1.0 le 1.0-dev : false
+ 1.0 <= 1.0-dev : false
+ 1.0 gt 1.0-dev : true
+ 1.0 > 1.0-dev : true
+ 1.0 ge 1.0-dev : true
+ 1.0 >= 1.0-dev : true
+ 1.0 eq 1.0-dev : false
+ 1.0 = 1.0-dev : false
+ 1.0 == 1.0-dev : false
+ 1.0 ne 1.0-dev : true
+ 1.0 <> 1.0-dev : true
+ 1.0 != 1.0-dev : true
+ 1.0 lt 1.0a1 : false
+ 1.0 < 1.0a1 : false
+ 1.0 le 1.0a1 : false
+ 1.0 <= 1.0a1 : false
+ 1.0 gt 1.0a1 : true
+ 1.0 > 1.0a1 : true
+ 1.0 ge 1.0a1 : true
+ 1.0 >= 1.0a1 : true
+ 1.0 eq 1.0a1 : false
+ 1.0 = 1.0a1 : false
+ 1.0 == 1.0a1 : false
+ 1.0 ne 1.0a1 : true
+ 1.0 <> 1.0a1 : true
+ 1.0 != 1.0a1 : true
+ 1.0 lt 1.0b1 : false
+ 1.0 < 1.0b1 : false
+ 1.0 le 1.0b1 : false
+ 1.0 <= 1.0b1 : false
+ 1.0 gt 1.0b1 : true
+ 1.0 > 1.0b1 : true
+ 1.0 ge 1.0b1 : true
+ 1.0 >= 1.0b1 : true
+ 1.0 eq 1.0b1 : false
+ 1.0 = 1.0b1 : false
+ 1.0 == 1.0b1 : false
+ 1.0 ne 1.0b1 : true
+ 1.0 <> 1.0b1 : true
+ 1.0 != 1.0b1 : true
+ 1.0 lt 1.0RC1 : false
+ 1.0 < 1.0RC1 : false
+ 1.0 le 1.0RC1 : false
+ 1.0 <= 1.0RC1 : false
+ 1.0 gt 1.0RC1 : true
+ 1.0 > 1.0RC1 : true
+ 1.0 ge 1.0RC1 : true
+ 1.0 >= 1.0RC1 : true
+ 1.0 eq 1.0RC1 : false
+ 1.0 = 1.0RC1 : false
+ 1.0 == 1.0RC1 : false
+ 1.0 ne 1.0RC1 : true
+ 1.0 <> 1.0RC1 : true
+ 1.0 != 1.0RC1 : true
+ 1.0 lt 1.0 : false
+ 1.0 < 1.0 : false
+ 1.0 le 1.0 : true
+ 1.0 <= 1.0 : true
+ 1.0 gt 1.0 : false
+ 1.0 > 1.0 : false
+ 1.0 ge 1.0 : true
+ 1.0 >= 1.0 : true
+ 1.0 eq 1.0 : true
+ 1.0 = 1.0 : true
+ 1.0 == 1.0 : true
+ 1.0 ne 1.0 : false
+ 1.0 <> 1.0 : false
+ 1.0 != 1.0 : false
+ 1.0 lt 1.0pl1 : true
+ 1.0 < 1.0pl1 : true
+ 1.0 le 1.0pl1 : true
+ 1.0 <= 1.0pl1 : true
+ 1.0 gt 1.0pl1 : false
+ 1.0 > 1.0pl1 : false
+ 1.0 ge 1.0pl1 : false
+ 1.0 >= 1.0pl1 : false
+ 1.0 eq 1.0pl1 : false
+ 1.0 = 1.0pl1 : false
+ 1.0 == 1.0pl1 : false
+ 1.0 ne 1.0pl1 : true
+ 1.0 <> 1.0pl1 : true
+ 1.0 != 1.0pl1 : true
+ 1.0pl1 lt 1.0-dev : false
+ 1.0pl1 < 1.0-dev : false
+ 1.0pl1 le 1.0-dev : false
+ 1.0pl1 <= 1.0-dev : false
+ 1.0pl1 gt 1.0-dev : true
+ 1.0pl1 > 1.0-dev : true
+ 1.0pl1 ge 1.0-dev : true
+ 1.0pl1 >= 1.0-dev : true
+ 1.0pl1 eq 1.0-dev : false
+ 1.0pl1 = 1.0-dev : false
+ 1.0pl1 == 1.0-dev : false
+ 1.0pl1 ne 1.0-dev : true
+ 1.0pl1 <> 1.0-dev : true
+ 1.0pl1 != 1.0-dev : true
+ 1.0pl1 lt 1.0a1 : false
+ 1.0pl1 < 1.0a1 : false
+ 1.0pl1 le 1.0a1 : false
+ 1.0pl1 <= 1.0a1 : false
+ 1.0pl1 gt 1.0a1 : true
+ 1.0pl1 > 1.0a1 : true
+ 1.0pl1 ge 1.0a1 : true
+ 1.0pl1 >= 1.0a1 : true
+ 1.0pl1 eq 1.0a1 : false
+ 1.0pl1 = 1.0a1 : false
+ 1.0pl1 == 1.0a1 : false
+ 1.0pl1 ne 1.0a1 : true
+ 1.0pl1 <> 1.0a1 : true
+ 1.0pl1 != 1.0a1 : true
+ 1.0pl1 lt 1.0b1 : false
+ 1.0pl1 < 1.0b1 : false
+ 1.0pl1 le 1.0b1 : false
+ 1.0pl1 <= 1.0b1 : false
+ 1.0pl1 gt 1.0b1 : true
+ 1.0pl1 > 1.0b1 : true
+ 1.0pl1 ge 1.0b1 : true
+ 1.0pl1 >= 1.0b1 : true
+ 1.0pl1 eq 1.0b1 : false
+ 1.0pl1 = 1.0b1 : false
+ 1.0pl1 == 1.0b1 : false
+ 1.0pl1 ne 1.0b1 : true
+ 1.0pl1 <> 1.0b1 : true
+ 1.0pl1 != 1.0b1 : true
+ 1.0pl1 lt 1.0RC1 : false
+ 1.0pl1 < 1.0RC1 : false
+ 1.0pl1 le 1.0RC1 : false
+ 1.0pl1 <= 1.0RC1 : false
+ 1.0pl1 gt 1.0RC1 : true
+ 1.0pl1 > 1.0RC1 : true
+ 1.0pl1 ge 1.0RC1 : true
+ 1.0pl1 >= 1.0RC1 : true
+ 1.0pl1 eq 1.0RC1 : false
+ 1.0pl1 = 1.0RC1 : false
+ 1.0pl1 == 1.0RC1 : false
+ 1.0pl1 ne 1.0RC1 : true
+ 1.0pl1 <> 1.0RC1 : true
+ 1.0pl1 != 1.0RC1 : true
+ 1.0pl1 lt 1.0 : false
+ 1.0pl1 < 1.0 : false
+ 1.0pl1 le 1.0 : false
+ 1.0pl1 <= 1.0 : false
+ 1.0pl1 gt 1.0 : true
+ 1.0pl1 > 1.0 : true
+ 1.0pl1 ge 1.0 : true
+ 1.0pl1 >= 1.0 : true
+ 1.0pl1 eq 1.0 : false
+ 1.0pl1 = 1.0 : false
+ 1.0pl1 == 1.0 : false
+ 1.0pl1 ne 1.0 : true
+ 1.0pl1 <> 1.0 : true
+ 1.0pl1 != 1.0 : true
+ 1.0pl1 lt 1.0pl1 : false
+ 1.0pl1 < 1.0pl1 : false
+ 1.0pl1 le 1.0pl1 : true
+ 1.0pl1 <= 1.0pl1 : true
+ 1.0pl1 gt 1.0pl1 : false
+ 1.0pl1 > 1.0pl1 : false
+ 1.0pl1 ge 1.0pl1 : true
+ 1.0pl1 >= 1.0pl1 : true
+ 1.0pl1 eq 1.0pl1 : true
+ 1.0pl1 = 1.0pl1 : true
+ 1.0pl1 == 1.0pl1 : true
+ 1.0pl1 ne 1.0pl1 : false
+ 1.0pl1 <> 1.0pl1 : false
+ 1.0pl1 != 1.0pl1 : false
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/vprintf.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/vprintf.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/vprintf.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- vprintf
+--SKIPIF--
+<?php if (function_exists('vprintf')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('vprintf');
+
+$values = array (2, 'car');
+
+$format = "There are %d monkeys in the %s";
+vprintf($format, $values);
+?>
+--EXPECT--
+There are 2 monkeys in the car
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/function/vsprintf.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/function/vsprintf.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/function/vsprintf.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,16 @@
+--TEST--
+Function -- vsprintf
+--SKIPIF--
+<?php if (function_exists('vsprintf')) { echo 'skip'; } ?>
+--FILE--
+<?php
+require_once 'PHP/Compat.php';
+PHP_Compat::loadFunction('vsprintf');
+
+$values = array (2, 'car');
+
+$format = "There are %d monkeys in the %s";
+vprintf($format, $values);
+?>
+--EXPECT--
+There are 2 monkeys in the car
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/loadconstant.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/loadconstant.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/loadconstant.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,25 @@
+--TEST--
+Method -- PHP_Compat::loadConstant
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+
+// Singular
+echo (PHP_Compat::loadConstant('invalid') === false) ? 'false' : 'true', "\n";
+
+// Multiple
+$comp = array('an-invalid', 'also-invalid', 'more-invalid', 'E_STRICT');
+$results = PHP_Compat::loadConstant($comp);
+
+foreach ($results as $comp => $result) {
+ echo $comp . ': ';
+ echo ($result === false) ? 'false' : 'true', "\n";
+}
+
+?>
+--EXPECT--
+false
+an-invalid: false
+also-invalid: false
+more-invalid: false
+E_STRICT: true
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/loadfunction.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/loadfunction.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/loadfunction.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,24 @@
+--TEST--
+Method -- PHP_Compat::loadFunction
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+
+// Singular
+echo (PHP_Compat::loadFunction('invalid') === false) ? 'false' : 'true', "\n";
+
+// Multiple
+$comp = array('an-invalid', 'also-invalid', 'more-invalid');
+$results = PHP_Compat::loadFunction($comp);
+
+foreach ($results as $comp => $result) {
+ echo $comp . ': ';
+ echo ($result === false) ? 'false' : 'true', "\n";
+}
+
+?>
+--EXPECT--
+false
+an-invalid: false
+also-invalid: false
+more-invalid: false
\ No newline at end of file
追加: branches/version-2_5-dev/data/module/Compat/tests/loadversion.phpt
===================================================================
--- branches/version-2_5-dev/data/module/Compat/tests/loadversion.phpt (rev 0)
+++ branches/version-2_5-dev/data/module/Compat/tests/loadversion.phpt 2010-12-30 07:59:42 UTC (rev 19792)
@@ -0,0 +1,21 @@
+--TEST--
+Method -- PHP_Compat::loadVersion
+--FILE--
+<?php
+require_once ('PHP/Compat.php');
+
+// Rather useless tests
+$res = PHP_Compat::loadVersion('3.0.0');
+var_dump(is_array($res));
+
+$res = PHP_Compat::loadVersion('9.0.0');
+var_dump(is_array($res));
+
+$res = PHP_Compat::loadVersion();
+var_dump(is_array($res));
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
\ No newline at end of file
Svn-src-all メーリングリストの案内