php5-xcache

Bradley Giesbrecht pixilla at macports.org
Sun Nov 6 09:19:29 PST 2011


On Nov 6, 2011, at 8:39 AM, Phil Dobbin wrote:

> On 6/11/11 16:28, "Bradley Giesbrecht" <brad at pixilla.com> wrote:
> 
>> Yes, sdk.class.php simply includes config.inc.php IF IT EXISTS. Whatever php
>> would parse in config.inc.php could
>> be parsed in ANY FILE before require_once("AWSSDKforPHP/sdk.class.php");.
>> 
>> The AWSSDKforPHP package includes a sample config.inc.php file. While you
>> learn to use the class I suggest you copy
>> it to your working directory and include it before the sdk class. Later you
>> can move the config.inc.php file somewhere else
>> for organizational purposes.
>> 
>> $ cp /opt/local/lib/php/pear/AWSSDKforPHP/config-sample.inc.php
>> ./config.inc.php
>> 
>> In your script:
>> require_once("config.inc.php");
>> require_once("AWSSDKforPHP/sdk.class.php");
> 
> I moved the original `AWSSDKforPHP` that I downloaded from PEAR via MacPorts
> to ~/.aws/sdk before I port installed the AWSSDKforPHP so as not to confuse
> things.

Generally speaking you should not "move" files installed by MacPorts. Coping sample configuration files is expected.

> The MacPorts `config.inc.php` contains my AWS security details as
> does the one in ~/.aws/sdk.

When you say "MacPorts `config.inc.php`" you mean the config-sample.inc.php file that you copied to {some dir}/config.inc.php, right?

I would move ~/.aws out of the way, you don't need it and it can only add to confusion should AWSSDK pickup some file in that dir.

Just include your config file before you include the class. If working with an existing/example application adding your config file to the top of the first php file should be fine.


Regards,
Bradley Giesbrecht (pixilla)






More information about the macports-users mailing list