class Factory implements FactoryInterface (View source)

Constants

CACHE_PREFIX

CACHE_DURATION

Properties

protected Cache $cache
protected Filesystem $fs

Methods

__construct(Cache $cache, Filesystem $fs)

No description

Stats[]
getAvailableCoreStats()

Get stats about all the locally available translation files for the core.

getCoreStats(string $localeID)

Get core translations stats for a specific locale ID.

Stats[]
getAvailablePackageStats(Package $package)

Get stats about all the locally available translation files for a package.

getPackageStats(Package $package, string $localeID)

Get package translations stats for a specific locale ID.

clearCache()

Clear (eventually) cached data about local translation stats.

null|array
getTranslationsStats(Translations $translations, DateTime $defaultUpdatedOn)

Get stats for a \Gettext\Translations instance.

getMoFileStats(string $moFile)

Get stats for a gettext .mo file.

Details

__construct(Cache $cache, Filesystem $fs)

No description

Parameters

Cache $cache
Filesystem $fs

Stats[] getAvailableCoreStats()

Get stats about all the locally available translation files for the core.

Return Value

Stats[]

keys are the locale IDs, values are the stats

See also

FactoryInterface::getAvailableCoreStats

Stats getCoreStats(string $localeID)

Get core translations stats for a specific locale ID.

Parameters

string $localeID

Return Value

Stats

See also

FactoryInterface::getCoreStats

Stats[] getAvailablePackageStats(Package $package)

Get stats about all the locally available translation files for a package.

Parameters

Package $package

Return Value

Stats[]

keys are the locale IDs, values are the stats

See also

FactoryInterface::getAvailablePackageStats

Stats getPackageStats(Package $package, string $localeID)

Get package translations stats for a specific locale ID.

Parameters

Package $package
string $localeID

Return Value

Stats

See also

FactoryInterface::getPackageStats

clearCache()

Clear (eventually) cached data about local translation stats.

protected null|array getTranslationsStats(Translations $translations, DateTime $defaultUpdatedOn)

Get stats for a \Gettext\Translations instance.

Parameters

Translations $translations
DateTime $defaultUpdatedOn

Return Value

null|array

{ @var string $version @var DateTime $updatedOn }

protected Stats getMoFileStats(string $moFile)

Get stats for a gettext .mo file.

Parameters

string $moFile

The full path to a gettext .mo file (it may not exist)

Return Value

Stats