PHP Class NFePHP\Common\Files\FilesFolders

Show file Open project: nfephp-org/nfephp Class Usage Examples

Protected Properties

Property Type Description
$ambientes
$subdirs

Public Methods

Method Description
createFolder ( string $folder ) createFolder
createFolders ( string $dirPath ) : boolean createFolders Cria a estrutura de diretorios para a guarda dos arquivos
getAmbiente ( string $tpAmb = '2' ) : string getAmbiente
getFilePath ( string $tpAmb = '2', string $dirbase = '', string $subdir = '' ) : string getFilePath
listDir ( $folder, string $fileMatch = '*-nfe.xml', boolean $retpath = false ) : array listDir Obtem todo o conteúdo de um diretorio, e que atendam ao critério indicado.
readFile ( string $pathFile = '' ) : string readFile
removeFile ( string $pathFile = '' ) : boolean removeFile
removeFolder ( string $dirPath ) : boolean Apaga um diretorio e todo o seu conteúdo
saveFile ( string $path = '', string $filename = '', string $content = '' ) : boolean saveFile
writeTest ( string $path = '', string $message = '', string &$respHtml = '' ) : boolean Rotina para teste de escrita no path especificado Usada na rotina de configuração (install.php)

Method Details

createFolder() public static method

createFolder
public static createFolder ( string $folder )
$folder string

createFolders() public static method

createFolders Cria a estrutura de diretorios para a guarda dos arquivos
public static createFolders ( string $dirPath ) : boolean
$dirPath string path do diretorio a ser criado
return boolean

getAmbiente() public static method

getAmbiente
public static getAmbiente ( string $tpAmb = '2' ) : string
$tpAmb string
return string

getFilePath() public static method

getFilePath
public static getFilePath ( string $tpAmb = '2', string $dirbase = '', string $subdir = '' ) : string
$tpAmb string
$dirbase string
$subdir string
return string

listDir() public static method

listDir Obtem todo o conteúdo de um diretorio, e que atendam ao critério indicado.
public static listDir ( $folder, string $fileMatch = '*-nfe.xml', boolean $retpath = false ) : array
$fileMatch string Critério de seleção pode ser usados coringas como *-nfe.xml
$retpath boolean se true retorna o path completo dos arquivos se false so retorna o nome dos arquivos
return array com os nome dos arquivos que atendem ao critério estabelecido ou false

readFile() public static method

readFile
public static readFile ( string $pathFile = '' ) : string
$pathFile string
return string

removeFile() public static method

removeFile
public static removeFile ( string $pathFile = '' ) : boolean
$pathFile string
return boolean

removeFolder() public static method

Apaga um diretorio e todo o seu conteúdo
public static removeFolder ( string $dirPath ) : boolean
$dirPath string
return boolean

saveFile() public static method

saveFile
public static saveFile ( string $path = '', string $filename = '', string $content = '' ) : boolean
$path string
$filename string
$content string
return boolean

writeTest() public static method

Rotina para teste de escrita no path especificado Usada na rotina de configuração (install.php)
public static writeTest ( string $path = '', string $message = '', string &$respHtml = '' ) : boolean
$path string
$message string
$respHtml string passado por referencia irá conter a resposta em html
return boolean

Property Details

$ambientes protected static property

protected static $ambientes

$subdirs protected static property

protected static $subdirs