Пример #1
0
<?php

/**
 * Web端请求入口
 *
 * @author Gavin<*****@*****.**>
 */
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
//~ require init.php
require __DIR__ . '/core/init.php';
$request = new Request();
$response = new Response();
try {
    SimPHP::I()->boot(RC_SESSION)->dispatch($request, $response);
} catch (SimPHPException $me) {
    $response->dump($me->getMessage());
} catch (Exception $e) {
    $response->dump($e->getMessage());
}
/*----- END FILE: index.php -----*/
Пример #2
0
<?php

/**
 * Mobile端请求入口
 *
 * @author Gavin<*****@*****.**>
 */
error_reporting(E_ALL);
ini_set('display_errors', 'on');
//~ require init.php
require __DIR__ . '/core/init.php';
$request = new Request();
$response = new Response();
//$response->send('<center style="font-size:36px;">系统维护中,请稍后再访问</center>');
try {
    SimPHP::I(['modroot' => 'mobiles'])->boot(RC_ALL ^ RC_MEMCACHE)->dispatch($request, $response);
} catch (SimPHPException $me) {
    $response->dump($me->getMessage());
} catch (Exception $e) {
    $response->dump($e->getMessage());
}
/*----- END FILE: mobile.php -----*/
Пример #3
0
<?php

/**
 * 
 *
 * @author Gavin<*****@*****.**>
 */
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
//~ require init.php
require __DIR__ . '/core/init.php';
//~ use Smarty template engine
Config::set('env.tplclass', 'Smarty');
Config::set('env.tplpostfix', '.htm');
$request = new Request();
$response = new Response();
try {
    SimPHP::I(['modroot' => 'admins', 'sessnode' => 'adm'])->boot(RC_ALL ^ RC_MEMCACHE)->dispatch($request, $response);
} catch (SimPHPException $me) {
    $response->dump($me->getMessage());
} catch (Exception $e) {
    $response->dump($e->getMessage());
}
/*----- END FILE: admin.php -----*/
Пример #4
0
<?php

/**
 * 通用API入口文件
 *
 * @author Gavin<*****@*****.**>
 */
if (!isset($_GET['q']) || empty($_GET['q'])) {
    $_GET['q'] = 'weixin/fxmgou';
}
//~ require init.php
require __DIR__ . '/core/init.php';
$request = new Request();
$response = new Response();
try {
    SimPHP::I(['modroot' => 'apis'])->boot(RC_DATABASE)->dispatch($request, $response);
} catch (SimPHPException $me) {
    $response->dump($me->getMessage());
} catch (Exception $e) {
    $response->dump($e->getMessage());
}
/*----- END FILE: api.php -----*/
Пример #5
0
#!/usr/bin/php
<?php 
/**
 * cron 脚步执行入口
 *
 * @author Gavin<*****@*****.**>
 */
//~ require init.php
require __DIR__ . '/core/init.php';
SimPHP::I()->boot();
if (!defined('CRON_ROOT')) {
    define('CRON_ROOT', SIMPHP_ROOT . '/cron');
}
if (!defined('BR')) {
    define('BR', IS_CLI ? "\n" : "<br>");
}
class JobManager
{
    // PHP commond path, maybe need changing here
    const PHP_CMD = '/usr/bin/php';
    //const PHP_CMD = '/usr/local/php-fcgi/bin/php';
    private function jobs()
    {
        $dir = CRON_ROOT;
        $jobs = [];
        $_handler = opendir($dir);
        while (false !== ($filename = readdir($_handler))) {
            if (preg_match("/^(.+Job)\\.php\$/", $filename, $matches) && is_file("{$dir}/{$filename}")) {
                $jobs[$matches[1]] = "{$dir}/{$filename}";
            }
        }
Пример #6
0
}
if (!function_exists('show_emptyimg')) {
    function show_emptyimg($format = 'gif')
    {
        header('Content-Type: image/' . $format);
        $width = 1;
        $height = 1;
        $img = imageCreate($width, $height);
        //imageFilledRectangle($img, 0, 0, $width, $height, imagecolorallocate($img, 255, 255, 255));
        ImageColorTransparent($img, imagecolorallocate($img, 255, 255, 255));
        imagegif($img);
        imagedestroy($img);
        exit;
    }
}
SimPHP::I()->boot(RC_SESSION);
if (isset($_GET['act'])) {
    $_action = trim($_GET['act']);
    switch ($_action) {
        case 'onload_stat':
            $vid = isset($_GET['vid']) ? intval($_GET['vid']) : 0;
            $onload_time = isset($_GET['t']) ? intval($_GET['t']) : 0;
            $params = array('onloadTime' => $onload_time);
            $vid = V($vid, $params, $_action);
            //show_jsonmsg(array('msg'=>'OK', 't'=>$onload_time));
            show_emptyimg();
            break;
        case 'retention_stat':
            $vid = isset($_GET['vid']) ? intval($_GET['vid']) : 0;
            $retention_time = isset($_GET['rt']) ? intval($_GET['rt']) : 0;
            $params = array('retentionTime' => $retention_time);
Пример #7
0
<?php

/**
 * Verify Code Generating
 *
 * @author Gavin<*****@*****.**>
 */
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
//~ require init.php
require __DIR__ . '/core/init.php';
SimPHP::I(['modroot' => 'admins', 'sessnode' => 'adm'])->boot(RC_SESSION);
$_SESSION['verifycode'] = '';
function _getcolor($color)
{
    global $image;
    $color = preg_replace("/^#/", "", $color);
    $r = $color[0] . $color[1];
    $r = hexdec($r);
    $b = $color[2] . $color[3];
    $b = hexdec($b);
    $g = $color[4] . $color[5];
    $g = hexdec($g);
    $color = imagecolorallocate($image, $r, $b, $g);
    return $color;
}
function _setnoise()
{
    global $image, $width, $height, $back, $noisenum;
    for ($i = 0; $i < $noisenum; $i++) {
        $randColor = imageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
Пример #8
0
<?php

/**
 * Web端请求入口
 *
 * @author Gavin<*****@*****.**>
 */
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
//~ require init.php
require __DIR__ . '/core/init.php';
$request = new Request();
$response = new Response();
try {
    SimPHP::I()->boot(RC_ALL ^ RC_MEMCACHE)->dispatch($request, $response);
} catch (SimPHPException $me) {
    $response->dump($me->getMessage());
} catch (Exception $e) {
    $response->dump($e->getMessage());
}
/*----- END FILE: index.php -----*/
Пример #9
0
<?php

/**
 * Verify Code Generating
 *
 * @author Gavin<*****@*****.**>
 */
//~ require init.php
require __DIR__ . '/core/init.php';
SimPHP::I(['modroot' => 'mobiles'])->boot(RC_SESSION);
$_SESSION['verifycode'] = '';
function _getcolor($color)
{
    global $image;
    $color = preg_replace("/^#/", "", $color);
    $r = $color[0] . $color[1];
    $r = hexdec($r);
    $b = $color[2] . $color[3];
    $b = hexdec($b);
    $g = $color[4] . $color[5];
    $g = hexdec($g);
    $color = imagecolorallocate($image, $r, $b, $g);
    return $color;
}
function _setnoise()
{
    global $image, $width, $height, $back, $noisenum;
    for ($i = 0; $i < $noisenum; $i++) {
        $randColor = imageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
        imageSetPixel($image, rand(0, $width), rand(0, $height), $randColor);
    }