Example #1
0
File: Flow.php Project: hisaboh/w2t
 /**
  * phpinfoからattachする
  * @param string $path
  */
 public function attach_self($path)
 {
     $this->url($_SERVER["PHP_SELF"] . "/");
     if ($this->args() != null) {
         Log::disable_display();
         Http::attach(new File($path . $this->args()));
         exit;
     }
 }
Example #2
0
 /**
  * xmlとし出力する
  * @param string $encoding エンコード名
  * @param string $name ファイル名
  */
 public function output($encoding = null, $name = null)
 {
     Log::disable_display();
     header(sprintf('Content-Type: application/xml%s', empty($name) ? '' : sprintf('; name=%s', $name)));
     print $this->get($encoding);
     exit;
 }
Example #3
0
 /**
  * phpinfoからattachする
  * @param string $path
  */
 protected final function attach_self($path)
 {
     $this->media_url(Request::current_url() . '/');
     if ($this->args() != null) {
         Log::disable_display();
         Http::attach(new File($path . $this->args()));
         exit;
     }
 }
Example #4
0
 protected function __init__()
 {
     Log::disable_display();
     $this->add_module(new OpenpearAccountModule());
 }
Example #5
0
File: Rss.php Project: hisaboh/w2t
 /**
  * 出力する
  *
  * @param string $name
  */
 public function output($name = "")
 {
     Log::disable_display();
     header(sprintf("Content-Type: application/rss+xml; name=%s", empty($name) ? uniqid("") : $name));
     print $this->get(true);
     exit;
 }
Example #6
0
<?php

declare (ticks=1);
require dirname(__FILE__) . '/__settings__.php';
import('core.Log');
import('core.Request');
Log::disable_display();
import('Chat.ChatServer');
header('application/x-javascript');
$req = new Request();
$object_list = C(ChatMessage)->find_all(Q::gt('id', $req->inVars('since_id', 0)), Q::order('-id'));
if (count($object_list) > 0) {
    echo ChatServer::models_to_jsonp(array_reverse($object_list), $req->inVars('callback', 'callback'));
    exit;
}
$server = new ChatServer();
pcntl_signal(SIGTERM, array(&$server, 'models_json'));
pcntl_signal(SIGHUP, array(&$server, 'models_json'));
pcntl_signal(SIGUSR1, array(&$server, 'models_json'));
sleep(def('chat@timeout'));
Example #7
0
File: File.php Project: hisaboh/w2t
 /**
  * 標準出力に出力する
  */
 public function output()
 {
     Log::disable_display();
     if (empty($this->value) && @is_file($this->fullname)) {
         readfile($this->fullname);
     } else {
         print $this->value;
     }
     exit;
 }
Example #8
0
 /**
  * JSONPとして出力
  * @param mixied $var 対象の値
  * @param string $callback コールバック名
  * @param string $encode 文字エンコード
  */
 public static function output_jsonp($var, $callback = null, $encode = "UTF-8")
 {
     Log::disable_display();
     header("Content-Type: application/json; charset=" . $encode);
     print str_replace(array("\r\n", "\r", "\n"), array("\\n"), empty($callback) ? Text::to_json($var) : $callback . "(" . Text::to_json($var) . ");");
     exit;
 }
Example #9
0
 /**
  * リポジトリサーバの実行
  */
 public static function handler()
 {
     Log::disable_display();
     $request = new Request("_inc_session_=false");
     if (strpos($request->args(), "/check") === 0) {
         exit;
     }
     $repository = new Repository();
     self::lib($repository);
     self::app($repository);
     Object::C(__CLASS__)->call_module("repository", $repository);
     foreach ($repository->names as $type) {
         if (preg_match("/^\\/" . $type . "\\/download\\/(.+)\$/", $request->args(), $match)) {
             if (self::is_tgz($type, $match[1], $filename)) {
                 self::dl($filename);
             }
         }
         if (preg_match("/^\\/" . $type . "\\/state\\/(.+)\$/", $request->args(), $match)) {
             if (self::is_tgz($type, $match[1], $filename)) {
                 exit;
             }
         }
         if (preg_match("/^\\/" . $type . "\\/list\$/", $request->args(), $match)) {
             print self::read_xml($type);
             exit;
         }
         if (preg_match("/^\\/" . $type . "\\/list\\/json\$/", $request->args(), $match)) {
             if (Tag::setof($tag, self::read_xml($type))) {
                 Text::output_jsonp($tag, $request->in_vars("callback"));
             }
         }
     }
     Http::status_header(403);
     exit;
 }
Example #10
0
 /**
  * リダイレクトする
  * @param string $url リダイレクトするURL
  * @param mixed{} $vars query文字列として渡す変数
  */
 public static function redirect($url, array $vars = array())
 {
     Log::disable_display();
     if (!empty($vars)) {
         $requestString = self::query($vars);
         if (substr($requestString, 0, 1) == "?") {
             $requestString = substr($requestString, 1);
         }
         $url = sprintf("%s?%s", $url, $requestString);
     }
     Log::debug("redirect: " . $url);
     Log::flush();
     header("Location: " . $url);
     exit;
 }