示例#1
0
 private static function isLogin()
 {
     if (!($userid = session_get('USERID'))) {
         if (Request::isAjax()) {
             exit(json_encode(array('code' => -1, 'msg' => 'please login')));
         } else {
             exit(app::run(array('home', 'page', 'login')));
         }
     }
     return $userid;
 }
示例#2
0
文件: api.cls.php 项目: qhdyym/PHPEMS
 public function run()
 {
     $ev = $this->make('ev');
     include '../lib/config.inc.php';
     header('P3P: CP=CAO PSA OUR');
     header('Content-Type: text/html; charset=' . HE);
     ini_set('date.timezone', 'Asia/Shanghai');
     date_default_timezone_set("Etc/GMT-8");
     error_reporting(0);
     $app = new app($this);
     $app->run();
 }
 public static function uoke()
 {
     self::coreRun();
     if (DEBUGSET == 1) {
         error_reporting(E_ERROR);
     } elseif (DEBUGSET == 2) {
         error_reporting(E_ALL);
     } else {
         error_reporting(0);
     }
     ob_start();
     helper_log::runLog();
     app::run();
 }
示例#4
0
 public static function init($userConfig)
 {
     //        spl_autoload_register('EZPHP\EZPHP::autoLoad');
     spl_autoload_register(array('EZPHP\\EZPHP', 'autoLoad'));
     set_error_handler('EZPHP\\EZPHP::appError');
     set_exception_handler('EZPHP\\EZPHP::appException');
     register_shutdown_function('EZPHP\\EZPHP::appEnd');
     //trigger_error("what ?",E_USER_ERROR);
     //throw new EZException('111');
     //obstart
     global $defaultConfig;
     global $config;
     $config = array_merge($defaultConfig, $userConfig);
     dev::start();
     app::run($config);
     dev::end();
     EZPHP::$success_end = true;
 }
示例#5
0
文件: index.php 项目: Cheuk1991/DuPHP
<?php

require 'core/app.php';
date_default_timezone_set("PRC");
app::init();
app::run();
示例#6
0
 public static function runRouter($router)
 {
     if (count($router) == 1) {
         $router[] = DEFAULT_ACTION;
     }
     $GLOBALS['APP']['router'] = $router;
     if (is_object($router[1])) {
         return call_user_func_array($router[1], array_slice($router, 2));
     } else {
         app::run($router);
     }
 }
示例#7
0
文件: index.php 项目: vgalitsky/moze
<?php

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
require_once 'app/core/const.php';
require_once 'app/core/autoload.php';
require_once 'config.php';
require_once "app/app.php";
/** @var app $app */
$app = new app($___config);
$app->run();
示例#8
0
    }
    /*
     * prüfe auf "?"-GET Variablen:
     */
    if (strrpos($_SERVER['REQUEST_URI'], "?") !== false) {
        $request['uri'] = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], "?"));
    } else {
        $request['uri'] = $_SERVER['REQUEST_URI'];
    }
    "(" . __FILE__ . "): REQUEST_URI und GET/POST ausgelesen:<br />" . "\$request:<br /><pre>" . var_export($request, true) . "</pre>";
}
/*
 * run application
 */
try {
    app::run($request);
} catch (Exception $exception) {
    /*
     * lade exception controller
     */
    $e = new controller_exceptionhandler();
    $e->run($exception);
}
exit;
/*
 * Ende Ablauf index.php
 **/
/**
 * __autoload($class_name)
 *
 * autmatisches Laden von Klassen
示例#9
0
            $opt['title'] = $row['title'];
            $opt['title2'] = $row['title_en'];
            $opt['min_ckeditor'] = $row['content'];
            $opt['keywords'] = $row['keyword'];
            $opt['journal'] = $row['journal_name'];
            $opt['more_authors'] = $row['more_authors'];
            $opt['file'] = $row['file'];
            $opt['link'] = $row['link'];
            if ($row['lang'] == 'en') {
                $opt['title'] = $row['title_en'];
                $opt['title2'] = $row['title'];
                $opt['min_ckeditor'] = $row['content_en'];
                $opt['keywords'] = $row['keyword_en'];
            }
            #CALL ADD FUNCTION
            app::run(app::$ROUTE_GET, array('do' => 'add'), array($opt));
        }
    }
});
$app->getDO('delete', ['auth_login' => true, 'get_token' => 'auth_token', validRequest() => true], function () use($pdo) {
    if (isset($_GET['article']) && intval($_GET['article'])) {
        $sql = "delete from article where id=:id";
        if ($_SESSION['permission'] != 'admin') {
            $sql = $sql . " and status=0 and uid=" . $_SESSION['userId'];
        }
        $stmt = $pdo->prepare($sql);
        $stmt->bindvalue(':id', filter_var($_GET['article'], FILTER_SANITIZE_STRING), PDO::PARAM_INT);
        $affected_rows = $stmt->execute();
        _log('info_delete', $affected_rows . ' row(s) of records deleted', 'article=' . $_GET['article']);
    }
    redirect(BACK_ADDRESS, 1);
示例#10
0
 /**
  * 每日执行
  */
 function task2()
 {
     $this->funddividend();
     //分红同步
     $this->resolution();
     //拆分同步
     app::run(array('bond', 'index'));
     //中证全债数据抓取
 }
示例#11
0
<?php

/*
PHP Image Host
www.phpace.com/php-image-host
Copyright (c) 2004,2008,2009 Sam Yapp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// turn full error reporting on / off
error_reporting(E_ALL ^ E_NOTICE);
// define this to stop other files being included when they shouldnt
define('PIH', true);
// include configuration / initialization options
require_once dirname(__FILE__) . '/classes/app.class.php';
$app = new app();
$app->run(isset($_REQUEST['cmd']) ? $_REQUEST['cmd'] : 'index');
echo $app->theme->renderTheme();