* amfphp gateway for cake controllers * Created By Wouter Verweirder * Based on the work of Patrick Mineault (amfphp), gwoo (cakephp) & Aral Balkan (swx) */ require_once 'cake_gateway_init.php'; App::import('Vendor', 'cake_gateway', array('file' => 'cakeswx' . DS . 'php' . DS . 'core' . DS . 'amf' . DS . 'app' . DS . 'CakeGateway.php')); App::import('Controller', 'App'); //You can set this constant appropriately to disable traces and debugging headers //You will also have the constant available in your classes, for changing //the mysql server info for example define("PRODUCTION_SERVER", false); //Include things that need to be global, for integrating with other frameworks //include "globals.php"; //Include framework //include "core/amf/app/Gateway.php"; $gateway = new CakeGateway(); //Set where the services classes are loaded from, *with trailing slash* $gateway->setClassPath(CONTROLLERS); //Set where class mappings are loaded from (ie: for VOs) //$voPath defined in globals.php //$gateway->setClassMappingsPath($voPath); //Read above large note for explanation of charset handling //The main contributor (Patrick Mineault) is French, //so don't be afraid if he forgot to turn off iconv by default! $gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1"); //Error types that will be rooted to the NetConnection debugger $gateway->setErrorHandling(E_ALL ^ E_NOTICE); if (PRODUCTION_SERVER) { //Disable profiling, remote tracing, and service browser $gateway->disableDebug(); }
<?php /* * json gateway for cake controllers * Created By Wouter Verweirder * Based on the work of Patrick Mineault (amfphp), gwoo (cakephp) & Aral Balkan (swx) */ require_once 'cake_gateway_init.php'; App::import('Vendor', 'cake_gateway', array('file' => 'cakeswx' . DS . 'php' . DS . 'core' . DS . 'json' . DS . 'app' . DS . 'CakeGateway.php')); App::import('Controller', 'App'); $gateway = new CakeGateway(); $gateway->setBaseClassPath(CONTROLLERS); $gateway->service();
- disableDebug() Stops debug info from being sent (independant of remote trace setting) */ //You can set this constant appropriately to disable traces and debugging headers //You will also have the constant available in your classes, for changing //the mysql server info for example define("PRODUCTION_SERVER", false); //Include things that need to be global, for integrating with other frameworks include "globals.php"; //Include the extended gateway framework include "core/cakeamf/app/CakeGateway.php"; if (defined("USE_ARRAY_COLLECTION_MAPPING") && USE_ARRAY_COLLECTION_MAPPING == true) { include_once $voPath . "/ArrayCollection.php"; } $gateway = new CakeGateway(); //Set where the services classes are loaded from, *with trailing slash* //$servicesPath defined in globals.php $gateway->setClassPath(APP . 'Controller' . DS); //Set where class mappings are loaded from (ie: for VOs) //$voPath defined in globals.php $gateway->setClassMappingsPath($voPath); //Read above large note for explanation of charset handling //The main contributor (Patrick Mineault) is French, //so don't be afraid if he forgot to turn off iconv by default! $gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1"); //Error types that will be rooted to the NetConnection debugger $gateway->setErrorHandling(E_ALL ^ E_NOTICE); if (PRODUCTION_SERVER) { //Disable profiling, remote tracing, and service browser $gateway->disableDebug();