From 507151aec89ae799e1b43b2a17d9e96f9e79d307 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 23 Nov 2006 21:06:13 +0000 Subject: [PATCH] Removed unneeded PEAR directories, part of #2020 --- .../src/docs/Archive_Tar/docs/Archive_Tar.txt | 461 ------ .../tools/pear/src/docs/Calendar/docs/Readme | 3 - .../src/docs/Calendar/docs/examples/1.php | 92 -- .../src/docs/Calendar/docs/examples/1.phps | 92 -- .../src/docs/Calendar/docs/examples/10.php | 93 -- .../src/docs/Calendar/docs/examples/10.phps | 93 -- .../src/docs/Calendar/docs/examples/11.php | 109 -- .../src/docs/Calendar/docs/examples/11.phps | 109 -- .../src/docs/Calendar/docs/examples/12.php | 116 -- .../src/docs/Calendar/docs/examples/12.phps | 116 -- .../src/docs/Calendar/docs/examples/13.php | 99 -- .../src/docs/Calendar/docs/examples/13.phps | 99 -- .../src/docs/Calendar/docs/examples/14.php | 141 -- .../src/docs/Calendar/docs/examples/14.phps | 141 -- .../src/docs/Calendar/docs/examples/15.php | 58 - .../src/docs/Calendar/docs/examples/15.phps | 58 - .../src/docs/Calendar/docs/examples/16.php | 31 - .../src/docs/Calendar/docs/examples/16.phps | 31 - .../src/docs/Calendar/docs/examples/17.php | 71 - .../src/docs/Calendar/docs/examples/17.phps | 71 - .../src/docs/Calendar/docs/examples/18.php | 36 - .../src/docs/Calendar/docs/examples/18.phps | 36 - .../src/docs/Calendar/docs/examples/19.php | 24 - .../src/docs/Calendar/docs/examples/19.phps | 24 - .../src/docs/Calendar/docs/examples/2.php | 142 -- .../src/docs/Calendar/docs/examples/2.phps | 142 -- .../src/docs/Calendar/docs/examples/20.php | 240 --- .../src/docs/Calendar/docs/examples/20.phps | 240 --- .../src/docs/Calendar/docs/examples/21.php | 139 -- .../src/docs/Calendar/docs/examples/21.phps | 139 -- .../src/docs/Calendar/docs/examples/22.php | 46 - .../src/docs/Calendar/docs/examples/22.phps | 46 - .../src/docs/Calendar/docs/examples/23.php | 66 - .../src/docs/Calendar/docs/examples/23.phps | 66 - .../src/docs/Calendar/docs/examples/3.php | 134 -- .../src/docs/Calendar/docs/examples/3.phps | 134 -- .../src/docs/Calendar/docs/examples/4.php | 49 - .../src/docs/Calendar/docs/examples/4.phps | 49 - .../src/docs/Calendar/docs/examples/5.php | 132 -- .../src/docs/Calendar/docs/examples/5.phps | 132 -- .../src/docs/Calendar/docs/examples/6.php | 210 --- .../src/docs/Calendar/docs/examples/6.phps | 210 --- .../src/docs/Calendar/docs/examples/7.php | 92 -- .../src/docs/Calendar/docs/examples/7.phps | 92 -- .../src/docs/Calendar/docs/examples/8.php | 70 - .../src/docs/Calendar/docs/examples/8.phps | 70 - .../src/docs/Calendar/docs/examples/9.php | 16 - .../src/docs/Calendar/docs/examples/9.phps | 16 - .../docs/Calendar/docs/examples/index.html | 49 - .../src/tools/pear/src/docs/DB/doc/IDEAS | 90 -- .../tools/pear/src/docs/DB/doc/MAINTAINERS | 16 - .../src/tools/pear/src/docs/DB/doc/STATUS | 93 -- .../src/tools/pear/src/docs/DB/doc/TESTERS | 156 -- .../src/docs/HTML_QuickForm/docs/elements.php | 154 -- .../src/docs/HTML_QuickForm/docs/filters.php | 61 - .../src/docs/HTML_QuickForm/docs/formrule.php | 101 -- .../src/docs/HTML_QuickForm/docs/groups.php | 95 -- .../docs/renderers/FlexyDynamic_example.php | 112 -- .../docs/renderers/FlexyStatic_example.php | 148 -- .../docs/renderers/ITDynamic_example.php | 96 -- .../docs/renderers/ITDynamic_example2.php | 119 -- .../docs/renderers/ITStatic_example.php | 111 -- .../docs/renderers/QuickHtml_example.php | 146 -- .../docs/renderers/SmartyDynamic_example.php | 108 -- .../docs/renderers/SmartyStatic_example.php | 137 -- .../docs/renderers/multiple-labels.php | 46 - .../renderers/templates/flexy-dynamic.html | 129 -- .../renderers/templates/flexy-static.html | 154 -- .../docs/renderers/templates/html.html | 4 - .../renderers/templates/it-dynamic-2.html | 110 -- .../docs/renderers/templates/it-dynamic.html | 127 -- .../docs/renderers/templates/it-static.html | 102 -- .../docs/renderers/templates/label.html | 4 - .../templates/smarty-dynamic-fancygroup.tpl | 28 - .../templates/smarty-dynamic-green.tpl | 9 - .../renderers/templates/smarty-dynamic.tpl | 134 -- .../renderers/templates/smarty-static.tpl | 156 -- .../templates/styles/fancygroup.html | 30 - .../renderers/templates/styles/green.html | 10 - .../HTML_QuickForm/docs/rules-builtin.php | 87 -- .../docs/HTML_QuickForm/docs/rules-custom.php | 107 -- .../docs/XML_Beautifier/examples/example1.php | 31 - .../docs/XML_Beautifier/examples/example2.php | 30 - .../docs/XML_Beautifier/examples/example3.php | 36 - .../docs/XML_Beautifier/examples/example4.php | 33 - .../docs/XML_Beautifier/examples/example5.php | 37 - .../docs/XML_Beautifier/examples/example6.php | 29 - .../src/docs/XML_Beautifier/examples/test.xml | 46 - .../XML_Parser/examples/xml_parser_file.php | 54 - .../XML_Parser/examples/xml_parser_file.xml | 5 - .../examples/xml_parser_handler.php | 50 - .../examples/xml_parser_simple1.php | 50 - .../examples/xml_parser_simple1.xml | 9 - .../examples/xml_parser_simple2.php | 59 - .../examples/xml_parser_simple2.xml | 5 - .../examples/xml_parser_simple_handler.php | 56 - .../docs/XML_Serializer/examples/example.xml | 6 - .../examples/serializeAndEncode.php | 52 - .../examples/serializeAndReturn.php | 27 - .../examples/serializeArrayWithObjects.php | 47 - .../examples/serializeEmptyArray.php | 27 - .../examples/serializeIndexedArray.php | 60 - .../examples/serializeObject.php | 43 - .../XML_Serializer/examples/serializeRDF.php | 64 - .../examples/serializeWithAttributes.php | 48 - .../examples/serializeWithAttributes2.php | 47 - .../examples/serializeWithDtd.php | 33 - .../serializeWithIndentedAttributes.php | 51 - .../examples/serializeWithNamespace.php | 50 - .../examples/serializeWithTagMap.php | 81 - .../examples/unserializeAnyXML.php | 81 - .../examples/unserializeClassNames.php | 57 - .../examples/unserializeEncoded.php | 40 - .../examples/unserializeEnum.php | 61 - .../examples/unserializeObject.php | 58 - .../examples/unserializeRDF.php | 93 -- .../examples/unserializeWithAttributes.php | 33 - .../src/docs/XML_Util/examples/example.php | 228 --- .../src/docs/XML_Util/examples/example2.php | 95 -- campcaster/src/tools/pear/src/package.dtd | 103 -- campcaster/src/tools/pear/src/pearcmd.php | 437 ------ campcaster/src/tools/pear/src/peclcmd.php | 45 - .../src/tools/pear/src/scripts/pearcmd.php | 6 +- .../src/tools/pear/src/scripts/peclcmd.php | 4 +- campcaster/src/tools/pear/src/template.spec | 72 - .../pear/src/tests/Calendar/tests/README | 7 - .../src/tests/Calendar/tests/all_tests.php | 34 - .../Calendar/tests/calendar_engine_tests.php | 20 - .../tests/Calendar/tests/calendar_include.php | 28 - .../Calendar/tests/calendar_tabular_tests.php | 21 - .../tests/Calendar/tests/calendar_test.php | 115 -- .../tests/Calendar/tests/calendar_tests.php | 25 - .../src/tests/Calendar/tests/day_test.php | 107 -- .../tests/Calendar/tests/decorator_test.php | 268 ---- .../tests/Calendar/tests/decorator_tests.php | 21 - .../Calendar/tests/decorator_textual_test.php | 174 --- .../Calendar/tests/decorator_uri_test.php | 37 - .../src/tests/Calendar/tests/helper_test.php | 83 - .../src/tests/Calendar/tests/hour_test.php | 98 -- .../src/tests/Calendar/tests/minute_test.php | 99 -- .../src/tests/Calendar/tests/month_test.php | 119 -- .../Calendar/tests/month_weekdays_test.php | 130 -- .../tests/Calendar/tests/month_weeks_test.php | 125 -- .../Calendar/tests/peardate_engine_test.php | 124 -- .../src/tests/Calendar/tests/second_test.php | 34 - .../tests/Calendar/tests/simple_include.php | 10 - .../Calendar/tests/table_helper_tests.php | 19 - .../Calendar/tests/unixts_engine_test.php | 104 -- .../src/tests/Calendar/tests/util_tests.php | 20 - .../Calendar/tests/util_textual_test.php | 191 --- .../tests/Calendar/tests/util_uri_test.php | 54 - .../Calendar/tests/validator_error_test.php | 34 - .../tests/Calendar/tests/validator_tests.php | 20 - .../Calendar/tests/validator_unit_test.php | 210 --- .../src/tests/Calendar/tests/week_test.php | 214 --- .../src/tests/Calendar/tests/year_test.php | 142 -- .../pear/src/tests/DB/tests/db_error.phpt | 79 - .../pear/src/tests/DB/tests/db_error2.phpt | 92 -- .../pear/src/tests/DB/tests/db_factory.phpt | 53 - .../pear/src/tests/DB/tests/db_ismanip.phpt | 57 - .../pear/src/tests/DB/tests/db_parsedsn.phpt | 480 ------ .../src/tests/DB/tests/driver/01connect.phpt | 76 - .../src/tests/DB/tests/driver/02fetch.phpt | 40 - .../tests/DB/tests/driver/03simplequery.phpt | 13 - .../src/tests/DB/tests/driver/04numcols.phpt | 16 - .../tests/DB/tests/driver/05sequences.phpt | 28 - .../src/tests/DB/tests/driver/06prepexec.phpt | 50 - .../tests/DB/tests/driver/08affectedrows.phpt | 62 - .../src/tests/DB/tests/driver/09numrows.phpt | 22 - .../src/tests/DB/tests/driver/10errormap.phpt | 37 - .../tests/DB/tests/driver/11transactions.phpt | 26 - .../src/tests/DB/tests/driver/13limit.phpt | 54 - .../DB/tests/driver/14fetchmode_object.phpt | 24 - .../src/tests/DB/tests/driver/15quote.phpt | 273 ---- .../tests/DB/tests/driver/16tableinfo.phpt | 1340 ----------------- .../src/tests/DB/tests/driver/17query.phpt | 140 -- .../pear/src/tests/DB/tests/driver/18get.phpt | 661 -------- .../tests/DB/tests/driver/19getlistof.phpt | 208 --- .../src/tests/DB/tests/driver/connect.inc | 46 - .../src/tests/DB/tests/driver/mktable.inc | 161 -- .../tests/DB/tests/driver/multiconnect.php | 83 - .../pear/src/tests/DB/tests/driver/run.cvs | 40 - .../src/tests/DB/tests/driver/setup.inc.cvs | 115 -- .../pear/src/tests/DB/tests/driver/skipif.inc | 37 - .../tools/pear/src/tests/DB/tests/errors.inc | 466 ------ .../src/tests/DB/tests/fetchmode_object.inc | 111 -- .../pear/src/tests/DB/tests/fetchmodes.inc | 170 --- .../tools/pear/src/tests/DB/tests/include.inc | 62 - .../tools/pear/src/tests/DB/tests/limit.inc | 86 -- .../tools/pear/src/tests/DB/tests/numcols.inc | 67 - .../tools/pear/src/tests/DB/tests/numrows.inc | 110 -- .../tools/pear/src/tests/DB/tests/prepexe.inc | 241 --- .../src/tools/pear/src/tests/DB/tests/run.cvs | 40 - .../pear/src/tests/DB/tests/sequences.inc | 129 -- .../pear/src/tests/DB/tests/simplequery.inc | 76 - .../tools/pear/src/tests/DB/tests/skipif.inc | 30 - .../pear/src/tests/DB/tests/transactions.inc | 101 -- .../pear/src/tests/File/tests/CSV/001.csv | 4 - .../pear/src/tests/File/tests/CSV/001.phpt | 73 - .../pear/src/tests/File/tests/CSV/002.csv | 4 - .../pear/src/tests/File/tests/CSV/002.phpt | 73 - .../pear/src/tests/File/tests/CSV/003.csv | 4 - .../pear/src/tests/File/tests/CSV/003.phpt | 66 - .../pear/src/tests/File/tests/CSV/004.csv | 4 - .../pear/src/tests/File/tests/CSV/004.phpt | 66 - .../pear/src/tests/File/tests/CSV/005.csv | 1 - .../pear/src/tests/File/tests/CSV/005.phpt | 84 -- .../pear/src/tests/File/tests/CSV/tests.txt | 12 - .../pear/src/tests/File/tests/FileTest.php | 226 --- .../pear/src/tests/File/tests/parser.php | 31 - .../tools/pear/src/tests/File/tests/test.csv | 18 - .../src/tests/File_Find/tests/01glob.phpt | 46 - .../src/tests/File_Find/tests/02maptree.phpt | 97 -- .../File_Find/tests/03maptreemultiple.phpt | 91 -- .../src/tests/File_Find/tests/04search.phpt | 53 - .../File_Find/tests/05search_inside.phpt | 63 - .../src/tests/File_Find/tests/bug2773.phpt | 58 - .../pear/src/tests/File_Find/tests/setup.php | 46 - .../pear/src/tests/XML_Parser/tests/001.phpt | 49 - .../pear/src/tests/XML_Parser/tests/002.phpt | 52 - .../pear/src/tests/XML_Parser/tests/003.phpt | 55 - .../pear/src/tests/XML_Parser/tests/004.phpt | 26 - .../pear/src/tests/XML_Parser/tests/005.phpt | 75 - .../pear/src/tests/XML_Parser/tests/test2.xml | 2 - .../pear/src/tests/XML_Parser/tests/test3.xml | 2 - .../pear/src/tests/XML_RPC/tests/allgot.inc | 58 - .../XML_RPC/tests/empty-value-struct.php | 90 -- .../src/tests/XML_RPC/tests/empty-value.php | 88 -- .../src/tests/XML_RPC/tests/extra-lines.php | 109 -- .../src/tests/XML_RPC/tests/protoport.php | 437 ------ .../src/tests/XML_RPC/tests/test_Dump.php | 50 - .../pear/src/tests/XML_RPC/tests/types.php | 132 -- 232 files changed, 5 insertions(+), 21513 deletions(-) delete mode 100644 campcaster/src/tools/pear/src/docs/Archive_Tar/docs/Archive_Tar.txt delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/Readme delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.php delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.phps delete mode 100644 campcaster/src/tools/pear/src/docs/Calendar/docs/examples/index.html delete mode 100644 campcaster/src/tools/pear/src/docs/DB/doc/IDEAS delete mode 100644 campcaster/src/tools/pear/src/docs/DB/doc/MAINTAINERS delete mode 100644 campcaster/src/tools/pear/src/docs/DB/doc/STATUS delete mode 100644 campcaster/src/tools/pear/src/docs/DB/doc/TESTERS delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/elements.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/filters.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/formrule.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/groups.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyDynamic_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyStatic_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example2.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITStatic_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/QuickHtml_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyDynamic_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyStatic_example.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/multiple-labels.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-dynamic.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-static.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/html.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic-2.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-static.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/label.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-fancygroup.tpl delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-green.tpl delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic.tpl delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-static.tpl delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/fancygroup.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/green.html delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-builtin.php delete mode 100644 campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-custom.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example1.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example2.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example3.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example4.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example5.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example6.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/test.xml delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.xml delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_handler.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.xml delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.xml delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple_handler.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/example.xml delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndEncode.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndReturn.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeArrayWithObjects.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeEmptyArray.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeIndexedArray.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeObject.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeRDF.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes2.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithDtd.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithIndentedAttributes.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithNamespace.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithTagMap.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeAnyXML.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeClassNames.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEncoded.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEnum.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeObject.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeRDF.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeWithAttributes.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Util/examples/example.php delete mode 100644 campcaster/src/tools/pear/src/docs/XML_Util/examples/example2.php delete mode 100644 campcaster/src/tools/pear/src/package.dtd delete mode 100644 campcaster/src/tools/pear/src/pearcmd.php delete mode 100644 campcaster/src/tools/pear/src/peclcmd.php delete mode 100644 campcaster/src/tools/pear/src/template.spec delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/README delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/all_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_engine_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_include.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tabular_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/day_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_textual_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_uri_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/helper_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/hour_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/minute_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/month_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/month_weekdays_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/month_weeks_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/peardate_engine_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/second_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/simple_include.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/table_helper_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/unixts_engine_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/util_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/util_textual_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/util_uri_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/validator_error_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/validator_tests.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/validator_unit_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/week_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/Calendar/tests/year_test.php delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/db_error.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/db_error2.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/db_factory.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/db_ismanip.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/db_parsedsn.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/01connect.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/02fetch.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/03simplequery.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/04numcols.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/05sequences.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/06prepexec.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/08affectedrows.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/09numrows.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/10errormap.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/11transactions.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/13limit.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/14fetchmode_object.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/15quote.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/16tableinfo.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/17query.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/18get.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/19getlistof.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/connect.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/mktable.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/multiconnect.php delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/run.cvs delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/setup.inc.cvs delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/driver/skipif.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/errors.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/fetchmode_object.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/fetchmodes.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/include.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/limit.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/numcols.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/numrows.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/prepexe.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/run.cvs delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/sequences.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/simplequery.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/skipif.inc delete mode 100644 campcaster/src/tools/pear/src/tests/DB/tests/transactions.inc delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/001.csv delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/001.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/002.csv delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/002.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/003.csv delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/003.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/004.csv delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/004.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/005.csv delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/005.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/CSV/tests.txt delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/FileTest.php delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/parser.php delete mode 100644 campcaster/src/tools/pear/src/tests/File/tests/test.csv delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/01glob.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/02maptree.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/03maptreemultiple.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/04search.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/05search_inside.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/bug2773.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/File_Find/tests/setup.php delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/001.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/002.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/003.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/004.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/005.phpt delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/test2.xml delete mode 100644 campcaster/src/tools/pear/src/tests/XML_Parser/tests/test3.xml delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/allgot.inc delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value-struct.php delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value.php delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/extra-lines.php delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/protoport.php delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/test_Dump.php delete mode 100644 campcaster/src/tools/pear/src/tests/XML_RPC/tests/types.php diff --git a/campcaster/src/tools/pear/src/docs/Archive_Tar/docs/Archive_Tar.txt b/campcaster/src/tools/pear/src/docs/Archive_Tar/docs/Archive_Tar.txt deleted file mode 100644 index d20507b34..000000000 --- a/campcaster/src/tools/pear/src/docs/Archive_Tar/docs/Archive_Tar.txt +++ /dev/null @@ -1,461 +0,0 @@ -Documentation for class Archive_Tar -=================================== -Last update : 2001-08-15 - - - -Overview : ----------- - - The Archive_Tar class helps in creating and managing GNU TAR format - files compressed by GNU ZIP or not. - The class offers basic functions like creating an archive, adding - files in the archive, extracting files from the archive and listing - the archive content. - It also provide advanced functions that allow the adding and - extraction of files with path manipulation. - - -Sample : --------- - - // ----- Creating the object (uncompressed archive) - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->setErrorHandling(PEAR_ERROR_PRINT); - - // ----- Creating the archive - $v_list[0]="file.txt"; - $v_list[1]="data/"; - $v_list[2]="file.log"; - $tar_object->create($v_list); - - // ----- Adding files - $v_list[0]="dev/file.txt"; - $v_list[1]="dev/data/"; - $v_list[2]="log/file.log"; - $tar_object->add($v_list); - - // ----- Adding more files - $tar_object->add("release/newfile.log release/readme.txt"); - - // ----- Listing the content - if (($v_list = $tar_object->listContent()) != 0) - for ($i=0; $i"; - echo " .size :'".$v_list[$i][size]."'
"; - echo " .mtime :'".$v_list[$i][mtime]."' (".date("l dS of F Y h:i:s A", $v_list[$i][mtime]).")
"; - echo " .mode :'".$v_list[$i][mode]."'
"; - echo " .uid :'".$v_list[$i][uid]."'
"; - echo " .gid :'".$v_list[$i][gid]."'
"; - echo " .typeflag :'".$v_list[$i][typeflag]."'
"; - } - - // ----- Extracting the archive in directory "install" - $tar_object->extract("install"); - - -Public arguments : ------------------- - -None - - -Public Methods : ----------------- - -Method : Archive_Tar($p_tarname, $compress = null) -Description : - Archive_Tar Class constructor. This flavour of the constructor only - declare a new Archive_Tar object, identifying it by the name of the - tar file. - If the compress argument is set the tar will be read or created as a - gzip or bz2 compressed TAR file. -Arguments : - $p_tarname : A valid filename for the tar archive file. - $p_compress : can be null, 'gz' or 'bz2'. For - compatibility reason it can also be true. This - parameter indicates if gzip or bz2 compression - is required. -Return value : - The Archive_Tar object. -Sample : - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object_compressed = new Archive_Tar("tarname.tgz", true); -How it works : - Initialize the object. - -Method : create($p_filelist) -Description : - This method creates the archive file and add the files / directories - that are listed in $p_filelist. - If the file already exists and is writable, it is replaced by the - new tar. It is a create and not an add. If the file exists and is - read-only or is a directory it is not replaced. The method return - false and a PEAR error text. - The $p_filelist parameter can be an array of string, each string - representing a filename or a directory name with their path if - needed. It can also be a single string with names separated by a - single blank. - See also createModify() method for more details. -Arguments : - $p_filelist : An array of filenames and directory names, or a single - string with names separated by a single blank space. -Return value : - true on success, false on error. -Sample 1 : - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling - $v_list[0]="file.txt"; - $v_list[1]="data/"; (Optional '/' at the end) - $v_list[2]="file.log"; - $tar_object->create($v_list); -Sample 2 : - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling - $tar_object->create("file.txt data/ file.log"); -How it works : - Just calling the createModify() method with the right parameters. - -Method : createModify($p_filelist, $p_add_dir, $p_remove_dir = "") -Description : - This method creates the archive file and add the files / directories - that are listed in $p_filelist. - If the file already exists and is writable, it is replaced by the - new tar. It is a create and not an add. If the file exists and is - read-only or is a directory it is not replaced. The method return - false and a PEAR error text. - The $p_filelist parameter can be an array of string, each string - representing a filename or a directory name with their path if - needed. It can also be a single string with names separated by a - single blank. - The path indicated in $p_remove_dir will be removed from the - memorized path of each file / directory listed when this path - exists. By default nothing is removed (empty path "") - The path indicated in $p_add_dir will be added at the beginning of - the memorized path of each file / directory listed. However it can - be set to empty "". The adding of a path is done after the removing - of path. - The path add/remove ability enables the user to prepare an archive - for extraction in a different path than the origin files are. - See also addModify() method for file adding properties. -Arguments : - $p_filelist : An array of filenames and directory names, or a single - string with names separated by a single blank space. - $p_add_dir : A string which contains a path to be added to the - memorized path of each element in the list. - $p_remove_dir : A string which contains a path to be removed from - the memorized path of each element in the list, when - relevant. -Return value : - true on success, false on error. -Sample 1 : - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling - $v_list[0]="file.txt"; - $v_list[1]="data/"; (Optional '/' at the end) - $v_list[2]="file.log"; - $tar_object->createModify($v_list, "install"); - // files are stored in the archive as : - // install/file.txt - // install/data - // install/data/file1.txt - // install/data/... all the files and sub-dirs of data/ - // install/file.log -Sample 2 : - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->setErrorHandling(PEAR_ERROR_PRINT); // Optional error handling - $v_list[0]="dev/file.txt"; - $v_list[1]="dev/data/"; (Optional '/' at the end) - $v_list[2]="log/file.log"; - $tar_object->createModify($v_list, "install", "dev"); - // files are stored in the archive as : - // install/file.txt - // install/data - // install/data/file1.txt - // install/data/... all the files and sub-dirs of data/ - // install/log/file.log -How it works : - Open the file in write mode (erasing the existing one if one), - call the _addList() method for adding the files in an empty archive, - add the tar footer (512 bytes block), close the tar file. - - -Method : addModify($p_filelist, $p_add_dir, $p_remove_dir="") -Description : - This method add the files / directories listed in $p_filelist at the - end of the existing archive. If the archive does not yet exists it - is created. - The $p_filelist parameter can be an array of string, each string - representing a filename or a directory name with their path if - needed. It can also be a single string with names separated by a - single blank. - The path indicated in $p_remove_dir will be removed from the - memorized path of each file / directory listed when this path - exists. By default nothing is removed (empty path "") - The path indicated in $p_add_dir will be added at the beginning of - the memorized path of each file / directory listed. However it can - be set to empty "". The adding of a path is done after the removing - of path. - The path add/remove ability enables the user to prepare an archive - for extraction in a different path than the origin files are. - If a file/dir is already in the archive it will only be added at the - end of the archive. There is no update of the existing archived - file/dir. However while extracting the archive, the last file will - replace the first one. This results in a none optimization of the - archive size. - If a file/dir does not exist the file/dir is ignored. However an - error text is send to PEAR error. - If a file/dir is not readable the file/dir is ignored. However an - error text is send to PEAR error. - If the resulting filename/dirname (after the add/remove option or - not) string is greater than 99 char, the file/dir is - ignored. However an error text is send to PEAR error. -Arguments : - $p_filelist : An array of filenames and directory names, or a single - string with names separated by a single blank space. - $p_add_dir : A string which contains a path to be added to the - memorized path of each element in the list. - $p_remove_dir : A string which contains a path to be removed from - the memorized path of each element in the list, when - relevant. -Return value : - true on success, false on error. -Sample 1 : - $tar_object = new Archive_Tar("tarname.tar"); - [...] - $v_list[0]="dev/file.txt"; - $v_list[1]="dev/data/"; (Optional '/' at the end) - $v_list[2]="log/file.log"; - $tar_object->addModify($v_list, "install"); - // files are stored in the archive as : - // install/file.txt - // install/data - // install/data/file1.txt - // install/data/... all the files and sub-dirs of data/ - // install/file.log -Sample 2 : - $tar_object = new Archive_Tar("tarname.tar"); - [...] - $v_list[0]="dev/file.txt"; - $v_list[1]="dev/data/"; (Optional '/' at the end) - $v_list[2]="log/file.log"; - $tar_object->addModify($v_list, "install", "dev"); - // files are stored in the archive as : - // install/file.txt - // install/data - // install/data/file1.txt - // install/data/... all the files and sub-dirs of data/ - // install/log/file.log -How it works : - If the archive does not exists it create it and add the files. - If the archive does exists and is not compressed, it open it, jump - before the last empty 512 bytes block (tar footer) and add the files - at this point. - If the archive does exists and is compressed, a temporary copy file - is created. This temporary file is then 'gzip' read block by block - until the last empty block. The new files are then added in the - compressed file. - The adding of files is done by going through the file/dir list, - adding files per files, in a recursive way through the - directory. Each time a path need to be added/removed it is done - before writing the file header in the archive. - -Method : add($p_filelist) -Description : - This method add the files / directories listed in $p_filelist at the - end of the existing archive. If the archive does not yet exists it - is created. - The $p_filelist parameter can be an array of string, each string - representing a filename or a directory name with their path if - needed. It can also be a single string with names separated by a - single blank. - See addModify() method for details and limitations. -Arguments : - $p_filelist : An array of filenames and directory names, or a single - string with names separated by a single blank space. -Return value : - true on success, false on error. -Sample 1 : - $tar_object = new Archive_Tar("tarname.tar"); - [...] - $v_list[0]="dev/file.txt"; - $v_list[1]="dev/data/"; (Optional '/' at the end) - $v_list[2]="log/file.log"; - $tar_object->add($v_list); -Sample 2 : - $tar_object = new Archive_Tar("tarname.tgz", true); - [...] - $v_list[0]="dev/file.txt"; - $v_list[1]="dev/data/"; (Optional '/' at the end) - $v_list[2]="log/file.log"; - $tar_object->add($v_list); -How it works : - Simply call the addModify() method with the right parameters. - -Method : addString($p_filename, $p_string) -Description : - This method add a single string as a file at the - end of the existing archive. If the archive does not yet exists it - is created. -Arguments : - $p_filename : A string which contains the full filename path - that will be associated with the string. - $p_string : The content of the file added in the archive. -Return value : - true on success, false on error. -Sample 1 : - $v_archive = & new Archive_Tar($p_filename); - $v_archive->setErrorHandling(PEAR_ERROR_PRINT); - $v_result = $v_archive->addString('data/test.txt', 'This is the text of the string'); - - -Method : extract($p_path = "") -Description : - This method extract all the content of the archive in the directory - indicated by $p_path.If $p_path is optional, if not set the archive - is extracted in the current directory. - While extracting a file, if the directory path does not exists it is - created. - See extractModify() for details and limitations. -Arguments : - $p_path : Optional path where the files/dir need to by extracted. -Return value : - true on success, false on error. -Sample : - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->extract(); -How it works : - Simply call the extractModify() method with appropriate parameters. - -Method : extractModify($p_path, $p_remove_path) -Description : - This method extract all the content of the archive in the directory - indicated by $p_path. When relevant the memorized path of the - files/dir can be modified by removing the $p_remove_path path at the - beginning of the file/dir path. - While extracting a file, if the directory path does not exists it is - created. - While extracting a file, if the file already exists it is replaced - without looking for last modification date. - While extracting a file, if the file already exists and is write - protected, the extraction is aborted. - While extracting a file, if a directory with the same name already - exists, the extraction is aborted. - While extracting a directory, if a file with the same name already - exists, the extraction is aborted. - While extracting a file/directory if the destination directory exist - and is write protected, or does not exist but can not be created, - the extraction is aborted. - If after extraction an extracted file does not show the correct - stored file size, the extraction is aborted. - When the extraction is aborted, a PEAR error text is set and false - is returned. However the result can be a partial extraction that may - need to be manually cleaned. -Arguments : - $p_path : The path of the directory where the files/dir need to by - extracted. - $p_remove_path : Part of the memorized path that can be removed if - present at the beginning of the file/dir path. -Return value : - true on success, false on error. -Sample : - // Imagine tarname.tar with files : - // dev/data/file.txt - // dev/data/log.txt - // readme.txt - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->extractModify("install", "dev"); - // Files will be extracted there : - // install/data/file.txt - // install/data/log.txt - // install/readme.txt -How it works : - Open the archive and call a more generic function that can extract - only a part of the archive or all the archive. - See extractList() method for more details. - -Method : extractInString($p_filename) -Description : - This method extract from the archive one file identified by $p_filename. - The return value is a string with the file content, or NULL on error. -Arguments : - $p_filename : The path of the file to extract in a string. -Return value : - a string with the file content or NULL. -Sample : - // Imagine tarname.tar with files : - // dev/data/file.txt - // dev/data/log.txt - // dev/readme.txt - $v_archive = & new Archive_Tar('tarname.tar'); - $v_archive->setErrorHandling(PEAR_ERROR_PRINT); - $v_string = $v_archive->extractInString('dev/readme.txt'); - echo $v_string; - -Method : listContent() -Description : - This method returns an array of arrays that describe each - file/directory present in the archive. - The array is not sorted, so it show the position of the file in the - archive. - The file informations are : - $file[filename] : Name and path of the file/dir. - $file[mode] : File permissions (result of fileperms()) - $file[uid] : user id - $file[gid] : group id - $file[size] : filesize - $file[mtime] : Last modification time (result of filemtime()) - $file[typeflag] : "" for file, "5" for directory -Arguments : -Return value : - An array of arrays or 0 on error. -Sample : - $tar_object = new Archive_Tar("tarname.tar"); - if (($v_list = $tar_object->listContent()) != 0) - for ($i=0; $i"; - echo " .size :'".$v_list[$i][size]."'
"; - echo " .mtime :'".$v_list[$i][mtime]."' (". - date("l dS of F Y h:i:s A", $v_list[$i][mtime]).")
"; - echo " .mode :'".$v_list[$i][mode]."'
"; - echo " .uid :'".$v_list[$i][uid]."'
"; - echo " .gid :'".$v_list[$i][gid]."'
"; - echo " .typeflag :'".$v_list[$i][typeflag]."'
"; - } -How it works : - Call the same function as an extract however with a flag to only go - through the archive without extracting the files. - -Method : extractList($p_filelist, $p_path = "", $p_remove_path = "") -Description : - This method extract from the archive only the files indicated in the - $p_filelist. These files are extracted in the current directory or - in the directory indicated by the optional $p_path parameter. - If indicated the $p_remove_path can be used in the same way as it is - used in extractModify() method. -Arguments : - $p_filelist : An array of filenames and directory names, or a single - string with names separated by a single blank space. - $p_path : The path of the directory where the files/dir need to by - extracted. - $p_remove_path : Part of the memorized path that can be removed if - present at the beginning of the file/dir path. -Return value : - true on success, false on error. -Sample : - // Imagine tarname.tar with files : - // dev/data/file.txt - // dev/data/log.txt - // readme.txt - $tar_object = new Archive_Tar("tarname.tar"); - $tar_object->extractList("dev/data/file.txt readme.txt", "install", - "dev"); - // Files will be extracted there : - // install/data/file.txt - // install/readme.txt -How it works : - Go through the archive and extract only the files present in the - list. - diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/Readme b/campcaster/src/tools/pear/src/docs/Calendar/docs/Readme deleted file mode 100644 index bba1ed66d..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/Readme +++ /dev/null @@ -1,3 +0,0 @@ -Readme - -See the PEAR manual at http://pear.php.net/manual/en/package.datetime.calendar.php for details. \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.php deleted file mode 100644 index 662a17da5..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.php +++ /dev/null @@ -1,92 +0,0 @@ -' ); -echo ( 'The time is now: '.date('Y M d H:i:s',$c->getTimestamp()).'
' ); - -$i = 1; -echo ( '

First Iteration

' ); -echo ( '

The first iteration is more "expensive", the calendar data - structures having to be built.

' ); -$start = getmicrotime(); -$c->build(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); - -$i = 1; -echo ( '

Second Iteration

' ); -echo ( '

This second iteration is faster, the data structures - being re-used

' ); -$start = getmicrotime(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.phps deleted file mode 100644 index 662a17da5..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/1.phps +++ /dev/null @@ -1,92 +0,0 @@ -' ); -echo ( 'The time is now: '.date('Y M d H:i:s',$c->getTimestamp()).'
' ); - -$i = 1; -echo ( '

First Iteration

' ); -echo ( '

The first iteration is more "expensive", the calendar data - structures having to be built.

' ); -$start = getmicrotime(); -$c->build(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); - -$i = 1; -echo ( '

Second Iteration

' ); -echo ( '

This second iteration is faster, the data structures - being re-used

' ); -$start = getmicrotime(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.php deleted file mode 100644 index c9d92e026..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.php +++ /dev/null @@ -1,93 +0,0 @@ -build(); -?> - - - - - A Simple Decorator - - -

A Simple Decorator

- - -fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "" ); - } else { - echo ( "" ); - } - if ( $Day->isLast() ) { - echo ( "\n\n" ); - } -} -?> - - - - - -
thisMonth() ); ?>
 ".$Day->thisDay()."
Prev Next
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.phps deleted file mode 100644 index c9d92e026..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/10.phps +++ /dev/null @@ -1,93 +0,0 @@ -build(); -?> - - - - - A Simple Decorator - - -

A Simple Decorator

- - -fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "" ); - } else { - echo ( "" ); - } - if ( $Day->isLast() ) { - echo ( "\n\n" ); - } -} -?> - - - - - -
thisMonth() ); ?>
 ".$Day->thisDay()."
Prev Next
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.php deleted file mode 100644 index 281dc8c70..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.php +++ /dev/null @@ -1,109 +0,0 @@ -entry = $entry; - } - function getEntry() { - return $this->entry; - } -} - -// Create a day to view the hours for -$Day = & new Calendar_Day(2003,10,24); - -// A sample query to get the data for today (NOT ACTUALLY USED HERE) -$sql = " - SELECT - * - FROM - diary - WHERE - eventtime >= '".$Day->thisDay(TRUE)."' - AND - eventtime < '".$Day->nextDay(TRUE)."';"; - -// An array simulating data from a database -$result = array ( - array('eventtime'=>mktime(9,0,0,10,24,2003),'entry'=>'Meeting with sales team'), - array('eventtime'=>mktime(11,0,0,10,24,2003),'entry'=>'Conference call with Widget Inc.'), - array('eventtime'=>mktime(15,0,0,10,24,2003),'entry'=>'Presentation to board of directors') - ); - -// An array to place selected hours in -$selection = array(); - -// Loop through the "database result" -foreach ( $result as $row ) { - $Hour = new Calendar_Hour(2000,1,1,1); // Create Hour with dummy values - $Hour->setTimeStamp($row['eventtime']); // Set the real time with setTimeStamp - - // Create the decorator, passing it the Hour - $DiaryEvent = new DiaryEvent($Hour); - - // Attach the payload - $DiaryEvent->setEntry($row['entry']); - - // Add the decorator to the selection - $selection[] = $DiaryEvent; -} - -// Build the hours in that day, passing the selection -$Day->build($selection); -?> - - - - Passing a Selection Payload with a Decorator - - -

Passing a Selection "Payload" using a Decorator

- - - - - - -fetch() ) { - - $hour = $Hour->thisHour(); - $minute = $Hour->thisMinute(); - - // Office hours only... - if ( $hour >= 8 && $hour <= 18 ) { - echo ( "\n" ); - echo ( "\n" ); - - // If the hour is selected, call the decorator method... - if ( $Hour->isSelected() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - echo ( "\n" ); - } -} -?> -
Your Schedule for thisDay(TRUE)) ); ?>
TimeEntry
$hour:$minute".$Hour->getEntry()." 
-

The query to fetch this data, with help from PEAR::Calendar, might be;

-
-
-
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.phps deleted file mode 100644 index 281dc8c70..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/11.phps +++ /dev/null @@ -1,109 +0,0 @@ -entry = $entry; - } - function getEntry() { - return $this->entry; - } -} - -// Create a day to view the hours for -$Day = & new Calendar_Day(2003,10,24); - -// A sample query to get the data for today (NOT ACTUALLY USED HERE) -$sql = " - SELECT - * - FROM - diary - WHERE - eventtime >= '".$Day->thisDay(TRUE)."' - AND - eventtime < '".$Day->nextDay(TRUE)."';"; - -// An array simulating data from a database -$result = array ( - array('eventtime'=>mktime(9,0,0,10,24,2003),'entry'=>'Meeting with sales team'), - array('eventtime'=>mktime(11,0,0,10,24,2003),'entry'=>'Conference call with Widget Inc.'), - array('eventtime'=>mktime(15,0,0,10,24,2003),'entry'=>'Presentation to board of directors') - ); - -// An array to place selected hours in -$selection = array(); - -// Loop through the "database result" -foreach ( $result as $row ) { - $Hour = new Calendar_Hour(2000,1,1,1); // Create Hour with dummy values - $Hour->setTimeStamp($row['eventtime']); // Set the real time with setTimeStamp - - // Create the decorator, passing it the Hour - $DiaryEvent = new DiaryEvent($Hour); - - // Attach the payload - $DiaryEvent->setEntry($row['entry']); - - // Add the decorator to the selection - $selection[] = $DiaryEvent; -} - -// Build the hours in that day, passing the selection -$Day->build($selection); -?> - - - - Passing a Selection Payload with a Decorator - - -

Passing a Selection "Payload" using a Decorator

- - - - - - -fetch() ) { - - $hour = $Hour->thisHour(); - $minute = $Hour->thisMinute(); - - // Office hours only... - if ( $hour >= 8 && $hour <= 18 ) { - echo ( "\n" ); - echo ( "\n" ); - - // If the hour is selected, call the decorator method... - if ( $Hour->isSelected() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - echo ( "\n" ); - } -} -?> -
Your Schedule for thisDay(TRUE)) ); ?>
TimeEntry
$hour:$minute".$Hour->getEntry()." 
-

The query to fetch this data, with help from PEAR::Calendar, might be;

-
-
-
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.php deleted file mode 100644 index 0096d21ce..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.php +++ /dev/null @@ -1,116 +0,0 @@ -build(); -?> - - - - <?php echo ( $Year->thisYear() ); ?> - - - - - -fetch() ) { - - switch ( $i ) { - case 0: - echo ( "\n" ); - break; - case 3: - case 6: - case 9: - echo ( "\n\n" ); - break; - case 12: - echo ( "\n" ); - break; - } - - echo ( "\n" ); - - $i++; -} -?> -
-thisYear() ); ?> - - -
\n\n" ); - echo ( "" ); - echo ( "\n\n" ); - $Month->build(); - while ( $Day = $Month->fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - if ( $Day->isLast() ) { - echo ( "\n" ); - } - } - echo ( "
".date('F',$Month->thisMonth(TRUE))."
MTWTFSS
 ".$Day->thisDay()."
\n
-

Took:

- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.phps deleted file mode 100644 index 0096d21ce..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/12.phps +++ /dev/null @@ -1,116 +0,0 @@ -build(); -?> - - - - <?php echo ( $Year->thisYear() ); ?> - - - - - -fetch() ) { - - switch ( $i ) { - case 0: - echo ( "\n" ); - break; - case 3: - case 6: - case 9: - echo ( "\n\n" ); - break; - case 12: - echo ( "\n" ); - break; - } - - echo ( "\n" ); - - $i++; -} -?> -
-thisYear() ); ?> - - -
\n\n" ); - echo ( "" ); - echo ( "\n\n" ); - $Month->build(); - while ( $Day = $Month->fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - if ( $Day->isLast() ) { - echo ( "\n" ); - } - } - echo ( "
".date('F',$Month->thisMonth(TRUE))."
MTWTFSS
 ".$Day->thisDay()."
\n
-

Took:

- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.php deleted file mode 100644 index 4fb0f317e..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.php +++ /dev/null @@ -1,99 +0,0 @@ -getTimestamp()); - -echo ( '

Using PEAR::Date engine

' ); -echo ( 'Viewing: '.@$_GET['view'].'
' ); -echo ( 'The time is now: '.$date->format('%Y %a %e %T').'
' ); - -$i = 1; -echo ( '

First Iteration

' ); -echo ( '

The first iteration is more "expensive", the calendar data - structures having to be built.

' ); -$start = getmicrotime(); -$c->build(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); - -$i = 1; -echo ( '

Second Iteration

' ); -echo ( '

This second iteration is faster, the data structures - being re-used

' ); -$start = getmicrotime(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.phps deleted file mode 100644 index 4fb0f317e..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/13.phps +++ /dev/null @@ -1,99 +0,0 @@ -getTimestamp()); - -echo ( '

Using PEAR::Date engine

' ); -echo ( 'Viewing: '.@$_GET['view'].'
' ); -echo ( 'The time is now: '.$date->format('%Y %a %e %T').'
' ); - -$i = 1; -echo ( '

First Iteration

' ); -echo ( '

The first iteration is more "expensive", the calendar data - structures having to be built.

' ); -$start = getmicrotime(); -$c->build(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); - -$i = 1; -echo ( '

Second Iteration

' ); -echo ( '

This second iteration is faster, the data structures - being re-used

' ); -$start = getmicrotime(); -while ( $e = $c->fetch() ) { - $class = strtolower(get_class($e)); - $link ="&y=".$e->thisYear()."&m=".$e->thisMonth()."&d=".$e->thisDay(). - "&h=".$e->thisHour()."&i=".$e->thisMinute()."&s=".$e->thisSecond(); - $method = 'this'.str_replace('calendar_','',$class); - echo ( "".$e->{$method}()." : " ); - if ( ($i % 10) == 0 ) { - echo ( '
' ); - } - $i++; -} -echo ( '

Took: '.(getmicrotime()-$start).' seconds

' ); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.php deleted file mode 100644 index b1c520c80..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.php +++ /dev/null @@ -1,141 +0,0 @@ -build($selectedDays); - -// Construct strings for next/previous links -$PMonth = $month->prevMonth('object'); // Get previous month as object -$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); -$NMonth = $month->nextMonth('object'); -$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); - -$thisDate = new Date($month->thisMonth('timestamp')); -?> - - - - Calendar using PEAR::Date Engine - - - - - -

Calendar using PEAR::Date Engine

- - - - - - - - - - - -fetch()) { - // Build a link string for each day - $link = $_SERVER['PHP_SELF']. - '?y='.$day->thisYear(). - '&m='.$day->thisMonth(). - '&d='.$day->thisDay(); - - // isFirst() to find start of week - if ($day->isFirst()) - echo "\n"; - - if ($day->isSelected()) { - echo ''."\n"; - } else if ($day->isEmpty()) { - echo ''."\n"; - } else { - echo ''."\n"; - } - - // isLast() to find end of week - if ($day->isLast()) { - echo "\n"; - } -} -?> - - - - - -
-format('%B %Y'); ?> -
MTWTFSS
'.$day->thisDay().' '.$day->thisDay().'
-<< -  - >> -
-Took: '.(getmicrotime()-$start).' seconds

'; -?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.phps deleted file mode 100644 index b1c520c80..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/14.phps +++ /dev/null @@ -1,141 +0,0 @@ -build($selectedDays); - -// Construct strings for next/previous links -$PMonth = $month->prevMonth('object'); // Get previous month as object -$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); -$NMonth = $month->nextMonth('object'); -$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); - -$thisDate = new Date($month->thisMonth('timestamp')); -?> - - - - Calendar using PEAR::Date Engine - - - - - -

Calendar using PEAR::Date Engine

- - - - - - - - - - - -fetch()) { - // Build a link string for each day - $link = $_SERVER['PHP_SELF']. - '?y='.$day->thisYear(). - '&m='.$day->thisMonth(). - '&d='.$day->thisDay(); - - // isFirst() to find start of week - if ($day->isFirst()) - echo "\n"; - - if ($day->isSelected()) { - echo ''."\n"; - } else if ($day->isEmpty()) { - echo ''."\n"; - } else { - echo ''."\n"; - } - - // isLast() to find end of week - if ($day->isLast()) { - echo "\n"; - } -} -?> - - - - - -
-format('%B %Y'); ?> -
MTWTFSS
'.$day->thisDay().' '.$day->thisDay().'
-<< -  - >> -
-Took: '.(getmicrotime()-$start).' seconds

'; -?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.php deleted file mode 100644 index c13adc563..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.php +++ /dev/null @@ -1,58 +0,0 @@ -getValidator(); -if (!$Validator->isValidWeek()) { - die ('Please enter a valid week!'); -} -*/ -?> - - - - Paging Weeks - - -

Paging Weeks

-

Week: thisWeek().' '.date('F Y',$Week->thisMonth(true)); ?>

-build(); -while ($Day = $Week->fetch()) { - echo '

'.date('jS F',$Day->thisDay(true))."

\n"; -} -$days = $Week->fetchAll(); - -$prevWeek = $Week->prevWeek('array'); -$prevWeekLink = $_SERVER['PHP_SELF']. - '?y='.$prevWeek['year']. - '&m='.$prevWeek['month']. - '&d='.$prevWeek['day']; - -$nextWeek = $Week->nextWeek('array'); -$nextWeekLink = $_SERVER['PHP_SELF']. - '?y='.$nextWeek['year']. - '&m='.$nextWeek['month']. - '&d='.$nextWeek['day']; -?> -

<< | >>

- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.phps deleted file mode 100644 index c13adc563..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/15.phps +++ /dev/null @@ -1,58 +0,0 @@ -getValidator(); -if (!$Validator->isValidWeek()) { - die ('Please enter a valid week!'); -} -*/ -?> - - - - Paging Weeks - - -

Paging Weeks

-

Week: thisWeek().' '.date('F Y',$Week->thisMonth(true)); ?>

-build(); -while ($Day = $Week->fetch()) { - echo '

'.date('jS F',$Day->thisDay(true))."

\n"; -} -$days = $Week->fetchAll(); - -$prevWeek = $Week->prevWeek('array'); -$prevWeekLink = $_SERVER['PHP_SELF']. - '?y='.$prevWeek['year']. - '&m='.$prevWeek['month']. - '&d='.$prevWeek['day']; - -$nextWeek = $Week->nextWeek('array'); -$nextWeekLink = $_SERVER['PHP_SELF']. - '?y='.$nextWeek['year']. - '&m='.$nextWeek['month']. - '&d='.$nextWeek['day']; -?> -

<< | >>

- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.php deleted file mode 100644 index 2551708a3..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.php +++ /dev/null @@ -1,31 +0,0 @@ -The current month is ' - .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'

'); - -$Uri = & new Calendar_Decorator_Uri($Calendar); -$Uri->setFragments('jahr','monat'); -// $Uri->setSeperator('/'); // Default is & -// $Uri->setScalar(); // Omit variable names -echo ( "
Previous Uri:\t".$Uri->prev('month')."\n" );
-echo ( "This Uri:\t".$Uri->this('month')."\n" );
-echo ( "Next Uri:\t".$Uri->next('month')."\n
" ); -?> -

-Prev : -Next -

\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.phps deleted file mode 100644 index 2551708a3..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/16.phps +++ /dev/null @@ -1,31 +0,0 @@ -The current month is ' - .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'

'); - -$Uri = & new Calendar_Decorator_Uri($Calendar); -$Uri->setFragments('jahr','monat'); -// $Uri->setSeperator('/'); // Default is & -// $Uri->setScalar(); // Omit variable names -echo ( "
Previous Uri:\t".$Uri->prev('month')."\n" );
-echo ( "This Uri:\t".$Uri->this('month')."\n" );
-echo ( "Next Uri:\t".$Uri->next('month')."\n
" ); -?> -

-Prev : -Next -

\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.php deleted file mode 100644 index 0cfebce3c..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.php +++ /dev/null @@ -1,71 +0,0 @@ -Calling: Calendar_Decorator_Textual::monthNames('long');
";
-print_r(Calendar_Decorator_Textual::monthNames('long'));
-echo '
'; - -echo "
Calling: Calendar_Decorator_Textual::weekdayNames('two');
";
-print_r(Calendar_Decorator_Textual::weekdayNames('two'));
-echo '
'; - -echo "
Creating: new Calendar_Day(date('Y'), date('n'), date('d'));
"; -$Calendar = new Calendar_Day(date('Y'), date('n'), date('d')); - -// Decorate -$Textual = & new Calendar_Decorator_Textual($Calendar); - -echo '
Previous month is: '.$Textual->prevMonthName('two').'
'; -echo 'This month is: '.$Textual->thisMonthName('short').'
'; -echo 'Next month is: '.$Textual->nextMonthName().'

'; -echo 'Previous day is: '.$Textual->prevDayName().'
'; -echo 'This day is: '.$Textual->thisDayName('short').'
'; -echo 'Next day is: '.$Textual->nextDayName('one').'

'; - -echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week
"; -$Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - -// Decorate -$Textual = & new Calendar_Decorator_Textual($Calendar); -?> -

Rendering calendar....

- - - -orderedWeekdays('short'); -foreach ($dayheaders as $dayheader) { - echo ''; -} -?> - -build(); -while ($Day = $Calendar->fetch()) { - if ($Day->isFirst()) { - echo "\n"; - } - if ($Day->isEmpty()) { - echo ''; - } else { - echo ''; - } - if ($Day->isLast()) { - echo "\n"; - } -} -?> -
thisMonthName().' '.$Textual->thisYear(); ?>
'.$dayheader.'
 '.$Day->thisDay().'
\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.phps deleted file mode 100644 index 0cfebce3c..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/17.phps +++ /dev/null @@ -1,71 +0,0 @@ -Calling: Calendar_Decorator_Textual::monthNames('long');
";
-print_r(Calendar_Decorator_Textual::monthNames('long'));
-echo '
'; - -echo "
Calling: Calendar_Decorator_Textual::weekdayNames('two');
";
-print_r(Calendar_Decorator_Textual::weekdayNames('two'));
-echo '
'; - -echo "
Creating: new Calendar_Day(date('Y'), date('n'), date('d'));
"; -$Calendar = new Calendar_Day(date('Y'), date('n'), date('d')); - -// Decorate -$Textual = & new Calendar_Decorator_Textual($Calendar); - -echo '
Previous month is: '.$Textual->prevMonthName('two').'
'; -echo 'This month is: '.$Textual->thisMonthName('short').'
'; -echo 'Next month is: '.$Textual->nextMonthName().'

'; -echo 'Previous day is: '.$Textual->prevDayName().'
'; -echo 'This day is: '.$Textual->thisDayName('short').'
'; -echo 'Next day is: '.$Textual->nextDayName('one').'

'; - -echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week
"; -$Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - -// Decorate -$Textual = & new Calendar_Decorator_Textual($Calendar); -?> -

Rendering calendar....

- - - -orderedWeekdays('short'); -foreach ($dayheaders as $dayheader) { - echo ''; -} -?> - -build(); -while ($Day = $Calendar->fetch()) { - if ($Day->isFirst()) { - echo "\n"; - } - if ($Day->isEmpty()) { - echo ''; - } else { - echo ''; - } - if ($Day->isLast()) { - echo "\n"; - } -} -?> -
thisMonthName().' '.$Textual->thisYear(); ?>
'.$dayheader.'
 '.$Day->thisDay().'
\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.php deleted file mode 100644 index 7ec2a4988..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.php +++ /dev/null @@ -1,36 +0,0 @@ -'.parent::thisDay().''; - } -} - -$Month = new Calendar_Month(date('Y'), date('n')); - -$Wrapper = & new Calendar_Decorator_Wrapper($Month); -$Wrapper->build(); - -echo '

The Wrapper decorator

'; -echo 'Day numbers are rendered in bold

'; -while ($DecoratedDay = $Wrapper->fetch('MyBoldDecorator')) { - echo $DecoratedDay->thisDay().'
'; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.phps deleted file mode 100644 index 7ec2a4988..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/18.phps +++ /dev/null @@ -1,36 +0,0 @@ -'.parent::thisDay().''; - } -} - -$Month = new Calendar_Month(date('Y'), date('n')); - -$Wrapper = & new Calendar_Decorator_Wrapper($Month); -$Wrapper->build(); - -echo '

The Wrapper decorator

'; -echo 'Day numbers are rendered in bold

'; -while ($DecoratedDay = $Wrapper->fetch('MyBoldDecorator')) { - echo $DecoratedDay->thisDay().'
'; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.php deleted file mode 100644 index e46d10759..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.php +++ /dev/null @@ -1,24 +0,0 @@ -setFirstDay(0); // Make Sunday first Day - -echo 'Yesterday: '.$WeekDay->prevWeekDay().'
'; -echo 'Today: '.$WeekDay->thisWeekDay().'
'; -echo 'Tomorrow: '.$WeekDay->nextWeekDay().'
'; - -$WeekDay->build(); -echo 'Hours today:
'; -while ( $Hour = $WeekDay->fetch() ) { - echo $Hour->thisHour().'
'; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.phps deleted file mode 100644 index e46d10759..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/19.phps +++ /dev/null @@ -1,24 +0,0 @@ -setFirstDay(0); // Make Sunday first Day - -echo 'Yesterday: '.$WeekDay->prevWeekDay().'
'; -echo 'Today: '.$WeekDay->thisWeekDay().'
'; -echo 'Tomorrow: '.$WeekDay->nextWeekDay().'
'; - -$WeekDay->build(); -echo 'Hours today:
'; -while ( $Hour = $WeekDay->fetch() ) { - echo $Hour->thisHour().'
'; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.php deleted file mode 100644 index 1f7654d70..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.php +++ /dev/null @@ -1,142 +0,0 @@ -build(); - -// Construct strings for next/previous links -$PMonth = $Month->prevMonth('object'); // Get previous month as object -$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); -$NMonth = $Month->nextMonth('object'); -$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); -?> - - - - Calendar - - - - -

Build with Calendar_Month_Weeks::build() then Calendar_Week::build()

- - - - - - - - - - - -fetch()) { - echo "\n"; - // Build the days in the week, passing the selected days - $Week->build($selectedDays); - while ($Day = $Week->fetch()) { - - // Build a link string for each day - $link = $_SERVER['PHP_SELF']. - '?y='.$Day->thisYear(). - '&m='.$Day->thisMonth(). - '&d='.$Day->thisDay(); - - // Check to see if day is selected - if ($Day->isSelected()) { - echo ''."\n"; - // Check to see if day is empty - } else if ($Day->isEmpty()) { - echo ''."\n"; - } else { - echo ''."\n"; - } - } - echo ''."\n"; -} -?> - - - - - -
-getTimeStamp()); ?> -
MTWTFSS
'.$Day->thisDay().''.$Day->thisDay().''.$Day->thisDay().'
-<< -  - >> -
-Took: '.(getmicrotime()-$start).' seconds

'; -?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.phps deleted file mode 100644 index 1f7654d70..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/2.phps +++ /dev/null @@ -1,142 +0,0 @@ -build(); - -// Construct strings for next/previous links -$PMonth = $Month->prevMonth('object'); // Get previous month as object -$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); -$NMonth = $Month->nextMonth('object'); -$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); -?> - - - - Calendar - - - - -

Build with Calendar_Month_Weeks::build() then Calendar_Week::build()

- - - - - - - - - - - -fetch()) { - echo "\n"; - // Build the days in the week, passing the selected days - $Week->build($selectedDays); - while ($Day = $Week->fetch()) { - - // Build a link string for each day - $link = $_SERVER['PHP_SELF']. - '?y='.$Day->thisYear(). - '&m='.$Day->thisMonth(). - '&d='.$Day->thisDay(); - - // Check to see if day is selected - if ($Day->isSelected()) { - echo ''."\n"; - // Check to see if day is empty - } else if ($Day->isEmpty()) { - echo ''."\n"; - } else { - echo ''."\n"; - } - } - echo ''."\n"; -} -?> - - - - - -
-getTimeStamp()); ?> -
MTWTFSS
'.$Day->thisDay().''.$Day->thisDay().''.$Day->thisDay().'
-<< -  - >> -
-Took: '.(getmicrotime()-$start).' seconds

'; -?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.php deleted file mode 100644 index 16a519fa8..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.php +++ /dev/null @@ -1,240 +0,0 @@ -entries[] = $entry; - } - - function getEntry() { - $entry = each($this->entries); - if ($entry) { - return $entry['value']; - } else { - reset($this->entries); - return false; - } - } -} - -class MonthPayload_Decorator extends Calendar_Decorator -{ - //Calendar engine - var $cE; - var $tableHelper; - - var $year; - var $month; - var $firstDay = false; - - function build($events=array()) - { - require_once CALENDAR_ROOT . 'Day.php'; - require_once CALENDAR_ROOT . 'Table/Helper.php'; - - $this->tableHelper = & new Calendar_Table_Helper($this, $this->firstDay); - $this->cE = & $this->getEngine(); - $this->year = $this->thisYear(); - $this->month = $this->thisMonth(); - - $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); - for ($i=1; $i<=$daysInMonth; $i++) { - $Day = new Calendar_Day(2000,1,1); // Create Day with dummy values - $Day->setTimeStamp($this->cE->dateToStamp($this->year, $this->month, $i)); - $this->children[$i] = new DiaryEvent($Day); - } - if (count($events) > 0) { - $this->setSelection($events); - } - Calendar_Month_Weekdays::buildEmptyDaysBefore(); - Calendar_Month_Weekdays::shiftDays(); - Calendar_Month_Weekdays::buildEmptyDaysAfter(); - Calendar_Month_Weekdays::setWeekMarkers(); - return true; - } - - function setSelection($events) - { - $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); - for ($i=1; $i<=$daysInMonth; $i++) { - $stamp1 = $this->cE->dateToStamp($this->year, $this->month, $i); - $stamp2 = $this->cE->dateToStamp($this->year, $this->month, $i+1); - foreach ($events as $event) { - if (($stamp1 >= $event['start'] && $stamp1 < $event['end']) || - ($stamp2 >= $event['start'] && $stamp2 < $event['end']) || - ($stamp1 <= $event['start'] && $stamp2 > $event['end']) - ) { - $this->children[$i]->addEntry($event); - $this->children[$i]->setSelected(); - } - } - } - } - - function fetch() - { - $child = each($this->children); - if ($child) { - return $child['value']; - } else { - reset($this->children); - return false; - } - } -} - -// Calendar instance used to get the dates in the preferred format: -// you can switch Calendar Engine and the example still works -$cal = new Calendar; - -$events = array(); -//add some events -$events[] = array( - 'start' => $cal->cE->dateToStamp(2004, 6, 1, 10), - 'end' => $cal->cE->dateToStamp(2004, 6, 1, 12), - 'desc' => 'Important meeting' -); -$events[] = array( - 'start' => $cal->cE->dateToStamp(2004, 6, 1, 21), - 'end' => $cal->cE->dateToStamp(2004, 6, 1, 23, 59), - 'desc' => 'Dinner with the boss' -); -$events[] = array( - 'start' => $cal->cE->dateToStamp(2004, 6, 5), - 'end' => $cal->cE->dateToStamp(2004, 6, 10, 23, 59), - 'desc' => 'Holidays!' -); - - - -$Month = & new Calendar_Month_Weekdays(2004, 6); -$MonthDecorator = new MonthPayload_Decorator($Month); -$MonthDecorator->build($events); - -?> - - - - Calendar - - - - - -

Sample Calendar Payload Decorator (using engine)

- - - - - - - - - - - -fetch()) { - - if ($Day->isFirst()) { - echo "\n"; - } - - echo ''; - - if ($Day->isLast()) { - echo "\n"; - } -} -?> -
- thisMonth().' / '.$MonthDecorator->thisYear(); ?> -
MondayTuesdayWednesdayThursdayFridaySaturdaySunday
'; - echo '
'.$Day->thisDay().'
'; - - if ($Day->isEmpty()) { - echo ' '; - } else { - echo '
    '; - while ($entry = $Day->getEntry()) { - echo '
  • '.$entry['desc'].'
  • '; - //you can print the time range as well - } - echo '
'; - } - echo '
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.phps deleted file mode 100644 index 16a519fa8..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/20.phps +++ /dev/null @@ -1,240 +0,0 @@ -entries[] = $entry; - } - - function getEntry() { - $entry = each($this->entries); - if ($entry) { - return $entry['value']; - } else { - reset($this->entries); - return false; - } - } -} - -class MonthPayload_Decorator extends Calendar_Decorator -{ - //Calendar engine - var $cE; - var $tableHelper; - - var $year; - var $month; - var $firstDay = false; - - function build($events=array()) - { - require_once CALENDAR_ROOT . 'Day.php'; - require_once CALENDAR_ROOT . 'Table/Helper.php'; - - $this->tableHelper = & new Calendar_Table_Helper($this, $this->firstDay); - $this->cE = & $this->getEngine(); - $this->year = $this->thisYear(); - $this->month = $this->thisMonth(); - - $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); - for ($i=1; $i<=$daysInMonth; $i++) { - $Day = new Calendar_Day(2000,1,1); // Create Day with dummy values - $Day->setTimeStamp($this->cE->dateToStamp($this->year, $this->month, $i)); - $this->children[$i] = new DiaryEvent($Day); - } - if (count($events) > 0) { - $this->setSelection($events); - } - Calendar_Month_Weekdays::buildEmptyDaysBefore(); - Calendar_Month_Weekdays::shiftDays(); - Calendar_Month_Weekdays::buildEmptyDaysAfter(); - Calendar_Month_Weekdays::setWeekMarkers(); - return true; - } - - function setSelection($events) - { - $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); - for ($i=1; $i<=$daysInMonth; $i++) { - $stamp1 = $this->cE->dateToStamp($this->year, $this->month, $i); - $stamp2 = $this->cE->dateToStamp($this->year, $this->month, $i+1); - foreach ($events as $event) { - if (($stamp1 >= $event['start'] && $stamp1 < $event['end']) || - ($stamp2 >= $event['start'] && $stamp2 < $event['end']) || - ($stamp1 <= $event['start'] && $stamp2 > $event['end']) - ) { - $this->children[$i]->addEntry($event); - $this->children[$i]->setSelected(); - } - } - } - } - - function fetch() - { - $child = each($this->children); - if ($child) { - return $child['value']; - } else { - reset($this->children); - return false; - } - } -} - -// Calendar instance used to get the dates in the preferred format: -// you can switch Calendar Engine and the example still works -$cal = new Calendar; - -$events = array(); -//add some events -$events[] = array( - 'start' => $cal->cE->dateToStamp(2004, 6, 1, 10), - 'end' => $cal->cE->dateToStamp(2004, 6, 1, 12), - 'desc' => 'Important meeting' -); -$events[] = array( - 'start' => $cal->cE->dateToStamp(2004, 6, 1, 21), - 'end' => $cal->cE->dateToStamp(2004, 6, 1, 23, 59), - 'desc' => 'Dinner with the boss' -); -$events[] = array( - 'start' => $cal->cE->dateToStamp(2004, 6, 5), - 'end' => $cal->cE->dateToStamp(2004, 6, 10, 23, 59), - 'desc' => 'Holidays!' -); - - - -$Month = & new Calendar_Month_Weekdays(2004, 6); -$MonthDecorator = new MonthPayload_Decorator($Month); -$MonthDecorator->build($events); - -?> - - - - Calendar - - - - - -

Sample Calendar Payload Decorator (using engine)

- - - - - - - - - - - -fetch()) { - - if ($Day->isFirst()) { - echo "\n"; - } - - echo ''; - - if ($Day->isLast()) { - echo "\n"; - } -} -?> -
- thisMonth().' / '.$MonthDecorator->thisYear(); ?> -
MondayTuesdayWednesdayThursdayFridaySaturdaySunday
'; - echo '
'.$Day->thisDay().'
'; - - if ($Day->isEmpty()) { - echo ' '; - } else { - echo '
    '; - while ($entry = $Day->getEntry()) { - echo '
  • '.$entry['desc'].'
  • '; - //you can print the time range as well - } - echo '
'; - } - echo '
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.php deleted file mode 100644 index dbdd68aec..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.php +++ /dev/null @@ -1,139 +0,0 @@ -build(); -?> - - - - <?php echo $Year->thisYear(); ?> - - - - - -fetch()) { - - switch ($i) { - case 0: - echo "\n"; - break; - case 3: - case 6: - case 9: - echo "\n\n"; - break; - case 12: - echo "\n"; - break; - } - - echo "\n"; - - $i++; -} -?> -
-thisYear(); ?> - - - -
\n\n"; - echo ''; - echo ''."\n"; - echo "\n\n"; - $Month->build(); - while ($Week = $Month->fetch()) { - echo "\n"; - echo '\n"; - $Week->build(); - - while ($Day = $Week->fetch()) { - if ($Day->isEmpty()) { - echo "\n"; - } else { - echo "\n"; - } - } - } - echo "
'.date('F', $Month->thisMonth(TRUE)).'
WeekMTWTFSS
'.$Week->thisWeek($_GET['week_type'])." ".$Day->thisDay()."
\n
-

Took:

- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.phps deleted file mode 100644 index dbdd68aec..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/21.phps +++ /dev/null @@ -1,139 +0,0 @@ -build(); -?> - - - - <?php echo $Year->thisYear(); ?> - - - - - -fetch()) { - - switch ($i) { - case 0: - echo "\n"; - break; - case 3: - case 6: - case 9: - echo "\n\n"; - break; - case 12: - echo "\n"; - break; - } - - echo "\n"; - - $i++; -} -?> -
-thisYear(); ?> - - - -
\n\n"; - echo ''; - echo ''."\n"; - echo "\n\n"; - $Month->build(); - while ($Week = $Month->fetch()) { - echo "\n"; - echo '\n"; - $Week->build(); - - while ($Day = $Week->fetch()) { - if ($Day->isEmpty()) { - echo "\n"; - } else { - echo "\n"; - } - } - } - echo "
'.date('F', $Month->thisMonth(TRUE)).'
WeekMTWTFSS
'.$Week->thisWeek($_GET['week_type'])." ".$Day->thisDay()."
\n
-

Took:

- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.php deleted file mode 100644 index 089c53606..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.php +++ /dev/null @@ -1,46 +0,0 @@ -The current month is ' - .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'

'); - -$Uri = & new Calendar_Util_Uri('jahr','monat'); -$Uri->setFragments('jahr','monat'); - -echo "\"Vector\" URIs
";
-echo ( "Previous Uri:\t".htmlentities($Uri->prev($Calendar, 'month'))."\n" );
-echo ( "This Uri:\t".htmlentities($Uri->this($Calendar,  'month'))."\n" );
-echo ( "Next Uri:\t".htmlentities($Uri->next($Calendar, 'month'))."\n" );
-echo "
"; - -// Switch to scalar URIs -$Uri->separator = '/'; // Default is & -$Uri->scalar = true; // Omit variable names - -echo "\"Scalar\" URIs
";
-echo ( "Previous Uri:\t".$Uri->prev($Calendar, 'month')."\n" );
-echo ( "This Uri:\t".$Uri->this($Calendar,  'month')."\n" );
-echo ( "Next Uri:\t".$Uri->next($Calendar, 'month')."\n" );
-echo "
"; - -// Restore the vector URIs -$Uri->separator = '&'; -$Uri->scalar = false; -?> -

-Prev : -Next -

\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.phps deleted file mode 100644 index 089c53606..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/22.phps +++ /dev/null @@ -1,46 +0,0 @@ -The current month is ' - .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'

'); - -$Uri = & new Calendar_Util_Uri('jahr','monat'); -$Uri->setFragments('jahr','monat'); - -echo "\"Vector\" URIs
";
-echo ( "Previous Uri:\t".htmlentities($Uri->prev($Calendar, 'month'))."\n" );
-echo ( "This Uri:\t".htmlentities($Uri->this($Calendar,  'month'))."\n" );
-echo ( "Next Uri:\t".htmlentities($Uri->next($Calendar, 'month'))."\n" );
-echo "
"; - -// Switch to scalar URIs -$Uri->separator = '/'; // Default is & -$Uri->scalar = true; // Omit variable names - -echo "\"Scalar\" URIs
";
-echo ( "Previous Uri:\t".$Uri->prev($Calendar, 'month')."\n" );
-echo ( "This Uri:\t".$Uri->this($Calendar,  'month')."\n" );
-echo ( "Next Uri:\t".$Uri->next($Calendar, 'month')."\n" );
-echo "
"; - -// Restore the vector URIs -$Uri->separator = '&'; -$Uri->scalar = false; -?> -

-Prev : -Next -

\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.php deleted file mode 100644 index 3f04b4486..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.php +++ /dev/null @@ -1,66 +0,0 @@ -Calling: Calendar_Util_Textual::monthNames('long');
";
-print_r(Calendar_Util_Textual::monthNames('long'));
-echo '
'; - -echo "
Calling: Calendar_Util_Textual::weekdayNames('two');
";
-print_r(Calendar_Util_Textual::weekdayNames('two'));
-echo '
'; - -echo "
Creating: new Calendar_Day(date('Y'), date('n'), date('d'));
"; -$Calendar = new Calendar_Day(date('Y'), date('n'), date('d')); - -echo '
Previous month is: '.Calendar_Util_Textual::prevMonthName($Calendar,'two').'
'; -echo 'This month is: '.Calendar_Util_Textual::thisMonthName($Calendar,'short').'
'; -echo 'Next month is: '.Calendar_Util_Textual::nextMonthName($Calendar).'

'; -echo 'Previous day is: '.Calendar_Util_Textual::prevDayName($Calendar).'
'; -echo 'This day is: '.Calendar_Util_Textual::thisDayName($Calendar,'short').'
'; -echo 'Next day is: '.Calendar_Util_Textual::nextDayName($Calendar,'one').'

'; - -echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week
"; -$Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - -?> -

Rendering calendar....

- - - -'.$dayheader.''; -} -?> - -build(); -while ($Day = $Calendar->fetch()) { - if ($Day->isFirst()) { - echo "\n"; - } - if ($Day->isEmpty()) { - echo ''; - } else { - echo ''; - } - if ($Day->isLast()) { - echo "\n"; - } -} -?> -
thisYear(); ?>
 '.$Day->thisDay().'
\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.phps deleted file mode 100644 index 3f04b4486..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/23.phps +++ /dev/null @@ -1,66 +0,0 @@ -Calling: Calendar_Util_Textual::monthNames('long');
";
-print_r(Calendar_Util_Textual::monthNames('long'));
-echo '
'; - -echo "
Calling: Calendar_Util_Textual::weekdayNames('two');
";
-print_r(Calendar_Util_Textual::weekdayNames('two'));
-echo '
'; - -echo "
Creating: new Calendar_Day(date('Y'), date('n'), date('d'));
"; -$Calendar = new Calendar_Day(date('Y'), date('n'), date('d')); - -echo '
Previous month is: '.Calendar_Util_Textual::prevMonthName($Calendar,'two').'
'; -echo 'This month is: '.Calendar_Util_Textual::thisMonthName($Calendar,'short').'
'; -echo 'Next month is: '.Calendar_Util_Textual::nextMonthName($Calendar).'

'; -echo 'Previous day is: '.Calendar_Util_Textual::prevDayName($Calendar).'
'; -echo 'This day is: '.Calendar_Util_Textual::thisDayName($Calendar,'short').'
'; -echo 'Next day is: '.Calendar_Util_Textual::nextDayName($Calendar,'one').'

'; - -echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week
"; -$Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - -?> -

Rendering calendar....

- - - -'.$dayheader.''; -} -?> - -build(); -while ($Day = $Calendar->fetch()) { - if ($Day->isFirst()) { - echo "\n"; - } - if ($Day->isEmpty()) { - echo ''; - } else { - echo ''; - } - if ($Day->isLast()) { - echo "\n"; - } -} -?> -
thisYear(); ?>
 '.$Day->thisDay().'
\ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.php deleted file mode 100644 index f92dcbbc9..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.php +++ /dev/null @@ -1,134 +0,0 @@ -prevMonth('object'); // Get previous month as object -$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); -$NMonth = $Month->nextMonth('object'); -$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); -?> - - - - Calendar - - - - - -build($selectedDays); -?> -

Built with Calendar_Month_Weekday::build()

- - - - - - - - - - - -fetch() ) { - - // Build a link string for each day - $link = $_SERVER['PHP_SELF']. - '?y='.$Day->thisYear(). - '&m='.$Day->thisMonth(). - '&d='.$Day->thisDay(); - - // isFirst() to find start of week - if ( $Day->isFirst() ) - echo ( "\n" ); - - if ( $Day->isSelected() ) { - echo ( "\n" ); - } else if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - - // isLast() to find end of week - if ( $Day->isLast() ) - echo ( "\n" ); -} -?> - - - - - -
-getTimeStamp())); ?> -
MTWTFSS
".$Day->thisDay()." ".$Day->thisDay()."
-<< -  - >> -
-Took: '.(getmicrotime()-$start).' seconds

' ); -?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.phps deleted file mode 100644 index f92dcbbc9..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/3.phps +++ /dev/null @@ -1,134 +0,0 @@ -prevMonth('object'); // Get previous month as object -$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); -$NMonth = $Month->nextMonth('object'); -$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); -?> - - - - Calendar - - - - - -build($selectedDays); -?> -

Built with Calendar_Month_Weekday::build()

- - - - - - - - - - - -fetch() ) { - - // Build a link string for each day - $link = $_SERVER['PHP_SELF']. - '?y='.$Day->thisYear(). - '&m='.$Day->thisMonth(). - '&d='.$Day->thisDay(); - - // isFirst() to find start of week - if ( $Day->isFirst() ) - echo ( "\n" ); - - if ( $Day->isSelected() ) { - echo ( "\n" ); - } else if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - - // isLast() to find end of week - if ( $Day->isLast() ) - echo ( "\n" ); -} -?> - - - - - -
-getTimeStamp())); ?> -
MTWTFSS
".$Day->thisDay()." ".$Day->thisDay()."
-<< -  - >> -
-Took: '.(getmicrotime()-$start).' seconds

' ); -?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.php deleted file mode 100644 index 034813ee3..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.php +++ /dev/null @@ -1,49 +0,0 @@ -Result: '.$Unit->thisYear().'-'.$Unit->thisMonth().'-'.$Unit->thisDay(). - ' '.$Unit->thisHour().':'.$Unit->thisMinute().':'.$Unit->thisSecond(); -if ($Unit->isValid()) { - echo ' is valid!

'; -} else { - $V= & $Unit->getValidator(); - echo ' is invalid:

'; - while ($error = $V->fetch()) { - echo $error->toString() .'
'; - } -} -?> -

Enter a date / time to validate:

-
-Year:
-Month:
-Day:
-Hour:
-Minute:
-Second:
- -
-

Note: Error messages can be controlled with the constants CALENDAR_VALUE_TOOSMALL and CALENDAR_VALUE_TOOLARGE - see Calendar_Validator.php

- -Took: '.(getmicrotime()-$start).' seconds

'; ?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.phps deleted file mode 100644 index 034813ee3..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/4.phps +++ /dev/null @@ -1,49 +0,0 @@ -Result: '.$Unit->thisYear().'-'.$Unit->thisMonth().'-'.$Unit->thisDay(). - ' '.$Unit->thisHour().':'.$Unit->thisMinute().':'.$Unit->thisSecond(); -if ($Unit->isValid()) { - echo ' is valid!

'; -} else { - $V= & $Unit->getValidator(); - echo ' is invalid:

'; - while ($error = $V->fetch()) { - echo $error->toString() .'
'; - } -} -?> -

Enter a date / time to validate:

-
-Year:
-Month:
-Day:
-Hour:
-Minute:
-Second:
- -
-

Note: Error messages can be controlled with the constants CALENDAR_VALUE_TOOSMALL and CALENDAR_VALUE_TOOLARGE - see Calendar_Validator.php

- -Took: '.(getmicrotime()-$start).' seconds

'; ?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.php deleted file mode 100644 index ce5ae7e00..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.php +++ /dev/null @@ -1,132 +0,0 @@ - - - - - Select and Update - - -

Select and Update

-isValid() ) { - $V= & $Second->getValidator(); - echo ('

Validation failed:

' ); - while ( $error = $V->fetch() ) { - echo ( $error->toString() .'
' ); - } - } else { - echo ('

Validation success.

' ); - echo ( '

New timestamp is: '.$Second->getTimeStamp().' which could be used to update a database, for example'); - } -} else { -$Year = new Calendar_Year($_POST['y']); -$Month = new Calendar_Month($_POST['y'],$_POST['m']); -$Day = new Calendar_Day($_POST['y'],$_POST['m'],$_POST['d']); -$Hour = new Calendar_Hour($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h']); -$Minute = new Calendar_Minute($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i']); -$Second = new Calendar_Second($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i'],$_POST['s']); -?> -

Set the alarm clock

-
-Year:   -Month:  -Day:  -Hour:  -Minute:  -Second:  -
- -Took: '.(getmicrotime()-$start).' seconds

' ); ?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.phps deleted file mode 100644 index ce5ae7e00..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/5.phps +++ /dev/null @@ -1,132 +0,0 @@ - - - - - Select and Update - - -

Select and Update

-isValid() ) { - $V= & $Second->getValidator(); - echo ('

Validation failed:

' ); - while ( $error = $V->fetch() ) { - echo ( $error->toString() .'
' ); - } - } else { - echo ('

Validation success.

' ); - echo ( '

New timestamp is: '.$Second->getTimeStamp().' which could be used to update a database, for example'); - } -} else { -$Year = new Calendar_Year($_POST['y']); -$Month = new Calendar_Month($_POST['y'],$_POST['m']); -$Day = new Calendar_Day($_POST['y'],$_POST['m'],$_POST['d']); -$Hour = new Calendar_Hour($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h']); -$Minute = new Calendar_Minute($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i']); -$Second = new Calendar_Second($_POST['y'],$_POST['m'],$_POST['d'],$_POST['h'],$_POST['i'],$_POST['s']); -?> -

Set the alarm clock

- -Year:   -Month:  -Day:  -Hour:  -Minute:  -Second:  -
- -Took: '.(getmicrotime()-$start).' seconds

' ); ?> - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.php deleted file mode 100644 index 591c05d7e..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.php +++ /dev/null @@ -1,210 +0,0 @@ -' ); -?> - - -Personal Planner Rendered with WML - -

Viewing getTimeStamp()) ); ?>

-

- -Back to Month View -"/> - -

- -build(); - while ( $Hour = & $Day->fetch() ) { - echo ( "\n" ); - echo ( "\n" ); - echo ( "\n" ); - } -?> -
".date('g a',$Hour->getTimeStamp())."Free time!
- -

getTimeStamp()) ); ?>

- - - - -build($selection); -while ( $Day = $Month->fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else if ( $Day->isSelected() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - if ( $Day->isLast() ) { - echo ( "\n" ); - } -} -?> - - - - - -
MTWTFSS
".$Day->thisDay()."\nthisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "&mime=wml\" />\n".$Day->thisDay()."\nthisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "&mime=wml\" />
- -<< -"/> - - - ->> -"/> - -
- - -

Back to HTML

-Took: '.(getmicrotime()-$start).' seconds

' ); ?> -
- - - - - HTML (+WML) Personal Planner - - -

Personal Planner Rendered with HTML

-

To view in WML, click here or place a ?mime=wml at the end of any URL. -Note that Opera supports WML natively and Mozilla / Firefox has the WMLBrowser -plugin: wmlbrowser.mozdev.org

- -

Viewing getTimeStamp()) ); ?>

-

- -Back to Month View -

- -build(); - while ( $Hour = & $Day->fetch() ) { - echo ( "\n" ); - echo ( "\n" ); - echo ( "\n" ); - } -?> -
".date('g a',$Hour->getTimeStamp())."Free time!
- -

getTimeStamp()) ); ?>

- - - - -build($selection); -while ( $Day = $Month->fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else if ( $Day->isSelected() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - if ( $Day->isLast() ) { - echo ( "\n" ); - } -} -?> - - - - - -
MTWTFSS
thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "&wml\">".$Day->thisDay()."thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "\">".$Day->thisDay()."
- -<< - ->> -
- - - - -Took: '.(getmicrotime()-$start).' seconds

' ); ?> - - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.phps deleted file mode 100644 index 591c05d7e..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/6.phps +++ /dev/null @@ -1,210 +0,0 @@ -' ); -?> - - -Personal Planner Rendered with WML - -

Viewing getTimeStamp()) ); ?>

-

- -Back to Month View -"/> - -

- -build(); - while ( $Hour = & $Day->fetch() ) { - echo ( "\n" ); - echo ( "\n" ); - echo ( "\n" ); - } -?> -
".date('g a',$Hour->getTimeStamp())."Free time!
- -

getTimeStamp()) ); ?>

- - - - -build($selection); -while ( $Day = $Month->fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else if ( $Day->isSelected() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - if ( $Day->isLast() ) { - echo ( "\n" ); - } -} -?> - - - - - -
MTWTFSS
".$Day->thisDay()."\nthisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "&mime=wml\" />\n".$Day->thisDay()."\nthisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "&mime=wml\" />
- -<< -"/> - - - ->> -"/> - -
- - -

Back to HTML

-Took: '.(getmicrotime()-$start).' seconds

' ); ?> -
- - - - - HTML (+WML) Personal Planner - - -

Personal Planner Rendered with HTML

-

To view in WML, click here or place a ?mime=wml at the end of any URL. -Note that Opera supports WML natively and Mozilla / Firefox has the WMLBrowser -plugin: wmlbrowser.mozdev.org

- -

Viewing getTimeStamp()) ); ?>

-

- -Back to Month View -

- -build(); - while ( $Hour = & $Day->fetch() ) { - echo ( "\n" ); - echo ( "\n" ); - echo ( "\n" ); - } -?> -
".date('g a',$Hour->getTimeStamp())."Free time!
- -

getTimeStamp()) ); ?>

- - - - -build($selection); -while ( $Day = $Month->fetch() ) { - if ( $Day->isFirst() ) { - echo ( "\n" ); - } - if ( $Day->isEmpty() ) { - echo ( "\n" ); - } else if ( $Day->isSelected() ) { - echo ( "\n" ); - } else { - echo ( "\n" ); - } - if ( $Day->isLast() ) { - echo ( "\n" ); - } -} -?> - - - - - -
MTWTFSS
thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "&wml\">".$Day->thisDay()."thisYear()."&m=".$Day->thisMonth()."&d=".$Day->thisDay(). - "\">".$Day->thisDay()."
- -<< - ->> -
- - - - -Took: '.(getmicrotime()-$start).' seconds

' ); ?> - - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.php deleted file mode 100644 index bdffd956c..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.php +++ /dev/null @@ -1,92 +0,0 @@ -__dispatch_map['getMonth'] = - array('in' => array('year' => 'int', 'month'=>'int'), - 'out' => array('month' => '{urn:PEAR_SOAP_Calendar}Month'), - ); - $this->__typedef['Month'] = array ( - 'monthname' => 'string', - 'days' => '{urn:PEAR_SOAP_Calendar}MonthDays' - ); - $this->__typedef['MonthDays'] = array (array ('{urn:PEAR_SOAP_Calendar}Day')); - $this->__typedef['Day'] = array ( - 'isFirst' => 'int', - 'isLast' => 'int', - 'isEmpty' => 'int', - 'day' => 'int' ); - } - - function __dispatch($methodname) - { - if (isset($this->__dispatch_map[$methodname])) - return $this->__dispatch_map[$methodname]; - return NULL; - } - - function getMonth($year, $month) - { - require_once(CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php'); - $Month = & new Calendar_Month_Weekdays($year,$month); - if (!$Month->isValid()) { - $V = & $Month->getValidator(); - $errorMsg = ''; - while ($error = $V->fetch()) { - $errorMsg .= $error->toString()."\n"; - } - return new SOAP_Fault($errorMsg, 'Client'); - } else { - $monthname = date('F Y', $Month->getTimeStamp()); - $days = array(); - $Month->build(); - while ($Day = & $Month->fetch()) { - $day = array( - 'isFirst' => (int)$Day->isFirst(), - 'isLast' => (int)$Day->isLast(), - 'isEmpty' => (int)$Day->isEmpty(), - 'day' => (int)$Day->thisDay(), - ); - $days[] = $day; - } - return array('monthname' => $monthname, 'days' => $days); - } - } -} - -$server = new SOAP_Server(); -$server->_auto_translation = true; -$calendar = new Calendar_Server(); -$server->addObjectMap($calendar, 'urn:PEAR_SOAP_Calendar'); - -if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') { - $server->service($GLOBALS['HTTP_RAW_POST_DATA']); -} else { - require_once 'SOAP'.DIRECTORY_SEPARATOR.'Disco.php'; - $disco = new SOAP_DISCO_Server($server, "PEAR_SOAP_Calendar"); - if (isset($_SERVER['QUERY_STRING']) && - strcasecmp($_SERVER['QUERY_STRING'], 'wsdl')==0) { - header("Content-type: text/xml"); - echo $disco->getWSDL(); - } else { - echo 'This is a PEAR::SOAP Calendar Server. For client try here
'; - echo 'For WSDL try here'; - } - exit; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.phps deleted file mode 100644 index bdffd956c..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/7.phps +++ /dev/null @@ -1,92 +0,0 @@ -__dispatch_map['getMonth'] = - array('in' => array('year' => 'int', 'month'=>'int'), - 'out' => array('month' => '{urn:PEAR_SOAP_Calendar}Month'), - ); - $this->__typedef['Month'] = array ( - 'monthname' => 'string', - 'days' => '{urn:PEAR_SOAP_Calendar}MonthDays' - ); - $this->__typedef['MonthDays'] = array (array ('{urn:PEAR_SOAP_Calendar}Day')); - $this->__typedef['Day'] = array ( - 'isFirst' => 'int', - 'isLast' => 'int', - 'isEmpty' => 'int', - 'day' => 'int' ); - } - - function __dispatch($methodname) - { - if (isset($this->__dispatch_map[$methodname])) - return $this->__dispatch_map[$methodname]; - return NULL; - } - - function getMonth($year, $month) - { - require_once(CALENDAR_ROOT.'Month'.DIRECTORY_SEPARATOR.'Weekdays.php'); - $Month = & new Calendar_Month_Weekdays($year,$month); - if (!$Month->isValid()) { - $V = & $Month->getValidator(); - $errorMsg = ''; - while ($error = $V->fetch()) { - $errorMsg .= $error->toString()."\n"; - } - return new SOAP_Fault($errorMsg, 'Client'); - } else { - $monthname = date('F Y', $Month->getTimeStamp()); - $days = array(); - $Month->build(); - while ($Day = & $Month->fetch()) { - $day = array( - 'isFirst' => (int)$Day->isFirst(), - 'isLast' => (int)$Day->isLast(), - 'isEmpty' => (int)$Day->isEmpty(), - 'day' => (int)$Day->thisDay(), - ); - $days[] = $day; - } - return array('monthname' => $monthname, 'days' => $days); - } - } -} - -$server = new SOAP_Server(); -$server->_auto_translation = true; -$calendar = new Calendar_Server(); -$server->addObjectMap($calendar, 'urn:PEAR_SOAP_Calendar'); - -if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') { - $server->service($GLOBALS['HTTP_RAW_POST_DATA']); -} else { - require_once 'SOAP'.DIRECTORY_SEPARATOR.'Disco.php'; - $disco = new SOAP_DISCO_Server($server, "PEAR_SOAP_Calendar"); - if (isset($_SERVER['QUERY_STRING']) && - strcasecmp($_SERVER['QUERY_STRING'], 'wsdl')==0) { - header("Content-type: text/xml"); - echo $disco->getWSDL(); - } else { - echo 'This is a PEAR::SOAP Calendar Server. For client try here
'; - echo 'For WSDL try here'; - } - exit; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.php deleted file mode 100644 index f84887953..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.php +++ /dev/null @@ -1,70 +0,0 @@ -") ) { - die('PHP 5 has problems with PEAR::SOAP Client (8.0RC3) - - remove @ before include below to see why'); -} - -if (!@include('SOAP'.DIRECTORY_SEPARATOR.'Client.php')) { - die('You must have PEAR::SOAP installed'); -} - -// Just to save manaul modification... -$basePath = explode('/', $_SERVER['SCRIPT_NAME']); -array_pop($basePath); -$basePath = implode('/', $basePath); -$url = 'http://'.$_SERVER['SERVER_NAME'].$basePath.'/7.php?wsdl'; - -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); -if (!isset($_GET['m'])) $_GET['m'] = date('n'); - -$wsdl = new SOAP_WSDL ($url); - -echo ( '
'.$wsdl->generateProxyCode().'
' ); - -$calendarClient = $wsdl->getProxy(); - -$month = $calendarClient->getMonth((int)$_GET['y'],(int)$_GET['m']); - -if ( PEAR::isError($month) ) { - die ( $month->toString() ); -} -?> - - - - Calendar over the Wire - - -

Calendar Over the Wire (featuring PEAR::SOAP)

- - - - - -days as $day ) { - - if ( $day->isFirst === 1 ) - echo ( "\n" ); - if ( $day->isEmpty === 1 ) { - echo ( "" ); - } else { - echo ( "" ); - } - if ( $day->isLast === 1 ) - echo ( "\n" ); -} -?> - -
monthname );?>
MTWTFSS
".$day->day."
-

Enter Year and Month to View:

- -Year:   -Month:   - - - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.phps deleted file mode 100644 index f84887953..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/8.phps +++ /dev/null @@ -1,70 +0,0 @@ -") ) { - die('PHP 5 has problems with PEAR::SOAP Client (8.0RC3) - - remove @ before include below to see why'); -} - -if (!@include('SOAP'.DIRECTORY_SEPARATOR.'Client.php')) { - die('You must have PEAR::SOAP installed'); -} - -// Just to save manaul modification... -$basePath = explode('/', $_SERVER['SCRIPT_NAME']); -array_pop($basePath); -$basePath = implode('/', $basePath); -$url = 'http://'.$_SERVER['SERVER_NAME'].$basePath.'/7.php?wsdl'; - -if (!isset($_GET['y'])) $_GET['y'] = date('Y'); -if (!isset($_GET['m'])) $_GET['m'] = date('n'); - -$wsdl = new SOAP_WSDL ($url); - -echo ( '
'.$wsdl->generateProxyCode().'
' ); - -$calendarClient = $wsdl->getProxy(); - -$month = $calendarClient->getMonth((int)$_GET['y'],(int)$_GET['m']); - -if ( PEAR::isError($month) ) { - die ( $month->toString() ); -} -?> - - - - Calendar over the Wire - - -

Calendar Over the Wire (featuring PEAR::SOAP)

- - - - - -days as $day ) { - - if ( $day->isFirst === 1 ) - echo ( "\n" ); - if ( $day->isEmpty === 1 ) { - echo ( "" ); - } else { - echo ( "" ); - } - if ( $day->isLast === 1 ) - echo ( "\n" ); -} -?> - -
monthname );?>
MTWTFSS
".$day->day."
-

Enter Year and Month to View:

-
-Year:   -Month:   - -
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.php b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.php deleted file mode 100644 index 4b6a937a4..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.php +++ /dev/null @@ -1,16 +0,0 @@ -getTimeStamp())); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.phps b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.phps deleted file mode 100644 index 4b6a937a4..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/9.phps +++ /dev/null @@ -1,16 +0,0 @@ -getTimeStamp())); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/index.html b/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/index.html deleted file mode 100644 index 869b8f3bd..000000000 --- a/campcaster/src/tools/pear/src/docs/Calendar/docs/examples/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - PEAR::Calendar Examples - - - - -

PEAR::Calendar Examples

-

$Id: index.html,v 1.5 2004/08/16 13:15:48 hfuecks Exp $

-
    -
  • 1.php [src] - shows basic usage, passing all the way down from Calendar_Year to Calendar_Second - more of a quick test it's working
  • -
  • 2.php [src] - shows how to build a tabular month using Calendar_Month_Weeks, Calendar_Week, Calendar_Day as well as selecting some dates.
  • -
  • 3.php [src] - shows how to build a tabular month using Calendar_Month_Weekdays and Calendar_Day, as well as selecting some dates (this method is faster).
  • -
  • 4.php [src] - shows how to use PEAR::Calendar for validation.
  • -
  • 5.php [src] - shows PEAR::Calendar in use to help generate a form.
  • -
  • 6.php [src] - a month and day "planner" calendar, which can be rendered both as HTML and WML.
  • -
  • 7.php [src] - a simple SOAP Calendar Server, using PEAR::SOAP and PEAR::Calendar
  • -
  • 8.php [src] - a WSDL SOAP client for the SOAP Calendar Server
  • -
  • 9.php [src] - quick example of i18n with setlocale (not working on SF)
  • -
  • 10.php [src] - an example of extending Calendar_Decorator to modify output
  • -
  • 11.php [src] - attaching a "payload" (e.g. results of a DB query) to a calendar using Calendar_Decorator to allow the payload to be available inside the main loop.
  • -
  • 12.php [src] - a complete year with months.
  • -
  • 13.php [src] - same as 1.php but using Calendar_Engine_PearDate, (see PEAR::Date).
  • -
  • 14.php [src] - same as 3.php but using Calendar_Engine_PearDate
  • -
  • 15.php [src] - paging through weeks
  • -
  • 16.php [src] - demonstrates using the Uri decorator. Note you should prefer Calendar_Util_Uri (see below) in most cases, for performance
  • -
  • 17.php [src] - demonstrates using the Textual decorator
  • -
  • 18.php [src] - demonstrates using the Wrapper decorator
  • -
  • 19.php [src] - demonstrates using the Weekday decorator
  • -
  • 20.php [src] - shows how to attach a "payload" spanning multiple days, with more than one entry per day
  • -
  • 21.php [src] - same as 12.php but using Calendar_Month_Weeks instead of Calendar_Month_Weekdays to allow the week in the year or week in the month to be displayed.
  • -
  • 22.php [src] - demonstrates use of Calendar_Util_Uri.
  • -
  • 23.php [src] - demonstrates use of Calendar_Util_Textual.
  • -
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/DB/doc/IDEAS b/campcaster/src/tools/pear/src/docs/DB/doc/IDEAS deleted file mode 100644 index afa661a30..000000000 --- a/campcaster/src/tools/pear/src/docs/DB/doc/IDEAS +++ /dev/null @@ -1,90 +0,0 @@ -Abstracted Types (Stig) ------------------------ - -DB needs a set of types representing the most commonly used types in -all backends. This type set could also be geared towards integration -with things like XML-RPC/SOAP implementations, HTML form classes, etc. - -Real Query Parser (Stig) ------------------------- - -With a real query parser, DB can implement more of its portability -based on the query, instead of having support functions for -everything. One example would be LIMIT, another "INSERT -... RETURNING". - -Portable transactions (Stig) ----------------------------- - -If DB can parse queries enough to determine what tables are affected -by queries, it should be possible to make a replayable transaction -log. GNOME uses an XML format for configuration data that lets you -checkpoint state once in a while, and revert to that state later. -With a similar approach for transactions in DB we can implement -portable transactions and checkpointing even for the databases that -don't support them. - - -Error reporting clean-up/debug (Tomas) -------------------------------------- -Now each driver has its own raiseError method, common has a raiseError and -DB has a DB_error class and its own isError() method. This error stuff -overhead could be simplified with only one raiseError, droping the DB Error -class and also the DB::isError() (use the PEAR.php ones instead). -Other idea could be to add a system for allowing people access to all the -queries sended by PEAR DB to the backend. Also a new PEAR_ERROR_DEBUG -flag that automatically (show|triggers) debug info, perhaps -with a new PEAR_(Warning|Debug) object. - -Quote clean-up (Stig) ---------------------- -1. Keep quote and quoteString, but move quoting of strings back into - quoteString and make quote call it for strings. - -2. Add an optional "operator" parameter to quote that is one of "=", - "<", ">" or "<>" that will be inserted in front of the quoted value - unless it is NULL, in which case it will be converted to "IS" (for - "=") or "IS NOT" (for the others). - -Auto free statements (Tomas) ----------------------------- -By setting a param in query() or for the hole DB instance, PEAR DB -could auto-free results in DB_result->fetch(Into|Row) when the driver -returns false. - -Datatypes in prepare syntax (Tomas) ------------------------------------ -Extend the actual prepare/execute placeholders to support data types, both -to check the data introduced to the query and to "cast" the result -to native php data types. Ex: - -$sql = "INSERT INTO table VALUES ({{int(4)}}, {{bool}}, {{date('Y-m-d')}})"; -$row = $db->query($sql, array(8, 't', '2001-04-1')); - -Format: {{(,)}} - -"param" could be the max lenght of the data, date formats, not_null -checks or default values. - -Other ideas could be: - -1) -$sql = "INSERT INTO table VALUES (?, ?, ?)"; -$sth = $db->prepare($sql, array('int(4)', 'bool', 'date'); -$res = $db->execute($sth, array($a, $b, $c); - -2) -$sql = "INSERT INTO table VALUES (?, ?, ?)"; -$params = array( - 0 => array($a, 'int(4)'), - 1 => array($b, 'bool') -); -$res = $db->query($sql, $params); - -Auto connect feature (Tomas) ----------------------------- -Add the ability to create for example a light and dump DB object which -will only set up the connection when needed. With that people could -create the DB object in a common prepend or default file without the -need to waste system resources if the use of the database is finally -not needed. diff --git a/campcaster/src/tools/pear/src/docs/DB/doc/MAINTAINERS b/campcaster/src/tools/pear/src/docs/DB/doc/MAINTAINERS deleted file mode 100644 index 750f6275f..000000000 --- a/campcaster/src/tools/pear/src/docs/DB/doc/MAINTAINERS +++ /dev/null @@ -1,16 +0,0 @@ -Maintainers for DB database backends/drivers: - -dbase : Daniel Convissor -fbsql : Daniel Convissor - Frank M. Kromann -ibase : Daniel Convissor -ifx : Daniel Convissor -msql : Daniel Convissor -mssql : Daniel Convissor -mysql : Daniel Convissor -mysqli : Daniel Convissor -oci8 : Daniel Convissor -odbc : Daniel Convissor -pgsql : Daniel Convissor -sqlite : Daniel Convissor -sybase : Daniel Convissor diff --git a/campcaster/src/tools/pear/src/docs/DB/doc/STATUS b/campcaster/src/tools/pear/src/docs/DB/doc/STATUS deleted file mode 100644 index cabaeef56..000000000 --- a/campcaster/src/tools/pear/src/docs/DB/doc/STATUS +++ /dev/null @@ -1,93 +0,0 @@ -STATUS OF THE PEAR DB PACKAGE -============================= - -$Id: STATUS,v 1.33 2005/02/22 15:45:36 danielc Exp $ ------------------------------------------------------------------------- - -DB Driver Feature Matrix ------------------------- -Symbols: - x = implemented, but without tests - t = implemented, but one or more tests fail - T = implemented, passing all tests - e = emulated, without tests - l = emulated, but one or more tests fail - E = emulated, passing all tests - n = returns "not capable" - - = no implementation of this feature or status unknown - - fbsql ifx mssql mysqli odbc sqlite -FEATURE dbase | ibase | msql | mysql | oci8 | pgsql | sybase -simpleQuery - T T T T T T T T T T T T -numCols x T T T T T T T T T T T T -numRows x T E E T T T T E T T T T -errorNative n T T T T T T T T T T E T -prepare/execute e E T E E E E E T E E E E -sequences n T T n T T T T T E T E T -affectedRows n T E E T T T T T T E T T -fetch modes x T T T T T T T T T T T T -fetch row by no x x n n x x x x n x x x x -transactions - T T T n T T T T T T n T -auto-commit n T E E n E E E E T E n E -error mapping - T T T T T T T T T T T T -tableInfo x T T t T T T T T T T T T - -getListOf() TYPES -tables - T T T T T T T T T T T T -views - T T - - T - - - T T - T -users - T T - - - T T - - T - - -databases - - - - T - T T - T T - - -functions - T - - - - - - - - T - - -synonyms - - - - - - - - T - - - - - - -Test Conformance ----------------- -Symbols: - o = Test passed - X = Test failed - L = Some portions of the test failed due to limitations in PHP or DBMS - n = Test returns "not capable" - - = Not tested - - fbsql ifx mssql mysqli odbc sqlite - dbase | ibase | msql | mysql | oci8 | pgsql | sybase -01connect o o o o o o o o o o o o o -02fetch - o o o o o o o o o o o o -03simplequery - o o o o o o o o o o o o -04numcols - o o o o o o o o o o o o -05sequences - o o o o o o o o o o o o -06prepexec - o o o L o o o o o o o o -08affectedrows - o o o o o o o o o o o o -09numrows - o o o o o o o o o o o o -10errormap - o o o o o o o o o o o o -11transactions - o o o n o o o o o o n o -13limit - o o o o o o o o o o o o -14fetchmode_obje - o o o o o o o o o o o o -15quote - o o o o o o o o o o o o -16tableinfo - o o L o o o o o o o o o -17query - o o o o o o o o o o o o -18get - o o o o o o o o o o o o -19getlistof - o o o o o o o o o o o o - - -DBMS Versions Tested --------------------- -dbase n/a -fbsql 4.1.6 -ibase Firebird 1.5.1 (PHP 5 only) -ifx 7.2 Standard Edtition -msql 3.6 (PHP snapshots dated 2005-02-18) -mssql 8.0.760 -mysql 4.0.21 -mysqli 4.1.5 (PHP 5 only) -oci8 9.2 -odbc DB2 ESE 8.1 and MS Access 2000 -pgsql 7.4.1 and 8.0.1 -sqlite PHP 5: extension. PHP 4: PECL snapshot. -sybase ASE 12.5.3 - -Tests were performed under both of the following PHP versions -unles otherwise noted: - 4.3.11-dev dated 2005-02-22 - 5.1.0-dev dated 2005-02-22 diff --git a/campcaster/src/tools/pear/src/docs/DB/doc/TESTERS b/campcaster/src/tools/pear/src/docs/DB/doc/TESTERS deleted file mode 100644 index 0eb4b20f7..000000000 --- a/campcaster/src/tools/pear/src/docs/DB/doc/TESTERS +++ /dev/null @@ -1,156 +0,0 @@ -=================== -HOW TO TEST PEAR DB -=================== - -$Id: TESTERS,v 1.20 2005/02/16 06:33:12 danielc Exp $ - - -INTRODUCTION -============ - -These are instructions for testing PEAR DB on a Windows machine using a -Cygwin Bash shell. Adjust the paths and commands to match your system. -This configuration is used because these precise steps are known to work. - -NOTE: You must log on as a user which has permissions to modify the -contents of your PHP executable's directory. This is necessary for both -configuring AND running the test system. - - -INSTALLATION -============ - -Obtain PHP's Test Framework ---------------------------- -If you don't have PHP's test framework, you need to obtain it. These -steps include changing the working directory, downloading run-tests.php -via CVS and copying the file into place. Change the revision flag in the -CVS command as appropriate for your present version of PHP. - - cd c:/progra~1/php - cvs -d :pserver:cvsread@cvs.php.net:/repository login # password is phpfi - cvs -d :pserver:cvsread@cvs.php.net:/repository co -r PHP_4_3 \ - -d test php-src/run-tests.php - cp test/run-tests.php . - rm -rf test - - -Obtain DB and its Test Framework --------------------------------- -* IF PEAR DB IS ALREADY INSTALLED: - - If you have PEAR DB installed already, good. The test suite - is in place. Open up a command/shell prompt and move into - the test directory. - - cd /tests/DB/tests - -* VIA A NEW INSTALLATION USING THE PEAR INSTALLER: - - Installing PEAR has gotten fairly easy. Follow the instructions - from the manual: http://pear.php.net/manual/en/installation.php - Once PEAR and DB are installed, move to the test directory. - - cd pear/tests/DB/tests - -* VIA CVS: - - Create a location to store the test installation of DB and its - test scripts. - - mkdir d:/peartest - cd d:/peartest - cvs -d :pserver:cvsread@cvs.php.net:/repository co -P pear/DB - - We assume you already have the PEAR base package installed. If - you don't, you will need to do so, but the instructions for - doing that are beyond the scope of this document. See - http://pear.php.net/manual/en/installation.php for more info. - - Move to the test directory. - - cd pear/DB/tests - - -Copy the Starter Shell Script and Edit the Paths ------------------------------------------------- -To make starting up each test run easier, we have included two shell -scripts. The original files are named "run.cvs". They need to be -renamed to "run" so CVS won't bother you with tracking them. Then, -the paths and file names in them need to be set to those used by -your system. - - cp run.cvs run - chmod 755 run - vi run - - cd driver - cp run.cvs run - chmod 755 run - vi run - - -Copy the Setup File and Edit the DSN's --------------------------------------- -The test suite contains a file that stores the DSN's needed to -connect to your database. The original file is "setup.inc.cvs" -and it needs to be renamed "setup.inc" so CVS won't track it. -Then you'll need to edit the DSN's in it. - - cp setup.inc.cvs setup.inc - vi setup.inc - - -RUN THE TESTS -============= - -To run all tests: ./run -To run one test: ./run -Example: ./run db_parsedsn.phpt - - -Test Types and Locations ------------------------- -tests Common PEAR DB tests -tests/driver Common tests for all the drivers - - -Results and What To Do With Them --------------------------------- -Each test that fails generates a .php (which you can execute), a .exp -(the expected output), a .out (the test output) and a .diff (a diff -u -from the .exp and .out files). - -If you run the tests, please report or fill the TEST CONFORMANCE table -in the STATUS document. Before any commit to CVS be sure to run the -tests and nothing got broken with the change. - -If you get the message "SKIP", means that the test it's not executed. -Look at the DB/tests/driver/skipif.inc to see what's the problem -(probably a connection problem). - - -DB TESTER MATRIX -================ - fbsql ifx mssql mysqli odbc sqlite -TESTER dbase | ibase | msql | mysql | oci8 | pgsql | sybase -John Horton - - - X - - - - - - - - - -Tim Zickus - - - - - - - - X - - - - -Tim Parkin - - - - - - - - X - - - - -Paul Gardiner - - - X - - - - - - - - - -peterwb@iafrica.com - - - X - - - - - - - - - -Daniel, Adam - - - - - - - - X - - - - -szii@sziisoft.com - - - - - - - - - X¹ - - - -jmh3@linuxfreak.com - - - - - - - - - - X - - -Kevin Henrikson - - - - - - - - X - - - - -Stig Bakken - - - - - - X - - - X - - -Chuck Hagenbuch - - - - - X - - - - - - - -Ludovico Magnocavallo - - X - - - - - - - - - - -Daniel Convissor X X X - X X X X X X² X X X - -MISSING TESTERS - - - - - - - - - - - - - - -Comments: - -[1]: ODBC using IBM DB2 -[2]: ODBC using IBM DB2 and MS Access diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/elements.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/elements.php deleted file mode 100644 index 93fd51ded..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/elements.php +++ /dev/null @@ -1,154 +0,0 @@ - -* @author Bertrand Mansion -* @author Alexey Borzov -* @version 3.2 -* -* $Id: elements.php,v 1.2 2004/03/22 10:05:09 mansion Exp $ -*/ - -require_once 'HTML/QuickForm.php'; - -$form =& new HTML_QuickForm('frmTest', 'get'); - -// Use a two-label template for the elements that require some comments -$twoLabel = <<<_HTML - - - *{label} - - - {error}
{element} -
{label_2} - - -_HTML; - -$renderer =& $form->defaultRenderer(); -$renderer->setElementTemplate($twoLabel, 'iadvChk'); -$renderer->setElementTemplate($twoLabel, 'iautoComp'); - -// Fills with some defaults values -$form->setDefaults(array( - 'itxtTest' => 'Test Text Box', - 'itxaTest' => 'Hello World', - 'ichkTest' => true, - 'iradTest' => 1, - 'iselTest' => array('B', 'C'), - 'name' => array('first'=>'Adam', 'last'=>'Daniel'), - 'phoneNo' => array('513', '123', '3456'), - 'iradYesNo' => 'Y', - 'ichkABC' => array('A'=>true,'B'=>true), - 'dateTest1' => array('d'=>11, 'm'=>1, 'Y'=>2003) -)); - -$form->setConstants(array( - 'dateTest3' => time() -)); - -// Elements will be displayed in the order they are declared -$form->addElement('header', '', 'Normal Elements'); -// Classic form elements -$form->addElement('hidden', 'ihidTest', 'hiddenField'); -$form->addElement('text', 'itxtTest', 'Test Text:'); -$form->addElement('textarea', 'itxaTest', 'Test TextArea:', array('rows' => 3, 'cols' => 20)); -$form->addElement('password', 'ipwdTest', 'Test Password:'); -$form->addElement('checkbox', 'ichkTest', 'Test CheckBox:', 'Check the box'); -$form->addElement('radio', 'iradTest', 'Test Radio Buttons:', 'Check the radio button #1', 1); -$form->addElement('radio', 'iradTest', '(Not a group)', 'Check the radio button #2', 2); -$form->addElement('button', 'ibtnTest', 'Test Button', array('onclick' => "alert('This is a test');")); -$form->addElement('reset', 'iresTest', 'Test Reset'); -$form->addElement('submit', 'isubTest', 'Test Submit'); -$form->addElement('image', 'iimgTest', 'http://pear.php.net/gifs/pear-icon.gif'); -$select =& $form->addElement('select', 'iselTest', 'Test Select:', array('A'=>'A', 'B'=>'B','C'=>'C','D'=>'D')); -$select->setSize(5); -$select->setMultiple(true); - -$form->addElement('header', '', 'Custom Elements'); -// Date elements -$form->addElement('date', 'dateTest1', 'Date1:', array('format'=>'dmY', 'minYear'=>2010, 'maxYear'=>2001)); -$form->addElement('date', 'dateTest2', 'Date2:', array('format'=>'d-F-Y H:i', 'language'=>'de', 'optionIncrement' => array('i' => 5))); -$form->addElement('date', 'dateTest3', 'Today is:', array('format'=>'l d M Y')); - -$main[0] = "Pop"; -$main[1] = "Rock"; -$main[2] = "Classical"; - -$secondary[0][0] = "Belle & Sebastian"; -$secondary[0][1] = "Elliot Smith"; -$secondary[0][2] = "Beck"; -$secondary[1][3] = "Noir Desir"; -$secondary[1][4] = "Violent Femmes"; -$secondary[2][5] = "Wagner"; -$secondary[2][6] = "Mozart"; -$secondary[2][7] = "Beethoven"; - -$opts[] = $main; -$opts[] = $secondary; - -$hs =& $form->addElement('hierselect', 'ihsTest', 'Hierarchical select:', array('style' => 'width: 20em;'), '
'); -$hs->setOptions($opts); - -$form->addElement('advcheckbox', 'iadvChk', array('Advanced checkbox:', 'Unlike standard checkbox, this element has a value
when it is not checked.'), 'Check the box', null, array('off', 'on')); - -$form->addElement('autocomplete', 'iautoComp', array('Your favourite fruit:', 'This is autocomplete element.
Start typing and see how it suggests possible completions.'), array('Pear', 'Orange', 'Apple'), array('size' => 30)); - - -$form->addElement('header', '', 'Grouped Elements'); -// Grouped elements -$name['last'] = &HTML_QuickForm::createElement('text', 'last', null, array('size' => 30)); -$name['first'] = &HTML_QuickForm::createElement('text', 'first', null, array('size' => 20)); -$form->addGroup($name, 'name', 'Name (last, first):', ', '); -// Creates a group of text inputs -$areaCode = &HTML_QuickForm::createElement('text', '', null, array('size' => 3, 'maxlength' => 3)); -$phoneNo1 = &HTML_QuickForm::createElement('text', '', null, array('size' => 3, 'maxlength' => 3)); -$phoneNo2 = &HTML_QuickForm::createElement('text', '', null, array('size' => 4, 'maxlength' => 4)); -$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phoneNo', 'Telephone:', '-'); - -// Creates a radio buttons group -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addGroup($radio, 'iradYesNo', 'Yes/No:'); - -// Creates a checkboxes group -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$form->addGroup($checkbox, 'ichkABC', 'ABC:', '
'); -// Creates a group of buttons to be displayed at the bottom of the form -$buttons[] = &HTML_QuickForm::createElement('submit', null, 'Submit'); -$buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset'); -$buttons[] = &HTML_QuickForm::createElement('image', 'iimgTest', 'http://pear.php.net/gifs/pear-icon.gif'); -$buttons[] = &HTML_QuickForm::createElement('button', 'ibutTest', 'Test Button', array('onClick' => "alert('This is a test');")); -$form->addGroup($buttons, null, null, ' ', false); - - -// applies new filters to the element values -$form->applyFilter('__ALL__', 'trim'); -// Adds some validation rules -$form->addRule('itxtTest', 'Test Text is a required field', 'required'); -$form->addRule('itxaTest', 'Test TextArea is a required field', 'required'); -$form->addRule('itxaTest', 'Test TextArea must be at least 5 characters', 'minlength', 5); -$form->addRule('ipwdTest', 'Password must be between 8 to 10 characters', 'rangelength', array(8, 10)); - -// Tries to validate the form -if ($form->validate()) { - // Form is validated, then processes the data - $form->freeze(); - $form->process('myProcess', false); - echo "\n
\n"; -} - -// Process callback -function myProcess($values) -{ - echo '
';
-    var_dump($values);
-    echo '
'; -} - -$form->display(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/filters.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/filters.php deleted file mode 100644 index 08f15d4f0..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/filters.php +++ /dev/null @@ -1,61 +0,0 @@ -addElement('text', 'txtTest', 'Test Text to trim:'); -$form->addRule('txtTest', 'Test text is required', 'required'); - -$phoneGrp[] =& $form->createElement('text', '', null, array('size' => 3, 'maxlength' => 3)); -$phoneGrp[] =& $form->createElement('text', '', null, array('size' => 3, 'maxlength' => 3)); -$phoneGrp[] =& $form->createElement('text', '', null, array('size' => 4, 'maxlength' => 4)); -$form->addGroup($phoneGrp, 'phone', 'Telephone (will be converted to numbers):', '-'); -$form->addGroupRule('phone', 'The phone is required', 'required', null, 3); - -$form->addElement('text', 'txtAustin', 'Text for custom filter:'); -$form->addRule('txtAustin', 'Custom filter text is required', 'required'); - -$form->addElement('submit', 'isubTest', 'Submit'); - -// now we apply the filters -$form->applyFilter('txtTest', 'trim'); -// the filter will be applied recursively -$form->applyFilter('phone', 'intval'); - -if ($form->validate()) { - // Here the filter is applied after validation - $form->applyFilter('txtAustin', '_filterAustin'); - - echo "
\n";
-    echo "Values before filter:\n\n";
-    var_dump($form->getElementValue('txtTest'));
-    echo "\n";
-    var_dump($form->getElementValue('phone'));
-    echo "\n";
-    var_dump($form->getElementValue('txtAustin'));
-
-    echo "\n\nValues after filter:\n\n";
-    var_dump($form->exportValue('txtTest'));
-    echo "\n";
-    var_dump($form->exportValue('phone'));
-    echo "\n";
-    var_dump($form->exportValue('txtAustin'));
-    echo "
\n"; -} - -$form->display(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/formrule.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/formrule.php deleted file mode 100644 index 7e9517d7e..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/formrule.php +++ /dev/null @@ -1,101 +0,0 @@ - -* @version 3.2 -*/ - -require_once 'HTML/QuickForm.php'; - -function _validate_shipping($values) -{ - // In Real Life (tm) you will probably query your DB for these - $profiles = array('foo', 'bar', 'baz'); - $errors = array(); - switch ($values['profile']) { - case 'personal': - if (empty($values['persProfileName'])) { - $errors['persProfileName'] = 'Enter the profile name'; - } elseif (in_array($values['persProfileName'], $profiles)) { - $errors['persProfileName'] = 'The profile already exists'; - } - if (empty($values['persName']['first']) || empty($values['persName']['last'])) { - $errors['persName'] = 'Name is required'; - } - if (empty($values['persAddress'])) { - $errors['persAddress'] = 'Address is required'; - } - break; - - case 'company': - if (empty($values['compProfileName'])) { - $errors['compProfileName'] = 'Enter the profile name'; - } elseif (in_array($values['compProfileName'], $profiles)) { - $errors['compProfileName'] = 'The profile already exists'; - } - if (empty($values['compName'])) { - $errors['compName'] = 'Company name is required'; - } - if (empty($values['compAddress'])) { - $errors['compAddress'] = 'Address is required'; - } - break; - - case 'existing': - default: - if (empty($values['profileName'])) { - $errors['profileName'] = 'Enter the profile name'; - } elseif (!in_array($values['profileName'], $profiles)) { - $errors['profileName'] = 'The profile does not exist'; - } - break; - } // switch - return empty($errors)? true: $errors; -} - -$form =& new HTML_QuickForm('frmFancy'); -$form->setDefaults(array( - 'profile' => 'existing', - 'stuffAmount' => '1' -)); -$renderer =& $form->defaultRenderer(); -$renderer->setElementTemplate("\n\t\n\t\t{element}\n\t", 'profile'); - -$form->addElement('header', null, 'Choose stuff'); -$form->addElement('select', 'stuffName', 'Stuff to send:', array('' => '--select--', 'n' => 'Nuts', 'b' => 'Bolts', 'f' => 'Flotsam', 'j' => 'Jetsam')); -$form->addElement('text', 'stuffAmount', 'Amount of stuff:', array('size' => 2, 'maxlength' => 2)); - - -$form->addElement('header', null, 'Choose shipping profile'); -$form->addElement('static', 'note', 'Note:', 'profiles \'foo\', \'bar\' and \'baz\' are considered existing'); - -$form->addElement('radio', 'profile', null, 'Use existing profile', 'existing'); -$form->addElement('text', 'profileName', 'Profile name:', array('size' => 32, 'maxlength' => 32)); - -$form->addElement('radio', 'profile', null, 'New personal profile', 'personal'); -$form->addElement('text', 'persProfileName', 'Profile name:', array('size' => 32, 'maxlength' => 32)); -$name[] =& $form->createElement('text', 'first', null, array('size' => 14, 'maxlength' => 100)); -$name[] =& $form->createElement('text', 'last', null, array('size' => 14, 'maxlength' => 100)); -$form->addGroup($name, 'persName', 'Name (first, last):', ' '); -$form->addElement('text', 'persAddress', 'Address:', array('size' => 32, 'maxlength' => 255)); - -$form->addElement('radio', 'profile', null, 'New company profile', 'company'); -$form->addElement('text', 'compProfileName', 'Profile name:', array('size' => 32, 'maxlength' => 32)); -$form->addElement('text', 'compName', 'Company name:', array('size' => 32, 'maxlength' => 100)); -$form->addElement('text', 'compAddress', 'Address:', array('size' => 32, 'maxlength' => 255)); - -$form->addElement('submit', null, 'Send'); - -$form->addFormRule('_validate_shipping'); - -if ($form->validate()) { - echo "
\n";
-    var_dump($form->exportValues());
-    echo "
\n"; -} - -$form->display(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/groups.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/groups.php deleted file mode 100644 index 2a99584bb..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/groups.php +++ /dev/null @@ -1,95 +0,0 @@ - -* @author Alexey Borzov -* @version 3.2 -*/ - -require_once 'HTML/QuickForm.php'; - -$form =& new HTML_QuickForm('frmGroups'); -$form->setDefaults(array( - 'id' => array('lastname' => 'Mamasam', 'code' => '1234'), - 'phoneNo' => array('513', '123', '3456'), - 'ichkABC' => array('A'=>true) -)); - -$renderer =& $form->defaultRenderer(); - -// Setting templates for form and headers -$renderer->setFormTemplate("\n\n{content}\n
\n"); -$renderer->setHeaderTemplate("\t\n\t\t{header}\n\t"); - -// Setting a special template for id element -$renderer->setGroupTemplate('{content}
', 'id'); -$renderer->setGroupElementTemplate('{element}
* {label}', 'id'); - - -$form->addElement('header', '', 'Tests on grouped elements'); - -// Creates a group of text inputs with templates -$id['lastname'] = &HTML_QuickForm::createElement('text', 'lastname', 'Name', array('size' => 30)); -$id['code'] = &HTML_QuickForm::createElement('text', 'code', 'Code', array('size' => 5, 'maxlength' => 4)); -$form->addGroup($id, 'id', 'ID:', ', '); - -// Add a complex rule for id element -$form->addGroupRule('id', array( - 'lastname' => array( - array('Name is required', 'required', null, 'client'), - array('Name is letters only', 'lettersonly', null, 'client') - ), - 'code' => array( - array('Code must be numeric', 'numeric', null, 'client') - ) -)); - - -// Creates a group of text inputs -$areaCode = &HTML_QuickForm::createElement('text', '', null, array('size' => 4, 'maxlength' => 3)); -$phoneNo1 = &HTML_QuickForm::createElement('text', '', null, array('size' => 4, 'maxlength' => 3)); -$phoneNo2 = &HTML_QuickForm::createElement('text', '', null, array('size' => 5, 'maxlength' => 4)); -$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phoneNo', 'Telephone:', '-'); - -// Adds validation rules for groups -$form->addGroupRule('phoneNo', 'Please fill all phone fields', 'required', null, 3, 'client'); -$form->addGroupRule('phoneNo', 'Values must be numeric', 'numeric', null, 3, 'client'); - -// Creates a checkboxes group using an array of separators -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'ichkABC', 'ABCD:', array(' ', '
')); - -// At least one element is required -$form->addGroupRule('ichkABC', 'Please check at least two boxes', 'required', null, 2, 'client', true); - -// Creates a standard radio buttons group -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addGroup($radio, 'iradYesNo', 'Yes/No:'); - -// Validate the radio buttons -$form->addRule('iradYesNo', 'Check Yes or No', 'required', null, 'client'); - -// Creates a group of buttons to be displayed at the bottom of the form -$buttons[] =& $form->createElement('submit', null, 'Submit'); -$buttons[] =& $form->createElement('reset', null, 'Reset'); -$buttons[] =& $form->createElement('checkbox', 'clientSide', null, 'use client-side validation', array('checked' => 'checked', 'onclick' => "if (this.checked) {this.form.onsubmit = validate_" . $form->getAttribute('id') . ";} else {this.form.onsubmit = null;}")); -$form->addGroup($buttons); - - -// Tries to validate the form -if ($form->validate()) { - // Form is validated, then processes the data - $form->freeze(); - $form->process('var_dump'); - echo "\n
\n"; -} -$form->display(); - -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyDynamic_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyDynamic_example.php deleted file mode 100644 index 4e0a1e5b6..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyDynamic_example.php +++ /dev/null @@ -1,112 +0,0 @@ - - * - * $Id: FlexyDynamic_example.php,v 1.2 2003/11/03 12:55:53 avb Exp $ - */ - -require_once 'HTML/QuickForm.php'; -require_once 'HTML/QuickForm/Renderer/Object.php'; -require_once 'HTML/Template/Flexy.php'; - -$form = new HTML_QuickForm('frmTest', 'post'); - -$form->setDefaults(array( - 'itxtTest' => 'Test Text Box', - 'itxaTest' => 'Hello World', - 'iselTest' => array('B', 'C'), - 'name' => array('first' => 'Thomas', 'last' => 'Schulz'), - 'iradYesNo' => 'Y', - 'ichkABCD' => array('A'=>true,'D'=>true) -)); - -$form->addElement('header', '', 'Normal Elements'); - -$form->addElement('hidden', 'ihidTest', 'hiddenField'); - -$form->addElement('text', 'itxtTest', 'Test Text'); - -$form->addElement('textarea', 'itxaTest', 'Test TextArea'); - -// will be later assigned to style green -$form->addElement('password', 'ipwdTest', array('Test Password', 'Please choose a password which is hard to guess')); -$select =& $form->addElement('select', 'iselTest', 'Test Select', array('A'=>'A', 'B'=>'B','C'=>'C','D'=>'D')); -$select->setSize(5); -$select->setMultiple(true); - -$form->addElement('submit', 'isubTest', 'Test Submit'); - -$form->addElement('header', '', 'Grouped Elements'); - -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'ichkABCD', 'ABCD', '
'); - -// will be later assigned to style fancygroup -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addGroup($radio, 'iradYesNo', 'Yes/No'); - -// will be later assigned to style fancygroup -$name['first'] = &HTML_QuickForm::createElement('text', 'first', 'First:'); -$name['first']->setSize(20); -$name['last'] = &HTML_QuickForm::createElement('text', 'last', 'Last:'); -$name['last']->setSize(30); -$form->addGroup($name, 'name', 'Name'); - -// add some 'required' rules to show "stars" and (possible) errors... -$form->addRule('itxtTest', 'Test Text is a required field', 'required'); -$form->addRule('itxaTest', 'Test TextArea is a required field', 'required'); -$form->addGroupRule('iradYesNo', 'Check Yes or No', 'required'); -$form->addGroupRule('name', array('last' => array(array('Last name is required', 'required')))); - -// try to validate the form -if ($form->validate()) { - $form->freeze(); -} - -$renderer =& new HTML_QuickForm_Renderer_Object(true); - -// give some elements aditional style informations -$renderer->setElementStyle(array( - 'ipwdTest' => 'green', - 'iradYesNo' => 'fancygroup', - 'name' => 'fancygroup' -)); - -$form->accept($renderer); - - -$options = &PEAR::getStaticProperty('HTML_Template_Flexy','options'); -$options = array( - 'templateDir' => './templates', - 'compileDir' => './templates/build', - 'debug' => 0 -); -$tpl =& new HTML_Template_Flexy($options); - -//$tpl->compile("styles/green.html"); -//$tpl->compile("styles/fancygroup.html"); - -// assign array with form data -$view = new StdClass; -$view->form = $renderer->toObject(); - -// capture the array stucture -// (only for showing in sample template) -ob_start(); -print_r($renderer->toObject()); -$view->dynamic_object = ob_get_contents(); -// XXX: dunno how to make Flexy ignore the placeholder -$view->formdata = '{formdata}'; -ob_end_clean(); - -// render and display the template -$tpl->compile('flexy-dynamic.html'); -$tpl->outputObject($view); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyStatic_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyStatic_example.php deleted file mode 100644 index baf2afd1c..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/FlexyStatic_example.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * $Id: FlexyStatic_example.php,v 1.4 2004/06/24 19:23:10 ths Exp $ - */ - -require_once('HTML/Template/Flexy.php'); -require_once('HTML/QuickForm.php'); -require_once('HTML/QuickForm/Renderer/ObjectFlexy.php'); - -function myProcess($values) -{ - echo "
";
-	var_dump($values);
-	echo "
"; -} - -$form = new HTML_QuickForm('form', 'POST'); - -// Fills with some defaults values - -$defaultValues['company'] = 'Devils son in law'; -$defaultValues['country'] = array(); -$defaultValues['name'] = array('first'=>'Petey', 'last'=>'Wheatstraw'); -$defaultValues['phone'] = array('513', '123', '4567'); -$form->setDefaults($defaultValues); - -// Hidden - -$form->addElement('hidden', 'session', '1234567890'); - -// Personal information - -$form->addElement('header', 'personal', 'Personal Information'); - -$form->addElement('hidden', 'ihidTest', 'hiddenField'); -$form->addElement('text', 'email', 'Your email:'); -$form->addElement('password', 'pass', 'Your password:', 'size=10'); -$name['last'] = &HTML_QuickForm::createElement('text', 'first', 'First', -'size=10'); -$name['first'] = &HTML_QuickForm::createElement('text', 'last', 'Last', -'size=10'); -$form->addGroup($name, 'name', 'Name:', ', '); -$areaCode = &HTML_QuickForm::createElement('text', '', null,'size=4 -maxlength=3'); -$phoneNo1 = &HTML_QuickForm::createElement('text', '', null, 'size=4 -maxlength=3'); -$phoneNo2 = &HTML_QuickForm::createElement('text', '', null, 'size=5 -maxlength=4'); -$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phone', -'Telephone:', '-'); - -// Company information - -$form->addElement('header', 'company_info', 'Company Information'); - -$form->addElement('text', 'company', 'Company:', 'size=20'); - -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$form->addGroup($str, 'street', 'Street:', '
'); - -$addr['zip'] = &HTML_QuickForm::createElement('text', 'zip', 'Zip', 'size=6 -maxlength=10'); -$addr['city'] = &HTML_QuickForm::createElement('text', 'city', 'City', -'size=15'); -$form->addGroup($addr, 'address', 'Zip, city:'); - -$select = array('' => 'Please select...', 'AU' => 'Australia', 'FR' => -'France', 'DE' => 'Germany', 'IT' => 'Italy'); -$form->addElement('select', 'country', 'Country:', $select); - -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'destination', 'Destination:', array(' ', -'
')); - -// Other elements - -$form->addElement('checkbox', 'news', '', " Check this box if you don't want -to receive our newsletter."); - -$form->addElement('reset', 'reset', 'Reset'); -$form->addElement('submit', 'submit', 'Register'); - -// Adds some validation rules - -$form->addRule('email', 'Email address is required', 'required'); -$form->addGroupRule('name', 'Name is required', 'required'); -$form->addRule('pass', 'Password must be between 8 to 10 characters', -'rangelength', array(8, 10),'client'); -$form->addRule('country', 'Country is a required field', 'required'); -$form->addGroupRule('destination', 'Please check at least two boxes', -'required', null, 2); -$form->addGroupRule('phone', 'Please fill all phone fields', 'required'); -$form->addGroupRule('phone', 'Values must be numeric', 'numeric'); - -$AddrRules['zip'][0] = array('Zip code is required', 'required'); -$AddrRules['zip'][1] = array('Zip code is numeric only', 'numeric'); -$AddrRules['city'][0] = array('City is required', 'required'); -$AddrRules['city'][1] = array('City is letters only', 'lettersonly'); -$form->addGroupRule('address', $AddrRules); - -// Tries to validate the form -if ($form->validate()) { - // Form is validated, then freezes the data - $form->freeze(); - $form->process('myProcess', false); - echo "\n
\n"; -} - -// setup a template object -$options = &PEAR::getStaticProperty('HTML_Template_Flexy','options'); -$options = array( - 'templateDir' => './templates', - 'compileDir' => './templates/build', - 'forceCompile' => 1, - 'debug' => 0, - 'local' => 'en' -); - -$template = new HTML_Template_Flexy($options); - -$renderer =& new HTML_QuickForm_Renderer_ObjectFlexy($template); -$renderer->setLabelTemplate("label.html"); -$renderer->setHtmlTemplate("html.html"); - -$form->accept($renderer); - -$view = new StdClass; -$view->form = $renderer->toObject(); - -$template->compile("flexy-static.html"); -// capture the array stucture -ob_start(); -print_r($view->form); -$view->static_object = ob_get_contents(); -ob_end_clean(); - -// render and display the template -$template->outputObject($view); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example.php deleted file mode 100644 index 5a1179fd5..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * $Id: ITDynamic_example.php,v 1.3 2003/09/09 10:46:51 avb Exp $ - */ - -require_once 'HTML/QuickForm.php'; -require_once 'HTML/QuickForm/Renderer/ITDynamic.php'; -// can use either HTML_Template_Sigma or HTML_Template_ITX -require_once 'HTML/Template/ITX.php'; -// require_once 'HTML/Template/Sigma.php'; - -$form = new HTML_QuickForm('frmTest', 'post'); - -$form->setDefaults(array( - 'itxtTest' => 'Test Text Box', - 'itxaTest' => 'Hello World', - 'iselTest' => array('B', 'C'), - 'name' => array('first' => 'Alexey', 'last' => 'Borzov'), - 'iradYesNo' => 'Y', - 'ichkABCD' => array('A'=>true,'D'=>true) -)); - -$form->addElement('header', '', 'Normal Elements'); - -$form->addElement('hidden', 'ihidTest', 'hiddenField'); -// will be rendered in default qf_element block -$form->addElement('text', 'itxtTest', 'Test Text:'); -// will be rendered in qf_textarea block, as it exists in template -$form->addElement('textarea', 'itxaTest', 'Test TextArea:', array('rows' => 5, 'cols' => 40)); -// will be later assigned to qf_green, note that an array of labels is passed -$form->addElement('password', 'ipwdTest', array('Test Password:', 'The password is expected to be long enough.')); -$select =& $form->addElement('select', 'iselTest', 'Test Select:', array('A'=>'A', 'B'=>'B','C'=>'C','D'=>'D')); -$select->setSize(5); -$select->setMultiple(true); -$form->addElement('submit', 'isubTest', 'Test Submit'); - -$form->addElement('header', '', 'Grouped Elements'); - -// will be rendered in default qf_group block -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'ichkABCD', 'ABCD:', array(' ', '
')); - -// fancygroup candidates -// will be rendered in qf_fancygroup_radio -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addGroup($radio, 'iradYesNo', 'Yes/No:'); - -// will be rendered in qf_fancygroup_element -$name['first'] = &HTML_QuickForm::createElement('text', 'first', 'First:'); -$name['first']->setSize(20); -$name['last'] = &HTML_QuickForm::createElement('text', 'last', 'Last:'); -$name['last']->setSize(30); -$form->addGroup($name, 'name', 'Name'); - -// add some 'required' rules to show "stars" and (possible) errors... -$form->addRule('itxtTest', 'Test Text is a required field', 'required'); -$form->addRule('itxaTest', 'Test TextArea is a required field', 'required'); -$form->addRule('iradYesNo', 'Check Yes or No', 'required'); -$form->addGroupRule('name', array('last' => array(array('Last name is required', 'required')))); - -// try to validate the form -if ($form->validate()) { - $form->freeze(); -} - -// create a template object and load the template file -// can use either HTML_Template_Sigma or HTML_Template_ITX -$tpl =& new HTML_Template_ITX('./templates'); -// $tpl =& new HTML_Template_Sigma('./templates'); - -$tpl->loadTemplateFile('it-dynamic.html', true, true); - -// create a renderer -$renderer =& new HTML_QuickForm_Renderer_ITDynamic($tpl); - -// assign elements to blocks -$renderer->setElementBlock(array( - 'ipwdTest' => 'qf_green', - 'iradYesNo' => 'qf_fancygroup', - 'name' => 'qf_fancygroup' -)); - -// Black Magic :] -$form->accept($renderer); - -// display the results -$tpl->show(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example2.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example2.php deleted file mode 100644 index 3f7bf07eb..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITDynamic_example2.php +++ /dev/null @@ -1,119 +0,0 @@ - -* @author Bertrand Mansion -* @author Alexey Borzov -* @version 3.0 -*/ -require_once 'HTML/QuickForm.php'; -require_once 'HTML/QuickForm/Renderer/ITDynamic.php'; -// can use either HTML_Template_Sigma or HTML_Template_ITX -require_once 'HTML/Template/ITX.php'; -//require_once 'HTML/Template/Sigma.php'; - -$form = new HTML_QuickForm('frmTest', 'POST'); - -// Fills with some defaults values -$defaultValues['company'] = 'Mamasam'; -$defaultValues['country'] = array(); -$defaultValues['name'] = array('first'=>'Alexey', 'last'=>'Borzov'); -$defaultValues['phone'] = array('513', '123', '4567'); -$form->setDefaults($defaultValues); - -// Hidden -$form->addElement('hidden', 'session', '1234567890'); -$form->addElement('hidden', 'timer', '12345'); -$form->addElement('hidden', 'ihidTest', 'hiddenField'); - -// Personal information -$form->addElement('header', 'personal_info', 'Personal Information'); - -$name['last'] = &HTML_QuickForm::createElement('text', 'first', 'First', 'size=10'); -$name['first'] = &HTML_QuickForm::createElement('text', 'last', 'Last', 'size=10'); -$form->addGroup($name, 'name', 'Name:', ', '); - -$areaCode = &HTML_QuickForm::createElement('text', '', null,'size=4 maxlength=3'); -$phoneNo1 = &HTML_QuickForm::createElement('text', '', null, 'size=4 maxlength=3'); -$phoneNo2 = &HTML_QuickForm::createElement('text', '', null, 'size=5 maxlength=4'); -$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phone', 'Telephone:', '-'); - -$form->addElement('text', 'email', 'Your email:'); - -$form->addElement('password', 'pass', 'Your password:', 'size=10'); - -// to finish the first column: -$form->addElement('static', null, null, 'first column'); - - -// Company information -$form->addElement('header', 'company_info', 'Company Information'); - -$form->addElement('text', 'company', 'Company:', 'size=20'); - -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$form->addGroup($str, 'street', 'Street:', '
'); - - -$addr['zip'] = &HTML_QuickForm::createElement('text', 'zip', 'Zip', 'size=6 maxlength=10'); -$addr['city'] = &HTML_QuickForm::createElement('text', 'city', 'City', 'size=15'); -$form->addGroup($addr, 'address', 'Zip, city:'); - -$select = array('' => 'Please select...', 'AU' => 'Australia', 'FR' => 'France', 'DE' => 'Germany', 'IT' => 'Italy'); -$form->addElement('select', 'country', 'Country:', $select); - -// Creates a checkboxes group using an array of separators -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'destination', 'Destination:', array(' ', '
')); - -// to finish the second column: -$form->addElement('static', null, null, 'second column'); - -// can't render these elements properly, so they are in the template -//$form->addElement('reset', 'reset', 'Reset'); -//$form->addElement('submit', 'submit', 'Register'); - -// Adds some validation rules -$form->addRule('email', 'Email address is required', 'required'); -$form->addGroupRule('name', 'Name is required', 'required'); -$form->addRule('pass', 'Password must be between 8 to 10 characters', 'rangelength', array(8, 10)); -$form->addRule('country', 'Country is a required field', 'required'); -$form->addGroupRule('destination', 'Please check at least two boxes', 'required', null, 2); -$form->addGroupRule('phone', 'Please fill all phone fields', 'required'); -$form->addGroupRule('phone', 'Values must be numeric', 'numeric'); - - -$AddrRules['zip'][0] = array('Zip code is required', 'required'); -$AddrRules['zip'][1] = array('Zip code is numeric only', 'numeric'); -$AddrRules['city'][0] = array('City is required', 'required'); -$AddrRules['city'][1] = array('City is letters only', 'lettersonly'); -$form->addGroupRule('address', $AddrRules); - -// Tries to validate the form -if ($form->validate()) { - // Form is validated, then freezes the data - $form->freeze(); -} - - -// can use either HTML_Template_Sigma or HTML_Template_ITX -$tpl =& new HTML_Template_ITX('./templates'); -// $tpl =& new HTML_Template_Sigma('./templates'); - -$tpl->loadTemplateFile('it-dynamic-2.html'); - -$renderer =& new HTML_QuickForm_Renderer_ITDynamic($tpl); -$renderer->setElementBlock(array( - 'name' => 'qf_group_table', - 'address' => 'qf_group_table' -)); - -$form->accept($renderer); - -$tpl->show(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITStatic_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITStatic_example.php deleted file mode 100644 index 577cd0be1..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/ITStatic_example.php +++ /dev/null @@ -1,111 +0,0 @@ - -* @version 2.0 -*/ - -// $Id: ITStatic_example.php,v 1.4 2004/10/02 09:54:41 ths Exp $ - -require_once('HTML/QuickForm.php'); -require_once('HTML/QuickForm/Renderer/ITStatic.php'); -require_once('HTML/Template/ITX.php'); - - -// Form name will be used to find the placeholders. - -$form = new HTML_QuickForm('form', 'POST'); - -// Fills with some defaults values - -$defaultValues['company'] = 'Mamasam'; -$defaultValues['country'] = array(); -$defaultValues['name'] = array('first'=>'Bertrand', 'last'=>'Mansion'); -$defaultValues['phone'] = array('513', '123', '4567'); -$form->setDefaults($defaultValues); - -// Hidden - -$form->addElement('hidden', 'session', '1234567890'); - -// Personal information - -$form->addElement('header', 'personal', 'Personal Information'); - -$form->addElement('hidden', 'ihidTest', 'hiddenField'); -$form->addElement('text', 'email', 'Your email:'); -$form->addElement('password', 'pass', 'Your password:', 'size=10'); -$name['last'] = &HTML_QuickForm::createElement('text', 'first', 'First', 'size=10'); -$name['first'] = &HTML_QuickForm::createElement('text', 'last', 'Last', 'size=10'); -$form->addGroup($name, 'name', 'Name:', ', '); -$areaCode = &HTML_QuickForm::createElement('text', '', null,'size=4 maxlength=3'); -$phoneNo1 = &HTML_QuickForm::createElement('text', '', null, 'size=4 maxlength=3'); -$phoneNo2 = &HTML_QuickForm::createElement('text', '', null, 'size=5 maxlength=4'); -$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phone', 'Telephone:', '-'); - -// Company information - -$form->addElement('header', 'company_info', 'Company Information'); - -$form->addElement('text', 'company', 'Company:', 'size=20'); - -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$form->addGroup($str, 'street', 'Street:', '
'); - -$addr['zip'] = &HTML_QuickForm::createElement('text', 'zip', 'Zip', 'size=6 maxlength=10'); -$addr['city'] = &HTML_QuickForm::createElement('text', 'city', 'City', 'size=15'); -$form->addGroup($addr, 'address', 'Zip, city:'); - -$select = array('' => 'Please select...', 'AU' => 'Australia', 'FR' => 'France', 'DE' => 'Germany', 'IT' => 'Italy'); -$form->addElement('select', 'country', 'Country:', $select); - -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'destination', 'Destination:', array(' ', '
')); - -// Other elements - -$form->addElement('checkbox', 'news', '', " Check this box if you don't want to receive our newsletter."); - -$form->addElement('reset', 'reset', 'Reset'); -$form->addElement('submit', 'submit', 'Register'); - -// Adds some validation rules - -$form->addRule('email', 'Email address is required', 'required'); -$form->addGroupRule('name', 'Name is required', 'required'); -$form->addRule('pass', 'Password must be between 8 to 10 characters', 'rangelength', array(8, 10)); -$form->addRule('country', 'Country is a required field', 'required'); -$form->addGroupRule('destination', 'Please check at least two boxes', 'required', null, 2); -$form->addGroupRule('phone', 'Please fill all phone fields', 'required'); -$form->addGroupRule('phone', 'Values must be numeric', 'numeric'); - -$AddrRules['zip'][0] = array('Zip code is required', 'required'); -$AddrRules['zip'][1] = array('Zip code is numeric only', 'numeric'); -$AddrRules['city'][0] = array('City is required', 'required'); -$AddrRules['city'][1] = array('City is letters only', 'lettersonly'); -$form->addGroupRule('address', $AddrRules); - -// Tries to validate the form -if ($form->validate()) { - // Form is validated, then freezes the data - $form->freeze(); -} - -// Could be HTML_Template_Sigma('./templates') -$tpl =& new HTML_Template_ITX('./templates'); -$tpl->loadTemplateFile('it-static.html'); - -$renderer =& new HTML_QuickForm_Renderer_ITStatic($tpl); -$renderer->setRequiredTemplate('{label}*'); -$renderer->setErrorTemplate('{error}
{html}'); - -$form->accept($renderer); - -$tpl->show(); - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/QuickHtml_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/QuickHtml_example.php deleted file mode 100644 index 72e1b1270..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/QuickHtml_example.php +++ /dev/null @@ -1,146 +0,0 @@ - - - QuickForm Using QuickHtml Renderer - - -*/ - -require_once ("HTML/QuickForm.php"); -require_once ("HTML/QuickForm/Renderer/QuickHtml.php"); -$form =& new HTML_QuickForm('tmp_form','POST'); -// get our render -$renderer =& new HTML_QuickForm_Renderer_QuickHtml(); -// create the elements -createElements($form); -// set their values -setValues($form); - -// Do the magic of creating the form. NOTE: order is important here: this must -// be called after creating the form elements, but before rendering them. -$form->accept($renderer); - -// Because radio buttons have the same name we have to pass the value -// as well as the name in order to get the correct one. -$tmp_radio = ' Yes: ' . $renderer->elementToHtml('tmp_radio', 'Y'); -$tmp_radio .= ' No: ' . $renderer->elementToHtml('tmp_radio', 'N'); - -$tmp_submit = $renderer->elementToHtml('tmp_reset'); -$tmp_submit .= $renderer->elementToHtml('tmp_submit'); - -// Make our form table using some of the widget functions. -$data = ' - - ' . createHeaderCell('QuickForm using QuickHtml Renderer', 'center', 2) . ' - ' . createFormCell($renderer->elementToHtml('tmp_textarea'), 'center', 2) . ' - ' . createHeaderCell('Text box (element is part of an array)', 'left') . - createHeaderCell('Yes or no?', 'right') . ' - ' . createFormCell($renderer->elementToHtml('tmp_text[array]'), 'left') . - createFormCell($tmp_radio, 'right') . ' - ' . createHeaderCell('Phone Number (a group)', 'left') . - createHeaderCell('Advanced Check Box?', 'right') . ' - ' . createFormCell($renderer->elementToHtml('phone_num'), 'left') . - createFormCell($renderer->elementToHtml('tmp_checkbox'), 'right') . ' - ' . createHeaderCell('Today is:', 'left') . - createHeaderCell('Multiple Select', 'right') . ' - ' . createFormCell($renderer->elementToHtml('tmp_date'), 'left') . - createFormCell($renderer->elementToHtml('tmp_multipleSelect[0]'), 'right') . ' - ' . createFormCell($tmp_submit, 'center', 2) . ' -
'; - -// Wrap the form and any remaining elements (i.e. hidden elements) into the form tags. -echo $renderer->toHtml($data); - -echo "\n
Submitted Values:
\n"; -echo "
";
-print_r($_POST);
-// {{{ createElements()
-
-// creates all the fields for the form
-function createElements(&$form)
-{
-    // select list array
-    $selectListArray = array(
-        'windows'   => 'Windows',
-        'linux'     => 'Linux',
-        'irix'      => 'Irix',
-        'mac'       => 'Mac',
-    );
-
-    $form->addElement('text','tmp_text[array]',null,array('size' => 10));
-    $form->addElement('hidden','tmp_hidden', 'value');
-    $form->addElement('textarea','tmp_textarea',null,array('cols' => 50, 'rows' => 10, 'wrap' => 'virtual'));
-    $form->addElement('radio','tmp_radio',null,null,'Y');
-    $form->addElement('radio','tmp_radio',null,null,'N');
-    $text = array();
-    $text[] =& HTML_QuickForm::createElement('text','',null,array('size' => 3));
-    $text[] =& HTML_QuickForm::createElement('text','',null,array('size' => 4));
-    $text[] =& HTML_QuickForm::createElement('text','',null,array('size' => 3));
-    $form->addGroup($text, 'phone_num', null, '-');
-    $form->addElement('advcheckbox','tmp_checkbox',null,'Please Check',null,array('not checked', 'checked'));
-    $form->addElement('date', 'tmp_date', null, array('format'=>'D d M Y'));
-    $form->addElement('select', 'tmp_multipleSelect[0]', null, $selectListArray, array('multiple' => 'multiple', 'size' => 4));
-    $form->addElement('reset','tmp_reset','Reset Form');
-    $form->addElement('submit','tmp_submit','Submit Form');
-    $form->addRule('tmp_text[array]','Text length must be greater than 10','minlength',10,'client');
-}
-
-// }}}
-// {{{ setValues()
-
-// sets all the default and constant values for the form
-function setValues(&$form)
-{
-    // Fills with some defaults values
-    $defaultValues['tmp_textarea']  = '
-Test Text Area
-
-With line breaks';
-    $defaultValues['phone_num'] = array('513', '123', '3456');
-    $defaultValues['tmp_checkbox'] = 'checked';
-    $defaultValues['tmp_multipleSelect'][0] = array('linux', 'mac');
-    // Fill with some constant values.
-    // Constant is not overridden by POST, GET, or defaultValues
-    // when values are being filled in
-    $constantValues['tmp_radio'] = 'Y';
-    $constantValues['tmp_date'] = time();
-    $constantValues['tmp_text']['array'] = 'constant';
-
-    $form->setDefaults($defaultValues);
-    $form->setConstants($constantValues);
-}
-
-// }}}
-// {{{ createHeaderCell()
-
-// creates a header cell
-function createHeaderCell($text, $align, $colspan = 1)
-{
-    return '' . $text . '';
-}
-
-// }}}
-// {{{ createFormCell()
-
-// creates a form cell based on the element name
-function createFormCell($elementHtml, $align, $colspan = 1)
-{
-    return '' . 
-           $elementHtml .
-           '';
-}
-
-// }}}
-?>
-
-
diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyDynamic_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyDynamic_example.php
deleted file mode 100644
index b09c6581c..000000000
--- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyDynamic_example.php
+++ /dev/null
@@ -1,108 +0,0 @@
-
- * @author Alexey Borzov 
- *
- * $Id: SmartyDynamic_example.php,v 1.4 2004/10/15 20:31:00 ths Exp $
- */
-
-require_once 'HTML/QuickForm.php';
-require_once 'HTML/QuickForm/Renderer/Array.php';
-// fix this if your Smarty is somewhere else
-require_once 'Smarty.class.php';
-
-$form = new HTML_QuickForm('frmTest', 'post');
-
-$form->setDefaults(array(
-    'itxtTest'  => 'Test Text Box',
-    'itxaTest'  => 'Hello World',
-    'iselTest'  => array('B', 'C'),
-    'name'      => array('first' => 'Thomas', 'last' => 'Schulz'),
-    'iradYesNo' => 'Y',
-    'ichkABCD'  => array('A'=>true,'D'=>true)
-));
-
-$form->addElement('header', '', 'Normal Elements');
-
-$form->addElement('hidden', 'ihidTest', 'hiddenField');
-
-$form->addElement('text', 'itxtTest', array('Test Text', 'note' => 'Note for Testtext element.'));
-
-$form->addElement('textarea', 'itxaTest', 'Test TextArea', 'cols="40" rows="2"');
-
-// will be later assigned to style green
-$form->addElement('password', 'ipwdTest', 'Test Password');
-$select =& $form->addElement(
-    'select',
-    'iselTest',
-    array('Test Select', 'note' => 'We recommend to check at least two categories!'),
-    array('A'=>'A * * * * (luxory)', 'B'=>'B * * *','C'=>'C * *','D'=>'D * (simple)')
- );
-$select->setSize(4);
-$select->setMultiple(true);
-
-$form->addElement('submit', 'isubTest', 'Test Submit');
-
-$form->addElement('header', '', 'Grouped Elements');
-
-$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A');
-$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B');
-$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C');
-$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D');
-$form->addGroup($checkbox, 'ichkABCD', 'ABCD', array(' ', '
')); - -// will be later assigned to style fancygroup -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 'Y'); -$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'N'); -$form->addGroup($radio, 'iradYesNo', 'Yes/No'); - -// will be later assigned to style fancygroup -$name['first'] = &HTML_QuickForm::createElement('text', 'first', 'First:'); -$name['first']->setSize(20); -$name['last'] = &HTML_QuickForm::createElement('text', 'last', 'Last:'); -$name['last']->setSize(30); -$form->addGroup($name, 'name', 'Name'); - -// add some 'required' rules to show "stars" and (possible) errors... -$form->addRule('itxtTest', 'Test Text is a required field', 'required'); -$form->addRule('itxaTest', 'Test TextArea is a required field', 'required'); -$form->addGroupRule('iradYesNo', 'Check Yes or No', 'required'); -$form->addGroupRule('name', array('last' => array(array('Last name is required', 'required')))); - -// try to validate the form -if ($form->validate()) { - $form->freeze(); -} - -$renderer =& new HTML_QuickForm_Renderer_Array(true, true); - -// give some elements aditional style informations -$renderer->setElementStyle(array( - 'ipwdTest' => 'green', - 'iradYesNo' => 'fancygroup', - 'name' => 'fancygroup' -)); - -$form->accept($renderer); - -// setup a template object -$tpl =& new Smarty; -$tpl->template_dir = './templates'; -$tpl->compile_dir = './templates'; - -// assign array with form data -$tpl->assign('form', $renderer->toArray()); - -// capture the array stucture -// (only for showing in sample template) -ob_start(); -print_r($renderer->toArray()); -$tpl->assign('dynamic_array', ob_get_contents()); -ob_end_clean(); - -// render and display the template -$tpl->display('smarty-dynamic.tpl'); - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyStatic_example.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyStatic_example.php deleted file mode 100644 index c10339ca7..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/SmartyStatic_example.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @author Thomas Schulz - * - * $Id: SmartyStatic_example.php,v 1.4 2004/10/15 20:31:00 ths Exp $ - */ - -require_once 'HTML/QuickForm.php'; -require_once 'HTML/QuickForm/Renderer/ArraySmarty.php'; -// fix this if your Smarty is somewhere else -require_once 'Smarty.class.php'; - -// Form name will be used to find the placeholders. - -$form = new HTML_QuickForm('form', 'POST'); - -// Fills with some defaults values - -$defaultValues['company'] = 'Mamasam'; -$defaultValues['country'] = array(); -$defaultValues['name'] = array('first'=>'Bertrand', 'last'=>'Mansion'); -$defaultValues['phone'] = array('513', '123', '4567'); -$form->setDefaults($defaultValues); - -// Hidden - -$form->addElement('hidden', 'session', '1234567890'); - -// Personal information - -$form->addElement('header', 'personal', 'Personal Information'); - -$form->addElement('hidden', 'ihidTest', 'hiddenField'); -$form->addElement('text', 'email', 'Your email:'); -$form->addElement('password', 'pass', array('Your password:', 'note'=>'Please, choose a 8-10 characters password.'), 'size=10'); -$name['last'] = &HTML_QuickForm::createElement('text', 'first', 'First', 'size=10'); -$name['first'] = &HTML_QuickForm::createElement('text', 'last', 'Last', 'size=10'); -$form->addGroup($name, 'name', 'Name:', ', '); -$areaCode = &HTML_QuickForm::createElement('text', '', null,'size=4 maxlength=3'); -$phoneNo1 = &HTML_QuickForm::createElement('text', '', null, 'size=4 maxlength=3'); -$phoneNo2 = &HTML_QuickForm::createElement('text', '', null, 'size=5 maxlength=4'); -$form->addGroup(array($areaCode, $phoneNo1, $phoneNo2), 'phone', 'Telephone:', '-'); - -// Company information - -$form->addElement('header', 'company_info', 'Company Information'); - -$form->addElement('text', 'company', 'Company:', 'size=20'); - -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$str[] = &HTML_QuickForm::createElement('text', '', null, 'size=20'); -$form->addGroup($str, 'street', 'Street:', '
'); - -$addr['zip'] = &HTML_QuickForm::createElement('text', 'zip', 'Zip', 'size=6 maxlength=10'); -$addr['city'] = &HTML_QuickForm::createElement('text', 'city', 'City', 'size=15'); -$form->addGroup($addr, 'address', 'Zip, city:'); - -$select = array('' => 'Please select...', 'AU' => 'Australia', 'FR' => 'France', 'DE' => 'Germany', 'IT' => 'Italy'); -$form->addElement('select', 'country', 'Country:', $select); - -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'A', null, 'A'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'B', null, 'B'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'C', null, 'C'); -$checkbox[] = &HTML_QuickForm::createElement('checkbox', 'D', null, 'D'); -$form->addGroup($checkbox, 'destination', 'Destination:', array(' ', '
')); - -// Other elements - -$form->addElement('checkbox', 'news', '', " Check this box if you don't want to receive our newsletter."); - -$form->addElement('reset', 'reset', 'Reset'); -$form->addElement('submit', 'submit', 'Register'); - -// Adds some validation rules - -$form->addRule('email', 'Email address is required', 'required'); -$form->addGroupRule('name', 'Name is required', 'required'); -$form->addRule('pass', 'Password must be between 8 to 10 characters', 'rangelength', array(8, 10)); -$form->addRule('country', 'Country is a required field', 'required'); -$form->addGroupRule('destination', 'Please check at least two boxes', 'required', null, 2); -$form->addGroupRule('phone', 'Please fill all phone fields', 'required'); -$form->addGroupRule('phone', 'Values must be numeric', 'numeric'); - -$AddrRules['zip'][0] = array('Zip code is required', 'required'); -$AddrRules['zip'][1] = array('Zip code is numeric only', 'numeric'); -$AddrRules['city'][0] = array('City is required', 'required'); -$AddrRules['city'][1] = array('City is letters only', 'lettersonly'); -$form->addGroupRule('address', $AddrRules); - -// Tries to validate the form -if ($form->validate()) { - // Form is validated, then freezes the data - $form->freeze(); -} - -// setup a template object -$tpl =& new Smarty; -$tpl->template_dir = './templates'; -$tpl->compile_dir = './templates'; - -$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl, true); - -$renderer->setRequiredTemplate( - '{if $error} - {$label|upper} - {else} - {$label} - {if $required} - * - {/if} - {/if}' - ); - -$renderer->setErrorTemplate( - '{if $error} - {$error}
- {/if}{$html}' - ); - -$form->accept($renderer); - -// assign array with form data -$tpl->assign('form', $renderer->toArray()); - -// capture the array stucture -ob_start(); -print_r($renderer->toArray()); -$tpl->assign('static_array', ob_get_contents()); -ob_end_clean(); - -// render and display the template -$tpl->display('smarty-static.tpl'); - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/multiple-labels.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/multiple-labels.php deleted file mode 100644 index 6451568dc..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/multiple-labels.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * $Id: multiple-labels.php,v 1.1 2004/03/06 12:03:50 avb Exp $ - */ - -require_once 'HTML/QuickForm.php'; - -$template = -' - - * - {label} - - - {element} -
{error}
-
{label_2} - -'; - -// Create the form, and add a header to it. -$form = new HTML_QuickForm('labels_example', 'post'); -$form->addHeader('QuickForm Labels Example'); - -// Do the magic! Just pass your label to the element as an array! -$form->addElement('text', 'name', array('Name', 'The name that you would like to enter in this element.')); -$form->addElement('checkbox', 'check', array('Check Me!', 'If you check this box, it will have tick in it.')); - -// More boring stuff. -$form->addElement('submit', null, 'Submit'); - -if ($form->validate()) { - $form->freeze(); -} - -// customize the element template -$renderer =& $form->defaultRenderer(); -$renderer->setElementTemplate($template); - -// output the form -$form->display(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-dynamic.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-dynamic.html deleted file mode 100644 index fd3df2b1e..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-dynamic.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - Flexy template for Object renderer - - - - - -{form.javascript:h} - -{form.outputHeader():h} - - {form.outputHeader():h} - {form.hidden:h} - - {foreach:form.sections,sec} - - - - - {foreach:sec.elements,elem} - {if:elem.style} - {elem.outputStyle():h} - {else:} - {if:elem.isButton()} - {if:elem.notFrozen()} - - - - - {end:} - {else:} - - {if:elem.isType(#textarea#)} - - - - {end:} - {end:} - {end:} - {end:} - {if:form.requirednote} - - - - - {end:} - - -
- {sec.header}
 {elem.html:h}
- {if:elem.required}*{end:} - {if:elem.error}{end:} - {elem.label:h}:
- {if:elem.error}
{end:} - {else:} -
- {if:elem.required}*{end:} - {if:elem.error}{end:} - {elem.label:h}: - {if:elem.error}{end:} - - {end:} - {if:elem.error}
{elem.error}
{end:} - {if:elem.isType(#group#)} - {foreach:elem.elements,gitem} - {gitem.label:h} - {gitem.html:h}{if:gitem.required}**{end:} - {if:elem.separator}{elem.separator:h}{end:} - {end:} - {else:} - {elem.html:h} - {end:} -
 {form.requirednote:h}
- -  -

Collected Errors:
-{foreach:form.errors,name,error} - {error:h} in element [{name:h}]
-{end:} -

- -  -

Best Practice:
-Use only one dynamic form template like this for your
-Flexy driven project. You include this where
-to place a form with the formdata object rendered by
-Object QuickForm Renderer as option:

- -
 
-<include file=form-dynamic.tpl form={formdata}> 
-
- -  -

The used "Dynamic" Object

-
 
-{dynamic_object} 
-
- - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-static.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-static.html deleted file mode 100644 index a13e2996f..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/flexy-static.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - Flexy template : 2 column layout example - -{form.javascript:h} - - - - -{form.outputHeader():h} -{form.hidden:h} - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
{form.header.personal:h}
{form.name.label:h}{form.name.error:h} - - - - - - - - - -
{form.name.first.html:h}{form.name.last.html:h}
{form.name.first.label:h}{form.name.last.label:h}
-
{form.phone.label:h}{form.phone.html:h}
{form.email.label:h}{form.email.html:h}
Please, choose a 8-10 characters password.
{form.pass.label:h}{form.pass.html:h}
-
- - - - - - - - - - - - - - - - - - - - - - -
{form.header.company_info:h}
{form.company.label:h}{form.company.html:h}
{form.street.label:h}{form.street.html:h}
{form.address.label:h}{form.address.error:h} - - - - - - - - - -
{form.address.zip.html:h}{form.address.city.html:h}
{form.address.zip.label:h}{form.address.city.label:h}
-
{form.country.label:h}{form.country.html:h}
{form.destination.label:h}{form.destination.html:h}
-
- - - - - - - - - -
{form.requirednote:h}{form.reset.html:h} {form.submit.html:h}

{form.news.html:h}
- - - -
-Collected Errors:
-{foreach:form.errors,error} - {error} in element [{name}]
-{end:} - -  -

The used "Static" Object

-
-{static_object}
-
- - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/html.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/html.html deleted file mode 100644 index 76f090f82..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/html.html +++ /dev/null @@ -1,4 +0,0 @@ -{if:error} - {error:h}
-{end:} -{html:h} \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic-2.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic-2.html deleted file mode 100644 index 8f623ddda..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic-2.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - -IT dynamic renderer: 2 column layout example - -{qf_javascript} - - - - -{qf_error}
- -
- -
- - {qf_hidden} - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
{qf_header}
* {qf_label}{qf_error}
{qf_element}
Please, choose a 8-10 characters password.
* {qf_label}{qf_error}
{qf_element}
* {qf_group_label}{qf_separator}{qf_element}
* {qf_group_label} - - - -
{qf_element}
{qf_label}*
-
- - - - - - -
{qf_required_note} 
-
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic.html deleted file mode 100644 index 939ebbbdc..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-dynamic.html +++ /dev/null @@ -1,127 +0,0 @@ - - - -IT dynamic renderer - - - - -{qf_javascript} -
- -
- - {qf_hidden} - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {qf_addblock} - - - - - - - - -
-
    - -
  • {qf_error}
  • - -
-
{qf_header}
*{qf_label}{qf_error}
{qf_element}
*{qf_label}
- {qf_error}
{qf_element}
*{qf_group_label} - {qf_error}
- {qf_separator}{qf_element} -
style="font-weight: bold; color: red">{qf_group_label} - - - - - - - - - - - - -
*{qf_label}{qf_element}{qf_element}
-
*{qf_label}{qf_error}
{qf_element} -
{qf_label_2}
 {qf_required_note}
-
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-static.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-static.html deleted file mode 100644 index 797452bf0..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/it-static.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - -IT static render: 2 column layout example - -{form_javascript} - - - -{form_error}
- -
-{form_session_html} - - - - -
- - - - - - - - - -
{form_header_personal}
{form_name_label}{form_name_error} - - - -
{form_name_first_html}{form_name_last_html}
{form_name_first_label}{form_name_last_label}
-
{form_phone_label}{form_phone_html}
{form_email_label}{form_email_html}
Please, choose a 8-10 characters password.
{form_pass_label}{form_pass_html}
-
- - - - - - - - - -
{form_header_company_info}
{form_company_label}{form_company_html}
{form_street_label}{form_street_html}
{form_address_label}{form_address_error} - - - -
{form_address_zip_html}{form_address_city_html}
{form_address_zip_label}{form_address_city_label}
-
{form_country_label}{form_country_html}
{form_destination_label}{form_destination_html}
-
- - - - - - - - -
{form_required_note}{form_reset_html} {form_submit_html}

{form_news_html}
-
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/label.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/label.html deleted file mode 100644 index 808a7253b..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/label.html +++ /dev/null @@ -1,4 +0,0 @@ -{if:required} - * -{end:} -{label:h} \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-fancygroup.tpl b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-fancygroup.tpl deleted file mode 100644 index 7fa5d276f..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-fancygroup.tpl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {if $element.required}*{/if}{$element.label}:
- - - - {foreach key=gkey item=gitem from=$element.elements} - - {if $gitem.type eq "radio"} - - {else} - - - {/if} - - {/foreach} -
- {$gitem.html} - - {if $gitem.required}*{/if} - {$gitem.label} - - {$gitem.html} -
- - diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-green.tpl b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-green.tpl deleted file mode 100644 index d4950eba3..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic-green.tpl +++ /dev/null @@ -1,9 +0,0 @@ - - - - {$element.label}: - - {if $element.error}{$element.error}
{/if} - {$element.html}{if $element.required}*{/if} - - diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic.tpl b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic.tpl deleted file mode 100644 index 90d5dbcd6..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-dynamic.tpl +++ /dev/null @@ -1,134 +0,0 @@ - - - - - Smarty template for Array renderer - - - - - -{$form.javascript} - - - {$form.hidden} - - {foreach item=sec key=i from=$form.sections} - - - - - {foreach item=element from=$sec.elements} - - - {if $element.style} - {include file="smarty-dynamic-`$element.style`.tpl} - - {* - NOTE: Another way ist to have smarty template code in - $element.style. In this case you can do: - - {if $element.style} - {eval var=$element.style} - *} - - - {elseif $element.type eq "submit" or $element.type eq "reset"} - {if not $form.frozen} - - - - - {/if} - - - {else} - - {if $element.type eq "textarea"} - - - - - {/if} - {/foreach} - {/foreach} - - {if $form.requirednote and not $form.frozen} - - - - - {/if} - - -
- {$sec.header}
 {$element.html}
- {if $element.required}*{/if}{$element.label}
- {else} -
- {if $element.required}*{/if}{$element.label}: - {/if} - {if $element.error}{$element.error}
{/if} - {if $element.type eq "group"} - {foreach key=gkey item=gitem from=$element.elements} - {$gitem.label} - {$gitem.html}{if $gitem.required}*{/if} - {if $element.separator}{cycle values=$element.separator}{/if} - {/foreach} - {else} - {$element.html} - {/if} -
{$element.label_note}
-
 {$form.requirednote}
- -  -

Collected Errors:
-{foreach key=name item=error from=$form.errors} - {$error} in element [{$name}]
-{/foreach} -

- -  -

Best Practice:
-Use only one dynamic form template like this for your
-Smarty driven project. You include this where
-to place a form with the formdata-Array rendered by
-SmartyDynamic QuickForm Renderer as option:

- -
-{ldelim}include file=form-dynamic.tpl form=$formdata{rdelim}
-
- -  -

The used "Dynamic" Array

-
-{$dynamic_array|htmlentities}
-
- - - diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-static.tpl b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-static.tpl deleted file mode 100644 index ea3a45596..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/smarty-static.tpl +++ /dev/null @@ -1,156 +0,0 @@ - - - - - Smarty template for ArraySmarty renderer: 2 column layout example - -{$form.javascript} - - - - -
-{$form.hidden} - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
{$form.header.personal}
{$form.name.label}{$form.name.error} - - - - - - - - - -
{$form.name.first.html}{$form.name.last.html}
{$form.name.first.label}{$form.name.last.label}
-
{$form.phone.label}{$form.phone.html}
{$form.email.label}{$form.email.html}
{$form.pass.label_note}
{$form.pass.label}{$form.pass.html}
-
- - - - - - - - - - - - - - - - - - - - - - -
{$form.header.company_info}
{$form.company.label}{$form.company.html}
{$form.street.label}{$form.street.html}
{$form.address.label}{$form.address.error} - - - - - - - - - -
{$form.address.zip.html}{$form.address.city.html}
{$form.address.zip.label}{$form.address.city.label}
-
{$form.country.label}{$form.country.html}
{$form.destination.label}{$form.destination.html}
-
- - - - - - - - - -
{$form.requirednote}{$form.reset.html} {$form.submit.html}

{$form.news.html}
- -
- -
-Collected Errors:
-{foreach key=name item=error from=$form.errors} - {$error} in element [{$name}]
-{/foreach} - -  -

The used "Static" Array

-
-{$static_array|htmlentities}
-
- - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/fancygroup.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/fancygroup.html deleted file mode 100644 index d957d7e44..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/fancygroup.html +++ /dev/null @@ -1,30 +0,0 @@ - - - {if:required}*{end:} - {if:error}{end:} - {label:h}: - {if:error}{end:} - - - {if:error}
{error}
{end:} - - {foreach:elements,gitem} - - {if:gitem.isType(#radio#)} - - {else:} - - - {end:} - - {end:} -
- {gitem.html:h} - - {if:gitem.required}*{end:} - {gitem.label:h} - - {gitem.html:h} -
- - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/green.html b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/green.html deleted file mode 100644 index 36ef45d4c..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/renderers/templates/styles/green.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - {if:required}*{end:}{label:h}: - - {if:error}{error:h}
{end:} - {html:h} - {if:label_2}
{label_2:h}{end:} - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-builtin.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-builtin.php deleted file mode 100644 index c5cf99014..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-builtin.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * $Id: rules-builtin.php,v 1.4 2004/11/26 10:24:54 avb Exp $ - */ - -require_once 'HTML/QuickForm.php'; - -$form =& new HTML_QuickForm('builtin'); - -// We need an additional label below the element -$renderer =& $form->defaultRenderer(); -$renderer->setElementTemplate(<< - *{label} - - {error}
{element} -
{label_2} - - - -EOT -); - -$form->addElement('header', null, 'Required rule'); -$form->addElement('text', 'rRequired', array('Required:', 'Rule type \'required\'
Note: when the field is not \'required\' and is empty, other validation rules will not be applied to it')); -$form->addRule('rRequired', 'The field is required', 'required', null, 'client'); - -// RangeLength rules -$form->addElement('header', null, 'Range based rules'); -$form->addElement('text', 'rMaxLength', array('Maximum length check (5):', 'Rule type \'maxlength\', $format = 5')); -$form->addElement('text', 'rMinLength', array('Minimum length check (5):', 'Rule type \'minlength\', $format = 5')); -$form->addElement('text', 'rRangeLength', array('Length range check (5-10):', 'Rule type \'rangelength\', $format = array(5, 10)')); - -$form->addRule('rMaxLength', 'Should be less than or equal to 5 symbols', 'maxlength', 5, 'client'); -$form->addRule('rMinLength', 'Should be more than or equal to 5 symbols', 'minlength', 5, 'client'); -$form->addRule('rRangeLength', 'Should be between 5 and 10 symbols', 'rangelength', array(5,10), 'client'); - -// Email rule -$form->addElement('header', null, 'Email rule'); -$form->addElement('text', 'rEmail', array('Email check:', 'Rule type \'email\'')); -$form->addRule('rEmail', 'Should contain a valid email', 'email', null, 'client'); - -// RegEx rules -$form->addElement('header', null, 'Regex based rules'); -$form->addElement('text', 'rRegex', array('Letters \'A\', \'B\', \'C\' only:', 'Rule type \'regex\' with $format = \'/^[ABCabc]+$/\'')); -$form->addElement('text', 'rLettersOnly', array('Letters only:', 'Rule type \'lettersonly\'')); -$form->addElement('text', 'rAlphaNumeric', array('Alphanumeric:', 'Rule type \'alphanumeric\'')); -$form->addElement('text', 'rNumeric', array('Numeric:', 'Rule type \'numeric\'')); -$form->addElement('text', 'rNoPunctuation', array('No punctuation:', 'Rule type \'nopunctuation\'')); -$form->addElement('text', 'rNonZero', array('Nonzero:', 'Rule type \'nonzero\'')); - -$form->addRule('rRegex', 'Should contain letters A, B, C only', 'regex', '/^[ABCabc]+$/', 'client'); -$form->addRule('rLettersOnly', 'Should contain letters only', 'lettersonly', null, 'client'); -$form->addRule('rAlphaNumeric', 'Should be alphanumeric', 'alphanumeric', null, 'client'); -$form->addRule('rNumeric', 'Should be numeric', 'numeric', null, 'client'); -$form->addRule('rNoPunctuation', 'Should contain no punctuation', 'nopunctuation', null, 'client'); -$form->addRule('rNonZero', 'Should be nonzero', 'nonzero', null, 'client'); - -// Compare rule -$form->addElement('header', null, 'Compare rule'); -$form->addElement('password', 'cmpPasswd', 'Password:'); -$form->addElement('password', 'cmpRepeat', array('Repeat password:', 'Rule type \'compare\', added to array(\'cmpPasswd\', \'cmpRepeat\')')); -$form->addRule(array('cmpPasswd', 'cmpRepeat'), 'The passwords do not match', 'compare', null, 'client'); - -// File rules -$form->addElement('header', null, 'Uploaded file rules'); -$form->addElement('file', 'tstUpload', array('Upload file:', 'Rule types: \'uploadedfile\', \'maxfilesize\' with $format = 10240, \'mimetype\' with $format = \'text/xml\', filename with $format = \'/\\.xml$/\'
Validation for files is obviously server-side only')); -$form->addRule('tstUpload', 'Upload is required', 'uploadedfile'); -$form->addRule('tstUpload', 'File size should be less than 10kb', 'maxfilesize', 10240); -$form->addRule('tstUpload', 'File type should be text/xml', 'mimetype', 'text/xml'); -$form->addRule('tstUpload', 'File name should be *.xml', 'filename', '/\\.xml$/'); - -$form->addElement('header', null, 'Submit the form'); -$submit[] =& $form->createElement('submit', null, 'Send'); -$submit[] =& $form->createElement('checkbox', 'clientSide', null, 'use client-side validation', array('checked' => 'checked', 'onclick' => "if (this.checked) {this.form.onsubmit = oldHandler;} else {oldHandler = this.form.onsubmit; this.form.onsubmit = null;}")); -$form->addGroup($submit, null, null, ' ', false); - -$form->applyFilter('__ALL__', 'trim'); - -$form->validate(); - -$form->display(); -?> diff --git a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-custom.php b/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-custom.php deleted file mode 100644 index b6ba613ee..000000000 --- a/campcaster/src/tools/pear/src/docs/HTML_QuickForm/docs/rules-custom.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * $Id: rules-custom.php,v 1.2 2003/11/03 20:45:23 avb Exp $ - */ - -require_once 'HTML/QuickForm.php'; -require_once 'HTML/QuickForm/Rule.php'; - -class RuleNumericRange extends HTML_QuickForm_Rule -{ - function validate($value, $options) - { - if (isset($options['min']) && floatval($value) < $options['min']) { - return false; - } - if (isset($options['max']) && floatval($value) > $options['max']) { - return false; - } - return true; - } - - function getValidationScript($options = null) - { - $jsCheck = array(); - if (isset($options['min'])) { - $jsCheck[] = 'Number({jsVar}) >= ' . $options['min']; - } - if (isset($options['max'])) { - $jsCheck[] = 'Number({jsVar}) <= ' . $options['max']; - } - return array('', "{jsVar} != '' && !(" . implode(' && ', $jsCheck) . ')'); - } // end func getValidationScript -} - -// In case you are wondering, this checks whether there are too many -// CAPITAL LETTERS in the string -function countUpper($value, $limit = null) -{ - if (empty($value)) { - return false; - } - if (!isset($limit)) { - $limit = 0.5; - } - $upper = array_filter(preg_split('//', $value, -1, PREG_SPLIT_NO_EMPTY), 'ctype_upper'); - return (count($upper) / strlen($value)) <= $limit; -} - -// BC thingie: it expects the first param to be element name -function countUpper_old($name, $value, $limit = null) -{ - if (empty($value)) { - return false; - } - if (!isset($limit)) { - $limit = 0.5; - } - $upper = array_filter(preg_split('//', $value, -1, PREG_SPLIT_NO_EMPTY), 'ctype_upper'); - return (count($upper) / strlen($value)) <= $limit; -} - -$form =& new HTML_QuickForm('custom'); - -$form->addElement('header', null, 'Custom rule class'); - -// registering the custom rule class -$form->registerRule('numRange', null, 'RuleNumericRange'); -$form->addElement('text', 'rNumber_1_10', 'The number (1-10):'); -$form->addRule('rNumber_1_10', 'Enter number from 1 to 10', 'numRange', array('min' => 1, 'max' => 10), 'client'); - -// adding an instance of the custom rule class without registering -$form->addElement('text', 'rNonnegative', 'Nonnegative number:'); -$form->addRule('rNonnegative', 'Enter nonnegative number', new RuleNumericRange(), array('min' => 0), 'client'); - -// adding a classname of the custom rule class without registering -$form->addElement('text', 'rNonpositive', 'Nonpositive number:'); -$form->addRule('rNonpositive', 'Enter nonpositive number', 'RuleNumericRange', array('max' => 0), 'client'); - -$form->addElement('header', null, 'Using callbacks'); - -// using callback without registering -$form->addElement('text', 'rUpper_0_5', 'Some (preferrably lowercase) text:'); -$form->addRule('rUpper_0_5', 'There are too many CAPITAL LETTERS', 'callback', 'countUpper'); - -// register with 'callback' type -$form->registerRule('upper', 'callback', 'countUpper'); -$form->addElement('text', 'rUpper_0_25', 'Some (mostly lowercase) text:'); -$form->addRule('rUpper_0_25', 'There are too many CAPITAL LETTERS', 'upper', 0.25); - -// BC feature: register with 'function' type -$form->registerRule('upperOld', 'function', 'countUpper_old'); -$form->addElement('text', 'rUpper_0', 'Some lowercase text:'); -$form->addRule('rUpper_0', 'There are CAPITAL LETTERS, this is not allowed', 'upperOld', 0); - -$form->addElement('submit', null, 'Send'); - -$form->applyFilter(array('rUpper_0_5', 'rUpper_0_25', 'rUpper_0'), 'trim'); -$form->applyFilter(array('rNumber_1_10', 'rNonnegative', 'rNonpositive'), 'floatval'); - -$form->validate(); - -$form->display(); -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example1.php b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example1.php deleted file mode 100644 index 4f5014d76..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example1.php +++ /dev/null @@ -1,31 +0,0 @@ - -*/ - error_reporting( E_ALL ); - - require_once 'XML/Beautifier.php'; - $fmt = new XML_Beautifier(); - $result = $fmt->formatFile('test.xml', 'test2.xml'); - - if (PEAR::isError($result)) { - echo $result->getMessage(); - exit(); - } - - echo "

Original file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test.xml')));
-    echo "
"; - - echo "

"; - - echo "

Beautified file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test2.xml')));
-    echo "
"; -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example2.php b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example2.php deleted file mode 100644 index 4922a6acc..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example2.php +++ /dev/null @@ -1,30 +0,0 @@ - -*/ - error_reporting( E_ALL ); - - $xmlString = 'foobar'; - - require_once 'XML/Beautifier.php'; - $fmt = new XML_Beautifier(); - $result = $fmt->formatString($xmlString); - - echo "

Original string

"; - echo "
";
-    echo htmlspecialchars($xmlString);
-    echo "
"; - - echo "

"; - - echo "

Beautified string

"; - echo "
";
-    echo htmlspecialchars($result);
-    echo "
"; -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example3.php b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example3.php deleted file mode 100644 index 1680b8fdc..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example3.php +++ /dev/null @@ -1,36 +0,0 @@ - -*/ - error_reporting( E_ALL ); - - require_once 'XML/Beautifier.php'; - - $options = array( - "caseFolding" => true, - "caseFoldingTo" => "uppercase" - ); - - $fmt = new XML_Beautifier($options); - $result = $fmt->formatFile('test.xml', 'test2.xml'); - - echo "

Original file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test.xml')));
-    echo "
"; - - echo "

"; - - echo "

Beautified file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test2.xml')));
-    echo "
"; -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example4.php b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example4.php deleted file mode 100644 index 011cb5a78..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example4.php +++ /dev/null @@ -1,33 +0,0 @@ - -*/ - error_reporting( E_ALL ); - - require_once 'XML/Beautifier.php'; - - $options = array( - "normalizeComments" => true, - ); - - $fmt = new XML_Beautifier($options); - $result = $fmt->formatFile('test.xml', 'test2.xml'); - - echo "

Original file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test.xml')));
-    echo "
"; - - echo "

"; - - echo "

Beautified file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test2.xml')));
-    echo "
"; -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example5.php b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example5.php deleted file mode 100644 index 29c83380a..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example5.php +++ /dev/null @@ -1,37 +0,0 @@ - -*/ - error_reporting( E_ALL ); - - require_once 'XML/Beautifier.php'; - - $options = array( - "normalizeComments" => true, - "maxCommentLine" => 10 - ); - - $fmt = new XML_Beautifier($options); - $result = $fmt->formatFile('test.xml', 'test2.xml'); - - echo "

Original file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test.xml')));
-    echo "
"; - - echo "

"; - - echo "

Beautified file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test2.xml')));
-    echo "
"; -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example6.php b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example6.php deleted file mode 100644 index 2bd2a42c3..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/example6.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ - error_reporting( E_ALL ); - - require_once 'XML/Beautifier.php'; - - $fmt = new XML_Beautifier( array( "multilineTags" => true ) ); - $result = $fmt->formatFile('test.xml'); - - echo "

Original file

"; - echo "
";
-    echo htmlspecialchars(implode("",file('test.xml')));
-    echo "
"; - - echo "

"; - - echo "

Beautified file

"; - echo "
";
-    echo htmlspecialchars($result);
-    echo "
"; -?> diff --git a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/test.xml b/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/test.xml deleted file mode 100644 index c9764039d..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Beautifier/examples/test.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - -]> - - - -Stephan Schmidt - - - -"; - } -?> -&foo;&bar; - - - Welcome to PHP -Application Tools & PEAR! - - If you're new to pat, and would like - - to know - - what we do - - here, take a look at - - - "About Pat" -or -check out the -"projects overview". Otherwise, you probably know your way -around -the site already - - - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.php b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.php deleted file mode 100644 index a659db608..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @package XML_Parser - * @subpackage Examples - */ - -/** - * require the parser - */ -require_once 'XML/Parser.php'; - -class myParser extends XML_Parser -{ - - function myParser() - { - parent::XML_Parser(); - } - - /** - * handle start element - * - * @access private - * @param resource xml parser resource - * @param string name of the element - * @param array attributes - */ - function startHandler($xp, $name, $attribs) - { - printf('handle start tag: %s
', $name); - } - - /** - * handle start element - * - * @access private - * @param resource xml parser resource - * @param string name of the element - * @param array attributes - */ - function endHandler($xp, $name) - { - printf('handle end tag: %s
', $name); - } -} - -$p = &new myParser(); - -$result = $p->setInputFile('xml_parser_file.xml'); -$result = $p->parse(); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.xml b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.xml deleted file mode 100644 index f59af027c..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_file.xml +++ /dev/null @@ -1,5 +0,0 @@ - - content of bar - - test - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_handler.php b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_handler.php deleted file mode 100644 index c6c5d036f..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_handler.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @package XML_Parser - * @subpackage Examples - */ - -/** - * require the parser - */ -require_once 'XML/Parser.php'; - -class myHandler -{ - /** - * handle start element - * - * @access private - * @param resource xml parser resource - * @param string name of the element - * @param array attributes - */ - function startHandler($xp, $name, $attribs) - { - printf('handle start tag: %s
', $name); - } - - /** - * handle start element - * - * @access private - * @param resource xml parser resource - * @param string name of the element - * @param array attributes - */ - function endHandler($xp, $name) - { - printf('handle end tag: %s
', $name); - } -} - -$p = &new XML_Parser(); -$h = &new myHandler(); - -$result = $p->setInputFile('xml_parser_file.xml'); -$result = $p->setHandlerObj($h); -$result = $p->parse(); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.php b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.php deleted file mode 100644 index 6eb4d896d..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @package XML_Parser - * @subpackage Examples - */ - -/** - * require the parser - */ -require_once 'XML/Parser/Simple.php'; - -class myParser extends XML_Parser_Simple -{ - function myParser() - { - $this->XML_Parser_Simple(); - } - - /** - * handle the element - * - * The element will be handled, once it's closed - * - * @access private - * @param string name of the element - * @param array attributes of the element - * @param string character data of the element - */ - function handleElement($name, $attribs, $data) - { - printf('handling %s in tag depth %d
', $name, $this->getCurrentDepth()); - printf('character data: %s
', $data ); - print 'Attributes:
'; - print '
';
-        print_r( $attribs );
-        print '
'; - print '
'; - } -} - -$p = &new myParser(); - -$result = $p->setInputFile('xml_parser_simple1.xml'); -$result = $p->parse(); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.xml b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.xml deleted file mode 100644 index 0696ef670..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - content of bar - - - test - pizza - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.php b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.php deleted file mode 100644 index f9f80fb46..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @package XML_Parser - * @subpackage Examples - */ - -/** - * require the parser - */ -require_once 'XML/Parser/Simple.php'; - -class myParser2 extends XML_Parser_Simple -{ - function myParser() - { - $this->XML_Parser_Simple(); - } - - /** - * handle the category element - * - * The element will be handled, once it's closed - * - * @access private - * @param string name of the element - * @param array attributes of the element - * @param string character data of the element - */ - function handleElement_category($name, $attribs, $data) - { - printf( 'Category is %s
', $data ); - } - - /** - * handle the name element - * - * The element will be handled, once it's closed - * - * @access private - * @param string name of the element - * @param array attributes of the element - * @param string character data of the element - */ - function handleElement_name($name, $attribs, $data) - { - printf( 'Name is %s
', $data ); - } -} - -$p = &new myParser2(); -$result = $p->setInputFile('xml_parser_simple2.xml'); -$p->setMode('func'); -$result = $p->parse(); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.xml b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.xml deleted file mode 100644 index ec56e6543..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple2.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - XML - XML_Parser - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple_handler.php b/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple_handler.php deleted file mode 100644 index e13bec21f..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Parser/examples/xml_parser_simple_handler.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @package XML_Parser - * @subpackage Examples - */ - -/** - * require the parser - */ -require_once 'XML/Parser/Simple.php'; - -class myHandlerSimple -{ - /** - * handle the category element - * - * The element will be handled, once it's closed - * - * @access private - * @param string name of the element - * @param array attributes of the element - * @param string character data of the element - */ - function handleElement_category($name, $attribs, $data) - { - printf( 'Category is %s
', $data ); - } - - /** - * handle the name element - * - * The element will be handled, once it's closed - * - * @access private - * @param string name of the element - * @param array attributes of the element - * @param string character data of the element - */ - function handleElement_name($name, $attribs, $data) - { - printf( 'Name is %s
', $data ); - } -} - -$p = &new XML_Parser_Simple(); -$h = &new myHandlerSimple(); -$p->setHandlerObj($h); -$result = $p->setInputFile('xml_parser_simple2.xml'); -$p->setMode('func'); -$result = $p->parse(); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/example.xml b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/example.xml deleted file mode 100644 index 62aaac89f..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/example.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - Test - test - - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndEncode.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndEncode.php deleted file mode 100644 index c5dbdb982..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndEncode.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - require_once 'XML/Unserializer.php'; - - // this is just to get a nested object - $pearError = PEAR::raiseError('This is just an error object',123); - - $options = array( - 'indent' => ' ', - 'linebreak' => "\n", - 'scalarAsAttributes' => true, - 'encodeFunction' => 'strtoupper' - ); - - $foo = new stdClass(); - $foo->bar = new stdClass(); - $foo->bar->test = 'This is a test.'; - $foo->bar->value = 'This is a value.'; - - $serializer = &new XML_Serializer($options); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - } - - echo "
";
-    print_r( htmlspecialchars($xml) );
-    echo	"
"; - - $unserializer = &new XML_Unserializer(); - $unserializer->setOption('parseAttributes', true); - $unserializer->setOption('decodeFunction', 'strtolower'); - - $result = $unserializer->unserialize($xml); - - echo '
';
-    print_r($unserializer->getUnserializedData());
-    echo '
'; -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndReturn.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndReturn.php deleted file mode 100644 index a792e8d3f..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeAndReturn.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - 'indent' => ' ', - 'linebreak' => "\n", - 'returnResult' => true - ); - - $serializer = new XML_Serializer($options); - - $foo = PEAR::raiseError('Just a test', 1234); - - $result = $serializer->serialize($foo); - - echo '
';
-    echo htmlspecialchars($result);
-    echo '
'; -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeArrayWithObjects.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeArrayWithObjects.php deleted file mode 100644 index ed28a5b24..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeArrayWithObjects.php +++ /dev/null @@ -1,47 +0,0 @@ - simplexml - * - * @author Stephan Schmidt - * @see serializeIndexedArray.php - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "typeHints" => false, - "addDecl" => true, - "encoding" => "UTF-8" - ); - - $serializer = new XML_Serializer($options); - - $serializer->setErrorHandling(PEAR_ERROR_DIE); - - $array = array( - new stdClass(), - new stdClass() - ); - - $result = $serializer->serialize($array); - - if( $result === true ) { - echo "
";
-        echo    htmlentities($serializer->getSerializedData());
-        echo    "
"; - } - - $result = $serializer->serialize($array, array( 'classAsTagName' => true )); - - if( $result === true ) { - echo "
";
-        echo    htmlentities($serializer->getSerializedData());
-        echo    "
"; - } - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeEmptyArray.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeEmptyArray.php deleted file mode 100644 index 8e8503f95..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeEmptyArray.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -error_reporting(E_ALL); -require_once 'XML/Unserializer.php'; - -$xml = <<< EOF - -1.0 - - -EOF; - -$unserializer = new XML_Unserializer(); -$result = $unserializer->unserialize($xml); - -if( $result === true ) { - echo '
';
-    print_r($unserializer->getUnserializedData());
-    echo '
'; -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeIndexedArray.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeIndexedArray.php deleted file mode 100644 index 7630569bd..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeIndexedArray.php +++ /dev/null @@ -1,60 +0,0 @@ - simplexml - * - * It can be used to serialize an indexed array - * like ext/simplexml does, by using the name - * of the parent tag, while omitting this tag. - * - * @author Stephan Schmidt - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "rootName" => "rdf:RDF", - "rootAttributes" => array("version" => "0.91"), - "mode" => "simplexml" - ); - - $serializer = new XML_Serializer($options); - - - $rdf = array( - "channel" => array( - "title" => "Example RDF channel", - "link" => "http://www.php-tools.de", - "image" => array( - "title" => "Example image", - "url" => "http://www.php-tools.de/image.gif", - "link" => "http://www.php-tools.de" - ), - "item" => array( - array( - "title" => "Example item", - "link" => "http://example.com" - ), - array( - "title" => "Another item", - "link" => "http://example.com" - ), - array( - "title" => "I think you get it...", - "link" => "http://example.com" - ) - ) - ) - ); - - $result = $serializer->serialize($rdf); - - if( $result === true ) { - echo "
";
-        echo    htmlentities($serializer->getSerializedData());
-        echo    "
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeObject.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeObject.php deleted file mode 100644 index b277e7a30..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeObject.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - // this is just to get a nested object - $pearError = PEAR::raiseError('This is just an error object',123); - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "defaultTagName" => "unnamedItem", - "typeHints" => true - ); - - $foo = new stdClass; - $foo->value = "My value"; - $foo->error = $pearError; - $foo->xml = "cool"; - - $foo->obj = new stdClass; - $foo->arr = array(); - $foo->zero = 0; - - $serializer = &new XML_Serializer($options); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - } - - echo "
";
-    print_r( htmlspecialchars($xml) );
-    echo	"
"; -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeRDF.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeRDF.php deleted file mode 100644 index 274643ce7..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeRDF.php +++ /dev/null @@ -1,64 +0,0 @@ - simplexml - * - * @author Stephan Schmidt - * @see serializeIndexedArray.php - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "typeHints" => false, - "addDecl" => true, - "encoding" => "UTF-8", - "rootName" => "rdf:RDF", - "rootAttributes" => array("version" => "0.91"), - "defaultTagName" => "item", - "attributesArray" => "_attributes" - ); - - $serializer = new XML_Serializer($options); - - - $rdf = array( - "channel" => array( - "title" => "Example RDF channel", - "link" => "http://www.php-tools.de", - "image" => array( - "title" => "Example image", - "url" => "http://www.php-tools.de/image.gif", - "link" => "http://www.php-tools.de" - ), - "_attributes" => array( "rdf:about" => "http://example.com/foobar.html" ), - array( - "title" => "Example item", - "link" => "http://example.com", - "_attributes" => array( "rdf:about" => "http://example.com/foobar.html" ) - ), - array( - "title" => "Another item", - "link" => "http://example.com", - "_attributes" => array( "rdf:about" => "http://example.com/foobar.html" ) - ), - array( - "title" => "I think you get it...", - "link" => "http://example.com", - "_attributes" => array( "rdf:about" => "http://example.com/foobar.html" ) - ) - ) - ); - - $result = $serializer->serialize($rdf); - - if( $result === true ) { - echo "
";
-        echo    htmlentities($serializer->getSerializedData());
-        echo    "
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes.php deleted file mode 100644 index 598ea6fb4..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "defaultTagName" => "unnamedItem", - "scalarAsAttributes" => true, - ); - - // this is just to get a nested object - $pearError = PEAR::raiseError('This is just an error object',123); - - $foo = new stdClass; - - $foo->value = "My value"; - $foo->error = $pearError; - $foo->xml = "cool"; - - $serializer = new XML_Serializer($options); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - - echo "
";
-	    print_r( htmlspecialchars($xml) );
-	    echo	"
"; - } else { - echo "
";
-		print_r($result);
-		echo	"
"; - } - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes2.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes2.php deleted file mode 100644 index 5e0ce92d5..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithAttributes2.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "defaultTagName" => "unnamedItem", - "scalarAsAttributes" => false, - "attributesArray" => '_attributes', - "contentName" => '_content' - ); - - $data = array( - 'foo' => array( - '_attributes' => array( 'version' => '1.0', 'foo' => 'bar' ), - '_content' => 'test' - ), - 'schst' => 'Stephan Schmidt' - ); - - $serializer = new XML_Serializer($options); - - $result = $serializer->serialize($data); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - - echo "
";
-	    print_r( htmlspecialchars($xml) );
-	    echo	"
"; - } else { - echo "
";
-		print_r($result);
-		echo	"
"; - } - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithDtd.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithDtd.php deleted file mode 100644 index 7370fd888..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithDtd.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "addDecl" => true, - "addDoctype" => true, - "doctype" => array( - 'uri' => 'http://pear.php.net/dtd/package-1.0', - 'id' => '-//PHP//PEAR/DTD PACKAGE 0.1' - ) - ); - - $serializer = new XML_Serializer($options); - - $foo = PEAR::raiseError("Just a test", 1234); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - echo "
";
-        echo    htmlentities($serializer->getSerializedData());
-        echo    "
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithIndentedAttributes.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithIndentedAttributes.php deleted file mode 100644 index 5b63199ec..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithIndentedAttributes.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ - error_reporting(E_ALL); - require_once 'XML/Serializer.php'; - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "typeHints" => false, - "defaultTagName" => "unnamedItem", - "scalarAsAttributes" => true, - "indentAttributes" => "_auto" - ); - - // this is just to get a nested object - $pearError = PEAR::raiseError('This is just an error object',123); - - $foo = new stdClass; - - $foo->value = "My value"; - $foo->error = $pearError; - $foo->xml = "cool"; - - $serializer = new XML_Serializer($options); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - - echo "
";
-	    print_r( htmlspecialchars($xml) );
-	    echo	"
"; - } else { - echo "
";
-		print_r($result);
-		echo	"
"; - } - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithNamespace.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithNamespace.php deleted file mode 100644 index e157720a8..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithNamespace.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once '../Serializer.php'; - - $options = array( - 'indent' => ' ', - 'linebreak' => "\n", - 'defaultTagName' => 'item', - 'namespace' => 'foo' - ); - - $foo = new stdClass; - $foo->value = 'My value'; - $foo->xml = 'cool'; - - $foo->obj = new stdClass; - $foo->arr = array(); - $foo->zero = 0; - - $serializer = &new XML_Serializer($options); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - } - - echo '
';
-    print_r( htmlspecialchars($xml) );
-    echo	'
'; - - // also pass the URI - $serializer->setOption('namespace', array('bar', 'http://pear.php.net/package/XML_Serializer')); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - } - - echo '
';
-    print_r( htmlspecialchars($xml) );
-    echo	'
'; -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithTagMap.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithTagMap.php deleted file mode 100644 index 6d3ad5520..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/serializeWithTagMap.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ - error_reporting(E_ALL); - require_once 'XML/Serializer.php'; - - $options = array( - 'indent' => ' ', - 'linebreak' => "\n", - 'mode' => 'simplexml', - 'rootName' => 'items' - ); - - $data = array( - 'item' => array( array( - 'title' => 'Foobar!', - 'description' => 'This is some text....', - 'link' => 'http://foobar.com' - ), - array( - 'title' => 'Foobar2!', - 'description' => 'This is some text.ü ü ä ö', - 'link' => 'http://foobar.com' - ) - ) - - ); - - - $serializer = new XML_Serializer($options); - - $result = $serializer->serialize($data); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - - echo '
';
-	    print_r( htmlspecialchars($xml) );
-	    echo	'
'; - } else { - echo '
';
-		print_r($result);
-		echo	'
'; - } - - $newOptions = array( - 'rootName' => 'body', - 'replaceEntities' => XML_SERIALIZER_ENTITIES_HTML, - 'tagMap' => array( - 'item' => 'div', - 'title' => 'h1', - 'description' => 'p', - 'link' => 'tt' - ) - ); - - $result = $serializer->serialize($data, $newOptions); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - - echo '
';
-	    print_r( htmlspecialchars($xml) );
-	    echo	'
'; - } else { - echo '
';
-		print_r($result);
-		echo	'
'; - } - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeAnyXML.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeAnyXML.php deleted file mode 100644 index a867d4c14..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeAnyXML.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ - error_reporting(E_ALL); - - // this is a simple XML document - $xml = '' . - ' Stephan Schmidt' . - ' Martin Jansen' . - ' PEAR QA Team' . - ' This is handled by the default keyAttribute' . - ' Another foo tag' . - ''; - - require_once 'XML/Unserializer.php'; - - // complex structures are arrays, the key is the attribute 'handle' or 'name', if handle is not present - $options = array( - "complexType" => "array", - "keyAttribute" => array( - 'user' => 'handle', - 'group' => 'name', - '__default' => 'id' - ) - ); - - // be careful to always use the ampersand in front of the new operator - $unserializer = &new XML_Unserializer($options); - - // userialize the document - $status = $unserializer->unserialize($xml, false); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } - - - // unserialize it again and change the complexType option - // but leave other options untouched - // now complex types will be an object, and the property name will be in the - // attribute 'handle' - $status = $unserializer->unserialize($xml, false, array("complexType" => "object")); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } - - - // unserialize it again and change the complexType option - // and reset all other options - // Now, there's no key so the tags are stored in an array - $status = $unserializer->unserialize($xml, false, array("overrideOptions" => true, "complexType" => "object")); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeClassNames.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeClassNames.php deleted file mode 100644 index 57080dfe4..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeClassNames.php +++ /dev/null @@ -1,57 +0,0 @@ - - * @category XML - * @package XML_Serializer - * @subpackage Examples - */ -error_reporting(E_ALL); - -/** - * uses XML_Unserializer - */ -require_once 'XML/Unserializer.php'; - -$xml = << - - bar - - - -EOT; - -class foo -{ -} -class bar -{ -} - -echo '
';
-
-//  be careful to always use the ampersand in front of the new operator 
-$unserializer = &new XML_Unserializer();
-$unserializer->setOption('complexType', 'object');
-$unserializer->setOption('parseAttributes', true);
-$unserializer->setOption('returnResult', true);
-
-
-$data = $unserializer->unserialize($xml);    
-var_dump( $data );
-
-
-echo "Do not use tagname as class name\n";
-$unserializer->setOption('tagAsClass', false);
-$data = $unserializer->unserialize($xml);    
-var_dump( $data );
-
-echo "Use a different default class\n";
-$unserializer->setOption('defaultClass', 'foo');
-$data = $unserializer->unserialize($xml);    
-var_dump( $data );
-
-echo '
'; -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEncoded.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEncoded.php deleted file mode 100644 index 22d707cbe..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEncoded.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Unserializer.php'; - -$xml = ' - - chickenwings - '.utf8_encode('Hähnchenflügel').' - - '; - - // specify different source and target encodings - $options = array( - 'encoding' => 'UTF-8', - 'targetEncoding' => 'ISO-8859-1' - ); - - - // be careful to always use the ampersand in front of the new operator - $unserializer = &new XML_Unserializer($options); - - // userialize the document - $status = $unserializer->unserialize($xml); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEnum.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEnum.php deleted file mode 100644 index 6af1e14d2..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeEnum.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @uses example.xml - */ - error_reporting(E_ALL); - - require_once 'XML/Unserializer.php'; - -$xml1 = ' - - schst - - - luckec - - '; - -$xml2 = ' - - schst - - '; - - $options = array( - 'forceEnum' => array('item') - ); - - - // be careful to always use the ampersand in front of the new operator - $unserializer = &new XML_Unserializer($options); - - // userialize the document - $status = $unserializer->unserialize($xml1); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } - - // userialize the document - $status = $unserializer->unserialize($xml2); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeObject.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeObject.php deleted file mode 100644 index b4f1a2c53..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeObject.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once 'XML/Serializer.php'; - require_once 'XML/Unserializer.php'; - // this is just to get a nested object - $pearError = PEAR::raiseError('This is just an error object',123); - - $options = array( - "indent" => " ", - "linebreak" => "\n", - "defaultTagName" => "unnamedItem", - "typeHints" => true - ); - - $foo = new stdClass; - - $foo->value = "My value"; - $foo->error = $pearError; - $foo->xml = array( "This is" => "cool" ); - $foo->resource = fopen( "../package.xml", "r" ); - - $serializer = new XML_Serializer($options); - - $result = $serializer->serialize($foo); - - if( $result === true ) { - $xml = $serializer->getSerializedData(); - } - - echo "
";
-    print_r( htmlspecialchars($xml) );
-    echo	"
"; - - // be careful to always use the ampersand in front of the new operator - $unserializer = &new XML_Unserializer(); - - $status = $unserializer->unserialize($xml); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        var_dump( $data );
-        echo	"
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeRDF.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeRDF.php deleted file mode 100644 index 0621936a7..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeRDF.php +++ /dev/null @@ -1,93 +0,0 @@ - - */ - error_reporting(E_ALL); - - require_once '../Unserializer.php'; - - /** - * class for the RDF docuemnt - * - * - */ - class rdfDocument - { - var $channel; - var $item; - - function getItems($amount) - { - return array_splice($this->item,0,$amount); - } - } - - - /** - * class that is used for a channel in the RSS file - * - * you could implement whatever you like in this class, - * properties will be set from the XML document - */ - class channel - { - function getTitle() - { - return $this->title; - } - } - - /** - * class that is used for an item in the RSS file - * - * you could implement whatever you like in this class, - * properties will be set from the XML document - */ - class item - { - function getTitle() - { - return $this->title; - } - } - - - $options = array( - "complexType" => "object", - "tagMap" => array( - "rdf:RDF" => "rdfDocument", // this is used to specify a classname for the root tag - ) - ); - - // be careful to always use the ampersand in front of the new operator - $unserializer = &new XML_Unserializer($options); - - $status = $unserializer->unserialize("http://pear.php.net/feeds/latest.rss",true); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $rss = $unserializer->getUnserializedData(); - - echo "This has been returned by XML_Unserializer:
"; - - echo "
";
-        print_r( $rss );
-        echo "
"; - - echo "

Root Tagname: ".$unserializer->getRootName()."
"; - - echo "Title of the channel: ".$rss->channel->getTitle()."
"; - - $items = $rss->getItems(3); - echo "
Titles of the last three releases:
"; - foreach ($items as $item) { - echo "Title : ".$item->getTitle()."
"; - } - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeWithAttributes.php b/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeWithAttributes.php deleted file mode 100644 index 27bb06988..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Serializer/examples/unserializeWithAttributes.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @uses example.xml - */ - error_reporting(E_ALL); - - require_once 'XML/Unserializer.php'; - - $options = array( - "parseAttributes" => true, - "attributesArray" => false - ); - - // be careful to always use the ampersand in front of the new operator - $unserializer = &new XML_Unserializer($options); - - // userialize the document - $status = $unserializer->unserialize("example.xml", true); - - if (PEAR::isError($status)) { - echo "Error: " . $status->getMessage(); - } else { - $data = $unserializer->getUnserializedData(); - - echo "
";
-        print_r( $data );
-        echo	"
"; - } -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Util/examples/example.php b/campcaster/src/tools/pear/src/docs/XML_Util/examples/example.php deleted file mode 100644 index 365205661..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Util/examples/example.php +++ /dev/null @@ -1,228 +0,0 @@ -\n"; - print XML_Util::replaceEntities("This string contains < & >."); - print "\n

\n"; - - /** - * reversing XML entities - */ - print "replace XML entities:
\n"; - print XML_Util::reverseEntities("This string contains < & >."); - print "\n

\n"; - - /** - * building XML declaration - */ - print "building XML declaration:
\n"; - print htmlspecialchars(XML_Util::getXMLDeclaration()); - print "\n

\n"; - - print "building XML declaration with additional attributes:
"; - print htmlspecialchars(XML_Util::getXMLDeclaration("1.0", "UTF-8", true)); - print "\n

\n"; - - /** - * building document type declaration - */ - print "building DocType declaration:
\n"; - print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', 'http://pear.php.net/dtd/package-1.0')); - print "\n

\n"; - - print "building DocType declaration with public ID (does not exist):
\n"; - print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', array('uri' => 'http://pear.php.net/dtd/package-1.0', 'id' => '-//PHP//PEAR/DTD PACKAGE 0.1'))); - print "\n

\n"; - - print "building DocType declaration with internal DTD:
\n"; - print "
";
-    print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', 'http://pear.php.net/dtd/package-1.0', ''));
-    print "
"; - print "\n

\n"; - - /** - * creating an attribute string - */ - $att = array( - "foo" => "bar", - "argh" => "tomato" - ); - - print "converting array to string:
\n"; - print XML_Util::attributesToString($att); - print "\n

\n"; - - - /** - * creating an attribute string with linebreaks - */ - $att = array( - "foo" => "bar", - "argh" => "tomato" - ); - - print "converting array to string (including line breaks):
\n"; - print "
";
-    print XML_Util::attributesToString($att, true, true);
-    print "
"; - print "\n

\n"; - - - /** - * splitting a qualified tag name - */ - print "splitting qualified tag name:
\n"; - print "
";
-    print_r(XML_Util::splitQualifiedName("xslt:stylesheet"));
-    print "
"; - print "\n
\n"; - - - /** - * splitting a qualified tag name (no namespace) - */ - print "splitting qualified tag name (no namespace):
\n"; - print "
";
-    print_r(XML_Util::splitQualifiedName("foo"));
-    print "
"; - print "\n
\n"; - - /** - * splitting a qualified tag name (no namespace, but default namespace specified) - */ - print "splitting qualified tag name (no namespace, but default namespace specified):
\n"; - print "
";
-    print_r(XML_Util::splitQualifiedName("foo", "bar"));
-    print "
"; - print "\n
\n"; - - /** - * verifying XML names - */ - print "verifying 'My private tag':
\n"; - print "
";
-    print_r(XML_Util::isValidname('My Private Tag'));
-    print "
"; - print "\n

\n"; - - print "verifying '-MyTag':
\n"; - print "
";
-    print_r(XML_Util::isValidname('-MyTag'));
-    print "
"; - print "\n

\n"; - - /** - * creating an XML tag - */ - $tag = array( - "namespace" => "foo", - "localPart" => "bar", - "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), - "content" => "I'm inside the tag" - ); - - print "creating a tag with namespace and local part:
"; - print htmlentities(XML_Util::createTagFromArray($tag)); - print "\n

\n"; - - /** - * creating an XML tag - */ - $tag = array( - "qname" => "foo:bar", - "namespaceUri" => "http://foo.com", - "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), - "content" => "I'm inside the tag" - ); - - print "creating a tag with qualified name and namespaceUri:
\n"; - print htmlentities(XML_Util::createTagFromArray($tag)); - print "\n

\n"; - - /** - * creating an XML tag - */ - $tag = array( - "qname" => "bar", - "namespaceUri" => "http://foo.com", - "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ) - ); - - print "creating an empty tag without namespace but namespace Uri:
\n"; - print htmlentities(XML_Util::createTagFromArray($tag)); - print "\n

\n"; - - /** - * creating an XML tag with a CData Section - */ - $tag = array( - "qname" => "foo", - "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), - "content" => "I'm inside the tag" - ); - - print "creating a tag with CData section:
\n"; - print htmlentities(XML_Util::createTagFromArray($tag, XML_UTIL_CDATA_SECTION)); - print "\n

\n"; - - /** - * creating an XML tag with a CData Section - */ - $tag = array( - "qname" => "foo", - "attributes" => array( "key" => "value", "argh" => "tütü" ), - "content" => "Also XHTML-tags can be created and HTML entities can be replaced Ä ä Ü ö <>." - ); - - print "creating a tag with HTML entities:
\n"; - print htmlentities(XML_Util::createTagFromArray($tag, XML_UTIL_ENTITIES_HTML)); - print "\n

\n"; - - /** - * creating an XML tag with createTag - */ - print "creating a tag with createTag:
"; - print htmlentities(XML_Util::createTag("myNs:myTag", array("foo" => "bar"), "This is inside the tag", "http://www.w3c.org/myNs#")); - print "\n

\n"; - - - /** - * trying to create an XML tag with an array as content - */ - $tag = array( - "qname" => "bar", - "content" => array( "foo" => "bar" ) - ); - print "trying to create an XML tag with an array as content:
\n"; - print "
";
-    print_r(XML_Util::createTagFromArray($tag));
-    print "
"; - print "\n

\n"; - - /** - * trying to create an XML tag without a name - */ - $tag = array( - "attributes" => array( "foo" => "bar" ), - ); - print "trying to create an XML tag without a name:
\n"; - print "
";
-    print_r(XML_Util::createTagFromArray($tag));
-    print "
"; - print "\n

\n"; -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/docs/XML_Util/examples/example2.php b/campcaster/src/tools/pear/src/docs/XML_Util/examples/example2.php deleted file mode 100644 index 9d818558b..000000000 --- a/campcaster/src/tools/pear/src/docs/XML_Util/examples/example2.php +++ /dev/null @@ -1,95 +0,0 @@ -"; - print htmlentities(XML_Util::createStartElement("myNs:myTag", array("foo" => "bar"), "http://www.w3c.org/myNs#")); - print "\n

\n"; - - - /** - * creating a start element - */ - print "creating a start element:
"; - print htmlentities(XML_Util::createStartElement("myTag", array(), "http://www.w3c.org/myNs#")); - print "\n

\n"; - - /** - * creating a start element - */ - print "creating a start element:
"; - print "
";
-    print htmlentities(XML_Util::createStartElement("myTag", array( "foo" => "bar", "argh" => "tomato" ), "http://www.w3c.org/myNs#", true));
-    print "
"; - print "\n

\n"; - - - /** - * creating an end element - */ - print "creating an end element:
"; - print htmlentities(XML_Util::createEndElement("myNs:myTag")); - print "\n

\n"; - - /** - * creating a CData section - */ - print "creating a CData section:
"; - print htmlentities(XML_Util::createCDataSection("I am content.")); - print "\n

\n"; - - /** - * creating a comment - */ - print "creating a comment:
"; - print htmlentities(XML_Util::createComment("I am a comment.")); - print "\n

\n"; - - /** - * creating an XML tag with multiline mode - */ - $tag = array( - "qname" => "foo:bar", - "namespaceUri" => "http://foo.com", - "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), - "content" => "I'm inside the tag & contain dangerous chars" - ); - - print "creating a tag with qualified name and namespaceUri:
\n"; - print "
";
-    print htmlentities(XML_Util::createTagFromArray($tag, XML_UTIL_REPLACE_ENTITIES, true));
-    print "
"; - print "\n

\n"; - - /** - * create an attribute string without replacing the entities - */ - $atts = array( 'series' => 'Starsky & Hutch', 'channel' => 'ABC' ); - print "creating a attribute string, entities in values already had been replaced:
"; - print htmlentities(XML_Util::attributesToString($atts, true, false, false, false, XML_UTIL_ENTITIES_NONE)); - print "\n

\n"; - - /** - * using the array-syntax for attributesToString() - */ - $atts = array( 'series' => 'Starsky & Hutch', 'channel' => 'ABC' ); - print "using the array-syntax for attributesToString()
"; - print htmlentities(XML_Util::attributesToString($atts, array('entities' => XML_UTIL_ENTITIES_NONE))); - print "\n

\n"; - - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/package.dtd b/campcaster/src/tools/pear/src/package.dtd deleted file mode 100644 index 5bc04dd7d..000000000 --- a/campcaster/src/tools/pear/src/package.dtd +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/campcaster/src/tools/pear/src/pearcmd.php b/campcaster/src/tools/pear/src/pearcmd.php deleted file mode 100644 index 56e22e5da..000000000 --- a/campcaster/src/tools/pear/src/pearcmd.php +++ /dev/null @@ -1,437 +0,0 @@ - | -// | Tomas V.V.Cox | -// | | -// +----------------------------------------------------------------------+ -// -// $Id: pearcmd.php,v 1.33 2006/01/02 18:05:53 cellog Exp $ - -ob_end_clean(); -if (!defined('PEAR_RUNTYPE')) { - // this is defined in peclcmd.php as 'pecl' - define('PEAR_RUNTYPE', 'pear'); -} -define('PEAR_IGNORE_BACKTRACE', 1); -if (!function_exists('file_get_contents')) { - function file_get_contents($filename) - { - $fp = fopen($filename, 'rb'); - $ret = ''; - while (!feof($fp)) { - $ret .= fread($fp, 8092);; - } - return $ret; - } -} -/** - * @nodep Gtk - */ -if ('/home/paul/software/campcaster/campcaster/usr/lib/pear' != '@'.'include_path'.'@') { - ini_set('include_path', '/home/paul/software/campcaster/campcaster/usr/lib/pear'); - $raw = false; -} else { - // this is a raw, uninstalled pear, either a cvs checkout, or php distro - $raw = true; -} -@ini_set('allow_url_fopen', true); -if (!ini_get('safe_mode')) { - @set_time_limit(0); -} -ob_implicit_flush(true); -@ini_set('track_errors', true); -@ini_set('html_errors', false); -@ini_set('magic_quotes_runtime', false); -$_PEAR_PHPDIR = '#$%^&*'; -set_error_handler('error_handler'); - -$pear_package_version = "1.4.11"; - -require_once 'PEAR.php'; -require_once 'PEAR/Frontend.php'; -require_once 'PEAR/Config.php'; -require_once 'PEAR/Command.php'; -require_once 'Console/Getopt.php'; - - -PEAR_Command::setFrontendType('CLI'); -$all_commands = PEAR_Command::getCommands(); - -// remove this next part when we stop supporting that crap-ass PHP 4.2 -if (!isset($_SERVER['argv']) && !isset($argv) && !isset($HTTP_SERVER_VARS['argv'])) { - die('ERROR: either use the CLI php executable, or set register_argc_argv=On in php.ini'); -} -$argv = Console_Getopt::readPHPArgv(); -// fix CGI sapi oddity - the -- in pear.bat/pear is not removed -if (php_sapi_name() != 'cli' && isset($argv[1]) && $argv[1] == '--') { - unset($argv[1]); - $argv = array_values($argv); -} -$progname = PEAR_RUNTYPE; -if (in_array('getopt2', get_class_methods('Console_Getopt'))) { - array_shift($argv); - $options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV"); -} else { - $options = Console_Getopt::getopt($argv, "c:C:d:D:Gh?sSqu:vV"); -} -if (PEAR::isError($options)) { - usage($options); -} - -$opts = $options[0]; - -$fetype = 'CLI'; -if ($progname == 'gpear' || $progname == 'pear-gtk') { - $fetype = 'Gtk'; -} else { - foreach ($opts as $opt) { - if ($opt[0] == 'G') { - $fetype = 'Gtk'; - } - } -} -//Check if Gtk and PHP >= 5.1.0 -if ($fetype == 'Gtk' && version_compare(phpversion(), '5.1.0', '>=')) { - $fetype = 'Gtk2'; -} - -$pear_user_config = ''; -$pear_system_config = ''; -$store_user_config = false; -$store_system_config = false; -$verbose = 1; - -foreach ($opts as $opt) { - switch ($opt[0]) { - case 'c': - $pear_user_config = $opt[1]; - break; - case 'C': - $pear_system_config = $opt[1]; - break; - } -} - -PEAR_Command::setFrontendType($fetype); -$ui = &PEAR_Command::getFrontendObject(); -$config = &PEAR_Config::singleton($pear_user_config, $pear_system_config); - -if (PEAR::isError($config)) { - $_file = ''; - if ($pear_user_config !== false) { - $_file .= $pear_user_config; - } - if ($pear_system_config !== false) { - $_file .= '/' . $pear_system_config; - } - if ($_file == '/') { - $_file = 'The default config file'; - } - $config->getMessage(); - $ui->outputData("ERROR: $_file is not a valid config file or is corrupted."); - // We stop, we have no idea where we are :) - exit(); -} - -// this is used in the error handler to retrieve a relative path -$_PEAR_PHPDIR = $config->get('php_dir'); -$ui->setConfig($config); -PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError")); -if (ini_get('safe_mode')) { - $ui->outputData('WARNING: running in safe mode requires that all files created ' . - 'be the same uid as the current script. PHP reports this script is uid: ' . - @getmyuid() . ', and current user is: ' . @get_current_user()); -} - -$verbose = $config->get("verbose"); -$cmdopts = array(); - -if ($raw) { - if (!$config->isDefinedLayer('user') && !$config->isDefinedLayer('system')) { - $found = false; - foreach ($opts as $opt) { - if ($opt[0] == 'd' || $opt[0] == 'D') { - $found = true; // the user knows what they are doing, and are setting config values - } - } - if (!$found) { - // no prior runs, try to install PEAR - if (strpos(dirname(__FILE__), 'scripts')) { - $packagexml = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'package2.xml'; - $pearbase = dirname(dirname(__FILE__)); - } else { - $packagexml = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'package2.xml'; - $pearbase = dirname(__FILE__); - } - if (file_exists($packagexml)) { - $options[1] = array( - 'install', - $packagexml - ); - $config->set('php_dir', $pearbase . DIRECTORY_SEPARATOR . 'php'); - $config->set('data_dir', $pearbase . DIRECTORY_SEPARATOR . 'data'); - $config->set('doc_dir', $pearbase . DIRECTORY_SEPARATOR . 'docs'); - $config->set('test_dir', $pearbase . DIRECTORY_SEPARATOR . 'tests'); - $config->set('ext_dir', $pearbase . DIRECTORY_SEPARATOR . 'extensions'); - $config->set('bin_dir', $pearbase); - $config->mergeConfigFile($pearbase . 'pear.ini', false); - $config->store(); - $config->set('auto_discover', 1); - } - } - } -} -foreach ($opts as $opt) { - $param = !empty($opt[1]) ? $opt[1] : true; - switch ($opt[0]) { - case 'd': - list($key, $value) = explode('=', $param); - $config->set($key, $value, 'user'); - break; - case 'D': - list($key, $value) = explode('=', $param); - $config->set($key, $value, 'system'); - break; - case 's': - $store_user_config = true; - break; - case 'S': - $store_system_config = true; - break; - case 'u': - $config->remove($param, 'user'); - break; - case 'v': - $config->set('verbose', $config->get('verbose') + 1); - break; - case 'q': - $config->set('verbose', $config->get('verbose') - 1); - break; - case 'V': - usage(null, 'version'); - case 'c': - case 'C': - break; - default: - // all non pear params goes to the command - $cmdopts[$opt[0]] = $param; - break; - } -} - -if ($store_system_config) { - $config->store('system'); -} - -if ($store_user_config) { - $config->store('user'); -} - -$command = (isset($options[1][0])) ? $options[1][0] : null; - -if (empty($command) && ($store_user_config || $store_system_config)) { - exit; -} - -if ($fetype == 'Gtk' || $fetype == 'Gtk2') { - if (!$config->validConfiguration()) { - PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' . - "'$pear_user_config' or '$pear_system_config', please copy an existing configuration" . - 'file to one of these locations, or use the -c and -s options to create one'); - } - Gtk::main(); -} else do { - if ($command == 'help') { - usage(null, @$options[1][1]); - } - if (!$config->validConfiguration()) { - PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' . - "'$pear_user_config' or '$pear_system_config', please copy an existing configuration" . - 'file to one of these locations, or use the -c and -s options to create one'); - } - - PEAR::pushErrorHandling(PEAR_ERROR_RETURN); - $cmd = PEAR_Command::factory($command, $config); - PEAR::popErrorHandling(); - if (PEAR::isError($cmd)) { - usage(null, @$options[1][0]); - } - - $short_args = $long_args = null; - PEAR_Command::getGetoptArgs($command, $short_args, $long_args); - if (in_array('getopt2', get_class_methods('Console_Getopt'))) { - array_shift($options[1]); - $tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args); - } else { - $tmp = Console_Getopt::getopt($options[1], $short_args, $long_args); - } - if (PEAR::isError($tmp)) { - break; - } - list($tmpopt, $params) = $tmp; - $opts = array(); - foreach ($tmpopt as $foo => $tmp2) { - list($opt, $value) = $tmp2; - if ($value === null) { - $value = true; // options without args - } - if (strlen($opt) == 1) { - $cmdoptions = $cmd->getOptions($command); - foreach ($cmdoptions as $o => $d) { - if (@$d['shortopt'] == $opt) { - $opts[$o] = $value; - } - } - } else { - if (substr($opt, 0, 2) == '--') { - $opts[substr($opt, 2)] = $value; - } - } - } - $ok = $cmd->run($command, $opts, $params); - if ($ok === false) { - PEAR::raiseError("unknown command `$command'"); - } - if (PEAR::isError($ok)) { - PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError")); - PEAR::raiseError($ok); - } -} while (false); - -// {{{ usage() - -function usage($error = null, $helpsubject = null) -{ - global $progname, $all_commands; - $stderr = fopen('php://stderr', 'w'); - if (PEAR::isError($error)) { - fputs($stderr, $error->getMessage() . "\n"); - } elseif ($error !== null) { - fputs($stderr, "$error\n"); - } - if ($helpsubject != null) { - $put = cmdHelp($helpsubject); - } else { - $put = - "Commands:\n"; - $maxlen = max(array_map("strlen", $all_commands)); - $formatstr = "%-{$maxlen}s %s\n"; - ksort($all_commands); - foreach ($all_commands as $cmd => $class) { - $put .= sprintf($formatstr, $cmd, PEAR_Command::getDescription($cmd)); - } - $put .= - "Usage: $progname [options] command [command-options] \n". - "Type \"$progname help options\" to list all options.\n". - "Type \"$progname help shortcuts\" to list all command shortcuts.\n". - "Type \"$progname help \" to get the help for the specified command."; - } - fputs($stderr, "$put\n"); - fclose($stderr); - exit; -} - -function cmdHelp($command) -{ - global $progname, $all_commands, $config; - if ($command == "options") { - return - "Options:\n". - " -v increase verbosity level (default 1)\n". - " -q be quiet, decrease verbosity level\n". - " -c file find user configuration in `file'\n". - " -C file find system configuration in `file'\n". - " -d foo=bar set user config variable `foo' to `bar'\n". - " -D foo=bar set system config variable `foo' to `bar'\n". - " -G start in graphical (Gtk) mode\n". - " -s store user configuration\n". - " -S store system configuration\n". - " -u foo unset `foo' in the user configuration\n". - " -h, -? display help/usage (this message)\n". - " -V version information\n"; - } elseif ($command == "shortcuts") { - $sc = PEAR_Command::getShortcuts(); - $ret = "Shortcuts:\n"; - foreach ($sc as $s => $c) { - $ret .= sprintf(" %-8s %s\n", $s, $c); - } - return $ret; - - } elseif ($command == "version") { - return "PEAR Version: ".$GLOBALS['pear_package_version']. - "\nPHP Version: ".phpversion(). - "\nZend Engine Version: ".zend_version(). - "\nRunning on: ".php_uname(); - - } elseif ($help = PEAR_Command::getHelp($command)) { - if (is_string($help)) { - return "$progname $command [options] $help\n"; - } - if ($help[1] === null) { - return "$progname $command $help[0]"; - } else { - return "$progname $command [options] $help[0]\n$help[1]"; - } - } - return "Command '$command' is not valid, try 'pear help'"; -} - -// }}} - -function error_handler($errno, $errmsg, $file, $line, $vars) { - if ((defined('E_STRICT') && $errno & E_STRICT) || !error_reporting()) { - if (defined('E_STRICT') && $errno & E_STRICT) { - return; // E_STRICT - } - if ($GLOBALS['config']->get('verbose') < 4) { - return; // @silenced error, show all if debug is high enough - } - } - $errortype = array ( - E_ERROR => "Error", - E_WARNING => "Warning", - E_PARSE => "Parsing Error", - E_NOTICE => "Notice", - E_CORE_ERROR => "Core Error", - E_CORE_WARNING => "Core Warning", - E_COMPILE_ERROR => "Compile Error", - E_COMPILE_WARNING => "Compile Warning", - E_USER_ERROR => "User Error", - E_USER_WARNING => "User Warning", - E_USER_NOTICE => "User Notice" - ); - $prefix = $errortype[$errno]; - global $_PEAR_PHPDIR; - if (stristr($file, $_PEAR_PHPDIR)) { - $file = substr($file, strlen($_PEAR_PHPDIR) + 1); - } else { - $file = basename($file); - } - print "\n$prefix: $errmsg in $file on line $line\n"; -} - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * mode: php - * End: - */ -// vim600:syn=php - -?> diff --git a/campcaster/src/tools/pear/src/peclcmd.php b/campcaster/src/tools/pear/src/peclcmd.php deleted file mode 100644 index 61f2cede6..000000000 --- a/campcaster/src/tools/pear/src/peclcmd.php +++ /dev/null @@ -1,45 +0,0 @@ - | -// | Tomas V.V.Cox | -// | | -// +----------------------------------------------------------------------+ -// -// $Id: peclcmd.php,v 1.1 2005/02/21 05:30:56 cellog Exp $ - -/** - * @nodep Gtk - */ -if ('/home/paul/software/campcaster/campcaster/usr/lib/pear' != '@'.'include_path'.'@') { - ini_set('include_path', '/home/paul/software/campcaster/campcaster/usr/lib/pear'); - $raw = false; -} else { - // this is a raw, uninstalled pear, either a cvs checkout, or php distro - $raw = true; -} -define('PEAR_RUNTYPE', 'pecl'); -require_once 'pearcmd.php'; -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * mode: php - * End: - */ -// vim600:syn=php - -?> diff --git a/campcaster/src/tools/pear/src/scripts/pearcmd.php b/campcaster/src/tools/pear/src/scripts/pearcmd.php index 530a0f7cd..56e22e5da 100644 --- a/campcaster/src/tools/pear/src/scripts/pearcmd.php +++ b/campcaster/src/tools/pear/src/scripts/pearcmd.php @@ -40,8 +40,8 @@ if (!function_exists('file_get_contents')) { /** * @nodep Gtk */ -if ('@include_path@' != '@'.'include_path'.'@') { - ini_set('include_path', '@include_path@'); +if ('/home/paul/software/campcaster/campcaster/usr/lib/pear' != '@'.'include_path'.'@') { + ini_set('include_path', '/home/paul/software/campcaster/campcaster/usr/lib/pear'); $raw = false; } else { // this is a raw, uninstalled pear, either a cvs checkout, or php distro @@ -58,7 +58,7 @@ ob_implicit_flush(true); $_PEAR_PHPDIR = '#$%^&*'; set_error_handler('error_handler'); -$pear_package_version = "@pear_version@"; +$pear_package_version = "1.4.11"; require_once 'PEAR.php'; require_once 'PEAR/Frontend.php'; diff --git a/campcaster/src/tools/pear/src/scripts/peclcmd.php b/campcaster/src/tools/pear/src/scripts/peclcmd.php index bdccc7540..61f2cede6 100644 --- a/campcaster/src/tools/pear/src/scripts/peclcmd.php +++ b/campcaster/src/tools/pear/src/scripts/peclcmd.php @@ -23,8 +23,8 @@ /** * @nodep Gtk */ -if ('@include_path@' != '@'.'include_path'.'@') { - ini_set('include_path', '@include_path@'); +if ('/home/paul/software/campcaster/campcaster/usr/lib/pear' != '@'.'include_path'.'@') { + ini_set('include_path', '/home/paul/software/campcaster/campcaster/usr/lib/pear'); $raw = false; } else { // this is a raw, uninstalled pear, either a cvs checkout, or php distro diff --git a/campcaster/src/tools/pear/src/template.spec b/campcaster/src/tools/pear/src/template.spec deleted file mode 100644 index 37b477f8f..000000000 --- a/campcaster/src/tools/pear/src/template.spec +++ /dev/null @@ -1,72 +0,0 @@ -Summary: PEAR: @summary@ -Name: @rpm_package@ -Version: @version@ -Release: 1 -License: @release_license@ -Group: Development/Libraries -Source: http://@master_server@/get/@package@-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-root -URL: http://@master_server@/package/@package@ -Prefix: %{_prefix} -BuildArchitectures: @arch@ -@extra_headers@ - -%description -@description@ - -%prep -rm -rf %{buildroot}/* -%setup -c -T -# XXX Source files location is missing here in pear cmd -pear -v -c %{buildroot}/pearrc \ - -d php_dir=%{_libdir}/php/pear \ - -d doc_dir=/docs \ - -d bin_dir=%{_bindir} \ - -d data_dir=%{_libdir}/php/pear/data \ - -d test_dir=%{_libdir}/php/pear/tests \ - -d ext_dir=%{_libdir} \@extra_config@ - -s - -%build -echo BuildRoot=%{buildroot} - -%postun -# if refcount = 0 then package has been removed (not upgraded) -if [ "$1" -eq "0" ]; then - pear uninstall --nodeps -r @possible_channel@@package@ - rm @rpm_xml_dir@/@package@.xml -fi - - -%post -# if refcount = 2 then package has been upgraded -if [ "$1" -ge "2" ]; then - pear upgrade --nodeps -r @rpm_xml_dir@/@package@.xml -else - pear install --nodeps -r @rpm_xml_dir@/@package@.xml -fi - -%install -pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \ - $RPM_SOURCE_DIR/@package@-%{version}.tgz -rm %{buildroot}/pearrc -rm %{buildroot}/%{_libdir}/php/pear/.filemap -rm %{buildroot}/%{_libdir}/php/pear/.lock -rm -rf %{buildroot}/%{_libdir}/php/pear/.registry -if [ "@doc_files@" != "" ]; then - mv %{buildroot}/docs/@package@/* . - rm -rf %{buildroot}/docs -fi -mkdir -p %{buildroot}@rpm_xml_dir@ -tar -xzf $RPM_SOURCE_DIR/@package@-%{version}.tgz package@package2xml@.xml -cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml - -#rm -rf %{buildroot}/* -#pear -q install -R %{buildroot} -n package@package2xml@.xml -#mkdir -p %{buildroot}@rpm_xml_dir@ -#cp -p package@package2xml@.xml %{buildroot}@rpm_xml_dir@/@package@.xml - -%files - %defattr(-,root,root) - %doc @doc_files@ - / diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/README b/campcaster/src/tools/pear/src/tests/Calendar/tests/README deleted file mode 100644 index ecc755b12..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/README +++ /dev/null @@ -1,7 +0,0 @@ -These tests require Simple Test: http://www.lastcraft.com/simple_test.php - -Ideally they would use PEAR::PHPUnit but the current version has bugs and -lacks alot of the functionality (e.g. Mock Objects) which Simple Test -provides. - -Modifying the simple_include.php script for your simple test install dir \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/all_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/all_tests.php deleted file mode 100644 index 034dec085..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/all_tests.php +++ /dev/null @@ -1,34 +0,0 @@ -GroupTest('All PEAR::Calendar Tests'); - $this->AddTestCase(new CalendarTests()); - $this->AddTestCase(new CalendarTabularTests()); - $this->AddTestCase(new ValidatorTests()); - $this->AddTestCase(new CalendarEngineTests()); - $this->AddTestCase(new TableHelperTests()); - $this->AddTestCase(new DecoratorTests()); - $this->AddTestCase(new UtilTests()); - } -} - -$test = &new AllTests(); -$test->run(new HtmlReporter()); -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_engine_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_engine_tests.php deleted file mode 100644 index da01f8a2f..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_engine_tests.php +++ /dev/null @@ -1,20 +0,0 @@ -GroupTest('Calendar Engine Tests'); - $this->addTestFile('peardate_engine_test.php'); - $this->addTestFile('unixts_engine_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new CalendarEngineTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_include.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_include.php deleted file mode 100644 index 96fa9575e..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_include.php +++ /dev/null @@ -1,28 +0,0 @@ - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tabular_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tabular_tests.php deleted file mode 100644 index 1dd7be4d0..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tabular_tests.php +++ /dev/null @@ -1,21 +0,0 @@ -GroupTest('Calendar Tabular Tests'); - $this->addTestFile('month_weekdays_test.php'); - $this->addTestFile('month_weeks_test.php'); - $this->addTestFile('week_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new CalendarTabularTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_test.php deleted file mode 100644 index 5ab63be94..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_test.php +++ /dev/null @@ -1,115 +0,0 @@ -UnitTestCase($name); - } - function setUp() { - $this->cal = new Calendar(2003,10,25,13,32,43); - } - function tearDown() { - unset($this->cal); - } - function testPrevYear () { - $this->assertEqual(2002,$this->cal->prevYear()); - } - function testPrevYear_Array () { - $this->assertEqual( - array( - 'year' => 2002, - 'month' => 1, - 'day' => 1, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevYear('array')); - } - function testThisYear () { - $this->assertEqual(2003,$this->cal->thisYear()); - } - function testNextYear () { - $this->assertEqual(2004,$this->cal->nextYear()); - } - function testPrevMonth () { - $this->assertEqual(9,$this->cal->prevMonth()); - } - function testPrevMonth_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 9, - 'day' => 1, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevMonth('array')); - } - function testThisMonth () { - $this->assertEqual(10,$this->cal->thisMonth()); - } - function testNextMonth () { - $this->assertEqual(11,$this->cal->nextMonth()); - } - function testPrevDay () { - $this->assertEqual(24,$this->cal->prevDay()); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 10, - 'day' => 24, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testThisDay () { - $this->assertEqual(25,$this->cal->thisDay()); - } - function testNextDay () { - $this->assertEqual(26,$this->cal->nextDay()); - } - function testPrevHour () { - $this->assertEqual(12,$this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(13,$this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(14,$this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(31,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(32,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(33,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(42,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(43,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(44,$this->cal->nextSecond()); - } - function testSetTimeStamp() { - $stamp = mktime(13,32,43,10,25,2003); - $this->cal->setTimeStamp($stamp); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } - function testGetTimeStamp() { - $stamp = mktime(13,32,43,10,25,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tests.php deleted file mode 100644 index b6bee2080..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/calendar_tests.php +++ /dev/null @@ -1,25 +0,0 @@ -GroupTest('Calendar Tests'); - $this->addTestFile('calendar_test.php'); - $this->addTestFile('year_test.php'); - $this->addTestFile('month_test.php'); - $this->addTestFile('day_test.php'); - $this->addTestFile('hour_test.php'); - $this->addTestFile('minute_test.php'); - $this->addTestFile('second_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new CalendarTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/day_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/day_test.php deleted file mode 100644 index 69685c4f8..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/day_test.php +++ /dev/null @@ -1,107 +0,0 @@ -UnitTestCase('Test of Day'); - } - function setUp() { - $this->cal = new Calendar_Day(2003,10,25); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 10, - 'day' => 24, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testPrevHour () { - $this->assertEqual(23,$this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(0,$this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(1,$this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(59,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(0,0,0,10,25,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfDayBuild extends TestOfDay { - function TestOfDayBuild() { - $this->UnitTestCase('Test of Day::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(24,$this->cal->size()); - } - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(24,$i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 0; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - function testSelection() { - require_once(CALENDAR_ROOT . 'Hour.php'); - $selection = array(new Calendar_Hour(2003,10,25,13)); - $this->cal->build($selection); - $i = 0; - while ( $Child = $this->cal->fetch() ) { - if ( $i == 13 ) - break; - $i++; - } - $this->assertTrue($Child->isSelected()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfDay(); - $test->run(new HtmlReporter()); - $test = &new TestOfDayBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_test.php deleted file mode 100644 index 05186431c..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_test.php +++ /dev/null @@ -1,268 +0,0 @@ -UnitTestCase('Test of Calendar_Decorator'); - } - function setUp() { - $this->mockengine = new Mock_Calendar_Engine($this); - $this->mockcal = new Mock_Calendar_Second($this); - $this->mockcal->setReturnValue('prevYear',2002); - $this->mockcal->setReturnValue('thisYear',2003); - $this->mockcal->setReturnValue('nextYear',2004); - $this->mockcal->setReturnValue('prevMonth',9); - $this->mockcal->setReturnValue('thisMonth',10); - $this->mockcal->setReturnValue('nextMonth',11); - $this->mockcal->setReturnValue('prevDay',14); - $this->mockcal->setReturnValue('thisDay',15); - $this->mockcal->setReturnValue('nextDay',16); - $this->mockcal->setReturnValue('prevHour',12); - $this->mockcal->setReturnValue('thisHour',13); - $this->mockcal->setReturnValue('nextHour',14); - $this->mockcal->setReturnValue('prevMinute',29); - $this->mockcal->setReturnValue('thisMinute',30); - $this->mockcal->setReturnValue('nextMinute',31); - $this->mockcal->setReturnValue('prevSecond',44); - $this->mockcal->setReturnValue('thisSecond',45); - $this->mockcal->setReturnValue('nextSecond',46); - $this->mockcal->setReturnValue('getEngine',$this->mockengine); - $this->mockcal->setReturnValue('getTimestamp',12345); - - } - function tearDown() { - unset ( $this->engine ); - unset ( $this->mockcal ); - } - function testPrevYear() { - $this->mockcal->expectOnce('prevYear',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(2002,$Decorator->prevYear()); - } - function testThisYear() { - $this->mockcal->expectOnce('thisYear',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(2003,$Decorator->thisYear()); - } - function testNextYear() { - $this->mockcal->expectOnce('nextYear',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(2004,$Decorator->nextYear()); - } - function testPrevMonth() { - $this->mockcal->expectOnce('prevMonth',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(9,$Decorator->prevMonth()); - } - function testThisMonth() { - $this->mockcal->expectOnce('thisMonth',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(10,$Decorator->thisMonth()); - } - function testNextMonth() { - $this->mockcal->expectOnce('nextMonth',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(11,$Decorator->nextMonth()); - } - function testPrevWeek() { - $mockweek = & new Mock_Calendar_Week($this); - $mockweek->setReturnValue('prevWeek',1); - $mockweek->expectOnce('prevWeek',array('n_in_month')); - $Decorator =& new Calendar_Decorator($mockweek); - $this->assertEqual(1,$Decorator->prevWeek()); - } - function testThisWeek() { - $mockweek = & new Mock_Calendar_Week($this); - $mockweek->setReturnValue('thisWeek',2); - $mockweek->expectOnce('thisWeek',array('n_in_month')); - $Decorator =& new Calendar_Decorator($mockweek); - $this->assertEqual(2,$Decorator->thisWeek()); - } - function testNextWeek() { - $mockweek = & new Mock_Calendar_Week($this); - $mockweek->setReturnValue('nextWeek',3); - $mockweek->expectOnce('nextWeek',array('n_in_month')); - $Decorator =& new Calendar_Decorator($mockweek); - $this->assertEqual(3,$Decorator->nextWeek()); - } - function testPrevDay() { - $this->mockcal->expectOnce('prevDay',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(14,$Decorator->prevDay()); - } - function testThisDay() { - $this->mockcal->expectOnce('thisDay',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(15,$Decorator->thisDay()); - } - function testNextDay() { - $this->mockcal->expectOnce('nextDay',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(16,$Decorator->nextDay()); - } - function testPrevHour() { - $this->mockcal->expectOnce('prevHour',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(12,$Decorator->prevHour()); - } - function testThisHour() { - $this->mockcal->expectOnce('thisHour',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(13,$Decorator->thisHour()); - } - function testNextHour() { - $this->mockcal->expectOnce('nextHour',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(14,$Decorator->nextHour()); - } - function testPrevMinute() { - $this->mockcal->expectOnce('prevMinute',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(29,$Decorator->prevMinute()); - } - function testThisMinute() { - $this->mockcal->expectOnce('thisMinute',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(30,$Decorator->thisMinute()); - } - function testNextMinute() { - $this->mockcal->expectOnce('nextMinute',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(31,$Decorator->nextMinute()); - } - function testPrevSecond() { - $this->mockcal->expectOnce('prevSecond',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(44,$Decorator->prevSecond()); - } - function testThisSecond() { - $this->mockcal->expectOnce('thisSecond',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(45,$Decorator->thisSecond()); - } - function testNextSecond() { - $this->mockcal->expectOnce('nextSecond',array('int')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(46,$Decorator->nextSecond()); - } - function testGetEngine() { - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertIsA($Decorator->getEngine(),'Mock_Calendar_Engine'); - } - function testSetTimestamp() { - $this->mockcal->expectOnce('setTimestamp',array('12345')); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->setTimestamp('12345'); - } - function testGetTimestamp() { - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual(12345,$Decorator->getTimestamp()); - } - function testSetSelected() { - $this->mockcal->expectOnce('setSelected',array(true)); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->setSelected(); - } - function testIsSelected() { - $this->mockcal->setReturnValue('isSelected',true); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertTrue($Decorator->isSelected()); - } - function testAdjust() { - $this->mockcal->expectOnce('adjust',array()); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->adjust(); - } - function testToArray() { - $this->mockcal->expectOnce('toArray',array(12345)); - $testArray = array('foo'=>'bar'); - $this->mockcal->setReturnValue('toArray',$testArray); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual($testArray,$Decorator->toArray(12345)); - } - function testReturnValue() { - $this->mockcal->expectOnce('returnValue',array('a','b','c','d')); - $this->mockcal->setReturnValue('returnValue','foo'); - $Decorator =& new Calendar_Decorator($this->mockcal); - $this->assertEqual('foo',$Decorator->returnValue('a','b','c','d')); - } - function testSetFirst() { - $mockday = & new Mock_Calendar_Day($this); - $mockday->expectOnce('setFirst',array(true)); - $Decorator =& new Calendar_Decorator($mockday); - $Decorator->setFirst(); - } - function testSetLast() { - $mockday = & new Mock_Calendar_Day($this); - $mockday->expectOnce('setLast',array(true)); - $Decorator =& new Calendar_Decorator($mockday); - $Decorator->setLast(); - } - function testIsFirst() { - $mockday = & new Mock_Calendar_Day($this); - $mockday->setReturnValue('isFirst',TRUE); - $Decorator =& new Calendar_Decorator($mockday); - $this->assertTrue($Decorator->isFirst()); - } - function testIsLast() { - $mockday = & new Mock_Calendar_Day($this); - $mockday->setReturnValue('isLast',TRUE); - $Decorator =& new Calendar_Decorator($mockday); - $this->assertTrue($Decorator->isLast()); - } - function testSetEmpty() { - $mockday = & new Mock_Calendar_Day($this); - $mockday->expectOnce('setEmpty',array(true)); - $Decorator =& new Calendar_Decorator($mockday); - $Decorator->setEmpty(); - } - function testIsEmpty() { - $mockday = & new Mock_Calendar_Day($this); - $mockday->setReturnValue('isEmpty',TRUE); - $Decorator =& new Calendar_Decorator($mockday); - $this->assertTrue($Decorator->isEmpty()); - } - function testBuild() { - $testArray=array('foo'=>'bar'); - $this->mockcal->expectOnce('build',array($testArray)); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->build($testArray); - } - function testFetch() { - $this->mockcal->expectOnce('fetch',array()); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->fetch(); - } - function testFetchAll() { - $this->mockcal->expectOnce('fetchAll',array()); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->fetchAll(); - } - function testSize() { - $this->mockcal->expectOnce('size',array()); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->size(); - } - function testIsValid() { - $this->mockcal->expectOnce('isValid',array()); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->isValid(); - } - function testGetValidator() { - $this->mockcal->expectOnce('getValidator',array()); - $Decorator =& new Calendar_Decorator($this->mockcal); - $Decorator->getValidator(); - } -} -?> diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_tests.php deleted file mode 100644 index 316d5bd57..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_tests.php +++ /dev/null @@ -1,21 +0,0 @@ -GroupTest('Decorator Tests'); - $this->addTestFile('decorator_test.php'); - $this->addTestFile('decorator_textual_test.php'); - $this->addTestFile('decorator_uri_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new DecoratorTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_textual_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_textual_test.php deleted file mode 100644 index 225ceedb5..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_textual_test.php +++ /dev/null @@ -1,174 +0,0 @@ -UnitTestCase('Test of Calendar_Decorator_Textual'); - } - function testMonthNamesLong() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $monthNames = array( - 1=>'January', - 2=>'February', - 3=>'March', - 4=>'April', - 5=>'May', - 6=>'June', - 7=>'July', - 8=>'August', - 9=>'September', - 10=>'October', - 11=>'November', - 12=>'December', - ); - $this->assertEqual($monthNames,$Textual->monthNames()); - } - function testMonthNamesShort() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $monthNames = array( - 1=>'Jan', - 2=>'Feb', - 3=>'Mar', - 4=>'Apr', - 5=>'May', - 6=>'Jun', - 7=>'Jul', - 8=>'Aug', - 9=>'Sep', - 10=>'Oct', - 11=>'Nov', - 12=>'Dec', - ); - $this->assertEqual($monthNames,$Textual->monthNames('short')); - } - function testMonthNamesTwo() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $monthNames = array( - 1=>'Ja', - 2=>'Fe', - 3=>'Ma', - 4=>'Ap', - 5=>'Ma', - 6=>'Ju', - 7=>'Ju', - 8=>'Au', - 9=>'Se', - 10=>'Oc', - 11=>'No', - 12=>'De', - ); - $this->assertEqual($monthNames,$Textual->monthNames('two')); - } - function testMonthNamesOne() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $monthNames = array( - 1=>'J', - 2=>'F', - 3=>'M', - 4=>'A', - 5=>'M', - 6=>'J', - 7=>'J', - 8=>'A', - 9=>'S', - 10=>'O', - 11=>'N', - 12=>'D', - ); - $this->assertEqual($monthNames,$Textual->monthNames('one')); - } - function testWeekdayNamesLong() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $weekdayNames = array( - 0=>'Sunday', - 1=>'Monday', - 2=>'Tuesday', - 3=>'Wednesday', - 4=>'Thursday', - 5=>'Friday', - 6=>'Saturday', - ); - $this->assertEqual($weekdayNames,$Textual->weekdayNames()); - } - function testWeekdayNamesShort() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $weekdayNames = array( - 0=>'Sun', - 1=>'Mon', - 2=>'Tue', - 3=>'Wed', - 4=>'Thu', - 5=>'Fri', - 6=>'Sat', - ); - $this->assertEqual($weekdayNames,$Textual->weekdayNames('short')); - } - function testWeekdayNamesTwo() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $weekdayNames = array( - 0=>'Su', - 1=>'Mo', - 2=>'Tu', - 3=>'We', - 4=>'Th', - 5=>'Fr', - 6=>'Sa', - ); - $this->assertEqual($weekdayNames,$Textual->weekdayNames('two')); - } - function testWeekdayNamesOne() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $weekdayNames = array( - 0=>'S', - 1=>'M', - 2=>'T', - 3=>'W', - 4=>'T', - 5=>'F', - 6=>'S', - ); - $this->assertEqual($weekdayNames,$Textual->weekdayNames('one')); - } - function testPrevMonthNameShort() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $this->assertEqual('Sep',$Textual->prevMonthName('short')); - } - function testThisMonthNameShort() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $this->assertEqual('Oct',$Textual->thisMonthName('short')); - } - function testNextMonthNameShort() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $this->assertEqual('Nov',$Textual->nextMonthName('short')); - } - function testThisDayNameShort() { - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $this->assertEqual('Wed',$Textual->thisDayName('short')); - } - function testOrderedWeekdaysShort() { - $weekdayNames = array( - 0=>'Sun', - 1=>'Mon', - 2=>'Tue', - 3=>'Wed', - 4=>'Thu', - 5=>'Fri', - 6=>'Sat', - ); - $Textual = new Calendar_Decorator_Textual($this->mockcal); - $this->assertEqual($weekdayNames,$Textual->orderedWeekdays('short')); - } - -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfDecoratorTextual(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_uri_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_uri_test.php deleted file mode 100644 index 48c212de2..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/decorator_uri_test.php +++ /dev/null @@ -1,37 +0,0 @@ -UnitTestCase('Test of Calendar_Decorator_Uri'); - } - function testFragments() { - $Uri = new Calendar_Decorator_Uri($this->mockcal); - $Uri->setFragments('year','month','day','hour','minute','second'); - $this->assertEqual('year=&month=&day=&hour=&minute=&second=',$Uri->this('second')); - } - function testScalarFragments() { - $Uri = new Calendar_Decorator_Uri($this->mockcal); - $Uri->setFragments('year','month','day','hour','minute','second'); - $Uri->setScalar(); - $this->assertEqual('&&&&&',$Uri->this('second')); - } - function testSetSeperator() { - $Uri = new Calendar_Decorator_Uri($this->mockcal); - $Uri->setFragments('year','month','day','hour','minute','second'); - $Uri->setSeparator('/'); - $this->assertEqual('year=/month=/day=/hour=/minute=/second=',$Uri->this('second')); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfDecoratorUri(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/helper_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/helper_test.php deleted file mode 100644 index cd03bf61b..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/helper_test.php +++ /dev/null @@ -1,83 +0,0 @@ -UnitTestCase('Test of Calendar_Table_Helper'); - } - function setUp() { - $this->mockengine = new Mock_Calendar_Engine($this); - $this->mockengine->setReturnValue('getMinYears',1970); - $this->mockengine->setReturnValue('getMaxYears',2037); - $this->mockengine->setReturnValue('getMonthsInYear',12); - $this->mockengine->setReturnValue('getDaysInMonth',31); - $this->mockengine->setReturnValue('getHoursInDay',24); - $this->mockengine->setReturnValue('getMinutesInHour',60); - $this->mockengine->setReturnValue('getSecondsInMinute',60); - $this->mockengine->setReturnValue('getWeekDays',array(0,1,2,3,4,5,6)); - $this->mockengine->setReturnValue('getDaysInWeek',7); - $this->mockengine->setReturnValue('getFirstDayOfWeek',1); - $this->mockengine->setReturnValue('getFirstDayInMonth',3); - $this->mockcal = new Mock_Calendar_Second($this); - $this->mockcal->setReturnValue('thisYear',2003); - $this->mockcal->setReturnValue('thisMonth',10); - $this->mockcal->setReturnValue('thisDay',15); - $this->mockcal->setReturnValue('thisHour',13); - $this->mockcal->setReturnValue('thisMinute',30); - $this->mockcal->setReturnValue('thisSecond',45); - $this->mockcal->setReturnValue('getEngine',$this->mockengine); - } - function testGetFirstDay() { - for ( $i = 0; $i <= 7; $i++ ) { - $Helper = & new Calendar_Table_Helper($this->mockcal,$i); - $this->assertEqual($Helper->getFirstDay(),$i); - } - } - function testGetDaysOfWeekMonday() { - $Helper = & new Calendar_Table_Helper($this->mockcal); - $this->assertEqual($Helper->getDaysOfWeek(),array(1,2,3,4,5,6,0)); - } - function testGetDaysOfWeekSunday() { - $Helper = & new Calendar_Table_Helper($this->mockcal,0); - $this->assertEqual($Helper->getDaysOfWeek(),array(0,1,2,3,4,5,6)); - } - function testGetDaysOfWeekThursday() { - $Helper = & new Calendar_Table_Helper($this->mockcal,4); - $this->assertEqual($Helper->getDaysOfWeek(),array(4,5,6,0,1,2,3)); - } - function testGetNumWeeks() { - $Helper = & new Calendar_Table_Helper($this->mockcal); - $this->assertEqual($Helper->getNumWeeks(),5); - } - function testGetNumTableDaysInMonth() { - $Helper = & new Calendar_Table_Helper($this->mockcal); - $this->assertEqual($Helper->getNumTableDaysInMonth(),35); - } - function testGetEmptyDaysBefore() { - $Helper = & new Calendar_Table_Helper($this->mockcal); - $this->assertEqual($Helper->getEmptyDaysBefore(),2); - } - function testGetEmptyDaysAfter() { - $Helper = & new Calendar_Table_Helper($this->mockcal); - $this->assertEqual($Helper->getEmptyDaysAfter(),33); - } - function testGetEmptyDaysAfterOffset() { - $Helper = & new Calendar_Table_Helper($this->mockcal); - $this->assertEqual($Helper->getEmptyDaysAfterOffset(),5); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfTableHelper(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/hour_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/hour_test.php deleted file mode 100644 index 9e220f44e..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/hour_test.php +++ /dev/null @@ -1,98 +0,0 @@ -UnitTestCase('Test of Hour'); - } - function setUp() { - $this->cal = new Calendar_Hour(2003,10,25,13); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 10, - 'day' => 24, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testPrevMinute () { - $this->assertEqual(59,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(13,0,0,10,25,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfHourBuild extends TestOfHour { - function TestOfHourBuild() { - $this->UnitTestCase('Test of Hour::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(60,$this->cal->size()); - } - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(60,$i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 0; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - function testSelection() { - require_once(CALENDAR_ROOT . 'Minute.php'); - $selection = array(new Calendar_Minute(2003,10,25,13,32)); - $this->cal->build($selection); - $i = 0; - while ( $Child = $this->cal->fetch() ) { - if ( $i == 32 ) - break; - $i++; - } - $this->assertTrue($Child->isSelected()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfHour(); - $test->run(new HtmlReporter()); - $test = &new TestOfHourBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/minute_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/minute_test.php deleted file mode 100644 index 49327ca7a..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/minute_test.php +++ /dev/null @@ -1,99 +0,0 @@ -UnitTestCase('Test of Minute'); - } - function setUp() { - $this->cal = new Calendar_Minute(2003,10,25,13,32); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 10, - 'day' => 24, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testThisSecond_Timestamp () { - $this->assertEqual($this->cal->cE->dateToStamp( - 2003, 10, 25, 13, 32, 0), - $this->cal->thisSecond('timestamp')); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testNextSecond_Timestamp () { - $this->assertEqual($this->cal->cE->dateToStamp( - 2003, 10, 25, 13, 32, 1), - $this->cal->nextSecond('timestamp')); - } - function testGetTimeStamp() { - $stamp = mktime(13,32,0,10,25,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfMinuteBuild extends TestOfMinute { - function TestOfMinuteBuild() { - $this->UnitTestCase('Test of Minute::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(60,$this->cal->size()); - } - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(60,$i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 0; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - function testSelection() { - require_once(CALENDAR_ROOT . 'Second.php'); - $selection = array(new Calendar_Second(2003,10,25,13,32,43)); - $this->cal->build($selection); - $i = 0; - while ( $Child = $this->cal->fetch() ) { - if ( $i == 43 ) - break; - $i++; - } - $this->assertTrue($Child->isSelected()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfMinute(); - $test->run(new HtmlReporter()); - $test = &new TestOfMinuteBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/month_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/month_test.php deleted file mode 100644 index d0ef8faba..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/month_test.php +++ /dev/null @@ -1,119 +0,0 @@ -UnitTestCase('Test of Month'); - } - function setUp() { - $this->cal = new Calendar_Month(2003,10); - } - function testPrevMonth_Object() { - $this->assertEqual(new Calendar_Month(2003, 9), $this->cal->prevMonth('object')); - } - function testPrevDay () { - $this->assertEqual(30,$this->cal->prevDay()); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 9, - 'day' => 30, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testThisDay () { - $this->assertEqual(1,$this->cal->thisDay()); - } - function testNextDay () { - $this->assertEqual(2,$this->cal->nextDay()); - } - function testPrevHour () { - $this->assertEqual(23,$this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(0,$this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(1,$this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(59,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(0,0,0,10,1,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfMonthBuild extends TestOfMonth { - function TestOfMonthBuild() { - $this->UnitTestCase('Test of Month::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(31,$this->cal->size()); - } - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(31,$i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - function testSelection() { - require_once(CALENDAR_ROOT . 'Day.php'); - $selection = array(new Calendar_Day(2003,10,25)); - $this->cal->build($selection); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - if ( $i == 25 ) - break; - $i++; - } - $this->assertTrue($Child->isSelected()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfMonth(); - $test->run(new HtmlReporter()); - $test = &new TestOfMonthBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/month_weekdays_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/month_weekdays_test.php deleted file mode 100644 index ba0be7313..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/month_weekdays_test.php +++ /dev/null @@ -1,130 +0,0 @@ -UnitTestCase('Test of Month Weekdays'); - } - function setUp() { - $this->cal = new Calendar_Month_Weekdays(2003,10); - } - function testPrevDay () { - $this->assertEqual(30,$this->cal->prevDay()); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 9, - 'day' => 30, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testThisDay () { - $this->assertEqual(1,$this->cal->thisDay()); - } - function testNextDay () { - $this->assertEqual(2,$this->cal->nextDay()); - } - function testPrevHour () { - $this->assertEqual(23,$this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(0,$this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(1,$this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(59,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(0,0,0,10,1,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfMonthWeekdaysBuild extends TestOfMonthWeekdays { - function TestOfMonthWeekdaysBuild() { - $this->UnitTestCase('Test of Month_Weekdays::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(35,$this->cal->size()); - } - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(35,$i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - function testSelection() { - require_once(CALENDAR_ROOT . 'Day.php'); - $selection = array(new Calendar_Day(2003,10,25)); - $this->cal->build($selection); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - if ( $i == 27 ) - break; - $i++; - } - $this->assertTrue($Child->isSelected()); - } - function testEmptyCount() { - $this->cal->build(); - $empty = 0; - while ( $Child = $this->cal->fetch() ) { - if ( $Child->isEmpty() ) - $empty++; - } - $this->assertEqual(4,$empty); - } - function testEmptyDaysBefore_AfterAdjust() { - $this->cal = new Calendar_Month_Weekdays(2004,0); - $this->cal->build(); - $this->assertEqual(0,$this->cal->tableHelper->getEmptyDaysBefore()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfMonthWeekdays(); - $test->run(new HtmlReporter()); - $test = &new TestOfMonthWeekdaysBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/month_weeks_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/month_weeks_test.php deleted file mode 100644 index 1cfb8e8df..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/month_weeks_test.php +++ /dev/null @@ -1,125 +0,0 @@ -UnitTestCase('Test of Month Weeks'); - } - function setUp() { - $this->cal = new Calendar_Month_Weeks(2003,10); - } - function testPrevDay () { - $this->assertEqual(30,$this->cal->prevDay()); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 9, - 'day' => 30, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testThisDay () { - $this->assertEqual(1,$this->cal->thisDay()); - } - function testNextDay () { - $this->assertEqual(2,$this->cal->nextDay()); - } - function testPrevHour () { - $this->assertEqual(23,$this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(0,$this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(1,$this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(59,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(0,0,0,10,1,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfMonthWeeksBuild extends TestOfMonthWeeks { - function TestOfMonthWeeksBuild() { - $this->UnitTestCase('Test of Month_Weeks::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(5,$this->cal->size()); - } - - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(5,$i); - } -/* Recusive dependency issue with SimpleTest - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } -*/ - function testSelection() { - require_once(CALENDAR_ROOT . 'Week.php'); - $selection = array(new Calendar_Week(2003, 10, 12)); - $this->cal->build($selection); - $i = 1; - while ($Child = $this->cal->fetch()) { - if ($i == 2) { - break; //12-10-2003 is the 2nd day of the week - } - $i++; - } - $this->assertTrue($Child->isSelected()); - } - function testEmptyDaysBefore_AfterAdjust() { - $this->cal = new Calendar_Month_Weeks(2004,0); - $this->cal->build(); - $this->assertEqual(0,$this->cal->tableHelper->getEmptyDaysBefore()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfMonthWeeks(); - $test->run(new HtmlReporter()); - $test = &new TestOfMonthWeeksBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/peardate_engine_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/peardate_engine_test.php deleted file mode 100644 index 4606185eb..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/peardate_engine_test.php +++ /dev/null @@ -1,124 +0,0 @@ -UnitTestCase('Test of Calendar_Engine_PearDate'); - } - function setUp() { - $this->engine = new Calendar_Engine_PearDate(); - } - function testGetSecondsInMinute() { - $this->assertEqual($this->engine->getSecondsInMinute(),60); - } - function testGetMinutesInHour() { - $this->assertEqual($this->engine->getMinutesInHour(),60); - } - function testGetHoursInDay() { - $this->assertEqual($this->engine->getHoursInDay(),24); - } - function testGetFirstDayOfWeek() { - $this->assertEqual($this->engine->getFirstDayOfWeek(),1); - } - function testGetWeekDays() { - $this->assertEqual($this->engine->getWeekDays(),array(0,1,2,3,4,5,6)); - } - function testGetDaysInWeek() { - $this->assertEqual($this->engine->getDaysInWeek(),7); - } - function testGetWeekNInYear() { - $this->assertEqual($this->engine->getWeekNInYear(2003, 11, 3), 45); - } - function testGetWeekNInMonth() { - $this->assertEqual($this->engine->getWeekNInMonth(2003, 11, 3), 2); - } - function testGetWeeksInMonth0() { - $this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 0), 6); //week starts on sunday - } - function testGetWeeksInMonth1() { - $this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 1), 5); //week starts on monday - } - function testGetWeeksInMonth2() { - $this->assertEqual($this->engine->getWeeksInMonth(2003, 2, 6), 4); //week starts on saturday - } - function testGetWeeksInMonth3() { - // Unusual cases that can cause fails (shows up with example 21.php) - $this->assertEqual($this->engine->getWeeksInMonth(2004,2,1),5); - $this->assertEqual($this->engine->getWeeksInMonth(2004,8,1),6); - } - function testGetDayOfWeek() { - $this->assertEqual($this->engine->getDayOfWeek(2003, 11, 18), 2); - } - function testGetFirstDayInMonth() { - $this->assertEqual($this->engine->getFirstDayInMonth(2003,10),3); - } - function testGetDaysInMonth() { - $this->assertEqual($this->engine->getDaysInMonth(2003,10),31); - } - function testGetMinYears() { - $this->assertEqual($this->engine->getMinYears(),0); - } - function testGetMaxYears() { - $this->assertEqual($this->engine->getMaxYears(),9999); - } - function testDateToStamp() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->dateToStamp(2003,10,15,13,30,45),$stamp); - } - function testStampToSecond() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->stampToSecond($stamp),45); - } - function testStampToMinute() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->stampToMinute($stamp),30); - } - function testStampToHour() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->stampToHour($stamp),13); - } - function testStampToDay() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->stampToDay($stamp),15); - } - function testStampToMonth() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->stampToMonth($stamp),10); - } - function testStampToYear() { - $stamp = '2003-10-15 13:30:45'; - $this->assertEqual($this->engine->stampToYear($stamp),2003); - } - function testAdjustDate() { - $stamp = '2004-01-01 13:30:45'; - $y = $this->engine->stampToYear($stamp); - $m = $this->engine->stampToMonth($stamp); - $d = $this->engine->stampToDay($stamp); - - //the first day of the month should be thursday - $this->assertEqual($this->engine->getDayOfWeek($y, $m, $d), 4); - - $m--; // 2004-00-01 => 2003-12-01 - $this->engine->adjustDate($y, $m, $d, $dummy, $dummy, $dummy); - - $this->assertEqual($y, 2003); - $this->assertEqual($m, 12); - $this->assertEqual($d, 1); - - // get last day and check if it's wednesday - $d = $this->engine->getDaysInMonth($y, $m); - - $this->assertEqual($this->engine->getDayOfWeek($y, $m, $d), 3); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfPearDateEngine(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/second_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/second_test.php deleted file mode 100644 index ea93da6c7..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/second_test.php +++ /dev/null @@ -1,34 +0,0 @@ -UnitTestCase('Test of Second'); - } - function setUp() { - $this->cal = new Calendar_Second(2003,10,25,13,32,43); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 10, - 'day' => 24, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfSecond(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/simple_include.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/simple_include.php deleted file mode 100644 index c32abeecc..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/simple_include.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/table_helper_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/table_helper_tests.php deleted file mode 100644 index 8ffcb192a..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/table_helper_tests.php +++ /dev/null @@ -1,19 +0,0 @@ -GroupTest('Table Helper Tests'); - $this->addTestFile('helper_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TableHelperTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/unixts_engine_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/unixts_engine_test.php deleted file mode 100644 index 69e61f408..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/unixts_engine_test.php +++ /dev/null @@ -1,104 +0,0 @@ -UnitTestCase('Test of Calendar_Engine_UnixTs'); - } - function setUp() { - $this->engine = new Calendar_Engine_UnixTs(); - } - function testGetSecondsInMinute() { - $this->assertEqual($this->engine->getSecondsInMinute(),60); - } - function testGetMinutesInHour() { - $this->assertEqual($this->engine->getMinutesInHour(),60); - } - function testGetHoursInDay() { - $this->assertEqual($this->engine->getHoursInDay(),24); - } - function testGetFirstDayOfWeek() { - $this->assertEqual($this->engine->getFirstDayOfWeek(),1); - } - function testGetWeekDays() { - $this->assertEqual($this->engine->getWeekDays(),array(0,1,2,3,4,5,6)); - } - function testGetDaysInWeek() { - $this->assertEqual($this->engine->getDaysInWeek(),7); - } - function testGetWeekNInYear() { - $this->assertEqual($this->engine->getWeekNInYear(2003, 11, 3), 45); - } - function testGetWeekNInMonth() { - $this->assertEqual($this->engine->getWeekNInMonth(2003, 11, 3), 2); - } - function testGetWeeksInMonth0() { - $this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 0), 6); //week starts on sunday - } - function testGetWeeksInMonth1() { - $this->assertEqual($this->engine->getWeeksInMonth(2003, 11, 1), 5); //week starts on monday - } - function testGetWeeksInMonth2() { - $this->assertEqual($this->engine->getWeeksInMonth(2003, 2, 6), 4); //week starts on saturday - } - function testGetWeeksInMonth3() { - // Unusual cases that can cause fails (shows up with example 21.php) - $this->assertEqual($this->engine->getWeeksInMonth(2004,2,1),5); - $this->assertEqual($this->engine->getWeeksInMonth(2004,8,1),6); - } - function testGetDayOfWeek() { - $this->assertEqual($this->engine->getDayOfWeek(2003, 11, 18), 2); - } - function testGetFirstDayInMonth() { - $this->assertEqual($this->engine->getFirstDayInMonth(2003,10),3); - } - function testGetDaysInMonth() { - $this->assertEqual($this->engine->getDaysInMonth(2003,10),31); - } - function testGetMinYears() { - $test = strpos(PHP_OS, 'WIN') >= 0 ? 1970 : 1902; - $this->assertEqual($this->engine->getMinYears(),$test); - } - function testGetMaxYears() { - $this->assertEqual($this->engine->getMaxYears(),2037); - } - function testDateToStamp() { - $stamp = mktime(0,0,0,10,15,2003); - $this->assertEqual($this->engine->dateToStamp(2003,10,15,0,0,0),$stamp); - } - function testStampToSecond() { - $stamp = mktime(13,30,45,10,15,2003); - $this->assertEqual($this->engine->stampToSecond($stamp),45); - } - function testStampToMinute() { - $stamp = mktime(13,30,45,10,15,2003); - $this->assertEqual($this->engine->stampToMinute($stamp),30); - } - function testStampToHour() { - $stamp = mktime(13,30,45,10,15,2003); - $this->assertEqual($this->engine->stampToHour($stamp),13); - } - function testStampToDay() { - $stamp = mktime(13,30,45,10,15,2003); - $this->assertEqual($this->engine->stampToDay($stamp),15); - } - function testStampToMonth() { - $stamp = mktime(13,30,45,10,15,2003); - $this->assertEqual($this->engine->stampToMonth($stamp),10); - } - function testStampToYear() { - $stamp = mktime(13,30,45,10,15,2003); - $this->assertEqual($this->engine->stampToYear($stamp),2003); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfUnixTsEngine(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/util_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/util_tests.php deleted file mode 100644 index fd578abb0..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/util_tests.php +++ /dev/null @@ -1,20 +0,0 @@ -GroupTest('Util Tests'); - $this->addTestFile('util_uri_test.php'); - $this->addTestFile('util_textual_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new UtilTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/util_textual_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/util_textual_test.php deleted file mode 100644 index 3fd80274e..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/util_textual_test.php +++ /dev/null @@ -1,191 +0,0 @@ -UnitTestCase('Test of Calendar_Util_Textual'); - } - function setUp() { - $this->mockengine = new Mock_Calendar_Engine($this); - $this->mockcal = new Mock_Calendar_Second($this); - $this->mockcal->setReturnValue('prevYear',2002); - $this->mockcal->setReturnValue('thisYear',2003); - $this->mockcal->setReturnValue('nextYear',2004); - $this->mockcal->setReturnValue('prevMonth',9); - $this->mockcal->setReturnValue('thisMonth',10); - $this->mockcal->setReturnValue('nextMonth',11); - $this->mockcal->setReturnValue('prevDay',14); - $this->mockcal->setReturnValue('thisDay',15); - $this->mockcal->setReturnValue('nextDay',16); - $this->mockcal->setReturnValue('prevHour',12); - $this->mockcal->setReturnValue('thisHour',13); - $this->mockcal->setReturnValue('nextHour',14); - $this->mockcal->setReturnValue('prevMinute',29); - $this->mockcal->setReturnValue('thisMinute',30); - $this->mockcal->setReturnValue('nextMinute',31); - $this->mockcal->setReturnValue('prevSecond',44); - $this->mockcal->setReturnValue('thisSecond',45); - $this->mockcal->setReturnValue('nextSecond',46); - $this->mockcal->setReturnValue('getEngine',$this->mockengine); - $this->mockcal->setReturnValue('getTimestamp',12345); - } - function tearDown() { - unset ( $this->engine ); - unset ( $this->mockcal ); - } - function testMonthNamesLong() { - $monthNames = array( - 1=>'January', - 2=>'February', - 3=>'March', - 4=>'April', - 5=>'May', - 6=>'June', - 7=>'July', - 8=>'August', - 9=>'September', - 10=>'October', - 11=>'November', - 12=>'December', - ); - $this->assertEqual($monthNames,Calendar_Util_Textual::monthNames()); - } - function testMonthNamesShort() { - $monthNames = array( - 1=>'Jan', - 2=>'Feb', - 3=>'Mar', - 4=>'Apr', - 5=>'May', - 6=>'Jun', - 7=>'Jul', - 8=>'Aug', - 9=>'Sep', - 10=>'Oct', - 11=>'Nov', - 12=>'Dec', - ); - $this->assertEqual($monthNames,Calendar_Util_Textual::monthNames('short')); - } - function testMonthNamesTwo() { - $monthNames = array( - 1=>'Ja', - 2=>'Fe', - 3=>'Ma', - 4=>'Ap', - 5=>'Ma', - 6=>'Ju', - 7=>'Ju', - 8=>'Au', - 9=>'Se', - 10=>'Oc', - 11=>'No', - 12=>'De', - ); - $this->assertEqual($monthNames,Calendar_Util_Textual::monthNames('two')); - } - function testMonthNamesOne() { - $monthNames = array( - 1=>'J', - 2=>'F', - 3=>'M', - 4=>'A', - 5=>'M', - 6=>'J', - 7=>'J', - 8=>'A', - 9=>'S', - 10=>'O', - 11=>'N', - 12=>'D', - ); - $this->assertEqual($monthNames,Calendar_Util_Textual::monthNames('one')); - } - function testWeekdayNamesLong() { - $weekdayNames = array( - 0=>'Sunday', - 1=>'Monday', - 2=>'Tuesday', - 3=>'Wednesday', - 4=>'Thursday', - 5=>'Friday', - 6=>'Saturday', - ); - $this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames()); - } - function testWeekdayNamesShort() { - $weekdayNames = array( - 0=>'Sun', - 1=>'Mon', - 2=>'Tue', - 3=>'Wed', - 4=>'Thu', - 5=>'Fri', - 6=>'Sat', - ); - $this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames('short')); - } - function testWeekdayNamesTwo() { - $weekdayNames = array( - 0=>'Su', - 1=>'Mo', - 2=>'Tu', - 3=>'We', - 4=>'Th', - 5=>'Fr', - 6=>'Sa', - ); - $this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames('two')); - } - function testWeekdayNamesOne() { - $weekdayNames = array( - 0=>'S', - 1=>'M', - 2=>'T', - 3=>'W', - 4=>'T', - 5=>'F', - 6=>'S', - ); - $this->assertEqual($weekdayNames,Calendar_Util_Textual::weekdayNames('one')); - } - function testPrevMonthNameShort() { - $this->assertEqual('Sep',Calendar_Util_Textual::prevMonthName($this->mockcal,'short')); - } - function testThisMonthNameShort() { - $this->assertEqual('Oct',Calendar_Util_Textual::thisMonthName($this->mockcal,'short')); - } - function testNextMonthNameShort() { - $this->assertEqual('Nov',Calendar_Util_Textual::nextMonthName($this->mockcal,'short')); - } - function testThisDayNameShort() { - $this->assertEqual('Wed',Calendar_Util_Textual::thisDayName($this->mockcal,'short')); - } - function testOrderedWeekdaysShort() { - $weekdayNames = array( - 0=>'Sun', - 1=>'Mon', - 2=>'Tue', - 3=>'Wed', - 4=>'Thu', - 5=>'Fri', - 6=>'Sat', - ); - $this->assertEqual($weekdayNames,Calendar_Util_Textual::orderedWeekdays($this->mockcal,'short')); - } - -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfUtilTextual(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/util_uri_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/util_uri_test.php deleted file mode 100644 index 7b4afe1ad..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/util_uri_test.php +++ /dev/null @@ -1,54 +0,0 @@ -UnitTestCase('Test of Calendar_Util_Uri'); - } - - function setUp() { - $this->MockCal = & new Mock_Calendar_Day($this); - $this->MockCal->setReturnValue('getEngine',new Mock_Calendar_Engine($this)); - } - - function testFragments() { - $Uri = new Calendar_Util_Uri('y','m','d','h','m','s'); - $Uri->setFragments('year','month','day','hour','minute','second'); - $this->assertEqual( - 'year=&month=&day=&hour=&minute=&second=', - $Uri->this($this->MockCal, 'second') - ); - } - function testScalarFragments() { - $Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second'); - $Uri->scalar = true; - $this->assertEqual( - '&&&&&', - $Uri->this($this->MockCal, 'second') - ); - } - function testSetSeperator() { - $Uri = new Calendar_Util_Uri('year','month','day','hour','minute','second'); - $Uri->separator = '/'; - $this->assertEqual( - 'year=/month=/day=/hour=/minute=/second=', - $Uri->this($this->MockCal, 'second') - ); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfUtilUri(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_error_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_error_test.php deleted file mode 100644 index aafc99c51..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_error_test.php +++ /dev/null @@ -1,34 +0,0 @@ -UnitTestCase('Test of Validation Error'); - } - function setUp() { - $this->vError = new Calendar_Validation_Error('foo',20,'bar'); - } - function testGetUnit() { - $this->assertEqual($this->vError->getUnit(),'foo'); - } - function testGetValue() { - $this->assertEqual($this->vError->getValue(),20); - } - function testGetMessage() { - $this->assertEqual($this->vError->getMessage(),'bar'); - } - function testToString() { - $this->assertEqual($this->vError->toString(),'foo = 20 [bar]'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfValidationError(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_tests.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_tests.php deleted file mode 100644 index 6749b1173..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_tests.php +++ /dev/null @@ -1,20 +0,0 @@ -GroupTest('Validator Tests'); - $this->addTestFile('validator_unit_test.php'); - $this->addTestFile('validator_error_test.php'); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new ValidatorTests(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_unit_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_unit_test.php deleted file mode 100644 index 3f4a58a40..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/validator_unit_test.php +++ /dev/null @@ -1,210 +0,0 @@ -UnitTestCase('Test of Validator'); - } - function setUp() { - $this->mockengine = new Mock_Calendar_Engine($this); - $this->mockengine->setReturnValue('getMinYears',1970); - $this->mockengine->setReturnValue('getMaxYears',2037); - $this->mockengine->setReturnValue('getMonthsInYear',12); - $this->mockengine->setReturnValue('getDaysInMonth',30); - $this->mockengine->setReturnValue('getHoursInDay',24); - $this->mockengine->setReturnValue('getMinutesInHour',60); - $this->mockengine->setReturnValue('getSecondsInMinute',60); - $this->mockcal = new Mock_Calendar_Second($this); - $this->mockcal->setReturnValue('getEngine',$this->mockengine); - } - function tearDown() { - unset ($this->mockengine); - unset ($this->mocksecond); - } - function testIsValidYear() { - $this->mockcal->setReturnValue('thisYear',2000); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValidYear()); - } - function testIsValidYearTooSmall() { - $this->mockcal->setReturnValue('thisYear',1969); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidYear()); - } - function testIsValidYearTooLarge() { - $this->mockcal->setReturnValue('thisYear',2038); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidYear()); - } - function testIsValidMonth() { - $this->mockcal->setReturnValue('thisMonth',10); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValidMonth()); - } - function testIsValidMonthTooSmall() { - $this->mockcal->setReturnValue('thisMonth',0); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidMonth()); - } - function testIsValidMonthTooLarge() { - $this->mockcal->setReturnValue('thisMonth',13); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidMonth()); - } - function testIsValidDay() { - $this->mockcal->setReturnValue('thisDay',10); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValidDay()); - } - function testIsValidDayTooSmall() { - $this->mockcal->setReturnValue('thisDay',0); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidDay()); - } - function testIsValidDayTooLarge() { - $this->mockcal->setReturnValue('thisDay',31); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidDay()); - } - function testIsValidHour() { - $this->mockcal->setReturnValue('thisHour',10); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValidHour()); - } - function testIsValidHourTooSmall() { - $this->mockcal->setReturnValue('thisHour',-1); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidHour()); - } - function testIsValidHourTooLarge() { - $this->mockcal->setReturnValue('thisHour',24); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidHour()); - } - function testIsValidMinute() { - $this->mockcal->setReturnValue('thisMinute',30); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValidMinute()); - } - function testIsValidMinuteTooSmall() { - $this->mockcal->setReturnValue('thisMinute',-1); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidMinute()); - } - function testIsValidMinuteTooLarge() { - $this->mockcal->setReturnValue('thisMinute',60); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidMinute()); - } - function testIsValidSecond() { - $this->mockcal->setReturnValue('thisSecond',30); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValidSecond()); - } - function testIsValidSecondTooSmall() { - $this->mockcal->setReturnValue('thisSecond',-1); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidSecond()); - } - function testIsValidSecondTooLarge() { - $this->mockcal->setReturnValue('thisSecond',60); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValidSecond()); - } - function testIsValid() { - $this->mockcal->setReturnValue('thisYear',2000); - $this->mockcal->setReturnValue('thisMonth',5); - $this->mockcal->setReturnValue('thisDay',15); - $this->mockcal->setReturnValue('thisHour',13); - $this->mockcal->setReturnValue('thisMinute',30); - $this->mockcal->setReturnValue('thisSecond',40); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertTrue($Validator->isValid()); - } - function testIsValidAllWrong() { - $this->mockcal->setReturnValue('thisYear',2038); - $this->mockcal->setReturnValue('thisMonth',13); - $this->mockcal->setReturnValue('thisDay',31); - $this->mockcal->day = 31; - $this->mockcal->setReturnValue('thisHour',24); - $this->mockcal->setReturnValue('thisMinute',60); - $this->mockcal->setReturnValue('thisSecond',60); - $Validator = & new Calendar_Validator($this->mockcal); - $this->assertFalse($Validator->isValid()); - $i = 0; - while ( $Validator->fetch() ) { - $i++; - } - $this->assertEqual($i,6); - } -} - -class TestOfValidatorLive extends UnitTestCase { - function TestOfValidatorLive() { - $this->UnitTestCase('Test of Validator Live'); - } - function testYear() { - $Unit = new Calendar_Year(2038); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidYear()); - } - function testMonth() { - $Unit = new Calendar_Month(2000,13); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidMonth()); - } -/* - function testWeek() { - $Unit = new Calendar_Week(2000,12,7); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidWeek()); - } -*/ - function testDay() { - $Unit = new Calendar_Day(2000,12,32); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidDay()); - } - function testHour() { - $Unit = new Calendar_Hour(2000,12,20,24); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidHour()); - } - function testMinute() { - $Unit = new Calendar_Minute(2000,12,20,23,60); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidMinute()); - } - function testSecond() { - $Unit = new Calendar_Second(2000,12,20,23,59,60); - $Validator = & $Unit->getValidator(); - $this->assertFalse($Validator->isValidSecond()); - } - function testAllBad() { - $Unit = new Calendar_Second(2000,13,32,24,60,60); - $this->assertFalse($Unit->isValid()); - $Validator = & $Unit->getValidator(); - $i = 0; - while ( $Validator->fetch() ) { - $i++; - } - $this->assertEqual($i,5); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfValidator(); - $test->run(new HtmlReporter()); - $test = &new TestOfValidatorLive(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/week_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/week_test.php deleted file mode 100644 index 8073b985a..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/week_test.php +++ /dev/null @@ -1,214 +0,0 @@ -UnitTestCase('Test of Week'); - } - function setUp() { - $this->cal = new Calendar_Week(2003, 10, 9, 1); //force firstDay = monday - //print_r($this->cal); - } - function testPrevDay () { - $this->assertEqual(8, $this->cal->prevDay()); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2003, - 'month' => 10, - 'day' => 8, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testThisDay () { - $this->assertEqual(9, $this->cal->thisDay()); - } - function testNextDay () { - $this->assertEqual(10, $this->cal->nextDay()); - } - function testPrevHour () { - $this->assertEqual(23, $this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(0, $this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(1, $this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(59, $this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0, $this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1, $this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59, $this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0, $this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1, $this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(0,0,0,10,9,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } - function testNewTimeStamp() { - $stamp = mktime(0,0,0,7,28,2004); - $this->cal->setTimestamp($stamp); - $this->assertEqual('30 2004', date('W Y', $this->cal->prevWeek(true))); - $this->assertEqual('31 2004', date('W Y', $this->cal->thisWeek(true))); - $this->assertEqual('32 2004', date('W Y', $this->cal->nextWeek(true))); - } - function testPrevWeekInMonth() { - $this->assertEqual(1, $this->cal->prevWeek()); - } - function testThisWeekInMonth() { - $this->assertEqual(2, $this->cal->thisWeek()); - } - function testNextWeekInMonth() { - $this->assertEqual(3, $this->cal->nextWeek()); - } - function testPrevWeekInYear() { - $this->assertEqual(40, $this->cal->prevWeek('n_in_year')); - } - function testThisWeekInYear() { - $this->assertEqual(41, $this->cal->thisWeek('n_in_year')); - } - function testNextWeekInYear() { - $this->assertEqual(42, $this->cal->nextWeek('n_in_year')); - } - function testPrevWeekArray() { - $testArray = array( - 'year'=>2003, - 'month'=>9, - 'day'=>29, - 'hour'=>0, - 'minute'=>0, - 'second'=>0 - ); - $this->assertEqual($testArray, $this->cal->prevWeek('array')); - } - function testThisWeekArray() { - $testArray = array( - 'year'=>2003, - 'month'=>10, - 'day'=>6, - 'hour'=>0, - 'minute'=>0, - 'second'=>0 - ); - $this->assertEqual($testArray, $this->cal->thisWeek('array')); - } - function testNextWeekArray() { - $testArray = array( - 'year'=>2003, - 'month'=>10, - 'day'=>13, - 'hour'=>0, - 'minute'=>0, - 'second'=>0 - ); - $this->assertEqual($testArray, $this->cal->nextWeek('array')); - } - function testPrevWeekObject() { - $testWeek = new Calendar_Week(2003,9,29); - $Week = $this->cal->prevWeek('object'); - $this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp()); - } - function testThisWeekObject() { - $testWeek = new Calendar_Week(2003,10,6); - $Week = $this->cal->thisWeek('object'); - $this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp()); - } - function testNextWeekObject() { - $testWeek = new Calendar_Week(2003,10,13); - $Week = $this->cal->nextWeek('object'); - $this->assertEqual($testWeek->getTimeStamp(),$Week->getTimeStamp()); - } -} - -class TestOfWeekBuild extends TestOfWeek { - function TestOfWeekBuild() { - $this->UnitTestCase('Test of Week::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(7, $this->cal->size()); - } - - function testFetch() { - $this->cal->build(); - $i=0; - while ($Child = $this->cal->fetch()) { - $i++; - } - $this->assertEqual(7, $i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - - function testSelection() { - require_once(CALENDAR_ROOT . 'Day.php'); - $selection = array(new Calendar_Day(2003, 10, 7)); - $this->cal->build($selection); - $i = 1; - while ($Child = $this->cal->fetch()) { - if ($i == 2) { - break; //07-10-2003 is the 2nd day of the week - } - $i++; - } - $this->assertTrue($Child->isSelected()); - } - function testSelectionCornerCase() { - require_once(CALENDAR_ROOT . 'Day.php'); - $selectedDays = array( - new Calendar_Day(2003, 12, 28), - new Calendar_Day(2003, 12, 29), - new Calendar_Day(2003, 12, 30), - new Calendar_Day(2003, 12, 31), - new Calendar_Day(2004, 01, 01), - new Calendar_Day(2004, 01, 02), - new Calendar_Day(2004, 01, 03) - ); - $this->cal = new Calendar_Week(2003, 12, 31, 0); - $this->cal->build($selectedDays); - while ($Day = $this->cal->fetch()) { - $this->assertTrue($Day->isSelected()); - } - $this->cal = new Calendar_Week(2004, 1, 1, 0); - $this->cal->build($selectedDays); - while ($Day = $this->cal->fetch()) { - $this->assertTrue($Day->isSelected()); - } - } -} -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfWeek(); - $test->run(new HtmlReporter()); - $test = &new TestOfWeekBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/Calendar/tests/year_test.php b/campcaster/src/tools/pear/src/tests/Calendar/tests/year_test.php deleted file mode 100644 index 8e7d6bd91..000000000 --- a/campcaster/src/tools/pear/src/tests/Calendar/tests/year_test.php +++ /dev/null @@ -1,142 +0,0 @@ -UnitTestCase('Test of Year'); - } - function setUp() { - $this->cal = new Calendar_Year(2003); - } - function testPrevYear_Object() { - $this->assertEqual(new Calendar_Year(2002), $this->cal->prevYear('object')); - } - function testThisYear_Object() { - $this->assertEqual(new Calendar_Year(2003), $this->cal->thisYear('object')); - } - function testPrevMonth () { - $this->assertEqual(12,$this->cal->prevMonth()); - } - function testPrevMonth_Array () { - $this->assertEqual( - array( - 'year' => 2002, - 'month' => 12, - 'day' => 1, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevMonth('array')); - } - function testThisMonth () { - $this->assertEqual(1,$this->cal->thisMonth()); - } - function testNextMonth () { - $this->assertEqual(2,$this->cal->nextMonth()); - } - function testPrevDay () { - $this->assertEqual(31,$this->cal->prevDay()); - } - function testPrevDay_Array () { - $this->assertEqual( - array( - 'year' => 2002, - 'month' => 12, - 'day' => 31, - 'hour' => 0, - 'minute' => 0, - 'second' => 0), - $this->cal->prevDay('array')); - } - function testThisDay () { - $this->assertEqual(1,$this->cal->thisDay()); - } - function testNextDay () { - $this->assertEqual(2,$this->cal->nextDay()); - } - function testPrevHour () { - $this->assertEqual(23,$this->cal->prevHour()); - } - function testThisHour () { - $this->assertEqual(0,$this->cal->thisHour()); - } - function testNextHour () { - $this->assertEqual(1,$this->cal->nextHour()); - } - function testPrevMinute () { - $this->assertEqual(59,$this->cal->prevMinute()); - } - function testThisMinute () { - $this->assertEqual(0,$this->cal->thisMinute()); - } - function testNextMinute () { - $this->assertEqual(1,$this->cal->nextMinute()); - } - function testPrevSecond () { - $this->assertEqual(59,$this->cal->prevSecond()); - } - function testThisSecond () { - $this->assertEqual(0,$this->cal->thisSecond()); - } - function testNextSecond () { - $this->assertEqual(1,$this->cal->nextSecond()); - } - function testGetTimeStamp() { - $stamp = mktime(0,0,0,1,1,2003); - $this->assertEqual($stamp,$this->cal->getTimeStamp()); - } -} - -class TestOfYearBuild extends TestOfYear { - function TestOfYearBuild() { - $this->UnitTestCase('Test of Year::build()'); - } - function testSize() { - $this->cal->build(); - $this->assertEqual(12,$this->cal->size()); - } - function testFetch() { - $this->cal->build(); - $i=0; - while ( $Child = $this->cal->fetch() ) { - $i++; - } - $this->assertEqual(12,$i); - } - function testFetchAll() { - $this->cal->build(); - $children = array(); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - $children[$i]=$Child; - $i++; - } - $this->assertEqual($children,$this->cal->fetchAll()); - } - function testSelection() { - require_once(CALENDAR_ROOT . 'Month.php'); - $selection = array(new Calendar_Month(2003,10)); - $this->cal->build($selection); - $i = 1; - while ( $Child = $this->cal->fetch() ) { - if ( $i == 10 ) - break; - $i++; - } - $this->assertTrue($Child->isSelected()); - } -} - -if (!defined('TEST_RUNNING')) { - define('TEST_RUNNING', true); - $test = &new TestOfYear(); - $test->run(new HtmlReporter()); - $test = &new TestOfYearBuild(); - $test->run(new HtmlReporter()); -} -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/db_error.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/db_error.phpt deleted file mode 100644 index 66de08bd2..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/db_error.phpt +++ /dev/null @@ -1,79 +0,0 @@ ---TEST-- -DB::DB_Error ---SKIPIF-- - ---FILE-- - 'Error', - E_WARNING => 'Warning', - E_PARSE => 'Parsing Error', - E_NOTICE => 'Notice', - E_CORE_ERROR => 'Core Error', - E_CORE_WARNING => 'Core Warning', - E_COMPILE_ERROR => 'Compile Error', - E_COMPILE_WARNING => 'Compile Warning', - E_USER_ERROR => 'User Error', - E_USER_WARNING => 'User Warning', - E_USER_NOTICE => 'User Notice', - E_STRICT => 'Strict Notice', - ); - $prefix = $errortype[$errno]; - print "\n$prefix: $errmsg in " . basename($file) . " on line XXX\n"; -} - -error_reporting(E_ALL); -set_error_handler('test_error_handler'); - -print "testing different error codes...\n"; -$e = new DB_Error(); print strtolower($e->toString())."\n"; -$e = new DB_Error("test error"); print strtolower($e->toString())."\n"; -$e = new DB_Error(DB_OK); print strtolower($e->toString())."\n"; -$e = new DB_Error(DB_ERROR); print strtolower($e->toString())."\n"; -$e = new DB_Error(DB_ERROR_SYNTAX); print strtolower($e->toString())."\n"; -$e = new DB_Error(DB_ERROR_DIVZERO); print strtolower($e->toString())."\n"; - -print "testing different error modes...\n"; -$e = new DB_Error(DB_ERROR, PEAR_ERROR_PRINT); print strtolower($e->toString())."\n"; -$e = new DB_Error(DB_ERROR_SYNTAX, PEAR_ERROR_TRIGGER); - -print "testing different error serverities...\n"; -$e = new DB_Error(DB_ERROR_SYNTAX, PEAR_ERROR_TRIGGER, E_USER_NOTICE); -$e = new DB_Error(DB_ERROR_SYNTAX, PEAR_ERROR_TRIGGER, E_USER_WARNING); -$e = new DB_Error(DB_ERROR_SYNTAX, PEAR_ERROR_TRIGGER, E_USER_ERROR); - -?> ---GET-- ---POST-- ---EXPECT-- -testing different error codes... -[db_error: message="db error: unknown error" code=-1 mode=return level=notice prefix="" info=""] -[db_error: message="db error: test error" code=-1 mode=return level=notice prefix="" info=""] -[db_error: message="db error: no error" code=1 mode=return level=notice prefix="" info=""] -[db_error: message="db error: unknown error" code=-1 mode=return level=notice prefix="" info=""] -[db_error: message="db error: syntax error" code=-2 mode=return level=notice prefix="" info=""] -[db_error: message="db error: division by zero" code=-13 mode=return level=notice prefix="" info=""] -testing different error modes... -DB Error: unknown error[db_error: message="db error: unknown error" code=-1 mode=print level=notice prefix="" info=""] - -User Notice: DB Error: syntax error in PEAR.php on line XXX -testing different error serverities... - -User Notice: DB Error: syntax error in PEAR.php on line XXX - -User Warning: DB Error: syntax error in PEAR.php on line XXX - -User Error: DB Error: syntax error in PEAR.php on line XXX diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/db_error2.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/db_error2.phpt deleted file mode 100644 index 2cc01ff2b..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/db_error2.phpt +++ /dev/null @@ -1,92 +0,0 @@ ---TEST-- -DB::Error 2 ---SKIPIF-- - ---FILE-- -toString()) . "\n"; -} -function myfunc2(&$obj) { - print 'myfunc2 here, obj=' - . strtolower($obj->toString()) . "\n"; -} -class myclass { - function myfunc(&$obj) { - print 'myclass::myfunc here, obj=' - . strtolower($obj->toString()) . "\n"; - } -} -function test_error_handler($errno, $errmsg, $file, $line, $vars) { - if (defined('E_STRICT')) { - if ($errno & E_STRICT - && (error_reporting() & E_STRICT) != E_STRICT) { - // Ignore E_STRICT notices unless they have been turned on - return; - } - } else { - define('E_STRICT', 2048); - } - $errortype = array ( - E_ERROR => 'Error', - E_WARNING => 'Warning', - E_PARSE => 'Parsing Error', - E_NOTICE => 'Notice', - E_CORE_ERROR => 'Core Error', - E_CORE_WARNING => 'Core Warning', - E_COMPILE_ERROR => 'Compile Error', - E_COMPILE_WARNING => 'Compile Warning', - E_USER_ERROR => 'User Error', - E_USER_WARNING => 'User Warning', - E_USER_NOTICE => 'User Notice', - E_STRICT => 'Strict Notice', - ); - $prefix = $errortype[$errno]; - print strtolower("$prefix: $errmsg in " . basename($file) - . " on line XXX\n"); -} - -$obj = new myclass; - -$dbh = DB::factory("mysql"); - -print "default: "; -$e = $dbh->raiseError("return testing error"); -print strtolower($e->toString()) . "\n"; - -print "global default: "; -PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "myfunc2"); -$e = $dbh->raiseError("global default test"); - -$dbh->setErrorHandling(PEAR_ERROR_PRINT); -print "mode=print: "; -$e = $dbh->raiseError("print testing error"); -print "\n"; - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, "myfunc"); -print "mode=function callback: "; -$e = $dbh->raiseError("function callback testing error"); - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, array($obj, "myfunc")); -print "mode=object callback: "; -$e = $dbh->raiseError("object callback testing error"); - -set_error_handler("test_error_handler"); -$dbh->setErrorHandling(PEAR_ERROR_TRIGGER); -print "mode=trigger: "; -$e = $dbh->raiseError("trigger testing error"); - -?> ---EXPECT-- -default: [db_error: message="db error: return testing error" code=-1 mode=return level=notice prefix="" info=" [db error: unknown error]"] -global default: myfunc2 here, obj=[db_error: message="db error: global default test" code=-1 mode=callback callback=myfunc2 prefix="" info=" [db error: unknown error]"] -mode=print: DB Error: print testing error -mode=function callback: myfunc here, obj=[db_error: message="db error: function callback testing error" code=-1 mode=callback callback=myfunc prefix="" info=" [db error: unknown error]"] -mode=object callback: myclass::myfunc here, obj=[db_error: message="db error: object callback testing error" code=-1 mode=callback callback=myclass::myfunc prefix="" info=" [db error: unknown error]"] -mode=trigger: user notice: db error: trigger testing error in pear.php on line xxx diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/db_factory.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/db_factory.phpt deleted file mode 100644 index e359485e3..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/db_factory.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -DB::factory ---SKIPIF-- - ---FILE-- -getMessage() . "\n"; - } else { - print 'object: ' . $obj->toString() . "\n"; - } -} - -?> ---GET-- ---POST-- ---EXPECT-- -testing dbase: object: db_dbase: (phptype=dbase, dbsyntax=dbase) -testing fbsql: object: db_fbsql: (phptype=fbsql, dbsyntax=fbsql) -testing ibase: object: db_ibase: (phptype=ibase, dbsyntax=ibase) -testing ifx: object: db_ifx: (phptype=ifx, dbsyntax=ifx) -testing msql: object: db_msql: (phptype=msql, dbsyntax=msql) -testing mssql: object: db_mssql: (phptype=mssql, dbsyntax=mssql) -testing mysql: object: db_mysql: (phptype=mysql, dbsyntax=mysql) -testing mysqli: object: db_mysqli: (phptype=mysqli, dbsyntax=mysqli) -testing oci8: object: db_oci8: (phptype=oci8, dbsyntax=oci8) -testing odbc: object: db_odbc: (phptype=odbc, dbsyntax=sql92) -testing pgsql: object: db_pgsql: (phptype=pgsql, dbsyntax=pgsql) -testing sqlite: object: db_sqlite: (phptype=sqlite, dbsyntax=sqlite) -testing sybase: object: db_sybase: (phptype=sybase, dbsyntax=sybase) diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/db_ismanip.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/db_ismanip.phpt deleted file mode 100644 index c6a275366..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/db_ismanip.phpt +++ /dev/null @@ -1,57 +0,0 @@ ---TEST-- -DB::isManip ---SKIPIF-- - ---FILE-- - ---GET-- ---POST-- ---EXPECT-- -testing DB::isManip... -SELECT : 0 -Select : 0 -select : 0 -sElECt : 0 -SELECT : 0 -UPDATE : 1 -DELETE : 1 -delete : 1 -create : 1 -CREATE : 1 -"CREATE : 1 -GRANT : 1 -REVOKE : 1 -SHOW : 0 -DROP : 1 -ALTER : 1 - : 0 - : 1 diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/db_parsedsn.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/db_parsedsn.phpt deleted file mode 100644 index 20955ac7e..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/db_parsedsn.phpt +++ /dev/null @@ -1,480 +0,0 @@ ---TEST-- -DB::parseDSN ---SKIPIF-- - ---FILE-- - 'mysql', - 'hostspec' => 'foobar', -); -testArray($array); - -?> ---GET-- ---POST-- ---EXPECT-- -testing DB::parseDSN... - -DSN: mysql -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => - [hostspec] => - [port] => - [socket] => - [database] => -) -DSN: odbc(mssql) -Array -( - [phptype] => odbc - [dbsyntax] => mssql - [username] => - [password] => - [protocol] => - [hostspec] => - [port] => - [socket] => - [database] => -) -DSN: odbc(db2)://user:password@/database -Array -( - [phptype] => odbc - [dbsyntax] => db2 - [username] => user - [password] => password - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => database -) -DSN: odbc(access):///database -Array -( - [phptype] => odbc - [dbsyntax] => access - [username] => - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => database -) -DSN: odbc://admin@/datasourceName -Array -( - [phptype] => odbc - [dbsyntax] => odbc - [username] => admin - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => datasourceName -) -DSN: mysql://localhost -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => tcp - [hostspec] => localhost - [port] => - [socket] => - [database] => -) -DSN: mysql://remote.host.com/db -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => tcp - [hostspec] => remote.host.com - [port] => - [socket] => - [database] => db -) -DSN: oci8://system:manager@ -Array -( - [phptype] => oci8 - [dbsyntax] => oci8 - [username] => system - [password] => manager - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => -) -DSN: oci8://user:pass@tns-name -Array -( - [phptype] => oci8 - [dbsyntax] => oci8 - [username] => user - [password] => pass - [protocol] => tcp - [hostspec] => tns-name - [port] => - [socket] => - [database] => -) -DSN: odbc(solid)://foo:bar@tcp+localhost+1313 -Array -( - [phptype] => odbc - [dbsyntax] => solid - [username] => foo - [password] => bar - [protocol] => tcp - [hostspec] => localhost+1313 - [port] => - [socket] => - [database] => -) -DSN: pgsql://user@unix+localhost/pear -Array -( - [phptype] => pgsql - [dbsyntax] => pgsql - [username] => user - [password] => - [protocol] => unix - [hostspec] => - [port] => - [socket] => localhost - [database] => pear -) -DSN: ibase://user%40domain:password@host -Array -( - [phptype] => ibase - [dbsyntax] => ibase - [username] => user@domain - [password] => password - [protocol] => tcp - [hostspec] => host - [port] => - [socket] => - [database] => -) -DSN: ibase://user@domain:pass@word@/database -Array -( - [phptype] => ibase - [dbsyntax] => ibase - [username] => user@domain - [password] => pass@word - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => database -) -DSN: ifx://user@domain:pass@word@host.com//usr/db/general.db -Array -( - [phptype] => ifx - [dbsyntax] => ifx - [username] => user@domain - [password] => pass@word - [protocol] => tcp - [hostspec] => host.com - [port] => - [socket] => - [database] => /usr/db/general.db -) -DSN: ifx://remote.host.com/c:\windows\my.db -Array -( - [phptype] => ifx - [dbsyntax] => ifx - [username] => - [password] => - [protocol] => tcp - [hostspec] => remote.host.com - [port] => - [socket] => - [database] => c:\windows\my.db -) -DSN: oci8://SHOOTOUT:******@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.101.161)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=TIS))) -Array -( - [phptype] => oci8 - [dbsyntax] => oci8 - [username] => SHOOTOUT - [password] => ****** - [protocol] => tcp - [hostspec] => (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.101.161)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=TIS))) - [port] => - [socket] => - [database] => -) -DSN: odbc(solid)://foo:bar@localhost:1313 -Array -( - [phptype] => odbc - [dbsyntax] => solid - [username] => foo - [password] => bar - [protocol] => tcp - [hostspec] => localhost - [port] => 1313 - [socket] => - [database] => -) -DSN: pgsql://user@unix()/pear -Array -( - [phptype] => pgsql - [dbsyntax] => pgsql - [username] => user - [password] => - [protocol] => unix - [hostspec] => - [port] => - [socket] => - [database] => pear -) -DSN: mysql://user@unix(/path/to/socket)/pear -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => user - [password] => - [protocol] => unix - [hostspec] => - [port] => - [socket] => /path/to/socket - [database] => pear -) -DSN: pgsql://user@tcp()/pear -Array -( - [phptype] => pgsql - [dbsyntax] => pgsql - [username] => user - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => pear -) -DSN: pgsql://user@tcp(somehost)/pear -Array -( - [phptype] => pgsql - [dbsyntax] => pgsql - [username] => user - [password] => - [protocol] => tcp - [hostspec] => somehost - [port] => - [socket] => - [database] => pear -) -DSN: pgsql://user:pass@word@tcp(somehost:7777)/pear -Array -( - [phptype] => pgsql - [dbsyntax] => pgsql - [username] => user - [password] => pass@word - [protocol] => tcp - [hostspec] => somehost - [port] => 7777 - [socket] => - [database] => pear -) -DSN: ibase://user:pass@localhost//var/lib/dbase.dbf?role=foo -Array -( - [phptype] => ibase - [dbsyntax] => ibase - [username] => user - [password] => pass - [protocol] => tcp - [hostspec] => localhost - [port] => - [socket] => - [database] => /var/lib/dbase.dbf - [role] => foo -) -DSN: dbase://@/?role=foo&dialect=bar -Array -( - [phptype] => dbase - [dbsyntax] => dbase - [username] => - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => - [role] => foo - [dialect] => bar -) -DSN: sqlite:////unix/path/to/database?option=value&anotheroption=anothervalue -Array -( - [phptype] => sqlite - [dbsyntax] => sqlite - [username] => - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => /unix/path/to/database - [option] => value - [anotheroption] => anothervalue -) -DSN: sqlite:///c:/win/path/to/database?option=value -Array -( - [phptype] => sqlite - [dbsyntax] => sqlite - [username] => - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => c:/win/path/to/database - [option] => value -) -DSN: mysql://username@hostspec -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => username - [password] => - [protocol] => tcp - [hostspec] => hostspec - [port] => - [socket] => - [database] => -) -DSN: mysql://hostspec/database -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => tcp - [hostspec] => hostspec - [port] => - [socket] => - [database] => database -) -DSN: mysql://hostspec -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => tcp - [hostspec] => hostspec - [port] => - [socket] => - [database] => -) -DSN: mysql:///database -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => tcp - [hostspec] => - [port] => - [socket] => - [database] => database -) -DSN: array -Array -( - [phptype] => mysql - [dbsyntax] => mysql - [username] => - [password] => - [protocol] => - [hostspec] => foobar - [port] => - [socket] => - [database] => -) diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/01connect.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/01connect.phpt deleted file mode 100644 index dbeae1e91..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/01connect.phpt +++ /dev/null @@ -1,76 +0,0 @@ ---TEST-- -DB_driver::connect ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- -toString()); - } - if (is_object($dbh)) { - print "$name is an object\n"; - } - switch ($dbh->phptype) { - case 'dbase': - if (is_int($dbh->connection)) { - print "$name is connected\n"; - } else { - print "$name NOT connected\n"; - } - break; - case 'mysqli': - if (is_a($dbh->connection, 'mysqli')) { - print "$name is connected\n"; - } else { - print "$name NOT connected\n"; - } - break; - default: - if (gettype($dbh->connection) == 'resource') { - print "$name is connected\n"; - } else { - print "$name NOT connected\n"; - } - } -} - - -check_dbh($dbh, '$dbh'); - - -$test_array_dsn = DB::parseDSN($dsn); -foreach ($test_array_dsn as $key => $value) { - if ($value === false) { - unset($test_array_dsn[$key]); - } -} - -$dbha =& DB::connect($test_array_dsn, $options); -check_dbh($dbha, '$dbha'); - - -$tmp = serialize($dbha); -$dbhu = unserialize($tmp); -check_dbh($dbhu, '$dbhu'); - -?> ---EXPECT-- -$dbh is an object -$dbh is connected -$dbha is an object -$dbha is connected -$dbhu is an object -$dbhu is connected diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/02fetch.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/02fetch.phpt deleted file mode 100644 index af6c39c28..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/02fetch.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -DB_driver::fetch ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -testing fetchrow: -row 1: 42, bing, This is a test, 1999-11-21 -row 2: 1, one, One, 2001-02-16 -row 3: 2, two, Two, 2001-02-15 -row 4: 3, three, Three, 2001-02-14 -row 5: NULL -testing fetchmodes: fetchrow default default, portability mode DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM -0 1 2 3 -output matched expected format -testing fetchmodes: fetchinto default default -0 1 2 3 -42 bing This is a test 1999-11-21 -testing fetchmodes: fetchrow ordered default -0 1 2 3 -testing fetchmodes: fetchrow assoc default -a b c d -testing fetchmodes: fetchrow ordered default with assoc specified -a b c d -testing fetchmodes: fetchrow assoc default with ordered specified -0 1 2 3 -testing fetchmodes: fetchinto ordered default -0 1 2 3 -testing fetchmodes: fetchinto assoc default -a b c d -testing fetchmodes: fetchinto ordered default with assoc specified -a b c d -testing fetchmodes: fetchinto assoc default with ordered specified -0 1 2 3 diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/03simplequery.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/03simplequery.phpt deleted file mode 100644 index c0b450ab0..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/03simplequery.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -DB_driver::simpleQuery ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -passed diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/04numcols.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/04numcols.phpt deleted file mode 100644 index f9a275af2..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/04numcols.phpt +++ /dev/null @@ -1,16 +0,0 @@ ---TEST-- -DB_driver::numCols ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -1 -2 -3 -4 diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/05sequences.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/05sequences.phpt deleted file mode 100644 index 17ec2f27f..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/05sequences.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -DB_driver::sequences ---INI-- -error_reporting = 2047 ---SKIPIF-- -dropSequence('ajkdslfajoijkadie'); -if (DB::isError($tableInfo) && $tableInfo->code == DB_ERROR_NOT_CAPABLE) { - die("skip $tableInfo->message"); -} -?> ---FILE-- - ---EXPECT-- -an error is the proper response here -an error cought by the error handler is good -a=1 -b=2 -b-a=1 -c=1 -d=1 -e=1 diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/06prepexec.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/06prepexec.phpt deleted file mode 100644 index 3feb0ebbf..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/06prepexec.phpt +++ /dev/null @@ -1,50 +0,0 @@ ---TEST-- -DB_driver::prepare/execute ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -------------1------------ -sth1,sth2,sth3,sth4 created -sth1: ? as param, passing as array... sth1 executed -sth2: ! and ? as params, passing as array... sth2 executed -sth3: ?, ! and & as params, passing as array... sth3 executed -sth4: no params... sth4 executed -results: -|72 - a - - | -|72 - direct - - | -|72 - it's good - opaque placeholder's test - | -|72 - that's right - - | - -------------2------------ -results: -|72 - set1 - opaque placeholder's test - 1234-56-78| -|72 - set2 - opaque placeholder's test - | -|72 - set3 - opaque placeholder's test - | - -------------3------------ -TRUE -FALSE - -------------4------------ -|72 - set1 - opaque placeholder's test - 1234-56-78| -|72 - set2 - opaque placeholder's test - | -|72 - set3 - opaque placeholder's test - | -~~ -~~ -|72 - set1 - opaque placeholder's test - 1234-56-78| -~~ -|72 - set1 - opaque placeholder's test - 1234-56-78| -|72 - set2 - opaque placeholder's test - | -|72 - set3 - opaque placeholder's test - | -~~ - -------------5------------ -insert: okay -a = 11, b = three, d = got expected outcome diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/08affectedrows.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/08affectedrows.phpt deleted file mode 100644 index 2624ac845..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/08affectedrows.phpt +++ /dev/null @@ -1,62 +0,0 @@ ---TEST-- -DB_driver::affectedRows ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- -setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -// Clean table -$dbh->query("DELETE FROM phptest"); - -// Affected rows by INSERT statement -$dbh->query("INSERT INTO phptest (a,b) VALUES(1, 'test')"); -$dbh->query("INSERT INTO phptest (a,b) VALUES(2, 'test')"); -printf("%d after insert\n", $dbh->affectedRows()); - -// Affected rows by SELECT statement -$dbh->query("SELECT * FROM phptest"); -printf("%d after select\n", $dbh->affectedRows()); -$dbh->query("DELETE FROM phptest WHERE b = 'test'"); -printf("%d after delete\n", $dbh->affectedRows()); - -// Affected rows by DELETE statement -$dbh->query("INSERT INTO phptest (a,b) VALUES(1, 'test')"); -$dbh->query("INSERT INTO phptest (a,b) VALUES(2, 'test')"); -$dbh->query("DELETE FROM phptest"); -printf("%d after delete all\n", $dbh->affectedRows()); - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); - -?> ---EXPECT-- -1 after insert -0 after select -2 after delete -2 after delete all diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/09numrows.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/09numrows.phpt deleted file mode 100644 index bc08f7763..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/09numrows.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -DB_driver::numRows ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -(want 1) got 1 from first -(want 2) got 2 from 0 -(want 3) got 3 from 1 -(want 4) got 4 from 2 -(want 5) got 5 from 3 -(want 6) got 6 from 4 -(want 5) got 5 from > 0 (passing params to query) -(want 4) got 4 from < 4 (doing prepare/execute) -(want 2) got 2 from 5 and 6 not deleted -(want 0) got 0 from < 0 diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/10errormap.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/10errormap.phpt deleted file mode 100644 index d953bef42..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/10errormap.phpt +++ /dev/null @@ -1,37 +0,0 @@ ---TEST-- -DB_driver::error mapping ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -DB_ERROR_NOSUCHTABLE for select: matches expected outcome -DB_ERROR_NOSUCHTABLE for drop: matches expected outcome -DB_ERROR_NOT_FOUND for drop index: matches expected outcome -DB_ERROR_ALREADY_EXISTS for create table: matches expected outcome -DB_ERROR_ALREADY_EXISTS for create index: matches expected outcome -DB_ERROR_CONSTRAINT for primary key insert duplicate: matches expected outcome -DB_ERROR_CONSTRAINT for primary key update duplicate: matches expected outcome -DB_ERROR_CONSTRAINT for unique key insert duplicate: matches expected outcome -DB_ERROR_CONSTRAINT for unique key update duplicate: matches expected outcome -DB_ERROR_CONSTRAINT for foreign key on insert: matches expected outcome -DB_ERROR_CONSTRAINT for foreign key on delete: matches expected outcome -DB_ERROR_CONSTRAINT_NOT_NULL on insert: matches expected outcome -DB_ERROR_CONSTRAINT_NOT_NULL on update: matches expected outcome -DB_ERROR_NOSUCHFIELD joining ON bogus column: matches expected outcome -DB_ERROR_NOSUCHFIELD joining USING bogus column: matches expected outcome -DB_ERROR_DIVZERO: matches expected outcome -DB_ERROR_INVALID_NUMBER putting chars in INT column: matches expected outcome -DB_ERROR_INVALID_NUMBER putting float in INT column: matches expected outcome -DB_ERROR_INVALID_NUMBER putting excessive int in INT column: matches expected outcome -DB_ERROR_INVALID_NUMBER putting int in CHAR column: matches expected outcome -DB_ERROR_NOSUCHFIELD: matches expected outcome -DB_ERROR_SYNTAX: matches expected outcome -DB_ERROR_VALUE_COUNT_ON_ROW: matches expected outcome -DB_ERROR_INVALID on CHAR column data too long: matches expected outcome -DB_ERROR_INVALID on VARCHAR column data too long: matches expected outcome diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/11transactions.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/11transactions.phpt deleted file mode 100644 index 888417df8..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/11transactions.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -DB_driver::transaction test ---INI-- -error_reporting = 2047 ---SKIPIF-- -features['transactions']) { - die('skip this driver does not support transactions'); -} -?> ---FILE-- - ---EXPECT-- -1) after autocommit: bing one. ops=ok -2) before commit: bing one two three. ops=ok -3) after commit: bing one two three. ops=ok -4) before rollback: bing one two three four five. ops=ok -5) after rollback: bing one two three. ops=ok -6) before autocommit+rollback: bing one two three six seven. ops=ok -7) after autocommit+rollback: bing one two three six seven. ops=ok -8) testing that select doesn't disturbe opcount: ok diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/13limit.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/13limit.phpt deleted file mode 100644 index 69bc5f2e2..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/13limit.phpt +++ /dev/null @@ -1,54 +0,0 @@ ---TEST-- -DB_driver::row limit ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -======= From: 0 || Number of rows to fetch: 10 ======= -1.- result 0 -2.- result 1 -3.- result 2 -4.- result 3 -5.- result 4 -6.- result 5 -7.- result 6 -8.- result 7 -9.- result 8 -10.- result 9 -======= From: 10 || Number of rows to fetch: 10 ======= -11.- result 10 -12.- result 11 -13.- result 12 -14.- result 13 -15.- result 14 -16.- result 15 -17.- result 16 -18.- result 17 -19.- result 18 -20.- result 19 -======= From: 20 || Number of rows to fetch: 10 ======= -21.- result 20 -22.- result 21 -23.- result 22 -24.- result 23 -25.- result 24 -26.- result 25 -27.- result 26 -28.- result 27 -29.- result 28 -30.- result 29 -======= From: 30 || Number of rows to fetch: 10 ======= -31.- result 30 -32.- result 31 -33.- result 32 -======= Passing $params || From: 11 || Number of rows to fetch: 3 ======= -12.- result 11 -13.- result 12 -14.- result 13 diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/14fetchmode_object.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/14fetchmode_object.phpt deleted file mode 100644 index fda4799d3..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/14fetchmode_object.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -DB_driver::fetchmode object ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - ---EXPECT-- ---- fetch with param DB_FETCHMODE_OBJECT --- -stdclass -> a b c d -stdclass -> a b c d ---- fetch with default fetchmode DB_FETCHMODE_OBJECT --- -stdclass -> a b c d -stdclass -> a b c d ---- fetch with default fetchmode DB_FETCHMODE_OBJECT and class DB_row --- -db_row -> a b c d -db_row -> a b c d ---- fetch with default fetchmode DB_FETCHMODE_OBJECT with no class then DB_row --- -stdclass -> a b c d -db_row -> a b c d diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/15quote.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/15quote.phpt deleted file mode 100644 index e80aaa979..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/15quote.phpt +++ /dev/null @@ -1,273 +0,0 @@ ---TEST-- -DB_driver::quote ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- -setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'pearquote'); - - die($o->toString()); -} - -// DBMS boolean column type simulation... -$boolean_col_type = array( - 'dbase' => 'Logical', - 'fbsql' => 'BOOLEAN', - 'ibase' => 'SMALLINT', - 'ifx' => 'SMALLINT', - 'msql' => 'INTEGER', - 'mssql' => 'BIT', - 'mysql' => 'TINYINT(1)', - 'mysqli' => 'TINYINT(1)', - 'oci8' => 'NUMBER(1)', - 'odbc' => 'SMALLINT', - 'pgsql' => 'BOOLEAN', - 'sqlite' => 'INTEGER', - 'sybase' => 'TINYINT', -); - -// adjust things for specific DBMS's - -if ($dbh->phptype == 'odbc') { - if ($dbh->dbsyntax == 'odbc') { - $type = $dbh->phptype; - } else { - $type = $dbh->dbsyntax; - } -} else { - $type = $dbh->phptype; -} - -switch ($type) { - case 'access': - $decimal = 'SINGLE'; - $null = ''; - $chr = 'VARCHAR(8)'; - $identifier = 'q\ut "dnt'; - break; - case 'db2': - case 'ibase': - $decimal = 'DECIMAL(3,1)'; - $null = ''; - $chr = 'VARCHAR(8)'; - $identifier = 'q\ut] "dn[t'; - break; - case 'ifx': - // doing this for ifx to keep certain versions happy - $decimal = 'DECIMAL(3,1)'; - $null = ''; - $chr = 'CHAR(8)'; - $identifier = ''; - break; - case 'msql': - $decimal = 'REAL'; - $null = ''; - $chr = 'CHAR(8)'; - $identifier = ''; - break; - case 'fbsql': - case 'oci8': - $decimal = 'DECIMAL(3,1)'; - $null = ''; - $chr = 'VARCHAR(8)'; - $identifier = 'q\ut] dn[t'; - break; - default: - $decimal = 'DECIMAL(3,1)'; - $null = 'NULL'; - $chr = 'VARCHAR(8)'; - $identifier = 'q\ut] "dn[t'; -} - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'pearquote'); - - -if ($identifier) { - switch ($dbh->phptype) { - case 'sybase': - $res = $dbh->query('set quoted_identifier on'); - if (DB::isError($res) ) { - pe($res); - } - break; - default: - } - $create = $dbh->query(" - CREATE TABLE pearquote ( - n $decimal $null, - s $chr $null, - " . $dbh->quoteIdentifier($identifier) . " $decimal $null, - b {$boolean_col_type[$dbh->phptype]} $null - ) - "); - - if (DB::isError($create) ) { - pe($create); - } - - $info = $dbh->tableInfo('pearquote'); - if (DB::isError($info) ) { - if ($info->code == DB_ERROR_NOT_CAPABLE) { - print "Got outcome expected from delimited identifier.\n"; - } else { - print "tableInfo() failed.\n"; - } - } else { - if ($identifier == $info[2]['name']) { - print "Got outcome expected from delimited identifier.\n"; - // print "COLUMN NAME IS: {$info[2]['name']}\n"; - } else { - print "Expected column name: '$identifier' ... "; - print "Actual column name: '{$info[2]['name']}'\n"; - } - } - -} else { - $dbh->query(" - CREATE TABLE pearquote ( - n $decimal $null, - s $chr $null, - plainidentifier $decimal $null, - b {$boolean_col_type[$dbh->phptype]} $null - ) - "); - print "Got outcome expected from delimited identifier.\n"; -} - - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$strings = array( - "'", - "\"", - "\\", - "%", - "_", - "''", - "\"\"", - "\\\\", - "\\'\\'", - "\\\"\\\"" -); - -$nums = array( - 12.3, - 15, -); - -$bools = array( - TRUE, - FALSE, -); - - -echo "String escape test: "; -foreach ($strings as $s) { - $quoted = $dbh->quoteSmart($s); - $dbh->query("INSERT INTO pearquote (s) VALUES ($quoted)"); -} -$diff = array_diff($strings, $res = $dbh->getCol("SELECT s FROM pearquote")); -if (count($diff) > 0) { - echo "FAIL"; - print_r($strings); - print_r($res); -} else { - echo "OK"; -} - -$dbh->query("DELETE FROM pearquote"); - - -echo "\nNumber escape test: "; -foreach ($nums as $n) { - $quoted = $dbh->quoteSmart($n); - $dbh->query("INSERT INTO pearquote (n) VALUES ($quoted)"); -} - -$diff = array(); -$res =& $dbh->getCol('SELECT n FROM pearquote ORDER BY n'); -foreach ($nums as $key => $val) { - if ($val != $res[$key]) { - $diff[] = "$val != {$res[$key]}"; - } -} - -if (count($diff) > 0) { - echo "FAIL\n"; - print_r($diff); -} else { - echo 'OK'; -} - -$dbh->query('DELETE FROM pearquote'); - - -echo "\nBoolean escape test: "; -$i = 1; -foreach ($bools as $b) { - $quoted = $dbh->quoteSmart($b); - $dbh->query("INSERT INTO pearquote (n, b) VALUES ($i, $quoted)"); - $i++; -} - -$diff = array(); -$res =& $dbh->getCol('SELECT b, n FROM pearquote ORDER BY n'); -foreach ($bools as $key => $val) { - if ($val === true) { - if ($res[$key] == 1 || $res[$key] == true || - substr(strtolower($res[$key]), 0, 1) == 't') - { - // good - } else { - $diff[] = "in:true != out:{$res[$key]}"; - } - } else { - if ($res[$key] == 0 || $res[$key] == false || - substr(strtolower($res[$key]), 0, 1) == 'f') - { - // good - } else { - $diff[] = "in:false != out:{$res[$key]}"; - } - } -} - -if (count($diff) > 0) { - echo "FAIL\n"; - print_r($diff); -} else { - echo "OK\n"; -} - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'pearquote'); - -?> ---EXPECT-- -Got outcome expected from delimited identifier. -String escape test: OK -Number escape test: OK -Boolean escape test: OK diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/16tableinfo.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/16tableinfo.phpt deleted file mode 100644 index fb2fe9509..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/16tableinfo.phpt +++ /dev/null @@ -1,1340 +0,0 @@ ---TEST-- -DB_driver::tableInfo ---INI-- -error_reporting = 2047 ---SKIPIF-- -$quirks array, which has the following format: - * - *
- * 'driver' => array(
- *     'clob' => DBMS's column type for creating CLOB fields
- *     'date' => DBMS's column type for creating DATE fields
- *     'dateliteral' => The SQL keyword necessary for defining dates
- *     'finds_table' => Can this DBMS determine table names from queries?
- *     'size_from_table' => Does this DBMS know the column size via table name?
- *     'handles_results' => Can the DBMS get info from query results?
- *     'commands' => array(
- *         Extra commands to be passed to PHP's eval() function
- *     )
- *     0 => array(
- *         //  Info expected to be reported for phptest_fk.a
- *         //  (INTEGER NOT NULL) (UNIQUE KEY with d)
- *         'type' => Column type reported by the DBMS
- *         'len' => Column size reported by the DBMS
- *         'flags' => Flags reported by the DBMS
- *     )
- *     1 => array()  Info expected to be reported for phptest_fk.fk
- *                   (INTEGER NOT NULL) (PRIMARY KEY)
- *     2 => array()  Info expected to be reported for phptest_fk.c
- *                   (CLOB/CHAR/VARCHAR NULL)
- *     3 => array()  Info expected to be reported for phptest_fk.d
- *                   (DATE NOT NULL) (UNIQUE KEY with a)
- *     4 => array()  Info expected to be reported for phptest_fk.e
- *                   (CHAR(2) DEFAULT ' e' NOT NULL)
- *     5 => array()  Info expected to be reported for phptest_fk.f
- *                   (DECIMAL(2,1) NULL)
- *     9 => array()  Info expected to be reported for phptest.d
- *                   (VARCHAR(20) NULL)
- * )
- * 
- * - * @category Database - * @package DB - * @version $Id: 16tableinfo.phpt,v 1.32 2005/02/14 17:04:17 danielc Exp $ - * @author Daniel Convissor - * @see DB_common::tableInfo() - */ - -error_reporting(E_ALL); -chdir(dirname(__FILE__)); -require_once './skipif.inc'; -$tableInfo = $db->tableInfo('ajkdslfajoijkadie'); -if (DB::isError($tableInfo) && $tableInfo->code == DB_ERROR_NOT_CAPABLE) { - die("skip $tableInfo->message"); -} - -?> ---FILE-- -getMessage() == "DB Error: can't distinguish duplicate field names") { - print "NOTICE: $dbh->phptype can't distinguish duplicate field names"; - return; - } - - if ($o->getCode() == DB_ERROR_NOT_CAPABLE && - !$quirks[$dbh->phptype . ':' . $dbh->dbsyntax]['handles_results']) - { - return; - } - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - drop_table($dbh, 'phptest_fk'); - - die($o->toString()); -} - -/** - * Loop through an array returned from tableInfo(), compare the actual - * contents to the expected contents. If the actual results match the - * expectations, say so. If not, say so and show the information. - * - * @param array $array the array to be examined - * @param string $expected the expected contents of the array - * @param string $field field index number of $quriks and table - * @param boolean $query true if array is from a query or false if array - * is tableInfo() - * @return void - */ -function examineArrayData($array, $expected, $field = false, $query = true) { - global $dbh, $quirks; - - $quirk_key = $dbh->phptype . ':' . $dbh->dbsyntax; - - if (DB::isError($array) && $array->getCode() == DB_ERROR_NOT_CAPABLE) { - print "matched expected result\n"; - return; - } - - if (!is_array($array)) { - print "This DMBS didn't produce proper results\n"; - return; - } - - if (is_int($field)) { - $array = $array[$field]; - } - - $actual = ''; - foreach ($array as $key => $value) { - if ($field !== false && - isset($quirks[$quirk_key][$field][$key])) - { - if ($key == 'flags' && $value == '' && $query && - !$quirks[$quirk_key]['finds_table']) - { - $actual .= "$key ... matched expected value\n"; - } else { - if ($quirks[$quirk_key][$field][$key] == $value) { - $actual .= "$key ... matched expected value\n"; - } else { - if ($value == 0 - && !$quirks[$quirk_key]['size_from_table']) - { - $actual .= "$key ... matched expected value\n"; - } else { - $actual .= "$key ... was '$value' but we expected "; - $actual .= "'{$quirks[$quirk_key][$field][$key]}'\n"; - } - } - } - } else { - if ($key == 'table') { - if ($field <= 5) { - if ($value == 'phptest_fk') { - $actual .= "$key ... matched expected value\n"; - } else { - if ($value == '' && $query && - !$quirks[$quirk_key]['finds_table']) - { - $actual .= "$key ... matched expected value\n"; - } else { - $actual .= "$key ... was '$value' but we expected 'phptest_fk'\n"; - } - } - } else { - if ($value == 'phptest') { - $actual .= "$key ... matched expected value\n"; - } else { - if ($value == '' && $query && - !$quirks[$quirk_key]['finds_table']) - { - $actual .= "$key ... matched expected value\n"; - } else { - $actual .= "$key ... was '$value' but we expected 'phptest_fk'\n"; - } - } - } - } else { - $actual .= "$key => $value\n"; - } - } - } - if ($actual == $expected) { - print "matched expected result\n"; - } else { - print "DIDN'T match expected values...\n"; - print "~~~~~~~~\nExpected:\n$expected\n"; - print "~~~~\nActual:\n$actual\n~~~~~~~~\n\n"; - } -} - -/** - * Loop through an array of table info data and return the results. - * - * @param array $array the array to be examined - * @return string - */ -function returnArrayData($array) { - global $dbh, $quirks; - - $quirk_key = $dbh->phptype . ':' . $dbh->dbsyntax; - - if (!$quirks[$quirk_key]['handles_results']) { - return "\n"; - } - - $out = ''; - foreach ($array as $key => $value) { - $out .= "$key => $value\n"; - } - return $out; -} - - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$quirks = array( - 'fbsql:fbsql' => array( - 'clob' => 'CHAR(29)', - 'date' => 'DATE', - 'dateliteral' => ' DATE ', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'INTEGER', - 'len' => 0, - 'flags' => '', - ), - 1 => array( - 'type' => 'INTEGER', - 'len' => 0, - 'flags' => 'not_null', - ), - 2 => array( - 'type' => 'CHARACTER', - 'len' => 29, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATE', - 'len' => 0, - 'flags' => '', - ), - 4 => array( - 'type' => 'CHARACTER', - 'len' => 2, - 'flags' => '', - ), - 5 => array( - 'type' => 'DECIMAL', - 'len' => 0, - 'flags' => '', - ), - 9 => array( - 'type' => 'CHARACTER', - 'len' => 20, - 'flags' => '', - ), - ), - - 'ibase:ibase' => array( - 'clob' => 'VARCHAR(50)', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'INTEGER', - 'len' => 4, - 'flags' => 'unique_key not_null', - ), - 1 => array( - 'type' => 'INTEGER', - 'len' => 4, - 'flags' => 'primary_key not_null', - ), - 2 => array( - 'type' => 'VARCHAR', - 'len' => 50, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATE', - 'len' => 4, - 'flags' => 'unique_key not_null', - ), - 4 => array( - 'type' => 'CHAR', - 'len' => 2, - 'flags' => 'not_null default', - ), - 5 => array( - 'type' => 'NUMERIC(9,1)', - 'len' => 4, - 'flags' => '', - ), - 9 => array( - 'type' => 'VARCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'ibase:firebird' => array( - 'clob' => 'VARCHAR(50)', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'INTEGER', - 'len' => 4, - 'flags' => 'unique_key not_null', - ), - 1 => array( - 'type' => 'INTEGER', - 'len' => 4, - 'flags' => 'primary_key not_null', - ), - 2 => array( - 'type' => 'VARCHAR', - 'len' => 50, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATE', - 'len' => 4, - 'flags' => 'unique_key not_null', - ), - 4 => array( - 'type' => 'CHAR', - 'len' => 2, - 'flags' => 'not_null default', - ), - 5 => array( - 'type' => 'NUMERIC(9,1)', - 'len' => 4, - 'flags' => '', - ), - 9 => array( - 'type' => 'VARCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'ifx:ifx' => array( - 'clob' => 'CHAR(29)', - 'date' => 'CHAR(10)', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'SQLINT', - 'len' => 4, - 'flags' => 'not_null', - ), - 1 => array( - 'type' => 'SQLINT', - 'len' => 4, - 'flags' => 'not_null', - ), - 2 => array( - 'type' => 'SQLCHAR', - 'len' => 29, - 'flags' => '', - ), - 3 => array( - 'type' => 'SQLCHAR', - 'len' => 10, - 'flags' => 'not_null', - ), - 4 => array( - 'type' => 'SQLCHAR', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'SQLDECIMAL', - 'len' => 513, - 'flags' => '', - ), - 9 => array( - 'type' => 'SQLCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'msql:msql' => array( - 'clob' => 'TEXT(255)', - 'date' => 'CHAR(10)', - 'dateliteral' => '', - 'finds_table' => true, - 'size_from_table' => true, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'int', - 'len' => 4, - 'flags' => 'not_null', - ), - 1 => array( - 'type' => 'int', - 'len' => 4, - // for some reason, the unique property always contains 0 - // 'flags' => 'unique_key not_null', - 'flags' => 'not_null', - ), - 2 => array( - 'type' => 'text', - 'len' => 255, - 'flags' => '', - ), - 3 => array( - 'type' => 'char', - 'len' => 10, - 'flags' => 'not_null', - ), - 4 => array( - 'type' => 'char', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'real', - 'len' => 8, - 'flags' => '', - ), - 9 => array( - 'type' => 'char', - 'len' => 20, - 'flags' => '', - ), - ), - - 'mssql:mssql' => array( - 'clob' => 'TEXT', - 'date' => 'SMALLDATETIME', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - 'ini_set("mssql.datetimeconvert", "Off");', - '$dbh->query("SET DATEFORMAT ymd");', - ), - 0 => array( - 'type' => 'int', - 'len' => 4, - 'flags' => 'multiple_key unique_key not_null', - ), - 1 => array( - 'type' => 'int', - 'len' => 4, - 'flags' => 'primary_key not_null', - ), - 2 => array( - 'type' => 'text', - 'len' => 4096, - 'flags' => '', - ), - 3 => array( - 'type' => 'datetime', - 'len' => 4, - 'flags' => 'multiple_key unique_key not_null', - ), - 4 => array( - 'type' => 'char', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'real', - 'len' => 19, - 'flags' => '', - ), - 9 => array( - 'type' => 'char', - 'len' => 20, - 'flags' => '', - ), - ), - - 'mysql:mysql' => array( - 'clob' => 'TEXT', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => true, - 'size_from_table' => true, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'int', - 'len' => 11, - 'flags' => 'not_null multiple_key', - ), - 1 => array( - 'type' => 'int', - 'len' => 11, - 'flags' => 'not_null primary_key', - ), - 2 => array( - 'type' => 'blob', - 'len' => 65535, - 'flags' => 'blob', - ), - 3 => array( - 'type' => 'date', - 'len' => 10, - 'flags' => 'not_null multiple_key', - ), - 4 => array( - 'type' => 'string', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'real', - 'len' => 4, - 'flags' => '', - ), - 9 => array( - 'type' => 'string', - 'len' => 20, - 'flags' => '', - ), - ), - - 'mysqli:mysqli' => array( - 'clob' => 'TEXT', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => true, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'int', - 'len' => 2, - 'flags' => 'not_null multiple_key group_by', - ), - 1 => array( - 'type' => 'int', - 'len' => 0, - 'flags' => 'not_null primary_key group_by', - ), - 2 => array( - 'type' => 'blob', - 'len' => 0, - 'flags' => 'blob', - ), - 3 => array( - 'type' => 'date', - 'len' => 10, - 'flags' => 'not_null multiple_key', - ), - 4 => array( - 'type' => 'char', - 'len' => 0, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'decimal', - 'len' => 0, - 'flags' => 'group_by', - ), - 9 => array( - 'type' => 'varchar', - 'len' => 10, - 'flags' => '', - ), - ), - - 'oci8:oci8' => array( - 'clob' => 'CLOB', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - '$dbh->query("ALTER SESSION SET NLS_DATE_FORMAT = \'YYYY-MM-DD\'");', - ), - 0 => array( - 'type' => 'NUMBER', - 'len' => 22, - 'flags' => 'not_null', - ), - 1 => array( - 'type' => 'NUMBER', - 'len' => 22, - 'flags' => 'not_null', - ), - 2 => array( - 'type' => 'CLOB', - 'len' => 4000, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATE', - 'len' => 7, - 'flags' => 'not_null', - ), - 4 => array( - 'type' => 'CHAR', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'NUMBER', - 'len' => 22, - 'flags' => '', - ), - 9 => array( - 'type' => 'VARCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'odbc:access' => array( - 'clob' => 'TEXT', - 'date' => 'DATETIME', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'INTEGER', - 'len' => 10, - 'flags' => 'not_null', - ), - 1 => array( - 'type' => 'INTEGER', - 'len' => 10, - 'flags' => 'not_null', - ), - 2 => array( - 'type' => 'LONGCHAR', - 'len' => 255, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATETIME', - 'len' => 19, - 'flags' => 'not_null', - ), - 4 => array( - 'type' => 'VARCHAR', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'DECIMAL', - 'len' => 15, - 'flags' => '', - ), - 9 => array( - 'type' => 'VARCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'odbc:db2' => array( - 'clob' => 'CLOB', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - ), - 0 => array( - 'type' => 'INTEGER', - 'len' => 10, - 'flags' => 'not_null', - ), - 1 => array( - 'type' => 'INTEGER', - 'len' => 10, - 'flags' => 'not_null', - ), - 2 => array( - 'type' => 'CLOB', - 'len' => 1048576, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATE', - 'len' => 10, - 'flags' => 'not_null', - ), - 4 => array( - 'type' => 'CHAR', - 'len' => 2, - 'flags' => 'not_null', - ), - 5 => array( - 'type' => 'DECIMAL', - 'len' => 2, - 'flags' => '', - ), - 9 => array( - 'type' => 'VARCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'pgsql:pgsql' => array( - 'clob' => 'TEXT', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - '$dbh->query("SET DATESTYLE = ISO");', - ), - 0 => array( - 'type' => 'int4', - 'len' => 4, - 'flags' => 'not_null unique_key multiple_key', - ), - 1 => array( - 'type' => 'int4', - 'len' => 4, - 'flags' => 'not_null primary_key', - ), - 2 => array( - 'type' => 'text', - 'len' => -1, - 'flags' => '', - ), - 3 => array( - 'type' => 'date', - 'len' => 4, - 'flags' => 'not_null unique_key multiple_key', - ), - 4 => array( - 'type' => 'bpchar', - 'len' => -1, - 'flags' => 'not_null default_%20e', - ), - 5 => array( - 'type' => 'numeric', - 'len' => -1, - 'flags' => '', - ), - 9 => array( - 'type' => 'varchar', - 'len' => -1, - 'flags' => '', - ), - ), - - 'sqlite:sqlite' => array( - 'clob' => 'CLOB', - 'date' => 'DATE', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => false, - 'commands' => array( - ), - 0 => array( - 'type' => 'INTEGER', - 'len' => 0, - 'flags' => 'not_null', - ), - 1 => array( - 'type' => 'INTEGER', - 'len' => 0, - 'flags' => 'primary_key not_null', - ), - 2 => array( - 'type' => 'CLOB', - 'len' => 0, - 'flags' => '', - ), - 3 => array( - 'type' => 'DATE', - 'len' => 0, - 'flags' => 'not_null', - ), - 4 => array( - 'type' => 'CHAR', - 'len' => 2, - 'flags' => 'not_null default_%20e', - ), - 5 => array( - 'type' => 'DECIMAL', - 'len' => 2, - 'flags' => '', - ), - 9 => array( - 'type' => 'VARCHAR', - 'len' => 20, - 'flags' => '', - ), - ), - - 'sybase:sybase' => array( - 'clob' => 'TEXT', - 'date' => 'SMALLDATETIME', - 'dateliteral' => '', - 'finds_table' => false, - 'size_from_table' => false, - 'handles_results' => true, - 'commands' => array( - '$dbh->query("SET DATEFORMAT ymd");', - ), - 0 => array( - 'type' => 'int', - 'len' => 11, - 'flags' => 'multiple_key unique_key', - ), - 1 => array( - 'type' => 'int', - 'len' => 11, - 'flags' => 'unique_key', - ), - 2 => array( - 'type' => 'string', - 'len' => 32768, - 'flags' => '', - ), - 3 => array( - 'type' => 'datetime', - 'len' => 29, - 'flags' => 'multiple_key unique_key', - ), - 4 => array( - 'type' => 'string', - 'len' => 2, - 'flags' => '', - ), - 5 => array( - 'type' => 'real', - 'len' => 4, - 'flags' => '', - ), - 9 => array( - 'type' => 'string', - 'len' => 20, - 'flags' => '', - ), - ), -); - - -$quirk_key = $dbh->phptype . ':' . $dbh->dbsyntax; - -if (!isset($quirks[$quirk_key])) { - die("This test does not yet support $quirk_key"); -} - -if (count($quirks[$quirk_key]['commands'])) { - foreach ($quirks[$quirk_key]['commands'] as $value) { - eval($value); - } -} - - -$dbh->query('DELETE FROM phptest'); -$dbh->query("INSERT INTO phptest VALUES (1, 'one', 'One', '2001-02-16')"); -$dbh->query("INSERT INTO phptest VALUES (2, 'two', 'Two', '2001-02-15')"); -$dbh->query("INSERT INTO phptest VALUES (3, 'three', 'Three', '2001-02-14')"); - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest_fk'); -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -if ($quirk_key == 'odbc:access') { - $default_e = ''; - $decimal = 'NUMERIC'; -} elseif ($quirk_key == 'msql:msql') { - $default_e = ''; - $decimal = 'REAL'; -} else { - $default_e = "DEFAULT ' e'"; - $decimal = 'DECIMAL(2,1)'; -} - -// $null is set in mktable.inc - -switch ($dbh->phptype) { - case 'msql': - $dbh->query(" - CREATE TABLE phptest_fk ( - a INTEGER NOT NULL, - fk INTEGER NOT NULL, - c {$quirks[$quirk_key]['clob']} $null, - d {$quirks[$quirk_key]['date']} NOT NULL, - e CHAR(2) $default_e NOT NULL, - f $decimal $null - ) - "); - $dbh->query('CREATE UNIQUE INDEX fkpk ON phptest_fk (fk)'); - $dbh->query('CREATE UNIQUE INDEX fkuk ON phptest_fk (a, d)'); - break; - default: - $dbh->query(" - CREATE TABLE phptest_fk ( - a INTEGER NOT NULL, - fk INTEGER NOT NULL, - c {$quirks[$quirk_key]['clob']} $null, - d {$quirks[$quirk_key]['date']} NOT NULL, - e CHAR(2) $default_e NOT NULL, - f $decimal $null, - PRIMARY KEY (fk), - UNIQUE (a, d) - ) - "); -} - -$dbh->query("CREATE INDEX thedidx ON phptest_fk (d)"); -$dbh->query("INSERT INTO phptest_fk VALUES (10, 1, 'One'," - . $quirks[$quirk_key]['dateliteral'] . "'2001-02-16', 'c1', 1.1)"); -$dbh->query("INSERT INTO phptest_fk VALUES (20, 2, 'Two'," - . $quirks[$quirk_key]['dateliteral'] . "'2001-02-15', 'c2', 2.2)"); -$dbh->query("INSERT INTO phptest_fk VALUES (30, 3, 'Three'," - . $quirks[$quirk_key]['dateliteral'] . "'2001-02-14', 'c3', 3.3)"); - -function &runQuery() { - global $dbh, $resultobj; - - $quirk_key = $dbh->phptype . ':' . $dbh->dbsyntax; - - switch ($quirk_key) { - case 'odbc:db2': - // can't extract blob's this way so make a fake column - $query = "SELECT phptest_fk.a, phptest_fk.fk, 'tempxyz' AS c," - . ' phptest_fk.d, phptest_fk.e, phptest_fk.f,' - . ' phptest.a, phptest.b, phptest.c, phptest.d' - . ' FROM phptest_fk, phptest' - . ' WHERE phptest.a = phptest_fk.fk'; - break; - case 'msql:msql': - $query = 'SELECT phptest_fk.a, phptest_fk.fk, phptest_fk.c,' - . ' phptest_fk.d, phptest_fk.e, phptest_fk.f,' - . ' phptest.a, phptest.b, phptest.c, phptest.d' - . ' FROM phptest_fk, phptest' - . ' WHERE phptest.a = phptest_fk.fk'; - break; - default: - $query = 'SELECT phptest_fk.a, phptest_fk.fk, phptest_fk.c,' - . ' phptest_fk.d, phptest_fk.e, phptest_fk.f,' - . ' phptest.a, phptest.b, phptest.c, phptest.d' - . ' FROM phptest_fk, phptest' - . ' WHERE phptest.a = phptest_fk.fk'; - } - $resultobj =& $dbh->query($query); - return $resultobj; -} - - -$expected01 = 'table ... matched expected value -name => a -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - -$expected02 = 'table ... matched expected value -name => fk -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - -$expected03 = 'table ... matched expected value -name => c -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - -$expected04 = 'table ... matched expected value -name => d -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - -$expected05 = 'table ... matched expected value -name => e -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - -$expected06 = 'table ... matched expected value -name => f -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - -$expected10 = 'table ... matched expected value -name => d -type ... matched expected value -len ... matched expected value -flags ... matched expected value -'; - - - -print "\n==========================================\n"; -print "Passing result OBJECT to method in DB_.\n"; -print "Output = default.\n"; -print "------------------------------------------\n"; -$resultobj =& runQuery(); -$array = $dbh->tableInfo($resultobj); - -print "\ncolumn 0:\n"; -examineArrayData($array, $expected01, 0); - -print "\ncolumn 9:\n"; -examineArrayData($array, $expected10, 9); - - -print "\n==========================================\n"; -print "Passing result ID to method in DB_.\n"; -print "Output = DB_TABLEINFO_ORDER.\n"; -print "------------------------------------------\n"; -$resultobj =& runQuery(); -$array = $dbh->tableInfo($resultobj->result, DB_TABLEINFO_ORDER); - -print "\ncolumn 0:\n"; -examineArrayData($array, $expected01, 0); - -print "\ncolumn 3:\n"; -examineArrayData($array, $expected04, 3); - -print "\nnum_fields: "; -if ($quirks[$quirk_key]['handles_results'] && $array['num_fields'] == 10) { - print "matched expected result\n"; -} elseif (DB::isError($array) && $array->getCode() == DB_ERROR_NOT_CAPABLE) { - print "matched expected result\n"; -} else { - print "This DMBS didn't produce proper results\n"; -} - -print "\norder:\n"; -if ($quirks[$quirk_key]['handles_results'] && is_array($array['order'])) { - $expected = 'a => 6 -b => 7 -c => 8 -d => 9 -e => 4 -f => 5 -fk => 1 -'; - ksort($array['order']); - examineArrayData($array['order'], $expected); -} elseif (DB::isError($array) && $array->getCode() == DB_ERROR_NOT_CAPABLE) { - print "matched expected result\n"; -} else { - print "This DMBS didn't produce proper results\n"; -} - - - -print "\n==========================================\n"; -print "Passing DB_TABLEINFO_ORDERTABLE to method in DB_result.\n"; -print "Output = DB_TABLEINFO_ORDERTABLE.\n"; -print "------------------------------------------\n"; -$resultobj =& runQuery(); -$array = $resultobj->tableInfo(DB_TABLEINFO_ORDERTABLE); -// Free this to keep interbase happy. -$resultobj->free(); - -print "\ncolumn 0:\n"; -examineArrayData($array, $expected01, 0); - -print "\ncolumn 3:\n"; -examineArrayData($array, $expected04, 3); - -print "\nnum_fields: "; -if ($quirks[$quirk_key]['handles_results'] && $array['num_fields'] == 10) { - print "matched expected result\n"; -} elseif (DB::isError($array) && $array->getCode() == DB_ERROR_NOT_CAPABLE) { - print "matched expected result\n"; -} else { - print "This DMBS didn't produce proper results\n"; -} - - -print 'ordertable[phptest]: '; -$expected = 'a => 6 -b => 7 -c => 8 -d => 9 -'; -if ($quirks[$quirk_key]['handles_results'] - && isset($array['ordertable']['phptest'])) { - $actual = returnArrayData($array['ordertable']['phptest']); -} else { - $actual = ''; -} -if ($actual == $expected) { - print "matched expected result\n"; -} else { - if (($quirks[$quirk_key]['finds_table'] === false - || DB::isError($array) && $array->getCode() == DB_ERROR_NOT_CAPABLE) - && $actual == '') { - print "matched expected result\n"; - } else { - print "DIDN'T match expected values...\n"; - print "~~~~~~~~\nExpected:\n$expected\n"; - print "~~~~\nActual:\n$actual\n~~~~~~~~\n\n"; - } -} - - -print 'ordertable[phptest_fk]: '; -$expected = 'a => 0 -fk => 1 -c => 2 -d => 3 -e => 4 -f => 5 -'; -if ($quirks[$quirk_key]['handles_results'] - && isset($array['ordertable']['phptest_fk'])) { - $actual = returnArrayData($array['ordertable']['phptest_fk']); -} else { - $actual = ''; -} -if ($actual == $expected) { - print "matched expected result\n"; -} else { - if (($quirks[$quirk_key]['finds_table'] === false - || DB::isError($array) && $array->getCode() == DB_ERROR_NOT_CAPABLE) - && $actual == '') { - print "matched expected result\n"; - } else { - print "DIDN'T match expected values...\n"; - print "~~~~~~~~\nExpected:\n$expected\n"; - print "~~~~\nActual:\n$actual\n~~~~~~~~\n\n"; - } -} - - -print "\n==========================================\n"; -print "Passing TABLE NAME 'phptest_fk' to method in DB_.\n"; -print "Output = default.\n"; -print "------------------------------------------\n"; -$array = $dbh->tableInfo('phptest_fk'); - -print "\ncolumn 0:\n"; -examineArrayData($array, $expected01, 0, false); - -print "\ncolumn 1:\n"; -examineArrayData($array, $expected02, 1, false); - -print "\ncolumn 2:\n"; -examineArrayData($array, $expected03, 2, false); - -print "\ncolumn 3:\n"; -examineArrayData($array, $expected04, 3, false); - -print "\ncolumn 4:\n"; -examineArrayData($array, $expected05, 4, false); - -print "\ncolumn 5:\n"; -examineArrayData($array, $expected06, 5, false); - - -print "\n==========================================\n"; -print "Passing TABLE NAME 'phptest_fk' to method in DB_.\n"; -print "Output = DB_TABLEINFO_FULL.\n"; -print "------------------------------------------\n"; -$array = $dbh->tableInfo('phptest_fk', DB_TABLEINFO_FULL); - -print "\ncolumn 0:\n"; -examineArrayData($array, $expected01, 0, false); - -print "\norder:\n"; -$expect ='a => 0 -fk => 1 -c => 2 -d => 3 -e => 4 -f => 5 -'; -examineArrayData($array['order'], $expect, false, false); - -print "\nordertable[phptest_fk]:\n"; -$expect ='a => 0 -fk => 1 -c => 2 -d => 3 -e => 4 -f => 5 -'; -examineArrayData($array['ordertable']['phptest_fk'], $expect); - - - -print "\n==========================================\n"; -print "Passing TABLE NAME 'phptest_fk' to method in DB_ AGAIN.\n"; -print "Output = DB_TABLEINFO_FULL, lowercasing turned off.\n"; -print "------------------------------------------\n"; -$dbh->setOption('portability', DB_PORTABILITY_ALL ^ DB_PORTABILITY_LOWERCASE); -$array = $dbh->tableInfo('phptest_fk', DB_TABLEINFO_FULL); - -// testing non-lowercasing above to ensure program doesn't die. -// lowercase the names here to ensure test uniformity. -$array[0]['table'] = strtolower($array[0]['table']); -$array[0]['name'] = strtolower($array[0]['name']); - -print "\ncolumn 0:\n"; -examineArrayData($array, 0, false); - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); -drop_table($dbh, 'phptest_fk'); - -?> ---EXPECT-- -========================================== -Passing result OBJECT to method in DB_. -Output = default. ------------------------------------------- - -column 0: -matched expected result - -column 9: -matched expected result - -========================================== -Passing result ID to method in DB_. -Output = DB_TABLEINFO_ORDER. ------------------------------------------- - -column 0: -matched expected result - -column 3: -matched expected result - -num_fields: matched expected result - -order: -matched expected result - -========================================== -Passing DB_TABLEINFO_ORDERTABLE to method in DB_result. -Output = DB_TABLEINFO_ORDERTABLE. ------------------------------------------- - -column 0: -matched expected result - -column 3: -matched expected result - -num_fields: matched expected result -ordertable[phptest]: matched expected result -ordertable[phptest_fk]: matched expected result - -========================================== -Passing TABLE NAME 'phptest_fk' to method in DB_. -Output = default. ------------------------------------------- - -column 0: -matched expected result - -column 1: -matched expected result - -column 2: -matched expected result - -column 3: -matched expected result - -column 4: -matched expected result - -column 5: -matched expected result - -========================================== -Passing TABLE NAME 'phptest_fk' to method in DB_. -Output = DB_TABLEINFO_FULL. ------------------------------------------- - -column 0: -matched expected result - -order: -matched expected result - -ordertable[phptest_fk]: -matched expected result - -========================================== -Passing TABLE NAME 'phptest_fk' to method in DB_ AGAIN. -Output = DB_TABLEINFO_FULL, lowercasing turned off. ------------------------------------------- - -column 0: -matched expected result diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/17query.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/17query.phpt deleted file mode 100644 index 4cbd33399..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/17query.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -DB_driver::query ---INI-- -error_reporting = 2047 ---SKIPIF-- - - * @internal - */ - -chdir(dirname(__FILE__)); -require_once './skipif.inc'; - -?> ---FILE-- -setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$dbh->setFetchMode(DB_FETCHMODE_ASSOC); - - -$res =& $dbh->query('DELETE FROM phptest WHERE a = 17'); -print '1) delete: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - -$res =& $dbh->query("INSERT INTO phptest (a, b, c) VALUES (17, 'one', 'One')"); -print '2) insert: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - -$res =& $dbh->query('INSERT INTO phptest (a, b, c) VALUES (?, ?, ?)', array(17, 'two', 'Two')); -print '3) insert: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - - -$res =& $dbh->query('SELECT a, b FROM phptest WHERE a = 17'); -$row = $res->fetchRow(); -print "4) a = {$row['a']}, b = {$row['b']}\n"; -$res->free(); // keep fbsql happy. - -$res =& $dbh->query('SELECT a, b FROM phptest WHERE c = ?', array('Two')); -$row = $res->fetchRow(); -print "5) a = {$row['a']}, b = {$row['b']}\n"; - - -$array = array( - 'foo' => 11, - 'bar' => 'three', - 'baz' => null, -); -$res =& $dbh->query('INSERT INTO phptest (a, b, d) VALUES (?, ?, ?)', $array); -print '6) insert: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - -$res =& $dbh->query('SELECT a, b, d FROM phptest WHERE a = ?', 11); -$row = $res->fetchRow(); -print "7) a = {$row['a']}, b = {$row['b']}, d = "; -if ($dbh->phptype == 'msql') { - if (array_key_exists('d', $row)) { - $type = gettype($row['d']); - if ($type == 'NULL' || $row['d'] == '') { - print "got expected value\n"; - } else { - print "ERR: expected d's type to be NULL but it's $type and the value is "; - print $row['d'] . "\n"; - } - } else { - // http://bugs.php.net/?id=31960 - print "Prior to PHP 4.3.11 or 5.0.4, PHP's msql extension silently" - . " dropped columns with null values. You need to upgrade.\n"; - } -} else { - $type = gettype($row['d']); - if ($type == 'NULL' || $row['d'] == '') { - print "got expected value\n"; - } else { - print "ERR: expected d's type to be NULL but it's $type and the value is "; - print $row['d'] . "\n"; - } -} - - -$res =& $dbh->query('DELETE FROM phptest WHERE a = ?', array(17)); -print '8) delete: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - -$res =& $dbh->query('DELETE FROM phptest WHERE a = ?', array(0)); -print '9) delete with array(0) as param: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - -$res =& $dbh->query('DELETE FROM phptest WHERE a = ?', 0); -print '10) delete with 0 as param: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); - -?> ---EXPECT-- -1) delete: okay -2) insert: okay -3) insert: okay -4) a = 17, b = one -5) a = 17, b = two -6) insert: okay -7) a = 11, b = three, d = got expected value -8) delete: okay -9) delete with array(0) as param: okay -10) delete with 0 as param: okay diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/18get.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/18get.phpt deleted file mode 100644 index 36c8355f0..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/18get.phpt +++ /dev/null @@ -1,661 +0,0 @@ ---TEST-- -DB_driver::get ---INI-- -error_reporting = 2047 ---SKIPIF-- - - * @internal - */ - -chdir(dirname(__FILE__)); -require_once './skipif.inc'; - -?> ---FILE-- -phptest table. - */ -require_once './mktable.inc'; - - -/** - * Local error callback handler. - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o){ - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$dbh->query("INSERT INTO phptest VALUES (2, 'two', 'Two', '2002-02-22')"); -$dbh->query("INSERT INTO phptest VALUES (42, 'three', 'Three', '2003-03-23')"); - - -print "===================================================\n"; -print 'testing getOne: '; -$ret =& $dbh->getOne("SELECT * FROM phptest WHERE c = 'Two'"); -print_r($ret); -print "\n"; - -print 'testing getOne with string params: '; -$ret =& $dbh->getOne('SELECT * FROM phptest WHERE c = ?', 'Three'); -print_r($ret); -print "\n"; - -print 'testing getOne with array params: '; -$ret =& $dbh->getOne('SELECT * FROM phptest WHERE c = ?', array('Two')); -print_r($ret); -print "\n"; - -print "\n===================================================\n"; -print "testing getRow:\n"; -$ret =& $dbh->getRow("SELECT * FROM phptest WHERE c = 'Two'"); -print_r($ret); - -print "testing getRow with null params, DB_FETCHMODE_ORDERED:\n"; -$ret =& $dbh->getRow("SELECT * FROM phptest WHERE c = 'Two'", - null, DB_FETCHMODE_ORDERED); -print_r($ret); - -// THIS DOESN'T WORK DUE TO BACKWARDS COMPATIBILITY CRAP -// print "testing getRow with string params, DB_FETCHMODE_ORDERED:\n"; -// $ret =& $dbh->getRow('SELECT * FROM phptest WHERE c = ?', -// 'Two', DB_FETCHMODE_ORDERED); -// print_r($ret); -// -// testing getRow with string params, DB_FETCHMODE_ORDERED: -// Array -// ( -// [0] => 2 -// [1] => two -// [2] => Two -// [3] => 2002-02-22 -// ) - - print "testing getRow with REVERSED args: DB_FETCHMODE_ASSOC, array params:\n"; - $ret =& $dbh->getRow('SELECT * FROM phptest WHERE c = ?', - DB_FETCHMODE_ASSOC, array('Two')); - print_r($ret); - - print "testing getRow with REVERSED args: DB_FETCHMODE_ASSOC:\n"; - $ret =& $dbh->getRow("SELECT * FROM phptest WHERE c = 'Two'", - DB_FETCHMODE_ASSOC); - print_r($ret); - -print "testing getRow with array params, DB_FETCHMODE_ASSOC:\n"; -$ret =& $dbh->getRow('SELECT * FROM phptest WHERE c = ?', - array('Two'), DB_FETCHMODE_ASSOC); -print_r($ret); - -print "testing getRow with array params, DB_FETCHMODE_OBJECT:\n"; -$ret =& $dbh->getRow('SELECT * FROM phptest WHERE c = ?', - array('Two'), DB_FETCHMODE_OBJECT); -print_r($ret); - - -print "\n===================================================\n"; -print "testing getCol:\n"; -$ret =& $dbh->getCol("SELECT * FROM phptest ORDER BY b"); -print_r($ret); - -print "testing getCol on query with no records:\n"; -$ret =& $dbh->getCol('SELECT * FROM phptest WHERE a > 200'); -print_r($ret); - -print "testing getCol with invalid column id:\n"; -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -$ret =& $dbh->getCol('SELECT b FROM phptest ORDER BY b', 1); -if (DB::isError($ret)) { - echo $ret->getMessage() . "\n"; -} else { - print ">> Should have produced 'no such field' error\n"; -} -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - -print "testing getCol with 1 col:\n"; -$ret =& $dbh->getCol("SELECT * FROM phptest ORDER BY b", 1); -print_r($ret); - -print "testing getCol with b col:\n"; -$ret =& $dbh->getCol("SELECT * FROM phptest ORDER BY b", 'b'); -print_r($ret); - -print "testing getCol with b col, scalar params:\n"; -$ret =& $dbh->getCol("SELECT * FROM phptest WHERE a < ? ORDER BY b", - 'b', 100); -print_r($ret); - -print "testing getCol with b col, array params:\n"; -$ret =& $dbh->getCol("SELECT * FROM phptest WHERE a < ? ORDER BY b", - 'b', array(100)); -print_r($ret); - - -print "\n===================================================\n"; -print "testing getAssoc:\n"; -$ret =& $dbh->getAssoc('SELECT a, b, c FROM phptest WHERE a < 100 ORDER BY b'); -print_r($ret); - -print "testing getAssoc with false force, null params, DB_FETCHMODE_ORDERED:\n"; -$ret =& $dbh->getAssoc("SELECT a, b, c FROM phptest WHERE a < 100 ORDER BY b", - false, null, DB_FETCHMODE_ORDERED); -print_r($ret); - -print "testing getAssoc with false force, scalar params, DB_FETCHMODE_ASSOC:\n"; -$ret =& $dbh->getAssoc('SELECT a, b, c FROM phptest WHERE a < ? ORDER BY b', - false, 100, DB_FETCHMODE_ASSOC); -print_r($ret); - -print "testing getAssoc with two cols, false force, scalar params, DB_FETCHMODE_ASSOC:\n"; -$ret =& $dbh->getAssoc('SELECT a, b FROM phptest WHERE a < ? ORDER BY b', - false, 100, DB_FETCHMODE_ASSOC); -print_r($ret); - -print "testing getAssoc with two cols, true force, scalar params, DB_FETCHMODE_ASSOC:\n"; -$ret =& $dbh->getAssoc('SELECT a, b FROM phptest WHERE a < ? ORDER BY b', - true, 100, DB_FETCHMODE_ASSOC); -print_r($ret); - -print "testing getAssoc with false force, scalar params, DB_FETCHMODE_ASSOC, true group:\n"; -$ret =& $dbh->getAssoc('SELECT a, b, c FROM phptest WHERE a < ? ORDER BY b', - false, 100, DB_FETCHMODE_ASSOC, true); -print_r($ret); - -print "testing getAssoc with false force, array params, DB_FETCHMODE_OBJECT:\n"; -$ret =& $dbh->getAssoc('SELECT a, b, c FROM phptest WHERE a < ? ORDER BY b', - false, array(100), DB_FETCHMODE_OBJECT); -print_r($ret); - -print "testing getAssoc with true force, array params, DB_FETCHMODE_OBJECT, true group:\n"; -$ret =& $dbh->getAssoc('SELECT a, b, c FROM phptest WHERE a < ? ORDER BY b', - false, array(100), DB_FETCHMODE_OBJECT, true); -print_r($ret); - - -print "\n===================================================\n"; -print "testing getAll:\n"; -$ret =& $dbh->getAll("SELECT * FROM phptest WHERE c = 'Two' OR c = 'Three'"); -print_r($ret); - -print "testing getAll with null params, DB_FETCHMODE_ORDERED:\n"; -$ret =& $dbh->getAll("SELECT * FROM phptest WHERE c = 'Two' OR c = 'Three'", - null, DB_FETCHMODE_ORDERED); -print_r($ret); - -// THIS DOESN'T WORK DUE TO BACKWARDS COMPATIBILITY CRAP -// print "testing getAll with string params, DB_FETCHMODE_ORDERED:\n"; -// $ret =& $dbh->getAll('SELECT * FROM phptest WHERE c = ?', -// 'Two', DB_FETCHMODE_ORDERED); -// print_r($ret); -// -// testing getAll with string params, DB_FETCHMODE_ORDERED: -// Array -// ( -// [0] => 2 -// [1] => two -// [2] => Two -// [3] => 2002-02-22 -// ) - - print "testing getAll with REVERSED args: DB_FETCHMODE_ASSOC, array params:\n"; - $ret =& $dbh->getAll('SELECT * FROM phptest WHERE c = ? OR c = ? ORDER BY c', - DB_FETCHMODE_ASSOC, array('Two', 'Three')); - print_r($ret); - - print "testing getAll with REVERSED args: DB_FETCHMODE_ASSOC:\n"; - $ret =& $dbh->getAll("SELECT * FROM phptest WHERE c = 'Two' OR c = 'Three'", - DB_FETCHMODE_ASSOC); - print_r($ret); - -print "testing getAll with array params, DB_FETCHMODE_ASSOC:\n"; -$ret =& $dbh->getAll('SELECT * FROM phptest WHERE c = ? OR c = ? ORDER BY c', - array('Two', 'Three'), DB_FETCHMODE_ASSOC); -print_r($ret); - -print "testing getAll with array params, DB_FETCHMODE_OBJECT:\n"; -$ret =& $dbh->getAll('SELECT * FROM phptest WHERE c = ? OR c = ? ORDER BY c', - array('Two', 'Three'), DB_FETCHMODE_OBJECT); -print_r($ret); - - -print "\n===================================================\n"; -print 'testing getOne with null value in column: '; -$dbh->query("INSERT INTO phptest VALUES (9, 'nine', '', NULL)"); -$ret =& $dbh->getOne('SELECT d FROM phptest WHERE a = 9'); -if ($ret === '') { - print "matches expected result\n"; -} else { - if ($dbh->phptype == 'msql') { - if (gettype($ret) == 'NULL') { - // msql doesn't even return the column. Joy! :) - // http://bugs.php.net/?id=31960 - print "matches expected result\n"; - } else { - print "WOW, mSQL now returns columns that have NULLS in them\n"; - } - } else { - print 'type=' . gettype($ret) . ", value=$ret\n"; - } -} - -print 'testing getOne with empty string in column: '; -$ret =& $dbh->getOne('SELECT c FROM phptest WHERE a = 9'); -if ($ret === '') { - print "empty string\n"; -} else { - print 'type=' . gettype($ret) . ", value=$ret\n"; -} - - -print "\n===================================================\n"; - - -drop_table($dbh, 'phptest'); - - -?> ---EXPECT-- -=================================================== -testing getOne: 2 -testing getOne with string params: 42 -testing getOne with array params: 2 - -=================================================== -testing getRow: -Array -( - [0] => 2 - [1] => two - [2] => Two - [3] => 2002-02-22 -) -testing getRow with null params, DB_FETCHMODE_ORDERED: -Array -( - [0] => 2 - [1] => two - [2] => Two - [3] => 2002-02-22 -) -testing getRow with REVERSED args: DB_FETCHMODE_ASSOC, array params: -Array -( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 -) -testing getRow with REVERSED args: DB_FETCHMODE_ASSOC: -Array -( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 -) -testing getRow with array params, DB_FETCHMODE_ASSOC: -Array -( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 -) -testing getRow with array params, DB_FETCHMODE_OBJECT: -stdClass Object -( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 -) - -=================================================== -testing getCol: -Array -( - [0] => 42 - [1] => 42 - [2] => 2 -) -testing getCol on query with no records: -Array -( -) -testing getCol with invalid column id: -DB Error: no such field -testing getCol with 1 col: -Array -( - [0] => bing - [1] => three - [2] => two -) -testing getCol with b col: -Array -( - [0] => bing - [1] => three - [2] => two -) -testing getCol with b col, scalar params: -Array -( - [0] => bing - [1] => three - [2] => two -) -testing getCol with b col, array params: -Array -( - [0] => bing - [1] => three - [2] => two -) - -=================================================== -testing getAssoc: -Array -( - [42] => Array - ( - [0] => three - [1] => Three - ) - - [2] => Array - ( - [0] => two - [1] => Two - ) - -) -testing getAssoc with false force, null params, DB_FETCHMODE_ORDERED: -Array -( - [42] => Array - ( - [0] => three - [1] => Three - ) - - [2] => Array - ( - [0] => two - [1] => Two - ) - -) -testing getAssoc with false force, scalar params, DB_FETCHMODE_ASSOC: -Array -( - [42] => Array - ( - [b] => three - [c] => Three - ) - - [2] => Array - ( - [b] => two - [c] => Two - ) - -) -testing getAssoc with two cols, false force, scalar params, DB_FETCHMODE_ASSOC: -Array -( - [42] => three - [2] => two -) -testing getAssoc with two cols, true force, scalar params, DB_FETCHMODE_ASSOC: -Array -( - [42] => Array - ( - [b] => three - ) - - [2] => Array - ( - [b] => two - ) - -) -testing getAssoc with false force, scalar params, DB_FETCHMODE_ASSOC, true group: -Array -( - [42] => Array - ( - [0] => Array - ( - [b] => bing - [c] => This is a test - ) - - [1] => Array - ( - [b] => three - [c] => Three - ) - - ) - - [2] => Array - ( - [0] => Array - ( - [b] => two - [c] => Two - ) - - ) - -) -testing getAssoc with false force, array params, DB_FETCHMODE_OBJECT: -Array -( - [42] => stdClass Object - ( - [a] => 42 - [b] => three - [c] => Three - ) - - [2] => stdClass Object - ( - [a] => 2 - [b] => two - [c] => Two - ) - -) -testing getAssoc with true force, array params, DB_FETCHMODE_OBJECT, true group: -Array -( - [42] => Array - ( - [0] => stdClass Object - ( - [a] => 42 - [b] => bing - [c] => This is a test - ) - - [1] => stdClass Object - ( - [a] => 42 - [b] => three - [c] => Three - ) - - ) - - [2] => Array - ( - [0] => stdClass Object - ( - [a] => 2 - [b] => two - [c] => Two - ) - - ) - -) - -=================================================== -testing getAll: -Array -( - [0] => Array - ( - [0] => 2 - [1] => two - [2] => Two - [3] => 2002-02-22 - ) - - [1] => Array - ( - [0] => 42 - [1] => three - [2] => Three - [3] => 2003-03-23 - ) - -) -testing getAll with null params, DB_FETCHMODE_ORDERED: -Array -( - [0] => Array - ( - [0] => 2 - [1] => two - [2] => Two - [3] => 2002-02-22 - ) - - [1] => Array - ( - [0] => 42 - [1] => three - [2] => Three - [3] => 2003-03-23 - ) - -) -testing getAll with REVERSED args: DB_FETCHMODE_ASSOC, array params: -Array -( - [0] => Array - ( - [a] => 42 - [b] => three - [c] => Three - [d] => 2003-03-23 - ) - - [1] => Array - ( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 - ) - -) -testing getAll with REVERSED args: DB_FETCHMODE_ASSOC: -Array -( - [0] => Array - ( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 - ) - - [1] => Array - ( - [a] => 42 - [b] => three - [c] => Three - [d] => 2003-03-23 - ) - -) -testing getAll with array params, DB_FETCHMODE_ASSOC: -Array -( - [0] => Array - ( - [a] => 42 - [b] => three - [c] => Three - [d] => 2003-03-23 - ) - - [1] => Array - ( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 - ) - -) -testing getAll with array params, DB_FETCHMODE_OBJECT: -Array -( - [0] => stdClass Object - ( - [a] => 42 - [b] => three - [c] => Three - [d] => 2003-03-23 - ) - - [1] => stdClass Object - ( - [a] => 2 - [b] => two - [c] => Two - [d] => 2002-02-22 - ) - -) - -=================================================== -testing getOne with null value in column: matches expected result -testing getOne with empty string in column: empty string - -=================================================== diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/19getlistof.phpt b/campcaster/src/tools/pear/src/tests/DB/tests/driver/19getlistof.phpt deleted file mode 100644 index 8be58f236..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/19getlistof.phpt +++ /dev/null @@ -1,208 +0,0 @@ ---TEST-- -DB_driver::getListOf ---INI-- -error_reporting = 2047 ---SKIPIF-- - ---FILE-- - array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => 'array', - 'ibase:ibase' => 'array', - 'ibase:firebird' => 'array', - 'ifx:ifx' => 'array', - 'msql:msql' => 'array', - 'mssql:mssql' => 'array', - 'mysql:mysql' => 'array', - 'mysqli:mysqli' => 'array', - 'oci8:oci8' => 'array', - 'odbc:access' => 'array', - 'odbc:db2' => 'array', - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => 'array', - 'sybase:sybase' => 'array', - ), - 'views' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => 'array', - 'ibase:ibase' => 'array', - 'ibase:firebird' => 'array', - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => DB_ERROR_UNSUPPORTED, - 'mssql:mssql' => 'array', - 'mysql:mysql' => DB_ERROR_UNSUPPORTED, - 'mysqli:mysqli' => DB_ERROR_UNSUPPORTED, - 'oci8:oci8' => DB_ERROR_UNSUPPORTED, - 'odbc:access' => 'array', - 'odbc:db2' => 'array', - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => 'array', - ), - 'users' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => 'array', - 'ibase:ibase' => 'array', - 'ibase:firebird' => 'array', - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => DB_ERROR_UNSUPPORTED, - 'mssql:mssql' => DB_ERROR_UNSUPPORTED, - 'mysql:mysql' => DB_ERROR_ACCESS_VIOLATION, - 'mysqli:mysqli' => DB_ERROR_ACCESS_VIOLATION, - 'oci8:oci8' => DB_ERROR_UNSUPPORTED, - 'odbc:access' => DB_ERROR_UNSUPPORTED, - 'odbc:db2' => DB_ERROR_UNSUPPORTED, - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => DB_ERROR_UNSUPPORTED, - ), - 'databases' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => DB_ERROR_UNSUPPORTED, - 'ibase:ibase' => DB_ERROR_UNSUPPORTED, - 'ibase:firebird' => DB_ERROR_UNSUPPORTED, - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => 'array', - 'mssql:mssql' => DB_ERROR_UNSUPPORTED, - 'mysql:mysql' => 'array', - 'mysqli:mysqli' => 'array', - 'oci8:oci8' => DB_ERROR_UNSUPPORTED, - 'odbc:access' => 'array', - 'odbc:db2' => 'array', - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => DB_ERROR_UNSUPPORTED, - ), - 'functions' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => 'array', - 'ibase:ibase' => DB_ERROR_UNSUPPORTED, - 'ibase:firebird' => DB_ERROR_UNSUPPORTED, - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => DB_ERROR_UNSUPPORTED, - 'mssql:mssql' => DB_ERROR_UNSUPPORTED, - 'mysql:mysql' => DB_ERROR_UNSUPPORTED, - 'mysqli:mysqli' => DB_ERROR_UNSUPPORTED, - 'oci8:oci8' => DB_ERROR_UNSUPPORTED, - 'odbc:access' => DB_ERROR_UNSUPPORTED, - 'odbc:db2' => DB_ERROR_UNSUPPORTED, - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => DB_ERROR_UNSUPPORTED, - ), - 'procedures' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => 'array', - 'ibase:ibase' => DB_ERROR_UNSUPPORTED, - 'ibase:firebird' => DB_ERROR_UNSUPPORTED, - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => DB_ERROR_UNSUPPORTED, - 'mssql:mssql' => DB_ERROR_UNSUPPORTED, - 'mysql:mysql' => DB_ERROR_UNSUPPORTED, - 'mysqli:mysqli' => DB_ERROR_UNSUPPORTED, - 'oci8:oci8' => DB_ERROR_UNSUPPORTED, - 'odbc:access' => DB_ERROR_UNSUPPORTED, - 'odbc:db2' => DB_ERROR_UNSUPPORTED, - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => DB_ERROR_UNSUPPORTED, - ), - 'schema.tables' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => DB_ERROR_UNSUPPORTED, - 'ibase:ibase' => DB_ERROR_UNSUPPORTED, - 'ibase:firebird' => DB_ERROR_UNSUPPORTED, - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => DB_ERROR_UNSUPPORTED, - 'mssql:mssql' => DB_ERROR_UNSUPPORTED, - 'mysql:mysql' => DB_ERROR_UNSUPPORTED, - 'mysqli:mysqli' => DB_ERROR_UNSUPPORTED, - 'oci8:oci8' => DB_ERROR_UNSUPPORTED, - 'odbc:access' => 'array', - 'odbc:db2' => 'array', - 'pgsql:pgsql' => 'array', - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => DB_ERROR_UNSUPPORTED, - ), - 'synonyms' => array( - 'dbase:dbase' => DB_ERROR_UNSUPPORTED, - 'fbsql:fbsql' => DB_ERROR_UNSUPPORTED, - 'ibase:ibase' => DB_ERROR_UNSUPPORTED, - 'ibase:firebird' => DB_ERROR_UNSUPPORTED, - 'ifx:ifx' => DB_ERROR_UNSUPPORTED, - 'msql:msql' => DB_ERROR_UNSUPPORTED, - 'mssql:mssql' => DB_ERROR_UNSUPPORTED, - 'mysql:mysql' => DB_ERROR_UNSUPPORTED, - 'mysqli:mysqli' => DB_ERROR_UNSUPPORTED, - 'oci8:oci8' => 'array', - 'odbc:access' => DB_ERROR_UNSUPPORTED, - 'odbc:db2' => DB_ERROR_UNSUPPORTED, - 'pgsql:pgsql' => DB_ERROR_UNSUPPORTED, - 'sqlite:sqlite' => DB_ERROR_UNSUPPORTED, - 'sybase:sybase' => DB_ERROR_UNSUPPORTED, - ), -); - -/** - * Determine if the output from the driver matches what we expect - * - * If things are as we expect, nothing is printed out. - * - * If things go wrong, print "UNEXPECTED OUTCOME" and display - * what happened. - * - * @param mixed $result the result from getListOf - * @param mixed $expected the expected result - * @param string $name the name of the current test - * - * @return void - */ -function check_output($result, $expected, $name) { - if (is_object($result)) { - if ($result->getCode() !== $expected) { - echo "UNEXPECTED OUTCOME FOR $name...\n"; - echo $result->getDebugInfo() . "\n"; - } - } else { - $type = gettype($result); - if ($type != $expected) { - if ($expected === DB_ERROR_ACCESS_VIOLATION - && $type == 'array') - { - // This user has access to the mysql table. - // Not a problem - } else { - echo "UNEXPECTED OUTCOME FOR $name...\n"; - echo " Expected: $expected\n"; - echo ' Result: '; - print_r($result); - echo "\n"; - } - } - } -} - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -foreach ($tests as $test => $dbms) { - check_output($dbh->getListOf($test), - $dbms[$dbh->phptype . ':' . $dbh->dbsyntax], - $test); -} - - -drop_table($dbh, 'phptest'); - -?> ---EXPECT-- diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/connect.inc b/campcaster/src/tools/pear/src/tests/DB/tests/driver/connect.inc deleted file mode 100644 index 70cfbc387..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/connect.inc +++ /dev/null @@ -1,46 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: connect.inc,v 1.12 2005/02/02 00:40:23 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -error_reporting(E_ALL); - -// Setting of $options and requiring DB are done in setup.inc - -/** - * Establish the include_path, DSN's and connection $options - */ -require_once './setup.inc'; - -if (empty($dsns)) { - die('At least one element of $dsns must be defined in setup.inc'); -} - -list($dbms, $dsn) = each($dsns); - -if ($dbms == 'mssql') { - ini_set('mssql.textlimit', 4096); - ini_set('mssql.textsize', 4096); -} - -$dbh =& DB::connect($dsn, $options); -if (DB::isError($dbh)) { - die('connect.inc: ' . $dbh->toString()); -} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/mktable.inc b/campcaster/src/tools/pear/src/tests/DB/tests/driver/mktable.inc deleted file mode 100644 index c09cb90ab..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/mktable.inc +++ /dev/null @@ -1,161 +0,0 @@ -phptest table - * - * Tries to drop the table first, in case it already exists. - * - *
- * CREATE TABLE phptest (
- *   a INTEGER NULL,
- *   b CHAR(40) DEFAULT 'def' NOT NULL,
- *   c VARCHAR(255) NULL,
- *   d VARCHAR(20) NULL)
- * 
- * - * Need NOT NULL on b to test - * DB_PORTABILITY_RTRIM. MS SQL and Sybase trim output from - * VARCHAR, but not on CHAR. - * - * Need DEFAULT value on b because Oracle considers - * an empty string to be NULL. - * - * In Oracle, when using placeholders in WHERE clauses on - * CHAR columns, the column must have RTRIM() run on - * the column: - * - * SELECT * FROM phptest WHERE RTRIM(b) = ? - * - * - * PHP versions 4 and 5 - * - * LICENSE: This source file is subject to version 3.0 of the PHP license - * that is available through the world-wide-web at the following URI: - * 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 web, please - * send a note to license@php.net so we can mail you a copy immediately. - * - * @category Database - * @package DB - * @author Daniel Convissor - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: mktable.inc,v 1.19 2005/02/14 23:33:20 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Establishes the DB object and connects to the database - */ -require_once './connect.inc'; - -/** - * Get the drop_table() function - */ -require_once './droptable.inc'; - -/** - * The error handler for the drop table procedure - * - * Prints out an error message and dies. - */ -function debug_die($o){ - die($o->toString()); -} - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); - -//$dbh->setErrorHandling(PEAR_ERROR_TRIGGER); -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'debug_die'); - -if ($dbh->phptype == 'odbc') { - if ($dbh->dbsyntax == 'odbc') { - $type = $dbh->phptype; - } else { - $type = $dbh->dbsyntax; - } -} else { - $type = $dbh->phptype; -} - - -switch ($type) { - case 'access': - $null = 'NULL'; - $chrc = 'VARCHAR(255)'; - $chrd = 'VARCHAR(20)'; - $default = ''; - $tabletype = ''; - break; - case 'db2': - case 'ibase': - $null = ''; - $chrc = 'VARCHAR(255)'; - $chrd = 'VARCHAR(20)'; - $default = "DEFAULT 'def' NOT NULL"; - $tabletype = ''; - break; - case 'fbsql': - $null = ''; - $chrc = 'CHAR(255)'; - $chrd = 'CHAR(20)'; - $default = "DEFAULT 'def' NOT NULL"; - $date_literal = ' DATE '; - $tabletype = ''; - break; - case 'ifx': - // doing this for ifx to keep certain versions happy - $null = ''; - $chrc = 'CHAR(255)'; - $chrd = 'CHAR(20)'; - $default = "DEFAULT 'def' NOT NULL"; - $tabletype = ''; - break; - case 'msql': - $null = ''; - $chrc = 'CHAR(255)'; - $chrd = 'CHAR(20)'; - $default = ''; - $tabletype = ''; - break; - case 'mysql': - case 'mysqli': - $null = 'NULL'; - $chrc = 'VARCHAR(255)'; - $chrd = 'VARCHAR(20)'; - $default = "DEFAULT 'def' NOT NULL"; - if (!empty($needinnodb)) { - $tabletype = 'TYPE=INNODB'; - } else { - $tabletype = ''; - } - break; - default: - $null = 'NULL'; - $chrc = 'VARCHAR(255)'; - $chrd = 'VARCHAR(20)'; - $default = "DEFAULT 'def' NOT NULL"; - $tabletype = ''; -} - -switch ($dbh->phptype) { - case 'dbase': - // file exists or was created in DB_dbase::connect() - break; - default: - $test_mktable_query = " - CREATE TABLE phptest ( - a INTEGER $null, - b CHAR(40) $default, - c $chrc $null, - d $chrd $null) $tabletype - "; -} - - -$dbh->query($test_mktable_query); -$dbh->query("INSERT INTO phptest VALUES(42, 'bing', 'This is a test', '1999-11-21')"); - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/multiconnect.php b/campcaster/src/tools/pear/src/tests/DB/tests/driver/multiconnect.php deleted file mode 100644 index 0405d79b0..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/multiconnect.php +++ /dev/null @@ -1,83 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: multiconnect.php,v 1.2 2005/02/03 05:49:45 danielc Exp $ - * @link http://pear.php.net/package/DB - * @since File available since Release 1.7.0 - */ - -/** - * Establish the include_path, DSN's and connection $options - */ -require_once './setup.inc'; - -foreach ($dsns as $dbms => $dsn) { - echo "======== $dbms ========\n"; - $options['persistent'] = false; - $dbh =& DB::connect($dsn, $options); - if (DB::isError($dbh)) { - echo 'PROBLEM: ' . $dbh->getUserInfo() . "\n"; - continue; - } - - if ($dbh->provides('new_link') - && version_compare(phpversion(), $dbh->provides('new_link'), '>=')) - { - $probs = false; - $dsn = DB::parseDSN($dsn); - $dsn['new_link'] = true; - $dbh =& DB::connect($dsn, $options); - if (DB::isError($dbh)) { - echo 'NEW LINK PROBLEM: ' . $dbh->getUserInfo() . "\n"; - $probs = true; - } - - if ($dbh->provides('pconnect')) { - $options['persistent'] = true; - $dbh->disconnect(); - $dbh =& DB::connect($dsn, $options); - if (DB::isError($dbh)) { - echo 'PERSIST NEWCON PROBLEM: ' . $dbh->getUserInfo() . "\n"; - $probs = true; - } - - unset($dsn['new_link']); - $dbh->disconnect(); - $dbh =& DB::connect($dsn, $options); - if (DB::isError($dbh)) { - echo 'PERSIST OLDCON PROBLEM: ' . $dbh->getUserInfo() . "\n"; - $probs = true; - } - } - if ($probs) { - continue; - } - $dbh->disconnect(); - - } elseif ($dbh->provides('pconnect')) { - $options['persistent'] = true; - $dbh->disconnect(); - $dbh =& DB::connect($dsn, $options); - if (DB::isError($dbh)) { - echo 'PERSIST PROBLEM: ' . $dbh->getUserInfo() . "\n"; - continue; - } - $dbh->disconnect(); - } - echo "GOOD\n"; -} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/run.cvs b/campcaster/src/tools/pear/src/tests/DB/tests/driver/run.cvs deleted file mode 100644 index 56a1cd04d..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/run.cvs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh - -# $Id: run.cvs,v 1.2 2004/02/20 18:57:52 danielc Exp $ - -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# PEAR DB TEST STARTER -# -# To run all tests: ./run -# To run one test: ./run -# Example: ./run db_parsedsn.phpt -# -# Before running the tests you must adjust the -# following three variables: - -# The full path to your PHP directory: - DB_TEST_PHP_PATH=c:/progra~1/php - -# The name of your PHP CLI executable -# (examples php.exe, php-cli.exe, cli/php.exe): - DB_TEST_PHP_CLI=php.exe - -# The full path to the present directory -# (not using $PWD due to Cygwin): - DB_TEST_DIR=d:/peartest/pear/DB/tests/driver - -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - -TEST_PHP_EXECUTABLE=$DB_TEST_PHP_PATH/$DB_TEST_PHP_CLI -export TEST_PHP_EXECUTABLE - -if [ $# -gt 0 ] -then - test=$1 -else - test=*.phpt -fi - -$TEST_PHP_EXECUTABLE $DB_TEST_PHP_PATH/run-tests.php $DB_TEST_DIR/${test} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/setup.inc.cvs b/campcaster/src/tools/pear/src/tests/DB/tests/driver/setup.inc.cvs deleted file mode 100644 index efc864a96..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/setup.inc.cvs +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: setup.inc.cvs,v 1.6 2005/02/14 23:33:20 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -if (!defined('PATH_SEPARATOR')) { - if (stristr(PHP_OS, 'WIN')) { - /** - * The string used to delimit elements of the path. - */ - define('PATH_SEPARATOR', ';'); - } else { - /** - * The string used to delimit elements of the path. - */ - define('PATH_SEPARATOR', ':'); - } -} - -/* - * If the path to your PEAR installation is found in the left hand - * portion of the if() expression below, that means this file has - * come from the PEAR installer. Therefore, let's use the - * installed version of DB, which should be found via the - * computer's default include_path. Add '.' to the include_path - * to ensure '.' is in there. - * - * If the path has not been substituted in the if() expression, - * this file has likely come from a CVS checkout or a .tar file. - * Therefore, we'll assume the tests should use the version of - * DB that has come from there as well. - */ -if ('/home/paul/software/campcaster/campcaster/usr/lib/pear' != '@'.'include_path'.'@') { - ini_set('include_path', ini_get('include_path') - . PATH_SEPARATOR . '.' - ); -} else { - ini_set('include_path', realpath(dirname(__FILE__) . '/../..') - . PATH_SEPARATOR . '.' . PATH_SEPARATOR - . ini_get('include_path') - ); -} - -/** - * Grab the PEAR DB classes. - */ -require_once 'DB.php'; - -// Options used when connecting -$options = array( - //'optimize' => 'portability', - 'portability' => DB_PORTABILITY_ALL, - 'debug' => 2, -); - -$dbasedsn = array( - 'phptype' => 'dbase', - 'database' => '/path/and/name/of/dbase/file', - 'mode' => 2, - 'fields' => array( - array('a', 'N', 5, 0), - array('b', 'C', 40), - array('c', 'C', 255), - array('d', 'C', 20), - ), -); - -/* - * Uncomment at least one of the following elements. - * When running the .phpt tests, the first uncommented element is used. - * When running the multiconnect.php test, all uncommented elements are used. - */ -$dsns = array( - // 'dbase' => $dbasedsn, - // 'fbsql' => 'fbsql://_system:@/db', - // 'firebird' => 'ibase(firebird)://SYSDBA:masterkey@//opt/interbase/examples/employee.gdb?dialect=3', - // 'ifx' => 'ifx://user:pw@localhost/db', - // 'msql' => 'msql:///db', - - // It's advisable to use only one of the following at a time: - // 'mssql' => 'mssql://sa@somehost/pubs', - // 'sybase' => 'sybase://sa@somehost/pubs', - - // 'mysql' => 'mysql://root@localhost/test', - // 'mysqli' => 'mysqli://root@localhost/test', - // 'oci8' => 'oci8://system:manager@', - // 'access' => 'odbc(access)://admin@/SystemDsnName', - // 'db2' => 'odbc(db2)://db2inst1:XXXX@/SAMPLE', - // 'pgsql' => 'pgsql://postgres@localhost/test', - // 'sqlite' => 'sqlite://dummy:@localhost/' . getcwd() . DIRECTORY_SEPARATOR . 'test.db?mode=0644', -); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/driver/skipif.inc b/campcaster/src/tools/pear/src/tests/DB/tests/driver/skipif.inc deleted file mode 100644 index 00c3015dd..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/driver/skipif.inc +++ /dev/null @@ -1,37 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: skipif.inc,v 1.7 2005/02/02 00:40:23 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Establish the include_path, DSN's and connection $options - */ -require_once './setup.inc'; - -if (empty($dsns)) { - die('skip At least one element of $dsns must be defined in setup.inc'); -} - -list($dbms, $dsn) = each($dsns); - -$dbh =& DB::connect($dsn, $options); -if (DB::isError($dbh)) { - die('skip ' . $dbh->message); -} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/errors.inc b/campcaster/src/tools/pear/src/tests/DB/tests/errors.inc deleted file mode 100644 index f44718984..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/errors.inc +++ /dev/null @@ -1,466 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: errors.inc,v 1.35 2005/02/28 02:02:41 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Determine if the error from the driver matches the error we expect - * - * If things are as we expect, print out "matches expected outcome" - * - * If things go wrong, print "UNEXPECTED OUTCOME" and display the - * error's information. - * - * @param object $e the DB_Error object from the query - * @param int $expected_db_code the DB_ERROR* constant to expect - * @param boolean $should_be_error does the DBMS consider this an error? - * - * @return void - */ -function check_error($e, $expected_db_code, $should_be_error = true) { - if ($should_be_error) { - if (DB::isError($e)) { - if ($e->getCode() == $expected_db_code) { - print "matches expected outcome\n"; - } else { - print "UNEXPECTED OUTCOME...\n"; - print ' PEAR::DB errorcode: ' . $e->getCode() . "\n"; - print ' ' . $e->getUserInfo() . "\n"; - } - } else { - print "\n UNEXPECTED OUTCOME... expected error but it wasn't\n"; - } - } else { - if (DB::isError($e)) { - print "UNEXPECTED OUTCOME... didn't expect error but it was\n"; - print ' PEAR::DB errorcode: ' . $e->getCode() . "\n"; - print ' ' . $e->getUserInfo() . "\n"; - } else { - print "matches expected outcome\n"; - } - } -} - -/** - * Local error callback handler - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - print "\n---------------\n"; - print "Having problems creating a table for testing...\n"; - print $o->getDebugInfo() . "\n"; - print "---------------\n"; -} - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); - - -print 'DB_ERROR_NOSUCHTABLE for select: '; -$res = $dbh->query('SELECT * FROM tableThatsBogus'); -check_error($res, DB_ERROR_NOSUCHTABLE); - -print 'DB_ERROR_NOSUCHTABLE for drop: '; -$res = drop_table($dbh, 'tableThatsBogus'); -check_error($res, DB_ERROR_NOSUCHTABLE); - -print 'DB_ERROR_NOT_FOUND for drop index: '; -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'fbsql:fbsql': - case 'ibase:firebird': - case 'ibase:ibase': - case 'ifx:ifx': - case 'odbc:db2': - case 'oci8:oci8': - case 'pgsql:pgsql': - case 'sqlite:sqlite': - $res = $dbh->query('DROP INDEX fakeindex'); - break; - case 'mssql:mssql': - case 'sybase:sybase': - $res = $dbh->query('DROP INDEX phptest.fakeindex'); - break; - case 'msql:msql': - $res = $dbh->query('DROP INDEX fakeindex FROM phptest'); - break; - default: - $res = $dbh->query('DROP INDEX fakeindex ON phptest'); -} -check_error($res, DB_ERROR_NOT_FOUND); - - -print 'DB_ERROR_ALREADY_EXISTS for create table: '; -$res = $dbh->query($test_mktable_query); -check_error($res, DB_ERROR_ALREADY_EXISTS); - -print 'DB_ERROR_ALREADY_EXISTS for create index: '; -$res = drop_table($dbh, 'a'); -$dbh->pushErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); -$res = $dbh->query('CREATE TABLE a (a INTEGER)'); -$dbh->popErrorHandling(); -$res = $dbh->query('CREATE INDEX aa_idx ON a (a)'); -$res = $dbh->query('CREATE INDEX aa_idx ON a (a)'); -switch ($dbh->phptype) { - case 'fbsql': - // FrontBase doesn't assign a specific code for this yet. - check_error($res, DB_ERROR_ALREADY_EXISTS, false); - break; - default: - check_error($res, DB_ERROR_ALREADY_EXISTS); -} -$res = drop_table($dbh, 'a'); - - -print 'DB_ERROR_CONSTRAINT for primary key insert duplicate: '; -$res = drop_table($dbh, 'a'); -$dbh->pushErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); -switch ($dbh->phptype) { - case 'msql': - $res = $dbh->query('CREATE TABLE a (a INTEGER NOT NULL)'); - $res = $dbh->query('CREATE UNIQUE INDEX apk ON a (a)'); - break; - default: - $res = $dbh->query('CREATE TABLE a (a INTEGER NOT NULL, PRIMARY KEY (a))'); -} -$dbh->popErrorHandling(); -$res = $dbh->query('INSERT INTO a VALUES (1)'); -$res = $dbh->query('INSERT INTO a VALUES (1)'); -check_error($res, DB_ERROR_CONSTRAINT); - - -print 'DB_ERROR_CONSTRAINT for primary key update duplicate: '; -$res = $dbh->query('INSERT INTO a VALUES (2)'); -$res = $dbh->query('UPDATE a SET a=1 WHERE a=2'); -check_error($res, DB_ERROR_CONSTRAINT); - - -print 'DB_ERROR_CONSTRAINT for unique key insert duplicate: '; -$res = drop_table($dbh, 'a'); -$dbh->pushErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); -switch ($dbh->phptype) { - case 'msql': - $res = $dbh->query('CREATE TABLE a (a INTEGER NOT NULL)'); - $res = $dbh->query('CREATE UNIQUE INDEX auk ON a (a)'); - break; - default: - $res = $dbh->query('CREATE TABLE a (a INTEGER NOT NULL, UNIQUE (a))'); -} -$dbh->popErrorHandling(); -$res = $dbh->query('INSERT INTO a VALUES (1)'); -$res = $dbh->query('INSERT INTO a VALUES (1)'); -check_error($res, DB_ERROR_CONSTRAINT); - - -print 'DB_ERROR_CONSTRAINT for unique key update duplicate: '; -$res = $dbh->query('INSERT INTO a VALUES (2)'); -$res = $dbh->query('UPDATE a SET a=1 WHERE a=2'); -check_error($res, DB_ERROR_CONSTRAINT); - - -print 'DB_ERROR_CONSTRAINT for foreign key on insert: '; -$res = drop_table($dbh, 'b'); -$res = drop_table($dbh, 'a'); -$dbh->pushErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); -switch ($dbh->phptype) { - case 'mysql': - case 'mysqli': - $res = $dbh->query('CREATE TABLE a (a INT NOT NULL, ' - . 'PRIMARY KEY (a)) ' - . 'TYPE=INNODB'); - $res = $dbh->query('CREATE TABLE b (b INT, ' - . 'INDEX par_ind (b), ' - . 'FOREIGN KEY (b) REFERENCES a (a)) ' - . 'TYPE=INNODB'); - $dbh->popErrorHandling(); - break; - - case 'msql': - // msql does not support foreign keys - $res = $dbh->query('CREATE TABLE a (a INTEGER NOT NULL)'); - $res = $dbh->query('CREATE UNIQUE INDEX auk ON a (a)'); - $dbh->popErrorHandling(); - $res = $dbh->query('CREATE TABLE b (b INTEGER REFERENCES a (a))'); - if (DB::isError($res)) { - print "matches expected outcome\n"; - print "DB_ERROR_CONSTRAINT for foreign key on delete: matches expected outcome\n"; - } else { - print "WOW, it seems mSQL now supports references\n"; - print "WOW, it seems mSQL now supports references\n"; - } - break; - - default: - $res = $dbh->query('CREATE TABLE a (a INTEGER NOT NULL, PRIMARY KEY (a))'); - $res = $dbh->query('CREATE TABLE b (b INTEGER REFERENCES a (a))'); - $dbh->popErrorHandling(); -} - -if ($dbh->phptype != 'msql') { - $res = $dbh->query('INSERT INTO a (a) values (1)'); - $res = $dbh->query('INSERT INTO b (b) values (2)'); - switch ($dbh->phptype) { - case 'sqlite': - check_error($res, DB_ERROR_CONSTRAINT, false); - break; - default: - check_error($res, DB_ERROR_CONSTRAINT); - } - - print 'DB_ERROR_CONSTRAINT for foreign key on delete: '; - $res = $dbh->query('INSERT INTO b (b) values (1)'); - $res = $dbh->query('DELETE FROM a WHERE a = 1'); - switch ($dbh->phptype) { - case 'sqlite': - check_error($res, DB_ERROR_CONSTRAINT, false); - break; - default: - check_error($res, DB_ERROR_CONSTRAINT); - } -} - - -print 'DB_ERROR_CONSTRAINT_NOT_NULL on insert: '; -$res = drop_table($dbh, 'peartestnull'); -$dbh->pushErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); -$res = $dbh->query('CREATE TABLE peartestnull (a CHAR(3) NOT NULL)'); -$dbh->popErrorHandling(); -$res = $dbh->query('INSERT INTO peartestnull VALUES (NULL)'); -check_error($res, DB_ERROR_CONSTRAINT_NOT_NULL); - - -print 'DB_ERROR_CONSTRAINT_NOT_NULL on update: '; -$res = $dbh->query("INSERT INTO peartestnull VALUES ('one')"); -$res = $dbh->query("UPDATE peartestnull SET a = NULL WHERE a = 'one'"); -switch ($dbh->phptype) { - case 'mysql': - case 'mysqli': - check_error($res, DB_ERROR_CONSTRAINT_NOT_NULL, false); - break; - default: - check_error($res, DB_ERROR_CONSTRAINT_NOT_NULL); -} - - -print 'DB_ERROR_NOSUCHFIELD joining ON bogus column: '; -$res = $dbh->query('SELECT * FROM phptest JOIN a ON (phptest.a = a.b)'); -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'msql:msql': - case 'odbc:access': - check_error($res, DB_ERROR_SYNTAX); - break; - default: - check_error($res, DB_ERROR_NOSUCHFIELD); -} - - -print 'DB_ERROR_NOSUCHFIELD joining USING bogus column: '; -$res = $dbh->query('SELECT * FROM phptest JOIN a USING (b)'); -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'ibase:ibase': - case 'ibase:firebird': - case 'msql:msql': - case 'odbc:access': - case 'odbc:db2': - case 'sybase:sybase': - check_error($res, DB_ERROR_SYNTAX); - break; - default: - check_error($res, DB_ERROR_NOSUCHFIELD); -} - - -print 'DB_ERROR_DIVZERO: '; -// Interbase detects the error on fetching -$res = $dbh->getAll('SELECT 0/0 FROM phptest'); -switch ($dbh->phptype) { - case 'odbc': - switch ($dbh->dbsyntax) { - case 'access': - check_error($res, DB_ERROR_DIVZERO, false); - break; - case 'db2': - check_error($res, DB_ERROR_DIVZERO); - break; - } - break; - case 'ibase': - case 'ifx': - case 'fbsql': - case 'mssql': - case 'mysql': - case 'mysqli': - case 'sqlite': - case 'sybase': - check_error($res, DB_ERROR_DIVZERO, false); - break; - case 'msql': - check_error($res, DB_ERROR_SYNTAX); - break; - default: - check_error($res, DB_ERROR_DIVZERO); -} - - -print 'DB_ERROR_INVALID_NUMBER putting chars in INT column: '; -$res = $dbh->query("UPDATE phptest SET a = 'abc' WHERE a = 42"); -switch ($dbh->phptype) { - case 'mysql': - case 'mysqli': - case 'sqlite': - check_error($res, DB_ERROR_INVALID_NUMBER, false); - break; - default: - check_error($res, DB_ERROR_INVALID_NUMBER); -} - - -print 'DB_ERROR_INVALID_NUMBER putting float in INT column: '; -$res = $dbh->query("UPDATE phptest SET a = 8.9 WHERE a = 42"); -switch ($dbh->phptype) { - case 'fbsql': - case 'ibase': - case 'ifx': - case 'mssql': - case 'mysql': - case 'mysqli': - case 'oci8': - case 'odbc': - case 'pgsql': - case 'sqlite': - check_error($res, DB_ERROR_INVALID_NUMBER, false); - break; - default: - check_error($res, DB_ERROR_INVALID_NUMBER); -} - - -print 'DB_ERROR_INVALID_NUMBER putting excessive int in INT column: '; -$res = $dbh->query("UPDATE phptest SET a = 18446744073709551616 WHERE a = 42"); -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'ibase:ibase': - case 'ibase:firebird': - check_error($res, DB_ERROR_SYNTAX); - break; - case 'fbsql:fbsql': - case 'msql:msql': - case 'mssql:mssql': - case 'mysql:mysql': - case 'mysqli:mysqli': - case 'oci8:oci8': - case 'odbc:access': - case 'sqlite:sqlite': - check_error($res, DB_ERROR_INVALID_NUMBER, false); - break; - default: - check_error($res, DB_ERROR_INVALID_NUMBER); -} - - -print 'DB_ERROR_INVALID_NUMBER putting int in CHAR column: '; -$res = $dbh->query("UPDATE phptest SET b = 8 WHERE a = 42"); -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'ibase:ibase': - case 'ibase:firebird': - case 'ifx:ifx': - case 'mssql:mssql': - case 'mysql:mysql': - case 'mysqli:mysqli': - case 'oci8:oci8': - case 'odbc:access': - case 'pgsql:pgsql': - case 'sqlite:sqlite': - check_error($res, DB_ERROR_INVALID_NUMBER, false); - break; - default: - check_error($res, DB_ERROR_INVALID_NUMBER); -} - - -print 'DB_ERROR_NOSUCHFIELD: '; -$res = $dbh->query('SELECT e FROM phptest'); -check_error($res, DB_ERROR_NOSUCHFIELD); - - -print 'DB_ERROR_SYNTAX: '; -$res = $dbh->query('CREATE'); -check_error($res, DB_ERROR_SYNTAX); - - -print 'DB_ERROR_VALUE_COUNT_ON_ROW: '; -$res = $dbh->query('INSERT INTO phptest (a) VALUES (678, 2)'); -switch ($dbh->phptype) { - case 'msql': - check_error($res, DB_ERROR_VALUE_COUNT_ON_ROW, false); - break; - default: - check_error($res, DB_ERROR_VALUE_COUNT_ON_ROW); -} - - -print 'DB_ERROR_INVALID on CHAR column data too long: '; -$res = $dbh->query("INSERT INTO phptest (b) VALUES ('123456789.123456789.123456789.123456789.1')"); -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'msql:msql': - case 'mssql:mssql': - case 'mysql:mysql': - case 'mysqli:mysqli': - case 'odbc:access': - case 'sqlite:sqlite': - case 'sybase:sybase': - check_error($res, DB_ERROR_INVALID, false); - break; - case 'fbsql:fbsql': - check_error($res, DB_ERROR_TRUNCATED); - break; - default: - check_error($res, DB_ERROR_INVALID); -} - - -print 'DB_ERROR_INVALID on VARCHAR column data too long: '; -$res = $dbh->query("INSERT INTO phptest (d) VALUES ('123456789.123456789.1')"); -switch ($dbh->phptype . ':' . $dbh->dbsyntax) { - case 'msql:msql': - case 'mssql:mssql': - case 'mysql:mysql': - case 'mysqli:mysqli': - case 'odbc:access': - case 'sqlite:sqlite': - case 'sybase:sybase': - check_error($res, DB_ERROR_INVALID, false); - break; - case 'fbsql:fbsql': - check_error($res, DB_ERROR_TRUNCATED); - break; - default: - check_error($res, DB_ERROR_INVALID); -} - - - -drop_table($dbh, 'phptest'); -drop_table($dbh, 'b'); -drop_table($dbh, 'a'); -drop_table($dbh, 'peartestnull'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/fetchmode_object.inc b/campcaster/src/tools/pear/src/tests/DB/tests/fetchmode_object.inc deleted file mode 100644 index 710a057d3..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/fetchmode_object.inc +++ /dev/null @@ -1,111 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: fetchmode_object.inc,v 1.11 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -error_reporting(E_ALL); - -/** - * Local error callback handler - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -/** - * Print out the object - */ -function print_obj(&$obj) { - if (!is_object($obj)) { - echo "ERROR: no object!\n"; - } else { - echo strtolower(get_class($obj)) . ' -> ' . implode(' ', array_keys((array)$obj)) . "\n"; - } -} - - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - -echo "--- fetch with param DB_FETCHMODE_OBJECT ---\n"; -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(DB_FETCHMODE_OBJECT); -print_obj($row); -$sth->free(); // keep fbsql happy. - -$sth = $dbh->query("SELECT * FROM phptest"); -$sth->fetchInto($row, DB_FETCHMODE_OBJECT); -print_obj($row); -$sth->free(); // keep fbsql happy. - -echo "--- fetch with default fetchmode DB_FETCHMODE_OBJECT ---\n"; -$dbh->setFetchMode(DB_FETCHMODE_OBJECT); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(); -print_obj($row); -$sth->free(); // keep fbsql happy. - -$sth = $dbh->query("SELECT * FROM phptest"); -$sth->fetchInto($row); -print_obj($row); -$sth->free(); // keep fbsql happy. - -echo "--- fetch with default fetchmode DB_FETCHMODE_OBJECT and class DB_row ---\n"; -$dbh->setFetchMode(DB_FETCHMODE_OBJECT, 'DB_row'); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(); -print_obj($row); -$sth->free(); // keep fbsql happy. - -$sth = $dbh->query("SELECT * FROM phptest"); -$sth->fetchInto($row); -print_obj($row); -$sth->free(); // keep fbsql happy. - -echo "--- fetch with default fetchmode DB_FETCHMODE_OBJECT with no class then DB_row ---\n"; -$dbh->setFetchMode(DB_FETCHMODE_OBJECT); -$sth = $dbh->query('SELECT * FROM phptest'); -$row = $sth->fetchRow(); -print_obj($row); -$sth->free(); // keep fbsql happy. - -$dbh->setFetchMode(DB_FETCHMODE_OBJECT, 'DB_row'); -$sth = $dbh->query('SELECT * FROM phptest'); -$row = $sth->fetchRow(); -print_obj($row); - -$sth->free(); // keep fbsql happy. - // keep ibase happy: can't drop tbl that has results open against it. - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/fetchmodes.inc b/campcaster/src/tools/pear/src/tests/DB/tests/fetchmodes.inc deleted file mode 100644 index 761c6754b..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/fetchmodes.inc +++ /dev/null @@ -1,170 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: fetchmodes.inc,v 1.11 2005/02/14 17:04:14 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Local error callback handler - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); -$dbh->setOption('autofree', true); - -$dbh->query("INSERT INTO phptest VALUES (1, 'one', 'One', '2001-02-16')"); -$dbh->query("INSERT INTO phptest VALUES (2, 'two', 'Two', '2001-02-15')"); -$dbh->query("INSERT INTO phptest VALUES (3, 'three', 'Three', '2001-02-14')"); - -print "testing fetchrow:\n"; -$sth = $dbh->query("SELECT * FROM phptest"); -for ($i = 1; $i <= 5; $i++) { - print "row $i: "; - $row = $sth->fetchRow(); - if (DB::isError($row)) { - print $row->toString() . "\n"; - continue; - } - if (is_array($row)) { - print implode(', ', $row) . "\n"; - } else { - var_dump($row); - } -} -$sth->free(); // keep fbsql happy. - -$dbh->query('DELETE FROM phptest WHERE a <> 42'); - - -print "testing fetchmodes: fetchrow default default, portability mode DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM\n"; -$dbh->setOption('portability', DB_PORTABILITY_ALL ^ DB_PORTABILITY_RTRIM); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(); -print implode(" ", array_keys($row))."\n"; -$actual = implode(' ', array_values($row)); -switch ($dbh->phptype) { - case 'fbsql': - case 'msql': - case 'mysql': - case 'mysqli': - case 'sqlite': - $expected = '42 bing This is a test 1999-11-21'; - break; - case 'ifx': - $expected = '42 bing This is a test 1999-11-21 '; - break; - default: - $expected = '42 bing This is a test 1999-11-21'; -} -if ($actual == $expected) { - echo "output matched expected format\n"; -} else { - echo "DIDN'T MATCH! Expected output: '$expected'. Actual output: '$actual'.\n"; -} -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchinto default default\n"; -$dbh->setOption('portability', DB_PORTABILITY_ALL); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = array(); -$sth->fetchInto($row); -print implode(" ", array_keys($row))."\n"; -print implode(' ', array_values($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchrow ordered default\n"; -$dbh->setFetchMode(DB_FETCHMODE_ORDERED); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchrow assoc default\n"; -$dbh->setFetchMode(DB_FETCHMODE_ASSOC); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchrow ordered default with assoc specified\n"; -$dbh->setFetchMode(DB_FETCHMODE_ORDERED); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(DB_FETCHMODE_ASSOC); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchrow assoc default with ordered specified\n"; -$dbh->setFetchMode(DB_FETCHMODE_ASSOC); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = $sth->fetchRow(DB_FETCHMODE_ORDERED); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchinto ordered default\n"; -$dbh->setFetchMode(DB_FETCHMODE_ORDERED); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = array(); -$sth->fetchInto($row); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchinto assoc default\n"; -$dbh->setFetchMode(DB_FETCHMODE_ASSOC); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = array(); -$sth->fetchInto($row); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchinto ordered default with assoc specified\n"; -$dbh->setFetchMode(DB_FETCHMODE_ORDERED); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = array(); -$sth->fetchInto($row, DB_FETCHMODE_ASSOC); -print implode(" ", array_keys($row))."\n"; -$sth->free(); // keep fbsql happy. - -print "testing fetchmodes: fetchinto assoc default with ordered specified\n"; -$dbh->setFetchMode(DB_FETCHMODE_ASSOC); -$sth = $dbh->query("SELECT * FROM phptest"); -$row = array(); -$sth->fetchInto($row, DB_FETCHMODE_ORDERED); -print implode(" ", array_keys($row))."\n"; - -$sth->free(); // keep fbsql happy. - // keep ibase happy: can't drop tbl that has results open against it. - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/include.inc b/campcaster/src/tools/pear/src/tests/DB/tests/include.inc deleted file mode 100644 index 1234a2793..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/include.inc +++ /dev/null @@ -1,62 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: include.inc,v 1.5 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -error_reporting(E_ALL); - -if (!defined('PATH_SEPARATOR')) { - if (stristr(PHP_OS, 'WIN')) { - /** - * Define the path separator for windows - */ - define('PATH_SEPARATOR', ';'); - } else { - /** - * Define the path separator for other systems - */ - define('PATH_SEPARATOR', ':'); - } -} - -/* - * If the path to your PEAR installation is found in the left hand - * portion of the if() expression below, that means this file has - * come from the PEAR installer. Therefore, let's use the - * installed version of DB, which should be found via the - * computer's default include_path. Add '.' to the include_path - * to ensure '.' is in there. - * - * If the path has not been substituted in the if() expression, - * this file has likely come from a CVS checkout or a .tar file. - * Therefore, we'll assume the tests should use the version of - * DB that has come from there as well. - */ -if ('/home/paul/software/campcaster/campcaster/usr/lib/pear' != '@'.'include_path'.'@') { - ini_set('include_path', ini_get('include_path') - . PATH_SEPARATOR . '.' - ); -} else { - ini_set('include_path', realpath(dirname(__FILE__) . '/..') - . PATH_SEPARATOR . '.' . PATH_SEPARATOR - . ini_get('include_path') - ); -} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/limit.inc b/campcaster/src/tools/pear/src/tests/DB/tests/limit.inc deleted file mode 100644 index 558e2b1fb..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/limit.inc +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: limit.inc,v 1.11 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -error_reporting(E_ALL); - -/** - * Local error callback handler - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'php_limit'); - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - -$dbh->query('CREATE TABLE php_limit (a CHAR(20))'); - - -$from = 0; -$count = 10; -$numrows = 30; - -for ($i=0; $i<=$numrows+2; $i++) { - $dbh->query("INSERT INTO php_limit VALUES('result $i')"); -} -for ($i = 0; $i <= 3; $i++) { - $from = 10 * $i; - $res = $dbh->limitQuery("select * from php_limit", $from, $count); - echo "======= From: $from || Number of rows to fetch: $count =======\n"; - while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) { - echo $res->getRowCounter() . '.- ' . $row['a'] . "\n"; - } - $res->free(); // keep fbsql happy. -} - - -$from = 11; -$count = 3; - -echo "======= Passing \$params || From: $from || Number of rows to fetch: $count =======\n"; -$res = $dbh->limitQuery('SELECT * FROM php_limit WHERE a < ?', $from, $count, array('result 99')); -while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) { - echo $res->getRowCounter() . '.- ' . $row['a'] . "\n"; -} - -$res->free(); // keep fbsql happy. - // keep ibase happy: can't drop tbl that has results open against it. - -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'php_limit'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/numcols.inc b/campcaster/src/tools/pear/src/tests/DB/tests/numcols.inc deleted file mode 100644 index 367a89c09..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/numcols.inc +++ /dev/null @@ -1,67 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: numcols.inc,v 1.7 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Local error callback handler - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$sth = $dbh->query("SELECT a FROM phptest"); -printf("%d\n", $sth->numCols()); -$sth = $dbh->query("SELECT a,b FROM phptest"); -printf("%d\n", $sth->numCols()); -$sth = $dbh->query("SELECT a,b,c FROM phptest"); -printf("%d\n", $sth->numCols()); -$sth = $dbh->query("SELECT * FROM phptest"); -printf("%d\n", $sth->numCols()); - - -switch ($dbh->phptype) { - case 'ibase': - /* - * Interbase doesn't allow dropping tables that have result - * sets still open. - */ - $dbh->freeResult($sth->result); - break; -} -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/numrows.inc b/campcaster/src/tools/pear/src/tests/DB/tests/numrows.inc deleted file mode 100644 index 64210c66c..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/numrows.inc +++ /dev/null @@ -1,110 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: numrows.inc,v 1.12 2005/02/09 07:07:24 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Local error callback handler - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - print "\n------------\n"; - if ($o->getCode() == DB_ERROR_NOT_CAPABLE) { - print "This DBMS does not support numRows()."; - } elseif ($o->getCode() == DB_ERROR_MISMATCH) { - print "Mismatch between the number of placeholders and parameters.\n"; - foreach ($o->backtrace as $item => $detail) { - if ($detail['function'] == 'query') { - echo 'QUERY: ' . $detail['args'][0] . "\n"; - echo "PARAMETERS:\n"; - print_r($detail['args'][1]); - } - } - } else { - print $o->getDebugInfo() . "\n"; - } - exit; -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$res = $dbh->query("SELECT a FROM phptest"); -if (!DB::isError($rows = $res->numRows())) { - print "(want 1) got $rows from first\n"; -} else { - print "\n"; -} -for ($i = 0; $i < 5; $i++) { - $dbh->query("INSERT INTO phptest (a) VALUES ($i)"); - $res = $dbh->query("SELECT a FROM phptest"); - if (!DB::isError($rows = $res->numRows())) { - print '(want ' . ($i + 2) . ") got $rows from $i\n"; - } else { - print "\n"; - } -} - -$res = $dbh->query('SELECT a FROM phptest WHERE a > ?', 0); -if (!DB::isError($rows = $res->numRows())) { - print "(want 5) got $rows from > 0 (passing params to query)\n"; -} else { - print "\n"; -} - -$sth = $dbh->prepare('SELECT a FROM phptest WHERE a < ?'); -$res = $dbh->execute($sth, array(4)); -if (!DB::isError($rows = $res->numRows())) { - print "(want 4) got $rows from < 4 (doing prepare/execute)\n"; -} else { - print "\n"; -} - -$dbh->query("DELETE FROM phptest WHERE a < 4"); -$res = $dbh->query("SELECT a FROM phptest"); -if (!DB::isError($rows = $res->numRows())) { - print "(want 2) got $rows from 5 and 6 not deleted\n"; -} else { - print "\n"; -} -$res = $dbh->query("SELECT a FROM phptest where a < 0"); -if (!DB::isError($rows = $res->numRows())) { - print "(want 0) got $rows from < 0\n"; -} else { - print "\n"; -} - - -$res->free(); // keep ibase happy -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/prepexe.inc b/campcaster/src/tools/pear/src/tests/DB/tests/prepexe.inc deleted file mode 100644 index 40d65953d..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/prepexe.inc +++ /dev/null @@ -1,241 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: prepexe.inc,v 1.25 2005/02/16 13:54:51 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -$tmpfile = tempnam("/tmp", "phptmp"); -register_shutdown_function("my_shutdown"); -$fp = fopen($tmpfile, "w"); -$filedata = "opaque placeholder's test"; -fwrite($fp, $filedata); -fclose($fp); - - -/** - * Local error callback handler - * - * Prints out an error message and kills the process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - print "\n" . $o->toString(); - exit; -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -// 1) Multiple prepare/exec INSERT queries -echo "------------1------------\n"; - -$sth1 = $dbh->prepare("INSERT INTO phptest (a, b) VALUES (?, 'a')"); -$sth2 = $dbh->prepare("INSERT INTO phptest (a,b) VALUES (!,?)"); -$sth3 = $dbh->prepare("INSERT INTO phptest (a,b,c) VALUES (?,!,&)"); -$sth4 = $dbh->prepare("INSERT INTO phptest (a, b) VALUES (72, 'direct')"); -print "sth1,sth2,sth3,sth4 created\n"; -print 'sth1: ? as param, passing as array... '; -if (($res = $dbh->execute($sth1, array(72))) === DB_OK) { - print "sth1 executed\n"; -} else { - print "sth1 failed\n"; -} - -print 'sth2: ! and ? as params, passing as array... '; -if (($res = $dbh->execute($sth2, array(72, "that's right"))) === DB_OK) { - print "sth2 executed\n"; -} else { - print "sth2 failed\n"; -} - -print 'sth3: ?, ! and & as params, passing as array... '; -switch ($dbh->phptype) { - case 'msql': - $res = $dbh->execute($sth3, array(72, "'it\\'s good'", $tmpfile)); - break; - default: - $res = $dbh->execute($sth3, array(72, "'it''s good'", $tmpfile)); -} -if ($res === DB_OK) { - print "sth3 executed\n"; -} else { - print "sth3 failed\n"; -} - -print 'sth4: no params... '; -if (($res = $dbh->execute($sth4)) === DB_OK) { - print "sth4 executed\n"; -} else { - print "sth4 failed\n"; -} -print_results(); - - -// 2) One prepared, multiple time executed -echo "\n------------2------------\n"; - -$dbh->query('DELETE FROM phptest'); -$sth = $dbh->prepare('INSERT INTO phptest (a, b, c, d) VALUES (?, ?, &, ?)'); -$data = array( - 0 => array(72, 'set1', $tmpfile, '1234-56-78'), - 1 => array(72, 'set2', $tmpfile, null), - 2 => array(72, 'set3', $tmpfile, null) -); -$res = $dbh->executeMultiple($sth, $data); -print_results(); - - -// 3) freePrepared() test -echo "\n------------3------------\n"; - -if ($dbh->freePrepared($sth)) { - echo 'TRUE'; -} else { - echo 'FALSE'; -} -echo "\n"; -if ($dbh->freePrepared(666)) { - echo 'TRUE'; -} else { - echo 'FALSE'; -} -echo "\n"; - - -// 4) SELECTs tests -echo "\n------------4------------\n"; -$sth1 = $dbh->prepare("SELECT * FROM phptest WHERE a = ? ORDER BY b"); -print_4($sth1, 72); -print_4($sth1, 71); -$sth2 = $dbh->prepare("SELECT * FROM phptest WHERE d = ? ORDER BY b"); -print_4($sth2, '1234-56-78'); -$sth3 = $dbh->prepare("SELECT * FROM phptest WHERE c = & ORDER BY b"); -print_4($sth3, $tmpfile); - - -// 5) ASSOCIATIVE ARRAY queries -echo "\n------------5------------\n"; - -$sth5 = $dbh->prepare('INSERT INTO phptest (a, b, d) VALUES (?, ?, ?)'); -$array = array( - 'foo' => 11, - 'bar' => 'three', - 'baz' => null, -); -$res = $dbh->execute($sth5, $array); -print 'insert: ' . ($res === DB_OK ? 'okay' : 'error') . "\n"; - -$sth6 = $dbh->prepare('SELECT a, b, d FROM phptest WHERE a = ?'); -$res = $dbh->execute($sth6, array(11)); -$row = $res->fetchRow(DB_FETCHMODE_ASSOC); -print "a = {$row['a']}, b = {$row['b']}, d = "; -if ($dbh->phptype == 'msql') { - if (array_key_exists('d', $row)) { - $type = gettype($row['d']); - if ($type == 'NULL' || $row['d'] == '') { - print "got expected outcome\n"; - } else { - $type = gettype($row['d']); - print "UN-expected outcome: $type\n"; - } - } else { - // http://bugs.php.net/?id=31960 - print "Prior to PHP 4.3.11 or 5.0.4, PHP's msql extension silently" - . " dropped columns with null values. You need to upgrade.\n"; - } -} else { - $type = gettype($row['d']); - if ($type == 'string') { - print "got expected outcome\n"; - } else { - print "UN-expected outcome: $type\n"; - } -} - -/** - * Automatically free the prepared statements and results when the script - * terminates - * - * @return void - */ -function my_shutdown() { - global $tmpfile, $dbh, $sth1, $sth2, $sth3, $sth4, $sth5, $sth6, $res; - - switch ($dbh->phptype) { - case 'ibase': - /* - * Interbase doesn't allow dropping tables that have result - * sets still open. - */ - $dbh->freePrepared($sth1); - $dbh->freePrepared($sth2); - $dbh->freePrepared($sth3); - $dbh->freePrepared($sth4); - $dbh->freePrepared($sth5); - $dbh->freePrepared($sth6); - $dbh->freeResult($res->result); - break; - } - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - unlink($tmpfile); -} - -/** - * Print out the data in test table - * - * @return void - */ -function print_results() { - global $dbh; - print "results:\n"; - $res = $dbh->query("SELECT * FROM phptest WHERE a = 72 ORDER BY b"); - $i = 0; - while ($row = $res->fetchRow(DB_FETCHMODE_ORDERED)) { - print '|' . implode(" - ", $row) . "|\n"; - $i++; - } - if (!$i) { - print "The records were not found. Did they get inserted?\n"; - } -} - -/** - * Execute the prepared statement and print out the data in the result - * - * @param resource $sth the statement handle to process - * @param string|array $bind the data that will replace the placeholders - * - * @return void - */ -function print_4($sth, $bind) { - global $dbh; - $res = $dbh->execute($sth, $bind); - while ($row = $res->fetchRow(DB_FETCHMODE_ORDERED)) { - print '|' . implode(" - ", $row) . "|\n"; - } - echo "~~\n"; -} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/run.cvs b/campcaster/src/tools/pear/src/tests/DB/tests/run.cvs deleted file mode 100644 index 3a939c450..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/run.cvs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh - -# $Id: run.cvs,v 1.3 2004/02/20 18:57:51 danielc Exp $ - -# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -# PEAR DB TEST STARTER -# -# To run all tests: ./run -# To run one test: ./run -# Example: ./run db_parsedsn.phpt -# -# Before running the tests you must adjust the -# following three variables: - -# The full path to your PHP directory: - DB_TEST_PHP_PATH=c:/progra~1/php - -# The name of your PHP CLI executable -# (examples php.exe, php-cli.exe, cli/php.exe): - DB_TEST_PHP_CLI=php.exe - -# The full path to the present directory -# (not using $PWD due to Cygwin): - DB_TEST_DIR=d:/peartest/pear/DB/tests - -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - - - -TEST_PHP_EXECUTABLE=$DB_TEST_PHP_PATH/$DB_TEST_PHP_CLI -export TEST_PHP_EXECUTABLE - -if [ $# -gt 0 ] -then - test=$1 -else - test=*.phpt -fi - -$TEST_PHP_EXECUTABLE $DB_TEST_PHP_PATH/run-tests.php $DB_TEST_DIR/${test} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/sequences.inc b/campcaster/src/tools/pear/src/tests/DB/tests/sequences.inc deleted file mode 100644 index 9e6aa8432..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/sequences.inc +++ /dev/null @@ -1,129 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: sequences.inc,v 1.11 2005/02/18 22:38:43 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Local error handler - */ -function error_handler(&$obj) { - print "sequences.inc error_handler:\n "; - print $obj->getDebugInfo() . "\n\n"; -} -ob_implicit_flush(true); - -$drop = $dbh->dropSequence('test'); -if (DB::isError($drop) && - $drop->getCode() != DB_ERROR_NOSUCHTABLE) -{ - print "Could not drop sequence...\n"; - print $drop->getDebugInfo() . "\n\n"; - if ($dbh->phptype == 'ibase' && - $drop->getCode() == DB_ERROR_ACCESS_VIOLATION) - { - print "Use this query to provide the permissions needed:\n"; - print ' grant all on RDB$GENERATORS to '; - } - exit; -} - -// 1) test that sequences are not created if "ondemand" is false - -$e = $dbh->nextId("test", false); -if (DB::isError($e) && $e->getCode() == DB_ERROR_NOSUCHTABLE) { - print "an error is the proper response here\n"; -} else { - if (DB::isError($e)) { - if ($dbh->phptype == 'ibase' && $e->getCode() == DB_ERROR_SYNTAX) { - print "an error is the proper response here\n"; - } else { - print "test 1) we expected to get back 'DB Error: no such table'.\n"; - print "Here is the error we got:\n"; - print 'Code: ' . $e->getCode() . "\n"; - print 'Message: ' . $e->getMessage() . "\n"; - print 'Debug: ' . $e->getDebugInfo() . "\n\n"; - } - } else { - print "test 1) we expected to get back 'DB Error: no such table'.\n"; - print "But an error wasn't generated\n\n"; - } -} - -// 2) test that the sequence is not created but the error is -// handled by the class error handler -$dbh->setErrorHandling(PEAR_ERROR_PRINT, - "an error cought by the error handler is good\n"); -$e = $dbh->nextId("test", false); -if (!DB::isError($e)) { - print "test 2) failed!\n"; -} -$dbh->_default_error_mode = null; - -// 3) test that sequences are created if "ondemand" is true, and that -// two successive nextIds return adjacent values -$a = $dbh->nextId("test"); -$b = $dbh->nextId("test"); -if (DB::isError($a)) { - print 'a: ' . $a->getDebugInfo() . "\n\n"; -} else { - print "a=$a\n"; -} -if (DB::isError($b)) { - print 'b: ' . $b->getDebugInfo() . "\n\n"; -} else { - print "b=$b\n"; -} -if (!DB::isError($a) && !DB::isError($b)) { - print 'b-a=' . ($b-$a) . "\n"; -} - -// 4) test that the user-specified error handler is really disabled -// during nextId, with per-object handler as well as global handler -$dbh->dropSequence("test"); - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); -$c = $dbh->nextId("test"); -if (!DB::isError($c)) { - print "c=$c\n"; -} -$dbh->dropSequence("test"); -$dbh->_default_error_mode = null; -$d = $dbh->nextId("test"); -if (!DB::isError($d)) { - print "d=$d\n"; -} - -// 5) test that the sequence is handled right when the table is empty - -// Backend with real sequences may don't like that -PEAR::pushErrorHandling(PEAR_ERROR_RETURN); -$dbh->query('DELETE FROM test_seq'); -PEAR::popErrorHandling(); -$e = $dbh->nextID('test'); -if (DB::isError($d)) { - print 'e: ' . $d->getDebugInfo() . "\n\n"; -} else { - print "e=$d\n"; -} - -// final clean-up -$dbh->dropSequence("test"); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/simplequery.inc b/campcaster/src/tools/pear/src/tests/DB/tests/simplequery.inc deleted file mode 100644 index 2cdfd9f1a..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/simplequery.inc +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: simplequery.inc,v 1.8 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Local error callback handler - * - * Drops the phptest table, prints out an error message and kills the - * process. - * - * @param object $o PEAR error object automatically passed to this method - * @return void - * @see PEAR::setErrorHandling() - */ -function pe($o) { - global $dbh; - - $dbh->setErrorHandling(PEAR_ERROR_RETURN); - drop_table($dbh, 'phptest'); - - die($o->toString()); -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'pe'); - - -$sth = $dbh->simpleQuery("SELECT * FROM phptest"); - -switch ($dbh->phptype) { - case 'mysqli': - if (is_a($sth, 'mysqli_result')) { - print "passed\n"; - } else { - print "PROBLEM\n"; - } - break; - default: - if (gettype($sth) == 'resource') { - print "passed\n"; - } else { - print "PROBLEM\n"; - } -} - - -switch ($dbh->phptype) { - case 'ibase': - /* - * Interbase doesn't allow dropping tables that have result - * sets still open. - */ - $dbh->freeResult($sth); - break; -} -$dbh->setErrorHandling(PEAR_ERROR_RETURN); -drop_table($dbh, 'phptest'); diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/skipif.inc b/campcaster/src/tools/pear/src/tests/DB/tests/skipif.inc deleted file mode 100644 index 84b729d5f..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/skipif.inc +++ /dev/null @@ -1,30 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: skipif.inc,v 1.2 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -/** - * Set up the include_path, error_reporting and PATH_SEPARATOR - */ -require_once './include.inc'; - -if (!include_once 'DB.php') { - print 'skip could not find DB.php'; -} diff --git a/campcaster/src/tools/pear/src/tests/DB/tests/transactions.inc b/campcaster/src/tools/pear/src/tests/DB/tests/transactions.inc deleted file mode 100644 index ca1817d2d..000000000 --- a/campcaster/src/tools/pear/src/tests/DB/tests/transactions.inc +++ /dev/null @@ -1,101 +0,0 @@ - - * @copyright 1997-2005 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version $Id: transactions.inc,v 1.9 2005/02/03 05:49:44 danielc Exp $ - * @link http://pear.php.net/package/DB - */ - -// Testing here due to skip not working currently in head -if (!$dbh->features['transactions']) { - die('this driver does not support transactions'); -} - -// View the table from a separate connection so we don't disturb -// the transaction. -$dbh2 = DB::connect($dbh->dsn); - -function error_handler(&$obj) { - print "\n" . $obj->getDebugInfo() . "\n"; -} - -function dumptable($expected) { - global $dbh, $dbh2; - print implode(' ', $dbh->getCol('SELECT b FROM phptest')); - - if (isset($dbh->transaction_opcount)) { - if ($expected == $dbh->transaction_opcount) { - print ". ops=ok\n"; - } else { - print ". ops=$dbh->transaction_opcount\n"; - } - } else { - print ". ops=ok\n"; - } -} - -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); - - -$dbh->autoCommit(true); -$dbh->query("INSERT INTO phptest VALUES(1, 'one', 'One', '2001-02-19')"); - -print '1) after autocommit: '; -dumptable(0); - -$dbh->autoCommit(false); -$dbh->query("INSERT INTO phptest VALUES(2, 'two', 'Two', '2001-02-20')"); -$dbh->query("INSERT INTO phptest VALUES(3, 'three', 'Three', '2001-02-21')"); -print '2) before commit: '; -dumptable(2); - -$dbh->commit(); -print '3) after commit: '; -dumptable(0); - -$dbh->query("INSERT INTO phptest VALUES(4, 'four', 'Four', '2001-02-22')"); -$dbh->query("INSERT INTO phptest VALUES(5, 'five', 'Five', '2001-02-23')"); -print '4) before rollback: '; -dumptable(2); - -$dbh->rollback(); -print '5) after rollback: '; -dumptable(0); -$dbh->rollback(); - -$dbh->autoCommit(true); -$dbh->query("INSERT INTO phptest VALUES(6, 'six', 'Six', '2001-02-24')"); -$dbh->query("INSERT INTO phptest VALUES(7, 'seven', 'Seven', '2001-02-25')"); -print '6) before autocommit+rollback: '; -dumptable(0); - -$dbh->rollback(); -print '7) after autocommit+rollback: '; -dumptable(0); - -print '8) testing that select doesn\'t disturbe opcount: '; -$dbh->autoCommit(false); -$dbh->simpleQuery("SELECT * FROM phptest"); -$dbh->simpleQuery("SELECT a,c FROM phptest"); -$dbh->simpleQuery("SELECT b,d FROM phptest"); -if (empty($dbh->transaction_opcount)) { - print "ok\n"; -} else { - print "failed (count=$dbh->transaction_opcount)\n"; -} diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/001.csv b/campcaster/src/tools/pear/src/tests/File/tests/CSV/001.csv deleted file mode 100644 index d217fb0fc..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/001.csv +++ /dev/null @@ -1,4 +0,0 @@ -"Field 1-1", "Field 1-2", "Field 1-3", "Field 1-4" -"Field 2-1", "Field 2-2", "Field 2-3" -"Field 3-1", "Field 3-2" -"Field 4-1" diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/001.phpt b/campcaster/src/tools/pear/src/tests/File/tests/CSV/001.phpt deleted file mode 100644 index 1ec4dca08..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/001.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -File_CSV Test Case 001: Fields count less than expected ---FILE-- - ---EXPECT-- -Format: -Array -( - [fields] => 4 - [sep] => , - [quote] => " -) - -Data: -Array -( - [0] => Array - ( - [0] => Field 1-1 - [1] => Field 1-2 - [2] => Field 1-3 - [3] => Field 1-4 - ) - - [1] => Array - ( - [0] => Field 2-1 - [1] => Field 2-2 - [2] => Field 2-3 - [3] => - ) - - [2] => Array - ( - [0] => Field 3-1 - [1] => Field 3-2 - [2] => - [3] => - ) - - [3] => Array - ( - [0] => Field 4-1 - [1] => - [2] => - [3] => - ) - -) \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/002.csv b/campcaster/src/tools/pear/src/tests/File/tests/CSV/002.csv deleted file mode 100644 index bcd6ce0ca..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/002.csv +++ /dev/null @@ -1,4 +0,0 @@ -"Field 1-1", "Field 1-2", "Field 1-3", "Field 1-4" -"Field 2-1", "Field 2-2", "Field 2-3", "Field 2-4", "Extra Field" -"Field 3-1", "Field 3-2" -"Field 4-1" diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/002.phpt b/campcaster/src/tools/pear/src/tests/File/tests/CSV/002.phpt deleted file mode 100644 index 958ded195..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/002.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -File_CSV Test Case 002: Fields count more than expected ---FILE-- - ---EXPECT-- -Format: -Array -( - [fields] => 4 - [sep] => , - [quote] => " -) - -Data: -Array -( - [0] => Array - ( - [0] => Field 1-1 - [1] => Field 1-2 - [2] => Field 1-3 - [3] => Field 1-4 - ) - - [1] => Array - ( - [0] => Field 2-1 - [1] => Field 2-2 - [2] => Field 2-3 - [3] => Field 2-4 - ) - - [2] => Array - ( - [0] => Field 3-1 - [1] => Field 3-2 - [2] => - [3] => - ) - - [3] => Array - ( - [0] => Field 4-1 - [1] => - [2] => - [3] => - ) - -) \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/003.csv b/campcaster/src/tools/pear/src/tests/File/tests/CSV/003.csv deleted file mode 100644 index 2309d7257..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/003.csv +++ /dev/null @@ -1,4 +0,0 @@ -"Field 1-1","Field 1-2","Field 1-3","Field 1-4" -"Field 2-1","Field 2-2","Field 2-3","I'm multiline -Field" -"Field 3-1","Field 3-2","Field 3-3" diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/003.phpt b/campcaster/src/tools/pear/src/tests/File/tests/CSV/003.phpt deleted file mode 100644 index be572b3b8..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/003.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -File_CSV Test Case 003: Windows EOL ---FILE-- - ---EXPECT-- -Format: -Array -( - [fields] => 4 - [sep] => , - [quote] => " -) - -Data: -Array -( - [0] => Array - ( - [0] => Field 1-1 - [1] => Field 1-2 - [2] => Field 1-3 - [3] => Field 1-4 - ) - - [1] => Array - ( - [0] => Field 2-1 - [1] => Field 2-2 - [2] => Field 2-3 - [3] => I'm multiline -Field - ) - - [2] => Array - ( - [0] => Field 3-1 - [1] => Field 3-2 - [2] => Field 3-3 - [3] => - ) - -) \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/004.csv b/campcaster/src/tools/pear/src/tests/File/tests/CSV/004.csv deleted file mode 100644 index 62cb0f7a6..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/004.csv +++ /dev/null @@ -1,4 +0,0 @@ -"Field 1-1","Field 1-2","Field 1-3","Field 1-4" -"Field 2-1","Field 2-2","Field 2-3","I'm multiline -Field" -"Field 3-1","Field 3-2","Field 3-3" diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/004.phpt b/campcaster/src/tools/pear/src/tests/File/tests/CSV/004.phpt deleted file mode 100644 index 6a85f7a58..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/004.phpt +++ /dev/null @@ -1,66 +0,0 @@ ---TEST-- -File_CSV Test Case 004: Unix EOL ---FILE-- - ---EXPECT-- -Format: -Array -( - [fields] => 4 - [sep] => , - [quote] => " -) - -Data: -Array -( - [0] => Array - ( - [0] => Field 1-1 - [1] => Field 1-2 - [2] => Field 1-3 - [3] => Field 1-4 - ) - - [1] => Array - ( - [0] => Field 2-1 - [1] => Field 2-2 - [2] => Field 2-3 - [3] => I'm multiline -Field - ) - - [2] => Array - ( - [0] => Field 3-1 - [1] => Field 3-2 - [2] => Field 3-3 - [3] => - ) - -) \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/005.csv b/campcaster/src/tools/pear/src/tests/File/tests/CSV/005.csv deleted file mode 100644 index 3b26aa998..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/005.csv +++ /dev/null @@ -1 +0,0 @@ -"Field 1-1","Field 1-2","Field 1-3","Field 1-4" "Field 2-1","Field 2-2","Field 2-3","I'm multiline Field" "Field 3-1","Field 3-2","Field 3-3" \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/005.phpt b/campcaster/src/tools/pear/src/tests/File/tests/CSV/005.phpt deleted file mode 100644 index c982c6585..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/005.phpt +++ /dev/null @@ -1,84 +0,0 @@ ---TEST-- -File_CSV Test Case 005: Mac EOL ---FILE-- - $row) { - if (strpos($row, "\r") !== false) { - $row = str_replace("\r", "_r_", $row); - } - if (strpos($row, "\n") !== false) { - $str = str_replace("\n", "_n_", $row); - } - if (strpos($row, "\t") !== false) { - $row = str_replace("\t", "_t_", $row); - } - $data[$key] = $row; - } - return $data; -} - -$data = array_map('_dbgBuff', $data); - -print "Data:\n"; -print_r($data); -?> ---EXPECT-- -Format: -Array -( - [fields] => 4 - [sep] => , - [quote] => " -) - -Data: -Array -( - [0] => Array - ( - [0] => Field 1-1 - [1] => Field 1-2 - [2] => Field 1-3 - [3] => Field 1-4 - ) - - [1] => Array - ( - [0] => Field 2-1 - [1] => Field 2-2 - [2] => Field 2-3 - [3] => I'm multiline_r_Field - ) - - [2] => Array - ( - [0] => Field 3-1 - [1] => Field 3-2 - [2] => Field 3-3 - [3] => - ) - -) \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/CSV/tests.txt b/campcaster/src/tools/pear/src/tests/File/tests/CSV/tests.txt deleted file mode 100644 index 5d6ffe41c..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/CSV/tests.txt +++ /dev/null @@ -1,12 +0,0 @@ -File_CSV Test Case -================== - - Case Covered Notes --------------------------------------------------------------------------------- -001 Fields count less than expected [x] -002 Fields count more than expected [x] High risk possibility - discovered fields count - wrong -003 Windows EOL [x] -004 Unix EOL [x] -005 Mac EOL [x] diff --git a/campcaster/src/tools/pear/src/tests/File/tests/FileTest.php b/campcaster/src/tools/pear/src/tests/File/tests/FileTest.php deleted file mode 100644 index 1a10e118b..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/FileTest.php +++ /dev/null @@ -1,226 +0,0 @@ -PHPUnit_TestCase($name); - } - - function getTestString() - { - static $str; - isset($str) or $str = str_repeat(str_repeat("0123456789", 1000)."\n", 100); - return $str; - } - - function getTestLine() - { - static $str; - isset($str) or $str = str_repeat("0123456789", 1000); - return $str; - } - - function setUp() - { - $this->tearDown(); - if (PEAR::isError($e = File::write('test.txt', $this->getTestString(), FILE_MODE_WRITE))) { - die("Cannot start test: ". str_replace($this->getTestString(),'...', $e->getMessage())); - } - } - - function tearDown() - { - File::closeAll(); - file_exists('test.txt') and unlink('test.txt'); - } - - function testlocking() - { - $this->assertFalse(PEAR::isError(File::write('test.txt', 'abc', FILE_MODE_APPEND, true))); - $this->assertTrue(PEAR::isError(File::write('test.txt', 'def', FILE_MODE_WRITE, true))); - $this->assertFalse(PEAR::isError(File::unlock('test.txt', FILE_MODE_APPEND))); - $this->assertFalse(PEAR::isError(File::unlock('test.txt', FILE_MODE_WRITE))); - } - - function testclose() - { - $this->assertFalse(PEAR::isError(File::close('test.txt', FILE_MODE_WRITE))); - $this->assertFalse(PEAR::isError(File::close('test.txt', FILE_MODE_APPEND))); - $this->assertFalse(PEAR::isError(File::close('test.txt', FILE_MODE_READ))); - } - - function testreadAll() - { - $this->assertEquals($this->getTestString(), File::readAll('test.txt')); - $this->assertEquals($this->getTestString(), File::readAll('test.txt')); - $this->assertEquals($this->getTestString(), File::readAll('test.txt')); - } - - function testread() - { - $this->assertEquals($this->getTestLine(), File::read('test.txt', 10000)); - $this->assertEquals("\n", File::read('test.txt', 1)); - $this->assertEquals('0123456789', File::read('test.txt', 10)); - } - - function testwrite() - { - $this->assertFalse(PEAR::isError($bytes = File::write('test.txt', '0123456789'))); - $this->assertEquals(10, $bytes); - } - - function testreadChar() - { - $this->assertFalse(PEAR::isError(File::rewind('test.txt', FILE_MODE_READ))); - $this->assertEquals('0', File::readChar('test.txt')); - $this->assertEquals('1', File::readChar('test.txt')); - $this->assertEquals('2', File::readChar('test.txt')); - $this->assertEquals('3', File::readChar('test.txt')); - $this->assertEquals('4', File::readChar('test.txt')); - $this->assertEquals('5', File::readChar('test.txt')); - $this->assertEquals('6', File::readChar('test.txt')); - $this->assertEquals('7', File::readChar('test.txt')); - $this->assertEquals('8', File::readChar('test.txt')); - $this->assertEquals('9', File::readChar('test.txt')); - $this->assertEquals('0', File::readChar('test.txt')); - } - - function testwriteChar() - { - $this->assertEquals(1, File::writeChar('test.txt', 'a')); - $this->assertEquals(1, File::writeChar('test.txt', 'b')); - $this->assertEquals(1, File::writeChar('test.txt', 'c')); - $this->assertEquals(1, File::writeChar('test.txt', 'd')); - $this->assertEquals(1, File::writeChar('test.txt', 'e')); - $this->assertEquals(1, File::writeChar('test.txt', 'f')); - $this->assertEquals(1, File::writeChar('test.txt', 'g')); - $this->assertEquals(1, File::writeChar('test.txt', 'h')); - $this->assertEquals(1, File::writeChar('test.txt', 'i')); - $this->assertEquals(1, File::writeChar('test.txt', 'j')); - } - - function testreadLine() - { - $this->assertFalse(PEAR::isError(File::rewind('test.txt', FILE_MODE_READ))); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - $this->assertEquals($this->getTestLine(), File::readLine('test.txt')); - } - - function testwriteLine() - { - $line = $this->getTestLine(); - $length = strlen($line) + 1; - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - $this->assertEquals($length, File::writeLine('test.txt', $line)); - } - - function testrewind() - { - $this->assertFalse(PEAR::isError(File::rewind('test.txt', FILE_MODE_WRITE))); - $this->assertFalse(PEAR::isError(File::rewind('test.txt', FILE_MODE_READ))); - } - - function testbuildPath() - { - $path = array( - 'some', - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - 'weird'.DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR, - DIRECTORY_SEPARATOR.'path'.DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, - ); - $built = implode(DIRECTORY_SEPARATOR, array('some','weird','path','','')); - $this->assertEquals($built, File::buildPath($path)); - } - - function testskipRoot() - { - if (OS_WINDOWS) { - $this->assertEquals('WINDOWS', File::skipRoot('C:\\WINDOWS')); - $this->assertEquals('WINDOWS', File::skipRoot('C:\\\\WINDOWS')); - $this->assertEquals('WINDOWS', File::skipRoot('C:/WINDOWS')); - } else { - $this->assertEquals('usr/share/pear', File::skipRoot('/usr/share/pear')); - } - } - - function testgetTempDir() - { - $dir = File::getTempDir(); - $this->assertTrue(is_dir($dir), "is_dir($dir)"); - } - - function testgetTempFile() - { - $tmp = File::getTempFile(); - $this->assertTrue(file_exists($tmp)); - } - - function testisAbsolute() - { - $this->assertFalse(File::isAbsolute('abra/../cadabra')); - $this->assertFalse(File::isAbsolute('data/dir')); - if (OS_WINDOWS) { - $this->assertTrue(File::isAbsolute('C:\\\\data')); - $this->assertTrue(File::isAbsolute('d:/data')); - $this->assertFalse(File::isAbsolute('\\')); - } else { - $this->assertTrue(File::isAbsolute('/')); - $this->assertFalse(File::isAbsolute('\\')); - $this->assertTrue(File::isAbsolute('~mike/bin')); - } - } - - function testrelativePath() - { - $this->assertEquals('tests/File', File::relativePath('/usr/share/pear/tests/File', '/usr/share/pear', '/')); - $this->assertEquals('../etc', File::relativePath('/etc', '/usr', '/')); - $this->assertEquals('D:\\Data', File::relativePath('D:\\Data', 'C:\\Data', '\\')); - if (OS_WINDOWS) { - $this->assertEquals('data\\dir', File::relativePath('/var/data/dir', '/var')); - } else { - $this->assertEquals('data/dir', File::relativePath('/var/data/dir', '/var')); - } - $this->assertEquals('../', File::relativePath('data', 'data/dir', '/')); - } - - function testrealpath() - { - $drive = OS_WINDOWS ? substr(getcwd(),0, 2) :''; - $this->assertEquals($drive . '/a/weird/path/is', File::realpath('/a\\weird//path\is/that/./../', '/')); - $this->assertEquals($drive . '/a/weird/path/is/that', File::realpath('/a\\weird//path\is/that/./../that/.', '/')); - } -} - -$result = &PHPUnit::run(new PHPUnit_TestSuite('FileTest')); -echo $result->toString(); - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/parser.php b/campcaster/src/tools/pear/src/tests/File/tests/parser.php deleted file mode 100644 index 0c764db88..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/parser.php +++ /dev/null @@ -1,31 +0,0 @@ - 4, - 'sep' => "\t", - 'quote' => '"', - 'header' => false -); -//*/ -ob_implicit_flush(true); -$argv = $_SERVER['argv']; -$file = $argv[1]; -$write = (isset($argv[2])) ? $argv[2] : false; -PEAR::setErrorHandling(PEAR_ERROR_PRINT, "warning: %s\n"); - -$conf = File_CSV::discoverFormat($file); -while ($fields = File_CSV::read($file, $conf)) { - if ($write) { - File_CSV::write($write, $fields, $conf); - } - print_r($fields); -} - -var_dump($conf); -echo "\n" - -?> \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File/tests/test.csv b/campcaster/src/tools/pear/src/tests/File/tests/test.csv deleted file mode 100644 index e74f4a25f..000000000 --- a/campcaster/src/tools/pear/src/tests/File/tests/test.csv +++ /dev/null @@ -1,18 +0,0 @@ -f1 f2 f3 f4 -good1 good2 good3 good4 -;;;;; ;;;;; ;;;;; ;;;;; -: : : ; ; " ". " ::::;;;;" -no"quote no"qu"ote n"quote" n"q"u"o"t" -"quote1" "quote2" noquote3" noquote4 -test1 "long -test2" "long test3 with seps" "I'm - silly - long" -less1 "less2 ." less3 -isvalid1 isvalid2 isvalid3 isvalid4 -more21 "more22 ." more23 more24 more25 more26 -isvalid21 isvalid22 isvalid23 isvalid24 -lessnoq31 lessnoq32 lessnoq33 -isvalid31 isvalid32 isvalid33 isvalid34 -morenoq41 morenoq42 morenoq43 morenoq44 morenoq45 -isvalid41 isvalid42 isvalid43 isvalid44 diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/01glob.phpt b/campcaster/src/tools/pear/src/tests/File_Find/tests/01glob.phpt deleted file mode 100644 index 5f55173b0..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/01glob.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -File_Find::glob() ---SKIPIF-- - ---FILE-- -glob( '/.*txt/', $tmpdir.'/File_Find/dir/', 'perl' ) ; -$result1 = &$ff->glob( '/.*txt/', $tmpdir.'/File_Find/dir', 'perl' ) ; -$result2 = &File_Find::glob( '/.*txt/', $tmpdir.'/File_Find/dir/', 'perl' ) ; -$result3 = &File_Find::glob( '/.*txt/', '/nosuch/', 'perl' ) ; - -print_r($result0); -print_r($result1); -print_r($result2); -print $result3->getMessage(); - -?> ---GET-- ---POST-- ---EXPECT-- -Array -( - [0] => 1.txt - [1] => 2.txt - [2] => txtdir -) -Array -( - [0] => 1.txt - [1] => 2.txt - [2] => txtdir -) -Array -( - [0] => 1.txt - [1] => 2.txt - [2] => txtdir -) -Cannot open directory - diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/02maptree.phpt b/campcaster/src/tools/pear/src/tests/File_Find/tests/02maptree.phpt deleted file mode 100644 index 5146d5c39..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/02maptree.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -File_Find::mapTree() ---SKIPIF-- - ---FILE-- -mapTree('File_Find/dir/') ; -$result[1] = $ff->mapTree('File_Find/dir') ; -$result[2] = File_Find::mapTree('File_Find/dir') ; - -if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - foreach($result as $k => $r) { - $result[$k][0] = str_replace("\\", '/', $result[$k][0]); - $result[$k][1] = str_replace("\\", '/', $result[$k][1]); - } -} - -print_r($result[0]); -print_r($result[1]); -print_r($result[2]); - -?> ---GET-- ---POST-- ---EXPECT-- -Array -( - [0] => Array - ( - [0] => File_Find/dir - [1] => File_Find/dir/txtdir - [2] => File_Find/dir/dir3 - [3] => File_Find/dir/dir2 - ) - - [1] => Array - ( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.bak - [4] => File_Find/dir/dir3/4.txt - [5] => File_Find/dir/dir2/3.bak - [6] => File_Find/dir/dir2/3.txt - ) - -) -Array -( - [0] => Array - ( - [0] => File_Find/dir - [1] => File_Find/dir/txtdir - [2] => File_Find/dir/dir3 - [3] => File_Find/dir/dir2 - ) - - [1] => Array - ( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.bak - [4] => File_Find/dir/dir3/4.txt - [5] => File_Find/dir/dir2/3.bak - [6] => File_Find/dir/dir2/3.txt - ) - -) -Array -( - [0] => Array - ( - [0] => File_Find/dir - [1] => File_Find/dir/txtdir - [2] => File_Find/dir/dir3 - [3] => File_Find/dir/dir2 - ) - - [1] => Array - ( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.bak - [4] => File_Find/dir/dir3/4.txt - [5] => File_Find/dir/dir2/3.bak - [6] => File_Find/dir/dir2/3.txt - ) - -) diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/03maptreemultiple.phpt b/campcaster/src/tools/pear/src/tests/File_Find/tests/03maptreemultiple.phpt deleted file mode 100644 index 2dd7ad2ad..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/03maptreemultiple.phpt +++ /dev/null @@ -1,91 +0,0 @@ ---TEST-- -File_Find::mapTreeMultiple() ---SKIPIF-- - ---FILE-- -mapTreeMultiple('File_Find//dir/') ; -$result1 = $ff->mapTreeMultiple('File_Find/dir') ; -$result2 = File_Find::mapTreeMultiple('File_Find/dir') ; - -print_r($result0); -print_r($result1); -print_r($result2); - -?> ---GET-- ---POST-- ---EXPECT-- -Array -( - [0] => 1.txt - [1] => 2.txt - [dir2] => Array - ( - [0] => 3.bak - [1] => 3.txt - ) - - [dir3] => Array - ( - [0] => 4.bak - [1] => 4.txt - ) - - [txtdir] => Array - ( - [0] => 5.txt - ) - -) -Array -( - [0] => 1.txt - [1] => 2.txt - [dir2] => Array - ( - [0] => 3.bak - [1] => 3.txt - ) - - [dir3] => Array - ( - [0] => 4.bak - [1] => 4.txt - ) - - [txtdir] => Array - ( - [0] => 5.txt - ) - -) -Array -( - [0] => 1.txt - [1] => 2.txt - [dir2] => Array - ( - [0] => 3.bak - [1] => 3.txt - ) - - [dir3] => Array - ( - [0] => 4.bak - [1] => 4.txt - ) - - [txtdir] => Array - ( - [0] => 5.txt - ) - -) - diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/04search.phpt b/campcaster/src/tools/pear/src/tests/File_Find/tests/04search.phpt deleted file mode 100644 index c9b1dd4ef..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/04search.phpt +++ /dev/null @@ -1,53 +0,0 @@ ---TEST-- -File_Find::search() ---SKIPIF-- - ---FILE-- -search('/txt/', 'File_Find/dir/', 'perl') ; -$result[1] = $ff->search('/txt/', 'File_Find/dir', 'perl') ; -$result[2] = File_Find::search('/3/', 'File_Find/dir/', 'perl') ; - -if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - foreach($result as $k => $r) { - $result[$k] = str_replace("\\", '/', $result[$k]); - } -} - -print_r($result[0]); -print_r($result[1]); -print_r($result[2]); - -?> ---GET-- ---POST-- ---EXPECT-- -Array -( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.txt - [4] => File_Find/dir/dir2/3.txt -) -Array -( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.txt - [4] => File_Find/dir/dir2/3.txt -) -Array -( - [0] => File_Find/dir/dir3/4.bak - [1] => File_Find/dir/dir3/4.txt - [2] => File_Find/dir/dir2/3.bak - [3] => File_Find/dir/dir2/3.txt -) \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/05search_inside.phpt b/campcaster/src/tools/pear/src/tests/File_Find/tests/05search_inside.phpt deleted file mode 100644 index db36a3cab..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/05search_inside.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -File_Find::search() inside another object ---SKIPIF-- - ---FILE-- -search('/txt/', 'File_Find/dir/', 'perl') ; -$result[1] = $f->search('/txt/', 'File_Find/dir', 'perl') ; -$result[2] = Foo::search('/txt/', 'File_Find/dir/', 'perl') ; - -if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - foreach($result as $k => $r) { - $result[$k] = str_replace("\\", '/', $result[$k]); - } -} - -print_r($result[0]); -print_r($result[1]); -print_r($result[2]); - -?> ---GET-- ---POST-- ---EXPECT-- -Array -( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.txt - [4] => File_Find/dir/dir2/3.txt -) -Array -( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.txt - [4] => File_Find/dir/dir2/3.txt -) -Array -( - [0] => File_Find/dir/1.txt - [1] => File_Find/dir/2.txt - [2] => File_Find/dir/txtdir/5.txt - [3] => File_Find/dir/dir3/4.txt - [4] => File_Find/dir/dir2/3.txt -) diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/bug2773.phpt b/campcaster/src/tools/pear/src/tests/File_Find/tests/bug2773.phpt deleted file mode 100644 index 70b887ebb..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/bug2773.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -File_Find bug #2773 ---SKIPIF-- - ---FILE-- -mapTreeMultiple('File_Find/dir2') ; -$result2 = File_Find::mapTreeMultiple('File_Find/dir2') ; - -print_r($result); -print_r($result2); - -?> ---GET-- ---POST-- ---EXPECT-- -Array -( - [0] => Array - ( - [0] => 1.txt - ) - - [1] => Array - ( - [0] => 1.txt - ) - - [2] => Array - ( - [0] => 1.txt - ) - -) -Array -( - [0] => Array - ( - [0] => 1.txt - ) - - [1] => Array - ( - [0] => 1.txt - ) - - [2] => Array - ( - [0] => 1.txt - ) - -) diff --git a/campcaster/src/tools/pear/src/tests/File_Find/tests/setup.php b/campcaster/src/tools/pear/src/tests/File_Find/tests/setup.php deleted file mode 100644 index e64ad2f48..000000000 --- a/campcaster/src/tools/pear/src/tests/File_Find/tests/setup.php +++ /dev/null @@ -1,46 +0,0 @@ - diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/001.phpt b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/001.phpt deleted file mode 100644 index 79f5af6ad..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/001.phpt +++ /dev/null @@ -1,49 +0,0 @@ ---TEST-- -XML Parser: parse simple string ---SKIPIF-- - ---FILE-- -XML_Parser(); - } - function startHandler($xp, $element, $attribs) { - print "<$element"; - reset($attribs); - while (list($key, $val) = each($attribs)) { - $enc = htmlentities($val); - print " $key=\"$enc\""; - } - print ">"; - } - function endHandler($xp, $element) { - print "\n"; - } - function cdataHandler($xp, $cdata) { - print ""; - } - function defaultHandler($xp, $cdata) { - - } -} -error_reporting(1023); -print "new __TestParser1 "; -var_dump(get_class($o = new __TestParser1())); -print "parseString "; -var_dump($o->parseString("foo", 1)); - -?> ---EXPECT-- -new __TestParser1 string(13) "__testparser1" -parseString -bool(true) diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/002.phpt b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/002.phpt deleted file mode 100644 index d40d341a3..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/002.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -XML Parser: parse from file ---SKIPIF-- - ---FILE-- -XML_Parser(); - } - function startHandler($xp, $element, $attribs) { - print "<$element"; - reset($attribs); - while (list($key, $val) = each($attribs)) { - $enc = htmlentities($val); - print " $key=\"$enc\""; - } - print ">"; - } - function endHandler($xp, $element) { - print "\n"; - } - function cdataHandler($xp, $cdata) { - print ""; - } - function defaultHandler($xp, $cdata) { - - } -} -print "new __TestParser2 "; -var_dump(get_class($o = new __TestParser2())); -print "setInputFile "; -print is_resource($o->setInputFile("test2.xml"))."\n"; -print "parse "; -var_dump($o->parse()); - -?> ---EXPECT-- -new __TestParser2 string(13) "__testparser2" -setInputFile 1 -parse -bool(true) diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/003.phpt b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/003.phpt deleted file mode 100644 index 6b54e689a..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/003.phpt +++ /dev/null @@ -1,55 +0,0 @@ ---TEST-- -XML Parser: parse from file resource ---SKIPIF-- - ---FILE-- -XML_Parser(); - } - function startHandler($xp, $element, $attribs) { - print "<$element"; - reset($attribs); - while (list($key, $val) = each($attribs)) { - $enc = htmlentities($val); - print " $key=\"$enc\""; - } - print ">"; - } - function endHandler($xp, $element) { - print "\n"; - } - function cdataHandler($xp, $cdata) { - print ""; - } - function defaultHandler($xp, $cdata) { - - } -} -print "new __TestParser3 "; -var_dump(get_class($o = new __TestParser3())); -print "fopen "; -print is_resource($fp = fopen("test3.xml", "r"))."\n"; -print "setInput "; -var_dump($o->setInput($fp)); -print "parse "; -var_dump($o->parse()); - -?> ---EXPECT-- -new __TestParser3 string(13) "__testparser3" -fopen 1 -setInput bool(true) -parse -bool(true) diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/004.phpt b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/004.phpt deleted file mode 100644 index b4631454a..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/004.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -XML Parser: error class ---SKIPIF-- - ---FILE-- -parseString("
", true); -if (PEAR::isError($e)) { - printf("error message: %s\n", $e->getMessage()); -} else { - print "no error\n"; -} - -?> ---EXPECT-- -new XML_Parser string(10) "xml_parser" -error message: XML_Parser: mismatched tag at XML input line 1 diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/005.phpt b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/005.phpt deleted file mode 100644 index b900606f0..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/005.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -XML Parser: mixing character encodings ---SKIPIF-- - ---FILE-- - ISO-8859-1 -// 2 UTF-8 -> US-ASCII -// 3 ISO-8859-1 -> UTF-8 -// 4 ISO-8859-1 -> US-ASCII -// 5 US-ASCII -> UTF-8 -// 6 US-ASCII -> ISO-8859-1 -// - -require_once "../Parser.php"; - -class TestEncodings1 extends XML_Parser { - var $output = ''; - - function TestEncodings1($to, $from) { - $this->XML_Parser($from, 'event', $to); - } - function startHandler($xp, $elem, $attribs) { - $this->output .= "<$elem>"; - } - function endHandler($xp, $elem) { - $this->output .= ""; - } - function cdataHandler($xp, $data) { - $this->output .= $data; - } - function test($data) { - // $this->output = ''; - $this->parseString($data, true); - return $this->output; - } -} - -$xml = ""; -$input = array( - "UTF-8" => "abcæøå", - "ISO-8859-1" => "abcæøå", - "US-ASCII" => "abcaoa" -); - -$encodings = array_keys($input); -foreach ($input as $srcenc => $string) { - foreach ($encodings as $tgtenc) { - if ($srcenc == $tgtenc) { - continue; - } - print "Testing $srcenc -> $tgtenc: "; - $p =& new TestEncodings1($tgtenc, $srcenc); - $e = $p->test($input[$srcenc]); - if (PEAR::isError($e)) { - printf("OOPS: %s\n", $e->getMessage()); - } else { - var_dump($e); - } - } -} - -?> ---EXPECT-- -Testing UTF-8 -> ISO-8859-1: string(13) "abcæøå" -Testing UTF-8 -> US-ASCII: string(13) "abc???" -Testing ISO-8859-1 -> UTF-8: string(16) "abcæøå" -Testing ISO-8859-1 -> US-ASCII: string(13) "abc???" -Testing US-ASCII -> UTF-8: string(13) "abcaoa" -Testing US-ASCII -> ISO-8859-1: string(13) "abcaoa" diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/test2.xml b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/test2.xml deleted file mode 100644 index b21ff3540..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/test2.xml +++ /dev/null @@ -1,2 +0,0 @@ - -foo \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/test3.xml b/campcaster/src/tools/pear/src/tests/XML_Parser/tests/test3.xml deleted file mode 100644 index b21ff3540..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_Parser/tests/test3.xml +++ /dev/null @@ -1,2 +0,0 @@ - -foo \ No newline at end of file diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/allgot.inc b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/allgot.inc deleted file mode 100644 index 3a74d531c..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/allgot.inc +++ /dev/null @@ -1,58 +0,0 @@ - - * @copyright 2005-2006 The PHP Group - * @license http://www.php.net/license/3_01.txt PHP License - * @version CVS: $Id: allgot.inc,v 1.2 2006/06/11 00:25:17 danielc Exp $ - * @link http://pear.php.net/package/XML_RPC - * @since File available since Release 1.4.4 - */ - -ob_start(); - -function returnAllGot($params) { - $out = ''; - $count = count($params->params); - for ($i = 0; $i < $count; $i++) { - $param = $params->getParam($i); - if (!XML_RPC_Value::isValue($param)) { - $out .= "parameter $i was error: $param\n"; - continue; - } - $got = XML_RPC_Decode($param); - $out .= "param $i: " . var_export($got, true) . "\n"; - } - $val = new XML_RPC_Value($out, 'string'); - return new XML_RPC_Response($val); -} - -$server = new XML_RPC_Server( - array( - 'allgot' => array( - 'function' => 'returnAllGot', - ), - ) -); - -$got = ob_get_clean(); - -if ($got == $expect) { - echo "passed\n"; -} else { - echo "FAILED\n"; - echo "Expected:\n$expect\n"; - echo "Got:\n$got\n"; -} diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value-struct.php b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value-struct.php deleted file mode 100644 index 81473476a..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value-struct.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright 2005-2006 The PHP Group - * @license http://www.php.net/license/3_0.txt PHP License - * @version CVS: $Id: empty-value-struct.php,v 1.2 2006/06/11 00:25:17 danielc Exp $ - * @link http://pear.php.net/package/XML_RPC - * @since File available since Release 1.4.4 - */ - -/* - * If the package version number is found in the left hand - * portion of the if() expression below, that means this file has - * come from the PEAR installer. Therefore, let's test the - * installed version of XML_RPC which should be in the include path. - * - * If the version has not been substituted in the if() expression, - * this file has likely come from a CVS checkout or a .tar file. - * Therefore, we'll assume the tests should use the version of - * XML_RPC that has come from there as well. - */ -if ('1.5.0' != '@'.'package_version'.'@') { - /** - * Get the needed class from the PEAR installation - */ - require_once 'XML/RPC/Server.php'; -} else { - if (substr(dirname(__FILE__), -9, -6) != 'XML') { - echo "The parent directory must be named 'XML'.\n"; - exit; - } - - ini_set('include_path', '../../' - . PATH_SEPARATOR . '.' . PATH_SEPARATOR - . ini_get('include_path') - ); - - /** - * Get the needed class from the parent directory - */ - require_once '../Server.php'; -} - -$GLOBALS['HTTP_RAW_POST_DATA'] = << - - allgot - - - - - - fld1 - - - -EOPOST; - -$expect = << - - - -param 0: array ( - 'fld1' => '', -) - - - - -EOEXP; - -include './allgot.inc'; diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value.php b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value.php deleted file mode 100644 index 576b0aa3e..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/empty-value.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @copyright 2005-2006 The PHP Group - * @license http://www.php.net/license/3_01.txt PHP License - * @version CVS: $Id: empty-value.php,v 1.2 2006/06/11 00:25:17 danielc Exp $ - * @link http://pear.php.net/package/XML_RPC - * @since File available since Release 1.4.4 - */ - -/* - * If the package version number is found in the left hand - * portion of the if() expression below, that means this file has - * come from the PEAR installer. Therefore, let's test the - * installed version of XML_RPC which should be in the include path. - * - * If the version has not been substituted in the if() expression, - * this file has likely come from a CVS checkout or a .tar file. - * Therefore, we'll assume the tests should use the version of - * XML_RPC that has come from there as well. - */ -if ('1.5.0' != '@'.'package_version'.'@') { - /** - * Get the needed class from the PEAR installation - */ - require_once 'XML/RPC/Server.php'; -} else { - if (substr(dirname(__FILE__), -9, -6) != 'XML') { - echo "The parent directory must be named 'XML'.\n"; - exit; - } - - ini_set('include_path', '../../' - . PATH_SEPARATOR . '.' . PATH_SEPARATOR - . ini_get('include_path') - ); - - /** - * Get the needed class from the parent directory - */ - require_once '../Server.php'; -} - -$GLOBALS['HTTP_RAW_POST_DATA'] = << - - allgot - - - first - - - - -EOPOST; - -$expect = << - - - -param 0: '' -param 1: 'first' -param 2: ' ' -param 3: '' - - - - -EOEXP; - -include './allgot.inc'; diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/extra-lines.php b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/extra-lines.php deleted file mode 100644 index 33f588351..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/extra-lines.php +++ /dev/null @@ -1,109 +0,0 @@ - - * @copyright 2005-2006 The PHP Group - * @license http://www.php.net/license/3_01.txt PHP License - * @version CVS: $Id: extra-lines.php,v 1.2 2006/06/11 00:25:17 danielc Exp $ - * @link http://pear.php.net/package/XML_RPC - * @since File available since Release 1.4.4 - */ - -/* - * If the package version number is found in the left hand - * portion of the if() expression below, that means this file has - * come from the PEAR installer. Therefore, let's test the - * installed version of XML_RPC which should be in the include path. - * - * If the version has not been substituted in the if() expression, - * this file has likely come from a CVS checkout or a .tar file. - * Therefore, we'll assume the tests should use the version of - * XML_RPC that has come from there as well. - */ -if ('1.5.0' != '@'.'package_version'.'@') { - /** - * Get the needed class from the PEAR installation - */ - require_once 'XML/RPC.php'; -} else { - if (substr(dirname(__FILE__), -9, -6) != 'XML') { - echo "The parent directory must be named 'XML'.\n"; - exit; - } - - ini_set('include_path', '../../' - . PATH_SEPARATOR . '.' . PATH_SEPARATOR - . ini_get('include_path') - ); - - /** - * Get the needed class from the parent directory - */ - require_once '../RPC.php'; -} - -$input = "First lfs\n\nSecond crlfs\r\n\r\nThird crs\r\rFourth line"; - -$expect_removed = " - -nada - - -First lfs -Second crlfs -Third crs -Fourth line - - - -"; - -$expect_not_removed = " - -nada - - -First lfs - -Second crlfs - -Third crs - -Fourth line - - - -"; - - -$msg = new XML_RPC_Message('nada', array(XML_RPC_encode($input))); -$msg->createPayload(); -if ($msg->payload == $expect_removed) { - echo "passed\n"; -} else { - echo "PROBLEM\n"; -} - -$msg = new XML_RPC_Message('nada', array(XML_RPC_encode($input))); -$msg->remove_extra_lines = false; -$msg->createPayload(); -if ($msg->payload == $expect_not_removed) { - echo "passed\n"; -} else { - echo "PROBLEM\n"; -} diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/protoport.php b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/protoport.php deleted file mode 100644 index 178b49c3f..000000000 --- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/protoport.php +++ /dev/null @@ -1,437 +0,0 @@ - - * @copyright 2005-2006 The PHP Group - * @license http://www.php.net/license/3_01.txt PHP License - * @version CVS: $Id: protoport.php,v 1.6 2006/06/11 00:25:17 danielc Exp $ - * @link http://pear.php.net/package/XML_RPC - * @since File available since Release 1.2 - */ - -/* - * If the package version number is found in the left hand - * portion of the if() expression below, that means this file has - * come from the PEAR installer. Therefore, let's test the - * installed version of XML_RPC which should be in the include path. - * - * If the version has not been substituted in the if() expression, - * this file has likely come from a CVS checkout or a .tar file. - * Therefore, we'll assume the tests should use the version of - * XML_RPC that has come from there as well. - */ -if ('1.5.0' != '@'.'package_version'.'@') { - /** - * Get the needed class from the PEAR installation - */ - require_once 'XML/RPC.php'; -} else { - /** - * Get the needed class from the parent directory - */ - require_once '../RPC.php'; -} - -/** - * Compare the test result to the expected result - * - * If the test fails, echo out the results. - * - * @param array $expect the array of object properties you expect - * from the test - * @param object $actual the object results from the test - * @param string $test_name the name of the test - * - * @return void - */ -function compare($expect, $actual, $test_name) { - $actual = get_object_vars($actual); - if (count(array_diff($actual, $expect))) { - echo "$test_name failed.\nExpect: "; - print_r($expect); - echo "Actual: "; - print_r($actual); - echo "\n"; - } -} - -if (php_sapi_name() != 'cli') { - echo "
\n";
-}
-
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 80,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'theserver');
-compare($x, $c, 'defaults');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 80,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'http://theserver');
-compare($x, $c, 'defaults with http');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 443,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'https://theserver');
-compare($x, $c, 'defaults with https');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 443,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'ssl://theserver');
-compare($x, $c, 'defaults with ssl');
-
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 65,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'theserver', 65);
-compare($x, $c, 'port 65');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 65,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'http://theserver', 65);
-compare($x, $c, 'port 65 with http');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 65,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'https://theserver', 65);
-compare($x, $c, 'port 65 with https');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 65,
-    'proxy' => '',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'ssl://theserver', 65);
-compare($x, $c, 'port 65 with ssl');
-
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 80,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'theserver', 0,
-                        'theproxy');
-compare($x, $c, 'defaults proxy');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 80,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 8080,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'http://theserver', 0,
-                        'http://theproxy');
-compare($x, $c, 'defaults with http proxy');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 443,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'ssl://',
-    'proxy_port' => 443,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'https://theserver', 0,
-                        'https://theproxy');
-compare($x, $c, 'defaults with https proxy');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 443,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'ssl://',
-    'proxy_port' => 443,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'ssl://theserver', 0,
-                        'ssl://theproxy');
-compare($x, $c, 'defaults with ssl proxy');
-
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 65,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 6565,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'theserver', 65,
-                        'theproxy', 6565);
-compare($x, $c, 'port 65 proxy 6565');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 65,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'http://',
-    'proxy_port' => 6565,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'http://theserver', 65,
-                        'http://theproxy', 6565);
-compare($x, $c, 'port 65 with http proxy 6565');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 65,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'ssl://',
-    'proxy_port' => 6565,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'https://theserver', 65,
-                        'https://theproxy', 6565);
-compare($x, $c, 'port 65 with https proxy 6565');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 65,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'ssl://',
-    'proxy_port' => 6565,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'ssl://theserver', 65,
-                        'ssl://theproxy', 6565);
-compare($x, $c, 'port 65 with ssl proxy 6565');
-
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'ssl://',
-    'port' => 443,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'ssl://',
-    'proxy_port' => 443,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'theserver', 443,
-                        'theproxy', 443);
-compare($x, $c, 'port 443 no protocol and proxy port 443 no protocol');
-
-$x = array(
-    'path' => 'thepath',
-    'server' => 'theserver',
-    'protocol' => 'http://',
-    'port' => 80,
-    'proxy' => 'theproxy',
-    'proxy_protocol' => 'ssl://',
-    'proxy_port' => 6565,
-    'proxy_user' => '',
-    'proxy_pass' => '',
-    'errno' => 0,
-    'errstring' => '',
-    'debug' => 0,
-    'username' => '',
-    'password' => '',
-);
-$c = new XML_RPC_Client('thepath', 'theserver', 0,
-                        'ssl://theproxy', 6565);
-compare($x, $c, 'port 443 no protocol and proxy port 443 no protocol');
-
-echo "\nIf no other output was produced, these tests passed.\n";
diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/test_Dump.php b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/test_Dump.php
deleted file mode 100644
index 242601cbc..000000000
--- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/test_Dump.php
+++ /dev/null
@@ -1,50 +0,0 @@
-new XML_RPC_Value('das ist der Titel', 'string'),
-    'startDate'=>new XML_RPC_Value(mktime(0,0,0,13,11,2004), 'dateTime.iso8601'),
-    'endDate'  =>new XML_RPC_Value(mktime(0,0,0,15,11,2004), 'dateTime.iso8601'),
-    'error'    =>'string',
-    'arkey'    => new XML_RPC_Value( array(
-        new XML_RPC_Value('simple string'),
-        new XML_RPC_Value(12345, 'int')
-        ), 'array')
-    )
-    ,'struct');
-
-XML_RPC_Dump($val);
-
-echo '==============' . "\r\n";
-$val2 = new XML_RPC_Value(44353, 'int');
-XML_RPC_Dump($val2);
-
-echo '==============' . "\r\n";
-$val3 = new XML_RPC_Value('this should be a string', 'string');
-XML_RPC_Dump($val3);
-
-echo '==============' . "\r\n";
-$val4 = new XML_RPC_Value(true, 'boolean');
-XML_RPC_Dump($val4);
diff --git a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/types.php b/campcaster/src/tools/pear/src/tests/XML_RPC/tests/types.php
deleted file mode 100644
index 8de7d8369..000000000
--- a/campcaster/src/tools/pear/src/tests/XML_RPC/tests/types.php
+++ /dev/null
@@ -1,132 +0,0 @@
-
- * @copyright  2005-2006 The PHP Group
- * @license    http://www.php.net/license/3_01.txt  PHP License
- * @version    CVS: $Id: types.php,v 1.2 2006/06/11 00:25:17 danielc Exp $
- * @link       http://pear.php.net/package/XML_RPC
- * @since      File available since Release 1.4.4
- */
-
-/*
- * If the package version number is found in the left hand
- * portion of the if() expression below, that means this file has
- * come from the PEAR installer.  Therefore, let's test the
- * installed version of XML_RPC which should be in the include path.
- * 
- * If the version has not been substituted in the if() expression,
- * this file has likely come from a CVS checkout or a .tar file.
- * Therefore, we'll assume the tests should use the version of
- * XML_RPC that has come from there as well.
- */
-if ('1.5.0' != '@'.'package_version'.'@') {
-    /**
-     * Get the needed class from the PEAR installation
-     */
-    require_once 'XML/RPC/Server.php';
-} else {
-    if (substr(dirname(__FILE__), -9, -6) != 'XML') {
-        echo "The parent directory must be named 'XML'.\n";
-        exit;
-    }
-
-    ini_set('include_path', '../../'
-            . PATH_SEPARATOR . '.' . PATH_SEPARATOR
-            . ini_get('include_path')
-    );
-
-    /**
-     * Get the needed class from the parent directory
-     */
-    require_once '../Server.php';
-}
-
-$GLOBALS['HTTP_RAW_POST_DATA'] = <<
-
- allgot
-  
-   default to string
-   inside string
-   8
-   20050809T01:33:44
-
-   
-    
-     
-      
-       
-        a
-       
-       
-        b
-       
-      
-     
-    
-   
-
-   
-    
-     
-      
-       a
-       
-        ay
-       
-      
-      
-       b
-       
-        be
-       
-      
-     
-    
-   
-
-  
- 
-EOPOST;
-
-$expect = <<
-
-
-
-param 0: 'default to string'
-param 1: 'inside string'
-param 2: '8'
-param 3: '20050809T01:33:44'
-param 4: array (
-  0 => 'a',
-  1 => 'b',
-)
-param 5: array (
-  'a' => 'ay',
-  'b' => 'be',
-)
-
-
-
-
-EOEXP;
-
-include './allgot.inc';