当前位置: 首页>>代码示例>>PHP>>正文


PHP http::out方法代码示例

本文整理汇总了PHP中http::out方法的典型用法代码示例。如果您正苦于以下问题:PHP http::out方法的具体用法?PHP http::out怎么用?PHP http::out使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在http的用法示例。


在下文中一共展示了http::out方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: eqphp_autoload

function eqphp_autoload($lib_name)
{
    $server_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
    $group = explode(',', config('group|info'));
    $rq_url = explode('/', trim($server_uri, '/'));
    $dir_first = array('a' => 'action', 'm' => 'model');
    $dir_second = array('a' => $rq_url[0] . '/action', 'm' => $rq_url[0] . '/model');
    $dir_arr = in_array($rq_url[0], $group) ? $dir_second : $dir_first;
    $dir_arr = array_merge($dir_arr, array('s' => 'server', 'p' => 'plugin'));
    $prefix = substr($lib_name, 0, strpos($lib_name, '_'));
    $dir_name = in_array($prefix, array_keys($dir_arr)) ? $dir_arr[$prefix] : 'class';
    $execute_file = $dir_name . '/' . $lib_name . '.php';
    if (strtolower($lib_name) == 'smarty') {
        $execute_file = 'data/smarty/Smarty.class.php';
    }
    if (file_exists($execute_file)) {
        return include dc_root . $execute_file;
    }
    if ($prefix == 'a') {
        $tpl_file = dc_root . 'view/' . substr($lib_name, 2) . '.html';
        if (file_exists($tpl_file)) {
            exit(include $tpl_file);
        }
        if ($execute_file != 'action/a_.php') {
            http::send(404, 0);
            http::out('404 Not Found');
        }
    }
    if (strpos(strtolower($execute_file), 'smarty_internal_') === false) {
        echo "class [" . $lib_name . "] is error !<br>";
    }
}
开发者ID:art-youth,项目名称:framework,代码行数:32,代码来源:index.php

示例2: register

 protected static function register($plugins = array(), $smarty = null)
 {
     $type = null;
     foreach ($plugins as $plug) {
         $type = count($plug) > 2 ? $plug[2] : 'function';
         if (count($plug) < 2 || !in_array($type, array('function', 'block', 'modifier'))) {
             http::out($plug);
         }
         self::reg($plug[0], $plug[1], $smarty, $type);
     }
     return true;
 }
开发者ID:art-youth,项目名称:framework,代码行数:12,代码来源:tpl.php

示例3: upload

 static function upload()
 {
     $basic_css = '<link rel="stylesheet" type="text/css" href="' . dc_url_style . 'basic.css" />';
     http::out($basic_css, true, false);
     $error = config('error', 'upload');
     $user_id = 8;
     //session::get('id');
     if (!$user_id) {
         http::out($error[301]);
     }
     $cf_type = config('self_type', 'upload');
     $cf_dir = config('self_dir', 'upload');
     $dir = post('up_dir', 'int');
     if (!$dir) {
         http::out($error[302]);
     }
     $save_path = dc_file_file . $cf_dir[$dir];
     if (!is_dir($save_path)) {
         http::out($error[304]);
     }
     //动态创建上传目录
     $auto_create_dir = '';
     //date('Y_m').'/'
     // $save_path.=$auto_create_dir;
     // if (!file_exists($save_path)) mkdir($save_path);
     if (!is_writable($save_path)) {
         http::out($error[305]);
     }
     $up_info = self::get('file_name');
     if ($up_info === null) {
         return http::out($error[303]);
     }
     if ($up_info === false) {
         http::out($error[306]);
     }
     $max_size = config('max_size|4', 'upload') * 1048576;
     if ($up_info['size'] > $max_size) {
         http::out($error[308]);
     }
     if ($up_info['error'] == 1) {
         http::out($error[309]);
     }
     if ($up_info['error'] == 2) {
         http::out($error[307]);
     }
     $ext_arr = array('pic' => explode(',', $cf_type['pic']), 'media' => explode(',', $cf_type['media']), 'doc' => explode(',', $cf_type['doc']), 'html' => explode(',', $cf_type['html']), 'zip' => explode(',', $cf_type['zip']));
     $type = post('up_type', 'title');
     if (!$type || !in_array($type, array_keys($ext_arr))) {
         http::out($error[304]);
     }
     if (!in_array(trim($up_info['type'], '.'), $ext_arr[$type])) {
         http::out($error[310]);
     }
     //$info_id=post('up_id','int'); //信息ID
     $file_name = $user_id . '_' . date("ymdHi") . '_' . rand(1000, 9999) . $up_info['type'];
     $file_path = $save_path . $file_name;
     if (!move_uploaded_file($up_info['name'], $file_path)) {
         http::out($error[311]);
     }
     chmod($file_path, 0644);
     //处理上传日志或入库逻辑
     http::out(dc_url_file . $cf_dir[$dir] . $auto_create_dir . $file_name);
 }
开发者ID:art-youth,项目名称:framework,代码行数:63,代码来源:a_upload.php


注:本文中的http::out方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。