Exemplo n.º 1
0
 public function createExelFile($filename)
 {
     $this->disableDebugAndLayout();
     HTTP::header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
     HTTP::header('Content-Disposition: attachment;filename="' . $filename . '"');
     HTTP::header('Cache-Control: max-age=0');
     $objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, 'Excel2007');
     $objWriter->save('php://output');
     exit;
 }
Exemplo n.º 2
0
 public function __call($method, $args)
 {
     $url = (defined('PHPFOX_API_URL') ? PHPFOX_API_URL : 'http://api.phpfox.com/') . $method;
     $Http = new HTTP($url);
     $Http->auth($this->_id, $this->_key);
     if (\Phpfox::isTrial()) {
         $Http->header('PHPFOX_IS_TRIAL', '1');
     }
     $Http->using(['domain' => \Phpfox::getParam('core.path')]);
     $Http->using(['version' => \Phpfox::VERSION]);
     foreach ($args as $key => $value) {
         if (is_string($value)) {
             // $value = [$key => $value];
         }
         $Http->using($value);
     }
     return $Http->post();
 }
Exemplo n.º 3
0
 /**
  * Status
  * Retorna el estado actual del sitio web
  *
  * @return true
  * ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
  * @author Luis Gdonis <*****@*****.**>
  * @since  2.0.0.0-alpha
  */
 private function _status()
 {
     HTTP::header('json');
     echo json_encode(Configure::read('info'));
 }
Exemplo n.º 4
0
<?php

date_default_timezone_set('Europe/Sofia');
//if(!isset($_GET['yegler'])){die('...');}
if (isset($_GET['refresh'])) {
    HTTP::header("Refresh: 2; ");
}
var_dump($_ENV);
?>

<a name="top"></a>
<form action="#bottom" method="POST" style="position:fixed;top:0px;left:0px;padding:3px 7px; background-color: white; color:000;">
	regex:<input type="text" name="regex" value="<?php 
echo isset($_POST['regex']) ? $_POST['regex'] : '';
?>
" />
	lines:<input type="text" name="n" value="<?php 
echo isset($_POST['n']) ? $_POST['n'] : '';
?>
" style='width:50px;'/>
	<input type="submit" value="GO" />
	<input type="button" value="clear" onclick="javascript:window.location.reload();" />
</form>
<a href="<?php 
echo isset($_GET['refresh']) ? '/' : '/?refresh';
?>
" style="position:fixed;top:0px;left:520px;padding:3px 7px; background-color: white;">Auto Refresh: <?php 
echo isset($_GET['refresh']) ? '0n' : 'Off';
?>
</a>
<a href="#top" style="position:fixed;bottom:0px;right:0px;padding:3px 7px; background-color: white;">top</a>
Exemplo n.º 5
0
Arquivo: XMLRPC.php Projeto: jasny/Q
 /**
  * Put additional information on an alternative channel (eg: http headers or stderr).
  * Fluent interface.
  *
  * @param string $type
  * @param string $value
  * @return RPC_Server_XMLRPC
  */
 public function putExtraInfo($type, $value)
 {
     if (!isset($this->altStream)) {
         HTTP::header("{$type}: {$value}", false);
     } else {
         $sxml = new SimpleXMLElement(xmlrpc_encode($value));
         fwrite($this->altStream, "<extraInfo><type>" . htmlentities($type) . "</type>" . $sxml->param->value->asXML() . "</extraInfo>");
     }
     return $this;
 }
function do_thumbnail_http_header()
{
    $offset = 60 * 60 * 24 * 30 * 12;
    // 1 year
    HTTP::header(array('Pragma' => 'private', 'Cache-Control' => 'private, max-age=' . $offset, 'Expires' => gmdate('D, d M Y H:i:s', time() + $offset) . ' GMT'));
}
Exemplo n.º 7
0
Arquivo: Header.php Projeto: jasny/Q
 /**
  * Log a message.
  *
  * @param string $message
  * @param string $type
  */
 protected function write($args)
 {
     $type = !empty($args['type']) ? $args['type'] : "Log";
     HTTP::header('X-' . ucfirst(strtolower($type)) . '-' . ++self::$counter . ': ' . str_replace(array("/r", "/n", "/t"), " ", $this->getLine($args)));
 }
