コード例 #1
0
ファイル: cache_info.php プロジェクト: gangjun911/hhvm
apc_delete('key1');
echo "1 delete, 2 keys\n";
$info = apc_cache_info('user');
checkInfo($info, 20, 7, 2, true);
dumpKeys($info);
apc_add('key1', array(true, 10, 4.5678, 'hello', array('a' => 'b', 'c' => 'd'), 'and more'));
echo "add again, 3 keys\n";
$info = apc_cache_info('');
checkInfo($info, 100, 10, 3, true);
class C
{
}
apc_add('key3', new C());
echo "4 keys\n";
$info = apc_cache_info('user');
checkInfo($info, 110, 14, 4, true);
dumpKeys($info);
$info = apc_cache_info('filehits');
if ($info == null) {
    echo "error with filehits\n";
}
$info = apc_cache_info('whatever');
if ($info == null) {
    echo "error random cache info\n";
}
echo "done\n";
// the size values are a bit of a difficult thing to check so we use them
// // as sort of a lower bound. It's a weak check but unless it gets bad
// // it's a useful thing to check
function checkInfo($info, $valuesSize, $keysSize, $entriesCount, $checkList)
{
コード例 #2
0
ファイル: proposer.php プロジェクト: sebspas/Share2Go
    }
    $_POST['Hdep'] = $gg . ":" . $ii;
    if (!preg_match('/^[0-9]{1,2}$/', $Tab['prix']) || $Tab['prix'] > 100 || $Tab['prix'] < 0) {
        return "Prix invalide, il doit être compris entre 0 et 99.";
    }
    if (nbPlace($Tab['vehicule']) < $Tab['places']) {
        return "Vous ne pouvez proposer plus de places que votre voiture n'en posséde !";
    }
    return "NoError";
}
if ($_POST['send']) {
    list($villedep, $Pays) = explode(',', $_POST['villedep']);
    list($villearr, $Pays) = explode(',', $_POST['villearr']);
    $_POST['villedep'] = $villedep;
    $_POST['villearr'] = $villearr;
    $error = checkInfo($_POST);
    if ($error == "NoError") {
        $nocig = 1;
        if ($_POST['nocig'] != "nocig") {
            $nocig = 0;
        }
        $music = 1;
        if ($_POST['music'] != "music") {
            $music = 0;
        }
        $bag = 1;
        if ($_POST['bag'] != "bag") {
            $bag = 0;
        }
        $bavar = 1;
        if ($_POST['talk'] != "talk") {
コード例 #3
0
ファイル: cache_info.php プロジェクト: badlamer/hhvm
apc_delete('key1');
echo "1 delete, 2 keys\n";
$info = apc_cache_info('user');
checkInfo($info, 20, 7, 2, true);
dumpKeys($info);
apc_add('key1', array(true, 10, 4.5678, 'hello', array('a' => 'b', 'c' => 'd'), 'and more'));
echo "add again, 3 keys\n";
$info = apc_cache_info('');
checkInfo($info, 48, 10, 3, true);
class C
{
}
apc_add('key3', new C());
echo "4 keys\n";
$info = apc_cache_info('user');
checkInfo($info, 90, 14, 4, true);
dumpKeys($info);
$info = apc_cache_info('filehits');
if ($info == null) {
    echo "error with filehits\n";
}
$info = apc_cache_info('whatever');
if ($info == null) {
    echo "error random cache info\n";
}
echo "done\n";
// The size values are a bit of a difficult thing to check so we use them as
// sort of a lower bound. It's a weak check but unless it gets bad it's a
// useful thing to check.
function checkInfo($info, $valuesSize, $keysSize, $entriesCount, $checkList)
{
コード例 #4
0
ファイル: index.php プロジェクト: SnowySailor/CodeStuff
<?php

error_reporting(E_ALL);
if (isset($_REQUEST['username'])) {
    $con = new mysqli('localhost', 'root', 'rooty', 'glossary') or die(mysql_error());
    $salt = substr(uniqid(mt_rand(), true), 0, 25);
    $userInfo = array('username' => $_POST['username'], 'email' => $_POST['email'], 'password' => sha1($_POST['password'] . $salt), 'password_salt' => $salt, 'userType' => 2, 'time' => time(), 'verified' => 0);
    include "check.php";
    $allowCreate = checkInfo($userInfo);
    if (!mysql_error() && $allowCreate['result']) {
        $query = "INSERT INTO `users` (username, email, password_hash, user_type, creation_time, password_salt, verified) VALUES (?,?,?,?,?,?,?)";
        $stmt = $con->prepare($query);
        $stmt->bind_param('sssiisi', $userInfo['username'], $userInfo['email'], $userInfo['password'], $userInfo['userType'], $userInfo['time'], $userInfo['password_salt'], $userInfo['verified']);
        $stmt->execute();
        $userInfo['user_id'] = mysqli_insert_id($con);
        include "register.php";
        createUserVerify($userInfo);
    } else {
        if (!$allowCreate['result']) {
            $errorMessage = $allowCreate['error'];
        }
    }
}
?>
<!DOCTYPE HTML>
<html>
<head>
	<title>Gloasis Resgister</title>
	<link rel="stylesheet" tpye="text/css" href="stylesheet.css">
</head>
<body>
コード例 #5
0
ファイル: cache_info.php プロジェクト: ezoic/hhvm
apc_delete('key1');
echo "1 delete, 2 keys\n";
$info = apc_cache_info('user');
checkInfo($info, 20, 7, 2, true);
dumpKeys($info);
apc_add('key1', array(true, 10, 4.5678, 'hello', array('a' => 'b', 'c' => 'd'), 'and more'));
echo "add again, 3 keys\n";
$info = apc_cache_info('');
checkInfo($info, 48, 10, 3, true);
class C
{
}
apc_add('key3', new C());
echo "4 keys\n";
$info = apc_cache_info('user');
checkInfo($info, 85, 14, 4, true);
dumpKeys($info);
$info = apc_cache_info('filehits');
if ($info == null) {
    echo "error with filehits\n";
}
$info = apc_cache_info('whatever');
if ($info == null) {
    echo "error random cache info\n";
}
echo "done\n";
// The size values are a bit of a difficult thing to check so we use them as
// sort of a lower bound. It's a weak check but unless it gets bad it's a
// useful thing to check.
function checkInfo($info, $valuesSize, $keysSize, $entriesCount, $checkList)
{