for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace phpbu\App\Backup\File;
use OpenStack\ObjectStore\v1\Models\Container;
use OpenStack\ObjectStore\v1\Models\StorageObject;
use phpbu\App\Exception;
/**
* OpenStack class.
*
* @package phpbu
* @subpackage Backup
* @author Sebastian Feldmann <[email protected]>
* @author Vitaly Baev <[email protected]>
* @copyright Sebastian Feldmann <[email protected]>
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
* @link http://phpbu.de/
* @since Class available since Release 5.1.0
*/
class OpenStack extends Remote
{
* @var Container
protected $container;
* OpenStack constructor.
* @param Container $container
* @param StorageObject $object
public function __construct($container, $object)
$this->container = $container;
$this->filename = basename($object->name);
$this->pathname = $object->name;
$this->size = (int)$object->contentLength;
$this->lastModified = $object->lastModified->getTimestamp();
getTimestamp
$object->lastModified
string
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
}
* Deletes the file.
* @throws \phpbu\App\Exception
public function unlink()
try {
$this->container->getObject($this->getPathname())->delete();
} catch (\Exception $exception) {
throw new Exception($exception->getMessage());
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.