本文整理匯總了PHP中Web::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Web::get方法的具體用法?PHP Web::get怎麽用?PHP Web::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Web
的用法示例。
在下文中一共展示了Web::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: updateUpdate
function updateUpdate($param)
{
// This is sort of a hack... The ssl configuration of the ipaddress has to be reflected properly in the domain too. So the web objects are initialized, the ssl parameters are changed on the fly and synced again. All this is because, apache will refuse to start if the ssl files are missing, which is fucking terrible. (later)... Apache is actually ok. The whole damn problem is with iis. Be careful about the createExtraVariables. As for now, the web object doesn't create objects from the parent domain object, and thus web object will work indepnednely without the help of the domain parent object. Thus the parent of the web can anything. But if in the at any time in the future the web object starts needing any parameter from the domain, then this will have to be rewritten. Then the domain objects have to initialized first, then the web objects are initialized, and the web can be created only UNDER the domain, and not directly under this object.
global $gbl, $sgbl, $login, $ghtml;
$driverapp = $gbl->getSyncClass($this->__masterserver, $this->__readserver, 'web');
$olddom = $this->domain;
$newdom = $param['domain'];
if (!csb($newdom, "lxdummy") && !is_disabled($newdom)) {
$ip = gethostbyname($newdom);
if ($ip != $this->getParentO()->ipaddr) {
throw new lxexception("this_domain_does_not_resolve_to_this_ip", 'domain', $newdom);
}
}
$this->domain = $param['domain'];
$this->ipaddr = $this->getParentO()->ipaddr;
$this->setUpdateSubaction();
$this->write();
if ($olddom) {
$odo = new Web(null, $this->syncserver, $olddom);
$odo->get();
// Need to get the client here itself so that it won't run into problems later. You don't need the client anymore...
//$odo->getParentO()->getParentO();
if ($odo->dbaction !== 'add') {
$odo->setUpdateSubaction('fixipdomain');
$odo->was();
}
}
if ($olddom === $newdom) {
return;
}
if (is_disabled($newdom)) {
return;
}
$ndo = new Web(null, $this->syncserver, $newdom);
$ndo->get();
//$ndo->getParentO()->getParentO(); //you don't need client anymore..
$ndo->setUpdateSubaction('fixipdomain');
$ndo->was();
}
示例2: array
$this->response->status($code);
$this->response->headers->set("Content-Type", "application/json");
echo json_encode(array("errors" => array($err)));
}
function authed()
{
return isset($_SESSION["adminid"]);
}
}
$app = new Web(array("debug" => false));
$app->add(new Slim\Middleware\ContentTypes());
$app->notFound(function () use($app) {
echo "Requested resource not found";
});
$app->get("/", function () use($app) {
$app->redirect("/");
});
$app->get("/plans", function () use($app) {
if (!$app->authed()) {
$app->makeError("Access denied");
return;
}
$qres = mysql_query("SELECT * FROM `tblproducts` p WHERE p.`type` IN ( 'hostingaccount','reselleraccount') and p.`configoption1` != '' and p.`servertype` = 'cpanel';");
if ($qres === FALSE) {
$app->makeError("Unable to get the list of hosting packages");
return;
}
$plans = array();
while (($row = mysql_fetch_assoc($qres)) !== FALSE) {
$plans[] = array("id" => intval($row["id"]), "label" => $row["name"], "description" => $row["description"], "name" => $row["configoption1"], "limits" => array("ftp" => intval($row["configoption2"]), "disk" => intval($row["configoption3"]), "email" => intval($row["configoption4"]), "bandwidth" => intval($row["configoption5"]), "dedicated_ip" => onoffval($row["configoption6"]), "ssh" => onoffval($row["configoption7"]), "databases" => intval($row["configoption8"]), "cgi" => onoffval($row["configoption9"]), "subdomains" => intval($row["configoption10"]), "frontpage" => onoffval($row["configoption11"]), "parked" => intval($row["configoption12"]), "addon" => intval($row["configoption14"]), "overage" => strval($row["overagesenabled"][0]) === "1"));
}