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


PHP kill函数代码示例

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


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

示例1: search

function search($ds, $filter, $attributes)
{
    // Nous allons commencer par afficher des informations de bases concernant le domaine auquel on est connecté et son administrateur
    $dn = "dc=rBOX,dc=lan";
    //Domaine
    $filtre = "({$filter})";
    //Filtre de recherche
    $sr = ldap_search($ds, $dn, '(' . $filter . ')', $attributes);
    //On effectue la recherche
    if (!$sr) {
        echo '<p class="center red">Le serveur LDAP n\'a pas pu effectuer la recherche . Nous vous prions de nous excuser pour le désagrément.</p>';
        kill($ds);
        exit;
    }
    $info = ldap_get_entries($ds, $sr);
    //On récupère les résultats
    if (!$info) {
        echo '<p class="center red">Le serveur LDAP n\'a pas pu récupérer les résultats de la recherche . Nous vous prions de nous excuser pour le désagrément.</p>';
        kill($ds);
        exit;
    }
    return $info;
}
开发者ID:hillfias,项目名称:LDAPWebApp,代码行数:23,代码来源:index.php

示例2: Memuse

function Memuse($limit = 65, $sup = '')
{
    if (e(',dead1', 1)) {
        return;
    }
    static $i;
    if (!$sup) {
        $i++;
    }
    $sup = $i;
    #if(j9){echo"+";return;}#dev
    #Timelong();no recursion#if(j9)kill("+$mem>$limit $_ENV[args]");#dev
    $mem = Round(Memory_get_usage(1) / 1000000, 2);
    if ($mem == $_ENV['lastmemusage']) {
        return;
    }
    $_ENV['lastmemusage'] = $mem;
    $db = "Erreur : usage mémoire : {$mem} mo cause {$sup}";
    if ($sup) {
        $_ENV['Mem'][$sup] = $mem;
    }
    if ($mem > $limit) {
        e(',dead1');
        dbm("MemLeak:{$mem}@{$sup}@" . SU . pre($_ENV));
        $x = dbkt();
        $line = p3(print_r(end($x), 1));
        db($line);
        return $mem;
        kill($line);
    }
    return $mem;
}
开发者ID:Ben749,项目名称:racetrack,代码行数:32,代码来源:kernel.php

示例3: implode

<html><head><title>racetrack editor - <?php 
echo $title;
?>
</title>
<link rel="shortcut icon" type="image/png" href="/favicon.ico">
<link href="/style.css" rel="stylesheet"><link href="/?css" rel="stylesheet">
<script src="//cdn.ckeditor.com/4.5.7/standard<?php 
#basic|full
?>
/ckeditor.js"></script>
<title>Racetrack :: editor</title></head><body>
<div class=w50><div class=w50>
<?php 
echo implode(' - ', $f->dc());
if ($choices) {
    kill('' . $choices . '</div></div>');
}
?>


<form method=post action='?fi=<?php 
echo $fi;
?>
'>
<input name=id type=hidden value='<?php 
echo $id;
?>
'>
Title : <input name=title value='<?php 
echo $title;
?>
开发者ID:Ben749,项目名称:racetrack,代码行数:31,代码来源:editor.php

示例4: session_start

<?php

