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


PHP execute函数代码示例

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


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

示例1: search

 public function search($page = 0, $limit = 200)
 {
     $end = $this->timeEnd ? $this->timeEnd->getTimestamp() : Time::microtime() + 1;
     $start = $this->timeStart ? $this->timeStart->getTimestamp() : 0;
     $args = array($start, $end, $page * $limit, $limit);
     $keys = $this->buildSearchKeys();
     if (($keysCount = count($keys)) > 1) {
         $args[] = $keysCount;
         $keysString = "ARGV[5]";
         foreach ($keys as $i => $k) {
             $keysString .= " ,KEYS[" . ($i + 2) . "]";
         }
         $command = "redis.call('zinterstore', KEYS[1], {$keysString}, 'AGGREGATE', 'MAX')" . PHP_EOL;
         array_unshift($keys, 'searchtmp:' . uniqid(getmypid() . ':', true));
     } else {
         $command = "";
         count($keys) or $keys[0] = 'index:job:all';
     }
     // zREVrangebyscore so ARG[2] ARG[1] are reversed
     $command .= "local result = redis.call('zrevrangebyscore', KEYS[1], ARGV[2], ARGV[1], 'LIMIT', ARGV[3], ARGV[4])" . PHP_EOL;
     $command .= "local count = redis.call('zcount', KEYS[1], ARGV[1], ARGV[2])" . PHP_EOL;
     if ($keysCount > 1) {
         $command .= "redis.call('del', KEYS[1])" . PHP_EOL;
     }
     $command .= 'return {count, result}';
     list($count, $list) = $this->commandExecutor->execute(new Phresque\Redis\Commands\DynamicCommand($command, $keys, $args));
     $jobs = array();
     foreach ($list as $jobID) {
         $jobs[] = $this->commandExecutor->execute(new Phresque\Redis\Commands\GetJob($jobID));
     }
     return $this->withCount ? array($jobs, $count) : $jobs;
 }
开发者ID:phresque,项目名称:phresque,代码行数:32,代码来源:Search.php

示例2: db_createItemsTable

function db_createItemsTable($con)
{
    $sql = "CREATE TABLE items\n                  (\n                    IID          INT           NOT NULL PRIMARY KEY AUTO_INCREMENT, # key to the items table\n                    OID          INT           NOT NULL, # key to the orders table\n                    PKID         INT           NOT NULL, # key to the packages table\n                    Personality  INT           ,         # foreign key to the pieces table\n                    Price        DECIMAL(6,2)  ,\n                    Quantity     INT\n                  )";
    if (!execute($con, $sql, "Table 'items' create")) {
        return false;
    }
}
开发者ID:ChapResearch,项目名称:Online-Orders-Database,代码行数:7,代码来源:racheltables.php

示例3: init

/**
 * Init function of API.
 */
function init()
{
    if ($paramArr = getParam()) {
        $repeat = $paramArr[2];
        for ($i = 4; $i < 30; $i++) {
            $ogListArr = getRandOgList(1, 29, $i, $repeat);
            $total1 = 0;
            $total2 = 0;
            foreach ($ogListArr as $ogList) {
                echo json_encode($ogList);
                echo '<br>';
                $statics = execute($ogList, $paramArr[0], $paramArr[1]);
                $total1 += $statics[0]['count'];
                $total2 += $statics[1]['count'];
            }
            $avg1 = $total1 / $repeat;
            $avg2 = $total2 / $repeat;
            echo '1/2 --- ' . (string) $avg1 . '<br>';
            echo '1   --- ' . (string) $avg2 . '<br>';
            echo '<br>';
        }
    } else {
        printParamErr();
    }
}
开发者ID:ycduan,项目名称:UESTC_Software2015,代码行数:28,代码来源:halfCmpFull.php

示例4: insertTemp

 public function insertTemp()
 {
     $temp = $_REQUEST['temp'];
     $date = $_REQUEST['datum'];
     $name = strtolower($_REQUEST['name']);
     execute("INSERT INTO forecast(date, temp, name) VALUES('{$date}', {$temp}, '{$name}')", $this->mysqli);
 }
开发者ID:Jrubensson,项目名称:raspberry,代码行数:7,代码来源:tempModel.php

示例5: getPoke

