本文整理匯總了PHP中Action函數的典型用法代碼示例。如果您正苦於以下問題:PHP Action函數的具體用法?PHP Action怎麽用?PHP Action使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Action函數的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DownloadBengou
function DownloadBengou($job)
{
$args = $job->workload();
list($bookid, $chapterid) = explode(",", $args);
//$bookid = "4182";
//$chapterid = 0005012703;
return Action(CBenGou::$siteid, $bookid, intval($chapterid));
}
示例2: DoDownload
function DoDownload($job)
{
$args = $job->workload();
list($bookid, $chapterid) = explode(",", $args);
//$bookid = "7_3283_1";
//$chapterid = 161405;
return Action($bookid, $chapterid);
}
示例3: DoDownload
function DoDownload($job)
{
sleep(17);
$args = $job->workload();
list($bookid, $chapterid) = explode(",", $args);
//$bookid = "4182";
//$chapterid = 0005012703;
return Action($bookid, intval($chapterid));
}
示例4: Action
/*
* @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 <service@mallmold.com>.
*/
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
示例5: Action
<?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']));
示例6: array
<?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'))));
示例7: Route
<?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;
示例8: Couple_Action
function Couple_Action($modelAction, $viewAction)
{
return array('model' => Action($modelAction), 'view' => Action($viewAction), 'couple_action' => true);
}
示例9: print_r
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) {
示例10: dbopen
<?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);
}
示例11: Action
<?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 <service@mallmold.com>.
*/
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');
}
}