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


PHP loadsettings函数代码示例

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


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

示例1: demo_process_thread

function demo_process_thread($act, $outformat, $lastid, $isuser, $canpost, $istyping, $postmessage)
{
    global $kind_for_agent, $kind_info, $kind_events, $kind_user, $kind_agent, $webimroot, $settings;
    loadsettings();
    if ($act == "refresh" || $act == "post") {
        $lastid++;
        if ($outformat == "xml") {
            start_xml_output();
            print "<thread lastid=\"{$lastid}\" typing=\"" . ($istyping ? 1 : 0) . "\" canpost=\"" . ($canpost ? 1 : 0) . "\">";
        } else {
            start_html_output();
            $url = "{$webimroot}/thread.php?act=refresh&amp;thread=0&amp;token=123&amp;html=on&amp;user=" . ($isuser ? "true" : "false");
            print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . "<html>\n<head>\n" . "<link href=\"{$webimroot}/styles/default/chat.css\" rel=\"stylesheet\" type=\"text/css\">\n" . "<meta http-equiv=\"Refresh\" content=\"" . $settings['updatefrequency_oldchat'] . "; URL={$url}&amp;sn=11\">\n" . "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" . "<title>chat</title>\n" . "</head>\n" . "<body bgcolor='#FFFFFF' text='#000000' link='#C28400' vlink='#C28400' alink='#C28400'>" . "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td valign='top' class='message'>";
        }
        if ($lastid == 1) {
            demo_print_message(array('ikind' => $kind_for_agent, 'created' => time() - 15, 'tname' => '', 'tmessage' => getstring2('chat.came.from', array("http://google.com"))), $outformat);
            demo_print_message(array('ikind' => $kind_info, 'created' => time() - 15, 'tname' => '', 'tmessage' => getstring('chat.wait')), $outformat);
            demo_print_message(array('ikind' => $kind_events, 'created' => time() - 10, 'tname' => '', 'tmessage' => getstring2("chat.status.operator.joined", array("Administrator"))), $outformat);
            demo_print_message(array('ikind' => $kind_agent, 'created' => time() - 9, 'tname' => 'Administrator', 'tmessage' => getstring("demo.chat.welcome")), $outformat);
            demo_print_message(array('ikind' => $kind_user, 'created' => time() - 5, 'tname' => getstring("chat.default.username"), 'tmessage' => getstring("demo.chat.question")), $outformat);
            if ($canpost && $outformat == 'xml') {
                demo_print_message(array('ikind' => $kind_info, 'created' => time() - 5, 'tname' => '', 'tmessage' => 'Hint: type something in message field to see typing notification'), $outformat);
            }
        }
        if ($act == 'post') {
            demo_print_message(array('ikind' => $isuser ? $kind_user : $kind_agent, 'created' => time(), 'tmessage' => $postmessage, 'tname' => $isuser ? getstring("chat.default.username") : "Administrator"), $outformat);
        }
        if ($outformat == "xml") {
            print "</thread>";
        } else {
            print "</td></tr></table><a name='aend'></a>" . "</body></html>";
        }
    }
}
开发者ID:paulcn,项目名称:mibew,代码行数:34,代码来源:demothread.php

示例2: getInstruments

 public function getInstruments()
 {
     //$instruments = [];
     $settings = loadsettings();
     $instruments = $settings['oanda']['pairs'];
     return $instruments;
 }
开发者ID:neilmillard,项目名称:fxtrader,代码行数:7,代码来源:StrategiesAction.php

示例3: setUp

 public function setUp()
 {
     // load the $settings
     require_once __DIR__ . '/../loadsettings.php';
     $settings = loadsettings();
     $this->settings = $settings;
     $setup['settings'] = $settings;
     $container = new Container($setup);
     $this->container = $container;
     // Set up dependencies
     require_once __DIR__ . '/../dependencies.php';
 }
开发者ID:neilmillard,项目名称:fxtrader,代码行数:12,代码来源:Job.php

示例4: setup_operator_settings_tabs

