for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Simple S3 package.
*
* (c) Mauro Cassani<https://github.com/mauretto78>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Matecat\SimpleS3\Commands\Handlers;
use Matecat\SimpleS3\Commands\CommandHandler;
class IsBucketVersioned extends CommandHandler
{
* Check if is enabled versioning for a bucket.
* For a complete reference:
* https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-versioning.html?highlight=versioning%20bucket
* @param mixed $params
* @return bool
* @throws \Exception
public function handle($params = [])
try {
$ver = $this->client->getConn()->getBucketVersioning([
'Bucket' => $params['bucket']
]);
return ($ver['Status'] === 'Enabled') ? true : false;
} catch (\Exception $e) {
return false;
}
* @param array $params
public function validateParams($params = [])
return isset($params['bucket']);