コード例 #1
0
ファイル: ajax.php プロジェクト: saintho/phpdisk
 * 定义 Ajax 类
 *
 * @link http://www.yucmedia.com/
 * @copyright Copyright (c) 2011-2012 宇初网络技术有限公司 {@link http://www.yucmedia.com/}
 * @version $Id: ajax.php 1186 2012-07-25 02:29:24Z zhanghui $
 * @author Administrator
 * @author $Author: zhanghui $
 * $Date: 2012-07-25 10:29:24 +0800 (周三, 2012-07-25) $
 * @package Ajax
 */
define('P_IS_ACCESS', TRUE);
require './_base.php';
class Ajax extends YPrepose implements YIAction
{
    public function __construct()
    {
        parent::__construct();
    }
    /**
     *  获取校验结果
     * @return type
     */
    public function run()
    {
        $ret = Verify::getVerifyResult();
        $back_result = array('code' => Verify::getCode(), 'result' => Verify::getResult(), 'details' => Verify::getDetails());
        echo 'yuc_site_config.ajaxresult=' . json_encode($back_result);
    }
}
YAccess::run('Ajax');
コード例 #2
0
ファイル: load.php プロジェクト: saintho/phpdisk
        YLog::Write('请求:' . YApp::getConfig('YUC_SERVICE_NAME') . YApp::getConfig('YUC_REQUEST_PATH') . ';返回状态 :' . $client->getStatus() . ';POST请求返回的数据:' . $client->getContent(), YLog::DEBUG);
        $ret_back = json_decode($client->getContent(), TRUE);
        if (!is_array($ret_back)) {
            YucMonitor::report("REPORT_0004", $client->getContent());
        }
        return array('status' => $client->getStatus(), 'content' => $ret_back);
    }
    /**
     * 加载 Js文件
     * @param $js
     * @return string|type
     */
    private function loadJs($js)
    {
        $js_code_temp = '';
        $key = md5('__compress_js__' . $js);
        $js_cache_code = F($key);
        if ($js_cache_code === FALSE) {
            $js_arr = explode('|', $js);
            foreach ($js_arr as $js) {
                $file = M_PRO_DIR . '/Media/Js/' . str_replace("_", "/", $js);
                $js_code_temp .= file_get_contents($file);
            }
            $js_cache_code = $js_code_temp;
            F($key, $js_cache_code);
        }
        return $js_cache_code;
    }
}
YAccess::run('Load');
コード例 #3
0
ファイル: _base.php プロジェクト: saintho/phpdisk
<?php

/**
 * 定义 _base 文件
 *
 * @link http://www.yucmedia.com/
 * @copyright Copyright (c) 2011-2012 宇初网络技术有限公司 {@link http://www.yucmedia.com/}
 * @todo 统一加载核心文件,开始启动核心文件
 * @version $Id: _base.php 1852 2012-08-31 02:57:50Z zhanghui $
 * @author Administrator
 * @author $Author: zhanghui $
 * $Date: 2012-08-31 10:57:50 +0800 (周五, 2012-08-31) $
 * @package _base
 */
date_default_timezone_set("PRC");
require dirname(dirname(__FILE__)) . '/Core/YAccess.php';
// 开始执行框架初始化
YAccess::start();
コード例 #4
0
ファイル: image.php プロジェクト: saintho/phpdisk
    {
        $ret = array();
        $ret['width'] = $this->getValueInRange('width', 160, 320, 245);
        $ret['height'] = $this->getValueInRange('height', 90, 180, 185);
        $ret['fontsize'] = $this->getValueInRange('fontsize', 30, 60, 30);
        return $ret;
    }
    /**
     *  获取值的确定值 为了安全着想
     * @param type $key
     * @param type $default
     * @param type $max
     * @param type $min
     * @return type
     */
    private function getValueInRange($key, $default, $max, $min)
    {
        $value = $this->_context->get($key, $default);
        if ($value > $max) {
            return $max;
        } else {
            if ($value < $min) {
                return $min;
            } else {
                return $value;
            }
        }
    }
}
YAccess::run('Image');
コード例 #5
0
ファイル: index.php プロジェクト: saintho/phpdisk
<?php

/**
 * 定义 index 类
 * @link http://www.yucmedia.com/
 * @copyright Copyright (c) 2011-2012 宇初网络技术有限公司 {@link http://www.yucmedia.com/}
 * @version $Id:$
 * @author Administrator
 * @author $Author: $
 * $Date: 2012-07-10 09:46:31 +0800 (周二, 2012-07-10) $
 * @package index
 */
define('P_IS_ACCESS', TRUE);
require './_base.php';
class Index extends YPrepose implements YIAction
{
    public function run()
    {
        $rndCodeStr = implode(',', YucMath::getCheckCode(5, 2));
        $code = urlencode(base64_encode(YucCrypt::encrypt($rndCodeStr, YucMath::erypt_key())));
        $c_id = YucMath::getMultiSerialId(2, 10);
        $plugin_path = dirname($this->_context->baseDir());
        $imgsrc = YucServer::getServerUrl() . "{$plugin_path}/image.php?I_S={$c_id}&mass={$code}";
        $renderid = $this->_context->get('renderid', '');
        echo "yuc_site_config.{$renderid}=" . json_encode(array('imgsrc' => $imgsrc, 'mass' => $code, "result" => array("code" => 0, 'details' => '')));
    }
}
YAccess::run('Index');