function setup_operator_settings_tabs($opId, $active)
{
    global $page, $webimroot, $settings;
    loadsettings();
    if ($opId) {
        if ($settings['enablegroups'] == '1') {
            $page['tabs'] = array(getlocal("page_agent.tab.main") => $active != 0 ? "{$webimroot}/operator/operator.php?op={$opId}" : "", getlocal("page_agent.tab.avatar") => $active != 1 ? "{$webimroot}/operator/avatar.php?op={$opId}" : "", getlocal("page_agent.tab.groups") => $active != 2 ? "{$webimroot}/operator/opgroups.php?op={$opId}" : "", getlocal("page_agent.tab.permissions") => $active != 3 ? "{$webimroot}/operator/permissions.php?op={$opId}" : "");
        } else {
            $page['tabs'] = array(getlocal("page_agent.tab.main") => $active != 0 ? "{$webimroot}/operator/operator.php?op={$opId}" : "", getlocal("page_agent.tab.avatar") => $active != 1 ? "{$webimroot}/operator/avatar.php?op={$opId}" : "", getlocal("page_agent.tab.permissions") => $active != 3 ? "{$webimroot}/operator/permissions.php?op={$opId}" : "");
        }
    } else {
        $page['tabs'] = array();
    }
}
开发者ID:laiello,项目名称:cartonbank,代码行数:14,代码来源:operator_settings.php

示例5: setup_operator_settings_tabs

function setup_operator_settings_tabs($opId, $active)
{
    global $page, $mibewroot, $settings;
    loadsettings();
    if ($opId) {
        if ($settings['enablegroups'] == '1') {
            $page['tabs'] = array(array('title' => getlocal("page_agent.tab.main"), 'link' => "{$mibewroot}/operator/operator.php?op={$opId}"), array('title' => getlocal("page_agent.tab.avatar"), 'link' => "{$mibewroot}/operator/avatar.php?op={$opId}"), array('title' => getlocal("page_agent.tab.groups"), 'link' => "{$mibewroot}/operator/opgroups.php?op={$opId}"), array('title' => getlocal("page_agent.tab.permissions"), 'link' => "{$mibewroot}/operator/permissions.php?op={$opId}"));
        } else {
            $page['tabs'] = array(array('title' => getlocal("page_agent.tab.main"), 'link' => "{$mibewroot}/operator/operator.php?op={$opId}"), array('title' => getlocal("page_agent.tab.avatar"), 'link' => "{$mibewroot}/operator/avatar.php?op={$opId}"), array('title' => getlocal("page_agent.tab.permissions"), 'link' => "{$mibewroot}/operator/permissions.php?op={$opId}"));
            if ($active == 3) {
                $active--;
            }
        }
        $page['tabselected'] = $active;
    } else {
        $page['tabs'] = array();
    }
}
开发者ID:kuell,项目名称:chat,代码行数:18,代码来源:operator_settings.php

示例6: getsetting

