PHP Класс AttachmentManager

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$m_config Configuration array.
$m_dirs Array of directory information.

Открытые методы

Метод Описание
__construct ( $p_config ) Constructor. Create a new Attachment Manager instance.
countFiles ( $path ) Count the number of files and directories in a given folder minus the thumbnail folders and thumbnails.
getBaseDir ( ) : string Get the base directory.
getBaseURL ( ) : string Get the base URL.
getDefaultThumb ( ) : string Get the default thumbnail.
getFileURL ( string $relative ) : string Get the URL of the relative file.
getFiles ( string $p_articleId, $p_languageId = null ) : array Get all the files and directories of a relative path.
getFiles ( string $p_articleId, $p_languageId = null, $p_filter = true ) : array Get all the files and directories of a relative path.
getFullPath ( string $relative ) : string Get the fullpath to a relative file.
isTmpFile ( string $file ) : boolean Check if the given file is a tmp file.
isValidBase ( )
validRelativePath ( string $path ) : boolean Check if the given path is part of the subdirectories under the base_dir.

Описание методов

__construct() публичный Метод

Constructor. Create a new Attachment Manager instance.
public __construct ( $p_config )

countFiles() публичный Метод

Count the number of files and directories in a given folder minus the thumbnail folders and thumbnails.
public countFiles ( $path )

getBaseDir() публичный Метод

Get the base directory.
public getBaseDir ( ) : string
Результат string base dir, see config.inc.php

getBaseURL() публичный Метод

Get the base URL.
public getBaseURL ( ) : string
Результат string base url, see config.inc.php

getDefaultThumb() публичный Метод

Get the default thumbnail.
public getDefaultThumb ( ) : string
Результат string default thumbnail, empty string if the thumbnail doesn't exist.

getFileURL() публичный Метод

basically appends the relative file to the base_url given in config.inc.php
public getFileURL ( string $relative ) : string
$relative string a file the relative to the base_dir
Результат string the URL of the relative file.

getFiles() публичный Метод

Get all the files and directories of a relative path.
public getFiles ( string $p_articleId, $p_languageId = null ) : array
$p_articleId string
Результат array of file and path information. array('url'=>'full url', 'storage'=>'full file path')

getFiles() публичный Метод

Get all the files and directories of a relative path.
public getFiles ( string $p_articleId, $p_languageId = null, $p_filter = true ) : array
$p_articleId string
Результат array of file and path information. array('url'=>'full url', 'storage'=>'full file path')

getFullPath() публичный Метод

Get the fullpath to a relative file.
public getFullPath ( string $relative ) : string
$relative string the relative file.
Результат string the full path, .ie. the base_dir + relative.

isTmpFile() публичный Метод

Check if the given file is a tmp file.
public isTmpFile ( string $file ) : boolean
$file string file name
Результат boolean true if it is a tmp file, false otherwise

isValidBase() публичный Метод

public isValidBase ( )

validRelativePath() публичный Метод

Check if the given path is part of the subdirectories under the base_dir.
public validRelativePath ( string $path ) : boolean
$path string the relative path to be checked
Результат boolean true if the path exists, false otherwise

Описание свойств

$m_config публичное свойство

Configuration array.
public $m_config

$m_dirs публичное свойство

Array of directory information.
public $m_dirs