Documentation

Azure extends AbstractAdapter
in package

Storage adapter Azure class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.0.0

Table of Contents

Properties

$auth  : Auth|null
Azure auth object
$baseDirectory  : string|null
Storage base directory
$client  : Client|null
HTTP client
$directory  : string|null
Current directory

Methods

__construct()  : mixed
Constructor
chdir()  : void
Change directory
copyFile()  : void
Copy file
copyFileFromExternal()  : void
Copy file from a location external to the current location
copyFileToExternal()  : void
Copy file to a location external to the current location
create()  : Azure
Create Azure client
deleteFile()  : void
Delete file
fetchFile()  : mixed
Fetch file
fetchFileInfo()  : array<string|int, mixed>
Fetch file info
fileExists()  : bool
File exists
getAuth()  : Auth|null
Get auth
getBaseDir()  : string|null
Get base directory
getClient()  : Client|null
Get client
getCurrentDir()  : string|null
Get current directory
getFileMTime()  : int|string|bool
Get file modified time
getFileSize()  : int|bool
Get file size
getFileType()  : string|bool
Get file type
hasAuth()  : bool
Has auth
hasClient()  : bool
Has client
initClient()  : Azure
Initialize client
isDir()  : bool
Check if is a dir
isFile()  : bool
Check if is a file
listAll()  : array<string|int, mixed>
List all
listDirs()  : array<string|int, mixed>
List directories
listFiles()  : array<string|int, mixed>
List files
md5File()  : string|bool
Create MD5 checksum of the file
mkdir()  : void
Make directory
moveFileFromExternal()  : void
Move file from a location external to the current location
moveFileToExternal()  : void
Move file to a location external to the current location
putFile()  : void
Put file
putFileContents()  : void
Put file contents
renameFile()  : void
Rename file
replaceFileContents()  : void
Replace file
rmdir()  : void
Remove a directory
setAuth()  : Azure
Set auth
setBaseDir()  : void
Set base directory
setClient()  : Azure
Set client
uploadFile()  : void
Upload file from server request $_FILES['file']
scrub()  : string
Scrub value of leading dots or slashes
searchFilter()  : array<string|int, mixed>
Search and filter values

Properties

$auth

Azure auth object

protected Auth|null $auth = null

$baseDirectory

Storage base directory

protected string|null $baseDirectory = null

$directory

Current directory

protected string|null $directory = null

Methods

__construct()

Constructor

public __construct(string $location, Auth $auth) : mixed
Parameters
$location : string
$auth : Auth

chdir()

Change directory

public chdir([string|null $directory = null ]) : void
Parameters
$directory : string|null = null

copyFile()

Copy file

public copyFile(string $sourceFile, string $destFile) : void
Parameters
$sourceFile : string
$destFile : string

copyFileFromExternal()

Copy file from a location external to the current location

public copyFileFromExternal(string $externalFile, string $destFile) : void
Parameters
$externalFile : string
$destFile : string

copyFileToExternal()

Copy file to a location external to the current location

public copyFileToExternal(string $sourceFile, string $externalFile) : void
Parameters
$sourceFile : string
$externalFile : string

create()

Create Azure client

public static create(string $accountName, string $accountKey) : Azure
Parameters
$accountName : string
$accountKey : string
Return values
Azure

deleteFile()

Delete file

public deleteFile(string $filename[, string|null $snapshots = 'include' ]) : void
Parameters
$filename : string
$snapshots : string|null = 'include'

['include', 'only', null]

fetchFile()

Fetch file

public fetchFile(string $filename[, bool $raw = true ]) : mixed
Parameters
$filename : string
$raw : bool = true

fetchFileInfo()

Fetch file info

public fetchFileInfo(string $filename) : array<string|int, mixed>
Parameters
$filename : string
Return values
array<string|int, mixed>

fileExists()

File exists

public fileExists(string $filename) : bool
Parameters
$filename : string
Return values
bool

getAuth()

Get auth

public getAuth() : Auth|null
Return values
Auth|null

getBaseDir()

Get base directory

public getBaseDir() : string|null
Return values
string|null

getCurrentDir()

Get current directory

public getCurrentDir() : string|null
Return values
string|null

getFileMTime()

Get file modified time

public getFileMTime(string $filename) : int|string|bool
Parameters
$filename : string
Return values
int|string|bool

getFileSize()

Get file size

public getFileSize(string $filename) : int|bool
Parameters
$filename : string
Return values
int|bool

getFileType()

Get file type

public getFileType(string $filename) : string|bool
Parameters
$filename : string
Return values
string|bool

hasAuth()

Has auth

public hasAuth() : bool
Return values
bool

hasClient()

Has client

public hasClient() : bool
Return values
bool

initClient()

Initialize client

public initClient([string $method = 'GET' ][, array<string|int, mixed> $headers = [] ][, bool $auto = true ]) : Azure
Parameters
$method : string = 'GET'
$headers : array<string|int, mixed> = []
$auto : bool = true
Return values
Azure

isDir()

Check if is a dir

public isDir(string $directory) : bool
Parameters
$directory : string
Return values
bool

isFile()

Check if is a file

public isFile(string $filename) : bool
Parameters
$filename : string
Return values
bool

listAll()

List all

public listAll([string|null $search = null ]) : array<string|int, mixed>
Parameters
$search : string|null = null
Return values
array<string|int, mixed>

listDirs()

List directories

public listDirs([string|null $search = null ]) : array<string|int, mixed>
Parameters
$search : string|null = null
Return values
array<string|int, mixed>

listFiles()

List files

public listFiles([string|null $search = null ]) : array<string|int, mixed>
Parameters
$search : string|null = null
Return values
array<string|int, mixed>

md5File()

Create MD5 checksum of the file

public md5File(string $filename) : string|bool
Parameters
$filename : string
Return values
string|bool

mkdir()

Make directory

public mkdir(string $directory) : void
Parameters
$directory : string

moveFileFromExternal()

Move file from a location external to the current location

public moveFileFromExternal(string $externalFile, string $destFile[, string|null $snapshots = 'include' ]) : void
Parameters
$externalFile : string
$destFile : string
$snapshots : string|null = 'include'

['include', 'only', null]

moveFileToExternal()

Move file to a location external to the current location

public moveFileToExternal(string $sourceFile, string $externalFile) : void
Parameters
$sourceFile : string
$externalFile : string

putFileContents()

Put file contents

public putFileContents(string $filename, string $fileContents) : void
Parameters
$filename : string
$fileContents : string

renameFile()

Rename file

public renameFile(string $oldFile, string $newFile) : void
Parameters
$oldFile : string
$newFile : string

replaceFileContents()

Replace file

public replaceFileContents(string $filename, string $fileContents) : void
Parameters
$filename : string
$fileContents : string

rmdir()

Remove a directory

public rmdir(string $directory) : void
Parameters
$directory : string

setBaseDir()

Set base directory

public setBaseDir([string|null $directory = null ]) : void
Parameters
$directory : string|null = null

uploadFile()

Upload file from server request $_FILES['file']

public uploadFile(array<string|int, mixed> $file) : void
Parameters
$file : array<string|int, mixed>
Tags
throws
Exception

scrub()

Scrub value of leading dots or slashes

protected scrub(string $value) : string
Parameters
$value : string
Return values
string

searchFilter()

Search and filter values

protected searchFilter(array<string|int, mixed> $objects, string $search) : array<string|int, mixed>
Parameters
$objects : array<string|int, mixed>
$search : string
Return values
array<string|int, mixed>

        
On this page

Search results