Application API Documentation

Directional Consulting

Classes

Common in package

Class Common provides reusable functions for application

Table of Contents

commonDebug()  : bool
Enables and enforces DEBUG handlers, clases and exception handling
detectMime()  : string
Analyzes the contents of a string and returns proper MIME type
dosData()  : string|bool|null
dosData function to provide reusable Disk Operations Filesystem wrapper
guzzleData()  : Response
Provides reusable GuzzleHttp\Client which can be extended
normalizeHeaders()  : array<string|int, mixed>
Normalize the received headers into standard JSON array
serialCodecs()  : Serializer
Common reusable Symfony Serializer object for encoding / decoding data
slurpData()  : bool|false|mixed|string|null
Common Windows File Share disk operations wrapper function for read, write, move, copy, delete, etc.

Methods

commonDebug()

Enables and enforces DEBUG handlers, clases and exception handling

public commonDebug() : bool
Return values
bool

detectMime()

Analyzes the contents of a string and returns proper MIME type

public detectMime(string $string) : string
Parameters
$string : string
Return values
string

dosData()

dosData function to provide reusable Disk Operations Filesystem wrapper

public dosData(mixed $method, array<string|int, mixed> $options) : string|bool|null
Parameters
$method : mixed
$options : array<string|int, mixed>
  • Options for file operations ['filename', 'filepath', 'perms', 'user_group', 'target']
Tags
see
https://symfony.com/doc/current/components/filesystem.html
Return values
string|bool|null

guzzleData()

Provides reusable GuzzleHttp\Client which can be extended

public guzzleData(string $url, string $method[, array<string|int, mixed> $options = array() ]) : Response
Parameters
$url : string
  • Required URL for HTTP request
$method : string
  • Optional HTTP Method - GET as default
$options : array<string|int, mixed> = array()
  • GuzzleHttp\Client request options array: ['body', 'auth', 'headers', 'query']
Tags
throws
GuzzleException
see
https://guzzle.readthedocs.io/en/latest/request-options.html#auth
Return values
Response

normalizeHeaders()

Normalize the received headers into standard JSON array

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

serialCodecs()

Common reusable Symfony Serializer object for encoding / decoding data

public serialCodecs() : Serializer
Return values
Serializer

slurpData()

Common Windows File Share disk operations wrapper function for read, write, move, copy, delete, etc.

public slurpData(mixed $host,  $share,  $filename[, string $method = 'read' ][, array<string|int, mixed> $options = array() ][, null $target = null ]) : bool|false|mixed|string|null

..

Parameters
$host : mixed
$share :
$filename :
$method : string = 'read'
$options : array<string|int, mixed> = array()

Options array contains smbclient params [user, password, workgroup, timeout, file, target]

$target : null = null
Tags
throws
DependencyException
throws
InvalidTypeException
throws
NotFoundException
Return values
bool|false|mixed|string|null

        

Search Results

Search results

Found Results