Plugin Directory

Changeset 495105


Ignore:
Timestamp:
01/25/2012 10:27:58 AM (14 years ago)
Author:
atvdev
Message:
 
Location:
amazon-s3-uploads/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • amazon-s3-uploads/trunk/asssu-models.php

    r493910 r495105  
    141141    }
    142142   
    143     function find_files($path, &$limit, $dir='') {
     143    function find_files($path, $limit, $dir='') {
    144144        $out = array();
    145145        $dir_path = $path.$dir;
    146146        if ($handle = opendir($dir_path)) {
    147147            while (false !== ($entry = readdir($handle)) && $limit > 0) {
    148                 if (!in_array($entry, array('.', '..', '.htaccess')) && $this->scheduled_files < 100) {
     148                if (!in_array($entry, array('.', '..', '.htaccess'))) {
    149149                    $entry_path = $dir_path.'/'.$entry;
    150150                    if (is_file($entry_path)) {
     
    195195    }
    196196
    197     function configure($wpdb=null) {
    198         if (!is_null($wpdb))
    199             $this->db = $wpdb;         
     197    function configure($wpdb) {
     198        $this->db = $wpdb;
    200199        $this->enabled = false;
    201200
     
    234233        $this->config = $config;
    235234        $this->config->endpoint = $this->get_endpoint();
     235        if (empty($this->config->endpoint)) {
     236            $error_log = 'endpoint could not be found'."\n";
     237            require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'tpyo-amazon-s3-php-class'.DIRECTORY_SEPARATOR.'S3.php';
     238            $adapter = new S3($config->access_key, $config->secret_key, $config->use_ssl);
     239            if (empty($adapter))
     240                $error_log .= 'could not connect to S3'."\n";
     241            $buckets = $adapter->listBuckets();
     242            if (empty($buckets))
     243                $error_log .= 'no buckets found'."\n";
     244            if (!in_array($config->bucket_name, $buckets))
     245                $error_log .= 'selected bucket not found'."\n";
     246            $location = $adapter->getBucketLocation($config->bucket_name);
     247            $error_log .= 'bucket location '.$location."\n";
     248            if (file_put_contents(dirname(__FILE__).'/asssu-errorlog.txt', $error_log) !== true)
     249                error_log($error_log);
     250        }
    236251    }
    237252
  • amazon-s3-uploads/trunk/asssu.php

    r493910 r495105  
    66Author URI: http://code.google.com/u/117859515361389646005/
    77Description: Moves your uploads to Amazon S3 via cron jobs.
    8 Version: 1.06
     8Version: 1.07
    99*/
    1010
  • amazon-s3-uploads/trunk/readme.txt

    r493910 r495105  
    55Requires at least: 2.3
    66Tested up to: 3.3
    7 Stable tag: 1.06
     7Stable tag: 1.07
    88
    99Moves your uploads to Amazon S3 via cron jobs.
     
    5252== Changelog ==
    5353
    54 = 1.06 =
     54= 1.05 - 1.07 =
    5555* Minor bug fixes
    56 
    57 = 1.05 =
    58 * Minor fixes
    5956
    6057= 1.04 =
     
    7875== Upgrade Notice ==
    7976
    80 = 1.06 =
     77= 1.05 - 1.07 =
    8178Minor bug fixes
    82 
    83 = 1.05 =
    84 Minor fixes
    8579
    8680= 1.04 =
Note: See TracChangeset for help on using the changeset viewer.