mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
4f67f84ff8
Conflicts: app/config/acl.ini.php app/config/bootstrap.php app/config/core.php app/config/database.php.default app/config/inflections.php app/config/routes.php app/config/schema/db_acl.php app/config/schema/i18n.php app/config/schema/sessions.php app/config/sql/db_acl.sql app/config/sql/i18n.sql app/index.php app/webroot/css.php app/webroot/css/cake.generic.css app/webroot/index.php app/webroot/js/vendors.php app/webroot/test.php cake/LICENSE.txt cake/basics.php cake/bootstrap.php cake/config/config.php cake/config/paths.php cake/config/unicode/casefolding/0080_00ff.php cake/config/unicode/casefolding/0100_017f.php cake/config/unicode/casefolding/0180_024F.php cake/config/unicode/casefolding/0250_02af.php cake/config/unicode/casefolding/0370_03ff.php cake/config/unicode/casefolding/0400_04ff.php cake/config/unicode/casefolding/0500_052f.php cake/config/unicode/casefolding/0530_058f.php cake/config/unicode/casefolding/1e00_1eff.php cake/config/unicode/casefolding/1f00_1fff.php cake/config/unicode/casefolding/2100_214f.php cake/config/unicode/casefolding/2150_218f.php cake/config/unicode/casefolding/2460_24ff.php cake/config/unicode/casefolding/2c00_2c5f.php cake/config/unicode/casefolding/2c60_2c7f.php cake/config/unicode/casefolding/2c80_2cff.php cake/config/unicode/casefolding/ff00_ffef.php cake/console/cake cake/console/cake.bat cake/console/cake.php cake/console/error.php cake/console/libs/acl.php cake/console/libs/api.php cake/console/libs/bake.php cake/console/libs/console.php cake/console/libs/i18n.php cake/console/libs/schema.php cake/console/libs/shell.php cake/console/libs/tasks/controller.php cake/console/libs/tasks/db_config.php cake/console/libs/tasks/extract.php cake/console/libs/tasks/model.php cake/console/libs/tasks/plugin.php cake/console/libs/tasks/project.php cake/console/libs/tasks/test.php cake/console/libs/tasks/view.php cake/console/libs/templates/skel/config/bootstrap.php cake/console/libs/templates/skel/config/inflections.php cake/console/libs/templates/skel/config/sql/sessions.sql cake/console/libs/templates/skel/index.php cake/console/libs/templates/skel/views/elements/email/html/default.ctp cake/console/libs/templates/skel/views/elements/email/text/default.ctp cake/console/libs/templates/skel/views/layouts/ajax.ctp cake/console/libs/templates/skel/views/layouts/default.ctp cake/console/libs/templates/skel/views/layouts/email/html/default.ctp cake/console/libs/templates/skel/views/layouts/email/text/default.ctp cake/console/libs/templates/skel/webroot/js/vendors.php cake/console/libs/templates/skel/webroot/test.php cake/console/libs/templates/views/form.ctp cake/console/libs/templates/views/index.ctp cake/console/libs/testsuite.php cake/console/templates/default/views/view.ctp cake/console/templates/skel/app_controller.php cake/console/templates/skel/app_helper.php cake/console/templates/skel/app_model.php cake/console/templates/skel/config/acl.ini.php cake/console/templates/skel/config/core.php cake/console/templates/skel/config/database.php.default cake/console/templates/skel/config/routes.php cake/console/templates/skel/config/schema/db_acl.php cake/console/templates/skel/config/schema/db_acl.sql cake/console/templates/skel/config/schema/i18n.php cake/console/templates/skel/config/schema/i18n.sql cake/console/templates/skel/config/schema/sessions.php cake/console/templates/skel/config/schema/sessions.sql cake/console/templates/skel/controllers/pages_controller.php cake/console/templates/skel/views/layouts/flash.ctp cake/console/templates/skel/webroot/css.php cake/console/templates/skel/webroot/css/cake.generic.css cake/console/templates/skel/webroot/index.php cake/dispatcher.php cake/libs/cache.php cake/libs/cache/apc.php cake/libs/cache/file.php cake/libs/cache/memcache.php cake/libs/cache/xcache.php cake/libs/cake_log.php cake/libs/cake_session.php cake/libs/cake_socket.php cake/libs/class_registry.php cake/libs/configure.php cake/libs/controller/app_controller.php cake/libs/controller/component.php cake/libs/controller/components/acl.php cake/libs/controller/components/auth.php cake/libs/controller/components/cookie.php cake/libs/controller/components/email.php cake/libs/controller/components/request_handler.php cake/libs/controller/components/security.php cake/libs/controller/components/session.php cake/libs/controller/controller.php cake/libs/controller/pages_controller.php cake/libs/controller/scaffold.php cake/libs/debugger.php cake/libs/error.php cake/libs/file.php cake/libs/flay.php cake/libs/folder.php cake/libs/http_socket.php cake/libs/i18n.php cake/libs/inflector.php cake/libs/l10n.php cake/libs/magic_db.php cake/libs/model/app_model.php cake/libs/model/behaviors/acl.php cake/libs/model/behaviors/containable.php cake/libs/model/behaviors/translate.php cake/libs/model/behaviors/tree.php cake/libs/model/cake_schema.php cake/libs/model/connection_manager.php cake/libs/model/datasources/datasource.php cake/libs/model/datasources/dbo/dbo_adodb.php cake/libs/model/datasources/dbo/dbo_db2.php cake/libs/model/datasources/dbo/dbo_firebird.php cake/libs/model/datasources/dbo/dbo_mssql.php cake/libs/model/datasources/dbo/dbo_mysql.php cake/libs/model/datasources/dbo/dbo_mysqli.php cake/libs/model/datasources/dbo/dbo_odbc.php cake/libs/model/datasources/dbo/dbo_oracle.php cake/libs/model/datasources/dbo/dbo_postgres.php cake/libs/model/datasources/dbo/dbo_sqlite.php cake/libs/model/datasources/dbo/dbo_sybase.php cake/libs/model/datasources/dbo_source.php cake/libs/model/db_acl.php cake/libs/model/model.php cake/libs/model/model_behavior.php cake/libs/multibyte.php cake/libs/object.php cake/libs/overloadable.php cake/libs/overloadable_php4.php cake/libs/overloadable_php5.php cake/libs/router.php cake/libs/sanitize.php cake/libs/security.php cake/libs/set.php cake/libs/string.php cake/libs/validation.php cake/libs/view/elements/dump.ctp cake/libs/view/elements/email/html/default.ctp cake/libs/view/elements/email/text/default.ctp cake/libs/view/errors/error404.ctp cake/libs/view/errors/missing_action.ctp cake/libs/view/errors/missing_component_class.ctp cake/libs/view/errors/missing_component_file.ctp cake/libs/view/errors/missing_connection.ctp cake/libs/view/errors/missing_controller.ctp cake/libs/view/errors/missing_helper_class.ctp cake/libs/view/errors/missing_helper_file.ctp cake/libs/view/errors/missing_layout.ctp cake/libs/view/errors/missing_model.ctp cake/libs/view/errors/missing_scaffolddb.ctp cake/libs/view/errors/missing_table.ctp cake/libs/view/errors/missing_view.ctp cake/libs/view/errors/private_action.ctp cake/libs/view/errors/scaffold_error.ctp cake/libs/view/helper.php cake/libs/view/helpers/ajax.php cake/libs/view/helpers/app_helper.php cake/libs/view/helpers/cache.php cake/libs/view/helpers/form.php cake/libs/view/helpers/html.php cake/libs/view/helpers/javascript.php cake/libs/view/helpers/js.php cake/libs/view/helpers/number.php cake/libs/view/helpers/paginator.php cake/libs/view/helpers/rss.php cake/libs/view/helpers/session.php cake/libs/view/helpers/text.php cake/libs/view/helpers/time.php cake/libs/view/helpers/xml.php cake/libs/view/layouts/ajax.ctp cake/libs/view/layouts/default.ctp cake/libs/view/layouts/email/html/default.ctp cake/libs/view/layouts/email/text/default.ctp cake/libs/view/layouts/flash.ctp cake/libs/view/media.php cake/libs/view/pages/home.ctp cake/libs/view/scaffolds/edit.ctp cake/libs/view/scaffolds/index.ctp cake/libs/view/scaffolds/view.ctp cake/libs/view/theme.php cake/libs/view/view.php cake/libs/xml.php cake/tests/cases/basics.test.php cake/tests/cases/console/cake.test.php cake/tests/cases/console/libs/acl.test.php cake/tests/cases/console/libs/api.test.php cake/tests/cases/console/libs/schema.test.php cake/tests/cases/console/libs/shell.test.php cake/tests/cases/console/libs/tasks/extract.test.php cake/tests/cases/console/libs/tasks/model.test.php cake/tests/cases/console/libs/tasks/test.test.php cake/tests/cases/dispatcher.test.php cake/tests/cases/libs/cache.test.php cake/tests/cases/libs/cache/apc.test.php cake/tests/cases/libs/cache/file.test.php cake/tests/cases/libs/cache/memcache.test.php cake/tests/cases/libs/cache/xcache.test.php cake/tests/cases/libs/cake_log.test.php cake/tests/cases/libs/cake_session.test.php cake/tests/cases/libs/cake_socket.test.php cake/tests/cases/libs/cake_test_case.test.php cake/tests/cases/libs/cake_test_fixture.test.php cake/tests/cases/libs/class_registry.test.php cake/tests/cases/libs/code_coverage_manager.test.php cake/tests/cases/libs/configure.test.php cake/tests/cases/libs/controller/component.test.php cake/tests/cases/libs/controller/components/acl.test.php cake/tests/cases/libs/controller/components/auth.test.php cake/tests/cases/libs/controller/components/cookie.test.php cake/tests/cases/libs/controller/components/email.test.php cake/tests/cases/libs/controller/components/request_handler.test.php cake/tests/cases/libs/controller/components/security.test.php cake/tests/cases/libs/controller/components/session.test.php cake/tests/cases/libs/controller/controller.test.php cake/tests/cases/libs/controller/controller_merge_vars.test.php cake/tests/cases/libs/controller/pages_controller.test.php cake/tests/cases/libs/controller/scaffold.test.php cake/tests/cases/libs/debugger.test.php cake/tests/cases/libs/error.test.php cake/tests/cases/libs/file.test.php cake/tests/cases/libs/flay.test.php cake/tests/cases/libs/folder.test.php cake/tests/cases/libs/http_socket.test.php cake/tests/cases/libs/i18n.test.php cake/tests/cases/libs/inflector.test.php cake/tests/cases/libs/l10n.test.php cake/tests/cases/libs/magic_db.test.php cake/tests/cases/libs/model/behaviors/acl.test.php cake/tests/cases/libs/model/behaviors/containable.test.php cake/tests/cases/libs/model/behaviors/translate.test.php cake/tests/cases/libs/model/behaviors/tree.test.php cake/tests/cases/libs/model/cake_schema.test.php cake/tests/cases/libs/model/connection_manager.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_adodb.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_mssql.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_mysql.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_mysqli.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_oracle.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_postgres.test.php cake/tests/cases/libs/model/datasources/dbo/dbo_sqlite.test.php cake/tests/cases/libs/model/datasources/dbo_source.test.php cake/tests/cases/libs/model/db_acl.test.php cake/tests/cases/libs/model/model.test.php cake/tests/cases/libs/model/model_behavior.test.php cake/tests/cases/libs/model/model_delete.test.php cake/tests/cases/libs/model/model_integration.test.php cake/tests/cases/libs/model/model_read.test.php cake/tests/cases/libs/model/model_validation.test.php cake/tests/cases/libs/model/model_write.test.php cake/tests/cases/libs/model/models.php cake/tests/cases/libs/multibyte.test.php cake/tests/cases/libs/object.test.php cake/tests/cases/libs/overloadable.test.php cake/tests/cases/libs/router.test.php cake/tests/cases/libs/sanitize.test.php cake/tests/cases/libs/security.test.php cake/tests/cases/libs/set.test.php cake/tests/cases/libs/string.test.php cake/tests/cases/libs/test_manager.test.php cake/tests/cases/libs/validation.test.php cake/tests/cases/libs/view/helper.test.php cake/tests/cases/libs/view/helpers/ajax.test.php cake/tests/cases/libs/view/helpers/cache.test.php cake/tests/cases/libs/view/helpers/form.test.php cake/tests/cases/libs/view/helpers/html.test.php cake/tests/cases/libs/view/helpers/javascript.test.php cake/tests/cases/libs/view/helpers/js.test.php cake/tests/cases/libs/view/helpers/number.test.php cake/tests/cases/libs/view/helpers/paginator.test.php cake/tests/cases/libs/view/helpers/rss.test.php cake/tests/cases/libs/view/helpers/session.test.php cake/tests/cases/libs/view/helpers/text.test.php cake/tests/cases/libs/view/helpers/time.test.php cake/tests/cases/libs/view/helpers/xml.test.php cake/tests/cases/libs/view/theme.test.php cake/tests/cases/libs/view/view.test.php cake/tests/cases/libs/xml.test.php cake/tests/fixtures/account_fixture.php cake/tests/fixtures/aco_action_fixture.php cake/tests/fixtures/aco_fixture.php cake/tests/fixtures/aco_two_fixture.php cake/tests/fixtures/advertisement_fixture.php cake/tests/fixtures/another_article_fixture.php cake/tests/fixtures/apple_fixture.php cake/tests/fixtures/aro_fixture.php cake/tests/fixtures/aro_two_fixture.php cake/tests/fixtures/aros_aco_fixture.php cake/tests/fixtures/aros_aco_two_fixture.php cake/tests/fixtures/article_featured_fixture.php cake/tests/fixtures/article_featureds_tags_fixture.php cake/tests/fixtures/article_fixture.php cake/tests/fixtures/articles_tag_fixture.php cake/tests/fixtures/attachment_fixture.php cake/tests/fixtures/auth_user_custom_field_fixture.php cake/tests/fixtures/auth_user_fixture.php cake/tests/fixtures/author_fixture.php cake/tests/fixtures/basket_fixture.php cake/tests/fixtures/bid_fixture.php cake/tests/fixtures/binary_test_fixture.php cake/tests/fixtures/book_fixture.php cake/tests/fixtures/cache_test_model_fixture.php cake/tests/fixtures/callback_fixture.php cake/tests/fixtures/category_fixture.php cake/tests/fixtures/category_thread_fixture.php cake/tests/fixtures/cd_fixture.php cake/tests/fixtures/comment_fixture.php cake/tests/fixtures/content_account_fixture.php cake/tests/fixtures/content_fixture.php cake/tests/fixtures/counter_cache_post_fixture.php cake/tests/fixtures/counter_cache_post_nonstandard_primary_key_fixture.php cake/tests/fixtures/counter_cache_user_fixture.php cake/tests/fixtures/counter_cache_user_nonstandard_primary_key_fixture.php cake/tests/fixtures/data_test_fixture.php cake/tests/fixtures/datatype_fixture.php cake/tests/fixtures/dependency_fixture.php cake/tests/fixtures/device_fixture.php cake/tests/fixtures/device_type_category_fixture.php cake/tests/fixtures/device_type_fixture.php cake/tests/fixtures/document_directory_fixture.php cake/tests/fixtures/document_fixture.php cake/tests/fixtures/exterior_type_category_fixture.php cake/tests/fixtures/feature_set_fixture.php cake/tests/fixtures/featured_fixture.php cake/tests/fixtures/film_file_fixture.php cake/tests/fixtures/flag_tree_fixture.php cake/tests/fixtures/fruit_fixture.php cake/tests/fixtures/fruits_uuid_tag_fixture.php cake/tests/fixtures/home_fixture.php cake/tests/fixtures/image_fixture.php cake/tests/fixtures/item_fixture.php cake/tests/fixtures/items_portfolio_fixture.php cake/tests/fixtures/join_a_b_fixture.php cake/tests/fixtures/join_a_c_fixture.php cake/tests/fixtures/join_a_fixture.php cake/tests/fixtures/join_b_fixture.php cake/tests/fixtures/join_c_fixture.php cake/tests/fixtures/join_thing_fixture.php cake/tests/fixtures/message_fixture.php cake/tests/fixtures/my_categories_my_products_fixture.php cake/tests/fixtures/my_categories_my_users_fixture.php cake/tests/fixtures/my_category_fixture.php cake/tests/fixtures/my_product_fixture.php cake/tests/fixtures/my_user_fixture.php cake/tests/fixtures/node_fixture.php cake/tests/fixtures/number_tree_fixture.php cake/tests/fixtures/number_tree_two_fixture.php cake/tests/fixtures/numeric_article_fixture.php cake/tests/fixtures/overall_favorite_fixture.php cake/tests/fixtures/person_fixture.php cake/tests/fixtures/portfolio_fixture.php cake/tests/fixtures/post_fixture.php cake/tests/fixtures/posts_tag_fixture.php cake/tests/fixtures/primary_model_fixture.php cake/tests/fixtures/product_fixture.php cake/tests/fixtures/project_fixture.php cake/tests/fixtures/sample_fixture.php cake/tests/fixtures/secondary_model_fixture.php cake/tests/fixtures/session_fixture.php cake/tests/fixtures/something_else_fixture.php cake/tests/fixtures/something_fixture.php cake/tests/fixtures/stories_tag_fixture.php cake/tests/fixtures/story_fixture.php cake/tests/fixtures/syfile_fixture.php cake/tests/fixtures/tag_fixture.php cake/tests/fixtures/test_plugin_article_fixture.php cake/tests/fixtures/test_plugin_comment_fixture.php cake/tests/fixtures/the_paper_monkies_fixture.php cake/tests/fixtures/thread_fixture.php cake/tests/fixtures/translate_article_fixture.php cake/tests/fixtures/translate_fixture.php cake/tests/fixtures/translate_table_fixture.php cake/tests/fixtures/translated_article_fixture.php cake/tests/fixtures/translated_item_fixture.php cake/tests/fixtures/unconventional_tree_fixture.php cake/tests/fixtures/underscore_field_fixture.php cake/tests/fixtures/user_fixture.php cake/tests/fixtures/uuid_fixture.php cake/tests/fixtures/uuid_tag_fixture.php cake/tests/fixtures/uuid_tree_fixture.php cake/tests/fixtures/uuiditem_fixture.php cake/tests/fixtures/uuiditems_uuidportfolio_fixture.php cake/tests/fixtures/uuiditems_uuidportfolio_numericid_fixture.php cake/tests/fixtures/uuidportfolio_fixture.php cake/tests/groups/acl.group.php cake/tests/groups/cache.group.php cake/tests/groups/components.group.php cake/tests/groups/configure.group.php cake/tests/groups/console.group.php cake/tests/groups/controller.group.php cake/tests/groups/database.group.php cake/tests/groups/helpers.group.php cake/tests/groups/lib.group.php cake/tests/groups/model.group.php cake/tests/groups/no_cross_contamination.group.php cake/tests/groups/routing_system.group.php cake/tests/groups/socket.group.php cake/tests/groups/test_suite.group.php cake/tests/groups/view.group.php cake/tests/groups/xml.group.php cake/tests/lib/cake_reporter.php cake/tests/lib/cake_test_case.php cake/tests/lib/cake_test_fixture.php cake/tests/lib/cake_test_model.php cake/tests/lib/cake_web_test_case.php cake/tests/lib/cli_reporter.php cake/tests/lib/code_coverage_manager.php cake/tests/lib/templates/footer.php cake/tests/lib/templates/header.php cake/tests/lib/templates/menu.php cake/tests/lib/templates/simpletest.php cake/tests/lib/test_manager.php cake/tests/lib/xdebug.php cake/tests/test_app/config/acl.ini.php cake/tests/test_app/controllers/tests_apps_controller.php cake/tests/test_app/controllers/tests_apps_posts_controller.php cake/tests/test_app/models/behaviors/persister_one_behavior.php cake/tests/test_app/models/behaviors/persister_two_behavior.php cake/tests/test_app/models/comment.php cake/tests/test_app/models/persister_one.php cake/tests/test_app/models/persister_two.php cake/tests/test_app/models/post.php cake/tests/test_app/plugins/test_plugin/controllers/components/other_component.php cake/tests/test_app/plugins/test_plugin/controllers/components/plugins_component.php cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_component.php cake/tests/test_app/plugins/test_plugin/controllers/components/test_plugin_other_component.php cake/tests/test_app/plugins/test_plugin/controllers/tests_controller.php cake/tests/test_app/plugins/test_plugin/models/test_plugin_post.php cake/tests/test_app/plugins/test_plugin/test_plugin_app_controller.php cake/tests/test_app/plugins/test_plugin/test_plugin_app_model.php cake/tests/test_app/plugins/test_plugin/vendors/sample/sample_plugin.php cake/tests/test_app/plugins/test_plugin/vendors/shells/example.php cake/tests/test_app/plugins/test_plugin/vendors/welcome.php cake/tests/test_app/plugins/test_plugin/views/helpers/other_helper.php cake/tests/test_app/plugins/test_plugin/views/helpers/plugged_helper.php cake/tests/test_app/plugins/test_plugin_two/vendors/shells/example.php cake/tests/test_app/plugins/test_plugin_two/vendors/shells/welcome.php cake/tests/test_app/vendors/Test/MyTest.php cake/tests/test_app/vendors/Test/hello.php cake/tests/test_app/vendors/sample/configure_test_vendor_sample.php cake/tests/test_app/vendors/shells/sample.php cake/tests/test_app/vendors/somename/some.name.php cake/tests/test_app/vendors/welcome.php cake/tests/test_app/views/elements/email/html/default.ctp cake/tests/test_app/views/elements/email/text/default.ctp cake/tests/test_app/views/elements/email/text/wide.ctp cake/tests/test_app/views/layouts/ajax.ctp cake/tests/test_app/views/layouts/ajax2.ctp cake/tests/test_app/views/layouts/cache_layout.ctp cake/tests/test_app/views/layouts/default.ctp cake/tests/test_app/views/layouts/email/html/default.ctp cake/tests/test_app/views/layouts/email/html/thin.ctp cake/tests/test_app/views/layouts/email/text/default.ctp cake/tests/test_app/views/layouts/flash.ctp cake/tests/test_app/views/layouts/multi_cache.ctp cake/tests/test_app/views/posts/sequencial_nocache.ctp cake/tests/test_app/views/posts/test_nocache_tags.ctp index.php
775 lines
No EOL
20 KiB
PHP
775 lines
No EOL
20 KiB
PHP
<?php
|
|
/**
|
|
* Request object for handling alternative HTTP requests
|
|
*
|
|
* Alternative HTTP requests can come from wireless units like mobile phones, palmtop computers,
|
|
* and the like. These units have no use for Ajax requests, and this Component can tell how Cake
|
|
* should respond to the different needs of a handheld computer and a desktop machine.
|
|
*
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
*
|
|
* Licensed under The MIT License
|
|
* Redistributions of files must retain the above copyright notice.
|
|
*
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
|
* @package cake
|
|
* @subpackage cake.cake.libs.controller.components
|
|
* @since CakePHP(tm) v 0.10.4.1076
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
|
*/
|
|
|
|
if (!defined('REQUEST_MOBILE_UA')) {
|
|
define('REQUEST_MOBILE_UA', '(iPhone|MIDP|AvantGo|BlackBerry|J2ME|Opera Mini|DoCoMo|NetFront|Nokia|PalmOS|PalmSource|portalmmm|Plucker|ReqwirelessWeb|SonyEricsson|Symbian|UP\.Browser|Windows CE|Xiino)');
|
|
}
|
|
|
|
/**
|
|
* Request object for handling HTTP requests
|
|
*
|
|
* @package cake
|
|
* @subpackage cake.cake.libs.controller.components
|
|
*
|
|
*/
|
|
class RequestHandlerComponent extends Object {
|
|
|
|
/**
|
|
* 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 $enabled = true;
|
|
|
|
/**
|
|
* Holds the content-type of the response that is set when using
|
|
* RequestHandler::respondAs()
|
|
*
|
|
* @var string
|
|
* @access private
|
|
*/
|
|
var $__responseTypeSet = null;
|
|
|
|
/**
|
|
* Holds the copy of Controller::$params
|
|
*
|
|
* @var array
|
|
* @access public
|
|
*/
|
|
var $params = array();
|
|
|
|
/**
|
|
* 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(
|
|
'javascript' => 'text/javascript',
|
|
'js' => 'text/javascript',
|
|
'json' => 'application/json',
|
|
'css' => 'text/css',
|
|
'html' => array('text/html', '*/*'),
|
|
'text' => 'text/plain',
|
|
'txt' => 'text/plain',
|
|
'csv' => array('application/vnd.ms-excel', 'text/plain'),
|
|
'form' => 'application/x-www-form-urlencoded',
|
|
'file' => 'multipart/form-data',
|
|
'xhtml' => array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
|
|
'xhtml-mobile' => 'application/vnd.wap.xhtml+xml',
|
|
'xml' => array('application/xml', 'text/xml'),
|
|
'rss' => 'application/rss+xml',
|
|
'atom' => 'application/atom+xml',
|
|
'amf' => 'application/x-amf',
|
|
'wap' => array(
|
|
'text/vnd.wap.wml',
|
|
'text/vnd.wap.wmlscript',
|
|
'image/vnd.wap.wbmp'
|
|
),
|
|
'wml' => 'text/vnd.wap.wml',
|
|
'wmlscript' => 'text/vnd.wap.wmlscript',
|
|
'wbmp' => 'image/vnd.wap.wbmp',
|
|
'pdf' => 'application/pdf',
|
|
'zip' => 'application/x-zip',
|
|
'tar' => 'application/x-tar'
|
|
);
|
|
|
|
/**
|
|
* 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
|
|
* @see Router::parseExtensions()
|
|
*/
|
|
var $__acceptTypes = array();
|
|
|
|
/**
|
|
* The template to use when rendering the given content type.
|
|
*
|
|
* @var string
|
|
* @access private
|
|
*/
|
|
var $__renderType = null;
|
|
|
|
/**
|
|
* Contains the file extension parsed out by the Router
|
|
*
|
|
* @var string
|
|
* @access public
|
|
* @see Router::parseExtensions()
|
|
*/
|
|
var $ext = null;
|
|
|
|
/**
|
|
* Flag set when MIME types have been initialized
|
|
*
|
|
* @var boolean
|
|
* @access private
|
|
* @see RequestHandler::__initializeTypes()
|
|
*/
|
|
var $__typesInitialized = false;
|
|
|
|
/**
|
|
* Constructor. Parses the accepted content types accepted by the client using HTTP_ACCEPT
|
|
*
|
|
*/
|
|
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();
|
|
}
|
|
|
|
/**
|
|
* Initializes the component, gets a reference to Controller::$parameters, and
|
|
* checks to see if a file extension has been parsed by the Router. If yes, the
|
|
* corresponding content-type is pushed onto the list of accepted content-types
|
|
* as the first item.
|
|
*
|
|
* @param object $controller A reference to the controller
|
|
* @param array $settings Array of settings to _set().
|
|
* @return void
|
|
* @see Router::parseExtensions()
|
|
* @access public
|
|
*/
|
|
function initialize(&$controller, $settings = array()) {
|
|
if (isset($controller->params['url']['ext'])) {
|
|
$this->ext = $controller->params['url']['ext'];
|
|
}
|
|
$this->_set($settings);
|
|
}
|
|
|
|
/**
|
|
* The startup method of the RequestHandler enables several automatic behaviors
|
|
* related to the detection of certain properties of the HTTP request, including:
|
|
*
|
|
* - Disabling layout rendering for Ajax requests (based on the HTTP_X_REQUESTED_WITH header)
|
|
* - If Router::parseExtensions() is enabled, the layout and template type are
|
|
* switched based on the parsed extension. For example, if controller/action.xml
|
|
* is requested, the view path becomes <i>app/views/controller/xml/action.ctp</i>.
|
|
* - If a helper with the same name as the extension exists, it is added to the controller.
|
|
* - If the extension is of a type that RequestHandler understands, it will set that
|
|
* Content-type in the response header.
|
|
* - If the XML data is POSTed, the data is parsed into an XML object, which is assigned
|
|
* to the $data property of the controller, which can then be saved to a model object.
|
|
*
|
|
* @param object $controller A reference to the controller
|
|
* @return void
|
|
* @access public
|
|
*/
|
|
function startup(&$controller) {
|
|
if (!$this->enabled) {
|
|
return;
|
|
}
|
|
|
|
$this->__initializeTypes();
|
|
$controller->params['isAjax'] = $this->isAjax();
|
|
$isRecognized = (
|
|
!in_array($this->ext, array('html', 'htm')) &&
|
|
in_array($this->ext, array_keys($this->__requestContent))
|
|
);
|
|
|
|
if (!empty($this->ext) && $isRecognized) {
|
|
$this->renderAs($controller, $this->ext);
|
|
} elseif ($this->isAjax()) {
|
|
$this->renderAs($controller, 'ajax');
|
|
}
|
|
|
|
if ($this->requestedWith('xml')) {
|
|
if (!class_exists('XmlNode')) {
|
|
App::import('Core', 'Xml');
|
|
}
|
|
$xml = new Xml(trim(file_get_contents('php://input')));
|
|
|
|
if (count($xml->children) == 1 && is_object($dataNode = $xml->child('data'))) {
|
|
$controller->data = $dataNode->toArray();
|
|
} else {
|
|
$controller->data = $xml->toArray();
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Handles (fakes) redirects for Ajax requests using requestAction()
|
|
*
|
|
* @param object $controller A reference to the controller
|
|
* @param mixed $url A string or array containing the redirect location
|
|
* @access public
|
|
*/
|
|
function beforeRedirect(&$controller, $url) {
|
|
if (!$this->isAjax()) {
|
|
return;
|
|
}
|
|
foreach ($_POST as $key => $val) {
|
|
unset($_POST[$key]);
|
|
}
|
|
echo $this->requestAction($url, array('return'));
|
|
$this->_stop();
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current HTTP request is Ajax, false otherwise
|
|
*
|
|
* @return boolean True if call is Ajax
|
|
* @access public
|
|
*/
|
|
function isAjax() {
|
|
return env('HTTP_X_REQUESTED_WITH') === "XMLHttpRequest";
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current HTTP request is coming from a Flash-based client
|
|
*
|
|
* @return boolean True if call is from Flash
|
|
* @access public
|
|
*/
|
|
function isFlash() {
|
|
return (preg_match('/^(Shockwave|Adobe) Flash/', env('HTTP_USER_AGENT')) == 1);
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current request is over HTTPS, false otherwise.
|
|
*
|
|
* @return bool True if call is over HTTPS
|
|
* @access public
|
|
*/
|
|
function isSSL() {
|
|
return env('HTTPS');
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current call accepts an XML response, false otherwise
|
|
*
|
|
* @return boolean True if client accepts an XML response
|
|
* @access public
|
|
*/
|
|
function isXml() {
|
|
return $this->prefers('xml');
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current call accepts an RSS response, false otherwise
|
|
*
|
|
* @return boolean True if client accepts an RSS response
|
|
* @access public
|
|
*/
|
|
function isRss() {
|
|
return $this->prefers('rss');
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current call accepts an Atom response, false otherwise
|
|
*
|
|
* @return boolean True if client accepts an RSS response
|
|
* @access public
|
|
*/
|
|
function isAtom() {
|
|
return $this->prefers('atom');
|
|
}
|
|
|
|
/**
|
|
* Returns true if user agent string matches a mobile web browser, or if the
|
|
* client accepts WAP content.
|
|
*
|
|
* @return boolean True if user agent is a mobile web browser
|
|
* @access public
|
|
*/
|
|
function isMobile() {
|
|
preg_match('/' . REQUEST_MOBILE_UA . '/i', env('HTTP_USER_AGENT'), $match);
|
|
if (!empty($match) || $this->accepts('wap')) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Returns true if the client accepts WAP content
|
|
*
|
|
* @return bool
|
|
* @access public
|
|
*/
|
|
function isWap() {
|
|
return $this->prefers('wap');
|
|
}
|
|
|
|
/**
|
|
* Returns true if the current call a POST request
|
|
*
|
|
* @return boolean 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 boolean 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 boolean 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 boolean 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. This method allows
|
|
* content-types to be mapped to friendly aliases (or extensions), which allows
|
|
* RequestHandler to automatically respond to requests of that type in the
|
|
* startup method.
|
|
*
|
|
* @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,
|
|
* i.e. "text/html", or "application/xml"
|
|
* @return void
|
|
* @access public
|
|
*/
|
|
function setContent($name, $type = null) {
|
|
if (is_array($name)) {
|
|
$this->__requestContent = array_merge($this->__requestContent, $name);
|
|
return;
|
|
}
|
|
$this->__requestContent[$name] = $type;
|
|
}
|
|
|
|
/**
|
|
* Gets the server name from which this request was referred
|
|
*
|
|
* @return string Server address
|
|
* @access public
|
|
*/
|
|
function getReferer() {
|
|
if (env('HTTP_HOST') != null) {
|
|
$sessHost = env('HTTP_HOST');
|
|
}
|
|
|
|
if (env('HTTP_X_FORWARDED_HOST') != null) {
|
|
$sessHost = env('HTTP_X_FORWARDED_HOST');
|
|
}
|
|
return trim(preg_replace('/(?:\:.*)/', '', $sessHost));
|
|
}
|
|
|
|
/**
|
|
* Gets remote client IP
|
|
*
|
|
* @return string Client IP address
|
|
* @access public
|
|
*/
|
|
function getClientIP($safe = true) {
|
|
if (!$safe && 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);
|
|
}
|
|
|
|
/**
|
|
* Determines which content types the client accepts. Acceptance is based on
|
|
* the file extension parsed by the Router (if present), and by the HTTP_ACCEPT
|
|
* header.
|
|
*
|
|
* @param mixed $type Can be null (or no parameter), a string type name, or an
|
|
* array of types
|
|
* @return mixed If null or no parameter is passed, returns an array of content
|
|
* types the client accepts. If a string is passed, returns true
|
|
* if the client accepts it. If an array is passed, returns true
|
|
* if the client accepts one or more elements in the array.
|
|
* @access public
|
|
* @see RequestHandlerComponent::setContent()
|
|
*/
|
|
function accepts($type = null) {
|
|
$this->__initializeTypes();
|
|
|
|
if ($type == null) {
|
|
return $this->mapType($this->__acceptTypes);
|
|
|
|
} elseif (is_array($type)) {
|
|
foreach ($type as $t) {
|
|
if ($this->accepts($t) == true) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
} elseif (is_string($type)) {
|
|
|
|
if (!isset($this->__requestContent[$type])) {
|
|
return false;
|
|
}
|
|
|
|
$content = $this->__requestContent[$type];
|
|
|
|
if (is_array($content)) {
|
|
foreach ($content as $c) {
|
|
if (in_array($c, $this->__acceptTypes)) {
|
|
return true;
|
|
}
|
|
}
|
|
} else {
|
|
if (in_array($content, $this->__acceptTypes)) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Determines the content type of the data the client has sent (i.e. in a POST request)
|
|
*
|
|
* @param mixed $type Can be null (or no parameter), a string type name, or an array of types
|
|
* @return mixed
|
|
* @access public
|
|
*/
|
|
function requestedWith($type = null) {
|
|
if (!$this->isPost() && !$this->isPut()) {
|
|
return null;
|
|
}
|
|
|
|
list($contentType) = explode(';', env('CONTENT_TYPE'));
|
|
if ($type == null) {
|
|
return $this->mapType($contentType);
|
|
} elseif (is_array($type)) {
|
|
foreach ($type as $t) {
|
|
if ($this->requestedWith($t)) {
|
|
return $this->mapType($t);
|
|
}
|
|
}
|
|
return false;
|
|
} elseif (is_string($type)) {
|
|
return ($type == $this->mapType($contentType));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Determines which content-types the client prefers. If no parameters are given,
|
|
* the content-type that the client most likely prefers is returned. If $type is
|
|
* an array, the first item in the array that the client accepts is returned.
|
|
* Preference is determined primarily by the file extension parsed by the Router
|
|
* if provided, and secondarily by the list of content-types provided in
|
|
* HTTP_ACCEPT.
|
|
*
|
|
* @param mixed $type An optional array of 'friendly' content-type names, i.e.
|
|
* 'html', 'xml', 'js', etc.
|
|
* @return mixed If $type is null or not provided, the first content-type in the
|
|
* list, based on preference, is returned.
|
|
* @access public
|
|
* @see RequestHandlerComponent::setContent()
|
|
*/
|
|
function prefers($type = null) {
|
|
$this->__initializeTypes();
|
|
$accept = $this->accepts();
|
|
|
|
if ($type == null) {
|
|
if (empty($this->ext)) {
|
|
if (is_array($accept)) {
|
|
return $accept[0];
|
|
}
|
|
return $accept;
|
|
}
|
|
return $this->ext;
|
|
}
|
|
|
|
$types = $type;
|
|
if (is_string($type)) {
|
|
$types = array($type);
|
|
}
|
|
|
|
if (count($types) === 1) {
|
|
if (!empty($this->ext)) {
|
|
return ($types[0] == $this->ext);
|
|
}
|
|
return ($types[0] == $accept[0]);
|
|
}
|
|
$accepts = array();
|
|
|
|
foreach ($types as $type) {
|
|
if (in_array($type, $accept)) {
|
|
$accepts[] = $type;
|
|
}
|
|
}
|
|
|
|
if (count($accepts) === 0) {
|
|
return false;
|
|
} elseif (count($types) === 1) {
|
|
return ($types[0] === $accepts[0]);
|
|
} elseif (count($accepts) === 1) {
|
|
return $accepts[0];
|
|
}
|
|
|
|
$acceptedTypes = array();
|
|
foreach ($this->__acceptTypes as $type) {
|
|
$acceptedTypes[] = $this->mapType($type);
|
|
}
|
|
$accepts = array_intersect($acceptedTypes, $accepts);
|
|
return $accepts[0];
|
|
}
|
|
|
|
/**
|
|
* Sets the layout and template paths for the content type defined by $type.
|
|
*
|
|
* @param object $controller A reference to a controller object
|
|
* @param string $type Type of response to send (e.g: 'ajax')
|
|
* @return void
|
|
* @access public
|
|
* @see RequestHandlerComponent::setContent()
|
|
* @see RequestHandlerComponent::respondAs()
|
|
*/
|
|
function renderAs(&$controller, $type) {
|
|
$this->__initializeTypes();
|
|
$options = array('charset' => 'UTF-8');
|
|
|
|
if (Configure::read('App.encoding') !== null) {
|
|
$options = array('charset' => Configure::read('App.encoding'));
|
|
}
|
|
|
|
if ($type == 'ajax') {
|
|
$controller->layout = $this->ajaxLayout;
|
|
return $this->respondAs('html', $options);
|
|
}
|
|
$controller->ext = '.ctp';
|
|
|
|
if (empty($this->__renderType)) {
|
|
$controller->viewPath .= DS . $type;
|
|
} else {
|
|
$remove = preg_replace("/([\/\\\\]{$this->__renderType})$/", DS . $type, $controller->viewPath);
|
|
$controller->viewPath = $remove;
|
|
}
|
|
$this->__renderType = $type;
|
|
$controller->layoutPath = $type;
|
|
|
|
if (isset($this->__requestContent[$type])) {
|
|
$this->respondAs($type, $options);
|
|
}
|
|
|
|
$helper = ucfirst($type);
|
|
$isAdded = (
|
|
in_array($helper, $controller->helpers) ||
|
|
array_key_exists($helper, $controller->helpers)
|
|
);
|
|
|
|
if (!$isAdded) {
|
|
if (App::import('Helper', $helper)) {
|
|
$controller->helpers[] = $helper;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sets the response header based on type map index name. If DEBUG is greater than 2, the header
|
|
* is not set.
|
|
*
|
|
* @param mixed $type Friendly type name, i.e. 'html' or 'xml', or a full content-type,
|
|
* like 'application/x-shockwave'.
|
|
* @param array $options If $type is a friendly type name that is associated with
|
|
* more than one type of content, $index is used to select which content-type to use.
|
|
*
|
|
* @return boolean Returns false if the friendly type name given in $type does
|
|
* not exist in the type map, or if the Content-type header has
|
|
* already been set by this method.
|
|
* @access public
|
|
* @see RequestHandlerComponent::setContent()
|
|
*/
|
|
function respondAs($type, $options = array()) {
|
|
$this->__initializeTypes();
|
|
if ($this->__responseTypeSet != null) {
|
|
return false;
|
|
}
|
|
if (!array_key_exists($type, $this->__requestContent) && strpos($type, '/') === false) {
|
|
return false;
|
|
}
|
|
$defaults = array('index' => 0, 'charset' => null, 'attachment' => false);
|
|
$options = array_merge($defaults, $options);
|
|
|
|
if (strpos($type, '/') === false && isset($this->__requestContent[$type])) {
|
|
$cType = null;
|
|
if (is_array($this->__requestContent[$type]) && isset($this->__requestContent[$type][$options['index']])) {
|
|
$cType = $this->__requestContent[$type][$options['index']];
|
|
} elseif (is_array($this->__requestContent[$type]) && isset($this->__requestContent[$type][0])) {
|
|
$cType = $this->__requestContent[$type][0];
|
|
} elseif (isset($this->__requestContent[$type])) {
|
|
$cType = $this->__requestContent[$type];
|
|
} else {
|
|
return false;
|
|
}
|
|
|
|
if (is_array($cType)) {
|
|
if ($this->prefers($cType)) {
|
|
$cType = $this->prefers($cType);
|
|
} else {
|
|
$cType = $cType[0];
|
|
}
|
|
}
|
|
} else {
|
|
$cType = $type;
|
|
}
|
|
|
|
if ($cType != null) {
|
|
$header = 'Content-type: ' . $cType;
|
|
|
|
if (!empty($options['charset'])) {
|
|
$header .= '; charset=' . $options['charset'];
|
|
}
|
|
if (!empty($options['attachment'])) {
|
|
header("Content-Disposition: attachment; filename=\"{$options['attachment']}\"");
|
|
}
|
|
if (Configure::read() < 2 && !defined('CAKEPHP_SHELL')) {
|
|
@header($header);
|
|
}
|
|
$this->__responseTypeSet = $cType;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Returns the current response type (Content-type header), or null if none has been set
|
|
*
|
|
* @return mixed A string content type alias, or raw content type if no alias map exists,
|
|
* otherwise null
|
|
* @access public
|
|
*/
|
|
function responseType() {
|
|
if ($this->__responseTypeSet == null) {
|
|
return null;
|
|
}
|
|
return $this->mapType($this->__responseTypeSet);
|
|
}
|
|
|
|
/**
|
|
* Maps a content-type back to an alias
|
|
*
|
|
* @param mixed $type Content type
|
|
* @return mixed Alias
|
|
* @access public
|
|
*/
|
|
function mapType($ctype) {
|
|
if (is_array($ctype)) {
|
|
$out = array();
|
|
foreach ($ctype as $t) {
|
|
$out[] = $this->mapType($t);
|
|
}
|
|
return $out;
|
|
} else {
|
|
$keys = array_keys($this->__requestContent);
|
|
$count = count($keys);
|
|
|
|
for ($i = 0; $i < $count; $i++) {
|
|
$name = $keys[$i];
|
|
$type = $this->__requestContent[$name];
|
|
|
|
if (is_array($type) && in_array($ctype, $type)) {
|
|
return $name;
|
|
} elseif (!is_array($type) && $type == $ctype) {
|
|
return $name;
|
|
}
|
|
}
|
|
return $ctype;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Initializes MIME types
|
|
*
|
|
* @return void
|
|
* @access private
|
|
*/
|
|
function __initializeTypes() {
|
|
if ($this->__typesInitialized) {
|
|
return;
|
|
}
|
|
if (isset($this->__requestContent[$this->ext])) {
|
|
$content = $this->__requestContent[$this->ext];
|
|
if (is_array($content)) {
|
|
$content = $content[0];
|
|
}
|
|
array_unshift($this->__acceptTypes, $content);
|
|
}
|
|
$this->__typesInitialized = true;
|
|
}
|
|
}
|
|
|
|
?>
|