function DownloadBengou($job) { $args = $job->workload(); list($bookid, $chapterid) = explode(",", $args); //$bookid = "4182"; //$chapterid = 0005012703; return Action(CBenGou::$siteid, $bookid, intval($chapterid)); }
function DoDownload($job) { $args = $job->workload(); list($bookid, $chapterid) = explode(",", $args); //$bookid = "7_3283_1"; //$chapterid = 161405; return Action($bookid, $chapterid); }
function DoDownload($job) { sleep(17); $args = $job->workload(); list($bookid, $chapterid) = explode(",", $args); //$bookid = "4182"; //$chapterid = 0005012703; return Action($bookid, intval($chapterid)); }
/* * @pageAction.php * Copyright (c)2013-2014 Mallmold Ecommerce(HK) Limited. * http://www.mallmold.com/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * More details please see: http://www.gnu.org/licenses/gpl.html * * If you want to get an unlimited version of the program or want to obtain * additional services, please send an email to <*****@*****.**>. */ require Action('common'); class pageAction extends commonAction { public function index() { $page_id = $this->model('urlkey')->getid('page_id'); if (!$page_id) { $this->_404(); return; } $page = $this->model('mdata')->table('pages')->where("id={$page_id}")->get(); if (!$page) { $this->_404(); return; } //parse tag
<?php function Action($url) { $title = $url; $caption = $url . 'のページ'; $text = 'これは' . $url . 'のページです'; return compact('title', 'caption', 'text'); } function View($params) { extract($params); include './layout.php'; } View(Action($_GET['url']));
<?php /* * Example routes * Ticket routes */ use actions; return array('Controller' => 'Ticket', 'first_pattern' => 'tickets{a}', 'GET' => array('id' => '[0-9]+'), 'pattern' => array(array('pattern' => 'tickets/'), array('pattern' => 'tickets/{page}', 'action' => Query('OnShow', 'page'), 'GET' => array('page' => '[0-9]+')), array('pattern' => 'tickets/add', 'action' => Action('onAdd'), 'event' => Form('form')), array('pattern' => 'tickets/edit/{id}', 'action' => Query('onEdit', 'id')), array('pattern' => 'tickets/delete{id}', 'action' => Query('onDelete', 'id')), array('pattern' => 'tickets/see/{id}', 'action' => Query('onShowTicket', 'id'))));
<?php /* Route example */ $route = new Route('example', 'Index'); // Creating a route with a controller, the model will be extracted by the getModel method $route->add(array('', 'index.html'), function () { // When the url is index.html -> call Closure echo 'Hello world'; }); $route->add(array('article-{id}.html', 'id' => '[0-9]+'), Query('getArticle', Get('id')), Action('showArticle')); // Calling model method getArticle and giving result to controller method showArticle $route->add(array('articles.html/{page?}', 'page' => '[0-9]+'), Query('getArticles', array(Get('page'), QUERY_ELSE => 0)), Action('showArticles')); // Then feeding the result to showArticles method $route->add('article-create', Permission(), Event('getFormEvent', array(Query('newArticle', Get('name')), Action('showArticle'), EVENT_ELSE => Action('writeArticle')))); // // If the form isn't completed, show the writeArticle form return $route;
function Couple_Action($modelAction, $viewAction) { return array('model' => Action($modelAction), 'view' => Action($viewAction), 'couple_action' => true); }
if (in_array($net["ip"], $servers)) { $ip = $net["ip"]; break; } } if (strlen($ip) < 1) { print_r("server ip error."); return -1; } $sites = array("ysts8" => 2); print_r("ip: {$ip}\n"); print_r("action: remove files\n"); list($files0, $files1) = ActionRemoveFile(); // remove pingshu8/ysts8 files print_r("action: add files\n"); $files2 = Action(); // add file to db print_r("------------------------------------------------------\n"); print_r("clean uri: {$files0}, remove: {$files1}\n"); print_r("add files: {$files2}\n"); print_r("------------------------------------------------------\n"); function Action() { global $db; global $ip; global $cols; global $sites; $num = 0; foreach ($sites as $sitename => $siteid) { $dirs = array("/ts/{$sitename}", "/ts2/{$sitename}", "/home/{$sitename}"); foreach ($dirs as $dir) {
<?php require "php/db.inc"; require "php/http.inc"; $db = dbopen("pingshu", "115.28.54.237"); if ($db->connect_errno) { echo "mysql error " . $db->connect->error; return; } if (count($argv) < 2) { print_r("please input server ip"); return -1; } Action($argv[1]); function Action($ip) { global $db; $sql = sprintf("select bookid, chapterid, uri from pingshu8"); $res = $db->query($sql); if (!$res) { print_r("Action failed: " . $db->error); return -1; } $chapters = array(); while ($row = $res->fetch_assoc()) { $bookid = $row["bookid"]; $chapterid = $row["chapterid"]; $uri = $row["uri"]; if (strlen($uri) > 0) { Download($ip, $bookid, $chapterid, $uri); }
<?php /* * @errorAction.php * Copyright (c)2013-2014 Mallmold Ecommerce(HK) Limited. * http://www.mallmold.com/ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * More details please see: http://www.gnu.org/licenses/gpl.html * * If you want to get an unlimited version of the program or want to obtain * additional services, please send an email to <*****@*****.**>. */ require_once Action('common'); class errorAction extends commonAction { public function __404($msg = '') { header("HTTP/1.1 404 Not Found"); $this->view['msg'] = $msg; $this->view('error/404.html'); } }