Imbo\Storage\S3::getStatus PHP Method

getStatus() public method

public getStatus ( )
    public function getStatus()
    {
        try {
            $this->getClient()->headBucket(['Bucket' => $this->params['bucket']]);
        } catch (S3Exception $e) {
            return false;
        }
        return true;
    }

Usage Example

Beispiel #1
0
 /**
  * @covers Imbo\Storage\S3::getStatus
  */
 public function testGetStatus()
 {
     $this->assertTrue($this->getDriver()->getStatus());
     $driver = new S3(['key' => $GLOBALS['AWS_S3_KEY'], 'secret' => $GLOBALS['AWS_S3_SECRET'], 'bucket' => uniqid()]);
     $this->assertFalse($driver->getStatus());
 }