sure, here are my files:
in <web_root>/system/application/config/config.php
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the "hooks" feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = TRUE;
<web_root>/system/application/config/hooks.php
(NOTE: I remember now there was a problem with this file. I had forgotten to add the closing “?>” php tag at the bottom. This is easy to do because of the way the default file is set up.
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files. Please see the user guide for info:
|
| http://codeigniter.com/user_guide/general/hooks.html
|
*/
$hook['display_override'] = array(
'class' => 'Amfphp',
'function' => 'output',
'filename' => 'amfphp.php',
'filepath' => 'hooks'
);
/* End of file hooks.php */
/* Location: ./system/application/config/hooks.php */
?>
<web_root>/system/application/hooks/amfphp.php
<?php
class Amfphp
{
var $ci;
function output()
{
if(!defined('AMFPHP'))
{
$this->ci =& get_instance();
$this->ci->output->_display($this->ci->output->get_output());
}
}
}
?>
<web_root>/amfphp/services/ci.php
NOTE: This was not clear in the wiki - it doesn’t give you an exact path to the services file, it just says to create one.
<?php
class ci
{
function execute($path, $vars=false)
{
define('AMFPHP', 1);
global $value;
if($vars AND is_array($vars)){
// Convert vars to POST data
$_POST = $vars;
}
$_SERVER['PATH_INFO'] = '/'.$path;
$_SERVER['QUERY_STRING'] = '/'.$path;
$_SERVER['REQUEST_URI'] = '/'.$path;
require_once('../../index.php');
return $value;
}
}
?>
I then call this from flash like so:
(Note: this is not tested code - but has all of the calls I use)
var args:Object = {'arg1':1,'arg2':2};
var connection:NetConnection = new NetConnection;
var responder:Responder = new Responder(onResult, onFault);
connection.connect("http://www.your_host.com/amfphp/gateway.php");
connection.call('ci.execute', responder, 'your_controller/your_controller_method', args);
This will populate $_POST with an associative php array.
Hope this helps.
A