当前位置: 首页>>代码示例>>PHP>>正文


PHP check_status函数代码示例

本文整理汇总了PHP中check_status函数的典型用法代码示例。如果您正苦于以下问题:PHP check_status函数的具体用法?PHP check_status怎么用?PHP check_status使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Get_LatLng_From_Google_Maps

function Get_LatLng_From_Google_Maps($address)
{
    $url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&sensor=false';
    // Make the HTTP request
    $data = @file_get_contents($url);
    // Parse the json response
    $jsondata = json_decode($data, true);
    // If the json data is invalid, return empty array
    if (!check_status($jsondata)) {
        return array();
    }
    $LatLng = array('lat' => $jsondata["results"][0]["geometry"]["location"]["lat"], 'lng' => $jsondata["results"][0]["geometry"]["location"]["lng"]);
    return $LatLng;
}
开发者ID:prakashranjan,项目名称:pinsulin.in,代码行数:14,代码来源:convert_add_to_lat_lon.php

示例2: Get_Address_From_Google_Maps

function Get_Address_From_Google_Maps($lat, $lon)
{
    $url = "http://maps.googleapis.com/maps/api/geocode/json?latlng={$lat},{$lon}&sensor=false";
    // Make the HTTP request
    $data = @file_get_contents($url);
    // Parse the json response
    $jsondata = json_decode($data, true);
    // If the json data is invalid, return empty array
    if (!check_status($jsondata)) {
        return array();
    }
    $address = array('country' => google_getCountry($jsondata), 'province' => google_getProvince($jsondata), 'city' => google_getCity($jsondata), 'street' => google_getStreet($jsondata), 'postal_code' => google_getPostalCode($jsondata), 'country_code' => google_getCountryCode($jsondata), 'formatted_address' => google_getAddress($jsondata));
    return $address;
}
开发者ID:niloyniloy,项目名称:location-from-lat-lng,代码行数:14,代码来源:address_from_lat_lng.php

示例3: die

