PHP Класс Xinax\LaravelGettext\FileSystem

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

Защищенные свойства (Protected)

Свойство Тип Описание
$basePath string File system base path All paths will be relative to this
$configuration Xinax\LaravelGettext\Config\Models\Config Package configuration model
$folderName string The folder name in which the language files are stored
$storageContainer string Storage directory name for view compilation
$storagePath string Storage path for file generation

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

Метод Описание
__construct ( Config $config, $basePath, $storagePath )
addLocale ( String $localePath, String $locale ) Adds a new locale directory + .po file
checkDirectoryStructure ( boolean | false $checkLocales = false ) : boolean Checks the required directory Optionally checks each local directory, if $checkLocales is true
clearDirectory ( string $path ) : null | boolean Removes the directory contents recursively
compileViews ( array $viewPaths, string $domain ) : boolean Build views in order to parse php files
createPOFile ( string $path, string $locale, string $domain, boolean | true $write = true ) : integer | string Creates a configured .po file on $path If PHP are not able to create the file the content will be returned instead
generateLocales ( ) : array Creates the localization directories and files by domain
getBasePath ( ) : string Get the filesystem base path
getConfiguration ( ) : Config Gets the package configuration model.
getDomainPath ( null $append = null ) : string Constructs and returns the full path to the translation files
getFolderName ( ) : string Get the folder name
getRelativePath ( string $from, string $to ) : string Return the relative path from a file or directory to anothe
getStorageForDomain ( $domain ) : String Get the full path for domain storage directory
getStoragePath ( ) : string Get the storage path
makePOFilePath ( $locale, $domain ) : string Returns the full path for a .po file from its domain and locale
setBasePath ( $basePath ) Set the filesystem base path
setConfiguration ( Config $configuration ) Set the package configuration model
setFolderName ( $folderName ) Set the folder name
setStoragePath ( $storagePath ) Set the storage path
updateLocale ( $localePath, $locale, $domain ) : boolean Update the .po file headers by domain (mainly source-file paths)

Защищенные методы

Метод Описание
createDirectory ( $path ) Validate if the directory can be created

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

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

public __construct ( Config $config, $basePath, $storagePath )
$config Xinax\LaravelGettext\Config\Models\Config
$basePath
$storagePath

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

Adds a new locale directory + .po file
public addLocale ( String $localePath, String $locale )
$localePath String
$locale String

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

Checks the required directory Optionally checks each local directory, if $checkLocales is true
public checkDirectoryStructure ( boolean | false $checkLocales = false ) : boolean
$checkLocales boolean | false
Результат boolean

clearDirectory() публичный статический Метод

Removes the directory contents recursively
public static clearDirectory ( string $path ) : null | boolean
$path string
Результат null | boolean

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

Build views in order to parse php files
public compileViews ( array $viewPaths, string $domain ) : boolean
$viewPaths array
$domain string
Результат boolean

createDirectory() защищенный Метод

Validate if the directory can be created
protected createDirectory ( $path )
$path

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

Creates a configured .po file on $path If PHP are not able to create the file the content will be returned instead
public createPOFile ( string $path, string $locale, string $domain, boolean | true $write = true ) : integer | string
$path string
$locale string
$domain string
$write boolean | true
Результат integer | string

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

Creates the localization directories and files by domain
public generateLocales ( ) : array
Результат array

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

Get the filesystem base path
public getBasePath ( ) : string
Результат string

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

Gets the package configuration model.
public getConfiguration ( ) : Config
Результат Xinax\LaravelGettext\Config\Models\Config

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

Constructs and returns the full path to the translation files
public getDomainPath ( null $append = null ) : string
$append null
Результат string

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

Get the folder name
public getFolderName ( ) : string
Результат string

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

Return the relative path from a file or directory to anothe
Автор: Laurent Goussard
public getRelativePath ( string $from, string $to ) : string
$from string
$to string
Результат string

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

Get the full path for domain storage directory
public getStorageForDomain ( $domain ) : String
$domain
Результат String

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

Get the storage path
public getStoragePath ( ) : string
Результат string

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

Returns the full path for a .po file from its domain and locale
public makePOFilePath ( $locale, $domain ) : string
$locale
$domain
Результат string

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

Set the filesystem base path
public setBasePath ( $basePath )
$basePath

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

Set the package configuration model
public setConfiguration ( Config $configuration )
$configuration Xinax\LaravelGettext\Config\Models\Config

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

Set the folder name
public setFolderName ( $folderName )
$folderName

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

Set the storage path
public setStoragePath ( $storagePath )
$storagePath

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

Update the .po file headers by domain (mainly source-file paths)
public updateLocale ( $localePath, $locale, $domain ) : boolean
$localePath
$locale
$domain
Результат boolean

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

$basePath защищенное свойство

File system base path All paths will be relative to this
protected string $basePath
Результат string

$configuration защищенное свойство

Package configuration model
protected Config,Xinax\LaravelGettext\Config\Models $configuration
Результат Xinax\LaravelGettext\Config\Models\Config

$folderName защищенное свойство

The folder name in which the language files are stored
protected string $folderName
Результат string

$storageContainer защищенное свойство

Storage directory name for view compilation
protected string $storageContainer
Результат string

$storagePath защищенное свойство

Storage path for file generation
protected string $storagePath
Результат string