Table of contents:

Gateway.php

AMFPHP connections go through the gateway.php file located in the amfphp folder. There are several settings in this file that can be changed to tailor amfphp to your environemnt. Edit the gateway.php file to update these settings. There are also configuration values located in globals.php.

required files

PRODUCTION_SERVER

By default amfphp is set to flase for PRODUCTION_SERVER. This is becuase if you just installed amfphp you want to see errors! By changing this value to true you disable profiling, remote tracing, and the Flash/Flex IDE StandAlone Player, in addition to the service browser. This is an important security issue! YOu should delete the browser directory on a production server!

Class Path

The service path is the location of your php classes to be consumed as services. The default location is amfphp/services/ however it is sometimes nice to place them outside of the amfphp directory. Edit globals.php to change the services path. Note that the trailing slash is required.

$servicesPath = "services/";

 

Class Mapping Path

Class mapping is one of the best features of amfphp for use with large groups of developers utilizing MVC frameworks. There are times that you want to define the location of all of your VO's (Value Object). Note the trailing slash is required.

$voPath = "services/vo/";

 

Character Set Handler

By default the Character Set Handler is setup as none. Iconv is included by default in php5, but not in php4 although most hosts have it installed. utf8_decode is of some use for Western European languages, but please remember that it won't work with settings other than ISO-8859-1.
The other methods also require seldom-used extensions but were included
just in case your particular host only supports them.

Replace the default English with a server enabled character set at the bottom of gateway.php

English:

$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );

Western european languages (French, Spanish, German, etc.):

$gateway->setCharsetHandler( "iconv", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );

Eastern european languages (Russian and other slavic languages):

$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "iconv", "your codepage", "your codepage" );

Oriental languages (Chinese, japanese, korean):

$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "iconv", "big5", "big5" );
$gateway->setCharsetHandler( "iconv", "CP950", "CP950" );
$gateway->setCharsetHandler( "iconv", "Shift_JIS", "Shift_JIS" );
$gateway->setCharsetHandler( "iconv", "CP932", "CP932" );
$gateway->setCharsetHandler( "iconv", "CP949", "CP949" );

Other languages:

$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );

See all the possible codepages for iconv here:

http://www.gnu.org/software/libiconv/


© amfphp.org | Disclaimer | Conditions of use