Example #1
0
 public function condition(Request $request)
 {
     return $request->isPost() && $request->inVars("login") === Rhaco::def("generic.module.SimpleAuth@user") && md5(sha1($request->inVars("password"))) === Rhaco::def("generic.module.SimpleAuth@password");
 }
Example #2
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 #3
0
<?php

/**
 * 更新を監視してmxmlcする
 */
include_once dirname(__FILE__) . "/__settings__.php";
import("core.Command");
import("core.File");
import("core.Request");
$req = new Request();
$cmd = new Command();
$cmd->open(File::absolute(def("mxmlc@flex_bin"), "fcsh"), null, work_path("mxmlc_error"));
$src = new File(path("flex/src/" . $req->inVars("f", "index.mxml")));
$bin = path("flex/bin/" . $src->oname() . ".swf");
$lib = path("flex/lib/");
$rsl = path("flex/rsl/");
while (true) {
    $lib_last_update = $src_last_update = $rsl_last_update = $id = 0;
    $mxmlc = sprintf("mxmlc -output %s --file-specs %s ", $bin, $src);
    if ($lib_last_update < ($lib_update = File::last_update($lib, true))) {
        $lib_last_update = $lib_update;
        $files = array();
        foreach (File::ls($lib) as $f) {
            $files[] = $f->fullname();
        }
        $mxmlc .= "-library-path+=" . implode(",", $files) . " ";
    }
    if ($rsl_last_update < ($rsl_update = File::last_update($rsl, true))) {
        $rsl_last_update = $rsl;
        $files = array();
        foreach (File::ls($rsl) as $f) {