function getPoke($url)
{
    $result = execute($url);
    $myfilePkd = fopen("pokedexLib.lua", "w") or die("Unable to open file!");
    fwrite($myfilePkd, "PokeDex={");
    foreach ($result->objects as $pokedex) {
        $txt = "['" . $pokedex->name . "'] = {attack='" . $pokedex->attack . "'," . "catch_rate='" . $pokedex->catch_rate . "'," . "sp_atk='" . $pokedex->sp_atk . "'," . "sp_def='" . $pokedex->sp_def . "'," . "species='" . $pokedex->species . "'," . "defense='" . $pokedex->defense . "'," . "egg_cycles='" . $pokedex->egg_cycles . "'," . "hp='" . $pokedex->hp . "'," . "male_female_ratio='" . $pokedex->male_female_ratio . "'," . "speed='" . $pokedex->speed . "'," . "height='" . $pokedex->height . "'," . "weight='" . $pokedex->weight . "'," . "evolutions={";
        foreach ($pokedex->evolutions as $evo) {
            if (isset($evo->level)) {
                $txt .= "{level='" . $evo->level . "',";
            } else {
                $txt .= "{level='0',";
            }
            $txt .= "method='" . $evo->method . "',";
            $txt .= "to='" . $evo->to . "'},";
        }
        $txt .= "},";
        $txt .= "types={";
        foreach ($pokedex->types as $types) {
            $txt .= "{name='" . $types->name . "'},";
        }
        $txt .= "},";
        $txt .= "moves={";
        foreach ($pokedex->moves as $move) {
            $idAPI = $move->resource_uri;
            $IdMove = explode('/', $idAPI);
            $txt .= "{id='" . $IdMove[4] . "',";
            $txt .= "learn_type='" . $move->learn_type . "',";
            $txt .= "name='" . ucwords(strtolower(str_replace("-", " ", $move->name))) . "'},";
        }
        $txt .= "},\n";
        $txt .= "},\n";
        fwrite($myfilePkd, $txt);
    }
}
开发者ID:JoseEduardo,项目名称:o_487qpaos89PsIQ,代码行数:35,代码来源:getPokedex.php

示例6: run

 public function run()
 {
     include_once SANWEN_LIB . '/Common/functions.php';
     include_used_file();
     //include the file that used
     Log::write('begin initApp');
     $this->initApp();
     //use the filter
     $filter = new Filter();
     //filter all url
     Log::write('begin to filter url');
     if ($filter->filter_all_url()) {
         $include_file = get_include_file();
         if (file_exists($include_file)) {
             Log::write('get_include_file:' . $include_file);
             include_once $include_file;
             execute(null, null);
         } else {
             //对应地址的类不存在的时候,执行默认首页
             if (file_exists(APP . '/Index/Action/Index.action.php')) {
                 include_once APP . '/Index/Action/Index.action.php';
                 execute("Index", "Index");
             } else {
                 //默认首页不存在的时候,抛出错误信息
                 echo get_langage_message('system.lang.php', 'DEFAULT_INDEX_NOT_FOUND');
             }
         }
     } else {
         echo get_langage_message('system.lang.php', 'CAN_NOT_ACCESS');
     }
 }
开发者ID:pantingwen,项目名称:sanwenphp,代码行数:31,代码来源:Application.class.php

示例7: run_cron

function run_cron()
{
    campaign_limit_update();
    execute();
    update_configvar('last_cron_job', time());
    add_syslog('daily_cron', '');
}
开发者ID:aiurlano,项目名称:mAdserve-Fork,代码行数:7,代码来源:cron_f.php

示例8: queryOptionsList

function queryOptionsList($query)
{
    $result = execute($query);
    while ($row = mysql_fetch_row($result)) {
        echo "<option value=\"{$row[0]}\">{$row[0]}</option>";
    }
}
开发者ID:nehaljwani,项目名称:dbapp,代码行数:7,代码来源:es2.php

示例9: init

/**
 * Init function of API.
 */
function init()
{
    if ($paramArr = getParam()) {
        $repeat = $paramArr[0];
        for ($i = 1; $i < 101; $i++) {
            $halfNum = $i / 100;
            for ($j = 4; $j < 29; $j++) {
                $ogListArr = getRandOgList(1, 29, $j, $repeat);
                $total = 0;
                foreach ($ogListArr as $ogList) {
                    $statics = execute($ogList, $halfNum);
                    $total += $statics['count'];
                }
                $avgNumber = $total / $repeat;
                echo $avgNumber;
                if ($j < 28) {
                    echo ',';
                }
            }
            echo '<br>';
        }
    } else {
        printParamErr();
    }
}
开发者ID:ycduan,项目名称:UESTC_Software2015,代码行数:28,代码来源:compareHalfNumWithNumber.php

示例10: addUser

function addUser($voornaam, $achternaam, $telefoon, $geslacht, $email, $logonNaam, $wachtwoord)
{
    $sql = "INSERT INTO users (user_voornaam, user_achternaam, user_telefoon, user_geslacht, user_email)\nVALUES (?, ?,?,?,?)";
    $sql2 = "INSERT INTO users (user_login_naam, user_wachtwoord)\nVALUES (?,?)";
    $conn = $getConnection();
    $stmt = $conn->prepare($sql);
    $stmt->bind_param('s', $voornaam);
    $stmt->bind_param('r', $achternaam);
    $stmt->bind_param('t', $telefoon);
    $stmt->bind_param('u', $geslacht);
    $stmt->bind_param('v', $email);
    $stmt2 = $conn->prepare($sql2);
    $stmt->bind_param('s', $logonNaam);
    $stmt->bind_param('r', $wachtwoord);
    //laten staan voor debugging voor nu
    if ($stmt - execute() === TRUE) {
        echo "New record created successfully";
    } else {
        echo "Error: " . $sql . "<br>" . $stmt->error;
    }
    if ($stmt2 - execute() === TRUE) {
        echo "New record created successfully";
    } else {
        echo "Error: " . $sql . "<br>" . $stmt2->error;
    }
    $conn->close();
}
开发者ID:JellyPuddingPie,项目名称:CravedOfficial,代码行数:27,代码来源:Functions.php

