本文整理汇总了PHP中JS::_PBF方法的典型用法代码示例。如果您正苦于以下问题:PHP JS::_PBF方法的具体用法?PHP JS::_PBF怎么用?PHP JS::_PBF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JS
的用法示例。
在下文中一共展示了JS::_PBF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _pack_bootstrap
private static function _pack_bootstrap($packed, $keywords)
{
$ENCODE = self::_pack_safe_regex('$encode\\($count\\)');
// $packed: the packed script
$packed = "'" . self::_pack_escape($packed) . "'";
// $ascii: base for encoding
$ascii = min(count($keywords['sorted']), self::$_PEN);
if ($ascii == 0) {
$ascii = 1;
}
// $count: number of words contained in the script
$count = count($keywords['sorted']);
// $keywords: list of words contained in the script
foreach ($keywords['protected'] as $i => $value) {
$keywords['sorted'][$i] = '';
}
// convert from a string to an array
ksort($keywords['sorted']);
$keywords = "'" . implode('|', $keywords['sorted']) . "'.split('|')";
$encode = self::$_PEN > 62 ? '_pack_encode95' : self::_pack_get_encoder($ascii);
$encode = self::get('_encode' . self::$_PEN);
$encode = preg_replace('/_encoding/', '$ascii', $encode);
$encode = preg_replace('/arguments\\.callee/', '$encode', $encode);
$inline = '\\$count' . ($ascii > 10 ? '.toString(\\$ascii)' : '');
// $decode: code snippet to speed up decoding
if (self::$_PFD) {
// create the decoder
$decode = self::get('_decode_body');
if (self::$_PEN > 62) {
$decode = preg_replace('/\\\\w/', '[\\xa1-\\xff]', $decode);
} elseif ($ascii < 36) {
$decode = preg_replace($ENCODE, $inline, $decode);
}
// special case: when $count==0 there are no keywords. I want to keep
// the basic shape of the unpacking funcion so i'll frig the code...
if ($count == 0) {
$decode = preg_replace(self::_pack_safe_regex('($count)\\s*=\\s*1'), '$1=0', $decode, 1);
}
}
// boot function
$unpack = self::get('_unpack');
if (self::$_PFD) {
// insert the decoder
self::$_PBF = $decode;
$unpack = preg_replace_callback('/\\{/', array('self', '_pack_put_fdecode'), $unpack, 1);
}
$unpack = preg_replace('/"/', "'", $unpack);
if (self::$_PEN > 62) {
// high-ascii
// get rid of the word-boundaries for regexp matches
$unpack = preg_replace('/\'\\\\\\\\b\'\\s*\\+|\\+\\s*\'\\\\\\\\b\'/', '', $unpack);
}
if ($ascii > 36 || self::$_PEN > 62 || self::$_PFD) {
// insert the encode function
self::$_PBF = $encode;
$unpack = preg_replace_callback('/\\{/', array('self', '_pack_put_fencode'), $unpack, 1);
} else {
// perform the encoding inline
$unpack = preg_replace($ENCODE, $inline, $unpack);
}
// pack the boot function too
self::pack($unpack, 0, true, false, false);
// arguments
$params = array($packed, $ascii, $count, $keywords);
if (self::$_PFD) {
$params[] = 0;
$params[] = '{}';
}
$params = implode(',', $params);
// the whole thing
return 'eval(' . $unpack . '(' . $params . "))\n";
}