| 1 |
<?php |
<?php |
| 2 |
// $Id: amfphp.module,v 1.4 2007/01/20 07:09:25 snelson Exp $ |
// $Id: amfphp.module,v 1.6 2007/07/15 06:48:53 snelson Exp $ |
| 3 |
|
|
| 4 |
/* |
/* |
| 5 |
* Implementation of hook_requirements() |
* Implementation of hook_requirements() |
| 15 |
|
|
| 16 |
if (!file_exists(realpath(dirname(__FILE__) . '/amfphp/core/amf/app/Gateway.php'))) { |
if (!file_exists(realpath(dirname(__FILE__) . '/amfphp/core/amf/app/Gateway.php'))) { |
| 17 |
$requirements['amfphp']['value'] = $t('Not found'); |
$requirements['amfphp']['value'] = $t('Not found'); |
| 18 |
$requirements['amfphp']['description'] = $t('You must dowload <a href="http://www.5etdemi.com/blog/archives/2006/12/amfphp-19-beta-get-it-now/">AMFPHP 1.9 beta</a> or newer, and place in the amfphp module folder.'); |
$requirements['amfphp']['description'] = $t('You must dowload <a href="http://www.5etdemi.com/blog/archives/2006/12/amfphp-19-beta-get-it-now/">AMFPHP 1.9 beta</a> or newer, and place inside the amfphp module folder.'); |
| 19 |
$requirements['amfphp']['severity'] = REQUIREMENT_ERROR; |
$requirements['amfphp']['severity'] = REQUIREMENT_ERROR; |
| 20 |
} |
} |
| 21 |
|
|
| 37 |
* here we include the contents of a gateway.php |
* here we include the contents of a gateway.php |
| 38 |
*/ |
*/ |
| 39 |
function amfphp_server() { |
function amfphp_server() { |
| 40 |
require_once drupal_get_path('module', 'amfphp') . "/overrides/AmfphpGateway.php"; |
$path = drupal_get_path('module', 'amfphp'); |
| 41 |
$gateway = new AmfphpGateway(); |
define("PRODUCTION_SERVER", variable_get('services_debug', FALSE)); |
| 42 |
|
|
| 43 |
// settings |
require_once $path . "/amfphp/globals.php"; |
| 44 |
$gateway->setLooseMode(true); |
require_once $path . "/overrides/AmfphpGateway.php"; |
| 45 |
|
|
| 46 |
|
$gateway = new AmfphpGateway(); |
| 47 |
|
$gateway->setClassPath($servicesPath); |
| 48 |
|
$gateway->setClassMappingsPath($voPath); |
| 49 |
|
$gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1"); |
| 50 |
$gateway->setErrorHandling(E_ALL ^ E_NOTICE); |
$gateway->setErrorHandling(E_ALL ^ E_NOTICE); |
|
$gateway->setAmf3RecordSetFormat("ArrayCollection"); |
|
| 51 |
|
|
| 52 |
// is production? |
if(PRODUCTION_SERVER) |
| 53 |
if(variable_get('services_debug', FALSE)) { |
{ |
|
$gateway->disableTrace(); |
|
| 54 |
$gateway->disableDebug(); |
$gateway->disableDebug(); |
|
$gateway->disableServiceDescription(); |
|
| 55 |
} |
} |
| 56 |
|
|
| 57 |
// adapter mappings |
$gateway->enableGzipCompression(25*1024); |
|
$gateway->addAdapterMapping('arrayf', 'arrayf'); |
|
|
$gateway->addAdapterMapping('arrayft', 'arrayft'); |
|
|
|
|
|
// start service |
|
| 58 |
$gateway->service(); |
$gateway->service(); |
| 59 |
} |
} |
| 60 |
|
|