示例11: login_user

 public function login_user()
 {
     //função de login do usuario
     $cod = $this->_user_cod;
     $login = $this->_user_login;
     $pass = $this->_user_pass;
     require_once 'config/connection_server.php';
     //arquivo de conexao
     $sql = "select COD_U,login,senha from usuario where login = :login and senha = :senha";
     //comando de pesquisa
     $dados = array(':cod_user' => $cod, ':login' => $login, ':login' => $pass);
     $query = $banco->prepare($sql);
     $query - execute($dados);
     if ($query->rowcount() >= 1) {
         while ($i = $query->fetch(PDO::FETCH_OBJ)) {
             //confirmação de existencia e redirecionando se verdadeiro
             if ($login == $i->login && $pass == $i->senha) {
                 session_start();
                 $_SESSION['cod'] = $i->cod;
             } else {
             }
         }
     } else {
         session_start();
         $_SESSION['menMenssagem']++;
     }
     $sql = "insert into usuario_login(COD_UL,cod_usu,horario_login)values(null,:cod_user,null)";
     //cod_user vem do $dados na linha 23
     $query = $banco->prepare($sql);
     $query->execute($dados);
     //executa o o sql para sinalizar o login do usuario
     header('Location:index2.php');
     // redireciona para a pagina de usuario
 }
开发者ID:G4m3Hunt3r,项目名称:gamehunter_site,代码行数:34,代码来源:FileClass.class.php

示例12: recvFile

 public function recvFile($remote, $local)
 {
     if (!($info = parse_url($remote))) {
         return;
     }
     if (isset($info['path'])) {
         $info = array_merge($info, pathinfo($info['path']));
     }
     if (!isset($info['filename'])) {
         trigger_error('iPlayer: No PID specified', E_USER_WARNING);
         return false;
     }
     if (!isset($info['extension'])) {
         trigger_error('iPlayer: No file type (extension) specified', E_USER_WARNING);
         return false;
     }
     if (is_dir($local)) {
         $localdir = $local;
         $local .= '/' . $info['basename'];
     } else {
         $localdir = dirname($local);
     }
     if ($info['extension'] == 'jpg') {
         return copy('http://www.bbc.co.uk/iplayer/images/episode/' . $info['filename'] . '_832_468.jpg', $local);
     }
     if ($info['extension'] == 'rdf') {
         return copy('http://www.bbc.co.uk/programmes/' . $info['filename'] . '.rdf', $local);
     }
     if ($info['extension'] == 'flv') {
         $tmpfile = $localdir . '/.iplayer-tmp-' . $info['filename'] . '.flv';
         if (!file_exists($tmpfile)) {
             $args = array();
             $args[] = GET_IPLAYER_PATH;
             $args[] = '--flvstreamer';
             $args[] = FLVSTREAMER_PATH;
             $args[] = '--modes=flashhd1,flashhd2,flashvhigh,flashhigh';
             $args[] = '--quiet';
             $args[] = '--nocopyright';
             $args[] = '--nopurge';
             $args[] = '--file-prefix=.iplayer-tmp-' . $info['filename'];
             $args[] = '--pid=' . $info['filename'];
             $args[] = '--force';
             $args[] = '--raw';
             $args[] = '-o';
             $args[] = $localdir;
             $result = execute(GET_IPLAYER_PATH, $args, false);
             if (!file_exists($tmpfile)) {
                 trigger_error('get_iplayer failed to download ' . $info['basename'], E_USER_NOTICE);
                 return false;
             }
         }
         if (!rename($tmpfile, $local)) {
             return false;
         }
         return true;
     }
     print_r($info);
     die;
 }
开发者ID:nexgenta,项目名称:vfs,代码行数:59,代码来源:iplayer.php

示例13: init

/**
 * Init function of API.
 */
function init()
{
    if (($paramArr = getParam()) && validateParam($paramArr[0]) && validateParam($paramArr[1])) {
        execute($paramArr[0], $paramArr[1], $paramArr[2]);
    } else {
        printParamErr();
    }
}
开发者ID:uestc-software,项目名称:mccap,代码行数:11,代码来源:index.php

示例14: init

/**
 * Init function of API.
 */
function init()
{
    if (($idArr = parseParam()) && validateParam($idArr)) {
        execute($idArr);
    } else {
        printParamErr();
    }
}
开发者ID:ycduan,项目名称:UESTC_Software2015,代码行数:11,代码来源:cegCSV.php

示例15: execute

 public function execute()
 {
     if (execute('which traceroute') != '') {
         echo execute('traceroute ' . escapeshellarg(CenterBot::getInstance()->_actionText));
     } else {
         echo 'Error: system comand (traceroute) not found';
     }
 }
开发者ID:slauger,项目名称:centerim-bot,代码行数:8,代码来源:traceroute.php


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