Clockwork\Storage\FileStorage::__construct PHP Method

__construct() public method

Return new storage, takes path where to store files as argument, throws exception if path is not writable
public __construct ( $path, $dirPermissions = 448 )
    public function __construct($path, $dirPermissions = 0700)
    {
        if (!file_exists($path)) {
            # directory doesn't exist, try to create one
            if (!mkdir($path, $dirPermissions, true)) {
                throw new Exception('Directory "' . $path . '" does not exist.');
            }
            # create default .gitignore, to ignore stored json files
            file_put_contents($path . '/.gitignore', "*.json\n");
        }
        if (!is_writable($path)) {
            throw new Exception('Path "' . $path . '" is not writable.');
        }
        $this->path = $path;
    }