• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: create_DOM

function create_DOM()
{
    $name = config\platform::name;
    $charset = config\platform::charset;
    //get init script location
    $init_script_location = 'client/init.js';
    //get init script
    $init_script = init();
    $dom = new DOMDocument('1.0', 'utf-8');
    $dom->loadHTML('
        <!DOCTYPE html>
        <html>
            <head>
                <title>' . $name . '</title>
                <meta charset="' . $charset . '">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
            </head>
            <body>
                ' . $init_script . '
            </body>
        </html>
    ');
    ob_start();
    echo add_external_libs();
    echo $dom->saveHTML($dom->getElementsByTagName('!DOCTYPE html')->item(0));
    ob_end_flush();
}
开发者ID:guillaum3f,项目名称:codie,代码行数:27,代码来源:dom.php


示例2: process

function process($form_data)
{
    $a = session_id();
    include "connect.php";
    $conn = init($_SESSION["permission_type"]);
    $query = "\n\t\t\t\tSELECT salesrecord.cost, salesrecord.sale_price, salesrecord.transport_price FROM `salesrecord` \n\t\t\t\tinner join contract on contract.id=salesrecord.contract_id\n\t\t\t\tinner join user on contract.user_id=user.id\n\t\t\t\tOrder by salesrecord.date\n\t\t\t";
    if (isset($form_data['choosenuser']) && $form_data['choosenuser'] != "") {
        $query = "\n\t\t\t\tSELECT salesrecord.cost, salesrecord.sale_price, salesrecord.transport_price FROM `salesrecord` \n\t\t\t\tinner join contract on contract.id=salesrecord.contract_id\n\t\t\t\tinner join user on contract.user_id=user.id\n\t\t\t\tWhere user.name = '" . $form_data['choosenuser'] . "'\n\t\t\t\tOrder by salesrecord.date\n\t\t\t\t";
    }
    $result = $conn->query($query);
    $rows = $result->fetch_all(MYSQLI_ASSOC);
    $stat = array();
    $i = 0;
    $sum = 0;
    foreach ($rows as $column) {
        $i += 1;
        if ($i == 100) {
            $stat[] = $sum / 100;
            $i = 0;
            $sum = 0;
        }
        $sum += floatval($column['sale_price']) / (floatval($column['cost']) + floatval($column['transport_price']));
        //echo (   $hh . "<br>"   );
    }
    $stat[] = $sum / $i;
    echo json_encode(array("stat" => $stat));
}
开发者ID:itmashalov,项目名称:Database-Systems-Food-Project,代码行数:27,代码来源:getCeoChart.php


示例3: delete

 public static function delete($key)
 {
     self:
     init();
     $ret = self::$pool->delete($key);
     return $ret;
 }
开发者ID:zhangjingpu,项目名称:yaf-lib,代码行数:7,代码来源:Memcache.php


示例4: process

function process($form_data)
{
    include "Helper.php";
    // pretty_print_array($form_data);
    $a = session_id();
    include "connect.php";
    $conn = init($_SESSION["permission_type"]);
    $result = array();
    if (isset($form_data["transportoffer---relation"])) {
        $result = deleteTransportOffer($form_data, $conn);
    } else {
        if (isset($form_data["user---relation"])) {
            $result = deleteUser($form_data, $conn);
        } else {
            if (isset($form_data["contract---relation"])) {
                $result = deleteContract($form_data, $conn);
            } else {
                if (isset($form_data["market---relation"])) {
                    $result = deleteMarket($form_data, $conn);
                } else {
                    if (isset($form_data["transportoffer---relation"])) {
                        $result = deleteTransportOffer($form_data, $conn);
                    } else {
                        if (isset($form_data["immigrants---relation"])) {
                            $result = deleteImigrants($form_data, $conn);
                        } else {
                            if (isset($form_data["product---relation"])) {
                                $result = deleteProduct($form_data, $conn);
                            } else {
                                if (isset($form_data["transportcompany---relation"])) {
                                    $result = deleteTransportCompany($form_data, $conn);
                                } else {
                                    if (isset($form_data["flavour---relation"])) {
                                        $result = deleteTaste($form_data, $conn);
                                    } else {
                                        if (isset($form_data["storagetype---relation"])) {
                                            $result = deleteStoragetype($form_data, $conn);
                                        } else {
                                            if (isset($form_data["country---relation"])) {
                                                $result = deleteCountry($form_data, $conn);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if ($result["error"] == "") {
        $returnedData = $conn->query($result["data"]);
    }
    if ($conn->connect_errno) {
        $result["error"] = $conn->connect_error;
    }
    $result["data"] = "";
    echo json_encode($result);
}
开发者ID:itmashalov,项目名称:Database-Systems-Food-Project,代码行数:60,代码来源:ActionDelete.php


示例5: compare

function compare()
{
    init();
    //如果目标数据库不存在,先创建一个
    $sql = 'create database if not exists ' . TARGET_DB . ' default charset utf8 collate utf8_general_ci';
    mysql_query($sql, TARGET_LINK);
    //获取数据源的数据结构
    $source_database_struct = get_database_struct(SOURCE_LINK, SOURCE_DB);
    //获取目标的数据结构
    $target_database_struct = get_database_struct(TARGET_LINK, TARGET_DB);
    //以数据源为准,比较差异
    foreach ($source_database_struct as $table_name => $create_table) {
        if (!$target_database_struct[$table_name]) {
            execute($create_table, TARGET_LINK);
        } else {
            //比较字段
            compare_column(SOURCE_LINK, TARGET_LINK, SOURCE_DB, TARGET_DB, $table_name);
            //比较索引
            compare_keys(SOURCE_LINK, TARGET_LINK, SOURCE_DB, TARGET_DB, $table_name);
            //比较分区
            compare_partition(SOURCE_LINK, TARGET_LINK, SOURCE_DB, TARGET_DB, $table_name);
        }
    }
    //删除多余的表
    foreach ($target_database_struct as $table_name => $create_table) {
        if (!$source_database_struct[$table_name]) {
            $sql = 'drop table ' . $table_name;
            execute($sql, TARGET_LINK);
        }
    }
    close();
}
开发者ID:bluefan,项目名称:phpsource,代码行数:32,代码来源:mysql_update.php


示例6: event

 public static function event()
 {
     $cmd = geolocCmd::byId(init('id'));
     if (!is_object($cmd)) {
         throw new Exception(__('Commande ID geoloc inconnu : ', __FILE__) . init('id'));
     }
     if ($cmd->getEqLogic()->getEqType_name() != 'geoloc') {
         throw new Exception(__('Cette commande n\'est pas de type geoloc : ', __FILE__) . init('id'));
     }
     if ($cmd->getConfiguration('mode') != 'dynamic') {
         throw new Exception(__('Cette commande de géoloc n\'est pas dynamique : ', __FILE__) . init('id'));
     }
     $value = init('value');
     if (strpos($value, 'https://') !== false || strpos($value, 'http://') !== false) {
         $url = parse_url($value);
         parse_str($url['query'], $output);
         if (isset($output['q'])) {
             $value = $output['q'];
         }
         if (isset($output['ll'])) {
             $value = $output['ll'];
         }
     }
     //For compatibility with older version which not use the Value property, set the Value if needed
     foreach ($cmd->getEqLogic()->getCmd('info') as $distance) {
         if ($distance->getConfiguration('mode') == 'distance' || $distance->getConfiguration('mode') == 'travelDistance' || $distance->getConfiguration('mode') == 'travelTime') {
             if ($distance->setDependency()) {
                 $distance->save();
             }
         }
     }
     $cmd->event($value);
     $cmd->getEqLogic()->refreshWidget();
 }
开发者ID:DavZero,项目名称:plugin-geoloc,代码行数:34,代码来源:geoloc.class.php


示例7: userPage

function userPage($modx)
{
    init($modx);
    $myuser = $modx->getObject('kofcuser', array('name' => $modx->user->username), false);
    if ($myuser) {
        $addr = $myuser->getMany('memberMemberAddress', array('addressType' => 'home'));
        foreach ($addr as $a) {
            echo $a->get('street1');
        }
        /*
        	$addr=$modx->newObject('memberAddress');
        	$addr->fromArray(array('addressType'=>'home','street1' => '412 Crofton Park Lane' ,'city'=>'Franklin','state'=>'TN','zip'=>'37069'));
        	$myuser->addMany($addr);
        $myuser->save();
        */
        $baseImage = '/assets/images/memberPhotos/';
        if ($myuser) {
            $imagePath = $baseImage . $myuser->get('imagePath');
        }
        //$mycouncil=$modx->getObject('council',array('id'=>$myuser->get('councilId')));
        $mycouncil = $myuser->getOne('memberCouncil');
        $modx->toPlaceholders(array("imagePath" => $imagePath), '');
        $modx->toPlaceholders($myuser->toArray(), 'member');
        $modx->toPlaceholders($mycouncil->toArray(), 'council');
    }
    return null;
}
开发者ID:jakewoodstn,项目名称:kofctnComponent,代码行数:27,代码来源:snippet.kofctn.php


示例8: process

function process($form_data)
{
    $a = session_id();
    include "connect.php";
    $conn = init($_SESSION["permission_type"]);
    include "Helper.php";
    //pretty_print_array($form_data);
    $processed_form_data = preprocess($form_data);
    $builder = new GetQueryBuilder();
    $coolresult = $builder->generateSQL($processed_form_data);
    $returnedData = "";
    //print_r($coolresult);
    $returnedData = $conn->query($coolresult["data"][0]);
    //echo ($coolresult["data"][0]);
    $coolresult["data"] = "";
    if ($conn->error) {
        if ($coolresult["error"] == "") {
            $coolresult["error"] = $conn->error;
        }
    } else {
        $coolresult["error"] = "";
        $coolresult["data"] = $returnedData->fetch_all(MYSQLI_ASSOC);
    }
    echo json_encode($coolresult);
}
开发者ID:itmashalov,项目名称:Database-Systems-Food-Project,代码行数:25,代码来源:ActionGet.php


示例9: event

 public static function event()
 {
     $cmd = iftttCmd::byId(init('id'));
     if (!is_object($cmd)) {
         throw new Exception('Commande ID ifttt inconnu : ' . init('id'));
     }
     $cmd->event(init('value'));
 }
开发者ID:jeedom,项目名称:plugin-ifttt,代码行数:8,代码来源:ifttt.class.php


示例10: getCodecheckProductBySearch

function getCodecheckProductBySearch($suchbegriff)
{
    $ean = preg_replace('/[^a-zA-Z-0-9]+/', '', $suchbegriff);
    $context = init();
    $r = file_get_contents('http://www.codecheck.info/WebService/rest/prod/search/0/0/30/' . $suchbegriff, false, $context);
    $r = json_decode($r);
    return $r->result;
}
开发者ID:RaphaelManke,项目名称:chefkochWrapperToRDF,代码行数:8,代码来源:codecheck.php


示例11: test_init

 /** 
  * Test initialization method.
  */
 public function test_init()
 {
     // Setup
     \WP_Mock::expectAction('wpd_tools_init');
     // Act
     init();
     // Verify
     $this->assertConditionsMet();
 }
开发者ID:lkwdwrd,项目名称:wp-doc-tools,代码行数:12,代码来源:Core_Tests.php


示例12: main

function main()
{
    if ($_SERVER['argc'] <= 1 || false === is_dir($_SERVER['argv'][1])) {
        echo usage();
        exit(-1);
    } else {
        setup();
        init($_SERVER['argv'][1]);
    }
}
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:10,代码来源:runner.php


示例13: main

function main()
{
    init();
    connect();
    switch ($GLOBALS['req']['a']) {
        case 'getMembers':
            display('members', getMembers());
            break;
    }
    echo json_encode($GLOBALS['final_print']);
    disconnect();
}
开发者ID:armsnyder,项目名称:bonehead-site,代码行数:12,代码来源:misc.php


示例14: generate

function generate()
{
    init();
    $sql = 'SHOW TABLES';
    $ret = QueryExecutor::execute(new SqlQuery($sql));
    getnerateDomainObjects($ret);
    getnerateDAOObjects($ret);
    getnerateDAOExtObjects($ret);
    getnerateIDAOObjects($ret);
    createIncludeFile($ret);
    createDAOFactory($ret);
}
开发者ID:acapps,项目名称:phpdao-for-me,代码行数:12,代码来源:generate.php


示例15: init

/**
 * Grab and push test email data into redis
 * @param $limit_rounds number of times function will execute recursively
 * @param $time_between_rounds number of seconds between each recursive round.
 */
function init($limit_rounds = 10, $time_between_rounds = 5)
{
    $limit_rounds--;
    $email_data_array = json_decode(exec('node test/make-test-data.js 100'));
    foreach ($email_data_array as $key => $email_data_item) {
        queue_email($email_data_item, rand(0, 10));
    }
    if ($limit_rounds > 0) {
        echo "queue_email sleeping. Rounds left: {$limit_rounds}.";
        sleep($time_between_rounds);
        init($limit_rounds);
    }
}
开发者ID:keeganbrown,项目名称:node-redis-priority-mail-queue,代码行数:18,代码来源:queue_email.php


示例16: tree_nav_table

function tree_nav_table($params, $title, $t_data, $parents = NULL, $i = 1, $id_parent = NULL, $tbody = '')
{
    global $modul;
    foreach ($t_data as $t_key => $t_value) {
        $tbody .= "<div class='table-row'>";
        foreach ($params['TABLE'] as $key => $value) {
            $data = init($t_value[$key], $value, $key);
            if ($value == 'activate') {
                $tbody .= "<div class='table-cell icon-only " . $key . "'>";
                if ($t_value[$key]) {
                    $tbody .= "<a href='#' class='icon-cell " . $key . "_de" . $value . "' data-content='" . $modul . "' id='" . $t_value['id'] . "' ><i class='icon-" . $value . "-active'></i>";
                } else {
                    $tbody .= "<a href='#' class='icon-cell " . $key . "_" . $value . "' data-content='" . $modul . "' id='" . $t_value['id'] . "' ><i class='icon-" . $value . "'></i>";
                }
                $tbody .= "</div><!-- /.table-cell -->";
            } else {
                $tbody .= "<div class='table-cell " . $key . "'>";
                for ($y = 2; $y <= $i; $y++) {
                    $tbody .= "<span class='spacer'></span>";
                }
                $tbody .= "<i class='icon-tree'></i>" . $data . "</div><!-- /.table-cell -->";
            }
        }
        $width = 40 + 26 * count($params['CONSTRUCT']);
        $tbody .= "<div class='table-cell tools' style='width: " . $width . "px;'>";
        foreach ($params['CONSTRUCT'] as $key => $value) {
            if ($value === true) {
                if ($key == 'activate') {
                    if ($t_value['c_active']) {
                        $tbody .= "<a href='#' class='icon-cell de" . $key . "' data-content='" . $modul . "' id='" . $t_value['id'] . "' ><i class='icon-" . $key . "-active'></i>";
                    } else {
                        $tbody .= "<a href='#' class='icon-cell " . $key . "' data-content='" . $modul . "' id='" . $t_value['id'] . "' ><i class='icon-" . $key . "'></i>";
                    }
                    $tbody .= "</a>";
                } else {
                    $tbody .= "<a href='#' class='icon-cell " . $key . "' data-content='" . $modul . "' id='" . $t_value['id'] . "' ><i class='icon-" . $key . "'></i></a>";
                }
            }
        }
        $tbody .= "</div><!-- /.table-cell -->";
        $tbody .= "</div><!-- /.table-row -->";
        if ($t_value['id_parent'] == $id_parent) {
            $i = 1;
        }
        if (isset($t_value['children'])) {
            $tbody .= tree_nav_table($params, $title, $t_value['children'], $parents, $i + 1, $t_value['id_parent'], '');
        }
    }
    return $tbody;
}
开发者ID:entire-media,项目名称:comator,代码行数:50,代码来源:helper.inc.php


示例17: event

 public static function event()
 {
     $cmd = geolocCmd::byId(init('id'));
     if (!is_object($cmd)) {
         throw new Exception('Commande ID geoloc inconnu : ' . init('id'));
     }
     if ($cmd->getEqLogic()->getEqType_name() != 'geoloc') {
         throw new Exception('Cette commande n\'est pas de type geoloc : ' . init('id'));
     }
     if ($cmd->getConfiguration('mode') != 'dynamic') {
         throw new Exception('Cette commande de géoloc n\'est pas dynamique : ' . init('id'));
     }
     $cmd->event(init('value'));
 }
开发者ID:Wators,项目名称:jeedom_plugins,代码行数:14,代码来源:geoloc.class.php


示例18: df_init

 /**
  * Initializes the dataface framework.
  */
 function df_init($site_path, $dataface_url, $conf = null)
 {
     require_once dirname(__FILE__) . '/init.php';
     init($site_path, $dataface_url);
     import('PEAR.php');
     import('Dataface/Application.php');
     $app = Dataface_Application::getInstance($conf);
     if (df_get_file_system_version() != df_get_database_version()) {
         $res = df_update();
         if (PEAR::isError($res)) {
             trigger_error($res->getMessage(), E_USER_ERROR);
         }
     }
     return $app;
 }
开发者ID:promoso,项目名称:HVAC,代码行数:18,代码来源:dataface-public-api.php


示例19: start

function start()
{
    session_start();
    checkAnswerButtonPressed();
    if (isset($_POST['next'])) {
        // next button geklikt
        $_SESSION['nieuweVraag'] = true;
        $_SESSION['vraag'] = $_SESSION['vraag'] + 1;
        unset($_SESSION['buttonGeklikt']);
    } else {
        if (isset($_SESSION['buttonGeklikt'])) {
            // antwoord-button geklikt
            $_SESSION['nieuweVraag'] = false;
        } else {
            // geen button geklikt, eerste vraag
            init();
        }
    }
}
开发者ID:jmoritdev,项目名称:rjseducation,代码行数:19,代码来源:countingassignment.php


示例20: send_mail

function send_mail($recipients, $subject, $message)
{
    $mail = init(json_decode(file_get_contents("config/config.json"), true)["mail"]);
    $mail->isHTML(ture);
    if (is_array($recipients)) {
        foreach ($recipients as $recipient) {
            $mail->addAddress($recipient);
        }
    } else {
        $mail->addAddress($recipients);
    }
    $mail->Subject = $subject;
    $mail->Body = $message;
    if (!$mail->send()) {
        return array("success" => false, "message" => $mail->ErrorInfo);
    } else {
        return array("success" => true);
    }
}
开发者ID:biannetta,项目名称:slacko,代码行数:19,代码来源:mailer.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP initDB函数代码示例发布时间:2022-05-15
下一篇:
PHP inicio函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap