[bd] Data Storage [Deleted]

I have to enable this option to use s3?

Static Website Hosting
You can host your static website entirely on Amazon S3. Once you enable your bucket for static website hosting, all your content is accessible to web browsers via the Amazon S3 website endpoint for your bucket.
Endpoint: data.yplaza.net.s3-website-eu-west-1.amazonaws.com
Each bucket serves a website namespace (e.g. "www.example.com"). Requests for your host name (e.g. "example.com" or "www.example.com") can be routed to the contents in your bucket. You can also redirect requests to another host name (e.g. redirect "example.com" to "www.example.com"). See ourwalkthrough for how to set up an Amazon S3 static website with your host name.

@TheBigK do you use this option on your site? (sorry if i tag you for this, but i'm a hurry for this a @xfrocks seems very busy these days :-) )
 
By this option if you mean static website hosting the answer is no. You can use S3 as your bucket for your forum's data...
 
I have tried yesterday to configure it reading the howto that you linked me yesterdayt but with no luck :/
 
Hi @xfrocks
After uninstalling this add-on, do I have to anything else rather than deleting code below from config.php?
PHP:
$config['bdDataStorage'] = array(
    array(
        'type' => 's3',
        'key' => '<paste your key here>',
        'secret' => '<paste your secret here>',
        'bucket' => '<enter bucket name here>',
        // 'region' => 'us-east-1',
        // 'url' => '',
        // 'acl' => 'public',
    ),
);
 
Hi @xfrocks
After uninstalling this add-on, do I have to anything else rather than deleting code below from config.php?
PHP:
$config['bdDataStorage'] = array(
    array(
        'type' => 's3',
        'key' => '<paste your key here>',
        'secret' => '<paste your secret here>',
        'bucket' => '<enter bucket name here>',
        // 'region' => 'us-east-1',
        // 'url' => '',
        // 'acl' => 'public',
    ),
);
Make sure you move the files back to its location too.
 
I'm trying to move our attachments off S3 and back to the local data folder. I left the Attachment options alone so they point to s3 bucket. I ran the "Update Attachments Data Storage Options" in the rebuild cache. I selected Default as the mode. Does this option copy the files back to the data folder? Did I use the wrong mode? XenForo is looking for the attachment(s) in the local data folder but nothing was copied. Is it still a manual process? Any help would be appreciated.
 
v1.4 compatible?
Is this plugin compatible with xenforo version 1.4.3?
Yes, it works with 1.4.4.

Hi @xfrocks, I'm having the same problem puropedia is/was having in post 19. Can you help sort me out? Thank you in advance!
I have replied to that post. Have you checked your config.php?

I'm trying to move our attachments off S3 and back to the local data folder. I left the Attachment options alone so they point to s3 bucket. I ran the "Update Attachments Data Storage Options" in the rebuild cache. I selected Default as the mode. Does this option copy the files back to the data folder? Did I use the wrong mode? XenForo is looking for the attachment(s) in the local data folder but nothing was copied. Is it still a manual process? Any help would be appreciated.
You are replying to the wrong add-on thread I think. Please confirm whether you have this add-on or [bd] Attachment Store add-on.
 
The S3 stream wrapper currently checks for the availability of ftp_connect:

Code:
if (!function_exists('ftp_connect')) {
    throw new XenForo_Exception('Data Storage: FTP support for PHP cannot be found.');
}

This doesn't really make sense, and was probably a copy-paste error. It causes problems on HHVM, as HHVM currently lacks ftp_connect.

Additionally, I noticed that the @ prefix is used in several places to ignore errors. Reliance on error suppression is discouraged, and some modern engines, like HHVM, ignore it altogether. Until XenForo handles errors in a modern way by throwing ErrorExceptions, you can account for both old and new engines:

Code:
try {
    @unlink($file);
} catch (ErrorException $e) { }

Here's a fancier solution that also handles Zend OPcache, which is more common than HHVM:

Code:
/**
 * Delete a local file if it still exists, ignoring typical errors.  Only works on local files.
 *
 * @see unlink() Wrapped by this method.
 *
 * @param string $filename
 * @param resource $context
 * @return bool Indicates success.
 */
protected static function _unlinkLocal($filename, $context = null)
{
    try {
        if (isset($context)) {
            return @unlink($filename, $context);
        }

        if (!file_exists($filename)) {
            return false;
        }

        // In case opcache.enable_file_override is enabled; has to run while the file still exists
        function_exists('opcache_invalidate') and opcache_invalidate($filename);

        return @unlink($filename);
    } catch (ErrorException $e) {
        // HHVM ignores @ prefix and throws ErrorException instead
        return false;
    }
}
 
The S3 stream wrapper currently checks for the availability of ftp_connect:

Code:
if (!function_exists('ftp_connect')) {
    throw new XenForo_Exception('Data Storage: FTP support for PHP cannot be found.');
}

This doesn't really make sense, and was probably a copy-paste error. It causes problems on HHVM, as HHVM currently lacks ftp_connect.

Additionally, I noticed that the @ prefix is used in several places to ignore errors. Reliance on error suppression is discouraged, and some modern engines, like HHVM, ignore it altogether. Until XenForo handles errors in a modern way by throwing ErrorExceptions, you can account for both old and new engines:

Code:
try {
    @unlink($file);
} catch (ErrorException $e) { }

Here's a fancier solution that also handles Zend OPcache, which is more common than HHVM:

Code:
/**
* Delete a local file if it still exists, ignoring typical errors.  Only works on local files.
*
* @see unlink() Wrapped by this method.
*
* @param string $filename
* @param resource $context
* @return bool Indicates success.
*/
protected static function _unlinkLocal($filename, $context = null)
{
    try {
        if (isset($context)) {
            return @unlink($filename, $context);
        }

        if (!file_exists($filename)) {
            return false;
        }

        // In case opcache.enable_file_override is enabled; has to run while the file still exists
        function_exists('opcache_invalidate') and opcache_invalidate($filename);

        return @unlink($filename);
    } catch (ErrorException $e) {
        // HHVM ignores @ prefix and throws ErrorException instead
        return false;
    }
}
Nice find. I will see what I can do.
 
I've installed the addon, ready the bucked in S3, config.php correctly configured, but I'm getting problems.
There are not the completely /data in the bucket, so, I have not avatars and some elements.
The bucket have the [db]Cache folder:
R 2015-05-14 at 20.23.21.webp
What I'm doing wrong? could you please give me a hand? Thanks!
 
Top Bottom