Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes sure AWS credentials are not already defined #53

Open
wants to merge 1 commit into
base: pThumb-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/components/phpthumbof/model/phpthumbof.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ function __construct(modX &$modx, &$settings_cache, $options, $s3info = 0) {
$this->config["{$this->config['s3outKey']}_url"] = $s3properties['url'];
$s3obj->bucket = $s3properties['bucket'];
include_once MODX_CORE_PATH . 'model/aws/sdk.class.php';
define('AWS_KEY', $s3properties['key']);
define('AWS_SECRET_KEY', $s3properties['secret_key']);
if(!defined('AWS_KEY')) define('AWS_KEY', $s3properties['key']);
if(!defined('AWS_SECRET_KEY')) define('AWS_SECRET_KEY', $s3properties['secret_key']);
try { $s3obj->driver = new AmazonS3(); }
catch (Exception $e) {
$modx->log(modX::LOG_LEVEL_ERROR, "[pThumb] Error connecting to S3 media source {$this->config['s3outputMS']}: " . $e->getMessage());
Expand Down