From 42da5aba81a80595161a87c9a03b929efb47b790 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 30 May 2008 11:40:08 +0000 Subject: [PATCH] Moving Cake folder to correct location git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7063 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/LICENSE.txt | 24 + cake/VERSION.txt | 9 + cake/basics.php | 1165 +++ cake/bootstrap.php | 51 + cake/config/config.php | 28 + cake/config/paths.php | 212 + cake/config/unicode/casefolding/0080_00ff.php | 81 + cake/config/unicode/casefolding/0100_017f.php | 114 + cake/config/unicode/casefolding/0180_024F.php | 156 + cake/config/unicode/casefolding/0250_02af.php | 49 + cake/config/unicode/casefolding/0370_03ff.php | 110 + cake/config/unicode/casefolding/0400_04ff.php | 172 + cake/config/unicode/casefolding/0500_052f.php | 56 + cake/config/unicode/casefolding/0530_058f.php | 86 + cake/config/unicode/casefolding/1e00_1eff.php | 176 + cake/config/unicode/casefolding/1f00_1fff.php | 224 + cake/config/unicode/casefolding/2100_214f.php | 52 + cake/config/unicode/casefolding/2150_218f.php | 65 + cake/config/unicode/casefolding/2460_24ff.php | 74 + cake/config/unicode/casefolding/2c00_2c5f.php | 95 + cake/config/unicode/casefolding/2c60_2c7f.php | 56 + cake/config/unicode/casefolding/2c80_2cff.php | 98 + cake/config/unicode/casefolding/ff00_ffef.php | 74 + cake/console/cake | 36 + cake/console/cake.bat | 37 + cake/console/cake.php | 562 ++ cake/console/error.php | 257 + cake/console/libs/acl.php | 519 + cake/console/libs/api.php | 218 + cake/console/libs/bake.php | 211 + cake/console/libs/console.php | 305 + cake/console/libs/i18n.php | 133 + cake/console/libs/schema.php | 401 + cake/console/libs/shell.php | 608 ++ cake/console/libs/tasks/controller.php | 580 ++ cake/console/libs/tasks/db_config.php | 355 + cake/console/libs/tasks/extract.php | 697 ++ cake/console/libs/tasks/model.php | 941 ++ cake/console/libs/tasks/plugin.php | 204 + cake/console/libs/tasks/project.php | 295 + cake/console/libs/tasks/test.php | 198 + cake/console/libs/tasks/view.php | 389 + cake/console/libs/templates/skel/.htaccess | 5 + .../libs/templates/skel/app_controller.php | 41 + .../libs/templates/skel/app_helper.php | 42 + .../console/libs/templates/skel/app_model.php | 43 + .../libs/templates/skel/config/acl.ini.php | 76 + .../libs/templates/skel/config/bootstrap.php | 46 + .../libs/templates/skel/config/core.php | 219 + .../skel/config/database.php.default | 103 + .../templates/skel/config/inflections.php | 72 + .../libs/templates/skel/config/routes.php | 46 + .../libs/templates/skel/config/sql/db_acl.php | 81 + .../libs/templates/skel/config/sql/db_acl.sql | 42 + .../libs/templates/skel/config/sql/i18n.php | 58 + .../libs/templates/skel/config/sql/i18n.sql | 28 + .../templates/skel/config/sql/sessions.php | 55 + .../templates/skel/config/sql/sessions.sql | 16 + .../skel/controllers/components/empty | 0 .../skel/controllers/pages_controller.php | 88 + cake/console/libs/templates/skel/index.php | 26 + .../skel/locale/eng/LC_MESSAGES/empty | 0 .../templates/skel/models/behaviors/empty | 0 .../templates/skel/models/datasources/empty | 0 .../console/libs/templates/skel/plugins/empty | 0 .../skel/tests/cases/behaviors/empty | 0 .../skel/tests/cases/components/empty | 0 .../skel/tests/cases/controllers/empty | 0 .../templates/skel/tests/cases/helpers/empty | 0 .../templates/skel/tests/cases/models/empty | 0 .../libs/templates/skel/tests/fixtures/empty | 0 .../libs/templates/skel/tests/groups/empty | 0 .../templates/skel/tmp/cache/models/empty | 0 .../templates/skel/tmp/cache/persistent/empty | 0 .../libs/templates/skel/tmp/cache/views/empty | 0 .../libs/templates/skel/tmp/logs/empty | 0 .../libs/templates/skel/tmp/sessions/empty | 0 .../libs/templates/skel/tmp/tests/empty | 0 .../templates/skel/vendors/shells/tasks/empty | 0 .../skel/vendors/shells/templates/empty | 0 .../views/elements/email/html/default.ctp | 33 + .../views/elements/email/text/default.ctp | 27 + .../libs/templates/skel/views/elements/empty | 0 .../libs/templates/skel/views/errors/empty | 0 .../libs/templates/skel/views/helpers/empty | 0 .../templates/skel/views/layouts/ajax.ctp | 27 + .../templates/skel/views/layouts/default.ctp | 69 + .../skel/views/layouts/email/html/default.ctp | 39 + .../skel/views/layouts/email/text/default.ctp | 31 + .../templates/skel/views/layouts/flash.ctp | 45 + .../skel/views/layouts/js/default.ctp | 2 + .../skel/views/layouts/rss/default.ctp | 17 + .../skel/views/layouts/xml/default.ctp | 2 + .../libs/templates/skel/views/pages/empty | 0 .../libs/templates/skel/views/scaffolds/empty | 0 .../libs/templates/skel/webroot/.htaccess | 6 + .../libs/templates/skel/webroot/css.php | 102 + .../skel/webroot/css/cake.generic.css | 418 + .../libs/templates/skel/webroot/favicon.ico | Bin 0 -> 4973 bytes .../templates/skel/webroot/img/cake.icon.gif | Bin 0 -> 1068 bytes .../templates/skel/webroot/img/cake.power.gif | Bin 0 -> 214 bytes .../libs/templates/skel/webroot/index.php | 89 + .../templates/skel/webroot/js/vendors.php | 43 + .../libs/templates/skel/webroot/test.php | 125 + cake/console/libs/templates/views/form.ctp | 71 + cake/console/libs/templates/views/home.ctp | 82 + cake/console/libs/templates/views/index.ctp | 101 + cake/console/libs/templates/views/view.ctp | 152 + cake/console/libs/testsuite.php | 354 + cake/dispatcher.php | 741 ++ cake/libs/cache.php | 448 + cake/libs/cache/apc.php | 92 + cake/libs/cache/file.php | 268 + cake/libs/cache/memcache.php | 149 + cake/libs/cache/xcache.php | 144 + cake/libs/cake_log.php | 102 + cake/libs/class_registry.php | 309 + cake/libs/configure.php | 1160 +++ cake/libs/controller/app_controller.php | 42 + cake/libs/controller/component.php | 145 + cake/libs/controller/components/acl.php | 627 ++ cake/libs/controller/components/auth.php | 825 ++ cake/libs/controller/components/cookie.php | 506 + cake/libs/controller/components/email.php | 776 ++ .../controller/components/request_handler.php | 709 ++ cake/libs/controller/components/security.php | 738 ++ cake/libs/controller/components/session.php | 307 + cake/libs/controller/controller.php | 1097 ++ cake/libs/controller/pages_controller.php | 88 + cake/libs/controller/scaffold.php | 527 + cake/libs/debugger.php | 541 + cake/libs/error.php | 329 + cake/libs/file.php | 572 ++ cake/libs/flay.php | 287 + cake/libs/folder.php | 800 ++ cake/libs/http_socket.php | 993 ++ cake/libs/i18n.php | 525 + cake/libs/inflector.php | 459 + cake/libs/l10n.php | 482 + cake/libs/magic_db.php | 299 + cake/libs/model/app_model.php | 42 + cake/libs/model/behavior.php | 470 + cake/libs/model/behaviors/acl.php | 118 + cake/libs/model/behaviors/containable.php | 405 + cake/libs/model/behaviors/translate.php | 471 + cake/libs/model/behaviors/tree.php | 912 ++ cake/libs/model/connection_manager.php | 266 + cake/libs/model/datasources/datasource.php | 512 + cake/libs/model/datasources/dbo/dbo_adodb.php | 518 + cake/libs/model/datasources/dbo/dbo_db2.php | 571 ++ .../model/datasources/dbo/dbo_firebird.php | 508 + cake/libs/model/datasources/dbo/dbo_mssql.php | 641 ++ cake/libs/model/datasources/dbo/dbo_mysql.php | 577 ++ .../libs/model/datasources/dbo/dbo_mysqli.php | 450 + cake/libs/model/datasources/dbo/dbo_odbc.php | 437 + .../libs/model/datasources/dbo/dbo_oracle.php | 1085 ++ .../model/datasources/dbo/dbo_postgres.php | 670 ++ .../libs/model/datasources/dbo/dbo_sqlite.php | 563 ++ .../libs/model/datasources/dbo/dbo_sybase.php | 387 + cake/libs/model/datasources/dbo_source.php | 2357 +++++ cake/libs/model/db_acl.php | 318 + cake/libs/model/model.php | 2655 +++++ cake/libs/model/schema.php | 479 + cake/libs/multibyte.php | 1078 ++ cake/libs/object.php | 287 + cake/libs/overloadable.php | 43 + cake/libs/overloadable_php4.php | 168 + cake/libs/overloadable_php5.php | 112 + cake/libs/router.php | 1313 +++ cake/libs/sanitize.php | 305 + cake/libs/security.php | 199 + cake/libs/session.php | 790 ++ cake/libs/set.php | 1116 ++ cake/libs/socket.php | 285 + cake/libs/string.php | 308 + cake/libs/validation.php | 914 ++ cake/libs/view/elements/dump.ctp | 32 + .../libs/view/elements/email/html/default.ctp | 33 + .../libs/view/elements/email/text/default.ctp | 27 + cake/libs/view/errors/error404.ctp | 31 + cake/libs/view/errors/missing_action.ctp | 53 + .../view/errors/missing_component_class.ctp | 46 + .../view/errors/missing_component_file.ctp | 46 + cake/libs/view/errors/missing_connection.ctp | 39 + cake/libs/view/errors/missing_controller.ctp | 47 + .../libs/view/errors/missing_helper_class.ctp | 46 + cake/libs/view/errors/missing_helper_file.ctp | 46 + cake/libs/view/errors/missing_layout.ctp | 39 + cake/libs/view/errors/missing_model.ctp | 48 + cake/libs/view/errors/missing_scaffolddb.ctp | 39 + cake/libs/view/errors/missing_table.ctp | 35 + cake/libs/view/errors/missing_view.ctp | 39 + cake/libs/view/errors/private_action.ctp | 35 + cake/libs/view/errors/scaffold_error.ctp | 42 + cake/libs/view/helper.php | 763 ++ cake/libs/view/helpers/ajax.php | 872 ++ cake/libs/view/helpers/app_helper.php | 42 + cake/libs/view/helpers/cache.php | 286 + cake/libs/view/helpers/form.php | 1700 ++++ cake/libs/view/helpers/html.php | 838 ++ cake/libs/view/helpers/javascript.php | 581 ++ cake/libs/view/helpers/js.php | 459 + cake/libs/view/helpers/number.php | 193 + cake/libs/view/helpers/paginator.php | 622 ++ cake/libs/view/helpers/rss.php | 266 + cake/libs/view/helpers/session.php | 203 + cake/libs/view/helpers/text.php | 329 + cake/libs/view/helpers/time.php | 538 + cake/libs/view/helpers/xml.php | 222 + cake/libs/view/layouts/ajax.ctp | 27 + cake/libs/view/layouts/default.ctp | 69 + cake/libs/view/layouts/email/html/default.ctp | 39 + cake/libs/view/layouts/email/text/default.ctp | 30 + cake/libs/view/layouts/flash.ctp | 45 + cake/libs/view/layouts/js/default.ctp | 2 + cake/libs/view/layouts/rss/default.ctp | 17 + cake/libs/view/layouts/xml/default.ctp | 2 + cake/libs/view/media.php | 185 + cake/libs/view/pages/home.ctp | 144 + cake/libs/view/scaffolds/edit.ctp | 53 + cake/libs/view/scaffolds/index.ctp | 99 + cake/libs/view/scaffolds/view.ctp | 161 + cake/libs/view/theme.php | 99 + cake/libs/view/view.php | 908 ++ cake/libs/xml.php | 1216 +++ cake/tests/cases/console/cake.test.php | 302 + cake/tests/cases/dispatcher.test.php | 1188 +++ cake/tests/cases/libs/cache.test.php | 109 + cake/tests/cases/libs/cache/apc.test.php | 99 + cake/tests/cases/libs/cache/file.test.php | 274 + cake/tests/cases/libs/cache/memcache.test.php | 118 + cake/tests/cases/libs/cache/xcache.test.php | 111 + cake/tests/cases/libs/cake_log.test.php | 53 + cake/tests/cases/libs/class_registry.test.php | 147 + .../cases/libs/code_coverage_manager.test.php | 583 ++ cake/tests/cases/libs/configure.test.php | 406 + .../cases/libs/controller/component.test.php | 88 + .../libs/controller/components/acl.test.php | 432 + .../libs/controller/components/auth.test.php | 591 ++ .../controller/components/cookie.test.php | 42 + .../libs/controller/components/email.test.php | 207 + .../components/request_handler.test.php | 282 + .../controller/components/security.test.php | 613 ++ .../controller/components/session.test.php | 243 + .../cases/libs/controller/controller.test.php | 511 + .../libs/controller/pages_controller.php | 42 + .../cases/libs/controller/scaffold.test.php | 78 + cake/tests/cases/libs/debugger.test.php | 198 + cake/tests/cases/libs/error.test.php | 270 + cake/tests/cases/libs/file.test.php | 385 + cake/tests/cases/libs/flay.test.php | 42 + cake/tests/cases/libs/folder.test.php | 358 + cake/tests/cases/libs/http_socket.test.php | 1281 +++ cake/tests/cases/libs/i18n.test.php | 1724 ++++ cake/tests/cases/libs/inflector.test.php | 193 + cake/tests/cases/libs/l10n.test.php | 42 + cake/tests/cases/libs/magic_db.test.php | 205 + cake/tests/cases/libs/model/behavior.test.php | 722 ++ .../libs/model/behaviors/containable.test.php | 3119 ++++++ .../libs/model/behaviors/translate.test.php | 507 + .../cases/libs/model/behaviors/tree.test.php | 970 ++ .../model/datasources/dbo/dbo_adodb.test.php | 215 + .../model/datasources/dbo/dbo_mssql.test.php | 195 + .../model/datasources/dbo/dbo_mysql.test.php | 226 + .../model/datasources/dbo/dbo_oracle.test.php | 61 + .../datasources/dbo/dbo_postgres.test.php | 220 + .../model/datasources/dbo_source.test.php | 2586 +++++ cake/tests/cases/libs/model/db_acl.test.php | 227 + cake/tests/cases/libs/model/model.test.php | 4195 ++++++++ cake/tests/cases/libs/model/models.php | 669 ++ cake/tests/cases/libs/model/schema.test.php | 268 + cake/tests/cases/libs/multibyte.test.php | 8972 +++++++++++++++++ cake/tests/cases/libs/object.test.php | 278 + cake/tests/cases/libs/overloadable.test.php | 42 + cake/tests/cases/libs/router.test.php | 1249 +++ cake/tests/cases/libs/sanitize.test.php | 333 + cake/tests/cases/libs/security.test.php | 117 + cake/tests/cases/libs/session.test.php | 235 + cake/tests/cases/libs/set.test.php | 1505 +++ cake/tests/cases/libs/socket.test.php | 135 + cake/tests/cases/libs/string.test.php | 168 + cake/tests/cases/libs/validation.test.php | 1529 +++ cake/tests/cases/libs/view/helper.test.php | 358 + .../cases/libs/view/helpers/ajax.test.php | 574 ++ .../cases/libs/view/helpers/cache.test.php | 56 + .../cases/libs/view/helpers/form.test.php | 3463 +++++++ .../cases/libs/view/helpers/html.test.php | 714 ++ .../libs/view/helpers/javascript.test.php | 528 + .../tests/cases/libs/view/helpers/js.test.php | 56 + .../cases/libs/view/helpers/number.test.php | 291 + .../libs/view/helpers/paginator.test.php | 467 + .../cases/libs/view/helpers/rss.test.php | 210 + .../cases/libs/view/helpers/session.test.php | 181 + .../cases/libs/view/helpers/text.test.php | 256 + .../cases/libs/view/helpers/time.test.php | 524 + .../cases/libs/view/helpers/xml.test.php | 207 + cake/tests/cases/libs/view/theme.test.php | 187 + cake/tests/cases/libs/view/view.test.php | 460 + cake/tests/cases/libs/xml.test.php | 451 + cake/tests/fixtures/aco_action_fixture.php | 49 + cake/tests/fixtures/aco_fixture.php | 59 + cake/tests/fixtures/aco_two_fixture.php | 61 + cake/tests/fixtures/ad_fixture.php | 25 + cake/tests/fixtures/advertisement_fixture.php | 49 + .../fixtures/another_article_fixture.php | 50 + cake/tests/fixtures/apple_fixture.php | 58 + cake/tests/fixtures/aro_fixture.php | 56 + cake/tests/fixtures/aro_two_fixture.php | 62 + cake/tests/fixtures/aros_aco_fixture.php | 49 + cake/tests/fixtures/aros_aco_two_fixture.php | 70 + .../fixtures/article_featured_fixture.php | 53 + .../article_featureds_tags_fixture.php | 45 + cake/tests/fixtures/article_fixture.php | 53 + cake/tests/fixtures/articles_tag_fixture.php | 50 + cake/tests/fixtures/attachment_fixture.php | 49 + cake/tests/fixtures/auth_user_fixture.php | 54 + cake/tests/fixtures/author_fixture.php | 52 + cake/tests/fixtures/bid_fixture.php | 50 + .../fixtures/cache_test_model_fixture.php | 44 + cake/tests/fixtures/callback_fixture.php | 51 + cake/tests/fixtures/campaign_fixture.php | 16 + cake/tests/fixtures/category_fixture.php | 54 + .../fixtures/category_thread_fixture.php | 55 + cake/tests/fixtures/comment_fixture.php | 56 + cake/tests/fixtures/data_test_fixture.php | 48 + cake/tests/fixtures/datatype_fixture.php | 47 + cake/tests/fixtures/dependency_fixture.php | 49 + cake/tests/fixtures/device_fixture.php | 49 + .../fixtures/device_type_category_fixture.php | 45 + cake/tests/fixtures/device_type_fixture.php | 52 + .../fixtures/document_directory_fixture.php | 45 + cake/tests/fixtures/document_fixture.php | 46 + .../exterior_type_category_fixture.php | 46 + cake/tests/fixtures/feature_set_fixture.php | 45 + cake/tests/fixtures/featured_fixture.php | 52 + cake/tests/fixtures/flag_tree_fixture.php | 49 + cake/tests/fixtures/home_fixture.php | 51 + cake/tests/fixtures/image_fixture.php | 49 + cake/tests/fixtures/item_fixture.php | 52 + .../fixtures/items_portfolio_fixture.php | 51 + cake/tests/fixtures/join_a_b_fixture.php | 55 + cake/tests/fixtures/join_a_c_fixture.php | 55 + cake/tests/fixtures/join_a_fixture.php | 54 + cake/tests/fixtures/join_b_fixture.php | 52 + cake/tests/fixtures/join_c_fixture.php | 52 + cake/tests/fixtures/join_thing_fixture.php | 55 + cake/tests/fixtures/message_fixture.php | 48 + cake/tests/fixtures/node_fixture.php | 51 + cake/tests/fixtures/number_tree_fixture.php | 48 + .../fixtures/numeric_article_fixture.php | 49 + cake/tests/fixtures/person_fixture.php | 58 + cake/tests/fixtures/portfolio_fixture.php | 48 + cake/tests/fixtures/post_fixture.php | 52 + cake/tests/fixtures/posts_tag_fixture.php | 50 + cake/tests/fixtures/primary_model_fixture.php | 46 + cake/tests/fixtures/project_fixture.php | 47 + cake/tests/fixtures/sample_fixture.php | 48 + .../fixtures/secondary_model_fixture.php | 46 + cake/tests/fixtures/session_fixture.php | 45 + .../tests/fixtures/something_else_fixture.php | 53 + cake/tests/fixtures/something_fixture.php | 53 + cake/tests/fixtures/syfile_fixture.php | 53 + cake/tests/fixtures/tag_fixture.php | 50 + .../fixtures/the_paper_monkies_fixture.php | 44 + cake/tests/fixtures/thread_fixture.php | 48 + cake/tests/fixtures/translate_fixture.php | 66 + .../fixtures/translate_table_fixture.php | 51 + .../fixtures/translated_item_fixture.php | 48 + .../fixtures/underscore_field_fixture.php | 49 + cake/tests/fixtures/user_fixture.php | 52 + cake/tests/fixtures/uuid_fixture.php | 52 + cake/tests/groups/acl.group.php | 46 + cake/tests/groups/cache.group.php | 45 + cake/tests/groups/components.group.php | 44 + cake/tests/groups/configure.group.php | 45 + cake/tests/groups/helpers.group.php | 45 + cake/tests/groups/lib.group.php | 43 + cake/tests/groups/lib_controller.group.php | 42 + cake/tests/groups/model.group.php | 49 + cake/tests/groups/no_database.group.php | 49 + cake/tests/groups/routing_system.group.php | 45 + cake/tests/groups/socket.group.php | 45 + cake/tests/groups/view.group.php | 45 + cake/tests/lib/cake_reporter.php | 215 + cake/tests/lib/cake_test_case.php | 718 ++ cake/tests/lib/cake_test_fixture.php | 185 + cake/tests/lib/cake_test_model.php | 40 + cake/tests/lib/cake_web_test_case.php | 41 + cake/tests/lib/cli_reporter.php | 106 + cake/tests/lib/code_coverage_manager.php | 741 ++ cake/tests/lib/content.php | 67 + cake/tests/lib/footer.php | 38 + cake/tests/lib/header.php | 59 + cake/tests/lib/simpletest.php | 38 + cake/tests/lib/test_manager.php | 554 + cake/tests/lib/xdebug.php | 33 + cake/tests/test_app/config/acl.ini.php | 67 + .../test_app/controllers/components/empty | 0 .../controllers/tests_apps_controller.php | 40 + .../test_app/locale/po/LC_MESSAGES/default.po | 71 + .../locale/rule_0_mo/LC_MESSAGES/core.mo | Bin 0 -> 673 bytes .../locale/rule_0_mo/LC_MESSAGES/default.mo | Bin 0 -> 617 bytes .../locale/rule_0_po/LC_MESSAGES/core.po | 21 + .../locale/rule_0_po/LC_MESSAGES/default.po | 24 + .../locale/rule_10_mo/LC_MESSAGES/core.mo | Bin 0 -> 845 bytes .../locale/rule_10_mo/LC_MESSAGES/default.mo | Bin 0 -> 759 bytes .../locale/rule_10_po/LC_MESSAGES/core.po | 24 + .../locale/rule_10_po/LC_MESSAGES/default.po | 27 + .../locale/rule_1_mo/LC_MESSAGES/core.mo | Bin 0 -> 704 bytes .../locale/rule_1_mo/LC_MESSAGES/default.mo | Bin 0 -> 638 bytes .../locale/rule_1_po/LC_MESSAGES/core.po | 22 + .../locale/rule_1_po/LC_MESSAGES/default.po | 25 + .../locale/rule_2_mo/LC_MESSAGES/core.mo | Bin 0 -> 699 bytes .../locale/rule_2_mo/LC_MESSAGES/default.mo | Bin 0 -> 633 bytes .../locale/rule_2_po/LC_MESSAGES/core.po | 22 + .../locale/rule_2_po/LC_MESSAGES/default.po | 25 + .../locale/rule_3_mo/LC_MESSAGES/core.mo | Bin 0 -> 790 bytes .../locale/rule_3_mo/LC_MESSAGES/default.mo | Bin 0 -> 714 bytes .../locale/rule_3_po/LC_MESSAGES/core.po | 23 + .../locale/rule_3_po/LC_MESSAGES/default.po | 26 + .../locale/rule_4_mo/LC_MESSAGES/core.mo | Bin 0 -> 758 bytes .../locale/rule_4_mo/LC_MESSAGES/default.mo | Bin 0 -> 682 bytes .../locale/rule_4_po/LC_MESSAGES/core.po | 23 + .../locale/rule_4_po/LC_MESSAGES/default.po | 26 + .../locale/rule_5_mo/LC_MESSAGES/core.mo | Bin 0 -> 806 bytes .../locale/rule_5_mo/LC_MESSAGES/default.mo | Bin 0 -> 658 bytes .../locale/rule_5_po/LC_MESSAGES/core.po | 23 + .../locale/rule_5_po/LC_MESSAGES/default.po | 24 + .../locale/rule_6_mo/LC_MESSAGES/core.mo | Bin 0 -> 841 bytes .../locale/rule_6_mo/LC_MESSAGES/default.mo | Bin 0 -> 765 bytes .../locale/rule_6_po/LC_MESSAGES/core.po | 23 + .../locale/rule_6_po/LC_MESSAGES/default.po | 26 + .../locale/rule_7_mo/LC_MESSAGES/core.mo | Bin 0 -> 850 bytes .../locale/rule_7_mo/LC_MESSAGES/default.mo | Bin 0 -> 774 bytes .../locale/rule_7_po/LC_MESSAGES/core.po | 23 + .../locale/rule_7_po/LC_MESSAGES/default.po | 26 + .../locale/rule_8_mo/LC_MESSAGES/core.mo | Bin 0 -> 774 bytes .../locale/rule_8_mo/LC_MESSAGES/default.mo | Bin 0 -> 698 bytes .../locale/rule_8_po/LC_MESSAGES/core.po | 23 + .../locale/rule_8_po/LC_MESSAGES/default.po | 26 + .../locale/rule_9_mo/LC_MESSAGES/core.mo | Bin 0 -> 819 bytes .../locale/rule_9_mo/LC_MESSAGES/default.mo | Bin 0 -> 743 bytes .../locale/rule_9_po/LC_MESSAGES/core.po | 23 + .../locale/rule_9_po/LC_MESSAGES/default.po | 26 + cake/tests/test_app/models/behaviors/empty | 0 cake/tests/test_app/models/datasources/empty | 0 .../components/test_plugin_component.php | 33 + .../test_plugin_other_component.php | 32 + .../tests_plugins_tests_controller.php | 40 + .../vendors/css/test_plugin_asset.css | 1 + .../vendors/sample/sample_plugin.php | 31 + .../views/helpers/test_plugin_helper.php | 33 + .../helpers/test_plugin_other_helper.php | 30 + .../test_plugin/views/layouts/default.ctp | 1 + .../test_plugin/views/test_plugin/index.ctp | 1 + .../views/tests_plugins_tests/index.ctp | 1 + .../test_plugin_theme/layouts/default.ctp | 1 + .../test_plugin_theme/test_plugin/index.ctp | 1 + cake/tests/test_app/tmp/dir_map | 2 + cake/tests/test_app/vendors/Test/MyTest.php | 30 + cake/tests/test_app/vendors/Test/hello.php | 30 + .../tests/test_app/vendors/css/test_asset.css | 1 + cake/tests/test_app/vendors/sample/sample.php | 31 + .../tests/test_app/vendors/shells/tasks/empty | 0 .../test_app/vendors/shells/templates/empty | 0 .../test_app/vendors/somename/some.name.php | 30 + cake/tests/test_app/views/elements/empty | 0 .../test_app/views/elements/test_element.ctp | 1 + cake/tests/test_app/views/errors/empty | 0 cake/tests/test_app/views/helpers/empty | 0 cake/tests/test_app/views/layouts/ajax.ctp | 27 + cake/tests/test_app/views/layouts/default.ctp | 67 + cake/tests/test_app/views/layouts/flash.ctp | 45 + .../test_app/views/layouts/js/default.ctp | 2 + .../test_app/views/layouts/rss/default.ctp | 17 + .../test_app/views/layouts/session_helper.ctp | 5 + .../test_app/views/layouts/xml/default.ctp | 2 + cake/tests/test_app/views/pages/empty | 0 cake/tests/test_app/views/pages/home.ctp | 80 + cake/tests/test_app/views/posts/index.ctp | 1 + .../views/posts/test_nocache_tags.ctp | 154 + cake/tests/test_app/views/scaffolds/empty | 0 .../tests/test_app/views/tests_apps/index.ctp | 1 + .../themed/test_theme/layouts/default.ctp | 1 + .../views/themed/test_theme/posts/index.ctp | 1 + 485 files changed, 119632 insertions(+) create mode 100644 cake/LICENSE.txt create mode 100644 cake/VERSION.txt create mode 100644 cake/basics.php create mode 100644 cake/bootstrap.php create mode 100644 cake/config/config.php create mode 100644 cake/config/paths.php create mode 100644 cake/config/unicode/casefolding/0080_00ff.php create mode 100644 cake/config/unicode/casefolding/0100_017f.php create mode 100644 cake/config/unicode/casefolding/0180_024F.php create mode 100644 cake/config/unicode/casefolding/0250_02af.php create mode 100644 cake/config/unicode/casefolding/0370_03ff.php create mode 100644 cake/config/unicode/casefolding/0400_04ff.php create mode 100644 cake/config/unicode/casefolding/0500_052f.php create mode 100644 cake/config/unicode/casefolding/0530_058f.php create mode 100644 cake/config/unicode/casefolding/1e00_1eff.php create mode 100644 cake/config/unicode/casefolding/1f00_1fff.php create mode 100644 cake/config/unicode/casefolding/2100_214f.php create mode 100644 cake/config/unicode/casefolding/2150_218f.php create mode 100644 cake/config/unicode/casefolding/2460_24ff.php create mode 100644 cake/config/unicode/casefolding/2c00_2c5f.php create mode 100644 cake/config/unicode/casefolding/2c60_2c7f.php create mode 100644 cake/config/unicode/casefolding/2c80_2cff.php create mode 100644 cake/config/unicode/casefolding/ff00_ffef.php create mode 100755 cake/console/cake create mode 100644 cake/console/cake.bat create mode 100644 cake/console/cake.php create mode 100644 cake/console/error.php create mode 100644 cake/console/libs/acl.php create mode 100644 cake/console/libs/api.php create mode 100644 cake/console/libs/bake.php create mode 100644 cake/console/libs/console.php create mode 100644 cake/console/libs/i18n.php create mode 100644 cake/console/libs/schema.php create mode 100644 cake/console/libs/shell.php create mode 100644 cake/console/libs/tasks/controller.php create mode 100644 cake/console/libs/tasks/db_config.php create mode 100644 cake/console/libs/tasks/extract.php create mode 100644 cake/console/libs/tasks/model.php create mode 100644 cake/console/libs/tasks/plugin.php create mode 100644 cake/console/libs/tasks/project.php create mode 100644 cake/console/libs/tasks/test.php create mode 100644 cake/console/libs/tasks/view.php create mode 100644 cake/console/libs/templates/skel/.htaccess create mode 100644 cake/console/libs/templates/skel/app_controller.php create mode 100644 cake/console/libs/templates/skel/app_helper.php create mode 100644 cake/console/libs/templates/skel/app_model.php create mode 100644 cake/console/libs/templates/skel/config/acl.ini.php create mode 100644 cake/console/libs/templates/skel/config/bootstrap.php create mode 100644 cake/console/libs/templates/skel/config/core.php create mode 100644 cake/console/libs/templates/skel/config/database.php.default create mode 100644 cake/console/libs/templates/skel/config/inflections.php create mode 100644 cake/console/libs/templates/skel/config/routes.php create mode 100644 cake/console/libs/templates/skel/config/sql/db_acl.php create mode 100644 cake/console/libs/templates/skel/config/sql/db_acl.sql create mode 100644 cake/console/libs/templates/skel/config/sql/i18n.php create mode 100644 cake/console/libs/templates/skel/config/sql/i18n.sql create mode 100644 cake/console/libs/templates/skel/config/sql/sessions.php create mode 100644 cake/console/libs/templates/skel/config/sql/sessions.sql create mode 100644 cake/console/libs/templates/skel/controllers/components/empty create mode 100644 cake/console/libs/templates/skel/controllers/pages_controller.php create mode 100644 cake/console/libs/templates/skel/index.php create mode 100644 cake/console/libs/templates/skel/locale/eng/LC_MESSAGES/empty create mode 100644 cake/console/libs/templates/skel/models/behaviors/empty create mode 100644 cake/console/libs/templates/skel/models/datasources/empty create mode 100644 cake/console/libs/templates/skel/plugins/empty create mode 100644 cake/console/libs/templates/skel/tests/cases/behaviors/empty create mode 100644 cake/console/libs/templates/skel/tests/cases/components/empty create mode 100644 cake/console/libs/templates/skel/tests/cases/controllers/empty create mode 100644 cake/console/libs/templates/skel/tests/cases/helpers/empty create mode 100644 cake/console/libs/templates/skel/tests/cases/models/empty create mode 100644 cake/console/libs/templates/skel/tests/fixtures/empty create mode 100644 cake/console/libs/templates/skel/tests/groups/empty create mode 100644 cake/console/libs/templates/skel/tmp/cache/models/empty create mode 100644 cake/console/libs/templates/skel/tmp/cache/persistent/empty create mode 100644 cake/console/libs/templates/skel/tmp/cache/views/empty create mode 100644 cake/console/libs/templates/skel/tmp/logs/empty create mode 100644 cake/console/libs/templates/skel/tmp/sessions/empty create mode 100644 cake/console/libs/templates/skel/tmp/tests/empty create mode 100644 cake/console/libs/templates/skel/vendors/shells/tasks/empty create mode 100644 cake/console/libs/templates/skel/vendors/shells/templates/empty create mode 100644 cake/console/libs/templates/skel/views/elements/email/html/default.ctp create mode 100644 cake/console/libs/templates/skel/views/elements/email/text/default.ctp create mode 100644 cake/console/libs/templates/skel/views/elements/empty create mode 100644 cake/console/libs/templates/skel/views/errors/empty create mode 100644 cake/console/libs/templates/skel/views/helpers/empty create mode 100644 cake/console/libs/templates/skel/views/layouts/ajax.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/default.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/email/html/default.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/email/text/default.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/flash.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/js/default.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/rss/default.ctp create mode 100644 cake/console/libs/templates/skel/views/layouts/xml/default.ctp create mode 100644 cake/console/libs/templates/skel/views/pages/empty create mode 100644 cake/console/libs/templates/skel/views/scaffolds/empty create mode 100644 cake/console/libs/templates/skel/webroot/.htaccess create mode 100644 cake/console/libs/templates/skel/webroot/css.php create mode 100644 cake/console/libs/templates/skel/webroot/css/cake.generic.css create mode 100644 cake/console/libs/templates/skel/webroot/favicon.ico create mode 100644 cake/console/libs/templates/skel/webroot/img/cake.icon.gif create mode 100644 cake/console/libs/templates/skel/webroot/img/cake.power.gif create mode 100644 cake/console/libs/templates/skel/webroot/index.php create mode 100644 cake/console/libs/templates/skel/webroot/js/vendors.php create mode 100644 cake/console/libs/templates/skel/webroot/test.php create mode 100644 cake/console/libs/templates/views/form.ctp create mode 100644 cake/console/libs/templates/views/home.ctp create mode 100644 cake/console/libs/templates/views/index.ctp create mode 100644 cake/console/libs/templates/views/view.ctp create mode 100644 cake/console/libs/testsuite.php create mode 100644 cake/dispatcher.php create mode 100644 cake/libs/cache.php create mode 100644 cake/libs/cache/apc.php create mode 100644 cake/libs/cache/file.php create mode 100644 cake/libs/cache/memcache.php create mode 100644 cake/libs/cache/xcache.php create mode 100644 cake/libs/cake_log.php create mode 100644 cake/libs/class_registry.php create mode 100644 cake/libs/configure.php create mode 100644 cake/libs/controller/app_controller.php create mode 100644 cake/libs/controller/component.php create mode 100644 cake/libs/controller/components/acl.php create mode 100644 cake/libs/controller/components/auth.php create mode 100644 cake/libs/controller/components/cookie.php create mode 100644 cake/libs/controller/components/email.php create mode 100644 cake/libs/controller/components/request_handler.php create mode 100644 cake/libs/controller/components/security.php create mode 100644 cake/libs/controller/components/session.php create mode 100644 cake/libs/controller/controller.php create mode 100644 cake/libs/controller/pages_controller.php create mode 100644 cake/libs/controller/scaffold.php create mode 100644 cake/libs/debugger.php create mode 100644 cake/libs/error.php create mode 100644 cake/libs/file.php create mode 100644 cake/libs/flay.php create mode 100644 cake/libs/folder.php create mode 100644 cake/libs/http_socket.php create mode 100644 cake/libs/i18n.php create mode 100644 cake/libs/inflector.php create mode 100644 cake/libs/l10n.php create mode 100644 cake/libs/magic_db.php create mode 100644 cake/libs/model/app_model.php create mode 100644 cake/libs/model/behavior.php create mode 100644 cake/libs/model/behaviors/acl.php create mode 100644 cake/libs/model/behaviors/containable.php create mode 100644 cake/libs/model/behaviors/translate.php create mode 100644 cake/libs/model/behaviors/tree.php create mode 100644 cake/libs/model/connection_manager.php create mode 100644 cake/libs/model/datasources/datasource.php create mode 100644 cake/libs/model/datasources/dbo/dbo_adodb.php create mode 100644 cake/libs/model/datasources/dbo/dbo_db2.php create mode 100644 cake/libs/model/datasources/dbo/dbo_firebird.php create mode 100644 cake/libs/model/datasources/dbo/dbo_mssql.php create mode 100644 cake/libs/model/datasources/dbo/dbo_mysql.php create mode 100644 cake/libs/model/datasources/dbo/dbo_mysqli.php create mode 100644 cake/libs/model/datasources/dbo/dbo_odbc.php create mode 100644 cake/libs/model/datasources/dbo/dbo_oracle.php create mode 100644 cake/libs/model/datasources/dbo/dbo_postgres.php create mode 100644 cake/libs/model/datasources/dbo/dbo_sqlite.php create mode 100644 cake/libs/model/datasources/dbo/dbo_sybase.php create mode 100644 cake/libs/model/datasources/dbo_source.php create mode 100644 cake/libs/model/db_acl.php create mode 100644 cake/libs/model/model.php create mode 100644 cake/libs/model/schema.php create mode 100644 cake/libs/multibyte.php create mode 100644 cake/libs/object.php create mode 100644 cake/libs/overloadable.php create mode 100644 cake/libs/overloadable_php4.php create mode 100644 cake/libs/overloadable_php5.php create mode 100644 cake/libs/router.php create mode 100644 cake/libs/sanitize.php create mode 100644 cake/libs/security.php create mode 100644 cake/libs/session.php create mode 100644 cake/libs/set.php create mode 100644 cake/libs/socket.php create mode 100644 cake/libs/string.php create mode 100644 cake/libs/validation.php create mode 100644 cake/libs/view/elements/dump.ctp create mode 100644 cake/libs/view/elements/email/html/default.ctp create mode 100644 cake/libs/view/elements/email/text/default.ctp create mode 100644 cake/libs/view/errors/error404.ctp create mode 100644 cake/libs/view/errors/missing_action.ctp create mode 100644 cake/libs/view/errors/missing_component_class.ctp create mode 100644 cake/libs/view/errors/missing_component_file.ctp create mode 100644 cake/libs/view/errors/missing_connection.ctp create mode 100644 cake/libs/view/errors/missing_controller.ctp create mode 100644 cake/libs/view/errors/missing_helper_class.ctp create mode 100644 cake/libs/view/errors/missing_helper_file.ctp create mode 100644 cake/libs/view/errors/missing_layout.ctp create mode 100644 cake/libs/view/errors/missing_model.ctp create mode 100644 cake/libs/view/errors/missing_scaffolddb.ctp create mode 100644 cake/libs/view/errors/missing_table.ctp create mode 100644 cake/libs/view/errors/missing_view.ctp create mode 100644 cake/libs/view/errors/private_action.ctp create mode 100644 cake/libs/view/errors/scaffold_error.ctp create mode 100644 cake/libs/view/helper.php create mode 100644 cake/libs/view/helpers/ajax.php create mode 100644 cake/libs/view/helpers/app_helper.php create mode 100644 cake/libs/view/helpers/cache.php create mode 100644 cake/libs/view/helpers/form.php create mode 100644 cake/libs/view/helpers/html.php create mode 100644 cake/libs/view/helpers/javascript.php create mode 100644 cake/libs/view/helpers/js.php create mode 100644 cake/libs/view/helpers/number.php create mode 100644 cake/libs/view/helpers/paginator.php create mode 100644 cake/libs/view/helpers/rss.php create mode 100644 cake/libs/view/helpers/session.php create mode 100644 cake/libs/view/helpers/text.php create mode 100644 cake/libs/view/helpers/time.php create mode 100644 cake/libs/view/helpers/xml.php create mode 100644 cake/libs/view/layouts/ajax.ctp create mode 100644 cake/libs/view/layouts/default.ctp create mode 100644 cake/libs/view/layouts/email/html/default.ctp create mode 100644 cake/libs/view/layouts/email/text/default.ctp create mode 100644 cake/libs/view/layouts/flash.ctp create mode 100644 cake/libs/view/layouts/js/default.ctp create mode 100644 cake/libs/view/layouts/rss/default.ctp create mode 100644 cake/libs/view/layouts/xml/default.ctp create mode 100644 cake/libs/view/media.php create mode 100644 cake/libs/view/pages/home.ctp create mode 100644 cake/libs/view/scaffolds/edit.ctp create mode 100644 cake/libs/view/scaffolds/index.ctp create mode 100644 cake/libs/view/scaffolds/view.ctp create mode 100644 cake/libs/view/theme.php create mode 100644 cake/libs/view/view.php create mode 100644 cake/libs/xml.php create mode 100644 cake/tests/cases/console/cake.test.php create mode 100644 cake/tests/cases/dispatcher.test.php create mode 100644 cake/tests/cases/libs/cache.test.php create mode 100644 cake/tests/cases/libs/cache/apc.test.php create mode 100644 cake/tests/cases/libs/cache/file.test.php create mode 100644 cake/tests/cases/libs/cache/memcache.test.php create mode 100644 cake/tests/cases/libs/cache/xcache.test.php create mode 100644 cake/tests/cases/libs/cake_log.test.php create mode 100644 cake/tests/cases/libs/class_registry.test.php create mode 100644 cake/tests/cases/libs/code_coverage_manager.test.php create mode 100644 cake/tests/cases/libs/configure.test.php create mode 100644 cake/tests/cases/libs/controller/component.test.php create mode 100644 cake/tests/cases/libs/controller/components/acl.test.php create mode 100644 cake/tests/cases/libs/controller/components/auth.test.php create mode 100644 cake/tests/cases/libs/controller/components/cookie.test.php create mode 100644 cake/tests/cases/libs/controller/components/email.test.php create mode 100644 cake/tests/cases/libs/controller/components/request_handler.test.php create mode 100644 cake/tests/cases/libs/controller/components/security.test.php create mode 100644 cake/tests/cases/libs/controller/components/session.test.php create mode 100644 cake/tests/cases/libs/controller/controller.test.php create mode 100644 cake/tests/cases/libs/controller/pages_controller.php create mode 100644 cake/tests/cases/libs/controller/scaffold.test.php create mode 100644 cake/tests/cases/libs/debugger.test.php create mode 100644 cake/tests/cases/libs/error.test.php create mode 100644 cake/tests/cases/libs/file.test.php create mode 100644 cake/tests/cases/libs/flay.test.php create mode 100644 cake/tests/cases/libs/folder.test.php create mode 100644 cake/tests/cases/libs/http_socket.test.php create mode 100644 cake/tests/cases/libs/i18n.test.php create mode 100644 cake/tests/cases/libs/inflector.test.php create mode 100644 cake/tests/cases/libs/l10n.test.php create mode 100644 cake/tests/cases/libs/magic_db.test.php create mode 100644 cake/tests/cases/libs/model/behavior.test.php create mode 100644 cake/tests/cases/libs/model/behaviors/containable.test.php create mode 100644 cake/tests/cases/libs/model/behaviors/translate.test.php create mode 100644 cake/tests/cases/libs/model/behaviors/tree.test.php create mode 100644 cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php create mode 100644 cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php create mode 100644 cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php create mode 100755 cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php create mode 100644 cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php create mode 100644 cake/tests/cases/libs/model/datasources/dbo_source.test.php create mode 100644 cake/tests/cases/libs/model/db_acl.test.php create mode 100644 cake/tests/cases/libs/model/model.test.php create mode 100644 cake/tests/cases/libs/model/models.php create mode 100644 cake/tests/cases/libs/model/schema.test.php create mode 100644 cake/tests/cases/libs/multibyte.test.php create mode 100644 cake/tests/cases/libs/object.test.php create mode 100644 cake/tests/cases/libs/overloadable.test.php create mode 100644 cake/tests/cases/libs/router.test.php create mode 100644 cake/tests/cases/libs/sanitize.test.php create mode 100644 cake/tests/cases/libs/security.test.php create mode 100644 cake/tests/cases/libs/session.test.php create mode 100644 cake/tests/cases/libs/set.test.php create mode 100644 cake/tests/cases/libs/socket.test.php create mode 100644 cake/tests/cases/libs/string.test.php create mode 100644 cake/tests/cases/libs/validation.test.php create mode 100644 cake/tests/cases/libs/view/helper.test.php create mode 100644 cake/tests/cases/libs/view/helpers/ajax.test.php create mode 100644 cake/tests/cases/libs/view/helpers/cache.test.php create mode 100644 cake/tests/cases/libs/view/helpers/form.test.php create mode 100644 cake/tests/cases/libs/view/helpers/html.test.php create mode 100644 cake/tests/cases/libs/view/helpers/javascript.test.php create mode 100644 cake/tests/cases/libs/view/helpers/js.test.php create mode 100644 cake/tests/cases/libs/view/helpers/number.test.php create mode 100644 cake/tests/cases/libs/view/helpers/paginator.test.php create mode 100644 cake/tests/cases/libs/view/helpers/rss.test.php create mode 100644 cake/tests/cases/libs/view/helpers/session.test.php create mode 100644 cake/tests/cases/libs/view/helpers/text.test.php create mode 100644 cake/tests/cases/libs/view/helpers/time.test.php create mode 100644 cake/tests/cases/libs/view/helpers/xml.test.php create mode 100644 cake/tests/cases/libs/view/theme.test.php create mode 100644 cake/tests/cases/libs/view/view.test.php create mode 100644 cake/tests/cases/libs/xml.test.php create mode 100644 cake/tests/fixtures/aco_action_fixture.php create mode 100644 cake/tests/fixtures/aco_fixture.php create mode 100644 cake/tests/fixtures/aco_two_fixture.php create mode 100644 cake/tests/fixtures/ad_fixture.php create mode 100644 cake/tests/fixtures/advertisement_fixture.php create mode 100644 cake/tests/fixtures/another_article_fixture.php create mode 100644 cake/tests/fixtures/apple_fixture.php create mode 100644 cake/tests/fixtures/aro_fixture.php create mode 100644 cake/tests/fixtures/aro_two_fixture.php create mode 100644 cake/tests/fixtures/aros_aco_fixture.php create mode 100644 cake/tests/fixtures/aros_aco_two_fixture.php create mode 100644 cake/tests/fixtures/article_featured_fixture.php create mode 100644 cake/tests/fixtures/article_featureds_tags_fixture.php create mode 100644 cake/tests/fixtures/article_fixture.php create mode 100644 cake/tests/fixtures/articles_tag_fixture.php create mode 100644 cake/tests/fixtures/attachment_fixture.php create mode 100644 cake/tests/fixtures/auth_user_fixture.php create mode 100644 cake/tests/fixtures/author_fixture.php create mode 100644 cake/tests/fixtures/bid_fixture.php create mode 100644 cake/tests/fixtures/cache_test_model_fixture.php create mode 100644 cake/tests/fixtures/callback_fixture.php create mode 100644 cake/tests/fixtures/campaign_fixture.php create mode 100644 cake/tests/fixtures/category_fixture.php create mode 100644 cake/tests/fixtures/category_thread_fixture.php create mode 100644 cake/tests/fixtures/comment_fixture.php create mode 100644 cake/tests/fixtures/data_test_fixture.php create mode 100644 cake/tests/fixtures/datatype_fixture.php create mode 100644 cake/tests/fixtures/dependency_fixture.php create mode 100644 cake/tests/fixtures/device_fixture.php create mode 100644 cake/tests/fixtures/device_type_category_fixture.php create mode 100644 cake/tests/fixtures/device_type_fixture.php create mode 100644 cake/tests/fixtures/document_directory_fixture.php create mode 100644 cake/tests/fixtures/document_fixture.php create mode 100644 cake/tests/fixtures/exterior_type_category_fixture.php create mode 100644 cake/tests/fixtures/feature_set_fixture.php create mode 100644 cake/tests/fixtures/featured_fixture.php create mode 100644 cake/tests/fixtures/flag_tree_fixture.php create mode 100644 cake/tests/fixtures/home_fixture.php create mode 100644 cake/tests/fixtures/image_fixture.php create mode 100644 cake/tests/fixtures/item_fixture.php create mode 100644 cake/tests/fixtures/items_portfolio_fixture.php create mode 100644 cake/tests/fixtures/join_a_b_fixture.php create mode 100644 cake/tests/fixtures/join_a_c_fixture.php create mode 100644 cake/tests/fixtures/join_a_fixture.php create mode 100644 cake/tests/fixtures/join_b_fixture.php create mode 100644 cake/tests/fixtures/join_c_fixture.php create mode 100644 cake/tests/fixtures/join_thing_fixture.php create mode 100644 cake/tests/fixtures/message_fixture.php create mode 100644 cake/tests/fixtures/node_fixture.php create mode 100644 cake/tests/fixtures/number_tree_fixture.php create mode 100644 cake/tests/fixtures/numeric_article_fixture.php create mode 100644 cake/tests/fixtures/person_fixture.php create mode 100644 cake/tests/fixtures/portfolio_fixture.php create mode 100644 cake/tests/fixtures/post_fixture.php create mode 100644 cake/tests/fixtures/posts_tag_fixture.php create mode 100644 cake/tests/fixtures/primary_model_fixture.php create mode 100644 cake/tests/fixtures/project_fixture.php create mode 100644 cake/tests/fixtures/sample_fixture.php create mode 100644 cake/tests/fixtures/secondary_model_fixture.php create mode 100644 cake/tests/fixtures/session_fixture.php create mode 100644 cake/tests/fixtures/something_else_fixture.php create mode 100644 cake/tests/fixtures/something_fixture.php create mode 100644 cake/tests/fixtures/syfile_fixture.php create mode 100644 cake/tests/fixtures/tag_fixture.php create mode 100644 cake/tests/fixtures/the_paper_monkies_fixture.php create mode 100644 cake/tests/fixtures/thread_fixture.php create mode 100644 cake/tests/fixtures/translate_fixture.php create mode 100644 cake/tests/fixtures/translate_table_fixture.php create mode 100644 cake/tests/fixtures/translated_item_fixture.php create mode 100644 cake/tests/fixtures/underscore_field_fixture.php create mode 100644 cake/tests/fixtures/user_fixture.php create mode 100644 cake/tests/fixtures/uuid_fixture.php create mode 100644 cake/tests/groups/acl.group.php create mode 100644 cake/tests/groups/cache.group.php create mode 100644 cake/tests/groups/components.group.php create mode 100644 cake/tests/groups/configure.group.php create mode 100644 cake/tests/groups/helpers.group.php create mode 100644 cake/tests/groups/lib.group.php create mode 100644 cake/tests/groups/lib_controller.group.php create mode 100644 cake/tests/groups/model.group.php create mode 100644 cake/tests/groups/no_database.group.php create mode 100644 cake/tests/groups/routing_system.group.php create mode 100644 cake/tests/groups/socket.group.php create mode 100644 cake/tests/groups/view.group.php create mode 100644 cake/tests/lib/cake_reporter.php create mode 100644 cake/tests/lib/cake_test_case.php create mode 100644 cake/tests/lib/cake_test_fixture.php create mode 100644 cake/tests/lib/cake_test_model.php create mode 100644 cake/tests/lib/cake_web_test_case.php create mode 100644 cake/tests/lib/cli_reporter.php create mode 100644 cake/tests/lib/code_coverage_manager.php create mode 100644 cake/tests/lib/content.php create mode 100644 cake/tests/lib/footer.php create mode 100644 cake/tests/lib/header.php create mode 100644 cake/tests/lib/simpletest.php create mode 100644 cake/tests/lib/test_manager.php create mode 100644 cake/tests/lib/xdebug.php create mode 100644 cake/tests/test_app/config/acl.ini.php create mode 100644 cake/tests/test_app/controllers/components/empty create mode 100644 cake/tests/test_app/controllers/tests_apps_controller.php create mode 100644 cake/tests/test_app/locale/po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_0_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_0_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_10_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_10_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_1_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_1_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_2_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_2_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_3_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_3_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_4_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_4_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_5_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_5_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_6_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_6_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_7_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_7_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_8_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_8_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/core.mo create mode 100644 cake/tests/test_app/locale/rule_9_mo/LC_MESSAGES/default.mo create mode 100644 cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/core.po create mode 100644 cake/tests/test_app/locale/rule_9_po/LC_MESSAGES/default.po create mode 100644 cake/tests/test_app/models/behaviors/empty create mode 100644 cake/tests/test_app/models/datasources/empty create mode 100644 cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php create mode 100644 cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php create mode 100644 cake/tests/test_app/plugins/test_plugin/controllers/tests_plugins_tests_controller.php create mode 100644 cake/tests/test_app/plugins/test_plugin/vendors/css/test_plugin_asset.css create mode 100644 cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php create mode 100644 cake/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_helper.php create mode 100644 cake/tests/test_app/plugins/test_plugin/views/helpers/test_plugin_other_helper.php create mode 100644 cake/tests/test_app/plugins/test_plugin/views/layouts/default.ctp create mode 100644 cake/tests/test_app/plugins/test_plugin/views/test_plugin/index.ctp create mode 100644 cake/tests/test_app/plugins/test_plugin/views/tests_plugins_tests/index.ctp create mode 100644 cake/tests/test_app/plugins/test_plugin/views/themed/test_plugin_theme/layouts/default.ctp create mode 100644 cake/tests/test_app/plugins/test_plugin/views/themed/test_plugin_theme/test_plugin/index.ctp create mode 100644 cake/tests/test_app/tmp/dir_map create mode 100644 cake/tests/test_app/vendors/Test/MyTest.php create mode 100644 cake/tests/test_app/vendors/Test/hello.php create mode 100644 cake/tests/test_app/vendors/css/test_asset.css create mode 100644 cake/tests/test_app/vendors/sample/sample.php create mode 100644 cake/tests/test_app/vendors/shells/tasks/empty create mode 100644 cake/tests/test_app/vendors/shells/templates/empty create mode 100644 cake/tests/test_app/vendors/somename/some.name.php create mode 100644 cake/tests/test_app/views/elements/empty create mode 100644 cake/tests/test_app/views/elements/test_element.ctp create mode 100644 cake/tests/test_app/views/errors/empty create mode 100644 cake/tests/test_app/views/helpers/empty create mode 100644 cake/tests/test_app/views/layouts/ajax.ctp create mode 100644 cake/tests/test_app/views/layouts/default.ctp create mode 100644 cake/tests/test_app/views/layouts/flash.ctp create mode 100644 cake/tests/test_app/views/layouts/js/default.ctp create mode 100644 cake/tests/test_app/views/layouts/rss/default.ctp create mode 100644 cake/tests/test_app/views/layouts/session_helper.ctp create mode 100644 cake/tests/test_app/views/layouts/xml/default.ctp create mode 100644 cake/tests/test_app/views/pages/empty create mode 100644 cake/tests/test_app/views/pages/home.ctp create mode 100644 cake/tests/test_app/views/posts/index.ctp create mode 100644 cake/tests/test_app/views/posts/test_nocache_tags.ctp create mode 100644 cake/tests/test_app/views/scaffolds/empty create mode 100644 cake/tests/test_app/views/tests_apps/index.ctp create mode 100644 cake/tests/test_app/views/themed/test_theme/layouts/default.ctp create mode 100644 cake/tests/test_app/views/themed/test_theme/posts/index.ctp diff --git a/cake/LICENSE.txt b/cake/LICENSE.txt new file mode 100644 index 000000000..4787242c4 --- /dev/null +++ b/cake/LICENSE.txt @@ -0,0 +1,24 @@ +The MIT License + +CakePHP(tm) : Rapid Development Framework +Copyright 2005-2007, Cake Software Foundation, Inc. + 1785 E. Sahara Avenue, Suite 490-204 + Las Vegas, Nevada 89104 + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/cake/VERSION.txt b/cake/VERSION.txt new file mode 100644 index 000000000..05ba774ab --- /dev/null +++ b/cake/VERSION.txt @@ -0,0 +1,9 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +---------------------------------------------------------------------------------------------------+ // +// + $Id$ +// + Last Modified: $Date$ +// + Modified By: $LastChangedBy$ +// +---------------------------------------------------------------------------------------------------+ // +/////////////////////////////////////////////////////////////////////////////////////////////////////////// + +1.2.0.6311 beta \ No newline at end of file diff --git a/cake/basics.php b/cake/basics.php new file mode 100644 index 000000000..9322ea302 --- /dev/null +++ b/cake/basics.php @@ -0,0 +1,1165 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake + * @since CakePHP(tm) v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Basic defines for timing functions. + */ + define('SECOND', 1); + define('MINUTE', 60 * SECOND); + define('HOUR', 60 * MINUTE); + define('DAY', 24 * HOUR); + define('WEEK', 7 * DAY); + define('MONTH', 30 * DAY); + define('YEAR', 365 * DAY); +/** + * Patch for PHP < 5.0 + */ +if (!function_exists('clone')) { + if (version_compare(phpversion(), '5.0') < 0) { + eval (' + function clone($object) + { + return $object; + }'); + } +} +/** + * Loads configuration files. Receives a set of configuration files + * to load. + * Example: + * + * config('config1', 'config2'); + * + * + * @return boolean Success + */ + function config() { + $args = func_get_args(); + foreach ($args as $arg) { + if (('database' == $arg) && file_exists(CONFIGS . $arg . '.php')) { + include_once(CONFIGS . $arg . '.php'); + } elseif (file_exists(CONFIGS . $arg . '.php')) { + include_once(CONFIGS . $arg . '.php'); + + if (count($args) == 1) { + return true; + } + } else { + if (count($args) == 1) { + return false; + } + } + } + return true; + } +/** + * Loads component/components from LIBS. Takes optional number of parameters. + * + * Example: + * + * uses('flay', 'time'); + * + * + * @param string $name Filename without the .php part + */ + function uses() { + $args = func_get_args(); + foreach ($args as $file) { + require_once(LIBS . strtolower($file) . '.php'); + } + } +/** + * Prints out debug information about given variable. + * + * Only runs if debug level is non-zero. + * + * @param boolean $var Variable to show debug information for. + * @param boolean $showHtml If set to true, the method prints the debug data in a screen-friendly way. + * @param boolean $showFrom If set to true, the method prints from where the function was called. + */ + function debug($var = false, $showHtml = false, $showFrom = true) { + if (Configure::read() > 0) { + if ($showFrom) { + $calledFrom = debug_backtrace(); + print "".substr(r(ROOT, "", $calledFrom[0]['file']), 1)." (line ".$calledFrom[0]['line'].")"; + } + print "\n
\n";
+			$var = print_r($var, true);
+
+			if ($showHtml) {
+				$var = str_replace('<', '<', str_replace('>', '>', $var));
+			}
+			print "{$var}\n
\n"; + } + } + if (!function_exists('getMicrotime')) { +/** + * Returns microtime for execution time checking + * + * @return float Microtime + */ + function getMicrotime() { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); + } + } + if (!function_exists('sortByKey')) { +/** + * Sorts given $array by key $sortby. + * + * @param array $array Array to sort + * @param string $sortby Sort by this key + * @param string $order Sort order asc/desc (ascending or descending). + * @param integer $type Type of sorting to perform + * @return mixed Sorted array + */ + function sortByKey(&$array, $sortby, $order = 'asc', $type = SORT_NUMERIC) { + if (!is_array($array)) { + return null; + } + + foreach ($array as $key => $val) { + $sa[$key] = $val[$sortby]; + } + + if ($order == 'asc') { + asort($sa, $type); + } else { + arsort($sa, $type); + } + + foreach ($sa as $key => $val) { + $out[] = $array[$key]; + } + return $out; + } + } + if (!function_exists('array_combine')) { +/** + * Combines given identical arrays by using the first array's values as keys, + * and the second one's values as values. (Implemented for back-compatibility with PHP4) + * + * @param array $a1 Array to use for keys + * @param array $a2 Array to use for values + * @return mixed Outputs either combined array or false. + */ + function array_combine($a1, $a2) { + $a1 = array_values($a1); + $a2 = array_values($a2); + $c1 = count($a1); + $c2 = count($a2); + + if ($c1 != $c2) { + return false; + } + if ($c1 <= 0) { + return false; + } + + $output=array(); + for ($i = 0; $i < $c1; $i++) { + $output[$a1[$i]] = $a2[$i]; + } + return $output; + } + } +/** + * Convenience method for htmlspecialchars. + * + * @param string $text Text to wrap through htmlspecialchars + * @param string $charset Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8' + * @return string Wrapped text + */ + function h($text, $charset = null) { + if (is_array($text)) { + return array_map('h', $text); + } + if (empty($charset)) { + $charset = Configure::read('App.encoding'); + } + if (empty($charset)) { + $charset = 'UTF-8'; + } + return htmlspecialchars($text, ENT_QUOTES, $charset); + } +/** + * Returns an array of all the given parameters. + * + * Example: + * + * a('a', 'b') + * + * + * Would return: + * + * array('a', 'b') + * + * + * @return array Array of given parameters + */ + function a() { + $args = func_get_args(); + return $args; + } +/** + * Constructs associative array from pairs of arguments. + * + * Example: + * + * aa('a','b') + * + * + * Would return: + * + * array('a'=>'b') + * + * + * @return array Associative array + */ + function aa() { + $args = func_get_args(); + for ($l = 0, $c = count($args); $l < $c; $l++) { + if ($l + 1 < count($args)) { + $a[$args[$l]] = $args[$l + 1]; + } else { + $a[$args[$l]] = null; + } + $l++; + } + return $a; + } +/** + * Convenience method for echo(). + * + * @param string $text String to echo + */ + function e($text) { + echo $text; + } +/** + * Convenience method for strtolower(). + * + * @param string $str String to lowercase + * @return string Lowercased string + */ + function low($str) { + return strtolower($str); + } +/** + * Convenience method for strtoupper(). + * + * @param string $str String to uppercase + * @return string Uppercased string + */ + function up($str) { + return strtoupper($str); + } +/** + * Convenience method for str_replace(). + * + * @param string $search String to be replaced + * @param string $replace String to insert + * @param string $subject String to search + * @return string Replaced string + */ + function r($search, $replace, $subject) { + return str_replace($search, $replace, $subject); + } +/** + * Print_r convenience function, which prints out
 tags around
+ * the output of given array. Similar to debug().
+ *
+ * @see	debug()
+ * @param array $var Variable to print out
+ * @param boolean $showFrom If set to true, the method prints from where the function was called
+ */
+	function pr($var) {
+		if (Configure::read() > 0) {
+			echo "
";
+			print_r($var);
+			echo "
"; + } + } +/** + * Display parameter + * + * @param mixed $p Parameter as string or array + * @return string + */ + function params($p) { + if (!is_array($p) || count($p) == 0) { + return null; + } else { + if (is_array($p[0]) && count($p) == 1) { + return $p[0]; + } else { + return $p; + } + } + } +/** + * Merge a group of arrays + * + * @param array First array + * @param array Second array + * @param array Third array + * @param array Etc... + * @return array All array parameters merged into one + */ + function am() { + $r = array(); + foreach (func_get_args()as $a) { + if (!is_array($a)) { + $a = array($a); + } + $r = array_merge($r, $a); + } + return $r; + } +/** + * Gets an environment variable from available sources, and provides emulation + * for unsupported or inconsisten environment variables (i.e. DOCUMENT_ROOT on + * IIS, or SCRIPT_NAME in CGI mode). Also exposes some additional custom + * environment information. + * + * @param string $key Environment variable name. + * @return string Environment variable setting. + */ + function env($key) { + if ($key == 'HTTPS') { + if (isset($_SERVER) && !empty($_SERVER)) { + return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'); + } else { + return (strpos(env('SCRIPT_URI'), 'https://') === 0); + } + } + + if ($key == 'SCRIPT_NAME') { + if (env('CGI_MODE') && isset($_ENV['SCRIPT_URL'])) { + $key = 'SCRIPT_URL'; + } + } + + $val = null; + if (isset($_SERVER[$key])) { + $val = $_SERVER[$key]; + } elseif (isset($_ENV[$key])) { + $val = $_ENV[$key]; + } elseif (getenv($key) !== false) { + $val = getenv($key); + } + + if ($key == 'REMOTE_ADDR' && $val == env('SERVER_ADDR')) { + $addr = env('HTTP_PC_REMOTE_ADDR'); + if ($addr != null) { + $val = $addr; + } + } + + if ($val !== null) { + return $val; + } + + switch ($key) { + case 'SCRIPT_FILENAME': + if (defined('SERVER_IIS') && SERVER_IIS === true){ + return str_replace('\\\\', '\\', env('PATH_TRANSLATED') ); + } + break; + case 'DOCUMENT_ROOT': + $offset = 0; + if (!strpos(env('SCRIPT_NAME'), '.php')) { + $offset = 4; + } + return substr(env('SCRIPT_FILENAME'), 0, strlen(env('SCRIPT_FILENAME')) - (strlen(env('SCRIPT_NAME')) + $offset)); + break; + case 'PHP_SELF': + return r(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME')); + break; + case 'CGI_MODE': + return (substr(php_sapi_name(), 0, 3) == 'cgi'); + break; + case 'HTTP_BASE': + return preg_replace ('/^([^.])*/i', null, env('HTTP_HOST')); + break; + } + return null; + } + if (!function_exists('file_put_contents')) { +/** + * Writes data into file. + * + * If file exists, it will be overwritten. If data is an array, it will be join()ed with an empty string. + * + * @param string $fileName File name. + * @param mixed $data String or array. + * @return boolean Success + */ + function file_put_contents($fileName, $data) { + if (is_array($data)) { + $data = join('', $data); + } + $res = @fopen($fileName, 'w+b'); + if ($res) { + $write = @fwrite($res, $data); + if ($write === false) { + return false; + } else { + @fclose($res); + return $write; + } + } + return false; + } + } +/** + * Reads/writes temporary data to cache files or session. + * + * @param string $path File path within /tmp to save the file. + * @param mixed $data The data to save to the temporary file. + * @param mixed $expires A valid strtotime string when the data expires. + * @param string $target The target of the cached data; either 'cache' or 'public'. + * @return mixed The contents of the temporary file. + * @deprecated Please use Cache::write() instead + */ + function cache($path, $data = null, $expires = '+1 day', $target = 'cache') { + if (Configure::read('Cache.disable')) { + return null; + } + $now = time(); + + if (!is_numeric($expires)) { + $expires = strtotime($expires, $now); + } + + switch(low($target)) { + case 'cache': + $filename = CACHE . $path; + break; + case 'public': + $filename = WWW_ROOT . $path; + break; + case 'tmp': + $filename = TMP . $path; + break; + } + $timediff = $expires - $now; + $filetime = false; + + if (file_exists($filename)) { + $filetime = @filemtime($filename); + } + + if ($data === null) { + if (file_exists($filename) && $filetime !== false) { + if ($filetime + $timediff < $now) { + @unlink($filename); + } else { + $data = @file_get_contents($filename); + } + } + } elseif (is_writable(dirname($filename))) { + @file_put_contents($filename, $data); + } + return $data; + } +/** + * Used to delete files in the cache directories, or clear contents of cache directories + * + * @param mixed $params As String name to be searched for deletion, if name is a directory all files in directory will be deleted. + * If array, names to be searched for deletion. + * If clearCache() without params, all files in app/tmp/cache/views will be deleted + * + * @param string $type Directory in tmp/cache defaults to view directory + * @param string $ext The file extension you are deleting + * @return true if files found and deleted false otherwise + */ + function clearCache($params = null, $type = 'views', $ext = '.php') { + if (is_string($params) || $params === null) { + $params = preg_replace('/\/\//', '/', $params); + $cache = CACHE . $type . DS . $params; + + if (is_file($cache . $ext)) { + @unlink($cache . $ext); + return true; + } elseif (is_dir($cache)) { + $files = glob("$cache*"); + + if ($files === false) { + return false; + } + + foreach ($files as $file) { + if (is_file($file)) { + @unlink($file); + } + } + return true; + } else { + $cache = CACHE . $type . DS . '*' . $params . $ext; + $files = glob($cache); + + $cache = CACHE . $type . DS . '*' . $params . '_*' . $ext; + $files = array_merge($files, glob($cache)); + + if ($files === false) { + return false; + } + + foreach ($files as $file) { + if (is_file($file)) { + @unlink($file); + } + } + return true; + } + } elseif (is_array($params)) { + foreach ($params as $key => $file) { + clearCache($file, $type, $ext); + } + return true; + } + return false; + } +/** + * Recursively strips slashes from all values in an array + * + * @param array $value Array of values to strip slashes + * @return mixed What is returned from calling stripslashes + */ + function stripslashes_deep($value) { + if (is_array($value)) { + $return = array_map('stripslashes_deep', $value); + return $return; + } else { + $return = stripslashes($value); + return $return ; + } + } +/** + * Returns a translated string if one is found, or the submitted message if not found. + * + * @param string $singular Text to translate + * @param boolean $return Set to true to return translated string, or false to echo + * @return mixed translated string if $return is false string will be echoed + */ + function __($singular, $return = false) { + if (!$singular) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($singular); + } else { + return I18n::translate($singular); + } + } +/** + * Returns correct plural form of message identified by $singular and $plural for count $count. + * Some languages have more than one form for plural messages dependent on the count. + * + * @param string $singular Singular text to translate + * @param string $plural Plural text + * @param integer $count Count + * @param boolean $return true to return, false to echo + * @return mixed plural form of translated string if $return is false string will be echoed + */ + function __n($singular, $plural, $count, $return = false) { + if (!$singular) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($singular, $plural, null, 5, $count); + } else { + return I18n::translate($singular, $plural, null, 5, $count); + } + } +/** + * Allows you to override the current domain for a single message lookup. + * + * @param string $domain Domain + * @param string $msg String to translate + * @param string $return true to return, false to echo + * @return translated string if $return is false string will be echoed + */ + function __d($domain, $msg, $return = false) { + if (!$msg) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($msg, null, $domain); + } else { + return I18n::translate($msg, null, $domain); + } + } +/** + * Allows you to override the current domain for a single plural message lookup + * Returns correct plural form of message identified by $singular and $plural for count $count + * from domain $domain + * + * @param string $domain Domain + * @param string $singular Singular string to translate + * @param string $plural Plural + * @param integer $count Count + * @param boolean $return true to return, false to echo + * @return plural form of translated string if $return is false string will be echoed + */ + function __dn($domain, $singular, $plural, $count, $return = false) { + if (!$singular) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($singular, $plural, $domain, 5, $count); + } else { + return I18n::translate($singular, $plural, $domain, 5, $count); + } + } +/** + * Allows you to override the current domain for a single message lookup. + * It also allows you to specify a category. + * + * The category argument allows a specific category of the locale settings to be used for fetching a message. + * Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL. + * + * Note that the category must be specified with a numeric value, instead of the constant name. The values are: + * LC_CTYPE 0 + * LC_NUMERIC 1 + * LC_TIME 2 + * LC_COLLATE 3 + * LC_MONETARY 4 + * LC_MESSAGES 5 + * LC_ALL 6 + * + * @param string $domain Domain + * @param string $msg Message to translate + * @param integer $category Category + * @param boolean $return true to return, false to echo + * @return translated string if $return is false string will be echoed + */ + function __dc($domain, $msg, $category, $return = false) { + if (!$msg) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($msg, null, $domain, $category); + } else { + return I18n::translate($msg, null, $domain, $category); + } + } +/** + * Allows you to override the current domain for a single plural message lookup. + * It also allows you to specify a category. + * Returns correct plural form of message identified by $singular and $plural for count $count + * from domain $domain + * + * The category argument allows a specific category of the locale settings to be used for fetching a message. + * Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL. + * + * Note that the category must be specified with a numeric value, instead of the constant name. The values are: + * LC_CTYPE 0 + * LC_NUMERIC 1 + * LC_TIME 2 + * LC_COLLATE 3 + * LC_MONETARY 4 + * LC_MESSAGES 5 + * LC_ALL 6 + * + * @param string $domain Domain + * @param string $singular Singular string to translate + * @param string $plural Plural + * @param integer $count Count + * @param integer $category Category + * @param boolean $return true to return, false to echo + * @return plural form of translated string if $return is false string will be echoed + */ + function __dcn($domain, $singular, $plural, $count, $category, $return = false) { + if (!$singular) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($singular, $plural, $domain, $category, $count); + } else { + return I18n::translate($singular, $plural, $domain, $category, $count); + } + } +/** + * The category argument allows a specific category of the locale settings to be used for fetching a message. + * Valid categories are: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES and LC_ALL. + * + * Note that the category must be specified with a numeric value, instead of the constant name. The values are: + * LC_CTYPE 0 + * LC_NUMERIC 1 + * LC_TIME 2 + * LC_COLLATE 3 + * LC_MONETARY 4 + * LC_MESSAGES 5 + * LC_ALL 6 + * + * @param string $msg String to translate + * @param integer $category Category + * @param string $return true to return, false to echo + * @return translated string if $return is false string will be echoed + */ + function __c($msg, $category, $return = false) { + if (!$msg) { + return; + } + if (!class_exists('I18n')) { + App::import('Core', 'i18n'); + } + + if ($return === false) { + echo I18n::translate($msg, null, null, $category); + } else { + return I18n::translate($msg, null, null, $category); + } + } +/** + * Computes the difference of arrays using keys for comparison + * + * @param array First array + * @param array Second array + * @return array Array with different keys + */ + if (!function_exists('array_diff_key')) { + function array_diff_key() { + $valuesDiff = array(); + + if (func_num_args() < 2) { + return false; + } + + foreach (func_get_args() as $param) { + if (!is_array($param)) { + return false; + } + } + + $args = func_get_args(); + foreach ($args[0] as $valueKey => $valueData) { + for ($i = 1; $i < func_num_args(); $i++) { + if (isset($args[$i][$valueKey])) { + continue 2; + } + } + $valuesDiff[$valueKey] = $valueData; + } + return $valuesDiff; + } + } +/** + * Computes the intersection of arrays using keys for comparison + * + * @param array First array + * @param array Second array + * @return array Array with interesected keys + */ + if (!function_exists('array_intersect_key')) { + function array_intersect_key($arr1, $arr2) { + $res = array(); + foreach ($arr1 as $key=>$value) { + if (array_key_exists($key, $arr2)) { + $res[$key] = $arr1[$key]; + } + } + return $res; + } + } +/** + * Shortcut to Log::write. + * + * @param string $message Message to write to log + */ + function LogError($message) { + if (!class_exists('CakeLog')) { + App::import('Core', 'CakeLog'); + } + $bad = array("\n", "\r", "\t"); + $good = ' '; + CakeLog::write('error', str_replace($bad, $good, $message)); + } +/** + * Searches include path for files + * + * @param string $file File to look for + * @return Full path to file if exists, otherwise false + */ + function fileExistsInPath($file) { + $paths = explode(PATH_SEPARATOR, ini_get('include_path')); + foreach ($paths as $path) { + $fullPath = $path . DIRECTORY_SEPARATOR . $file; + + if (file_exists($fullPath)) { + return $fullPath; + } elseif (file_exists($file)) { + return $file; + } + } + return false; + } +/** + * Convert forward slashes to underscores and removes first and last underscores in a string + * + * @param string String to convert + * @return string with underscore remove from start and end of string + */ + function convertSlash($string) { + $string = trim($string,"/"); + $string = preg_replace('/\/\//', '/', $string); + $string = str_replace('/', '_', $string); + return $string; + } +/** + * Implements http_build_query for PHP4. + * + * @param string $data Data to set in query string + * @param string $prefix If numeric indices, prepend this to index for elements in base array. + * @param string $argSep String used to separate arguments + * @param string $baseKey Base key + * @return string URL encoded query string + * @see http://php.net/http_build_query + */ + if (!function_exists('http_build_query')) { + function http_build_query($data, $prefix = null, $argSep = null, $baseKey = null) { + if (empty($argSep)) { + $argSep = ini_get('arg_separator.output'); + } + if (is_object($data)) { + $data = get_object_vars($data); + } + $out = array(); + + foreach ((array)$data as $key => $v) { + if (is_numeric($key) && !empty($prefix)) { + $key = $prefix . $key; + } + $key = urlencode($key); + + if (!empty($baseKey)) { + $key = $baseKey . '[' . $key . ']'; + } + + if (is_array($v) || is_object($v)) { + $out[] = http_build_query($v, $prefix, $argSep, $key); + } else { + $out[] = $key . '=' . urlencode($v); + } + } + return implode($argSep, $out); + } + } +/** + * Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2. + * Don't use for isset() conditions, or wrap your variable with @ operator: + * Example: + * + * ife(isset($variable), @$variable, 'default'); + * + * + * @param mixed $condition Conditional expression + * @param mixed $val1 Value to return in case condition matches + * @param mixed $val2 Value to return if condition doesn't match + * @return mixed $val1 or $val2, depending on whether $condition evaluates to a non-empty expression. + */ + function ife($condition, $val1 = null, $val2 = null) { + if (!empty($condition)) { + return $val1; + } + return $val2; + } +/** + * @deprecated + * @see App::import('View', 'ViewName'); + */ + function loadView($name) { + trigger_error('loadView is deprecated see App::import(\'View\', \'ViewName\');', E_USER_WARNING); + return App::import('View', $name); + } +/** + * @deprecated + * @see App::import('Model', 'ModelName'); + */ + function loadModel($name = null) { + trigger_error('loadModel is deprecated see App::import(\'Model\', \'ModelName\');', E_USER_WARNING); + return App::import('Model', $name); + } +/** + * @deprecated + * @see App::import('Controller', 'ControllerName'); + */ + function loadController($name) { + trigger_error('loadController is deprecated see App::import(\'Controller\', \'ControllerName\');', E_USER_WARNING); + return App::import('Controller', $name); + } +/** + * @deprecated + * @see App::import('Helper', 'HelperName'); + */ + function loadHelper($name) { + trigger_error('loadHelper is deprecated see App::import(\'Helper\', \'PluginName.HelperName\');', E_USER_WARNING); + return App::import('Helper', $name); + } +/** + * @deprecated + * @see App::import('Helper', 'PluginName.HelperName'); + */ + function loadPluginHelper($plugin, $helper) { + trigger_error('loadPluginHelper is deprecated see App::import(\'Helper\', \'PluginName.HelperName\');', E_USER_WARNING); + return App::import('Helper', $plugin . '.' . $helper); + } +/** + * @deprecated + * @see App::import('Component', 'ComponentName'); + */ + function loadComponent($name) { + trigger_error('loadComponent is deprecated see App::import(\'Component\', \'ComponentName\');', E_USER_WARNING); + return App::import('Component', $name); + } +/** + * @deprecated + * @see App::import('Component', 'PluginName.ComponentName'); + */ + function loadPluginComponent($plugin, $component) { + trigger_error('loadPluginComponent is deprecated see App::import(\'Component\', \'PluginName.ComponentName\');', E_USER_WARNING); + return App::import('Component', $plugin . '.' . $component); + } +/** + * @deprecated + * @see App::import('Behavior', 'BehaviorrName'); + */ + function loadBehavior($name) { + trigger_error('loadBehavior is deprecated see App::import(\'Behavior\', $name);', E_USER_WARNING); + return App::import('Behavior', $name); + } +/** + * @deprecated + * @see $model = Configure::listObjects('model'); and App::import('Model', $models); + * or App::import('Model', array(List of Models)); + */ + function loadModels() { + $loadModels = array(); + if (func_num_args() > 0) { + $args = func_get_args(); + foreach($args as $arg) { + if (is_array($arg)) { + $loadModels = am($loadModels, $arg); + } else { + $loadModels[] = $arg; + } + } + } + + if (empty($loadModels)) { + $loadModels = Configure::listObjects('model'); + } + App::import('Model', $loadModels); + trigger_error('loadModels is deprecated see $model = Configure::listObjects(\'model\'); and App::import(\'Model\', $models);', E_USER_WARNING); + return $loadModels; + } +/** + * @deprecated + * @see App::import('Model', 'PluginName.PluginModel'); + */ + function loadPluginModels($plugin) { + if (!class_exists('AppModel')) { + loadModel(); + } + $plugin = Inflector::underscore($plugin); + $pluginAppModel = Inflector::camelize($plugin . '_app_model'); + $pluginAppModelFile = APP . 'plugins' . DS . $plugin . DS . $plugin . '_app_model.php'; + + if (!class_exists($pluginAppModel)) { + if (file_exists($pluginAppModelFile)) { + require($pluginAppModelFile); + Overloadable::overload($pluginAppModel); + } + } + + $pluginModelDir = APP . 'plugins' . DS . $plugin . DS . 'models' . DS; + if (is_dir($pluginModelDir)) { + foreach (listClasses($pluginModelDir)as $modelFileName) { + list($name) = explode('.', $modelFileName); + $className = Inflector::camelize($name); + + if (!class_exists($className)) { + require($pluginModelDir . $modelFileName); + Overloadable::overload($className); + } + } + } + trigger_error('loadPluginModels is deprecated see App::import(\'Model\', \'PluginName.PluginModel\');', E_USER_WARNING); + } +/** + * @deprecated + * @see $controllers = Configure::listObjects('controller'); and App::import('Controller', $controllers); + * or App::import('Controller', array(List of Controllers); + */ + function loadControllers() { + $loadControllers = array(); + if (func_num_args() > 0) { + $args = func_get_args(); + foreach($args as $arg) { + if (is_array($arg)) { + $loadControllers = am($loadControllers, $arg); + } else { + $loadControllers[] = $arg; + } + } + } + + if (empty($loadControllers)) { + $loadControllers = Configure::listObjects('controller'); + } + App::import('Controller', $loadControllers); + trigger_error('loadControllers is deprecated see $controllers = Configure::listObjects(\'controller\'); and App::import(\'Controller\', $controllers);', E_USER_WARNING); + return $loadControllers; + } +/** + * @deprecated + * @see Configure::listObjects('file', $path); + */ + function listClasses($path ) { + trigger_error('listClasses is deprecated see Configure::listObjects(\'file\', $path);', E_USER_WARNING); + return Configure::listObjects('file', $path); + } +/** + * @deprecated + * @see Configure::corePaths(); + */ + function paths() { + $directories = Configure::getInstance(); + $paths = array(); + + foreach ($directories->modelPaths as $path) { + $paths['Models'][] = $path; + } + foreach ($directories->behaviorPaths as $path) { + $paths['Behaviors'][] = $path; + } + foreach ($directories->controllerPaths as $path) { + $paths['Controllers'][] = $path; + } + foreach ($directories->componentPaths as $path) { + $paths['Components'][] = $path; + } + foreach ($directories->helperPaths as $path) { + $paths['Helpers'][] = $path; + } + + if (!class_exists('Folder')) { + App::import('Core', 'Folder'); + } + + $folder =& new Folder(APP.'plugins'.DS); + $plugins = $folder->ls(); + $classPaths = array('models', 'models'.DS.'behaviors', 'controllers', 'controllers'.DS.'components', 'views'.DS.'helpers'); + + foreach ($plugins[0] as $plugin) { + foreach ($classPaths as $path) { + if (strpos($path, DS) !== false) { + $key = explode(DS, $path); + $key = $key[1]; + } else { + $key = $path; + } + $folder->path = APP.'plugins'.DS.$plugin.DS.$path; + $paths[Inflector::camelize($plugin)][Inflector::camelize($key)][] = $folder->path; + } + } + return $paths; + } +/** + * @deprecated + */ + function vendor() { + trigger_error('(vendor) Deprecated, see App::import(\'Vendor\', \'...\');', E_USER_WARNING); + $args = func_get_args(); + $c = func_num_args(); + + for ($i = 0; $i < $c; $i++) { + $arg = $args[$i]; + + if (strpos($arg, '.') !== false) { + $file = explode('.', $arg); + $plugin = Inflector::underscore($file[0]); + unset($file[0]); + $file = implode('.', $file); + if (file_exists(APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . $file . '.php')) { + require_once(APP . 'plugins' . DS . $plugin . DS . 'vendors' . DS . $file . '.php'); + continue; + } + } + + if (file_exists(APP . 'vendors' . DS . $arg . '.php')) { + require_once(APP . 'vendors' . DS . $arg . '.php'); + } elseif (file_exists(VENDORS . $arg . '.php')) { + require_once(VENDORS . $arg . '.php'); + } else { + return false; + } + } + return true; + } +/** + * @deprecated + * @see Dispatcher::uri(); + */ + function setUri() { + return null; + } +/** + * @deprecated + * @see Dispatcher::getUrl(); + */ + function setUrl() { + return null; + } +?> \ No newline at end of file diff --git a/cake/bootstrap.php b/cake/bootstrap.php new file mode 100644 index 000000000..a727b6e7c --- /dev/null +++ b/cake/bootstrap.php @@ -0,0 +1,51 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake + * @since CakePHP(tm) v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +if (!defined('PHP5')) { + define ('PHP5', (phpversion() >= 5)); +} +/** + * Configuration, directory layout and standard libraries + */ + if (!isset($bootstrap)) { + require CORE_PATH . 'cake' . DS . 'basics.php'; + $TIME_START = getMicrotime(); + require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php'; + require LIBS . 'object.php'; + require LIBS . 'inflector.php'; + require LIBS . 'configure.php'; + } + require LIBS . 'file.php'; + require LIBS . 'cache.php'; + + Configure::getInstance(); + + $url = null; + + App::import('Core', array('Session', 'Security', 'String', 'Dispatcher')); +?> \ No newline at end of file diff --git a/cake/config/config.php b/cake/config/config.php new file mode 100644 index 000000000..a70363ad1 --- /dev/null +++ b/cake/config/config.php @@ -0,0 +1,28 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.app.config + * @since CakePHP(tm) v 1.1.11.4062 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +return $config['Cake.version'] = '1.2.0.6311 beta'; +?> \ No newline at end of file diff --git a/cake/config/paths.php b/cake/config/paths.php new file mode 100644 index 000000000..c06e07676 --- /dev/null +++ b/cake/config/paths.php @@ -0,0 +1,212 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.app.config + * @since CakePHP(tm) v 0.2.9 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * If the index.php file is used instead of an .htaccess file + * or if the user can not set the web root to use the public + * directory we will define ROOT there, otherwise we set it + * here. + */ + if (!defined('ROOT')) { + define ('ROOT', '../'); + } + if (!defined('WEBROOT_DIR')) { + define ('WEBROOT_DIR', 'webroot'); + } +/** + * Path to the cake directory. + */ + define ('CAKE', CORE_PATH.'cake'.DS); +/** + * Path to the application's directory. + */ +if (!defined('APP')) { + define ('APP', ROOT.DS.APP_DIR.DS); +} +/** + * Path to the application's models directory. + */ + define ('MODELS', APP.'models'.DS); +/** + * Path to model behaviors directory. + */ + define ('BEHAVIORS', MODELS.'behaviors'.DS); +/** + * Path to the application's controllers directory. + */ + define ('CONTROLLERS', APP.'controllers'.DS); +/** + * Path to the application's components directory. + */ + define ('COMPONENTS', CONTROLLERS.'components'.DS); +/** + * Path to the application's views directory. + */ + define ('VIEWS', APP.'views'.DS); +/** + * Path to the application's helpers directory. + */ + define ('HELPERS', VIEWS.'helpers'.DS); +/** + * Path to the application's view's layouts directory. + */ + define ('LAYOUTS', VIEWS.'layouts'.DS); +/** + * Path to the application's view's elements directory. + * It's supposed to hold pieces of PHP/HTML that are used on multiple pages + * and are not linked to a particular layout (like polls, footers and so on). + */ + define ('ELEMENTS', VIEWS.'elements'.DS); +/** + * Path to the configuration files directory. + */ +if (!defined('CONFIGS')) { + define ('CONFIGS', APP.'config'.DS); +} +/** + * Path to the libs directory. + */ + define ('INFLECTIONS', CAKE.'config'.DS.'inflections'.DS); +/** + * Path to the libs directory. + */ + define ('LIBS', CAKE.'libs'.DS); +/** + * Path to the public CSS directory. + */ + define ('CSS', WWW_ROOT.'css'.DS); +/** + * Path to the public JavaScript directory. + */ + define ('JS', WWW_ROOT.'js'.DS); +/** + * Path to the public images directory. + */ + define ('IMAGES', WWW_ROOT.'img'.DS); +/** + * Path to the console libs direcotry. + */ + define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS); +/** + * Path to the tests directory. + */ +if (!defined('TESTS')) { + define ('TESTS', APP.'tests'.DS); +} +/** + * Path to the core tests directory. + */ +if (!defined('CAKE_TESTS')) { + define ('CAKE_TESTS', CAKE.'tests'.DS); +} +/** + * Path to the test suite. + */ + define ('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS); + +/** + * Path to the controller test directory. + */ + define ('CONTROLLER_TESTS', TESTS.'cases'.DS.'controllers'.DS); +/** + * Path to the components test directory. + */ + define ('COMPONENT_TESTS', TESTS.'cases'.DS.'components'.DS); +/** + * Path to the helpers test directory. + */ + define ('HELPER_TESTS', TESTS.'cases'.DS.'views'.DS.'helpers'.DS); +/** + * Path to the models' test directory. + */ + define ('MODEL_TESTS', TESTS.'cases'.DS.'models'.DS); +/** + * Path to the lib test directory. + */ + define ('LIB_TESTS', CAKE_TESTS.'cases'.DS.'lib'.DS); +/** + * Path to the temporary files directory. + */ +if (!defined('TMP')) { + define ('TMP', APP.'tmp'.DS); +} +/** + * Path to the logs directory. + */ + define ('LOGS', TMP.'logs'.DS); +/** + * Path to the cache files directory. It can be shared between hosts in a multi-server setup. + */ + define('CACHE', TMP.'cache'.DS); +/** + * Path to the vendors directory. + */ +if (!defined('VENDORS')) { + define ('VENDORS', CAKE_CORE_INCLUDE_PATH.DS.'vendors'.DS); +} +/** + * Path to the Pear directory + * The purporse is to make it easy porting Pear libs into Cake + * without setting the include_path PHP variable. + */ + define ('PEAR', VENDORS.'Pear'.DS); +/** + * Full url prefix + */ +if (!defined('FULL_BASE_URL')) { + $s = null; + if (env('HTTPS')) { + $s ='s'; + } + + $httpHost = env('HTTP_HOST'); + + if (isset($httpHost)) { + define('FULL_BASE_URL', 'http'.$s.'://'.$httpHost); + } + unset($httpHost, $s); +} +/** + * Web path to the public images directory. + */ +if (!defined('IMAGES_URL')) { + define ('IMAGES_URL', 'img/'); +} +/** + * Web path to the CSS files directory. + */ +if (!defined('CSS_URL')) { + define ('CSS_URL', 'css/'); +} +/** + * Web path to the js files directory. + */ +if (!defined('JS_URL')) { + define ('JS_URL', 'js/'); +} +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0080_00ff.php b/cake/config/unicode/casefolding/0080_00ff.php new file mode 100644 index 000000000..03521584b --- /dev/null +++ b/cake/config/unicode/casefolding/0080_00ff.php @@ -0,0 +1,81 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0080_00ff'][] = array('upper' => 181, 'status' => 'C', 'lower' => array(956)); +$config['0080_00ff'][] = array('upper' => 924, 'status' => 'C', 'lower' => array(181)); +$config['0080_00ff'][] = array('upper' => 192, 'status' => 'C', 'lower' => array(224)); /* LATIN CAPITAL LETTER A WITH GRAVE */ +$config['0080_00ff'][] = array('upper' => 193, 'status' => 'C', 'lower' => array(225)); /* LATIN CAPITAL LETTER A WITH ACUTE */ +$config['0080_00ff'][] = array('upper' => 194, 'status' => 'C', 'lower' => array(226)); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ +$config['0080_00ff'][] = array('upper' => 195, 'status' => 'C', 'lower' => array(227)); /* LATIN CAPITAL LETTER A WITH TILDE */ +$config['0080_00ff'][] = array('upper' => 196, 'status' => 'C', 'lower' => array(228)); /* LATIN CAPITAL LETTER A WITH DIAERESIS */ +$config['0080_00ff'][] = array('upper' => 197, 'status' => 'C', 'lower' => array(229)); /* LATIN CAPITAL LETTER A WITH RING ABOVE */ +$config['0080_00ff'][] = array('upper' => 198, 'status' => 'C', 'lower' => array(230)); /* LATIN CAPITAL LETTER AE */ +$config['0080_00ff'][] = array('upper' => 199, 'status' => 'C', 'lower' => array(231)); /* LATIN CAPITAL LETTER C WITH CEDILLA */ +$config['0080_00ff'][] = array('upper' => 200, 'status' => 'C', 'lower' => array(232)); /* LATIN CAPITAL LETTER E WITH GRAVE */ +$config['0080_00ff'][] = array('upper' => 201, 'status' => 'C', 'lower' => array(233)); /* LATIN CAPITAL LETTER E WITH ACUTE */ +$config['0080_00ff'][] = array('upper' => 202, 'status' => 'C', 'lower' => array(234)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ +$config['0080_00ff'][] = array('upper' => 203, 'status' => 'C', 'lower' => array(235)); /* LATIN CAPITAL LETTER E WITH DIAERESIS */ +$config['0080_00ff'][] = array('upper' => 204, 'status' => 'C', 'lower' => array(236)); /* LATIN CAPITAL LETTER I WITH GRAVE */ +$config['0080_00ff'][] = array('upper' => 205, 'status' => 'C', 'lower' => array(237)); /* LATIN CAPITAL LETTER I WITH ACUTE */ +$config['0080_00ff'][] = array('upper' => 206, 'status' => 'C', 'lower' => array(238)); /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ +$config['0080_00ff'][] = array('upper' => 207, 'status' => 'C', 'lower' => array(239)); /* LATIN CAPITAL LETTER I WITH DIAERESIS */ +$config['0080_00ff'][] = array('upper' => 208, 'status' => 'C', 'lower' => array(240)); /* LATIN CAPITAL LETTER ETH */ +$config['0080_00ff'][] = array('upper' => 209, 'status' => 'C', 'lower' => array(241)); /* LATIN CAPITAL LETTER N WITH TILDE */ +$config['0080_00ff'][] = array('upper' => 210, 'status' => 'C', 'lower' => array(242)); /* LATIN CAPITAL LETTER O WITH GRAVE */ +$config['0080_00ff'][] = array('upper' => 211, 'status' => 'C', 'lower' => array(243)); /* LATIN CAPITAL LETTER O WITH ACUTE */ +$config['0080_00ff'][] = array('upper' => 212, 'status' => 'C', 'lower' => array(244)); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ +$config['0080_00ff'][] = array('upper' => 213, 'status' => 'C', 'lower' => array(245)); /* LATIN CAPITAL LETTER O WITH TILDE */ +$config['0080_00ff'][] = array('upper' => 214, 'status' => 'C', 'lower' => array(246)); /* LATIN CAPITAL LETTER O WITH DIAERESIS */ +$config['0080_00ff'][] = array('upper' => 216, 'status' => 'C', 'lower' => array(248)); /* LATIN CAPITAL LETTER O WITH STROKE */ +$config['0080_00ff'][] = array('upper' => 217, 'status' => 'C', 'lower' => array(249)); /* LATIN CAPITAL LETTER U WITH GRAVE */ +$config['0080_00ff'][] = array('upper' => 218, 'status' => 'C', 'lower' => array(250)); /* LATIN CAPITAL LETTER U WITH ACUTE */ +$config['0080_00ff'][] = array('upper' => 219, 'status' => 'C', 'lower' => array(251)); /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ +$config['0080_00ff'][] = array('upper' => 220, 'status' => 'C', 'lower' => array(252)); /* LATIN CAPITAL LETTER U WITH DIAERESIS */ +$config['0080_00ff'][] = array('upper' => 221, 'status' => 'C', 'lower' => array(253)); /* LATIN CAPITAL LETTER Y WITH ACUTE */ +$config['0080_00ff'][] = array('upper' => 222, 'status' => 'C', 'lower' => array(254)); /* LATIN CAPITAL LETTER THORN */ +$config['0080_00ff'][] = array('upper' => 223, 'status' => 'F', 'lower' => array(115, 115)); /* LATIN SMALL LETTER SHARP S */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0100_017f.php b/cake/config/unicode/casefolding/0100_017f.php new file mode 100644 index 000000000..1a8b6cfbd --- /dev/null +++ b/cake/config/unicode/casefolding/0100_017f.php @@ -0,0 +1,114 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0100_017f'][] = array('upper' => 256, 'status' => 'C', 'lower' => array(257)); /* LATIN CAPITAL LETTER A WITH MACRON */ +$config['0100_017f'][] = array('upper' => 258, 'status' => 'C', 'lower' => array(259)); /* LATIN CAPITAL LETTER A WITH BREVE */ +$config['0100_017f'][] = array('upper' => 260, 'status' => 'C', 'lower' => array(261)); /* LATIN CAPITAL LETTER A WITH OGONEK */ +$config['0100_017f'][] = array('upper' => 262, 'status' => 'C', 'lower' => array(263)); /* LATIN CAPITAL LETTER C WITH ACUTE */ +$config['0100_017f'][] = array('upper' => 264, 'status' => 'C', 'lower' => array(265)); /* LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 266, 'status' => 'C', 'lower' => array(267)); /* LATIN CAPITAL LETTER C WITH DOT ABOVE */ +$config['0100_017f'][] = array('upper' => 268, 'status' => 'C', 'lower' => array(269)); /* LATIN CAPITAL LETTER C WITH CARON */ +$config['0100_017f'][] = array('upper' => 270, 'status' => 'C', 'lower' => array(271)); /* LATIN CAPITAL LETTER D WITH CARON */ +$config['0100_017f'][] = array('upper' => 272, 'status' => 'C', 'lower' => array(273)); /* LATIN CAPITAL LETTER D WITH STROKE */ +$config['0100_017f'][] = array('upper' => 274, 'status' => 'C', 'lower' => array(275)); /* LATIN CAPITAL LETTER E WITH MACRON */ +$config['0100_017f'][] = array('upper' => 276, 'status' => 'C', 'lower' => array(277)); /* LATIN CAPITAL LETTER E WITH BREVE */ +$config['0100_017f'][] = array('upper' => 278, 'status' => 'C', 'lower' => array(279)); /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ +$config['0100_017f'][] = array('upper' => 280, 'status' => 'C', 'lower' => array(281)); /* LATIN CAPITAL LETTER E WITH OGONEK */ +$config['0100_017f'][] = array('upper' => 282, 'status' => 'C', 'lower' => array(283)); /* LATIN CAPITAL LETTER E WITH CARON */ +$config['0100_017f'][] = array('upper' => 284, 'status' => 'C', 'lower' => array(285)); /* LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 286, 'status' => 'C', 'lower' => array(287)); /* LATIN CAPITAL LETTER G WITH BREVE */ +$config['0100_017f'][] = array('upper' => 288, 'status' => 'C', 'lower' => array(289)); /* LATIN CAPITAL LETTER G WITH DOT ABOVE */ +$config['0100_017f'][] = array('upper' => 290, 'status' => 'C', 'lower' => array(291)); /* LATIN CAPITAL LETTER G WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 292, 'status' => 'C', 'lower' => array(293)); /* LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 294, 'status' => 'C', 'lower' => array(295)); /* LATIN CAPITAL LETTER H WITH STROKE */ +$config['0100_017f'][] = array('upper' => 296, 'status' => 'C', 'lower' => array(297)); /* LATIN CAPITAL LETTER I WITH TILDE */ +$config['0100_017f'][] = array('upper' => 298, 'status' => 'C', 'lower' => array(299)); /* LATIN CAPITAL LETTER I WITH MACRON */ +$config['0100_017f'][] = array('upper' => 300, 'status' => 'C', 'lower' => array(301)); /* LATIN CAPITAL LETTER I WITH BREVE */ +$config['0100_017f'][] = array('upper' => 302, 'status' => 'C', 'lower' => array(303)); /* LATIN CAPITAL LETTER I WITH OGONEK */ +$config['0100_017f'][] = array('upper' => 304, 'status' => 'F', 'lower' => array(105, 775)); /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ +$config['0100_017f'][] = array('upper' => 304, 'status' => 'T', 'lower' => array(105)); /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ +$config['0100_017f'][] = array('upper' => 306, 'status' => 'C', 'lower' => array(307)); /* LATIN CAPITAL LIGATURE IJ */ +$config['0100_017f'][] = array('upper' => 308, 'status' => 'C', 'lower' => array(309)); /* LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 310, 'status' => 'C', 'lower' => array(311)); /* LATIN CAPITAL LETTER K WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 313, 'status' => 'C', 'lower' => array(314)); /* LATIN CAPITAL LETTER L WITH ACUTE */ +$config['0100_017f'][] = array('upper' => 315, 'status' => 'C', 'lower' => array(316)); /* LATIN CAPITAL LETTER L WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 317, 'status' => 'C', 'lower' => array(318)); /* LATIN CAPITAL LETTER L WITH CARON */ +$config['0100_017f'][] = array('upper' => 319, 'status' => 'C', 'lower' => array(320)); /* LATIN CAPITAL LETTER L WITH MIDDLE DOT */ +$config['0100_017f'][] = array('upper' => 321, 'status' => 'C', 'lower' => array(322)); /* LATIN CAPITAL LETTER L WITH STROKE */ +$config['0100_017f'][] = array('upper' => 323, 'status' => 'C', 'lower' => array(324)); /* LATIN CAPITAL LETTER N WITH ACUTE */ +$config['0100_017f'][] = array('upper' => 325, 'status' => 'C', 'lower' => array(326)); /* LATIN CAPITAL LETTER N WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 327, 'status' => 'C', 'lower' => array(328)); /* LATIN CAPITAL LETTER N WITH CARON */ +$config['0100_017f'][] = array('upper' => 329, 'status' => 'F', 'lower' => array(700, 110)); /* LATIN SMALL LETTER N PRECEDED BY APOSTROPHE */ +$config['0100_017f'][] = array('upper' => 330, 'status' => 'C', 'lower' => array(331)); /* LATIN CAPITAL LETTER ENG */ +$config['0100_017f'][] = array('upper' => 332, 'status' => 'C', 'lower' => array(333)); /* LATIN CAPITAL LETTER O WITH MACRON */ +$config['0100_017f'][] = array('upper' => 334, 'status' => 'C', 'lower' => array(335)); /* LATIN CAPITAL LETTER O WITH BREVE */ +$config['0100_017f'][] = array('upper' => 336, 'status' => 'C', 'lower' => array(337)); /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ +$config['0100_017f'][] = array('upper' => 338, 'status' => 'C', 'lower' => array(339)); /* LATIN CAPITAL LIGATURE OE */ +$config['0100_017f'][] = array('upper' => 340, 'status' => 'C', 'lower' => array(341)); /* LATIN CAPITAL LETTER R WITH ACUTE */ +$config['0100_017f'][] = array('upper' => 342, 'status' => 'C', 'lower' => array(343)); /* LATIN CAPITAL LETTER R WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 344, 'status' => 'C', 'lower' => array(345)); /* LATIN CAPITAL LETTER R WITH CARON */ +$config['0100_017f'][] = array('upper' => 346, 'status' => 'C', 'lower' => array(347)); /* LATIN CAPITAL LETTER S WITH ACUTE */ +$config['0100_017f'][] = array('upper' => 348, 'status' => 'C', 'lower' => array(349)); /* LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 350, 'status' => 'C', 'lower' => array(351)); /* LATIN CAPITAL LETTER S WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 352, 'status' => 'C', 'lower' => array(353)); /* LATIN CAPITAL LETTER S WITH CARON */ +$config['0100_017f'][] = array('upper' => 354, 'status' => 'C', 'lower' => array(355)); /* LATIN CAPITAL LETTER T WITH CEDILLA */ +$config['0100_017f'][] = array('upper' => 356, 'status' => 'C', 'lower' => array(357)); /* LATIN CAPITAL LETTER T WITH CARON */ +$config['0100_017f'][] = array('upper' => 358, 'status' => 'C', 'lower' => array(359)); /* LATIN CAPITAL LETTER T WITH STROKE */ +$config['0100_017f'][] = array('upper' => 360, 'status' => 'C', 'lower' => array(361)); /* LATIN CAPITAL LETTER U WITH TILDE */ +$config['0100_017f'][] = array('upper' => 362, 'status' => 'C', 'lower' => array(363)); /* LATIN CAPITAL LETTER U WITH MACRON */ +$config['0100_017f'][] = array('upper' => 364, 'status' => 'C', 'lower' => array(365)); /* LATIN CAPITAL LETTER U WITH BREVE */ +$config['0100_017f'][] = array('upper' => 366, 'status' => 'C', 'lower' => array(367)); /* LATIN CAPITAL LETTER U WITH RING ABOVE */ +$config['0100_017f'][] = array('upper' => 368, 'status' => 'C', 'lower' => array(369)); /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ +$config['0100_017f'][] = array('upper' => 370, 'status' => 'C', 'lower' => array(371)); /* LATIN CAPITAL LETTER U WITH OGONEK */ +$config['0100_017f'][] = array('upper' => 372, 'status' => 'C', 'lower' => array(373)); /* LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 374, 'status' => 'C', 'lower' => array(375)); /* LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ +$config['0100_017f'][] = array('upper' => 376, 'status' => 'C', 'lower' => array(255)); /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ +$config['0100_017f'][] = array('upper' => 377, 'status' => 'C', 'lower' => array(378)); /* LATIN CAPITAL LETTER Z WITH ACUTE */ +$config['0100_017f'][] = array('upper' => 379, 'status' => 'C', 'lower' => array(380)); /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ +$config['0100_017f'][] = array('upper' => 381, 'status' => 'C', 'lower' => array(382)); /* LATIN CAPITAL LETTER Z WITH CARON */ +$config['0100_017f'][] = array('upper' => 383, 'status' => 'C', 'lower' => array(115)); /* LATIN SMALL LETTER LONG S */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0180_024F.php b/cake/config/unicode/casefolding/0180_024F.php new file mode 100644 index 000000000..991f2fb7b --- /dev/null +++ b/cake/config/unicode/casefolding/0180_024F.php @@ -0,0 +1,156 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0180_024F'][] = array('upper' => 385, 'status' => 'C', 'lower' => array(595)); /* LATIN CAPITAL LETTER B WITH HOOK */ +$config['0180_024F'][] = array('upper' => 386, 'status' => 'C', 'lower' => array(387)); /* LATIN CAPITAL LETTER B WITH TOPBAR */ +$config['0180_024F'][] = array('upper' => 388, 'status' => 'C', 'lower' => array(389)); /* LATIN CAPITAL LETTER TONE SIX */ +$config['0180_024F'][] = array('upper' => 390, 'status' => 'C', 'lower' => array(596)); /* LATIN CAPITAL LETTER OPEN O */ +$config['0180_024F'][] = array('upper' => 391, 'status' => 'C', 'lower' => array(392)); /* LATIN CAPITAL LETTER C WITH HOOK */ +$config['0180_024F'][] = array('upper' => 393, 'status' => 'C', 'lower' => array(598)); /* LATIN CAPITAL LETTER AFRICAN D */ +$config['0180_024F'][] = array('upper' => 394, 'status' => 'C', 'lower' => array(599)); /* LATIN CAPITAL LETTER D WITH HOOK */ +$config['0180_024F'][] = array('upper' => 395, 'status' => 'C', 'lower' => array(396)); /* LATIN CAPITAL LETTER D WITH TOPBAR */ +$config['0180_024F'][] = array('upper' => 398, 'status' => 'C', 'lower' => array(477)); /* LATIN CAPITAL LETTER REVERSED E */ +$config['0180_024F'][] = array('upper' => 399, 'status' => 'C', 'lower' => array(601)); /* LATIN CAPITAL LETTER SCHWA */ +$config['0180_024F'][] = array('upper' => 400, 'status' => 'C', 'lower' => array(603)); /* LATIN CAPITAL LETTER OPEN E */ +$config['0180_024F'][] = array('upper' => 401, 'status' => 'C', 'lower' => array(402)); /* LATIN CAPITAL LETTER F WITH HOOK */ +$config['0180_024F'][] = array('upper' => 403, 'status' => 'C', 'lower' => array(608)); /* LATIN CAPITAL LETTER G WITH HOOK */ +$config['0180_024F'][] = array('upper' => 404, 'status' => 'C', 'lower' => array(611)); /* LATIN CAPITAL LETTER GAMMA */ +$config['0180_024F'][] = array('upper' => 406, 'status' => 'C', 'lower' => array(617)); /* LATIN CAPITAL LETTER IOTA */ +$config['0180_024F'][] = array('upper' => 407, 'status' => 'C', 'lower' => array(616)); /* LATIN CAPITAL LETTER I WITH STROKE */ +$config['0180_024F'][] = array('upper' => 408, 'status' => 'C', 'lower' => array(409)); /* LATIN CAPITAL LETTER K WITH HOOK */ +$config['0180_024F'][] = array('upper' => 412, 'status' => 'C', 'lower' => array(623)); /* LATIN CAPITAL LETTER TURNED M */ +$config['0180_024F'][] = array('upper' => 413, 'status' => 'C', 'lower' => array(626)); /* LATIN CAPITAL LETTER N WITH LEFT HOOK */ +$config['0180_024F'][] = array('upper' => 415, 'status' => 'C', 'lower' => array(629)); /* LATIN CAPITAL LETTER O WITH MIDDLE TILDE */ +$config['0180_024F'][] = array('upper' => 416, 'status' => 'C', 'lower' => array(417)); /* LATIN CAPITAL LETTER O WITH HORN */ +$config['0180_024F'][] = array('upper' => 418, 'status' => 'C', 'lower' => array(419)); /* LATIN CAPITAL LETTER OI */ +$config['0180_024F'][] = array('upper' => 420, 'status' => 'C', 'lower' => array(421)); /* LATIN CAPITAL LETTER P WITH HOOK */ +$config['0180_024F'][] = array('upper' => 422, 'status' => 'C', 'lower' => array(640)); /* LATIN LETTER YR */ +$config['0180_024F'][] = array('upper' => 423, 'status' => 'C', 'lower' => array(424)); /* LATIN CAPITAL LETTER TONE TWO */ +$config['0180_024F'][] = array('upper' => 425, 'status' => 'C', 'lower' => array(643)); /* LATIN CAPITAL LETTER ESH */ +$config['0180_024F'][] = array('upper' => 428, 'status' => 'C', 'lower' => array(429)); /* LATIN CAPITAL LETTER T WITH HOOK */ +$config['0180_024F'][] = array('upper' => 430, 'status' => 'C', 'lower' => array(648)); /* LATIN CAPITAL LETTER T WITH RETROFLEX HOOK */ +$config['0180_024F'][] = array('upper' => 431, 'status' => 'C', 'lower' => array(432)); /* LATIN CAPITAL LETTER U WITH HORN */ +$config['0180_024F'][] = array('upper' => 433, 'status' => 'C', 'lower' => array(650)); /* LATIN CAPITAL LETTER UPSILON */ +$config['0180_024F'][] = array('upper' => 434, 'status' => 'C', 'lower' => array(651)); /* LATIN CAPITAL LETTER V WITH HOOK */ +$config['0180_024F'][] = array('upper' => 435, 'status' => 'C', 'lower' => array(436)); /* LATIN CAPITAL LETTER Y WITH HOOK */ +$config['0180_024F'][] = array('upper' => 437, 'status' => 'C', 'lower' => array(438)); /* LATIN CAPITAL LETTER Z WITH STROKE */ +$config['0180_024F'][] = array('upper' => 439, 'status' => 'C', 'lower' => array(658)); /* LATIN CAPITAL LETTER EZH */ +$config['0180_024F'][] = array('upper' => 440, 'status' => 'C', 'lower' => array(441)); /* LATIN CAPITAL LETTER EZH REVERSED */ +$config['0180_024F'][] = array('upper' => 444, 'status' => 'C', 'lower' => array(445)); /* LATIN CAPITAL LETTER TONE FIVE */ +$config['0180_024F'][] = array('upper' => 452, 'status' => 'C', 'lower' => array(454)); /* LATIN CAPITAL LETTER DZ WITH CARON */ +$config['0180_024F'][] = array('upper' => 453, 'status' => 'C', 'lower' => array(454)); /* LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON */ +$config['0180_024F'][] = array('upper' => 455, 'status' => 'C', 'lower' => array(457)); /* LATIN CAPITAL LETTER LJ */ +$config['0180_024F'][] = array('upper' => 456, 'status' => 'C', 'lower' => array(457)); /* LATIN CAPITAL LETTER L WITH SMALL LETTER J */ +$config['0180_024F'][] = array('upper' => 458, 'status' => 'C', 'lower' => array(460)); /* LATIN CAPITAL LETTER NJ */ +$config['0180_024F'][] = array('upper' => 459, 'status' => 'C', 'lower' => array(460)); /* LATIN CAPITAL LETTER N WITH SMALL LETTER J */ +$config['0180_024F'][] = array('upper' => 461, 'status' => 'C', 'lower' => array(462)); /* LATIN CAPITAL LETTER A WITH CARON */ +$config['0180_024F'][] = array('upper' => 463, 'status' => 'C', 'lower' => array(464)); /* LATIN CAPITAL LETTER I WITH CARON */ +$config['0180_024F'][] = array('upper' => 465, 'status' => 'C', 'lower' => array(466)); /* LATIN CAPITAL LETTER O WITH CARON */ +$config['0180_024F'][] = array('upper' => 467, 'status' => 'C', 'lower' => array(468)); /* LATIN CAPITAL LETTER U WITH CARON */ +$config['0180_024F'][] = array('upper' => 469, 'status' => 'C', 'lower' => array(470)); /* LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON */ +$config['0180_024F'][] = array('upper' => 471, 'status' => 'C', 'lower' => array(472)); /* LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE */ +$config['0180_024F'][] = array('upper' => 473, 'status' => 'C', 'lower' => array(474)); /* LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON */ +$config['0180_024F'][] = array('upper' => 475, 'status' => 'C', 'lower' => array(476)); /* LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE */ +$config['0180_024F'][] = array('upper' => 478, 'status' => 'C', 'lower' => array(479)); /* LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON */ +$config['0180_024F'][] = array('upper' => 480, 'status' => 'C', 'lower' => array(481)); /* LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON */ +$config['0180_024F'][] = array('upper' => 482, 'status' => 'C', 'lower' => array(483)); /* LATIN CAPITAL LETTER AE WITH MACRON */ +$config['0180_024F'][] = array('upper' => 484, 'status' => 'C', 'lower' => array(485)); /* LATIN CAPITAL LETTER G WITH STROKE */ +$config['0180_024F'][] = array('upper' => 486, 'status' => 'C', 'lower' => array(487)); /* LATIN CAPITAL LETTER G WITH CARON */ +$config['0180_024F'][] = array('upper' => 488, 'status' => 'C', 'lower' => array(489)); /* LATIN CAPITAL LETTER K WITH CARON */ +$config['0180_024F'][] = array('upper' => 490, 'status' => 'C', 'lower' => array(491)); /* LATIN CAPITAL LETTER O WITH OGONEK */ +$config['0180_024F'][] = array('upper' => 492, 'status' => 'C', 'lower' => array(493)); /* LATIN CAPITAL LETTER O WITH OGONEK AND MACRON */ +$config['0180_024F'][] = array('upper' => 494, 'status' => 'C', 'lower' => array(495)); /* LATIN CAPITAL LETTER EZH WITH CARON */ +$config['0180_024F'][] = array('upper' => 496, 'status' => 'F', 'lower' => array(106, 780)); /* LATIN SMALL LETTER J WITH CARON */ +$config['0180_024F'][] = array('upper' => 497, 'status' => 'C', 'lower' => array(499)); /* LATIN CAPITAL LETTER DZ */ +$config['0180_024F'][] = array('upper' => 498, 'status' => 'C', 'lower' => array(499)); /* LATIN CAPITAL LETTER D WITH SMALL LETTER Z */ +$config['0180_024F'][] = array('upper' => 500, 'status' => 'C', 'lower' => array(501)); /* LATIN CAPITAL LETTER G WITH ACUTE */ +$config['0180_024F'][] = array('upper' => 502, 'status' => 'C', 'lower' => array(405)); /* LATIN CAPITAL LETTER HWAIR */ +$config['0180_024F'][] = array('upper' => 503, 'status' => 'C', 'lower' => array(447)); /* LATIN CAPITAL LETTER WYNN */ +$config['0180_024F'][] = array('upper' => 504, 'status' => 'C', 'lower' => array(505)); /* LATIN CAPITAL LETTER N WITH GRAVE */ +$config['0180_024F'][] = array('upper' => 506, 'status' => 'C', 'lower' => array(507)); /* LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE */ +$config['0180_024F'][] = array('upper' => 508, 'status' => 'C', 'lower' => array(509)); /* LATIN CAPITAL LETTER AE WITH ACUTE */ +$config['0180_024F'][] = array('upper' => 510, 'status' => 'C', 'lower' => array(511)); /* LATIN CAPITAL LETTER O WITH STROKE AND ACUTE */ +$config['0180_024F'][] = array('upper' => 512, 'status' => 'C', 'lower' => array(513)); /* LATIN CAPITAL LETTER A WITH DOUBLE GRAVE */ +$config['0180_024F'][] = array('upper' => 514, 'status' => 'C', 'lower' => array(515)); /* LATIN CAPITAL LETTER A WITH INVERTED BREVE */ +$config['0180_024F'][] = array('upper' => 516, 'status' => 'C', 'lower' => array(517)); /* LATIN CAPITAL LETTER E WITH DOUBLE GRAVE */ +$config['0180_024F'][] = array('upper' => 518, 'status' => 'C', 'lower' => array(519)); /* LATIN CAPITAL LETTER E WITH INVERTED BREVE */ +$config['0180_024F'][] = array('upper' => 520, 'status' => 'C', 'lower' => array(521)); /* LATIN CAPITAL LETTER I WITH DOUBLE GRAVE */ +$config['0180_024F'][] = array('upper' => 522, 'status' => 'C', 'lower' => array(523)); /* LATIN CAPITAL LETTER I WITH INVERTED BREVE */ +$config['0180_024F'][] = array('upper' => 524, 'status' => 'C', 'lower' => array(525)); /* LATIN CAPITAL LETTER O WITH DOUBLE GRAVE */ +$config['0180_024F'][] = array('upper' => 526, 'status' => 'C', 'lower' => array(527)); /* LATIN CAPITAL LETTER O WITH INVERTED BREVE */ +$config['0180_024F'][] = array('upper' => 528, 'status' => 'C', 'lower' => array(529)); /* LATIN CAPITAL LETTER R WITH DOUBLE GRAVE */ +$config['0180_024F'][] = array('upper' => 530, 'status' => 'C', 'lower' => array(531)); /* LATIN CAPITAL LETTER R WITH INVERTED BREVE */ +$config['0180_024F'][] = array('upper' => 532, 'status' => 'C', 'lower' => array(533)); /* LATIN CAPITAL LETTER U WITH DOUBLE GRAVE */ +$config['0180_024F'][] = array('upper' => 534, 'status' => 'C', 'lower' => array(535)); /* LATIN CAPITAL LETTER U WITH INVERTED BREVE */ +$config['0180_024F'][] = array('upper' => 536, 'status' => 'C', 'lower' => array(537)); /* LATIN CAPITAL LETTER S WITH COMMA BELOW */ +$config['0180_024F'][] = array('upper' => 538, 'status' => 'C', 'lower' => array(539)); /* LATIN CAPITAL LETTER T WITH COMMA BELOW */ +$config['0180_024F'][] = array('upper' => 540, 'status' => 'C', 'lower' => array(541)); /* LATIN CAPITAL LETTER YOGH */ +$config['0180_024F'][] = array('upper' => 542, 'status' => 'C', 'lower' => array(543)); /* LATIN CAPITAL LETTER H WITH CARON */ +$config['0180_024F'][] = array('upper' => 544, 'status' => 'C', 'lower' => array(414)); /* LATIN CAPITAL LETTER N WITH LONG RIGHT LEG */ +$config['0180_024F'][] = array('upper' => 546, 'status' => 'C', 'lower' => array(547)); /* LATIN CAPITAL LETTER OU */ +$config['0180_024F'][] = array('upper' => 548, 'status' => 'C', 'lower' => array(549)); /* LATIN CAPITAL LETTER Z WITH HOOK */ +$config['0180_024F'][] = array('upper' => 550, 'status' => 'C', 'lower' => array(551)); /* LATIN CAPITAL LETTER A WITH DOT ABOVE */ +$config['0180_024F'][] = array('upper' => 552, 'status' => 'C', 'lower' => array(553)); /* LATIN CAPITAL LETTER E WITH CEDILLA */ +$config['0180_024F'][] = array('upper' => 554, 'status' => 'C', 'lower' => array(555)); /* LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON */ +$config['0180_024F'][] = array('upper' => 556, 'status' => 'C', 'lower' => array(557)); /* LATIN CAPITAL LETTER O WITH TILDE AND MACRON */ +$config['0180_024F'][] = array('upper' => 558, 'status' => 'C', 'lower' => array(559)); /* LATIN CAPITAL LETTER O WITH DOT ABOVE */ +$config['0180_024F'][] = array('upper' => 560, 'status' => 'C', 'lower' => array(561)); /* LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON */ +$config['0180_024F'][] = array('upper' => 562, 'status' => 'C', 'lower' => array(563)); /* LATIN CAPITAL LETTER Y WITH MACRON */ +$config['0180_024F'][] = array('upper' => 570, 'status' => 'C', 'lower' => array(11365)); /* LATIN CAPITAL LETTER A WITH STROKE */ +$config['0180_024F'][] = array('upper' => 571, 'status' => 'C', 'lower' => array(572)); /* LATIN CAPITAL LETTER C WITH STROKE */ +$config['0180_024F'][] = array('upper' => 573, 'status' => 'C', 'lower' => array(410)); /* LATIN CAPITAL LETTER L WITH BAR */ +$config['0180_024F'][] = array('upper' => 574, 'status' => 'C', 'lower' => array(11366)); /* LATIN CAPITAL LETTER T WITH DIAGONAL STROKE */ +$config['0180_024F'][] = array('upper' => 577, 'status' => 'C', 'lower' => array(578)); /* LATIN CAPITAL LETTER GLOTTAL STOP */ +$config['0180_024F'][] = array('upper' => 579, 'status' => 'C', 'lower' => array(384)); /* LATIN CAPITAL LETTER B WITH STROKE */ +$config['0180_024F'][] = array('upper' => 580, 'status' => 'C', 'lower' => array(649)); /* LATIN CAPITAL LETTER U BAR */ +$config['0180_024F'][] = array('upper' => 581, 'status' => 'C', 'lower' => array(652)); /* LATIN CAPITAL LETTER TURNED V */ +$config['0180_024F'][] = array('upper' => 582, 'status' => 'C', 'lower' => array(583)); /* LATIN CAPITAL LETTER E WITH STROKE */ +$config['0180_024F'][] = array('upper' => 584, 'status' => 'C', 'lower' => array(585)); /* LATIN CAPITAL LETTER J WITH STROKE */ +$config['0180_024F'][] = array('upper' => 586, 'status' => 'C', 'lower' => array(587)); /* LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL */ +$config['0180_024F'][] = array('upper' => 588, 'status' => 'C', 'lower' => array(589)); /* LATIN CAPITAL LETTER R WITH STROKE */ +$config['0180_024F'][] = array('upper' => 590, 'status' => 'C', 'lower' => array(591)); /* LATIN CAPITAL LETTER Y WITH STROKE */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0250_02af.php b/cake/config/unicode/casefolding/0250_02af.php new file mode 100644 index 000000000..1b7c28f58 --- /dev/null +++ b/cake/config/unicode/casefolding/0250_02af.php @@ -0,0 +1,49 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.6833 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0250_02af'][] = array('upper' => 422, 'status' => 'C', 'lower' => array(640)); +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0370_03ff.php b/cake/config/unicode/casefolding/0370_03ff.php new file mode 100644 index 000000000..eaec95258 --- /dev/null +++ b/cake/config/unicode/casefolding/0370_03ff.php @@ -0,0 +1,110 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0370_03ff'][] = array('upper' => 902, 'status' => 'C', 'lower' => array(940)); /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ +$config['0370_03ff'][] = array('upper' => 904, 'status' => 'C', 'lower' => array(941)); /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ +$config['0370_03ff'][] = array('upper' => 905, 'status' => 'C', 'lower' => array(942)); /* GREEK CAPITAL LETTER ETA WITH TONOS */ +$config['0370_03ff'][] = array('upper' => 906, 'status' => 'C', 'lower' => array(943)); /* GREEK CAPITAL LETTER IOTA WITH TONOS */ +$config['0370_03ff'][] = array('upper' => 908, 'status' => 'C', 'lower' => array(972)); /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ +$config['0370_03ff'][] = array('upper' => 910, 'status' => 'C', 'lower' => array(973)); /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ +$config['0370_03ff'][] = array('upper' => 911, 'status' => 'C', 'lower' => array(974)); /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ +//$config['0370_03ff'][] = array('upper' => 912, 'status' => 'F', 'lower' => array(953, 776, 769)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ +$config['0370_03ff'][] = array('upper' => 913, 'status' => 'C', 'lower' => array(945)); /* GREEK CAPITAL LETTER ALPHA */ +$config['0370_03ff'][] = array('upper' => 914, 'status' => 'C', 'lower' => array(946)); /* GREEK CAPITAL LETTER BETA */ +$config['0370_03ff'][] = array('upper' => 915, 'status' => 'C', 'lower' => array(947)); /* GREEK CAPITAL LETTER GAMMA */ +$config['0370_03ff'][] = array('upper' => 916, 'status' => 'C', 'lower' => array(948)); /* GREEK CAPITAL LETTER DELTA */ +$config['0370_03ff'][] = array('upper' => 917, 'status' => 'C', 'lower' => array(949)); /* GREEK CAPITAL LETTER EPSILON */ +$config['0370_03ff'][] = array('upper' => 918, 'status' => 'C', 'lower' => array(950)); /* GREEK CAPITAL LETTER ZETA */ +$config['0370_03ff'][] = array('upper' => 919, 'status' => 'C', 'lower' => array(951)); /* GREEK CAPITAL LETTER ETA */ +$config['0370_03ff'][] = array('upper' => 920, 'status' => 'C', 'lower' => array(952)); /* GREEK CAPITAL LETTER THETA */ +$config['0370_03ff'][] = array('upper' => 921, 'status' => 'C', 'lower' => array(953)); /* GREEK CAPITAL LETTER IOTA */ +$config['0370_03ff'][] = array('upper' => 922, 'status' => 'C', 'lower' => array(954)); /* GREEK CAPITAL LETTER KAPPA */ +$config['0370_03ff'][] = array('upper' => 923, 'status' => 'C', 'lower' => array(955)); /* GREEK CAPITAL LETTER LAMDA */ +$config['0370_03ff'][] = array('upper' => 924, 'status' => 'C', 'lower' => array(956)); /* GREEK CAPITAL LETTER MU */ +$config['0370_03ff'][] = array('upper' => 925, 'status' => 'C', 'lower' => array(957)); /* GREEK CAPITAL LETTER NU */ +$config['0370_03ff'][] = array('upper' => 926, 'status' => 'C', 'lower' => array(958)); /* GREEK CAPITAL LETTER XI */ +$config['0370_03ff'][] = array('upper' => 927, 'status' => 'C', 'lower' => array(959)); /* GREEK CAPITAL LETTER OMICRON */ +$config['0370_03ff'][] = array('upper' => 928, 'status' => 'C', 'lower' => array(960)); /* GREEK CAPITAL LETTER PI */ +$config['0370_03ff'][] = array('upper' => 929, 'status' => 'C', 'lower' => array(961)); /* GREEK CAPITAL LETTER RHO */ +$config['0370_03ff'][] = array('upper' => 931, 'status' => 'C', 'lower' => array(963)); /* GREEK CAPITAL LETTER SIGMA */ +$config['0370_03ff'][] = array('upper' => 932, 'status' => 'C', 'lower' => array(964)); /* GREEK CAPITAL LETTER TAU */ +$config['0370_03ff'][] = array('upper' => 933, 'status' => 'C', 'lower' => array(965)); /* GREEK CAPITAL LETTER UPSILON */ +$config['0370_03ff'][] = array('upper' => 934, 'status' => 'C', 'lower' => array(966)); /* GREEK CAPITAL LETTER PHI */ +$config['0370_03ff'][] = array('upper' => 935, 'status' => 'C', 'lower' => array(967)); /* GREEK CAPITAL LETTER CHI */ +$config['0370_03ff'][] = array('upper' => 936, 'status' => 'C', 'lower' => array(968)); /* GREEK CAPITAL LETTER PSI */ +$config['0370_03ff'][] = array('upper' => 937, 'status' => 'C', 'lower' => array(969)); /* GREEK CAPITAL LETTER OMEGA */ +$config['0370_03ff'][] = array('upper' => 938, 'status' => 'C', 'lower' => array(970)); /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ +$config['0370_03ff'][] = array('upper' => 939, 'status' => 'C', 'lower' => array(971)); /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ +$config['0370_03ff'][] = array('upper' => 944, 'status' => 'F', 'lower' => array(965, 776, 769)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ +$config['0370_03ff'][] = array('upper' => 962, 'status' => 'C', 'lower' => array(963)); /* GREEK SMALL LETTER FINAL SIGMA */ +$config['0370_03ff'][] = array('upper' => 976, 'status' => 'C', 'lower' => array(946)); /* GREEK BETA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 977, 'status' => 'C', 'lower' => array(952)); /* GREEK THETA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 981, 'status' => 'C', 'lower' => array(966)); /* GREEK PHI SYMBOL */ +$config['0370_03ff'][] = array('upper' => 982, 'status' => 'C', 'lower' => array(960)); /* GREEK PI SYMBOL */ +$config['0370_03ff'][] = array('upper' => 984, 'status' => 'C', 'lower' => array(985)); /* GREEK LETTER ARCHAIC KOPPA */ +$config['0370_03ff'][] = array('upper' => 986, 'status' => 'C', 'lower' => array(987)); /* GREEK LETTER STIGMA */ +$config['0370_03ff'][] = array('upper' => 988, 'status' => 'C', 'lower' => array(989)); /* GREEK LETTER DIGAMMA */ +$config['0370_03ff'][] = array('upper' => 990, 'status' => 'C', 'lower' => array(991)); /* GREEK LETTER KOPPA */ +$config['0370_03ff'][] = array('upper' => 992, 'status' => 'C', 'lower' => array(993)); /* GREEK LETTER SAMPI */ +$config['0370_03ff'][] = array('upper' => 994, 'status' => 'C', 'lower' => array(995)); /* COPTIC CAPITAL LETTER SHEI */ +$config['0370_03ff'][] = array('upper' => 996, 'status' => 'C', 'lower' => array(997)); /* COPTIC CAPITAL LETTER FEI */ +$config['0370_03ff'][] = array('upper' => 998, 'status' => 'C', 'lower' => array(999)); /* COPTIC CAPITAL LETTER KHEI */ +$config['0370_03ff'][] = array('upper' => 1000, 'status' => 'C', 'lower' => array(1001)); /* COPTIC CAPITAL LETTER HORI */ +$config['0370_03ff'][] = array('upper' => 1002, 'status' => 'C', 'lower' => array(1003)); /* COPTIC CAPITAL LETTER GANGIA */ +$config['0370_03ff'][] = array('upper' => 1004, 'status' => 'C', 'lower' => array(1005)); /* COPTIC CAPITAL LETTER SHIMA */ +$config['0370_03ff'][] = array('upper' => 1006, 'status' => 'C', 'lower' => array(1007)); /* COPTIC CAPITAL LETTER DEI */ +$config['0370_03ff'][] = array('upper' => 1008, 'status' => 'C', 'lower' => array(954)); /* GREEK KAPPA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1009, 'status' => 'C', 'lower' => array(961)); /* GREEK RHO SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1012, 'status' => 'C', 'lower' => array(952)); /* GREEK CAPITAL THETA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1013, 'status' => 'C', 'lower' => array(949)); /* GREEK LUNATE EPSILON SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1015, 'status' => 'C', 'lower' => array(1016)); /* GREEK CAPITAL LETTER SHO */ +$config['0370_03ff'][] = array('upper' => 1017, 'status' => 'C', 'lower' => array(1010)); /* GREEK CAPITAL LUNATE SIGMA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1018, 'status' => 'C', 'lower' => array(1019)); /* GREEK CAPITAL LETTER SAN */ +$config['0370_03ff'][] = array('upper' => 1021, 'status' => 'C', 'lower' => array(891)); /* GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1022, 'status' => 'C', 'lower' => array(892)); /* GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL */ +$config['0370_03ff'][] = array('upper' => 1023, 'status' => 'C', 'lower' => array(893)); /* GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0400_04ff.php b/cake/config/unicode/casefolding/0400_04ff.php new file mode 100644 index 000000000..2f5c77c8c --- /dev/null +++ b/cake/config/unicode/casefolding/0400_04ff.php @@ -0,0 +1,172 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0400_04ff'][] = array('upper' => 1024, 'status' => 'C', 'lower' => array(1104)); /* CYRILLIC CAPITAL LETTER IE WITH GRAVE */ +$config['0400_04ff'][] = array('upper' => 1025, 'status' => 'C', 'lower' => array(1105)); /* CYRILLIC CAPITAL LETTER IO */ +$config['0400_04ff'][] = array('upper' => 1026, 'status' => 'C', 'lower' => array(1106)); /* CYRILLIC CAPITAL LETTER DJE */ +$config['0400_04ff'][] = array('upper' => 1027, 'status' => 'C', 'lower' => array(1107)); /* CYRILLIC CAPITAL LETTER GJE */ +$config['0400_04ff'][] = array('upper' => 1028, 'status' => 'C', 'lower' => array(1108)); /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ +$config['0400_04ff'][] = array('upper' => 1029, 'status' => 'C', 'lower' => array(1109)); /* CYRILLIC CAPITAL LETTER DZE */ +$config['0400_04ff'][] = array('upper' => 1030, 'status' => 'C', 'lower' => array(1110)); /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ +$config['0400_04ff'][] = array('upper' => 1031, 'status' => 'C', 'lower' => array(1111)); /* CYRILLIC CAPITAL LETTER YI */ +$config['0400_04ff'][] = array('upper' => 1032, 'status' => 'C', 'lower' => array(1112)); /* CYRILLIC CAPITAL LETTER JE */ +$config['0400_04ff'][] = array('upper' => 1033, 'status' => 'C', 'lower' => array(1113)); /* CYRILLIC CAPITAL LETTER LJE */ +$config['0400_04ff'][] = array('upper' => 1034, 'status' => 'C', 'lower' => array(1114)); /* CYRILLIC CAPITAL LETTER NJE */ +$config['0400_04ff'][] = array('upper' => 1035, 'status' => 'C', 'lower' => array(1115)); /* CYRILLIC CAPITAL LETTER TSHE */ +$config['0400_04ff'][] = array('upper' => 1036, 'status' => 'C', 'lower' => array(1116)); /* CYRILLIC CAPITAL LETTER KJE */ +$config['0400_04ff'][] = array('upper' => 1037, 'status' => 'C', 'lower' => array(1117)); /* CYRILLIC CAPITAL LETTER I WITH GRAVE */ +$config['0400_04ff'][] = array('upper' => 1038, 'status' => 'C', 'lower' => array(1118)); /* CYRILLIC CAPITAL LETTER SHORT U */ +$config['0400_04ff'][] = array('upper' => 1039, 'status' => 'C', 'lower' => array(1119)); /* CYRILLIC CAPITAL LETTER DZHE */ +$config['0400_04ff'][] = array('upper' => 1040, 'status' => 'C', 'lower' => array(1072)); /* CYRILLIC CAPITAL LETTER A */ +$config['0400_04ff'][] = array('upper' => 1041, 'status' => 'C', 'lower' => array(1073)); /* CYRILLIC CAPITAL LETTER BE */ +$config['0400_04ff'][] = array('upper' => 1042, 'status' => 'C', 'lower' => array(1074)); /* CYRILLIC CAPITAL LETTER VE */ +$config['0400_04ff'][] = array('upper' => 1043, 'status' => 'C', 'lower' => array(1075)); /* CYRILLIC CAPITAL LETTER GHE */ +$config['0400_04ff'][] = array('upper' => 1044, 'status' => 'C', 'lower' => array(1076)); /* CYRILLIC CAPITAL LETTER DE */ +$config['0400_04ff'][] = array('upper' => 1045, 'status' => 'C', 'lower' => array(1077)); /* CYRILLIC CAPITAL LETTER IE */ +$config['0400_04ff'][] = array('upper' => 1046, 'status' => 'C', 'lower' => array(1078)); /* CYRILLIC CAPITAL LETTER ZHE */ +$config['0400_04ff'][] = array('upper' => 1047, 'status' => 'C', 'lower' => array(1079)); /* CYRILLIC CAPITAL LETTER ZE */ +$config['0400_04ff'][] = array('upper' => 1048, 'status' => 'C', 'lower' => array(1080)); /* CYRILLIC CAPITAL LETTER I */ +$config['0400_04ff'][] = array('upper' => 1049, 'status' => 'C', 'lower' => array(1081)); /* CYRILLIC CAPITAL LETTER SHORT I */ +$config['0400_04ff'][] = array('upper' => 1050, 'status' => 'C', 'lower' => array(1082)); /* CYRILLIC CAPITAL LETTER KA */ +$config['0400_04ff'][] = array('upper' => 1051, 'status' => 'C', 'lower' => array(1083)); /* CYRILLIC CAPITAL LETTER EL */ +$config['0400_04ff'][] = array('upper' => 1052, 'status' => 'C', 'lower' => array(1084)); /* CYRILLIC CAPITAL LETTER EM */ +$config['0400_04ff'][] = array('upper' => 1053, 'status' => 'C', 'lower' => array(1085)); /* CYRILLIC CAPITAL LETTER EN */ +$config['0400_04ff'][] = array('upper' => 1054, 'status' => 'C', 'lower' => array(1086)); /* CYRILLIC CAPITAL LETTER O */ +$config['0400_04ff'][] = array('upper' => 1055, 'status' => 'C', 'lower' => array(1087)); /* CYRILLIC CAPITAL LETTER PE */ +$config['0400_04ff'][] = array('upper' => 1056, 'status' => 'C', 'lower' => array(1088)); /* CYRILLIC CAPITAL LETTER ER */ +$config['0400_04ff'][] = array('upper' => 1057, 'status' => 'C', 'lower' => array(1089)); /* CYRILLIC CAPITAL LETTER ES */ +$config['0400_04ff'][] = array('upper' => 1058, 'status' => 'C', 'lower' => array(1090)); /* CYRILLIC CAPITAL LETTER TE */ +$config['0400_04ff'][] = array('upper' => 1059, 'status' => 'C', 'lower' => array(1091)); /* CYRILLIC CAPITAL LETTER U */ +$config['0400_04ff'][] = array('upper' => 1060, 'status' => 'C', 'lower' => array(1092)); /* CYRILLIC CAPITAL LETTER EF */ +$config['0400_04ff'][] = array('upper' => 1061, 'status' => 'C', 'lower' => array(1093)); /* CYRILLIC CAPITAL LETTER HA */ +$config['0400_04ff'][] = array('upper' => 1062, 'status' => 'C', 'lower' => array(1094)); /* CYRILLIC CAPITAL LETTER TSE */ +$config['0400_04ff'][] = array('upper' => 1063, 'status' => 'C', 'lower' => array(1095)); /* CYRILLIC CAPITAL LETTER CHE */ +$config['0400_04ff'][] = array('upper' => 1064, 'status' => 'C', 'lower' => array(1096)); /* CYRILLIC CAPITAL LETTER SHA */ +$config['0400_04ff'][] = array('upper' => 1065, 'status' => 'C', 'lower' => array(1097)); /* CYRILLIC CAPITAL LETTER SHCHA */ +$config['0400_04ff'][] = array('upper' => 1066, 'status' => 'C', 'lower' => array(1098)); /* CYRILLIC CAPITAL LETTER HARD SIGN */ +$config['0400_04ff'][] = array('upper' => 1067, 'status' => 'C', 'lower' => array(1099)); /* CYRILLIC CAPITAL LETTER YERU */ +$config['0400_04ff'][] = array('upper' => 1068, 'status' => 'C', 'lower' => array(1100)); /* CYRILLIC CAPITAL LETTER SOFT SIGN */ +$config['0400_04ff'][] = array('upper' => 1069, 'status' => 'C', 'lower' => array(1101)); /* CYRILLIC CAPITAL LETTER E */ +$config['0400_04ff'][] = array('upper' => 1070, 'status' => 'C', 'lower' => array(1102)); /* CYRILLIC CAPITAL LETTER YU */ +$config['0400_04ff'][] = array('upper' => 1071, 'status' => 'C', 'lower' => array(1103)); /* CYRILLIC CAPITAL LETTER YA */ +$config['0400_04ff'][] = array('upper' => 1120, 'status' => 'C', 'lower' => array(1121)); /* CYRILLIC CAPITAL LETTER OMEGA */ +$config['0400_04ff'][] = array('upper' => 1122, 'status' => 'C', 'lower' => array(1123)); /* CYRILLIC CAPITAL LETTER YAT */ +$config['0400_04ff'][] = array('upper' => 1124, 'status' => 'C', 'lower' => array(1125)); /* CYRILLIC CAPITAL LETTER IOTIFIED E */ +$config['0400_04ff'][] = array('upper' => 1126, 'status' => 'C', 'lower' => array(1127)); /* CYRILLIC CAPITAL LETTER LITTLE YUS */ +$config['0400_04ff'][] = array('upper' => 1128, 'status' => 'C', 'lower' => array(1129)); /* CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS */ +$config['0400_04ff'][] = array('upper' => 1130, 'status' => 'C', 'lower' => array(1131)); /* CYRILLIC CAPITAL LETTER BIG YUS */ +$config['0400_04ff'][] = array('upper' => 1132, 'status' => 'C', 'lower' => array(1133)); /* CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS */ +$config['0400_04ff'][] = array('upper' => 1134, 'status' => 'C', 'lower' => array(1135)); /* CYRILLIC CAPITAL LETTER KSI */ +$config['0400_04ff'][] = array('upper' => 1136, 'status' => 'C', 'lower' => array(1137)); /* CYRILLIC CAPITAL LETTER PSI */ +$config['0400_04ff'][] = array('upper' => 1138, 'status' => 'C', 'lower' => array(1139)); /* CYRILLIC CAPITAL LETTER FITA */ +$config['0400_04ff'][] = array('upper' => 1140, 'status' => 'C', 'lower' => array(1141)); /* CYRILLIC CAPITAL LETTER IZHITSA */ +$config['0400_04ff'][] = array('upper' => 1142, 'status' => 'C', 'lower' => array(1143)); /* CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */ +$config['0400_04ff'][] = array('upper' => 1144, 'status' => 'C', 'lower' => array(1145)); /* CYRILLIC CAPITAL LETTER UK */ +$config['0400_04ff'][] = array('upper' => 1146, 'status' => 'C', 'lower' => array(1147)); /* CYRILLIC CAPITAL LETTER ROUND OMEGA */ +$config['0400_04ff'][] = array('upper' => 1148, 'status' => 'C', 'lower' => array(1149)); /* CYRILLIC CAPITAL LETTER OMEGA WITH TITLO */ +$config['0400_04ff'][] = array('upper' => 1150, 'status' => 'C', 'lower' => array(1151)); /* CYRILLIC CAPITAL LETTER OT */ +$config['0400_04ff'][] = array('upper' => 1152, 'status' => 'C', 'lower' => array(1153)); /* CYRILLIC CAPITAL LETTER KOPPA */ +$config['0400_04ff'][] = array('upper' => 1162, 'status' => 'C', 'lower' => array(1163)); /* CYRILLIC CAPITAL LETTER SHORT I WITH TAIL */ +$config['0400_04ff'][] = array('upper' => 1164, 'status' => 'C', 'lower' => array(1165)); /* CYRILLIC CAPITAL LETTER SEMISOFT SIGN */ +$config['0400_04ff'][] = array('upper' => 1166, 'status' => 'C', 'lower' => array(1167)); /* CYRILLIC CAPITAL LETTER ER WITH TICK */ +$config['0400_04ff'][] = array('upper' => 1168, 'status' => 'C', 'lower' => array(1169)); /* CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ +$config['0400_04ff'][] = array('upper' => 1170, 'status' => 'C', 'lower' => array(1171)); /* CYRILLIC CAPITAL LETTER GHE WITH STROKE */ +$config['0400_04ff'][] = array('upper' => 1172, 'status' => 'C', 'lower' => array(1173)); /* CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK */ +$config['0400_04ff'][] = array('upper' => 1174, 'status' => 'C', 'lower' => array(1175)); /* CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1176, 'status' => 'C', 'lower' => array(1177)); /* CYRILLIC CAPITAL LETTER ZE WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1178, 'status' => 'C', 'lower' => array(1179)); /* CYRILLIC CAPITAL LETTER KA WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1180, 'status' => 'C', 'lower' => array(1181)); /* CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */ +$config['0400_04ff'][] = array('upper' => 1182, 'status' => 'C', 'lower' => array(1183)); /* CYRILLIC CAPITAL LETTER KA WITH STROKE */ +$config['0400_04ff'][] = array('upper' => 1184, 'status' => 'C', 'lower' => array(1185)); /* CYRILLIC CAPITAL LETTER BASHKIR KA */ +$config['0400_04ff'][] = array('upper' => 1186, 'status' => 'C', 'lower' => array(1187)); /* CYRILLIC CAPITAL LETTER EN WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1188, 'status' => 'C', 'lower' => array(1189)); /* CYRILLIC CAPITAL LIGATURE EN GHE */ +$config['0400_04ff'][] = array('upper' => 1190, 'status' => 'C', 'lower' => array(1191)); /* CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK */ +$config['0400_04ff'][] = array('upper' => 1192, 'status' => 'C', 'lower' => array(1193)); /* CYRILLIC CAPITAL LETTER ABKHASIAN HA */ +$config['0400_04ff'][] = array('upper' => 1194, 'status' => 'C', 'lower' => array(1195)); /* CYRILLIC CAPITAL LETTER ES WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1196, 'status' => 'C', 'lower' => array(1197)); /* CYRILLIC CAPITAL LETTER TE WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1198, 'status' => 'C', 'lower' => array(1199)); /* CYRILLIC CAPITAL LETTER STRAIGHT U */ +$config['0400_04ff'][] = array('upper' => 1200, 'status' => 'C', 'lower' => array(1201)); /* CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */ +$config['0400_04ff'][] = array('upper' => 1202, 'status' => 'C', 'lower' => array(1203)); /* CYRILLIC CAPITAL LETTER HA WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1204, 'status' => 'C', 'lower' => array(1205)); /* CYRILLIC CAPITAL LIGATURE TE TSE */ +$config['0400_04ff'][] = array('upper' => 1206, 'status' => 'C', 'lower' => array(1207)); /* CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1208, 'status' => 'C', 'lower' => array(1209)); /* CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */ +$config['0400_04ff'][] = array('upper' => 1210, 'status' => 'C', 'lower' => array(1211)); /* CYRILLIC CAPITAL LETTER SHHA */ +$config['0400_04ff'][] = array('upper' => 1212, 'status' => 'C', 'lower' => array(1213)); /* CYRILLIC CAPITAL LETTER ABKHASIAN CHE */ +$config['0400_04ff'][] = array('upper' => 1214, 'status' => 'C', 'lower' => array(1215)); /* CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1216, 'status' => 'C', 'lower' => array(1231)); /* CYRILLIC LETTER PALOCHKA */ +$config['0400_04ff'][] = array('upper' => 1217, 'status' => 'C', 'lower' => array(1218)); /* CYRILLIC CAPITAL LETTER ZHE WITH BREVE */ +$config['0400_04ff'][] = array('upper' => 1219, 'status' => 'C', 'lower' => array(1220)); /* CYRILLIC CAPITAL LETTER KA WITH HOOK */ +$config['0400_04ff'][] = array('upper' => 1221, 'status' => 'C', 'lower' => array(1222)); /* CYRILLIC CAPITAL LETTER EL WITH TAIL */ +$config['0400_04ff'][] = array('upper' => 1223, 'status' => 'C', 'lower' => array(1224)); /* CYRILLIC CAPITAL LETTER EN WITH HOOK */ +$config['0400_04ff'][] = array('upper' => 1225, 'status' => 'C', 'lower' => array(1226)); /* CYRILLIC CAPITAL LETTER EN WITH TAIL */ +$config['0400_04ff'][] = array('upper' => 1227, 'status' => 'C', 'lower' => array(1228)); /* CYRILLIC CAPITAL LETTER KHAKASSIAN CHE */ +$config['0400_04ff'][] = array('upper' => 1229, 'status' => 'C', 'lower' => array(1230)); /* CYRILLIC CAPITAL LETTER EM WITH TAIL */ +$config['0400_04ff'][] = array('upper' => 1232, 'status' => 'C', 'lower' => array(1233)); /* CYRILLIC CAPITAL LETTER A WITH BREVE */ +$config['0400_04ff'][] = array('upper' => 1234, 'status' => 'C', 'lower' => array(1235)); /* CYRILLIC CAPITAL LETTER A WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1236, 'status' => 'C', 'lower' => array(1237)); /* CYRILLIC CAPITAL LIGATURE A IE */ +$config['0400_04ff'][] = array('upper' => 1238, 'status' => 'C', 'lower' => array(1239)); /* CYRILLIC CAPITAL LETTER IE WITH BREVE */ +$config['0400_04ff'][] = array('upper' => 1240, 'status' => 'C', 'lower' => array(1241)); /* CYRILLIC CAPITAL LETTER SCHWA */ +$config['0400_04ff'][] = array('upper' => 1242, 'status' => 'C', 'lower' => array(1243)); /* CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1244, 'status' => 'C', 'lower' => array(1245)); /* CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1246, 'status' => 'C', 'lower' => array(1247)); /* CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1248, 'status' => 'C', 'lower' => array(1249)); /* CYRILLIC CAPITAL LETTER ABKHASIAN DZE */ +$config['0400_04ff'][] = array('upper' => 1250, 'status' => 'C', 'lower' => array(1251)); /* CYRILLIC CAPITAL LETTER I WITH MACRON */ +$config['0400_04ff'][] = array('upper' => 1252, 'status' => 'C', 'lower' => array(1253)); /* CYRILLIC CAPITAL LETTER I WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1254, 'status' => 'C', 'lower' => array(1255)); /* CYRILLIC CAPITAL LETTER O WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1256, 'status' => 'C', 'lower' => array(1257)); /* CYRILLIC CAPITAL LETTER BARRED O */ +$config['0400_04ff'][] = array('upper' => 1258, 'status' => 'C', 'lower' => array(1259)); /* CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1260, 'status' => 'C', 'lower' => array(1261)); /* CYRILLIC CAPITAL LETTER E WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1262, 'status' => 'C', 'lower' => array(1263)); /* CYRILLIC CAPITAL LETTER U WITH MACRON */ +$config['0400_04ff'][] = array('upper' => 1264, 'status' => 'C', 'lower' => array(1265)); /* CYRILLIC CAPITAL LETTER U WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1266, 'status' => 'C', 'lower' => array(1267)); /* CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE */ +$config['0400_04ff'][] = array('upper' => 1268, 'status' => 'C', 'lower' => array(1269)); /* CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1270, 'status' => 'C', 'lower' => array(1271)); /* CYRILLIC CAPITAL LETTER GHE WITH DESCENDER */ +$config['0400_04ff'][] = array('upper' => 1272, 'status' => 'C', 'lower' => array(1273)); /* CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS */ +$config['0400_04ff'][] = array('upper' => 1274, 'status' => 'C', 'lower' => array(1275)); /* CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK */ +$config['0400_04ff'][] = array('upper' => 1276, 'status' => 'C', 'lower' => array(1277)); /* CYRILLIC CAPITAL LETTER HA WITH HOOK */ +$config['0400_04ff'][] = array('upper' => 1278, 'status' => 'C', 'lower' => array(1279)); /* CYRILLIC CAPITAL LETTER HA WITH STROKE */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0500_052f.php b/cake/config/unicode/casefolding/0500_052f.php new file mode 100644 index 000000000..1c8455f55 --- /dev/null +++ b/cake/config/unicode/casefolding/0500_052f.php @@ -0,0 +1,56 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0500_052f'][] = array('upper' => 1280, 'status' => 'C', 'lower' => array(1281)); /* CYRILLIC CAPITAL LETTER KOMI DE */ +$config['0500_052f'][] = array('upper' => 1282, 'status' => 'C', 'lower' => array(1283)); /* CYRILLIC CAPITAL LETTER KOMI DJE */ +$config['0500_052f'][] = array('upper' => 1284, 'status' => 'C', 'lower' => array(1285)); /* CYRILLIC CAPITAL LETTER KOMI ZJE */ +$config['0500_052f'][] = array('upper' => 1286, 'status' => 'C', 'lower' => array(1287)); /* CYRILLIC CAPITAL LETTER KOMI DZJE */ +$config['0500_052f'][] = array('upper' => 1288, 'status' => 'C', 'lower' => array(1289)); /* CYRILLIC CAPITAL LETTER KOMI LJE */ +$config['0500_052f'][] = array('upper' => 1290, 'status' => 'C', 'lower' => array(1291)); /* CYRILLIC CAPITAL LETTER KOMI NJE */ +$config['0500_052f'][] = array('upper' => 1292, 'status' => 'C', 'lower' => array(1293)); /* CYRILLIC CAPITAL LETTER KOMI SJE */ +$config['0500_052f'][] = array('upper' => 1294, 'status' => 'C', 'lower' => array(1295)); /* CYRILLIC CAPITAL LETTER KOMI TJE */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/0530_058f.php b/cake/config/unicode/casefolding/0530_058f.php new file mode 100644 index 000000000..9d5e18048 --- /dev/null +++ b/cake/config/unicode/casefolding/0530_058f.php @@ -0,0 +1,86 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['0530_058f'][] = array('upper' => 1329, 'status' => 'C', 'lower' => array(1377)); /* ARMENIAN CAPITAL LETTER AYB */ +$config['0530_058f'][] = array('upper' => 1330, 'status' => 'C', 'lower' => array(1378)); /* ARMENIAN CAPITAL LETTER BEN */ +$config['0530_058f'][] = array('upper' => 1331, 'status' => 'C', 'lower' => array(1379)); /* ARMENIAN CAPITAL LETTER GIM */ +$config['0530_058f'][] = array('upper' => 1332, 'status' => 'C', 'lower' => array(1380)); /* ARMENIAN CAPITAL LETTER DA */ +$config['0530_058f'][] = array('upper' => 1333, 'status' => 'C', 'lower' => array(1381)); /* ARMENIAN CAPITAL LETTER ECH */ +$config['0530_058f'][] = array('upper' => 1334, 'status' => 'C', 'lower' => array(1382)); /* ARMENIAN CAPITAL LETTER ZA */ +$config['0530_058f'][] = array('upper' => 1335, 'status' => 'C', 'lower' => array(1383)); /* ARMENIAN CAPITAL LETTER EH */ +$config['0530_058f'][] = array('upper' => 1336, 'status' => 'C', 'lower' => array(1384)); /* ARMENIAN CAPITAL LETTER ET */ +$config['0530_058f'][] = array('upper' => 1337, 'status' => 'C', 'lower' => array(1385)); /* ARMENIAN CAPITAL LETTER TO */ +$config['0530_058f'][] = array('upper' => 1338, 'status' => 'C', 'lower' => array(1386)); /* ARMENIAN CAPITAL LETTER ZHE */ +$config['0530_058f'][] = array('upper' => 1339, 'status' => 'C', 'lower' => array(1387)); /* ARMENIAN CAPITAL LETTER INI */ +$config['0530_058f'][] = array('upper' => 1340, 'status' => 'C', 'lower' => array(1388)); /* ARMENIAN CAPITAL LETTER LIWN */ +$config['0530_058f'][] = array('upper' => 1341, 'status' => 'C', 'lower' => array(1389)); /* ARMENIAN CAPITAL LETTER XEH */ +$config['0530_058f'][] = array('upper' => 1342, 'status' => 'C', 'lower' => array(1390)); /* ARMENIAN CAPITAL LETTER CA */ +$config['0530_058f'][] = array('upper' => 1343, 'status' => 'C', 'lower' => array(1391)); /* ARMENIAN CAPITAL LETTER KEN */ +$config['0530_058f'][] = array('upper' => 1344, 'status' => 'C', 'lower' => array(1392)); /* ARMENIAN CAPITAL LETTER HO */ +$config['0530_058f'][] = array('upper' => 1345, 'status' => 'C', 'lower' => array(1393)); /* ARMENIAN CAPITAL LETTER JA */ +$config['0530_058f'][] = array('upper' => 1346, 'status' => 'C', 'lower' => array(1394)); /* ARMENIAN CAPITAL LETTER GHAD */ +$config['0530_058f'][] = array('upper' => 1347, 'status' => 'C', 'lower' => array(1395)); /* ARMENIAN CAPITAL LETTER CHEH */ +$config['0530_058f'][] = array('upper' => 1348, 'status' => 'C', 'lower' => array(1396)); /* ARMENIAN CAPITAL LETTER MEN */ +$config['0530_058f'][] = array('upper' => 1349, 'status' => 'C', 'lower' => array(1397)); /* ARMENIAN CAPITAL LETTER YI */ +$config['0530_058f'][] = array('upper' => 1350, 'status' => 'C', 'lower' => array(1398)); /* ARMENIAN CAPITAL LETTER NOW */ +$config['0530_058f'][] = array('upper' => 1351, 'status' => 'C', 'lower' => array(1399)); /* ARMENIAN CAPITAL LETTER SHA */ +$config['0530_058f'][] = array('upper' => 1352, 'status' => 'C', 'lower' => array(1400)); /* ARMENIAN CAPITAL LETTER VO */ +$config['0530_058f'][] = array('upper' => 1353, 'status' => 'C', 'lower' => array(1401)); /* ARMENIAN CAPITAL LETTER CHA */ +$config['0530_058f'][] = array('upper' => 1354, 'status' => 'C', 'lower' => array(1402)); /* ARMENIAN CAPITAL LETTER PEH */ +$config['0530_058f'][] = array('upper' => 1355, 'status' => 'C', 'lower' => array(1403)); /* ARMENIAN CAPITAL LETTER JHEH */ +$config['0530_058f'][] = array('upper' => 1356, 'status' => 'C', 'lower' => array(1404)); /* ARMENIAN CAPITAL LETTER RA */ +$config['0530_058f'][] = array('upper' => 1357, 'status' => 'C', 'lower' => array(1405)); /* ARMENIAN CAPITAL LETTER SEH */ +$config['0530_058f'][] = array('upper' => 1358, 'status' => 'C', 'lower' => array(1406)); /* ARMENIAN CAPITAL LETTER VEW */ +$config['0530_058f'][] = array('upper' => 1359, 'status' => 'C', 'lower' => array(1407)); /* ARMENIAN CAPITAL LETTER TIWN */ +$config['0530_058f'][] = array('upper' => 1360, 'status' => 'C', 'lower' => array(1408)); /* ARMENIAN CAPITAL LETTER REH */ +$config['0530_058f'][] = array('upper' => 1361, 'status' => 'C', 'lower' => array(1409)); /* ARMENIAN CAPITAL LETTER CO */ +$config['0530_058f'][] = array('upper' => 1362, 'status' => 'C', 'lower' => array(1410)); /* ARMENIAN CAPITAL LETTER YIWN */ +$config['0530_058f'][] = array('upper' => 1363, 'status' => 'C', 'lower' => array(1411)); /* ARMENIAN CAPITAL LETTER PIWR */ +$config['0530_058f'][] = array('upper' => 1364, 'status' => 'C', 'lower' => array(1412)); /* ARMENIAN CAPITAL LETTER KEH */ +$config['0530_058f'][] = array('upper' => 1365, 'status' => 'C', 'lower' => array(1413)); /* ARMENIAN CAPITAL LETTER OH */ +$config['0530_058f'][] = array('upper' => 1366, 'status' => 'C', 'lower' => array(1414)); /* ARMENIAN CAPITAL LETTER FEH */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/1e00_1eff.php b/cake/config/unicode/casefolding/1e00_1eff.php new file mode 100644 index 000000000..a6fbd0642 --- /dev/null +++ b/cake/config/unicode/casefolding/1e00_1eff.php @@ -0,0 +1,176 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['1e00_1eff'][] = array('upper' => 7680, 'status' => 'C', 'lower' => array(7681)); /* LATIN CAPITAL LETTER A WITH RING BELOW */ +$config['1e00_1eff'][] = array('upper' => 7682, 'status' => 'C', 'lower' => array(7683)); /* LATIN CAPITAL LETTER B WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7684, 'status' => 'C', 'lower' => array(7685)); /* LATIN CAPITAL LETTER B WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7686, 'status' => 'C', 'lower' => array(7687)); /* LATIN CAPITAL LETTER B WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7688, 'status' => 'C', 'lower' => array(7689)); /* LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7690, 'status' => 'C', 'lower' => array(7691)); /* LATIN CAPITAL LETTER D WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7692, 'status' => 'C', 'lower' => array(7693)); /* LATIN CAPITAL LETTER D WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7694, 'status' => 'C', 'lower' => array(7695)); /* LATIN CAPITAL LETTER D WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7696, 'status' => 'C', 'lower' => array(7697)); /* LATIN CAPITAL LETTER D WITH CEDILLA */ +$config['1e00_1eff'][] = array('upper' => 7698, 'status' => 'C', 'lower' => array(7699)); /* LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW */ +$config['1e00_1eff'][] = array('upper' => 7700, 'status' => 'C', 'lower' => array(7701)); /* LATIN CAPITAL LETTER E WITH MACRON AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7702, 'status' => 'C', 'lower' => array(7703)); /* LATIN CAPITAL LETTER E WITH MACRON AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7704, 'status' => 'C', 'lower' => array(7705)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW */ +$config['1e00_1eff'][] = array('upper' => 7706, 'status' => 'C', 'lower' => array(7707)); /* LATIN CAPITAL LETTER E WITH TILDE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7708, 'status' => 'C', 'lower' => array(7709)); /* LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */ +$config['1e00_1eff'][] = array('upper' => 7710, 'status' => 'C', 'lower' => array(7711)); /* LATIN CAPITAL LETTER F WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7712, 'status' => 'C', 'lower' => array(7713)); /* LATIN CAPITAL LETTER G WITH MACRON */ +$config['1e00_1eff'][] = array('upper' => 7714, 'status' => 'C', 'lower' => array(7715)); /* LATIN CAPITAL LETTER H WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7716, 'status' => 'C', 'lower' => array(7717)); /* LATIN CAPITAL LETTER H WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7718, 'status' => 'C', 'lower' => array(7719)); /* LATIN CAPITAL LETTER H WITH DIAERESIS */ +$config['1e00_1eff'][] = array('upper' => 7720, 'status' => 'C', 'lower' => array(7721)); /* LATIN CAPITAL LETTER H WITH CEDILLA */ +$config['1e00_1eff'][] = array('upper' => 7722, 'status' => 'C', 'lower' => array(7723)); /* LATIN CAPITAL LETTER H WITH BREVE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7724, 'status' => 'C', 'lower' => array(7725)); /* LATIN CAPITAL LETTER I WITH TILDE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7726, 'status' => 'C', 'lower' => array(7727)); /* LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7728, 'status' => 'C', 'lower' => array(7729)); /* LATIN CAPITAL LETTER K WITH ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7730, 'status' => 'C', 'lower' => array(7731)); /* LATIN CAPITAL LETTER K WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7732, 'status' => 'C', 'lower' => array(7733)); /* LATIN CAPITAL LETTER K WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7734, 'status' => 'C', 'lower' => array(7735)); /* LATIN CAPITAL LETTER L WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7736, 'status' => 'C', 'lower' => array(7737)); /* LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON */ +$config['1e00_1eff'][] = array('upper' => 7738, 'status' => 'C', 'lower' => array(7739)); /* LATIN CAPITAL LETTER L WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7740, 'status' => 'C', 'lower' => array(7741)); /* LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW */ +$config['1e00_1eff'][] = array('upper' => 7742, 'status' => 'C', 'lower' => array(7743)); /* LATIN CAPITAL LETTER M WITH ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7744, 'status' => 'C', 'lower' => array(7745)); /* LATIN CAPITAL LETTER M WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7746, 'status' => 'C', 'lower' => array(7747)); /* LATIN CAPITAL LETTER M WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7748, 'status' => 'C', 'lower' => array(7749)); /* LATIN CAPITAL LETTER N WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7750, 'status' => 'C', 'lower' => array(7751)); /* LATIN CAPITAL LETTER N WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7752, 'status' => 'C', 'lower' => array(7753)); /* LATIN CAPITAL LETTER N WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7754, 'status' => 'C', 'lower' => array(7755)); /* LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW */ +$config['1e00_1eff'][] = array('upper' => 7756, 'status' => 'C', 'lower' => array(7757)); /* LATIN CAPITAL LETTER O WITH TILDE AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7758, 'status' => 'C', 'lower' => array(7759)); /* LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS */ +$config['1e00_1eff'][] = array('upper' => 7760, 'status' => 'C', 'lower' => array(7761)); /* LATIN CAPITAL LETTER O WITH MACRON AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7762, 'status' => 'C', 'lower' => array(7763)); /* LATIN CAPITAL LETTER O WITH MACRON AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7764, 'status' => 'C', 'lower' => array(7765)); /* LATIN CAPITAL LETTER P WITH ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7766, 'status' => 'C', 'lower' => array(7767)); /* LATIN CAPITAL LETTER P WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7768, 'status' => 'C', 'lower' => array(7769)); /* LATIN CAPITAL LETTER R WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7770, 'status' => 'C', 'lower' => array(7771)); /* LATIN CAPITAL LETTER R WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7772, 'status' => 'C', 'lower' => array(7773)); /* LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON */ +$config['1e00_1eff'][] = array('upper' => 7774, 'status' => 'C', 'lower' => array(7775)); /* LATIN CAPITAL LETTER R WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7776, 'status' => 'C', 'lower' => array(7777)); /* LATIN CAPITAL LETTER S WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7778, 'status' => 'C', 'lower' => array(7779)); /* LATIN CAPITAL LETTER S WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7780, 'status' => 'C', 'lower' => array(7781)); /* LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7782, 'status' => 'C', 'lower' => array(7783)); /* LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7784, 'status' => 'C', 'lower' => array(7785)); /* LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7786, 'status' => 'C', 'lower' => array(7787)); /* LATIN CAPITAL LETTER T WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7788, 'status' => 'C', 'lower' => array(7789)); /* LATIN CAPITAL LETTER T WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7790, 'status' => 'C', 'lower' => array(7791)); /* LATIN CAPITAL LETTER T WITH LINE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7792, 'status' => 'C', 'lower' => array(7793)); /* LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW */ +$config['1e00_1eff'][] = array('upper' => 7794, 'status' => 'C', 'lower' => array(7795)); /* LATIN CAPITAL LETTER U WITH DIAERESIS BELOW */ +$config['1e00_1eff'][] = array('upper' => 7796, 'status' => 'C', 'lower' => array(7797)); /* LATIN CAPITAL LETTER U WITH TILDE BELOW */ +$config['1e00_1eff'][] = array('upper' => 7798, 'status' => 'C', 'lower' => array(7799)); /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW */ +$config['1e00_1eff'][] = array('upper' => 7800, 'status' => 'C', 'lower' => array(7801)); /* LATIN CAPITAL LETTER U WITH TILDE AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7802, 'status' => 'C', 'lower' => array(7803)); /* LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS */ +$config['1e00_1eff'][] = array('upper' => 7804, 'status' => 'C', 'lower' => array(7805)); /* LATIN CAPITAL LETTER V WITH TILDE */ +$config['1e00_1eff'][] = array('upper' => 7806, 'status' => 'C', 'lower' => array(7807)); /* LATIN CAPITAL LETTER V WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7808, 'status' => 'C', 'lower' => array(7809)); /* LATIN CAPITAL LETTER W WITH GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7810, 'status' => 'C', 'lower' => array(7811)); /* LATIN CAPITAL LETTER W WITH ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7812, 'status' => 'C', 'lower' => array(7813)); /* LATIN CAPITAL LETTER W WITH DIAERESIS */ +$config['1e00_1eff'][] = array('upper' => 7814, 'status' => 'C', 'lower' => array(7815)); /* LATIN CAPITAL LETTER W WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7816, 'status' => 'C', 'lower' => array(7817)); /* LATIN CAPITAL LETTER W WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7818, 'status' => 'C', 'lower' => array(7819)); /* LATIN CAPITAL LETTER X WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7820, 'status' => 'C', 'lower' => array(7821)); /* LATIN CAPITAL LETTER X WITH DIAERESIS */ +$config['1e00_1eff'][] = array('upper' => 7822, 'status' => 'C', 'lower' => array(7823)); /* LATIN CAPITAL LETTER Y WITH DOT ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7824, 'status' => 'C', 'lower' => array(7825)); /* LATIN CAPITAL LETTER Z WITH CIRCUMFLEX */ +$config['1e00_1eff'][] = array('upper' => 7826, 'status' => 'C', 'lower' => array(7827)); /* LATIN CAPITAL LETTER Z WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7828, 'status' => 'C', 'lower' => array(7829)); /* LATIN CAPITAL LETTER Z WITH LINE BELOW */ + +//$config['1e00_1eff'][] = array('upper' => 7830, 'status' => 'F', 'lower' => array(104, 817)); /* LATIN SMALL LETTER H WITH LINE BELOW */ +//$config['1e00_1eff'][] = array('upper' => 7831, 'status' => 'F', 'lower' => array(116, 776)); /* LATIN SMALL LETTER T WITH DIAERESIS */ +//$config['1e00_1eff'][] = array('upper' => 7832, 'status' => 'F', 'lower' => array(119, 778)); /* LATIN SMALL LETTER W WITH RING ABOVE */ +//$config['1e00_1eff'][] = array('upper' => 7833, 'status' => 'F', 'lower' => array(121, 778)); /* LATIN SMALL LETTER Y WITH RING ABOVE */ +//$config['1e00_1eff'][] = array('upper' => 7834, 'status' => 'F', 'lower' => array(97, 702)); /* LATIN SMALL LETTER A WITH RIGHT HALF RING */ +//$config['1e00_1eff'][] = array('upper' => 7835, 'status' => 'C', 'lower' => array(7777)); /* LATIN SMALL LETTER LONG S WITH DOT ABOVE */ + +$config['1e00_1eff'][] = array('upper' => 7840, 'status' => 'C', 'lower' => array(7841)); /* LATIN CAPITAL LETTER A WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7842, 'status' => 'C', 'lower' => array(7843)); /* LATIN CAPITAL LETTER A WITH HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7844, 'status' => 'C', 'lower' => array(7845)); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7846, 'status' => 'C', 'lower' => array(7847)); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7848, 'status' => 'C', 'lower' => array(7849)); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7850, 'status' => 'C', 'lower' => array(7851)); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ +$config['1e00_1eff'][] = array('upper' => 7852, 'status' => 'C', 'lower' => array(7853)); /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7854, 'status' => 'C', 'lower' => array(7855)); /* LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7856, 'status' => 'C', 'lower' => array(7857)); /* LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7858, 'status' => 'C', 'lower' => array(7859)); /* LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7860, 'status' => 'C', 'lower' => array(7861)); /* LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ +$config['1e00_1eff'][] = array('upper' => 7862, 'status' => 'C', 'lower' => array(7863)); /* LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7864, 'status' => 'C', 'lower' => array(7865)); /* LATIN CAPITAL LETTER E WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7866, 'status' => 'C', 'lower' => array(7867)); /* LATIN CAPITAL LETTER E WITH HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7868, 'status' => 'C', 'lower' => array(7869)); /* LATIN CAPITAL LETTER E WITH TILDE */ +$config['1e00_1eff'][] = array('upper' => 7870, 'status' => 'C', 'lower' => array(7871)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7872, 'status' => 'C', 'lower' => array(7873)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7874, 'status' => 'C', 'lower' => array(7875)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7876, 'status' => 'C', 'lower' => array(7877)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ +$config['1e00_1eff'][] = array('upper' => 7878, 'status' => 'C', 'lower' => array(7879)); /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7880, 'status' => 'C', 'lower' => array(7881)); /* LATIN CAPITAL LETTER I WITH HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7882, 'status' => 'C', 'lower' => array(7883)); /* LATIN CAPITAL LETTER I WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7884, 'status' => 'C', 'lower' => array(7885)); /* LATIN CAPITAL LETTER O WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7886, 'status' => 'C', 'lower' => array(7887)); /* LATIN CAPITAL LETTER O WITH HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7888, 'status' => 'C', 'lower' => array(7889)); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7890, 'status' => 'C', 'lower' => array(7891)); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7892, 'status' => 'C', 'lower' => array(7893)); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7894, 'status' => 'C', 'lower' => array(7895)); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ +$config['1e00_1eff'][] = array('upper' => 7896, 'status' => 'C', 'lower' => array(7897)); /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7898, 'status' => 'C', 'lower' => array(7899)); /* LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7900, 'status' => 'C', 'lower' => array(7901)); /* LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7902, 'status' => 'C', 'lower' => array(7903)); /* LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7904, 'status' => 'C', 'lower' => array(7905)); /* LATIN CAPITAL LETTER O WITH HORN AND TILDE */ +$config['1e00_1eff'][] = array('upper' => 7906, 'status' => 'C', 'lower' => array(7907)); /* LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7908, 'status' => 'C', 'lower' => array(7909)); /* LATIN CAPITAL LETTER U WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7910, 'status' => 'C', 'lower' => array(7911)); /* LATIN CAPITAL LETTER U WITH HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7912, 'status' => 'C', 'lower' => array(7913)); /* LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ +$config['1e00_1eff'][] = array('upper' => 7914, 'status' => 'C', 'lower' => array(7915)); /* LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7916, 'status' => 'C', 'lower' => array(7917)); /* LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7918, 'status' => 'C', 'lower' => array(7919)); /* LATIN CAPITAL LETTER U WITH HORN AND TILDE */ +$config['1e00_1eff'][] = array('upper' => 7920, 'status' => 'C', 'lower' => array(7921)); /* LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7922, 'status' => 'C', 'lower' => array(7923)); /* LATIN CAPITAL LETTER Y WITH GRAVE */ +$config['1e00_1eff'][] = array('upper' => 7924, 'status' => 'C', 'lower' => array(7925)); /* LATIN CAPITAL LETTER Y WITH DOT BELOW */ +$config['1e00_1eff'][] = array('upper' => 7926, 'status' => 'C', 'lower' => array(7927)); /* LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ +$config['1e00_1eff'][] = array('upper' => 7928, 'status' => 'C', 'lower' => array(7929)); /* LATIN CAPITAL LETTER Y WITH TILDE */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/1f00_1fff.php b/cake/config/unicode/casefolding/1f00_1fff.php new file mode 100644 index 000000000..fe9ed38ab --- /dev/null +++ b/cake/config/unicode/casefolding/1f00_1fff.php @@ -0,0 +1,224 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['1f00_1fff'][] = array('upper' => 7944, 'status' => 'C', 'lower' => array(7936, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 7945, 'status' => 'C', 'lower' => array(7937)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 7946, 'status' => 'C', 'lower' => array(7938)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7947, 'status' => 'C', 'lower' => array(7939)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7948, 'status' => 'C', 'lower' => array(7940)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7949, 'status' => 'C', 'lower' => array(7941)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7950, 'status' => 'C', 'lower' => array(7942)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 7951, 'status' => 'C', 'lower' => array(7943)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 7960, 'status' => 'C', 'lower' => array(7952)); /* GREEK CAPITAL LETTER EPSILON WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 7961, 'status' => 'C', 'lower' => array(7953)); /* GREEK CAPITAL LETTER EPSILON WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 7962, 'status' => 'C', 'lower' => array(7954)); /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7963, 'status' => 'C', 'lower' => array(7955)); /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7964, 'status' => 'C', 'lower' => array(7956)); /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7965, 'status' => 'C', 'lower' => array(7957)); /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7976, 'status' => 'C', 'lower' => array(7968)); /* GREEK CAPITAL LETTER ETA WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 7977, 'status' => 'C', 'lower' => array(7969)); /* GREEK CAPITAL LETTER ETA WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 7978, 'status' => 'C', 'lower' => array(7970)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7979, 'status' => 'C', 'lower' => array(7971)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7980, 'status' => 'C', 'lower' => array(7972)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7981, 'status' => 'C', 'lower' => array(7973)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7982, 'status' => 'C', 'lower' => array(7974)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 7983, 'status' => 'C', 'lower' => array(7975)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 7992, 'status' => 'C', 'lower' => array(7984)); /* GREEK CAPITAL LETTER IOTA WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 7993, 'status' => 'C', 'lower' => array(7985)); /* GREEK CAPITAL LETTER IOTA WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 7994, 'status' => 'C', 'lower' => array(7986)); /* GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7995, 'status' => 'C', 'lower' => array(7987)); /* GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 7996, 'status' => 'C', 'lower' => array(7988)); /* GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7997, 'status' => 'C', 'lower' => array(7989)); /* GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 7998, 'status' => 'C', 'lower' => array(7990)); /* GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 7999, 'status' => 'C', 'lower' => array(7991)); /* GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8008, 'status' => 'C', 'lower' => array(8000)); /* GREEK CAPITAL LETTER OMICRON WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 8009, 'status' => 'C', 'lower' => array(8001)); /* GREEK CAPITAL LETTER OMICRON WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 8010, 'status' => 'C', 'lower' => array(8002)); /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8011, 'status' => 'C', 'lower' => array(8003)); /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8012, 'status' => 'C', 'lower' => array(8004)); /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8013, 'status' => 'C', 'lower' => array(8005)); /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8016, 'status' => 'F', 'lower' => array(965, 787)); /* GREEK SMALL LETTER UPSILON WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 8018, 'status' => 'F', 'lower' => array(965, 787, 768)); /* GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8020, 'status' => 'F', 'lower' => array(965, 787, 769)); /* GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8022, 'status' => 'F', 'lower' => array(965, 787, 834)); /* GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8025, 'status' => 'C', 'lower' => array(8017)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 8027, 'status' => 'C', 'lower' => array(8019)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8029, 'status' => 'C', 'lower' => array(8021)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8031, 'status' => 'C', 'lower' => array(8023)); /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8040, 'status' => 'C', 'lower' => array(8032)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 8041, 'status' => 'C', 'lower' => array(8033)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 8042, 'status' => 'C', 'lower' => array(8034)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8043, 'status' => 'C', 'lower' => array(8035)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8044, 'status' => 'C', 'lower' => array(8036)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8045, 'status' => 'C', 'lower' => array(8037)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8046, 'status' => 'C', 'lower' => array(8038)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8047, 'status' => 'C', 'lower' => array(8039)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8064, 'status' => 'F', 'lower' => array(7936, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8065, 'status' => 'F', 'lower' => array(7937, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8066, 'status' => 'F', 'lower' => array(7938, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8067, 'status' => 'F', 'lower' => array(7939, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8068, 'status' => 'F', 'lower' => array(7940, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8069, 'status' => 'F', 'lower' => array(7941, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8070, 'status' => 'F', 'lower' => array(7942, 953)); /* GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8071, 'status' => 'F', 'lower' => array(7943, 953)); /* GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8072, 'status' => 'F', 'lower' => array(7936, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8072, 'status' => 'S', 'lower' => array(8064)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8073, 'status' => 'F', 'lower' => array(7937, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8073, 'status' => 'S', 'lower' => array(8065)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8074, 'status' => 'F', 'lower' => array(7938, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8074, 'status' => 'S', 'lower' => array(8066)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8075, 'status' => 'F', 'lower' => array(7939, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8075, 'status' => 'S', 'lower' => array(8067)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8076, 'status' => 'F', 'lower' => array(7940, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8076, 'status' => 'S', 'lower' => array(8068)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8077, 'status' => 'F', 'lower' => array(7941, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8077, 'status' => 'S', 'lower' => array(8069)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8078, 'status' => 'F', 'lower' => array(7942, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8078, 'status' => 'S', 'lower' => array(8070)); /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8079, 'status' => 'F', 'lower' => array(7943, 953)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8079, 'status' => 'S', 'lower' => array(8071)); /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8080, 'status' => 'F', 'lower' => array(7968, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8081, 'status' => 'F', 'lower' => array(7969, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8082, 'status' => 'F', 'lower' => array(7970, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8083, 'status' => 'F', 'lower' => array(7971, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8084, 'status' => 'F', 'lower' => array(7972, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8085, 'status' => 'F', 'lower' => array(7973, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8086, 'status' => 'F', 'lower' => array(7974, 953)); /* GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8087, 'status' => 'F', 'lower' => array(7975, 953)); /* GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8088, 'status' => 'F', 'lower' => array(7968, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8088, 'status' => 'S', 'lower' => array(8080)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8089, 'status' => 'F', 'lower' => array(7969, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8089, 'status' => 'S', 'lower' => array(8081)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8090, 'status' => 'F', 'lower' => array(7970, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8090, 'status' => 'S', 'lower' => array(8082)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8091, 'status' => 'F', 'lower' => array(7971, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8091, 'status' => 'S', 'lower' => array(8083)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8092, 'status' => 'F', 'lower' => array(7972, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8092, 'status' => 'S', 'lower' => array(8084)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8093, 'status' => 'F', 'lower' => array(7973, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8093, 'status' => 'S', 'lower' => array(8085)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8094, 'status' => 'F', 'lower' => array(7974, 953)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8094, 'status' => 'S', 'lower' => array(8086)); /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8095, 'status' => 'F', 'lower' => array(7975, 953)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8095, 'status' => 'S', 'lower' => array(8087)); /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8096, 'status' => 'F', 'lower' => array(8032, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8097, 'status' => 'F', 'lower' => array(8033, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8098, 'status' => 'F', 'lower' => array(8034, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8099, 'status' => 'F', 'lower' => array(8035, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8100, 'status' => 'F', 'lower' => array(8036, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8101, 'status' => 'F', 'lower' => array(8037, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8102, 'status' => 'F', 'lower' => array(8038, 953)); /* GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8103, 'status' => 'F', 'lower' => array(8039, 953)); /* GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8104, 'status' => 'F', 'lower' => array(8032, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8104, 'status' => 'S', 'lower' => array(8096)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8105, 'status' => 'F', 'lower' => array(8033, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8105, 'status' => 'S', 'lower' => array(8097)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8106, 'status' => 'F', 'lower' => array(8034, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8106, 'status' => 'S', 'lower' => array(8098)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8107, 'status' => 'F', 'lower' => array(8035, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8107, 'status' => 'S', 'lower' => array(8099)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8108, 'status' => 'F', 'lower' => array(8036, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8108, 'status' => 'S', 'lower' => array(8100)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8109, 'status' => 'F', 'lower' => array(8037, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8109, 'status' => 'S', 'lower' => array(8101)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8110, 'status' => 'F', 'lower' => array(8038, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8110, 'status' => 'S', 'lower' => array(8102)); /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8111, 'status' => 'F', 'lower' => array(8039, 953)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8111, 'status' => 'S', 'lower' => array(8103)); /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8114, 'status' => 'F', 'lower' => array(8048, 953)); /* GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8115, 'status' => 'F', 'lower' => array(945, 953)); /* GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8116, 'status' => 'F', 'lower' => array(940, 953)); /* GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8118, 'status' => 'F', 'lower' => array(945, 834)); /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8119, 'status' => 'F', 'lower' => array(945, 834, 953)); /* GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8120, 'status' => 'C', 'lower' => array(8112)); /* GREEK CAPITAL LETTER ALPHA WITH VRACHY */ +$config['1f00_1fff'][] = array('upper' => 8121, 'status' => 'C', 'lower' => array(8113)); /* GREEK CAPITAL LETTER ALPHA WITH MACRON */ +$config['1f00_1fff'][] = array('upper' => 8122, 'status' => 'C', 'lower' => array(8048)); /* GREEK CAPITAL LETTER ALPHA WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8123, 'status' => 'C', 'lower' => array(8049)); /* GREEK CAPITAL LETTER ALPHA WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8124, 'status' => 'F', 'lower' => array(945, 953)); /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8124, 'status' => 'S', 'lower' => array(8115)); /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8126, 'status' => 'C', 'lower' => array(953)); /* GREEK PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8130, 'status' => 'F', 'lower' => array(8052, 953)); /* GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8131, 'status' => 'F', 'lower' => array(951, 953)); /* GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8132, 'status' => 'F', 'lower' => array(942, 953)); /* GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8134, 'status' => 'F', 'lower' => array(951, 834)); /* GREEK SMALL LETTER ETA WITH PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8135, 'status' => 'F', 'lower' => array(951, 834, 953)); /* GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8136, 'status' => 'C', 'lower' => array(8050)); /* GREEK CAPITAL LETTER EPSILON WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8137, 'status' => 'C', 'lower' => array(8051)); /* GREEK CAPITAL LETTER EPSILON WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8138, 'status' => 'C', 'lower' => array(8052)); /* GREEK CAPITAL LETTER ETA WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8139, 'status' => 'C', 'lower' => array(8053)); /* GREEK CAPITAL LETTER ETA WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8140, 'status' => 'F', 'lower' => array(951, 953)); /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8140, 'status' => 'S', 'lower' => array(8131)); /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8146, 'status' => 'F', 'lower' => array(953, 776, 768)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8147, 'status' => 'F', 'lower' => array(953, 776, 769)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8150, 'status' => 'F', 'lower' => array(953, 834)); /* GREEK SMALL LETTER IOTA WITH PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8151, 'status' => 'F', 'lower' => array(953, 776, 834)); /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8152, 'status' => 'C', 'lower' => array(8144)); /* GREEK CAPITAL LETTER IOTA WITH VRACHY */ +$config['1f00_1fff'][] = array('upper' => 8153, 'status' => 'C', 'lower' => array(8145)); /* GREEK CAPITAL LETTER IOTA WITH MACRON */ +$config['1f00_1fff'][] = array('upper' => 8154, 'status' => 'C', 'lower' => array(8054)); /* GREEK CAPITAL LETTER IOTA WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8155, 'status' => 'C', 'lower' => array(8055)); /* GREEK CAPITAL LETTER IOTA WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8162, 'status' => 'F', 'lower' => array(965, 776, 768)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA */ +$config['1f00_1fff'][] = array('upper' => 8163, 'status' => 'F', 'lower' => array(965, 776, 769)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA */ +$config['1f00_1fff'][] = array('upper' => 8164, 'status' => 'F', 'lower' => array(961, 787)); /* GREEK SMALL LETTER RHO WITH PSILI */ +$config['1f00_1fff'][] = array('upper' => 8166, 'status' => 'F', 'lower' => array(965, 834)); /* GREEK SMALL LETTER UPSILON WITH PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8167, 'status' => 'F', 'lower' => array(965, 776, 834)); /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8168, 'status' => 'C', 'lower' => array(8160)); /* GREEK CAPITAL LETTER UPSILON WITH VRACHY */ +$config['1f00_1fff'][] = array('upper' => 8169, 'status' => 'C', 'lower' => array(8161)); /* GREEK CAPITAL LETTER UPSILON WITH MACRON */ +$config['1f00_1fff'][] = array('upper' => 8170, 'status' => 'C', 'lower' => array(8058)); /* GREEK CAPITAL LETTER UPSILON WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8171, 'status' => 'C', 'lower' => array(8059)); /* GREEK CAPITAL LETTER UPSILON WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8172, 'status' => 'C', 'lower' => array(8165)); /* GREEK CAPITAL LETTER RHO WITH DASIA */ +$config['1f00_1fff'][] = array('upper' => 8178, 'status' => 'F', 'lower' => array(8060, 953)); /* GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8179, 'status' => 'F', 'lower' => array(969, 953)); /* GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8180, 'status' => 'F', 'lower' => array(974, 953)); /* GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8182, 'status' => 'F', 'lower' => array(969, 834)); /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI */ +$config['1f00_1fff'][] = array('upper' => 8183, 'status' => 'F', 'lower' => array(969, 834, 953)); /* GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8184, 'status' => 'C', 'lower' => array(8056)); /* GREEK CAPITAL LETTER OMICRON WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8185, 'status' => 'C', 'lower' => array(8057)); /* GREEK CAPITAL LETTER OMICRON WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8186, 'status' => 'C', 'lower' => array(8060)); /* GREEK CAPITAL LETTER OMEGA WITH VARIA */ +$config['1f00_1fff'][] = array('upper' => 8187, 'status' => 'C', 'lower' => array(8061)); /* GREEK CAPITAL LETTER OMEGA WITH OXIA */ +$config['1f00_1fff'][] = array('upper' => 8188, 'status' => 'F', 'lower' => array(969, 953)); /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */ +$config['1f00_1fff'][] = array('upper' => 8188, 'status' => 'S', 'lower' => array(8179)); /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/2100_214f.php b/cake/config/unicode/casefolding/2100_214f.php new file mode 100644 index 000000000..9bd666001 --- /dev/null +++ b/cake/config/unicode/casefolding/2100_214f.php @@ -0,0 +1,52 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['2100_214f'][] = array('upper' => 8486, 'status' => 'C', 'lower' => array(969)); /* OHM SIGN */ +$config['2100_214f'][] = array('upper' => 8490, 'status' => 'C', 'lower' => array(107)); /* KELVIN SIGN */ +$config['2100_214f'][] = array('upper' => 8491, 'status' => 'C', 'lower' => array(229)); /* ANGSTROM SIGN */ +$config['2100_214f'][] = array('upper' => 8498, 'status' => 'C', 'lower' => array(8526)); /* TURNED CAPITAL F */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/2150_218f.php b/cake/config/unicode/casefolding/2150_218f.php new file mode 100644 index 000000000..0483b7105 --- /dev/null +++ b/cake/config/unicode/casefolding/2150_218f.php @@ -0,0 +1,65 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['2150_218f'][] = array('upper' => 8544, 'status' => 'C', 'lower' => array(8560)); /* ROMAN NUMERAL ONE */ +$config['2150_218f'][] = array('upper' => 8545, 'status' => 'C', 'lower' => array(8561)); /* ROMAN NUMERAL TWO */ +$config['2150_218f'][] = array('upper' => 8546, 'status' => 'C', 'lower' => array(8562)); /* ROMAN NUMERAL THREE */ +$config['2150_218f'][] = array('upper' => 8547, 'status' => 'C', 'lower' => array(8563)); /* ROMAN NUMERAL FOUR */ +$config['2150_218f'][] = array('upper' => 8548, 'status' => 'C', 'lower' => array(8564)); /* ROMAN NUMERAL FIVE */ +$config['2150_218f'][] = array('upper' => 8549, 'status' => 'C', 'lower' => array(8565)); /* ROMAN NUMERAL SIX */ +$config['2150_218f'][] = array('upper' => 8550, 'status' => 'C', 'lower' => array(8566)); /* ROMAN NUMERAL SEVEN */ +$config['2150_218f'][] = array('upper' => 8551, 'status' => 'C', 'lower' => array(8567)); /* ROMAN NUMERAL EIGHT */ +$config['2150_218f'][] = array('upper' => 8552, 'status' => 'C', 'lower' => array(8568)); /* ROMAN NUMERAL NINE */ +$config['2150_218f'][] = array('upper' => 8553, 'status' => 'C', 'lower' => array(8569)); /* ROMAN NUMERAL TEN */ +$config['2150_218f'][] = array('upper' => 8554, 'status' => 'C', 'lower' => array(8570)); /* ROMAN NUMERAL ELEVEN */ +$config['2150_218f'][] = array('upper' => 8555, 'status' => 'C', 'lower' => array(8571)); /* ROMAN NUMERAL TWELVE */ +$config['2150_218f'][] = array('upper' => 8556, 'status' => 'C', 'lower' => array(8572)); /* ROMAN NUMERAL FIFTY */ +$config['2150_218f'][] = array('upper' => 8557, 'status' => 'C', 'lower' => array(8573)); /* ROMAN NUMERAL ONE HUNDRED */ +$config['2150_218f'][] = array('upper' => 8558, 'status' => 'C', 'lower' => array(8574)); /* ROMAN NUMERAL FIVE HUNDRED */ +$config['2150_218f'][] = array('upper' => 8559, 'status' => 'C', 'lower' => array(8575)); /* ROMAN NUMERAL ONE THOUSAND */ +$config['2150_218f'][] = array('upper' => 8579, 'status' => 'C', 'lower' => array(8580)); /* ROMAN NUMERAL REVERSED ONE HUNDRED */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/2460_24ff.php b/cake/config/unicode/casefolding/2460_24ff.php new file mode 100644 index 000000000..4278132a6 --- /dev/null +++ b/cake/config/unicode/casefolding/2460_24ff.php @@ -0,0 +1,74 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['2460_24ff'][] = array('upper' => 9398, 'status' => 'C', 'lower' => array(9424)); /* CIRCLED LATIN CAPITAL LETTER A */ +$config['2460_24ff'][] = array('upper' => 9399, 'status' => 'C', 'lower' => array(9425)); /* CIRCLED LATIN CAPITAL LETTER B */ +$config['2460_24ff'][] = array('upper' => 9400, 'status' => 'C', 'lower' => array(9426)); /* CIRCLED LATIN CAPITAL LETTER C */ +$config['2460_24ff'][] = array('upper' => 9401, 'status' => 'C', 'lower' => array(9427)); /* CIRCLED LATIN CAPITAL LETTER D */ +$config['2460_24ff'][] = array('upper' => 9402, 'status' => 'C', 'lower' => array(9428)); /* CIRCLED LATIN CAPITAL LETTER E */ +$config['2460_24ff'][] = array('upper' => 9403, 'status' => 'C', 'lower' => array(9429)); /* CIRCLED LATIN CAPITAL LETTER F */ +$config['2460_24ff'][] = array('upper' => 9404, 'status' => 'C', 'lower' => array(9430)); /* CIRCLED LATIN CAPITAL LETTER G */ +$config['2460_24ff'][] = array('upper' => 9405, 'status' => 'C', 'lower' => array(9431)); /* CIRCLED LATIN CAPITAL LETTER H */ +$config['2460_24ff'][] = array('upper' => 9406, 'status' => 'C', 'lower' => array(9432)); /* CIRCLED LATIN CAPITAL LETTER I */ +$config['2460_24ff'][] = array('upper' => 9407, 'status' => 'C', 'lower' => array(9433)); /* CIRCLED LATIN CAPITAL LETTER J */ +$config['2460_24ff'][] = array('upper' => 9408, 'status' => 'C', 'lower' => array(9434)); /* CIRCLED LATIN CAPITAL LETTER K */ +$config['2460_24ff'][] = array('upper' => 9409, 'status' => 'C', 'lower' => array(9435)); /* CIRCLED LATIN CAPITAL LETTER L */ +$config['2460_24ff'][] = array('upper' => 9410, 'status' => 'C', 'lower' => array(9436)); /* CIRCLED LATIN CAPITAL LETTER M */ +$config['2460_24ff'][] = array('upper' => 9411, 'status' => 'C', 'lower' => array(9437)); /* CIRCLED LATIN CAPITAL LETTER N */ +$config['2460_24ff'][] = array('upper' => 9412, 'status' => 'C', 'lower' => array(9438)); /* CIRCLED LATIN CAPITAL LETTER O */ +$config['2460_24ff'][] = array('upper' => 9413, 'status' => 'C', 'lower' => array(9439)); /* CIRCLED LATIN CAPITAL LETTER P */ +$config['2460_24ff'][] = array('upper' => 9414, 'status' => 'C', 'lower' => array(9440)); /* CIRCLED LATIN CAPITAL LETTER Q */ +$config['2460_24ff'][] = array('upper' => 9415, 'status' => 'C', 'lower' => array(9441)); /* CIRCLED LATIN CAPITAL LETTER R */ +$config['2460_24ff'][] = array('upper' => 9416, 'status' => 'C', 'lower' => array(9442)); /* CIRCLED LATIN CAPITAL LETTER S */ +$config['2460_24ff'][] = array('upper' => 9417, 'status' => 'C', 'lower' => array(9443)); /* CIRCLED LATIN CAPITAL LETTER T */ +$config['2460_24ff'][] = array('upper' => 9418, 'status' => 'C', 'lower' => array(9444)); /* CIRCLED LATIN CAPITAL LETTER U */ +$config['2460_24ff'][] = array('upper' => 9419, 'status' => 'C', 'lower' => array(9445)); /* CIRCLED LATIN CAPITAL LETTER V */ +$config['2460_24ff'][] = array('upper' => 9420, 'status' => 'C', 'lower' => array(9446)); /* CIRCLED LATIN CAPITAL LETTER W */ +$config['2460_24ff'][] = array('upper' => 9421, 'status' => 'C', 'lower' => array(9447)); /* CIRCLED LATIN CAPITAL LETTER X */ +$config['2460_24ff'][] = array('upper' => 9422, 'status' => 'C', 'lower' => array(9448)); /* CIRCLED LATIN CAPITAL LETTER Y */ +$config['2460_24ff'][] = array('upper' => 9423, 'status' => 'C', 'lower' => array(9449)); /* CIRCLED LATIN CAPITAL LETTER Z */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/2c00_2c5f.php b/cake/config/unicode/casefolding/2c00_2c5f.php new file mode 100644 index 000000000..fd88a07be --- /dev/null +++ b/cake/config/unicode/casefolding/2c00_2c5f.php @@ -0,0 +1,95 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['2c00_2c5f'][] = array('upper' => 11264, 'status' => 'C', 'lower' => array(11312)); /* GLAGOLITIC CAPITAL LETTER AZU */ +$config['2c00_2c5f'][] = array('upper' => 11265, 'status' => 'C', 'lower' => array(11313)); /* GLAGOLITIC CAPITAL LETTER BUKY */ +$config['2c00_2c5f'][] = array('upper' => 11266, 'status' => 'C', 'lower' => array(11314)); /* GLAGOLITIC CAPITAL LETTER VEDE */ +$config['2c00_2c5f'][] = array('upper' => 11267, 'status' => 'C', 'lower' => array(11315)); /* GLAGOLITIC CAPITAL LETTER GLAGOLI */ +$config['2c00_2c5f'][] = array('upper' => 11268, 'status' => 'C', 'lower' => array(11316)); /* GLAGOLITIC CAPITAL LETTER DOBRO */ +$config['2c00_2c5f'][] = array('upper' => 11269, 'status' => 'C', 'lower' => array(11317)); /* GLAGOLITIC CAPITAL LETTER YESTU */ +$config['2c00_2c5f'][] = array('upper' => 11270, 'status' => 'C', 'lower' => array(11318)); /* GLAGOLITIC CAPITAL LETTER ZHIVETE */ +$config['2c00_2c5f'][] = array('upper' => 11271, 'status' => 'C', 'lower' => array(11319)); /* GLAGOLITIC CAPITAL LETTER DZELO */ +$config['2c00_2c5f'][] = array('upper' => 11272, 'status' => 'C', 'lower' => array(11320)); /* GLAGOLITIC CAPITAL LETTER ZEMLJA */ +$config['2c00_2c5f'][] = array('upper' => 11273, 'status' => 'C', 'lower' => array(11321)); /* GLAGOLITIC CAPITAL LETTER IZHE */ +$config['2c00_2c5f'][] = array('upper' => 11274, 'status' => 'C', 'lower' => array(11322)); /* GLAGOLITIC CAPITAL LETTER INITIAL IZHE */ +$config['2c00_2c5f'][] = array('upper' => 11275, 'status' => 'C', 'lower' => array(11323)); /* GLAGOLITIC CAPITAL LETTER I */ +$config['2c00_2c5f'][] = array('upper' => 11276, 'status' => 'C', 'lower' => array(11324)); /* GLAGOLITIC CAPITAL LETTER DJERVI */ +$config['2c00_2c5f'][] = array('upper' => 11277, 'status' => 'C', 'lower' => array(11325)); /* GLAGOLITIC CAPITAL LETTER KAKO */ +$config['2c00_2c5f'][] = array('upper' => 11278, 'status' => 'C', 'lower' => array(11326)); /* GLAGOLITIC CAPITAL LETTER LJUDIJE */ +$config['2c00_2c5f'][] = array('upper' => 11279, 'status' => 'C', 'lower' => array(11327)); /* GLAGOLITIC CAPITAL LETTER MYSLITE */ +$config['2c00_2c5f'][] = array('upper' => 11280, 'status' => 'C', 'lower' => array(11328)); /* GLAGOLITIC CAPITAL LETTER NASHI */ +$config['2c00_2c5f'][] = array('upper' => 11281, 'status' => 'C', 'lower' => array(11329)); /* GLAGOLITIC CAPITAL LETTER ONU */ +$config['2c00_2c5f'][] = array('upper' => 11282, 'status' => 'C', 'lower' => array(11330)); /* GLAGOLITIC CAPITAL LETTER POKOJI */ +$config['2c00_2c5f'][] = array('upper' => 11283, 'status' => 'C', 'lower' => array(11331)); /* GLAGOLITIC CAPITAL LETTER RITSI */ +$config['2c00_2c5f'][] = array('upper' => 11284, 'status' => 'C', 'lower' => array(11332)); /* GLAGOLITIC CAPITAL LETTER SLOVO */ +$config['2c00_2c5f'][] = array('upper' => 11285, 'status' => 'C', 'lower' => array(11333)); /* GLAGOLITIC CAPITAL LETTER TVRIDO */ +$config['2c00_2c5f'][] = array('upper' => 11286, 'status' => 'C', 'lower' => array(11334)); /* GLAGOLITIC CAPITAL LETTER UKU */ +$config['2c00_2c5f'][] = array('upper' => 11287, 'status' => 'C', 'lower' => array(11335)); /* GLAGOLITIC CAPITAL LETTER FRITU */ +$config['2c00_2c5f'][] = array('upper' => 11288, 'status' => 'C', 'lower' => array(11336)); /* GLAGOLITIC CAPITAL LETTER HERU */ +$config['2c00_2c5f'][] = array('upper' => 11289, 'status' => 'C', 'lower' => array(11337)); /* GLAGOLITIC CAPITAL LETTER OTU */ +$config['2c00_2c5f'][] = array('upper' => 11290, 'status' => 'C', 'lower' => array(11338)); /* GLAGOLITIC CAPITAL LETTER PE */ +$config['2c00_2c5f'][] = array('upper' => 11291, 'status' => 'C', 'lower' => array(11339)); /* GLAGOLITIC CAPITAL LETTER SHTA */ +$config['2c00_2c5f'][] = array('upper' => 11292, 'status' => 'C', 'lower' => array(11340)); /* GLAGOLITIC CAPITAL LETTER TSI */ +$config['2c00_2c5f'][] = array('upper' => 11293, 'status' => 'C', 'lower' => array(11341)); /* GLAGOLITIC CAPITAL LETTER CHRIVI */ +$config['2c00_2c5f'][] = array('upper' => 11294, 'status' => 'C', 'lower' => array(11342)); /* GLAGOLITIC CAPITAL LETTER SHA */ +$config['2c00_2c5f'][] = array('upper' => 11295, 'status' => 'C', 'lower' => array(11343)); /* GLAGOLITIC CAPITAL LETTER YERU */ +$config['2c00_2c5f'][] = array('upper' => 11296, 'status' => 'C', 'lower' => array(11344)); /* GLAGOLITIC CAPITAL LETTER YERI */ +$config['2c00_2c5f'][] = array('upper' => 11297, 'status' => 'C', 'lower' => array(11345)); /* GLAGOLITIC CAPITAL LETTER YATI */ +$config['2c00_2c5f'][] = array('upper' => 11298, 'status' => 'C', 'lower' => array(11346)); /* GLAGOLITIC CAPITAL LETTER SPIDERY HA */ +$config['2c00_2c5f'][] = array('upper' => 11299, 'status' => 'C', 'lower' => array(11347)); /* GLAGOLITIC CAPITAL LETTER YU */ +$config['2c00_2c5f'][] = array('upper' => 11300, 'status' => 'C', 'lower' => array(11348)); /* GLAGOLITIC CAPITAL LETTER SMALL YUS */ +$config['2c00_2c5f'][] = array('upper' => 11301, 'status' => 'C', 'lower' => array(11349)); /* GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL */ +$config['2c00_2c5f'][] = array('upper' => 11302, 'status' => 'C', 'lower' => array(11350)); /* GLAGOLITIC CAPITAL LETTER YO */ +$config['2c00_2c5f'][] = array('upper' => 11303, 'status' => 'C', 'lower' => array(11351)); /* GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS */ +$config['2c00_2c5f'][] = array('upper' => 11304, 'status' => 'C', 'lower' => array(11352)); /* GLAGOLITIC CAPITAL LETTER BIG YUS */ +$config['2c00_2c5f'][] = array('upper' => 11305, 'status' => 'C', 'lower' => array(11353)); /* GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS */ +$config['2c00_2c5f'][] = array('upper' => 11306, 'status' => 'C', 'lower' => array(11354)); /* GLAGOLITIC CAPITAL LETTER FITA */ +$config['2c00_2c5f'][] = array('upper' => 11307, 'status' => 'C', 'lower' => array(11355)); /* GLAGOLITIC CAPITAL LETTER IZHITSA */ +$config['2c00_2c5f'][] = array('upper' => 11308, 'status' => 'C', 'lower' => array(11356)); /* GLAGOLITIC CAPITAL LETTER SHTAPIC */ +$config['2c00_2c5f'][] = array('upper' => 11309, 'status' => 'C', 'lower' => array(11357)); /* GLAGOLITIC CAPITAL LETTER TROKUTASTI A */ +$config['2c00_2c5f'][] = array('upper' => 11310, 'status' => 'C', 'lower' => array(11358)); /* GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/2c60_2c7f.php b/cake/config/unicode/casefolding/2c60_2c7f.php new file mode 100644 index 000000000..43a22822e --- /dev/null +++ b/cake/config/unicode/casefolding/2c60_2c7f.php @@ -0,0 +1,56 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['2c60_2c7f'][] = array('upper' => 11360, 'status' => 'C', 'lower' => array(11361)); /* LATIN CAPITAL LETTER L WITH DOUBLE BAR */ +$config['2c60_2c7f'][] = array('upper' => 11362, 'status' => 'C', 'lower' => array(619)); /* LATIN CAPITAL LETTER L WITH MIDDLE TILDE */ +$config['2c60_2c7f'][] = array('upper' => 11363, 'status' => 'C', 'lower' => array(7549)); /* LATIN CAPITAL LETTER P WITH STROKE */ +$config['2c60_2c7f'][] = array('upper' => 11364, 'status' => 'C', 'lower' => array(637)); /* LATIN CAPITAL LETTER R WITH TAIL */ +$config['2c60_2c7f'][] = array('upper' => 11367, 'status' => 'C', 'lower' => array(11368)); /* LATIN CAPITAL LETTER H WITH DESCENDER */ +$config['2c60_2c7f'][] = array('upper' => 11369, 'status' => 'C', 'lower' => array(11370)); /* LATIN CAPITAL LETTER K WITH DESCENDER */ +$config['2c60_2c7f'][] = array('upper' => 11371, 'status' => 'C', 'lower' => array(11372)); /* LATIN CAPITAL LETTER Z WITH DESCENDER */ +$config['2c60_2c7f'][] = array('upper' => 11381, 'status' => 'C', 'lower' => array(11382)); /* LATIN CAPITAL LETTER HALF H */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/2c80_2cff.php b/cake/config/unicode/casefolding/2c80_2cff.php new file mode 100644 index 000000000..b3d4d8aed --- /dev/null +++ b/cake/config/unicode/casefolding/2c80_2cff.php @@ -0,0 +1,98 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['2c80_2cff'][] = array('upper' => 11392, 'status' => 'C', 'lower' => array(11393)); /* COPTIC CAPITAL LETTER ALFA */ +$config['2c80_2cff'][] = array('upper' => 11394, 'status' => 'C', 'lower' => array(11395)); /* COPTIC CAPITAL LETTER VIDA */ +$config['2c80_2cff'][] = array('upper' => 11396, 'status' => 'C', 'lower' => array(11397)); /* COPTIC CAPITAL LETTER GAMMA */ +$config['2c80_2cff'][] = array('upper' => 11398, 'status' => 'C', 'lower' => array(11399)); /* COPTIC CAPITAL LETTER DALDA */ +$config['2c80_2cff'][] = array('upper' => 11400, 'status' => 'C', 'lower' => array(11401)); /* COPTIC CAPITAL LETTER EIE */ +$config['2c80_2cff'][] = array('upper' => 11402, 'status' => 'C', 'lower' => array(11403)); /* COPTIC CAPITAL LETTER SOU */ +$config['2c80_2cff'][] = array('upper' => 11404, 'status' => 'C', 'lower' => array(11405)); /* COPTIC CAPITAL LETTER ZATA */ +$config['2c80_2cff'][] = array('upper' => 11406, 'status' => 'C', 'lower' => array(11407)); /* COPTIC CAPITAL LETTER HATE */ +$config['2c80_2cff'][] = array('upper' => 11408, 'status' => 'C', 'lower' => array(11409)); /* COPTIC CAPITAL LETTER THETHE */ +$config['2c80_2cff'][] = array('upper' => 11410, 'status' => 'C', 'lower' => array(11411)); /* COPTIC CAPITAL LETTER IAUDA */ +$config['2c80_2cff'][] = array('upper' => 11412, 'status' => 'C', 'lower' => array(11413)); /* COPTIC CAPITAL LETTER KAPA */ +$config['2c80_2cff'][] = array('upper' => 11414, 'status' => 'C', 'lower' => array(11415)); /* COPTIC CAPITAL LETTER LAULA */ +$config['2c80_2cff'][] = array('upper' => 11416, 'status' => 'C', 'lower' => array(11417)); /* COPTIC CAPITAL LETTER MI */ +$config['2c80_2cff'][] = array('upper' => 11418, 'status' => 'C', 'lower' => array(11419)); /* COPTIC CAPITAL LETTER NI */ +$config['2c80_2cff'][] = array('upper' => 11420, 'status' => 'C', 'lower' => array(11421)); /* COPTIC CAPITAL LETTER KSI */ +$config['2c80_2cff'][] = array('upper' => 11422, 'status' => 'C', 'lower' => array(11423)); /* COPTIC CAPITAL LETTER O */ +$config['2c80_2cff'][] = array('upper' => 11424, 'status' => 'C', 'lower' => array(11425)); /* COPTIC CAPITAL LETTER PI */ +$config['2c80_2cff'][] = array('upper' => 11426, 'status' => 'C', 'lower' => array(11427)); /* COPTIC CAPITAL LETTER RO */ +$config['2c80_2cff'][] = array('upper' => 11428, 'status' => 'C', 'lower' => array(11429)); /* COPTIC CAPITAL LETTER SIMA */ +$config['2c80_2cff'][] = array('upper' => 11430, 'status' => 'C', 'lower' => array(11431)); /* COPTIC CAPITAL LETTER TAU */ +$config['2c80_2cff'][] = array('upper' => 11432, 'status' => 'C', 'lower' => array(11433)); /* COPTIC CAPITAL LETTER UA */ +$config['2c80_2cff'][] = array('upper' => 11434, 'status' => 'C', 'lower' => array(11435)); /* COPTIC CAPITAL LETTER FI */ +$config['2c80_2cff'][] = array('upper' => 11436, 'status' => 'C', 'lower' => array(11437)); /* COPTIC CAPITAL LETTER KHI */ +$config['2c80_2cff'][] = array('upper' => 11438, 'status' => 'C', 'lower' => array(11439)); /* COPTIC CAPITAL LETTER PSI */ +$config['2c80_2cff'][] = array('upper' => 11440, 'status' => 'C', 'lower' => array(11441)); /* COPTIC CAPITAL LETTER OOU */ +$config['2c80_2cff'][] = array('upper' => 11442, 'status' => 'C', 'lower' => array(11443)); /* COPTIC CAPITAL LETTER DIALECT-P ALEF */ +$config['2c80_2cff'][] = array('upper' => 11444, 'status' => 'C', 'lower' => array(11445)); /* COPTIC CAPITAL LETTER OLD COPTIC AIN */ +$config['2c80_2cff'][] = array('upper' => 11446, 'status' => 'C', 'lower' => array(11447)); /* COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE */ +$config['2c80_2cff'][] = array('upper' => 11448, 'status' => 'C', 'lower' => array(11449)); /* COPTIC CAPITAL LETTER DIALECT-P KAPA */ +$config['2c80_2cff'][] = array('upper' => 11450, 'status' => 'C', 'lower' => array(11451)); /* COPTIC CAPITAL LETTER DIALECT-P NI */ +$config['2c80_2cff'][] = array('upper' => 11452, 'status' => 'C', 'lower' => array(11453)); /* COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI */ +$config['2c80_2cff'][] = array('upper' => 11454, 'status' => 'C', 'lower' => array(11455)); /* COPTIC CAPITAL LETTER OLD COPTIC OOU */ +$config['2c80_2cff'][] = array('upper' => 11456, 'status' => 'C', 'lower' => array(11457)); /* COPTIC CAPITAL LETTER SAMPI */ +$config['2c80_2cff'][] = array('upper' => 11458, 'status' => 'C', 'lower' => array(11459)); /* COPTIC CAPITAL LETTER CROSSED SHEI */ +$config['2c80_2cff'][] = array('upper' => 11460, 'status' => 'C', 'lower' => array(11461)); /* COPTIC CAPITAL LETTER OLD COPTIC SHEI */ +$config['2c80_2cff'][] = array('upper' => 11462, 'status' => 'C', 'lower' => array(11463)); /* COPTIC CAPITAL LETTER OLD COPTIC ESH */ +$config['2c80_2cff'][] = array('upper' => 11464, 'status' => 'C', 'lower' => array(11465)); /* COPTIC CAPITAL LETTER AKHMIMIC KHEI */ +$config['2c80_2cff'][] = array('upper' => 11466, 'status' => 'C', 'lower' => array(11467)); /* COPTIC CAPITAL LETTER DIALECT-P HORI */ +$config['2c80_2cff'][] = array('upper' => 11468, 'status' => 'C', 'lower' => array(11469)); /* COPTIC CAPITAL LETTER OLD COPTIC HORI */ +$config['2c80_2cff'][] = array('upper' => 11470, 'status' => 'C', 'lower' => array(11471)); /* COPTIC CAPITAL LETTER OLD COPTIC HA */ +$config['2c80_2cff'][] = array('upper' => 11472, 'status' => 'C', 'lower' => array(11473)); /* COPTIC CAPITAL LETTER L-SHAPED HA */ +$config['2c80_2cff'][] = array('upper' => 11474, 'status' => 'C', 'lower' => array(11475)); /* COPTIC CAPITAL LETTER OLD COPTIC HEI */ +$config['2c80_2cff'][] = array('upper' => 11476, 'status' => 'C', 'lower' => array(11477)); /* COPTIC CAPITAL LETTER OLD COPTIC HAT */ +$config['2c80_2cff'][] = array('upper' => 11478, 'status' => 'C', 'lower' => array(11479)); /* COPTIC CAPITAL LETTER OLD COPTIC GANGIA */ +$config['2c80_2cff'][] = array('upper' => 11480, 'status' => 'C', 'lower' => array(11481)); /* COPTIC CAPITAL LETTER OLD COPTIC DJA */ +$config['2c80_2cff'][] = array('upper' => 11482, 'status' => 'C', 'lower' => array(11483)); /* COPTIC CAPITAL LETTER OLD COPTIC SHIMA */ +$config['2c80_2cff'][] = array('upper' => 11484, 'status' => 'C', 'lower' => array(11485)); /* COPTIC CAPITAL LETTER OLD NUBIAN SHIMA */ +$config['2c80_2cff'][] = array('upper' => 11486, 'status' => 'C', 'lower' => array(11487)); /* COPTIC CAPITAL LETTER OLD NUBIAN NGI */ +$config['2c80_2cff'][] = array('upper' => 11488, 'status' => 'C', 'lower' => array(11489)); /* COPTIC CAPITAL LETTER OLD NUBIAN NYI */ +$config['2c80_2cff'][] = array('upper' => 11490, 'status' => 'C', 'lower' => array(11491)); /* COPTIC CAPITAL LETTER OLD NUBIAN WAU */ +?> \ No newline at end of file diff --git a/cake/config/unicode/casefolding/ff00_ffef.php b/cake/config/unicode/casefolding/ff00_ffef.php new file mode 100644 index 000000000..b1243774c --- /dev/null +++ b/cake/config/unicode/casefolding/ff00_ffef.php @@ -0,0 +1,74 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.config.unicode.casefolding + * @since CakePHP(tm) v 1.2.0.5691 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * The upper field is the decimal value of the upper case character + * + * The lower filed is an array of the decimal values that form the lower case version of a character. + * + * The status field is: + * C: common case folding, common mappings shared by both simple and full mappings. + * F: full case folding, mappings that cause strings to grow in length. Multiple characters are separated by spaces. + * S: simple case folding, mappings to single characters where different from F. + * T: special case for uppercase I and dotted uppercase I + * - For non-Turkic languages, this mapping is normally not used. + * - For Turkic languages (tr, az), this mapping can be used instead of the normal mapping for these characters. + * Note that the Turkic mappings do not maintain canonical equivalence without additional processing. + * See the discussions of case mapping in the Unicode Standard for more information. + */ +$config['ff00_ffef'][] = array('upper' => 65313, 'status' => 'C', 'lower' => array(65345)); /* FULLWIDTH LATIN CAPITAL LETTER A */ +$config['ff00_ffef'][] = array('upper' => 65314, 'status' => 'C', 'lower' => array(65346)); /* FULLWIDTH LATIN CAPITAL LETTER B */ +$config['ff00_ffef'][] = array('upper' => 65315, 'status' => 'C', 'lower' => array(65347)); /* FULLWIDTH LATIN CAPITAL LETTER C */ +$config['ff00_ffef'][] = array('upper' => 65316, 'status' => 'C', 'lower' => array(65348)); /* FULLWIDTH LATIN CAPITAL LETTER D */ +$config['ff00_ffef'][] = array('upper' => 65317, 'status' => 'C', 'lower' => array(65349)); /* FULLWIDTH LATIN CAPITAL LETTER E */ +$config['ff00_ffef'][] = array('upper' => 65318, 'status' => 'C', 'lower' => array(65350)); /* FULLWIDTH LATIN CAPITAL LETTER F */ +$config['ff00_ffef'][] = array('upper' => 65319, 'status' => 'C', 'lower' => array(65351)); /* FULLWIDTH LATIN CAPITAL LETTER G */ +$config['ff00_ffef'][] = array('upper' => 65320, 'status' => 'C', 'lower' => array(65352)); /* FULLWIDTH LATIN CAPITAL LETTER H */ +$config['ff00_ffef'][] = array('upper' => 65321, 'status' => 'C', 'lower' => array(65353)); /* FULLWIDTH LATIN CAPITAL LETTER I */ +$config['ff00_ffef'][] = array('upper' => 65322, 'status' => 'C', 'lower' => array(65354)); /* FULLWIDTH LATIN CAPITAL LETTER J */ +$config['ff00_ffef'][] = array('upper' => 65323, 'status' => 'C', 'lower' => array(65355)); /* FULLWIDTH LATIN CAPITAL LETTER K */ +$config['ff00_ffef'][] = array('upper' => 65324, 'status' => 'C', 'lower' => array(65356)); /* FULLWIDTH LATIN CAPITAL LETTER L */ +$config['ff00_ffef'][] = array('upper' => 65325, 'status' => 'C', 'lower' => array(65357)); /* FULLWIDTH LATIN CAPITAL LETTER M */ +$config['ff00_ffef'][] = array('upper' => 65326, 'status' => 'C', 'lower' => array(65358)); /* FULLWIDTH LATIN CAPITAL LETTER N */ +$config['ff00_ffef'][] = array('upper' => 65327, 'status' => 'C', 'lower' => array(65359)); /* FULLWIDTH LATIN CAPITAL LETTER O */ +$config['ff00_ffef'][] = array('upper' => 65328, 'status' => 'C', 'lower' => array(65360)); /* FULLWIDTH LATIN CAPITAL LETTER P */ +$config['ff00_ffef'][] = array('upper' => 65329, 'status' => 'C', 'lower' => array(65361)); /* FULLWIDTH LATIN CAPITAL LETTER Q */ +$config['ff00_ffef'][] = array('upper' => 65330, 'status' => 'C', 'lower' => array(65362)); /* FULLWIDTH LATIN CAPITAL LETTER R */ +$config['ff00_ffef'][] = array('upper' => 65331, 'status' => 'C', 'lower' => array(65363)); /* FULLWIDTH LATIN CAPITAL LETTER S */ +$config['ff00_ffef'][] = array('upper' => 65332, 'status' => 'C', 'lower' => array(65364)); /* FULLWIDTH LATIN CAPITAL LETTER T */ +$config['ff00_ffef'][] = array('upper' => 65333, 'status' => 'C', 'lower' => array(65365)); /* FULLWIDTH LATIN CAPITAL LETTER U */ +$config['ff00_ffef'][] = array('upper' => 65334, 'status' => 'C', 'lower' => array(65366)); /* FULLWIDTH LATIN CAPITAL LETTER V */ +$config['ff00_ffef'][] = array('upper' => 65335, 'status' => 'C', 'lower' => array(65367)); /* FULLWIDTH LATIN CAPITAL LETTER W */ +$config['ff00_ffef'][] = array('upper' => 65336, 'status' => 'C', 'lower' => array(65368)); /* FULLWIDTH LATIN CAPITAL LETTER X */ +$config['ff00_ffef'][] = array('upper' => 65337, 'status' => 'C', 'lower' => array(65369)); /* FULLWIDTH LATIN CAPITAL LETTER Y */ +$config['ff00_ffef'][] = array('upper' => 65338, 'status' => 'C', 'lower' => array(65370)); /* FULLWIDTH LATIN CAPITAL LETTER Z */ +?> \ No newline at end of file diff --git a/cake/console/cake b/cake/console/cake new file mode 100755 index 000000000..b1dac2a8b --- /dev/null +++ b/cake/console/cake @@ -0,0 +1,36 @@ +#!/bin/bash +################################################################################ +# +# Bake is a shell script for running CakePHP bake script +# PHP versions 4 and 5 +# +# CakePHP(tm) : Rapid Development Framework +# Copyright 2005-2007, Cake Software Foundation, Inc. +# 1785 E. Sahara Avenue, Suite 490-204 +# Las Vegas, Nevada 89104 +# +# Licensed under The MIT License +# Redistributions of files must retain the above copyright notice. +# +# @filesource +# @copyright Copyright 2005-2007, Cake Software Foundation, Inc. +# @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +# @package cake +# @subpackage cake.cake.console +# @since CakePHP(tm) v 1.2.0.5012 +# @version $Revision$ +# @modifiedby $LastChangedBy$ +# @lastmodified $Date$ +# @license http://www.opensource.org/licenses/mit-license.php The MIT License +# +################################################################################ +clear + +LIB=${0/%cake/} +APP=`pwd` + +exec php -q ${LIB}cake.php -working "${APP}" "$@" + +echo " "; + +exit; \ No newline at end of file diff --git a/cake/console/cake.bat b/cake/console/cake.bat new file mode 100644 index 000000000..99c70464d --- /dev/null +++ b/cake/console/cake.bat @@ -0,0 +1,37 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Bake is a shell script for running CakePHP bake script +:: PHP versions 4 and 5 +:: +:: CakePHP(tm) : Rapid Development Framework +:: Copyright 2005-2007, Cake Software Foundation, Inc. +:: 1785 E. Sahara Avenue, Suite 490-204 +:: Las Vegas, Nevada 89104 +:: +:: Licensed under The MIT License +:: Redistributions of files must retain the above copyright notice. +:: +:: @filesource +:: @copyright Copyright 2005-2007, Cake Software Foundation, Inc. +:: @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project +:: @package cake +:: @subpackage cake.cake.console +:: @since CakePHP(tm) v 1.2.0.5012 +:: @version $Revision$ +:: @modifiedby $LastChangedBy$ +:: @lastmodified $Date$ +:: @license http://www.opensource.org/licenses/mit-license.php The MIT License +:: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:: In order for this script to work as intended, the cake\console\ folder must be in your PATH + +@echo. +@echo off + +SET app=%0 +SET lib=%~dp0 + +php -q "%lib%cake.php" -working "%CD%" %* + +echo. \ No newline at end of file diff --git a/cake/console/cake.php b/cake/console/cake.php new file mode 100644 index 000000000..9dd8d7e89 --- /dev/null +++ b/cake/console/cake.php @@ -0,0 +1,562 @@ +#!/usr/bin/php -q + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Shell dispatcher + * + * @package cake + * @subpackage cake.cake.console + */ +class ShellDispatcher { +/** + * Standard input stream. + * + * @var filehandle + * @access public + */ + var $stdin; +/** + * Standard output stream. + * + * @var filehandle + * @access public + */ + var $stdout; +/** + * Standard error stream. + * + * @var filehandle + * @access public + */ + var $stderr; +/** + * Contains command switches parsed from the command line. + * + * @var array + * @access public + */ + var $params = array(); +/** + * Contains arguments parsed from the command line. + * + * @var array + * @access public + */ + var $args = array(); +/** + * The file name of the shell that was invoked. + * + * @var string + * @access public + */ + var $shell = null; +/** + * The class name of the shell that was invoked. + * + * @var string + * @access public + */ + var $shellClass = null; +/** + * The command called if public methods are available. + * + * @var string + * @access public + */ + var $shellCommand = null; +/** + * The path locations of shells. + * + * @var array + * @access public + */ + var $shellPaths = array(); +/** + * The path to the current shell location. + * + * @var string + * @access public + */ + var $shellPath = null; +/** + * The name of the shell in camelized. + * + * @var string + * @access public + */ + var $shellName = null; +/** + * Constructs this ShellDispatcher instance. + * + * @param array $args the argv. + */ + function ShellDispatcher($args = array()) { + $this->__construct($args); + } +/** + * Constructor + * + * @param array $args the argv. + */ + function __construct($args = array()) { + set_time_limit(0); + $this->__initConstants(); + $this->parseParams($args); + $this->__initEnvironment(); + $this->dispatch(); + die("\n"); + } +/** + * Defines core configuration. + * + * @access private + */ + function __initConstants() { + if (function_exists('ini_set')) { + ini_set('display_errors', '1'); + ini_set('error_reporting', E_ALL); + ini_set('html_errors', false); + ini_set('implicit_flush', true); + ini_set('max_execution_time', 0); + } + + if (!defined('CAKE_CORE_INCLUDE_PATH')) { + define('PHP5', (phpversion() >= 5)); + define('DS', DIRECTORY_SEPARATOR); + define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(dirname(__FILE__)))); + define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); + define('DISABLE_DEFAULT_ERROR_HANDLING', false); + define('CAKEPHP_SHELL', true); + } + } +/** + * Defines current working environment. + * + * @access private + */ + function __initEnvironment() { + $this->stdin = fopen('php://stdin', 'r'); + $this->stdout = fopen('php://stdout', 'w'); + $this->stderr = fopen('php://stderr', 'w'); + + if (!isset($this->args[0]) || !isset($this->params['working'])) { + $this->stdout("\nCakePHP Console: "); + $this->stdout('This file has been loaded incorrectly and cannot continue.'); + $this->stdout('Please make sure that ' . DIRECTORY_SEPARATOR . 'cake' . DIRECTORY_SEPARATOR . 'console is in your system path,'); + $this->stdout('and check the manual for the correct usage of this command.'); + $this->stdout('(http://manual.cakephp.org/)'); + exit(); + } + + if (basename(__FILE__) != basename($this->args[0])) { + $this->stdout("\nCakePHP Console: "); + $this->stdout('Warning: the dispatcher may have been loaded incorrectly, which could lead to unexpected results...'); + if ($this->getInput('Continue anyway?', array('y', 'n'), 'y') == 'n') { + exit(); + } + } + + if (!$this->__bootstrap()) { + $this->stdout("\nCakePHP Console: "); + $this->stdout("\nUnable to load Cake core:"); + $this->stdout("\tMake sure " . DS . 'cake' . DS . 'libs exists in ' . CAKE_CORE_INCLUDE_PATH); + exit(); + } + + $this->shiftArgs(); + + $this->shellPaths = array( + APP . 'vendors' . DS . 'shells' . DS, + VENDORS . 'shells' . DS, + CONSOLE_LIBS + ); + } +/** + * Initializes the environment and loads the Cake core. + * + * @return boolean Success. + * @access private + */ + function __bootstrap() { + + define('ROOT', $this->params['root']); + define('APP_DIR', $this->params['app']); + define('APP_PATH', $this->params['working'] . DS); + define('WWW_ROOT', APP_PATH . $this->params['webroot']); + + $includes = array( + CORE_PATH . 'cake' . DS . 'basics.php', + CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'object.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'inflector.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'configure.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'file.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'cache.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'string.php', + CORE_PATH . 'cake' . DS . 'libs' . DS . 'class_registry.php', + CORE_PATH . 'cake' . DS . 'console' . DS . 'error.php' + ); + + foreach ($includes as $inc) { + if (!require($inc)) { + $this->stderr("Failed to load Cake core file {$inc}"); + return false; + } + } + + Configure::getInstance(file_exists(CONFIGS . 'bootstrap.php')); + + if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) { + include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'libs' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php'; + } + + Configure::write('debug', 1); + return true; + } + +/** + * Dispatches a CLI request + * + * @access public + */ + function dispatch() { + $this->stdout("\nWelcome to CakePHP v" . Configure::version() . " Console"); + $this->stdout("---------------------------------------------------------------"); + if (isset($this->args[0])) { + $plugin = null; + $shell = $this->args[0]; + if (strpos($shell, '.') !== false) { + list($plugin, $shell) = explode('.', $this->args[0]); + } + + $this->shell = $shell; + $this->shiftArgs(); + $this->shellName = Inflector::camelize($this->shell); + $this->shellClass = $this->shellName . 'Shell'; + + if ($this->shell == 'help') { + $this->help(); + } else { + $loaded = false; + $paths = array(); + + if ($plugin !== null) { + $pluginPaths = Configure::read('pluginPaths'); + $count = count($pluginPaths); + for ($i = 0; $i < $count; $i++) { + $paths[] = $pluginPaths[$i] . $plugin . DS . 'vendors' . DS . 'shells' . DS; + } + } + + $vendorPaths = array_values(Configure::read('vendorPaths')); + $count = count($vendorPaths); + + for ($i = 0; $i < $count; $i++) { + $paths[] = rtrim($vendorPaths[$i], DS) . DS . 'shells' . DS; + } + + $this->shellPaths = array_merge($paths, array(CONSOLE_LIBS)); + foreach ($this->shellPaths as $path) { + $this->shellPath = $path . $this->shell . ".php"; + if (file_exists($this->shellPath)) { + $loaded = true; + break; + } + } + + if ($loaded) { + if (!class_exists('Shell')) { + require CONSOLE_LIBS . 'shell.php'; + } + require $this->shellPath; + if (class_exists($this->shellClass)) { + $command = null; + if (isset($this->args[0])) { + $command = $this->args[0]; + } + $this->shellCommand = Inflector::variable($command); + $shell = new $this->shellClass($this); + + if (strtolower(get_parent_class($shell)) == 'shell') { + $shell->initialize(); + $shell->loadTasks(); + + foreach ($shell->taskNames as $task) { + if (strtolower(get_parent_class($shell)) == 'shell') { + $shell->{$task}->initialize(); + $shell->{$task}->loadTasks(); + } + } + + $task = Inflector::camelize($command); + if (in_array($task, $shell->taskNames)) { + $this->shiftArgs(); + $shell->{$task}->startup(); + if (isset($this->args[0]) && $this->args[0] == 'help') { + if (method_exists($shell->{$task}, 'help')) { + $shell->{$task}->help(); + exit(); + } else { + $this->help(); + } + } + $shell->{$task}->execute(); + return; + } + } + + $classMethods = get_class_methods($shell); + + $privateMethod = $missingCommand = false; + if ((in_array($command, $classMethods) || in_array(strtolower($command), $classMethods)) && strpos($command, '_', 0) === 0) { + $privateMethod = true; + } + + if (!in_array($command, $classMethods) && !in_array(strtolower($command), $classMethods)) { + $missingCommand = true; + } + + $protectedCommands = array( + 'initialize','in','out','err','hr', + 'createfile', 'isdir','copydir','object','tostring', + 'requestaction','log','cakeerror', 'shelldispatcher', + '__initconstants','__initenvironment','__construct', + 'dispatch','__bootstrap','getinput','stdout','stderr','parseparams','shiftargs' + ); + + if (in_array(strtolower($command), $protectedCommands)) { + $missingCommand = true; + } + + if ($missingCommand && method_exists($shell, 'main')) { + $shell->startup(); + $shell->main(); + } elseif (!$privateMethod && method_exists($shell, $command)) { + $this->shiftArgs(); + $shell->startup(); + $shell->{$command}(); + } else { + $this->stderr("Unknown {$this->shellName} command '$command'.\nFor usage, try 'cake {$this->shell} help'.\n\n"); + } + } else { + $this->stderr('Class '.$this->shellClass.' could not be loaded'); + } + } else { + $this->help(); + } + } + } else { + $this->help(); + } + } +/** + * Prompts the user for input, and returns it. + * + * @param string $prompt Prompt text. + * @param mixed $options Array or string of options. + * @param string $default Default input value. + * @return Either the default value, or the user-provided input. + * @access public + */ + function getInput($prompt, $options = null, $default = null) { + if (!is_array($options)) { + $print_options = ''; + } else { + $print_options = '(' . implode('/', $options) . ')'; + } + + if ($default == null) { + $this->stdout($prompt . " $print_options \n" . '> ', false); + } else { + $this->stdout($prompt . " $print_options \n" . "[$default] > ", false); + } + $result = fgets($this->stdin); + + if ($result === false){ + exit; + } + $result = trim($result); + + if ($default != null && empty($result)) { + return $default; + } else { + return $result; + } + } +/** + * Outputs to the stdout filehandle. + * + * @param string $string String to output. + * @param boolean $newline If true, the outputs gets an added newline. + * @access public + */ + function stdout($string, $newline = true) { + if ($newline) { + fwrite($this->stdout, $string . "\n"); + } else { + fwrite($this->stdout, $string); + } + } +/** + * Outputs to the stderr filehandle. + * + * @param string $string Error text to output. + * @access public + */ + function stderr($string) { + fwrite($this->stderr, 'Error: '. $string); + } +/** + * Parses command line options + * + * @param array $params Parameters to parse + * @access public + */ + function parseParams($params) { + $this->__parseParams($params); + + $defaults = array('app' => 'app', 'root' => dirname(dirname(dirname(__FILE__))), 'working' => null, 'webroot' => 'webroot'); + + $params = array_merge($defaults, array_intersect_key($this->params, $defaults)); + + $isWin = array_filter(array_map('strpos', $params, array('\\'))); + + $params = str_replace('\\', '/', $params); + + if (!empty($params['working']) && (!isset($this->args[0]) || isset($this->args[0]) && $this->args[0]{0} !== '.')) { + if ($params['app'] === 'app') { + $params['root'] = dirname($params['working']); + $params['app'] = basename($params['working']); + } else { + $params['root'] = $params['working']; + } + } + + if($params['app'][0] == '/' || preg_match('/([a-z])(:)/i', $params['app'], $matches)) { + $params['root'] = dirname($params['app']); + } elseif (strpos($params['app'], '/')) { + $params['root'] .= '/' . dirname($params['app']); + } + $params['app'] = basename($params['app']); + $params['working'] = $params['root'] . '/' . $params['app']; + + if (!empty($matches[0]) || !empty($isWin)) { + $params = str_replace('/', '\\', $params); + } + + $this->params = array_merge($this->params, $params); + } +/** + * Helper for recursively paraing params + * + * @return array params + * @access private + */ + function __parseParams($params) { + $count = count($params); + for ($i = 0; $i < $count; $i++) { + if (isset($params[$i])) { + if ($params[$i]{0} === '-') { + $key = substr($params[$i], 1); + $this->params[$key] = true; + unset($params[$i]); + if (isset($params[++$i])) { + if ($params[$i]{0} !== '-') { + $this->params[$key] = str_replace('"', '', $params[$i]); + unset($params[$i]); + } else { + $i--; + $this->__parseParams($params); + } + } + } else { + $this->args[] = $params[$i]; + unset($params[$i]); + } + + } + } + } +/** + * Removes first argument and shifts other arguments up + * + * @return boolean False if there are no arguments + * @access public + */ + function shiftArgs() { + if (empty($this->args)) { + return false; + } + unset($this->args[0]); + $this->args = array_values($this->args); + return true; + } +/** + * Shows console help + * + * @access public + */ + function help() { + $this->stdout("Current Paths:"); + $this->stdout(" -app: ". $this->params['app']); + $this->stdout(" -working: " . $this->params['working']); + $this->stdout(" -root: " . $this->params['root']); + $this->stdout(" -core: " . CORE_PATH); + $this->stdout(""); + $this->stdout("Changing Paths:"); + $this->stdout("your working path should be the same as your application path"); + $this->stdout("to change your path use the '-app' param."); + $this->stdout("Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp"); + + $this->stdout("\nAvailable Shells:"); + foreach ($this->shellPaths as $path) { + if (is_dir($path)) { + $shells = Configure::listObjects('file', $path); + $path = r(CORE_PATH, '', $path); + $this->stdout("\n " . $path . ":"); + if (empty($shells)) { + $this->stdout("\t - none"); + } else { + foreach ($shells as $shell) { + if ($shell != 'shell.php') { + $this->stdout("\t " . r('.php', '', $shell)); + } + } + } + } + } + $this->stdout("\nTo run a command, type 'cake shell_name [args]'"); + $this->stdout("To get help on a specific command, type 'cake shell_name help'"); + exit(); + } +} +if (!defined('DISABLE_AUTO_DISPATCH')) { + $dispatcher = new ShellDispatcher($argv); +} +?> \ No newline at end of file diff --git a/cake/console/error.php b/cake/console/error.php new file mode 100644 index 000000000..8058e1709 --- /dev/null +++ b/cake/console/error.php @@ -0,0 +1,257 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console + * @since CakePHP(tm) v 1.2.0.5074 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Error Handler for Cake console. + * + * @package cake + * @subpackage cake.cake.console + */ +class ErrorHandler extends Object { +/** + * Standard output stream. + * + * @var filehandle + * @access public + */ + var $stdout; +/** + * Standard error stream. + * + * @var filehandle + * @access public + */ + var $stderr; +/** + * Class constructor. + * + * @param string $method Method dispatching an error + * @param array $messages Error messages + */ + function __construct($method, $messages) { + $this->stdout = fopen('php://stdout', 'w'); + $this->stderr = fopen('php://stderr', 'w'); + if (Configure::read() > 0 || $method == 'error') { + call_user_func_array(array(&$this, $method), $messages); + } else { + call_user_func_array(array(&$this, 'error404'), $messages); + } + } +/** + * Displays an error page (e.g. 404 Not found). + * + * @param array $params Parameters (code, name, and message) + * @access public + */ + function error($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr($code . $name . $message."\n"); + $this->stop(); + } +/** + * Convenience method to display a 404 page. + * + * @param array $params Parameters (url, message) + * @access public + */ + function error404($params) { + extract($params, EXTR_OVERWRITE); + $this->error(array('code' => '404', + 'name' => 'Not found', + 'message' => sprintf(__("The requested address %s was not found on this server.", true), $url, $message))); + $this->stop(); + } +/** + * Renders the Missing Controller web page. + * + * @param array $params Parameters (className) + * @access public + */ + function missingController($params) { + extract($params, EXTR_OVERWRITE); + $controllerName = str_replace('Controller', '', $className); + $this->stderr(sprintf(__("Missing Controller '%s'", true), $controllerName)); + $this->stop(); + } +/** + * Renders the Missing Action web page. + * + * @param array $params Parameters (action, className) + * @access public + */ + function missingAction($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing Method '%s' in '%s'", true), $action, $className)); + $this->stop(); + } +/** + * Renders the Private Action web page. + * + * @param array $params Parameters (action, className) + * @access public + */ + function privateAction($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Trying to access private method '%s' in '%s'", true), $action, $className)); + $this->stop(); + } +/** + * Renders the Missing Table web page. + * + * @param array $params Parameters (table, className) + * @access public + */ + function missingTable($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing database table '%s' for model '%s'", true), $table, $className)); + $this->stop(); + } +/** + * Renders the Missing Database web page. + * + * @param array $params Parameters + * @access public + */ + function missingDatabase($params = array()) { + extract($params, EXTR_OVERWRITE); + $this->stderr(__("Missing Database", true)); + $this->stop(); + } +/** + * Renders the Missing View web page. + * + * @param array $params Parameters (file, action, className) + * @access public + */ + function missingView($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing View '%s' for '%s' in '%s'", true), $file, $action, $className)); + $this->stop(); + } +/** + * Renders the Missing Layout web page. + * + * @param array $params Parameters (file) + * @access public + */ + function missingLayout($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing Layout '%s'", true), $file)); + $this->stop(); + } +/** + * Renders the Database Connection web page. + * + * @param array $params Parameters + * @access public + */ + function missingConnection($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(__("Missing Database Connection. Try 'cake bake'", true)); + $this->stop(); + } +/** + * Renders the Missing Helper file web page. + * + * @param array $params Parameters (file, helper) + * @access public + */ + function missingHelperFile($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing Helper file '%s' for '%s'", true), $file, Inflector::camelize($helper))); + $this->stop(); + } +/** + * Renders the Missing Helper class web page. + * + * @param array $params Parameters (file, helper) + * @access public + */ + function missingHelperClass($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing Helper class '%s' in '%s'", true), Inflector::camelize($helper), $file)); + $this->stop(); + } +/** + * Renders the Missing Component file web page. + * + * @param array $params Parameters (file, component) + * @access public + */ + function missingComponentFile($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing Component file '%s' for '%s'", true), $file, Inflector::camelize($component))); + $this->stop(); + } +/** + * Renders the Missing Component class web page. + * + * @param array $params Parameters (file, component) + * @access public + */ + function missingComponentClass($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing Component class '%s' in '%s'", true), Inflector::camelize($component), $file)); + $this->stop(); + } +/** + * Renders the Missing Model class web page. + * + * @param array $params Parameters (className) + * @access public + */ + function missingModel($params) { + extract($params, EXTR_OVERWRITE); + $this->stderr(sprintf(__("Missing model '%s'", true), $className)); + $this->stop(); + } +/** + * Outputs to the stdout filehandle. + * + * @param string $string String to output. + * @param boolean $newline If true, the outputs gets an added newline. + * @access public + */ + function stdout($string, $newline = true) { + if ($newline) { + fwrite($this->stdout, $string . "\n"); + } else { + fwrite($this->stdout, $string); + } + } +/** + * Outputs to the stderr filehandle. + * + * @param string $string Error text to output. + * @access public + */ + function stderr($string) { + fwrite($this->stderr, "Error: ". $string . "\n"); + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/acl.php b/cake/console/libs/acl.php new file mode 100644 index 000000000..4ca2b1eb7 --- /dev/null +++ b/cake/console/libs/acl.php @@ -0,0 +1,519 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Component', 'Acl'); +App::import('Model', 'DbAcl'); +/** + * Shell for ACL management. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class AclShell extends Shell { +/** + * Contains instance of AclComponent + * + * @var object + * @access public + */ + var $Acl; +/** + * Contains arguments parsed from the command line. + * + * @var array + * @access public + */ + var $args; +/** + * Contains database source to use + * + * @var string + * @access public + */ + var $dataSource = 'default'; +/** + * Contains tasks to load and instantiate + * + * @var array + * @access public + */ + var $tasks = array('DbConfig'); +/** + * Override startup of the Shell + * + * @access public + */ + function startup() { + $this->dataSource = 'default'; + + if (isset($this->params['datasource'])) { + $this->dataSource = $this->params['datasource']; + } + + if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) { + $out = "--------------------------------------------------\n"; + $out .= __("Error: Your current Cake configuration is set to", true) . "\n"; + $out .= __("an ACL implementation other than DB. Please change", true) . "\n"; + $out .= __("your core config to reflect your decision to use", true) . "\n"; + $out .= __("DbAcl before attempting to use this script", true) . ".\n"; + $out .= "--------------------------------------------------\n"; + $out .= sprintf(__("Current ACL Classname: %s", true), Configure::read('Acl.classname')) . "\n"; + $out .= "--------------------------------------------------\n"; + $this->err($out); + $this->stop(); + } + + if ($this->command && !in_array($this->command, array('help'))) { + if (!config('database')) { + $this->out(__("Your database configuration was not found. Take a moment to create one.", true), true); + $this->args = null; + return $this->DbConfig->execute(); + } + require_once (CONFIGS.'database.php'); + + if (!in_array($this->command, array('initdb'))) { + $this->Acl = new AclComponent(); + $controller = null; + $this->Acl->startup($controller); + } + } + } +/** + * Override main() for help message hook + * + * @access public + */ + function main() { + $out = __("Available ACL commands:", true) . "\n"; + $out .= "\t - create\n"; + $out .= "\t - delete\n"; + $out .= "\t - setParent\n"; + $out .= "\t - getPath\n"; + $out .= "\t - check\n"; + $out .= "\t - grant\n"; + $out .= "\t - deny\n"; + $out .= "\t - inherit\n"; + $out .= "\t - view\n"; + $out .= "\t - initdb\n"; + $out .= "\t - help\n\n"; + $out .= __("For help, run the 'help' command. For help on a specific command, run 'help '", true); + $this->out($out); + } +/** + * Creates an ARO/ACO node + * + * @access public + */ + function create() { + + $this->_checkArgs(3, 'create'); + $this->checkNodeType(); + extract($this->__dataVars()); + + $class = ucfirst($this->args[0]); + $object = new $class(); + + if (preg_match('/^([\w]+)\.(.*)$/', $this->args[1], $matches) && count($matches) == 3) { + $parent = array( + 'model' => $matches[1], + 'foreign_key' => $matches[2], + ); + } else { + $parent = $this->args[1]; + } + + if (!empty($parent) && $parent != '/' && $parent != 'root') { + @$parent = $object->node($parent); + if (empty($parent)) { + $this->err(sprintf(__('Could not find parent node using reference "%s"', true), $this->args[1])); + return; + } else { + $parent = Set::extract($parent, "0.{$class}.id"); + } + } else { + $parent = null; + } + + if (preg_match('/^([\w]+)\.(.*)$/', $this->args[2], $matches) && count($matches) == 3) { + $data = array( + 'model' => $matches[1], + 'foreign_key' => $matches[2], + ); + } else { + if (!($this->args[2] == '/')) { + $data = array('alias' => $this->args[2]); + } else { + $this->error(__('/ can not be used as an alias!', true), __('\t/ is the root, please supply a sub alias', true)); + } + } + + $data['parent_id'] = $parent; + $object->create(); + + if ($object->save($data)) { + $this->out(sprintf(__("New %s '%s' created.\n", true), $class, $this->args[2]), true); + } else { + $this->err(sprintf(__("There was a problem creating a new %s '%s'.", true), $class, $this->args[2])); + } + } +/** + * Delete an ARO/ACO node. + * + * @access public + */ + function delete() { + $this->_checkArgs(2, 'delete'); + $this->checkNodeType(); + extract($this->__dataVars()); + if (!$this->Acl->{$class}->delete($this->args[1])) { + $this->error(__("Node Not Deleted", true), sprintf(__("There was an error deleting the %s. Check that the node exists", true), $class) . ".\n"); + } + $this->out(sprintf(__("%s deleted", true), $class) . ".\n", true); + } + +/** + * Set parent for an ARO/ACO node. + * + * @access public + */ + function setParent() { + $this->_checkArgs(3, 'setParent'); + $this->checkNodeType(); + extract($this->__dataVars()); + $data = array( + $class => array( + 'id' => $this->args[1], + 'parent_id' => $this->args[2] + ) + ); + $this->Acl->{$class}->create(); + if (!$this->Acl->{$class}->save($data)) { + $this->out(__("Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.", true), true); + } else { + $this->out(sprintf(__("Node parent set to %s", true), $this->args[2]) . "\n", true); + } + } +/** + * Get path to specified ARO/ACO node. + * + * @access public + */ + function getPath() { + $this->_checkArgs(2, 'getPath'); + $this->checkNodeType(); + extract($this->__dataVars()); + $id = ife(is_numeric($this->args[1]), intval($this->args[1]), $this->args[1]); + $nodes = $this->Acl->{$class}->getPath($id); + if (empty($nodes)) { + $this->error(sprintf(__("Supplied Node '%s' not found", true), $this->args[1]), __("No tree returned.", true)); + } + for ($i = 0; $i < count($nodes); $i++) { + $this->out(str_repeat(' ', $i) . "[" . $nodes[$i][$class]['id'] . "]" . $nodes[$i][$class]['alias'] . "\n"); + } + } +/** + * Check permission for a given ARO to a given ACO. + * + * @access public + */ + function check() { + $this->_checkArgs(3, 'check'); + extract($this->__getParams()); + + if ($this->Acl->check($aro, $aco, $action)) { + $this->out(sprintf(__("%s is allowed.", true), $aro), true); + } else { + $this->out(sprintf(__("%s is not allowed.", true), $aro), true); + } + } +/** + * Grant permission for a given ARO to a given ACO. + * + * @access public + */ + function grant() { + $this->_checkArgs(3, 'grant'); + extract($this->__getParams()); + + if ($this->Acl->allow($aro, $aco, $action)) { + $this->out(__("Permission granted.", true), true); + } else { + $this->out(__("Permission was not granted.", true), true); + } + } +/** + * Deny access for an ARO to an ACO. + * + * @access public + */ + function deny() { + $this->_checkArgs(3, 'deny'); + extract($this->__getParams()); + + if ($this->Acl->deny($aro, $aco, $action)) { + $this->out(__("Permission denied.", true), true); + } else { + $this->out(__("Permission was not denied.", true), true); + } + } +/** + * Set an ARO to inhermit permission to an ACO. + * + * @access public + */ + function inherit() { + $this->_checkArgs(3, 'inherit'); + extract($this->__getParams()); + + if ($this->Acl->inherit($aro, $aco, $action)) { + $this->out(__("Permission inherited.", true), true); + } else { + $this->out(__("Permission was not inherited.", true), true); + } + } +/** + * Show a specific ARO/ACO node. + * + * @access public + */ + function view() { + $this->_checkArgs(1, 'view'); + $this->checkNodeType(); + extract($this->__dataVars()); + if (isset($this->args[1]) && !is_null($this->args[1])) { + $key = ife(is_numeric($this->args[1]), $secondary_id, 'alias'); + $conditions = array($class . '.' . $key => $this->args[1]); + } else { + $conditions = null; + } + $nodes = $this->Acl->{$class}->find('all', array('conditions' => $conditions, 'order' => 'lft ASC')); + if (empty($nodes)) { + if (isset($this->args[1])) { + $this->error(sprintf(__("%s not found", true), $this->args[1]), __("No tree returned.", true)); + } elseif (isset($this->args[0])) { + $this->error(sprintf(__("%s not found", true), $this->args[0]), __("No tree returned.", true)); + } + } + $this->out($class . " tree:"); + $this->hr(); + $stack = array(); + $last = null; + foreach ($nodes as $n) { + $stack[] = $n; + if (!empty($last)) { + $end = end($stack); + if ($end[$class]['rght'] > $last) { + foreach ($stack as $k => $v) { + $end = end($stack); + if ($v[$class]['rght'] < $end[$class]['rght']) { + unset($stack[$k]); + } + } + } + } + $last = $n[$class]['rght']; + $count = count($stack); + $this->out(str_repeat(' ', $count) . "[" . $n[$class]['id'] . "]" . $n[$class]['alias']."\n"); + } + $this->hr(); + } +/** + * Initialize ACL database. + * + * @access public + */ + function initdb() { + $this->Dispatch->args = array('schema', 'run', 'create', 'DbAcl'); + $this->Dispatch->dispatch(); + } +/** + * Show help screen. + * + * @access public + */ + function help() { + $head = __("Usage: cake acl ...", true) . "\n"; + $head .= "-----------------------------------------------\n"; + $head .= __("Commands:", true) . "\n\n"; + + $commands = array( + 'create' => "\tcreate aro|aco \n" . + "\t\t" . __("Creates a new ACL object under the parent specified by , an id/alias.", true) . "\n" . + "\t\t" . __("The and references can be in one of the following formats:", true) . "\n" . + "\t\t\t- " . __(". - The node will be bound to a specific record of the given model", true) . "\n" . + "\t\t\t- " . __(" - The node will be given a string alias (or path, in the case of ),", true) . "\n" . + "\t\t\t " . __("i.e. 'John'. When used with , this takes the form of an alias path,", true) . "\n" . + "\t\t\t " . __("i.e. //.", true) . "\n" . + "\t\t" . __("To add a node at the root level, enter 'root' or '/' as the parameter.", true) . "\n", + + 'delete' => "\tdelete aro|aco \n" . + "\t\t" . __("Deletes the ACL object with the given reference (see 'create' for info on node references).", true) . "\n", + + 'setparent' => "\tsetParent aro|aco \n" . + "\t\t" . __("Moves the ACL object specified by beneath the parent ACL object specified by .", true) . "\n" . + "\t\t" . __("To identify the node and parent, use the row id.", true) . "\n", + + 'getpath' => "\tgetPath aro|aco \n" . + "\t\t" . __("Returns the path to the ACL object specified by . This command", true) . "\n" . + "\t\t" . __("is useful in determining the inhertiance of permissions for a certain", true) . "\n" . + "\t\t" . __("object in the tree.", true) . "\n" . + "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + + 'check' => "\tcheck [] " . __("or", true) . " all\n" . + "\t\t" . __("Use this command to check ACL permissions.", true) . "\n" . + "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + + 'grant' => "\tgrant [] " . __("or", true) . " all\n" . + "\t\t" . __("Use this command to grant ACL permissions. Once executed, the ARO", true) . "\n" . + "\t\t" . __("specified (and its children, if any) will have ALLOW access to the", true) . "\n" . + "\t\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" . + "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + + 'deny' => "\tdeny []" . __("or", true) . " all\n" . + "\t\t" . __("Use this command to deny ACL permissions. Once executed, the ARO", true) . "\n" . + "\t\t" . __("specified (and its children, if any) will have DENY access to the", true) . "\n" . + "\t\t" . __("specified ACO action (and the ACO's children, if any).", true) . "\n" . + "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + + 'inherit' => "\tinherit []" . __("or", true) . " all\n" . + "\t\t" . __("Use this command to force a child ARO object to inherit its", true) . "\n" . + "\t\t" . __("permissions settings from its parent.", true) . "\n" . + "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + + 'view' => "\tview aro|aco []\n" . + "\t\t" . __("The view command will return the ARO or ACO tree. The optional", true) . "\n" . + "\t\t" . __("id/alias parameter allows you to return only a portion of the requested tree.", true) . "\n" . + "\t\t" . __("For more detailed parameter usage info, see help for the 'create' command.", true) . "\n", + + 'initdb' => "\tinitdb\n". + "\t\t" . __("Uses this command : cake schema run create DbAcl", true) . "\n", + + 'help' => "\thelp []\n" . + "\t\t" . __("Displays this help message, or a message on a specific command.", true) . "\n" + ); + + $this->out($head); + if (!isset($this->args[0])) { + foreach ($commands as $cmd) { + $this->out("{$cmd}\n\n"); + } + } elseif (isset($commands[low($this->args[0])])) { + $this->out($commands[low($this->args[0])] . "\n\n"); + } else { + $this->out(sprintf(__("Command '%s' not found", true), $this->args[0])); + } + } +/** + * Check that first argument specifies a valid Node type (ARO/ACO) + * + * @access public + */ + function checkNodeType() { + if (!isset($this->args[0])) { + return false; + } + if ($this->args[0] != 'aco' && $this->args[0] != 'aro') { + $this->error(sprintf(__("Missing/Unknown node type: '%s'", true), $this->args[1]), __('Please specify which ACL object type you wish to create.', true)); + } + } +/** + * Checks that given node exists + * + * @param string $type Node type (ARO/ACO) + * @param integer $id Node id + * @return boolean Success + * @access public + */ + function nodeExists() { + if (!$this->checkNodeType() && !isset($this->args[1])) { + return false; + } + extract($this->__dataVars($this->args[0])); + $key = (ife(is_numeric($this->args[1]), $secondary_id, 'alias')); + $conditions = array($class . '.' . $key => $this->args[1]); + $possibility = $this->Acl->{$class}->find('all', compact('conditions')); + if (empty($possibility)) { + $this->error(sprintf(__("%s not found", true), $this->args[1]), __("No tree returned.", true)); + } + return $possibility; + } +/** + * get params for standard Acl methods + * + * @return array aro, aco, action + * @access private + */ + function __getParams() { + $aro = ife(is_numeric($this->args[0]), intval($this->args[0]), $this->args[0]); + $aco = ife(is_numeric($this->args[1]), intval($this->args[1]), $this->args[1]); + + if (is_string($aro) && preg_match('/^([\w]+)\.(.*)$/', $aro, $matches)) { + $aro = array( + 'model' => $matches[1], + 'foreign_key' => $matches[2], + ); + } + + if (is_string($aco) && preg_match('/^([\w]+)\.(.*)$/', $aco, $matches)) { + $aco = array( + 'model' => $matches[1], + 'foreign_key' => $matches[2], + ); + } + + $action = null; + if (isset($this->args[2])) { + $action = $this->args[2]; + if ($action == '' || $action == 'all') { + $action = '*'; + } + } + return compact('aro', 'aco', 'action'); + } + +/** + * Build data parameters based on node type + * + * @param string $type Node type (ARO/ACO) + * @return array Variables + * @access private + */ + function __dataVars($type = null) { + if ($type == null) { + $type = $this->args[0]; + } + $vars = array(); + $class = ucwords($type); + $vars['secondary_id'] = ife(strtolower($class) == 'aro', 'foreign_key', 'object_id'); + $vars['data_name'] = $type; + $vars['table_name'] = $type . 's'; + $vars['class'] = $class; + return $vars; + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/api.php b/cake/console/libs/api.php new file mode 100644 index 000000000..8e66b76e1 --- /dev/null +++ b/cake/console/libs/api.php @@ -0,0 +1,218 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ + +/** + * API shell to show method signatures of CakePHP core classes. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class ApiShell extends Shell { +/** + * Map between short name for paths and real paths. + * + * @var array + * @access public + */ + var $paths = array(); +/** + * Override intialize of the Shell + * + * @access public + */ + function initialize () { + $this->paths = array_merge($this->paths, array( + 'behavior' => LIBS . 'model' . DS . 'behaviors' . DS, + 'cache' => LIBS . 'cache' . DS, + 'controller' => LIBS . 'controller' . DS, + 'component' => LIBS . 'controller' . DS . 'components' . DS, + 'helper' => LIBS . 'view' . DS . 'helpers' . DS, + 'model' => LIBS . 'model' . DS, + 'view' => LIBS . 'view' . DS, + 'core' => LIBS + )); + } +/** + * Override main() to handle action + * + * @access public + */ + function main() { + if (empty($this->args)) { + return $this->help(); + } + + $type = low($this->args[0]); + + if (isset($this->paths[$type])) { + $path = $this->paths[$type]; + } else { + $path = $this->paths['core']; + } + + if (count($this->args) == 1) { + $file = $type; + $class = Inflector::camelize($type); + } elseif (count($this->args) > 1) { + $file = Inflector::underscore($this->args[1]); + $class = Inflector::camelize($file); + } + + $objects = Configure::listObjects('class', $path); + if (in_array($class, $objects)) { + if (in_array($type, array('behavior', 'component', 'helper')) && $type !== $file) { + if (!preg_match('/' . Inflector::camelize($type) . '$/', $class)) { + $class .= Inflector::camelize($type); + } + } + + } else { + $this->err(sprintf(__("%s not found", true), $class)); + $this->stop(); + } + + $parsed = $this->__parseClass($path . $file .'.php'); + + if (!empty($parsed)) { + if (isset($this->params['m'])) { + if (!isset($parsed[$this->params['m']])) { + $this->err(sprintf(__("%s::%s() could not be found", true), $class, $this->params['m'])); + $this->stop(); + } + $method = $parsed[$this->params['m']]; + $this->out($class .'::'.$method['method'] . $method['parameters']); + $this->hr(); + $this->out($method['comment'], true); + } else { + $this->out(ucwords($class)); + $this->hr(); + $i = 0; + foreach ($parsed as $method) { + $list[] = ++$i . ". " . $method['method'] . $method['parameters']; + } + $this->out($list); + + $methods = array_keys($parsed); + while ($number = $this->in(__('Select a number to see the more information about a specific method. q to quit. l to list.', true), null, 'q')) { + if ($number === 'q') { + $this->out(__('Done', true)); + $this->stop(); + } + + if ($number === 'l') { + $this->out($list); + } + + if (isset($methods[--$number])) { + $method = $parsed[$methods[$number]]; + $this->hr(); + $this->out($class .'::'.$method['method'] . $method['parameters']); + $this->hr(); + $this->out($method['comment'], true); + } + } + } + } + } + +/** + * Show help for this shell. + * + * @access public + */ + function help() { + $head = "Usage: cake api [] [-m ]\n"; + $head .= "-----------------------------------------------\n"; + $head .= "Parameters:\n\n"; + + $commands = array( + 'path' => "\t\n" . + "\t\tEither a full path or type of class (model, behavior, controller, component, view, helper).\n". + "\t\tAvailable values:\n\n". + "\t\tbehavior\tLook for class in CakePHP behavior path\n". + "\t\tcache\tLook for class in CakePHP cache path\n". + "\t\tcontroller\tLook for class in CakePHP controller path\n". + "\t\tcomponent\tLook for class in CakePHP component path\n". + "\t\thelper\tLook for class in CakePHP helper path\n". + "\t\tmodel\tLook for class in CakePHP model path\n". + "\t\tview\tLook for class in CakePHP view path\n", + 'className' => "\t\n" . + "\t\tA CakePHP core class name (e.g: Component, HtmlHelper).\n" + ); + + $this->out($head); + if (!isset($this->args[1])) { + foreach ($commands as $cmd) { + $this->out("{$cmd}\n\n"); + } + } elseif (isset($commands[low($this->args[1])])) { + $this->out($commands[low($this->args[1])] . "\n\n"); + } else { + $this->out("Command '" . $this->args[1] . "' not found"); + } + } + +/** + * Parse a given class (located on given file) and get public methods and their + * signatures. + * + * @param object $File File object + * @param string $class Class name + * @return array Methods and signatures indexed by method name + * @access private + */ + function __parseClass($path) { + $parsed = array(); + + $File = new File($path); + if (!$File->exists()) { + $this->err(sprintf(__("%s could not be found", true), $File->name)); + $this->stop(); + } + + $contents = $File->read(); + + if (preg_match_all('%(/\\*\\*[\\s\\S]*?\\*/)(\\s+function\\s+\\w+)(\\(.+\\))%', $contents, $result, PREG_PATTERN_ORDER)) { + foreach($result[2] as $key => $method) { + $method = str_replace('function ', '', trim($method)); + + if (strpos($method, '__') === false && $method[0] != '_') { + $parsed[$method] = array( + 'comment' => r(array('/*', '*/', '*'), '', trim($result[1][$key])), + 'method' => $method, + 'parameters' => trim($result[3][$key]), + ); + } + } + } + ksort($parsed); + return $parsed; + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php new file mode 100644 index 000000000..16e57027c --- /dev/null +++ b/cake/console/libs/bake.php @@ -0,0 +1,211 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Bake is a command-line code generation utility for automating programmer chores. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class BakeShell extends Shell { +/** + * Contains tasks to load and instantiate + * + * @var array + * @access public + */ + var $tasks = array('Project', 'DbConfig', 'Model', 'Controller', 'View', 'Plugin', 'Test'); +/** + * Override loadTasks() to handle paths + * + * @access public + */ + function loadTasks() { + parent::loadTasks(); + $task = Inflector::classify($this->command); + if (isset($this->{$task}) && !in_array($task, array('Project', 'DbConfig'))) { + $path = Inflector::underscore(Inflector::pluralize($this->command)); + $this->{$task}->path = $this->params['working'] . DS . $path . DS; + if (!is_dir($this->{$task}->path)) { + $this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path)); + $this->stop(); + } + } + } +/** + * Override main() to handle action + * + * @access public + */ + function main() { + if (!is_dir($this->DbConfig->path)) { + if ($this->Project->execute()) { + $this->DbConfig->path = $this->params['working'] . DS . 'config' . DS; + } + } + + if (!config('database')) { + $this->out(__("Your database configuration was not found. Take a moment to create one.", true)); + $this->args = null; + return $this->DbConfig->execute(); + } + $this->out('Interactive Bake Shell'); + $this->hr(); + $this->out('[D]atabase Configuration'); + $this->out('[M]odel'); + $this->out('[V]iew'); + $this->out('[C]ontroller'); + $this->out('[P]roject'); + $this->out('[Q]uit'); + + $classToBake = strtoupper($this->in(__('What would you like to Bake?', true), array('D', 'M', 'V', 'C', 'P', 'Q'))); + switch($classToBake) { + case 'D': + $this->DbConfig->execute(); + break; + case 'M': + $this->Model->execute(); + break; + case 'V': + $this->View->execute(); + break; + case 'C': + $this->Controller->execute(); + break; + case 'P': + $this->Project->execute(); + break; + case 'Q': + exit(0); + break; + default: + $this->out(__('You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, or C.', true)); + } + $this->hr(); + $this->main(); + } +/** + * Quickly bake the MVC + * + * @access public + */ + function all() { + $ds = 'default'; + $this->hr(); + $this->out('Bake All'); + $this->hr(); + + if (isset($this->params['connection'])) { + $ds = $this->params['connection']; + } + + if (empty($this->args)) { + $name = $this->Model->getName($ds); + } + + if (!empty($this->args[0])) { + $name = $this->args[0]; + $this->Model->listAll($ds, false); + } + + $modelExists = false; + $model = $this->_modelName($name); + if (App::import('Model', $model)) { + $object = new $model(); + $modelExists = true; + } else { + App::import('Model'); + $object = new Model(array('name' => $name, 'ds' => $ds)); + } + + $modelBaked = $this->Model->bake($object, false); + + if ($modelBaked && $modelExists === false) { + $this->out(sprintf(__('%s Model was baked.', true), $model)); + if ($this->_checkUnitTest()) { + $this->Model->bakeTest($model); + } + $modelExists = true; + } + + if ($modelExists === true) { + $controller = $this->_controllerName($name); + if ($this->Controller->bake($controller, $this->Controller->bakeActions($controller))) { + $this->out(sprintf(__('%s Controller was baked.', true), $name)); + if ($this->_checkUnitTest()) { + $this->Controller->bakeTest($controller); + } + } + if (App::import('Controller', $controller)) { + $this->View->args = array($controller); + $this->View->execute(); + } + $this->out(__('Bake All complete')); + } else { + $this->err(__('Bake All could not continue without a valid model', true)); + } + + if (empty($this->args)) { + $this->all(); + } + $this->stop(); + } + +/** + * Displays help contents + * + * @access public + */ + function help() { + $this->out('CakePHP Bake:'); + $this->hr(); + $this->out('The Bake script generates controllers, views and models for your application.'); + $this->out('If run with no command line arguments, Bake guides the user through the class'); + $this->out('creation process. You can customize the generation process by telling Bake'); + $this->out('where different parts of your application are using command line arguments.'); + $this->hr(); + $this->out("Usage: cake bake ..."); + $this->hr(); + $this->out('Params:'); + $this->out("\t-app Absolute/Relative path to your app folder.\n"); + $this->out('Commands:'); + $this->out("\n\tbake help\n\t\tshows this help message."); + $this->out("\n\tbake all \n\t\tbakes complete MVC. optional of a Model"); + $this->out("\n\tbake project \n\t\tbakes a new app folder in the path supplied\n\t\tor in current directory if no path is specified"); + $this->out("\n\tbake plugin \n\t\tbakes a new plugin folder in the path supplied\n\t\tor in current directory if no path is specified."); + $this->out("\n\tbake db_config\n\t\tbakes a database.php file in config directory."); + $this->out("\n\tbake model\n\t\tbakes a model. run 'bake model help' for more info"); + $this->out("\n\tbake view\n\t\tbakes views. run 'bake view help' for more info"); + $this->out("\n\tbake controller\n\t\tbakes a controller. run 'bake controller help' for more info"); + $this->out(""); + + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/console.php b/cake/console/libs/console.php new file mode 100644 index 000000000..8e3ea12f5 --- /dev/null +++ b/cake/console/libs/console.php @@ -0,0 +1,305 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * @package cake + * @subpackage cake.cake.console.libs + */ +class ConsoleShell extends Shell { +/** + * Available binding types + * + * @var array + * @access public + */ + var $associations = array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany'); +/** + * Chars that describe invalid commands + * + * @var array + * @access public + */ + var $badCommandChars = array('$', ';'); +/** + * Available models + * + * @var array + * @access public + */ + var $models = array(); +/** + * Override intialize of the Shell + * + * @access public + */ + function initialize() { + require_once CAKE . 'dispatcher.php'; + $this->Dispatcher = new Dispatcher(); + $this->models = Configure::listObjects('model'); + App::import('Model', $this->models); + + foreach ($this->models as $model) { + $class = Inflector::camelize(r('.php', '', $model)); + $this->models[$model] = $class; + $this->{$class} =& new $class(); + } + $this->out('Model classes:'); + $this->out('--------------'); + + foreach ($this->models as $model) { + $this->out(" - {$model}"); + } + } +/** + * Prints the help message + * + * @access public + */ + function help() { + $this->main('help'); + } +/** + * Override main() to handle action + * + * @access public + */ + function main($command = null) { + while (true) { + if (empty($command)) { + $command = trim($this->in('')); + } + + switch($command) { + case 'help': + $this->out('Console help:'); + $this->out('-------------'); + $this->out('The interactive console is a tool for testing parts of your app before you commit code'); + $this->out(''); + $this->out('Model testing:'); + $this->out('To test model results, use the name of your model without a leading $'); + $this->out('e.g. Foo->find("all")'); + $this->out(''); + $this->out('To dynamically set associations, you can do the following:'); + $this->out("\tModelA bind ModelB"); + $this->out("where the supported assocations are hasOne, hasMany, belongsTo, hasAndBelongsToMany"); + $this->out(''); + $this->out('To dynamically remove associations, you can do the following:'); + $this->out("\t ModelA unbind ModelB"); + $this->out("where the supported associations are the same as above"); + $this->out(''); + $this->out("To save a new field in a model, you can do the following:"); + $this->out("\tModelA->save(array('foo' => 'bar', 'baz' => 0))"); + $this->out("where you are passing a hash of data to be saved in the format"); + $this->out("of field => value pairs"); + $this->out(''); + $this->out("To get column information for a model, use the following:"); + $this->out("\tModelA columns"); + $this->out("which returns a list of columns and their type"); + $this->out(''); + $this->out('Route testing:'); + $this->out('To test URLs against your app\'s route configuration, type:'); + $this->out("\tRoute "); + $this->out("where url is the path to your your action plus any query parameters, minus the"); + $this->out("application's base path"); + $this->out(''); + $this->out('To reload your routes config (config/routes.php), do the following:'); + $this->out("\tRoute reload"); + $this->out(''); + break; + case 'quit': + case 'exit': + return true; + break; + case 'models': + $this->out('Model classes:'); + $this->hr(); + foreach ($this->models as $model) { + $this->out(" - {$model}"); + } + break; + case (preg_match("/^(\w+) bind (\w+) (\w+)/", $command, $tmp) == true): + foreach ($tmp as $data) { + $data = strip_tags($data); + $data = str_replace($this->badCommandChars, "", $data); + } + + $modelA = $tmp[1]; + $association = $tmp[2]; + $modelB = $tmp[3]; + + if ($this->__isValidModel($modelA) && $this->__isValidModel($modelB) && in_array($association, $this->associations)) { + $this->{$modelA}->bindModel(array($association => array($modelB => array('className' => $modelB))), false); + $this->out("Created $association association between $modelA and $modelB"); + } else { + $this->out("Please verify you are using valid models and association types"); + } + break; + case (preg_match("/^(\w+) unbind (\w+) (\w+)/", $command, $tmp) == true): + foreach ($tmp as $data) { + $data = strip_tags($data); + $data = str_replace($this->badCommandChars, "", $data); + } + + $modelA = $tmp[1]; + $association = $tmp[2]; + $modelB = $tmp[3]; + + // Verify that there is actually an association to unbind + $currentAssociations = $this->{$modelA}->getAssociated(); + $validCurrentAssociation = false; + + foreach ($currentAssociations as $model => $currentAssociation) { + if ($model == $modelB && $association == $currentAssociation) { + $validCurrentAssociation = true; + } + } + + if ($this->__isValidModel($modelA) && $this->__isValidModel($modelB) && in_array($association, $this->associations) && $validCurrentAssociation) { + $this->{$modelA}->unbindModel(array($association => array($modelB))); + $this->out("Removed $association association between $modelA and $modelB"); + } else { + $this->out("Please verify you are using valid models, valid current association, and valid association types"); + } + break; + case (strpos($command, "->find") > 0): + // Remove any bad info + $command = strip_tags($command); + $command = str_replace($this->badCommandChars, "", $command); + + // Do we have a valid model? + list($modelToCheck, $tmp) = explode('->', $command); + + if ($this->__isValidModel($modelToCheck)) { + $findCommand = "\$data = \$this->$command;"; + @eval($findCommand); + + if (is_array($data)) { + foreach ($data as $idx => $results) { + if (is_numeric($idx)) { // findAll() output + foreach ($results as $modelName => $result) { + $this->out("$modelName"); + + foreach ($result as $field => $value) { + if (is_array($value)) { + foreach ($value as $field2 => $value2) { + $this->out("\t$field2: $value2"); + } + + $this->out(""); + } else { + $this->out("\t$field: $value"); + } + } + } + } else { // find() output + $this->out($idx); + + foreach ($results as $field => $value) { + if (is_array($value)) { + foreach ($value as $field2 => $value2) { + $this->out("\t$field2: $value2"); + } + + $this->out(""); + } else { + $this->out("\t$field: $value"); + } + } + } + } + } else { + $this->out("\nNo result set found"); + } + } else { + $this->out("$modelToCheck is not a valid model"); + } + + break; + case (strpos($command, '->save') > 0): + // Validate the model we're trying to save here + $command = strip_tags($command); + $command = str_replace($this->badCommandChars, "", $command); + list($modelToSave, $tmp) = explode("->", $command); + + if ($this->__isValidModel($modelToSave)) { + // Extract the array of data we are trying to build + list($foo, $data) = explode("->save", $command); + $badChars = array("(", ")"); + $data = str_replace($badChars, "", $data); + $saveCommand = "\$this->{$modelToSave}->save(array('{$modelToSave}' => array({$data})));"; + @eval($saveCommand); + $this->out('Saved record for ' . $modelToSave); + } + + break; + case (preg_match("/^(\w+) columns/", $command, $tmp) == true): + $modelToCheck = strip_tags(str_replace($this->badCommandChars, "", $tmp[1])); + + if ($this->__isValidModel($modelToCheck)) { + // Get the column info for this model + $fieldsCommand = "\$data = \$this->{$modelToCheck}->getColumnTypes();"; + @eval($fieldsCommand); + + if (is_array($data)) { + foreach ($data as $field => $type) { + $this->out("\t{$field}: {$type}"); + } + } + } else { + $this->out("Please verify that you selected a valid model"); + } + break; + case (preg_match("/^routes\s+reload/i", $command, $tmp) == true): + $router =& Router::getInstance(); + $router->reload(); + if (config('routes') && $router->parse('/')) { + $this->out("Routes configuration reloaded, " . count($router->routes) . " routes connected"); + } + break; + case (preg_match("/^route\s+(.*)/i", $command, $tmp) == true): + $this->out(Debugger::exportVar(Router::parse($tmp[1]))); + break; + default: + $this->out("Invalid command\n"); + break; + } + $command = ''; + } + } +/** + * Tells if the specified model is included in the list of available models + * + * @param string $modelToCheck + * @return boolean true if is an available model, false otherwise + * @access private + */ + function __isValidModel($modelToCheck) { + return in_array($modelToCheck, $this->models); + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/i18n.php b/cake/console/libs/i18n.php new file mode 100644 index 000000000..2dddf8e97 --- /dev/null +++ b/cake/console/libs/i18n.php @@ -0,0 +1,133 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5669 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Shell for I18N management. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class I18nShell extends Shell { +/** + * Contains database source to use + * + * @var string + * @access public + */ + var $dataSource = 'default'; +/** + * Contains tasks to load and instantiate + * + * @var array + * @access public + */ + var $tasks = array('DbConfig', 'Extract'); + +/** + * Override startup of the Shell + * + * @access public + */ + function startup() { + + if (isset($this->params['datasource'])) { + $this->dataSource = $this->params['datasource']; + } + + if ($this->command && !in_array($this->command, array('help'))) { + if (!config('database')) { + $this->out(__('Your database configuration was not found. Take a moment to create one.', true), true); + return $this->DbConfig->execute(); + } + } + } +/** + * Override main() for help message hook + * + * @access public + */ + function main() { + $this->out(__('I18n Shell', true)); + $this->hr(); + $this->out(__('[E]xtract POT file from sources', true)); + $this->out(__('[I]nitialize i18n database table', true)); + $this->out(__('[H]elp', true)); + $this->out(__('[Q]uit', true)); + + $choice = strtoupper($this->in(__('What would you like to do?', true), array('E', 'I', 'H', 'Q'))); + switch($choice) { + case 'E': + $this->Extract->execute(); + break; + case 'I': + $this->initdb(); + break; + case 'H': + $this->help(); + break; + case 'Q': + exit(0); + break; + default: + $this->out(__('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.', true)); + } + $this->hr(); + $this->main(); + } +/** + * Initialize I18N database. + * + * @access public + */ + function initdb() { + $this->Dispatch->args = array('schema', 'run', 'create', 'i18n'); + $this->Dispatch->dispatch(); + } +/** + * Show help screen. + * + * @access public + */ + function help() { + $this->hr(); + $this->out(__('I18n Shell:', true)); + $this->hr(); + $this->out(__('I18n Shell initializes i18n database table for your application', true)); + $this->out(__('and generates .pot file(s) with translations.', true)); + $this->hr(); + $this->out(__('usage:', true)); + $this->out(' cake i18n help'); + $this->out(' cake i18n initdb [-datasource custom]'); + $this->out(''); + $this->hr(); + + $this->Extract->help(); + } +} + +?> \ No newline at end of file diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php new file mode 100644 index 000000000..12fc2735d --- /dev/null +++ b/cake/console/libs/schema.php @@ -0,0 +1,401 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5550 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('File'); +App::import('Model', 'Schema'); +/** + * Schema is a command-line database management utility for automating programmer chores. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class SchemaShell extends Shell { +/** + * is this a dry run? + * + * @var boolean + * @access private + */ + var $__dry = null; +/** + * Override initialize + * + * @access public + */ + function initialize() { + $this->out('Cake Schema Shell'); + $this->hr(); + } +/** + * Override startup + * + * @access public + */ + function startup() { + $name = null; + if (!empty($this->params['name'])) { + $name = $this->params['name']; + } + $path = null; + if (!empty($this->params['path'])) { + $path = $this->params['path']; + } + $file = null; + if (!empty($this->params['file'])) { + $file = $this->params['file']; + } + $connection = null; + if (!empty($this->params['connection'])) { + $connection = $this->params['connection']; + } + $this->Schema =& new CakeSchema(compact('name', 'path', 'file', 'connection')); + } +/** + * Override main + * + * @access public + */ + function main() { + $this->help(); + } +/** + * Read and output contents od schema object + * path to read as second arg + * + * @access public + */ + function view() { + $File = new File($this->Schema->path . DS .'schema.php'); + if ($File->exists()) { + $this->out($File->read()); + $this->stop(); + } else { + $this->err(__('Schema could not be found', true)); + $this->stop(); + } + } +/** + * Read database and Write schema object + * accepts a connection as first arg or path to save as second arg + * + * @access public + */ + function generate() { + $this->out('Generating Schema...'); + $options = array(); + if (isset($this->params['f'])) { + $options = array('models' => false); + } + + $snapshot = false; + if (isset($this->args[0]) && $this->args[0] === 'snapshot') { + $snapshot = true; + } + + if (!$snapshot && file_exists($this->Schema->path . DS . 'schema.php')) { + $snapshot = true; + $result = $this->in("Schema file exists.\n [O]verwrite\n [S]napshot\n [Q]uit\nWould you like to do?", array('o', 's', 'q'), 's'); + if ($result === 'q') { + $this->stop(); + } + if ($result === 'o') { + $snapshot = false; + } + } + + $content = $this->Schema->read($options); + $content['file'] = 'schema.php'; + + if ($snapshot === true) { + $Folder =& new Folder($this->Schema->path); + $result = $Folder->read(); + $count = 1; + if (!empty($result[1])) { + foreach ($result[1] as $file) { + if (preg_match('/schema/', $file)) { + $count++; + } + } + } + $content['file'] = 'schema_'.$count.'.php'; + } + + if ($this->Schema->write($content)) { + $this->out(sprintf(__('Schema file: %s generated', true), $content['file'])); + $this->stop(); + } else { + $this->err(__('Schema file: %s generated', true)); + $this->stop(); + } + } +/** + * Dump Schema object to sql file + * if first arg == write, file will be written to sql file + * or it will output sql + * + * @access public + */ + function dump() { + $write = false; + $Schema = $this->Schema->load(); + if (!$Schema) { + $this->err(__('Schema could not be loaded', true)); + $this->stop(); + } + if (!empty($this->args[0])) { + if ($this->args[0] == 'true') { + $write = Inflector::underscore($this->Schema->name); + } else { + $write = $this->args[0]; + } + } + $db =& ConnectionManager::getDataSource($this->Schema->connection); + $contents = "#". $Schema->name ." sql generated on: " . date('Y-m-d H:m:s') . " : ". time()."\n\n"; + $contents .= $db->dropSchema($Schema) . "\n\n". $db->createSchema($Schema); + if ($write) { + if (strpos($write, '.sql') === false) { + $write .= '.sql'; + } + $File = new File($this->Schema->path . DS . $write, true); + if ($File->write($contents)) { + $this->out(sprintf(__('SQL dump file created in %s', true), $File->pwd())); + $this->stop(); + } else { + $this->err(__('SQL dump could not be created', true)); + $this->stop(); + } + } + $this->out($contents); + return $contents; + } +/** + * Run database commands: create, update + * + * @access public + */ + function run() { + if (!isset($this->args[0])) { + $this->err('command not found'); + $this->stop(); + } + + $command = $this->args[0]; + + $this->Dispatch->shiftArgs(); + + $name = null; + if (isset($this->args[0])) { + $name = $this->args[0]; + } + + if (isset($this->params['dry'])) { + $this->__dry = true; + $this->out(__('Performing a dry run.', true)); + } + + $options = array('name' => $name, 'file' => $this->Schema->file); + if (isset($this->params['s'])) { + $options = array('file' => 'schema_'.$this->params['s'].'.php'); + } + + $Schema = $this->Schema->load($options); + + if (!$Schema) { + $this->err(sprintf(__('%s could not be loaded', true), $this->Schema->file)); + $this->stop(); + } + + $table = null; + if (isset($this->args[1])) { + $table = $this->args[1]; + } + + switch($command) { + case 'create': + $this->__create($Schema, $table); + break; + case 'update': + $this->__update($Schema, $table); + break; + default: + $this->err(__('command not found', true)); + $this->stop(); + } + } +/** + * Create database from Schema object + * Should be called via the run method + * + * @access private + */ + function __create($Schema, $table = null) { + $db =& ConnectionManager::getDataSource($this->Schema->connection); + + $drop = $create = array(); + + if (!$table) { + foreach ($Schema->tables as $table => $fields) { + $drop[$table] = $db->dropSchema($Schema, $table); + $create[$table] = $db->createSchema($Schema, $table); + } + } elseif (isset($Schema->tables[$table])) { + $drop[$table] = $db->dropSchema($Schema, $table); + $create[$table] = $db->createSchema($Schema, $table); + } + if (empty($drop) || empty($create)) { + $this->out(__('Schema is up to date.', true)); + $this->stop(); + } + + $this->out("\n" . __('The following tables will be dropped.', true)); + $this->out(array_keys($drop)); + + if ('y' == $this->in(__('Are you sure you want to drop the tables?', true), array('y', 'n'), 'n')) { + $this->out('Dropping tables.'); + $this->__run($drop, 'drop'); + } + + $this->out("\n" . __('The following tables will be created.', true)); + $this->out(array_keys($create)); + + if ('y' == $this->in(__('Are you sure you want to create the tables?', true), array('y', 'n'), 'y')) { + $this->out('Creating tables.'); + $this->__run($create, 'create'); + } + + $this->out(__('End create.', true)); + } +/** + * Update database with Schema object + * Should be called via the run method + * + * @access private + */ + function __update($Schema, $table = null) { + $db =& ConnectionManager::getDataSource($this->Schema->connection); + + $this->out('Comparing Database to Schema...'); + $Old = $this->Schema->read(); + $compare = $this->Schema->compare($Old, $Schema); + + $contents = array(); + + if (empty($table)) { + foreach ($compare as $table => $changes) { + $contents[$table] = $db->alterSchema(array($table => $changes), $table); + } + } elseif (isset($compare[$table])) { + $contents[$table] = $db->alterSchema(array($table => $compare[$table]), $table); + } + + if (empty($contents)) { + $this->out(__('Schema is up to date.', true)); + $this->stop(); + } + + $this->out("\n" . __('The following statements will run.', true)); + $this->out(array_map('trim', $contents)); + if ('y' == $this->in(__('Are you sure you want to alter the tables?', true), array('y', 'n'), 'n')) { + $this->out(''); + $this->out(__('Updating Database...', true)); + $this->__run($contents, 'update'); + } + + $this->out(__('End update.', true)); + } +/** + * runs sql from __create() or __update() + * + * @access private + */ + function __run($contents, $event) { + if (empty($contents)) { + $this->err(__('Sql could not be run', true)); + return; + } + Configure::write('debug', 2); + $db =& ConnectionManager::getDataSource($this->Schema->connection); + $db->fullDebug = true; + + $errors = array(); + foreach($contents as $table => $sql) { + if (empty($sql)) { + $this->out(sprintf(__('%s is up to date.', true), $table)); + } else { + if ($this->__dry === true) { + $this->out(sprintf(__('Dry run for %s :', true), $table)); + $this->out($sql); + } else { + if (!$this->Schema->before(array($event => $table))) { + return false; + } + if (!$db->_execute($sql)) { + $error = $db->lastError(); + } + + $this->Schema->after(array($event => $table, 'errors'=> $errors)); + + if (isset($error)) { + $this->out($errors); + } elseif ($this->__dry !== true) { + $this->out(sprintf(__('%s updated.', true), $table)); + } + } + } + } + } +/** + * Displays help contents + * + * @access public + */ + function help() { + $this->out("The Schema Shell generates a schema object from \n\t\tthe database and updates the database from the schema."); + $this->hr(); + $this->out("Usage: cake schema ..."); + $this->hr(); + $this->out('Params:'); + $this->out("\n\t-connection \n\t\tset db config . uses 'default' if none is specified"); + $this->out("\n\t-path \n\t\tpath to read and write schema.php.\n\t\tdefault path: ". $this->Schema->path); + $this->out("\n\t-file \n\t\tfile to read and write.\n\t\tdefault file: ". $this->Schema->file); + $this->out("\n\t-s \n\t\tsnapshot to use for run."); + $this->out("\n\t-dry\n\t\tPerform a dry run on 'run' commands.\n\t\tQueries will be output to window instead of executed."); + $this->out("\n\t-f\n\t\tforce 'generate' to create a new schema."); + $this->out('Commands:'); + $this->out("\n\tschema help\n\t\tshows this help message."); + $this->out("\n\tschema view\n\t\tread and output contents of schema file"); + $this->out("\n\tschema generate\n\t\treads from 'connection' writes to 'path'\n\t\tTo force genaration of all tables into the schema, use the -f param."); + $this->out("\n\tschema dump \n\t\tdump database sql based on schema file to filename in schema path. \n\t\tif filename is true, default will use the app directory name."); + $this->out("\n\tschema run create \n\t\tdrop tables and create database based on schema file\n\t\toptional arg for selecting schema name\n\t\toptional
arg for creating only one table\n\t\tpass the -s param with a number to use a snapshot\n\t\tTo see the changes, perform a dry run with the -dry param"); + $this->out("\n\tschema run update
\n\t\talter tables based on schema file\n\t\toptional arg for selecting schema name.\n\t\toptional
arg for altering only one table.\n\t\tTo use a snapshot, pass the -s param with the snapshot number\n\t\tTo see the changes, perform a dry run with the -dry param"); + $this->out(""); + $this->stop(); + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php new file mode 100644 index 000000000..7cceaeab4 --- /dev/null +++ b/cake/console/libs/shell.php @@ -0,0 +1,608 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Base class for command-line utilities for automating programmer chores. + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class Shell extends Object { +/** + * An instance of the ShellDispatcher object that loaded this script + * + * @var object + * @access public + */ + var $Dispatch = null; +/** + * If true, the script will ask for permission to perform actions. + * + * @var boolean + * @access public + */ + var $interactive = true; +/** + * Holds the DATABASE_CONFIG object for the app. Null if database.php could not be found, + * or the app does not exist. + * + * @var object + * @access public + */ + var $DbConfig = null; +/** + * Contains command switches parsed from the command line. + * + * @var array + * @access public + */ + var $params = array(); +/** + * Contains arguments parsed from the command line. + * + * @var array + * @access public + */ + var $args = array(); +/** + * The file name of the shell that was invoked. + * + * @var string + * @access public + */ + var $shell = null; +/** + * The class name of the shell that was invoked. + * + * @var string + * @access public + */ + var $className = null; +/** + * The command called if public methods are available. + * + * @var string + * @access public + */ + var $command = null; +/** + * The name of the shell in camelized. + * + * @var string + * @access public + */ + var $name = null; +/** + * Contains tasks to load and instantiate + * + * @var array + * @access public + */ + var $tasks = array(); +/** + * Contains the loaded tasks + * + * @var array + * @access public + */ + var $taskNames = array(); +/** + * Contains models to load and instantiate + * + * @var array + * @access public + */ + var $uses = array(); +/** + * Constructs this Shell instance. + * + */ + function __construct(&$dispatch) { + $vars = array('params', 'args', 'shell', 'shellCommand'=> 'command'); + foreach ($vars as $key => $var) { + if (is_string($key)) { + $this->{$var} =& $dispatch->{$key}; + } else { + $this->{$var} =& $dispatch->{$var}; + } + } + + $this->className = get_class($this); + + if ($this->name == null) { + $this->name = str_replace(array('shell', 'Shell', 'task', 'Task'), '', $this->className); + } + + $shellKey = Inflector::underscore($this->className); + ClassRegistry::addObject($shellKey, $this); + ClassRegistry::map($shellKey, $shellKey); + + if (!PHP5 && isset($this->args[0])) { + if(strpos($this->className, low(Inflector::camelize($this->args[0]))) !== false) { + $dispatch->shiftArgs(); + } + if (low($this->command) == low(Inflector::variable($this->args[0])) && method_exists($this, $this->command)) { + $dispatch->shiftArgs(); + } + } + + $this->Dispatch =& $dispatch; + } +/** + * Initializes the Shell + * acts as constructor for subclasses + * allows configuration of tasks prior to shell execution + * + * @access public + */ + function initialize() { + $this->_loadModels(); + } +/** + * Starts up the the Shell + * allows for checking and configuring prior to command or main execution + * can be overriden in subclasses + * + * @access public + */ + function startup() { + $this->_welcome(); + } +/** + * Displays a header for the shell + * + * @access protected + */ + function _welcome() { + $this->out('App : '. $this->params['app']); + $this->out('Path: '. $this->params['working']); + $this->hr(); + } +/** + * Loads database file and constructs DATABASE_CONFIG class + * makes $this->DbConfig available to subclasses + * + * @return bool + * @access protected + */ + function _loadDbConfig() { + if (config('database') && class_exists('DATABASE_CONFIG')) { + $this->DbConfig =& new DATABASE_CONFIG(); + return true; + } + $this->err('Database config could not be loaded'); + $this->out('Run \'bake\' to create the database configuration'); + return false; + } +/** + * if var $uses = true + * Loads AppModel file and constructs AppModel class + * makes $this->AppModel available to subclasses + * if var $uses is an array of models will load those models + * + * @return bool + * @access protected + */ + function _loadModels() { + if ($this->uses === null || $this->uses === false) { + return; + } + + App::import(array( + 'model'.DS.'connection_manager', 'model'.DS.'datasources'.DS.'dbo_source', 'model'.DS.'model' + )); + + if ($this->uses === true && App::import('Model', 'AppModel')) { + $this->AppModel =& new AppModel(false, false, false); + return true; + } + + if ($this->uses !== true && !empty($this->uses)) { + $uses = is_array($this->uses) ? $this->uses : array($this->uses); + $this->modelClass = $uses[0]; + + foreach ($uses as $modelClass) { + if (PHP5) { + $this->{$modelClass} = ClassRegistry::init($modelClass); + } else { + $this->{$modelClass} =& ClassRegistry::init($modelClass); + } + } + return true; + } + return false; + } +/** + * Loads tasks defined in var $tasks + * + * @return bool + * @access public + */ + function loadTasks() { + if ($this->tasks === null || $this->tasks === false) { + return; + } + + if ($this->tasks !== true && !empty($this->tasks)) { + + $tasks = $this->tasks; + if (!is_array($tasks)) { + $tasks = array($tasks); + } + + foreach ($tasks as $taskName) { + $task = Inflector::underscore($taskName); + $taskClass = Inflector::camelize($taskName.'Task'); + $taskKey = Inflector::underscore($taskClass); + + if (!class_exists($taskClass)) { + foreach ($this->Dispatch->shellPaths as $path) { + $taskPath = $path . 'tasks' . DS . $task.'.php'; + if (file_exists($taskPath)) { + require_once $taskPath; + break; + } + } + } + if (ClassRegistry::isKeySet($taskKey)) { + $this->taskNames[] = $taskName; + if (!PHP5) { + $this->{$taskName} =& ClassRegistry::getObject($taskKey); + ClassRegistry::map($taskName, $taskKey); + } else { + $this->{$taskName} = ClassRegistry::getObject($taskKey); + ClassRegistry::map($taskName, $taskKey); + } + } else { + + $this->taskNames[] = $taskName; + if (!PHP5) { + $this->{$taskName} =& new $taskClass($this->Dispatch); + } else { + $this->{$taskName} = new $taskClass($this->Dispatch); + } + } + + if (!isset($this->{$taskName})) { + $this->err("Task '".$taskName."' could not be loaded"); + $this->stop(); + } + } + } + + return false; + } +/** + * Prompts the user for input, and returns it. + * + * @param string $prompt Prompt text. + * @param mixed $options Array or string of options. + * @param string $default Default input value. + * @return Either the default value, or the user-provided input. + * @access public + */ + function in($prompt, $options = null, $default = null) { + if (!$this->interactive) { + return $default; + } + $in = $this->Dispatch->getInput($prompt, $options, $default); + + if ($options && is_string($options)) { + if (strpos($options, ',')) { + $options = explode(',', $options); + } elseif (strpos($options, '/')) { + $options = explode('/', $options); + } else { + $options = array($options); + } + } + if (is_array($options)) { + while ($in == '' || ($in && (!in_array(low($in), $options) && !in_array(up($in), $options)) && !in_array($in, $options))) { + $in = $this->Dispatch->getInput($prompt, $options, $default); + } + } + if ($in) { + return $in; + } + } +/** + * Outputs to the stdout filehandle. + * + * @param string $string String to output. + * @param boolean $newline If true, the outputs gets an added newline. + * @access public + */ + function out($string, $newline = true) { + if (is_array($string)) { + $str = ''; + foreach($string as $message) { + $str .= $message ."\n"; + } + $string = $str; + } + return $this->Dispatch->stdout($string, $newline); + } +/** + * Outputs to the stderr filehandle. + * + * @param string $string Error text to output. + * @access public + */ + function err($string) { + if (is_array($string)) { + $str = ''; + foreach($string as $message) { + $str .= $message ."\n"; + } + $string = $str; + } + return $this->Dispatch->stderr($string."\n"); + } +/** + * Outputs a series of minus characters to the standard output, acts as a visual separator. + * + * @param boolean $newline If true, the outputs gets an added newline. + * @access public + */ + function hr($newline = false) { + if ($newline) { + $this->out("\n"); + } + $this->out('---------------------------------------------------------------'); + if ($newline) { + $this->out("\n"); + } + } +/** + * Displays a formatted error message and exits the application + * + * @param string $title Title of the error message + * @param string $msg Error message + * @access public + */ + function error($title, $msg) { + $out = "$title\n"; + $out .= "$msg\n"; + $out .= "\n"; + $this->err($out); + $this->stop(); + } +/** + * Will check the number args matches otherwise throw an error + * + * @param integer $expectedNum Expected number of paramters + * @param string $command Command + * @access protected + */ + function _checkArgs($expectedNum, $command = null) { + if (!$command) { + $command = $this->command; + } + if (count($this->args) < $expectedNum) { + $this->error("Wrong number of parameters: ".count($this->args), "Expected: {$expectedNum}\nPlease type 'cake {$this->shell} help' for help on usage of the {$this->name} {$command}"); + } + } +/** + * Creates a file at given path + * + * @param string $path Where to put the file. + * @param string $contents Content to put in the file. + * @return boolean Success + * @access public + */ + function createFile ($path, $contents) { + $path = str_replace(DS . DS, DS, $path); + $this->out("\n" . sprintf(__("Creating file %s", true), $path)); + if (is_file($path) && $this->interactive === true) { + $key = $this->in(__("File exists, overwrite?", true). " {$path}", array('y', 'n', 'q'), 'n'); + if (low($key) == 'q') { + $this->out(__("Quitting.", true) ."\n"); + exit; + } elseif (low($key) != 'y') { + $this->out(__("Skip", true) ." {$path}\n"); + return false; + } + } + if (!class_exists('File')) { + uses('file'); + } + + if ($File = new File($path, true)) { + $data = $File->prepare($contents); + $File->write($data); + $this->out(__("Wrote", true) ." {$path}"); + return true; + } else { + $this->err(__("Error! Could not write to", true)." {$path}.\n"); + return false; + } + } +/** + * Outputs usage text on the standard output. Implement it in subclasses. + * + * @access public + */ + function help() { + if ($this->command != null) { + $this->err("Unknown {$this->name} command '$this->command'.\nFor usage, try 'cake {$this->shell} help'.\n\n"); + } else { + $this->Dispatch->help(); + } + } +/** + * Action to create a Unit Test + * + * @return boolean Success + * @access protected + */ + function _checkUnitTest() { + if (is_dir(VENDORS.'simpletest') || is_dir(ROOT.DS.APP_DIR.DS.'vendors'.DS.'simpletest')) { + return true; + } + $unitTest = $this->in('Cake test suite not installed. Do you want to bake unit test files anyway?', array('y','n'), 'y'); + $result = low($unitTest) == 'y' || low($unitTest) == 'yes'; + + if ($result) { + $this->out("\nYou can download the Cake test suite from http://cakeforge.org/projects/testsuite/", true); + } + return $result; + } +/** + * Makes absolute file path easier to read + * + * @param string $file Absolute file path + * @return sting short path + * @access public + */ + function shortPath($file) { + $shortPath = str_replace(ROOT, null, $file); + $shortPath = str_replace('..'.DS, '', $shortPath); + return r(DS.DS, DS, $shortPath); + } +/** + * Checks for Configure::read('Routing.admin') and forces user to input it if not enabled + * + * @return string Admin route to use + * @access public + */ + function getAdmin() { + $admin = ''; + $cakeAdmin = null; + $adminRoute = Configure::read('Routing.admin'); + if (!empty($adminRoute)) { + $cakeAdmin = $adminRoute . '_'; + } else { + $this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.'); + $this->out('What would you like the admin route to be?'); + $this->out('Example: www.example.com/admin/controller'); + while ($admin == '') { + $admin = $this->in("What would you like the admin route to be?", null, 'admin'); + } + if ($this->Project->cakeAdmin($admin) !== true) { + $this->out('Unable to write to /app/config/core.php.'); + $this->out('You need to enable Configure::write(\'Routing.admin\',\'admin\') in /app/config/core.php to use admin routing.'); + $this->stop(); + } else { + $cakeAdmin = $admin . '_'; + } + } + return $cakeAdmin; + } +/** + * Creates the proper controller path for the specified controller class name + * + * @param string $name Controller class name + * @return string Path to controller + * @access protected + */ + function _controllerPath($name) { + return low(Inflector::underscore($name)); + } +/** + * Creates the proper controller plural name for the specified controller class name + * + * @param string $name Controller class name + * @return string Controller plural name + * @access protected + */ + function _controllerName($name) { + return Inflector::pluralize(Inflector::camelize($name)); + } +/** + * Creates the proper controller camelized name (singularized) for the specified name + * + * @param string $name Name + * @return string Camelized and singularized controller name + * @access protected + */ + function _modelName($name) { + return Inflector::camelize(Inflector::singularize($name)); + } +/** + * Creates the proper singular model key for associations + * + * @param string $name Controller class name + * @return string Singular model key + * @access protected + */ + function _modelKey($name) { + return Inflector::underscore(Inflector::singularize($name)).'_id'; + } +/** + * Creates the proper model name from a foreign key + * + * @param string $key Foreign key + * @return string Model name + * @access protected + */ + function _modelNameFromKey($key) { + $name = str_replace('_id', '',$key); + return Inflector::camelize($name); + } +/** + * creates the singular name for use in views. + * + * @param string $name + * @return string $name + * @access protected + */ + function _singularName($name) { + return Inflector::variable(Inflector::singularize($name)); + } +/** + * Creates the plural name for views + * + * @param string $name Name to use + * @return string Plural name for views + * @access protected + */ + function _pluralName($name) { + return Inflector::variable(Inflector::pluralize($name)); + } +/** + * Creates the singular human name used in views + * + * @param string $name Controller name + * @return string Singular human name + * @access protected + */ + function _singularHumanName($name) { + return Inflector::humanize(Inflector::underscore(Inflector::singularize($name))); + } +/** + * Creates the plural human name used in views + * + * @param string $name Controller name + * @return string Plural human name + * @access protected + */ + function _pluralHumanName($name) { + return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name))); + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php new file mode 100644 index 000000000..8d549a975 --- /dev/null +++ b/cake/console/libs/tasks/controller.php @@ -0,0 +1,580 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Task class for creating and updating controller files. + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class ControllerTask extends Shell { +/** + * Name of plugin + * + * @var string + * @access public + */ + var $plugin = null; +/** + * Tasks to be loaded by this Task + * + * @var array + * @access public + */ + var $tasks = array('Project'); +/** + * path to CONTROLLERS directory + * + * @var array + * @access public + */ + var $path = CONTROLLERS; +/** + * Override initialize + * + * @access public + */ + function initialize() { + } +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (empty($this->args)) { + $this->__interactive(); + } + + if (isset($this->args[0])) { + $controller = Inflector::camelize($this->args[0]); + $actions = null; + if (isset($this->args[1]) && $this->args[1] == 'scaffold') { + $this->out('Baking scaffold for ' . $controller); + $actions = $this->bakeActions($controller); + } else { + $actions = 'scaffold'; + } + if ((isset($this->args[1]) && $this->args[1] == 'admin') || (isset($this->args[2]) && $this->args[2] == 'admin')) { + if ($admin = $this->getAdmin()) { + $this->out('Adding ' . Configure::read('Routing.admin') .' methods'); + if ($actions == 'scaffold') { + $actions = $this->bakeActions($controller, $admin); + } else { + $actions .= $this->bakeActions($controller, $admin); + } + } + } + if ($this->bake($controller, $actions)) { + if ($this->_checkUnitTest()) { + $this->bakeTest($controller); + } + } + } + } +/** + * Interactive + * + * @access private + */ + function __interactive($controllerName = false) { + if (!$controllerName) { + $this->interactive = true; + $this->hr(); + $this->out(sprintf("Bake Controller\nPath: %s", $this->path)); + $this->hr(); + $actions = ''; + $uses = array(); + $helpers = array(); + $components = array(); + $wannaUseSession = 'y'; + $wannaDoAdmin = 'n'; + $wannaUseScaffold = 'n'; + $wannaDoScaffolding = 'y'; + $controllerName = $this->getName(); + } + $this->hr(); + $this->out("Baking {$controllerName}Controller"); + $this->hr(); + + $controllerFile = low(Inflector::underscore($controllerName)); + + $question[] = __("Would you like to build your controller interactively?", true); + if (file_exists($this->path . $controllerFile .'_controller.php')) { + $question[] = sprintf(__("Warning: Choosing no will overwrite the %sController.", true), $controllerName); + } + $doItInteractive = $this->in(join("\n", $question), array('y','n'), 'y'); + + if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') { + $this->interactive = true; + + $wannaUseScaffold = $this->in(__("Would you like to use scaffolding?", true), array('y','n'), 'n'); + + if (low($wannaUseScaffold) == 'n' || low($wannaUseScaffold) == 'no') { + + $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'n'); + + if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'n'); + } + + $wannaDoHelpers = $this->in(__("Would you like this controller to use other helpers besides HtmlHelper and FormHelper?", true), array('y','n'), 'n'); + + if (low($wannaDoHelpers) == 'y' || low($wannaDoHelpers) == 'yes') { + $helpersList = $this->in(__("Please provide a comma separated list of the other helper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)); + $helpersListTrimmed = str_replace(' ', '', $helpersList); + $helpers = explode(',', $helpersListTrimmed); + } + $wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); + + if (low($wannaDoComponents) == 'y' || low($wannaDoComponents) == 'yes') { + $componentsList = $this->in(__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)); + $componentsListTrimmed = str_replace(' ', '', $componentsList); + $components = explode(',', $componentsListTrimmed); + } + + $wannaUseSession = $this->in(__("Would you like to use Sessions?", true), array('y','n'), 'y'); + } else { + $wannaDoScaffolding = 'n'; + } + } else { + $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'y'); + + if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'y'); + } + } + $admin = false; + + if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) { + $admin = $this->getAdmin(); + } + + if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + $actions = $this->bakeActions($controllerName, null, in_array(low($wannaUseSession), array('y', 'yes'))); + if ($admin) { + $actions .= $this->bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes'))); + } + } + + if ($this->interactive === true) { + $this->out(''); + $this->hr(); + $this->out('The following controller will be created:'); + $this->hr(); + $this->out("Controller Name: $controllerName"); + + if (low($wannaUseScaffold) == 'y' || low($wannaUseScaffold) == 'yes') { + $this->out(" var \$scaffold;"); + $actions = 'scaffold'; + } + + if (count($helpers)) { + $this->out("Helpers: ", false); + + foreach ($helpers as $help) { + if ($help != $helpers[count($helpers) - 1]) { + $this->out(ucfirst($help) . ", ", false); + } else { + $this->out(ucfirst($help)); + } + } + } + + if (count($components)) { + $this->out("Components: ", false); + + foreach ($components as $comp) { + if ($comp != $components[count($components) - 1]) { + $this->out(ucfirst($comp) . ", ", false); + } else { + $this->out(ucfirst($comp)); + } + } + } + $this->hr(); + $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); + + if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); + if ($baked && $this->_checkUnitTest()) { + $this->bakeTest($controllerName); + } + } else { + $this->__interactive($controllerName); + } + } else { + $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); + if ($baked && $this->_checkUnitTest()) { + $this->bakeTest($controllerName); + } + } + } +/** + * Bake scaffold actions + * + * @param string $controllerName Controller name + * @param string $admin Admin route to use + * @param boolean $wannaUseSession Set to true to use sessions, false otherwise + * @return string Baked actions + * @access private + */ + function bakeActions($controllerName, $admin = null, $wannaUseSession = true) { + $currentModelName = $this->_modelName($controllerName); + if (!App::import('Model', $currentModelName)) { + $this->err(__('You must have a model for this class to build scaffold methods. Please try again.', true)); + exit; + } + $actions = null; + $modelObj =& new $currentModelName(); + $controllerPath = $this->_controllerPath($controllerName); + $pluralName = $this->_pluralName($currentModelName); + $singularName = Inflector::variable($currentModelName); + $singularHumanName = Inflector::humanize($currentModelName); + $pluralHumanName = Inflector::humanize($controllerName); + $actions .= "\n"; + $actions .= "\tfunction {$admin}index() {\n"; + $actions .= "\t\t\$this->{$currentModelName}->recursive = 0;\n"; + $actions .= "\t\t\$this->set('{$pluralName}', \$this->paginate());\n"; + $actions .= "\t}\n"; + $actions .= "\n"; + $actions .= "\tfunction {$admin}view(\$id = null) {\n"; + $actions .= "\t\tif (!\$id) {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}.', true));\n"; + $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; + } else { + $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; + } + $actions .= "\t\t}\n"; + $actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n"; + $actions .= "\t}\n"; + $actions .= "\n"; + + /* ADD ACTION */ + $compact = array(); + $actions .= "\tfunction {$admin}add() {\n"; + $actions .= "\t\tif (!empty(\$this->data)) {\n"; + $actions .= "\t\t\t\$this->{$currentModelName}->create();\n"; + $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n"; + $actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n"; + } else { + $actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action'=>'index'));\n"; + $actions .= "\t\t\t\t\$this->stop();\n"; + } + $actions .= "\t\t\t} else {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\t\$this->Session->setFlash(__('The {$singularHumanName} could not be saved. Please, try again.', true));\n"; + } + $actions .= "\t\t\t}\n"; + $actions .= "\t\t}\n"; + foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) { + if (!empty($associationName)) { + $habtmModelName = $this->_modelName($associationName); + $habtmSingularName = $this->_singularName($associationName); + $habtmPluralName = $this->_pluralName($associationName); + $actions .= "\t\t\${$habtmPluralName} = \$this->{$currentModelName}->{$habtmModelName}->find('list');\n"; + $compact[] = "'{$habtmPluralName}'"; + } + } + foreach ($modelObj->belongsTo as $associationName => $relation) { + if (!empty($associationName)) { + $belongsToModelName = $this->_modelName($associationName); + $belongsToPluralName = $this->_pluralName($associationName); + $actions .= "\t\t\${$belongsToPluralName} = \$this->{$currentModelName}->{$belongsToModelName}->find('list');\n"; + $compact[] = "'{$belongsToPluralName}'"; + } + } + if (!empty($compact)) { + $actions .= "\t\t\$this->set(compact(".join(', ', $compact)."));\n"; + } + $actions .= "\t}\n"; + $actions .= "\n"; + + /* EDIT ACTION */ + $compact = array(); + $actions .= "\tfunction {$admin}edit(\$id = null) {\n"; + $actions .= "\t\tif (!\$id && empty(\$this->data)) {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}', true));\n"; + $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; + } else { + $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; + $actions .= "\t\t\t\$this->stop();\n"; + } + $actions .= "\t\t}\n"; + $actions .= "\t\tif (!empty(\$this->data)) {\n"; + $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\t\$this->Session->setFlash(__('The ".$singularHumanName." has been saved', true));\n"; + $actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n"; + } else { + $actions .= "\t\t\t\t\$this->flash(__('The ".$singularHumanName." has been saved.', true), array('action'=>'index'));\n"; + $actions .= "\t\t\t\t\$this->stop();\n"; + } + $actions .= "\t\t\t} else {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\t\$this->Session->setFlash(__('The {$singularHumanName} could not be saved. Please, try again.', true));\n"; + } + $actions .= "\t\t\t}\n"; + $actions .= "\t\t}\n"; + $actions .= "\t\tif (empty(\$this->data)) {\n"; + $actions .= "\t\t\t\$this->data = \$this->{$currentModelName}->read(null, \$id);\n"; + $actions .= "\t\t}\n"; + + foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) { + if (!empty($associationName)) { + $habtmModelName = $this->_modelName($associationName); + $habtmSingularName = $this->_singularName($associationName); + $habtmPluralName = $this->_pluralName($associationName); + $actions .= "\t\t\${$habtmPluralName} = \$this->{$currentModelName}->{$habtmModelName}->find('list');\n"; + $compact[] = "'{$habtmPluralName}'"; + } + } + foreach ($modelObj->belongsTo as $associationName => $relation) { + if (!empty($associationName)) { + $belongsToModelName = $this->_modelName($associationName); + $belongsToPluralName = $this->_pluralName($associationName); + $actions .= "\t\t\${$belongsToPluralName} = \$this->{$currentModelName}->{$belongsToModelName}->find('list');\n"; + $compact[] = "'{$belongsToPluralName}'"; + } + } + if (!empty($compact)) { + $actions .= "\t\t\$this->set(compact(".join(',', $compact)."));\n"; + } + $actions .= "\t}\n"; + $actions .= "\n"; + $actions .= "\tfunction {$admin}delete(\$id = null) {\n"; + $actions .= "\t\tif (!\$id) {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\$this->Session->setFlash(__('Invalid id for {$singularHumanName}', true));\n"; + $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; + } else { + $actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n"; + } + $actions .= "\t\t}\n"; + $actions .= "\t\tif (\$this->{$currentModelName}->del(\$id)) {\n"; + if ($wannaUseSession) { + $actions .= "\t\t\t\$this->Session->setFlash(__('{$singularHumanName} deleted', true));\n"; + $actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n"; + } else { + $actions .= "\t\t\t\$this->flash(__('{$singularHumanName} deleted', true), array('action'=>'index'));\n"; + } + $actions .= "\t\t}\n"; + $actions .= "\t}\n"; + $actions .= "\n"; + return $actions; + } + + +/** + * Assembles and writes a Controller file + * + * @param string $controllerName Controller name + * @param string $actions Actions to add, or set the whole controller to use $scaffold (set $actions to 'scaffold') + * @param array $helpers Helpers to use in controller + * @param array $components Components to use in controller + * @param array $uses Models to use in controller + * @return string Baked controller + * @access private + */ + function bake($controllerName, $actions = '', $helpers = null, $components = null, $uses = null) { + $out = "plugin}AppController {\n\n"; + $out .= "\tvar \$name = '$controllerName';\n"; + + if (low($actions) == 'scaffold') { + $out .= "\tvar \$scaffold;\n"; + } else { + if (count($uses)) { + $out .= "\tvar \$uses = array('" . $this->_modelName($controllerName) . "', "; + + foreach ($uses as $use) { + if ($use != $uses[count($uses) - 1]) { + $out .= "'" . $this->_modelName($use) . "', "; + } else { + $out .= "'" . $this->_modelName($use) . "'"; + } + } + $out .= ");\n"; + } + + $out .= "\tvar \$helpers = array('Html', 'Form'"; + if (count($helpers)) { + foreach ($helpers as $help) { + $out .= ", '" . Inflector::camelize($help) . "'"; + } + } + $out .= ");\n"; + + if (count($components)) { + $out .= "\tvar \$components = array("; + + foreach ($components as $comp) { + if ($comp != $components[count($components) - 1]) { + $out .= "'" . Inflector::camelize($comp) . "', "; + } else { + $out .= "'" . Inflector::camelize($comp) . "'"; + } + } + $out .= ");\n"; + } + $out .= $actions; + } + $out .= "}\n"; + $out .= "?>"; + $filename = $this->path . $this->_controllerPath($controllerName) . '_controller.php'; + return $this->createFile($filename, $out); + } +/** + * Assembles and writes a unit test file + * + * @param string $className Controller class name + * @return string Baked test + * @access private + */ + function bakeTest($className) { + $import = $className; + if ($this->plugin) { + $import = $this->plugin . '.' . $className; + } + $out = "App::import('Controller', '$import');\n\n"; + $out .= "class Test{$className} extends {$className}Controller {\n"; + $out .= "\tvar \$autoRender = false;\n}\n\n"; + $out .= "class {$className}ControllerTest extends CakeTestCase {\n"; + $out .= "\tvar \${$className} = null;\n\n"; + $out .= "\tfunction setUp() {\n\t\t\$this->{$className} = new Test{$className}();\n\t}\n\n"; + $out .= "\tfunction test{$className}ControllerInstance() {\n"; + $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}Controller'));\n\t}\n\n"; + $out .= "\tfunction tearDown() {\n\t\tunset(\$this->{$className});\n\t}\n}\n"; + + $path = CONTROLLER_TESTS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'controllers' . DS; + } + + $filename = Inflector::underscore($className).'_controller.test.php'; + $this->out("\nBaking unit test for $className..."); + + $header = '$Id'; + $content = ""; + return $this->createFile($path . $filename, $content); + } +/** + * Outputs and gets the list of possible models or controllers from database + * + * @param string $useDbConfig Database configuration name + * @return array Set of controllers + * @access public + */ + function listAll($useDbConfig = 'default') { + $db =& ConnectionManager::getDataSource($useDbConfig); + $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; + if ($usePrefix) { + $tables = array(); + foreach ($db->listSources() as $table) { + if (!strncmp($table, $usePrefix, strlen($usePrefix))) { + $tables[] = substr($table, strlen($usePrefix)); + } + } + } else { + $tables = $db->listSources(); + } + + if (empty($tables)) { + $this->err(__('Your database does not have any tables.', true)); + $this->stop(); + } + + $this->__tables = $tables; + $this->out('Possible Controllers based on your current database:'); + $this->_controllerNames = array(); + $count = count($tables); + for ($i = 0; $i < $count; $i++) { + $this->_controllerNames[] = $this->_controllerName($this->_modelName($tables[$i])); + $this->out($i + 1 . ". " . $this->_controllerNames[$i]); + } + return $this->_controllerNames; + } + +/** + * Forces the user to specify the controller he wants to bake, and returns the selected controller name. + * + * @return string Controller name + * @access public + */ + function getName() { + $useDbConfig = 'default'; + $controllers = $this->listAll($useDbConfig, 'Controllers'); + $enteredController = ''; + + while ($enteredController == '') { + $enteredController = $this->in(__("Enter a number from the list above, type in the name of another controller, or 'q' to exit", true), null, 'q'); + + if ($enteredController === 'q') { + $this->out(__("Exit", true)); + $this->stop(); + } + + if ($enteredController == '' || intval($enteredController) > count($controllers)) { + $this->out(__('Error:', true)); + $this->out(__("The Controller name you supplied was empty, or the number \nyou selected was not an option. Please try again.", true)); + $enteredController = ''; + } + } + + if (intval($enteredController) > 0 && intval($enteredController) <= count($controllers) ) { + $controllerName = $controllers[intval($enteredController) - 1]; + } else { + $controllerName = Inflector::camelize($enteredController); + } + + return $controllerName; + } +/** + * Displays help contents + * + * @access public + */ + function help() { + $this->hr(); + $this->out("Usage: cake bake controller ..."); + $this->hr(); + $this->out('Commands:'); + $this->out("\n\tcontroller \n\t\tbakes controller with var \$scaffold"); + $this->out("\n\tcontroller scaffold\n\t\tbakes controller with scaffold actions.\n\t\t(index, view, add, edit, delete)"); + $this->out("\n\tcontroller scaffold admin\n\t\tbakes a controller with scaffold actions for both public and Configure::read('Routing.admin')"); + $this->out("\n\tcontroller admin\n\t\tbakes a controller with scaffold actions only for Configure::read('Routing.admin')"); + $this->out(""); + $this->stop(); + } +} +?> diff --git a/cake/console/libs/tasks/db_config.php b/cake/console/libs/tasks/db_config.php new file mode 100644 index 000000000..1f7d4513b --- /dev/null +++ b/cake/console/libs/tasks/db_config.php @@ -0,0 +1,355 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +if (!class_exists('File')) { + uses('file'); +} +/** + * Task class for creating and updating the database configuration file. + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class DbConfigTask extends Shell { +/** + * path to CONFIG directory + * + * @var string + * @access public + */ + var $path = null; +/** + * Default configuration settings to use + * + * @var array + * @access private + */ + var $__defaultConfig = array( + 'name' => 'default', 'driver'=> 'mysql', 'persistent'=> 'false', 'host'=> 'localhost', + 'login'=> 'root', 'password'=> 'password', 'database'=> 'project_name', + 'schema'=> null, 'prefix'=> null, 'encoding' => null, 'port' => null + ); +/** + * initialization callback + * + * @var string + * @access public + */ + function initialize() { + $this->path = $this->params['working'] . DS . 'config' . DS; + } +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (empty($this->args)) { + $this->__interactive(); + $this->stop(); + } + } +/** + * Interactive interface + * + * @access private + */ + function __interactive() { + $this->hr(); + $this->out('Database Configuration:'); + $this->hr(); + $done = false; + $dbConfigs = array(); + + while ($done == false) { + $name = ''; + + while ($name == '') { + $name = $this->in("Name:", null, 'default'); + if (preg_match('/[^a-z0-9_]/i', $name)) { + $name = ''; + $this->out('The name may only contain unaccented latin characters, numbers or underscores'); + } + else if (preg_match('/^[^a-z_]/i', $name)) { + $name = ''; + $this->out('The name must start with an unaccented latin character or an underscore'); + } + } + $driver = ''; + + while ($driver == '') { + $driver = $this->in('Driver:', array('db2', 'firebird', 'mssql', 'mysql', 'mysqli', 'odbc', 'oracle', 'postgres', 'sqlite', 'sybase'), 'mysql'); + } + $persistent = ''; + + while ($persistent == '') { + $persistent = $this->in('Persistent Connection?', array('y', 'n'), 'n'); + } + + if (low($persistent) == 'n') { + $persistent = 'false'; + } else { + $persistent = 'true'; + } + $host = ''; + + while ($host == '') { + $host = $this->in('Database Host:', null, 'localhost'); + } + $port = ''; + + while ($port == '') { + $port = $this->in('Port?', null, 'n'); + } + + if (low($port) == 'n') { + $port = null; + } + $login = ''; + + while ($login == '') { + $login = $this->in('User:', null, 'root'); + } + $password = ''; + $blankPassword = false; + + while ($password == '' && $blankPassword == false) { + $password = $this->in('Password:'); + + if ($password == '') { + $blank = $this->in('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n'); + if ($blank == 'y') + { + $blankPassword = true; + } + } + } + $database = ''; + + while ($database == '') { + $database = $this->in('Database Name:', null, 'cake'); + } + $prefix = ''; + + while ($prefix == '') { + $prefix = $this->in('Table Prefix?', null, 'n'); + } + + if (low($prefix) == 'n') { + $prefix = null; + } + $encoding = ''; + + while ($encoding == '') { + $encoding = $this->in('Table encoding?', null, 'n'); + } + + if (low($encoding) == 'n') { + $encoding = null; + } + $schema = ''; + + if ($driver == 'postgres') { + while ($schema == '') { + $schema = $this->in('Table schema?', null, 'n'); + } + } + + if (low($schema) == 'n') { + $schema = null; + } + + $config = compact('name', 'driver', 'persistent', 'host', 'login', 'password', 'database', 'prefix', 'encoding', 'port', 'schema'); + + while ($this->__verify($config) == false) { + $this->__interactive(); + } + $dbConfigs[] = $config; + $doneYet = $this->in('Do you wish to add another database configuration?', null, 'n'); + + if (low($doneYet == 'n')) { + $done = true; + } + } + + $this->bake($dbConfigs); + config('database'); + return true; + } +/** + * Output verification message and bake if it looks good + * + * @return boolean True if user says it looks good, false otherwise + * @access private + */ + function __verify($config) { + $config = array_merge($this->__defaultConfig, $config); + extract($config); + $this->out(''); + $this->hr(); + $this->out('The following database configuration will be created:'); + $this->hr(); + $this->out("Name: $name"); + $this->out("Driver: $driver"); + $this->out("Persistent: $persistent"); + $this->out("Host: $host"); + + if ($port) { + $this->out("Port: $port"); + } + + $this->out("User: $login"); + $this->out("Pass: " . str_repeat('*', strlen($password))); + $this->out("Database: $database"); + + if ($prefix) { + $this->out("Table prefix: $prefix"); + } + + if ($schema) { + $this->out("Schema: $schema"); + } + + if ($encoding) { + $this->out("Encoding: $encoding"); + } + + $this->hr(); + $looksGood = $this->in('Look okay?', array('y', 'n'), 'y'); + + if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + return $config; + } + return false; + } +/** + * Assembles and writes database.php + * + * @param array $configs Configuration settings to use + * @return boolean Success + * @access public + */ + function bake($configs) { + if (!is_dir($this->path)) { + $this->err($this->path . ' not found'); + return false; + } + + $filename = $this->path . 'database.php'; + $oldConfigs = array(); + + if (file_exists($filename)) { + $db = new DATABASE_CONFIG; + $temp = get_class_vars(get_class($db)); + + foreach ($temp as $configName => $info) { + $info = array_merge($this->__defaultConfig, $info); + + if (!isset($info['schema'])) { + $info['schema'] = null; + } + if (!isset($info['encoding'])) { + $info['encoding'] = null; + } + if (!isset($info['port'])) { + $info['port'] = null; + } + + if($info['persistent'] === false) { + $info['persistent'] = 'false'; + } else { + $info['persistent'] = 'false'; + } + + $oldConfigs[] = array( + 'name' => $configName, + 'driver' => $info['driver'], + 'persistent' => $info['persistent'], + 'host' => $info['host'], + 'port' => $info['port'], + 'login' => $info['login'], + 'password' => $info['password'], + 'database' => $info['database'], + 'prefix' => $info['prefix'], + 'schema' => $info['schema'], + 'encoding' => $info['encoding'] + ); + } + } + + foreach ($oldConfigs as $key => $oldConfig) { + foreach ($configs as $key1 => $config) { + if ($oldConfig['name'] == $config['name']) { + unset($oldConfigs[$key]); + } + } + } + + $configs = array_merge($oldConfigs, $configs); + $out = "__defaultConfig, $config); + extract($config); + + $out .= "\tvar \${$name} = array(\n"; + $out .= "\t\t'driver' => '{$driver}',\n"; + $out .= "\t\t'persistent' => {$persistent},\n"; + $out .= "\t\t'host' => '{$host}',\n"; + + if ($port) { + $out .= "\t\t'port' => {$port},\n"; + } + + $out .= "\t\t'login' => '{$login}',\n"; + $out .= "\t\t'password' => '{$password}',\n"; + $out .= "\t\t'database' => '{$database}',\n"; + + if ($schema) { + $out .= "\t\t'schema' => '{$schema}',\n"; + } + + if ($prefix) { + $out .= "\t\t'prefix' => '{$prefix}',\n"; + } + + if ($encoding) { + $out .= "\t\t'encoding' => '{$encoding}'\n"; + } + + $out .= "\t);\n"; + } + + $out .= "}\n"; + $out .= "?>"; + $filename = $this->path.'database.php'; + return $this->createFile($filename, $out); + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/extract.php b/cake/console/libs/tasks/extract.php new file mode 100644 index 000000000..6980fde4b --- /dev/null +++ b/cake/console/libs/tasks/extract.php @@ -0,0 +1,697 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs + * @since CakePHP(tm) v 1.2.0.5012 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Only used when -debug option + */ + ob_start(); + + $singularReturn = __('Singular string return __()', true); + $singularEcho = __('Singular string echo __()'); + + $pluralReturn = __n('% apple in the bowl (plural string return __n())', '% apples in the blowl (plural string 2 return __n())', 3, true); + $pluralEcho = __n('% apple in the bowl (plural string 2 echo __n())', '% apples in the blowl (plural string 2 echo __n()', 3); + + $singularDomainReturn = __d('controllers', 'Singular string domain lookup return __d()', true); + $singularDomainEcho = __d('controllers', 'Singular string domain lookup echo __d()'); + + $pluralDomainReturn = __dn('controllers', '% pears in the bowl (plural string domain lookup return __dn())', '% pears in the blowl (plural string domain lookup return __dn())', 3, true); + $pluralDomainEcho = __dn('controllers', '% pears in the bowl (plural string domain lookup echo __dn())', '% pears in the blowl (plural string domain lookup echo __dn())', 3); + + $singularDomainCategoryReturn = __dc('controllers', 'Singular string domain and category lookup return __dc()', 5, true); + $singularDomainCategoryEcho = __dc('controllers', 'Singular string domain and category lookup echo __dc()', 5); + + $pluralDomainCategoryReturn = __dcn('controllers', '% apple in the bowl (plural string 1 domain and category lookup return __dcn())', '% apples in the blowl (plural string 2 domain and category lookup return __dcn())', 3, 5, true); + $pluralDomainCategoryEcho = __dcn('controllers', '% apple in the bowl (plural string 1 domain and category lookup echo __dcn())', '% apples in the blowl (plural string 2 domain and category lookup echo __dcn())', 3, 5); + + $categoryReturn = __c('Category string lookup line return __c()', 5, true); + $categoryEcho = __c('Category string lookup line echo __c()', 5); + + ob_end_clean(); +/** + * Language string extractor + * + * @package cake + * @subpackage cake.cake.console.libs + */ +class ExtractTask extends Shell{ +/** + * Path to use when looking for strings + * + * @var string + * @access public + */ + var $path = null; +/** + * Files from where to extract + * + * @var array + * @access public + */ + var $files = array(); +/** + * Filename where to deposit translations + * + * @var string + * @access private + */ + var $__filename = 'default'; +/** + * True if all strings should be merged into one file + * + * @var boolean + * @access private + */ + var $__oneFile = true; +/** + * Current file being processed + * + * @var string + * @access private + */ + var $__file = null; +/** + * Extracted tokens + * + * @var array + * @access private + */ + var $__tokens = array(); +/** + * Extracted strings + * + * @var array + * @access private + */ + var $__strings = array(); +/** + * History of file versions + * + * @var array + * @access private + */ + var $__fileVersions = array(); +/** + * Destination path + * + * @var string + * @access private + */ + var $__output = null; +/** + * Override initialize + * + * @access public + */ + function initialize() { + } +/** + * Override startup + * + * @access public + */ + function startup() { + } +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (isset($this->params['files']) && !is_array($this->params['files'])) { + $this->files = explode(',', $this->params['files']); + } + if (isset($this->params['path'])) { + $this->path = $this->params['path']; + } else { + $response = ''; + while ($response == '') { + $response = $this->in("What is the full path you would like to extract?\nExample: " . $this->params['root'] . DS . "myapp\n[Q]uit", null, 'Q'); + if (strtoupper($response) === 'Q') { + $this->out('Extract Aborted'); + $this->stop(); + } + } + + if (is_dir($response)) { + $this->path = $response; + } else { + $this->err('The directory path you supplied was not found. Please try again.'); + $this->execute(); + } + } + + if (isset($this->params['debug'])) { + $this->path = ROOT; + $this->files = array(__FILE__); + } + + if (isset($this->params['output'])) { + $this->__output = $this->params['output']; + } else { + $response = ''; + while ($response == '') { + $response = $this->in("What is the full path you would like to output?\nExample: " . $this->path . DS . "locale\n[Q]uit", null, $this->path . DS . "locale"); + if (strtoupper($response) === 'Q') { + $this->out('Extract Aborted'); + $this->stop(); + } + } + + if (is_dir($response)) { + $this->__output = $response . DS; + } else { + $this->err('The directory path you supplied was not found. Please try again.'); + $this->execute(); + } + } + + if (empty($this->files)) { + $this->files = $this->__searchDirectory(); + } + $this->__extract(); + } +/** + * Extract text + * + * @access private + */ + function __extract() { + $this->out(''); + $this->out(''); + $this->out(__('Extracting...', true)); + $this->hr(); + $this->out(__('Path: ', true). $this->path); + $this->out(__('Output Directory: ', true). $this->__output); + $this->hr(); + + $response = ''; + $filename = ''; + while ($response == '') { + $response = $this->in(__('Would you like to merge all translations into one file?', true), array('y','n'), 'y'); + if (strtolower($response) == 'n') { + $this->__oneFile = false; + } else { + while ($filename == '') { + $filename = $this->in(__('What should we name this file?', true), null, $this->__filename); + if ($filename == '') { + $this->out(__('The filesname you supplied was empty. Please try again.', true)); + } + } + $this->__filename = $filename; + } + } + $this->__extractTokens(); + } +/** + * Show help options + * + * @access public + */ + function help() { + $this->out(__('CakePHP Language String Extraction:', true)); + $this->hr(); + $this->out(__('The Extract script generates .pot file(s) with translations', true)); + $this->out(__('By default the .pot file(s) will be place in the locale directory of -app', true)); + $this->out(__('By default -app is ROOT/app', true)); + $this->hr(); + $this->out(__('usage: cake i18n extract [command] [path...]', true)); + $this->out(''); + $this->out(__('commands:', true)); + $this->out(__(' -app [path...]: directory where your application is located', true)); + $this->out(__(' -root [path...]: path to install', true)); + $this->out(__(' -core [path...]: path to cake directory', true)); + $this->out(__(' -path [path...]: Full path to directory to extract strings', true)); + $this->out(__(' -output [path...]: Full path to output directory', true)); + $this->out(__(' -files: [comma separated list of files, full path to file is needed]', true)); + $this->out(__(' cake i18n extract help: Shows this help message.', true)); + $this->out(__(' -debug: Perform self test.', true)); + $this->out(''); + } +/** + * Extract tokens out of all files to be processed + * + * @access private + */ + function __extractTokens() { + foreach ($this->files as $file) { + $this->__file = $file; + $this->out(sprintf(__('Processing %s...', true), $file)); + + $code = file_get_contents($file); + + $this->__findVersion($code, $file); + $allTokens = token_get_all($code); + $this->__tokens = array(); + $lineNumber = 1; + + foreach ($allTokens as $token) { + if ((!is_array($token)) || (($token[0] != T_WHITESPACE) && ($token[0] != T_INLINE_HTML))) { + if (is_array($token)) { + $token[] = $lineNumber; + } + $this->__tokens[] = $token; + } + + if (is_array($token)) { + $lineNumber += count(split("\n", $token[1])) - 1; + } else { + $lineNumber += count(split("\n", $token)) - 1; + } + } + unset($allTokens); + $this->basic(); + $this->basic('__c'); + $this->extended(); + $this->extended('__dc', 2); + $this->extended('__n', 0, true); + $this->extended('__dn', 2, true); + $this->extended('__dcn', 4, true); + } + $this->__buildFiles(); + $this->__writeFiles(); + $this->out('Done.'); + } +/** + * Will parse __(), __c() functions + * + * @param string $functionName Function name that indicates translatable string (e.g: '__') + * @access public + */ + function basic($functionName = '__') { + $count = 0; + $tokenCount = count($this->__tokens); + + while (($tokenCount - $count) > 3) { + list($countToken, $parenthesis, $middle, $right) = array($this->__tokens[$count], $this->__tokens[$count + 1], $this->__tokens[$count + 2], $this->__tokens[$count + 3]); + if (!is_array($countToken)) { + $count++; + continue; + } + + list($type, $string, $line) = $countToken; + if (($type == T_STRING) && ($string == $functionName) && ($parenthesis == '(')) { + + if (in_array($right, array(')', ',')) + && (is_array($middle) && ($middle[0] == T_CONSTANT_ENCAPSED_STRING))) { + + if ($this->__oneFile === true) { + $this->__strings[$this->__formatString($middle[1])][$this->__file][] = $line; + } else { + $this->__strings[$this->__file][$this->__formatString($middle[1])][] = $line; + } + } else { + $this->__markerError($this->__file, $line, $functionName, $count); + } + } + $count++; + } + } +/** + * Will parse __d(), __dc(), __n(), __dn(), __dcn() + * + * @param string $functionName Function name that indicates translatable string (e.g: '__') + * @param integer $shift Number of parameters to shift to find translateable string + * @param boolean $plural Set to true if function supports plural format, false otherwise + * @access public + */ + function extended($functionName = '__d', $shift = 0, $plural = false) { + $count = 0; + $tokenCount = count($this->__tokens); + + while (($tokenCount - $count) > 7) { + list($countToken, $firstParenthesis) = array($this->__tokens[$count], $this->__tokens[$count + 1]); + if (!is_array($countToken)) { + $count++; + continue; + } + + list($type, $string, $line) = $countToken; + if (($type == T_STRING) && ($string == $functionName) && ($firstParenthesis == '(')) { + $position = $count; + $depth = 0; + + while ($depth == 0) { + if ($this->__tokens[$position] == '(') { + $depth++; + } elseif ($this->__tokens[$position] == ')') { + $depth--; + } + $position++; + } + + if ($plural) { + $end = $position + $shift + 7; + + if ($this->__tokens[$position + $shift + 5] === ')') { + $end = $position + $shift + 5; + } + + if (empty($shift)) { + list($singular, $firstComma, $plural, $seoncdComma, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $this->__tokens[$position + 3], $this->__tokens[$end]); + $condition = ($seoncdComma == ','); + } else { + list($domain, $firstComma, $singular, $seoncdComma, $plural, $comma3, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $this->__tokens[$position + 3], $this->__tokens[$position + 4], $this->__tokens[$position + 5], $this->__tokens[$end]); + $condition = ($comma3 == ','); + } + $condition = $condition && + (is_array($singular) && ($singular[0] == T_CONSTANT_ENCAPSED_STRING)) && + (is_array($plural) && ($plural[0] == T_CONSTANT_ENCAPSED_STRING)); + } else { + if ($this->__tokens[$position + $shift + 5] === ')') { + $comma = $this->__tokens[$position + $shift + 3]; + $end = $position + $shift + 5; + } else { + $comma = null; + $end = $position + $shift + 3; + } + + list($domain, $firstComma, $text, $seoncdComma, $endParenthesis) = array($this->__tokens[$position], $this->__tokens[$position + 1], $this->__tokens[$position + 2], $comma, $this->__tokens[$end]); + $condition = ($seoncdComma == ',' || $seoncdComma === null) && + (is_array($domain) && ($domain[0] == T_CONSTANT_ENCAPSED_STRING)) && + (is_array($text) && ($text[0] == T_CONSTANT_ENCAPSED_STRING)); + } + + if (($endParenthesis == ')') && $condition) { + if ($this->__oneFile === true) { + if ($plural) { + $this->__strings[$this->__formatString($singular[1]) . "\0" . $this->__formatString($plural[1])][$this->__file][] = $line; + } else { + $this->__strings[$this->__formatString($text[1])][$this->__file][] = $line; + } + } else { + if ($plural) { + $this->__strings[$this->__file][$this->__formatString($singular[1]) . "\0" . $this->__formatString($plural[1])][] = $line; + } else { + $this->__strings[$this->__file][$this->__formatString($text[1])][] = $line; + } + } + } else { + $this->__markerError($this->__file, $line, $functionName, $count); + } + } + $count++; + } + } +/** + * Build the translate template file contents out of obtained strings + * + * @access private + */ + function __buildFiles() { + foreach ($this->__strings as $str => $fileInfo) { + $output = ''; + $occured = $fileList = array(); + + if ($this->__oneFile === true) { + foreach ($fileInfo as $file => $lines) { + $occured[] = "$file:" . join(';', $lines); + + if (isset($this->__fileVersions[$file])) { + $fileList[] = $this->__fileVersions[$file]; + } + } + $occurances = join("\n#: ", $occured); + $occurances = str_replace($this->path, '', $occurances); + $output = "#: $occurances\n"; + $filename = $this->__filename; + + if (strpos($str, "\0") === false) { + $output .= "msgid \"$str\"\n"; + $output .= "msgstr \"\"\n"; + } else { + list($singular, $plural) = explode("\0", $str); + $output .= "msgid \"$singular\"\n"; + $output .= "msgid_plural \"$plural\"\n"; + $output .= "msgstr[0] \"\"\n"; + $output .= "msgstr[1] \"\"\n"; + } + $output .= "\n"; + } else { + foreach ($fileInfo as $file => $lines) { + $filename = $str; + $occured = array("$str:" . join(';', $lines)); + + if (isset($this->__fileVersions[$str])) { + $fileList[] = $this->__fileVersions[$str]; + } + $occurances = join("\n#: ", $occured); + $occurances = str_replace($this->path, '', $occurances); + $output .= "#: $occurances\n"; + + if (strpos($file, "\0") === false) { + $output .= "msgid \"$file\"\n"; + $output .= "msgstr \"\"\n"; + } else { + list($singular, $plural) = explode("\0", $file); + $output .= "msgid \"$singular\"\n"; + $output .= "msgid_plural \"$plural\"\n"; + $output .= "msgstr[0] \"\"\n"; + $output .= "msgstr[1] \"\"\n"; + } + $output .= "\n"; + } + } + $this->__store($filename, $output, $fileList); + } + } +/** + * Prepare a file to be stored + * + * @param string $file Filename + * @param string $input What to store + * @param array $fileList File list + * @param integer $get Set to 1 to get files to store, false to set + * @return mixed If $get == 1, files to store, otherwise void + * @access private + */ + function __store($file = 0, $input = 0, $fileList = array(), $get = 0) { + static $storage = array(); + + if (!$get) { + if (isset($storage[$file])) { + $storage[$file][1] = array_unique(array_merge($storage[$file][1], $fileList)); + $storage[$file][] = $input; + } else { + $storage[$file] = array(); + $storage[$file][0] = $this->__writeHeader(); + $storage[$file][1] = $fileList; + $storage[$file][2] = $input; + } + } else { + return $storage; + } + } +/** + * Write the files that need to be stored + * + * @access private + */ + function __writeFiles() { + $output = $this->__store(0, 0, array(), 1); + $output = $this->__mergeFiles($output); + + foreach ($output as $file => $content) { + $tmp = str_replace(array($this->path, '.php','.ctp','.thtml', '.inc','.tpl' ), '', $file); + $tmp = str_replace(DS, '.', $tmp); + $file = str_replace('.', '-', $tmp) .'.pot'; + $fileList = $content[1]; + + unset($content[1]); + + $fileList = str_replace(array($this->path), '', $fileList); + + if (count($fileList) > 1) { + $fileList = "Generated from files:\n# " . join("\n# ", $fileList); + } elseif (count($fileList) == 1) { + $fileList = 'Generated from file: ' . join('', $fileList); + } else { + $fileList = 'No version information was available in the source files.'; + } + + if (is_file($this->__output . $file)) { + $response = ''; + while ($response == '') { + $response = $this->in("\n\nError: ".$file . ' already exists in this location. Overwrite?', array('y','n', 'q'), 'n'); + if (strtoupper($response) === 'Q') { + $this->out('Extract Aborted'); + $this->stop(); + } elseif (strtoupper($response) === 'N') { + $response = ''; + while ($response == '') { + $response = $this->in("What would you like to name this file?\nExample: new_" . $file, null, "new_" . $file); + $file = $response; + } + } + } + } + $fp = fopen($this->__output . $file, 'w'); + fwrite($fp, str_replace('--VERSIONS--', $fileList, join('', $content))); + fclose($fp); + } + } +/** + * Merge output files + * + * @param array $output Output to merge + * @return array Merged output + * @access private + */ + function __mergeFiles($output) { + foreach ($output as $file => $content) { + if (count($content) <= 1 && $file != $this->__filename) { + @$output[$this->__filename][1] = array_unique(array_merge($output[$this->__filename][1], $content[1])); + + if (!isset($output[$this->__filename][0])) { + $output[$this->__filename][0] = $content[0]; + } + unset($content[0]); + unset($content[1]); + + foreach ($content as $msgid) { + $output[$this->__filename][] = $msgid; + } + unset($output[$file]); + } + } + return $output; + } +/** + * Build the translation template header + * + * @return string Translation template header + * @access private + */ + function __writeHeader() { + $output = "# LANGUAGE translation of CakePHP Application\n"; + $output .= "# Copyright YEAR NAME \n"; + $output .= "# --VERSIONS--\n"; + $output .= "#\n"; + $output .= "#, fuzzy\n"; + $output .= "msgid \"\"\n"; + $output .= "msgstr \"\"\n"; + $output .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n"; + $output .= "\"POT-Creation-Date: " . date("Y-m-d H:iO") . "\\n\"\n"; + $output .= "\"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\\n\"\n"; + $output .= "\"Last-Translator: NAME \\n\"\n"; + $output .= "\"Language-Team: LANGUAGE \\n\"\n"; + $output .= "\"MIME-Version: 1.0\\n\"\n"; + $output .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n"; + $output .= "\"Content-Transfer-Encoding: 8bit\\n\"\n"; + $output .= "\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n\"\n\n"; + return $output; + } +/** + * Find the version number of a file looking for SVN commands + * + * @param string $code Source code of file + * @param string $file File + * @access private + */ + function __findVersion($code, $file) { + $header = '$Id' . ':'; + if (preg_match('/\\' . $header . ' [\\w.]* ([\\d]*)/', $code, $versionInfo)) { + $version = str_replace(ROOT, '', 'Revision: ' . $versionInfo[1] . ' ' .$file); + $this->__fileVersions[$file] = $version; + } + } +/** + * Format a string to be added as a translateable string + * + * @param string $string String to format + * @return string Formatted string + * @access private + */ + function __formatString($string) { + $quote = substr($string, 0, 1); + $string = substr($string, 1, -1); + if ($quote == '"') { + $string = stripcslashes($string); + } else { + $string = strtr($string, array("\\'" => "'", "\\\\" => "\\")); + } + return addcslashes($string, "\0..\37\\\""); + } +/** + * Indicate an invalid marker on a processed file + * + * @param string $file File where invalid marker resides + * @param integer $line Line number + * @param string $marker Marker found + * @param integer $count Count + * @access private + */ + function __markerError($file, $line, $marker, $count) { + $this->out("Invalid marker content in $file:$line\n* $marker(", true); + $count += 2; + $tokenCount = count($this->__tokens); + $parenthesis = 1; + + while ((($tokenCount - $count) > 0) && $parenthesis) { + if (is_array($this->__tokens[$count])) { + $this->out($this->__tokens[$count][1], false); + } else { + $this->out($this->__tokens[$count], false); + if ($this->__tokens[$count] == '(') { + $parenthesis++; + } + + if ($this->__tokens[$count] == ')') { + $parenthesis--; + } + } + $count++; + } + $this->out("\n", true); + } +/** + * Search the specified path for files that may contain translateable strings + * + * @param string $path Path (or set to null to use current) + * @return array Files + * @access private + */ + function __searchDirectory($path = null) { + if ($path === null) { + $path = $this->path .DS; + } + $files = glob("$path*.{php,ctp,thtml,inc,tpl}", GLOB_BRACE); + $dirs = glob("$path*", GLOB_ONLYDIR); + + foreach ($dirs as $dir) { + if (!preg_match("!(^|.+/)(CVS|.svn)$!", $dir)) { + $files = array_merge($files, $this->__searchDirectory("$dir" . DS)); + if (($id = array_search($dir . DS . 'extract.php', $files)) !== FALSE) { + unset($files[$id]); + } + } + } + return $files; + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php new file mode 100644 index 000000000..2e049d3c1 --- /dev/null +++ b/cake/console/libs/tasks/model.php @@ -0,0 +1,941 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Task class for creating and updating model files. + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class ModelTask extends Shell { +/** + * Name of plugin + * + * @var string + * @access public + */ + var $plugin = null; +/** + * path to MODELS directory + * + * @var string + * @access public + */ + var $path = MODELS; + +/** + * tasks + * + * @var array + * @access public + */ + var $tasks = array('DbConfig'); +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (empty($this->args)) { + $this->__interactive(); + } + + if (!empty($this->args[0])) { + $model = Inflector::camelize($this->args[0]); + if ($this->bake($model)) { + if ($this->_checkUnitTest()) { + $this->bakeTest($model); + } + } + } + } +/** + * Handles interactive baking + * + * @access private + */ + function __interactive() { + $this->hr(); + $this->out(sprintf("Bake Model\nPath: %s", $this->path)); + $this->hr(); + $this->interactive = true; + + $useTable = null; + $primaryKey = 'id'; + $validate = array(); + $associations = array('belongsTo'=> array(), 'hasOne'=> array(), 'hasMany' => array(), 'hasAndBelongsToMany'=> array()); + + $useDbConfig = 'default'; + $configs = get_class_vars('DATABASE_CONFIG'); + + if (!is_array($configs)) { + return $this->DbConfig->execute(); + } + + $connections = array_keys($configs); + if (count($connections) > 1) { + $useDbConfig = $this->in(__('Use Database Config', true) .':', $connections, 'default'); + } + + $currentModelName = $this->getName($useDbConfig); + $db =& ConnectionManager::getDataSource($useDbConfig); + $useTable = Inflector::tableize($currentModelName); + $fullTableName = $db->fullTableName($useTable, false); + $tableIsGood = false; + + if (array_search($useTable, $this->__tables) === false) { + $this->out(''); + $this->out(sprintf(__("Given your model named '%s', Cake would expect a database table named %s", true), $currentModelName, $fullTableName)); + $tableIsGood = $this->in(__('Do you want to use this table?', true), array('y','n'), 'y'); + } + + if (low($tableIsGood) == 'n' || low($tableIsGood) == 'no') { + $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); + } + + while ($tableIsGood == false && low($useTable) != 'null') { + if (is_array($this->__tables) && !in_array($useTable, $this->__tables)) { + $fullTableName = $db->fullTableName($useTable, false); + $this->out($fullTableName . ' does not exist.'); + $useTable = $this->in(__('What is the name of the table (enter "null" to use NO table)?', true)); + $tableIsGood = false; + } else { + $tableIsGood = true; + } + } + + $wannaDoValidation = $this->in(__('Would you like to supply validation criteria for the fields in your model?', true), array('y','n'), 'y'); + + if (in_array($useTable, $this->__tables)) { + App::import('Model'); + $tempModel = new Model(array('name' => $currentModelName, 'table' => $useTable, 'ds' => $useDbConfig)); + + $fields = $tempModel->schema(); + if (!array_key_exists('id', $fields)) { + foreach ($fields as $name => $field) { + if (isset($field['key']) && $field['key'] == 'primary') { + break; + } + } + $primaryKey = $this->in(__('What is the primaryKey?', true), null, $name); + } + } + + if (array_search($useTable, $this->__tables) !== false && (low($wannaDoValidation) == 'y' || low($wannaDoValidation) == 'yes')) { + $validate = $this->doValidation($tempModel); + } + + $wannaDoAssoc = $this->in(__('Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)?', true), array('y','n'), 'y'); + if ((low($wannaDoAssoc) == 'y' || low($wannaDoAssoc) == 'yes')) { + $associations = $this->doAssociations($tempModel); + } + + $this->out(''); + $this->hr(); + $this->out(__('The following Model will be created:', true)); + $this->hr(); + $this->out("Name: " . $currentModelName); + + if ($useDbConfig !== 'default') { + $this->out("DB Config: " . $useDbConfig); + } + if ($fullTableName !== Inflector::tableize($currentModelName)) { + $this->out("DB Table: " . $fullTableName); + } + if ($primaryKey != 'id') { + $this->out("Primary Key: " . $primaryKey); + } + if (!empty($validate)) { + $this->out("Validation: " . print_r($validate, true)); + } + if (!empty($associations)) { + $this->out("Associations:"); + + if (!empty($associations['belongsTo'])) { + for ($i = 0; $i < count($associations['belongsTo']); $i++) { + $this->out(" $currentModelName belongsTo {$associations['belongsTo'][$i]['alias']}"); + } + } + + if (!empty($associations['hasOne'])) { + for ($i = 0; $i < count($associations['hasOne']); $i++) { + $this->out(" $currentModelName hasOne {$associations['hasOne'][$i]['alias']}"); + } + } + + if (!empty($associations['hasMany'])) { + for ($i = 0; $i < count($associations['hasMany']); $i++) { + $this->out(" $currentModelName hasMany {$associations['hasMany'][$i]['alias']}"); + } + } + + if (!empty($associations['hasAndBelongsToMany'])) { + for ($i = 0; $i < count($associations['hasAndBelongsToMany']); $i++) { + $this->out(" $currentModelName hasAndBelongsToMany {$associations['hasAndBelongsToMany'][$i]['alias']}"); + } + } + } + $this->hr(); + $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); + + if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + if ($this->bake($currentModelName, $associations, $validate, $primaryKey, $useTable, $useDbConfig)) { + if ($this->_checkUnitTest()) { + $this->bakeTest($currentModelName, $useTable, $associations); + } + } + } else { + return false; + } + } +/** + * Handles associations + * + * @param object $model + * @param boolean $interactive + * @return array $validate + * @access public + */ + function doValidation(&$model, $interactive = true) { + if (!is_object($model)) { + return false; + } + $fields = $model->schema(); + + if (empty($fields)) { + return false; + } + + $validate = array(); + $options = array('VALID_NOT_EMPTY', 'VALID_EMAIL', 'VALID_NUMER', 'VALID_YEAR'); + + if (class_exists('Validation')) { + $parent = get_class_methods(get_parent_class('Validation')); + $options = array_diff(get_class_methods('Validation'), $parent); + } + + foreach ($fields as $fieldName => $field) { + $prompt = 'Field: ' . $fieldName . "\n"; + $prompt .= 'Type: ' . $field['type'] . "\n"; + $prompt .= '---------------------------------------------------------------'."\n"; + $prompt .= 'Please select one of the following validation options:'."\n"; + $prompt .= '---------------------------------------------------------------'."\n"; + $choices = array(); + $skip = 1; + sort($options); + foreach ($options as $key => $option) { + if ($option{0} != '_' && strtolower($option) != 'getinstance') { + $prompt .= "{$skip} - {$option}\n"; + $choices[$skip] = strtolower($option); + $skip++; + } + } + $methods = array_flip($choices); + + $prompt .= "{$skip} - Do not do any validation on this field.\n"; + $prompt .= "... or enter in a valid regex validation string.\n"; + + $guess = $skip; + if ($field['null'] != 1 && $fieldName != $model->primaryKey && !in_array($fieldName, array('created', 'modified', 'updated'))) { + if ($fieldName == 'email') { + $guess = $methods['email']; + } elseif ($field['type'] == 'string') { + $guess = $methods['alphanumeric']; + } elseif ($field['type'] == 'integer') { + $guess = $methods['numeric']; + } elseif ($field['type'] == 'boolean') { + $guess = $methods['numeric']; + } elseif ($field['type'] == 'datetime') { + $guess = $methods['date']; + } + } + + if ($interactive === true) { + $this->out(''); + $choice = $this->in($prompt, null, $guess); + } else { + $choice = $guess; + } + if ($choice != $skip) { + if (is_numeric($choice) && isset($choices[$choice])) { + $validate[$fieldName] = $choices[$choice]; + } else { + $validate[$fieldName] = $choice; + } + } + } + return $validate; + } + +/** + * Handles associations + * + * @param object $model + * @param boolean $interactive + * @return array $assocaitons + * @access public + */ + function doAssociations(&$model, $interactive = true) { + + if (!is_object($model)) { + return false; + } + $this->out(__('One moment while the associations are detected.', true)); + + $fields = $model->schema(); + + if (empty($fields)) { + return false; + } + + $primaryKey = $model->primaryKey; + $foreignKey = $this->_modelKey($model->name); + + $associations = $possibleKeys = array(); + + //Look for belongsTo + $i = 0; + foreach ($fields as $fieldName => $field) { + $offset = strpos($fieldName, '_id'); + if ($fieldName != $model->primaryKey && $offset !== false) { + $tmpModelName = $this->_modelNameFromKey($fieldName); + $associations['belongsTo'][$i]['alias'] = $tmpModelName; + $associations['belongsTo'][$i]['className'] = $tmpModelName; + $associations['belongsTo'][$i]['foreignKey'] = $fieldName; + $i++; + } + } + //Look for hasOne and hasMany and hasAndBelongsToMany + $i = $j = 0; + + foreach ($this->__tables as $otherTable) { + App::import('Model'); + $tmpModelName = $this->_modelName($otherTable); + $tempOtherModel = & new Model(array('name' => $tmpModelName, 'table' => $otherTable, 'ds' => $model->useDbConfig)); + $modelFieldsTemp = $tempOtherModel->schema(); + + $offset = strpos($otherTable, $model->table . '_'); + $otherOffset = strpos($otherTable, '_' . $model->table); + + foreach ($modelFieldsTemp as $fieldName => $field) { + if ($field['type'] == 'integer' || $field['type'] == 'string') { + $possibleKeys[$otherTable][] = $fieldName; + } + if ($fieldName != $model->primaryKey && $fieldName == $foreignKey && $offset === false && $otherOffset === false) { + $associations['hasOne'][$j]['alias'] = $tempOtherModel->name; + $associations['hasOne'][$j]['className'] = $tempOtherModel->name; + $associations['hasOne'][$j]['foreignKey'] = $fieldName; + + $associations['hasMany'][$j]['alias'] = $tempOtherModel->name; + $associations['hasMany'][$j]['className'] = $tempOtherModel->name; + $associations['hasMany'][$j]['foreignKey'] = $fieldName; + $j++; + } + } + + if ($offset !== false) { + $offset = strlen($model->table . '_'); + $tmpModelName = $this->_modelName(substr($otherTable, $offset)); + $associations['hasAndBelongsToMany'][$i]['alias'] = $tmpModelName; + $associations['hasAndBelongsToMany'][$i]['className'] = $tmpModelName; + $associations['hasAndBelongsToMany'][$i]['foreignKey'] = $foreignKey; + $associations['hasAndBelongsToMany'][$i]['associationForeignKey'] = $this->_modelKey($tmpModelName); + $associations['hasAndBelongsToMany'][$i]['joinTable'] = $otherTable; + $i++; + } + + if ($otherOffset !== false) { + $tmpModelName = $this->_modelName(substr($otherTable, 0, $otherOffset)); + $associations['hasAndBelongsToMany'][$i]['alias'] = $tmpModelName; + $associations['hasAndBelongsToMany'][$i]['className'] = $tmpModelName; + $associations['hasAndBelongsToMany'][$i]['foreignKey'] = $foreignKey; + $associations['hasAndBelongsToMany'][$i]['associationForeignKey'] = $this->_modelKey($tmpModelName); + $associations['hasAndBelongsToMany'][$i]['joinTable'] = $otherTable; + $i++; + } + } + + if ($interactive !== true) { + unset($associations['hasOne']); + } + + if ($interactive === true) { + $this->hr(); + if (empty($associations)) { + $this->out(__('None found.', true)); + } else { + $this->out(__('Please confirm the following associations:', true)); + $this->hr(); + foreach ($associations as $type => $settings) { + if (!empty($associations[$type])) { + $count = count($associations[$type]); + $response = 'y'; + for ($i = 0; $i < $count; $i++) { + $prompt = "{$model->name} {$type} {$associations[$type][$i]['alias']}"; + $response = $this->in("{$prompt}?", array('y','n'), 'y'); + + if ('n' == low($response) || 'no' == low($response)) { + unset($associations[$type][$i]); + } else { + if ($model->name === $associations[$type][$i]['alias']) { + if ($type === 'belongsTo') { + $alias = 'Parent' . $associations[$type][$i]['alias']; + } + if($type === 'hasOne' || $type === 'hasMany') { + $alias = 'Child' . $associations[$type][$i]['alias']; + } + + $alternateAlias = $this->in(sprintf(__('This is a self join. Use %s as the alias', true), $alias), array('y', 'n'), 'y'); + + if ('n' == low($alternateAlias) || 'no' == low($alternateAlias)) { + $associations[$type][$i]['alias'] = $this->in(__('Specify an alternate alias.', true)); + } else { + $associations[$type][$i]['alias'] = $alias; + } + } + } + } + $associations[$type] = array_merge($associations[$type]); + } + } + } + + $wannaDoMoreAssoc = $this->in(__('Would you like to define some additional model associations?', true), array('y','n'), 'n'); + + while ((low($wannaDoMoreAssoc) == 'y' || low($wannaDoMoreAssoc) == 'yes')) { + $assocs = array(1 => 'belongsTo', 2 => 'hasOne', 3 => 'hasMany', 4 => 'hasAndBelongsToMany'); + $bad = true; + while ($bad) { + $this->out(__('What is the association type?', true)); + $prompt = "1. belongsTo\n"; + $prompt .= "2. hasOne\n"; + $prompt .= "3. hasMany\n"; + $prompt .= "4. hasAndBelongsToMany\n"; + $assocType = intval($this->in($prompt, null, __("Enter a number", true))); + + if (intval($assocType) < 1 || intval($assocType) > 4) { + $this->out(__('The selection you entered was invalid. Please enter a number between 1 and 4.', true)); + } else { + $bad = false; + } + } + $this->out(__('For the following options be very careful to match your setup exactly. Any spelling mistakes will cause errors.', true)); + $this->hr(); + $alias = $this->in(__('What is the alias for this association?', true)); + $className = $this->in(sprintf(__('What className will %s use?', true), $alias), null, $alias ); + $suggestedForeignKey = null; + if ($assocType == '1') { + $showKeys = $possibleKeys[$model->table]; + $suggestedForeignKey = $this->_modelKey($alias); + } else { + $otherTable = Inflector::tableize($className); + if (in_array($otherTable, $this->__tables)) { + if ($assocType < '4') { + $showKeys = $possibleKeys[$otherTable]; + } else { + $showKeys = null; + } + } else { + $otherTable = $this->in(__('What is the table for this model?', true)); + $showKeys = $possibleKeys[$otherTable]; + } + $suggestedForeignKey = $this->_modelKey($model->name); + } + if (!empty($showKeys)) { + $this->out(__('A helpful List of possible keys', true)); + for ($i = 0; $i < count($showKeys); $i++) { + $this->out($i + 1 . ". " . $showKeys[$i]); + } + $foreignKey = $this->in(__('What is the foreignKey?', true), null, __("Enter a number", true)); + if (intval($foreignKey) > 0 && intval($foreignKey) <= $i ) { + $foreignKey = $showKeys[intval($foreignKey) - 1]; + } + } + if (!isset($foreignKey)) { + $foreignKey = $this->in(__('What is the foreignKey? Specify your own.', true), null, $suggestedForeignKey); + } + if ($assocType == '4') { + $associationForeignKey = $this->in(__('What is the associationForeignKey?', true), null, $this->_modelKey($model->name)); + $joinTable = $this->in(__('What is the joinTable?', true)); + } + $associations[$assocs[$assocType]] = array_values((array)$associations[$assocs[$assocType]]); + $count = count($associations[$assocs[$assocType]]); + $i = ($count > 0) ? $count : 0; + $associations[$assocs[$assocType]][$i]['alias'] = $alias; + $associations[$assocs[$assocType]][$i]['className'] = $className; + $associations[$assocs[$assocType]][$i]['foreignKey'] = $foreignKey; + if ($assocType == '4') { + $associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey; + $associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable; + } + $wannaDoMoreAssoc = $this->in(__('Define another association?', true), array('y','n'), 'y'); + } + } + return $associations; + } +/** + * Assembles and writes a Model file. + * + * @param mixed $name Model name or object + * @param mixed $associations if array and $name is not an object assume Model associations array otherwise boolean interactive + * @param array $validate Validation rules + * @param string $primaryKey Primary key to use + * @param string $useTable Table to use + * @param string $useDbConfig Database configuration setting to use + * @access private + */ + function bake($name, $associations = array(), $validate = array(), $primaryKey = 'id', $useTable = null, $useDbConfig = 'default') { + + if (is_object($name)) { + if (!is_array($associations)) { + $associations = $this->doAssociations($name, $associations); + $validate = $this->doValidation($name, $associations); + } + $primaryKey = $name->primaryKey; + $useTable = $name->table; + $useDbConfig = $name->useDbConfig; + $name = $name->name; + } + + $out = "plugin}AppModel {\n\n"; + $out .= "\tvar \$name = '{$name}';\n"; + + if ($useDbConfig !== 'default') { + $out .= "\tvar \$useDbConfig = '$useDbConfig';\n"; + } + + if (($useTable && $useTable !== Inflector::tableize($name)) || $useTable === false) { + $table = "'$useTable'"; + if (!$useTable) { + $table = 'false'; + } + $out .= "\tvar \$useTable = $table;\n"; + } + + if ($primaryKey !== 'id') { + $out .= "\tvar \$primaryKey = '$primaryKey';\n"; + } + + $validateCount = count($validate); + if (is_array($validate) && $validateCount > 0) { + $out .= "\tvar \$validate = array(\n"; + $keys = array_keys($validate); + for ($i = 0; $i < $validateCount; $i++) { + $out .= "\t\t'" . $keys[$i] . "' => array('" . $validate[$keys[$i]] . "')"; + if ($i + 1 < $validateCount) { + $out .= ","; + } + $out .= "\n"; + } + $out .= "\t);\n"; + } + $out .= "\n"; + + if (!empty($associations)) { + if (!empty($associations['belongsTo']) || !empty($associations['$hasOne']) || !empty($associations['hasMany']) || !empty($associations['hasAndBelongsToMany'])) { + $out.= "\t//The Associations below have been created with all possible keys, those that are not needed can be removed\n"; + } + + if (!empty($associations['belongsTo'])) { + $out .= "\tvar \$belongsTo = array(\n"; + $belongsToCount = count($associations['belongsTo']); + + for ($i = 0; $i < $belongsToCount; $i++) { + $out .= "\t\t\t'{$associations['belongsTo'][$i]['alias']}' => "; + $out .= "array('className' => '{$associations['belongsTo'][$i]['className']}',\n"; + $out .= "\t\t\t\t\t\t\t\t'foreignKey' => '{$associations['belongsTo'][$i]['foreignKey']}',\n"; + $out .= "\t\t\t\t\t\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'fields' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'order' => ''\n"; + $out .= "\t\t\t)"; + if ($i + 1 < $belongsToCount) { + $out .= ","; + } + $out .= "\n"; + + } + $out .= "\t);\n\n"; + } + + if (!empty($associations['hasOne'])) { + $out .= "\tvar \$hasOne = array(\n"; + $hasOneCount = count($associations['hasOne']); + + for ($i = 0; $i < $hasOneCount; $i++) { + $out .= "\t\t\t'{$associations['hasOne'][$i]['alias']}' => "; + $out .= "array('className' => '{$associations['hasOne'][$i]['className']}',\n"; + $out .= "\t\t\t\t\t\t\t\t'foreignKey' => '{$associations['hasOne'][$i]['foreignKey']}',\n"; + $out .= "\t\t\t\t\t\t\t\t'dependent' => false,\n"; + $out .= "\t\t\t\t\t\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'fields' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'order' => ''\n"; + $out .= "\t\t\t)"; + if ($i + 1 < $hasOneCount) { + $out .= ","; + } + $out .= "\n"; + + } + $out .= "\t);\n\n"; + } + + if (!empty($associations['hasMany'])) { + $out .= "\tvar \$hasMany = array(\n"; + $hasManyCount = count($associations['hasMany']); + + for ($i = 0; $i < $hasManyCount; $i++) { + $out .= "\t\t\t'{$associations['hasMany'][$i]['alias']}' => "; + $out .= "array('className' => '{$associations['hasMany'][$i]['className']}',\n"; + $out .= "\t\t\t\t\t\t\t\t'foreignKey' => '{$associations['hasMany'][$i]['foreignKey']}',\n"; + $out .= "\t\t\t\t\t\t\t\t'dependent' => false,\n"; + $out .= "\t\t\t\t\t\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'fields' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'order' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'limit' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'offset' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'exclusive' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'finderQuery' => '',\n"; + $out .= "\t\t\t\t\t\t\t\t'counterQuery' => ''\n"; + $out .= "\t\t\t)"; + if ($i + 1 < $hasManyCount) { + $out .= ","; + } + $out .= "\n"; + } + $out .= "\t);\n\n"; + } + + if (!empty($associations['hasAndBelongsToMany'])) { + $out .= "\tvar \$hasAndBelongsToMany = array(\n"; + $hasAndBelongsToManyCount = count($associations['hasAndBelongsToMany']); + + for ($i = 0; $i < $hasAndBelongsToManyCount; $i++) { + $out .= "\t\t\t'{$associations['hasAndBelongsToMany'][$i]['alias']}' => "; + $out .= "array('className' => '{$associations['hasAndBelongsToMany'][$i]['className']}',\n"; + $out .= "\t\t\t\t\t\t'joinTable' => '{$associations['hasAndBelongsToMany'][$i]['joinTable']}',\n"; + $out .= "\t\t\t\t\t\t'foreignKey' => '{$associations['hasAndBelongsToMany'][$i]['foreignKey']}',\n"; + $out .= "\t\t\t\t\t\t'associationForeignKey' => '{$associations['hasAndBelongsToMany'][$i]['associationForeignKey']}',\n"; + $out .= "\t\t\t\t\t\t'unique' => true,\n"; + $out .= "\t\t\t\t\t\t'conditions' => '',\n"; + $out .= "\t\t\t\t\t\t'fields' => '',\n"; + $out .= "\t\t\t\t\t\t'order' => '',\n"; + $out .= "\t\t\t\t\t\t'limit' => '',\n"; + $out .= "\t\t\t\t\t\t'offset' => '',\n"; + $out .= "\t\t\t\t\t\t'finderQuery' => '',\n"; + $out .= "\t\t\t\t\t\t'deleteQuery' => '',\n"; + $out .= "\t\t\t\t\t\t'insertQuery' => ''\n"; + $out .= "\t\t\t)"; + if ($i + 1 < $hasAndBelongsToManyCount) { + $out .= ","; + } + $out .= "\n"; + } + $out .= "\t);\n\n"; + } + } + $out .= "}\n"; + $out .= "?>"; + $filename = $this->path . Inflector::underscore($name) . '.php'; + $this->out("\nBaking model class for $name..."); + return $this->createFile($filename, $out); + } + +/** + * Assembles and writes a unit test file + * + * @param string $className Model class name + * @access private + */ + function bakeTest($className, $useTable = null, $associations = array()) { + $results = $this->fixture($className, $useTable); + + if ($results) { + $fixtureInc = 'app'; + if ($this->plugin) { + $fixtureInc = 'plugin.'.Inflector::underscore($this->plugin); + } + + $fixture[] = "'{$fixtureInc}." . Inflector::underscore($className) ."'"; + + if (!empty($associations)) { + $assoc[] = Set::extract($associations, 'belongsTo.{n}.className'); + $assoc[] = Set::extract($associations, 'hasOne.{n}.className'); + $assoc[] = Set::extract($associations, 'hasMany.{n}.className'); + foreach ($assoc as $key => $value) { + if (is_array($value)) { + foreach ($value as $class) { + $fixture[] = "'{$fixtureInc}." . Inflector::underscore($class) ."'"; + } + } + } + } + $fixture = join(", ", $fixture); + + $import = $className; + if (isset($this->plugin)) { + $import = $this->plugin . '.' . $className; + } + + $out = "App::import('Model', '$import');\n\n"; + $out .= "class Test{$className} extends {$className} {\n"; + $out .= "\tvar \$cacheSources = false;\n"; + $out .= "\tvar \$useDbConfig = 'test_suite';\n}\n\n"; + $out .= "class {$className}TestCase extends CakeTestCase {\n"; + $out .= "\tvar \${$className} = null;\n"; + $out .= "\tvar \$fixtures = array($fixture);\n\n"; + $out .= "\tfunction start() {\n\t\tparent::start();\n\t\t\$this->{$className} = new Test{$className}();\n\t}\n\n"; + $out .= "\tfunction test{$className}Instance() {\n"; + $out .= "\t\t\$this->assertTrue(is_a(\$this->{$className}, '{$className}'));\n\t}\n\n"; + $out .= "\tfunction test{$className}Find() {\n"; + $out .= "\t\t\$results = \$this->{$className}->recursive = -1;\n"; + $out .= "\t\t\$results = \$this->{$className}->find('first');\n\t\t\$this->assertTrue(!empty(\$results));\n\n"; + $out .= "\t\t\$expected = array('$className' => array(\n$results\n\t\t\t));\n"; + $out .= "\t\t\$this->assertEqual(\$results, \$expected);\n\t}\n}\n"; + + $path = MODEL_TESTS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'cases' . DS . 'models' . DS; + } + + $filename = Inflector::underscore($className).'.test.php'; + $this->out("\nBaking unit test for $className..."); + + $header = '$Id'; + $content = ""; + return $this->createFile($path . $filename, $content); + } + return false; + } +/** + * outputs the a list of possible models or controllers from database + * + * @param string $useDbConfig Database configuration name + * @access public + */ + function listAll($useDbConfig = 'default', $interactive = true) { + $db =& ConnectionManager::getDataSource($useDbConfig); + $usePrefix = empty($db->config['prefix']) ? '' : $db->config['prefix']; + if ($usePrefix) { + $tables = array(); + foreach ($db->listSources() as $table) { + if (!strncmp($table, $usePrefix, strlen($usePrefix))) { + $tables[] = substr($table, strlen($usePrefix)); + } + } + } else { + $tables = $db->listSources(); + } + if (empty($tables)) { + $this->err(__('Your database does not have any tables.', true)); + $this->stop(); + } + + $this->__tables = $tables; + + if ($interactive === true) { + $this->out(__('Possible Models based on your current database:', true)); + $this->_modelNames = array(); + $count = count($tables); + for ($i = 0; $i < $count; $i++) { + $this->_modelNames[] = $this->_modelName($tables[$i]); + $this->out($i + 1 . ". " . $this->_modelNames[$i]); + } + } + } +/** + * Forces the user to specify the model he wants to bake, and returns the selected model name. + * + * @return string the model name + * @access public + */ + function getName($useDbConfig) { + $this->listAll($useDbConfig); + + $enteredModel = ''; + + while ($enteredModel == '') { + $enteredModel = $this->in(__("Enter a number from the list above, type in the name of another model, or 'q' to exit", true), null, 'q'); + + if ($enteredModel === 'q') { + $this->out(__("Exit", true)); + $this->stop(); + } + + if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) { + $this->err(__("The model name you supplied was empty, or the number you selected was not an option. Please try again.", true)); + $enteredModel = ''; + } + } + + if (intval($enteredModel) > 0 && intval($enteredModel) <= count($this->_modelNames)) { + $currentModelName = $this->_modelNames[intval($enteredModel) - 1]; + } else { + $currentModelName = $enteredModel; + } + + return $currentModelName; + } +/** + * Displays help contents + * + * @access public + */ + function help() { + $this->hr(); + $this->out("Usage: cake bake model "); + $this->hr(); + $this->out('Commands:'); + $this->out("\n\tmodel\n\t\tbakes model in interactive mode."); + $this->out("\n\tmodel \n\t\tbakes model file with no associations or validation"); + $this->out(""); + $this->stop(); + } +/** + * Builds the tests fixtures for the model and create the file + * + * @param string $model the name of the model + * @param string $useTable table name + * @return array $records, used in ModelTask::bakeTest() to create $expected + * @todo move this to a task + */ + function fixture($model, $useTable = null) { + if (!class_exists('CakeSchema')) { + App::import('Model', 'Schema'); + } + $out = "\nclass {$model}Fixture extends CakeTestFixture {\n"; + $out .= "\tvar \$name = '$model';\n"; + + if (!$useTable) { + $useTable = Inflector::tableize($model); + } else { + $out .= "\tvar \$table = '$useTable';\n"; + } + $schema = new CakeSchema(); + $data = $schema->read(array('models' => false)); + + if (!isset($data['tables'][$useTable])) { + return false; + } + $tables[$model] = $data['tables'][$useTable]; + + foreach ($tables as $table => $fields) { + if (!is_numeric($table) && $table !== 'missing') { + $out .= "\tvar \$fields = array(\n"; + $records = array(); + if (is_array($fields)) { + $cols = array(); + foreach ($fields as $field => $value) { + if ($field != 'indexes') { + if (is_string($value)) { + $type = $value; + $value = array('type'=> $type); + } + $col = "\t\t\t'{$field}' => array('type'=>'" . $value['type'] . "', "; + + switch ($value['type']) { + case 'integer': + $insert = 1; + break; + case 'string'; + $insert = "Lorem ipsum dolor sit amet"; + if (!empty($value['length'])) { + $insert = substr($insert, 0, (int)$value['length'] - 2); + } + $insert = "'$insert'"; + break; + case 'datetime': + $ts = date('Y-m-d H:i:s'); + $insert = "'$ts'"; + break; + case 'date': + $ts = date('Y-m-d'); + $insert = "'$ts'"; + break; + case 'time': + $ts = date('H:i:s'); + $insert = "'$ts'"; + break; + case 'boolean': + $insert = 1; + break; + case 'text': + $insert = + '\'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, + phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, + vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, + feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis. + Orci aliquet, in lorem et velit maecenas luctus, wisi nulla at, mauris nam ut a, lorem et et elit eu. + Sed dui facilisi, adipiscing mollis lacus congue integer, faucibus consectetuer eros amet sit sit, + magna dolor posuere. Placeat et, ac occaecat rutrum ante ut fusce. Sit velit sit porttitor non enim purus, + id semper consectetuer justo enim, nulla etiam quis justo condimentum vel, malesuada ligula arcu. Nisl neque, + ligula cras suscipit nunc eget, et tellus in varius urna odio est. Fuga urna dis metus euismod laoreet orci, + litora luctus suspendisse sed id luctus ut. Pede volutpat quam vitae, ut ornare wisi. Velit dis tincidunt, + pede vel eleifend nec curabitur dui pellentesque, volutpat taciti aliquet vivamus viverra, eget tellus ut + feugiat lacinia mauris sed, lacinia et felis.\''; + break; + } + $records[] = "\t\t\t'$field' => $insert"; + unset($value['type']); + $col .= join(', ', $schema->__values($value)); + } else { + $col = "\t\t\t'indexes' => array("; + $props = array(); + foreach ((array)$value as $key => $index) { + $props[] = "'{$key}' => array(".join(', ', $schema->__values($index)).")"; + } + $col .= join(', ', $props); + } + $col .= ")"; + $cols[] = $col; + } + $out .= join(",\n", $cols); + } + $out .= "\n\t\t\t);\n"; + } + } + $records = join(",\n", $records); + $out .= "\tvar \$records = array(array(\n$records\n\t\t\t));\n"; + $out .= "}\n"; + $path = TESTS . DS . 'fixtures' . DS; + if (isset($this->plugin)) { + $pluginPath = 'plugins' . DS . Inflector::underscore($this->plugin) . DS; + $path = APP . $pluginPath . 'tests' . DS . 'fixtures' . DS; + } + $filename = Inflector::underscore($model).'_fixture.php'; + $header = '$Id'; + $content = ""; + $this->out("\nBaking test fixture for $model..."); + if ($this->createFile($path . $filename, $content)) { + return $records; + } + return false; + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/plugin.php b/cake/console/libs/tasks/plugin.php new file mode 100644 index 000000000..a199f2ee9 --- /dev/null +++ b/cake/console/libs/tasks/plugin.php @@ -0,0 +1,204 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +if (!class_exists('File')) { + uses('file'); +} +/** + * Task class for creating a plugin + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class PluginTask extends Shell { +/** + * Tasks + * + */ + var $tasks = array('Model', 'Controller', 'View'); +/** + * path to CONTROLLERS directory + * + * @var array + * @access public + */ + var $path = null; +/** + * initialize + * + * @return void + */ + function initialize() { + $this->path = APP . 'plugins' . DS; + } +/** + * Execution method always used for tasks + * + * @return void + */ + function execute() { + if (empty($this->params['skel'])) { + $this->params['skel'] = ''; + if (is_dir(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel') === true) { + $this->params['skel'] = CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel'; + } + } + + $plugin = null; + + if(isset($this->args[0])) { + $plugin = Inflector::camelize($this->args[0]); + $pluginPath = Inflector::underscore($plugin) . DS; + $this->Dispatch->shiftArgs(); + if (is_dir($this->path . $pluginPath)) { + $this->out(sprintf('Plugin: %s', $plugin)); + $this->out(sprintf('Path: %s', $this->path . $pluginPath)); + $this->hr(); + } elseif (isset($this->args[0])) { + $this->err(sprintf('%s in path %s not found.', $plugin, $this->path . $pluginPath)); + $this->stop(); + } else { + $this->__interactive($plugin); + } + } + + if(isset($this->args[0])) { + $task = Inflector::classify($this->args[0]); + $this->Dispatch->shiftArgs(); + if (in_array($task, $this->tasks)) { + $this->{$task}->plugin = $plugin; + $this->{$task}->path = $this->path . $pluginPath . Inflector::underscore(Inflector::pluralize($task)) . DS; + + if (!is_dir($this->{$task}->path)) { + $this->err(sprintf(__("%s directory could not be found.\nBe sure you have created %s", true), $task, $this->{$task}->path)); + } + $this->{$task}->loadTasks(); + $this->{$task}->execute(); + } + } + } + +/** + * Interactive interface + * + * @access private + * @return void + */ + function __interactive($plugin = null) { + while ($plugin === null) { + $plugin = $this->in(__('Enter the name of the plugin in CamelCase format', true)); + } + + if (!$this->bake($plugin)) { + $this->err(sprintf(__("An error occured trying to bake: %s in %s", true), $plugin, $this->path . $pluginPath)); + } + } + +/** + * Bake the plugin, create directories and files + * + * @params $plugin name of the plugin in CamelCased format + * @access public + * @return bool + */ + function bake($plugin) { + + $pluginPath = Inflector::underscore($plugin); + + $this->hr(); + $this->out("Plugin Name: $plugin"); + $this->out("Plugin Directory: {$this->path}{$pluginPath}"); + $this->hr(); + + + $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); + + if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); + + $Folder = new Folder($this->path . $pluginPath); + $directories = array('models' . DS . 'behaviors', 'controllers' . DS . 'components', 'views' . DS . 'helpers'); + + foreach ($directories as $directory) { + $Folder->create($this->path . $pluginPath . DS . $directory); + } + + if (low($verbose) == 'y' || low($verbose) == 'yes') { + foreach ($Folder->messages() as $message) { + $this->out($message); + } + } + + $errors = $Folder->errors(); + if (!empty($errors)) { + return false; + } + + $controllerFileName = $pluginPath . '_app_controller.php'; + + $out = "\n"; + $this->createFile($this->path . $pluginPath. DS . $controllerFileName, $out); + + $modelFileName = $pluginPath . '_app_model.php'; + + $out = "\n"; + $this->createFile($this->path . $pluginPath . DS . $modelFileName, $out); + + $this->hr(); + $this->out(sprintf(__("Created: %s in %s", true), $plugin, $this->path . $pluginPath)); + $this->hr(); + } + + return true; + } +/** + * Help + * + * @return void + * @access public + */ + function help() { + $this->hr(); + $this->out("Usage: cake bake plugin ..."); + $this->hr(); + $this->out('Commands:'); + $this->out("\n\tplugin \n\t\tbakes plugin directory structure"); + $this->out("\n\tplugin model\n\t\tbakes model. Run 'cake bake model help' for more info."); + $this->out("\n\tplugin controller\n\t\tbakes controller. Run 'cake bake controller help' for more info."); + $this->out("\n\tplugin view\n\t\tbakes view. Run 'cake bake view help' for more info."); + $this->out(""); + $this->stop(); + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/project.php b/cake/console/libs/tasks/project.php new file mode 100644 index 000000000..fbd1e27d3 --- /dev/null +++ b/cake/console/libs/tasks/project.php @@ -0,0 +1,295 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.scripts.bake + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +if (!class_exists('File')) { + uses('file'); +} +/** + * Task class for creating new project apps and plugins + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class ProjectTask extends Shell { +/** + * Override + * + * @access public + */ + function initialize() { + } +/** + * Override + * + * @access public + */ + function startup() { + } +/** + * Checks that given project path does not already exist, and + * finds the app directory in it. Then it calls bake() with that information. + * + * @param string $project Project path + * @access public + */ + function execute($project = null) { + if ($project === null) { + if (isset($this->args[0])) { + $project = $this->args[0]; + $this->Dispatch->shiftArgs(); + } + } + + if ($project) { + $this->Dispatch->parseParams(array('-app', $project)); + $project = $this->params['working']; + } + + if (empty($this->params['skel'])) { + $this->params['skel'] = ''; + if (is_dir(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel') === true) { + $this->params['skel'] = CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel'; + } + } + + while (!$project) { + $project = $this->in("What is the full path for this app including the app directory name?\nExample: ".$this->params['working'] . DS . "myapp", null, $this->params['working'] . DS . 'myapp'); + } + + if ($project) { + $response = false; + while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) { + $response = $this->in('A project already exists in this location: '.$project.' Overwrite?', array('y','n'), 'n'); + if (strtolower($response) === 'n') { + $response = $project = false; + } + } + } + + if($this->bake($project)) { + $path = Folder::slashTerm($project); + if ($this->createHome($path)) { + $this->out(__('Welcome page created', true)); + } else { + $this->out(__('The Welcome page was NOT created', true)); + } + + if ($this->securitySalt($path) === true ) { + $this->out(__('Random hash key created for \'Security.salt\'', true)); + } else { + $this->err(sprintf(__('Unable to generate random hash for \'Security.salt\', you should change it in %s', true), CONFIGS . 'core.php')); + } + + $corePath = $this->corePath($path); + if ($corePath === true ) { + $this->out(sprintf(__('CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', true), CAKE_CORE_INCLUDE_PATH)); + $this->out(sprintf(__('CAKE_CORE_INCLUDE_PATH set to %s in webroot/test.php', true), CAKE_CORE_INCLUDE_PATH)); + $this->out(__('Remember to check these value after moving to production server', true)); + } elseif ($corePath === false) { + $this->err(sprintf(__('Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s', true), $path . 'webroot' .DS .'index.php')); + } + $Folder = new Folder($path); + if (!$Folder->chmod($path . 'tmp', 0777)) { + $this->err(sprintf(__('Could not set permissions on %s', true), $path . DS .'tmp')); + $this->out(sprintf(__('chmod -R 0777 %s', true), $path . DS .'tmp')); + } + return true; + } + } +/** + * Looks for a skeleton template of a Cake application, + * and if not found asks the user for a path. When there is a path + * this method will make a deep copy of the skeleton to the project directory. + * A default home page will be added, and the tmp file storage will be chmod'ed to 0777. + * + * @param string $path Project path + * @param string $skel Path to copy from + * @param string $skip array of directories to skip when copying + * @access private + */ + function bake($path, $skel = null, $skip = array('empty')) { + if(!$skel) { + $skel = $this->params['skel']; + } + + while (!$skel) { + $skel = $this->in(sprintf(__("What is the path to the directory layout you wish to copy?\nExample: %s"), APP, null, ROOT . DS . 'myapp' . DS)); + if ($skel == '') { + $this->out(__('The directory path you supplied was empty. Please try again.', true)); + } else { + while (is_dir($skel) === false) { + $skel = $this->in(__('Directory path does not exist please choose another:', true)); + } + } + } + + $app = basename($path); + + $this->out('Bake Project'); + $this->out("Skel Directory: $skel"); + $this->out("Will be copied to: {$path}"); + $this->hr(); + + $looksGood = $this->in('Look okay?', array('y', 'n', 'q'), 'y'); + + if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); + + $Folder = new Folder($skel); + if ($Folder->copy(array('to' => $path, 'skip' => $skip))) { + $this->hr(); + $this->out(sprintf(__("Created: %s in %s", true), $app, $path)); + $this->hr(); + } else { + $this->err(" '".$app."' could not be created properly"); + return false; + } + + if (low($verbose) == 'y' || low($verbose) == 'yes') { + foreach ($Folder->messages() as $message) { + $this->out($message); + } + } + + return true; + } elseif (low($looksGood) == 'q' || low($looksGood) == 'quit') { + $this->out('Bake Aborted.'); + } else { + $this->execute(false); + return false; + } + } +/** + * Writes a file with a default home page to the project. + * + * @param string $dir Path to project + * @return boolean Success + * @access public + */ + function createHome($dir) { + $app = basename($dir); + $path = $dir . 'views' . DS . 'pages' . DS; + include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'views'.DS.'home.ctp'); + return $this->createFile($path.'home.ctp', $output); + } +/** + * Generates and writes 'Security.salt' + * + * @param string $path Project path + * @return boolean Success + * @access public + */ + function securitySalt($path) { + $File =& new File($path . 'config' . DS . 'core.php'); + $contents = $File->read(); + if (preg_match('/([\\t\\x20]*Configure::write\\(\\\'Security.salt\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { + uses('Security'); + $string = Security::generateAuthKey(); + $result = str_replace($match[0], "\t" . 'Configure::write(\'Security.salt\', \''.$string.'\');', $contents); + if ($File->write($result)) { + return true; + } else { + return false; + } + } else { + return false; + } + } +/** + * Generates and writes CAKE_CORE_INCLUDE_PATH + * + * @param string $path Project path + * @return boolean Success + * @access public + */ + function corePath($path) { + if (dirname($path) !== CAKE_CORE_INCLUDE_PATH) { + $File =& new File($path . 'webroot' . DS . 'index.php'); + $contents = $File->read(); + if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { + $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents); + if (!$File->write($result)) { + return false; + } + } else { + return false; + } + + $File =& new File($path . 'webroot' . DS . 'test.php'); + $contents = $File->read(); + if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) { + $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', '".CAKE_CORE_INCLUDE_PATH."');", $contents); + if (!$File->write($result)) { + return false; + } + } else { + return false; + } + return true; + } + } +/** + * Enables Configure::read('Routing.admin') in /app/config/core.php + * + * @param string $name Name to use as admin routing + * @return boolean Success + * @access public + */ + function cakeAdmin($name) { + $File =& new File(CONFIGS . 'core.php'); + $contents = $File->read(); + if (preg_match('%([/\\t\\x20]*Configure::write\(\'Routing.admin\',[\\t\\x20\'a-z]*\\);)%', $contents, $match)) { + $result = str_replace($match[0], "\t" . 'Configure::write(\'Routing.admin\', \''.$name.'\');', $contents); + if ($File->write($result)) { + Configure::write('Routing.admin', $name); + return true; + } else { + return false; + } + } else { + return false; + } + } +/** + * Help + * + * @return void + * @access public + */ + function help() { + $this->hr(); + $this->out("Usage: cake bake project "); + $this->hr(); + $this->out('Commands:'); + $this->out("\n\tproject \n\t\tbakes app directory structure.\n\t\tif begins with '/' path is absolute."); + $this->out(""); + $this->stop(); + } + +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php new file mode 100644 index 000000000..6e04ce1c9 --- /dev/null +++ b/cake/console/libs/tasks/test.php @@ -0,0 +1,198 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +/** + * Task class for creating and updating test files. + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class TestTask extends Shell { +/** + * Name of plugin + * + * @var string + * @access public + */ + var $plugin = null; +/** + * path to TESTS directory + * + * @var string + * @access public + */ + var $path = TESTS; +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (empty($this->args)) { + $this->__interactive(); + } + + if (count($this->args) == 1) { + $this->__interactive($this->args[0]); + } + + if (count($this->args) > 1) { + $class = Inflector::underscore($this->args[0]); + if ($this->bake($class, $this->args[1])) { + $this->out('done'); + } + } + } +/** + * Handles interactive baking + * + * @access private + */ + function __interactive($class = null) { + $this->hr(); + $this->out(sprintf("Bake Tests\nPath: %s", $this->path)); + $this->hr(); + + $key = null; + $options = array('Behavior', 'Helper', 'Component', 'Model', 'Controller'); + + if ($class !== null) { + $class = Inflector::camelize($class); + if (in_array($class, $options)) { + $key = array_search($class); + } + } + + while ($class == null) { + + $this->hr(); + $this->out("Select a class:"); + $this->hr(); + + $keys = array(); + foreach ($options as $key => $option) { + $this->out(++$key . '. ' . $option); + $keys[] = $key; + } + $keys[] = 'q'; + + $key = $this->in(__("Enter the class to test or (q)uit", true), $keys, 'q'); + + if ($key != 'q') { + if (isset($options[--$key])) { + $class = $options[$key]; + } + + if ($class) { + $this->path .= 'cases' . DS . Inflector::tableize($class) . DS; + + $name = $this->in(__("Enter the name for the test or (q)uit", true), null, 'q'); + if ($name !== 'q') { + $case = null; + while ($case !== 'q') { + $case = $this->in(__("Enter a test case or (q)uit", true), null, 'q'); + if ($case !== 'q') { + $cases[] = $case; + } + } + if ($this->bake($class, $name, $cases)) { + $this->out(__("Test baked\n", true)); + $type = null; + } + $class = null; + } + } + } else { + $this->stop(); + } + } + } +/** + * Writes File + * + * @access public + */ + function bake($class, $name = null, $cases = array()) { + if (!$name) { + return false; + } + + if (!is_array($cases)) { + $cases = array($cases); + } + + $name = Inflector::camelize($name); + $import = $name; + if (isset($this->plugin)) { + $import = $this->plugin . '.' . $name; + } + $extras = $this->__extras($class); + $out = "App::import('$class', '$import');\n"; + if ($class == 'Model') { + $class = null; + } + $out .= "class Test{$name} extends {$name}{$class} {\n"; + $out .= "{$extras}"; + $out .= "}\n\n"; + $out .= "class {$name}{$class}Test extends CakeTestCase {\n"; + $out .= "\n\tfunction start() {\n\t\tparent::start();\n\t\t\$this->{$name} = new Test{$name}();\n\t}\n"; + $out .= "\n\tfunction test{$name}Instance() {\n"; + $out .= "\t\t\$this->assertTrue(is_a(\$this->{$name}, '{$name}{$class}'));\n\t}\n"; + foreach ($cases as $case) { + $case = Inflector::classify($case); + $out .= "\n\tfunction test{$case}() {\n\n\t}\n"; + } + $out .= "}\n"; + + $this->out("Baking unit test for $name..."); + $this->out($out); + $ok = $this->in(__('Is this correct?'), array('y', 'n'), 'y'); + if ($ok == 'n') { + return false; + } + + $header = '$Id'; + $content = ""; + return $this->createFile($this->path . Inflector::underscore($name) . '.test.php', $content); + } +/** + * Handles the extra stuff needed + * + * @access private + */ + function __extras($class) { + $extras = null; + switch ($class) { + case 'Model': + $extras = "\n\tvar \$cacheSources = false;\n"; + break; + } + return $extras; + } +} +?> \ No newline at end of file diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php new file mode 100644 index 000000000..767d10fc7 --- /dev/null +++ b/cake/console/libs/tasks/view.php @@ -0,0 +1,389 @@ + + * Copyright 2005-2008, Cake Software Foundation, Inc. + * 1785 E. Sahara Avenue, Suite 490-204 + * Las Vegas, Nevada 89104 + * + * Licensed under The MIT License + * Redistributions of files must retain the above copyright notice. + * + * @filesource + * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. + * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project + * @package cake + * @subpackage cake.cake.console.libs.tasks + * @since CakePHP(tm) v 1.2 + * @version $Revision$ + * @modifiedby $LastChangedBy$ + * @lastmodified $Date$ + * @license http://www.opensource.org/licenses/mit-license.php The MIT License + */ +App::import('Core', 'Controller'); +/** + * Task class for creating and updating view files. + * + * @package cake + * @subpackage cake.cake.console.libs.tasks + */ +class ViewTask extends Shell { +/** + * Name of plugin + * + * @var string + * @access public + */ + var $plugin = null; +/** + * Tasks to be loaded by this Task + * + * @var array + * @access public + */ + var $tasks = array('Project', 'Controller'); +/** + * path to VIEWS directory + * + * @var array + * @access public + */ + var $path = VIEWS; +/** + * Name of the controller being used + * + * @var string + * @access public + */ + var $controllerName = null; +/** + * Path to controller to put views + * + * @var string + * @access public + */ + var $controllerPath = null; +/** + * The template file to use + * + * @var string + * @access public + */ + var $template = null; +/** + * Actions to use for scaffolding + * + * @var array + * @access public + */ + var $scaffoldActions = array('index', 'view', 'add', 'edit'); +/** + * Override initialize + * + * @access public + */ + function initialize() { + } +/** + * Execution method always used for tasks + * + * @access public + */ + function execute() { + if (empty($this->args)) { + $this->__interactive(); + } + + if (isset($this->args[0])) { + $controller = $action = $alias = null; + $this->controllerName = Inflector::camelize($this->args[0]); + $this->controllerPath = Inflector::underscore($this->controllerName); + + if (isset($this->args[1])) { + $this->template = $this->args[1]; + } + + if (isset($this->args[2])) { + $action = $this->args[2]; + } + + if (!$action) { + $action = $this->template; + } + + if (in_array($action, $this->scaffoldActions)) { + $this->bake($action, true); + } elseif ($action) { + $this->bake($action, true); + } else { + $vars = $this->__loadController(); + if ($vars) { + $protected = array_map('strtolower', get_class_methods('appcontroller')); + $classVars = get_class_vars($this->controllerName . 'Controller'); + if (array_key_exists('scaffold', $classVars)) { + $methods = $this->scaffoldActions; + } else { + $methods = get_class_methods($this->controllerName . 'Controller'); + } + $adminDelete = null; + + $adminRoute = Configure::read('Routing.admin'); + if (!empty($adminRoute)) { + $adminDelete = $adminRoute.'_delete'; + } + foreach ($methods as $method) { + if ($method{0} != '_' && !in_array(low($method), array_merge($protected, array('delete', $adminDelete)))) { + $content = $this->getContent($method, $vars); + $this->bake($method, $content); + } + } + } + } + } + } +/** + * Handles interactive baking + * + * @access private + */ + function __interactive() { + $this->hr(); + $this->out(sprintf("Bake View\nPath: %s", $this->path)); + $this->hr(); + $wannaDoAdmin = 'n'; + $wannaDoScaffold = 'y'; + $this->interactive = false; + + $this->controllerName = $this->Controller->getName(); + + $this->controllerPath = low(Inflector::underscore($this->controllerName)); + + $interactive = $this->in("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite {$this->controllerName} views if it exist.", array('y','n'), 'y'); + + if (low($interactive) == 'y' || low($interactive) == 'yes') { + $this->interactive = true; + $wannaDoScaffold = $this->in("Would you like to create some scaffolded views (index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller and model classes (including associated models).", array('y','n'), 'n'); + } + + if (low($wannaDoScaffold) == 'y' || low($wannaDoScaffold) == 'yes') { + $wannaDoAdmin = $this->in("Would you like to create the views for admin routing?", array('y','n'), 'y'); + } + $admin = false; + + if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) { + $admin = $this->getAdmin(); + } + + if (low($wannaDoScaffold) == 'y' || low($wannaDoScaffold) == 'yes') { + $actions = $this->scaffoldActions; + if ($admin) { + foreach ($actions as $action) { + $actions[] = $admin . $action; + } + } + $vars = $this->__loadController(); + if ($vars) { + foreach ($actions as $action) { + $content = $this->getContent($action, $vars); + $this->bake($action, $content); + } + } + $this->hr(); + $this->out(''); + $this->out('View Scaffolding Complete.'."\n"); + } else { + $action = ''; + while ($action == '') { + $action = $this->in('Action Name? (use camelCased function name)'); + if ($action == '') { + $this->out('The action name you supplied was empty. Please try again.'); + } + } + $this->out(''); + $this->hr(); + $this->out('The following view will be created:'); + $this->hr(); + $this->out("Controller Name: {$this->controllerName}"); + $this->out("Action Name: {$action}"); + $this->out("Path: ".$this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"); + $this->hr(); + $looksGood = $this->in('Look okay?', array('y','n'), 'y'); + if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + $this->bake($action); + $this->stop(); + } else { + $this->out('Bake Aborted.'); + } + } + } +/** + * Loads Controller and sets variables for the template + * Available template variables + * 'modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', + * 'singularHumanName', 'pluralHumanName', 'fields', 'foreignKeys', + * 'belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany' + * + * @return array Returns an variables to be made available to a view template + * @access private + */ + function __loadController() { + if (!$this->controllerName) { + $this->err(__('Controller not found', true)); + } + + $import = $this->controllerName; + if ($this->plugin) { + $import = $this->plugin . '.' . $this->controllerName; + } + + if (!App::import('Controller', $import)) { + $file = $this->controllerPath . '_controller.php'; + $this->err(sprintf(__("The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller.", true), $file)); + $this->stop(); + } + $controllerClassName = $this->controllerName . 'Controller'; + $controllerObj = & new $controllerClassName(); + $controllerObj->constructClasses(); + $modelClass = $controllerObj->modelClass; + $modelObj =& ClassRegistry::getObject($controllerObj->modelKey); + + if ($modelObj) { + $primaryKey = $modelObj->primaryKey; + $displayField = $modelObj->displayField; + $singularVar = Inflector::variable($modelClass); + $pluralVar = Inflector::variable($this->controllerName); + $singularHumanName = Inflector::humanize($modelClass); + $pluralHumanName = Inflector::humanize($this->controllerName); + $schema = $modelObj->schema(); + $fields = array_keys($schema); + $associations = $this->__associations($modelObj); + } else { + $primaryKey = null; + $displayField = null; + $singularVar = Inflector::variable(Inflector::singularize($this->controllerName)); + $pluralVar = Inflector::variable($this->controllerName); + $singularHumanName = Inflector::humanize(Inflector::singularize($this->controllerName)); + $pluralHumanName = Inflector::humanize($this->controllerName); + $fields = array(); + $schema = array(); + $associations = array(); + } + + return compact('modelClass', 'schema', 'primaryKey', 'displayField', 'singularVar', 'pluralVar', + 'singularHumanName', 'pluralHumanName', 'fields','associations'); + } +/** + * Assembles and writes bakes the view file. + * + * @param string $action Action to bake + * @param string $content Content to write + * @return boolean Success + * @access public + */ + function bake($action, $content = '') { + if ($content === true) { + $content = $this->getContent(); + } + $filename = $this->path . $this->controllerPath . DS . Inflector::underscore($action) . '.ctp'; + $Folder =& new Folder($this->path . $this->controllerPath, true); + $errors = $Folder->errors(); + if (empty($errors)) { + $path = $Folder->slashTerm($Folder->pwd()); + return $this->createFile($filename, $content); + } else { + foreach ($errors as $error) { + $this->err($error); + } + } + return false; + } +/** + * Builds content from template and variables + * + * @param string $template file to use + * @param array $vars passed for use in templates + * @return string content from template + * @access public + */ + function getContent($template = null, $vars = null) { + if (!$template) { + $template = $this->template; + } + $action = $template; + + $adminRoute = Configure::read('Routing.admin'); + if (!empty($adminRoute) && strpos($template, $adminRoute) !== false) { + $template = str_replace($adminRoute.'_', '', $template); + } + if (in_array($template, array('add', 'edit'))) { + $action = $template; + $template = 'form'; + } + $loaded = false; + foreach ($this->Dispatch->shellPaths as $path) { + $templatePath = $path . 'templates' . DS . 'views' . DS .Inflector::underscore($template).'.ctp'; + if (file_exists($templatePath) && is_file($templatePath)) { + $loaded = true; + break; + } + } + if (!$vars) { + $vars = $this->__loadController(); + } + if ($loaded) { + extract($vars); + ob_start(); + ob_implicit_flush(0); + include($templatePath); + $content = ob_get_clean(); + return $content; + } + $this->hr(); + $this->err(sprintf(__('Template for %s could not be found', true), $template)); + return false; + } +/** + * Displays help contents + * + * @access public + */ + function help() { + $this->hr(); + $this->out("Usage: cake bake view ..."); + $this->hr(); + $this->out('Commands:'); + $this->out("\n\tview \n\t\twill read the given controller for methods\n\t\tand bake corresponding views.\n\t\tIf var scaffold is found it will bake the scaffolded actions\n\t\t(index,view,add,edit)"); + $this->out("\n\tview \n\t\twill bake a template. core templates: (index, add, edit, view)"); + $this->out("\n\tview