Created
July 16, 2012 21:28
-
-
Save pfranc/3125181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->log('Extracting gettext strings'); | |
$xgettext = popen('xgettext --files-from=- --no-location --language=PHP --from-code=UTF-8 --no-wrap --omit-header -j -o "' . $messagesFile . '"', 'w'); | |
foreach ($dirs as $dir) { | |
$iterator = new RegexIterator( | |
new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator( | |
$dir, | |
FilesystemIterator::SKIP_DOTS | |
) | |
), | |
'%.+php$%' | |
); | |
foreach($iterator as $entry) { | |
if (strpos($entry, 'vendor') === FALSE && strpos($entry, 'tests') === FALSE) { | |
fwrite($xgettext, $entry . "\n"); | |
} | |
} | |
} | |
fclose($xgettext); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment