Callum, i just emailed you about this–your technique worked like a charm!!! I had a hard time at first understanding what you meant. You wrote “gedit” and i thought he couldn’t possibly be talking about Gedit on Ubuntu. …either way, for anyone else interested, you have to download and install the regular expression search and replace Gedit plugin here:
http://halfhourhacks.blogspot.com/2008/03/gedit-regular-expression-plugin.html
download the files. place them where they say to place them after extracting them. however, the files you place there are in the folder within the extracted folder. so just extracting them isn’t enough. go one level deep and copy/paste that into the gedit plugins folder.
Otherwise, if you’re like me when i was first looking at Callum’s explanation, i didn’t understand the classMap. Basically, install the entire AWS SDK folder tree in your extensions folder. Then go there at the commandline, and type:
grep -rn -e "^class" * > classMap.php
and then open that file in Gedit on Ubuntu (or any other distro that has it), and first install the regular expressions Gedit plugin. And then execute the plugin by filling the search field with this:
^([^:]*):\d+:class (\S*).*$
and the replace field with this:
'\2' => $aws_path . '\1',
Basically what is happening is his initial grep command is build a list of all the files in the aws sdk folder tree that end in ‘class’ , i.e. it’s producing a list of all the class file names and class names. Then when you run the regular expression in gedit you produce a proper array map of files to include. That’s all. Contact me if you need any help.
Thanks again, Callum!
ps. here’s the classMap.php file:
<?php
return(array(
'S3_Exception' => $aws_path . 'sdk/services/s3.class.php',
'AmazonS3' => $aws_path . 'sdk/services/s3.class.php',
'AmazonSQS' => $aws_path . 'sdk/services/sqs.class.php',
'SQS_Exception' => $aws_path . 'sdk/services/sqs.class.php',
'AmazonRDS' => $aws_path . 'sdk/services/rds.class.php',
'RDS_Exception' => $aws_path . 'sdk/services/rds.class.php',
'CloudFront_Exception' => $aws_path . 'sdk/services/cloudfront.class.php',
'AmazonCloudFront' => $aws_path . 'sdk/services/cloudfront.class.php',
'AmazonEC2' => $aws_path . 'sdk/services/ec2.class.php',
'EC2_Exception' => $aws_path . 'sdk/services/ec2.class.php',
'AmazonIAM' => $aws_path . 'sdk/services/iam.class.php',
'IAM_Exception' => $aws_path . 'sdk/services/iam.class.php',
'AmazonELB' => $aws_path . 'sdk/services/elb.class.php',
'ELB_Exception' => $aws_path . 'sdk/services/elb.class.php',
'AmazonElasticBeanstalk' => $aws_path . 'sdk/services/elasticbeanstalk.class.php',
'ElasticBeanstalk_Exception' => $aws_path . 'sdk/services/elasticbeanstalk.class.php',
'AmazonCloudFormation' => $aws_path . 'sdk/services/cloudformation.class.php',
'CloudFormation_Exception' => $aws_path . 'sdk/services/cloudformation.class.php',
'AmazonCloudWatch' => $aws_path . 'sdk/services/cloudwatch.class.php',
'CloudWatch_Exception' => $aws_path . 'sdk/services/cloudwatch.class.php',
'AmazonSDB' => $aws_path . 'sdk/services/sdb.class.php',
'SDB_Exception' => $aws_path . 'sdk/services/sdb.class.php',
'AmazonEMR' => $aws_path . 'sdk/services/emr.class.php',
'EMR_Exception' => $aws_path . 'sdk/services/emr.class.php',
'AmazonSNS' => $aws_path . 'sdk/services/sns.class.php',
'SNS_Exception' => $aws_path . 'sdk/services/sns.class.php',
'AmazonImportExport' => $aws_path . 'sdk/services/importexport.class.php',
'ImportExport_Exception' => $aws_path . 'sdk/services/importexport.class.php',
'AmazonAS' => $aws_path . 'sdk/services/as.class.php',
'AS_Exception' => $aws_path . 'sdk/services/as.class.php',
'AmazonSES' => $aws_path . 'sdk/services/ses.class.php',
'Email_Exception' => $aws_path . 'sdk/services/ses.class.php',
'sfYaml' => $aws_path . 'sdk/lib/yaml/lib/sfYaml.php',
'sfYamlDumper' => $aws_path . 'sdk/lib/yaml/lib/sfYamlDumper.php',
'sfYamlInline' => $aws_path . 'sdk/lib/yaml/lib/sfYamlInline.php',
'sfYamlParser' => $aws_path . 'sdk/lib/yaml/lib/sfYamlParser.php',
'CachePDO' => $aws_path . 'sdk/lib/cachecore/cachepdo.class.php',
'CacheAPC' => $aws_path . 'sdk/lib/cachecore/cacheapc.class.php',
'CacheFile' => $aws_path . 'sdk/lib/cachecore/cachefile.class.php',
'CacheXCache' => $aws_path . 'sdk/lib/cachecore/cachexcache.class.php',
'CacheMC' => $aws_path . 'sdk/lib/cachecore/cachemc.class.php',
'CacheCore' => $aws_path . 'sdk/lib/cachecore/cachecore.class.php',
'RequestCore' => $aws_path . 'sdk/lib/requestcore/requestcore.class.php',
'ResponseCore' => $aws_path . 'sdk/lib/requestcore/requestcore.class.php',
'RequestCore_Exception' => $aws_path . 'sdk/lib/requestcore/requestcore.class.php',
'Console_ProgressBar' => $aws_path . 'sdk/_samples/lib/ProgressBar.php',
'CFRuntime_Exception' => $aws_path . 'sdk/sdk.class.php',
'CFRuntime' => $aws_path . 'sdk/sdk.class.php',
'CFLoader' => $aws_path . 'sdk/sdk.class.php',
'CFInfo' => $aws_path . 'sdk/utilities/info.class.php',
'CFJSON' => $aws_path . 'sdk/utilities/json.class.php',
'JSON_Exception' => $aws_path . 'sdk/utilities/json.class.php',
'CFStepConfig' => $aws_path . 'sdk/utilities/stepconfig.class.php',
'CFPolicy' => $aws_path . 'sdk/utilities/policy.class.php',
'CFArray' => $aws_path . 'sdk/utilities/array.class.php',
'CFMimeTypes' => $aws_path . 'sdk/utilities/mimetypes.class.php',
'CFStackTemplate' => $aws_path . 'sdk/utilities/stacktemplate.class.php',
'CFComplexType' => $aws_path . 'sdk/utilities/complextype.class.php',
'CFResponse' => $aws_path . 'sdk/utilities/response.class.php',
'CFBatchRequest_Exception' => $aws_path . 'sdk/utilities/batchrequest.class.php',
'CFBatchRequest' => $aws_path . 'sdk/utilities/batchrequest.class.php',
'CFSimpleXML' => $aws_path . 'sdk/utilities/simplexml.class.php',
'CFRequest' => $aws_path . 'sdk/utilities/request.class.php',
'CFManifest' => $aws_path . 'sdk/utilities/manifest.class.php',
'CFUtilities' => $aws_path . 'sdk/utilities/utilities.class.php',
'CFGzipDecode' => $aws_path . 'sdk/utilities/gzipdecode.class.php',
'CFHadoopStep' => $aws_path . 'sdk/utilities/hadoopstep.class.php',
));
and here’s my index.php entry script:
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
$debug = $_SERVER['HTTP_HOST'] != "www.crimetv.com" ? true : false;
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',$debug);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
if($debug) {
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
error_reporting(E_ALL);
ini_set('display_errors', 'on');
}
require_once($yii);
$aws_path = dirname(__FILE__).'/protected/extensions/aws-sdk/'; //ADD THIS!!!
Yii::$classMap=require(dirname(__FILE__).'/protected/config/classMap.php'); //ADD THIS!!!
Yii::createWebApplication($config)->run();