*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with eLabFTW.  If not, see <http://www.gnu.org/licenses/>.
*
********************************************************************************/
require_once 'inc/common.php';
// get $id from $_POST['id']
if (is_pos_int($_POST['id'])) {
    $id = $_POST['id'];
} else {
    die('Bad id value.');
}
// we only update status
if (isset($_POST['status'])) {
    $status = check_status($_POST['status']);
    $sql = "UPDATE experiments \n        SET status = :status \n        WHERE userid_creator = :userid \n        AND id = :id";
    $req = $bdd->prepare($sql);
    $result = $req->execute(array('status' => $status, 'userid' => $_SESSION['userid'], 'id' => $id));
    // we only update visibility
} elseif (isset($_POST['visibility'])) {
    // will return 'team' in case of wrong visibility
    $visibility = check_visibility($_POST['visibility']);
    $sql = "UPDATE experiments \n        SET visibility = :visibility \n        WHERE userid_creator = :userid \n        AND id = :id";
    $req = $bdd->prepare($sql);
    $result = $req->execute(array('visibility' => $visibility, 'userid' => $_SESSION['userid'], 'id' => $id));
    // or we update date, title, and body
} else {
    // get $title from $_POST['title']
    $title = check_title($_POST['title']);
    // get $body from $_POST['body']
开发者ID:studur,项目名称:elabchem,代码行数:31,代码来源:quicksave.php

示例4: check_timestamp

        ?>
</td>
        <td><?php 
        echo check_timestamp($item['rdb_last_save_time']);
        ?>
</td>
        <td><?php 
        echo check_value($item['rdb_last_bgsave_status']);
        ?>
</td>
        <td><?php 
        echo $item['rdb_last_bgsave_time_sec'];
        ?>
</td>
        <td><?php 
        echo check_status($item['aof_enabled']);
        ?>
</td>
        <td><?php 
        if ($item['aof_enabled'] != 0) {
            echo round($item['aof_current_size'] / 1024 / 1024, 2);
        } else {
            echo "---";
        }
        ?>
</td>
        <td><?php 
        if ($item['aof_enabled'] != 0) {
            echo check_value($item['aof_last_bgrewrite_status']);
        } else {
            echo "---";
开发者ID:heafod,项目名称:RedisMM,代码行数:31,代码来源:redis_persistence_status.php

示例5: define

// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
define('PHPWG_ROOT_PATH', './');
include_once PHPWG_ROOT_PATH . 'include/common.inc.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_GUEST);
if (empty($_GET['q'])) {
    redirect(make_index_url());
}
$search = array();
$search['q'] = $_GET['q'];
$query = '
SElECT id FROM ' . SEARCH_TABLE . '
  WHERE rules = \'' . addslashes(serialize($search)) . '\'
;';
$search_id = array_from_query($query, 'id');
if (!empty($search_id)) {
    $search_id = $search_id[0];
    $query = '
UPDATE ' . SEARCH_TABLE . '
  SET last_seen=NOW()
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:qsearch.php

示例6: define

// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
//----------------------------------------------------------- include
define('PHPWG_ROOT_PATH', './');
include_once PHPWG_ROOT_PATH . 'include/common.inc.php';
// +-----------------------------------------------------------------------+
// | Check Access and exit when user status is not ok                      |
// +-----------------------------------------------------------------------+
check_status(ACCESS_FREE);
//----------------------------------------------------------- user registration
if (!$conf['allow_user_registration']) {
    page_forbidden('User registration closed');
}
trigger_notify('loc_begin_register');
if (isset($_POST['submit'])) {
    if (!verify_ephemeral_key(@$_POST['key'])) {
        set_status_header(403);
        $page['errors'][] = l10n('Invalid/expired form key');
    }
    if (empty($_POST['password'])) {
        $page['errors'][] = l10n('Password is missing. Please enter the password.');
    } else {
        if (empty($_POST['password_conf'])) {
            $page['errors'][] = l10n('Password confirmation is missing. Please confirm the chosen password.');
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:31,代码来源:register.php

示例7: check_date

    $to = check_date($_REQUEST['to']);
} else {
    $to = '';
}
if (isset($_REQUEST['tags']) && !empty($_REQUEST['tags'])) {
    $tags = filter_var($_REQUEST['tags'], FILTER_SANITIZE_STRING);
} else {
    $tags = '';
}
if (isset($_REQUEST['body']) && !empty($_REQUEST['body'])) {
    $body = check_body($_REQUEST['body']);
} else {
    $body = '';
}
if (isset($_REQUEST['status']) && !empty($_REQUEST['status'])) {
    $status = check_status($_REQUEST['status']);
} else {
    $status = '';
}
if (isset($_REQUEST['rating']) && !empty($_REQUEST['rating'])) {
    if ($_REQUEST['rating'] === 'no') {
        $rating = '0';
    } else {
        $rating = intval($_REQUEST['rating']);
    }
} else {
    $rating = '';
}
if (isset($_REQUEST['owner']) && !empty($_REQUEST['owner']) && is_pos_int($_REQUEST['owner'])) {
    $owner_search = true;
    $owner = $_REQUEST['owner'];
开发者ID:studur,项目名称:elabchem,代码行数:31,代码来源:search.php

示例8: session_start

require_once "userlogin.php";
session_start();
// IMPORTANT VARIABLES
$UserId = $_SESSION['user_id'];
$BookingDate = $_POST['bookDate'];
$TableNumber = $_POST['bookTables'];
$TimeFrame = $_POST['bookTime'];
if (isset($_POST['submitBook'])) {
    if (empty($_POST['bookSeats'])) {
        $bookSeatsError = "You need to select the number of seats";
    }
    if (empty($_POST['bookTime'])) {
        $bookTimeError = "You need to select the time frame for your reservation";
    }
    if (empty($_POST['bookDate'])) {
        $bookTimeError = "You need to select a date for your reservation";
    }
    function check_status($BookingDate, $TimeFrame, $SelectedTableID)
    {
        $sql = "SELECT table_id FROM booking WHERE reservation_date='{$BookingDate}' AND booking_timeframe='{$TimeFrame}' AND table_id='{$SelectedTableID}' ";
        $result = mysqli_query(mysqli_connect(DB_SERVER, DB_USER, DB_PASS, DB_NAME), $sql);
        if (mysqli_num_rows($result) > 0) {
            return 1;
        } else {
            return 0;
        }
    }
    if (check_status($BookingDate, $TimeFrame, $SelectedTableID) == 1) {
        redirect_to('../reservation.php?MiD=10');
    }
}
开发者ID:Mterkelsen,项目名称:Torben-Auto,代码行数:31,代码来源:booking.php

示例9: do_start

function do_start($server, $dedi_cfg, $config)
{
    $pid_file = $config->pid . $dedi_cfg->masterserver_account->login . ".txt";
    if (file_exists($pid_file)) {
        check_status($server, $dedi_cfg, $config);
        throw new Exception('pid file already exist');
    }
    echo color("\n Starting server", "green") . $dedi_cfg->masterserver_account->login . " (" . $dedi_cfg->system_config->xmlrpc_port . ")\n\n";
    if (!file_exists($config->dedicated->exec . $config->dedicated->tracks . "MatchSettings/" . $dedi_cfg->masterserver_account->login . ".txt")) {
        throw new Exception($config->dedicated->exec . $config->dedicated->tracks . "MatchSettings/" . $dedi_cfg->masterserver_account->login . ".txt does not exist");
    }
    /* command line */
    $cmd = "cd " . $config->dedicated->exec . "; ./TrackmaniaServer /dedicated_cfg=dedicated_cfg." . $dedi_cfg->masterserver_account->login . ".txt /game_settings=MatchSettings/" . $dedi_cfg->masterserver_account->login . ".txt";
    $pid_dump = system($cmd);
    $find = "pid=";
    $matches = explode(' ', substr($pid_dump, strpos($pid_dump, $find), 50));
    $pid = substr($matches[0], 4);
    $console = substr($matches[1], 8, -2);
    $data = array("pid" => intval($pid), "console" => intval($console), "xmlrpc_port" => intval($dedi_cfg->system_config->xmlrpc_port));
    /*
    	
    	if (!mkdir($config->pid, 0, true)) {
        throw new Exception("unable to create pid dir");
    	}
    */
    file_put_contents($config->pid . $dedi_cfg->masterserver_account->login . ".txt", json_encode($data));
    echo "\n";
    sleep(2);
    check_status($server, $dedi_cfg, $config);
}
开发者ID:norico,项目名称:tms3,代码行数:30,代码来源:tms.php

示例10: check_status

<?php

$check_system = true;
$check_result = check_status();
foreach ($check_result as $name => $value) {
    if ($value !== true) {
        $check_system = false;
        break;
    }
}
if ($check_system === false) {
    ?>
	<h1>安装环境检查结果</h1>
	<table class="table table-condensed">
		<thead>
		<tr>
			<th>组件</th>
			<th>状态</th>
		</tr>
		</thead>
		<tbody>
		<?php 
    foreach ($check_result as $name => $value) {
        ?>
			<tr class="<?php 
        echo $value ? "success" : "danger";
        ?>
">
				<td><?php 
        echo $name;
        ?>
开发者ID:ttym7993,项目名称:Linger,代码行数:31,代码来源:check_system.php

示例11: Smarty_NM

         }
     }
     $b = $j % 2;
     $bgcolor = '';
     if ($b == 0) {
         $bgcolor = '#B8E7FF';
     }
     $table_data = new Smarty_NM();
     if ($j == 0) {
         $table_selector = $table_data->fetch("dashboard_header_location.tpl");
     }
     $action = sprintf("show_dashboard.php?group=0&lokatie=%s", $field_location->lokatie);
     $table_data->assign("bgcolor", $bgcolor);
     $table_data->assign("location", $field_location->lokatie);
     $table_data->assign("datetime", $field_location->creation_time);
     $status_array = check_status($qc_status);
     $table_data->assign("status_img", $status_array['img']);
     $table_data->assign("status_txt", $status_array['txt']);
     if (!empty($gewenste_processen)) {
         if (!$qc_freq_status) {
             $table_data->assign("qc_frequency", "1 of meerdere qc's te laat");
             $table_data->assign("waarde_class", "table_data_red");
         } else {
             $table_data->assign("qc_frequency", "ok");
             $table_data->assign("waarde_class", "table_data_green");
         }
     }
     $table_data->assign("action_location", $action);
     $table_selector .= $table_data->fetch("dashboard_row_location.tpl");
     $j++;
 }
开发者ID:JaapGroen,项目名称:WAD_Interface,代码行数:31,代码来源:show_dashboard.php

示例12: gw_waitForStartup

function gw_waitForStartup()
{
    $xml_parser = xml_parser_create();
    xml_set_element_handler($xml_parser, "startElement", "endElement");
    $kannelSmscOnlineStatus = "online";
    $kannelStatusUrl = loadKannelStatusUrl();
    // first get the total number of SMSCs
    $kannelStatusXml = file_get_contents($kannelStatusUrl);
    $ids = explode(' ', get_smscids('', $kannelStatusXml));
    $numIds = count($ids);
    // now keep waiting until the number of
    // online SMSCs equals the total number
    //
    echo "waiting...";
    while ($numIds != check_status($kannelSmscOnlineStatus, $kannelStatusXml)) {
        echo ".";
        sleep(5);
        $kannelStatusXml = file_get_contents($kannelStatusUrl);
    }
    echo "\n";
    xml_parser_free($xml_parser);
}
开发者ID:laiello,项目名称:ya-playsms,代码行数:22,代码来源:fn.php

示例13: round

        ?>
</td>
        <td><?php 
        echo $item['db_md5sum'];
        ?>
</td-->
        <td><?php 
        echo round($item['db_size'] / 1024 / 1024, 2);
        ?>
</td>
        <td><?php 
        echo check_status($item['suc_flag']);
        ?>
</td>
        <td><?php 
        echo check_status($item['del_flag']);
        ?>
</td>
        <td><?php 
        echo $item['date'];
        ?>
</td>
        <td><?php 
        echo $item['modify_time'];
        ?>
</td>
    </tr>
 <?php 
    }
    ?>
  <!--tr>
开发者ID:heafod,项目名称:RedisMM,代码行数:31,代码来源:history.php

示例14: substr

 // Generate the unique name. Keep generating new names until one that is not in use is found.
 do {
     // Create a random seed by taking the first 8 characters of an MD5 hash of a concatenation of the current UNIX epoch time and the current server process ID.
     $seed = substr(md5(uniqid("")), 0, 8);
     // Assemble the file path.
     $path_to_image = './' . $CONFIG['fullpath'] . 'edit/' . $prefix . $seed . '.' . $suffix;
 } while (file_exists($path_to_image));
 // Create a holder called $tempname.
 $tempname = $prefix . $seed . '.' . $suffix;
 // The file name $path_to_image has been created. We must prepare to download the resource. First, we will attemt to detect the status code for the resource.
 // Open a stream to the resource.
 $fp = fopen($URI_name, "rb");
 // Check to see if the resource was opened.
 if (!$fp) {
     // Attempt to get the status of the resource.
     $response = check_status($URI_name);
     // Try to parse header if we were able to get a response.
     if ($response) {
         if (strstr($response, '401')) {
             // 401 Unauthorized - Authorization needed to obtain resource. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_401']);
         } elseif (strstr($response, '402')) {
             // 402 Payment Required -  Where's the cash? :-) Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_402']);
         } elseif (strstr($response, '403')) {
             // 403 Forbidden - No permission to access the resource. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_403']);
         } elseif (strstr($response, '404')) {
             // 404 Not Found - The resource is missing. Note an error.
             $URI_failure_array[] = array('failure_ordinal' => $failure_ordinal, 'URI_name' => $URI_name, 'error_code' => $lang_upload_php['http_404']);
         } elseif (strstr($response, '500')) {
开发者ID:phill104,项目名称:branches,代码行数:31,代码来源:upload.php

示例15: format_mbytes

        ?>
</td>
        <td><?php 
        echo $item['mem_bits'];
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_resident']);
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_virtual']);
        ?>
</td>
        <td><?php 
        echo check_status($item['mem_supported']);
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_mapped']);
        ?>
</td>
        <td><?php 
        echo format_mbytes($item['mem_mappedWithJournal']);
        ?>
</td>
        <td><a href="<?php 
        echo site_url('mongodb/chart/' . $item['server_id']);
        ?>
"><img src="./images/chart.gif"/></a></a></td>
     </tr>
开发者ID:hisery,项目名称:Lepus-1,代码行数:31,代码来源:memory.php


注:本文中的check_status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。