Definition at line 9 of file Extractor.php.
◆ fromFile()
static Gettext\Extractors\Extractor::fromFile |
( |
|
$file, |
|
|
Translations |
$translations = null |
|
) |
| |
|
static |
Extract the translations from a file.
- Parameters
-
array | string | $file | A path of a file or files |
null | Translations | $translations | The translations instance to append the new translations. |
- Returns
- Translations
Definition at line 19 of file Extractor.php.
References $file.
21 if ($translations === null) {
22 $translations =
new Translations();
26 static::fromString(self::readFile($file), $translations, $file);
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ getFiles()
static Gettext\Extractors\Extractor::getFiles |
( |
|
$file | ) |
|
|
staticprotected |
Checks and returns all files.
- Parameters
-
string | array | $file | The file/s |
- Returns
- array The file paths
Definition at line 39 of file Extractor.php.
References $file, $files, and array.
45 if (is_string(
$file)) {
46 if (!is_file(
$file)) {
50 if (!is_readable(
$file)) {
57 if (is_array(
$file)) {
60 foreach (
$file as $f) {
Create styles array
The data for the language used.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
◆ readFile()
static Gettext\Extractors\Extractor::readFile |
( |
|
$file | ) |
|
|
staticprotected |
Reads and returns the content of a file.
- Parameters
-
- Returns
- string
Definition at line 77 of file Extractor.php.
References $file.
79 $length = filesize(
$file);
81 if (!($fd = fopen(
$file,
'rb'))) {
82 throw new Exception(
"Cannot read the file '$file', probably permissions");
85 $content = $length ? fread($fd, $length) :
'';
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
The documentation for this class was generated from the following file:
- libs/composer/vendor/gettext/gettext/src/Extractors/Extractor.php