Exemplo n.º 8
0
 /**
  * 处理业务逻辑 查询log 查询统计信息
  * @see PHPServerWorker::dealProcess()
  */
 public function dealProcess($recv_str)
 {
     HTTP::decode($recv_str);
     $module = isset($_GET['module']) ? trim($_GET['module']) : '';
     $interface = isset($_GET['interface']) ? trim($_GET['interface']) : '';
     $start_time = isset($_GET['start_time']) ? trim($_GET['start_time']) : '';
     $end_time = isset($_GET['end_time']) ? trim($_GET['end_time']) : '';
     // 管理员
     if (0 === strpos($_SERVER['REQUEST_URI'], '/admin')) {
         return $this->admin();
     } elseif (0 === strpos($_SERVER['REQUEST_URI'], '/html')) {
         if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
             HTTP::header("HTTP/1.1 304 Not Modified");
             return $this->sendToClient(HTTP::encode(''));
         }
         $modified_time = date('D, d M Y H:i:s');
         $base_name = basename($_SERVER['REQUEST_URI']);
         switch ($base_name) {
             case 'highcharts.js':
                 HTTP::header("Content-Type: application/javascript");
                 HTTP::header("Last-Modified: {$modified_time}");
                 return $this->sendToClient(HTTP::encode(self::$hichart));
             case 'jquery.min.js':
                 HTTP::header("Content-Type: application/javascript");
                 HTTP::header("Last-Modified: {$modified_time}");
                 return $this->sendToClient(HTTP::encode(self::$jquery));
             default:
                 HTTP::header("HTTP/1.1 404 Not Found");
                 return $this->sendToClient(HTTP::encode(''));
         }
     } elseif (0 === strpos($_SERVER['REQUEST_URI'], '/log')) {
         $this->checkRedirect();
         $right_str = '';
         $code = isset($_GET['code']) ? $_GET['code'] : '';
         $msg = isset($_GET['msg']) ? $_GET['msg'] : '';
         $pointer = isset($_GET['pointer']) ? $_GET['pointer'] : '';
         $count = isset($_GET['count']) ? $_GET['count'] : 5;
         $log_data_arr = $this->getStasticLog($module, $interface, $start_time, $end_time, $code, $msg, $pointer, $count);
         $log_data_str = '';
         unset($_GET['ip']);
         unset($_GET['pointer']);
         foreach ($log_data_arr as $address => $log_data) {
             list($ip, $port) = explode(':', $address);
             $str = str_replace('source_ip:', 'client_ip:', $log_data['data']);
             $log_data_str .= preg_replace('/t?arget_ip:\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/', 'server_ip:' . $ip . "<br/>", $str);
             $_GET['ip'][] = $ip;
             $_GET['pointer'][] = $log_data['pointer'];
         }
         // 过滤掉用户名密码
         $log_data_str = preg_replace(array('/([^#]*?Db[a-zA-Z]*Connection[^#]*?[construct|connect]\\()([^)]*?),([^)]*?),([^)]*?)(,[^)]*?\\))/i', '/(REQUEST_DATA:.*?)"password":"******"]*?)"/'), array('${1}${2}, ****, ****$5', '$1"password":"******"'), $log_data_str);
         unset($_GET['end_time']);
         $next_page_url = http_build_query($_GET);
         $log_data_str .= "</br><center><a href='/log/?{$next_page_url}'>下一页</a></center>";
         return $this->display(nl2br($log_data_str));
     } else {
         $this->checkRedirect();
         // 首页
         if (empty($module)) {
             return $this->home();
         } else {
             if ($interface) {
                 return $this->displayInterface($module, $interface, $start_time, $end_time);
             } else {
                 $this->multiRequestStAndModules($module);
                 return $this->display();
             }
         }
     }
     return $this->display();
 }
Exemplo n.º 9
0
 public static function redirect($url, $moved = false)
 {
     if ($moved) {
         HTTP::header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently', true, 301);
     }
     if (strlen($url) > 0) {
         HTTP::header("Location: " . $url);
     } else {
         HTTP::header("Location: " . Router::$URI);
     }
     exit;
 }
Exemplo n.º 10
0
 /**
  * 清除header
  * @return void
  */
 public static function clear()
 {
     self::$header = array();
 }