PHP 클래스 AttachmentManager

파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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