Exemplo n.º 1
1
 /**
  * @param string $provider
  *
  * @return array
  */
 public function getProviderConfig($provider)
 {
     return array_exists($provider, $this->getProvidersConfigs()) ? $this->providersConfigs[$provider] : [];
 }
Exemplo n.º 2
0
 public static function exists($identifier)
 {
     $key = $identifier;
     // Initiates everything
     static::load();
     return array_exists(static::$stack, $key);
 }
Exemplo n.º 3
0
function page_valid()
{
    $str_list[] = "<";
    $str_list[] = ">";
    $str_list[] = "'";
    $str_list[] = ";";
    $str_list[] = "select";
    $str_list[] = " and ";
    $str_list[] = "exec";
    $str_list[] = "insert";
    $str_list[] = "delete";
    $str_list[] = "update";
    $str_list[] = "count";
    $str_list[] = "*";
    $str_list[] = "%";
    $str_list[] = "chr";
    $str_list[] = "char";
    $str_list[] = "mid";
    $str_list[] = "master";
    $str_list[] = "truncate";
    $str_list[] = "declare";
    settype($page_valid_post, 'array');
    settype($page_valid_get, 'array');
    $tmp = true;
    for ($i = 0; $i < count($str_list); $i++) {
        foreach ($_REQUEST as $key => $value) {
            if (str_exists($value, $str_list[$i])) {
                $tmp = false;
                if (!array_exists($page_valid_post, $str_list[$i])) {
                    $page_valid_post[] = $str_list[$i];
                }
            }
        }
        foreach ($_REQUEST as $key => $value) {
            if (str_exists($key, $str_list[$i]) || str_exists($value, $str_list[$i])) {
                $tmp = false;
                if (!array_exists($page_valid_get, $str_list[$i])) {
                    $page_valid_get[] = $str_list[$i];
                }
            }
        }
    }
    setcookie("ozg_beta", "ozg_beta");
    if ($_COOKIE) {
        if (count($page_valid_post) > 0) {
            setcookie("page_valid_post", implode(",", $page_valid_post));
        }
        if (count($page_valid_get) > 0) {
            setcookie("page_valid_get", implode(",", $page_valid_get));
        }
    }
    setcookie("ozg_beta", "");
    return $tmp;
}
Exemplo n.º 4
0
 /**
  * Verify if the provided $key exists on the data stack
  *
  * @param string $key Data identifier
  * @return bool
  */
 public function offsetExists($key)
 {
     return array_exists($this->data, $key);
 }
Exemplo n.º 5
0
 /**
  * Handles the available handlers and pushes them to the Monolog\Logger instance
  *
  * @return void
  */
 protected function pushHandlers()
 {
     foreach (Config::get('kernel.logs.handlers') as $handler => $options) {
         switch ($handler) {
             case 'RotatingFileHandler':
                 if (!$options['enabled']) {
                     continue;
                 }
                 $level = static::nameToLevel($options['level']);
                 $chmod = 0 . $options['chmod'];
                 /*
                 $class = 'Monolog\\Formatter\\' . $options['formatter'];
                 $formatter = new $class();
                 */
                 // Is this handler enabled for this environment?
                 if (array_exists(array_flip($options['environments']), Kernel::env())) {
                     $rotateHandler = new RotatingFileHandler(path('logs') . $options['filename'] . '.log', $options['max'], $level, $chmod);
                     $rotateHandler->setFilenameFormat('{filename}-{date}', $options['date_format']);
                     $this->getLogger()->pushHandler($rotateHandler);
                 }
                 break;
             case 'BrowserConsoleHandler':
                 if (!$options['enabled']) {
                     continue;
                 }
                 // Is this handler enabled for this environment?
                 if (array_exists(array_flip($options['environments']), Kernel::env())) {
                     $this->getLogger()->pushHandler(new BrowserConsoleHandler());
                 }
                 break;
         }
     }
 }
Exemplo n.º 6
0
require "comm/functions.php";
require "comm/share.php";
$curr_file_name = strtolower(self());
$runtime = new runtime();
$db = new ezSQL_pdo($db_cfg["connect"], $db_cfg["user"], $db_cfg["pwd"]);
if (strpos($db_cfg["connect"], "mysql") !== false) {
    $db->query("SET NAMES " . constant("WEB_CHARSET"));
}
define("SMARTY_PATH", "smarty/");
$smarty = new Smarty();
$smarty->template_dir = "html/";
$smarty->compile_dir = constant("SMARTY_PATH") . "templates_c/";
$smarty->config_dir = constant("SMARTY_PATH") . "configs/";
$smarty->cache_dir = constant("SMARTY_PATH") . "cache/";
$page = new Page();
$page->pageIndexName = "page";
$page->firstText = "首页";
$page->prevText = "上一页";
$page->nextText = "下一页";
$page->lastText = "末页";
$novalid = array();
$novalid[] = "admin_articlesingle.php";
$novalid[] = "admin_data_add.php";
$novalid[] = "admin_sql.php";
$novalid[] = "msg.php";
//这个数组是为了解决某些不需要SQL验证的页面,如使用了FCK的页面
if (!page_valid()) {
    if (!array_exists($novalid, $curr_file_name)) {
        //msg_box(get_page_valid_msg());
    }
}