function getsetting($settingname, $default)
{
    global $settings;
    global $DB_USEDATACACHE, $DB_DATACACHEPATH;
    if ($settingname == "usedatacache") {
        return $DB_USEDATACACHE;
    } elseif ($settingname == "datacachepath") {
        return $DB_DATACACHEPATH;
    }
    if (!isset($settings[$settingname])) {
        loadsettings();
    } else {
        return $settings[$settingname];
    }
    if (!isset($settings[$settingname])) {
        savesetting($settingname, $default);
        return $default;
    } else {
        return $settings[$settingname];
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:21,代码来源:settings.php

示例7: getsetting

function getsetting(string $settingname, $default)
{
    global $settings, $DB_USEDATACACHE, $DB_DATACACHEPATH;
    if ($settingname == 'usedatacache') {
        return $DB_USEDATACACHE;
    } else {
        if ($settingname == 'datacachepath') {
            return $DB_DATACACHEPATH;
        }
    }
    if (!isset($settings[$settingname])) {
        loadsettings();
    } else {
        return $settings[$settingname];
    }
    if (!isset($settings[$settingname])) {
        savesetting($settingname, $default);
        return $default;
    } else {
        return $settings[$settingname];
    }
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:22,代码来源:settings.php

示例8: check_status

function check_status()
{
    global $page, $webimroot, $settings, $dbversion;
    $page['done'][] = getlocal2("install.0.php", array(phpversion()));
    if (!check_webimroot()) {
        return;
    }
    if (!check_files()) {
        return;
    }
    $link = check_connection();
    if (!$link) {
        return;
    }
    if (!check_database($link)) {
        mysql_close($link);
        return;
    }
    if (!check_tables($link)) {
        mysql_close($link);
        return;
    }
    if (!check_columns($link)) {
        mysql_close($link);
        return;
    }
    check_sound();
    $page['done'][] = getlocal("installed.message");
    if (!check_admin($link)) {
        $page['nextstep'] = getlocal("installed.login_link");
        $page['nextnotice'] = getlocal2("installed.notice", array("{$webimroot}/install/"));
        $page['nextstepurl'] = "{$webimroot}/operator/login.php?login=admin";
    }
    $page['show_small_login'] = true;
    mysql_close($link);
    loadsettings();
    $settings['dbversion'] = $dbversion;
    update_settings();
}
开发者ID:paulcn,项目名称:mibew,代码行数:39,代码来源:index.php

示例9: getchatstyle

function getchatstyle()
{
    global $settings;
    $chatstyle = verifyparam("style", "/^\\w+\$/", "");
    if ($chatstyle) {
        return $chatstyle;
    }
    loadsettings();
    return $settings['chatstyle'];
}
开发者ID:eMagicMan,项目名称:Study-CSharp,代码行数:10,代码来源:common.php

示例10: setup_chatview_for_operator

function setup_chatview_for_operator($thread, $operator)
{
    global $page, $webimroot, $company_logo_link, $company_name, $settings;
    loadsettings();
    $page = array();
    $page['agent'] = true;
    $page['user'] = false;
    $page['canpost'] = $thread['agentId'] == $operator['operatorid'];
    $page['ct.chatThreadId'] = $thread['threadid'];
    $page['ct.token'] = $thread['ltoken'];
    $page['ct.user.name'] = htmlspecialchars(topage(get_user_name($thread['userName'], $thread['remote'], $thread['userid'])));
    $page['chat.title'] = topage($settings['chattitle']);
    setup_logo();
    if ($settings['sendmessagekey'] == 'enter') {
        $page['send_shortcut'] = "Enter";
        $page['ignorectrl'] = 1;
    } else {
        $page['send_shortcut'] = is_mac_opera() ? "&#8984;-Enter" : "Ctrl-Enter";
        $page['ignorectrl'] = 0;
    }
    if ($settings['enablessl'] == "1" && !is_secure_request()) {
        $page['sslLink'] = get_app_location(true, true) . "/operator/agent.php?thread=" . $thread['threadid'] . "&amp;token=" . $thread['ltoken'];
    }
    $page['isOpera95'] = is_agent_opera95();
    $page['neediframesrc'] = needsFramesrc();
    $page['historyParams'] = array("userid" => "" . $thread['userid']);
    $page['historyParamsLink'] = add_params($webimroot . "/operator/userhistory.php", $page['historyParams']);
    $predefinedres = "";
    $canned_messages = load_canned_messages($thread['locale'], $thread['groupid']);
    foreach ($canned_messages as $answer) {
        $predefinedres .= "<option>" . htmlspecialchars(topage($answer['vcvalue'])) . "</option>";
    }
    $page['predefinedAnswers'] = $predefinedres;
    $params = "thread=" . $thread['threadid'] . "&amp;token=" . $thread['ltoken'];
    $page['redirectLink'] = "{$webimroot}/operator/agent.php?" . $params . "&amp;act=redirect";
    $page['namePostfix'] = "";
    $page['frequency'] = $settings['updatefrequency_chat'];
}
开发者ID:laiello,项目名称:cartonbank,代码行数:38,代码来源:chat.php

示例11: prepare_menu

function prepare_menu($operator, $hasright = true)
{
    global $page, $settings, $can_administrate, $can_viewnotifications;
    $page['operator'] = topage(get_operator_name($operator));
    if ($hasright) {
        loadsettings();
        $page['showban'] = $settings['enableban'] == "1";
        $page['showgroups'] = $settings['enablegroups'] == "1";
        $page['showstat'] = $settings['enablestatistics'] == "1";
        $page['shownotifications'] = is_capable($can_viewnotifications, $operator);
        $page['showadmin'] = is_capable($can_administrate, $operator);
        $page['currentopid'] = $operator['operatorid'];
    }
}
开发者ID:kuell,项目名称:chat,代码行数:14,代码来源:operator.php

示例12: getsetting

function getsetting($settingname, $default)
{
    global $settings;
    loadsettings();
    if (!isset($settings[$settingname])) {
        savesetting($settingname, $default);
        return $default;
    } else {
        if (trim($settings[$settingname]) == "") {
            $settings[$settingname] = $default;
        }
        return $settings[$settingname];
    }
}
开发者ID:BackupTheBerlios,项目名称:dragonsaga-svn,代码行数:14,代码来源:common.php

示例13: insertobject

function insertobject($object, $taglevel, $charinfo = array(), $offset = 0)
{
    global $settings, $cfg;
    if (!preg_match('/^([0-9]+),([0-9]+)$/', $object->coords, $coords)) {
        return;
    }
    //not be able to set object properly without coords
    loadsettings($object, $taglevel);
    foreach ($object->attributes() as $attributeskey => $attributesvalue) {
        $attributes[$attributeskey] = "" . $attributesvalue;
    }
    switch ($attributes['class']) {
        case "symbol_land":
            $picture = "symbol_land";
            break;
        case "symbol_sea":
            $picture = "symbol_sea";
            break;
        case "symbol_class":
            if (!$charinfo['jobclass']) {
                return;
            }
            switch ($charinfo['jobclass']) {
                case "Saint":
                    $picture = "class_s";
                    break;
                case "Shaman":
                    $picture = "class_s";
                    break;
                case "Priest":
                    $picture = "class_s";
                    break;
                case "Noble":
                    $picture = "class_n";
                    break;
                case "Court Magician":
                    $picture = "class_n";
                    break;
                case "Magic Knight":
                    $picture = "class_n";
                    break;
                case "Mercenary":
                    $picture = "class_w";
                    break;
                case "Guardian Swordsman":
                    $picture = "class_w";
                    break;
                case "Gladiator":
                    $picture = "class_w";
                    break;
                case "Explorer":
                    $picture = "class_e";
                    break;
                case "Sniper":
                    $picture = "class_e";
                    break;
                case "Excavator":
                    $picture = "class_e";
                    break;
                default:
                    return;
            }
            break;
        default:
            return;
    }
    $picture = $cfg['signature_abs'] . "/objects/" . $picture;
    if (!is_file($picture)) {
        return;
    }
    // load objectpicture
    global $Teilgrafik;
    $info = getimagesize($picture);
    if ($info[2] == 2) {
        //JPEG / JPG
        $objectpicture = imagecreatefromjpeg($picture);
    } elseif ($info[2] == 3) {
        //PNG
        $objectpicture = imagecreatefrompng($picture);
    } elseif ($info[2] == 1) {
        // GIF
        $objectpicture = imagecreatefromgif($picture);
    } else {
        //BMP
        require_once $cfg['root_abs'] . "/convertbmp.php";
        $objectpicture = imagecreatefrombmp($picture);
    }
    //some global options (not in loadsettings()?)
    // 	if (isset($object->transparency) && 0<intval($object->transparency)) {
    // 		$transparency = $object->transparency+0;
    // 	}
    // 	else { $transparency = 100; }
    $width = imagesx($objectpicture);
    $height = imagesy($objectpicture);
    if (isset($object->height) && 0 < intval($object->height)) {
        $height = $object->height + 0;
        if (!$object->width) {
            //if only height set, resize in width
            $width = ceil(imagesx($objectpicture) * ($height / imagesy($objectpicture)));
        }
//.........这里部分代码省略.........
开发者ID:Rellfy,项目名称:florensia-base,代码行数:101,代码来源:signature.php

示例14: loadsettings

<?php

function loadsettings()
{
    // Instantiate the app
    $path = __DIR__ . '/../app/settings.php';
    if (!file_exists($path)) {
        $settings = (require __DIR__ . '/../app/settings_dist.php');
    } else {
        $settings = (require $path);
    }
    return $settings;
}
$settings = ['settings' => loadsettings()];
开发者ID:neilmillard,项目名称:fxtrader,代码行数:14,代码来源:loadsettings.php

示例15: workers

 public function workers(Request $request, Response $response, array $args)
 {
     $data = [];
     $settings = loadsettings();
     $REDIS_BACKEND = $settings['resque']['REDIS_BACKEND'];
     if (!empty($REDIS_BACKEND)) {
         \Resque::setBackend($REDIS_BACKEND);
     }
     $workerlist = \Resque_Worker::all();
     $workers = [];
     foreach ($workerlist as $worker) {
         $job = $worker->job();
         if (empty($job)) {
             $job = "Idle";
         }
         $workers[] = ['name' => (string) $worker, 'job' => $job];
     }
     $data['workers'] = $workers;
     $this->view->render($response, 'workers.twig', $data);
     return $response;
 }
开发者ID:neilmillard,项目名称:fxtrader,代码行数:21,代码来源:QueuesAction.php


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