class Document extends Helper

Class Document

Constants

VERSION

Version path on server

UPLOAD_DIR

Upload directory in server

Properties

protected string $name File name
protected string $filePath File path on server
protected float $fileSize File size

Methods

bool|string
image_resize(string $src, string $dst, int $width, int $height, int $crop = 0)

No description

from Helper
mixed
getName()

No description

setName(String $name)

No description

null|string
getAbsolutePath()

Get file absolute path on server

null|string
getWebPath()

Get full web path for file on server

null|string
getThumbPath()

Get thumbnail path on server

string
getDayFolder()

Get folder by date

string
getUploadDir()

Get rid of the DIR so it doesn't screw up when displaying uploaded doc/image inklimacold. the view.

string
getUploadRootDir()

Get upload root dir full path on server

static string
getWebDir()

Get web directory on server

static string
getMainBlobDirectoryForUpload()

Get main blob directory for uploaded blob files

string
getServer(bool $override = false)

Get server path

false|int
saveToFile(string $base64String, null $imageCode = null)

Save base64 to file

bool|int
saveBlobToFile(mixed $blob)

Save blob object to file

false|int
uploadLanguageFileYML(string $base64String)

Upload language file from base64 string

setFileName(int $size, string $extension)

Set file name if file exists give it random name

string
createThumbnail(int $size, string $extension, array $data, string $type)

No description

string
getLanguageRootDir()

Get language translations root dir

string
getTmpDir()

Get temporary directory

int
uploadLanguageFile(string $locale, string $base64String)

No description

bool
is_excel(String $extension)

Check if is excel

string
getLanguageFilePath()

Get language file path

float
getPeakMemoryInMegabytes()

Get peak memory in megabytes

int
returnFileSize()

Return file size

null|string
getAbsolutePathWithVersion()

Get absolute path with version

null|string
getAbsolutePathWithoutName()

Get absolute path without name

float
getFileSize()

No description

setFileSize(float $fileSize)

No description

updateFileSize()

set file size

deleteFile()

No description

deleteLanguageFile()

No description

static File
uploadFile(UploadedFile $uploadedFile, string $uploadDir, null $prefix = null)

Upload file

static 
deleteUnusedBlobFiles(array $links, string $htmlString)

Delete unused blob files

static 
deleteUnusedBlockElementsImages(array $mediaLinks, string $htmlString)

No description

static 
removeOldFiles(string $uploadDir, string $format = 'Y-m-d-h')

Remove old files

string
createFolder()

A method that creates the appropriate day folder for every image uploaded

string
createProFolder()

Create project folder if it does not exist

Details

in Helper at line 32
bool|string image_resize(string $src, string $dst, int $width, int $height, int $crop = 0)

Parameters

string $src
string $dst
int $width
int $height
int $crop

Return Value

bool|string

at line 78
mixed getName()

Return Value

mixed

at line 88
Document setName(String $name)

Parameters

String $name

Return Value

Document

at line 101
null|string getAbsolutePath()

Get file absolute path on server

Return Value

null|string

at line 116
null|string getWebPath()

Get full web path for file on server

Return Value

null|string

at line 131
null|string getThumbPath()

Get thumbnail path on server

Return Value

null|string

at line 145
string getDayFolder()

Get folder by date

Return Value

string

at line 155
string getUploadDir()

Get rid of the DIR so it doesn't screw up when displaying uploaded doc/image inklimacold. the view.

Return Value

string

at line 167
string getUploadRootDir()

Get upload root dir full path on server

Return Value

string

at line 177
static string getWebDir()

Get web directory on server

Return Value

string

at line 189
static string getMainBlobDirectoryForUpload()

Get main blob directory for uploaded blob files

Return Value

string

at line 201
string getServer(bool $override = false)

Get server path

Parameters

bool $override

Return Value

string

at line 235
false|int saveToFile(string $base64String, null $imageCode = null)

Save base64 to file

Parameters

string $base64String to decode and save to file
null $imageCode

Return Value

false|int

at line 265
bool|int saveBlobToFile(mixed $blob)

Save blob object to file

Parameters

mixed $blob

Return Value

bool|int

at line 284
false|int uploadLanguageFileYML(string $base64String)

Upload language file from base64 string

Parameters

string $base64String to decode and save to file

Return Value

false|int

at line 313
setFileName(int $size, string $extension)

Set file name if file exists give it random name

Parameters

int $size
string $extension

at line 332
string createThumbnail(int $size, string $extension, array $data, string $type)

Parameters

int $size
string $extension
array $data
string $type

Return Value

string

at line 400
string getLanguageRootDir()

Get language translations root dir

Return Value

string

at line 410
string getTmpDir()

Get temporary directory

Return Value

string

at line 424
int uploadLanguageFile(string $locale, string $base64String)

Parameters

string $locale
string $base64String

Return Value

int

Exceptions

PHPExcel_Reader_Exception
PHPExcel_Exception

at line 467
bool is_excel(String $extension)

Check if is excel

Parameters

String $extension

Return Value

bool

at line 479
string getLanguageFilePath()

Get language file path

Return Value

string

at line 489
float getPeakMemoryInMegabytes()

Get peak memory in megabytes

Return Value

float

at line 501
int returnFileSize()

Return file size

Return Value

int

at line 512
null|string getAbsolutePathWithVersion()

Get absolute path with version

Return Value

null|string

at line 524
null|string getAbsolutePathWithoutName()

Get absolute path without name

Return Value

null|string

at line 534
float getFileSize()

Return Value

float

at line 542
setFileSize(float $fileSize)

Parameters

float $fileSize

at line 550
updateFileSize()

set file size

at line 558
deleteFile()

at line 568
deleteLanguageFile()

at line 584
static File uploadFile(UploadedFile $uploadedFile, string $uploadDir, null $prefix = null)

Upload file

Parameters

UploadedFile $uploadedFile
string $uploadDir
null $prefix

Return Value

File

at line 609
static deleteUnusedBlobFiles(array $links, string $htmlString)

Delete unused blob files

Parameters

array $links
string $htmlString

at line 655
static deleteUnusedBlockElementsImages(array $mediaLinks, string $htmlString)

Parameters

array $mediaLinks
string $htmlString

at line 701
static removeOldFiles(string $uploadDir, string $format = 'Y-m-d-h')

Remove old files

Parameters

string $uploadDir
string $format

at line 721
protected string createFolder()

A method that creates the appropriate day folder for every image uploaded

Return Value

string

at line 750
protected string createProFolder()

Create project folder if it does not exist

Return Value

string