Mage_Core_Helper_File_Storage_Database
extends Mage_Core_Helper_Abstract
in package
Maho
Tags
Table of Contents
Properties
- $_databaseModel : Mage_Core_Model_File_Storage_Database|null
- Database storage model
- $_layout : Mage_Core_Model_Layout
- Layout model object
- $_mediaBaseDirectory : string
- Media dir
- $_moduleName : string
- Helper module name
- $_request : Mage_Core_Controller_Request_Http
- Request object
- $_resourceModel : Mage_Core_Model_Resource_File_Storage_Database|null
- Storage resource model
- $_useDb : bool
- Db usage flag
- $modulesDisabled : array<string|int, mixed>
Methods
- __() : string
- Translate
- checkDbUsage() : bool
- Check if we use DB storage Note: Disabled as not completed feature
- copyFile() : mixed
- Copy file in DB storage
- deleteFile() : mixed
- Deletes from DB files, which belong to one folder
- deleteFolder() : mixed
- Deletes from DB files, which belong to one folder
- escapeHtml() : null|string|array<string|int, string>
- Escape html entities
- escapeScriptIdentifiers() : string
- Remove `javascript:`, `vbscript:`, `data:` words from the string.
- escapeSpecial() : string
- Remove `\t`,`\n`,`\r`,`\0`,`\x0B:` symbols from the string.
- escapeUrl() : string
- Escape html entities in url
- fileExists() : bool|null
- Check whether file exists in DB
- getLayout() : Mage_Core_Model_Layout
- Retrieve layout model object
- getMediaBaseDir() : string
- Return Media base dir
- getMediaRelativePath() : string
- Return relative uri for media content by full path
- getResourceStorageModel() : Mage_Core_Model_Resource_File_Storage_Database
- Get storage model
- getStorageDatabaseModel() : Mage_Core_Model_File_Storage_Database
- Get database storage model
- getStorageFileModel() : Mage_Core_Model_File_Storage_File
- Get file storage model
- getUniqueFilename() : string
- Get unique name for passed file in case this file already exists
- hasTags() : bool
- Check for tags in multidimensional arrays
- htmlEscape() : null|string|array<string|int, string>
- isModuleEnabled() : bool
- Check is module exists and enabled in global config.
- isModuleOutputEnabled() : bool
- Check whether the module output is enabled in Configuration
- jsQuoteEscape() : string|array<string|int, string>
- Escape quotes in java script
- quoteEscape() : string
- Escape quotes inside html attributes Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc)
- removeTags() : string
- Remove html tags, but leave "<" and ">" signs
- renameFile() : mixed
- Rename file in DB storage
- saveFile() : mixed
- Save file in DB storage
- saveFileToFilesystem() : bool
- Save database file to file system
- saveUploadedFile() : string
- Saves uploaded by Mage_Core_Model_File_Uploader file to DB with existence tests
- setLayout() : Mage_Core_Helper_Abstract
- Declare layout
- stripTags() : string
- Wrapper for standard strip_tags() function with extra functionality for html entities
- translateArray() : array<string|int, mixed>
- Translate array
- urlDecode() : string
- base64_decode() for URLs decoding
- urlDecodeAndEscape() : string
- base64_decode() and escape quotes in url
- urlEncode() : string
- base64_encode() for URLs encoding
- urlEscape() : string
- _cleanCache() : Mage_Core_Helper_Abstract
- Cleaning cache
- _getModuleName() : string
- Retrieve helper module name
- _getRequest() : Mage_Core_Controller_Request_Http
- Retrieve request object
- _getUrl() : string
- Retrieve url
- _loadCache() : mixed
- Loading cache data
- _removeAbsPathFromFileName() : string
- Convert full file path to local (as used by model) If not - returns just a filename
- _removeCache() : Mage_Core_Helper_Abstract
- Removing cache
- _saveCache() : Mage_Core_Helper_Abstract
- Saving cache
Properties
$_databaseModel
Database storage model
protected
Mage_Core_Model_File_Storage_Database|null
$_databaseModel
= \null
$_layout
Layout model object
protected
Mage_Core_Model_Layout
$_layout
$_mediaBaseDirectory
Media dir
protected
string
$_mediaBaseDirectory
$_moduleName
Helper module name
protected
string
$_moduleName
= 'Mage_Core'
$_request
Request object
protected
Mage_Core_Controller_Request_Http
$_request
$_resourceModel
Storage resource model
protected
Mage_Core_Model_Resource_File_Storage_Database|null
$_resourceModel
= \null
$_useDb
Db usage flag
protected
bool
$_useDb
= \null
$modulesDisabled
protected
array<string|int, mixed>
$modulesDisabled
= []
Methods
__()
Translate
public
__() : string
Return values
stringcheckDbUsage()
Check if we use DB storage Note: Disabled as not completed feature
public
checkDbUsage() : bool
Return values
boolcopyFile()
Copy file in DB storage
public
copyFile(string $oldName, string $newName) : mixed
Parameters
- $oldName : string
- $newName : string
deleteFile()
Deletes from DB files, which belong to one folder
public
deleteFile(string $filename) : mixed
Parameters
- $filename : string
deleteFolder()
Deletes from DB files, which belong to one folder
public
deleteFolder(string $folderName) : mixed
Parameters
- $folderName : string
escapeHtml()
Escape html entities
public
escapeHtml(string|array<string|int, string> $data[, array<string|int, mixed>|null $allowedTags = null ]) : null|string|array<string|int, string>
Parameters
- $data : string|array<string|int, string>
- $allowedTags : array<string|int, mixed>|null = null
Return values
null|string|array<string|int, string>escapeScriptIdentifiers()
Remove `javascript:`, `vbscript:`, `data:` words from the string.
public
escapeScriptIdentifiers(string $data) : string
Parameters
- $data : string
Return values
stringescapeSpecial()
Remove `\t`,`\n`,`\r`,`\0`,`\x0B:` symbols from the string.
public
escapeSpecial(string $data) : string
Parameters
- $data : string
Return values
stringescapeUrl()
Escape html entities in url
public
escapeUrl(string $data) : string
Parameters
- $data : string
Return values
stringfileExists()
Check whether file exists in DB
public
fileExists(string $filename) : bool|null
Parameters
- $filename : string
-
can be both full path or partial (like in DB)
Return values
bool|nullgetLayout()
Retrieve layout model object
public
getLayout() : Mage_Core_Model_Layout
Return values
Mage_Core_Model_LayoutgetMediaBaseDir()
Return Media base dir
public
getMediaBaseDir() : string
Return values
stringgetMediaRelativePath()
Return relative uri for media content by full path
public
getMediaRelativePath(string $fullPath) : string
Parameters
- $fullPath : string
Return values
stringgetResourceStorageModel()
Get storage model
public
getResourceStorageModel() : Mage_Core_Model_Resource_File_Storage_Database
Return values
Mage_Core_Model_Resource_File_Storage_DatabasegetStorageDatabaseModel()
Get database storage model
public
getStorageDatabaseModel() : Mage_Core_Model_File_Storage_Database
Return values
Mage_Core_Model_File_Storage_DatabasegetStorageFileModel()
Get file storage model
public
getStorageFileModel() : Mage_Core_Model_File_Storage_File
Return values
Mage_Core_Model_File_Storage_FilegetUniqueFilename()
Get unique name for passed file in case this file already exists
public
getUniqueFilename(string $directory, string $filename) : string
Parameters
- $directory : string
-
- can be both full path or partial (like in DB)
- $filename : string
-
- not just a filename. Can have directory chunks. return will have this form
Return values
stringhasTags()
Check for tags in multidimensional arrays
public
hasTags(string|array<string|int, mixed> $data[, array<string|int, mixed> $arrayKeys = [] ][, bool $skipTags = true ]) : bool
Parameters
- $data : string|array<string|int, mixed>
- $arrayKeys : array<string|int, mixed> = []
-
keys of the array being checked that are excluded and included in the check
- $skipTags : bool = true
-
skip transferred array keys, if false then check only them
Return values
boolhtmlEscape()
public
htmlEscape(string|array<string|int, string> $data[, array<string|int, mixed>|null $allowedTags = null ]) : null|string|array<string|int, string>
after 1.4.0.0-rc1
Parameters
- $data : string|array<string|int, string>
- $allowedTags : array<string|int, mixed>|null = null
Tags
Return values
null|string|array<string|int, string>isModuleEnabled()
Check is module exists and enabled in global config.
public
isModuleEnabled([string $moduleName = null ]) : bool
Parameters
- $moduleName : string = null
-
the full module name, example Mage_Core
Return values
boolisModuleOutputEnabled()
Check whether the module output is enabled in Configuration
public
isModuleOutputEnabled([string $moduleName = null ]) : bool
Parameters
- $moduleName : string = null
-
Full module name
Return values
booljsQuoteEscape()
Escape quotes in java script
public
jsQuoteEscape(string|array<string|int, string> $data[, string $quote = ''' ]) : string|array<string|int, string>
Parameters
- $data : string|array<string|int, string>
- $quote : string = '''
Return values
string|array<string|int, string>quoteEscape()
Escape quotes inside html attributes Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc)
public
quoteEscape(string $data[, bool $addSlashes = false ]) : string
Parameters
- $data : string
- $addSlashes : bool = false
Return values
stringremoveTags()
Remove html tags, but leave "<" and ">" signs
public
removeTags(string $html) : string
Parameters
- $html : string
Return values
stringrenameFile()
Rename file in DB storage
public
renameFile(string $oldName, string $newName) : mixed
Parameters
- $oldName : string
- $newName : string
saveFile()
Save file in DB storage
public
saveFile(string $filename) : mixed
Parameters
- $filename : string
saveFileToFilesystem()
Save database file to file system
public
saveFileToFilesystem(string $filename) : bool
Parameters
- $filename : string
Return values
boolsaveUploadedFile()
Saves uploaded by Mage_Core_Model_File_Uploader file to DB with existence tests
public
saveUploadedFile([array<string|int, mixed> $result = [] ]) : string
param $result should be result from Mage_Core_Model_File_Uploader::save() method Checks in DB, whether uploaded file exists ($result['file']) If yes, renames file on FS (!!!!!) Saves file with unique name into DB If passed file exists returns new name, file was renamed to (in the same context) Otherwise returns $result['file']
Parameters
- $result : array<string|int, mixed> = []
Return values
stringsetLayout()
Declare layout
public
setLayout(Mage_Core_Model_Layout $layout) : Mage_Core_Helper_Abstract
Parameters
- $layout : Mage_Core_Model_Layout
Return values
Mage_Core_Helper_AbstractstripTags()
Wrapper for standard strip_tags() function with extra functionality for html entities
public
stripTags(string $data[, null|string|array<string|int, string> $allowableTags = null ][, bool $escape = false ]) : string
Parameters
- $data : string
- $allowableTags : null|string|array<string|int, string> = null
- $escape : bool = false
Return values
stringtranslateArray()
Translate array
public
translateArray([mixed $arr = [] ]) : array<string|int, mixed>
@param array $arr
Parameters
- $arr : mixed = []
Return values
array<string|int, mixed>urlDecode()
base64_decode() for URLs decoding
public
urlDecode(mixed $url) : string
@param string $url
Parameters
- $url : mixed
Return values
stringurlDecodeAndEscape()
base64_decode() and escape quotes in url
public
urlDecodeAndEscape(mixed $url) : string
@param string $url
Parameters
- $url : mixed
Return values
stringurlEncode()
base64_encode() for URLs encoding
public
urlEncode(mixed $url) : string
@param string $url
Parameters
- $url : mixed
Return values
stringurlEscape()
public
urlEscape(string $data) : string
after 1.4.0.0-rc1
Parameters
- $data : string
Tags
Return values
string_cleanCache()
Cleaning cache
protected
_cleanCache([array<string|int, mixed> $tags = [] ]) : Mage_Core_Helper_Abstract
Parameters
- $tags : array<string|int, mixed> = []
Return values
Mage_Core_Helper_Abstract_getModuleName()
Retrieve helper module name
protected
_getModuleName() : string
Return values
string_getRequest()
Retrieve request object
protected
_getRequest() : Mage_Core_Controller_Request_Http
Return values
Mage_Core_Controller_Request_Http_getUrl()
Retrieve url
protected
_getUrl(string $route[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $route : string
- $params : array<string|int, mixed> = []
Return values
string_loadCache()
Loading cache data
protected
_loadCache(string $id) : mixed
Parameters
- $id : string
_removeAbsPathFromFileName()
Convert full file path to local (as used by model) If not - returns just a filename
protected
_removeAbsPathFromFileName(string $filename) : string
Parameters
- $filename : string
Return values
string_removeCache()
Removing cache
protected
_removeCache(string $id) : Mage_Core_Helper_Abstract
Parameters
- $id : string
Return values
Mage_Core_Helper_Abstract_saveCache()
Saving cache
protected
_saveCache(mixed $data, string $id[, array<string|int, mixed> $tags = [] ][, null|false|int $lifeTime = false ]) : Mage_Core_Helper_Abstract
Parameters
- $data : mixed
- $id : string
- $tags : array<string|int, mixed> = []
- $lifeTime : null|false|int = false