PHP Class Xinax\LaravelGettext\FileSystem

Afficher le fichier Open project: xinax/laravel-gettext Class Usage Examples

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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)

Méthodes protégées

Méthode Description
createDirectory ( $path ) Validate if the directory can be created

Method Details

__construct() public méthode

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

addLocale() public méthode

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

checkDirectoryStructure() public méthode

Checks the required directory Optionally checks each local directory, if $checkLocales is true
public checkDirectoryStructure ( boolean | false $checkLocales = false ) : boolean
$checkLocales boolean | false
Résultat boolean

clearDirectory() public static méthode

Removes the directory contents recursively
public static clearDirectory ( string $path ) : null | boolean
$path string
Résultat null | boolean

compileViews() public méthode

Build views in order to parse php files
public compileViews ( array $viewPaths, string $domain ) : boolean
$viewPaths array
$domain string
Résultat boolean

createDirectory() protected méthode

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

createPOFile() public méthode

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
Résultat integer | string

generateLocales() public méthode

Creates the localization directories and files by domain
public generateLocales ( ) : array
Résultat array

getBasePath() public méthode

Get the filesystem base path
public getBasePath ( ) : string
Résultat string

getConfiguration() public méthode

Gets the package configuration model.
public getConfiguration ( ) : Config
Résultat Xinax\LaravelGettext\Config\Models\Config

getDomainPath() public méthode

Constructs and returns the full path to the translation files
public getDomainPath ( null $append = null ) : string
$append null
Résultat string

getFolderName() public méthode

Get the folder name
public getFolderName ( ) : string
Résultat string

getRelativePath() public méthode

Return the relative path from a file or directory to anothe
Author: Laurent Goussard
public getRelativePath ( string $from, string $to ) : string
$from string
$to string
Résultat string

getStorageForDomain() public méthode

Get the full path for domain storage directory
public getStorageForDomain ( $domain ) : String
$domain
Résultat String

getStoragePath() public méthode

Get the storage path
public getStoragePath ( ) : string
Résultat string

makePOFilePath() public méthode

Returns the full path for a .po file from its domain and locale
public makePOFilePath ( $locale, $domain ) : string
$locale
$domain
Résultat string

setBasePath() public méthode

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

setConfiguration() public méthode

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

setFolderName() public méthode

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

setStoragePath() public méthode

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

updateLocale() public méthode

Update the .po file headers by domain (mainly source-file paths)
public updateLocale ( $localePath, $locale, $domain ) : boolean
$localePath
$locale
$domain
Résultat boolean

Property Details

$basePath protected_oe property

File system base path All paths will be relative to this
protected string $basePath
Résultat string

$configuration protected_oe property

Package configuration model
protected Config,Xinax\LaravelGettext\Config\Models $configuration
Résultat Xinax\LaravelGettext\Config\Models\Config

$folderName protected_oe property

The folder name in which the language files are stored
protected string $folderName
Résultat string

$storageContainer protected_oe property

Storage directory name for view compilation
protected string $storageContainer
Résultat string

$storagePath protected_oe property

Storage path for file generation
protected string $storagePath
Résultat string