本文整理汇总了PHP中getStatus函数的典型用法代码示例。如果您正苦于以下问题:PHP getStatus函数的具体用法?PHP getStatus怎么用?PHP getStatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getStatus函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStatus
function getStatus($wait = false, $i = 0)
{
global $_dev;
$t = wpa_cli("status");
if (trim($t) == "" || preg_match("/(Failed to connect)/i", $t)) {
_l("wpa_supplicant not running, trying to start...");
start_wpa_supplicant();
sleep(1);
return getStatus();
} else {
$v = parseVars($t);
if ($wait) {
if ($v["wpa_state"] != "COMPLETED") {
_l("wpa_state = {$v["wpa_state"]} - retrying");
sleep(1);
$i++;
if ($i >= 20) {
return $v;
} else {
return getStatus(true, $i);
}
} else {
return $v;
}
} else {
return $v;
}
}
}
示例2: transferSettingsToTable
function transferSettingsToTable()
{
$settings_section = db_get_row("SELECT section_id FROM ?:settings_sections WHERE type = 'ADDON' AND name = 'hybrid_auth'");
$settings = db_get_array("SELECT * FROM ?:settings_objects WHERE section_id = " . $settings_section['section_id']);
$companies = db_get_array("SELECT company_id FROM ?:companies;");
$_settings = array();
foreach ($settings as $setting) {
$_settings[$setting['name']] = $setting;
}
$settings = $_settings;
if (!empty($settings)) {
foreach ($settings as $setting) {
if (strpos($setting['name'], '_status')) {
$provider_id = str_replace('_status', '', $setting['name']);
foreach ($companies as $company_data) {
list($status, $is_vendor) = getStatus($provider_id, $settings, $company_data['company_id']);
if ($status == 'Y') {
$app_id = getSetting($provider_id, 'id', $settings, $company_data['company_id'], $is_vendor);
if (empty($app_id)) {
$app_id = getSetting($provider_id, 'key', $settings, $company_data['company_id'], $is_vendor);
}
$secret_key = getSetting($provider_id, 'secret', $settings, $company_data['company_id'], $is_vendor);
$public_key = getSetting($provider_id, 'public', $settings, $company_data['company_id'], $is_vendor);
db_query("INSERT INTO ?:hybrid_auth_providers SET " . "provider = '" . $provider_id . "'" . ", company_id = " . $company_data['company_id'] . ", app_id = '" . $app_id . "'" . ", app_secret_key = '" . $secret_key . "'" . ", app_public_key = '" . $public_key . "'" . ", status = 'A'" . " ON DUPLICATE KEY UPDATE provider_id = VALUES(provider_id)");
}
}
}
}
}
}
示例3: github
function github($format)
{
// location of cached file
$file = 'assets/cache/contributors.json';
// whatever this does, but it works
stream_context_set_default(array("http" => array("header" => "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9")));
// update cached file if it's older than half a day
if (time() - filemtime($file) > 3600 * 12) {
// || $_GET['forcerefresh']) {
// get most recent json data
$url = 'https://api.github.com/repos/thm/uinames/contributors?per_page=100';
// check status
if (getStatus($url) == 200) {
// update cached file
$data = file_get_contents($url);
file_put_contents($file, $data, LOCK_EX);
} else {
$data = file_get_contents($file);
}
// prepare fresh data for implementation
$data = json_decode($data, true);
} else {
// prepare cached data for implementation
$data = json_decode(file_get_contents($file), true);
}
// shuffle people up so they're in a different spot every time
shuffle($data);
// loop: render faces
for ($i = 0; $i < count($data); $i++) {
$needles = ['$href', '$img', '$user', '$contributions'];
$details = [$data[$i]['html_url'], $data[$i]['avatar_url'], $data[$i]['login'], $data[$i]['contributions']];
echo str_replace($needles, $details, $format);
}
}
示例4: run
function run()
{
$status = getStatus();
for ($i = 1; $i < 20; $i++) {
$currentFile = 'Problem' . $i . '.c';
$programSource = file_get_contents($currentFile);
// replace some stuff that is not needed at all
$preprocessedSource = str_replace('#include <stdio.h>', '', $programSource);
$preprocessedSource = str_replace('#include <assert.h>', '', $preprocessedSource);
$preprocessedSource = str_replace('#include <math.h>', '', $preprocessedSource);
$preprocessedSource = str_replace(': assert(0);', ':;', $preprocessedSource);
$preprocessedSource = 'extern int __VERIFIER_nondet_int();' . $preprocessedSource;
$preprocessedSource = replaceMain($preprocessedSource);
// default error labels (0 - 59)
for ($j = 0; $j < 60; $j++) {
$finalProgramSource = setErrorLabel($j, $preprocessedSource);
$state = 'unknown';
if (isset($status[$i][$j])) {
$state = $status[$i][$j];
}
file_put_contents(getNewFileName($i, $j, $state), $finalProgramSource);
}
// global error label
$state = 'unknown';
if (isset($status[$i][$j])) {
$state = $status[$i][$j];
}
$finalProgramSource = str_replace('globalError:;', 'ERROR: goto ERROR;', $preprocessedSource);
file_put_contents(getNewFileName($i, 60, $state), $finalProgramSource);
}
}
示例5: getControls
function getControls($entity, $type)
{
global $ENTRADA_TEMPLATE;
$controls_file = $ENTRADA_TEMPLATE->absolute() . "/modules/common/mspr/controls.xml";
$control_template = new Template($controls_file);
$user = $entity->getUser();
$user_id = $user->getID();
$control_bind = array("user_id" => $user_id, "entity_id" => $entity->getID(), "image_dir" => ENTRADA_URL . "/images", "form_url" => ENTRADA_URL . "/admin/users/manage/students?section=mspr&id=" . $user_id);
$controls = array();
switch ($type) {
//the differences below are due to the fact that students can only edit approvable items, while staff can only edit non-approvable items
case "admin":
if ($entity instanceof Approvable) {
$status = getStatus($entity);
switch ($status) {
case 'approved':
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "unapprove"));
break;
case 'unapproved':
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "reject"));
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "approve"));
break;
case 'rejected':
case 'rejected_reason':
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "approve"));
break;
}
} else {
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "remove"));
}
if ($entity instanceof Editable) {
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "edit"));
}
break;
case "public":
//fall through
//fall through
default:
if ($entity instanceof Approvable) {
if ($entity instanceof Editable) {
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "edit"));
}
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "remove"));
}
if ($entity instanceof Observership) {
if ($entity->getStart() >= time()) {
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "remove"));
$controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "edit"));
}
}
break;
}
$control_content = implode("\n", $controls);
if ($control_content) {
$control_set_file = $ENTRADA_TEMPLATE->absolute() . "/modules/common/mspr/control_set.xml";
$control_set_template = new Template($control_set_file);
$control_set_bind = array("controls" => $control_content);
return $control_set_template->getResult($control_set_bind, array("lang" => DEFAULT_LANGUAGE));
}
}
示例6: get_status_list
function get_status_list($target = null)
{
$states = array();
$result = '';
$target = isset($target) ? $target : get_username();
// Default to showing own status.
$statuses = getStatus($target);
$health = getHealth($target);
if ($health < 1) {
$states[] = "Dead";
} else {
// *** Other statuses only display if not dead.
if ($health < 80) {
$states[] = "Injured";
} else {
$states[] = "Healthy";
}
if ($statuses['Stealth']) {
$states[] = "Stealthed";
}
if ($statuses['Poison']) {
$states[] = "Poisoned";
}
if ($statuses['Frozen']) {
$states[] = "Frozen";
}
}
return $states;
}
示例7: stopTool
function stopTool()
{
if (getStatus() == "running") {
//当脚本未执行态的时候才能执行stop命令
echo "wait for command stop ...<br>";
system(STOP);
system("echo stopped > ../status.txt");
echo "stopped...";
return TRUE;
} else {
echo "<br/>Already stoped, no need to stop again.<br/>";
return FALSE;
}
}
示例8: getInfo
/**
* Get info about the current database
*
* @return unknown
*/
public function getInfo()
{
$response = Sopha_Http_Request::get($this->_db_uri);
if (!$response->isSuccess()) {
require_once 'Sopha/Db/Exception.php';
switch ($response->getStatus()) {
case 404:
throw new Sopha_Db_Exception("Database does not exist");
break;
default:
throw new Sopha_Db_Exception("Unexpected response from server: " . "{$response->getStatus()} {$response->getMessage()}", $response > getStatus());
break;
}
}
return $response->getDocument();
}
示例9: getOrders
function getOrders($companyID)
{
global $conn;
if ($stmtOrders = $conn->prepare("SELECT o.`orde_id`, o.`Users_user_id`, o.`orde_price`, o.`orde_status`, o.`orde_stars`, o.`orde_address`, ohp.`Products_prod_id`, p.`prod_description`, p.`prod_price`, u.`user_name` FROM orders o, orders_has_products ohp, products p, users u WHERE o.`Companies_comp_id`=? AND ohp.`Orders_orde_id`=o.`orde_id` AND p.`prod_id`=ohp.`Products_prod_id` AND u.`user_id`=o.`Users_user_id` ORDER BY o.`orde_id` DESC")) {
$stmtOrders->bind_param("i", $companyID);
$stmtOrders->execute();
$stmtOrders->bind_result($orderID, $orderUserID, $orderPrice, $orderStatus, $orderStars, $orderAddress, $productID, $productDescription, $productPrice, $userName);
$stmtOrders->store_result();
while ($stmtOrders->fetch()) {
$statusClass = getStatusClass($orderStatus);
$orderStatus = getStatus($orderStatus);
$orderStars = getStars($orderStars);
echo "<tr class=\"{$statusClass}\">\n\n <td>{$orderID}</td>\n\n <td class=\"text-center\">{$userName}</td>\n\n <td>{$productDescription}</td>\n\n <td class=\"text-center\">" . $orderPrice / $productPrice . "</td>\n\n <td class=\"text-right\">R\$ " . number_format($orderPrice, 2, ',', ' ') . "</td>\n\n <td class=\"text-center\">{$orderStatus}</td>\n\n <td class=\"text-center\">{$orderStars}</td>\n\n <td>{$orderAddress}</td>\n\n <td class=\"text-center\"><a class=\"btn btn-primary btn-xs\" href=\"../../controllers/sendOrder.php?order={$orderID}\" role=\"button\" data-toggle=\"modal\" data-target=\"#order\">Enviar</a></td>\n\n </tr>";
}
} else {
echo "Falha na conexão: " . $conn->error;
}
}
示例10: index
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
$clients = $this->client->count();
$invoices = $this->invoice->count();
$estimates = $this->estimate->count();
$products = $this->product->count();
$recentInvoices = $this->invoice->with('client')->limit(10)->get();
foreach ($recentInvoices as $count => $invoice) {
$recentInvoices[$count]['totals'] = $this->invoice->invoiceTotals($invoice->id);
}
$recentEstimates = $this->estimate->with('client')->limit(10)->get();
foreach ($recentEstimates as $count => $invoice) {
$recentEstimates[$count]['totals'] = $this->estimate->estimateTotals($invoice->id);
}
$invoice_stats['unpaid'] = $this->invoice->where('status', getStatus('label', 'unpaid'))->count();
$invoice_stats['paid'] = $this->invoice->where('status', getStatus('label', 'paid'))->count();
$invoice_stats['partiallyPaid'] = $this->invoice->where('status', getStatus('label', 'partially paid'))->count();
$invoice_stats['overdue'] = $this->invoice->where('status', getStatus('label', 'overdue'))->count();
return view('home', compact('clients', 'invoices', 'products', 'estimates', 'recentInvoices', 'recentEstimates', 'invoice_stats'));
}
示例11: runlike
function runlike($DB)
{
$cookie = "";
$status = getStatus($DB);
$uid = $status['cur'];
$user = $DB->Query("tl_sid", "uid", $uid);
$qq = $user['qq'];
$sid = $user['sid'];
$re = '/href="(http:\\/\\/blog[0-9]*?.z.qq.com\\/like.*?)">赞/';
$url = "http://ish.z.qq.com/infocenter_v2.jsp?B_UID=" . $qq . "&sid=" . $sid . "&g_ut=1";
$page = url_fetch($url);
preg_match_all($re, $page, $matches);
$ia = count($matches[1]);
for ($i = 0; $i < $ia; $i++) {
sleep(5);
$cookie2 = like_click($matches[1][$i], $url, $cookie);
if (!empty($cookie2)) {
$cookie = $cookie2;
}
}
echo "ok";
}
示例12: sec_session_start
<?php
// *** include require setting files ***
include_once "lib/ini.setting.php";
include_once "ini.config.php";
include_once "ini.dbstring.php";
include_once "ctrl.admin.php";
sec_session_start();
include_once "mod.login.php";
include_once "ctrl.login.php";
// check user role and authentication
checkSession($_SESSION['sess_user_id']);
$sta = getStatus($db);
$rf = getRf($db);
$os = getOS($db);
$app = getApp($db);
?>
<html lang="en-US">
<head>
<meta charset="utf-8">
<link href="<?php
echo CSS;
?>
import.css" type="text/css" rel="stylesheet"/>
<link href="<?php
echo CSS;
?>
style.css" type="text/css" rel="stylesheet"/>
<script src="<?php
echo JS;
?>
示例13: getStatus
?>
</td>
<td><?php
echo $vo['fudaoyuan'];
?>
</td>
<td><?php
echo $vo['rxsj'];
?>
</td>
<td><?php
echo $vo['bysj'];
?>
</td>
<td class="text-center" ><?php
echo getStatus($vo['status']);
?>
</td>
<td><input type="checkbox" name="ids" class="j-icheck" value="<?php
echo $vo['id'];
?>
"></td>
<td>
<div class="mrg0A">
<a href="<?php
echo U('edit', array('id' => $vo['id']));
?>
" rel="editstudent<?php
echo $vo['id'];
?>
" class="btn small bg-blue" target="dialog" width="440px" height="400px" ><span class="button-content"><i class="glyph-icon icon-edit"></i> 编辑</span></a>
示例14: either
// boolean for attacking again
$target = $attackee = either(in('target'), in('attackee'));
$username = get_username();
// Pulls from an internal source.
$attacker = $username;
// *** Target's stats. ***
$attackee_health = getHealth($target);
$attackee_level = getLevel($target);
$attackee_str = getStrength($target);
$attackee_status = getStatus($target);
// *** Attacker's stats. ***
$attacker_health = getHealth($username);
$attacker_level = getLevel($username);
$user_turns = getTurns($username);
$attacker_str = getStrength($username);
$attacker_status = getStatus($username);
$class = getClass($username);
// *** Attack System Initialization ***
$starting_attackee_health = $attackee_health;
$starting_turns = $user_turns;
$killpoints = 0;
// *** Starting state for killpoints. ***
$attack_turns = 1;
// *** Default cost, will go to zero if an error prevents combat. ***
$required_turns = $attack_turns;
$level_check = $attacker_level - $attackee_level;
$what = "";
// *** This will be the attack type string, e.g. "duel". ***
$loot = 0;
$duel = in('duel') ? true : NULL;
$blaze = in('blaze') ? true : NULL;
示例15: getStatus
public function getStatus()
{
return getStatus($this->vo->uname);
}