session_start();
$skip_login = true;
require_once 'functions.php';
$expiration = (int) $_GET['expiration'];
$get_hash = $_GET['hash'];
$hash = encrypt($expiration);
if ($hash != $get_hash && !$_GET['state']) {
    kill();
}
$expiration_date = date("Y-m-d", $expiration);
$yesterday = date("Y-m-d", strtotime(date("Y-m-d" . " -1day")));
if ($expiration_date < date("Y-m-d") && !$_GET['state']) {
    kill("Expiration date can not be before yesterday or after tomorrow");
}
if (LOCAL) {
    $redirect = 'http://ib.is/openstreets/register.php';
} else {
    $redirect = 'http://friends.openstreets.co.za/register.php';
}
if ($_GET['state']) {
    if ($_GET['state'] != $_SESSION['state']) {
        $error = "Invalid session";
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://www.googleapis.com/oauth2/v3/token");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "code={$_GET['code']}&client_id={$client_id}&client_secret={$client_secret}&redirect_uri={$redirect}&grant_type=authorization_code");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $output = curl_exec($ch);
开发者ID:OpenStreetsCapeTown,项目名称:backoffice,代码行数:31,代码来源:register.php

示例5: header

<?php

header("Content-Type: text/plain");
/**
 * delete a group
 * @param : group name [required]
 * @return : success/fail message (txt)
 * */
if (!empty($_POST['group'])) {
    // LDAP ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    // On a besoin de récupérer les infos sur les groupes pour le formulaire/ pour ajouter un nouvel utilisateur
    include '../ldap/index.php';
    $ds = connectionLDAP();
    // LDAP ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    $name = $_POST['group'];
    $dn = "cn={$name},ou=groups,dc=rBOX,dc=lan";
    // Supression de l'entrée de l'annuaire
    $r = ldap_delete($ds, $dn);
    if ($r) {
        echo 'Le groupe a été correctement supprimé.';
    } else {
        echo 'Données non conformes.';
    }
    kill($ds);
}
开发者ID:hillfias,项目名称:LDAPWebApp,代码行数:25,代码来源:deleteGroup.php

示例6: array

     }
 }
 // Step 2 - Execute the program, only if there is no compile error
 $descriptorspec = array(0 => array("file", "{$cwd}input.txt", "r"), 1 => array("file", "{$cwd}output.txt", "w"), 2 => array("file", "{$cwd}error-output.txt", "a"));
 chmod($cwd . 'myfile.out', 0777);
 // Start the Counter
 $start_time = time();
 // Start the program execution
 $process = proc_open("ulimit -Sv {$memory_limit};\nLD_PRELOAD={$path}/sandbox/EasySandbox.so {$cwd}/myfile.out", $descriptorspec, $pipes, $cwd, $env);
 // Time to sleep, for the program to complete
 usleep($time_limit * 1000);
 // Now awake up to see if the execution is complete
 $status = proc_get_status($process);
 if ($status['running']) {
     // If the process is still running, terminate it
     kill($status['pid']);
     proc_terminate($process);
     echo json_encode(array('type' => 'ERROR', 'content' => 'Time limit exceeded'));
     removeFiles();
     exit;
 }
 if (is_resource($process)) {
     // It is important that you close any pipes before calling
     // proc_close in order to avoid a deadlock
     $return_value = proc_close($process);
     $end_time = time();
     // echo "Total Time taken - " . date('H:m:s', $end_time - $start_time);
     //		echo $return_value;
     $command_output = str_replace("\r\n", "\n", rtrim(trim(file_get_contents($cwd . 'output.txt'))));
     if (substr($command_output, 0, 26) == "<<entering SECCOMP mode>>\n") {
         $command_output = substr($command_output, 26);
开发者ID:ATofighi,项目名称:PHP-CPP-Compile,代码行数:31,代码来源:compile.php

示例7: deathnote

function deathnote($itmd = 0, $dnname = '', $dndeath = '', $dngender = 'm', $dnicon = 1, $sfn)
{
    global $db, $tablepre, $log, $killnum, $mode, $achievement;
    global ${'itm' . $itmd}, ${'itms' . $itmd}, ${'itmk' . $itmd}, ${'itme' . $itmd}, ${'itmsk' . $itmd};
    $dn =& ${'itm' . $itmd};
    $dnk =& ${'itmk' . $itmd};
    $dne =& ${'itme' . $itmd};
    $dns =& ${'itms' . $itmd};
    $dnsk =& ${'itmsk' . $itmd};
    $mode = 'command';
    if ($dn != '■DeathNote■' && $dn != '四面亲手制作的■DeathNote■') {
        $log .= '道具使用错误!<br>';
        return;
    } elseif ($dns <= 0) {
        $dn = $dnk = $dnsk = '';
        $dne = $dns = 0;
        $log .= '道具不存在!<br>';
        return;
    }
    if (!$dnname) {
        return;
    }
    if ($dnname == $sfn && $dn != '四面亲手制作的■DeathNote■') {
        $log .= "你不能自杀。<br>";
        return;
    }
    if (!$dndeath) {
        $dndeath = '心脏麻痹';
    }
    if ($dn == '四面亲手制作的■DeathNote■') {
        $dndeath = "使用了天然呆四面的假冒伪劣■DeathNote■";
    }
    //echo "name=$dnname,gender = $dngender,icon=$dnicon,";
    if ($dn != '四面亲手制作的■DeathNote■') {
        $result = $db->query("SELECT * FROM {$tablepre}players WHERE name='{$dnname}' AND type = 0");
    } else {
        $result = $db->query("SELECT * FROM {$tablepre}players WHERE name='{$sfn}' AND type = 0");
    }
    if (!$db->num_rows($result)) {
        $log .= "你使用了■DeathNote■,但是什么都没有发生。<br>哪里出错了?<br>";
    } else {
        $edata = $db->fetch_array($result);
        if (($dngender != $edata['gd'] || $dnicon != $edata['icon']) && $dn != '四面亲手制作的■DeathNote■') {
            $log .= "你使用了■DeathNote■,但是什么都没有发生。<br>哪里出错了?<br>";
        } else {
            if ($dn != '四面亲手制作的■DeathNote■') {
                $log .= "你将<span class=\"yellow b\">{$dnname}</span>的名字写在了■DeathNote■上。<br>";
                $log .= "<span class=\"yellow b\">{$dnname}</span>被你杀死了。";
                include_once GAME_ROOT . './include/state.func.php';
                kill('dn', $dnname, 0, $edata['pid'], $dndeath);
                $killnum++;
            } else {
                $log .= "你将<span class=\"yellow b\">{$dnname}</span>的名字写在了■DeathNote■上。<br>";
                $log .= "但就在这时,你突然感觉一阵晕眩。<br>你失去了意识。<br>";
                $log .= "<span class='lime'>“这张■DeathNote■似乎制作不合格呢,还真是对不起呢……”<br></span>";
                include_once GAME_ROOT . './include/state.func.php';
                death('fake_dn', '', 0, $dndeath);
                $killnum++;
            }
        }
    }
    $dns--;
    if ($dns <= 0) {
        $log .= '■DeathNote■突然燃烧起来,转瞬间化成了灰烬。<br>';
        $dn = $dnk = $dnsk = '';
        $dne = $dns = 0;
    }
    return;
}
开发者ID:jiangtiandao,项目名称:phpdts,代码行数:69,代码来源:item2.func.php

示例8: handle_data

function handle_data($data, $is_sock = False, $auth = False, $exec = False)
{
    global $buckets;
    global $alias_locks;
    global $dest_overrides;
    global $admin_accounts;
    global $admin_data;
    global $admin_is_sock;
    global $admin_aliases;
    global $exec_errors;
    global $exec_list;
    global $throttle_time;
    global $ignore_list;
    if ($auth == False) {
        echo "[33m" . date("Y-m-d H:i:s", microtime(True)) . " > [0m{$data}";
        handle_errors($data);
    } else {
        term_echo("*** auth = true");
    }
    $items = parse_data($data);
    if ($items !== False) {
        write_out_buffer_data($items);
        if ($items["destination"] == DEBUG_CHAN) {
            return;
        }
        if ($auth == False and $is_sock == True) {
            log_items($items);
        }
        if (in_array($items["nick"], $ignore_list) == True) {
            return;
        }
        if (isset($buckets[BUCKET_IGNORE_NEXT]) == True and $items["nick"] == get_bot_nick()) {
            unset($buckets[BUCKET_IGNORE_NEXT]);
            return;
        }
        if ($items["prefix"] == IRC_HOST and strpos(strtolower($items["trailing"]), "throttled") !== False) {
            term_echo("*** THROTTLED BY SERVER - REFUSING ALL OUTGOING MESSAGES TO SERVER FOR " . THROTTLE_LOCKOUT_TIME . " SECONDS ***");
            $throttle_time = microtime(True);
            return;
        }
        if ($items["cmd"] == 330) {
            authenticate($items);
        }
        if ($items["cmd"] == 376) {
            dojoin(INIT_CHAN_LIST);
        }
        if ($items["cmd"] == "NOTICE" and $items["nick"] == "NickServ" and $items["trailing"] == NICKSERV_IDENTIFY_PROMPT) {
            if (file_exists(PASSWORD_FILE) == True and NICKSERV_IDENTIFY === "1") {
                rawmsg("NickServ IDENTIFY " . trim(file_get_contents(PASSWORD_FILE)), True);
            }
            startup();
        }
        $args = explode(" ", $items["trailing"]);
        if (in_array($args[0], $admin_aliases) == True or has_account_list($args[0]) == True) {
            if ($auth == False and $is_sock == True) {
                term_echo("authenticating \"" . $args[0] . "\"...");
                $admin_data = $items["data"];
                $admin_is_sock = $is_sock;
                rawmsg("WHOIS " . $items["nick"]);
                return;
            }
        }
        $alias = $args[0];
        handle_events($items);
        switch ($alias) {
            case ALIAS_ADMIN_NICK:
                if (count($args) == 2) {
                    rawmsg(":" . get_bot_nick() . " NICK :" . trim($args[1]));
                    set_bot_nick(trim($args[1]));
                }
                break;
            case ALIAS_ADMIN_QUIT:
                if (count($args) == 1) {
                    write_out_buffer_command($items, "quit");
                    process_scripts($items, ALIAS_QUIT);
                }
                break;
            case ALIAS_ADMIN_PS:
                if (count($args) == 1) {
                    write_out_buffer_command($items, "ps");
                    ps($items);
                }
                break;
            case ALIAS_ADMIN_KILL:
                if (count($args) == 2) {
                    write_out_buffer_command($items, "kill");
                    kill($items, $args[1]);
                }
                break;
            case ALIAS_ADMIN_KILLALL:
                if (count($args) == 1) {
                    write_out_buffer_command($items, "killall");
                    killall($items);
                }
                break;
            case ALIAS_LIST:
                if (check_nick($items, $alias) == True) {
                    if (count($args) == 1) {
                        write_out_buffer_command($items, "list");
                        get_list($items);
//.........这里部分代码省略.........
开发者ID:cmn32480,项目名称:exec-irc-bot,代码行数:101,代码来源:irc_lib.php

示例9: get_row_info

function get_row_info($tab_name, $col, $row_id, &$row, $show_err = 1)
{
    global $conni;
    $SQL = "SELECT * FROM {$tab_name} where {$col}='{$row_id}'";
    #    print $SQL."<br>";
    $rs = mysqli_query($SQL) or die($SQL);
    if (mysqli_error($conni) != '') {
        error_page(mysqli_error($conni), "Database Error");
        die;
    }
    if (mysqli_num_rows($rs) == 0 and $show_err == 1) {
        kill("Invalid Row id Id#{$row_id} for table {$tab_name}");
    }
    $row = mysqli_fetch_assoc($rs);
    return mysqli_num_rows($rs);
}
开发者ID:baltincsoft,项目名称:VarnerCC,代码行数:16,代码来源:functions.php

示例10: kill

<?php

$skip_login = true;
require_once 'functions.php';
$id = (int) $_GET['id'];
if (!$id) {
    kill("Invalid link opened");
}
$hash = $_GET['hash'];
$gethash = $_GET['hash'];
$info = $db->query("SELECT * FROM people WHERE id = {$id}");
$hash = encrypt($id . $info->email);
if ($hash != $gethash) {
    die("Sorry, this link is invalid. Please click the link in your e-mail. If this does not work, contact us at info@openstreets.co.za.");
} else {
    logThis(12, $id);
    $db->query("UPDATE people SET active = 1 WHERE id = {$id} LIMIT 1");
    $date = date("r");
    $message = "A new user signed up for the mailing list and was registered in the database.\n\nName: {$info->firstname} {$info->lastname}\nE-mail: {$info->email}\nDate: {$date}\n\nMore details:\n" . URL . "people/{$id}";
    $headers = 'From: noreply@friends.openstreets.co.za' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
    mail("info@openstreets.co.za", "Open Streets Subscription", $message, $headers);
}
?>
<!doctype html>
<html>
<head>
<title>Newsletter subscription | Friends of Open Streets</title>
<?php 
echo $head;
?>
<style type="text/css">
开发者ID:OpenStreetsCapeTown,项目名称:backoffice,代码行数:31,代码来源:newsletter.confirm.php

示例11: send

                        $names .= $chars . $user['nick'] . ' ';
                    }
                }
                send($me, ':' . $config['name'] . ' 353 ' . $me['nick'] . ' = ' . $target . ' :' . $names);
                send($me, ':' . $config['name'] . ' 366 ' . $me['nick'] . ' ' . $target . ' :End of /NAMES list.');
                break;
            case 'ping':
                // PONG DAMNIT!
                if (strpos($args[1], ':') === false) {
                    $args[1] = ':' . $args[1];
                }
                send($me, ':' . $config['name'] . ' PONG ' . $config['name'] . ' ' . $args[1]);
                break;
                // tabbing jumps
        }
        // select
    }
    // while
    // closed?
    $error = socket_last_error($me['sock']);
    //echo $error;
    if ($error == 10053 || $error == 10054 || $error === false) {
        // he failed.
        echo $me['nick'] . " has died.\r\n";
        kill($me, 'Something failed...');
        array_removal($me, $conn);
    }
}
// foreach
sleep(1);
// 100% CPU ftl
开发者ID:laiello,项目名称:zircd,代码行数:31,代码来源:connection_handler.php

示例12: fun

<?php

#consumes 2 list files and tries downloading missing files over http, could also be some scp command injected via shell_exec or directly bash script
$basepath = '/home/devsite/';
#base local path
#find $basepath/media > media.prod.list;#1
$prodlist = $basepath . 'media.prod.list';
#find $basepath/media -type f > medias.list;#2
$devlist = $basepath . 'medias.list';
$distantDomain = 'http://productionwebsite.com/';
/**********************************************/
new fun();
pretitle(1);
#assumes : +ob_start();
if (!is_file($prodlist) or !is_file($devlist)) {
    kill("missing parameters");
}
$copied = [];
$lf = __FILE__ . '.log';
$a = explode("\n", fgc($prodlist));
$b = explode("\n", fgc($devlist));
$missing = array_diff($a, $b);
$c = ['a' => count($a), 'b' => count($b), 'missing' => count($missing)];
out($c, $lf);
foreach ($missing as $url) {
    if (strpos($url, '.') === FALSE) {
        continue;
    }
    $targetFile = $basepath . $url;
    #str_replace(' ','%20',$url);
    if (is_file($targetFile)) {
开发者ID:Ben749,项目名称:racetrack,代码行数:31,代码来源:prod.dev.import.nonversionned.files.simple.php

示例13: lockfile

function lockfile($f)
{
    global $unlinks;
    if (substr($f, 0, 1) != '/') {
        $cwd = getcwd();
        $f = $cwd . '/' . $f;
    }
    #from the script for reference
    if (is_file($f)) {
        kill("locked {$f}");
    }
    touch($f);
    $unlinks[] = $f;
}
开发者ID:Ben749,项目名称:racetrack,代码行数:14,代码来源:fun.php

示例14: kill

<?php

include 'php/autoload.php';
function kill()
{
    $GLOBALS['db']->close();
    die;
}
if (!$isLoggedIn) {
    kill(';failed-not-logged-in');
}
if (is_null($me->getAdmin()) || !$me->getAdmin()->canMakeAdmin()) {
    kill(';failed-insufficient-permissions');
}
$action = $_GET['action'];
if ($action == 'delete') {
    $id = $_GET['id'];
    kill($db->query('DELETE FROM Admins WHERE userId = ?', array($id), array(SQLITE3_TEXT)));
} elseif ($action == 'recruit') {
    $username = $_GET['username'];
    $id = $db->scalar('SELECT userId FROM Users WHERE username = ?', array($username), array(SQLITE3_TEXT));
    if ($id === false) {
        kill(';failed-user-doesnt-exist');
    } else {
        $canReview = $_GET['canReview'] == 'y';
        $canMakeAdmin = $_GET['canMakeAdmin'] == 'y';
        kill($db->addAdmin($id, $canReview, $canMakeAdmin));
    }
}
开发者ID:kezadias,项目名称:ShitpostBotWeb,代码行数:29,代码来源:manage-admin.php

示例15: StdClass

<?php

require 'vendor/autoload.php';
$sSql = "SELECT * FROM testes.teste inner join  coisa.neh on teste.codigo = neh.codigo where teste.xoxo = 1 and teste.xoxb is true;";
$oObjeto = new StdClass();
$oObjeto->aArray = array(1, 2, 3, 4, 5, "6", array(7));
$oObjeto->backtrace = debug_backtrace();
\PHP\Utils::dump_sql($sSql);
\PHP\Utils::dump($sSql, $oObjeto);
dump_sql($sSql);
dump($sSql, $oObjeto);
kill($sSql, $oObjeto);
\PHP\Utils::kill($sSql, $oObjeto);
echo "Não deve aparecer";
开发者ID:hmschreiner,项目名称:PHPUtils,代码行数:14,代码来源:testes.php


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