|
| __construct ($_script, $_encoding=62, $_fastDecode=true, $_specialChars=false) |
|
| pack () |
|
Definition at line 69 of file JavaScriptPacker.php.
JavaScriptPacker::__construct |
( |
|
$_script, |
|
|
|
$_encoding = 62 , |
|
|
|
$_fastDecode = true , |
|
|
|
$_specialChars = false |
|
) |
| |
JavaScriptPacker::pack |
( |
| ) |
|
const JavaScriptPacker::IGNORE = '$1' |
const JavaScriptPacker::JSFUNCTION_decodeBody |
Initial value:=
' if (!\'\'.replace(/^/, String)) {
// decode all the values we need
while ($count--) {
$decode[$encode($count)] = $keywords[$count] || $encode($count);
}
// global replacement function
$keywords = [function ($encoded) {return $decode[$encoded]}];
// generic match
$encode = function () {return \'\\\\w+\'};
// reset the loop counter - we are now doing a global replace
$count = 1;
}
'
Definition at line 475 of file JavaScriptPacker.php.
const JavaScriptPacker::JSFUNCTION_encode10 |
const JavaScriptPacker::JSFUNCTION_encode36 |
Initial value:=
'function($charCode) {
return $charCode.toString(36);
}'
Definition at line 516 of file JavaScriptPacker.php.
const JavaScriptPacker::JSFUNCTION_encode62 |
Initial value:=
'function($charCode) {
return ($charCode < _encoding ? \'\' : arguments.callee(parseInt($charCode / _encoding))) +
(($charCode = $charCode % _encoding) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36));
}'
Definition at line 523 of file JavaScriptPacker.php.
const JavaScriptPacker::JSFUNCTION_encode95 |
Initial value:=
'function($charCode) {
return ($charCode < _encoding ? \'\' : arguments.callee($charCode / _encoding)) +
String.fromCharCode($charCode % _encoding + 161);
}'
Definition at line 531 of file JavaScriptPacker.php.
const JavaScriptPacker::JSFUNCTION_unpack |
Initial value:=
'function($packed, $ascii, $count, $keywords, $encode, $decode) {
while ($count--) {
if ($keywords[$count]) {
$packed = $packed.replace(new RegExp(\'\\\\b\' + $encode($count) + \'\\\\b\', \'g\'), $keywords[$count]);
}
}
return $packed;
}'
Definition at line 455 of file JavaScriptPacker.php.
The documentation for this class was generated from the following file: