From f435a514cd0597108cec95b5febdc105b0e16302 Mon Sep 17 00:00:00 2001
From: Ludovic Pouzenc
Date: Wed, 1 Aug 2012 18:18:44 +0000
Subject: Copie des sources du poc01 pour un poc02 et ajout d'un CakePHP
git-svn-id: file:///var/svn/2012-php-weave/trunk@4 d972a294-176a-4cf9-8ea1-fcd5b0c30f5c
---
poc/poc02-compiling-cake/src/composer.json | 6 +
poc/poc02-compiling-cake/src/get_deps.sh | 2 +
poc/poc02-compiling-cake/src/php-weave/main.php | 64 +
.../src/php-weave/visitors.inc.php | 91 +
.../src/vendor/cake_1.1.20.7692/.htaccess | 5 +
.../src/vendor/cake_1.1.20.7692/app/.htaccess | 5 +
.../vendor/cake_1.1.20.7692/app/config/acl.ini.php | 76 +
.../cake_1.1.20.7692/app/config/bootstrap.php | 46 +
.../vendor/cake_1.1.20.7692/app/config/core.php | 146 ++
.../app/config/database.php.default | 74 +
.../cake_1.1.20.7692/app/config/inflections.php | 72 +
.../vendor/cake_1.1.20.7692/app/config/routes.php | 46 +
.../cake_1.1.20.7692/app/config/sql/db_acl.sql | 38 +
.../cake_1.1.20.7692/app/config/sql/sessions.sql | 16 +
.../app/controllers/components/empty | 0
.../src/vendor/cake_1.1.20.7692/app/index.php | 26 +
.../src/vendor/cake_1.1.20.7692/app/models/empty | 0
.../src/vendor/cake_1.1.20.7692/app/plugins/empty | 0
.../vendor/cake_1.1.20.7692/app/tmp/cache/empty | 0
.../cake_1.1.20.7692/app/tmp/cache/models/empty | 0
.../app/tmp/cache/persistent/empty | 0
.../cake_1.1.20.7692/app/tmp/cache/views/empty | 0
.../src/vendor/cake_1.1.20.7692/app/tmp/empty | 0
.../src/vendor/cake_1.1.20.7692/app/tmp/logs/empty | 0
.../vendor/cake_1.1.20.7692/app/tmp/sessions/empty | 0
.../vendor/cake_1.1.20.7692/app/tmp/tests/empty | 0
.../src/vendor/cake_1.1.20.7692/app/vendors/empty | 0
.../cake_1.1.20.7692/app/views/elements/empty | 0
.../vendor/cake_1.1.20.7692/app/views/errors/empty | 0
.../cake_1.1.20.7692/app/views/helpers/empty | 0
.../cake_1.1.20.7692/app/views/layouts/empty | 0
.../vendor/cake_1.1.20.7692/app/views/pages/empty | 0
.../vendor/cake_1.1.20.7692/app/webroot/.htaccess | 6 +
.../vendor/cake_1.1.20.7692/app/webroot/css.php | 102 +
.../app/webroot/css/cake.generic.css | 250 ++
.../cake_1.1.20.7692/app/webroot/favicon.ico | Bin 0 -> 4973 bytes
.../app/webroot/img/cake.power.png | Bin 0 -> 3053 bytes
.../cake_1.1.20.7692/app/webroot/img/w3c_css.png | Bin 0 -> 299 bytes
.../app/webroot/img/w3c_xhtml10.png | Bin 0 -> 321 bytes
.../vendor/cake_1.1.20.7692/app/webroot/index.php | 87 +
.../cake_1.1.20.7692/app/webroot/js/vendors.php | 44 +
.../src/vendor/cake_1.1.20.7692/cake/LICENSE.txt | 24 +
.../src/vendor/cake_1.1.20.7692/cake/VERSION.txt | 9 +
.../cake_1.1.20.7692/cake/app_controller.php | 42 +
.../src/vendor/cake_1.1.20.7692/cake/app_model.php | 42 +
.../src/vendor/cake_1.1.20.7692/cake/basics.php | 1156 +++++++++
.../src/vendor/cake_1.1.20.7692/cake/bootstrap.php | 104 +
.../vendor/cake_1.1.20.7692/cake/config/config.php | 28 +
.../vendor/cake_1.1.20.7692/cake/config/paths.php | 175 ++
.../vendor/cake_1.1.20.7692/cake/dispatcher.php | 429 ++++
.../vendor/cake_1.1.20.7692/cake/libs/cache.php | 137 +
.../vendor/cake_1.1.20.7692/cake/libs/cake_log.php | 57 +
.../cake_1.1.20.7692/cake/libs/class_registry.php | 117 +
.../cake_1.1.20.7692/cake/libs/configure.php | 354 +++
.../cake/libs/controller/component.php | 139 ++
.../cake/libs/controller/components/acl.php | 196 ++
.../cake/libs/controller/components/acl_base.php | 63 +
.../libs/controller/components/dbacl/db_acl.php | 310 +++
.../controller/components/dbacl/models/aclnode.php | 309 +++
.../controller/components/dbacl/models/aco.php | 52 +
.../components/dbacl/models/acoaction.php | 56 +
.../controller/components/dbacl/models/aro.php | 52 +
.../components/dbacl/models/aros_aco.php | 63 +
.../libs/controller/components/iniacl/ini_acl.php | 180 ++
.../libs/controller/components/request_handler.php | 412 +++
.../cake/libs/controller/components/security.php | 202 ++
.../cake/libs/controller/components/session.php | 306 +++
.../cake/libs/controller/controller.php | 998 ++++++++
.../cake/libs/controller/pages_controller.php | 105 +
.../cake/libs/controller/scaffold.php | 432 ++++
.../vendor/cake_1.1.20.7692/cake/libs/error.php | 347 +++
.../src/vendor/cake_1.1.20.7692/cake/libs/file.php | 293 +++
.../src/vendor/cake_1.1.20.7692/cake/libs/flay.php | 278 +++
.../vendor/cake_1.1.20.7692/cake/libs/folder.php | 328 +++
.../cake_1.1.20.7692/cake/libs/inflector.php | 437 ++++
.../vendor/cake_1.1.20.7692/cake/libs/legacy.php | 70 +
.../cake/libs/model/connection_manager.php | 243 ++
.../cake/libs/model/datasources/datasource.php | 519 ++++
.../cake/libs/model/datasources/dbo_source.php | 1967 +++++++++++++++
.../cake/libs/model/dbo/dbo_adodb.php | 437 ++++
.../cake/libs/model/dbo/dbo_mssql.php | 604 +++++
.../cake/libs/model/dbo/dbo_mysql.php | 681 +++++
.../cake/libs/model/dbo/dbo_mysqli.php | 441 ++++
.../cake/libs/model/dbo/dbo_odbc.php | 437 ++++
.../cake/libs/model/dbo/dbo_pear.php | 241 ++
.../cake/libs/model/dbo/dbo_postgres.php | 595 +++++
.../cake/libs/model/dbo/dbo_sqlite.php | 409 +++
.../cake_1.1.20.7692/cake/libs/model/model.php | 42 +
.../cake/libs/model/model_php4.php | 1719 +++++++++++++
.../cake/libs/model/model_php5.php | 1716 +++++++++++++
.../cake_1.1.20.7692/cake/libs/neat_array.php | 318 +++
.../cake_1.1.20.7692/cake/libs/neat_string.php | 88 +
.../vendor/cake_1.1.20.7692/cake/libs/object.php | 259 ++
.../vendor/cake_1.1.20.7692/cake/libs/router.php | 230 ++
.../vendor/cake_1.1.20.7692/cake/libs/sanitize.php | 245 ++
.../vendor/cake_1.1.20.7692/cake/libs/security.php | 151 ++
.../vendor/cake_1.1.20.7692/cake/libs/session.php | 757 ++++++
.../src/vendor/cake_1.1.20.7692/cake/libs/set.php | 805 ++++++
.../cake_1.1.20.7692/cake/libs/validators.php | 45 +
.../cake_1.1.20.7692/cake/libs/view/helper.php | 167 ++
.../cake/libs/view/helpers/ajax.php | 853 +++++++
.../cake/libs/view/helpers/cache.php | 272 ++
.../cake/libs/view/helpers/form.php | 491 ++++
.../cake/libs/view/helpers/html.php | 1257 ++++++++++
.../cake/libs/view/helpers/javascript.php | 317 +++
.../cake/libs/view/helpers/number.php | 88 +
.../cake/libs/view/helpers/session.php | 198 ++
.../cake/libs/view/helpers/text.php | 238 ++
.../cake/libs/view/helpers/time.php | 397 +++
.../cake/libs/view/templates/elements/dump.thtml | 32 +
.../cake/libs/view/templates/errors/error404.thtml | 28 +
.../view/templates/errors/missing_action.thtml | 37 +
.../templates/errors/missing_component_class.thtml | 36 +
.../templates/errors/missing_component_file.thtml | 35 +
.../view/templates/errors/missing_connection.thtml | 30 +
.../view/templates/errors/missing_controller.thtml | 36 +
.../templates/errors/missing_helper_class.thtml | 35 +
.../templates/errors/missing_helper_file.thtml | 35 +
.../view/templates/errors/missing_layout.thtml | 30 +
.../libs/view/templates/errors/missing_model.thtml | 36 +
.../view/templates/errors/missing_scaffolddb.thtml | 30 +
.../libs/view/templates/errors/missing_table.thtml | 29 +
.../libs/view/templates/errors/missing_view.thtml | 30 +
.../view/templates/errors/private_action.thtml | 29 +
.../view/templates/errors/scaffold_error.thtml | 33 +
.../cake/libs/view/templates/layouts/ajax.thtml | 27 +
.../cake/libs/view/templates/layouts/default.thtml | 58 +
.../cake/libs/view/templates/layouts/flash.thtml | 45 +
.../cake/libs/view/templates/pages/home.thtml | 75 +
.../cake/libs/view/templates/scaffolds/add.thtml | 40 +
.../cake/libs/view/templates/scaffolds/edit.thtml | 56 +
.../cake/libs/view/templates/scaffolds/index.thtml | 95 +
.../cake/libs/view/templates/scaffolds/view.thtml | 166 ++
.../cake_1.1.20.7692/cake/libs/view/view.php | 765 ++++++
.../vendor/cake_1.1.20.7692/cake/scripts/acl.php | 853 +++++++
.../vendor/cake_1.1.20.7692/cake/scripts/bake.php | 2635 ++++++++++++++++++++
.../cake/scripts/templates/skel/.htaccess | 5 +
.../cake/scripts/templates/skel/app_controller.php | 41 +
.../cake/scripts/templates/skel/app_model.php | 43 +
.../cake/scripts/templates/skel/config/acl.ini.php | 76 +
.../scripts/templates/skel/config/bootstrap.php | 46 +
.../cake/scripts/templates/skel/config/core.php | 146 ++
.../templates/skel/config/database.php.default | 74 +
.../scripts/templates/skel/config/inflections.php | 72 +
.../cake/scripts/templates/skel/config/routes.php | 46 +
.../scripts/templates/skel/config/sql/db_acl.sql | 30 +
.../scripts/templates/skel/config/sql/sessions.sql | 11 +
.../skel/controllers/pages_controller.php | 105 +
.../cake/scripts/templates/skel/index.php | 26 +
.../templates/skel/views/layouts/ajax.thtml | 30 +
.../templates/skel/views/layouts/default.thtml | 30 +
.../templates/skel/views/layouts/flash.thtml | 50 +
.../cake/scripts/templates/skel/webroot/.htaccess | 6 +
.../cake/scripts/templates/skel/webroot/css.php | 100 +
.../templates/skel/webroot/css/cake.generic.css | 251 ++
.../scripts/templates/skel/webroot/favicon.ico | Bin 0 -> 4973 bytes
.../templates/skel/webroot/img/cake.power.png | Bin 0 -> 3053 bytes
.../cake/scripts/templates/skel/webroot/index.php | 87 +
.../scripts/templates/skel/webroot/js/vendors.php | 43 +
.../cake/scripts/templates/views/home.thtml | 16 +
.../src/vendor/cake_1.1.20.7692/docs/CHANGELOG.txt | 13 +
.../src/vendor/cake_1.1.20.7692/docs/COPYING.txt | 24 +
.../src/vendor/cake_1.1.20.7692/docs/INSTALL.txt | 40 +
.../src/vendor/cake_1.1.20.7692/docs/README.txt | 19 +
.../src/vendor/cake_1.1.20.7692/index.php | 77 +
165 files changed, 33574 insertions(+)
create mode 100644 poc/poc02-compiling-cake/src/composer.json
create mode 100755 poc/poc02-compiling-cake/src/get_deps.sh
create mode 100644 poc/poc02-compiling-cake/src/php-weave/main.php
create mode 100644 poc/poc02-compiling-cake/src/php-weave/visitors.inc.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/.htaccess
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/.htaccess
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/acl.ini.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/bootstrap.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/core.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/database.php.default
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/inflections.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/routes.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/db_acl.sql
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/sessions.sql
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/controllers/components/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/index.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/models/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/plugins/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/models/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/persistent/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/views/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/logs/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/sessions/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/tests/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/vendors/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/elements/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/errors/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/helpers/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/layouts/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/pages/empty
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/.htaccess
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css/cake.generic.css
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/favicon.ico
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/cake.power.png
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_css.png
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_xhtml10.png
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/index.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/js/vendors.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/LICENSE.txt
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/VERSION.txt
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_controller.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_model.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/basics.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/bootstrap.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/config.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/paths.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/dispatcher.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cache.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cake_log.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/class_registry.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/configure.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/component.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl_base.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/db_acl.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aclnode.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aco.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/acoaction.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aro.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aros_aco.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/iniacl/ini_acl.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/request_handler.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/security.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/session.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/controller.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/pages_controller.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/scaffold.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/error.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/file.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/flay.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/folder.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/inflector.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/legacy.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/connection_manager.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/datasources/datasource.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/datasources/dbo_source.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_adodb.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_mssql.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_mysql.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_mysqli.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_odbc.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_pear.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_postgres.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/dbo/dbo_sqlite.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/model.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/model_php4.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/model/model_php5.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/neat_array.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/neat_string.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/object.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/router.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/sanitize.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/security.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/session.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/set.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/validators.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helper.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/ajax.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/cache.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/form.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/html.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/javascript.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/number.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/session.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/text.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/time.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/elements/dump.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/error404.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_action.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_class.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_file.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_connection.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_controller.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_class.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_file.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_layout.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_model.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_scaffolddb.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_table.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_view.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/private_action.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/scaffold_error.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/ajax.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/default.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/flash.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/pages/home.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/add.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/edit.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/index.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/view.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/view.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/acl.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/bake.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/.htaccess
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_controller.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_model.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/acl.ini.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/bootstrap.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/core.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/database.php.default
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/inflections.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/routes.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/db_acl.sql
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/sessions.sql
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/controllers/pages_controller.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/index.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/ajax.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/default.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/flash.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/.htaccess
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css/cake.generic.css
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/favicon.ico
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/img/cake.power.png
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/index.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/js/vendors.php
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/views/home.thtml
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/CHANGELOG.txt
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/COPYING.txt
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/INSTALL.txt
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/README.txt
create mode 100644 poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/index.php
diff --git a/poc/poc02-compiling-cake/src/composer.json b/poc/poc02-compiling-cake/src/composer.json
new file mode 100644
index 0000000..a366739
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/composer.json
@@ -0,0 +1,6 @@
+{
+ "require": {
+ "nikic/php-parser": "0.9.2"
+ }
+}
+
diff --git a/poc/poc02-compiling-cake/src/get_deps.sh b/poc/poc02-compiling-cake/src/get_deps.sh
new file mode 100755
index 0000000..67c84c3
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/get_deps.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+php ../../../composer.phar install
diff --git a/poc/poc02-compiling-cake/src/php-weave/main.php b/poc/poc02-compiling-cake/src/php-weave/main.php
new file mode 100644
index 0000000..2a4df55
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/php-weave/main.php
@@ -0,0 +1,64 @@
+parse(file_get_contents($src_filepath));
+
+ if (strlen($stmts1_filepath) > 0 ) {
+ dbg($level,"Dumping1 '$src_filepath' AST to '$stmts1_filepath'");
+ file_put_contents($stmts1_filepath, $nodeDumper->dump($stmts));
+ }
+
+ dbg($level,"Transforming '$src_filepath'");
+ $traverser = new PHPParser_NodeTraverser;
+/*
+ $traverser->addVisitor(new PHPParser_NodeVisitor_NameResolver);
+ $traverser->addVisitor(new NodeVisitor_NamespaceConverter);
+*/
+ // FIXME : getcwd is quick and dirty here
+ $traverser->addVisitor(new NodeVisitor_PreprocessInclude($level, getcwd(), $src_filepath));
+ $stmts = $traverser->traverse($stmts);
+ $traverser=null; //Destroy
+
+ if (strlen($stmts2_filepath) > 0) {
+ dbg($level,"Dumping2 '$src_filepath' AST to '$stmts2_filepath'");
+ file_put_contents($stmts2_filepath, $nodeDumper->dump($stmts));
+ }
+
+ } catch (PHPParser_Error $e) {
+ echo 'Parse Error: ', $e->getMessage();
+ }
+ return $stmts;
+}
+
+
+// Main
+$src_filepath = "./main.php";
+#$src_filepath = "./to_parse.php";
+$stmts1_filepath = "out/stmts1.ast";
+$stmts2_filepath = "out/stmts2.ast";
+$dest_filepath = "out/result.php";
+
+$parser = new PHPParser_Parser(new PHPParser_Lexer);
+$nodeDumper = new PHPParser_NodeDumper;
+
+$level=0;
+$stmts=recursive_parse($src_filepath, $stmts1_filepath, $stmts2_filepath);
+
+dbg(0,"Outputing '$dest_filepath'");
+$prettyPrinter = new PHPParser_PrettyPrinter_Zend;
+file_put_contents($dest_filepath, "prettyPrint($stmts) . "\n?>");
+
+?>
diff --git a/poc/poc02-compiling-cake/src/php-weave/visitors.inc.php b/poc/poc02-compiling-cake/src/php-weave/visitors.inc.php
new file mode 100644
index 0000000..3f997ad
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/php-weave/visitors.inc.php
@@ -0,0 +1,91 @@
+toString('_'));
+ } elseif ($node instanceof PHPParser_Node_Stmt_Class
+ || $node instanceof PHPParser_Node_Stmt_Interface
+ || $node instanceof PHPParser_Node_Stmt_Function) {
+ $node->name = $node->namespacedName->toString('_');
+ } elseif ($node instanceof PHPParser_Node_Stmt_Const) {
+ foreach ($node->consts as $const) {
+ $const->name = $const->namespacedName->toString('_');
+ }
+ } elseif ($node instanceof PHPParser_Node_Stmt_Namespace) {
+ // returning an array merges is into the parent array
+ return $node->stmts;
+ } elseif ($node instanceof PHPParser_Node_Stmt_Use) {
+ // returning false removed the node altogether
+ return false;
+ }
+ }
+}
+*/
+
+class NodeVisitor_PreprocessInclude extends PHPParser_NodeVisitorAbstract {
+ protected $level;
+ protected $cwd;
+ protected $filepath;
+ protected $prettyPrinter;
+
+ public function __construct($level, $cwd, $filepath) {
+ $this->level=$level;
+ $this->cwd=$cwd;
+ $this->filepath=$filepath;
+ $this->prettyPrinter = new PHPParser_PrettyPrinter_Zend;
+ }
+
+ protected function resolveIncludePath($node) {
+ //FIXME : Quick and dirty
+ // no classpath checks...
+ // no check if compound value like "dirname(__FILE__) . '/PHPParser/Autoloader.php'"
+ return $node->expr->value;
+ }
+
+ public function enterNode(PHPParser_Node $node) {
+ if ($node instanceof PHPParser_Node_Expr_Include) {
+ // Already processed, go out (occurs if an unresolved include has left as is in the previous recursion level)
+ if (is_array($node->attributes) && array_key_exists('NodeVisitor_PreprocessInclude', $node->attributes)) return $node;
+
+ switch($node->type) {
+ case PHPParser_Node_Expr_Include::TYPE_INCLUDE:
+ case PHPParser_Node_Expr_Include::TYPE_REQUIRE:
+ $once=0;
+ break;
+ case PHPParser_Node_Expr_Include::TYPE_INCLUDE_ONCE:
+ case PHPParser_Node_Expr_Include::TYPE_REQUIRE_ONCE:
+ $once=1;
+ echo "TODO : include_once or require_once\n";
+ break;
+ default:
+ echo "FIXME : BUG NodeVisitor_PreprocessInclude::enterNode !!\n";
+ return $node;
+ }
+
+ $path=$this->resolveIncludePath($node);
+
+ //FIXME : No infinite recursion check like test.php contains include('./test.php');
+ // Preprocess include if readable
+ $comment_suffix=" */";
+ if ( ($this->level < 3) && is_readable($path)) {
+ $comment_prefix="/* ";
+ //FIXME : use a closure or sort of here (dependancy injection)
+ //$stmts=recursive_parse($path, "out/rec.out1", "out/rec.out2", $this->level+1);
+ $stmts=recursive_parse($path, "", "", $this->level+1);
+ } else {
+ $comment_prefix="/* UNRESOLVED : ";
+ $node->attributes['NodeVisitor_PreprocessInclude']='unresolved';
+ $stmts=array($node); // Caution : can cause infinite loop (will be tried at the next step)
+ }
+
+ $comment= new PHPParser_Comment($comment_prefix . $this->prettyPrinter->prettyPrint(array($node)) . $comment_suffix);
+
+ // FIXME : Get out this if() that is a trick for not returning here an array instead of a node
+ return new PHPParser_Node_Stmt_If(new PHPParser_Node_Scalar_LNumber(1),array('stmts'=>$stmts),array('comments'=>array($comment)));
+ }
+
+ }
+}
+
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/.htaccess b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/.htaccess
new file mode 100644
index 0000000..f23dbaf
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/.htaccess
@@ -0,0 +1,5 @@
+
+ RewriteEngine on
+ RewriteRule ^$ app/webroot/ [L]
+ RewriteRule (.*) app/webroot/$1 [L]
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/.htaccess b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/.htaccess
new file mode 100644
index 0000000..0ed8662
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/.htaccess
@@ -0,0 +1,5 @@
+
+ RewriteEngine on
+ RewriteRule ^$ webroot/ [L]
+ RewriteRule (.*) webroot/$1 [L]
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/acl.ini.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/acl.ini.php
new file mode 100644
index 0000000..486e790
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/acl.ini.php
@@ -0,0 +1,76 @@
+;
+; SVN FILE: $Id: acl.ini.php 6305 2008-01-02 02:33:56Z phpnut $
+;/**
+; * Short description for file.
+; *
+; *
+; * PHP versions 4 and 5
+; *
+; * CakePHP(tm) : Rapid Development Framework
+; * 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 0.10.0.1076
+; * @version $Revision: 6305 $
+; * @modifiedby $LastChangedBy: phpnut $
+; * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+; */
+
+; acl.ini.php - Cake ACL Configuration
+; ---------------------------------------------------------------------
+; Use this file to specify user permissions.
+; aco = access control object (something in your application)
+; aro = access request object (something requesting access)
+;
+; User records are added as follows:
+;
+; [uid]
+; groups = group1, group2, group3
+; allow = aco1, aco2, aco3
+; deny = aco4, aco5, aco6
+;
+; Group records are added in a similar manner:
+;
+; [gid]
+; allow = aco1, aco2, aco3
+; deny = aco4, aco5, aco6
+;
+; The allow, deny, and groups sections are all optional.
+; NOTE: groups names *cannot* ever be the same as usernames!
+;
+; ACL permissions are checked in the following order:
+; 1. Check for user denies (and DENY if specified)
+; 2. Check for user allows (and ALLOW if specified)
+; 3. Gather user's groups
+; 4. Check group denies (and DENY if specified)
+; 5. Check group allows (and ALLOW if specified)
+; 6. If no aro, aco, or group information is found, DENY
+;
+; ---------------------------------------------------------------------
+
+;-------------------------------------
+;Users
+;-------------------------------------
+
+[username-goes-here]
+groups = group1, group2
+deny = aco1, aco2
+allow = aco3, aco4
+
+;-------------------------------------
+;Groups
+;-------------------------------------
+
+[groupname-goes-here]
+deny = aco5, aco6
+allow = aco7, aco8
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/bootstrap.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/bootstrap.php
new file mode 100644
index 0000000..ef4cedf
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/bootstrap.php
@@ -0,0 +1,46 @@
+
+ * 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 0.10.8.2117
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ *
+ * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded
+ * This is an application wide file to load any function that is not used within a class define.
+ * You can also use this to include or require any files in your application.
+ *
+ */
+/**
+ * The settings below can be used to set additional paths to models, views and controllers.
+ * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
+ *
+ * $modelPaths = array('full path to models', 'second full path to models', 'etc...');
+ * $viewPaths = array('this path to views', 'second full path to views', 'etc...');
+ * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
+ *
+ */
+//EOF
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/core.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/core.php
new file mode 100644
index 0000000..77cf1ff
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/core.php
@@ -0,0 +1,146 @@
+
+ * 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 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * If you do not have mod rewrite on your system
+ * or if you prefer to use CakePHP pretty urls.
+ * uncomment the line below.
+ * Note: If you do have mod rewrite but prefer the
+ * CakePHP pretty urls, you also have to remove the
+ * .htaccess files
+ * release/.htaccess
+ * release/app/.htaccess
+ * release/app/webroot/.htaccess
+ */
+// define ('BASE_URL', env('SCRIPT_NAME'));
+/**
+ * Set debug level here:
+ * - 0: production
+ * - 1: development
+ * - 2: full debug with sql
+ * - 3: full debug with sql and dump of the current object
+ *
+ * In production, the "flash messages" redirect after a time interval.
+ * With the other debug levels you get to click the "flash message" to continue.
+ *
+ */
+ define('DEBUG', 1);
+/**
+ * Turn of caching checking wide.
+ * You must still use the controller var cacheAction inside you controller class.
+ * You can either set it controller wide, or in each controller method.
+ * use var $cacheAction = true; or in the controller method $this->cacheAction = true;
+ */
+ define('CACHE_CHECK', false);
+/**
+ * Error constant. Used for differentiating error logging and debugging.
+ * Currently PHP supports LOG_DEBUG
+ */
+ define('LOG_ERROR', 2);
+/**
+ * CakePHP includes 3 types of session saves
+ * database or file. Set this to your preferred method.
+ * If you want to use your own save handler place it in
+ * app/config/name.php DO NOT USE file or database as the name.
+ * and use just the name portion below.
+ *
+ * Setting this to cake will save files to /cakedistro/tmp directory
+ * Setting it to php will use the php default save path
+ * Setting it to database will use the database
+ *
+ */
+ define('CAKE_SESSION_SAVE', 'php');
+/**
+ * If using you own table name for storing sessions
+ * set the table name here.
+ * DO NOT INCLUDE PREFIX IF YOU HAVE SET ONE IN database.php
+ *
+ */
+ define('CAKE_SESSION_TABLE', 'cake_sessions');
+/**
+ * Set a random string of used in session.
+ *
+ */
+ define('CAKE_SESSION_STRING', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
+/**
+ * Set the name of session cookie
+ *
+ */
+ define('CAKE_SESSION_COOKIE', 'CAKEPHP');
+/**
+ * Set level of Cake security.
+ *
+ */
+ define('CAKE_SECURITY', 'high');
+/**
+ * Set Cake Session time out.
+ * If CAKE_SECURITY define is set
+ * high: multiplied by 10
+ * medium: is multiplied by 100
+ * low is: multiplied by 300
+ *
+ * Number below is seconds.
+ */
+ define('CAKE_SESSION_TIMEOUT', '120');
+/**
+ * Uncomment the define below to use cake built in admin routes.
+ * You can set this value to anything you want.
+ * All methods related to the admin route should be prefixed with the
+ * name you set CAKE_ADMIN to.
+ * For example: admin_index, admin_edit
+ */
+// define('CAKE_ADMIN', 'admin');
+/**
+ * The define below is used to turn cake built webservices
+ * on or off. Default setting is off.
+ */
+ define('WEBSERVICES', 'off');
+/**
+ * Compress output CSS (removing comments, whitespace, repeating tags etc.)
+ * This requires a/var/cache directory to be writable by the web server (caching).
+ * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use Controller::cssTag().
+ */
+ define('COMPRESS_CSS', false);
+/**
+ * If set to true, helpers would output data instead of returning it.
+ */
+ define('AUTO_OUTPUT', false);
+/**
+ * If set to false, session would not automatically be started.
+ */
+ define('AUTO_SESSION', true);
+/**
+ * Set the max size of file to use md5() .
+ */
+ define('MAX_MD5SIZE', (5 * 1024) * 1024);
+/**
+ * To use Access Control Lists with Cake...
+ */
+ define('ACL_CLASSNAME', 'DB_ACL');
+ define('ACL_FILENAME', 'dbacl' . DS . 'db_acl');
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/database.php.default b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/database.php.default
new file mode 100644
index 0000000..4df48e1
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/database.php.default
@@ -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.app.config
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * In this file you set up your database connection details.
+ *
+ * @package cake
+ * @subpackage cake.config
+ */
+/**
+ * Database configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * driver =>
+ * mysql, postgres, sqlite, adodb, pear-drivername
+ *
+ * connect =>
+ * MySQL set the connect to either mysql_pconnect of mysql_connect
+ * PostgreSQL set the connect to either pg_pconnect of pg_connect
+ * SQLite set the connect to sqlite_popen sqlite_open
+ * ADOdb set the connect to one of these
+ * (http://phplens.com/adodb/supported.databases.html) and
+ * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
+ *
+ * host =>
+ * the host you connect to the database
+ * MySQL 'localhost' to add a port number use 'localhost:port#'
+ * PostgreSQL 'localhost' to add a port number use 'localhost port=5432'
+ *
+ */
+class DATABASE_CONFIG
+{
+ var $default = array('driver' => 'mysql',
+ 'connect' => 'mysql_connect',
+ 'host' => 'localhost',
+ 'login' => 'user',
+ 'password' => 'password',
+ 'database' => 'project_name',
+ 'prefix' => '');
+
+ var $test = array('driver' => 'mysql',
+ 'connect' => 'mysql_connect',
+ 'host' => 'localhost',
+ 'login' => 'user',
+ 'password' => 'password',
+ 'database' => 'project_name-test',
+ 'prefix' => '');
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/inflections.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/inflections.php
new file mode 100644
index 0000000..e08a7d8
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/inflections.php
@@ -0,0 +1,72 @@
+
+ * 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.0.0.2312
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * This is a key => value array of regex used to match words.
+ * If key matches then the value is returned.
+ *
+ * $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice');
+ */
+ $pluralRules = array();
+/**
+ * This is a key only array of plural words that should not be inflected.
+ * Notice the last comma
+ *
+ * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox');
+ */
+ $uninflectedPlural = array();
+/**
+ * This is a key => value array of plural irregular words.
+ * If key matches then the value is returned.
+ *
+ * $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers')
+ */
+ $irregularPlural = array();
+/**
+ * This is a key => value array of regex used to match words.
+ * If key matches then the value is returned.
+ *
+ * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i')
+ */
+ $singularRules = array();
+/**
+ * This is a key only array of singular words that should not be inflected.
+ * You should not have to change this value below if you do change it use same format
+ * as the $uninflectedPlural above.
+ */
+ $uninflectedSingular = $uninflectedPlural;
+/**
+ * This is a key => value array of singular irregular words.
+ * Most of the time this will be a reverse of the above $irregularPlural array
+ * You should not have to change this value below if you do change it use same format
+ *
+ * $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother')
+ */
+ $irregularSingular = array_flip($irregularPlural);
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/routes.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/routes.php
new file mode 100644
index 0000000..45ae36a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/routes.php
@@ -0,0 +1,46 @@
+
+ * 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 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Here, we are connecting '/' (base path) to controller called 'Pages',
+ * its action called 'display', and we pass a param to select the view file
+ * to use (in this case, /app/views/pages/home.thtml)...
+ */
+ $Route->connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
+/**
+ * ...and connect the rest of 'Pages' controller's urls.
+ */
+ $Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
+/**
+ * Then we connect url '/test' to our test controller. This is helpfull in
+ * developement.
+ */
+ $Route->connect('/tests', array('controller' => 'tests', 'action' => 'index'));
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/db_acl.sql b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/db_acl.sql
new file mode 100644
index 0000000..be8f200
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/db_acl.sql
@@ -0,0 +1,38 @@
+# $Id: db_acl.sql 6305 2008-01-02 02:33:56Z phpnut $
+#
+# 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.
+# http://www.opensource.org/licenses/mit-license.php The MIT License
+
+CREATE TABLE acos (
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ object_id INTEGER(10) NULL DEFAULT NULL,
+ alias VARCHAR(255) NOT NULL DEFAULT '',
+ lft INTEGER(10) NULL DEFAULT NULL,
+ rght INTEGER(10) NULL DEFAULT NULL,
+ PRIMARY KEY(id)
+);
+
+CREATE TABLE aros_acos (
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ aro_id INTEGER(10) UNSIGNED NOT NULL,
+ aco_id INTEGER(10) UNSIGNED NOT NULL,
+ _create CHAR(2) NOT NULL DEFAULT 0,
+ _read CHAR(2) NOT NULL DEFAULT 0,
+ _update CHAR(2) NOT NULL DEFAULT 0,
+ _delete CHAR(2) NOT NULL DEFAULT 0,
+ PRIMARY KEY(id)
+);
+
+CREATE TABLE aros (
+ id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ foreign_key INTEGER(10) UNSIGNED NULL DEFAULT NULL,
+ alias VARCHAR(255) NOT NULL DEFAULT '',
+ lft INTEGER(10) NULL DEFAULT NULL,
+ rght INTEGER(10) NULL DEFAULT NULL,
+ PRIMARY KEY(id)
+);
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/sessions.sql b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/sessions.sql
new file mode 100644
index 0000000..14c0036
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/config/sql/sessions.sql
@@ -0,0 +1,16 @@
+# $Id: sessions.sql 6305 2008-01-02 02:33:56Z phpnut $
+#
+# 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.
+# http://www.opensource.org/licenses/mit-license.php The MIT License
+
+CREATE TABLE cake_sessions (
+ id varchar(255) NOT NULL default '',
+ data text,
+ expires int(11) default NULL,
+ PRIMARY KEY (id)
+);
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/controllers/components/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/controllers/components/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/index.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/index.php
new file mode 100644
index 0000000..bd8993b
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/index.php
@@ -0,0 +1,26 @@
+
+ * 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
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/models/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/models/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/plugins/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/plugins/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/models/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/models/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/persistent/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/persistent/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/views/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/cache/views/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/logs/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/logs/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/sessions/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/sessions/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/tests/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/tmp/tests/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/vendors/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/vendors/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/elements/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/elements/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/errors/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/errors/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/helpers/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/helpers/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/layouts/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/layouts/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/pages/empty b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/views/pages/empty
new file mode 100644
index 0000000..e69de29
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/.htaccess b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/.htaccess
new file mode 100644
index 0000000..f9d8b93
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/.htaccess
@@ -0,0 +1,6 @@
+
+ RewriteEngine On
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css.php
new file mode 100644
index 0000000..dc87218
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css.php
@@ -0,0 +1,102 @@
+
+ * 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.webroot
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+if (!defined('CAKE_CORE_INCLUDE_PATH')) {
+ header('HTTP/1.1 404 Not Found');
+ exit('File Not Found');
+}
+/**
+ * Enter description here...
+ */
+ uses('file');
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $path
+ * @param unknown_type $name
+ * @return unknown
+ */
+ function make_clean_css($path, $name) {
+ require(VENDORS . 'csspp' . DS . 'csspp.php');
+ $data = file_get_contents($path);
+ $csspp = new csspp();
+ $output = $csspp->compress($data);
+ $ratio = 100 - (round(strlen($output) / strlen($data), 3) * 100);
+ $output = " /* file: $name, ratio: $ratio% */ " . $output;
+ return $output;
+ }
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $path
+ * @param unknown_type $content
+ * @return unknown
+ */
+ function write_css_cache($path, $content) {
+ if (!is_dir(dirname($path))) {
+ mkdir(dirname($path));
+ }
+ $cache = new File($path);
+ return $cache->write($content);
+ }
+
+ if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) {
+ die('Wrong file name.');
+ }
+
+ $filename = 'css/' . $regs[1];
+ $filepath = CSS . $regs[1];
+ $cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]);
+
+ if (!file_exists($filepath)) {
+ die('Wrong file name.');
+ }
+
+ if (file_exists($cachepath)) {
+ $templateModified = filemtime($filepath);
+ $cacheModified = filemtime($cachepath);
+
+ if ($templateModified > $cacheModified) {
+ $output = make_clean_css($filepath, $filename);
+ write_css_cache($cachepath, $output);
+ } else {
+ $output = file_get_contents($cachepath);
+ }
+ } else {
+ $output = make_clean_css($filepath, $filename);
+ write_css_cache($cachepath, $output);
+ $templateModified = time();
+ }
+
+ header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT');
+ header("Content-Type: text/css");
+ header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT");
+ header("Cache-Control: cache"); // HTTP/1.1
+ header("Pragma: cache"); // HTTP/1.0
+ print $output;
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css/cake.generic.css b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css/cake.generic.css
new file mode 100644
index 0000000..bc27d22
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/css/cake.generic.css
@@ -0,0 +1,250 @@
+*{
+margin:0;
+padding:0;
+}
+
+body{
+font-family:"frutiger linotype","lucida grande",helvetica,arial,sans-serif;
+text-align:center;
+color:#333;
+font-size: 76%;
+}
+
+/* General Style Info */
+a{
+color:#003d4c;
+text-decoration:underline;
+}
+a:hover{
+color:#003d4c;
+text-decoration:none;
+}
+
+a img{
+border:none;
+}
+
+h1, h2, h3, h4{
+font-weight:normal;
+}
+
+h1{
+color: #003d4c;
+margin:0.3em 0;
+font-size: 180%;
+}
+
+h2{
+color:#c6c65b;
+padding-top: 1em;
+margin:0.3em 0;
+font-size: 180%;
+}
+
+h3{
+color:#c6c65b;
+padding-top:2em;
+font-size: 140%;
+}
+
+h4{
+color:#c6c65b;
+padding-top:0.5em;
+font-weight:normal;
+}
+
+em {
+font-size: 12px;
+}
+
+ul, li {
+margin: 0 12px;
+}
+
+/* Layout */
+
+#container{
+text-align:left;
+}
+
+#header{
+margin-top: 1em;
+padding: 4px 20px;
+}
+
+#content{
+clear:both;
+padding: 0px 40px 10px 40px;
+background-color: #fff;
+color: #333;
+}
+#footer{
+clear:both;
+padding: 6px 10px;
+text-align: right;
+}
+
+/* tables */
+
+table {
+width: 100%;
+border-top: 1px solid #ccc;
+border-left: 1px solid #ccc;
+border-bottom: 1px solid #ccc;
+color:#333;
+background-color: #fff;
+clear:both;
+padding: 0;
+margin: 0 0 2em 0;
+white-space: normal;
+}
+th {
+background-color: #e2e2e2;
+border-top: 1px solid #fff;
+border-left: 1px solid #fff;
+border-right: 1px solid #003d4c;
+border-bottom: 1px solid #003d4c;
+text-align: center;
+padding:1px 4px;
+}
+table tr td {
+border-right: 1px solid #ddd;
+padding:4px 4px;
+vertical-align:top;
+text-align: center;
+}
+table tr.altRow td {
+background: #f4f4f4;
+}
+table td.actions {
+ white-space: nowrap;
+}
+#cakeSqlLog td {
+text-align: left;
+padding: 4px 8px;
+background: #fff;
+border-bottom: 2px solid #ccc;
+}
+
+/* scaffold show */
+
+div.related {
+clear:both;
+display:block;
+}
+dl {
+line-height:2em;
+margin:0em 1em;
+float:left;
+width: 400px;
+}
+dt {
+font-weight: bold;
+vertical-align:top;
+}
+dd {
+margin-left:10em;
+margin-top:-2em;
+vertical-align:top;
+}
+
+/* notices and errors */
+
+#flashMessage, .error, .error_message {
+color:#900;
+font-size: 16px;
+background-color: #fff;
+margin: 8px 0px;
+font-weight: bold;
+}
+.error_message {
+clear: both;
+}
+.error em {
+font-size: 18px;
+color: #003d4c;
+}
+.notice {
+color: #656565;
+font-size: 14px;
+background-color: #f4f4f4;
+padding: 0.5em;
+margin: 1em 0;
+display:block;
+}
+.tip {
+color: #656565;
+background-color: #ddd;
+}
+
+/* forms */
+
+form {
+margin-top: 2em;
+}
+form div{
+vertical-align: text-top;
+margin-left: 1em;
+margin-bottom:2em;
+}
+form div.date{
+margin-left: 0em;
+}
+label {
+display: block;
+width: 140px;
+font-size: 14px;
+padding-right: 20px;
+}
+input[type=checkbox] {
+float: left;
+clear: left;
+margin: 2px 6px 7px 2px;
+}
+input, textarea {
+clear: both;
+display:block;
+font-size: 14px;
+font-family: inherit;
+}
+select {
+clear: both;
+vertical-align: text-bottom;
+font-size: 14px;
+font-family: inherit;
+}
+option {
+font-size: 14px;
+font-family: inherit;
+padding: 0 0.3em;
+}
+input[type=submit] {
+display: inline;
+vertical-align: bottom;
+}
+div.required {
+clear: both;
+color:#222;
+font-weight:bold;
+}
+div.optional {
+clear: both;
+color:#555;
+}
+div.submit {
+clear: both;
+margin-top: 40px;
+margin-left: 140px;
+}
+/* action links */
+ul.actions {
+float: left;
+margin-left:20px;
+width: 200px;
+}
+ul.actions li {
+margin-top: 4px;
+}
+pre {
+padding: 1em;
+}
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/favicon.ico b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/favicon.ico
new file mode 100644
index 0000000..1bc32bd
Binary files /dev/null and b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/favicon.ico differ
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/cake.power.png b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/cake.power.png
new file mode 100644
index 0000000..699ef80
Binary files /dev/null and b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/cake.power.png differ
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_css.png b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_css.png
new file mode 100644
index 0000000..706325e
Binary files /dev/null and b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_css.png differ
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_xhtml10.png b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_xhtml10.png
new file mode 100644
index 0000000..ec68644
Binary files /dev/null and b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/img/w3c_xhtml10.png differ
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/index.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/index.php
new file mode 100644
index 0000000..48771ff
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/index.php
@@ -0,0 +1,87 @@
+
+ * 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.webroot
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Do not change
+ */
+ if (!defined('DS')) {
+ define('DS', DIRECTORY_SEPARATOR);
+ }
+/**
+ * These defines should only be edited if you have cake installed in
+ * a directory layout other than the way it is distributed.
+ * Each define has a commented line of code that explains what you would change.
+ *
+ */
+ if (!defined('ROOT')) {
+ //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
+ //You should also use the DS define to seperate your directories
+ define('ROOT', dirname(dirname(dirname(__FILE__))));
+ }
+ if (!defined('APP_DIR')) {
+ //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
+ define('APP_DIR', basename(dirname(dirname(__FILE__))));
+ }
+/**
+ * This only needs to be changed if the cake installed libs are located
+ * outside of the distributed directory structure.
+ */
+ if (!defined('CAKE_CORE_INCLUDE_PATH')) {
+ //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
+ //You should also use the DS define to seperate your directories
+ define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ }
+///////////////////////////////
+//DO NOT EDIT BELOW THIS LINE//
+///////////////////////////////
+ if (!defined('WEBROOT_DIR')) {
+ define('WEBROOT_DIR', basename(dirname(__FILE__)));
+ }
+ if (!defined('WWW_ROOT')) {
+ define('WWW_ROOT', dirname(__FILE__) . DS);
+ }
+ if (!defined('CORE_PATH')) {
+ if (function_exists('ini_set')) {
+ ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'));
+ define('APP_PATH', null);
+ define('CORE_PATH', null);
+ } else {
+ define('APP_PATH', ROOT . DS . APP_DIR . DS);
+ define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
+ }
+ }
+ require CORE_PATH . 'cake' . DS . 'bootstrap.php';
+ if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
+ } else {
+ $Dispatcher = new Dispatcher();
+ $Dispatcher->dispatch($url);
+ }
+ if (Configure::read() > 0) {
+ echo "";
+ }
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/js/vendors.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/js/vendors.php
new file mode 100644
index 0000000..cee6b77
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/app/webroot/js/vendors.php
@@ -0,0 +1,44 @@
+
+ * 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.webroot.js
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 7691 $
+ * @modifiedby $LastChangedBy: nate $
+ * @lastmodified $Date: 2008-10-02 00:59:12 -0400 (Thu, 02 Oct 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Enter description here...
+ */
+if (isset($_GET['file'])) {
+ $file = $_GET['file'];
+ $pos = strpos($file, '..');
+ if ($pos === false) {
+ if (is_file('../../vendors/javascript/'.$file) && (preg_match('/(\/.+)\\.js/', $file))) {
+ readfile('../../vendors/javascript/'.$file);
+ return;
+ }
+ }
+}
+header('HTTP/1.1 404 Not Found');
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/LICENSE.txt b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/LICENSE.txt
new file mode 100644
index 0000000..4787242
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/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/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/VERSION.txt b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/VERSION.txt
new file mode 100644
index 0000000..75ad570
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/VERSION.txt
@@ -0,0 +1,9 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// +---------------------------------------------------------------------------------------------------+ //
+// + $Id: VERSION.txt 7692 2008-10-02 05:06:48Z nate $
+// + Last Modified: $Date: 2008-10-02 01:06:48 -0400 (Thu, 02 Oct 2008) $
+// + Modified By: $LastChangedBy: nate $
+// +---------------------------------------------------------------------------------------------------+ //
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+1.1.20.7692
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_controller.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_controller.php
new file mode 100644
index 0000000..24a501c
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_controller.php
@@ -0,0 +1,42 @@
+
+ * 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: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * This is a placeholder class.
+ * Create the same file in app/app_controller.php
+ *
+ * Add your application-wide methods in the class below, your controllers
+ * will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.cake
+ */
+class AppController extends Controller {
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_model.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_model.php
new file mode 100644
index 0000000..c20a518
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/app_model.php
@@ -0,0 +1,42 @@
+
+ * 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: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Application model for Cake.
+ *
+ * This is a placeholder class.
+ * Create the same file in app/app_model.php
+ * Add your application-wide methods to the class, your models will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.cake
+ */
+class AppModel extends Model {
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/basics.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/basics.php
new file mode 100644
index 0000000..486584f
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/basics.php
@@ -0,0 +1,1156 @@
+
+ * 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: 7691 $
+ * @modifiedby $LastChangedBy: nate $
+ * @lastmodified $Date: 2008-10-02 00:59:12 -0400 (Thu, 02 Oct 2008) $
+ * @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 < 4.3
+ */
+ if (!function_exists("ob_get_clean")) {
+ function ob_get_clean() {
+ $ob_contents = ob_get_contents();
+ ob_end_clean();
+ return $ob_contents;
+ }
+ }
+/**
+ * Patch for PHP < 4.3
+ */
+ if (version_compare(phpversion(), '5.0') < 0) {
+ eval ('
+ function clone($object) {
+ return $object;
+ }');
+ }
+/**
+ * Computes the difference of arrays using keys for comparison
+ *
+ * @param array
+ * @param array
+ * @return array
+ */
+ 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
+ * @param array
+ * @return array
+ */
+ 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;
+ }
+ }
+/**
+ * Loads all models.
+ */
+ function loadModels() {
+ if (!class_exists('Model')) {
+ require LIBS . 'model' . DS . 'model.php';
+ }
+ $path = Configure::getInstance();
+ if (!class_exists('AppModel')) {
+ if (file_exists(APP . 'app_model.php')) {
+ require(APP . 'app_model.php');
+ } else {
+ require(CAKE . 'app_model.php');
+ }
+ if (phpversion() < 5 && function_exists("overload")) {
+ overload('AppModel');
+ }
+ }
+
+ foreach ($path->modelPaths as $path) {
+ foreach (listClasses($path)as $model_fn) {
+ list($name) = explode('.', $model_fn);
+ $className = Inflector::camelize($name);
+
+ if (!class_exists($className)) {
+ require($path . $model_fn);
+
+ if (phpversion() < 5 && function_exists("overload")) {
+ overload($className);
+ }
+ }
+ }
+ }
+ }
+/**
+ * Loads all plugin models.
+ *
+ * @param string $plugin Name of plugin
+ * @return
+ */
+ function loadPluginModels($plugin) {
+ if (!class_exists('AppModel')) {
+ loadModel();
+ }
+ $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);
+ } else {
+ die('Plugins must have a class named ' . $pluginAppModel);
+ }
+ if (phpversion() < 5 && function_exists("overload")) {
+ overload($pluginAppModel);
+ }
+ }
+
+ $pluginModelDir = APP . 'plugins' . DS . $plugin . DS . 'models' . DS;
+
+ foreach (listClasses($pluginModelDir)as $modelFileName) {
+ list($name) = explode('.', $modelFileName);
+ $className = Inflector::camelize($name);
+
+ if (!class_exists($className)) {
+ require($pluginModelDir . $modelFileName);
+
+ if (phpversion() < 5 && function_exists("overload")) {
+ overload($className);
+ }
+ }
+ }
+ }
+/**
+ * Loads custom view class.
+ *
+ */
+ function loadView($viewClass) {
+ if (!class_exists($viewClass . 'View')) {
+ $paths = Configure::getInstance();
+ $file = Inflector::underscore($viewClass) . '.php';
+
+ foreach ($paths->viewPaths as $path) {
+ if (file_exists($path . $file)) {
+ return require($path . $file);
+ }
+ }
+
+ if ($viewFile = fileExistsInPath(LIBS . 'view' . DS . $file)) {
+ if (file_exists($viewFile)) {
+ require($viewFile);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+ }
+/**
+ * Loads a model by CamelCase name.
+ */
+ function loadModel($name = null) {
+ if (!class_exists('Model')) {
+ require LIBS . 'model' . DS . 'model.php';
+ }
+ if (!class_exists('AppModel')) {
+ if (file_exists(APP . 'app_model.php')) {
+ require(APP . 'app_model.php');
+ } else {
+ require(CAKE . 'app_model.php');
+ }
+ if (phpversion() < 5 && function_exists("overload")) {
+ overload('AppModel');
+ }
+ }
+
+ if (!is_null($name) && !class_exists($name)) {
+ $className = $name;
+ $name = Inflector::underscore($name);
+ $paths = Configure::getInstance();
+
+ foreach ($paths->modelPaths as $path) {
+ if (file_exists($path . $name . '.php')) {
+ require($path . $name . '.php');
+ if (phpversion() < 5 && function_exists("overload")) {
+ overload($className);
+ }
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return true;
+ }
+ }
+/**
+ * Loads all controllers.
+ */
+ function loadControllers() {
+ $paths = Configure::getInstance();
+ if (!class_exists('AppController')) {
+ if (file_exists(APP . 'app_controller.php')) {
+ require(APP . 'app_controller.php');
+ } else {
+ require(CAKE . 'app_controller.php');
+ }
+ }
+ $loadedControllers = array();
+
+ foreach ($paths->controllerPaths as $path) {
+ foreach (listClasses($path) as $controller) {
+ list($name) = explode('.', $controller);
+ $className = Inflector::camelize(str_replace('_controller', '', $name));
+
+ if (loadController($className)) {
+ $loadedControllers[$controller] = $className;
+ }
+ }
+ }
+ return $loadedControllers;
+ }
+/**
+ * Loads a controller and its helper libraries.
+ *
+ * @param string $name Name of controller
+ * @return boolean Success
+ */
+ function loadController($name) {
+ $paths = Configure::getInstance();
+ if (!class_exists('AppController')) {
+ if (file_exists(APP . 'app_controller.php')) {
+ require(APP . 'app_controller.php');
+ } else {
+ require(CAKE . 'app_controller.php');
+ }
+ }
+
+ if ($name === null) {
+ return true;
+ }
+
+ if (!class_exists($name . 'Controller')) {
+ $name = Inflector::underscore($name);
+
+ foreach ($paths->controllerPaths as $path) {
+ if (file_exists($path . $name . '_controller.php')) {
+ require($path . $name . '_controller.php');
+ return true;
+ }
+ }
+
+ if ($controller_fn = fileExistsInPath(LIBS . 'controller' . DS . $name . '_controller.php')) {
+ if (file_exists($controller_fn)) {
+ require($controller_fn);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+/**
+ * Loads a plugin's controller.
+ *
+ * @param string $plugin Name of plugin
+ * @param string $controller Name of controller to load
+ * @return boolean Success
+ */
+ function loadPluginController($plugin, $controller) {
+ $pluginAppController = Inflector::camelize($plugin . '_app_controller');
+ $pluginAppControllerFile = APP . 'plugins' . DS . $plugin . DS . $plugin . '_app_controller.php';
+ if (!class_exists($pluginAppController)) {
+ if (file_exists($pluginAppControllerFile)) {
+ require($pluginAppControllerFile);
+ } else {
+ return false;
+ }
+ }
+
+ if (empty($controller)) {
+ if (!class_exists($plugin . 'Controller')) {
+ if (file_exists(APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $plugin . '_controller.php')) {
+ require(APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $plugin . '_controller.php');
+ return true;
+ }
+ }
+ }
+
+ if (!class_exists($controller . 'Controller')) {
+ $controller = Inflector::underscore($controller);
+ $file = APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $controller . '_controller.php';
+
+ if (file_exists($file)) {
+ require($file);
+ return true;
+ } elseif (!class_exists(Inflector::camelize($plugin . '_controller'))) {
+ if (file_exists(APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $plugin . '_controller.php')) {
+ require(APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . $plugin . '_controller.php');
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+/**
+ * Loads a helper
+ *
+ * @param string $name Name of helper
+ * @return boolean Success
+ */
+ function loadHelper($name) {
+ $paths = Configure::getInstance();
+
+ if ($name === null) {
+ return true;
+ }
+
+ if (!class_exists($name . 'Helper')) {
+ $name=Inflector::underscore($name);
+
+ foreach ($paths->helperPaths as $path) {
+ if (file_exists($path . $name . '.php')) {
+ require($path . $name . '.php');
+ return true;
+ }
+ }
+
+ if ($helper_fn = fileExistsInPath(LIBS . 'view' . DS . 'helpers' . DS . $name . '.php')) {
+ if (file_exists($helper_fn)) {
+ require($helper_fn);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+/**
+ * Loads a plugin's helper
+ *
+ * @param string $plugin Name of plugin
+ * @param string $helper Name of helper to load
+ * @return boolean Success
+ */
+ function loadPluginHelper($plugin, $helper) {
+ if (!class_exists($helper . 'Helper')) {
+ $helper = Inflector::underscore($helper);
+ $file = APP . 'plugins' . DS . $plugin . DS . 'views' . DS . 'helpers' . DS . $helper . '.php';
+ if (file_exists($file)) {
+ require($file);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ }
+/**
+ * Loads a component
+ *
+ * @param string $name Name of component
+ * @return boolean Success
+ */
+ function loadComponent($name) {
+ $paths = Configure::getInstance();
+
+ if ($name === null) {
+ return true;
+ }
+
+ if (!class_exists($name . 'Component')) {
+ $name=Inflector::underscore($name);
+
+ foreach ($paths->componentPaths as $path) {
+ if (file_exists($path . $name . '.php')) {
+ require($path . $name . '.php');
+ return true;
+ }
+ }
+
+ if ($component_fn = fileExistsInPath(LIBS . 'controller' . DS . 'components' . DS . $name . '.php')) {
+ if (file_exists($component_fn)) {
+ require($component_fn);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+/**
+ * Loads a plugin's component
+ *
+ * @param string $plugin Name of plugin
+ * @param string $helper Name of component to load
+ * @return boolean Success
+ */
+ function loadPluginComponent($plugin, $component) {
+ if (!class_exists($component . 'Component')) {
+ $component = Inflector::underscore($component);
+ $file = APP . 'plugins' . DS . $plugin . DS . 'controllers' . DS . 'components' . DS . $component . '.php';
+ if (file_exists($file)) {
+ require($file);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ }
+/**
+ * Returns an array of filenames of PHP files in given directory.
+ *
+ * @param string $path Path to scan for files
+ * @return array List of files in directory
+ */
+ function listClasses($path) {
+ $dir = opendir($path);
+ $classes=array();
+ while (false !== ($file = readdir($dir))) {
+ if ((substr($file, -3, 3) == 'php') && substr($file, 0, 1) != '.') {
+ $classes[] = $file;
+ }
+ }
+ closedir($dir);
+ return $classes;
+ }
+/**
+ * Loads configuration files
+ *
+ * @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.
+ *
+ * Example:
+ *
+ * uses('flay', 'time');
+ *
+ *
+ * @uses LIBS
+ */
+ function uses() {
+ $args = func_get_args();
+ foreach ($args as $arg) {
+ require_once(LIBS . strtolower($arg) . '.php');
+ }
+ }
+/**
+ * Require given files in the VENDORS directory. Takes optional number of parameters.
+ *
+ * @param string $name Filename without the .php part.
+ *
+ */
+ function vendor($name) {
+ $args = func_get_args();
+ foreach ($args as $arg) {
+ if (file_exists(APP . 'vendors' . DS . $arg . '.php')) {
+ require_once(APP . 'vendors' . DS . $arg . '.php');
+ } else {
+ require_once(VENDORS . $arg . '.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 $show_html If set to true, the method prints the debug data in a screen-friendly way.
+ */
+ function debug($var = false, $showHtml = false) {
+ if (Configure::read() > 0) {
+ print "\n\n";
+ ob_start();
+ print_r($var);
+ $var = ob_get_clean();
+
+ if ($showHtml) {
+ $var = str_replace('<', '<', str_replace('>', '>', $var));
+ }
+ print "{$var}\n \n";
+ }
+ }
+/**
+ * Returns microtime for execution time checking
+ *
+ * @return integer
+ */
+ if (!function_exists('getMicrotime')) {
+ function getMicrotime() {
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+ }
+ }
+/**
+ * Sorts given $array by key $sortby.
+ *
+ * @param array $array
+ * @param string $sortby
+ * @param string $order Sort order asc/desc (ascending or descending).
+ * @param integer $type
+ * @return mixed
+ */
+ if (!function_exists('sortByKey')) {
+ 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;
+ }
+ }
+/**
+ * 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
+ * @param array $a2
+ * @return mixed Outputs either combined array or false.
+ */
+ if (!function_exists('array_combine')) {
+ 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
+ * @return string
+ */
+ function h($text) {
+ if (is_array($text)) {
+ return array_map('h', $text);
+ }
+ return htmlspecialchars($text);
+ }
+/**
+ * Returns an array of all the given parameters.
+ *
+ * Example:
+ *
+ * a('a', 'b')
+ *
+ *
+ * Would return:
+ *
+ * array('a', 'b')
+ *
+ *
+ * @return array
+ */
+ 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
+ */
+ 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
+ */
+ function low($str) {
+ return strtolower($str);
+ }
+/**
+ * Convenience method for strtoupper().
+ *
+ * @param string $str String to uppercase
+ */
+ 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
+ */
+ 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
+ */
+ 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;
+ }
+/**
+ * Returns the REQUEST_URI from the server environment, or, failing that,
+ * constructs a new one, using the PHP_SELF constant and other variables.
+ *
+ * @return string URI
+ */
+ function setUri() {
+ if (env('HTTP_X_REWRITE_URL')) {
+ $uri = env('HTTP_X_REWRITE_URL');
+ } elseif (env('REQUEST_URI')) {
+ $uri = env('REQUEST_URI');
+ } else {
+ if (env('argv')) {
+ $uri = env('argv');
+
+ if (defined('SERVER_IIS')) {
+ $uri = BASE_URL . $uri[0];
+ } else {
+ $uri = env('PHP_SELF') . '/' . $uri[0];
+ }
+ } else {
+ $uri = env('PHP_SELF') . '/' . env('QUERY_STRING');
+ }
+ }
+ return $uri;
+ }
+/**
+ * Gets an environment variable from available sources.
+ * Used as a backup if $_SERVER/$_ENV are disabled.
+ *
+ * @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 (isset($_SERVER[$key])) {
+ return $_SERVER[$key];
+ } elseif (isset($_ENV[$key])) {
+ return $_ENV[$key];
+ } elseif (getenv($key) !== false) {
+ return getenv($key);
+ }
+
+ if ($key == 'SCRIPT_FILENAME' && defined('SERVER_IIS') && SERVER_IIS === true) {
+ return str_replace('\\\\', '\\', env('PATH_TRANSLATED') );
+ }
+
+ if ($key == '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));
+ }
+ if ($key == 'PHP_SELF') {
+ return r(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));
+ }
+ return null;
+ }
+/**
+ * Returns contents of a file as a string.
+ *
+ * @param string $fileName Name of the file.
+ * @param boolean $useIncludePath Wheter the function should use the include path or not.
+ * @return mixed Boolean false or contents of required file.
+ */
+ if (!function_exists('file_get_contents')) {
+ function file_get_contents($fileName, $useIncludePath = false) {
+ $res=fopen($fileName, 'rb', $useIncludePath);
+
+ if ($res === false) {
+ trigger_error('file_get_contents() failed to open stream: No such file or directory', E_USER_WARNING);
+ return false;
+ }
+ clearstatcache();
+
+ if ($fileSize = @filesize($fileName)) {
+ $data = fread($res, $fileSize);
+ } else {
+ $data = '';
+
+ while (!feof($res)) {
+ $data .= fread($res, 8192);
+ }
+ }
+ return "$data\n";
+ }
+ }
+/**
+ * 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.
+ */
+ if (!function_exists('file_put_contents')) {
+ 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 {
+ return $write;
+ }
+ }
+ }
+ }
+/**
+ * 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.
+ */
+ function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
+ $now = time();
+ if (!is_numeric($expires)) {
+ $expires = strtotime($expires, $now);
+ }
+
+ switch(strtolower($target)) {
+ case 'cache':
+ $filename = CACHE . $path;
+ break;
+ case 'public':
+ $filename = WWW_ROOT . $path;
+ break;
+ }
+
+ $timediff = $expires - $now;
+ $filetime = false;
+ if (file_exists($filename)) {
+ $filetime = @filemtime($filename);
+ }
+
+ if ($data === null) {
+ // Read data from file
+ if (file_exists($filename) && $filetime !== false) {
+ if ($filetime + $timediff < $now) {
+ // File has expired
+ @unlink($filename);
+ } else {
+ $data = file_get_contents($filename);
+ }
+ }
+ } else {
+ 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 unknown_type $value
+ * @return unknown
+ */
+ 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 unknown_type $msg
+ * @param unknown_type $return
+ * @return unknown
+ * @todo Not implemented fully till 2.0
+ */
+ function __($msg, $return = null) {
+ if (is_null($return)) {
+ echo($msg);
+ } else {
+ return $msg;
+ }
+ }
+/**
+ * Counts the dimensions of an array
+ *
+ * @param array $array
+ * @return int The number of dimensions in $array
+ */
+ function countdim($array) {
+ if (is_array(reset($array))) {
+ $return = countdim(reset($array)) + 1;
+ } else {
+ $return = 1;
+ }
+ return $return;
+ }
+/**
+ * Shortcut to Log::write.
+ */
+ function LogError($message) {
+ if (!class_exists('CakeLog')) {
+ uses('cake_log');
+ }
+ $bad = array("\n", "\r", "\t");
+ $good = ' ';
+ CakeLog::write('error', str_replace($bad, $good, $message));
+ }
+/**
+ * Searches include path for files
+ *
+ * @param string $file
+ * @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
+ * @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;
+ }
+
+/**
+ * chmod recursively on a directory
+ *
+ * @param string $path
+ * @param int $mode
+ * @return boolean
+ */
+ function chmodr($path, $mode = 0755) {
+ if (!is_dir($path)) {
+ return chmod($path, $mode);
+ }
+ $dir = opendir($path);
+
+ while ($file = readdir($dir)) {
+ if ($file != '.' && $file != '..') {
+ $fullpath = $path . '/' . $file;
+
+ if (!is_dir($fullpath)) {
+ if (!chmod($fullpath, $mode)) {
+ return false;
+ }
+ } else {
+ if (!chmodr($fullpath, $mode)) {
+ return false;
+ }
+ }
+ }
+ }
+ closedir($dir);
+
+ if (chmod($path, $mode)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+/**
+ * removed the plugin name from the base url
+ *
+ * @param string $base
+ * @param string $plugin
+ * @return base url with plugin name removed if present
+ */
+ function strip_plugin($base, $plugin) {
+ if ($plugin != null) {
+ $base = preg_replace('/' . $plugin . '/', '', $base);
+ $base = str_replace('//', '', $base);
+ $pos1 = strrpos($base, '/');
+ $char = strlen($base) - 1;
+
+ if ($pos1 == $char) {
+ $base = substr($base, 0, $char);
+ }
+ }
+ return $base;
+ }
+/**
+ * Wraps ternary operations. If $condition is a non-empty value, $val1 is returned, otherwise $val2.
+ *
+ * @param mixed $condition Conditional expression
+ * @param mixed $val1
+ * @param mixed $val2
+ * @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;
+ }
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/bootstrap.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/bootstrap.php
new file mode 100644
index 0000000..baed0e2
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/bootstrap.php
@@ -0,0 +1,104 @@
+
+ * 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: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Configuration, directory layout and standard libraries
+ */
+ if (!isset($bootstrap)) {
+ require CORE_PATH . 'cake' . DS . 'basics.php';
+ require APP_PATH . 'config' . DS . 'core.php';
+ require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
+ }
+ $TIME_START = getMicrotime();
+ require LIBS . 'object.php';
+ require LIBS . 'session.php';
+ require LIBS . 'security.php';
+ require LIBS . 'inflector.php';
+ require LIBS . 'configure.php';
+ $paths = Configure::getInstance();
+/**
+ * Enter description here...
+ */
+ if (empty($uri) && defined('BASE_URL')) {
+ $uri = setUri();
+
+ if ($uri === '/' || $uri === '/index.php' || $uri === '/'.APP_DIR.'/') {
+ $_GET['url'] = '/';
+ $url = '/';
+ } else {
+ if (strpos($uri, 'index.php') !== false) {
+ $uri = r('?', '', $uri);
+ $elements=explode('/index.php', $uri);
+ } else {
+ $elements = explode('/?', $uri);
+ }
+
+ if (!empty($elements[1])) {
+ $_GET['url'] = $elements[1];
+ $url = $elements[1];
+ } else {
+ $_GET['url'] = '/';
+ $url = '/';
+ }
+ }
+ } else {
+ if (empty($_GET['url'])) {
+ $url = null;
+ } else {
+ $url = $_GET['url'];
+ }
+ }
+
+ if (strpos($url, 'ccss/') === 0) {
+ include WWW_ROOT . DS . 'css.php';
+ die();
+ }
+
+ Configure::write('debug', DEBUG);
+
+ require CAKE . 'dispatcher.php';
+
+ if (defined('CACHE_CHECK') && CACHE_CHECK === true) {
+ if (empty($uri)) {
+ $uri = setUri();
+ }
+ $filename=CACHE . 'views' . DS . convertSlash($uri) . '.php';
+
+ if (file_exists($filename)) {
+ uses(DS . 'controller' . DS . 'component', DS . 'view' . DS . 'view');
+ $v = null;
+ $view = new View($v);
+ $view->renderCache($filename, $TIME_START);
+ } elseif (file_exists(CACHE . 'views' . DS . convertSlash($uri) . '_index.php')) {
+ uses(DS . 'controller' . DS . 'component', DS . 'view' . DS . 'view');
+ $v = null;
+ $view = new View($v);
+ $view->renderCache(CACHE . 'views' . DS . convertSlash($uri) . '_index.php', $TIME_START);
+ }
+ }
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/config.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/config.php
new file mode 100644
index 0000000..6d907df
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/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: 7692 $
+ * @modifiedby $LastChangedBy: nate $
+ * @lastmodified $Date: 2008-10-02 01:06:48 -0400 (Thu, 02 Oct 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+$config['Cake.version'] = '1.1.20.7692';
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/paths.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/paths.php
new file mode 100644
index 0000000..a2f9659
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/config/paths.php
@@ -0,0 +1,175 @@
+
+ * 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: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @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 application's directory.
+ */
+ define ('CAKE', CORE_PATH.'cake'.DS);
+/**
+ * Path to the application's directory.
+ */
+ define ('APP', ROOT.DS.APP_DIR.DS);
+/**
+ * Path to the application's models directory.
+ */
+ define ('MODELS', APP.'models'.DS);
+/**
+ * Path to the application's controllers directory.
+ */
+ define ('CONTROLLERS', APP.'controllers'.DS);
+/**
+ * Path to the application's controllers 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.
+ */
+ 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 directory.
+ */
+ define ('CSS', WWW_ROOT.'css'.DS);
+/**
+ * Path to the public directory.
+ */
+ define ('JS', WWW_ROOT.'js'.DS);
+/**
+ * Path to the scripts direcotry.
+ */
+ define('SCRIPTS', CAKE.'scripts'.DS);
+/**
+ * Path to the tests directory.
+ */
+ define ('TESTS', APP.'tests'.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', TESTS.'lib'.DS);
+/**
+ * Path to the temporary files directory.
+ */
+ 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.
+ */
+ 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
+ */
+ $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.
+ */
+ define ('IMAGES_URL', 'img/');
+/**
+ * Web path to the CSS files directory.
+ */
+ define ('CSS_URL', 'css/');
+/**
+ * Web path to the js files directory.
+ */
+ define ('JS_URL', 'js/');
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/dispatcher.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/dispatcher.php
new file mode 100644
index 0000000..c2325cf
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/dispatcher.php
@@ -0,0 +1,429 @@
+
+ * 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: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * List of helpers to include
+ */
+ uses('router', DS.'controller'.DS.'controller');
+/**
+ * Dispatcher translates URLs to controller-action-paramter triads.
+ *
+ * Dispatches the request, creating appropriate models and controllers.
+ *
+ * @package cake
+ * @subpackage cake.cake
+ */
+class Dispatcher extends Object {
+/**
+ * Base URL
+ * @var string
+ */
+ var $base = false;
+/**
+ * @var string
+ */
+ var $admin = false;
+/**
+ * @var string
+ */
+ var $webservices = null;
+/**
+ * @var string
+ */
+ var $plugin = null;
+/**
+ * Constructor.
+ */
+ function __construct() {
+ parent::__construct();
+ }
+/**
+ * Dispatches and invokes given URL, handing over control to the involved controllers, and then renders the results (if autoRender is set).
+ *
+ * If no controller of given name can be found, invoke() shows error messages in
+ * the form of Missing Controllers information. It does the same with Actions (methods of Controllers are called
+ * Actions).
+ *
+ * @param string $url URL information to work on.
+ * @param array $additionalParams Settings array ("bare", "return"),
+ * which is melded with the GET and POST params.
+ * @return boolean Success
+ */
+ function dispatch($url, $additionalParams=array()) {
+ $params = array_merge($this->parseParams($url), $additionalParams);
+ $missingController = false;
+ $missingAction = false;
+ $missingView = false;
+ $privateAction = false;
+ $this->base = $this->baseUrl();
+
+ if (empty($params['controller'])) {
+ $missingController = true;
+ } else {
+ $ctrlName = Inflector::camelize($params['controller']);
+ $ctrlClass = $ctrlName.'Controller';
+
+ if (!loadController($ctrlName)) {
+ $pluginName = Inflector::camelize($params['action']);
+ if (!loadPluginController(Inflector::underscore($ctrlName), $pluginName)) {
+ if (preg_match('/([\\.]+)/', $ctrlName)) {
+ return $this->cakeError('error404', array(
+ array('url' => strtolower($ctrlName),
+ 'message' => 'Was not found on this server',
+ 'base' => $this->base)));
+ } elseif (!class_exists($ctrlClass)) {
+ $missingController = true;
+ } else {
+ $params['plugin'] = null;
+ $this->plugin = null;
+ }
+ } else {
+ $params['plugin'] = Inflector::underscore($ctrlName);
+ }
+ } else {
+ $params['plugin'] = null;
+ $this->plugin = null;
+ }
+ }
+
+ if (isset($params['plugin'])) {
+ $plugin = $params['plugin'];
+ $pluginName = Inflector::camelize($params['action']);
+ $pluginClass = $pluginName.'Controller';
+ $ctrlClass = $pluginClass;
+ $oldAction = $params['action'];
+ $params = $this->_restructureParams($params);
+ $this->plugin = $plugin;
+ loadPluginModels($plugin);
+ $this->base = $this->base.'/'.Inflector::underscore($ctrlName);
+
+ if (empty($params['controller']) || !class_exists($pluginClass)) {
+ $params['controller'] = Inflector::underscore($ctrlName);
+ $ctrlClass = $ctrlName.'Controller';
+ if (!is_null($params['action'])) {
+ array_unshift($params['pass'], $params['action']);
+ }
+ $params['action'] = $oldAction;
+ }
+ }
+
+ if (empty($params['action'])) {
+ $params['action'] = 'index';
+ }
+
+ if (defined('CAKE_ADMIN')) {
+ if (isset($params[CAKE_ADMIN])) {
+ $this->admin = '/'.CAKE_ADMIN ;
+ $url = preg_replace('/'.CAKE_ADMIN.'(\/|$)/', '', $url);
+ $params['action'] = CAKE_ADMIN.'_'.$params['action'];
+ } elseif (strpos($params['action'], CAKE_ADMIN) === 0) {
+ $privateAction = true;
+ }
+ }
+
+ if ($missingController) {
+ return $this->cakeError('missingController', array(
+ array('className' => Inflector::camelize($params['controller']."Controller"),
+ 'webroot' => $this->webroot,
+ 'url' => $url,
+ 'base' => $this->base)));
+ } else {
+ $controller =& new $ctrlClass();
+ }
+
+ $classMethods = get_class_methods($controller);
+ $classVars = get_object_vars($controller);
+
+ if ((in_array($params['action'], $classMethods) || in_array(strtolower($params['action']), $classMethods)) && strpos($params['action'], '_', 0) === 0) {
+ $privateAction = true;
+ }
+
+ if (!in_array($params['action'], $classMethods) && !in_array(strtolower($params['action']), $classMethods)) {
+ $missingAction = true;
+ }
+
+ if (in_array(strtolower($params['action']), array('object', 'tostring', 'requestaction', 'log',
+ 'cakeerror', 'constructclasses', 'redirect',
+ 'set', 'setaction', 'validate', 'validateerrors',
+ 'render', 'referer', 'flash', 'flashout',
+ 'generatefieldnames', 'postconditions', 'cleanupfields',
+ 'beforefilter', 'beforerender', 'afterfilter'))) {
+ $missingAction = true;
+ }
+
+ if (in_array('return', array_keys($params)) && $params['return'] == 1) {
+ $controller->autoRender = false;
+ }
+
+ $controller->base = $this->base;
+ $base = strip_plugin($this->base, $this->plugin);
+ if (defined("BASE_URL")) {
+ $controller->here = $base . $this->admin . $url;
+ } else {
+ $controller->here = $base . $this->admin . '/' . $url;
+ }
+ $controller->webroot = $this->webroot;
+ $controller->params = $params;
+ $controller->action = $params['action'];
+
+ if (!empty($controller->params['data'])) {
+ $controller->data =& $controller->params['data'];
+ } else {
+ $controller->data = null;
+ }
+
+ if (!empty($controller->params['pass'])) {
+ $controller->passed_args =& $controller->params['pass'];
+ $controller->passedArgs =& $controller->params['pass'];
+ } else {
+ $controller->passed_args = null;
+ $controller->passedArgs = null;
+ }
+
+ if (!empty($params['bare'])) {
+ $controller->autoLayout = !$params['bare'];
+ } else {
+ $controller->autoLayout = $controller->autoLayout;
+ }
+
+ $controller->webservices = $params['webservices'];
+ $controller->plugin = $this->plugin;
+
+ if (!is_null($controller->webservices)) {
+ array_push($controller->components, $controller->webservices);
+ array_push($controller->helpers, $controller->webservices);
+ $component =& new Component($controller);
+ }
+ $controller->_initComponents();
+ $controller->constructClasses();
+
+ if ($missingAction && !in_array('scaffold', array_keys($classVars))) {
+ $this->start($controller);
+ return $this->cakeError('missingAction', array(
+ array('className' => Inflector::camelize($params['controller']."Controller"),
+ 'action' => $params['action'],
+ 'webroot' => $this->webroot,
+ 'url' => $url,
+ 'base' => $this->base)));
+ }
+
+ if ($privateAction) {
+ $this->start($controller);
+ return $this->cakeError('privateAction', array(
+ array('className' => Inflector::camelize($params['controller']."Controller"),
+ 'action' => $params['action'],
+ 'webroot' => $this->webroot,
+ 'url' => $url,
+ 'base' => $this->base)));
+ }
+ return $this->_invoke($controller, $params, $missingAction);
+ }
+/**
+ * Invokes given controller's render action if autoRender option is set. Otherwise the contents of the operation are returned as a string.
+ *
+ * @param object $controller
+ * @param array $params
+ * @param boolean $missingAction
+ * @return string
+ */
+ function _invoke (&$controller, $params, $missingAction = false) {
+ $this->start($controller);
+ $classVars = get_object_vars($controller);
+
+ if ($missingAction && in_array('scaffold', array_keys($classVars))) {
+ uses(DS.'controller'.DS.'scaffold');
+ return new Scaffold($controller, $params);
+ } else {
+ $output = call_user_func_array(array(&$controller, $params['action']), empty($params['pass'])? array(): $params['pass']);
+ }
+ if ($controller->autoRender) {
+ $output = $controller->render();
+ }
+ $controller->output =& $output;
+ $controller->afterFilter();
+ return $controller->output;
+ }
+/**
+ * Starts up a controller
+ *
+ * @param object $controller
+ */
+ function start(&$controller) {
+ if (!empty($controller->beforeFilter)) {
+ if (is_array($controller->beforeFilter)) {
+
+ foreach ($controller->beforeFilter as $filter) {
+ if (is_callable(array($controller,$filter)) && $filter != 'beforeFilter') {
+ $controller->$filter();
+ }
+ }
+ } else {
+ if (is_callable(array($controller, $controller->beforeFilter)) && $controller->beforeFilter != 'beforeFilter') {
+ $controller->{$controller->beforeFilter}();
+ }
+ }
+ }
+ $controller->beforeFilter();
+
+ foreach ($controller->components as $c) {
+ $path = preg_split('/\/|\./', $c);
+ $c = $path[count($path) - 1];
+ if (isset($controller->{$c}) && is_object($controller->{$c}) && is_callable(array($controller->{$c}, 'startup'))) {
+ $controller->{$c}->startup($controller);
+ }
+ }
+ }
+
+/**
+ * Returns array of GET and POST parameters. GET parameters are taken from given URL.
+ *
+ * @param string $from_url URL to mine for parameter information.
+ * @return array Parameters found in POST and GET.
+ */
+ function parseParams($from_url) {
+ $Route = new Router();
+ include CONFIGS.'routes.php';
+ $params = $Route->parse ($from_url);
+
+ if (ini_get('magic_quotes_gpc') == 1) {
+ if (!empty($_POST)) {
+ $params['form'] = stripslashes_deep($_POST);
+ }
+ } else {
+ $params['form'] = $_POST;
+ }
+
+ if (isset($params['form']['data'])) {
+ $params['data'] = $Route->stripEscape($params['form']['data']);
+ }
+
+ if (isset($_GET)) {
+ if (ini_get('magic_quotes_gpc') == 1) {
+ $params['url'] = stripslashes_deep($_GET);
+ } else {
+ $params['url'] = $_GET;
+ }
+ }
+
+ foreach ($_FILES as $name => $data) {
+ if ($name != 'data') {
+ $params['form'][$name] = $data;
+ }
+ }
+
+ if (isset($_FILES['data'])) {
+ foreach ($_FILES['data'] as $key => $data) {
+
+ foreach ($data as $model => $fields) {
+
+ foreach ($fields as $field => $value) {
+ $params['data'][$model][$field][$key] = $value;
+ }
+ }
+ }
+ }
+ $params['bare'] = empty($params['ajax'])? (empty($params['bare'])? 0: 1): 1;
+ $params['webservices'] = empty($params['webservices']) ? null : $params['webservices'];
+ return $params;
+ }
+/**
+ * Returns a base URL.
+ *
+ * @return string Base URL
+ */
+ function baseUrl() {
+ $htaccess = null;
+ $base = $this->admin;
+ $this->webroot = '';
+
+ if (defined('BASE_URL')) {
+ $base = BASE_URL.$this->admin;
+ }
+
+ $docRoot = env('DOCUMENT_ROOT');
+ $scriptName = env('PHP_SELF');
+ $r = null;
+ $appDirName = str_replace('/', '\/', preg_quote(APP_DIR));
+ $webrootDirName = str_replace('/', '\/', preg_quote(WEBROOT_DIR));
+
+ if (preg_match('/'.$appDirName.'\\'.DS.$webrootDirName.'/', $docRoot)) {
+ $this->webroot = '/';
+
+ if (preg_match('/^(.*)\/index\.php$/', $scriptName, $r)) {
+
+ if (!empty($r[1])) {
+ return $base.$r[1];
+ }
+ }
+ } else {
+ if (defined('BASE_URL')) {
+ $webroot = setUri();
+ $htaccess = preg_replace('/(?:'.APP_DIR.'\\/(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.'/'.$webrootDirName.'/';
+ }
+
+ if (preg_match('/^(.*)\\/'.$appDirName.'\\/'.$webrootDirName.'\\/index\\.php$/', $scriptName, $regs)) {
+
+ if (APP_DIR === 'app') {
+ $appDir = null;
+ } else {
+ $appDir = '/'.APP_DIR;
+ }
+ !empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].$appDir.'/';
+ return $base.$regs[1].$appDir;
+
+ } elseif (preg_match('/^(.*)\\/'.$webrootDirName.'([^\/i]*)|index\\\.php$/', $scriptName, $regs)) {
+ !empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[0].'/';
+ return $base.$regs[0];
+
+ } else {
+ !empty($htaccess)? $this->webroot = $htaccess : $this->webroot = '/';
+ return $base;
+ }
+ }
+ return $base;
+ }
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $params
+ * @return unknown
+ */
+ function _restructureParams($params) {
+ $params['controller'] = $params['action'];
+
+ if (isset($params['pass'][0])) {
+ $params['action'] = $params['pass'][0];
+ array_shift($params['pass']);
+ } else {
+ $params['action'] = null;
+ }
+ return $params;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cache.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cache.php
new file mode 100644
index 0000000..9d59ef6
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cache.php
@@ -0,0 +1,137 @@
+
+ * 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.libs
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Included libraries.
+ *
+ */
+ if (!class_exists('Model')) {
+ uses(DS . 'model' . DS . 'model');
+ }
+/**
+ * Caching for Cake.
+ *
+ *
+ * @package cake
+ * @subpackage cake.cake.libs
+ */
+class Cache extends Model{
+/**
+ * Identifier. Either an MD5 string or NULL.
+ *
+ * @var string
+ */
+ var $id = null;
+/**
+ * Content container for cache data.
+ *
+ * @var unknown_type
+ */
+ var $data = null;
+/**
+ * Content to be cached.
+ *
+ * @var unknown_type
+ */
+ var $for_caching = null;
+/**
+ * Name of the database table used for caching.
+ *
+ * @var string
+ */
+ var $useTable = 'cache';
+/**
+ * Constructor. Generates an md5'ed id for internal use. Calls the constructor on Model as well.
+ *
+ * @param unknown_type $id
+ */
+ function __construct($id) {
+ $this->id = (md5($id));
+ parent::__construct($this->id);
+ }
+/**
+ * Returns this object's id after setting it. If called without parameters the current object's id is returned.
+ *
+ * @param unknown_type $id
+ * @return unknown
+ */
+ function id($id = null) {
+ if (!$id) {
+ return $this->id;
+ }
+ return ($this->id = $id);
+ }
+/**
+ * Store given content in cache database.
+ *
+ * @param string $content Content to keep in cache.
+ * @param int $keep_for Number of seconds to keep data in cache.
+ * @return boolean Success
+ */
+ function remember($content, $keep_for = CACHE_PAGES_FOR) {
+ $data = addslashes($this->for_caching . $content);
+ $expire = date("Y-m-d H:i:s", time() + ($keep_for > 0 ? $keep_for : 999999999));
+ return $this->query("REPLACE {$this->useTable} (id,data,expire) VALUES ('{$this->id}', '{$data}', '{$expire}')");
+ }
+/**
+ * Returns content from the Cache object itself, if the Cache object has a non-empty data property.
+ * Else from the database cache.
+ *
+ * @return unknown
+ */
+ function restore() {
+ if (empty($this->data['data'])) {
+ return $this->find("id='{$this->id}' AND expire>NOW()");
+ }
+ return $this->data['data'];
+ }
+/**
+ * Returns true if the cache data property has current (non-stale) content for given id.
+ *
+ * @return boolean
+ */
+ function has() {
+ return is_array($this->data = $this->find("id='{$this->id}' AND expire>NOW()"));
+ }
+/**
+ * Appends $string to the for_caching property of the Cache object.
+ *
+ * @param string $string
+ */
+ function append($string) {
+ $this->for_caching .= $string;
+ }
+/**
+ * Clears the cache database table.
+ *
+ * @return unknown
+ */
+ function clear() {
+ return $this->query("DELETE FROM {$this->useTable}");
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cake_log.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cake_log.php
new file mode 100644
index 0000000..7f6e7e0
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/cake_log.php
@@ -0,0 +1,57 @@
+
+ * 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.libs
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Included libraries.
+ *
+ */
+ if (!class_exists('File')) {
+ uses('file');
+ }
+/**
+ * Logs messages to text files
+ *
+ * @package cake
+ * @subpackage cake.cake.libs
+ */
+class CakeLog{
+/**
+ * Writes given message to a log file in the logs directory.
+ *
+ * @param string $type Type of log, becomes part of the log's filename
+ * @param string $msg Message to log
+ * @return boolean Success
+ */
+ function write($type, $msg) {
+ $filename = LOGS . $type . '.log';
+ $output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $msg . "\n";
+ $log = new File($filename);
+ return $log->append($output);
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/class_registry.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/class_registry.php
new file mode 100644
index 0000000..45b1822
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/class_registry.php
@@ -0,0 +1,117 @@
+
+ * 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.libs
+ * @since CakePHP(tm) v 0.9.2
+ * @version $Revision: 7691 $
+ * @modifiedby $LastChangedBy: nate $
+ * @lastmodified $Date: 2008-10-02 00:59:12 -0400 (Thu, 02 Oct 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Class Collections.
+ *
+ * A repository for class objects, each registered with a key.
+ * If you try to add an object with the same key twice, nothing will come of it.
+ * If you need a second instance of an object, give it another key.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs
+ */
+class ClassRegistry{
+/**
+ * Names of classes with their objects.
+ *
+ * @var array
+ * @access private
+ */
+ var $_objects = array();
+/**
+ * Return a singleton instance of the ClassRegistry.
+ *
+ * @return ClassRegistry instance
+ */
+ function &getInstance() {
+ static $instance = array();
+ if (!$instance) {
+ $instance[0] = &new ClassRegistry;
+ }
+ return $instance[0];
+ }
+/**
+ * Add $object to the registry, associating it with the name $key.
+ *
+ * @param string $key
+ * @param mixed $object
+ */
+ function addObject($key, &$object) {
+ $_this =& ClassRegistry::getInstance();
+ $key = Inflector::underscore($key);
+ if (array_key_exists($key, $_this->_objects) === false) {
+ $_this->_objects[$key] = &$object;
+ }
+ }
+/**
+ * Remove object which corresponds to given key.
+ *
+ * @param string $key
+ * @return void
+ */
+ function removeObject($key) {
+ $_this =& ClassRegistry::getInstance();
+ $key = Inflector::underscore($key);
+ if (array_key_exists($key, $_this->_objects) === true) {
+ unset($_this->_objects[$key]);
+ }
+ }
+/**
+ * Returns true if given key is present in the ClassRegistry.
+ *
+ * @param string $key Key to look for
+ * @return boolean Success
+ */
+ function isKeySet($key) {
+ $_this =& ClassRegistry::getInstance();
+ $key = Inflector::underscore($key);
+ return array_key_exists($key, $_this->_objects);
+ }
+/**
+ * Get all keys from the regisrty.
+ *
+ * @return array
+ */
+ function keys() {
+ $_this =& ClassRegistry::getInstance();
+ return array_keys($_this->_objects);
+ }
+/**
+ * Return object which corresponds to given key.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ function &getObject($key) {
+ $_this =& ClassRegistry::getInstance();
+ $key = Inflector::underscore($key);
+ return $_this->_objects[$key];
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/configure.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/configure.php
new file mode 100644
index 0000000..677db20
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/configure.php
@@ -0,0 +1,354 @@
+
+ * 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.libs
+ * @since CakePHP(tm) v 1.0.0.2363
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs
+ */
+class Configure extends Object {
+/**
+ * Hold array with paths to view files
+ *
+ * @var array
+ * @access public
+ */
+ var $viewPaths = array();
+/**
+ * Hold array with paths to controller files
+ *
+ * @var array
+ * @access public
+ */
+ var $controllerPaths = array();
+/**
+ * Enter description here...
+ *
+ * @var array
+ * @access public
+ */
+ var $modelPaths = array();
+/**
+ * Enter description here...
+ *
+ * @var array
+ * @access public
+ */
+ var $helperPaths = array();
+/**
+ * Enter description here...
+ *
+ * @var array
+ * @access public
+ */
+ var $componentPaths = array();
+/**
+ * Enter description here...
+ *
+ * @var integer
+ * @access public
+ */
+ var $debug = null;
+/**
+ * Return a singleton instance of Configure.
+ *
+ * @return Configure instance
+ * @access public
+ */
+ function &getInstance() {
+ static $instance = array();
+ if (!$instance) {
+ $instance[0] =& new Configure;
+ $instance[0]->__loadBootstrap();
+ }
+ return $instance[0];
+ }
+/**
+ * Used to write a dynamic var in the Configure instance.
+ *
+ * Usage
+ * Configure::write('One.key1', 'value of the Configure::One[key1]');
+ * Configure::write(array('One.key1' => 'value of the Configure::One[key1]'));
+ * Configure::write('One', array('key1'=>'value of the Configure::One[key1]', 'key2'=>'value of the Configure::One[key2]');
+ * Configure::write(array('One.key1' => 'value of the Configure::One[key1]', 'One.key2' => 'value of the Configure::One[key2]'));
+ *
+ * @param array $config
+ * @return void
+ * @access public
+ */
+ function write($config, $value = null) {
+ $_this =& Configure::getInstance();
+
+ if (!is_array($config) && $value !== null) {
+ $name = $_this->__configVarNames($config);
+
+ if (count($name) > 1) {
+ $_this->{$name[0]}[$name[1]] = $value;
+ } else {
+ $_this->{$name[0]} = $value;
+ }
+ } else {
+
+ foreach ($config as $names => $value) {
+ $name = $_this->__configVarNames($names);
+ if (count($name) > 1) {
+ $_this->{$name[0]}[$name[1]] = $value;
+ } else {
+ $_this->{$name[0]} = $value;
+ }
+ }
+ }
+
+ if ($config == 'debug' || (is_array($config) && in_array('debug', $config))) {
+ if ($_this->debug) {
+ error_reporting(E_ALL);
+
+ if (function_exists('ini_set')) {
+ ini_set('display_errors', 1);
+ }
+ } else {
+ error_reporting(0);
+ }
+ }
+ }
+/**
+ * Used to read Configure::$var
+ *
+ * Usage
+ * Configure::read('Name'); will return all values for Name
+ * Configure::read('Name.key'); will return only the value of Configure::Name[key]
+ *
+ * @param string $var
+ * @return string value of Configure::$var
+ * @access public
+ */
+ function read($var = 'debug') {
+ $_this =& Configure::getInstance();
+ if ($var === 'debug') {
+ if (!isset($_this->debug)) {
+ $_this->debug = DEBUG;
+ }
+ return $_this->debug;
+ }
+
+ $name = $_this->__configVarNames($var);
+ if (count($name) > 1) {
+ if (isset($_this->{$name[0]}[$name[1]])) {
+ return $_this->{$name[0]}[$name[1]];
+ }
+ return null;
+ } else {
+ if (isset($_this->{$name[0]})) {
+ return $_this->{$name[0]};
+ }
+ return null;
+ }
+ }
+/**
+ * Used to delete a var from the Configure instance.
+ *
+ * Usage:
+ * Configure::delete('Name'); will delete the entire Configure::Name
+ * Configure::delete('Name.key'); will delete only the Configure::Name[key]
+ *
+ * @param string $var the var to be deleted
+ * @return void
+ * @access public
+ */
+ function delete($var = null) {
+ $_this =& Configure::getInstance();
+
+ $name = $_this->__configVarNames($var);
+ if (count($name) > 1) {
+ unset($_this->{$name[0]}[$name[1]]);
+ } else {
+ unset($_this->{$name[0]});
+ }
+ }
+/**
+ * Will load a file from app/config/configure_file.php
+ * variables in the files should be formated like:
+ * $config['name'] = 'value';
+ * These will be used to create dynamic Configure vars.
+ *
+ * Usage Configure::load('configure_file');
+ *
+ * @param string $fileName name of file to load, extension must be .php and only the name should be used, not the extenstion
+ * @return Configure::write
+ * @access public
+ */
+ function load($fileName) {
+ $_this =& Configure::getInstance();
+
+ if (!file_exists(CONFIGS . $fileName . '.php')) {
+ trigger_error("Configure::load() - $fileName.php not found", E_USER_WARNING);
+ return false;
+ }
+ include(CONFIGS . $fileName . '.php');
+ if (!isset($config)) {
+ trigger_error("Configure::load() - no variable \$config found in $fileName.php", E_USER_WARNING);
+ return false;
+ }
+ return $_this->write($config);
+ }
+
+/**
+ * Used to determine the current version of CakePHP
+ *
+ * Usage Configure::version();
+ *
+ * @return string Current version of CakePHP
+ * @access public
+ */
+ function version() {
+ $_this =& Configure::getInstance();
+ if (!isset($_this->Cake['version'])) {
+ require(CORE_PATH . 'cake' . DS . 'config' . DS . 'config.php');
+ $_this->write($config);
+ }
+ return $_this->Cake['version'];
+ }
+/**
+ * Checks $name for dot notation to create dynamic Configure::$var as an array when needed.
+ *
+ * @param mixed $name
+ * @return array
+ * @access private
+ */
+ function __configVarNames($name) {
+ if (is_string($name)) {
+ if (strpos($name, ".")) {
+ $name = explode(".", $name);
+ } else {
+ $name = array($name);
+ }
+ }
+ return $name;
+ }
+/**
+ * Sets the var modelPaths
+ *
+ * @param array $modelPaths
+ * @access private
+ */
+ function __buildModelPaths($modelPaths) {
+ $_this =& Configure::getInstance();
+ $_this->modelPaths[] = MODELS;
+ if (isset($modelPaths)) {
+ foreach ($modelPaths as $value) {
+ $_this->modelPaths[] = $value;
+ }
+ }
+ }
+/**
+ * Sets the var viewPaths
+ *
+ * @param array $viewPaths
+ * @access private
+ */
+ function __buildViewPaths($viewPaths) {
+ $_this =& Configure::getInstance();
+ $_this->viewPaths[] = VIEWS;
+ if (isset($viewPaths)) {
+ foreach ($viewPaths as $value) {
+ $_this->viewPaths[] = $value;
+ }
+ }
+ }
+/**
+ * Sets the var controllerPaths
+ *
+ * @param array $controllerPaths
+ * @access private
+ */
+ function __buildControllerPaths($controllerPaths) {
+ $_this =& Configure::getInstance();
+ $_this->controllerPaths[] = CONTROLLERS;
+ if (isset($controllerPaths)) {
+ foreach ($controllerPaths as $value) {
+ $_this->controllerPaths[] = $value;
+ }
+ }
+ }
+/**
+ * Sets the var helperPaths
+ *
+ * @param array $helperPaths
+ * @access private
+ */
+ function __buildHelperPaths($helperPaths) {
+ $_this =& Configure::getInstance();
+ $_this->helperPaths[] = HELPERS;
+ if (isset($helperPaths)) {
+ foreach ($helperPaths as $value) {
+ $_this->helperPaths[] = $value;
+ }
+ }
+ }
+/**
+ * Sets the var componentPaths
+ *
+ * @param array $componentPaths
+ * @access private
+ */
+ function __buildComponentPaths($componentPaths) {
+ $_this =& Configure::getInstance();
+ $_this->componentPaths[] = COMPONENTS;
+ if (isset($componentPaths)) {
+ foreach ($componentPaths as $value) {
+ $_this->componentPaths[] = $value;
+ }
+ }
+ }
+/**
+ * Loads the app/config/bootstrap.php
+ * If the alternative paths are set in this file
+ * they will be added to the paths vars
+ *
+ * @access private
+ */
+ function __loadBootstrap() {
+ $_this =& Configure::getInstance();
+ $_this->write('Session.checkAgent', true);
+ $modelPaths = null;
+ $viewPaths = null;
+ $controllerPaths = null;
+ $helperPaths = null;
+ $componentPaths = null;
+ require APP_PATH . 'config' . DS . 'bootstrap.php';
+ $_this->__buildModelPaths($modelPaths);
+ $_this->__buildViewPaths($viewPaths);
+ $_this->__buildControllerPaths($controllerPaths);
+ $_this->__buildHelperPaths($helperPaths);
+ $_this->__buildComponentPaths($componentPaths);
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/component.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/component.php
new file mode 100644
index 0000000..d604269
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/component.php
@@ -0,0 +1,139 @@
+
+ * 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.libs.controller
+ * @since CakePHP(tm) v TBD
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Component
+ *
+ * Used to create instances of applications components
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller
+ */
+class Component extends Object {
+/**
+ * Instance Controller
+ *
+ * @var object
+ * @access private
+ */
+ var $__controller = null;
+/**
+ * Constructor
+ */
+ function __construct() {
+ }
+/**
+ * Used to initialize the components for current controller
+ *
+ * @param object $controller
+ * @access public
+ */
+ function init(&$controller) {
+ $this->__controller =& $controller;
+
+ if ($this->__controller->components !== false) {
+ $loaded = array();
+ $this->__controller->components = array_merge(array('Session'), $this->__controller->components);
+ $loaded = $this->__loadComponents($loaded, $this->__controller->components);
+
+ foreach (array_keys($loaded)as $component) {
+ $tempComponent =& $loaded[$component];
+
+ if (isset($tempComponent->components) && is_array($tempComponent->components)) {
+ foreach ($tempComponent->components as $subComponent) {
+ $this->__controller->{$component}->{$subComponent} =& $loaded[$subComponent];
+ }
+ }
+ if (is_callable(array($tempComponent, 'initialize'))) {
+ $tempComponent->initialize($controller);
+ }
+ }
+ }
+ }
+
+/**
+ * Enter description here...
+ *
+ * @param array $loaded
+ * @param array $components
+ * @return loaded components
+ * @access private
+ */
+ function &__loadComponents(&$loaded, $components) {
+ foreach ($components as $component) {
+ $parts = preg_split('/\/|\./', $component);
+
+ if (count($parts) === 1) {
+ $plugin = $this->__controller->plugin;
+ } else {
+ $plugin = Inflector::underscore($parts['0']);
+ $component = $parts[count($parts) - 1];
+ }
+
+ $componentCn = $component . 'Component';
+
+ if (in_array($component, array_keys($loaded)) !== true) {
+
+ if (!class_exists($componentCn)) {
+
+ if (is_null($plugin) || !loadPluginComponent($plugin, $component)) {
+
+ if (!loadComponent($component)) {
+ $this->cakeError('missingComponentFile', array(array(
+ 'className' => $this->__controller->name,
+ 'component' => $component,
+ 'file' => Inflector::underscore($component) . '.php',
+ 'base' => $this->__controller->base)));
+ exit();
+ }
+ }
+
+ if (!class_exists($componentCn)) {
+ $this->cakeError('missingComponentClass', array(array(
+ 'className' => $this->__controller->name,
+ 'component' => $component,
+ 'file' => Inflector::underscore($component) . '.php',
+ 'base' => $this->__controller->base)));
+ exit();
+ }
+ }
+
+ if ($componentCn == 'SessionComponent') {
+ $param = strip_plugin($this->__controller->base, $this->__controller->plugin) . '/';
+ } else {
+ $param = null;
+ }
+ $this->__controller->{$component} =& new $componentCn($param);
+ $loaded[$component] =& $this->__controller->{$component};
+
+ if (isset($this->__controller->{$component}->components) && is_array($this->__controller->{$component}->components)) {
+ $loaded =& $this->__loadComponents($loaded, $this->__controller->{$component}->components);
+ }
+ }
+ }
+ return $loaded;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl.php
new file mode 100644
index 0000000..1c2792a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl.php
@@ -0,0 +1,196 @@
+
+ * 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.libs.controller.components
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Access Control List factory class.
+ *
+ * Looks for ACL implementation class in core config, and returns an instance of that class.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components
+ */
+class AclComponent extends Object {
+/**
+ * Instance of ACL_CLASSNAME set in app/config/core.php
+ *
+ * @var object
+ */
+ var $_instance = null;
+/**
+ * Enter description here...
+ *
+ * @var boolean
+ */
+ var $controller = true;
+/**
+ * Constructor.
+ *
+ * Will return an instance of the correct ACL class.
+ */
+ function __construct() {
+ $this->getACL();
+ }
+/**
+ * Static function used to gain an instance of the correct ACL class.
+ *
+ * @return object instance of ACL_CLASSNAME set in app/config/core.php
+ * @access public
+ */
+ function &getACL() {
+ if ($this->_instance == null) {
+ uses('controller' . DS . 'components' . DS . ACL_FILENAME);
+ $classname = ACL_CLASSNAME;
+ $this->_instance = new $classname;
+ }
+
+ if ($classname == 'DB_ACL') {
+ $this->Aro = new Aro();
+ $this->Aco = new Aco();
+ }
+ return $this->_instance;
+ }
+/**
+ * Empty class defintion, to be overridden in subclasses.
+ *
+ * @access public
+ */
+ function _initACL() {
+ }
+/**
+ * Pass-thru function for ACL check instance.
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action : default = *
+ * @return boolean
+ * @access public
+ */
+ function check($aro, $aco, $action = "*") {
+ return $this->_instance->check($aro, $aco, $action);
+ }
+/**
+ * Pass-thru function for ACL allow instance.
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action : default = *
+ * @return boolean
+ * @access public
+ */
+ function allow($aro, $aco, $action = "*") {
+ return $this->_instance->allow($aro, $aco, $action);
+ }
+/**
+ * Pass-thru function for ACL deny instance.
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action : default = *
+ * @return boolean
+ * @abstract public
+ */
+ function deny($aro, $aco, $action = "*") {
+ return $this->_instance->deny($aro, $aco, $action);
+ }
+/**
+ * Pass-thru function for ACL inherit instance.
+ *
+ * @return boolean
+ * @abstract public
+ */
+ function inherit($aro, $aco, $action = "*") {
+ return $this->_instance->inherit($aro, $aco, $action);
+ }
+/**
+ * Pass-thru function for ACL grant instance.
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action : default = *
+ * @return boolean
+ * @access public
+ */
+ function grant($aro, $aco, $action = "*") {
+ return $this->_instance->grant($aro, $aco, $action);
+ }
+/**
+ * Pass-thru function for ACL grant instance.
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action : default = *
+ * @return boolean
+ * @access public
+ */
+ function revoke($aro, $aco, $action = "*") {
+ return $this->_instance->revoke($aro, $aco, $action);
+ }
+/**
+ * Sets the current ARO instance to object from getAro
+ *
+ * @param string $id
+ * @return boolean
+ * @access public
+ */
+ function setAro($id) {
+ return $this->Aro = $this->_instance->getAro($id);
+ }
+/**
+* Sets the current ACO instance to object from getAco
+ *
+ * @param string $id
+ * @return boolean
+ * @access public
+ */
+ function setAco($id) {
+ return $this->Aco = $this->_instance->getAco($id);
+ }
+/**
+ * Pass-thru function for ACL getAro instance
+ * that gets an ARO object from the given id or alias
+ *
+ * @param string $id
+ * @return object Aro
+ * @access public
+ */
+ function getAro($id) {
+ return $this->_instance->getAro($id);
+ }
+/**
+ * Pass-thru function for ACL getAco instance.
+ * that gets an ACO object from the given id or alias
+ *
+ * @param string $id
+ * @return object Aco
+ * @access public
+ */
+ function getAco($id) {
+ return $this->_instance->getAco($id);
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl_base.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl_base.php
new file mode 100644
index 0000000..82e162a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/acl_base.php
@@ -0,0 +1,63 @@
+
+ * 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.libs.controller.components
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Access Control List abstract class. Not to be instantiated.
+ * Subclasses of this class are used by AclComponent to perform ACL checks in Cake.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components
+ * @abstract
+ */
+class AclBase extends Object {
+/**
+ * This class should never be instantiated, just subclassed.
+ *
+ * No instantiations or constructor calls (even statically)
+ *
+ * @return AclBase
+ * @abstract
+ */
+ function __construct() {
+ if (strcasecmp(get_class($this), "AclBase") == 0 || !is_subclass_of($this, "AclBase")) {
+ trigger_error("[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.", E_USER_ERROR);
+ return null;
+ }
+ }
+/**
+ * Empty method to be overridden in subclasses
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @abstract
+ */
+ function check($aro, $aco, $action = "*") {
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/db_acl.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/db_acl.php
new file mode 100644
index 0000000..f575a2a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/db_acl.php
@@ -0,0 +1,310 @@
+
+ * 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.libs.controller.componenets.dbacl
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+if (!defined('ACL_DATABASE')) {
+ define('ACL_DATABASE', 'default');
+}
+uses('controller' . DS . 'components' . DS . 'acl_base');
+uses('controller' . DS . 'components' . DS . 'dbacl' . DS . 'models' . DS . 'aclnode');
+uses('controller' . DS . 'components' . DS . 'dbacl' . DS . 'models' . DS . 'aco');
+uses('controller' . DS . 'components' . DS . 'dbacl' . DS . 'models' . DS . 'acoaction');
+uses('controller' . DS . 'components' . DS . 'dbacl' . DS . 'models' . DS . 'aro');
+uses('controller' . DS . 'components' . DS . 'dbacl' . DS . 'models' . DS . 'aros_aco');
+/**
+ * In this file you can extend the AclBase.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components.dbacl
+ */
+class DB_ACL extends AclBase {
+/**
+ * Enter description here...
+ *
+ */
+ function __construct() {
+ }
+/**
+ * Enter description here...
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @return boolean
+ * @access public
+ */
+ function check($aro, $aco, $action = "*") {
+ $Perms = new ArosAco();
+ $Aro = new Aro();
+ $Aco = new Aco();
+
+ if ($aro == null || $aco == null) {
+ return false;
+ }
+
+ $permKeys = $this->_getAcoKeys($Perms->loadInfo());
+ $aroPath = $Aro->getPath($aro);
+ $tmpAcoPath = $Aco->getPath($aco);
+
+ if ($tmpAcoPath === null) {
+ return false;
+ }
+ $tmpAcoPath = array_reverse($tmpAcoPath);
+ $acoPath = array();
+
+ if ($action != '*' && !in_array('_' . $action, $permKeys)) {
+ trigger_error('ACO permissions key "' . $action . '" does not exist in DB_ACL::check()', E_USER_NOTICE);
+ return false;
+ }
+
+ foreach ($tmpAcoPath as $a) {
+ $acoPath[] = $a['Aco']['id'];
+ }
+
+ for ($i = count($aroPath) - 1; $i >= 0; $i--) {
+ $perms = $Perms->findAll(array('ArosAco.aro_id' => $aroPath[$i]['Aro']['id'],
+ 'ArosAco.aco_id' => $acoPath), null,
+ 'Aco.lft desc');
+ if ($perms == null || count($perms) == 0) {
+ continue;
+ } else {
+ foreach ($perms as $perm) {
+ if ($action == '*') {
+ // ARO must be cleared for ALL ACO actions
+ foreach ($permKeys as $key) {
+ if (isset($perm['ArosAco'])) {
+ if ($perm['ArosAco'][$key] != 1) {
+ return false;
+ }
+ }
+ }
+ return true;
+
+ } else {
+ switch($perm['ArosAco']['_' . $action]) {
+ case -1:
+ return false;
+ case 0:
+ continue;
+ break;
+ case 1:
+ return true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+/**
+ * Enter description here...
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @param integer $value
+ * @return boolean
+ * @access public
+ */
+ function allow($aro, $aco, $action = "*", $value = 1) {
+ $Perms = new ArosAco();
+ $perms = $this->getAclLink($aro, $aco);
+ $permKeys = $this->_getAcoKeys($Perms->loadInfo());
+ $save = array();
+
+ if ($perms == false) {
+ trigger_error('DB_ACL::allow() - Invalid node', E_USER_WARNING);
+ return false;
+ }
+
+ if (isset($perms[0])) {
+ $save = $perms[0]['ArosAco'];
+ }
+
+ if ($action == "*") {
+ $permKeys = $this->_getAcoKeys($Perms->loadInfo());
+
+ foreach ($permKeys as $key) {
+ $save[$key] = $value;
+ }
+ } else {
+ if (in_array('_' . $action, $permKeys)) {
+ $save['_' . $action] = $value;
+ } else {
+ trigger_error('DB_ACL::allow() - Invalid ACO action', E_USER_WARNING);
+ return false;
+ }
+ }
+
+ $save['aro_id'] = $perms['aro'];
+ $save['aco_id'] = $perms['aco'];
+
+ if ($perms['link'] != null && count($perms['link']) > 0) {
+ $save['id'] = $perms['link'][0]['ArosAco']['id'];
+ }
+ return $Perms->save(array('ArosAco' => $save));
+ }
+/**
+ * Enter description here...
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @return boolean
+ * @access public
+ */
+ function deny($aro, $aco, $action = "*") {
+ return $this->allow($aro, $aco, $action, -1);
+ }
+/**
+ * Enter description here...
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @return boolean
+ * @access public
+ */
+ function inherit($aro, $aco, $action = "*") {
+ return $this->allow($aro, $aco, $action, 0);
+ }
+/**
+ * Enter description here...
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @return boolean
+ * @access public
+ */
+ function grant($aro, $aco, $action = "*") {
+ return $this->allow($aro, $aco, $action);
+ }
+/**
+ * Enter description here...
+ *
+ * @param string $aro
+ * @param string $aco
+ * @param string $action
+ * @return boolean
+ * @access public
+ */
+ function revoke($aro, $aco, $action = "*") {
+ return $this->deny($aro, $aco, $action);
+ }
+/**
+ * Get an ARO object from the given id or alias
+ *
+ * @param mixed $id
+ * @return object Aro
+ * @access public
+ */
+ function getAro($id = null) {
+ return $this->__getObject($id, 'Aro');
+ }
+/**
+ * Get an ACO object from the given id or alias
+ *
+ * @param mixed $id
+ * @return object Aco
+ * @access public
+ */
+ function getAco($id = null) {
+ return $this->__getObject($id, 'Aco');
+ }
+ function __getObject($id = null, $object) {
+ if ($id == null) {
+ trigger_error('Null id provided in DB_ACL::get' . $object, E_USER_WARNING);
+ return null;
+ }
+
+ $obj = new $object;
+
+ if (is_numeric($id)) {
+ $key = 'foreign_key';
+ if ($object == 'Aco') {
+ $key = 'object_id';
+ }
+
+ $conditions = array($object . '.' . $key => $id);
+ } else {
+ $conditions = array($object . '.alias' => $id);
+ }
+
+ $tmp = $obj->find($conditions);
+ $obj->id = $tmp[$object]['id'];
+ return $obj;
+ }
+/**
+ * Get an array of access-control links between the given Aro and Aco
+ *
+ * @param mixed $aro
+ * @param mixed $aco
+ * @return array
+ * @access public
+ */
+ function getAclLink($aro, $aco) {
+ $Aro = new Aro();
+ $Aco = new Aco();
+ $Link = new ArosAco();
+
+ $obj = array();
+ $obj['Aro'] = $Aro->find($Aro->_resolveID($aro));
+ $obj['Aco'] = $Aco->find($Aco->_resolveID($aco));
+ $obj['Aro'] = $obj['Aro']['Aro'];
+ $obj['Aco'] = $obj['Aco']['Aco'];
+
+ if ($obj['Aro'] == null || count($obj['Aro']) == 0 || $obj['Aco'] == null || count($obj['Aco']) == 0) {
+ return false;
+ }
+ return array('aro' => $obj['Aro']['id'],
+ 'aco' => $obj['Aco']['id'],
+ 'link' => $Link->findAll(array(
+ 'ArosAco.aro_id' => $obj['Aro']['id'],
+ 'ArosAco.aco_id' => $obj['Aco']['id'])));
+ }
+/**
+ * Enter description here...
+ *
+ * @param object $keys
+ * @return array
+ * @access protected
+ */
+ function _getAcoKeys($keys) {
+ $newKeys = array();
+ $keys = $keys->value;
+
+ foreach ($keys as $key) {
+ if ($key['name'] != 'id' && $key['name'] != 'aro_id' && $key['name'] != 'aco_id') {
+ $newKeys[] = $key['name'];
+ }
+ }
+ return $newKeys;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aclnode.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aclnode.php
new file mode 100644
index 0000000..6ea9753
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aclnode.php
@@ -0,0 +1,309 @@
+
+ * 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.libs.controller.components.dbacl.models
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Load AppModel class
+ */
+loadModel();
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components.dbacl.models
+ *
+ */
+class AclNode extends AppModel {
+/**
+ * Database configuration to use
+ *
+ * @var string
+ */
+ var $useDbConfig = ACL_DATABASE;
+/**
+ * Cache Queries
+ *
+ * @var boolean
+ */
+ var $cacheQueries = false;
+/**
+ * Creates a new ARO/ACO node
+ *
+ * @param int $linkId
+ * @param mixed $parentId
+ * @param string $alias
+ * @return boolean True on success, false on fail
+ * @access public
+ */
+ function create($linkId = 0, $parentId = null, $alias = '') {
+ parent::create();
+ if (strtolower(get_class($this)) == "aclnode") {
+ trigger_error("[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.", E_USER_ERROR);
+ return null;
+ }
+ extract ($this->__dataVars());
+
+ if ($parentId == null || $parentId === 0) {
+ $parent = $this->find(null, 'MAX(rght) as rght', null, -1);
+ $parent['lft'] = $parent[0]['rght'];
+
+ if ($parent[0]['rght'] == null || !$parent[0]['rght']) {
+ $parent['lft'] = 0;
+ }
+ } else {
+ $parent = $this->find($this->_resolveID($parentId), null, null, 0);
+ if ($parent == null || count($parent) == 0) {
+ trigger_error("Null parent in {$class}::create()", E_USER_WARNING);
+ return null;
+ }
+ $parent = $parent[$class];
+ $this->_syncTable(1, $parent['lft'], $parent['lft']);
+ }
+ $return = $this->save(array($class => array($secondary_id => $linkId,
+ 'alias' => $alias,
+ 'lft' => $parent['lft'] + 1,
+ 'rght' => $parent['lft'] + 2)));
+ $this->id = $this->getLastInsertID();
+ return $return;
+ }
+/**
+ * Get the ARO/ACO ID with the given alias
+ *
+ * @param mixed $alias The alias of an ARO/ACO node
+ * @return mixed The ID of an ARO/ACO node, or false if not found.
+ * @access public
+ */
+ function id($alias) {
+ extract($this->__dataVars());
+ return $this->find(array($this->name . '.alias' => $alias), array($secondary_id), null, -1);
+ }
+/**
+ * Deletes the ARO/ACO node with the given ID
+ *
+ * @param mixed $id The id or alias of an ARO/ACO node
+ * @return boolean True on success, false on fail
+ * @access public
+ */
+ function delete($id) {
+ extract ($this->__dataVars());
+ $db =& ConnectionManager::getDataSource($this->useDbConfig);
+
+ $result = $this->find($this->_resolveID($id));
+ $object = $result[$class];
+ if ($object == null || count($object) == 0) {
+ return false;
+ }
+
+ $children = $this->findAll(array("{$class}.rght" => "< {$result[$class]['rght']}", "{$class}.lft" => "> {$result[$class]['lft']}"), 'id', null, null, null, -1);
+ $idList = Set::extract($children, '{n}.' . $class . '.id');
+ $idList[] = $result[$class]['id'];
+
+ $this->ArosAco->query('DELETE FROM ' . $db->fullTableName($this->ArosAco) . " WHERE {$class}_id in (" . implode(', ', $idList) . ')');
+
+ $table = $db->fullTableName($this);
+ $this->query("DELETE FROM {$table} WHERE {$table}.lft >= {$result[$class]['lft']} AND {$table}.rght <= {$result[$class]['rght']}");
+
+ $shift = 1 + $result[$class]['rght'] - $result[$class]['lft'];
+ $this->query('UPDATE ' . $table . ' SET ' . $db->name('rght') . ' = ' . $db->name('rght') . ' - ' . $shift . ' WHERE ' . $db->name('rght') . ' > ' . $result[$class]['rght']);
+ $this->query('UPDATE ' . $table . ' SET ' . $db->name('lft') . ' = ' . $db->name('lft') . ' - ' . $shift . ' WHERE ' . $db->name('lft') . ' > ' . $result[$class]['lft']);
+ return true;
+ }
+/**
+ * Sets the parent of the given node
+ *
+ * @param mixed $parentId
+ * @param mixed $id
+ * @return boolean True on success, false on failure
+ * @access public
+ */
+ function setParent($parentId = null, $id = null) {
+ if (strtolower(get_class($this)) == "aclnode") {
+ trigger_error("[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.", E_USER_ERROR);
+ return null;
+ }
+ extract ($this->__dataVars());
+
+ if ($id == null && $this->id == false) {
+ return false;
+ } elseif ($id == null) {
+ $id = $this->id;
+ }
+ $object = $this->find($this->_resolveID($id), null, null, 0);
+
+ if ($object == null || count($object) == 0) {
+ return false;
+ }
+ $object = $object[$class];
+ $parent = $this->getParent($id);
+
+ if (($parent == null && $parentId == null) || ($parentId == $parent[$class][$secondary_id] && $parentId != null) || ($parentId == $parent[$class]['alias'] && $parentId != null)) {
+ return false;
+ }
+
+ if ($parentId == null) {
+ $newParent = $this->find(null, 'MAX(rght) as lft', null, -1);
+ $newParent = $newParent[0];
+ $newParent['rght'] = $newParent['lft'];
+ } else {
+ $newParent = $this->find($this->_resolveID($parentId), null, null, 0);
+ $newParent = $newParent[$class];
+ }
+
+ if ($parentId != null && $newParent['lft'] <= $object['lft'] && $newParent['rght'] >= $object['rght']) {
+ return false;
+ }
+ $this->_syncTable(0, $object['lft'], $object['lft']);
+
+ if ($object['lft'] < $newParent['lft']) {
+ $newParent['lft'] = $newParent['lft'] - 2;
+ $newParent['rght'] = $newParent['rght'] - 2;
+ }
+
+ if ($parentId != null) {
+ $this->_syncTable(1, $newParent['lft'], $newParent['lft']);
+ }
+ $object['lft'] = $newParent['lft'] + 1;
+ $object['rght'] = $newParent['lft'] + 2;
+ $this->save(array($class => $object));
+
+ if ($newParent['lft'] == 0) {
+ $this->_syncTable(2, $newParent['lft'], $newParent['lft']);
+ }
+ return true;
+ }
+/**
+ * Get the parent node of the given Aro or Aco
+ *
+ * @param moxed $id
+ * @return array
+ * @access public
+ */
+ function getParent($id) {
+ $path = $this->getPath($id);
+ if ($path == null || count($path) < 2) {
+ return null;
+ } else {
+ return $path[count($path) - 2];
+ }
+ }
+/**
+ * Gets the path to the given Aro or Aco
+ *
+ * @param mixed $id
+ * @return array
+ * @access public
+ */
+ function getPath($id) {
+ if (strtolower(get_class($this)) == "aclnode") {
+ trigger_error("[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.", E_USER_ERROR);
+ return null;
+ }
+ extract ($this->__dataVars());
+ $item = $this->find($this->_resolveID($id), null, null, 0);
+
+ if ($item == null || count($item) == 0) {
+ return null;
+ }
+ return $this->findAll(array($class . '.lft' => '<= ' . $item[$class]['lft'], $class . '.rght' => '>= ' . $item[$class]['rght']), null, array($class . '.lft' => 'ASC'), null, null, 0);
+ }
+/**
+ * Get the child nodes of the given Aro or Aco
+ *
+ * @param mixed $id
+ * @return array
+ * @access public
+ */
+ function getChildren($id) {
+ if (strtolower(get_class($this)) == "aclnode") {
+ trigger_error("[acl_base] The AclBase class constructor has been called, or the class was instantiated. This class must remain abstract. Please refer to the Cake docs for ACL configuration.", E_USER_ERROR);
+ return null;
+ }
+
+ extract ($this->__dataVars());
+ $item = $this->find($this->_resolveID($id), null, null, 0);
+ return $this->findAll(array($class . '.lft' => '> ' . $item[$class]['lft'], $class . '.rght' => '< ' . $item[$class]['rght']), null, null, null, null, null, 0);
+ }
+/**
+ * Gets a conditions array to find an Aro or Aco, based on the given id or alias
+ *
+ * @param mixed $id
+ * @return array Conditions array for a find/findAll call
+ * @access public
+ */
+ function _resolveID($id) {
+ extract($this->__dataVars());
+ $key = (is_numeric($id) ? $secondary_id : 'alias');
+ return array($this->name . '.' . $key => $id);
+ }
+/**
+ * Shifts the left and right values of the aro/aco tables
+ * when a node is added or removed
+ *
+ * @param unknown_type $dir
+ * @param unknown_type $lft
+ * @param unknown_type $rght
+ * @access protected
+ */
+ function _syncTable($dir, $lft, $rght) {
+ $db =& ConnectionManager::getDataSource($this->useDbConfig);
+
+ if ($dir == 2) {
+ $shift = 1;
+ $dir = '+';
+ } else {
+ $shift = 2;
+
+ if ($dir > 0) {
+ $dir = '+';
+ } else {
+ $dir = '-';
+ }
+ }
+ $db->query('UPDATE ' . $db->fullTableName($this) . ' SET ' . $db->name('rght') . ' = ' . $db->name('rght') . ' ' . $dir . ' ' . $shift . ' WHERE ' . $db->name('rght') . ' > ' . $rght);
+ $db->query('UPDATE ' . $db->fullTableName($this) . ' SET ' . $db->name('lft') . ' = ' . $db->name('lft') . ' ' . $dir . ' ' . $shift . ' WHERE ' . $db->name('lft') . ' > ' . $lft);
+ }
+/**
+ * Infers data based on the currently-intantiated subclass.
+ *
+ * @return array
+ * @access private
+ */
+ function __dataVars() {
+ $vars = array();
+ $class = strtolower(get_class($this));
+ if ($class == 'aro') {
+ $vars['secondary_id'] = 'foreign_key';
+ } else {
+ $vars['secondary_id'] = 'object_id';
+ }
+ $vars['class'] = ucwords($class);
+ return $vars;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aco.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aco.php
new file mode 100644
index 0000000..988f8b1
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aco.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.libs.controller.components.dbacl.models
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components.dbacl.models
+ *
+ */
+class Aco extends AclNode{
+/**
+ * Model name
+ *
+ * @var string
+ */
+ var $name = 'Aco';
+/**
+ * Has many association
+ *
+ * @var array
+ */
+ var $hasMany = array('ArosAco');
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/acoaction.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/acoaction.php
new file mode 100644
index 0000000..5e33b80
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/acoaction.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.libs.controller.components.dbacl.models
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description.
+ */
+loadModel();
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components.dbacl.models
+ *
+ */
+class AcoAction extends AppModel {
+/**
+ * Model name
+ *
+ * @var string
+ */
+ var $name = 'AcoAction';
+/**
+ * Belongs to association
+ *
+ * @var string
+ */
+ var $belongsTo = 'Aco';
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aro.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aro.php
new file mode 100644
index 0000000..1db67eb
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aro.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.libs.controller.components.dbacl.models
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components.dbacl.models
+ *
+ */
+class Aro extends AclNode {
+/**
+ * Model name
+ *
+ * @var string
+ */
+ var $name = 'Aro';
+/**
+ * Has many association
+ *
+ * @var array
+ */
+ var $hasMany = array('ArosAco');
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aros_aco.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aros_aco.php
new file mode 100644
index 0000000..dade2cc
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/dbacl/models/aros_aco.php
@@ -0,0 +1,63 @@
+
+ * 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.libs.controller.components.dbacl.models
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components.dbacl.models
+ */
+class ArosAco extends AppModel {
+/**
+ * Cache Queries
+ *
+ * @var boolean
+ */
+ var $cacheQueries = false;
+/**
+ * Model name
+ *
+ * @var string
+ */
+ var $name = 'ArosAco';
+/**
+ * Table this model uses
+ *
+ * @var string
+ */
+ var $useTable = 'aros_acos';
+/**
+ * Belongs to association
+ *
+ * @var array
+ */
+ var $belongsTo = array('Aro', 'Aco');
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/iniacl/ini_acl.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/iniacl/ini_acl.php
new file mode 100644
index 0000000..e99de6f
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/iniacl/ini_acl.php
@@ -0,0 +1,180 @@
+
+ * 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.libs.controller.componenets.iniacl
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 7691 $
+ * @modifiedby $LastChangedBy: nate $
+ * @lastmodified $Date: 2008-10-02 00:59:12 -0400 (Thu, 02 Oct 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * load AclBase
+ */
+uses('controller/components/acl_base');
+/**
+ * In this file you can extend the AclBase.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.componenets.iniacl
+ */
+class INI_ACL extends AclBase {
+/**
+ * Array with configuration, parsed from ini file
+ *
+ * @var array
+ */
+ var $config = null;
+/**
+ * Constructor
+ *
+ */
+ function __construct() {
+ }
+
+/**
+ * Main ACL check function. Checks to see if the ARO (access request object) has access to the ACO (access control object).
+ * Looks at the acl.ini.php file for permissions (see instructions in/config/acl.ini.php).
+ *
+ * @param string $aro
+ * @param string $aco
+ * @return boolean
+ * @access public
+ */
+ function check($aro, $aco, $acoAction = null) {
+ if ($this->config == null) {
+ $this->config = $this->readConfigFile(CONFIGS . 'acl.ini.php');
+ }
+ $aclConfig = $this->config;
+
+ //First, if the user is specifically denied, then DENY
+ if (isset($aclConfig[$aro]['deny'])) {
+ $userDenies = $this->arrayTrim(explode(",", $aclConfig[$aro]['deny']));
+
+ if (array_search($aco, $userDenies)) {
+ //echo "User Denied!";
+ return false;
+ }
+ }
+
+ //Second, if the user is specifically allowed, then ALLOW
+ if (isset($aclConfig[$aro]['allow'])) {
+ $userAllows = $this->arrayTrim(explode(",", $aclConfig[$aro]['allow']));
+
+ if (array_search($aco, $userAllows)) {
+ //echo "User Allowed!";
+ return true;
+ }
+ }
+
+ //Check group permissions
+ if (isset($aclConfig[$aro]['groups'])) {
+ $userGroups = $this->arrayTrim(explode(",", $aclConfig[$aro]['groups']));
+
+ foreach ($userGroups as $group) {
+ //If such a group exists,
+ if (array_key_exists($group, $aclConfig)) {
+ //If the group is specifically denied, then DENY
+ if (isset($aclConfig[$group]['deny'])) {
+ $groupDenies=$this->arrayTrim(explode(",", $aclConfig[$group]['deny']));
+
+ if (array_search($aco, $groupDenies)) {
+ //echo("Group Denied!");
+ return false;
+ }
+ }
+
+ //If the group is specifically allowed, then ALLOW
+ if (isset($aclConfig[$group]['allow'])) {
+ $groupAllows = $this->arrayTrim(explode(",", $aclConfig[$group]['allow']));
+
+ if (array_search($aco, $groupAllows)) {
+ //echo("Group Allowed!");
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ //Default, DENY
+ //echo("DEFAULT: DENY.");
+ return false;
+ }
+
+/**
+ * Parses an INI file and returns an array that reflects the INI file's section structure. Double-quote friendly.
+ *
+ * @param string $fileName
+ * @return array
+ */
+ function readConfigFile($fileName) {
+ $fileLineArray = file($fileName);
+
+ foreach ($fileLineArray as $fileLine) {
+ $dataLine = trim($fileLine);
+ $firstChar = substr($dataLine, 0, 1);
+
+ if ($firstChar != ';' && $dataLine != '') {
+ if ($firstChar == '[' && substr($dataLine, -1, 1) == ']') {
+ $sectionName = preg_replace('/[\[\]]/', '', $dataLine);
+ } else {
+ $delimiter = strpos($dataLine, '=');
+
+ if ($delimiter > 0) {
+ $key = strtolower(trim(substr($dataLine, 0, $delimiter)));
+ $value = trim(substr($dataLine, $delimiter + 1));
+
+ if (substr($value, 0, 1) == '"' && substr($value, -1) == '"') {
+ $value = substr($value, 1, -1);
+ }
+
+ $iniSetting[$sectionName][$key]=stripcslashes($value);
+ } else {
+ if (!isset($sectionName)) {
+ $sectionName = '';
+ }
+
+ $iniSetting[$sectionName][strtolower(trim($dataLine))]='';
+ }
+ }
+ } else {
+ }
+ }
+
+ return $iniSetting;
+ }
+/**
+ * Removes trailing spaces on all array elements (to prepare for searching)
+ *
+ * @param array $array Array to trim
+ * @return array Trimmed array
+ * @access public
+ */
+ function arrayTrim($array) {
+ foreach ($array as $key => $value) {
+ $array[$key] = trim($value);
+ }
+ array_unshift($array, "");
+ return $array;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/request_handler.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/request_handler.php
new file mode 100644
index 0000000..c307799
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/controller/components/request_handler.php
@@ -0,0 +1,412 @@
+
+ * 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.libs.controller.components
+ * @since CakePHP(tm) v 0.10.4.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+if (!defined('REQUEST_MOBILE_UA')) {
+ define('REQUEST_MOBILE_UA',
+ '(AvantGo|BlackBerry|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)');
+}
+/**
+ * Request object for handling alternative HTTP requests
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.controller.components
+ *
+ */
+class RequestHandlerComponent extends Object{
+/**
+ * Enter description here...
+ *
+ * @var object
+ * @access public
+ */
+ var $controller = true;
+/**
+ * The layout that will be switched to for Ajax requests
+ *
+ * @var string
+ * @access public
+ * @see RequestHandler::setAjax()
+ */
+ var $ajaxLayout = 'ajax';
+/**
+ * Determines whether or not callbacks will be fired on this component
+ *
+ * @var boolean
+ * @access public
+ */
+ var $disableStartup = false;
+/**
+ * Friendly content-type mappings used to set response types and determine
+ * request types. Can be modified with RequestHandler::setContent()
+ *
+ * @var array
+ * @access private
+ * @see RequestHandlerComponent::setContent
+ */
+ var $__requestContent = array(
+ 'js' => 'text/javascript',
+ 'css' => 'text/css',
+ 'html' => 'text/html',
+ 'form' => 'application/x-www-form-urlencoded',
+ 'file' => 'multipart/form-data',
+ 'xhtml' => array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
+ 'xml' => array('application/xml', 'text/xml'),
+ 'rss' => 'application/rss+xml',
+ 'atom' => 'application/atom+xml'
+ );
+/**
+ * Content-types accepted by the client. If extension parsing is enabled in the
+ * Router, and an extension is detected, the corresponding content-type will be
+ * used as the overriding primary content-type accepted.
+ *
+ * @var array
+ * @access private
+ */
+ var $__acceptTypes = array();
+/**
+ * Constructor. Parses the accepted content types accepted by the client using
+ * HTTP_ACCEPT
+ *
+ * @access public
+ * @return void
+ */
+ function __construct() {
+ $this->__acceptTypes = explode(',', env('HTTP_ACCEPT'));
+
+ foreach ($this->__acceptTypes as $i => $type) {
+ if (strpos($type, ';')) {
+ $type = explode(';', $type);
+ $this->__acceptTypes[$i] = $type[0];
+ }
+ }
+ parent::__construct();
+ }
+/**
+ * Startup
+ *
+ * @param object A reference to the controller
+ * @return null
+ * @access public
+ */
+ function startup(&$controller) {
+ if ($this->disableStartup) {
+ return;
+ }
+ $this->setAjax($controller);
+ }
+/**
+ * Sets a controller's layout based on whether or not the current call is Ajax
+ *
+ * Add UTF-8 header for IE6 on XPsp2 bug if RequestHandlerComponent::isAjax()
+ *
+ * @param object The controller object
+ * @return null
+ * @access public
+ */
+ function setAjax(&$controller) {
+ if ($this->isAjax()) {
+ $controller->layout = $this->ajaxLayout;
+ // Add UTF-8 header for IE6 on XPsp2 bug
+ header ('Content-Type: text/html; charset=UTF-8');
+ }
+ }
+/**
+ * Returns true if the current call is from Ajax, false otherwise
+ *
+ * @return bool True if call is Ajax
+ * @access public
+ */
+ function isAjax() {
+ if (env('HTTP_X_REQUESTED_WITH') != null) {
+ return env('HTTP_X_REQUESTED_WITH') == "XMLHttpRequest";
+ } else {
+ return false;
+ }
+ }
+/**
+ * Returns true if the current call accepts an XML response, false otherwise
+ *
+ * @return bool True if client accepts an XML response
+ * @access public
+ */
+ function isXml() {
+ return $this->accepts('xml');
+ }
+/**
+ * Returns true if the current call accepts an RSS response, false otherwise
+ *
+ * @return bool True if client accepts an RSS response
+ * @access public
+ */
+ function isRss() {
+ return $this->accepts('rss');
+ }
+/**
+ * Returns true if the current call accepts an RSS response, false otherwise
+ *
+ * @return bool True if client accepts an RSS response
+ * @access public
+ */
+ function isAtom() {
+ return $this->accepts('atom');
+ }
+/**
+ * Returns true if the current call a POST request
+ *
+ * @return bool True if call is a POST
+ * @access public
+ */
+ function isPost() {
+ return (strtolower(env('REQUEST_METHOD')) == 'post');
+ }
+/**
+ * Returns true if the current call a PUT request
+ *
+ * @return bool True if call is a PUT
+ * @access public
+ */
+ function isPut() {
+ return (strtolower(env('REQUEST_METHOD')) == 'put');
+ }
+/**
+ * Returns true if the current call a GET request
+ *
+ * @return bool True if call is a GET
+ * @access public
+ */
+ function isGet() {
+ return (strtolower(env('REQUEST_METHOD')) == 'get');
+ }
+/**
+ * Returns true if the current call a DELETE request
+ *
+ * @return bool True if call is a DELETE
+ * @access public
+ */
+ function isDelete() {
+ return (strtolower(env('REQUEST_METHOD')) == 'delete');
+ }
+/**
+ * Gets Prototype version if call is Ajax, otherwise empty string.
+ * The Prototype library sets a special "Prototype version" HTTP header.
+ *
+ * @return string Prototype version of component making Ajax call
+ * @access public
+ */
+ function getAjaxVersion() {
+ if (env('HTTP_X_PROTOTYPE_VERSION') != null) {
+ return env('HTTP_X_PROTOTYPE_VERSION');
+ }
+ return false;
+ }
+/**
+ * Adds/sets the Content-type(s) for the given name
+ *
+ * @param string $name The name of the Content-type, i.e. "html", "xml", "css"
+ * @param mixed $type The Content-type or array of Content-types assigned to the name
+ * @return void
+ * @access public
+ */
+ function setContent($name, $type) {
+ $this->__requestContent[$name] = $type;
+ }
+/**
+ * Gets the server name from which this request was referred
+ *
+ * @return string Server address
+ * @access public
+ */
+ function getReferrer() {
+ if (env('HTTP_HOST') != null) {
+ $sess_host = env('HTTP_HOST');
+ }
+
+ if (env('HTTP_X_FORWARDED_HOST') != null) {
+ $sess_host = env('HTTP_X_FORWARDED_HOST');
+ }
+ return trim(preg_replace('/:.*/', '', $sess_host));
+ }
+/**
+ * Gets remote client IP
+ *
+ * @return string Client IP address
+ * @access public
+ */
+ function getClientIP() {
+ if (env('HTTP_X_FORWARDED_FOR') != null) {
+ $ipaddr = preg_replace('/,.*/', '', env('HTTP_X_FORWARDED_FOR'));
+ } else {
+ if (env('HTTP_CLIENT_IP') != null) {
+ $ipaddr = env('HTTP_CLIENT_IP');
+ } else {
+ $ipaddr = env('REMOTE_ADDR');
+ }
+ }
+
+ if (env('HTTP_CLIENTADDRESS') != null) {
+ $tmpipaddr = env('HTTP_CLIENTADDRESS');
+
+ if (!empty($tmpipaddr)) {
+ $ipaddr = preg_replace('/,.*/', '', $tmpipaddr);
+ }
+ }
+ return trim($ipaddr);
+ }
+/**
+ * Returns true if user agent string matches a mobile web browser
+ *
+ * @return bool True if user agent is a mobile web browser
+ * @access public
+ */
+ function isMobile() {
+ return (preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT')) > 0);
+ }
+/**
+ * Strips extra whitespace from output
+ *
+ * @param string $str
+ * @return string
+ * @access public
+ */
+ function stripWhitespace($str) {
+ $r = preg_replace('/[\n\r\t]+/', '', $str);
+ return preg_replace('/\s{2,}/', ' ', $r);
+ }
+/**
+ * Strips image tags from output
+ *
+ * @param string $str
+ * @return string
+ * @access public
+ */
+ function stripImages($str) {
+ $str = preg_replace('/(]*>)( ]+alt=")([^"]*)("[^>]*>)(<\/a>)/i', '$1$3$5 ', $str);
+ $str = preg_replace('/( ]+alt=")([^"]*)("[^>]*>)/i', '$2 ', $str);
+ $str = preg_replace('/ ]*>/i', '', $str);
+ return $str;
+ }
+/**
+ * Strips scripts and stylesheets from output
+ *
+ * @param string $str
+ * @return string
+ * @access public
+ */
+ function stripScripts($str) {
+ return preg_replace('/( ]+rel="[^"]*stylesheet"[^>]*>| ]*>|style="[^"]*")|',
+ 'javascriptlink' => '');
+/**
+ * Parses custom config/tags.ini.php and merges with $this->tags.
+ *
+ * @return html tags used by helpers
+ */
+ function loadConfig() {
+
+ if (file_exists(APP . 'config' . DS . 'tags.ini.php')) {
+ $tags = $this->readConfigFile(APP . 'config' . DS . 'tags.ini.php');
+ $this->tags = am($this->tags, $tags);
+ }
+ return $this->tags;
+ }
+/**
+ * Decides whether to output or return a string.
+ *
+ * Based on AUTO_OUTPUT and $return's value, this method decides whether to
+ * output a string, or return it.
+ *
+ * @param string $str String to be output or returned.
+ * @param boolean $return Whether this method should return a value or output it.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ */
+ function output($str, $return = false) {
+ if (AUTO_OUTPUT && $return === false) {
+ echo $str;
+ } else {
+ return $str;
+ }
+ }
+/**
+ * Assigns values to tag templates.
+ *
+ * Finds a tag template by $keyName, and replaces $values's keys with
+ * $values's keys.
+ *
+ * @param string $keyName Name of the key in the tag array.
+ * @param array $values Values to be inserted into tag.
+ * @return string Tag with inserted values.
+ */
+ function assign($keyName, $values) {
+ return str_replace('%%' . array_keys($values) . '%%', array_values($values), $this->tags[$keyName]);
+ }
+/**
+ * Returns an array of settings in given INI file.
+ *
+ * @param string $fileName ini file to read
+ * @return array of lines from the $fileName
+ */
+ function readConfigFile($fileName) {
+ $fileLineArray = file($fileName);
+
+ foreach ($fileLineArray as $fileLine) {
+ $dataLine = trim($fileLine);
+ $firstChar = substr($dataLine, 0, 1);
+
+ if ($firstChar != ';' && $dataLine != '') {
+ if ($firstChar == '[' && substr($dataLine, -1, 1) == ']') {
+ // [section block] we might use this later do not know for sure
+ // this could be used to add a key with the section block name
+ // but it adds another array level
+ } else {
+ $delimiter = strpos($dataLine, '=');
+
+ if ($delimiter > 0) {
+ $key = strtolower(trim(substr($dataLine, 0, $delimiter)));
+ $value = trim(stripcslashes(substr($dataLine, $delimiter + 1)));
+
+ if (substr($value, 0, 1) == '"' && substr($value, -1) == '"') {
+ $value = substr($value, 1, -1);
+ }
+
+ $iniSetting[$key] = $value;
+
+ } else {
+ $iniSetting[strtolower(trim($dataLine))] = '';
+ }
+ }
+ } else {
+ }
+ }
+
+ return $iniSetting;
+ }
+/**
+ * After render callback. Overridden in subclasses.
+ *
+ * @return void
+ */
+ function afterRender() {
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/ajax.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/ajax.php
new file mode 100644
index 0000000..9e14931
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/ajax.php
@@ -0,0 +1,853 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * AjaxHelper library.
+ *
+ * Helps doing AJAX using the Prototype library.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class AjaxHelper extends Helper {
+/**
+ * Included helpers.
+ *
+ * @var array
+ * @access public
+ */
+ var $helpers = array('Html', 'Javascript');
+/**
+ * Names of Javascript callback functions.
+ *
+ * @var array
+ * @access public
+ */
+ var $callbacks = array('uninitialized', 'loading', 'loaded', 'interactive', 'complete', 'success', 'failure');
+/**
+ * Names of AJAX options.
+ *
+ * @var array
+ * @access public
+ */
+ var $ajaxOptions = array('type', 'confirm', 'condition', 'before', 'after', 'fallback', 'update', 'loading', 'loaded', 'interactive', 'complete', 'with', 'url', 'method', 'position', 'form', 'parameters', 'evalScripts', 'asynchronous', 'onComplete', 'onUninitialized', 'onLoading', 'onLoaded', 'onInteractive', 'success', 'failure', 'onSuccess', 'onFailure', 'insertion', 'requestHeaders');
+/**
+ * Options for draggable.
+ *
+ * @var array
+ * @access public
+ */
+ var $dragOptions = array('handle', 'revert', 'constraint', 'change', 'ghosting');
+/**
+ * Options for droppable.
+ *
+ * @var array
+ * @access public
+ */
+ var $dropOptions = array('accept', 'containment', 'overlap', 'greedy', 'hoverclass', 'onHover', 'onDrop');
+/**
+ * Options for sortable.
+ *
+ * @var array
+ * @access public
+ */
+ var $sortOptions = array('tag', 'only', 'overlap', 'constraint', 'containment', 'handle', 'hoverclass', 'ghosting', 'dropOnEmpty', 'onUpdate', 'onChange');
+/**
+ * Options for slider.
+ *
+ * @var array
+ * @access public
+ */
+ var $sliderOptions = array('axis', 'increment', 'maximum', 'minimum', 'alignX', 'alignY', 'sliderValue', 'disabled', 'handleImage', 'handleDisabled', 'values', 'onSlide', 'onChange');
+/**
+ * Options for in-place editor.
+ *
+ * @var array
+ * @access public
+ */
+ var $editorOptions = array('okText', 'cancelText', 'savingText', 'formId', 'externalControl', 'rows', 'cols', 'size', 'highlightcolor', 'highlightendcolor', 'savingClassName', 'formClassName', 'loadTextURL', 'loadingText', 'callback', 'ajaxOptions', 'clickToEditText');
+/**
+ * Options for auto-complete editor.
+ *
+ * @var array
+ * @access public
+ */
+ var $autoCompleteOptions = array('paramName', 'tokens', 'frequency', 'minChars', 'indicator', 'updateElement', 'afterUpdateElement', 'onShow', 'onHide');
+/**
+ * Output buffer for Ajax update content
+ *
+ * @var array
+ * @access private
+ */
+ var $__ajaxBuffer = array();
+/**
+ * Returns link to remote action
+ *
+ * Returns a link to a remote action defined by options[url]
+ * (using the urlFor format) that's called in the background using
+ * XMLHttpRequest. The result of that request can then be inserted into a
+ * DOM object whose id can be specified with options[update] .
+ *
+ * Examples:
+ *
+ * $ajax->link("Delete this post", "/posts/delete/{$post['Post']['id']}"
+ * array("update" => "posts", "loading"=>"Element.show('loading');", "complete"=>"Element.hide('loading');"),
+ * "Are you sure you want to delte this post?");
+ * $ajax->link($html->img("refresh"), '/emails/refresh',
+ * array("update" => "posts", "loading"=>"Element.show('loading');", "complete"=>"Element.hide('loading');"),
+ * null, false);
+ *
+ *
+ * By default, these remote requests are processed asynchronous during
+ * which various callbacks can be triggered (for progress indicators and
+ * the likes).
+ *
+ * The callbacks that may be specified are:
+ *
+ * - loading :: Called when the remote document is being
+ * loaded with data by the browser.
+ * - loaded :: Called when the browser has finished loading
+ * the remote document.
+ * - interactive :: Called when the user can interact with the
+ * remote document, even though it has not
+ * finished loading.
+ * - complete :: Called when the request is complete.
+ *
+ * If you for some reason or another need synchronous processing (that'll
+ * block the browser while the request is happening), you can specify
+ * $options['type'] = synchronous .
+ *
+ * You can customize further browser side call logic by passing
+ * in Javascript code snippets via some optional parameters. In
+ * their order of use these are:
+ *
+ * - confirm :: Adds confirmation dialog.
+ * - condition :: Perform remote request conditionally
+ * by this expression. Use this to
+ * describe browser-side conditions when
+ * request should not be initiated.
+ * - before :: Called before request is initiated.
+ * - after :: Called immediately after request was
+ * initiated and before loading .
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater
+ * @param string $title Title of link
+ * @param string $href href string "/products/view/12"
+ * @param array $options Options for JavaScript function
+ * @param string $confirm Confirmation message. Calls up a JavaScript confirm() message.
+ * @param boolean $escapeTitle Escaping the title string to HTML entities
+ * @return HTML code for link to remote action
+ * @access public
+ */
+ function link($title, $href = null, $options = array(), $confirm = null, $escapeTitle = true) {
+ if (!isset($href)) {
+ $href = $title;
+ }
+
+ if (!isset($options['url'])) {
+ $options['url'] = $href;
+ }
+
+ if (isset($confirm)) {
+ $options['confirm'] = $confirm;
+ unset($confirm);
+ }
+ $htmlOptions = $this->__getHtmlOptions($options);
+
+ if (empty($options['fallback']) || !isset($options['fallback'])) {
+ $options['fallback'] = $href;
+ }
+
+ if (!isset($htmlOptions['id'])) {
+ $htmlOptions['id'] = 'link' . intval(rand());
+ }
+
+ if (!isset($htmlOptions['onclick'])) {
+ $htmlOptions['onclick'] = '';
+ }
+ $htmlOptions['onclick'] .= ' event.returnValue = false; return false;';
+ $return = $this->Html->link($title, $href, $htmlOptions, null, $escapeTitle);
+ $script = $this->Javascript->event("'{$htmlOptions['id']}'", "click", $this->remoteFunction($options));
+
+ if (is_string($script)) {
+ $return .= $script;
+ }
+ return $return;
+ }
+/**
+ * Creates JavaScript function for remote AJAX call
+ *
+ * This function creates the javascript needed to make a remote call
+ * it is primarily used as a helper for link.
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater
+ * @see link() for docs on options parameter.
+ * @param array $options options for javascript
+ * @return string html code for link to remote action
+ * @access public
+ */
+ function remoteFunction($options = null) {
+ if (isset($options['update'])) {
+ if (!is_array($options['update'])) {
+ $func = "new Ajax.Updater('{$options['update']}',";
+ } else {
+ $func = "new Ajax.Updater(document.createElement('div'),";
+ }
+ if (!isset($options['requestHeaders'])) {
+ $options['requestHeaders'] = array();
+ }
+ if (is_array($options['update'])) {
+ $options['update'] = join(' ', $options['update']);
+ }
+ $options['requestHeaders']['X-Update'] = $options['update'];
+ } else {
+ $func = "new Ajax.Request(";
+ }
+
+ $func .= "'" . $this->Html->url(isset($options['url']) ? $options['url'] : "") . "'";
+ $func .= ", " . $this->__optionsForAjax($options) . ")";
+
+ if (isset($options['before'])) {
+ $func = "{$options['before']}; $func";
+ }
+
+ if (isset($options['after'])) {
+ $func = "$func; {$options['after']};";
+ }
+
+ if (isset($options['condition'])) {
+ $func = "if ({$options['condition']}) { $func; }";
+ }
+
+ if (isset($options['confirm'])) {
+ $func = "if (confirm('" . $this->Javascript->escapeString($options['confirm'])
+ . "')) { $func; } else { event.returnValue = false; return false; }";
+ }
+ return $func;
+ }
+/**
+ * Periodically call remote url via AJAX.
+ *
+ * Periodically calls the specified url (options['url'] ) every options['frequency'] seconds (default is 10).
+ * Usually used to update a specified div (options['update'] ) with the results of the remote call.
+ * The options for specifying the target with url and defining callbacks is the same as link.
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater
+ * @param array $options Callback options
+ * @return string Javascript codeblock
+ * @access public
+ */
+ function remoteTimer($options = null) {
+ $frequency=(isset($options['frequency'])) ? $options['frequency'] : 10;
+ $code="new PeriodicalExecuter(function() {" . $this->remoteFunction($options) . "}, $frequency)";
+ return $this->Javascript->codeBlock($code);
+ }
+/**
+ * Returns form tag that will submit using Ajax.
+ *
+ * Returns a form tag that will submit using XMLHttpRequest in the background instead of the regular
+ * reloading POST arrangement. Even though it's using Javascript to serialize the form elements, the form submission
+ * will work just like a regular submission as viewed by the receiving side (all elements available in params).
+ * The options for defining callbacks is the same as link().
+ *
+ * @param array $params Form target
+ * @param array $type How form data is posted: 'get' or 'post'
+ * @param array $options Callback/HTML options
+ * @return string JavaScript/HTML code
+ * @access public
+ */
+ function form($params = null, $type = 'post', $options = array()) {
+ if (is_array($params)) {
+ extract($params, EXTR_OVERWRITE);
+
+ if (!isset($action)) {
+ $action = null;
+ }
+
+ if (!isset($type)) {
+ $type = 'post';
+ }
+
+ if (!isset($options)) {
+ $options = array();
+ }
+ } else {
+ $action = $params;
+ }
+ $htmlOptions = $this->__getHtmlOptions($options);
+ $htmlOptions['action'] = $action;
+
+ if (!isset($htmlOptions['id'])) {
+ $htmlOptions['id'] = 'form' . intval(rand());
+ }
+ $htmlOptions['onsubmit']="event.returnValue = false; return false;";
+
+ if (!isset($options['with'])) {
+ $options['with'] = "Form.serialize('{$htmlOptions['id']}')";
+ }
+ $options['url']=$action;
+
+ return $this->Html->formTag($htmlOptions['action'], $type, $htmlOptions)
+ . $this->Javascript->event("'" . $htmlOptions['id']. "'", "submit", $this->remoteFunction($options));
+ }
+/**
+ * Returns a button input tag that will submit using Ajax
+ *
+ * Returns a button input tag that will submit form using XMLHttpRequest in the background instead of regular
+ * reloading POST arrangement. options argument is the same as in form_remote_tag
+ *
+ * @param string $title Input button title
+ * @param array $options Callback options
+ * @return string Ajaxed input button
+ * @access public
+ */
+ function submit($title = 'Submit', $options = array()) {
+ $htmlOptions =$this->__getHtmlOptions($options);
+ $htmlOptions['value']=$title;
+
+ if (!isset($options['with'])) {
+ $options['with'] = 'Form.serialize(Event.element(event).form)';
+ }
+
+ if (!isset($htmlOptions['id'])) {
+ $htmlOptions['id'] = 'submit' . intval(rand());
+ }
+ $htmlOptions['onclick']="event.returnValue = false; return false;";
+ return $this->Html->submit($title, $htmlOptions)
+ . $this->Javascript->event('"' . $htmlOptions['id'] . '"', 'click', $this->remoteFunction($options));
+ }
+/**
+ * Observe field and call ajax on change.
+ *
+ * Observes the field with the DOM ID specified by field_id and makes
+ * an Ajax when its contents have changed.
+ *
+ * Required +options+ are:
+ * - frequency :: The frequency (in seconds) at which changes to
+ * this field will be detected.
+ * - url :: @see urlFor() -style options for the action to call
+ * when the field has changed.
+ *
+ * Additional options are:
+ * - update :: Specifies the DOM ID of the element whose
+ * innerHTML should be updated with the
+ * XMLHttpRequest response text.
+ * - with :: A Javascript expression specifying the
+ * parameters for the XMLHttpRequest. This defaults
+ * to Form.Element.serialize('$field_id'), which can be
+ * accessed from params['form']['field_id'].
+ *
+ * @see link().
+ * @param string $field_id DOM ID of field to observe
+ * @param array $options ajax options
+ * @return string ajax script
+ * @access public
+ */
+ function observeField($field_id, $options = array()) {
+ if (!isset($options['with'])) {
+ $options['with'] = "Form.Element.serialize('$field_id')";
+ }
+ return $this->Javascript->codeBlock($this->_buildObserver('Form.Element.Observer', $field_id, $options));
+ }
+/**
+ * Observe entire form and call ajax on change.
+ *
+ * Like @see observeField(), but operates on an entire form identified by the
+ * DOM ID form_id . options are the same as observe_field , except
+ * the default value of the with option evaluates to the
+ * serialized (request string) value of the form.
+ *
+ * @param string $field_id DOM ID of field to observe
+ * @param array $options ajax options
+ * @return string ajax script
+ * @access public
+ */
+ function observeForm($field_id, $options = array()) {
+ if (!isset($options['with'])) {
+ $options['with'] = 'Form.serialize("' . $field_id . '")';
+ }
+ return $this->Javascript->codeBlock($this->_buildObserver('Form.Observer', $field_id, $options));
+ }
+/**
+ * Create a text field with Autocomplete.
+ *
+ * Creates an autocomplete field with the given ID and options.
+ *
+ * options['with'] defaults to "Form.Element.serialize('$field_id')",
+ * but can be any valid javascript expression defining the
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter
+ * @param string $field_id DOM ID of field to observe
+ * @param string $url URL for the autocomplete action
+ * @param array $options Ajax options
+ * @return string Ajax script
+ * @access public
+ */
+ function autoComplete($field, $url = "", $options = array()) {
+ $var = '';
+ if (isset($options['var'])) {
+ $var = 'var ' . $options['var'] . ' = ';
+ unset($options['var']);
+ }
+
+ if (!isset($options['id'])) {
+ $options['id'] = Inflector::camelize(r("/", "_", $field));
+ }
+ $divOptions = array('id' => $options['id'] . "_autoComplete", 'class' => isset($options['class']) ? $options['class'] : 'auto_complete');
+
+ if (isset($options['div_id'])) {
+ $divOptions['id'] = $options['div_id'];
+ unset($options['div_id']);
+ }
+ $htmlOptions = $this->__getHtmlOptions($options);
+ $htmlOptions['autocomplete'] = "off";
+
+ foreach ($this->autoCompleteOptions as $opt) {
+ unset($htmlOptions[$opt]);
+ }
+
+ if (isset($options['tokens'])) {
+ if (is_array($options['tokens'])) {
+ $options['tokens'] = $this->Javascript->object($options['tokens']);
+ } else {
+ $options['tokens'] = '"' . $options['tokens'] . '"';
+ }
+ }
+ $options = $this->_optionsToString($options, array('paramName', 'indicator'));
+ $options = $this->_buildOptions($options, $this->autoCompleteOptions);
+ return $this->Html->input($field, $htmlOptions) . "\n" .
+ $this->Html->tag('div', $divOptions, true) . "\n" .
+ $this->Javascript->codeBlock("{$var}new Ajax.Autocompleter('" . $htmlOptions['id']
+ . "', '" . $divOptions['id'] . "', '" . $this->Html->url($url) . "', " .
+ $options . ");");
+ }
+/**
+ * Setup a Draggable Element.
+ * For a reference on the options for this function, check out
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Draggable
+ * @param sting $id the DOM id to enable
+ * @param array $options a set of options
+ * @return string Javascript::codeBlock();
+ * @access public
+ */
+ function drag($id, $options = array()) {
+ return $this->Javascript->codeBlock("new Draggable('$id', " . $this->_optionsForDraggable($options) . ");");
+ }
+/**
+ * Creates an Ajax-updateable DIV element
+ *
+ * @param string $id options for javascript
+ * @param array $options a set of options
+ * @return string HTML code
+ * @access public
+ */
+ function div($id, $options = array()) {
+ if (env('HTTP_X_UPDATE') != null) {
+ $divs = explode(' ', env('HTTP_X_UPDATE'));
+ if (in_array($id, $divs)) {
+ @ob_end_clean();
+ ob_start();
+ return '';
+ }
+ }
+ $attr = $this->Html->_parseAttributes(am($options, array('id' => $id)));
+ return $this->output(sprintf($this->tags['blockstart'], $attr));
+ }
+/**
+ * Closes an Ajax-updateable DIV element
+ *
+ * @param string $id The DOM ID of the element
+ * @return string HTML code
+ * @access public
+ */
+ function divEnd($id) {
+ if (env('HTTP_X_UPDATE') != null) {
+ $divs = explode(' ', env('HTTP_X_UPDATE'));
+ if (in_array($id, $divs)) {
+ $this->__ajaxBuffer[$id] = ob_get_contents();
+ ob_end_clean();
+ return '';
+ }
+ }
+ return $this->output($this->tags['blockend']);
+ }
+/**
+ * Protectd helper method to return an array of options for draggable.
+ *
+ * @param array $options
+ * @return array
+ * @access protected
+ */
+ function _optionsForDraggable($options) {
+ $options = $this->_optionsToString($options, array('handle', 'constraint'));
+ return $this->_buildOptions($options, $this->dragOptions);
+ }
+/**
+ * Setup a droppable element
+ * For a reference on the options for this function, check out
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Droppables.add
+ * @param string $id
+ * @param array $options
+ * @return array
+ * @access public
+ */
+ function drop($id, $options = array()) {
+ $options = $this->_optionsForDroppable($options);
+ return $this->Javascript->codeBlock("Droppables.add('$id', $options);");
+ }
+/**
+ * Protected helper method to return an array of options for droppable.
+ *
+ * @param string $options
+ * @return string String of Javascript array definition
+ * @access protected
+ */
+ function _optionsForDroppable($options) {
+ $options = $this->_optionsToString($options, array('accept', 'overlap', 'hoverclass'));
+ return $this->_buildOptions($options, $this->dropOptions);
+ }
+/**
+ * Setup a remote droppable element.
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Droppables.add
+ * @see link() and remoteFunction()
+ * @param string $id DOM id of droppable
+ * @param array $options ame as drop()
+ * @param array $ajaxOptions same as remoteFunction()
+ * @return string Javascript::codeBlock()
+ * @access public
+ */
+ function dropRemote($id, $options = array(), $ajaxOptions = array()) {
+ $options['onDrop'] = "function(element) {" . $this->remoteFunction($ajaxOptions) . "}";
+ $options = $this->_optionsForDroppable($options);
+ return $this->Javascript->codeBlock("Droppables.add('$id', $options);");
+ }
+/**
+ * Makes a slider control.
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Slider
+ * @param string $id DOM ID of slider handle
+ * @param string $track_id DOM ID of slider track
+ * @param array $options Array of options to control the slider
+ * @return string Javascript::codeBlock()
+ * @access public
+ */
+ function slider($id, $track_id, $options = array()) {
+ $options = $this->_optionsToString($options, array('axis', 'handleImage', 'handleDisabled'));
+
+ if (isset($options['change'])) {
+ $options['onChange'] = $options['change'];
+ unset($options['change']);
+ }
+
+ if (isset($options['slide'])) {
+ $options['onSlide'] = $options['slide'];
+ unset($options['slide']);
+ }
+
+ $options = $this->_buildOptions($options, $this->sliderOptions);
+ return $this->Javascript->codeBlock("var $id = new Control.Slider('$id', '$track_id', $options);");
+ }
+/**
+ * Makes an Ajax In Place editor control.
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor
+ * @param string $id DOM ID of input element
+ * @param string $url Postback URL of saved data
+ * @param array $options Array of options to control the editor, including ajaxOptions (see link).
+ * @return string Javascript::codeBlock()
+ * @access public
+ */
+ function editor($id, $url, $options = array()) {
+ $url = $this->Html->url($url);
+ $options['ajaxOptions'] = $this->__optionsForAjax($options);
+
+ foreach ($this->ajaxOptions as $opt) {
+ if (isset($options[$opt])) {
+ unset($options[$opt]);
+ }
+ }
+
+ if (isset($options['callback'])) {
+ $options['callback'] = 'function(form, value) {' . $options['callback'] . '}';
+ }
+
+ $options = $this->_optionsToString($options, array('okText', 'cancelText', 'savingText', 'formId', 'externalControl', 'highlightcolor', 'highlightendcolor', 'savingClassName', 'formClassName', 'loadTextURL', 'loadingText', 'clickToEditText'));
+ $options = $this->_buildOptions($options, $this->editorOptions);
+ return $this->Javascript->codeBlock("new Ajax.InPlaceEditor('{$id}', '{$url}', {$options});");
+ }
+/**
+ * Makes a list or group of floated objects sortable.
+ *
+ * @link http://wiki.script.aculo.us/scriptaculous/show/Sortable.create
+ * @param string $id DOM ID of parent
+ * @param array $options Array of options to control sort
+ * @return string Javascript::codeBlock()
+ * @access public
+ */
+ function sortable($id, $options = array()) {
+ if (!empty($options['url'])) {
+ $options['with'] = "Sortable.serialize('$id')";
+ $options['onUpdate'] = 'function(sortable) {' . $this->remoteFunction($options) . '}';
+ }
+
+ $options = $this->__optionsForSortable($options);
+ return $this->Javascript->codeBlock("Sortable.create('$id', $options);");
+ }
+/**
+ * Private method; generates sortables code from array options
+ *
+ * @param array $options
+ * @return string String of Javascript array definition
+ * @access private
+ */
+ function __optionsForSortable($options) {
+ $options = $this->_optionsToString($options, array('handle', 'tag', 'constraint', 'ghosting', 'only', 'hoverclass'));
+ return $this->_buildOptions($options, $this->sortOptions);
+ }
+/**
+ * Private helper function for Ajax.
+ *
+ * @param array $options
+ * @return string String of Javascript array definition
+ * @access private
+ */
+ function __optionsForAjax($options = array()) {
+
+ if (isset($options['indicator'])) {
+ if (isset($options['loading'])) {
+ $options['loading'] .= "Element.show('{$options['indicator']}');";
+ } else {
+ $options['loading'] = "Element.show('{$options['indicator']}');";
+ }
+ if (isset($options['complete'])) {
+ $options['complete'] .= "Element.hide('{$options['indicator']}');";
+ } else {
+ $options['complete'] = "Element.hide('{$options['indicator']}');";
+ }
+ unset($options['indicator']);
+ }
+
+ $jsOptions = am(
+ array('asynchronous' => 'true', 'evalScripts' => 'true'),
+ $this->_buildCallbacks($options)
+ );
+ $options = $this->_optionsToString($options, array('method'));
+
+ foreach ($options as $key => $value) {
+ switch($key) {
+ case 'type':
+ $jsOptions['asynchronous'] = ife(($value == 'synchronous'), 'false', 'true');
+ break;
+ case 'evalScripts':
+ $jsOptions['evalScripts'] = ife($value, 'true', 'false');
+ break;
+ case 'position':
+ $jsOptions['insertion'] = "Insertion." . Inflector::camelize($options['position']);
+ break;
+ case 'with':
+ $jsOptions['parameters'] = $options['with'];
+ break;
+ case 'form':
+ $jsOptions['parameters'] = 'Form.serialize(this)';
+ break;
+ case 'requestHeaders':
+ $keys = array();
+ foreach ($value as $key => $val) {
+ $keys[] = "'" . $key . "'";
+ $keys[] = "'" . $val . "'";
+ }
+ $jsOptions['requestHeaders'] = '[' . join(', ', $keys) . ']';
+ break;
+ }
+ }
+ return $this->_buildOptions($jsOptions, $this->ajaxOptions);
+ }
+/**
+ * Private Method to return a string of html options
+ * option data as a JavaScript options hash.
+ *
+ * @param array $options Options in the shape of keys and values
+ * @param array $extra Array of legal keys in this options context
+ * @return array Array of html options
+ * @access private
+ */
+ function __getHtmlOptions($options, $extra = array()) {
+ foreach ($this->ajaxOptions as $key) {
+ if (isset($options[$key])) {
+ unset($options[$key]);
+ }
+ }
+
+ foreach ($extra as $key) {
+ if (isset($options[$key])) {
+ unset($options[$key]);
+ }
+ }
+ return $options;
+ }
+/**
+ * Protected Method to return a string of JavaScript with the given
+ * option data as a JavaScript options hash.
+ *
+ * @param array $options Options in the shape of keys and values
+ * @param array $acceptable Array of legal keys in this options context
+ * @return string String of Javascript array definition
+ * @access protected
+ */
+ function _buildOptions($options, $acceptable) {
+ if (is_array($options)) {
+ $out = array();
+
+ foreach ($options as $k => $v) {
+ if (in_array($k, $acceptable)) {
+ $out[] = "$k:$v";
+ }
+ }
+
+ $out = join(', ', $out);
+ $out = '{' . $out . '}';
+ return $out;
+ } else {
+ return false;
+ }
+ }
+/**
+ * Protected Method to return JavaScript text for an observer...
+ *
+ * @param string $klass Name of JavaScript class
+ * @param string $name
+ * @param array $options Ajax options
+ * @return string Formatted JavaScript
+ * @access protected
+ */
+ function _buildObserver($klass, $name, $options = null) {
+ if (!isset($options['with']) && isset($options['update'])) {
+ $options['with'] = 'value';
+ }
+
+ $callback = $this->remoteFunction($options);
+ $javascript = "new $klass('$name', ";
+ $javascript .= (isset($options['frequency']) ? $options['frequency'] : 2) . ", function(element, value) {";
+ $javascript .= "$callback})";
+ return $javascript;
+ }
+/**
+ * Protected Method to return JavaScript text for all callbacks...
+ *
+ * @param array $options
+ * @return array
+ * @access protected
+ */
+ function _buildCallbacks($options) {
+ $callbacks = array();
+
+ foreach ($this->callbacks as $callback) {
+ if (isset($options[$callback])) {
+ $name = 'on' . ucfirst($callback);
+ $code = $options[$callback];
+ $callbacks[$name] = "function(request) {" . $code . "}";
+ }
+ }
+ return $callbacks;
+ }
+/**
+ * Protected Method to return a string of JavaScript with a string representation
+ * of given options array.
+ *
+ * @param array $options Ajax options array
+ * @param array $stringOpts Options as strings in an array
+ * @access private
+ * @return array
+ * @access protected
+ */
+ function _optionsToString($options, $stringOpts = array()) {
+ foreach ($stringOpts as $option) {
+ if (isset($options[$option]) && !$options[$option][0] != "'") {
+ if ($options[$option] === true || $options[$option] === 'true') {
+ $options[$option] = 'true';
+ } elseif ($options[$option] === false || $options[$option] === 'false') {
+ $options[$option] = 'false';
+ } else {
+ $options[$option] = "'{$options[$option]}'";
+ }
+ }
+ }
+ return $options;
+ }
+/**
+ * afterRender callback
+ *
+ * @return array
+ * @access public
+ */
+ function afterRender() {
+ if (env('HTTP_X_UPDATE') != null && count($this->__ajaxBuffer) > 0) {
+ $data = array();
+ $divs = explode(' ', env('HTTP_X_UPDATE'));
+
+ foreach ($this->__ajaxBuffer as $key => $val) {
+ if (in_array($key, $divs)) {
+ $data[] = $key . ':"' . rawurlencode($val) . '"';
+ }
+ }
+
+ $out = 'var __ajaxUpdater__ = {' . join(', ', $data) . '};' . "\n";
+ $out .= 'for (n in __ajaxUpdater__) { if (typeof __ajaxUpdater__[n] == "string" && $(n)) Element.update($(n), unescape(decodeURIComponent(__ajaxUpdater__[n]))); }';
+
+ @ob_end_clean();
+ e($this->Javascript->codeBlock($out));
+ exit();
+ }
+ }
+/**
+ * Replaced by AjaxHelper::link()
+ *
+ * @deprecated will not be avialable after 1.1.x.x
+ */
+ function linkToRemote($title, $options = array(), $html_options = array()) {
+ trigger_error('Deprecated function: use AjaxHelper::link', E_USER_WARNING);
+ $href = '#';
+
+ if (!empty($options['fallback']) && isset($options['fallback'])) {
+ $href = $options['fallback'];
+ }
+
+ if (isset($html_options['id'])) {
+ return $this->Html->link($title, $href, $html_options) .
+ $this->Javascript->event("$('{$html_options['id']}')", "click", $this->remoteFunction($options));
+ } else {
+ $html_options['onclick'] = $this->remoteFunction($options) . "; event.returnValue = false; return false;";
+ return $this->Html->link($title, $href, $html_options);
+ }
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/cache.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/cache.php
new file mode 100644
index 0000000..99d609f
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/cache.php
@@ -0,0 +1,272 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 1.0.0.2277
+ * @version $Revision: 7691 $
+ * @modifiedby $LastChangedBy: nate $
+ * @lastmodified $Date: 2008-10-02 00:59:12 -0400 (Thu, 02 Oct 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for file.
+ *
+ * Long description for file
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class CacheHelper extends Helper{
+/**
+ * Array of strings replaced in cached views.
+ * The strings are found between in views
+ *
+ * @var array
+ * @access private
+ */
+ var $__replace = array();
+/**
+ * Array of string that are replace with there var replace above.
+ * The strings are any content inside and includes the tags in views
+ *
+ * @var array
+ * @access private
+ */
+ var $__match = array();
+/**
+ * holds the View object passed in final call to CacheHelper::cache()
+ *
+ * @var object
+ * @access public
+ */
+ var $view;
+/**
+ * Main method used to cache a view
+ *
+ * @param string $file File to cache
+ * @param string $out output to cache
+ * @param boolean $cache
+ * @return view ouput
+ */
+ function cache($file, $out, $cache = false) {
+ if (is_array($this->cacheAction)) {
+ $check = str_replace('/', '_', $this->here);
+ $replace = str_replace('/', '_', $this->base);
+ $match = str_replace($this->base, '', $this->here);
+ $match = str_replace('//', '/', $match);
+ $match = str_replace('/' . $this->controllerName . '/', '', $match);
+ $check = str_replace($replace, '', $check);
+ $check = str_replace('_' . $this->controllerName . '_', '', $check);
+ $check = convertSlash($check);
+ $check = preg_replace('/^_+/', '', $check);
+ $keys = str_replace('/', '_', array_keys($this->cacheAction));
+ $found = array_keys($this->cacheAction);
+ $index = null;
+ $count = 0;
+
+ foreach ($keys as $key => $value) {
+ if (strpos($check, $value) === 0) {
+ $index = $found[$count];
+ break;
+ }
+ $count++;
+ }
+
+ if (isset($index)) {
+ $pos1 = strrpos($match, '/');
+ $char = strlen($match) - 1;
+
+ if ($pos1 == $char) {
+ $match = substr($match, 0, $char);
+ }
+
+ $key = $match;
+ } elseif ($this->action == 'index') {
+ $index = 'index';
+ }
+ if (isset($this->cacheAction[$index])) {
+ $cacheTime = $this->cacheAction[$index];
+ } else {
+ $cacheTime = 0;
+ }
+ } else {
+ $cacheTime = $this->cacheAction;
+ }
+
+ if ($cacheTime != '' && $cacheTime > 0) {
+ $this->__parseFile($file, $out);
+
+ if ($cache === true) {
+ $cached = $this->__parseOutput($out);
+ $this->__writeFile($cached, $cacheTime);
+ }
+ }
+ return $out;
+ }
+/**
+ * Parse file searching for no cache tags
+ *
+ * @param string $file
+ * @param boolean $cache
+ * @access private
+ */
+ function __parseFile($file, $cache) {
+ if (is_file($file)) {
+ $file = file_get_contents($file);
+ } elseif ($file = fileExistsInPath($file)) {
+ $file = file_get_contents($file);
+ }
+
+ preg_match_all('/((?<=)[\\s\\S]*?(?=<\/cake:nocache>)<\/cake:nocache>)/i', $cache, $oresult, PREG_PATTERN_ORDER);
+ preg_match_all('/(?<=)([\\s\\S]*?)(?=<\/cake:nocache>)/i', $file, $result, PREG_PATTERN_ORDER);
+
+ if (!empty($this->__replace)) {
+ foreach ($oresult['0'] as $k => $element) {
+ if (array_search($element, $this->__match) !== false) {
+ array_splice($oresult[0], $k, 1);
+ }
+ }
+ }
+
+ if (!empty($result['0'])) {
+ $count = 0;
+
+ foreach ($result['0'] as $block) {
+ if (isset($oresult['0'][$count])) {
+ $this->__replace[] = $block;
+ $this->__match[] = $oresult['0'][$count];
+ }
+ $count++;
+ }
+ }
+ }
+/**
+ * Parse the output and replace cache tags
+ *
+ * @param sting $cache
+ * @return string with all replacements made to
+ * @access private
+ */
+ function __parseOutput($cache) {
+ $count = 0;
+ if (!empty($this->__match)) {
+
+ foreach ($this->__match as $found) {
+ $original = $cache;
+ $length = strlen($found);
+ $position = 0;
+
+ for ($i = 1; $i <= 1; $i++) {
+ $position = strpos($cache, $found, $position);
+
+ if ($position !== false) {
+ $cache = substr($original, 0, $position);
+ $cache .= $this->__replace[$count];
+ $cache .= substr($original, $position + $length);
+ } else {
+ break;
+ }
+ }
+ $count++;
+ }
+ return $cache;
+ }
+ return $cache;
+ }
+/**
+ * Write a cached version of the file
+ *
+ * @param string $content
+ * @param sting $timestamp
+ * @return cached view
+ * @access private
+ */
+ function __writeFile($content, $timestamp) {
+ $now = time();
+
+ if (is_numeric($timestamp)) {
+ $cacheTime = $now + $timestamp;
+ } else {
+ $cacheTime = strtotime($timestamp, $now);
+ }
+
+ $cache = convertSlash($this->here);
+ if (empty($cache)) {
+ return;
+ }
+
+ $cache = $cache . '.php';
+ $file = 'plugin)) {
+ $file .= '
+ loadController(\'' . $this->view->name. '\');
+ loadModels();
+ ';
+ } else {
+ $file .= '
+ if (!class_exists(\'AppController\')) {
+ if (file_exists(\'' . APP . 'app_controller.php\')) {
+ require(\''. APP . 'app_controller.php\');
+ } else {
+ require(\''.CAKE . 'app_controller.php\');
+ }
+ }
+ loadPluginController(\''.$this->plugin.'\',\''.$this->view->name.'\');
+ loadPluginModels(\''.$this->plugin.'\');
+ ';
+ }
+ $file .= '$this->controller = new ' . $this->view->name . 'Controller();
+ $this->controller->plugin = \''.$this->plugin.'\';
+ $this->controller->_initComponents();
+ $this->helpers = unserialize(\'' . serialize($this->view->helpers) . '\');
+ $this->base = \'' . $this->view->base . '\';
+ $this->layout = \'' . $this->view->layout. '\';
+ $this->webroot = \'' . $this->view->webroot . '\';
+ $this->here = \'' . $this->view->here . '\';
+ $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->view->params)) . '\'));
+ $this->action = unserialize(\'' . serialize($this->view->action) . '\');
+ $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->view->data)) . '\'));
+ $this->themeWeb = \'' . $this->view->themeWeb . '\';
+ $this->plugin = \'' . $this->view->plugin . '\';
+ $loadedHelpers = array();
+ $loadedHelpers = $this->_loadHelpers($loadedHelpers, $this->helpers);
+ foreach (array_keys($loadedHelpers) as $helper)
+ {
+ $replace = strtolower(substr($helper, 0, 1));
+ $camelBackedHelper = preg_replace(\'/\\w/\', $replace, $helper, 1);
+ ${$camelBackedHelper} =& $loadedHelpers[$helper];
+
+ if (isset(${$camelBackedHelper}->helpers) && is_array(${$camelBackedHelper}->helpers))
+ {
+ foreach (${$camelBackedHelper}->helpers as $subHelper)
+ {
+ ${$camelBackedHelper}->{$subHelper} =& $loadedHelpers[$subHelper];
+ }
+ }
+ $this->loaded[$camelBackedHelper] = (${$camelBackedHelper});
+ }
+ ?>';
+ $content = preg_replace("/(<\\?xml)/", "",$content);
+ $file .= $content;
+ return cache('views' . DS . $cache, $file, $timestamp);
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/form.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/form.php
new file mode 100644
index 0000000..d2d58a4
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/form.php
@@ -0,0 +1,491 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Tag template for a div with a class attribute.
+ */
+ define('TAG_DIV', '%s
');
+/**
+ * Tag template for a paragraph with a class attribute.
+ */
+ define('TAG_P_CLASS', '%s
');
+/**
+ * Tag template for a label with a for attribute.
+ */
+ define('TAG_LABEL', '%s ');
+/**
+ * Tag template for a fieldset with a legend tag inside.
+ */
+ define('TAG_FIELDSET', '%s %s');
+/**
+ * Form helper library.
+ *
+ * Automatic generation of HTML FORMs from given data.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class FormHelper extends Helper{
+/**
+ * Included helpers.
+ *
+ * @var array
+ * @access public
+ */
+ var $helpers = array('Html');
+/**
+ * Returns a formatted error message for given FORM field, NULL if no errors.
+ *
+ * @param string $field This should be "Modelname/fieldname"
+ * @return bool If there are errors this method returns true, else false.
+ * @access public
+ */
+ function isFieldError($field) {
+ $error=1;
+ $this->Html->setFormTag($field);
+
+ if ($error == $this->Html->tagIsInvalid($this->Html->model, $this->Html->field)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+/**
+ * Returns a formatted LABEL element for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $text Text that will appear in the label field.
+ * @return string The formatted LABEL element
+ * @access public
+ */
+ function labelTag($tagName, $text) {
+ return sprintf(TAG_LABEL, Inflector::camelize(str_replace('/', '_', $tagName)), $text);
+ }
+/**
+ * Returns a formatted DIV tag for HTML FORMs.
+ *
+ * @param string $class CSS class name of the div element.
+ * @param string $text String content that will appear inside the div element.
+ * @return string The formatted DIV element
+ * @access public
+ */
+ function divTag($class, $text) {
+ return sprintf(TAG_DIV, $class, $text);
+ }
+/**
+ * Returns a formatted P tag with class for HTML FORMs.
+ *
+ * @param string $class CSS class name of the p element.
+ * @param string $text Text that will appear inside the p element.
+ * @return string The formatted P element
+ * @access public
+ */
+ function pTag($class, $text) {
+ return sprintf(TAG_P_CLASS, $class, $text);
+ }
+/**
+ * Returns a formatted INPUT tag for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param bool $required True if this field is a required field.
+ * @param string $errorMsg Text that will appear if an error has occurred.
+ * @param int $size Size attribute for INPUT element
+ * @param array $htmlOptions HTML options array.
+ * @return string The formatted INPUT element, with a label and wrapped in a div.
+ * @access public
+ */
+ function generateInputDiv($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null) {
+ $htmlAttributes = $htmlOptions;
+ $htmlAttributes['size'] = $size;
+ $str = $this->Html->input($tagName, $htmlAttributes);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ return $this->divTag($divClass, $divTagInside);
+ }
+/**
+ * Returns a formatted CHECKBOX tag inside a DIV for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param bool $required True if this field is a required field.
+ * @param string $errorMsg Text that will appear if an error has occurred.
+ * @param array $htmlOptions HTML options array.
+ * @return string The formatted checkbox div
+ * @access public
+ */
+ function generateCheckboxDiv($tagName, $prompt, $required = false, $errorMsg = null, $htmlOptions = null) {
+ $htmlOptions['class'] = "inputCheckbox";
+ $str = $this->Html->checkbox($tagName, null, $htmlOptions);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ return $this->divTag($divClass, $divTagInside);
+ }
+/**
+ * Returns a formatted date option element for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param bool $required True if this field is a required field.
+ * @param string $errorMsg Text that will appear if an error has occurred.
+ * @param int $size Not used.
+ * @param array $htmlOptions HTML options array
+ * @return string Date option wrapped in a div.
+ * @todo Remove the $size parameter from this method.
+ * @access public
+ */
+ function generateDate($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
+ $str = $this->Html->dateTimeOptionTag($tagName, 'MDY', 'NONE', $selected, $htmlOptions);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ $requiredDiv = $this->divTag($divClass, $divTagInside);
+ return $this->divTag("date", $requiredDiv);
+ }
+/**
+ * Returns a formatted date option element for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param bool $required True if this field is a required field.
+ * @param string $errorMsg Text that will appear if an error has occurred.
+ * @param int $size Not used.
+ * @param array $htmlOptions HTML options array
+ * @return string Date option wrapped in a div.
+ * @todo Remove the $size parameter from this method.
+ * @access public
+ */
+ function generateTime($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
+ $str = $this->Html->dateTimeOptionTag($tagName, 'NONE', '24', $selected, $htmlOptions);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ $requiredDiv = $this->divTag($divClass, $divTagInside);
+ return $this->divTag("time", $requiredDiv);
+ }
+/**
+ * Returns a formatted year option element for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param bool $required True if this field is a required field.
+ * @param string $errorMsg Text that will appear if an error has occurred.
+ * @param int $size Not used.
+ * @param array $htmlOptions HTML options array
+ * @return string Date option wrapped in a div.
+ * @todo Remove the $size parameter from this method.
+ * @access public
+ */
+ function generateYear($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
+ $str = $this->Html->dateTimeOptionTag($tagName, 'Y', 'NONE', $selected, $htmlOptions);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ $requiredDiv = $this->divTag($divClass, $divTagInside);
+ return $this->divTag("year", $requiredDiv);
+ }
+/**
+ * Returns a formatted datetime option element for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param bool $required True if this field is required.
+ * @param string $errorMsg Text that will appear if an error has occurred.
+ * @param int $size Not used.
+ * @param array $htmlOptions HTML options array
+ * @param array $selected Selected index in the dateTimeOption tag.
+ * @return string The formatted datetime option element wrapped in a div.
+ * @todo Remove the $size parameter from this method.
+ * @access public
+ */
+ function generateDateTime($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
+ $str = $this->Html->dateTimeOptionTag($tagName, 'MDY', '12', $selected, $htmlOptions);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ $requiredDiv = $this->divTag($divClass, $divTagInside);
+ return $this->divTag("date", $requiredDiv);
+ }
+/**
+ * Returns a formatted TEXTAREA inside a DIV for use with HTML forms.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field.
+ * @param boolean $required True if this field is required.
+ * @param string $errorMsg ext that will appear if an error has occurred.
+ * @param integer $cols Number of columns.
+ * @param integer $rows Number of rows.
+ * @param array $htmlOptions HTML options array.
+ * @return string The formatted TEXTAREA element, wrapped in a div.
+ * @access public
+ */
+ function generateAreaDiv($tagName, $prompt, $required = false, $errorMsg = null, $cols = 60, $rows = 10, $htmlOptions = null) {
+ $htmlAttributes = $htmlOptions;
+ $htmlAttributes['cols'] = $cols;
+ $htmlAttributes['rows'] = $rows;
+ $str = $this->Html->textarea($tagName, $htmlAttributes);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass="required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError = $this->pTag('error', $errorMsg);
+ $divClass = sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ return $this->divTag($divClass, $divTagInside);
+ }
+/**
+ * Returns a formatted SELECT tag for HTML FORMs.
+ *
+ * @param string $tagName This should be "Modelname/fieldname"
+ * @param string $prompt Text that will appear in the label field
+ * @param array $options Options to be contained in SELECT element
+ * @param string $selected Currently selected item
+ * @param array $selectAttr Array of HTML attributes for the SELECT element
+ * @param array $optionAttr Array of HTML attributes for the OPTION elements
+ * @param bool $required True if this field is required
+ * @param string $errorMsg Text that will appear if an error has occurred
+ * @return string The formatted INPUT element, wrapped in a div
+ * @access public
+ */
+ function generateSelectDiv($tagName, $prompt, $options, $selected = null, $selectAttr = null, $optionAttr = null, $required = false, $errorMsg = null) {
+ $str = $this->Html->selectTag($tagName, $options, $selected, $selectAttr, $optionAttr);
+ $strLabel = $this->labelTag($tagName, $prompt);
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+
+ if ($this->isFieldError($tagName)) {
+ $strError=$this->pTag('error', $errorMsg);
+ $divClass=sprintf("%s error", $divClass);
+ }
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ return $this->divTag($divClass, $divTagInside);
+ }
+/**
+ * Returns a formatted submit widget for HTML FORMs.
+ *
+ * @param string $displayText Text that will appear on the widget
+ * @param array $htmlOptions HTML options array
+ * @return string The formatted submit widget
+ * @access public
+ */
+ function generateSubmitDiv($displayText, $htmlOptions = null) {
+ return $this->divTag('submit', $this->Html->submit($displayText, $htmlOptions));
+ }
+/**
+ * Generates a form to go onto a HtmlHelper object.
+ *
+ * @param array $fields An array of form field definitions
+ * @param boolean $readOnly True if the form should be rendered as READONLY
+ * @return string The completed form specified by the $fields parameter
+ * @access public
+ */
+ function generateFields($fields, $readOnly = false) {
+ $strFormFields = '';
+
+ foreach ($fields as $field) {
+ if (isset($field['type'])) {
+
+ if (!isset($field['required'])) {
+ $field['required'] = false;
+ }
+
+ if (!isset($field['errorMsg'])) {
+ $field['errorMsg'] = null;
+ }
+
+ if (!isset($field['htmlOptions'])) {
+ $field['htmlOptions'] = array();
+ }
+
+ if ($readOnly) {
+ $field['htmlOptions']['READONLY'] = "readonly";
+ }
+
+ switch($field['type']) {
+ case "input":
+ if (!isset($field['size'])) {
+ $field['size'] = 40;
+ }
+ $strFormFields = $strFormFields . $this->generateInputDiv($field['tagName'], $field['prompt'],
+ $field['required'], $field['errorMsg'], $field['size'], $field['htmlOptions']);
+ break;
+ case "checkbox":
+ $strFormFields = $strFormFields . $this->generateCheckboxDiv($field['tagName'], $field['prompt'],
+ $field['required'], $field['errorMsg'], $field['htmlOptions']);
+ break;
+ case "select":
+ case "selectMultiple":
+ if ("selectMultiple" == $field['type']) {
+ $field['selectAttr']['multiple'] = 'multiple';
+ $field['selectAttr']['class'] = 'selectMultiple';
+ }
+
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+
+ if (!isset($field['selectAttr'])) {
+ $field['selectAttr'] = null;
+ }
+
+ if (!isset($field['optionsAttr'])) {
+ $field['optionsAttr'] = null;
+ }
+
+ if ($readOnly) {
+ $field['selectAttr']['DISABLED'] = true;
+ }
+
+ if (!isset($field['options'])) {
+ $field['options'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateSelectDiv($field['tagName'], $field['prompt'], $field['options'],
+ $field['selected'], $field['selectAttr'], $field['optionsAttr'], $field['required'], $field['errorMsg']);
+ break;
+ case "area":
+ if (!isset($field['rows'])) {
+ $field['rows'] = 10;
+ }
+
+ if (!isset($field['cols'])) {
+ $field['cols'] = 60;
+ }
+ $strFormFields = $strFormFields . $this->generateAreaDiv($field['tagName'], $field['prompt'],
+ $field['required'], $field['errorMsg'], $field['cols'], $field['rows'], $field['htmlOptions']);
+ break;
+ case "fieldset":
+ $strFieldsetFields = $this->generateFields($field['fields']);
+ $strFieldSet = sprintf(' %s %s ',
+ $field['legend'], $field['noteHeading'], $field['note'], $strFieldsetFields);
+ $strFormFields = $strFormFields . $strFieldSet;
+ break;
+ case "hidden":
+ if (!isset($field['value'])) {
+ $field['value'] = null;
+ }
+ $strFormFields = $strFormFields . $this->Html->hidden($field['tagName'], $field['value']);
+ break;
+ case "date":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateDate($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ case "datetime":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateDateTime($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ case "time":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateTime($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ case "year":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateYear($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return $strFormFields;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/html.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/html.php
new file mode 100644
index 0000000..9b86c91
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/html.php
@@ -0,0 +1,1257 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.9.1
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Html Helper class for easy use of HTML widgets.
+ *
+ * HtmlHelper encloses all methods needed while working with HTML pages.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class HtmlHelper extends Helper {
+/**
+ * Base URL
+ *
+ * @var string
+ * @access public
+ */
+ var $base = null;
+/**
+ * URL to current action.
+ *
+ * @var string
+ * @access public
+ */
+ var $here = null;
+/**
+ * Parameter array.
+ *
+ * @var array
+ * @access public
+ */
+ var $params = array();
+/**
+ * Current action.
+ *
+ * @var string
+ * @access public
+ */
+ var $action = null;
+/**
+ * Controller::data;
+ *
+ * @var array
+ * @access public
+ */
+ var $data = null;
+/**
+ * Name of model this helper is attached to.
+ *
+ * @var string
+ * @access public
+ */
+ var $model = null;
+/**
+ *
+ * @var string
+ * @access public
+ */
+ var $field = null;
+/**
+ * Breadcrumbs.
+ *
+ * @var array
+ * @access protected
+ */
+ var $_crumbs = array();
+/**
+ * Adds a link to the breadcrumbs array.
+ *
+ * @param string $name Text for link
+ * @param string $link URL for link
+ * @return void
+ * @access public
+ */
+ function addCrumb($name, $link) {
+ $this->_crumbs[] = array($name, $link);
+ }
+/**
+ * Returns a charset META-tag.
+ *
+ * @param string $charset
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function charset($charset = null, $return = false) {
+ if (is_null($charset)) {
+ $charset = 'utf-8';
+ }
+ return $this->output(sprintf($this->tags['charset'], $charset), $return);
+ }
+/**
+ * Finds URL for specified action.
+ *
+ * Returns an URL pointing to a combination of controller and action. Param
+ * $url can be:
+ * + Empty - the method will find adress to actuall controller/action.
+ * + '/' - the method will find base URL of application.
+ * + A combination of controller/action - the method will find url for it.
+ *
+ * @param string $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4"
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function url($url = null, $return = false) {
+ if (isset($this->plugin)) {
+ $base = strip_plugin($this->base, $this->plugin);
+ } else {
+ $base = $this->base;
+ }
+
+ if (empty($url)) {
+ return $this->here;
+ } elseif ($url{0} == '/') {
+ $output = $base . $url;
+ } else {
+ $output = $base . '/' . Inflector::underscore($this->params['controller']) . '/' . $url;
+ }
+
+ return $this->output($output, $return);
+ }
+/**
+ * Creates an HTML link.
+ *
+ * If $url starts with "http://" this is treated as an external link. Else,
+ * it is treated as a path to controller/action and parsed with the
+ * HtmlHelper::url() method.
+ *
+ * If the $url is empty, $title is used instead.
+ *
+ * @param string $title The content of the A tag.
+ * @param string $url Cake-relative URL, or external URL (starts with http://)
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param string $confirmMessage Confirmation message.
+ * @param boolean $escapeTitle Whether or not the text in the $title variable should be HTML escaped.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function link($title, $url = null, $htmlAttributes = array(), $confirmMessage = false, $escapeTitle = true, $return = false) {
+ if ($escapeTitle === true) {
+ $title = htmlspecialchars($title, ENT_QUOTES);
+ } elseif (is_string($escapeTitle)) {
+ $title = htmlentities($title, ENT_QUOTES);
+ }
+ $url = $url ? $url : $title;
+
+ if ($confirmMessage) {
+ $confirmMessage = str_replace("'", "\'", $confirmMessage);
+ $confirmMessage = str_replace('"', '\"', $confirmMessage);
+ $htmlAttributes['onclick']="return confirm('{$confirmMessage}');";
+ }
+
+ if (((strpos($url, '://')) || (strpos($url, 'javascript:') === 0) || (strpos($url, 'mailto:') === 0) || substr($url,0,1) == '#')) {
+ $output = sprintf($this->tags['link'], $url, $this->_parseAttributes($htmlAttributes), $title);
+ } else {
+ $output = sprintf($this->tags['link'], $this->url($url, true), $this->_parseAttributes($htmlAttributes), $title);
+ }
+ return $this->output($output, $return);
+ }
+/**
+ * Creates a submit widget.
+ *
+ * @param string $caption Text on submit button
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function submit($caption = 'Submit', $htmlAttributes = array(), $return = false) {
+ $htmlAttributes['value'] = $caption;
+ return $this->output(sprintf($this->tags['submit'], $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return);
+ }
+/**
+ * Creates a password input widget.
+ *
+ * @param string $fieldName Name of a field, like this "Modelname/fieldname"
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function password($fieldName, $htmlAttributes = array(), $return = false) {
+ $this->setFormTag($fieldName);
+ if (!isset($htmlAttributes['value'])) {
+ $htmlAttributes['value'] = $this->tagValue($fieldName);
+ }
+ if (!isset($htmlAttributes['id'])) {
+ $htmlAttributes['id'] = $this->model . Inflector::camelize($this->field);
+ }
+
+ if ($this->tagIsInvalid($this->model, $this->field)) {
+ if (isset($htmlAttributes['class']) && trim($htmlAttributes['class']) != "") {
+ $htmlAttributes['class'] .= ' form_error';
+ } else {
+ $htmlAttributes['class'] = 'form_error';
+ }
+ }
+ return $this->output(sprintf($this->tags['password'], $this->model, $this->field, $this->_parseAttributes($htmlAttributes, null, ' ', ' ')), $return);
+ }
+/**
+ * Creates a textarea widget.
+ *
+ * @param string $fieldName Name of a field, like this "Modelname/fieldname"
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function textarea($fieldName, $htmlAttributes = array(), $return = false) {
+ $this->setFormTag($fieldName);
+ $value = $this->tagValue($fieldName);
+ if (!empty($htmlAttributes['value'])) {
+ $value = $htmlAttributes['value'];
+ unset($htmlAttributes['value']);
+ }
+ if (!isset($htmlAttributes['id'])) {
+ $htmlAttributes['id'] = $this->model . Inflector::camelize($this->field);
+ }
+
+ if ($this->tagIsInvalid($this->model, $this->field)) {
+ if (isset($htmlAttributes['class']) && trim($htmlAttributes['class']) != "") {
+ $htmlAttributes['class'] .= ' form_error';
+ } else {
+ $htmlAttributes['class'] = 'form_error';
+ }
+ }
+ return $this->output(sprintf($this->tags['textarea'], $this->model, $this->field, $this->_parseAttributes($htmlAttributes, null, ' '), $value), $return);
+ }
+/**
+ * Creates a checkbox widget.
+ *
+ * @param string $fieldName Name of a field, like this "Modelname/fieldname"
+ * @deprecated string $title
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function checkbox($fieldName, $title = null, $htmlAttributes = array(), $return = false) {
+ $value = $this->tagValue($fieldName);
+ $notCheckedValue = 0;
+
+ if (!isset($htmlAttributes['id'])) {
+ $htmlAttributes['id'] = $this->model . Inflector::camelize($this->field);
+ }
+
+ if (isset($htmlAttributes['checked'])) {
+ if ($htmlAttributes['checked'] == 'checked' || intval($htmlAttributes['checked']) === 1 || $htmlAttributes['checked'] === true) {
+ $htmlAttributes['checked'] = 'checked';
+ } else {
+ $htmlAttributes['checked'] = null;
+ $notCheckedValue = -1;
+ }
+ } else {
+ if (isset($htmlAttributes['value']) || (!class_exists($this->model) && !loadModel($this->model))) {
+ $htmlAttributes['checked'] = ($htmlAttributes['value'] == $value) ? 'checked' : null;
+
+ if ($htmlAttributes['value'] == '0') {
+ $notCheckedValue = -1;
+ }
+ } else {
+ $model = new $this->model;
+ $db =& ConnectionManager::getDataSource($model->useDbConfig);
+ $value = $db->boolean($value);
+ $htmlAttributes['checked'] = $value ? 'checked' : null;
+ $htmlAttributes['value'] = 1;
+ }
+ }
+
+ $output = $this->hidden($fieldName, array('value' => $notCheckedValue, 'id' => $htmlAttributes['id'] . '_'), true);
+ $output .= sprintf($this->tags['checkbox'], $this->model, $this->field, $this->_parseAttributes($htmlAttributes, null, '', ' '));
+ return $this->output($output, $return);
+ }
+/**
+ * Creates a link element for CSS stylesheets.
+ *
+ * @param string $path Path to CSS file
+ * @param string $rel Rel attribute. Defaults to "stylesheet".
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function css($path, $rel = 'stylesheet', $htmlAttributes = array(), $return = false) {
+ $url = "{$this->webroot}" . (COMPRESS_CSS ? 'c' : '') . $this->themeWeb . CSS_URL . $path . ".css";
+
+ if ($rel == 'import') {
+ return $this->output(sprintf($this->tags['style'], $this->parseHtmlOptions($htmlAttributes, null, '', ' '), '@import url(' . $url . ');'), $return);
+ } else {
+ return $this->output(sprintf($this->tags['css'], $rel, $url, $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return);
+ }
+ }
+/**
+ * Creates file input widget.
+ *
+ * @param string $fieldName Name of a field, like this "Modelname/fieldname"
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a valueor output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function file($fieldName, $htmlAttributes = array(), $return = false) {
+ if (strpos($fieldName, '/')) {
+ $this->setFormTag($fieldName);
+ if (!isset($htmlAttributes['id'])) {
+ $htmlAttributes['id'] = $this->model . Inflector::camelize($this->field);
+ }
+ return $this->output(sprintf($this->tags['file'], $this->model, $this->field, $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return);
+ }
+ return $this->output(sprintf($this->tags['file_no_model'], $fieldName, $this->_parseAttributes($htmlAttributes, null, '', ' ')), $return);
+ }
+/**
+ * Returns the breadcrumb trail as a sequence of »-separated links.
+ *
+ * @param string $separator Text to separate crumbs.
+ * @param string $startText This will be the first crumb, if false it defaults to first crumb in array
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return. If $this->_crumbs is empty, return null.
+ * @access public
+ */
+ function getCrumbs($separator = '»', $startText = false, $return = false) {
+ if (count($this->_crumbs)) {
+ $out = array();
+ if ($startText) {
+ $out[] = $this->link($startText, '/');
+ }
+
+ foreach ($this->_crumbs as $crumb) {
+ $out[] = $this->link($crumb[0], $crumb[1]);
+ }
+ return $this->output(join($separator, $out), $return);
+ } else {
+ return null;
+ }
+ }
+/**
+ * Creates a hidden input field.
+ *
+ * @param string $fieldName Name of a field, like this "Modelname/fieldname"
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function hidden($fieldName, $htmlAttributes = array(), $return = false) {
+ $this->setFormTag($fieldName);
+ if (!isset($htmlAttributes['value'])) {
+ $htmlAttributes['value'] = $this->tagValue($fieldName);
+ }
+ if (!isset($htmlAttributes['id'])) {
+ $htmlAttributes['id'] = $this->model . Inflector::camelize($this->field);
+ }
+ return $this->output(sprintf($this->tags['hidden'], $this->model, $this->field, $this->_parseAttributes($htmlAttributes, null, ' ', ' ')), $return);
+ }
+/**
+ * Creates a formatted IMG element.
+ *
+ * @param string $path Path to the image file, relative to the webroot/img/ directory.
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function image($path, $htmlAttributes = array(), $return = false) {
+ if (strpos($path, '://')) {
+ $url = $path;
+ } else {
+ $url = $this->webroot . $this->themeWeb . IMAGES_URL . $path;
+ }
+ return $this->output(sprintf($this->tags['image'], $url, $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return);
+ }
+/**
+ * Creates a text input widget.
+ *
+ * @param string $fieldNamem Name of a field, like this "Modelname/fieldname"
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function input($fieldName, $htmlAttributes = array(), $return = false) {
+ $this->setFormTag($fieldName);
+ if (!isset($htmlAttributes['value'])) {
+ $htmlAttributes['value'] = $this->tagValue($fieldName);
+ }
+
+ if (!isset($htmlAttributes['type'])) {
+ $htmlAttributes['type'] = 'text';
+ }
+
+ if (!isset($htmlAttributes['id'])) {
+ $htmlAttributes['id'] = $this->model . Inflector::camelize($this->field);
+ }
+
+ if ($this->tagIsInvalid($this->model, $this->field)) {
+ if (isset($htmlAttributes['class']) && trim($htmlAttributes['class']) != "") {
+ $htmlAttributes['class'] .= ' form_error';
+ } else {
+ $htmlAttributes['class'] = 'form_error';
+ }
+ }
+ return $this->output(sprintf($this->tags['input'], $this->model, $this->field, $this->_parseAttributes($htmlAttributes, null, ' ', ' ')), $return);
+ }
+ /**
+ * Returns a formatted SELECT element.
+ *
+ * @param string $fieldName Name attribute of the SELECT
+ * @param array $optionElements Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the SELECT element
+ * @param mixed $selected Selected option
+ * @param array $selectAttr Array of HTML options for the opening SELECT element
+ * @param array $optionAttr Array of HTML options for the enclosed OPTION elements
+ * @param boolean $show_empty If true, the empty select option is shown
+ * @param boolean $return Whether this method should return a value
+ * @return string Formatted SELECT element
+ * @access public
+ */
+ function selectTag($fieldName, $optionElements, $selected = null, $selectAttr = array(), $optionAttr = null, $showEmpty = true, $return = false) {
+ $this->setFormTag($fieldName);
+ if ($this->tagIsInvalid($this->model, $this->field)) {
+ if (isset($selectAttr['class']) && trim($selectAttr['class']) != "") {
+ $selectAttr['class'] .= ' form_error';
+ } else {
+ $selectAttr['class'] = 'form_error';
+ }
+ }
+ if (!isset($selectAttr['id'])) {
+ $selectAttr['id'] = $this->model . Inflector::camelize($this->field);
+ }
+
+ if (!is_array($optionElements)) {
+ return null;
+ }
+
+ if (!isset($selected)) {
+ $selected = $this->tagValue($fieldName);
+ }
+
+ if (isset($selectAttr) && array_key_exists("multiple", $selectAttr)) {
+ $select[] = sprintf($this->tags['selectmultiplestart'], $this->model, $this->field, $this->parseHtmlOptions($selectAttr));
+ } else {
+ $select[] = sprintf($this->tags['selectstart'], $this->model, $this->field, $this->parseHtmlOptions($selectAttr));
+ }
+
+ if ($showEmpty == true) {
+ $select[] = sprintf($this->tags['selectempty'], $this->parseHtmlOptions($optionAttr));
+ }
+
+ foreach ($optionElements as $name => $title) {
+ $optionsHere = $optionAttr;
+
+ if (($selected != null) && ($selected == $name)) {
+ $optionsHere['selected'] = 'selected';
+ } elseif (is_array($selected) && in_array($name, $selected)) {
+ $optionsHere['selected'] = 'selected';
+ }
+
+ $select[] = sprintf($this->tags['selectoption'], $name, $this->parseHtmlOptions($optionsHere), h($title));
+ }
+
+ $select[] = sprintf($this->tags['selectend']);
+ return $this->output(implode("\n", $select), $return);
+ }
+/**
+ * Creates a set of radio widgets.
+ *
+ * @param string $fieldName Name of a field, like this "Modelname/fieldname"
+ * @param array $options Radio button options array
+ * @param array $inbetween String that separates the radio buttons.
+ * @param array $htmlAttributes Array of HTML attributes.
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return.
+ * @access public
+ */
+ function radio($fieldName, $options, $inbetween = null, $htmlAttributes = array(), $return = false) {
+
+ $this->setFormTag($fieldName);
+ $value = isset($htmlAttributes['value']) ? $htmlAttributes['value'] : $this->tagValue($fieldName);
+ $out = array();
+
+ foreach ($options as $optValue => $optTitle) {
+ $optionsHere = array('value' => $optValue);
+ if ($value !== false && $optValue == $value) {
+ $optionsHere['checked'] = 'checked';
+ }
+ $parsedOptions = $this->parseHtmlOptions(array_merge($htmlAttributes, $optionsHere), null, '', ' ');
+ $individualTagName = "{$this->field}_{$optValue}";
+ $out[] = sprintf($this->tags['radio'], $this->model, $this->field, $individualTagName, $parsedOptions, $optTitle);
+ }
+
+ $out = join($inbetween, $out);
+ return $this->output($out ? $out : null, $return);
+ }
+/**
+ * Returns a SELECT element for days.
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @deprecated string $value
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @param boolean $showEmpty Show/hide the empty select option
+ * @return mixed
+ * @access public
+ */
+ function dayOptionTag($tagName, $value = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ if (empty($selected) && $this->tagValue($tagName)) {
+ $selected = date('d', strtotime($this->tagValue($tagName)));
+ }
+ $dayValue = empty($selected) ? ($showEmpty == true ? NULL : date('d')) : $selected;
+ $days = array('01' => '1', '02' => '2', '03' => '3', '04' => '4', '05' => '5', '06' => '6', '07' => '7', '08' => '8', '09' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', '31' => '31');
+ $option = $this->selectTag($tagName . "_day", $days, $dayValue, $selectAttr, $optionAttr, $showEmpty);
+ return $option;
+ }
+/**
+ * Returns a SELECT element for years
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @deprecated string $value
+ * @param integer $minYear First year in sequence
+ * @param integer $maxYear Last year in sequence
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @param boolean $showEmpty Show/hide the empty select option
+ * @return mixed
+ * @access public
+ */
+ function yearOptionTag($tagName, $value = null, $minYear = null, $maxYear = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ if (empty($selected) && ($this->tagValue($tagName))) {
+ $selected = date('Y', strtotime($this->tagValue($tagName)));
+ }
+
+ $yearValue = empty($selected) ? ($showEmpty ? NULL : date('Y')) : $selected;
+ $currentYear = date('Y');
+ $maxYear = is_null($maxYear) ? $currentYear + 11 : $maxYear + 1;
+ $minYear = is_null($minYear) ? $currentYear - 60 : $minYear;
+
+ if ($minYear > $maxYear) {
+ $tmpYear = $minYear;
+ $minYear = $maxYear;
+ $maxYear = $tmpYear;
+ }
+
+ $minYear = $currentYear < $minYear ? $currentYear : $minYear;
+ $maxYear = $currentYear > $maxYear ? $currentYear : $maxYear;
+
+ for ($yearCounter = $minYear; $yearCounter < $maxYear; $yearCounter++) {
+ $years[$yearCounter] = $yearCounter;
+ }
+
+ return $this->selectTag($tagName . "_year", $years, $yearValue, $selectAttr, $optionAttr, $showEmpty);
+ }
+/**
+ * Returns a SELECT element for months.
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @deprecated string $value
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @param boolean $showEmpty Show/hide the empty select option
+ * @return mixed
+ * @access public
+ */
+ function monthOptionTag($tagName, $value = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ if (empty($selected) && ($this->tagValue($tagName))) {
+ $selected = date('m', strtotime($this->tagValue($tagName)));
+ }
+ $monthValue = empty($selected) ? ($showEmpty ? NULL : date('m')) : $selected;
+ $months = array('01' => 'January', '02' => 'February', '03' => 'March', '04' => 'April', '05' => 'May', '06' => 'June', '07' => 'July', '08' => 'August', '09' => 'September', '10' => 'October', '11' => 'November', '12' => 'December');
+
+ return $this->selectTag($tagName . "_month", $months, $monthValue, $selectAttr, $optionAttr, $showEmpty);
+ }
+/**
+ * Returns a SELECT element for hours.
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @deprecated string $value
+ * @param boolean $format24Hours True for 24 hours format
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @return mixed
+ * @access public
+ */
+ function hourOptionTag($tagName, $value = null, $format24Hours = false, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ if (empty($selected) && ($this->tagValue($tagName))) {
+ if ($format24Hours) {
+ $selected = date('H', strtotime($this->tagValue($tagName)));
+ } else {
+ $selected = date('g', strtotime($this->tagValue($tagName)));
+ }
+ }
+ if ($format24Hours) {
+ $hourValue = empty($selected) ? ($showEmpty ? NULL : date('H')) : $selected;
+ } else {
+ $hourValue = empty($selected) ? ($showEmpty ? NULL : date('g')) : $selected;
+ if (isset($selected) && intval($hourValue) == 0 && !$showEmpty) {
+ $hourValue = 12;
+ }
+ }
+
+ if ($format24Hours) {
+ $hours = array('00' => '00', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23');
+ } else {
+ $hours = array('01' => '1', '02' => '2', '03' => '3', '04' => '4', '05' => '5', '06' => '6', '07' => '7', '08' => '8', '09' => '9', '10' => '10', '11' => '11', '12' => '12');
+ }
+
+ $option = $this->selectTag($tagName . "_hour", $hours, $hourValue, $selectAttr, $optionAttr, $showEmpty);
+ return $option;
+ }
+/**
+ * Returns a SELECT element for minutes.
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @deprecated string $value
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @return mixed
+ * @access public
+ */
+ function minuteOptionTag($tagName, $value = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ if (empty($selected) && ($this->tagValue($tagName))) {
+ $selected = date('i', strtotime($this->tagValue($tagName)));
+ }
+ $minValue = empty($selected) ? ($showEmpty ? NULL : date('i')) : $selected;
+
+ for ($minCount = 0; $minCount < 60; $minCount++) {
+ $mins[sprintf('%02d', $minCount)] = sprintf('%02d', $minCount);
+ }
+ $option = $this->selectTag($tagName . "_min", $mins, $minValue, $selectAttr, $optionAttr, $showEmpty);
+ return $option;
+ }
+
+/**
+ * Returns a SELECT element for AM or PM.
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @deprecated string $value
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @return mixed
+ * @access public
+ */
+ function meridianOptionTag($tagName, $value = null, $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ if (empty($selected) && ($this->tagValue($tagName))) {
+ $selected = date('a', strtotime($this->tagValue($tagName)));
+ }
+ $merValue = empty($selected) ? ($showEmpty ? NULL : date('a')) : $selected;
+ $meridians = array('am' => 'am', 'pm' => 'pm');
+
+ $option = $this->selectTag($tagName . "_meridian", $meridians, $merValue, $selectAttr, $optionAttr, $showEmpty);
+ return $option;
+ }
+/**
+ * Returns a set of SELECT elements for a full datetime setup: day, month and year, and then time.
+ *
+ * @param string $tagName Prefix name for the SELECT element
+ * @param string $dateFormat DMY, MDY, YMD or NONE.
+ * @param string $timeFormat 12, 24, NONE
+ * @param string $selected Option which is selected.
+ * @param array $optionAttr Attribute array for the option elements.
+ * @return string The HTML formatted OPTION element
+ * @access public
+ */
+ function dateTimeOptionTag($tagName, $dateFormat = 'DMY', $timeFormat = '12', $selected = null, $selectAttr = null, $optionAttr = null, $showEmpty = true) {
+ $day = null;
+ $month = null;
+ $year = null;
+ $hour = null;
+ $min = null;
+ $meridian = null;
+
+ if (empty($selected)) {
+ $selected = $this->tagValue($tagName);
+ }
+
+ if (!empty($selected)) {
+
+ if (is_int($selected)) {
+ $selected = strftime('%Y-%m-%d %H:%M:%S', $selected);
+ }
+
+ $meridian = 'am';
+ $pos = strpos($selected, '-');
+ if ($pos !== false) {
+ $date = explode('-', $selected);
+ $days = explode(' ', $date[2]);
+ $day = $days[0];
+ $month = $date[1];
+ $year = $date[0];
+ } else {
+ $days[1] = $selected;
+ }
+
+ if ($timeFormat != 'NONE' && !empty($timeFormat)) {
+ $time = explode(':', $days[1]);
+ $check = str_replace(':', '', $days[1]);
+
+ if (($check > 115959) && $timeFormat == '12') {
+ $time[0] = $time[0] - 12;
+ $meridian = 'pm';
+ } elseif ($time[0] > 12) {
+ $meridian = 'pm';
+ }
+
+ $hour = $time[0];
+ $min = $time[1];
+ }
+ }
+
+ $elements = array('Day','Month','Year','Hour','Minute','Meridian');
+ if (isset($selectAttr['id'])) {
+ if (is_string($selectAttr['id'])) {
+ // build out an array version
+ foreach ($elements as $element) {
+ $selectAttrName = 'select' . $element . 'Attr';
+ ${$selectAttrName} = $selectAttr;
+ ${$selectAttrName}['id'] = $selectAttr['id'] . $element;
+ }
+ } elseif (is_array($selectAttr['id'])) {
+ // check for missing ones and build selectAttr for each element
+ foreach ($elements as $element) {
+ $selectAttrName = 'select' . $element . 'Attr';
+ ${$selectAttrName} = $selectAttr;
+ ${$selectAttrName}['id'] = $selectAttr['id'][strtolower($element)];
+ }
+ }
+ } else {
+ // build the selectAttrName with empty id's to pass
+ foreach ($elements as $element) {
+ $selectAttrName = 'select' . $element . 'Attr';
+ ${$selectAttrName} = $selectAttr;
+ }
+ }
+
+ switch($dateFormat) {
+ case 'DMY': // so uses the new selex
+ $opt = $this->dayOptionTag($tagName, null, $day, $selectDayAttr, $optionAttr, $showEmpty) . '-' .
+ $this->monthOptionTag($tagName, null, $month, $selectMonthAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag($tagName, null, null, null, $year, $selectYearAttr, $optionAttr, $showEmpty);
+ break;
+ case 'MDY':
+ $opt = $this->monthOptionTag($tagName, null, $month, $selectMonthAttr, $optionAttr, $showEmpty) . '-' .
+ $this->dayOptionTag($tagName, null, $day, $selectDayAttr, $optionAttr, $showEmpty) . '-' . $this->yearOptionTag($tagName, null, null, null, $year, $selectYearAttr, $optionAttr, $showEmpty);
+ break;
+ case 'YMD':
+ $opt = $this->yearOptionTag($tagName, null, null, null, $year, $selectYearAttr, $optionAttr, $showEmpty) . '-' .
+ $this->monthOptionTag($tagName, null, $month, $selectMonthAttr, $optionAttr, $showEmpty) . '-' .
+ $this->dayOptionTag($tagName, null, $day, $selectDayAttr, $optionAttr, $showEmpty);
+ break;
+ case 'Y':
+ $opt = $this->yearOptionTag($tagName, null, null, null, $selected, $selectYearAttr, $optionAttr, $showEmpty);
+ break;
+ case 'NONE':
+ default:
+ $opt = '';
+ break;
+ }
+
+ switch($timeFormat) {
+ case '24':
+ $opt .= $this->hourOptionTag($tagName, null, true, $hour, $selectHourAttr, $optionAttr, $showEmpty) . ':' .
+ $this->minuteOptionTag($tagName, null, $min, $selectMinuteAttr, $optionAttr, $showEmpty);
+ break;
+ case '12':
+ $opt .= $this->hourOptionTag($tagName, null, false, $hour, $selectHourAttr, $optionAttr, $showEmpty) . ':' .
+ $this->minuteOptionTag($tagName, null, $min, $selectMinuteAttr, $optionAttr, $showEmpty) . ' ' .
+ $this->meridianOptionTag($tagName, null, $meridian, $selectMeridianAttr, $optionAttr, $showEmpty);
+ break;
+ case 'NONE':
+ default:
+ $opt .= '';
+ break;
+ }
+ return $opt;
+ }
+/**
+ * Returns a row of formatted and named TABLE headers.
+ *
+ * @param array $names Array of tablenames.
+ * @param array $trOptions HTML options for TR elements.
+ * @param array $thOptions HTML options for TH elements.
+ * @param boolean $return Wheter this method should return a value
+ * @return string
+ * @access public
+ */
+ function tableHeaders($names, $trOptions = null, $thOptions = null, $return = false) {
+ $out = array();
+ foreach ($names as $arg) {
+ $out[] = sprintf($this->tags['tableheader'], $this->parseHtmlOptions($thOptions), $arg);
+ }
+
+ $data = sprintf($this->tags['tablerow'], $this->parseHtmlOptions($trOptions), join(' ', $out));
+ return $this->output($data, $return);
+ }
+/**
+ * Returns a formatted string of table rows (TR's with TD's in them).
+ *
+ * @param array $data Array of table data
+ * @param array $oddTrOptionsHTML options for odd TR elements
+ * @param array $evenTrOptionsHTML options for even TR elements
+ * @param boolean $return Wheter this method should return a value
+ * @return string Formatted HTML
+ * @access public
+ */
+ function tableCells($data, $oddTrOptions = null, $evenTrOptions = null, $return = false) {
+ if (empty($data[0]) || !is_array($data[0])) {
+ $data = array($data);
+ }
+ static $count = 0;
+
+ foreach ($data as $line) {
+ $count++;
+ $cellsOut = array();
+
+ foreach ($line as $cell) {
+ $cellsOut[] = sprintf($this->tags['tablecell'], null, $cell);
+ }
+ $options = $this->parseHtmlOptions($count % 2 ? $oddTrOptions : $evenTrOptions);
+ $out[] = sprintf($this->tags['tablerow'], $options, join(' ', $cellsOut));
+ }
+ return $this->output(join("\n", $out), $return);
+ }
+/**
+ * Generates a nested unordered list tree from an array.
+ *
+ * @param array $data
+ * @param array $htmlAttributes
+ * @param string $bodyKey
+ * @param string $childrenKey
+ * @param boolean $return Wheter this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return mixed Either string or echos the value, depends on AUTO_OUTPUT and $return. If $this->_crumbs is empty, return null.
+ * @access public
+ */
+ function guiListTree($data, $htmlAttributes = array(), $bodyKey = 'body', $childrenKey = 'children', $return = false) {
+ $out="_parseAttributes($htmlAttributes) . ">\n";
+ foreach ($data as $item) {
+ $out .= "{$item[$bodyKey]}\n";
+ if (isset($item[$childrenKey]) && is_array($item[$childrenKey]) && count($item[$childrenKey])) {
+ $out .= $this->guiListTree($item[$childrenKey], $htmlAttributes, $bodyKey, $childrenKey);
+ }
+ $out .= " \n";
+ }
+ $out .= " \n";
+ return $this->output($out, $return);
+ }
+/**
+ * Returns value of $fieldName. False if the tag does not exist.
+ *
+ * @param string $fieldName Fieldname as "Modelname/fieldname" string
+ * @return string htmlspecialchars Value of the named tag.
+ * @access public
+ */
+ function tagValue($fieldName, $escape = false) {
+ $this->setFormTag($fieldName);
+ if (isset($this->params['data'][$this->model][$this->field])) {
+ return ife($escape, h($this->params['data'][$this->model][$this->field]), $this->params['data'][$this->model][$this->field]);
+ } elseif (isset($this->data[$this->model][$this->field])) {
+ return ife($escape, h($this->data[$this->model][$this->field]), $this->data[$this->model][$this->field]);
+ }
+ return false;
+ }
+/**
+ * Returns false if given FORM field has no errors. Otherwise it returns the constant set in the array Model->validationErrors.
+ *
+ * @param string $model Model name as string
+ * @param string $field Fieldname as string
+ * @return boolean True on errors.
+ * @access public
+ */
+ function tagIsInvalid($model, $field) {
+ return empty($this->validationErrors[$model][$field]) ? 0 : $this->validationErrors[$model][$field];
+ }
+/**
+ * Returns number of errors in a submitted FORM.
+ *
+ * @return int Number of errors
+ * @access public
+ */
+ function validate() {
+ $args = func_get_args();
+ $errors = call_user_func_array(array(&$this, 'validateErrors'), $args);
+ return count($errors);
+ }
+/**
+ * Validates a FORM according to the rules set up in the Model.
+ *
+ * @return int Number of errors
+ * @access public
+ */
+ function validateErrors() {
+ $objects = func_get_args();
+ if (!count($objects)) {
+ return false;
+ }
+
+ $errors = array();
+ foreach ($objects as $object) {
+ $errors = array_merge($errors, $object->invalidFields($object->data));
+ }
+ return $this->validationErrors = (count($errors) ? $errors : false);
+ }
+/**
+ * Returns a formatted error message for given FORM field, NULL if no errors.
+ *
+ * @param string $field A field name, like "Modelname/fieldname"
+ * @param string $text Error message
+ * @return string If there are errors this method returns an error message, else NULL.
+ * @access public
+ */
+ function tagErrorMsg($field, $text) {
+ $error = 1;
+ $this->setFormTag($field);
+ if ($error == $this->tagIsInvalid($this->model, $this->field)) {
+ return sprintf('%s
', is_array($text) ? (empty($text[$error - 1]) ? 'Error in field' : $text[$error - 1]) : $text);
+ } else {
+ return null;
+ }
+ }
+/**
+ * Sets this helper's model and field properties to the slash-separated value-pair in $tagValue.
+ *
+ * @param string $tagValue A field name, like "Modelname/fieldname"
+ * @return
+ * @access public
+ */
+ function setFormTag($tagValue) {
+ return list($this->model, $this->field) = explode("/", $tagValue);
+ }
+/**
+ * Returns a space-delimited string with items of the $options array. If a
+ * key of $options array happens to be one of:
+ * + 'compact'
+ * + 'checked'
+ * + 'declare'
+ * + 'readonly'
+ * + 'disabled'
+ * + 'selected'
+ * + 'defer'
+ * + 'ismap'
+ * + 'nohref'
+ * + 'noshade'
+ * + 'nowrap'
+ * + 'multiple'
+ * + 'noresize'
+ *
+ * And its value is one of:
+ * + 1
+ * + true
+ * + 'true'
+ *
+ * Then the value will be reset to be identical with key's name.
+ * If the value is not one of these 3, the parameter is not output.
+ *
+ * @param array $options Array of options.
+ * @param array $exclude Array of options to be excluded.
+ * @param string $insertBefore String to be inserted before options.
+ * @param string $insertAfter String to be inserted ater options.
+ * @return string
+ * @access protected
+ */
+ function _parseAttributes($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
+ if (is_array($options)) {
+ $default = array (
+ 'escape' => true
+ );
+ $options = am($default, $options);
+ if (!is_array($exclude)) {
+ $exclude = array();
+ }
+ $exclude = am($exclude, array('escape'));
+ $keys = array_diff(array_keys($options), $exclude);
+ $values = array_intersect_key(array_values($options), $keys);
+ $escape = $options['escape'];
+ $attributes = array();
+ foreach ($keys as $index => $key) {
+ $attributes[] = $this->__formatAttribute($key, $values[$index], $escape);
+ }
+ $out = implode(' ', $attributes);
+ } else {
+ $out = $options;
+ }
+ return $out ? $insertBefore . $out . $insertAfter : '';
+ }
+/**
+ * @param string $key
+ * @param string $value
+ * @return string
+ * @access private
+ */
+ function __formatAttribute($key, $value, $escape = true) {
+ $attribute = '';
+ $attributeFormat = '%s="%s"';
+ $minimizedAttributes = array('compact', 'checked', 'declare', 'readonly', 'disabled', 'selected', 'defer', 'ismap', 'nohref', 'noshade', 'nowrap', 'multiple', 'noresize');
+
+ if (in_array($key, $minimizedAttributes)) {
+ if ($value === 1 || $value === true || $value === 'true' || $value == $key) {
+ $attribute = sprintf($attributeFormat, $key, $key);
+ }
+ } else {
+ $attribute = sprintf($attributeFormat, $key, ife($escape, h($value), $value));
+ }
+ return $attribute;
+ }
+/**
+ * @deprecated Name changed to 'textarea'. Version 0.9.2.
+ * @see HtmlHelper::textarea()
+ */
+ function areaTag($tagName, $cols = 60, $rows = 10, $htmlAttributes = array(), $return = false) {
+ $htmlAttributes['cols']=$cols;
+ $htmlAttributes['rows']=$rows;
+ return $this->textarea($tagName, $htmlAttributes, $return);
+ }
+/**
+ * @deprecated Name changed to 'charset'. Version 0.9.2.
+ * @see HtmlHelper::charset()
+ */
+ function charsetTag($charset, $return = false) {
+ return $this->charset($charset, $return);
+ }
+/**
+ * @deprecated Name changed to 'checkbox'. Version 0.9.2.
+ * @see HtmlHelper::checkbox()
+ */
+ function checkboxTag($fieldName, $title = null, $htmlAttributes = array(), $return = false) {
+ return $this->checkbox($fieldName, $title, $htmlAttributes, $return);
+ }
+/**
+ * @deprecated Name changed to 'css'. Version 0.9.2.
+ * @see HtmlHelper::css()
+ */
+ function cssTag($path, $rel = 'stylesheet', $htmlAttributes = array(), $return = false) {
+ return $this->css($path, $rel, $htmlAttributes, $return);
+ }
+/**
+ * @deprecated Name changed to 'file'. Version 0.9.2.
+ * @see HtmlHelper::file()
+ */
+ function fileTag($fieldName, $htmlAttributes = array(), $return = false) {
+ return $this->file($fieldName, $htmlAttributes, $return);
+ }
+/**
+ * @deprecated Name changed to 'hidden'. Version 0.9.2.
+ * @see HtmlHelper::hidden()
+ */
+ function hiddenTag($tagName, $value = null, $htmlOptions = null) {
+ $this->setFormTag($tagName);
+ $htmlOptions['value'] = $value ? $value : $this->tagValue($tagName);
+ return $this->output(sprintf($this->tags['hidden'], $this->model, $this->field, $this->parseHtmlOptions($htmlOptions, null, '', ' ')));
+ }
+/**
+ * @deprecated Name changed to 'image'. Version 0.9.2.
+ * @see HtmlHelper::image()
+ */
+ function imageTag($path, $alt = null, $htmlAttributes = array(), $return = false) {
+ $htmlAttributes['alt'] = $alt;
+ return $this->image($path, $htmlAttributes, $return);
+ }
+/**
+ * @deprecated Name changed to 'input'. Version 0.9.2.
+ * @see HtmlHelper::input()
+ */
+ function inputTag($tagName, $size = 20, $htmlOptions = null) {
+ $this->setFormTag($tagName);
+ $htmlOptions['value'] = isset($htmlOptions['value']) ? $htmlOptions['value'] : $this->tagValue($tagName);
+ $this->tagIsInvalid($this->model, $this->field) ? $htmlOptions['class'] = 'form_error' : null;
+ return $this->output(sprintf($this->tags['input'], $this->model, $this->field, $this->parseHtmlOptions($htmlOptions, null, '', ' ')));
+ }
+/**
+ * @deprecated Unified with 'link'. Version 0.9.2.
+ * @see HtmlHelper::link()
+ */
+ function linkOut($title, $url = null, $htmlAttributes = array(), $escapeTitle = true, $return = false) {
+ return $this->link($title, $url, $htmlAttributes, false, $escapeTitle, $return);
+ }
+/**
+ * @deprecated Unified with 'link'. Version 0.9.2.
+ * @see HtmlHelper::link()
+ */
+ function linkTo($title, $url, $htmlAttributes = array(), $confirmMessage = false, $escapeTitle = true, $return = false) {
+ return $this->link($title, $url, $htmlAttributes, $confirmMessage, $escapeTitle, $return);
+ }
+/**
+ * @deprecated Name changed to '_parseAttributes'. Version 0.9.2.
+ * @see HtmlHelper::_parseAttributes()
+ */
+ function parseHtmlOptions($options, $exclude = null, $insertBefore = ' ', $insertAfter = null) {
+ if (!is_array($exclude))
+ $exclude=array();
+
+ if (is_array($options)) {
+ $out=array();
+
+ foreach ($options as $k => $v) {
+ if (!in_array($k, $exclude)) {
+ $out[] = "{$k}=\"{$v}\"";
+ }
+ }
+ $out = join(' ', $out);
+ return $out ? $insertBefore . $out . $insertAfter : null;
+ } else {
+ return $options ? $insertBefore . $options . $insertAfter : null;
+ }
+ }
+/**
+ * @deprecated Name changed to 'password'. Version 0.9.2.
+ * @see HtmlHelper::password()
+ */
+ function passwordTag($fieldName, $size = 20, $htmlAttributes = array(), $return = false) {
+ $args = func_get_args();
+ return call_user_func_array(array(&$this,
+ "password"), $args);
+ }
+/**
+ * @deprecated Name changed to 'radio'. Version 0.9.2.
+ * @see HtmlHelper::radio()
+ */
+ function radioTags($fieldName, $options, $inbetween = null, $htmlAttributes = array(), $return = false) {
+ return $this->radio($fieldName, $options, $inbetween, $htmlAttributes, $return);
+ }
+/**
+ * @deprecated Name changed to 'url'. Version 0.9.2.
+ * @see HtmlHelper::url()
+ */
+ function urlFor($url) {
+ return $this->url($url);
+ }
+/**
+ * @deprecated Name changed to 'submit'. Version 0.9.2.
+ * @see HtmlHelper::submit()
+ */
+ function submitTag() {
+ $args = func_get_args();
+ return call_user_func_array(array(&$this, "submit"), $args);
+ }
+/*************************************************************************
+ * Moved methods
+ *************************************************************************/
+/**
+ * @deprecated Moved to TextHelper. Version 0.9.2.
+ */
+ function trim() {
+ die("Method HtmlHelper::trim() was moved to TextHelper::trim().");
+ }
+/**
+ * @deprecated Moved to JavascriptHelper. Version 0.9.2.
+ */
+ function javascriptIncludeTag($url) {
+ die("Method HtmlHelper::javascriptIncludeTag() was moved to JavascriptHelper::link().");
+ }
+/**
+ * @deprecated Moved to JavascriptHelper. Version 0.9.2.
+ */
+ function javascriptTag($script) {
+ die("Method HtmlHelper::javascriptTag() was moved to JavascriptHelper::codeBlock().");
+ }
+/**
+ * This is very WYSIWYG unfriendly, use HtmlHelper::url() to get contents of "action" attribute. Version 0.9.2.
+ * @deprecated Version 0.9.2. Will not be available after 1.1.x.x
+ * @see FormHelper::create()
+ */
+ function formTag($target = null, $type = 'post', $htmlAttributes = array()) {
+ $htmlAttributes['action']=$this->urlFor ($target);
+ $htmlAttributes['method']=$type == 'get' ? 'get' : 'post';
+ $type == 'file' ? $htmlAttributes['enctype'] = 'multipart/form-data' : null;
+
+ $append = '';
+
+ if (isset($this->params['_Token']) && !empty($this->params['_Token'])) {
+ $append .= '';
+ $append .= $this->hidden('_Token/key', array('value' => $this->params['_Token']['key'], 'id' => '_TokenKey' . mt_rand()), true);
+ $append .= '
';
+ }
+
+ return sprintf($this->tags['form'], $this->parseHtmlOptions($htmlAttributes, null, '')) . $append;
+ }
+/**
+ * This should be done using a content filter.
+ * @deprecated Version 0.9.2. Will not be available after 1.1.x.x
+ */
+ function linkEmail($title, $email = null, $options = null) {
+ // if no $email, then title contains the email.
+ if (empty($email))
+ $email=$title;
+
+ $match=array();
+
+ // does the address contain extra attributes?
+ preg_match('!^(.*)(\?.*)$!', $email, $match);
+
+ // plaintext
+ if (empty($options['encode']) || !empty($match[2])) {
+ return sprintf($this->tags['mailto'], $email, $this->parseHtmlOptions($options), $title);
+ }
+ // encoded to avoid spiders
+ else {
+ $email_encoded=null;
+
+ for ($ii = 0; $ii < strlen($email); $ii++) {
+ if (preg_match('!\w!', $email[$ii])) {
+ $email_encoded .= '%' . bin2hex($email[$ii]);
+ } else {
+ $email_encoded .= $email[$ii];
+ }
+ }
+
+ $title_encoded=null;
+
+ for ($ii = 0; $ii < strlen($title); $ii++) {
+ $title_encoded .= preg_match('/^[A-Za-z0-9]$/', $title[$ii])
+ ? '' . bin2hex($title[$ii]) . ';' : $title[$ii];
+ }
+
+ return sprintf($this->tags['mailto'], $email_encoded,
+ $this->parseHtmlOptions($options, array('encode')), $title_encoded);
+ }
+ }
+
+/**
+ * @deprecated Version 0.9.2. Will not be available after 1.1.x.x
+ */
+ function tag($name, $options = null, $open = false) {
+ $tag = "<$name " . $this->parseHtmlOptions($options);
+ $tag .= $open ? ">" : " />";
+ return $tag;
+ }
+/**
+ * @deprecated Version 0.9.2. Will not be available after 1.1.x.x
+ */
+ function contentTag($name, $content, $options = null) {
+ return "<$name " . $this->parseHtmlOptions($options) . ">$content$name>";
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/javascript.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/javascript.php
new file mode 100644
index 0000000..1219987
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/javascript.php
@@ -0,0 +1,317 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Javascript Helper class for easy use of JavaScript.
+ *
+ * JavascriptHelper encloses all methods needed while working with JavaScript.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class JavascriptHelper extends Helper{
+ var $_cachedEvents = array();
+ var $_cacheEvents = false;
+ var $_cacheToFile = false;
+ var $_cacheAll = false;
+ var $_rules = array();
+/**
+ * Returns a JavaScript script tag.
+ *
+ * @param string $script The JavaScript to be wrapped in SCRIPT tags.
+ * @param boolean $allowCache Allows the script to be cached if non-event caching is active
+ * @return string The full SCRIPT element, with the JavaScript inside it.
+ * @access public
+ */
+ function codeBlock($script, $allowCache = true) {
+ if ($this->_cacheEvents && $this->_cacheAll && $allowCache) {
+ $this->_cachedEvents[] = $script;
+ } else {
+ return sprintf($this->tags['javascriptblock'], $script);
+ }
+ }
+/**
+ * Returns a JavaScript include tag (SCRIPT element)
+ *
+ * @param string $url URL to JavaScript file.
+ * @return string
+ * @access public
+ */
+ function link($url) {
+ if (strpos($url, '.js') === false) {
+ $url .= ".js";
+ }
+ return sprintf($this->tags['javascriptlink'], $this->webroot . $this->themeWeb . JS_URL . $url);
+ }
+/**
+ * Returns a JavaScript include tag for an externally-hosted script
+ *
+ * @param string $url URL to JavaScript file.
+ * @return string
+ * @access public
+ */
+ function linkOut($url) {
+ if (strpos($url, '.js') === false && strpos($url, '?') === false) {
+ $url .= '.js';
+ }
+ return sprintf($this->tags['javascriptlink'], $url);
+ }
+/**
+ * Escape carriage returns and single and double quotes for JavaScript segments.
+ *
+ * @param string $script string that might have javascript elements
+ * @return string escaped string
+ * @access public
+ */
+ function escapeScript($script) {
+ $script = r(array("\r\n", "\n", "\r"), '\n', $script);
+ $script = r(array('"', "'"), array('\"', "\\'"), $script);
+ return $script;
+ }
+/**
+ * Escape a string to be JavaScript friendly.
+ *
+ * List of escaped ellements:
+ * + "\r\n" => '\n'
+ * + "\r" => '\n'
+ * + "\n" => '\n'
+ * + '"' => '\"'
+ * + "'" => "\\'"
+ *
+ * @param string $script String that needs to get escaped.
+ * @return string Escaped string.
+ * @access public
+ */
+ function escapeString($string) {
+ $escape = array("\r\n" => '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'");
+ return r(array_keys($escape), array_values($escape), $string);
+ }
+/**
+ * Attach an event to an element. Used with the Prototype library.
+ *
+ * @param string $object Object to be observed
+ * @param string $event event to observe
+ * @param string $observer function to call
+ * @param boolean $useCapture default true
+ * @return boolean true on success
+ * @access public
+ */
+ function event($object, $event, $observer = null, $useCapture = false) {
+
+ if ($useCapture == true) {
+ $useCapture = "true";
+ } else {
+ $useCapture = "false";
+ }
+
+ if ($object == 'window' || strpos($object, '$(') !== false || strpos($object, '"') !== false || strpos($object, '\'') !== false) {
+ $b = "Event.observe($object, '$event', function(event) { $observer }, $useCapture);";
+ } else {
+ $chars = array('#', ' ', ', ', '.', ':');
+ $found = false;
+ foreach ($chars as $char) {
+ if (strpos($object, $char) !== false) {
+ $found = true;
+ break;
+ }
+ }
+ if ($found) {
+ $this->_rules[$object] = $event;
+ } else {
+ $b = "Event.observe(\$('$object'), '$event', function(event) { $observer }, $useCapture);";
+ }
+ }
+
+ if (isset($b) && !empty($b)) {
+ if ($this->_cacheEvents === true) {
+ $this->_cachedEvents[] = $b;
+ return;
+ } else {
+ return $this->codeBlock($b);
+ }
+ }
+ }
+/**
+ * Cache JavaScript events created with event()
+ *
+ * @param boolean $file If true, code will be written to a file
+ * @param boolean $all If true, all code written with JavascriptHelper will be sent to a file
+ * @return void
+ * @access public
+ */
+ function cacheEvents($file = false, $all = false) {
+ $this->_cacheEvents = true;
+ $this->_cacheToFile = $file;
+ $this->_cacheAll = $all;
+ }
+/**
+ * Write cached JavaScript events
+ *
+ * @return string
+ * @access public
+ */
+ function writeEvents() {
+
+ $rules = array();
+ if (!empty($this->_rules)) {
+ foreach ($this->_rules as $sel => $event) {
+ $rules[] = "\t'{$sel}': function(element, event) {\n\t\t{$event}\n\t}";
+ }
+ $this->_cacheEvents = true;
+ }
+
+ if ($this->_cacheEvents) {
+
+ $this->_cacheEvents = false;
+ $events = $this->_cachedEvents;
+ $data = implode("\n", $events);
+ $this->_cachedEvents = array();
+
+ if (!empty($rules)) {
+ $data .= "\n\nvar SelectorRules = {\n" . implode(",\n\n", $rules) . "\n}\n";
+ $data .= "\nEventSelectors.start(SelectorRules);\n";
+ }
+
+ if (!empty($events) || !empty($rules)) {
+ if ($this->_cacheToFile) {
+ $filename = md5($data);
+ if (!file_exists(JS . $filename . '.js')) {
+ cache(r(WWW_ROOT, '', JS) . $filename . '.js', $data, '+999 days', 'public');
+ }
+ return $this->link($filename);
+ } else {
+ return $this->codeBlock("\n" . $data . "\n");
+ }
+ }
+ }
+ }
+/**
+ * Includes the Prototype Javascript library (and anything else) inside a single script tag.
+ *
+ * Note: The recommended approach is to copy the contents of
+ * javascripts into your application's
+ * public/javascripts/ directory, and use @see javascriptIncludeTag() to
+ * create remote script links.
+ *
+ * @param string $script name of script to include
+ * @return string script with all javascript in/javascripts folder
+ * @access public
+ */
+ function includeScript($script = "") {
+ if ($script == "") {
+ $dh = opendir(JS);
+ while (false !== ($filename = readdir($dh))) {
+ $files[] = $filename;
+ }
+ sort($files);
+ $javascript = '';
+ foreach ($files as $file) {
+ if (substr($file, -3) == '.js') {
+ $javascript .= file_get_contents(JS . "{$file}") . "\n\n";
+ }
+ }
+ } else {
+ $javascript = file_get_contents(JS . "$script.js") . "\n\n";
+ }
+ return $this->codeBlock("\n\n" . $javascript);
+ }
+/**
+ * Generates a JavaScript object in JavaScript Object Notation (JSON)
+ * from an array
+ *
+ * @param array $data Data to be converted
+ * @param boolean $block Wraps return value in a block if true
+ * @param string $prefix Prepends the string to the returned data
+ * @param string $postfix Appends the string to the returned data
+ * @param array $stringKeys A list of array keys to be treated as a string
+ * @param boolean $quoteKeys If false, treats $stringKey as a list of keys *not* to be quoted
+ * @param string $q The type of quote to use
+ * @return string A JSON code block
+ * @access public
+ */
+ function object($data = array(), $block = false, $prefix = '', $postfix = '', $stringKeys = array(), $quoteKeys = true, $q = "\"") {
+ if (is_object($data)) {
+ $data = get_object_vars($data);
+ }
+
+ $out = array();
+ $key = array();
+
+ if (is_array($data)) {
+ $keys = array_keys($data);
+ }
+
+ $numeric = true;
+ if (!empty($keys)) {
+ $numeric = (array_values($keys) === array_keys(array_values($keys)));
+ }
+
+ foreach ($data as $key => $val) {
+ if (is_array($val) || is_object($val)) {
+ $val = $this->object($val, false, '', '', $stringKeys, $quoteKeys, $q);
+ } else {
+ if ((!count($stringKeys) && !is_numeric($val) && !is_bool($val)) || ($quoteKeys && in_array($key, $stringKeys, true)) || (!$quoteKeys && !in_array($key, $stringKeys, true))) {
+ $val = $q . $this->escapeString($val) . $q;
+ }
+ if ($val === null) {
+ $val = 'null';
+ }
+ if (is_bool($val)) {
+ $val = ife($val, 'true', 'false');
+ }
+ }
+
+ if (!$numeric) {
+ $val = $q . $key . $q . ':' . $val;
+ }
+
+ $out[] = $val;
+ }
+
+ if (!$numeric) {
+ $rt = '{' . join(', ', $out) . '}';
+ } else {
+ $rt = '[' . join(', ', $out) . ']';
+ }
+ $rt = $prefix . $rt . $postfix;
+
+ if ($block) {
+ $rt = $this->codeBlock($rt);
+ }
+
+ return $rt;
+ }
+/**
+ * AfterRender callback. Writes any cached events to the view, or to a temp file.
+ *
+ * @return void
+ * @access public
+ */
+ function afterRender() {
+ echo $this->writeEvents();
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/number.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/number.php
new file mode 100644
index 0000000..3d8ea8e
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/number.php
@@ -0,0 +1,88 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Number helper library.
+ *
+ * Methods to make numbers more readable.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class NumberHelper extends Helper {
+/**
+ * Formats a number with a level of precision.
+ *
+ * @param float $number A floating point number.
+ * @param integer $precision The precision of the returned number.
+ * @return float Enter description here...
+ * @access public
+ */
+ function precision($number, $precision = 3) {
+ return sprintf("%01.{$precision}f", $number);
+ }
+
+/**
+ * Returns a formatted-for-humans file size.
+ *
+ * @param integer $length Size in bytes
+ * @return string Human readable size
+ * @access public
+ */
+ function toReadableSize($size) {
+ switch($size) {
+ case 0:
+ return '0 Bytes';
+ case 1:
+ return '1 Byte';
+ case $size < 1024:
+ return $size . ' Bytes';
+ case $size < 1024 * 1024:
+ return NumberHelper::precision($size / 1024, 0) . ' KB';
+ case $size < 1024 * 1024 * 1024:
+ return NumberHelper::precision($size / 1024 / 1024, 2) . ' MB';
+ case $size < 1024 * 1024 * 1024 * 1024:
+ return NumberHelper::precision($size / 1024 / 1024 / 1024, 2) . ' GB';
+ case $size < 1024 * 1024 * 1024 * 1024 * 1024:
+ return NumberHelper::precision($size / 1024 / 1024 / 1024 / 1024, 2) . ' TB';
+ }
+ }
+
+/**
+ * Formats a number into a percentage string.
+ *
+ * @param float $number A floating point number
+ * @param integer $precision The precision of the returned number
+ * @return string Percentage string
+ * @access public
+ */
+ function toPercentage($number, $precision = 2) {
+ return NumberHelper::precision($number, $precision) . '%';
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/session.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/session.php
new file mode 100644
index 0000000..77eee9a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/session.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.libs.view.helpers
+ * @since CakePHP(tm) v 1.1.7.3328
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Session Helper.
+ *
+ * Session reading from the view.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ *
+ */
+if(!class_exists('cakesession')) {
+ uses('session');
+}
+class SessionHelper extends CakeSession {
+/**
+ * List of helpers used by this helper
+ *
+ * @var array
+ */
+ var $helpers = null;
+/**
+ * Used to determine if methods implementation is used, or bypassed
+ *
+ * @var boolean
+ */
+ var $__active = true;
+/**
+ * Class constructor
+ *
+ * @param string $base
+ */
+ function __construct($base = null) {
+ if (!defined('AUTO_SESSION') || AUTO_SESSION === true) {
+ parent::__construct($base, false);
+ } else {
+ $this->__active = false;
+ }
+ }
+/**
+ * Turn sessions on if 'Session.start' is set to false in core.php
+ *
+ * @param string $base
+ */
+ function activate($base = null) {
+ $this->__active = true;
+ }
+/**
+ * Used to read a session values set in a controller for a key or return values for all keys.
+ *
+ * In your view: $session->read('Controller.sessKey');
+ * Calling the method without a param will return all session vars
+ *
+ * @param string $name the name of the session key you want to read
+ *
+ * @return values from the session vars
+ * @access public
+ */
+ function read($name = null) {
+ if ($this->__active === true && $this->__start()) {
+ return parent::read($name);
+ }
+ return false;
+ }
+/**
+ * Used to check is a session key has been set
+ *
+ * In your view: $session->check('Controller.sessKey');
+ *
+ * @param string $name
+ * @return boolean
+ * @access public
+ */
+ function check($name) {
+ if ($this->__active === true && $this->__start()) {
+ return parent::check($name);
+ }
+ return false;
+ }
+/**
+ * Returns last error encountered in a session
+ *
+ * In your view: $session->error();
+ *
+ * @return string last error
+ * @access public
+ */
+ function error() {
+ if ($this->__active === true && $this->__start()) {
+ return parent::error();
+ }
+ return false;
+ }
+/**
+ * Used to render the message set in Controller::Session::setFlash()
+ *
+ * In your view: $session->flash('somekey');
+ * Will default to flash if no param is passed
+ *
+ * @param string $key The [Message.]key you are rendering in the view.
+ * @return string Will echo the value if $key is set, or false if not set.
+ * @access public
+ */
+ function flash($key = 'flash') {
+ if ($this->__active === true && $this->__start()) {
+ if (parent::check('Message.' . $key)) {
+ $flash = parent::read('Message.' . $key);
+
+ if ($flash['layout'] == 'default') {
+ $out = '' . $flash['message'] . '
';
+ } elseif ($flash['layout'] == '' || $flash['layout'] == null) {
+ $out = $flash['message'];
+ } else {
+ $view =& ClassRegistry::getObject('view');
+ list($tmpLayout, $tmpVars, $tmpTitle) = array($view->layout, $view->viewVars, $view->pageTitle);
+ list($view->layout, $view->viewVars, $view->pageTitle) = array($flash['layout'], $flash['params'], '');
+ $out = $view->renderLayout($flash['message']);
+ list($view->layout, $view->viewVars, $view->pageTitle) = array($tmpLayout, $tmpVars, $tmpTitle);
+ }
+ e($out);
+ parent::del('Message.' . $key);
+ return true;
+ }
+ }
+ return false;
+ }
+/**
+ * Used to check is a session is valid in a view
+ *
+ * @return boolean
+ * @access public
+ */
+ function valid() {
+ if ($this->__active === true && $this->__start()) {
+ return parent::valid();
+ }
+ }
+/**
+ * Override CakeSession::write().
+ * This method should not be used in a view
+ *
+ * @return boolean
+ * @access public
+ */
+ function write() {
+ trigger_error(__('You can not write to a Session from the view', true), E_USER_WARNING);
+ }
+/**
+ * Session id
+ *
+ * @return string Session id
+ * @access public
+ */
+ function id() {
+ return parent::id();
+ }
+/**
+ * Determine if Session has been started
+ * and attempt to start it if not
+ *
+ * @return boolean true if Session is already started, false if
+ * Session could not be started
+ * @access public
+ */
+ function __start() {
+ if(!parent::started()) {
+ parent::start();
+ }
+ return true;
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/text.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/text.php
new file mode 100644
index 0000000..c545f3c
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/text.php
@@ -0,0 +1,238 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Included libraries.
+ *
+ */
+if (!class_exists('Flay')) {
+ uses('flay');
+}
+if (!class_exists('HtmlHelper')) {
+ uses('view' . DS . 'helpers' . DS . 'html');
+}
+/**
+ * Text helper library.
+ *
+ * Text manipulations: Highlight, excerpt, truncate, strip of links, convert email addresses to mailto: links...
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class TextHelper extends Helper{
+/**
+ * Highlights a given phrase in a text.
+ *
+ * @param string $text Text to search the phrase in
+ * @param string $phrase The phrase that will be searched
+ * @param string $highlighter The piece of html with that the phrase will be highlighted
+ * @return string The highlighted text
+ * @access public
+ */
+ function highlight($text, $phrase, $highlighter = '\1 ') {
+ if (empty($phrase))
+ return $text;
+
+ if (is_array($phrase)) {
+ $replace=array();
+ $with=array();
+
+ foreach ($phrase as $key => $value) {
+ if (empty($key)) {
+ $key =$value;
+ $value=$highlighter;
+ }
+
+ $replace[]='|(' . $key . ')|i';
+ $with[]=empty($value) ? $highlighter : $value;
+ }
+
+ return preg_replace($replace, $with, $text);
+ } else {
+ return preg_replace("|({$phrase})|i", $highlighter, $text);
+ }
+ }
+/**
+ * Strips given text of all links ((.*)<\/a>|im', '\1', $text);
+ }
+/**
+ * Adds links ( $value) {
+ $options .= "'$option' => '$value', ";
+ }
+
+ $options .= ')';
+
+ $text = preg_replace_callback('#(?)((?:http|https|ftp|nntp)://[^ <]+)#i',
+ create_function('$matches',
+ '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $options . ');'),
+ $text);
+ return preg_replace_callback('#(?)(?tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . $matches[0],' . $options . ');'),
+ $text);
+ }
+/**
+ * Adds email links ( '$value', ";
+ }
+
+ $options .= ')';
+
+ return preg_replace_callback(
+ '#([_A-Za-z0-9+-]+(?:\.[_A-Za-z0-9+-]+)*@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*)#',
+ create_function('$matches',
+ '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->linkEmail($matches[0], $matches[0],' . $options . ');'),
+ $text);
+ }
+/**
+ * Convert all links and email adresses to HTML links.
+ *
+ * @param string $text Text
+ * @param array $htmlOptions Array of HTML options.
+ * @return string The text with links
+ * @access public
+ */
+ function autoLink($text, $htmlOptions = array()) {
+ return $this->autoLinkEmails($this->autoLinkUrls($text, $htmlOptions), $htmlOptions);
+ }
+/**
+ * Truncates text.
+ *
+ * Cuts a string to the length of $length and replaces the last characters
+ * with the ending if the text is longer than length.
+ *
+ * @param string $text String to truncate.
+ * @param integer $length Length of returned string, including ellipsis.
+ * @param string $ending Ending to be appended to the trimmed string.
+ * @param boolean $exact If false, $test will not be cut mid-word
+ * @return string Trimmed string.
+ * @access public
+ */
+ function truncate($text, $length, $ending = '...', $exact = true) {
+ if (strlen($text) <= $length) {
+ return $text;
+ } else {
+ $truncate=substr($text, 0, $length - strlen($ending));
+
+ if (!$exact) {
+ $spacepos=strrpos($truncate, ' ');
+
+ if (isset($spacepos)) {
+ return substr($truncate, 0, $spacepos) . $ending;
+ }
+ }
+
+ return $truncate . $ending;
+ }
+ }
+/**
+ * Alias for truncate().
+ *
+ * @see TextHelper::truncate()
+ * @return Text::truncate()
+ * @access public
+ */
+ function trim() {
+ $args=func_get_args();
+ return call_user_func_array(array(&$this,
+ "truncate"), $args);
+ }
+/**
+ * Extracts an excerpt from the text surrounding the phrase with a number of characters on each side determined by radius.
+ *
+ * @param string $text String to search the phrase in
+ * @param string $phrase Phrase that will be searched for
+ * @param integer $radius The amount of characters that will be returned on each side of the founded phrase
+ * @param string $ending Ending that will be appended
+ * @return string
+ * @access public
+ */
+ function excerpt($text, $phrase, $radius = 100, $ending = "...") {
+ if (empty($text) or empty($phrase))
+ return $this->truncate($text, $radius * 2, $ending);
+
+ if ($radius < strlen($phrase))
+ $radius=strlen($phrase);
+
+ $pos =strpos($text, $phrase);
+ $startPos=$pos <= $radius ? 0 : $pos - $radius;
+ $endPos =$pos + strlen($phrase) + $radius >= strlen($text)
+ ? strlen($text) : $pos + strlen($phrase) + $radius;
+
+ $excerpt =substr($text, $startPos, $endPos - $startPos);
+
+ if ($startPos != 0)
+ $excerpt=substr_replace($excerpt, $ending, 0, strlen($phrase));
+
+ if ($endPos != strlen($text))
+ $excerpt=substr_replace($excerpt, $ending, -strlen($phrase));
+
+ return $excerpt;
+ }
+/**
+ * Text-to-html parser, similar to Textile or RedCloth, only with a little different syntax.
+ *
+ * @param string $text String to "flay"
+ * @param boolean $allowHtml Set to true if if html is allowed
+ * @return string "Flayed" text
+ * @todo Change this. We need a real Textile parser.
+ * @access public
+ */
+ function flay($text, $allowHtml = false) {
+ return Flay::toHtml($text, false, $allowHtml);
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/time.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/time.php
new file mode 100644
index 0000000..f10cadb
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/helpers/time.php
@@ -0,0 +1,397 @@
+
+ * 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.libs.view.helpers
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Time Helper class for easy use of time data.
+ *
+ * Manipulation of time data.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view.helpers
+ */
+class TimeHelper extends Helper {
+/**
+ * Returns given string trimmed to given length, adding an ending (default: "..") if necessary.
+ *
+ * @param string $string String to trim
+ * @param integer $length Length of returned string, excluding ellipsis
+ * @param string $ending Ending to be appended after trimmed string
+ * @return string Trimmed string
+ * @access public
+ */
+ function trim($string, $length, $ending = '..') {
+ return substr($string, 0, $length) . (strlen($string) > $length ? $ending : null);
+ }
+/**
+ * Returns a UNIX timestamp, given either a UNIX timestamp or a valid strtotime() date string.
+ *
+ * @param string $date_string Datetime string
+ * @return string Formatted date string
+ * @access public
+ */
+ function fromString($date_string) {
+ if (is_integer($date_string) || is_numeric($date_string)) {
+ return intval($date_string);
+ } else {
+ return strtotime($date_string);
+ }
+ }
+/**
+ * Returns a nicely formatted date string for given Datetime string.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Formatted date string
+ * @access public
+ */
+ function nice($date_string = null, $return = false) {
+ if ($date_string != null) {
+ $date = $this->fromString($date_string);
+ } else {
+ $date = time();
+ }
+
+ $ret = date("D, M jS Y, H:i", $date);
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns a formatted descriptive date string for given datetime string.
+ *
+ * If the given date is today, the returned string could be "Today, 16:54".
+ * If the given date was yesterday, the returned string could be "Yesterday, 16:54".
+ * If $date_string's year is the current year, the returned string does not
+ * include mention of the year.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Described, relative date string
+ * @access public
+ */
+ function niceShort($date_string = null, $return = false) {
+ $date = $date_string ? $this->fromString($date_string) : time();
+ $y = $this->isThisYear($date) ? '' : ' Y';
+
+ if ($this->isToday($date)) {
+ $ret = "Today, " . date("H:i", $date);
+ } elseif ($this->wasYesterday($date)) {
+ $ret = "Yesterday, " . date("H:i", $date);
+ } else {
+ $ret = date("M jS{$y}, H:i", $date);
+ }
+
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns true if given datetime string is today.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return boolean True if datetime string is today
+ * @access public
+ */
+ function isToday($date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = date('Y-m-d', $date) == date('Y-m-d', time());
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns a partial SQL string to search for all records between two dates.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param string $end Datetime string or Unix timestamp
+ * @param string $field_name Name of database field to compare with
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Partial SQL string.
+ * @access public
+ */
+ function daysAsSql($begin, $end, $field_name, $return = false) {
+ $begin = $this->fromString($begin);
+ $end = $this->fromString($end);
+ $begin = date('Y-m-d', $begin) . ' 00:00:00';
+ $end = date('Y-m-d', $end) . ' 23:59:59';
+
+ return $this->output("($field_name >= '$begin') AND ($field_name <= '$end')", $return);
+ }
+/**
+ * Returns a partial SQL string to search for all records between two times
+ * occurring on the same day.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param string $field_name Name of database field to compare with
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Partial SQL string.
+ * @access public
+ */
+ function dayAsSql($date_string, $field_name, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = $this->daysAsSql($date_string, $date_string, $field_name);
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns true if given datetime string is within current year.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return boolean True if datetime string is within current year
+ * @access public
+ */
+ function isThisYear($date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = date('Y', $date) == date('Y', time());
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns true if given datetime string was yesterday.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return boolean True if datetime string was yesterday
+ * @access public
+ */
+ function wasYesterday($date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = date('Y-m-d', $date) == date('Y-m-d', strtotime('yesterday'));
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns true if given datetime string is tomorrow.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return boolean True if datetime string was yesterday
+ * @access public
+ */
+ function isTomorrow($date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = date('Y-m-d', $date) == date('Y-m-d', strtotime('tomorrow'));
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns a UNIX timestamp from a textual datetime description. Wrapper for PHP function strtotime().
+ *
+ * @param string $date_string Datetime string to be represented as a Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return int Unix timestamp
+ * @access public
+ */
+ function toUnix($date_string, $return = false) {
+ $ret = strtotime($date_string);
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns a date formatted for Atom RSS feeds.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Formatted date string
+ * @access public
+ */
+ function toAtom($date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = date('Y-m-d\TH:i:s\Z', $date);
+ return $this->output($ret, $return);
+ }
+/**
+ * Formats date for RSS feeds
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Formatted date string
+ * @access public
+ */
+ function toRSS($date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $ret = date("r", $date);
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns either a relative date or a formatted date depending
+ * on the difference between the current time and given datetime.
+ * $datetime should be in a strtotime -parsable format, like MySQL's datetime datatype.
+ *
+ * Relative dates look something like this:
+ * 3 weeks, 4 days ago
+ * 15 seconds ago
+ * Formatted dates look like this:
+ * on 02/18/2004
+ *
+ * The returned string includes 'ago' or 'on' and assumes you'll properly add a word
+ * like 'Posted ' before the function output.
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param string $format Default format if timestamp is used in $date_string
+ * @param string $backwards False if $date_string is in the past, true if in the future
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Relative time string.
+ * @access public
+ */
+ function timeAgoInWords($datetime_string, $format = 'j/n/y', $backwards = false, $return = false) {
+ $datetime = $this->fromString($datetime_string);
+
+ $in_seconds = $datetime;
+ if ($backwards) {
+ $diff = $in_seconds - time();
+ } else {
+ $diff = time() - $in_seconds;
+ }
+
+ $months = floor($diff / 2419200);
+ $diff -= $months * 2419200;
+ $weeks = floor($diff / 604800);
+ $diff -= $weeks * 604800;
+ $days = floor($diff / 86400);
+ $diff -= $days * 86400;
+ $hours = floor($diff / 3600);
+ $diff -= $hours * 3600;
+ $minutes = floor($diff / 60);
+ $diff -= $minutes * 60;
+ $seconds = $diff;
+
+ if ($months > 0) {
+ // over a month old, just show date (mm/dd/yyyy format)
+ $relative_date = 'on ' . date($format, $in_seconds);
+ $old = true;
+ } else {
+ $relative_date = '';
+ $old = false;
+
+ if ($weeks > 0) {
+ // weeks and days
+ $relative_date .= ($relative_date ? ', ' : '') . $weeks . ' week' . ($weeks > 1 ? 's' : '');
+ $relative_date .= $days > 0 ? ($relative_date ? ', ' : '') . $days . ' day' . ($days > 1 ? 's' : '') : '';
+ } elseif ($days > 0) {
+ // days and hours
+ $relative_date .= ($relative_date ? ', ' : '') . $days . ' day' . ($days > 1 ? 's' : '');
+ $relative_date .= $hours > 0 ? ($relative_date ? ', ' : '') . $hours . ' hour' . ($hours > 1 ? 's' : '') : '';
+ } elseif ($hours > 0) {
+ // hours and minutes
+ $relative_date .= ($relative_date ? ', ' : '') . $hours . ' hour' . ($hours > 1 ? 's' : '');
+ $relative_date .= $minutes > 0 ? ($relative_date ? ', ' : '') . $minutes . ' minute' . ($minutes > 1 ? 's' : '') : '';
+ } elseif ($minutes > 0) {
+ // minutes only
+ $relative_date .= ($relative_date ? ', ' : '') . $minutes . ' minute' . ($minutes > 1 ? 's' : '');
+ } else {
+ // seconds only
+ $relative_date .= ($relative_date ? ', ' : '') . $seconds . ' second' . ($seconds != 1 ? 's' : '');
+ }
+ }
+
+ $ret = $relative_date;
+
+ // show relative date and add proper verbiage
+ if (!$backwards && !$old) {
+ $ret .= ' ago';
+ }
+ return $this->output($ret, $return);
+ }
+/**
+ * Alias for timeAgoInWords
+ *
+ * @param string $date_string Datetime string or Unix timestamp
+ * @param string $format Default format if timestamp is used in $date_string
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return string Relative time string.
+ * @see Time::timeAgoInWords()
+ * @access public
+ */
+ function relativeTime($datetime_string, $format = 'j/n/y', $return = false) {
+ $date = strtotime($datetime_string);
+
+ if (strtotime("now") > $date) {
+ $ret = $this->timeAgoInWords($datetime_string, $format, false);
+ } else {
+ $ret = $this->timeAgoInWords($datetime_string, $format, true);
+ }
+
+ return $this->output($ret, $return);
+ }
+/**
+ * Returns true if specified datetime was within the interval specified, else false.
+ *
+ * @param mixed $timeInterval the numeric value with space then time type. Example of valid types: 6 hours, 2 days, 1 minute.
+ * @param mixed $date_string the datestring or unix timestamp to compare
+ * @param boolean $return Whether this method should return a value or output it. This overrides AUTO_OUTPUT.
+ * @return boolean
+ * @access public
+ */
+ function wasWithinLast($timeInterval, $date_string, $return = false) {
+ $date = $this->fromString($date_string);
+ $result = preg_split('/\\s/', $timeInterval);
+ $numInterval = $result[0];
+ $textInterval = $result[1];
+ $currentTime = floor(time());
+ $seconds = ($currentTime - floor($date));
+
+ switch($textInterval) {
+ case "seconds":
+ case "second":
+ $timePeriod = $seconds;
+ $ret = $return;
+ break;
+ case "minutes":
+ case "minute":
+ $minutes = floor($seconds / 60);
+ $timePeriod = $minutes;
+ break;
+ case "hours":
+ case "hour":
+ $hours = floor($seconds / 3600);
+ $timePeriod = $hours;
+ break;
+ case "days":
+ case "day":
+ $days = floor($seconds / 86400);
+ $timePeriod = $days;
+ break;
+ case "weeks":
+ case "week":
+ $weeks = floor($seconds / 604800);
+ $timePeriod = $weeks;
+ break;
+ case "months":
+ case "month":
+ $months = floor($seconds / 2629743.83);
+ $timePeriod = $months;
+ break;
+ case "years":
+ case "year":
+ $years = floor($seconds / 31556926);
+ $timePeriod = $years;
+ break;
+ default:
+ $days = floor($seconds / 86400);
+ $timePeriod = $days;
+ break;
+ }
+ if ($timePeriod <= $numInterval) {
+ $ret = true;
+ } else {
+ $ret = false;
+ }
+ return $this->output($ret, $return);
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/elements/dump.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/elements/dump.thtml
new file mode 100644
index 0000000..3591bdb
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/elements/dump.thtml
@@ -0,0 +1,32 @@
+
+ * 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.libs.view.templates.elements
+ * @since CakePHP(tm) v 0.10.5.1782
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
+
Controller dump:
+
+ controller); ?>
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/error404.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/error404.thtml
new file mode 100644
index 0000000..cde78fd
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/error404.thtml
@@ -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.cake.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_action.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_action.thtml
new file mode 100644
index 0000000..e04e94b
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_action.thtml
@@ -0,0 +1,37 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Method in
+You are seeing this error because the action is not defined in controller
+If you want to customize this error message, create .
+Fatal : Confirm you have created the ::() in file :
+<?php
+class extends AppController {
+ function () {
+ }
+}
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_class.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_class.thtml
new file mode 100644
index 0000000..42c8783
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_class.thtml
@@ -0,0 +1,36 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Component Class
+You are seeing this error because the component class
+you have set in can't be found or doesn't exist.
+Notice: If you want to customize this error message, create .
+Fatal : Create the class below in file :
+<?php
+class Component extends Object {
+}
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_file.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_file.thtml
new file mode 100644
index 0000000..5ff57bd
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_component_file.thtml
@@ -0,0 +1,35 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Component File
+You are seeing this error because the component file can't be found or doesn't exist.
+Notice: If you want to customize this error message, create .
+Fatal : Create the class below in file :
+<?php
+class Component extends Object {
+
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_connection.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_connection.thtml
new file mode 100644
index 0000000..de859fb
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_connection.thtml
@@ -0,0 +1,30 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Requires a Database Connection
+Missing Database Connection: requires a database connection
+Notice: If you want to customize this error message, create .
+Fatal : Confirm you have created the file :
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_controller.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_controller.thtml
new file mode 100644
index 0000000..535fb6a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_controller.thtml
@@ -0,0 +1,36 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing controller
+You are seeing this error because controller could not be found.
+Notice: If you want to customize this error message, create .
+Fatal : Create the class below in file :
+<?php
+class extends AppController {
+ var $name = '';
+}
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_class.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_class.thtml
new file mode 100644
index 0000000..b7bb5a0
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_class.thtml
@@ -0,0 +1,35 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Helper Class
+You are seeing this error because the view helper class can't be found or doesn't exist.
+Notice: If you want to customize this error message, create .
+Fatal : Create the class below in file :
+<?php
+class extends Helper {
+}
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_file.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_file.thtml
new file mode 100644
index 0000000..16c4e0c
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_helper_file.thtml
@@ -0,0 +1,35 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Helper File
+You are seeing this error because the view helper file can't be found or doesn't exist.
+Notice: If you want to customize this error message, create .
+Fatal : Create the class below in file :
+<?php
+class extends Helper {
+}
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_layout.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_layout.thtml
new file mode 100644
index 0000000..bfd991d
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_layout.thtml
@@ -0,0 +1,30 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Layout
+You are seeing this error because the layout file can't be found or doesn't exist.
+Notice: If you want to customize this error message, create .
+Fatal : Confirm you have created the file :
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_model.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_model.thtml
new file mode 100644
index 0000000..ade0783
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_model.thtml
@@ -0,0 +1,36 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Model
+No class found for the model
+Notice: If you want to customize this error message, create .
+Fatal : Create the class below in file :
+<?php
+class extends AppModel {
+ var $name = '';
+}
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_scaffolddb.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_scaffolddb.thtml
new file mode 100644
index 0000000..a680c2a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_scaffolddb.thtml
@@ -0,0 +1,30 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Scaffold Requires a Database Connection
+Missing Database Connection: Scaffold Does not work without a database connection
+Notice: If you want to customize this error message, create .
+Fatal : Confirm you have created the file :
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_table.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_table.thtml
new file mode 100644
index 0000000..01d3049
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_table.thtml
@@ -0,0 +1,29 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing Database Table
+No Database table for model (expected ""), create it first.
+Notice: If you want to customize this error message, create .
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_view.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_view.thtml
new file mode 100644
index 0000000..d5c2f1f
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/missing_view.thtml
@@ -0,0 +1,30 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Missing view
+You are seeing this error because the view for ::() could not be found.
+If you want to customize this error message, create .
+Fatal : Confirm you have created the file :
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/private_action.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/private_action.thtml
new file mode 100644
index 0000000..6b9388f
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/private_action.thtml
@@ -0,0 +1,29 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Private Method in
+You are seeing this error because the private class method should not be accessed directly
+Notice: If you want to customize this error message, create .
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/scaffold_error.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/scaffold_error.thtml
new file mode 100644
index 0000000..919aa25
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/errors/scaffold_error.thtml
@@ -0,0 +1,33 @@
+
+ * 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.libs.view.templates.errors
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Scaffold Error
+Your must implement the following method in your controller
+Notice: If you want to customize this error message, create .
+
+ function _scaffoldError() {
+ }
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/ajax.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/ajax.thtml
new file mode 100644
index 0000000..446beaa
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/ajax.thtml
@@ -0,0 +1,27 @@
+
+ * 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.libs.view.templates.layouts
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/default.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/default.thtml
new file mode 100644
index 0000000..bb733c5
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/default.thtml
@@ -0,0 +1,58 @@
+
+ * 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.libs.view.templates.pages
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
+
+
+CakePHP(tm) :
+charset(); ?>
+
+
+css('cake.generic'); ?>
+
+
+
+
+
+ check('Message.flash'))
+ {
+ $session->flash();
+ }
+ echo $content_for_layout;
+ ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/flash.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/flash.thtml
new file mode 100644
index 0000000..1d7c808
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/layouts/flash.thtml
@@ -0,0 +1,45 @@
+
+ * 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.libs.view.templates.layouts
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
+
+
+
+charset(); ?>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/pages/home.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/pages/home.thtml
new file mode 100644
index 0000000..a505e39
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/pages/home.thtml
@@ -0,0 +1,75 @@
+
+ * 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.libs.view.templates.pages
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+Your database configuration file is
+
+
+getDataSource('default'); ?>
+CakeisConnected() ? ' is able to' : ' is not able to';?> connect to the database.
+
+
+CakePHP release information is on CakeForge
+ Read the release notes and get the latest version
+Editing this Page
+
+To change the content of this page, create: /app/views/pages/home.thtml.
+To change its layout, create: /app/views/layouts/default.thtml.
+See the views section of the manual for more info
+You can also add some CSS styles for your pages at: app/webroot/css/.
+
+More about Cake
+
+CakePHP is a rapid development framework for PHP which uses commonly known design patterns like
+Active Record, Association Data Mapping, Front Controller and MVC.
+
+
+Our primary goal is to provide a structured framework that enables PHP users at all levels
+to rapidly develop robust web applications, without any loss to flexibility.
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/add.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/add.thtml
new file mode 100644
index 0000000..5291ea9
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/add.thtml
@@ -0,0 +1,40 @@
+
+ * 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.libs.view.templates.scaffolds
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+New name)?>
+plugin)) {
+ $path = '/';
+} else {
+ $path = '/'.$this->plugin.'/';
+}
+echo $html->formTag($path. Inflector::underscore($this->name).'/create');
+echo $form->generateFields( $fieldNames );
+echo $form->generateSubmitDiv( 'Add' );?>
+
+
+".$html->link('List '.Inflector::humanize($this->name), $path.$this->viewPath.'/index').""; ?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/edit.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/edit.thtml
new file mode 100644
index 0000000..bb259a4
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/edit.thtml
@@ -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.libs.view.templates.scaffolds
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+$modelName = ucwords(Inflector::singularize($this->name));
+$modelKey = $modelName;
+if (is_null($this->plugin)) {
+ $path = '/';
+} else {
+ $path = '/'.$this->plugin.'/';
+}?>
+
+formTag($path . Inflector::underscore($this->name) .'/update');
+} else {
+ echo $html->formTag($path. Inflector::underscore($this->name).'/create');
+}
+echo $form->generateFields( $fieldNames );
+echo $form->generateSubmitDiv( 'Save' ); ?>
+
+
+".$html->link('Delete '.Inflector::humanize($modelName), $path.$this->viewPath.'/delete/'.$data[$modelKey][$this->controller->{$modelName}->primaryKey])."";
+}
+echo "".$html->link('List '.Inflector::humanize($modelName), $path.$this->viewPath.'/index')." ";
+if ($type == 'Edit') {
+ foreach ($fieldNames as $field => $value) {
+ if (isset($value['foreignKey'])) {
+ echo "".$html->link( "View ".Inflector::humanize($value['controller']), $path.Inflector::underscore($value['controller'])."/view/".$data[$modelKey][$field] )." ";
+ }
+ }
+}?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/index.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/index.thtml
new file mode 100644
index 0000000..3de10af
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/index.thtml
@@ -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.libs.view.templates.scaffolds
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+List name)?>
+name));
+$modelKey = $model;
+$humanName = Inflector::humanize($this->name);
+$humanSingularName = Inflector::singularize( $humanName );
+if (is_null($this->plugin)) {
+ $path = '/';
+} else {
+ $path = '/'.$this->plugin.'/';
+}
+if (!empty($this->controller->{$model}->modelToTable)) {
+ foreach ($this->controller->{$model}->modelToTable as $key => $value) {
+ $alias[] = $key;
+ }
+}?>
+
+
+
+
+
+
+Actions
+
+
+
+";
+ } else {
+ echo "";
+ }
+ $count = 0;
+ foreach ($fieldNames as $field=>$value) { ?>
+
+getDisplayField() ];
+ } else {
+ $displayText = $row[$alias[$count]][$field];
+ }
+ echo $html->link( $displayText, $path.Inflector::underscore($otherControllerName)."/view/".$row[$modelKey][$field] );
+ $count++;
+ } else {
+ echo $row[$modelKey][$field];
+ }?>
+
+
+ link('View',$path.$this->viewPath."/view/{$row[$modelKey][$this->controller->{$model}->primaryKey]}/")?>
+ link('Edit',$path.$this->viewPath."/edit/{$row[$modelKey][$this->controller->{$model}->primaryKey]}/")?>
+ link('Delete',$path.$this->viewPath."/delete/{$row[$modelKey][$this->controller->{$model}->primaryKey]}/", null, 'Are you sure you want to delete id '.$row[$modelKey][$this->controller->{$model}->primaryKey].' ?')?>
+
+
+
+
+
+
+ link('New '.$humanSingularName, $path.$this->viewPath.'/add'); ?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/view.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/view.thtml
new file mode 100644
index 0000000..9bc903b
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/templates/scaffolds/view.thtml
@@ -0,0 +1,166 @@
+
+ * 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.libs.view.templates.scaffolds
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+name));
+$modelKey = Inflector::underscore($modelName);
+$objModel =& ClassRegistry::getObject($modelKey);
+if (is_null($this->plugin)) {
+ $path = '/';
+} else {
+ $path = '/'.$this->plugin.'/';
+}
+if (!empty($objModel->modelToTable)) {
+ foreach ($objModel->modelToTable as $key => $value) {
+ $alias[] = $key;
+ }
+ $count = 0;
+}?>
+View
+
+
+
+ $value) {
+ echo "".$value['prompt']." ";
+ if (isset($value['foreignKey'])) {
+ $otherModelObject =& ClassRegistry::getObject(Inflector::underscore($objModel->tableToModel[$value['table']]));
+ $displayField = $otherModelObject->getDisplayField();
+ $displayText = $data[$alias[$count]][$displayField];
+ if (!empty($data[$objModel->tableToModel[$objModel->table]][$field]) && (isset($displayText))) {
+ echo "".$html->link($displayText, $path.Inflector::underscore($value['controller']).'/view/'
+ .$data[$objModel->tableToModel[$objModel->table]][$field] )." ";
+ } else {
+ echo " ";
+ }
+ $count++;
+ } else {
+ if ( !empty($data[$objModel->tableToModel[$objModel->table]][$field])) {
+ echo "".$data[$objModel->tableToModel[$objModel->table]][$field]." ";
+ } else {
+ echo " ";
+ }
+ }
+}?>
+
+
+".$html->link('Edit '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/edit/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey])."";
+echo "".$html->link('Delete '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/delete/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey], null, 'Are you sure you want to delete id '.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey].' ?')." ";
+echo "".$html->link('List '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/index')." ";
+echo "".$html->link('New '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/add')." ";
+
+foreach ( $fieldNames as $field => $value ) {
+ if ( isset( $value['foreignKey'] ) ) {
+ echo "".$html->link( "List ".Inflector::humanize($value['controller']), $path.Inflector::underscore($value['controller'])."/index/")." ";
+ }
+}?>
+
+
+
+hasOne as $association => $relation) {
+ $model = $relation['className'];
+ $otherModelName = $objModel->tableToModel[$objModel->{$model}->table];
+ $controller = Inflector::pluralize($model);
+ $new = true;
+ echo "";
+ } else {
+ echo "".$html->link('New '.Inflector::humanize($association),$path.Inflector::underscore($controller)."/add/{$data[$association][$objModel->{$model}->primaryKey]}")." ";
+ }
+ }
+}
+?>
+
+
+hasMany, $objModel->hasAndBelongsToMany);
+foreach ($relations as $association => $relation) {
+ $model = $relation['className'];
+ $count = 0;
+ $otherModelName = Inflector::singularize($model);
+ $controller = Inflector::pluralize($model);
+
+ echo "
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/view.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/view.php
new file mode 100644
index 0000000..57365ab
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/libs/view/view.php
@@ -0,0 +1,765 @@
+
+ * 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.libs.view
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Included libraries.
+ */
+uses ('view' . DS . 'helper', 'class_registry');
+/**
+ * View, the V in the MVC triad.
+ *
+ * Class holding methods for displaying presentation data.
+ *
+ * @package cake
+ * @subpackage cake.cake.libs.view
+ */
+class View extends Object{
+/**
+ * Name of the controller.
+ *
+ * @var string Name of controller
+ * @access public
+ */
+ var $name = null;
+/**
+ * Stores the current URL (for links etc.)
+ *
+ * @var string Current URL
+ * @access public
+ */
+ var $here = null;
+/**
+ * Action to be performed.
+ *
+ * @var string Name of action
+ * @access public
+ */
+ var $action = null;
+/**
+ * An array of names of built-in helpers to include.
+ *
+ * @var mixed A single name as a string or a list of names as an array.
+ * @access public
+ */
+ var $helpers = array('Html');
+/**
+ * Path to View.
+ *
+ * @var string Path to View
+ * @access public
+ */
+ var $viewPath;
+/**
+ * Replaced with public var viewVars
+ * @access protected
+ * @deprecated
+ */
+ var $_viewVars = array();
+/**
+ * Variables for the view
+ *
+ * @var array
+ * @access public
+ */
+ var $viewVars = array();
+/**
+ * Title HTML element of this View.
+ *
+ * @var boolean
+ * @access public
+ */
+ var $pageTitle = false;
+/**
+ * Path parts for creating links in views.
+ *
+ * @var string Base URL
+ * @access public
+ */
+ var $base = null;
+/**
+ * Name of layout to use with this View.
+ *
+ * @var string
+ * @access public
+ */
+ var $layout = 'default';
+/**
+ * Turns on or off Cake's conventional mode of rendering views. On by default.
+ *
+ * @var boolean
+ * @access public
+ */
+ var $autoRender = true;
+/**
+ * Turns on or off Cake's conventional mode of finding layout files. On by default.
+ *
+ * @var boolean
+ * @access public
+ */
+ var $autoLayout = true;
+/**
+ * Array of parameter data
+ *
+ * @var array Parameter data
+ * @access public
+ */
+ var $params;
+/**
+ * True when the view has been rendered.
+ *
+ * @var boolean
+ * @access protected
+ */
+ var $_hasRendered = null;
+/**
+ * @deprecated will not be avialable after 1.1.x.x
+ */
+ var $controller = null;
+/**
+ * Array of loaded view helpers.
+ *
+ * @var array
+ * @access public
+ */
+ var $loaded = array();
+/**
+ * File extension. Defaults to Cake's conventional ".thtml".
+ *
+ * @var array
+ * @access public
+ */
+ var $ext = '.thtml';
+/**
+ * Sub-directory for this view file.
+ *
+ * @var string
+ * @access public
+ */
+ var $subDir = null;
+/**
+ * The directory where theme web accessible content is stored
+ *
+ * @var array
+ * @access public
+ */
+ var $themeWeb = null;
+/**
+ * Plugin name. A Plugin is a sub-application.
+ * This is used to set the correct paths for views
+ *
+ * @var string
+ * @access public
+ */
+ var $plugin = null;
+/**
+ * Creates system path to plugin: plugins . DS . plugin_name . DS
+ *
+ * @var string
+ */
+ var $pluginPath = null;
+/**
+ * Holds an array of plugin paths.
+ * VIEWS . $this->pluginPath
+ * APP . $this->pluginPath . views . DS
+ *
+ * @var array
+ */
+ var $pluginPaths = array();
+/**
+ * List of variables to collect from the associated controller
+ *
+ * @var array
+ * @access protected
+ */
+ var $_passedVars = array('viewVars', 'action', 'autoLayout', 'autoRender', 'ext', 'base', 'webroot', 'helpers', 'here', 'layout', 'modelNames', 'name', 'pageTitle', 'viewPath', 'params', 'data', 'webservices', 'plugin');
+/**
+ * Constructor
+ *
+ * Instance is created in Controller::render() and is never called directly
+ *
+ * @var object instance of the calling controller
+ */
+ function __construct(&$controller) {
+ if (is_object($controller)) {
+ $this->controller =& $controller;
+ $c = count($this->_passedVars);
+
+ for ($j = 0; $j < $c; $j++) {
+ $var = $this->_passedVars[$j];
+ $this->{$var} = $controller->{$var};
+ }
+ $this->_viewVars =& $this->viewVars;
+ }
+ if (!is_null($this->plugin)) {
+ $this->pluginPath = 'plugins'. DS . $this->plugin . DS;
+ $this->pluginPaths = array(
+ VIEWS . $this->pluginPath,
+ APP . $this->pluginPath . 'views' . DS,
+ );
+
+ }
+ parent::__construct();
+ ClassRegistry::addObject('view', $this);
+ }
+/**
+ * Renders view for given action and layout. If $file is given, that is used
+ * for a view filename (e.g. customFunkyView.thtml).
+ *
+ * @param string $action Name of action to render for
+ * @param string $layout Layout to use
+ * @param string $file Custom filename for view
+ * @return mixed returns an error if View::render() fails to find a related template.
+ * boolean on successful render
+ * @access public
+ */
+ function render($action = null, $layout = null, $file = null) {
+
+ if (isset($this->_hasRendered) && $this->_hasRendered) {
+ return true;
+ } else {
+ $this->_hasRendered = false;
+ }
+
+ if (!$action) {
+ $action = $this->action;
+ }
+ $tempLayout = $this->layout;
+
+ if ($layout) {
+ $this->setLayout($layout);
+ }
+
+ if ($file) {
+ $viewFileName = $file;
+ } else {
+ $viewFileName = $this->_getViewFileName($action);
+ }
+
+ if (!is_null($this->plugin) && is_null($file)) {
+ return $this->pluginView($action, $layout);
+ }
+
+ if (!is_file($viewFileName) && !fileExistsInPath($viewFileName) || $viewFileName === '/' || $viewFileName === '\\') {
+ if (strpos($action, 'missingAction') !== false) {
+ $errorAction = 'missingAction';
+ } else {
+ $errorAction = 'missingView';
+ }
+
+ foreach (array($this->name, 'errors') as $viewDir) {
+ $errorAction = Inflector::underscore($errorAction);
+
+ if (file_exists(VIEWS . $viewDir . DS . $errorAction . $this->ext)) {
+ $missingViewFileName = VIEWS . $viewDir . DS . $errorAction . $this->ext;
+ } elseif ($missingViewFileName = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . $viewDir . DS . $errorAction . '.thtml')) {
+ } else {
+ $missingViewFileName = false;
+ }
+
+ $missingViewExists = is_file($missingViewFileName);
+
+ if ($missingViewExists) {
+ break;
+ }
+ }
+
+ if (strpos($action, 'missingView') === false) {
+ return $this->cakeError('missingView', array(array('className' => $this->controller->name,
+ 'action' => $action,
+ 'file' => $viewFileName,
+ 'base' => $this->base)));
+
+ $isFatal = isset($this->isFatal) ? $this->isFatal : false;
+
+ if (!$isFatal) {
+ $viewFileName = $missingViewFileName;
+ }
+ } else {
+ $missingViewExists = false;
+ }
+
+ if (!$missingViewExists || $isFatal) {
+ if (Configure::read() > 0) {
+ trigger_error(sprintf("No template file for view %s (expected %s), create it first'", $action, $viewFileName), E_USER_ERROR);
+ } else {
+ $this->error('404', 'Not found', sprintf("The requested address %s was not found on this server.", '', "missing view \"{$action}\""));
+ }
+ die();
+ }
+ }
+
+ if ($viewFileName && !$this->_hasRendered) {
+ if (substr($viewFileName, -5) === 'thtml') {
+ $out = View::_render($viewFileName, $this->viewVars);
+ } else {
+ $out = $this->_render($viewFileName, $this->viewVars);
+ }
+
+ if ($out !== false) {
+ if ($this->layout && $this->autoLayout) {
+ $out = $this->renderLayout($out);
+ if (isset($this->loaded['cache']) && ((isset($this->controller) && $this->controller->cacheAction != false)) && (defined('CACHE_CHECK') && CACHE_CHECK === true)) {
+ $replace = array('', ' ');
+ $out = str_replace($replace, '', $out);
+ }
+ }
+
+ print $out;
+ $this->setLayout($tempLayout);
+ $this->_hasRendered = true;
+ } else {
+ $out = $this->_render($viewFileName, $this->viewVars);
+ trigger_error(sprintf("Error in view %s, got: %s ", $viewFileName, $out), E_USER_ERROR);
+ }
+ return true;
+ }
+ }
+/**
+ * Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
+ *
+ * This realizes the concept of Elements, (or "partial layouts")
+ * and the $params array is used to send data to be used in the Element.
+ *
+ * @param string $name Name of template file in the/app/views/elements/ folder
+ * @param array $params Array of data to be made available to the for rendered view (i.e. the Element)
+ * @return string Rendered output
+ * @access public
+ */
+ function renderElement($name, $params = array()) {
+ if (isset($params['plugin'])) {
+ $this->plugin = $params['plugin'];
+ $this->pluginPath = 'plugins' . DS . $this->plugin . DS;
+ $this->pluginPaths = array(
+ VIEWS . $this->pluginPath,
+ APP . $this->pluginPath . 'views' . DS,
+ );
+ }
+
+ $paths = Configure::getInstance();
+ $viewPaths = am($this->pluginPaths, $paths->viewPaths);
+
+ $file = null;
+ foreach ($viewPaths as $path) {
+ if (file_exists($path . 'elements' . DS . $name . $this->ext)) {
+ $file = $path . 'elements' . DS . $name . $this->ext;
+ break;
+ } elseif (file_exists($path . 'elements' . DS . $name . '.ctp')) {
+ $file = $path . 'elements' . DS . $name . '.ctp';
+ break;
+ }
+ }
+
+ if (!is_null($file)) {
+ $params = array_merge_recursive($params, $this->loaded);
+ return $this->_render($file, array_merge($this->viewVars, $params), false);
+ }
+
+ if (!is_null($this->pluginPath)) {
+ $file = APP . $this->pluginPath . 'views' . DS . 'elements' . DS . $name . $this->ext;
+ } else {
+ $file = VIEWS . 'elements' . DS . $name . $this->ext;
+ }
+
+ if (Configure::read() > 0) {
+ return "Element Not Found: " . $file;
+ }
+ }
+/**
+ * Wrapper for View::renderElement();
+ *
+ * @param string $name Name of template file in the/app/views/elements/ folder
+ * @param array $params Array of data to be made available to the for rendered view (i.e. the Element)
+ * @return string View::renderElement()
+ * @access public
+ */
+ function element($name, $params = array()) {
+ return $this->renderElement($name, $params);
+ }
+/**
+ * Renders a layout. Returns output from _render(). Returns false on error.
+ *
+ * @param string $contentForLayout Content to render in a view, wrapped by the surrounding layout.
+ * @return mixed Rendered output, or false on error
+ * @access public
+ */
+ function renderLayout($contentForLayout) {
+ $layoutFilename = $this->_getLayoutFileName();
+
+ if (Configure::read() > 2 && $this->controller != null) {
+ $debug = View::_render(LIBS . 'view' . DS . 'templates' . DS . 'elements' . DS . 'dump.thtml', array('controller' => $this->controller), false);
+ } else {
+ $debug = '';
+ }
+
+ if ($this->pageTitle !== false) {
+ $pageTitle = $this->pageTitle;
+ } else {
+ $pageTitle = Inflector::humanize($this->viewPath);
+ }
+
+ $dataForLayout = array_merge($this->viewVars, array('title_for_layout' => $pageTitle,
+ 'content_for_layout' => $contentForLayout,
+ 'cakeDebug' => $debug));
+
+ if (is_file($layoutFilename)) {
+ if (empty($this->loaded) && !empty($this->helpers)) {
+ $loadHelpers = true;
+ } else {
+ $loadHelpers = false;
+ $dataForLayout = array_merge($dataForLayout, $this->loaded);
+ }
+
+ if (substr($layoutFilename, -5) === 'thtml') {
+ $out = View::_render($layoutFilename, $dataForLayout, $loadHelpers, true);
+ } else {
+ $out = $this->_render($layoutFilename, $dataForLayout, $loadHelpers);
+ }
+
+ if ($out === false) {
+ $out = $this->_render($layoutFilename, $dataForLayout);
+ trigger_error(sprintf("Error in layout %s, got: %s ", $layoutFilename, $out), E_USER_ERROR);
+ return false;
+ } else {
+ return $out;
+ }
+ } else {
+ return $this->cakeError('missingLayout', array(array('layout' => $this->layout,
+ 'file' => $layoutFilename,
+ 'base' => $this->base)));
+ }
+ }
+/**
+ * Sets layout to be used when rendering.
+ *
+ * @param string $layout Name of layout.
+ * @return void
+ * @access public
+ * @deprecated in 1.2.x.x
+ */
+ function setLayout($layout) {
+ $this->layout = $layout;
+ }
+/**
+ * Displays an error page to the user. Uses layouts/error.html to render the page.
+ *
+ * @param int $code HTTP Error code (for instance: 404)
+ * @param string $name Name of the error (for instance: Not Found)
+ * @param string $message Error message as a web page
+ * @return rendered error message
+ * @access public
+ *
+ */
+ function error($code, $name, $message) {
+ header ("HTTP/1.0 {$code} {$name}");
+ print ($this->_render(VIEWS . 'layouts/error.thtml', array('code' => $code,
+ 'name' => $name,
+ 'message' => $message)));
+ }
+/**
+ * Returns filename of given action's template file (.thtml) as a string. CamelCased action names will be under_scored! This means that you can have LongActionNames that refer to long_action_names.thtml views.
+ *
+ * @param string $action Controller action to find template filename for
+ * @return string Template filename
+ * @access protected
+ */
+ function _getViewFileName($action) {
+ $action = Inflector::underscore($action);
+
+ if (!is_null($this->webservices)) {
+ $type = strtolower($this->webservices) . DS;
+ } else {
+ $type = null;
+ }
+
+ $position = strpos($action, '..');
+ if ($position !== false) {
+ $action = explode('/', $action);
+ $i = array_search('..', $action);
+ unset($action[$i - 1]);
+ unset($action[$i]);
+ $action = '..' . DS . implode(DS, $action);
+ }
+
+ $paths = Configure::getInstance();
+ $viewPaths = am($this->pluginPaths, $paths->viewPaths);
+
+ $name = $this->viewPath . DS . $this->subDir . $type . $action;
+ foreach ($viewPaths as $path) {
+ if (file_exists($path . $name . $this->ext)) {
+ return $path . $name . $this->ext;
+ } elseif (file_exists($path . $name . '.ctp')) {
+ return $path . $name . '.ctp';
+ }
+ }
+
+ if ($viewFileName = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . 'errors' . DS . $type . $action . '.thtml')) {
+ return $viewFileName;
+ } elseif ($viewFileName = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . $this->viewPath . DS . $type . $action . '.thtml')) {
+ return $viewFileName;
+ } else {
+ if (!is_null($this->pluginPath)) {
+ $viewFileName = APP . $this->pluginPath . 'views' . DS . $name . $this->ext;
+ } else {
+ $viewFileName = VIEWS . $name . $this->ext;
+ }
+ }
+ return $viewFileName;
+ }
+/**
+ * Returns layout filename for this template as a string.
+ *
+ * @return string Filename for layout file (.thtml).
+ * @access protected
+ */
+ function _getLayoutFileName() {
+ if (isset($this->webservices) && !is_null($this->webservices)) {
+ $type = strtolower($this->webservices) . DS;
+ } else {
+ $type = null;
+ }
+
+ $paths = Configure::getInstance();
+ $viewPaths = am($this->pluginPaths, $paths->viewPaths);
+
+ $name = $this->subDir . $type . $this->layout;
+ foreach ($viewPaths as $path) {
+ if (file_exists($path . 'layouts' . DS . $name . $this->ext)) {
+ return $path . 'layouts' . DS . $name . $this->ext;
+ } elseif (file_exists($path . 'layouts' . DS . $name . '.ctp')) {
+ return $path . 'layouts' . DS . $name . '.ctp';
+ }
+ }
+
+ if (!is_null($this->pluginPath)) {
+ $layoutFileName = APP . $this->pluginPath . 'views' . DS . 'layouts' . DS . $name . $this->ext;
+ } else {
+ $layoutFileName = VIEWS . 'layouts' . DS . $name . $this->ext;
+ }
+
+ $layoutFileName = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . 'layouts' . DS . $type . $this->layout . '.thtml');
+ if (empty($layoutFileName) && !empty($type)) {
+ $layoutFileName = fileExistsInPath(LIBS . 'view' . DS . 'templates' . DS . 'layouts' . DS . $type . 'default.thtml');
+ }
+ return $layoutFileName;
+ }
+
+/**
+ * Renders and returns output for given view filename with its array of data.
+ *
+ * @param string $___viewFn Filename of the view
+ * @param array $___dataForView Data to include in rendered view
+ * @return string Rendered output
+ * @access protected
+ */
+ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false) {
+ if ($this->helpers != false && $loadHelpers === true) {
+ $loadedHelpers = array();
+ $loadedHelpers = $this->_loadHelpers($loadedHelpers, $this->helpers);
+
+ foreach (array_keys($loadedHelpers) as $helper) {
+ $replace = strtolower(substr($helper, 0, 1));
+ $camelBackedHelper = preg_replace('/\\w/', $replace, $helper, 1);
+
+ ${$camelBackedHelper} =& $loadedHelpers[$helper];
+
+ if (isset(${$camelBackedHelper}->helpers) && is_array(${$camelBackedHelper}->helpers)) {
+ foreach (${$camelBackedHelper}->helpers as $subHelper) {
+ ${$camelBackedHelper}->{$subHelper} =& $loadedHelpers[$subHelper];
+ }
+ }
+ $this->loaded[$camelBackedHelper] =& ${$camelBackedHelper};
+ }
+ }
+ extract($___dataForView, EXTR_SKIP);
+ $BASE = $this->base;
+ $params =& $this->params;
+
+ ob_start();
+
+ if (Configure::read() > 0) {
+ include ($___viewFn);
+ } else {
+ @include ($___viewFn);
+ }
+
+ if ($this->helpers != false && $loadHelpers === true) {
+ foreach ($loadedHelpers as $helper) {
+ if (is_object($helper)) {
+ if (is_subclass_of($helper, 'Helper') || is_subclass_of($helper, 'helper')) {
+ $helper->afterRender();
+ }
+ }
+ }
+ }
+ $out = ob_get_clean();
+
+ if (isset($this->loaded['cache']) && ((isset($this->controller) && $this->controller->cacheAction != false)) && (defined('CACHE_CHECK') && CACHE_CHECK === true)) {
+ if (is_a($this->loaded['cache'], 'CacheHelper')) {
+ $cache =& $this->loaded['cache'];
+
+ if ($cached === true) {
+ $cache->view = &$this;
+ }
+
+ $cache->base = $this->base;
+ $cache->here = $this->here;
+ $cache->action = $this->action;
+ $cache->controllerName = $this->params['controller'];
+ $cache->cacheAction = $this->controller->cacheAction;
+ $cache->cache($___viewFn, $out, $cached);
+ }
+ }
+ return $out;
+ }
+/**
+ * Loads helpers, with their dependencies.
+ *
+ * @param array $loaded List of helpers that are already loaded.
+ * @param array $helpers List of helpers to load.
+ * @return array
+ * @access protected
+ */
+ function &_loadHelpers(&$loaded, $helpers) {
+ static $tags;
+ $helpers[] = 'Session';
+ if (empty($tags)) {
+ $helperTags = new Helper();
+ $tags = $helperTags->loadConfig();
+ }
+
+ foreach ($helpers as $helper) {
+ $parts = preg_split('/\/|\./', $helper);
+
+ if (count($parts) === 1) {
+ $plugin = $this->plugin;
+ } else {
+ $plugin = Inflector::underscore($parts['0']);
+ $helper = $parts[count($parts) - 1];
+ }
+ $helperCn = $helper . 'Helper';
+
+ if (in_array($helper, array_keys($loaded)) !== true) {
+ if (!class_exists($helperCn)) {
+ if (is_null($plugin) || !loadPluginHelper($plugin, $helper)) {
+ if (!loadHelper($helper)) {
+ $this->cakeError('missingHelperFile', array(array(
+ 'helper' => $helper,
+ 'file' => Inflector::underscore($helper) . '.php',
+ 'base' => $this->base)));
+ exit();
+ }
+ }
+ if (!class_exists($helperCn)) {
+ $this->cakeError('missingHelperClass', array(array(
+ 'helper' => $helper,
+ 'file' => Inflector::underscore($helper) . '.php',
+ 'base' => $this->base)));
+ exit();
+ }
+ }
+
+ $camelBackedHelper = Inflector::variable($helper);
+
+ ${$camelBackedHelper} =& new $helperCn;
+ ${$camelBackedHelper}->view =& $this;
+ ${$camelBackedHelper}->tags = $tags;
+
+ $vars = array('base', 'webroot', 'here', 'params', 'action', 'data', 'themeWeb', 'plugin');
+ $c = count($vars);
+ for ($j = 0; $j < $c; $j++) {
+ ${$camelBackedHelper}->{$vars[$j]} = $this->{$vars[$j]};
+ }
+
+ if (!empty($this->validationErrors)) {
+ ${$camelBackedHelper}->validationErrors = $this->validationErrors;
+ }
+
+ $loaded[$helper] =& ${$camelBackedHelper};
+
+ if (isset(${$camelBackedHelper}->helpers) && is_array(${$camelBackedHelper}->helpers)) {
+ $loaded = &$this->_loadHelpers($loaded, ${$camelBackedHelper}->helpers);
+ }
+ }
+ }
+ return $loaded;
+ }
+/**
+ * Returns a plugin view
+ *
+ * @param string $action Name of action to render for
+ * @param string $layout Layout to use
+ * @return mixed View::render() if template is found, error if template is missing
+ * @access public
+ */
+ function pluginView($action, $layout) {
+ $viewFileName = APP . 'plugins' . DS . $this->plugin . DS . 'views' . DS . $this->viewPath . DS . $action . $this->ext;
+
+ if (file_exists($viewFileName)) {
+ $this->render($action, $layout, $viewFileName);
+ } else {
+ return $this->cakeError('missingView', array(array(
+ 'className' => $this->controller->name,
+ 'action' => $action,
+ 'file' => $viewFileName,
+ 'base' => $this->base)));
+ }
+ }
+/**
+ * Renders a cached view if timestamp in file is less or equal to current time.
+ *
+ * If $layout is xml content type will be set before rendering the cache
+ *
+ * @param string $filename
+ * @param int $timeStart
+ * @return mixed outputs view, or returns void if timestamp has expired
+ * @access public
+ */
+ function renderCache($filename, $timeStart) {
+ ob_start();
+ include ($filename);
+
+ if (Configure::read() > 0 && $this->layout != 'xml') {
+ echo "";
+ }
+ $out = ob_get_clean();
+
+ if (preg_match('/^/', $out, $match)) {
+ if (time() >= $match['1']) {
+ @unlink($filename);
+ unset ($out);
+ return;
+ } else {
+ if ($this->layout === 'xml') {
+ header('Content-type: text/xml');
+ }
+ $out = str_replace('', '', $out);
+ e($out);
+ die();
+ }
+ }
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/acl.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/acl.php
new file mode 100644
index 0000000..b4c7669
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/acl.php
@@ -0,0 +1,853 @@
+#!/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.scripts
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Enter description here...
+ */
+ define ('DS', DIRECTORY_SEPARATOR);
+ if (function_exists('ini_set')) {
+ ini_set('display_errors', '1');
+ ini_set('error_reporting', '7');
+ ini_set('max_execution_time',0);
+ }
+
+ $app = 'app';
+ $core = null;
+ $root = dirname(dirname(dirname(__FILE__)));
+ $here = $argv[0];
+ $dataSource = 'default';
+ $unset = array();
+ for ($i = 1; $i < count($argv); $i++) {
+ // Process command-line modifiers here
+ switch (strtolower($argv[$i])) {
+ case '-app':
+ $app = $argv[$i + 1];
+ $unset[$i] = $argv[$i];
+ $unset[$i + 1] = $argv[$i + 1];
+ break;
+ case '-core':
+ $core = $argv[$i + 1];
+ $unset[$i] = $argv[$i];
+ $unset[$i + 1] = $argv[$i + 1];
+ break;
+ case '-root':
+ $root = $argv[$i + 1];
+ $unset[$i] = $argv[$i];
+ $unset[$i + 1] = $argv[$i + 1];
+ break;
+ case '-datasource':
+ $dataSource = $argv[$i + 1];
+ $unset[$i] = $argv[$i];
+ $unset[$i + 1] = $argv[$i + 1];
+ break;
+ }
+ }
+
+ if (strlen($app) && $app[0] == DS) {
+ $cnt = substr_count($root, DS);
+ $app = str_repeat('..' . DS, $cnt) . $app;
+ }
+ define ('ROOT', $root.DS);
+ define ('APP_DIR', $app);
+ define ('DEBUG', 1);;
+ define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ define('DATASOURCE', $dataSource);
+
+ if (function_exists('ini_set')) {
+ ini_set('include_path',ini_get('include_path').
+ PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.DS.
+ PATH_SEPARATOR.CORE_PATH.DS.
+ PATH_SEPARATOR.ROOT.DS.APP_DIR.DS.
+ PATH_SEPARATOR.APP_DIR.DS.
+ PATH_SEPARATOR.APP_PATH);
+ define('APP_PATH', null);
+ define('CORE_PATH', null);
+ } else {
+ define('APP_PATH', ROOT . DS . APP_DIR . DS);
+ define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
+ }
+
+ require ('cake'.DS.'basics.php');
+ require ('cake'.DS.'config'.DS.'paths.php');
+ require (CONFIGS.'core.php');
+ uses ('object', 'configure', 'neat_array', 'session', 'security', 'inflector', 'model'.DS.'connection_manager',
+ 'model'.DS.'datasources'.DS.'dbo_source', 'model'.DS.'model');
+ require(CAKE.'app_model.php');
+ uses ('controller'.DS.'components'.DS.'acl', 'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aclnode',
+ 'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aco', 'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'acoaction',
+ 'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aro');
+ //Get and format args: first arg is the name of the script.
+ $serverArgs = $argv;
+ if (!empty($unset)) {
+ $serverArgs = array_values(array_diff($argv, $unset));
+ }
+
+ $wasted = array_shift($serverArgs);
+ $command = array_shift($serverArgs);
+ $args = $serverArgs;
+ $aclCLI = new AclCLI ($command, $args);
+/**
+ * @package cake
+ * @subpackage cake.cake.scritps
+ */
+class AclCLI {
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $stdin;
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $stdout;
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $stderr;
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $acl;
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $args;
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $dataSource = 'default';
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $command
+ * @param unknown_type $args
+ * @return AclCLI
+ */
+ function AclCLI($command, $args) {
+ $this->__construct($command, $args);
+ }
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $command
+ * @param unknown_type $args
+ */
+ function __construct ($command, $args) {
+ $this->stdin = fopen('php://stdin', 'r');
+ $this->stdout = fopen('php://stdout', 'w');
+ $this->stderr = fopen('php://stderr', 'w');
+
+ if (ACL_CLASSNAME != 'DB_ACL') {
+ $out = "--------------------------------------------------\n";
+ $out .= "Error: Your current Cake configuration is set to \n";
+ $out .= "an ACL implementation other than DB. Please change \n";
+ $out .= "your core config to reflect your decision to use \n";
+ $out .= "DB_ACL before attempting to use this script.\n";
+ $out .= "--------------------------------------------------\n";
+ $out .= "Current ACL Classname: " . ACL_CLASSNAME . "\n";
+ $out .= "--------------------------------------------------\n";
+ fwrite($this->stderr, $out);
+ exit();
+ }
+
+ if (!in_array($command, array('help'))) {
+ if (!file_exists(CONFIGS.'database.php')) {
+ $this->stdout('');
+ $this->stdout('Your database configuration was not found.');
+ $this->stdout('Take a moment to create one:');
+ $this->doDbConfig();
+ }
+ require_once (CONFIGS.'database.php');
+
+ if (!in_array($command, array('initdb'))) {
+ $this->dataSource = DATASOURCE;
+ $this->Acl = new AclComponent();
+ $this->args = $args;
+ $this->db =& ConnectionManager::getDataSource($this->dataSource);
+ }
+ }
+
+ switch ($command) {
+ case 'create':
+ $this->create();
+ break;
+ case 'delete':
+ $this->delete();
+ break;
+ case 'setParent':
+ $this->setParent();
+ break;
+ case 'getPath':
+ $this->getPath();
+ break;
+ case 'grant':
+ $this->grant();
+ break;
+ case 'deny':
+ $this->deny();
+ break;
+ case 'inherit':
+ $this->inherit();
+ break;
+ case 'view':
+ $this->view();
+ break;
+ case 'initdb':
+ $this->initdb();
+ break;
+ case 'upgrade':
+ $this->upgradedb();
+ break;
+ case 'help':
+ $this->help();
+ break;
+ default:
+ fwrite($this->stderr, "Unknown ACL command '$command'.\nFor usage, try 'php acl.php help'.\n\n");
+ break;
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function create() {
+ $this->checkArgNumber(4, 'create');
+ $this->checkNodeType();
+ extract($this->__dataVars());
+
+ $parent = (is_numeric($this->args[2])) ? intval($this->args[2]) : $this->args[2];
+ if (!$this->Acl->{$class}->create(intval($this->args[1]), $parent, $this->args[3])) {
+ $this->displayError("Parent Node Not Found", "There was an error creating the ".$class.", probably couldn't find the parent node.\n If you wish to create a new root node, specify the as '0'.");
+ }
+ $this->stdout("New $class '".$this->args[3]."' created.\n\n");
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function delete() {
+ $this->checkArgNumber(2, 'delete');
+ $this->checkNodeType();
+ extract($this->__dataVars());
+ if (!$this->Acl->{$class}->delete($this->args[1])) {
+ $this->displayError("Node Not Deleted", "There was an error deleting the ".$class.". Check that the node exists.\n");
+ }
+ $this->stdout("{$class} deleted.\n\n");
+ }
+
+/**
+ * Enter description here...
+ *
+ */
+ function setParent() {
+ $this->checkArgNumber(3, 'setParent');
+ $this->checkNodeType();
+ extract($this->__dataVars());
+ if (!$this->Acl->{$class}->setParent($this->args[2], $this->args[1])) {
+ $this->stdout("Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.\n");
+ } else {
+ $this->stdout("Node parent set to ".$this->args[2]."\n\n");
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function getPath() {
+ $this->checkArgNumber(2, 'getPath');
+ $this->checkNodeType();
+ extract($this->__dataVars());
+ $id = (is_numeric($this->args[2])) ? intval($this->args[1]) : $this->args[1];
+ $nodes = $this->Acl->{$class}->getPath($id);
+ if (empty($nodes)) {
+ $this->displayError("Supplied Node '".$this->args[1]."' not found", "No tree returned.");
+ }
+ for ($i = 0; $i < count($nodes); $i++) {
+ $this->stdout(str_repeat(' ', $i) . "[" . $nodes[$i][$class]['id'] . "]" . $nodes[$i][$class]['alias'] . "\n");
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function grant() {
+ $this->checkArgNumber(3, 'grant');
+ //add existence checks for nodes involved
+ $aro = $this->args[0];
+ if (is_numeric($aro)) {
+ $aro = intval($aro);
+ }
+ $aco = $this->args[1];
+ if (is_numeric($aco)) {
+ $aco = intval($aco);
+ }
+ if ($this->Acl->allow($aro, $aco, $this->args[2])) {
+ $this->stdout("Permission granted.\n");
+ } else {
+ $this->stdout("Permission could not be granted.\n");
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function deny() {
+ $this->checkArgNumber(3, 'deny');
+ //add existence checks for nodes involved
+ $aro = (is_numeric($this->args[0])) ? intval($this->args[0]) : $this->args[0];
+ $aco = (is_numeric($this->args[1])) ? intval($this->args[1]) : $this->args[1];
+ $aro = $this->args[0];
+ if (is_numeric($aro)) {
+ $aro = intval($aro);
+ }
+ $aco = $this->args[1];
+ if (is_numeric($aco)) {
+ $aco = intval($aco);
+ }
+ if ($this->Acl->deny($aro, $aco, $this->args[2])) {
+ $this->stdout("Permission denied.\n");
+ } else {
+ $this->stdout("Permission could not be denied.\n");
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function inherit() {
+ $this->checkArgNumber(3, 'inherit');
+ $aro = $this->args[0];
+ if (is_numeric($aro)) {
+ $aro = intval($aro);
+ }
+ $aco = $this->args[1];
+ if (is_numeric($aco)) {
+ $aco = intval($aco);
+ }
+ if ($this->Acl->inherit($aro, $aco, $this->args[2])) {
+ $this->stdout("Permission inherited.\n");
+ } else {
+ $this->stdout("Permission could not be inherited.\n");
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function view() {
+ $this->checkArgNumber(1, 'view');
+ $this->checkNodeType();
+ extract($this->__dataVars());
+ if (!is_null($this->args[1])) {
+ $conditions = $this->Acl->{$class}->_resolveID($this->args[1]);
+ } else {
+ $conditions = null;
+ }
+ $nodes = $this->Acl->{$class}->findAll($conditions, null, 'lft ASC');
+ if (empty($nodes)) {
+ $this->displayError($this->args[1]." not found", "No tree returned.");
+ }
+ $right = array();
+
+ $this->stdout($class . " tree:\n");
+ $this->stdout("------------------------------------------------\n");
+
+ for ($i = 0; $i < count($nodes); $i++) {
+ if (count($right) > 0) {
+ while ($right[count($right)-1] < $nodes[$i][$class]['rght']) {
+ if ($right[count($right)-1]) {
+ array_pop($right);
+ } else {
+ break;
+ }
+ }
+ }
+ $this->stdout(str_repeat(' ',count($right)) . "[" . $nodes[$i][$class]['id'] . "]" . $nodes[$i][$class]['alias']."\n");
+ $right[] = $nodes[$i][$class]['rght'];
+ }
+ $this->stdout("------------------------------------------------\n");
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function initdb() {
+ $db =& ConnectionManager::getDataSource($this->dataSource);
+ $this->stdout("Initializing Database...\n");
+ $this->stdout("Creating access control objects table (acos)...\n");
+ $sql = " CREATE TABLE ".$db->fullTableName('acos')." (
+ ".$db->name('id')." ".$db->column($db->columns['primary_key']).",
+ ".$db->name('object_id')." ".$db->column($db->columns['integer'])." default NULL,
+ ".$db->name('alias')." ".$db->column($db->columns['string'])." NOT NULL default '',
+ ".$db->name('lft')." ".$db->column($db->columns['integer'])." default NULL,
+ ".$db->name('rght')." ".$db->column($db->columns['integer'])." default NULL,
+ PRIMARY KEY (".$db->name('id').")
+ );";
+ if ($db->query($sql) === false) {
+ die("Error: " . $db->lastError() . "\n\n");
+ }
+
+ $this->stdout("Creating access request objects table (aros)...\n");
+ $sql2 = "CREATE TABLE ".$db->fullTableName('aros')." (
+ ".$db->name('id')." ".$db->column($db->columns['primary_key']).",
+ ".$db->name('foreign_key')." ".$db->column($db->columns['integer'])." default NULL,
+ ".$db->name('alias')." ".$db->column($db->columns['string'])." NOT NULL default '',
+ ".$db->name('lft')." ".$db->column($db->columns['integer'])." default NULL,
+ ".$db->name('rght')." ".$db->column($db->columns['integer'])." default NULL,
+ PRIMARY KEY (".$db->name('id').")
+ );";
+ if ($db->query($sql2) === false) {
+ die("Error: " . $db->lastError() . "\n\n");
+ }
+
+ $this->stdout("Creating relationships table (aros_acos)...\n");
+ $sql3 = "CREATE TABLE ".$db->fullTableName('aros_acos')." (
+ ".$db->name('id')." ".$db->column($db->columns['primary_key']).",
+ ".$db->name('aro_id')." ".$db->column($db->columns['integer'])." default NULL,
+ ".$db->name('aco_id')." ".$db->column($db->columns['integer'])." default NULL,
+ ".$db->name('_create')." ".$db->column($db->columns['integer'])." NOT NULL default '0',
+ ".$db->name('_read')." ".$db->column($db->columns['integer'])." NOT NULL default '0',
+ ".$db->name('_update')." ".$db->column($db->columns['integer'])." NOT NULL default '0',
+ ".$db->name('_delete')." ".$db->column($db->columns['integer'])." NOT NULL default '0',
+ PRIMARY KEY (".$db->name('id').")
+ );";
+ if ($db->query($sql3) === false) {
+ die("Error: " . $db->lastError() . "\n\n");
+ }
+
+ $this->stdout("\nDone.\n");
+ }
+
+/**
+ * Enter description here...
+ *
+ */
+ function upgradedb() {
+ $db =& ConnectionManager::getDataSource($this->dataSource);
+ $this->stdout("Initializing Database...\n");
+ $this->stdout("Upgrading table (aros)...\n");
+ $sql = "ALTER TABLE ".$db->fullTableName('aros')."
+ CHANGE ".$db->name('user_id')."
+ ".$db->name('foreign_key')."
+ INT( 10 ) UNSIGNED NULL DEFAULT NULL;";
+ $sql .= "ALTER TABLE " . $db->name('aros_acos') . " CHANGE " . $db->name('_create')
+ . " " . $db->name('_create') . " CHAR(2) NOT NULL DEFAULT '0';";
+ $sql .= "ALTER TABLE " . $db->name('aros_acos') . " CHANGE " . $db->name('_update')
+ . " " . $db->name('_update') . " CHAR(2) NOT NULL DEFAULT '0';";
+ $sql .= "ALTER TABLE " . $db->name('aros_acos') . " CHANGE " . $db->name('_read')
+ . " " . $db->name('_read') . " CHAR(2) NOT NULL DEFAULT '0';";
+ $sql .= "ALTER TABLE " . $db->name('aros_acos') . " CHANGE " . $db->name('_delete')
+ . " " . $db->name('_delete') . " CHAR(2) NOT NULL DEFAULT '0';";
+ if ($db->query($sql) === false) {
+ die("Error: " . $db->lastError() . "\n\n");
+ }
+ $this->stdout("\nDatabase upgrade is complete.\n");
+ }
+
+/**
+ * Enter description here...
+ *
+ */
+ function help() {
+ $out = "Usage: php acl.php ...\n";
+ $out .= "-----------------------------------------------\n";
+ $out .= "Commands:\n";
+ $out .= "\n";
+ $out .= "\tcreate aro|aco \n";
+ $out .= "\t\tCreates a new ACL object under the parent specified by , an id/alias (see\n";
+ $out .= "\t\t'view'). The link_id allows you to link a user object to Cake's\n";
+ $out .= "\t\tACL structures. The alias parameter allows you to address your object\n";
+ $out .= "\t\tusing a non-integer ID. Example: \"\$php acl.php create aro 57 0 John\"\n";
+ $out .= "\t\twould create a new ARO object at the root of the tree, linked to 57\n";
+ $out .= "\t\tin your users table, with an internal alias 'John'.";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tdelete aro|aco \n";
+ $out .= "\t\tDeletes the ACL object with the specified ID (see 'view').\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tsetParent aro|aco \n";
+ $out .= "\t\tUsed to set the parent of the ACL object specified by to the ID\n";
+ $out .= "\t\tspecified by .\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tgetPath aro|aco \n";
+ $out .= "\t\tReturns the path to the ACL object specified by . This command is\n";
+ $out .= "\t\tis useful in determining the inhertiance of permissions for a certain\n";
+ $out .= "\t\tobject in the tree.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tgrant \n";
+ $out .= "\t\tUse this command to grant ACL permissions. Once executed, the ARO\n";
+ $out .= "\t\tspecified (and its children, if any) will have ALLOW access to the\n";
+ $out .= "\t\tspecified ACO action (and the ACO's children, if any).\n";
+ $out .= "\t\tIf an integer is passed permissions will be granted based on the foreign_key or object_id.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tdeny \n";
+ $out .= "\t\tUse this command to deny ACL permissions. Once executed, the ARO\n";
+ $out .= "\t\tspecified (and its children, if any) will have DENY access to the\n";
+ $out .= "\t\tspecified ACO action (and the ACO's children, if any).\n";
+ $out .= "\t\tIf an integer is passed permissions will be denied based on the foreign_key or object_id.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tinherit \n";
+ $out .= "\t\tUse this command to force a child ARO object to inherit its\n";
+ $out .= "\t\tpermissions settings from its parent.\n";
+ $out .= "\t\tIf an integer is passed permissions will be inherited based on the foreign_key or object_id.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tview aro|aco [id]\n";
+ $out .= "\t\tThe view command will return the ARO or ACO tree. The optional\n";
+ $out .= "\t\tid/alias parameter allows you to return only a portion of the requested\n";
+ $out .= "\t\ttree.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\tinitdb\n";
+ $out .= "\t\tUse this command to create the database tables needed to use DB ACL.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $out .= "\thelp\n";
+ $out .= "\t\tDisplays this help message.\n";
+ $out .= "\n";
+ $out .= "\n";
+ $this->stdout($out);
+ }
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $title
+ * @param unknown_type $msg
+ */
+ function displayError($title, $msg) {
+ $out = "\n";
+ $out .= "Error: $title\n";
+ $out .= "$msg\n";
+ $out .= "\n";
+ $this->stdout($out);
+ exit();
+ }
+
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $expectedNum
+ * @param unknown_type $command
+ */
+ function checkArgNumber($expectedNum, $command) {
+ if (count($this->args) < $expectedNum) {
+ $this->displayError('Wrong number of parameters: '.count($this->args), 'Please type \'php acl.php help\' for help on usage of the '.$command.' command.');
+ }
+ }
+/**
+ * Enter description here...
+ *
+ */
+ function checkNodeType() {
+ if ($this->args[0] != 'aco' && $this->args[0] != 'aro') {
+ $this->displayError("Missing/Unknown node type: '".$this->args[0]."'", 'Please specify which ACL object type you wish to create.');
+ }
+ }
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $type
+ * @param unknown_type $id
+ * @return unknown
+ */
+ function nodeExists($type, $id) {
+ //$this->stdout("Check to see if $type with ID = $id exists...\n");
+ extract($this->__dataVars($type));
+ $conditions = $this->Acl->{$class}->_resolveID($id);
+ $possibility = $this->Acl->{$class}->findAll($conditions);
+ return $possibility;
+ }
+
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $type
+ * @return unknown
+ */
+ function __dataVars($type = null) {
+ if ($type == null) {
+ $type = $this->args[0];
+ }
+
+ $vars = array();
+ $class = ucwords($type);
+ $vars['secondary_id'] = ($class == 'aro' ? 'foreign_key' : 'object_id');
+ $vars['data_name'] = $type;
+ $vars['table_name'] = $type . 's';
+ $vars['class'] = $class;
+ return $vars;
+ }
+/**
+ * Database configuration setup.
+ *
+ */
+ function doDbConfig() {
+ $this->hr();
+ $this->stdout('Database Configuration:');
+ $this->hr();
+
+ $driver = '';
+
+ while ($driver == '') {
+ $driver = $this->getInput('What database driver would you like to use?', array('mysql','mysqli','mssql','sqlite','postgres', 'odbc'), 'mysql');
+ if ($driver == '') {
+ $this->stdout('The database driver supplied was empty. Please supply a database driver.');
+ }
+ }
+
+ switch($driver) {
+ case 'mysql':
+ $connect = 'mysql_connect';
+ break;
+ case 'mysqli':
+ $connect = 'mysqli_connect';
+ break;
+ case 'mssql':
+ $connect = 'mssql_connect';
+ break;
+ case 'sqlite':
+ $connect = 'sqlite_open';
+ break;
+ case 'postgres':
+ $connect = 'pg_connect';
+ break;
+ case 'odbc':
+ $connect = 'odbc_connect';
+ break;
+ default:
+ $this->stdout('The connection parameter could not be set.');
+ break;
+ }
+
+ $host = '';
+
+ while ($host == '') {
+ $host = $this->getInput('What is the hostname for the database server?', null, 'localhost');
+ if ($host == '') {
+ $this->stdout('The host name you supplied was empty. Please supply a hostname.');
+ }
+ }
+ $login = '';
+
+ while ($login == '') {
+ $login = $this->getInput('What is the database username?', null, 'root');
+
+ if ($login == '') {
+ $this->stdout('The database username you supplied was empty. Please try again.');
+ }
+ }
+ $password = '';
+ $blankPassword = false;
+
+ while ($password == '' && $blankPassword == false) {
+ $password = $this->getInput('What is the database password?');
+ if ($password == '') {
+ $blank = $this->getInput('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n');
+ if ($blank == 'y')
+ {
+ $blankPassword = true;
+ }
+ }
+ }
+ $database = '';
+
+ while ($database == '') {
+ $database = $this->getInput('What is the name of the database you will be using?', null, 'cake');
+
+ if ($database == '') {
+ $this->stdout('The database name you supplied was empty. Please try again.');
+ }
+ }
+
+ $prefix = '';
+
+ while ($prefix == '') {
+ $prefix = $this->getInput('Enter a table prefix?', null, 'n');
+ }
+ if (low($prefix) == 'n') {
+ $prefix = '';
+ }
+
+ $this->stdout('');
+ $this->hr();
+ $this->stdout('The following database configuration will be created:');
+ $this->hr();
+ $this->stdout("Driver: $driver");
+ $this->stdout("Connection: $connect");
+ $this->stdout("Host: $host");
+ $this->stdout("User: $login");
+ $this->stdout("Pass: " . str_repeat('*', strlen($password)));
+ $this->stdout("Database: $database");
+ $this->stdout("Table prefix: $prefix");
+ $this->hr();
+ $looksGood = $this->getInput('Look okay?', array('y', 'n'), 'y');
+
+ if (low($looksGood) == 'y' || low($looksGood) == 'yes') {
+ $this->bakeDbConfig($driver, $connect, $host, $login, $password, $database, $prefix);
+ } else {
+ $this->stdout('Bake Aborted.');
+ }
+ }
+/**
+ * Creates a database configuration file for Bake.
+ *
+ * @param string $host
+ * @param string $login
+ * @param string $password
+ * @param string $database
+ */
+ function bakeDbConfig( $driver, $connect, $host, $login, $password, $database, $prefix) {
+ $out = " '{$driver}',\n";
+ $out .= "\t\t'connect' => '{$connect}',\n";
+ $out .= "\t\t'host' => '{$host}',\n";
+ $out .= "\t\t'login' => '{$login}',\n";
+ $out .= "\t\t'password' => '{$password}',\n";
+ $out .= "\t\t'database' => '{$database}', \n";
+ $out .= "\t\t'prefix' => '{$prefix}' \n";
+ $out .= "\t);\n";
+ $out .= "}\n";
+ $out .= "?>";
+ $filename = CONFIGS.'database.php';
+ $this->__createFile($filename, $out);
+ }
+/**
+ * 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.
+ */
+ function getInput($prompt, $options = null, $default = null) {
+ if (!is_array($options)) {
+ $print_options = '';
+ } else {
+ $print_options = '(' . implode('/', $options) . ')';
+ }
+
+ if ($default == null) {
+ $this->stdout('');
+ $this->stdout($prompt . " $print_options \n" . '> ', false);
+ } else {
+ $this->stdout('');
+ $this->stdout($prompt . " $print_options \n" . "[$default] > ", false);
+ }
+ $result = trim(fgets($this->stdin));
+
+ 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.
+ */
+ 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.
+ */
+ function stderr($string) {
+ fwrite($this->stderr, $string);
+ }
+/**
+ * Outputs a series of minus characters to the standard output, acts as a visual separator.
+ *
+ */
+ function hr() {
+ $this->stdout('---------------------------------------------------------------');
+ }
+/**
+ * Creates a file at given path.
+ *
+ * @param string $path Where to put the file.
+ * @param string $contents Content to put in the file.
+ * @return Success
+ */
+ function __createFile ($path, $contents) {
+ $path = str_replace('//', '/', $path);
+ echo "\nCreating file $path\n";
+ if (is_file($path) && $this->interactive === true) {
+ fwrite($this->stdout, "File exists, overwrite?" . " {$path} (y/n/q):");
+ $key = trim(fgets($this->stdin));
+
+ if ($key=='q') {
+ fwrite($this->stdout, "Quitting.\n");
+ exit;
+ } elseif ($key == 'a') {
+ $this->dont_ask = true;
+ } elseif ($key == 'y') {
+ } else {
+ fwrite($this->stdout, "Skip" . " {$path}\n");
+ return false;
+ }
+ }
+
+ if ($f = fopen($path, 'w')) {
+ fwrite($f, $contents);
+ fclose($f);
+ fwrite($this->stdout, "Wrote" . "{$path}\n");
+ return true;
+ } else {
+ fwrite($this->stderr, "Error! Could not write to" . " {$path}.\n");
+ return false;
+ }
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/bake.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/bake.php
new file mode 100644
index 0000000..2365ee8
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/bake.php
@@ -0,0 +1,2635 @@
+#!/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.scripts.bake
+ * @since CakePHP(tm) v 0.10.0.1232
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+ define ('DS', DIRECTORY_SEPARATOR);
+ if (function_exists('ini_set')) {
+ ini_set('display_errors', '1');
+ ini_set('error_reporting', '7');
+ ini_set('max_execution_time',0);
+ }
+
+ $app = null;
+ $root = dirname(dirname(dirname(__FILE__)));
+ $core = null;
+ $here = $argv[0];
+ $help = null;
+ $project = null;
+
+ for ($i = 1; $i < count($argv); $i += 2) {
+ switch ($argv[$i]) {
+ case '-a':
+ case '-app':
+ $app = $argv[$i + 1];
+ break;
+ case '-c':
+ case '-core':
+ $core = $argv[$i + 1];
+ break;
+ case '-r':
+ case '-root':
+ $root = $argv[$i + 1];
+ break;
+ case '-h':
+ case '-help':
+ $help = true;
+ break;
+ case '-p':
+ case '-project':
+ $project = true;
+ $projectPath = $argv[$i + 1];
+ $app = $argv[$i + 1];
+ break;
+ }
+ }
+
+ if (!$app && isset($argv[1])) {
+ $app = $argv[1];
+ } elseif (!$app) {
+ $app = 'app';
+ }
+ if (!is_dir($app)) {
+ $project = true;
+ $projectPath = $app;
+
+ }
+ if ($project) {
+ $app = $projectPath;
+ }
+
+ $shortPath = str_replace($root, '', $app);
+ $shortPath = str_replace('..'.DS, '', $shortPath);
+ $shortPath = str_replace(DS.DS, DS, $shortPath);
+
+ $pathArray = explode(DS, $shortPath);
+ if (end($pathArray) != '') {
+ $appDir = array_pop($pathArray);
+ } else {
+ array_pop($pathArray);
+ $appDir = array_pop($pathArray);
+ }
+ $rootDir = implode(DS, $pathArray);
+ $rootDir = str_replace(DS.DS, DS, $rootDir);
+
+ if (!$rootDir) {
+ $rootDir = $root;
+ $projectPath = $root.DS.$appDir;
+ }
+
+ define ('ROOT', $rootDir);
+ define ('APP_DIR', $appDir);
+ define ('DEBUG', 1);
+
+ if (!empty($core)) {
+ define('CAKE_CORE_INCLUDE_PATH', dirname($core));
+ } else {
+ define('CAKE_CORE_INCLUDE_PATH', $root);
+ }
+
+ if (function_exists('ini_set')) {
+ ini_set('include_path',ini_get('include_path').
+ PATH_SEPARATOR.CAKE_CORE_INCLUDE_PATH.DS.
+ PATH_SEPARATOR.ROOT.DS.APP_DIR.DS);
+ define('APP_PATH', null);
+ define('CORE_PATH', null);
+ } else {
+ define('APP_PATH', ROOT . DS . APP_DIR . DS);
+ define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
+ }
+
+ require_once (CORE_PATH.'cake'.DS.'basics.php');
+ require_once (CORE_PATH.'cake'.DS.'config'.DS.'paths.php');
+ require_once (CORE_PATH.'cake'.DS.'scripts'.DS.'templates'.DS.'skel'.DS.'config'.DS.'core.php');
+ require_once (CORE_PATH.'cake'.DS.'dispatcher.php');
+ uses('object', 'session', 'security', 'configure', 'inflector', 'model'.DS.'connection_manager');
+
+ $pattyCake = new Bake();
+ if ($help === true)
+ {
+ $pattyCake->help();
+ exit();
+ }
+ if ($project === true)
+ {
+ $pattyCake->project($projectPath);
+ exit();
+ }
+ $pattyCake->main();
+/**
+ * Bake is a command-line code generation utility for automating programmer chores.
+ *
+ * @package cake
+ * @subpackage cake.cake.scripts
+ */
+class Bake {
+
+/**
+ * Standard input stream.
+ *
+ * @var filehandle
+ */
+ var $stdin;
+/**
+ * Standard output stream.
+ *
+ * @var filehandle
+ */
+ var $stdout;
+/**
+ * Standard error stream.
+ *
+ * @var filehandle
+ */
+ var $stderr;
+/**
+ * Associated controller name.
+ *
+ * @var string
+ */
+ var $controllerName = null;
+/**
+ * If true, Bake will ask for permission to perform actions.
+ *
+ * @var boolean
+ */
+ var $interactive = false;
+
+ var $__modelAlias = false;
+/**
+ * Private helper function for constructor
+ * @access private
+ */
+ function __construct() {
+ $this->stdin = fopen('php://stdin', 'r');
+ $this->stdout = fopen('php://stdout', 'w');
+ $this->stderr = fopen('php://stderr', 'w');
+ $this->welcome();
+ }
+/**
+ * Constructor.
+ *
+ * @return Bake
+ */
+ function Bake() {
+ return $this->__construct();
+ }
+/**
+ * Main-loop method.
+ *
+ */
+ function main() {
+
+ $this->stdout('');
+ $this->stdout('');
+ $this->stdout('Baking...');
+ $this->hr();
+ $this->stdout('Name: '. APP_DIR);
+ $this->stdout('Path: '. ROOT.DS.APP_DIR);
+ $this->hr();
+
+ if (!file_exists(CONFIGS.'database.php')) {
+ $this->stdout('');
+ $this->stdout('Your database configuration was not found. Take a moment to create one:');
+ $this->doDbConfig();
+ }
+ require_once (CONFIGS.'database.php');
+ $this->stdout('[M]odel');
+ $this->stdout('[C]ontroller');
+ $this->stdout('[V]iew');
+ $invalidSelection = true;
+
+ while ($invalidSelection) {
+ $classToBake = strtoupper($this->getInput('What would you like to Bake?', array('M', 'V', 'C')));
+ switch($classToBake) {
+ case 'M':
+ $invalidSelection = false;
+ $this->doModel();
+ break;
+ case 'V':
+ $invalidSelection = false;
+ $this->doView();
+ break;
+ case 'C':
+ $invalidSelection = false;
+ $this->doController();
+ break;
+ default:
+ $this->stdout('You have made an invalid selection. Please choose a type of class to Bake by entering M, V, or C.');
+ }
+ }
+ }
+/**
+ * Database configuration setup.
+ *
+ */
+ function doDbConfig() {
+ $this->hr();
+ $this->stdout('Database Configuration:');
+ $this->hr();
+
+ $driver = '';
+
+ while ($driver == '') {
+ $driver = $this->getInput('What database driver would you like to use?', array('mysql','mysqli','mssql','sqlite','postgres', 'odbc'), 'mysql');
+ if ($driver == '') {
+ $this->stdout('The database driver supplied was empty. Please supply a database driver.');
+ }
+ }
+
+ switch($driver) {
+ case 'mysql':
+ $connect = 'mysql_connect';
+ break;
+ case 'mysqli':
+ $connect = 'mysqli_connect';
+ break;
+ case 'mssql':
+ $connect = 'mssql_connect';
+ break;
+ case 'sqlite':
+ $connect = 'sqlite_open';
+ break;
+ case 'postgres':
+ $connect = 'pg_connect';
+ break;
+ case 'odbc':
+ $connect = 'odbc_connect';
+ break;
+ default:
+ $this->stdout('The connection parameter could not be set.');
+ break;
+ }
+
+ $host = '';
+
+ while ($host == '') {
+ $host = $this->getInput('What is the hostname for the database server?', null, 'localhost');
+ if ($host == '') {
+ $this->stdout('The host name you supplied was empty. Please supply a hostname.');
+ }
+ }
+ $login = '';
+
+ while ($login == '') {
+ $login = $this->getInput('What is the database username?', null, 'root');
+
+ if ($login == '') {
+ $this->stdout('The database username you supplied was empty. Please try again.');
+ }
+ }
+ $password = '';
+ $blankPassword = false;
+
+ while ($password == '' && $blankPassword == false) {
+ $password = $this->getInput('What is the database password?');
+ if ($password == '') {
+ $blank = $this->getInput('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n');
+ if ($blank == 'y')
+ {
+ $blankPassword = true;
+ }
+ }
+ }
+ $database = '';
+
+ while ($database == '') {
+ $database = $this->getInput('What is the name of the database you will be using?', null, 'cake');
+
+ if ($database == '') {
+ $this->stdout('The database name you supplied was empty. Please try again.');
+ }
+ }
+
+ $prefix = '';
+
+ while ($prefix == '') {
+ $prefix = $this->getInput('Enter a table prefix?', null, 'n');
+ }
+ if (low($prefix) == 'n') {
+ $prefix = '';
+ }
+
+ $this->stdout('');
+ $this->hr();
+ $this->stdout('The following database configuration will be created:');
+ $this->hr();
+ $this->stdout("Driver: $driver");
+ $this->stdout("Connection: $connect");
+ $this->stdout("Host: $host");
+ $this->stdout("User: $login");
+ $this->stdout("Pass: " . str_repeat('*', strlen($password)));
+ $this->stdout("Database: $database");
+ $this->stdout("Table prefix: $prefix");
+ $this->hr();
+ $looksGood = $this->getInput('Look okay?', array('y', 'n'), 'y');
+
+ if (low($looksGood) == 'y' || low($looksGood) == 'yes') {
+ $this->bakeDbConfig($driver, $connect, $host, $login, $password, $database, $prefix);
+ } else {
+ $this->stdout('Bake Aborted.');
+ }
+ }
+/**
+ * Action to create a Model.
+ *
+ */
+ function doModel()
+ {
+ $this->hr();
+ $this->stdout('Model Bake:');
+ $this->hr();
+ $this->interactive = true;
+
+ $useTable = null;
+ $primaryKey = 'id';
+ $validate = array();
+ $associations = array();
+ $useDbConfig = 'default';
+ $this->__doList($useDbConfig);
+
+
+ $enteredModel = '';
+
+ while ($enteredModel == '') {
+ $enteredModel = $this->getInput('Enter a number from the list above, or type in the name of another model.');
+
+ if ($enteredModel == '' || intval($enteredModel) > count($this->__modelNames)) {
+ $this->stdout('Error:');
+ $this->stdout("The model name you supplied was empty, or the number \nyou selected was not an option. Please try again.");
+ $enteredModel = '';
+ }
+ }
+
+ if (intval($enteredModel) > 0 && intval($enteredModel) <= count($this->__modelNames)) {
+ $currentModelName = $this->__modelNames[intval($enteredModel) - 1];
+ } else {
+ $currentModelName = $enteredModel;
+ }
+
+ $db =& ConnectionManager::getDataSource($useDbConfig);
+
+ $useTable = Inflector::tableize($currentModelName);
+ $fullTableName = $db->fullTableName($useTable, false);
+ if (array_search($useTable, $this->__tables) === false) {
+ $this->stdout("\nGiven your model named '$currentModelName', Cake would expect a database table named '" . $fullTableName . "'.");
+ $tableIsGood = $this->getInput('do you want to use this table?', array('y','n'), 'y');
+ }
+
+ if (low($tableIsGood) == 'n' || low($tableIsGood) == 'no') {
+ $useTable = $this->getInput('What is the name of the table (enter "null" to use NO table)?');
+ }
+ $tableIsGood = false;
+ while ($tableIsGood == false && low($useTable) != 'null') {
+ if (is_array($this->__tables) && !in_array($useTable, $this->__tables)) {
+ $fullTableName = $db->fullTableName($useTable, false);
+ $this->stdout($fullTableName . ' does not exist.');
+ $useTable = $this->getInput('What is the name of the table (enter "null" to use NO table)?');
+ $tableIsGood = false;
+ } else {
+ $tableIsGood = true;
+ }
+ }
+ $wannaDoValidation = $this->getInput('Would you like to supply validation criteria for the fields in your model?', array('y','n'), 'y');
+
+ if (in_array($useTable, $this->__tables)) {
+ loadModel();
+ $tempModel = new Model(false, $useTable);
+ $modelFields = $db->describe($tempModel);
+
+ if (!array_key_exists('id', $modelFields)) {
+ foreach ($modelFields as $name => $field) {
+ break;
+ }
+ $primaryKey = $this->getInput('What is the primaryKey?', null, $name);
+ }
+ }
+ $validate = array();
+
+ if (array_search($useTable, $this->__tables) !== false && (low($wannaDoValidation) == 'y' || low($wannaDoValidation) == 'yes')) {
+ foreach ($modelFields as $name => $field) {
+ $this->stdout('');
+ $prompt = 'Name: ' . $name . "\n";
+ $prompt .= 'Type: ' . $field['type'] . "\n";
+ $prompt .= '---------------------------------------------------------------'."\n";
+ $prompt .= 'Please select one of the following validation options:'."\n";
+ $prompt .= '---------------------------------------------------------------'."\n";
+ $prompt .= "1- VALID_NOT_EMPTY\n";
+ $prompt .= "2- VALID_EMAIL\n";
+ $prompt .= "3- VALID_NUMBER\n";
+ $prompt .= "4- VALID_YEAR\n";
+ $prompt .= "5- Do not do any validation on this field.\n\n";
+ $prompt .= "... or enter in a valid regex validation string.\n\n";
+
+ if ($field['null'] == 1 || $name == $primaryKey || $name == 'created' || $name == 'modified') {
+ $validation = $this->getInput($prompt, null, '5');
+ } else {
+ $validation = $this->getInput($prompt, null, '1');
+ }
+
+ switch ($validation) {
+ case '1':
+ $validate[$name] = 'VALID_NOT_EMPTY';
+ break;
+ case '2':
+ $validate[$name] = 'VALID_EMAIL';
+ break;
+ case '3':
+ $validate[$name] = 'VALID_NUMBER';
+ break;
+ case '4':
+ $validate[$name] = 'VALID_YEAR';
+ break;
+ case '5':
+ break;
+ default:
+ $validate[$name] = $validation;
+ break;
+ }
+ }
+ }
+
+ $wannaDoAssoc = $this->getInput('Would you like to define model associations (hasMany, hasOne, belongsTo, etc.)?', array('y','n'), 'y');
+
+ if ((low($wannaDoAssoc) == 'y' || low($wannaDoAssoc) == 'yes')) {
+ $this->stdout('One moment while I try to detect any associations...');
+ $possibleKeys = array();
+ $i = 0;
+ foreach ($modelFields as $name => $field) {
+ $offset = strpos($name, '_id');
+ if ($name != $primaryKey && $offset !== false) {
+ $tmpModelName = $this->__modelNameFromKey($name);
+ $associations['belongsTo'][$i]['alias'] = $tmpModelName;
+ $associations['belongsTo'][$i]['className'] = $tmpModelName;
+ $associations['belongsTo'][$i]['foreignKey'] = $name;
+ $i++;
+ }
+ }
+ $i = 0;
+ $j = 0;
+ foreach ($this->__tables as $otherTable) {
+ $tempOtherModel = & new Model(false, $otherTable);
+ $modelFieldsTemp = $db->describe($tempOtherModel);
+ foreach ($modelFieldsTemp as $name => $field) {
+ if ($field['type'] == 'integer' || $field['type'] == 'string') {
+ $possibleKeys[$otherTable][] = $name;
+ }
+ if ($name != $primaryKey && $name == $this->__modelKey($currentModelName)) {
+ $tmpModelName = $this->__modelName($otherTable);
+ $associations['hasOne'][$j]['alias'] = $tmpModelName;
+ $associations['hasOne'][$j]['className'] = $tmpModelName;
+ $associations['hasOne'][$j]['foreignKey'] = $name;
+
+ $associations['hasMany'][$j]['alias'] = $tmpModelName;
+ $associations['hasMany'][$j]['className'] = $tmpModelName;
+ $associations['hasMany'][$j]['foreignKey'] = $name;
+ $j++;
+ }
+ }
+ $offset = strpos($otherTable, $useTable . '_');
+ if ($offset !== false) {
+ $offset = strlen($useTable . '_');
+ $tmpModelName = $this->__modelName(substr($otherTable, $offset));
+ $associations['hasAndBelongsToMany'][$i]['alias'] = $tmpModelName;
+ $associations['hasAndBelongsToMany'][$i]['className'] = $tmpModelName;
+ $associations['hasAndBelongsToMany'][$i]['foreignKey'] = $this->__modelKey($currentModelName);
+ $associations['hasAndBelongsToMany'][$i]['associationForeignKey'] = $this->__modelKey($tmpModelName);
+ $associations['hasAndBelongsToMany'][$i]['joinTable'] = $otherTable;
+ $i++;
+ }
+ $offset = strpos($otherTable, '_' . $useTable);
+ if ($offset !== false) {
+ $tmpModelName = $this->__modelName(substr($otherTable, 0, $offset));
+ $associations['hasAndBelongsToMany'][$i]['alias'] = $tmpModelName;
+ $associations['hasAndBelongsToMany'][$i]['className'] = $tmpModelName;
+ $associations['hasAndBelongsToMany'][$i]['foreignKey'] = $this->__modelKey($currentModelName);
+ $associations['hasAndBelongsToMany'][$i]['associationForeignKey'] = $this->__modelKey($tmpModelName);
+ $associations['hasAndBelongsToMany'][$i]['joinTable'] = $otherTable;
+ $i++;
+ }
+ }
+ $this->stdout('Done.');
+ $this->hr();
+ if (empty($associations)) {
+ $this->stdout('None found.');
+ } else {
+ $this->stdout('Please confirm the following associations:');
+ $this->hr();
+ if (!empty($associations['belongsTo'])) {
+ $count = count($associations['belongsTo']);
+ for ($i = 0; $i < $count; $i++) {
+ if ($currentModelName == $associations['belongsTo'][$i]['alias']) {
+ $response = $this->getInput("{$currentModelName} belongsTo {$associations['belongsTo'][$i]['alias']}\nThis looks like a self join. Do you want to specify an alternate association alias?", array('y','n'), 'y');
+ if ('y' == low($response) || 'yes' == low($response)) {
+ $associations['belongsTo'][$i]['alias'] = $this->getInput("So what is the alias?", null, $associations['belongsTo'][$i]['alias']);
+ }
+ if ($currentModelName != $associations['belongsTo'][$i]['alias']) {
+ $response = $this->getInput("$currentModelName belongsTo {$associations['belongsTo'][$i]['alias']}?", array('y','n'), 'y');
+ } else {
+ $response = 'n';
+ }
+ } else {
+ $response = $this->getInput("$currentModelName belongsTo {$associations['belongsTo'][$i]['alias']}?", array('y','n'), 'y');
+ }
+ if ('n' == low($response) || 'no' == low($response)) {
+ unset($associations['belongsTo'][$i]);
+ }
+ }
+ $associations['belongsTo'] = array_merge($associations['belongsTo']);
+ }
+
+ if (!empty($associations['hasOne'])) {
+ $count = count($associations['hasOne']);
+ for ($i = 0; $i < $count; $i++) {
+ if ($currentModelName == $associations['hasOne'][$i]['alias']) {
+ $response = $this->getInput("{$currentModelName} hasOne {$associations['hasOne'][$i]['alias']}\nThis looks like a self join. Do you want to specify an alternate association alias?", array('y','n'), 'y');
+ if ('y' == low($response) || 'yes' == low($response)) {
+ $associations['hasOne'][$i]['alias'] = $this->getInput("So what is the alias?", null, $associations['hasOne'][$i]['alias']);
+ }
+ if ($currentModelName != $associations['hasOne'][$i]['alias']) {
+ $response = $this->getInput("$currentModelName hasOne {$associations['hasOne'][$i]['alias']}?", array('y','n'), 'y');
+ } else {
+ $response = 'n';
+ }
+ } else {
+ $response = $this->getInput("$currentModelName hasOne {$associations['hasOne'][$i]['alias']}?", array('y','n'), 'y');
+ }
+ if ('n' == low($response) || 'no' == low($response)) {
+ unset($associations['hasOne'][$i]);
+ }
+ }
+ $associations['hasOne'] = array_merge($associations['hasOne']);
+ }
+
+ if (!empty($associations['hasMany'])) {
+ $count = count($associations['hasMany']);
+ for ($i = 0; $i < $count; $i++) {
+ if ($currentModelName == $associations['hasMany'][$i]['alias']) {
+ $response = $this->getInput("{$currentModelName} hasMany {$associations['hasMany'][$i]['alias']}\nThis looks like a self join. Do you want to specify an alternate association alias?", array('y','n'), 'y');
+ if ('y' == low($response) || 'yes' == low($response)) {
+ $associations['hasMany'][$i]['alias'] = $this->getInput("So what is the alias?", null, $associations['hasMany'][$i]['alias']);
+ }
+ if ($currentModelName != $associations['hasMany'][$i]['alias']) {
+ $response = $this->getInput("$currentModelName hasMany {$associations['hasMany'][$i]['alias']}?", array('y','n'), 'y');
+ } else {
+ $response = 'n';
+ }
+ } else {
+ $response = $this->getInput("$currentModelName hasMany {$associations['hasMany'][$i]['alias']}?", array('y','n'), 'y');
+ }
+ if ('n' == low($response) || 'no' == low($response)) {
+ unset($associations['hasMany'][$i]);
+ }
+ }
+ $associations['hasMany'] = array_merge($associations['hasMany']);
+ }
+
+ if (!empty($associations['hasAndBelongsToMany'])) {
+ $count = count($associations['hasAndBelongsToMany']);
+ for ($i = 0; $i < $count; $i++) {
+ if ($currentModelName == $associations['hasAndBelongsToMany'][$i]['alias']) {
+ $response = $this->getInput("{$currentModelName} hasAndBelongsToMany {$associations['hasAndBelongsToMany'][$i]['alias']}\nThis looks like a self join. Do you want to specify an alternate association alias?", array('y','n'), 'y');
+ if ('y' == low($response) || 'yes' == low($response)) {
+ $associations['hasAndBelongsToMany'][$i]['alias'] = $this->getInput("So what is the alias?", null, $associations['hasAndBelongsToMany'][$i]['alias']);
+ }
+ if ($currentModelName != $associations['hasAndBelongsToMany'][$i]['alias']) {
+ $response = $this->getInput("$currentModelName hasAndBelongsToMany {$associations['hasAndBelongsToMany'][$i]['alias']}?", array('y','n'), 'y');
+ } else {
+ $response = 'n';
+ }
+ } else {
+ $response = $this->getInput("$currentModelName hasAndBelongsToMany {$associations['hasAndBelongsToMany'][$i]['alias']}?", array('y','n'), 'y');
+ }
+ if ('n' == low($response) || 'no' == low($response)) {
+ unset($associations['hasAndBelongsToMany'][$i]);
+ }
+ }
+ $associations['hasAndBelongsToMany'] = array_merge($associations['hasAndBelongsToMany']);
+ }
+ }
+ $wannaDoMoreAssoc = $this->getInput('Would you like to define some additional model associations?', array('y','n'), 'y');
+
+ while ((low($wannaDoMoreAssoc) == 'y' || low($wannaDoMoreAssoc) == 'yes')) {
+ $assocs = array(1=>'belongsTo', 2=>'hasOne', 3=>'hasMany', 4=>'hasAndBelongsToMany');
+ $bad = true;
+ while ($bad) {
+ $this->stdout('What is the association type?');
+ $prompt = "1- belongsTo\n";
+ $prompt .= "2- hasOne\n";
+ $prompt .= "3- hasMany\n";
+ $prompt .= "4- hasAndBelongsToMany\n";
+ $assocType = intval($this->getInput($prompt, null, null));
+
+ if (intval($assocType) < 1 || intval($assocType) > 4) {
+ $this->stdout('The selection you entered was invalid. Please enter a number between 1 and 4.');
+ } else {
+ $bad = false;
+ }
+ }
+ $this->stdout('For the following options be very careful to match your setup exactly. Any spelling mistakes will cause errors.');
+ $this->hr();
+ $associationName = $this->getInput('What is the name of this association?');
+ $className = $this->getInput('What className will '.$associationName.' use?', null, $associationName );
+ $suggestedForeignKey = null;
+ if ($assocType == '1') {
+ $showKeys = $possibleKeys[$useTable];
+ $suggestedForeignKey = $this->__modelKey($associationName);
+ } else {
+ $otherTable = Inflector::tableize($className);
+ if (in_array($otherTable, $this->__tables)) {
+ if ($assocType < '4') {
+ $showKeys = $possibleKeys[$otherTable];
+ } else {
+ $showKeys = null;
+ }
+ } else {
+ $otherTable = $this->getInput('What is the table for this class?');
+ $showKeys = $possibleKeys[$otherTable];
+ }
+ $suggestedForeignKey = $this->__modelKey($currentModelName);
+ }
+ if (!empty($showKeys)) {
+ $this->stdout('A helpful List of possible keys');
+ for ($i = 0; $i < count($showKeys); $i++) {
+ $this->stdout($i + 1 . ". " . $showKeys[$i]);
+ }
+ $foreignKey = $this->getInput('What is the foreignKey? Choose a number.');
+ if (intval($foreignKey) > 0 && intval($foreignKey) <= $i ) {
+ $foreignKey = $showKeys[intval($foreignKey) - 1];
+ }
+ }
+ if (!isset($foreignKey)) {
+ $foreignKey = $this->getInput('What is the foreignKey? Specify your own.', null, $suggestedForeignKey);
+ }
+ if ($assocType == '4') {
+ $associationForeignKey = $this->getInput('What is the associationForeignKey?', null, $this->__modelKey($currentModelName));
+ $joinTable = $this->getInput('What is the joinTable?');
+ }
+ $associations[$assocs[$assocType]] = array_values($associations[$assocs[$assocType]]);
+ $count = count($associations[$assocs[$assocType]]);
+ $i = ($count > 0) ? $count : 0;
+ $associations[$assocs[$assocType]][$i]['alias'] = $associationName;
+ $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->getInput('Define another association?', array('y','n'), 'y');
+ }
+ }
+ $this->stdout('');
+ $this->hr();
+ $this->stdout('The following model will be created:');
+ $this->hr();
+ $this->stdout("Model Name: $currentModelName");
+ $this->stdout("DB Connection: " . ($usingDefault ? 'default' : $useDbConfig));
+ $this->stdout("DB Table: " . $fullTableName);
+ if ($primaryKey != 'id') {
+ $this->stdout("Primary Key: " . $primaryKey);
+ }
+ $this->stdout("Validation: " . print_r($validate, true));
+
+ if (!empty($associations)) {
+ $this->stdout("Associations:");
+
+ if (count($associations['belongsTo'])) {
+ for ($i = 0; $i < count($associations['belongsTo']); $i++) {
+ $this->stdout(" $currentModelName belongsTo {$associations['belongsTo'][$i]['alias']}");
+ }
+ }
+
+ if (count($associations['hasOne'])) {
+ for ($i = 0; $i < count($associations['hasOne']); $i++) {
+ $this->stdout(" $currentModelName hasOne {$associations['hasOne'][$i]['alias']}");
+ }
+ }
+
+ if (count($associations['hasMany'])) {
+ for ($i = 0; $i < count($associations['hasMany']); $i++) {
+ $this->stdout(" $currentModelName hasMany {$associations['hasMany'][$i]['alias']}");
+ }
+ }
+
+ if (count($associations['hasAndBelongsToMany'])) {
+ for ($i = 0; $i < count($associations['hasAndBelongsToMany']); $i++) {
+ $this->stdout(" $currentModelName hasAndBelongsToMany {$associations['hasAndBelongsToMany'][$i]['alias']}");
+ }
+ }
+ }
+ $this->hr();
+ $looksGood = $this->getInput('Look okay?', array('y','n'), 'y');
+
+ if (low($looksGood) == 'y' || low($looksGood) == 'yes') {
+ if ($useTable == Inflector::tableize($currentModelName)) {
+ $useTable = null;
+ }
+ $this->bakeModel($currentModelName, $useDbConfig, $useTable, $primaryKey, $validate, $associations);
+
+ if ($this->doUnitTest()) {
+ $this->bakeUnitTest('model', $currentModelName);
+ }
+ } else {
+ $this->stdout('Bake Aborted.');
+ }
+ }
+/**
+ * Action to create a View.
+ *
+ */
+ function doView() {
+ $this->hr();
+ $this->stdout('View Bake:');
+ $this->hr();
+ $uses = array();
+ $wannaUseSession = 'y';
+ $wannaDoScaffold = 'y';
+
+
+ $useDbConfig = 'default';
+ $this->__doList($useDbConfig, 'Controllers');
+
+ $enteredController = '';
+
+ while ($enteredController == '') {
+ $enteredController = $this->getInput('Enter a number from the list above, or type in the name of another controller.');
+
+ if ($enteredController == '' || intval($enteredController) > count($this->__controllerNames)) {
+ $this->stdout('Error:');
+ $this->stdout("The Controller name you supplied was empty, or the number \nyou selected was not an option. Please try again.");
+ $enteredController = '';
+ }
+ }
+
+ if (intval($enteredController) > 0 && intval($enteredController) <= count($this->__controllerNames) ) {
+ $controllerName = $this->__controllerNames[intval($enteredController) - 1];
+ } else {
+ $controllerName = Inflector::camelize($enteredController);
+ }
+
+ $controllerPath = low(Inflector::underscore($controllerName));
+
+ $doItInteractive = $this->getInput("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite {$controllerClassName} views if it exist.", array('y','n'), 'y');
+
+ if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') {
+ $this->interactive = true;
+ $wannaDoScaffold = $this->getInput("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');
+ }
+
+ $admin = null;
+ $admin_url = null;
+ if (low($wannaDoScaffold) == 'y' || low($wannaDoScaffold) == 'yes') {
+ $wannaDoAdmin = $this->getInput("Would you like to create the views for admin routing?", array('y','n'), 'n');
+ }
+
+ if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) {
+ require(CONFIGS.'core.php');
+ if (defined('CAKE_ADMIN')) {
+ $admin = CAKE_ADMIN . '_';
+ $admin_url = '/'.CAKE_ADMIN;
+ } else {
+ $adminRoute = '';
+ $this->stdout('You need to enable CAKE_ADMIN in /app/config/core.php to use admin routing.');
+ $this->stdout('What would you like the admin route to be?');
+ $this->stdout('Example: www.example.com/admin/controller');
+ while ($adminRoute == '') {
+ $adminRoute = $this->getInput("What would you like the admin route to be?", null, 'admin');
+ }
+ if ($this->__addAdminRoute($adminRoute) !== true) {
+ $this->stdout('Unable to write to /app/config/core.php.');
+ $this->stdout('You need to enable CAKE_ADMIN in /app/config/core.php to use admin routing.');
+ exit();
+ } else {
+ $admin = $adminRoute . '_';
+ $admin_url = '/'.$adminRoute;
+ }
+ }
+ }
+ if (low($wannaDoScaffold) == 'y' || low($wannaDoScaffold) == 'yes') {
+ $file = CONTROLLERS . $controllerPath . '_controller.php';
+
+ if (!file_exists($file)) {
+ $shortPath = str_replace(ROOT, null, $file);
+ $shortPath = str_replace('../', '', $shortPath);
+ $shortPath = str_replace('//', '/', $shortPath);
+ $this->stdout('');
+ $this->stdout("The file '$shortPath' could not be found.\nIn order to scaffold, you'll need to first create the controller. ");
+ $this->stdout('');
+ die();
+ } else {
+ uses('controller'.DS.'controller');
+ loadController($controllerName);
+ if ($admin) {
+ $this->__bakeViews($controllerName, $controllerPath, $admin, $admin_url);
+ }
+ $this->__bakeViews($controllerName, $controllerPath, null, null);
+
+ $this->hr();
+ $this->stdout('');
+ $this->stdout('View Scaffolding Complete.'."\n");
+ }
+ } else {
+ $actionName = '';
+
+ while ($actionName == '') {
+ $actionName = $this->getInput('Action Name? (use camelCased function name)');
+
+ if ($actionName == '') {
+ $this->stdout('The action name you supplied was empty. Please try again.');
+ }
+ }
+ $this->stdout('');
+ $this->hr();
+ $this->stdout('The following view will be created:');
+ $this->hr();
+ $this->stdout("Controller Name: $controllerName");
+ $this->stdout("Action Name: $actionName");
+ $this->stdout("Path: app/views/" . $controllerPath . DS . Inflector::underscore($actionName) . '.thtml');
+ $this->hr();
+ $looksGood = $this->getInput('Look okay?', array('y','n'), 'y');
+
+ if (low($looksGood) == 'y' || low($looksGood) == 'yes') {
+ $this->bakeView($controllerName, $actionName);
+ } else {
+ $this->stdout('Bake Aborted.');
+ }
+ }
+ }
+
+ function __bakeViews($controllerName, $controllerPath, $admin= null, $admin_url = null) {
+ $controllerClassName = $controllerName.'Controller';
+ $controllerObj = & new $controllerClassName();
+
+ if (!in_array('Html', $controllerObj->helpers)) {
+ $controllerObj->helpers[] = 'Html';
+ }
+ if (!in_array('Form', $controllerObj->helpers)) {
+ $controllerObj->helpers[] = 'Form';
+ }
+
+ $controllerObj->constructClasses();
+ $currentModelName = $controllerObj->modelClass;
+ $this->__modelClass = $currentModelName;
+ $modelKey = Inflector::underscore($currentModelName);
+ $modelObj =& ClassRegistry::getObject($modelKey);
+ $singularName = $this->__singularName($currentModelName);
+ $pluralName = $this->__pluralName($currentModelName);
+ $singularHumanName = $this->__singularHumanName($currentModelName);
+ $pluralHumanName = $this->__pluralHumanName($controllerName);
+
+ $fieldNames = $controllerObj->generateFieldNames(null, false);
+ $indexView = null;
+
+ if (!empty($modelObj->alias)) {
+ foreach ($modelObj->alias as $key => $value) {
+ $alias[] = $key;
+ }
+ }
+ $indexView .= "\n";
+ $indexView .= "
List " . $pluralHumanName . " \n\n";
+ $indexView .= "
\n";
+ $indexView .= "\n";
+
+ foreach ($fieldNames as $fieldName) {
+ $indexView .= "\t".$fieldName['prompt']." \n";
+ }
+ $indexView .= "\tActions \n";
+ $indexView .= " \n";
+ $indexView .= "\n";
+ $indexView .= "\n";
+ $count = 0;
+ foreach ($fieldNames as $field => $value) {
+ if (isset($value['foreignKey'])) {
+ $otherModelName = $this->__modelName($value['model']);
+ $otherModelKey = Inflector::underscore($otherModelName);
+ $otherModelObj =& ClassRegistry::getObject($otherModelKey);
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ if (is_object($otherModelObj)) {
+ $displayField = $otherModelObj->getDisplayField();
+ $indexView .= "\t link(\$".$singularName."['{$alias[$count]}']['{$displayField}'], '{$admin_url}/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?> \n";
+ } else {
+ $indexView .= "\tname}']['{$field}']; ?> \n";
+ }
+ $count++;
+ } else {
+ $indexView .= "\tname}']['{$field}']; ?> \n";
+ }
+ }
+ $indexView .= "\t\n";
+ $indexView .= "\t\tlink('View','{$admin_url}/{$controllerPath}/view/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n";
+ $indexView .= "\t\tlink('Edit','{$admin_url}/{$controllerPath}/edit/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n";
+ $indexView .= "\t\tlink('Delete','{$admin_url}/{$controllerPath}/delete/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'], null, 'Are you sure you want to delete id ' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n";
+ $indexView .= "\t \n";
+ $indexView .= " \n";
+ $indexView .= "\n";
+ $indexView .= "
\n\n";
+ $indexView .= "
\n";
+ $indexView .= "\tlink('New {$singularHumanName}', '{$admin_url}/{$controllerPath}/add'); ?> \n";
+ $indexView .= " \n";
+ $indexView .= "
";
+ $viewView = null;
+ $viewView .= "\n";
+ $viewView .= "
View " . $singularHumanName . " \n\n";
+ $viewView .= "
\n";
+ $count = 0;
+ foreach ($fieldNames as $field => $value) {
+ $viewView .= "\t" . $value['prompt'] . " \n";
+ if (isset($value['foreignKey'])) {
+ $otherModelName = $this->__modelName($value['model']);
+ $otherModelKey = Inflector::underscore($otherModelName);
+ $otherModelObj =& ClassRegistry::getObject($otherModelKey);
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ $displayField = $otherModelObj->getDisplayField();
+ $viewView .= "\t link(\$".$singularName."['{$alias[$count]}']['{$displayField}'], '{$admin_url}/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?> \n";
+ $count++;
+ } else {
+ $viewView .= "\t name}']['{$field}']?> \n";
+ }
+ }
+ $viewView .= " \n";
+ $viewView .= "
\n";
+ $viewView .= "\tlink('Edit " . $singularHumanName . "', '{$admin_url}/{$controllerPath}/edit/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}']) ?> \n";
+ $viewView .= "\tlink('Delete " . $singularHumanName . "', '{$admin_url}/{$controllerPath}/delete/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'], null, 'Are you sure you want to delete: id ' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'] . '?') ?> \n";
+ $viewView .= "\tlink('List " . $pluralHumanName ."', '{$admin_url}/{$controllerPath}/index') ?> \n";
+ $viewView .= "\tlink('New " . $singularHumanName . "', '{$admin_url}/{$controllerPath}/add') ?> \n";
+ foreach ( $fieldNames as $field => $value ) {
+ if ( isset( $value['foreignKey'] ) ) {
+ $otherModelName = $this->__modelName($value['model']);
+ if ($otherModelName != $currentModelName) {
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ $otherSingularHumanName = $this->__singularHumanName($value['controller']);
+ $otherPluralHumanName = $this->__pluralHumanName($value['controller']);
+ $viewView .= "\tlink('List " . $otherSingularHumanName . "', '{$admin_url}/" . $otherControllerPath . "/index/')?> \n";
+ $viewView .= "\tlink('New " . $otherPluralHumanName . "', '{$admin_url}/" . $otherControllerPath . "/add/')?> \n";
+ }
+ }
+ }
+ $viewView .= " \n\n";
+
+ $viewView .= "
\n";
+
+
+ foreach ($modelObj->hasOne as $associationName => $relation) {
+ $new = true;
+
+ $otherModelName = $this->__modelName($relation['className']);
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralHumanName = $this->__pluralHumanName($associationName);
+ $otherSingularHumanName = $this->__singularHumanName($associationName);
+
+ $viewView .= "\n";
+ }
+ $relations = array_merge($modelObj->hasMany, $modelObj->hasAndBelongsToMany);
+
+ foreach ($relations as $associationName => $relation) {
+ $otherModelName = $this->__modelName($relation['className']);
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralHumanName = $this->__pluralHumanName($associationName);
+ $otherSingularHumanName = $this->__singularHumanName($associationName);
+ $otherModelKey = Inflector::underscore($otherModelName);
+ $otherModelObj =& ClassRegistry::getObject($otherModelKey);
+
+ $viewView .= "\n";
+ }
+ $addView = null;
+ $addView .= "New " . $singularHumanName . " \n";
+ $addView .= "\n";
+ $addView .= "\n";
+ $addView .= "link('List {$pluralHumanName}', '{$admin_url}/{$controllerPath}/index')?> \n";
+ foreach ($modelObj->belongsTo as $associationName => $relation) {
+ $otherModelName = $this->__modelName($associationName);
+ if ($otherModelName != $currentModelName) {
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralHumanName($associationName);
+ $addView .= "link('View " . $otherPluralName . "', '{$admin_url}/" .$otherControllerPath."/index/');?> \n";
+ $addView .= "link('Add " . $otherPluralName . "', '{$admin_url}/" .$otherControllerPath."/add/');?> \n";
+ }
+ }
+ $addView .= " \n";
+ $editView = null;
+ $editView .= "Edit " . $singularHumanName . " \n";
+ $editView .= "\n";
+ $editView .= "\n";
+ $editView .= "link('Delete','{$admin_url}/{$controllerPath}/delete/' . \$html->tagValue('{$modelObj->name}/{$modelObj->primaryKey}'), null, 'Are you sure you want to delete: id ' . \$html->tagValue('{$modelObj->name}/{$modelObj->primaryKey}'));?>\n";
+ $editView .= " link('List {$pluralHumanName}', '{$admin_url}/{$controllerPath}/index')?> \n";
+ foreach ($modelObj->belongsTo as $associationName => $relation) {
+ $otherModelName = $this->__modelName($associationName);
+ if ($otherModelName != $currentModelName) {
+ $otherControllerName = $this->__controllerName($otherModelName);
+ $otherControllerPath = $this->__controllerPath($otherControllerName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralHumanName($associationName);
+ $editView .= "link('View " . $otherPluralName . "', '{$admin_url}/" .$otherControllerPath."/index/');?> \n";
+ $editView .= "link('Add " . $otherPluralName . "', '{$admin_url}/" .$otherControllerPath."/add/');?> \n";
+ }
+ }
+ $editView .= " \n";
+
+ if (!file_exists(VIEWS.$controllerPath)) {
+ mkdir(VIEWS.$controllerPath);
+ }
+ $filename = VIEWS . $controllerPath . DS . $admin . 'index.thtml';
+ $this->__createFile($filename, $indexView);
+ $filename = VIEWS . $controllerPath . DS . $admin . 'view.thtml';
+ $this->__createFile($filename, $viewView);
+ $filename = VIEWS . $controllerPath . DS . $admin . 'add.thtml';
+ $this->__createFile($filename, $addView);
+ $filename = VIEWS . $controllerPath . DS . $admin . 'edit.thtml';
+ $this->__createFile($filename, $editView);
+ }
+/**
+ * Action to create a Controller.
+ *
+ */
+ function doController() {
+ $this->hr();
+ $this->stdout('Controller Bake:');
+ $this->hr();
+ $uses = array();
+ $helpers = array();
+ $components = array();
+ $wannaUseSession = 'y';
+ $wannaDoScaffolding = 'y';
+
+ $useDbConfig = 'default';
+ $this->__doList($useDbConfig, 'Controllers');
+
+ $enteredController = '';
+
+ while ($enteredController == '') {
+ $enteredController = $this->getInput('Enter a number from the list above, or type in the name of another controller.');
+
+ if ($enteredController == '' || intval($enteredController) > count($this->__controllerNames)) {
+ $this->stdout('Error:');
+ $this->stdout("The Controller name you supplied was empty, or the number \nyou selected was not an option. Please try again.");
+ $enteredController = '';
+ }
+ }
+
+ if (intval($enteredController) > 0 && intval($enteredController) <= count($this->__controllerNames) ) {
+ $controllerName = $this->__controllerNames[intval($enteredController) - 1];
+ } else {
+ $controllerName = Inflector::camelize($enteredController);
+ }
+
+ $controllerPath = low(Inflector::underscore($controllerName));
+
+ $doItInteractive = $this->getInput("Would you like bake to build your controller interactively?\nWarning: Choosing no will overwrite {$controllerClassName} controller if it exist.", array('y','n'), 'y');
+
+ if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') {
+ $this->interactive = true;
+
+ $wannaUseScaffold = $this->getInput("Would you like to use scaffolding?", array('y','n'), 'y');
+
+ if (low($wannaUseScaffold) == 'n' || low($wannaUseScaffold) == 'no') {
+
+ $wannaDoScaffolding = $this->getInput("Would you like to include some basic class methods (index(), add(), view(), edit())?", array('y','n'), 'n');
+
+ if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') {
+ $wannaDoAdmin = $this->getInput("Would you like to create the methods for admin routing?", array('y','n'), 'n');
+ }
+
+ $wannaDoUses = $this->getInput("Would you like this controller to use other models besides '" . $this->__modelName($controllerName) . "'?", array('y','n'), 'n');
+
+ if (low($wannaDoUses) == 'y' || low($wannaDoUses) == 'yes') {
+ $usesList = $this->getInput("Please provide a comma separated list of the classnames of other models you'd like to use.\nExample: 'Author, Article, Book'");
+ $usesListTrimmed = str_replace(' ', '', $usesList);
+ $uses = explode(',', $usesListTrimmed);
+ }
+ $wannaDoHelpers = $this->getInput("Would you like this controller to use other helpers besides HtmlHelper and FormHelper?", array('y','n'), 'n');
+
+ if (low($wannaDoHelpers) == 'y' || low($wannaDoHelpers) == 'yes') {
+ $helpersList = $this->getInput("Please provide a comma separated list of the other helper names you'd like to use.\nExample: 'Ajax, Javascript, Time'");
+ $helpersListTrimmed = str_replace(' ', '', $helpersList);
+ $helpers = explode(',', $helpersListTrimmed);
+ }
+ $wannaDoComponents = $this->getInput("Would you like this controller to use any components?", array('y','n'), 'n');
+
+ if (low($wannaDoComponents) == 'y' || low($wannaDoComponents) == 'yes') {
+ $componentsList = $this->getInput("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, MyNiftyHelper'");
+ $componentsListTrimmed = str_replace(' ', '', $componentsList);
+ $components = explode(',', $componentsListTrimmed);
+ }
+
+ $wannaUseSession = $this->getInput("Would you like to use Sessions?", array('y','n'), 'y');
+ } else {
+ $wannaDoScaffolding = 'n';
+ }
+ } else {
+ $wannaDoScaffolding = $this->getInput("Would you like to include some basic class methods (index(), add(), view(), edit())?", array('y','n'), 'y');
+
+ if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') {
+ $wannaDoAdmin = $this->getInput("Would you like to create the methods for admin routing?", array('y','n'), 'y');
+ }
+ }
+
+ $admin = null;
+ $admin_url = null;
+ if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) {
+ require(CONFIGS.'core.php');
+ if (defined('CAKE_ADMIN')) {
+ $admin = CAKE_ADMIN.'_';
+ $admin_url = '/'.CAKE_ADMIN;
+ } else {
+ $adminRoute = '';
+ $this->stdout('You need to enable CAKE_ADMIN in /app/config/core.php to use admin routing.');
+ $this->stdout('What would you like the admin route to be?');
+ $this->stdout('Example: www.example.com/admin/controller');
+ while ($adminRoute == '') {
+ $adminRoute = $this->getInput("What would you like the admin route to be?", null, 'admin');
+ }
+ if ($this->__addAdminRoute($adminRoute) !== true) {
+ $this->stdout('Unable to write to /app/config/core.php.');
+ $this->stdout('You need to enable CAKE_ADMIN in /app/config/core.php to use admin routing.');
+ exit();
+ } else {
+ $admin = $adminRoute . '_';
+ $admin_url = '/'.$adminRoute;
+ }
+ }
+ }
+
+ if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') {
+ $actions = $this->__bakeActions($controllerName, null, null, $wannaUseSession);
+ if ($admin) {
+ $actions .= $this->__bakeActions($controllerName, $admin, $admin_url, $wannaUseSession);
+ }
+ }
+
+ if ($this->interactive === true) {
+ $this->stdout('');
+ $this->hr();
+ $this->stdout('The following controller will be created:');
+ $this->hr();
+ $this->stdout("Controller Name: $controllerName");
+ if (low($wannaUseScaffold) == 'y' || low($wannaUseScaffold) == 'yes') {
+ $this->stdout(" var \$scaffold;");
+ }
+ if (count($uses)) {
+ $this->stdout("Uses: ", false);
+
+ foreach ($uses as $use) {
+ if ($use != $uses[count($uses) - 1]) {
+ $this->stdout(ucfirst($use) . ", ", false);
+ } else {
+ $this->stdout(ucfirst($use));
+ }
+ }
+ }
+
+ if (count($helpers)) {
+ $this->stdout("Helpers: ", false);
+
+ foreach ($helpers as $help) {
+ if ($help != $helpers[count($helpers) - 1]) {
+ $this->stdout(ucfirst($help) . ", ", false);
+ } else {
+ $this->stdout(ucfirst($help));
+ }
+ }
+ }
+
+ if (count($components)) {
+ $this->stdout("Components: ", false);
+
+ foreach ($components as $comp) {
+ if ($comp != $components[count($components) - 1]) {
+ $this->stdout(ucfirst($comp) . ", ", false);
+ } else {
+ $this->stdout(ucfirst($comp));
+ }
+ }
+ }
+ $this->hr();
+ $looksGood = $this->getInput('Look okay?', array('y','n'), 'y');
+
+ if (low($looksGood) == 'y' || low($looksGood) == 'yes') {
+ $this->bakeController($controllerName, $uses, $helpers, $components, $actions, $wannaUseScaffold);
+
+ if ($this->doUnitTest()) {
+ $this->bakeUnitTest('controller', $controllerName);
+ }
+ } else {
+ $this->stdout('Bake Aborted.');
+ }
+ } else {
+ $this->bakeController($controllerName, $uses, $helpers, $components, $actions, $wannaUseScaffold);
+ if ($this->doUnitTest()) {
+ $this->bakeUnitTest('controller', $controllerName);
+ }
+ exit();
+ }
+ }
+
+ function __bakeActions($controllerName, $admin = null, $admin_url = null, $wannaUseSession = 'y') {
+ $currentModelName = $this->__modelName($controllerName);
+ loadModel($currentModelName);
+ $modelObj =& new $currentModelName();
+ $controllerPath = $this->__controllerPath($controllerName);
+ $pluralName = $this->__pluralName($currentModelName);
+ $singularName = $this->__singularName($currentModelName);
+ $singularHumanName = $this->__singularHumanName($currentModelName);
+ $pluralHumanName = $this->__pluralHumanName($controllerName);
+ if (!class_exists($currentModelName)) {
+ $this->stdout('You must have a model for this class to build scaffold methods. Please try again.');
+ exit;
+ }
+ $actions .= "\n";
+ $actions .= "\tfunction {$admin}index() {\n";
+ $actions .= "\t\t\$this->{$currentModelName}->recursive = 0;\n";
+ $actions .= "\t\t\$this->set('{$pluralName}', \$this->{$currentModelName}->findAll());\n";
+ $actions .= "\t}\n";
+ $actions .= "\n";
+ $actions .= "\tfunction {$admin}view(\$id = null) {\n";
+ $actions .= "\t\tif (!\$id) {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}.');\n";
+ $actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index');\n";
+ } else {
+ $actions .= "\t\t\t\$this->flash('Invalid id for {$singularHumanName}', '{$admin_url}/{$controllerPath}/index');\n";
+ }
+ $actions .= "\t\t}\n";
+ $actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n";
+ $actions .= "\t}\n";
+ $actions .= "\n";
+ $actions .= "\tfunction {$admin}add() {\n";
+ $actions .= "\t\tif (empty(\$this->data)) {\n";
+
+ foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $selectedOtherPluralName = 'selected' . ucfirst($otherPluralName);
+ $actions .= "\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ $actions .= "\t\t\t\$this->set('{$selectedOtherPluralName}', null);\n";
+ }
+ }
+ foreach ($modelObj->belongsTo as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $actions .= "\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ }
+ }
+ $actions .= "\t\t\t\$this->render();\n";
+ $actions .= "\t\t} else {\n";
+ $actions .= "\t\t\t\$this->cleanUpFields();\n";
+ $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\t\$this->Session->setFlash('The ".$this->__singularHumanName($currentModelName)." has been saved');\n";
+ $actions .= "\t\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index');\n";
+ } else {
+ $actions .= "\t\t\t\t\$this->flash('{$currentModelName} saved.', '{$admin_url}/{$controllerPath}/index');\n";
+ }
+ $actions .= "\t\t\t} else {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\t\$this->Session->setFlash('Please correct errors below.');\n";
+ }
+
+ foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $selectedOtherPluralName = 'selected' . ucfirst($otherPluralName);
+ $actions .= "\t\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ $actions .= "\t\t\t\tif (empty(\$this->data['{$associationName}']['{$associationName}'])) { \$this->data['{$associationName}']['{$associationName}'] = null; }\n";
+ $actions .= "\t\t\t\t\$this->set('{$selectedOtherPluralName}', \$this->data['{$associationName}']['{$associationName}']);\n";
+ }
+ }
+ foreach ($modelObj->belongsTo as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $actions .= "\t\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ }
+ }
+ $actions .= "\t\t\t}\n";
+ $actions .= "\t\t}\n";
+ $actions .= "\t}\n";
+ $actions .= "\n";
+ $actions .= "\tfunction {$admin}edit(\$id = null) {\n";
+ $actions .= "\t\tif (empty(\$this->data)) {\n";
+ $actions .= "\t\t\tif (!\$id) {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}');\n";
+ $actions .= "\t\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index');\n";
+ } else {
+ $actions .= "\t\t\t\t\$this->flash('Invalid id for {$singularHumanName}', '{$admin_url}/{$controllerPath}/index');\n";
+ }
+ $actions .= "\t\t\t}\n";
+ $actions .= "\t\t\t\$this->data = \$this->{$currentModelName}->read(null, \$id);\n";
+
+ foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $otherModelKey = Inflector::underscore($otherModelName);
+ $otherModelObj =& ClassRegistry::getObject($otherModelKey);
+ $selectedOtherPluralName = 'selected' . ucfirst($otherPluralName);
+ $actions .= "\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ $actions .= "\t\t\tif (empty(\$this->data['{$associationName}'])) { \$this->data['{$associationName}'] = null; }\n";
+ $actions .= "\t\t\t\$this->set('{$selectedOtherPluralName}', \$this->_selectedArray(\$this->data['{$associationName}']));\n";
+ }
+ }
+ foreach ($modelObj->belongsTo as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $actions .= "\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ }
+ }
+ $actions .= "\t\t} else {\n";
+ $actions .= "\t\t\t\$this->cleanUpFields();\n";
+ $actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\t\$this->Session->setFlash('The ".Inflector::humanize($currentModelName)." has been saved');\n";
+ $actions .= "\t\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index');\n";
+ } else {
+ $actions .= "\t\t\t\t\$this->flash('{$currentModelName} saved.', '{$admin_url}/{$controllerPath}/index');\n";
+ }
+ $actions .= "\t\t\t} else {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\t\$this->Session->setFlash('Please correct errors below.');\n";
+ }
+
+ foreach ($modelObj->hasAndBelongsToMany as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $selectedOtherPluralName = 'selected' . ucfirst($otherPluralName);
+ $actions .= "\t\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ $actions .= "\t\t\t\tif (empty(\$this->data['{$associationName}']['{$associationName}'])) { \$this->data['{$associationName}']['{$associationName}'] = null; }\n";
+ $actions .= "\t\t\t\t\$this->set('{$selectedOtherPluralName}', \$this->data['{$associationName}']['{$associationName}']);\n";
+ }
+ }
+ foreach ($modelObj->belongsTo as $associationName => $relation) {
+ if (!empty($associationName)) {
+ $otherModelName = $this->__modelName($associationName);
+ $otherSingularName = $this->__singularName($associationName);
+ $otherPluralName = $this->__pluralName($associationName);
+ $actions .= "\t\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n";
+ }
+ }
+ $actions .= "\t\t\t}\n";
+ $actions .= "\t\t}\n";
+ $actions .= "\t}\n";
+ $actions .= "\n";
+ $actions .= "\tfunction {$admin}delete(\$id = null) {\n";
+ $actions .= "\t\tif (!\$id) {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}');\n";
+ $actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index');\n";
+ } else {
+ $actions .= "\t\t\t\$this->flash('Invalid id for {$singularHumanName}', '{$admin_url}/{$controllerPath}/index');\n";
+ }
+ $actions .= "\t\t}\n";
+ $actions .= "\t\tif (\$this->{$currentModelName}->del(\$id)) {\n";
+ if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
+ $actions .= "\t\t\t\$this->Session->setFlash('The ".$this->__singularHumanName($currentModelName)." deleted: id '.\$id.'');\n";
+ $actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index');\n";
+ } else {
+ $actions .= "\t\t\t\$this->flash('{$currentModelName} deleted: id '.\$id.'.', '{$admin_url}/{$controllerPath}/index');\n";
+ }
+ $actions .= "\t\t}\n";
+ $actions .= "\t}\n";
+ $actions .= "\n";
+ return $actions;
+ }
+/**
+ * Action to create a Unit Test.
+ *
+ * @return Success
+ */
+ function doUnitTest() {
+ if (is_dir(VENDORS.'simpletest') || is_dir(ROOT.DS.APP_DIR.DS.'vendors'.DS.'simpletest')) {
+ return true;
+ }
+ $unitTest = $this->getInput('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->stdout("\nYou can download the Cake test suite from http://cakeforge.org/projects/testsuite/", true);
+ }
+ return $result;
+ }
+/**
+ * Creates a database configuration file for Bake.
+ *
+ * @param string $host
+ * @param string $login
+ * @param string $password
+ * @param string $database
+ */
+ function bakeDbConfig( $driver, $connect, $host, $login, $password, $database, $prefix) {
+ $out = " '{$driver}',\n";
+ $out .= "\t\t'connect' => '{$connect}',\n";
+ $out .= "\t\t'host' => '{$host}',\n";
+ $out .= "\t\t'login' => '{$login}',\n";
+ $out .= "\t\t'password' => '{$password}',\n";
+ $out .= "\t\t'database' => '{$database}', \n";
+ $out .= "\t\t'prefix' => '{$prefix}' \n";
+ $out .= "\t);\n";
+ $out .= "}\n";
+ $out .= "?>";
+ $filename = CONFIGS.'database.php';
+ $this->__createFile($filename, $out);
+ }
+/**
+ * Assembles and writes a Model file.
+ *
+ * @param string $name
+ * @param object $useDbConfig
+ * @param string $useTable
+ * @param string $primaryKey
+ * @param array $validate
+ * @param array $associations
+ */
+ function bakeModel($name, $useDbConfig = 'default', $useTable = null, $primaryKey = 'id', $validate=array(), $associations=array()) {
+ $out = " " . $validate[$keys[$i]] . ",\n";
+ }
+ $out .= "\t);\n";
+ }
+ $out .= "\n";
+
+ if (!empty($associations)) {
+ $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";
+
+ for ($i = 0; $i < count($associations['belongsTo']); $i++) {
+ $out .= "\t\t\t'{$associations['belongsTo'][$i]['alias']}' =>\n";
+ $out .= "\t\t\t\tarray('className' => '{$associations['belongsTo'][$i]['className']}',\n";
+ $out .= "\t\t\t\t\t\t'foreignKey' => '{$associations['belongsTo'][$i]['foreignKey']}',\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'counterCache' => ''\n";
+ $out .= "\t\t\t\t),\n\n";
+ }
+ $out .= "\t);\n\n";
+ }
+
+ if (!empty($associations['hasOne'])) {
+ $out .= "\tvar \$hasOne = array(\n";
+
+ for ($i = 0; $i < count($associations['hasOne']); $i++) {
+ $out .= "\t\t\t'{$associations['hasOne'][$i]['alias']}' =>\n";
+ $out .= "\t\t\t\tarray('className' => '{$associations['hasOne'][$i]['className']}',\n";
+ $out .= "\t\t\t\t\t\t'foreignKey' => '{$associations['hasOne'][$i]['foreignKey']}',\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'dependent' => ''\n";
+ $out .= "\t\t\t\t),\n\n";
+ }
+ $out .= "\t);\n\n";
+ }
+
+ if (!empty($associations['hasMany'])) {
+ $out .= "\tvar \$hasMany = array(\n";
+
+ for ($i = 0; $i < count($associations['hasMany']); $i++) {
+ $out .= "\t\t\t'{$associations['hasMany'][$i]['alias']}' =>\n";
+ $out .= "\t\t\t\tarray('className' => '{$associations['hasMany'][$i]['className']}',\n";
+ $out .= "\t\t\t\t\t\t'foreignKey' => '{$associations['hasMany'][$i]['foreignKey']}',\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'dependent' => '',\n";
+ $out .= "\t\t\t\t\t\t'exclusive' => '',\n";
+ $out .= "\t\t\t\t\t\t'finderQuery' => '',\n";
+ $out .= "\t\t\t\t\t\t'counterQuery' => ''\n";
+ $out .= "\t\t\t\t),\n\n";
+ }
+ $out .= "\t);\n\n";
+ }
+
+ if (!empty($associations['hasAndBelongsToMany'])) {
+ $out .= "\tvar \$hasAndBelongsToMany = array(\n";
+
+ for ($i = 0; $i < count($associations['hasAndBelongsToMany']); $i++) {
+ $out .= "\t\t\t'{$associations['hasAndBelongsToMany'][$i]['alias']}' =>\n";
+ $out .= "\t\t\t\tarray('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'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'unique' => '',\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\t),\n\n";
+ }
+ $out .= "\t);\n\n";
+ }
+ }
+ $out .= "}\n";
+ $out .= "?>";
+ $filename = MODELS.Inflector::underscore($name) . '.php';
+ $this->__createFile($filename, $out);
+ }
+/**
+ * Assembles and writes a View file.
+ *
+ * @param string $controllerName
+ * @param string $actionName
+ * @param string $content
+ */
+ function bakeView($controllerName, $actionName, $content = '') {
+ $out = "{$actionName} \n";
+ $out .= $content;
+ if (!file_exists(VIEWS.$this->__controllerPath($controllerName))) {
+ mkdir(VIEWS.$this->__controllerPath($controllerName));
+ }
+ $filename = VIEWS . $this->__controllerPath($controllerName) . DS . Inflector::underscore($actionName) . '.thtml';
+ $this->__createFile($filename, $out);
+ }
+/**
+ * Assembles and writes a Controller file.
+ *
+ * @param string $controllerName
+ * @param array $uses
+ * @param array $helpers
+ * @param array $components
+ * @param string $actions
+ */
+ function bakeController($controllerName, $uses, $helpers, $components, $actions = '', $wannaUseScaffold = 'y') {
+ $out = "__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) {
+ if ($help != $helpers[count($helpers) - 1]) {
+ $out .= ", '" . Inflector::camelize($help) . "'";
+ } else {
+ $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 = CONTROLLERS . $this->__controllerPath($controllerName) . '_controller.php';
+ $this->__createFile($filename, $out);
+ }
+/**
+ * Assembles and writes a unit test file.
+ *
+ * @param string $type One of "model", and "controller".
+ * @param string $className
+ */
+ function bakeUnitTest($type, $className) {
+ $out = 'object = new {$className}();\n";
+ $out .= "\t}\n\n\tfunction tearDown() {\n\t\tunset(\$this->object);\n\t}\n";
+ $out .= "\n\t/*\n\tfunction testMe() {\n";
+ $out .= "\t\t\$result = \$this->object->doSomething();\n";
+ $out .= "\t\t\$expected = 1;\n";
+ $out .= "\t\t\$this->assertEqual(\$result, \$expected);\n\t}\n\t*/\n}";
+ $path = MODEL_TESTS;
+ $filename = $this->__singularName($className).'.test.php';
+ break;
+ case 'controller':
+ $out .= "loadController('$className');\n\n";
+ $out .= "class {$className}ControllerTestCase extends UnitTestCase {\n";
+ $out .= "\tvar \$object = null;\n\n";
+ $out .= "\tfunction setUp() {\n\t\t\$this->object = new {$className}Controller();\n";
+ $out .= "\t}\n\n\tfunction tearDown() {\n\t\tunset(\$this->object);\n\t}\n";
+ $out .= "\n\t/*\n\tfunction testMe() {\n";
+ $out .= "\t\t\$result = \$this->object->doSomething();\n";
+ $out .= "\t\t\$expected = 1;\n";
+ $out .= "\t\t\$this->assertEqual(\$result, \$expected);\n\t}\n\t*/\n}";
+ $path = CONTROLLER_TESTS;
+ $filename = $this->__pluralName($className).'_controller.test.php';
+ break;
+ default:
+ $error = true;
+ break;
+ }
+ $out .= "\n?>";
+
+ if (!$error) {
+ $this->stdout("Baking unit test for $className...");
+ $path = explode(DS, $path);
+ foreach ($path as $i => $val) {
+ if ($val == '' || $val == '../') {
+ unset($path[$i]);
+ }
+ }
+ $path = implode(DS, $path);
+ $unixPath = DS;
+ if (strpos(PHP_OS, 'WIN') === 0) {
+ $unixPath = null;
+ }
+ if (!is_dir($unixPath.$path)) {
+ $create = $this->getInput("Unit test directory does not exist. Create it?", array('y','n'), 'y');
+ if (low($create) == 'y' || low($create) == 'yes') {
+ $build = array();
+
+ foreach (explode(DS, $path) as $i => $dir) {
+ $build[] = $dir;
+ if (!is_dir($unixPath.implode(DS, $build))) {
+ mkdir($unixPath.implode(DS, $build));
+ }
+ }
+ } else {
+ return false;
+ }
+ }
+ $this->__createFile($unixPath.$path.DS.$filename, $out);
+ }
+ }
+/**
+ * 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.
+ */
+ function getInput($prompt, $options = null, $default = null) {
+ if (!is_array($options)) {
+ $print_options = '';
+ } else {
+ $print_options = '(' . implode('/', $options) . ')';
+ }
+
+ if ($default == null) {
+ $this->stdout('');
+ $this->stdout($prompt . " $print_options \n" . '> ', false);
+ } else {
+ $this->stdout('');
+ $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.
+ */
+ 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.
+ */
+ function stderr($string) {
+ fwrite($this->stderr, $string, true);
+ }
+/**
+ * Outputs a series of minus characters to the standard output, acts as a visual separator.
+ *
+ */
+ function hr() {
+ $this->stdout('---------------------------------------------------------------');
+ }
+/**
+ * Creates a file at given path.
+ *
+ * @param string $path Where to put the file.
+ * @param string $contents Content to put in the file.
+ * @return Success
+ */
+ function __createFile ($path, $contents) {
+ $path = str_replace('//', '/', $path);
+ echo "\nCreating file $path\n";
+ if (is_file($path) && $this->interactive === true) {
+ fwrite($this->stdout, __("File exists, overwrite?", true). " {$path} (y/n/q):");
+ $key = trim(fgets($this->stdin));
+
+ if ($key=='q') {
+ fwrite($this->stdout, __("Quitting.", true) ."\n");
+ exit;
+ } elseif ($key == 'a') {
+ $this->dont_ask = true;
+ } elseif ($key == 'y') {
+ } else {
+ fwrite($this->stdout, __("Skip", true) ." {$path}\n");
+ return false;
+ }
+ }
+
+ if ($f = fopen($path, 'w')) {
+ fwrite($f, $contents);
+ fclose($f);
+ fwrite($this->stdout, __("Wrote", true) ."{$path}\n");
+ return true;
+ } else {
+ fwrite($this->stderr, __("Error! Could not write to", true)." {$path}.\n");
+ return false;
+ }
+ }
+/**
+ * Takes an array of database fields, and generates an HTML form for a View.
+ * This is an extraction from the Scaffold functionality.
+ *
+ * @param array $fields
+ * @param boolean $readOnly
+ * @return Generated HTML and PHP.
+ */
+ function generateFields( $fields, $readOnly = false ) {
+ $strFormFields = '';
+ foreach ( $fields as $field ) {
+ if (isset( $field['type'])) {
+ if (!isset($field['required'])) {
+ $field['required'] = false;
+ }
+
+ if (!isset( $field['errorMsg'])) {
+ $field['errorMsg'] = null;
+ }
+
+ if (!isset( $field['htmlOptions'])) {
+ $field['htmlOptions'] = array();
+ }
+
+ if ( $readOnly ) {
+ $field['htmlOptions']['READONLY'] = "readonly";
+ }
+
+ switch( $field['type'] ) {
+ case "input" :
+ if (!isset( $field['size'])) {
+ $field['size'] = 60;
+ }
+ $strFormFields = $strFormFields.$this->generateInputDiv( $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['size'], $field['htmlOptions'] );
+ break;
+ case "checkbox" :
+ $strFormFields = $strFormFields.$this->generateCheckboxDiv( $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['htmlOptions'] );
+ break;
+ case "select";
+ case "selectMultiple";
+ if ( "selectMultiple" == $field['type'] ) {
+ $field['selectAttr']['multiple'] = 'multiple';
+ $field['selectAttr']['class'] = 'selectMultiple';
+ }
+ if (!isset( $field['selected'])) {
+ $field['selected'] = null;
+ }
+ if (!isset( $field['selectAttr'])) {
+ $field['selectAttr'] = null;
+ }
+ if (!isset( $field['optionsAttr'])) {
+ $field['optionsAttr'] = null;
+ }
+ if ($readOnly) {
+ $field['selectAttr']['DISABLED'] = true;
+ }
+ if (!isset( $field['options'])) {
+ $field['options'] = null;
+ }
+ $this->__modelAlias = null;
+ if (isset($field['foreignKey'])) {
+ $modelKey = Inflector::underscore($this->__modelClass);
+ $modelObj =& ClassRegistry::getObject($modelKey);
+ foreach ($modelObj->belongsTo as $associationName => $value) {
+ if ($field['model'] == $value['className']) {
+ $this->__modelAlias = $this->__modelName($associationName);
+ break;
+ }
+ }
+ }
+ $strFormFields = $strFormFields.$this->generateSelectDiv( $field['tagName'], $field['prompt'], $field['options'], $field['selected'], $field['selectAttr'], $field['optionsAttr'], $field['required'], $field['errorMsg'] );
+ break;
+ case "area";
+ if (!isset( $field['rows'])) {
+ $field['rows'] = 10;
+ }
+ if (!isset( $field['cols'])) {
+ $field['cols'] = 60;
+ }
+ $strFormFields = $strFormFields.$this->generateAreaDiv( $field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], $field['cols'], $field['rows'], $field['htmlOptions'] );
+ break;
+ case "fieldset";
+ $strFieldsetFields = $this->generateFields( $field['fields'] );
+ $strFieldSet = sprintf( '
+ %s %s ',
+ $field['legend'], $field['noteHeading'], $field['note'], $strFieldsetFields );
+ $strFormFields = $strFormFields.$strFieldSet;
+ break;
+ case "hidden";
+ //$strFormFields = $strFormFields . $this->Html->hiddenTag( $field['tagName']);
+ break;
+ case "date":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateDate($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ case "datetime":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateDateTime($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ case "time":
+ if (!isset($field['selected'])) {
+ $field['selected'] = null;
+ }
+ $strFormFields = $strFormFields . $this->generateTime($field['tagName'], $field['prompt'], $field['required'], $field['errorMsg'], null, $field['htmlOptions'], $field['selected']);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return $strFormFields;
+ }
+/**
+ * Generates PHP code for a View file that makes a textarea.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param boolean $required
+ * @param string $errorMsg
+ * @param integer $cols
+ * @param integer $rows
+ * @param array $htmlOptions
+ * @return Generated HTML and PHP.
+ */
+ function generateAreaDiv($tagName, $prompt, $required=false, $errorMsg=null, $cols=60, $rows=10, $htmlOptions=null ) {
+ $htmlAttributes = $htmlOptions;
+ $htmlAttributes['cols'] = $cols;
+ $htmlAttributes['rows'] = $rows;
+ $str = "\ttextarea('{$tagName}', " . $this->__attributesToArray($htmlAttributes) . ");?>\n";
+ $str .= "\ttagErrorMsg('{$tagName}', 'Please enter the {$prompt}.');?>\n";
+ $strLabel = "\n\tlabelTag( '{$tagName}', '{$prompt}' );?>\n";
+ $divClass = "optional";
+
+ if ( $required ) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str );
+ return $this->divTag( $divClass, $divTagInside );
+ }
+/**
+ * Generates PHP code for a View file that makes a checkbox, wrapped in a DIV.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param boolean $required
+ * @param string $errorMsg
+ * @param array $htmlOptions
+ * @return Generated HTML and PHP.
+ */
+ function generateCheckboxDiv($tagName, $prompt, $required=false, $errorMsg=null, $htmlOptions=null ) {
+ $htmlAttributes = $htmlOptions;
+ $strLabel = "\n\tcheckbox('{$tagName}', null, " . $this->__attributesToArray($htmlAttributes) . ");?>\n";
+ $strLabel .= "\tlabelTag('{$tagName}', '{$prompt}');?>\n";
+ $str = "\ttagErrorMsg('{$tagName}', 'Please check the {$prompt}.');?>\n";
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str);
+ return $this->divTag( $divClass, $divTagInside );
+ }
+/**
+ * Generates PHP code for a View file that makes a date-picker, wrapped in a DIV.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param boolean $required
+ * @param string $errorMsg
+ * @param integer $size
+ * @param array $htmlOptions
+ * @param string $selected
+ * @return Generated HTML and PHP.
+ */
+ function generateDate($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null, $selected=null ) {
+ $str = "\tdateTimeOptionTag('{$tagName}', 'MDY' , 'NONE', \$html->tagValue('{$tagName}'), " . $this->__attributesToArray($htmlOptions) . ");?>\n";
+ $str .= "\ttagErrorMsg('{$tagName}', 'Please select the {$prompt}.');?>\n";
+ $strLabel = "\n\tlabelTag('{$tagName}', '{$prompt}');?>\n";
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str );
+ return $this->divTag( $divClass, $divTagInside );
+ }
+/**
+ * Generates PHP code for a View file that makes a time-picker, wrapped in a DIV.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param boolean $required
+ * @param string $errorMsg
+ * @param integer $size
+ * @param array $htmlOptions
+ * @param string $selected
+ * @return Generated HTML and PHP.
+ */
+ function generateTime($tagName, $prompt, $required = false, $errorMsg = null, $size = 20, $htmlOptions = null, $selected = null) {
+ $str = "\n\t\dateTimeOptionTag('{$tagName}', 'NONE', '24', \$html->tagValue('{$tagName}'), " . $this->__attributesToArray($htmlOptions) . ");?>\n";
+ $strLabel = "\n\tlabelTag('{$tagName}', '{$prompt}');?>\n";
+ $divClass = "optional";
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf("%s %s %s", $strError, $strLabel, $str);
+ return $this->divTag($divClass, $divTagInside);
+ }
+/**
+ * EGenerates PHP code for a View file that makes a datetime-picker, wrapped in a DIV.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param boolean $required
+ * @param string $errorMsg
+ * @param integer $size
+ * @param array $htmlOptions
+ * @param string $selected
+ * @return Generated HTML and PHP.
+ */
+ function generateDateTime($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null, $selected = null ) {
+ $str = "\tdateTimeOptionTag('{$tagName}', 'MDY' , '12', \$html->tagValue('{$tagName}'), " . $this->__attributesToArray($htmlOptions) . ");?>\n";
+ $str .= "\ttagErrorMsg('{$tagName}', 'Please select the {$prompt}.');?>\n";
+ $strLabel = "\n\tlabelTag('{$tagName}', '{$prompt}');?>\n";
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str );
+ return $this->divTag( $divClass, $divTagInside );
+ }
+/**
+ * Generates PHP code for a View file that makes an INPUT field, wrapped in a DIV.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param boolean $required
+ * @param string $errorMsg
+ * @param integer $size
+ * @param array $htmlOptions
+ * @return Generated HTML and PHP.
+ */
+ function generateInputDiv($tagName, $prompt, $required=false, $errorMsg=null, $size=20, $htmlOptions=null ) {
+ $htmlAttributes = $htmlOptions;
+ $htmlAttributes['size'] = $size;
+ $str = "\tinput('{$tagName}', " . $this->__attributesToArray($htmlAttributes) . ");?>\n";
+ $str .= "\ttagErrorMsg('{$tagName}', 'Please enter the {$prompt}.');?>\n";
+ $strLabel = "\n\tlabelTag('{$tagName}', '{$prompt}');?>\n";
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str );
+ return $this->divTag( $divClass, $divTagInside );
+ }
+
+/**
+ * Generates PHP code for a View file that makes a SELECT box, wrapped in a DIV.
+ *
+ * @param string $tagName
+ * @param string $prompt
+ * @param array $options
+ * @param string $selected
+ * @param array $selectAttr
+ * @param array $optionAttr
+ * @param boolean $required
+ * @param string $errorMsg
+ * @return Generated HTML and PHP.
+ */
+ function generateSelectDiv($tagName, $prompt, $options, $selected=null, $selectAttr=null, $optionAttr=null, $required=false, $errorMsg=null) {
+
+ if ($this->__modelAlias) {
+ $pluralName = $this->__pluralName($this->__modelAlias);
+ } else {
+ $tagArray = explode('/', $tagName);
+ $pluralName = $this->__pluralName($this->__modelNameFromKey($tagArray[1]));
+ }
+ $showEmpty = 'true';
+ if ($required) {
+ $showEmpty = 'false';
+ }
+ if ($selectAttr['multiple'] != 'multiple') {
+ $str = "\tselectTag('{$tagName}', " . "\${$pluralName}, \$html->tagValue('{$tagName}'), " . $this->__attributesToArray($selectAttr) . ", " . $this->__attributesToArray($optionAttr) . ", " . $showEmpty . ");?>\n";
+ $str .= "\ttagErrorMsg('{$tagName}', 'Please select the {$prompt}.') ?>\n";
+ } else {
+ $selectedPluralName = 'selected' . ucfirst($pluralName);
+ $selectAttr = am(array('multiple' => 'multiple', 'class' => 'selectMultiple'), $selectAttr);
+ $str = "\tselectTag('{$tagName}', \${$pluralName}, \${$selectedPluralName}, " . $this->__attributesToArray($selectAttr) . ", " . $this->__attributesToArray($optionAttr) . ", " . $showEmpty . ");?>\n";
+ $str .= "\ttagErrorMsg('{$tagName}', 'Please select the {$prompt}.');?>\n";
+ }
+ $strLabel = "\n\tlabelTag('{$tagName}', '{$prompt}');?>\n";
+ $divClass = "optional";
+
+ if ($required) {
+ $divClass = "required";
+ }
+ $strError = "";
+ $divTagInside = sprintf( "%s %s %s", $strError, $strLabel, $str );
+ return $this->divTag( $divClass, $divTagInside );
+ }
+/**
+ * Generates PHP code for a View file that makes a submit button, wrapped in a DIV.
+ *
+ * @param string $displayText
+ * @param array $htmlOptions
+ * @return Generated HTML.
+ */
+ function generateSubmitDiv($displayText, $htmlOptions = null) {
+ $str = "\n\tsubmit('{$displayText}');?>\n";
+ $divTagInside = sprintf( "%s", $str );
+ return $this->divTag( 'submit', $divTagInside);
+ }
+/**
+ * Returns the text wrapped in an HTML DIV, followed by a newline.
+ *
+ * @param string $class
+ * @param string $text
+ * @return Generated HTML.
+ */
+ function divTag($class, $text) {
+ return sprintf('%s
', $class, $text ) . "\n";
+ }
+/**
+ * Parses the HTML attributes array, which is a common data structure in View files.
+ * Returns PHP code for initializing this array in a View file.
+ *
+ * @param array $htmlAttributes
+ * @return Generated PHP code.
+ */
+ function __attributesToArray($htmlAttributes) {
+ if (is_array($htmlAttributes)) {
+ $keys = array_keys($htmlAttributes);
+ $vals = array_values($htmlAttributes);
+ $out = "array(";
+
+ for ($i = 0; $i < count($htmlAttributes); $i++) {
+ if (substr($vals[$i], 0, 1) != '$') {
+ $out .= "'{$keys[$i]}' => '{$vals[$i]}', ";
+ } else {
+ $out .= "'{$keys[$i]}' => {$vals[$i]}, ";
+ }
+ }
+ if (substr($out, -2, 1) == ',') {
+ $out = substr($out, 0, strlen($out) - 2);
+ }
+ $out .= ")";
+ return $out;
+ } else {
+ return 'array()';
+ }
+ }
+/**
+ * Outputs usage text on the standard output.
+ *
+ */
+ function help() {
+ $this->stdout('CakePHP Bake:');
+ $this->hr();
+ $this->stdout('The Bake script generates controllers, views and models for your application.');
+ $this->stdout('If run with no command line arguments, Bake guides the user through the class');
+ $this->stdout('creation process. You can customize the generation process by telling Bake');
+ $this->stdout('where different parts of your application are using command line arguments.');
+ $this->stdout('');
+ $this->hr('');
+ $this->stdout('usage: php bake.php [command] [path...]');
+ $this->stdout('');
+ $this->stdout('commands:');
+ $this->stdout(' -app [path...] Absolute path to Cake\'s app Folder.');
+ $this->stdout(' -core [path...] Absolute path to Cake\'s cake Folder.');
+ $this->stdout(' -help Shows this help message.');
+ $this->stdout(' -project [path...] Generates a new app folder in the path supplied.');
+ $this->stdout(' -root [path...] Absolute path to Cake\'s \app\webroot Folder.');
+ $this->stdout('');
+ }
+/**
+ * Checks that given project path does not already exist, and
+ * finds the app directory in it. Then it calls __buildDirLayout() with that information.
+ *
+ * @param string $projectPath
+ */
+ function project($projectPath = null) {
+ if ($projectPath != '') {
+ while ($this->__checkPath($projectPath) === true && $this->__checkPath(CONFIGS) === true) {
+ $response = $this->getInput('Bake -app in '.$projectPath, array('y','n'), 'y');
+ if (low($response) == 'y') {
+ $this->main();
+ exit();
+ } else {
+ $projectPath = $this->getInput("What is the full path for this app including the app directory name?\nExample: ".ROOT.DS."myapp", null, ROOT.DS.'myapp');
+ }
+ }
+ } else {
+ while ($projectPath == '') {
+ $projectPath = $this->getInput("What is the full path for this app including the app directory name?\nExample: ".ROOT.DS."myapp", null, ROOT.DS.'myapp');
+
+ if ($projectPath == '') {
+ $this->stdout('The directory path you supplied was empty. Please try again.');
+ }
+ }
+ }
+ while ($newPath != 'y' && ($this->__checkPath($projectPath) === true || $projectPath == '')) {
+ $newPath = $this->getInput('Directory '.$projectPath.' exists. Overwrite (y) or insert a new path', null, 'y');
+ if ($newPath != 'y') {
+ $projectPath = $newPath;
+ }
+ while ($projectPath == '') {
+ $projectPath = $this->getInput('The directory path you supplied was empty. Please try again.');
+ }
+ }
+ $parentPath = explode(DS, $projectPath);
+ $count = count($parentPath);
+ $appName = $parentPath[$count - 1];
+ if ($appName == '') {
+ $appName = $parentPath[$count - 2];
+ }
+ $this->__buildDirLayout($projectPath, $appName);
+ exit();
+ }
+/**
+ * Returns true if given path is a directory.
+ *
+ * @param string $projectPath
+ * @return True if given path is a directory.
+ */
+ function __checkPath($projectPath) {
+ if (is_dir($projectPath)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+/**
+ * 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 $projectPath
+ * @param string $appName
+ */
+ function __buildDirLayout($projectPath, $appName) {
+ $skel = '';
+ if ($this->__checkPath(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'scripts'.DS.'templates'.DS.'skel') === true) {
+ $skel = CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'scripts'.DS.'templates'.DS.'skel';
+ } else {
+
+ while ($skel == '') {
+ $skel = $this->getInput("What is the full path for the cake install app directory?\nExample: ", null, ROOT.'myapp'.DS);
+
+ if ($skel == '') {
+ $this->stdout('The directory path you supplied was empty. Please try again.');
+ } else {
+ while ($this->__checkPath($skel) === false) {
+ $skel = $this->getInput('Directory path does not exist please choose another:');
+ }
+ }
+ }
+ }
+ $this->stdout('');
+ $this->hr();
+ $this->stdout("Skel Directory: $skel");
+ $this->stdout("Will be copied to:");
+ $this->stdout("New App Directory: $projectPath");
+ $this->hr();
+ $looksGood = $this->getInput('Look okay?', array('y', 'n', 'q'), 'y');
+
+ if (low($looksGood) == 'y' || low($looksGood) == 'yes') {
+ $verboseOuptut = $this->getInput('Do you want verbose output?', array('y', 'n'), 'n');
+ $verbose = false;
+
+ if (low($verboseOuptut) == 'y' || low($verboseOuptut) == 'yes') {
+ $verbose = true;
+ }
+ $this->__copydirr($skel, $projectPath, 0755, $verbose);
+ $this->hr();
+ $this->stdout('Created: '.$projectPath);
+ $this->hr();
+ $this->stdout('Creating welcome page');
+ $this->hr();
+ $this->__defaultHome($projectPath, $appName);
+ $this->stdout('Welcome page created');
+ if (chmodr($projectPath.DS.'tmp', 0777) === false) {
+ $this->stdout('Could not set permissions on '. $projectPath.DS.'tmp'.DS.'*');
+ $this->stdout('You must manually check that these directories can be wrote to by the server');
+ }
+ return;
+ } elseif (low($looksGood) == 'q' || low($looksGood) == 'quit') {
+ $this->stdout('Bake Aborted.');
+ } else {
+ $this->project();
+ }
+ }
+/**
+ * Recursive directory copy.
+ *
+ * @param string $fromDir
+ * @param string $toDir
+ * @param octal $chmod
+ * @param boolean $verbose
+ * @return Success.
+ */
+ function __copydirr($fromDir, $toDir, $chmod = 0755, $verbose = false) {
+ $errors=array();
+ $messages=array();
+
+ uses('folder');
+ $folder = new Folder($toDir, true, 0755);
+
+ if (!is_writable($toDir)) {
+ $errors[]='target '.$toDir.' is not writable';
+ }
+
+ if (!is_dir($fromDir)) {
+ $errors[]='source '.$fromDir.' is not a directory';
+ }
+
+ if (!empty($errors)) {
+ if ($verbose) {
+ foreach ($errors as $err) {
+ $this->stdout('Error: '.$err);
+ }
+ }
+ return false;
+ }
+ $exceptions=array('.','..','.svn');
+ $handle = opendir($fromDir);
+
+ while (false!==($item = readdir($handle))) {
+ if (!in_array($item,$exceptions)) {
+ $from = $folder->addPathElement($fromDir, $item);
+ $to = $folder->addPathElement($toDir, $item);
+ if (is_file($from)) {
+ if (@copy($from, $to)) {
+ chmod($to, $chmod);
+ touch($to, filemtime($from));
+ $messages[]='File copied from '.$from.' to '.$to;
+ } else {
+ $errors[]='cannot copy file from '.$from.' to '.$to;
+ }
+ }
+
+ if (is_dir($from)) {
+ if (@mkdir($to)) {
+ chmod($to,$chmod);
+ $messages[]='Directory created: '.$to;
+ } else {
+ $errors[]='cannot create directory '.$to;
+ }
+ $this->__copydirr($from,$to,$chmod,$verbose);
+ }
+ }
+ }
+ closedir($handle);
+
+ if ($verbose) {
+ foreach ($errors as $err) {
+ $this->stdout('Error: '.$err);
+ }
+ foreach ($messages as $msg) {
+ $this->stdout($msg);
+ }
+ }
+ return true;
+ }
+
+ function __addAdminRoute($name) {
+ $file = file_get_contents(CONFIGS.'core.php');
+ if (preg_match('%([/\\t\\x20]*define\\(\'CAKE_ADMIN\',[\\t\\x20\'a-z]*\\);)%', $file, $match)) {
+ $result = str_replace($match[0], 'define(\'CAKE_ADMIN\', \''.$name.'\');', $file);
+
+ if (file_put_contents(CONFIGS.'core.php', $result)) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+/**
+ * Outputs an ASCII art banner to standard output.
+ *
+ */
+ function welcome()
+ {
+ $this->stdout('');
+ $this->stdout(' ___ __ _ _ ___ __ _ _ __ __ __ _ _ ___ ');
+ $this->stdout('| |__| |_/ |__ |__] |__| |__] |__] |__| |_/ |__ ');
+ $this->stdout('|___ | | | \_ |___ | | | | |__] | | | \_ |___ ');
+ $this->hr();
+ $this->stdout('');
+ }
+/**
+ * Writes a file with a default home page to the project.
+ *
+ * @param string $dir
+ * @param string $app
+ */
+ function __defaultHome($dir, $app) {
+ $path = $dir.DS.'views'.DS.'pages'.DS;
+ include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'scripts'.DS.'templates'.DS.'views'.DS.'home.thtml');
+ $this->__createFile($path.'home.thtml', $output);
+ }
+/**
+ * creates the proper pluralize controller for the url
+ *
+ * @param string $name must be a controller name in pluralized form
+ * @return string $name
+ */
+ function __controllerPath($name) {
+ return low(Inflector::underscore($name));
+ }
+/**
+ * creates the proper pluralize controller class name.
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __controllerName($name) {
+ return Inflector::pluralize(Inflector::camelize($name));
+ }
+/**
+ * creates the proper singular model name.
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __modelName($name) {
+ return Inflector::camelize(Inflector::singularize($name));
+ }
+/**
+ * creates the proper singular model key for associations.
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __modelKey($name) {
+ return Inflector::underscore(Inflector::singularize($name)).'_id';
+ }
+/**
+ * creates the proper model name from a foreign key.
+ *
+ * @param string $key
+ * @return string $name
+ */
+ function __modelNameFromKey($key) {
+ $name = str_replace('_id', '',$key);
+ return $this->__modelName($name);
+ }
+/**
+ * creates the singular name for use in views.
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __singularName($name) {
+ return Inflector::variable(Inflector::singularize($name));
+ }
+/**
+ * creates the plural name for views.
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __pluralName($name) {
+ return Inflector::variable(Inflector::pluralize($name));
+ }
+/**
+ * creates the singular human name used in views
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __singularHumanName($name) {
+ return Inflector::humanize(Inflector::underscore(Inflector::singularize($name)));
+ }
+/**
+ * creates the plural humna name used in views
+ *
+ * @param string $name
+ * @return string $name
+ */
+ function __pluralHumanName($name) {
+ return Inflector::humanize(Inflector::underscore(Inflector::pluralize($name)));
+ }
+/**
+ * outputs the a list of possible models or controllers from database
+ *
+ * @param string $useDbConfig
+ * @param string $type = Models or Controllers
+ * @return output
+ */
+ function __doList($useDbConfig = 'default', $type = 'Models') {
+ $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();
+ }
+ $this->__tables = $tables;
+ $this->stdout('Possible '.$type.' based on your current database:');
+ $this->__controllerNames = array();
+ $this->__modelNames = array();
+ $count = count($tables);
+ for ($i = 0; $i < $count; $i++) {
+ if (low($type) == 'controllers') {
+ $this->__controllerNames[] = $this->__controllerName($this->__modelName($tables[$i]));
+ $this->stdout($i + 1 . ". " . $this->__controllerNames[$i]);
+ } else {
+ $this->__modelNames[] = $this->__modelName($tables[$i]);
+ $this->stdout($i + 1 . ". " . $this->__modelNames[$i]);
+ }
+ }
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/.htaccess b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/.htaccess
new file mode 100644
index 0000000..00d12ab
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/.htaccess
@@ -0,0 +1,5 @@
+
+ RewriteEngine on
+ RewriteRule ^$ webroot/ [L]
+ RewriteRule (.*) webroot/$1 [L]
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_controller.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_controller.php
new file mode 100644
index 0000000..411f7f0
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_controller.php
@@ -0,0 +1,41 @@
+
+ * 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
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for class.
+ *
+ * Add your application-wide methods in the class below, your controllers
+ * will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.app
+ */
+class AppController extends Controller {
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_model.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_model.php
new file mode 100644
index 0000000..37eaecc
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/app_model.php
@@ -0,0 +1,43 @@
+
+ * 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
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+
+/**
+ * Application model for Cake.
+ *
+ * Add your application-wide methods in the class below, your models
+ * will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.app
+ */
+class AppModel extends Model{
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/acl.ini.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/acl.ini.php
new file mode 100644
index 0000000..8179591
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/acl.ini.php
@@ -0,0 +1,76 @@
+;
+; SVN FILE: $Id: acl.ini.php 6305 2008-01-02 02:33:56Z phpnut $
+;/**
+; * Short description for file.
+; *
+; *
+; * PHP versions 4 and 5
+; *
+; * CakePHP(tm) : Rapid Development Framework
+; * 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 0.10.0.1076
+; * @version $Revision: 6305 $
+; * @modifiedby $LastChangedBy: phpnut $
+; * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+; */
+
+; acl.ini.php - Cake ACL Configuration
+; ---------------------------------------------------------------------
+; Use this file to specify user permissions.
+; aco = access control object (something in your application)
+; aro = access request object (something requesting access)
+;
+; User records are added as follows:
+;
+; [uid]
+; groups = group1, group2, group3
+; allow = aco1, aco2, aco3
+; deny = aco4, aco5, aco6
+;
+; Group records are added in a similar manner:
+;
+; [gid]
+; allow = aco1, aco2, aco3
+; deny = aco4, aco5, aco6
+;
+; The allow, deny, and groups sections are all optional.
+; NOTE: groups names *cannot* ever be the same as usernames!
+;
+; ACL permissions are checked in the following order:
+; 1. Check for user denies (and DENY if specified)
+; 2. Check for user allows (and ALLOW if specified)
+; 3. Gather user's groups
+; 4. Check group denies (and DENY if specified)
+; 5. Check group allows (and ALLOW if specified)
+; 6. If no aro, aco, or group information is found, DENY
+;
+; ---------------------------------------------------------------------
+
+;-------------------------------------
+;Users
+;-------------------------------------
+
+[username-goes-here]
+groups = group1, group2
+deny = aco1, aco2
+allow = aco3, aco4
+
+;-------------------------------------
+;Groups
+;-------------------------------------
+
+[groupname-goes-here]
+deny = aco5, aco6
+allow = aco7, aco8
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/bootstrap.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/bootstrap.php
new file mode 100644
index 0000000..ef4cedf
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/bootstrap.php
@@ -0,0 +1,46 @@
+
+ * 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 0.10.8.2117
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ *
+ * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded
+ * This is an application wide file to load any function that is not used within a class define.
+ * You can also use this to include or require any files in your application.
+ *
+ */
+/**
+ * The settings below can be used to set additional paths to models, views and controllers.
+ * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
+ *
+ * $modelPaths = array('full path to models', 'second full path to models', 'etc...');
+ * $viewPaths = array('this path to views', 'second full path to views', 'etc...');
+ * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
+ *
+ */
+//EOF
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/core.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/core.php
new file mode 100644
index 0000000..77cf1ff
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/core.php
@@ -0,0 +1,146 @@
+
+ * 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 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * If you do not have mod rewrite on your system
+ * or if you prefer to use CakePHP pretty urls.
+ * uncomment the line below.
+ * Note: If you do have mod rewrite but prefer the
+ * CakePHP pretty urls, you also have to remove the
+ * .htaccess files
+ * release/.htaccess
+ * release/app/.htaccess
+ * release/app/webroot/.htaccess
+ */
+// define ('BASE_URL', env('SCRIPT_NAME'));
+/**
+ * Set debug level here:
+ * - 0: production
+ * - 1: development
+ * - 2: full debug with sql
+ * - 3: full debug with sql and dump of the current object
+ *
+ * In production, the "flash messages" redirect after a time interval.
+ * With the other debug levels you get to click the "flash message" to continue.
+ *
+ */
+ define('DEBUG', 1);
+/**
+ * Turn of caching checking wide.
+ * You must still use the controller var cacheAction inside you controller class.
+ * You can either set it controller wide, or in each controller method.
+ * use var $cacheAction = true; or in the controller method $this->cacheAction = true;
+ */
+ define('CACHE_CHECK', false);
+/**
+ * Error constant. Used for differentiating error logging and debugging.
+ * Currently PHP supports LOG_DEBUG
+ */
+ define('LOG_ERROR', 2);
+/**
+ * CakePHP includes 3 types of session saves
+ * database or file. Set this to your preferred method.
+ * If you want to use your own save handler place it in
+ * app/config/name.php DO NOT USE file or database as the name.
+ * and use just the name portion below.
+ *
+ * Setting this to cake will save files to /cakedistro/tmp directory
+ * Setting it to php will use the php default save path
+ * Setting it to database will use the database
+ *
+ */
+ define('CAKE_SESSION_SAVE', 'php');
+/**
+ * If using you own table name for storing sessions
+ * set the table name here.
+ * DO NOT INCLUDE PREFIX IF YOU HAVE SET ONE IN database.php
+ *
+ */
+ define('CAKE_SESSION_TABLE', 'cake_sessions');
+/**
+ * Set a random string of used in session.
+ *
+ */
+ define('CAKE_SESSION_STRING', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
+/**
+ * Set the name of session cookie
+ *
+ */
+ define('CAKE_SESSION_COOKIE', 'CAKEPHP');
+/**
+ * Set level of Cake security.
+ *
+ */
+ define('CAKE_SECURITY', 'high');
+/**
+ * Set Cake Session time out.
+ * If CAKE_SECURITY define is set
+ * high: multiplied by 10
+ * medium: is multiplied by 100
+ * low is: multiplied by 300
+ *
+ * Number below is seconds.
+ */
+ define('CAKE_SESSION_TIMEOUT', '120');
+/**
+ * Uncomment the define below to use cake built in admin routes.
+ * You can set this value to anything you want.
+ * All methods related to the admin route should be prefixed with the
+ * name you set CAKE_ADMIN to.
+ * For example: admin_index, admin_edit
+ */
+// define('CAKE_ADMIN', 'admin');
+/**
+ * The define below is used to turn cake built webservices
+ * on or off. Default setting is off.
+ */
+ define('WEBSERVICES', 'off');
+/**
+ * Compress output CSS (removing comments, whitespace, repeating tags etc.)
+ * This requires a/var/cache directory to be writable by the web server (caching).
+ * To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use Controller::cssTag().
+ */
+ define('COMPRESS_CSS', false);
+/**
+ * If set to true, helpers would output data instead of returning it.
+ */
+ define('AUTO_OUTPUT', false);
+/**
+ * If set to false, session would not automatically be started.
+ */
+ define('AUTO_SESSION', true);
+/**
+ * Set the max size of file to use md5() .
+ */
+ define('MAX_MD5SIZE', (5 * 1024) * 1024);
+/**
+ * To use Access Control Lists with Cake...
+ */
+ define('ACL_CLASSNAME', 'DB_ACL');
+ define('ACL_FILENAME', 'dbacl' . DS . 'db_acl');
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/database.php.default b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/database.php.default
new file mode 100644
index 0000000..fbbb1a3
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/database.php.default
@@ -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.app.config
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * In this file you set up your database connection details.
+ *
+ * @package cake
+ * @subpackage cake.config
+ */
+/**
+ * Database configuration class.
+ * You can specify multiple configurations for production, development and testing.
+ *
+ * driver =>
+ * mysql, postgres, sqlite, adodb-drivername, pear-drivername
+ *
+ * connect =>
+ * MySQL set the connect to either mysql_pconnect of mysql_connect
+ * PostgreSQL set the connect to either pg_pconnect of pg_connect
+ * SQLite set the connect to sqlite_popen sqlite_open
+ * ADOdb set the connect to one of these
+ * (http://phplens.com/adodb/supported.databases.html) and
+ * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
+ *
+ * host =>
+ * the host you connect to the database
+ * MySQL 'localhost' to add a port number use 'localhost:port#'
+ * PostgreSQL 'localhost' to add a port number use 'localhost port=5432'
+ *
+ */
+class DATABASE_CONFIG
+{
+ var $default = array('driver' => 'mysql',
+ 'connect' => 'mysql_connect',
+ 'host' => 'localhost',
+ 'login' => 'user',
+ 'password' => 'password',
+ 'database' => 'project_name',
+ 'prefix' => '');
+
+ var $test = array('driver' => 'mysql',
+ 'connect' => 'mysql_connect',
+ 'host' => 'localhost',
+ 'login' => 'user',
+ 'password' => 'password',
+ 'database' => 'project_name-test',
+ 'prefix' => '');
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/inflections.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/inflections.php
new file mode 100644
index 0000000..e08a7d8
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/inflections.php
@@ -0,0 +1,72 @@
+
+ * 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.0.0.2312
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * This is a key => value array of regex used to match words.
+ * If key matches then the value is returned.
+ *
+ * $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice');
+ */
+ $pluralRules = array();
+/**
+ * This is a key only array of plural words that should not be inflected.
+ * Notice the last comma
+ *
+ * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox');
+ */
+ $uninflectedPlural = array();
+/**
+ * This is a key => value array of plural irregular words.
+ * If key matches then the value is returned.
+ *
+ * $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers')
+ */
+ $irregularPlural = array();
+/**
+ * This is a key => value array of regex used to match words.
+ * If key matches then the value is returned.
+ *
+ * $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i')
+ */
+ $singularRules = array();
+/**
+ * This is a key only array of singular words that should not be inflected.
+ * You should not have to change this value below if you do change it use same format
+ * as the $uninflectedPlural above.
+ */
+ $uninflectedSingular = $uninflectedPlural;
+/**
+ * This is a key => value array of singular irregular words.
+ * Most of the time this will be a reverse of the above $irregularPlural array
+ * You should not have to change this value below if you do change it use same format
+ *
+ * $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother')
+ */
+ $irregularSingular = array_flip($irregularPlural);
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/routes.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/routes.php
new file mode 100644
index 0000000..45ae36a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/routes.php
@@ -0,0 +1,46 @@
+
+ * 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 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Here, we are connecting '/' (base path) to controller called 'Pages',
+ * its action called 'display', and we pass a param to select the view file
+ * to use (in this case, /app/views/pages/home.thtml)...
+ */
+ $Route->connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
+/**
+ * ...and connect the rest of 'Pages' controller's urls.
+ */
+ $Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
+/**
+ * Then we connect url '/test' to our test controller. This is helpfull in
+ * developement.
+ */
+ $Route->connect('/tests', array('controller' => 'tests', 'action' => 'index'));
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/db_acl.sql b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/db_acl.sql
new file mode 100644
index 0000000..8c7aae8
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/db_acl.sql
@@ -0,0 +1,30 @@
+CREATE TABLE `acos` (
+ `id` int(11) NOT NULL auto_increment,
+ `model` varchar(255) NOT NULL default '',
+ `object_id` int(11) default NULL,
+ `alias` varchar(255) NOT NULL default '',
+ `lft` int(11) default NULL,
+ `rght` int(11) default NULL,
+ PRIMARY KEY (`id`)
+);
+
+CREATE TABLE `aros` (
+ `id` int(11) NOT NULL auto_increment,
+ `model` varchar(255) NOT NULL default '',
+ `user_id` int(11) default NULL,
+ `alias` varchar(255) NOT NULL default '',
+ `lft` int(11) default NULL,
+ `rght` int(11) default NULL,
+ PRIMARY KEY (`id`)
+);
+
+CREATE TABLE `aros_acos` (
+ `id` int(11) NOT NULL auto_increment,
+ `aro_id` int(11) default NULL,
+ `aco_id` int(11) default NULL,
+ `_create` int(1) NOT NULL default '0',
+ `_read` int(1) NOT NULL default '0',
+ `_update` int(1) NOT NULL default '0',
+ `_delete` int(11) NOT NULL default '0',
+ PRIMARY KEY (`id`)
+);
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/sessions.sql b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/sessions.sql
new file mode 100644
index 0000000..7166ae4
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/config/sql/sessions.sql
@@ -0,0 +1,11 @@
+-- @copyright Copyright 2005-2007, Cake Software Foundation, Inc.
+-- @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
+-- @since CakePHP v 0.10.8.1997
+-- @version $Revision: 4409 $
+
+CREATE TABLE cake_sessions (
+ id varchar(255) NOT NULL default '',
+ data text,
+ expires int(11) default NULL,
+ PRIMARY KEY (id)
+);
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/controllers/pages_controller.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/controllers/pages_controller.php
new file mode 100644
index 0000000..b308565
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/controllers/pages_controller.php
@@ -0,0 +1,105 @@
+
+ * 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.controllers
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+
+/**
+ * Short description for class.
+ *
+ * This file is application-wide controller file. You can put all
+ * application-wide controller-related methods here.
+ *
+ * Add your application-wide methods in the class below, your controllers
+ * will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.app.controllers
+ */
+class PagesController extends AppController{
+
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $name = 'Pages';
+
+/**
+ * Enter description here...
+ *
+ * @var unknown_type
+ */
+ var $helpers = array('Html');
+
+/**
+ * This controller does not use a model
+ *
+ * @var $uses
+ */
+ var $uses = null;
+
+/**
+ * Displays a view
+ *
+ */
+ function display() {
+ if (!func_num_args()) {
+ $this->redirect('/');
+ }
+
+ $path=func_get_args();
+
+ if (!count($path)) {
+ $this->redirect('/');
+ }
+
+ $count =count($path);
+ $page =null;
+ $subpage=null;
+ $title =null;
+
+ if (!empty($path[0])) {
+ $page = $path[0];
+ }
+
+ if (!empty($path[1])) {
+ $subpage = $path[1];
+ }
+
+ if (!empty($path[$count - 1])) {
+ $title = ucfirst($path[$count - 1]);
+ }
+
+ $this->set('page', $page);
+ $this->set('subpage', $subpage);
+ $this->set('title', $title);
+ $this->render(join('/', $path));
+ }
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/index.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/index.php
new file mode 100644
index 0000000..bd8993b
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/index.php
@@ -0,0 +1,26 @@
+
+ * 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
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/ajax.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/ajax.thtml
new file mode 100644
index 0000000..c6daffc
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/ajax.thtml
@@ -0,0 +1,30 @@
+
+ * 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.libs.view.templates.layouts
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/default.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/default.thtml
new file mode 100644
index 0000000..0172200
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/default.thtml
@@ -0,0 +1,30 @@
+
+
+
+CakePHP(tm) :
+
+
+css('cake.generic');?>
+
+
+
+
+
+ check('Message.flash'))
+ {
+ $session->flash();
+ }
+ echo $content_for_layout;
+ ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/flash.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/flash.thtml
new file mode 100644
index 0000000..b1880c2
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/views/layouts/flash.thtml
@@ -0,0 +1,50 @@
+
+ * 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.libs.view.templates.layouts
+ * @since CakePHP(tm) v 0.10.0.1076
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/.htaccess b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/.htaccess
new file mode 100644
index 0000000..8ca27c0
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/.htaccess
@@ -0,0 +1,6 @@
+
+ RewriteEngine On
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
+
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css.php
new file mode 100644
index 0000000..23223a6
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css.php
@@ -0,0 +1,100 @@
+
+ * 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.webroot
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Enter description here...
+ */
+ require(CONFIGS . 'paths.php');
+ require(CAKE . 'basics.php');
+ require(LIBS . 'folder.php');
+ require(LIBS . 'file.php');
+ require(LIBS . 'legacy.php');
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $path
+ * @param unknown_type $name
+ * @return unknown
+ */
+ function make_clean_css($path, $name) {
+ require(VENDORS . 'csspp' . DS . 'csspp.php');
+ $data =file_get_contents($path);
+ $csspp =new csspp();
+ $output=$csspp->compress($data);
+ $ratio =100 - (round(strlen($output) / strlen($data), 3) * 100);
+ $output=" /* file: $name, ratio: $ratio% */ " . $output;
+ return $output;
+ }
+/**
+ * Enter description here...
+ *
+ * @param unknown_type $path
+ * @param unknown_type $content
+ * @return unknown
+ */
+ function write_css_cache($path, $content) {
+ if (!is_dir(dirname($path))) {
+ mkdir(dirname($path));
+ }
+ $cache=new File($path);
+ return $cache->write($content);
+ }
+
+ if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) {
+ die('Wrong file name.');
+ }
+
+ $filename = 'css/' . $regs[1];
+ $filepath = CSS . $regs[1];
+ $cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]);
+
+ if (!file_exists($filepath)) {
+ die('Wrong file name.');
+ }
+
+ if (file_exists($cachepath)) {
+ $templateModified=filemtime($filepath);
+ $cacheModified =filemtime($cachepath);
+
+ if ($templateModified > $cacheModified) {
+ $output=make_clean_css($filepath, $filename);
+ write_css_cache($cachepath, $output);
+ } else {
+ $output = file_get_contents($cachepath);
+ }
+ } else {
+ $output=make_clean_css($filepath, $filename);
+ write_css_cache($cachepath, $output);
+ }
+ header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT');
+ header("Content-Type: text/css");
+ header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT");
+ header("Cache-Control: cache"); // HTTP/1.1
+ header("Pragma: cache"); // HTTP/1.0
+ print $output;
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css/cake.generic.css b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css/cake.generic.css
new file mode 100644
index 0000000..491dc7a
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/css/cake.generic.css
@@ -0,0 +1,251 @@
+*{
+margin:0;
+padding:0;
+}
+
+body{
+font-family:"frutiger linotype","lucida grande",helvetica,arial,sans-serif;
+text-align:center;
+color:#333;
+font-size: 76%;
+}
+
+/* General Style Info */
+a{
+color:#003d4c;
+text-decoration:underline;
+}
+a:hover{
+color:#003d4c;
+text-decoration:none;
+}
+
+a img{
+border:none;
+}
+
+h1, h2, h3, h4{
+font-weight:normal;
+}
+
+h1{
+color: #003d4c;
+margin:0.3em 0;
+font-size: 180%;
+}
+
+h2{
+color:#c6c65b;
+padding-top: 1em;
+margin:0.3em 0;
+font-size: 180%;
+}
+
+h3{
+color:#c6c65b;
+padding-top:2em;
+font-size: 140%;
+}
+
+h4{
+color:#c6c65b;
+padding-top:0.5em;
+font-weight:normal;
+}
+
+em {
+font-size: 12px;
+}
+
+ul, li {
+margin: 0 12px;
+}
+
+/* Layout */
+
+#container{
+text-align:left;
+}
+
+#header{
+margin-top: 1em;
+padding: 4px 20px;
+}
+
+#content{
+clear:both;
+padding: 0px 40px 10px 40px;
+background-color: #fff;
+color: #333;
+}
+#footer{
+clear:both;
+padding: 6px 10px;
+text-align: right;
+}
+
+/* tables */
+
+table {
+width: 100%;
+border-top: 1px solid #ccc;
+border-left: 1px solid #ccc;
+border-bottom: 1px solid #ccc;
+color:#333;
+background-color: #fff;
+clear:both;
+padding: 0;
+margin: 0 0 2em 0;
+white-space: normal;
+}
+th {
+background-color: #e2e2e2;
+border-top: 1px solid #fff;
+border-left: 1px solid #fff;
+border-right: 1px solid #003d4c;
+border-bottom: 1px solid #003d4c;
+text-align: center;
+padding:1px 4px;
+}
+table tr td {
+border-right: 1px solid #ddd;
+padding:4px 4px;
+vertical-align:top;
+text-align: center;
+}
+table tr.altRow td {
+background: #f4f4f4;
+}
+table td.actions {
+ white-space: nowrap;
+}
+#cakeSqlLog td {
+text-align: left;
+padding: 4px 8px;
+background: #fff;
+border-bottom: 2px solid #ccc;
+}
+
+/* scaffold show */
+
+div.related {
+clear:both;
+display:block;
+}
+dl {
+line-height:2em;
+margin:0em 1em;
+float:left;
+width: 400px;
+}
+dt {
+font-weight: bold;
+vertical-align:top;
+}
+dd {
+margin-left:10em;
+margin-top:-2em;
+vertical-align:top;
+}
+
+/* notices and errors */
+
+#flashMessage, .error, .error_message {
+color:#900;
+font-size: 16px;
+background-color: #fff;
+margin: 8px 0px;
+font-weight: bold;
+}
+.error_message {
+clear: both;
+}
+.error em {
+font-size: 18px;
+color: #003d4c;
+}
+.notice {
+color: #656565;
+font-size: 14px;
+background-color: #f4f4f4;
+padding: 0.5em;
+margin: 1em 0;
+display:block;
+}
+.tip {
+color: #656565;
+background-color: #ddd;
+}
+
+/* forms */
+
+form {
+margin-top: 2em;
+}
+form div{
+vertical-align: text-top;
+margin-left: 1em;
+margin-bottom:2em;
+}
+form div.date{
+margin-left: 0em;
+}
+label {
+display: block;
+float:left;
+width: 140px;
+font-size: 14px;
+padding-right: 20px;
+}
+input[type=checkbox] {
+float: left;
+clear: left;
+margin: 2px 6px 7px 2px;
+}
+input, textarea {
+clear: both;
+display:block;
+font-size: 14px;
+font-family: inherit;
+}
+select {
+clear: both;
+vertical-align: text-bottom;
+font-size: 14px;
+font-family: inherit;
+}
+option {
+font-size: 14px;
+font-family: inherit;
+padding: 0 0.3em;
+}
+input[type=submit] {
+display: inline;
+vertical-align: bottom;
+}
+div.required {
+clear: both;
+color:#222;
+font-weight:bold;
+}
+div.optional {
+clear: both;
+color:#555;
+}
+div.submit {
+clear: both;
+margin-top: 40px;
+margin-left: 140px;
+}
+/* action links */
+ul.actions {
+float: left;
+margin-left:20px;
+width: 200px;
+}
+ul.actions li {
+margin-top: 4px;
+}
+pre {
+padding: 1em;
+}
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/favicon.ico b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/favicon.ico
new file mode 100644
index 0000000..1bc32bd
Binary files /dev/null and b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/favicon.ico differ
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/img/cake.power.png b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/img/cake.power.png
new file mode 100644
index 0000000..699ef80
Binary files /dev/null and b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/img/cake.power.png differ
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/index.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/index.php
new file mode 100644
index 0000000..6874e2b
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/index.php
@@ -0,0 +1,87 @@
+
+ * 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.webroot
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Do not change
+ */
+ if (!defined('DS')) {
+ define('DS', DIRECTORY_SEPARATOR);
+ }
+/**
+ * These defines should only be edited if you have cake installed in
+ * a directory layout other than the way it is distributed.
+ * Each define has a commented line of code that explains what you would change.
+ *
+ */
+ if (!defined('ROOT')) {
+ //define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
+ //You should also use the DS define to seperate your directories
+ define('ROOT', dirname(dirname(dirname(__FILE__))));
+ }
+ if (!defined('APP_DIR')) {
+ //define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
+ define('APP_DIR', basename(dirname(dirname(__FILE__))));
+ }
+/**
+ * This only needs to be changed if the cake installed libs are located
+ * outside of the distributed directory structure.
+ */
+ if (!defined('CAKE_CORE_INCLUDE_PATH')) {
+ //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
+ //You should also use the DS define to seperate your directories
+ define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ }
+///////////////////////////////
+//DO NOT EDIT BELOW THIS LINE//
+///////////////////////////////
+ if (!defined('WEBROOT_DIR')) {
+ define('WEBROOT_DIR', basename(dirname(__FILE__)));
+ }
+ if (!defined('WWW_ROOT')) {
+ define('WWW_ROOT', dirname(__FILE__) . DS);
+ }
+ if (!defined('CORE_PATH')) {
+ if (function_exists('ini_set')) {
+ ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'));
+ define('APP_PATH', null);
+ define('CORE_PATH', null);
+ } else {
+ define('APP_PATH', ROOT . DS . APP_DIR . DS);
+ define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
+ }
+ }
+ require CORE_PATH . 'cake' . DS . 'bootstrap.php';
+ if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
+ } else {
+ $Dispatcher = new Dispatcher();
+ $Dispatcher->dispatch($url);
+ }
+ if (Configure::read() > 0) {
+ echo "";
+ }
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/js/vendors.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/js/vendors.php
new file mode 100644
index 0000000..1075bfb
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/skel/webroot/js/vendors.php
@@ -0,0 +1,43 @@
+
+ * 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.webroot.js
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Enter description here...
+ */
+$file = $_GET['file'];
+$pos = strpos($file, '..');
+if ($pos === false) {
+ if (is_file('../../vendors/javascript/'.$file) && (preg_match('/(\/.+)\\.js/', $file)))
+ {
+ readfile('../../vendors/javascript/'.$file);
+ }
+} else {
+ header('HTTP/1.1 404 Not Found');
+}
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/views/home.thtml b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/views/home.thtml
new file mode 100644
index 0000000..d107e55
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/cake/scripts/templates/views/home.thtml
@@ -0,0 +1,16 @@
+Your database configuration file is
\n";
+$output .= "\n";
+$output .= "\n";
+$output .= "getDataSource('default'); ?>\n";
+$output .= "CakeisConnected() ? ' is able to' : ' is not able to';?> connect to the database.
\n";
+$output .= " \n";
+$output .= "\n";
+$output .= "Sweet, \"".Inflector::humanize($app)."\" got Baked by CakePHP! \n";
+$output .= "Editing this Page \n";
+$output .= "\n";
+$output .= "To change the content of this page, edit: ".$dir.DS."views".DS."pages".DS."home.thtml. \n";
+$output .= "To change its layout, edit: ".$dir.DS."views".DS."layouts".DS."default.thtml. \n";
+$output .= "You can also add some CSS styles for your pages at: ".$dir.DS."webroot/css/.\n";
+$output .= "
\n";
+?>
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/CHANGELOG.txt b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/CHANGELOG.txt
new file mode 100644
index 0000000..7d1e628
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/CHANGELOG.txt
@@ -0,0 +1,13 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// +---------------------------------------------------------------------------------------------------+//
+// + $Id: CHANGELOG.txt 4064 2006-12-04 05:29:12Z phpnut $
+// + Last Modified: $Date: 2006-12-04 00:29:12 -0500 (Mon, 04 Dec 2006) $
+// + Modified By: $LastChangedBy: phpnut $
+// +---------------------------------------------------------------------------------------------------+//
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+Changelog:
+https://trac.cakephp.org/wiki/changelog/1.1.x.x
+
+Release Notes:
+https://trac.cakephp.org/wiki/notes/1.1.x.x
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/COPYING.txt b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/COPYING.txt
new file mode 100644
index 0000000..4787242
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/COPYING.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/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/INSTALL.txt b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/INSTALL.txt
new file mode 100644
index 0000000..47698fc
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/INSTALL.txt
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// +---------------------------------------------------------------------------------------------------+//
+// + $Id: INSTALL.txt 4409 2007-02-02 13:20:59Z phpnut $
+// + Last Modified: $Date: 2007-02-02 08:20:59 -0500 (Fri, 02 Feb 2007) $
+// + Modified By: $LastChangedBy: phpnut $
+// +---------------------------------------------------------------------------------------------------+//
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+In order use CakePHP you must first have a server that has all the required libraries and programs to run CakePHP:
+
+Here are the requirements for setting up a server to run CakePHP:
+
+ 1. An HTTP server (like Apache) with the following enabled.
+ 2. PHP 4.3.2 or greater. Yes, CakePHP works great in either PHP 4 or 5.
+ 3. A database engine (right now, there is support for MySQL, MsSQL, Oracle, Sqlite, PostgreSQL and a wrapper for ADODB).
+
+For development we can place the whole Cake installation directory inside the specified DocumentRoot.
+
+ 1. Unpack latest distribution in your DocumentRoot.
+ 2. Rename the directory to anything you like.
+ 3. Access the install.
+ a. If mod_rewrite is working then http://www.example.com/my_directory
+ 1. If you receive a "Bad Request" add the trailing slash, http://www.example.com/my_directory/
+ 4. If mod_rewrite is not working you will need to remove the comment from app/config/core.php
+ a. Around line 40: define ('BASE_URL', env('SCRIPT_NAME'));
+ b. Then access using http://www.example.com/my_directory/index.php/pages to verify installation is working
+
+For more information on installation see http://manual.cakephp.org/chapter/installing
+
+Good resources for help.
+* The Bakery :: Everything CakePHP (http://bakery.cakephp.org/)
+* CakePHP Manual :: Your Rapid Development Cookbook (http://manual.cakephp.org/)
+* CakePHP API :: Docblock Your Best Friend (http://api.cakephp.org/)
+* CakePHP Google Group :: Community mailing list (http://groups-beta.google.com/group/cake-php)
+* CakePHP(tm) :: The Rapid Development Framework (http://www.cakephp.org/)
+* CakeForge :: Open Development for CakePHP (http://cakeforge.org/)
+* CakePHP Trac :: For the Development of CakePHP (Tickets, SVN browser, Roadmap, Changelogs) (https://trac.cakephp.org/)
+* Live chat about CakePHP (irc.freenode.net #cakephp)
+ Web Interface to IRC (http://irc.cakephp.org/irc.htm)
\ No newline at end of file
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/README.txt b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/README.txt
new file mode 100644
index 0000000..234e171
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/docs/README.txt
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+// +---------------------------------------------------------------------------------------------------+//
+// + $Id: README.txt 4064 2006-12-04 05:29:12Z phpnut $
+// + Last Modified: $Date: 2006-12-04 00:29:12 -0500 (Mon, 04 Dec 2006) $
+// + Modified By: $LastChangedBy: phpnut $
+// +---------------------------------------------------------------------------------------------------+//
+///////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+This README will be updated
+
+Home:
+http://www.cakephp.org/
+
+Documentation
+http://manual.cakephp.org/
+
+Development:
+https://trac.cakephp.org/
+
diff --git a/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/index.php b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/index.php
new file mode 100644
index 0000000..e78de13
--- /dev/null
+++ b/poc/poc02-compiling-cake/src/vendor/cake_1.1.20.7692/index.php
@@ -0,0 +1,77 @@
+
+ * 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
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 6305 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-01 21:33:56 -0500 (Tue, 01 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Get Cake's root directory
+ */
+ define('APP_DIR', 'app');
+ define('DS', DIRECTORY_SEPARATOR);
+ define('ROOT', dirname(__FILE__));
+ define('WEBROOT_DIR', 'webroot');
+ define('WWW_ROOT', ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS);
+/**
+ * This only needs to be changed if the cake installed libs are located
+ * outside of the distributed directory structure.
+ */
+ if (!defined('CAKE_CORE_INCLUDE_PATH')) {
+ //define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
+ define('CAKE_CORE_INCLUDE_PATH', ROOT);
+ }
+ if (function_exists('ini_set')) {
+ ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
+ define('APP_PATH', null);
+ define('CORE_PATH', null);
+ } else {
+ define('APP_PATH', ROOT . DS . APP_DIR . DS);
+ define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
+ }
+ require CORE_PATH . 'cake' . DS . 'basics.php';
+ require APP_PATH . 'config' . DS . 'core.php';
+ require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
+ $bootstrap=true;
+ $uri =setUri();
+/**
+ * As mod_rewrite (or .htaccess files) is not working, we need to take care
+ * of what would normally be rewritten, i.e. the static files in app/webroot/
+ */
+ if ($uri === '/' || $uri === '/index.php') {
+ $_GET['url'] = '/';
+ require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
+ } else {
+ $elements=explode('/index.php', $uri);
+
+ if (!empty($elements[1])) {
+ $path = $elements[1];
+ } else {
+ $path = '/';
+ }
+ $_GET['url']=$path;
+ require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
+ }
+?>
\ No newline at end of file
--
cgit v1.2.3