Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
wp /
vendor /
gettext /
gettext /
src /
Utils /
[ HOME SHELL ]
Name
Size
Permission
Action
CsvTrait.php
1.39
KB
-rw-r--r--
DictionaryTrait.php
1.48
KB
-rw-r--r--
FunctionsScanner.php
5.32
KB
-rw-r--r--
HeadersExtractorTrait.php
1.62
KB
-rw-r--r--
HeadersGeneratorTrait.php
567
B
-rw-r--r--
JsFunctionsScanner.php
9.23
KB
-rw-r--r--
MultidimensionalArrayTrait.php
3.18
KB
-rw-r--r--
ParsedComment.php
3.09
KB
-rw-r--r--
ParsedFunction.php
3.62
KB
-rw-r--r--
PhpFunctionsScanner.php
5.91
KB
-rw-r--r--
StringReader.php
971
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : FunctionsScanner.php
<?php namespace Gettext\Utils; use Exception; use Gettext\Translations; abstract class FunctionsScanner { /** * Scan and returns the functions and the arguments. * * @param array $constants Constants used in the code to replace * * @return array */ abstract public function getFunctions(array $constants = []); /** * Search for specific functions and create translations. * * You can pass multiple translation with different domains and value found will be sorted respectively. * * @param Translations|Translations[] $translations Multiple domain translations instances where to save the values * @param array $options The extractor options * @throws Exception */ public function saveGettextFunctions($translations, array $options) { $translations = is_array($translations) ? $translations : [$translations]; /** @var Translations[] $translationByDomain [domain => translations, ..] */ $translationByDomain = array_reduce($translations, function ($carry, Translations $translations) { $carry[$translations->getDomain()] = $translations; return $carry; }, []); $functions = $options['functions']; $file = $options['file']; /** * List of source code comments already associated with a function. * * Prevents associating the same comment to multiple functions. * * @var ParsedComment[] $commentsCache */ $commentsCache = []; foreach ($this->getFunctions($options['constants']) as $function) { list($name, $line, $args) = $function; if (isset($options['lineOffset'])) { $line += $options['lineOffset']; } if (!isset($functions[$name])) { continue; } $deconstructed = $this->deconstructArgs($functions[$name], $args); if (!$deconstructed) { continue; } list($domain, $context, $original, $plural) = $deconstructed; if ((string)$original === '') { continue; } $isDefaultDomain = $domain === null; $domainTranslations = isset($translationByDomain[$domain]) ? $translationByDomain[$domain] : false; if (!empty($options['domainOnly']) && $isDefaultDomain) { // If we want to find translations for a specific domain, skip default domain messages continue; } if (!$domainTranslations) { continue; } $translation = $domainTranslations->insert($context, $original, $plural); $translation->addReference($file, $line); if (isset($function[3])) { /* @var ParsedComment $extractedComment */ foreach ($function[3] as $extractedComment) { if (in_array($extractedComment, $commentsCache, true)) { continue; } $translation->addExtractedComment($extractedComment->getComment()); $commentsCache[] = $extractedComment; } } } } /** * Deconstruct arguments to translation values * * @param $function * @param $args * @return array|null * @throws Exception */ protected function deconstructArgs($function, $args) { $domain = null; $context = null; $original = null; $plural = null; switch ($function) { case 'noop': case 'gettext': if (!isset($args[0])) { return null; } $original = $args[0]; break; case 'ngettext': if (!isset($args[1])) { return null; } list($original, $plural) = $args; break; case 'pgettext': if (!isset($args[1])) { return null; } list($context, $original) = $args; break; case 'dgettext': if (!isset($args[1])) { return null; } list($domain, $original) = $args; break; case 'dpgettext': if (!isset($args[2])) { return null; } list($domain, $context, $original) = $args; break; case 'npgettext': if (!isset($args[2])) { return null; } list($context, $original, $plural) = $args; break; case 'dnpgettext': if (!isset($args[3])) { return null; } list($domain, $context, $original, $plural) = $args; break; case 'dngettext': if (!isset($args[2])) { return null; } list($domain, $original, $plural) = $args; break; default: throw new Exception(sprintf('Not valid function %s', $function)); } return [$domain, $context, $original, $plural]; } }
Close