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


PHP getConf函数代码示例

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


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

示例1: testTemplate

 public function testTemplate()
 {
     newConf('tpl', "\ncomponents:\n  tpl:\n    template_dir: " . dirname(__FILE__) . "/view\n    compile_dir:  " . dirname(__FILE__) . "/view/_compile\n    config_dir:   " . dirname(__FILE__) . "/view/_config\n    cache_dir:    " . dirname(__FILE__) . "/view/_cache\n");
     $site = new Site(getConf('tpl'));
     $site->tpl->display('test.tpl');
     killConf('tpl');
 }
开发者ID:ericpridham,项目名称:site,代码行数:7,代码来源:SiteTplTest.php

示例2: cron_main

/**
 * main cron function
 * @return string
 */
function cron_main()
{
    global $config;
    // always send reminders and reminders
    churchcore_sendReminders();
    churchcore_sendMails();
    if (getVar("standby")) {
        // email with feedback image
        if ($id = getVar("mailqueue_id")) {
            db_query("UPDATE {cc_mail_queue} \n                SET reading_count = reading_count + 1 \n                WHERE id=:id", array(":id" => $id));
        }
        // Check if it's time to do a normal cron job
        if (getConf("cronjob_delay") > 0) {
            $last_cron = db_query("SELECT value old,  UNIX_TIMESTAMP() act \n                             FROM {cc_config} \n                             WHERE name='last_cron'")->fetch();
            if ($last_cron) {
                if ($last_cron->act - $config["cronjob_delay"] > $last_cron->old) {
                    db_query("UPDATE {cc_config} \n                    SET VALUE= UNIX_TIMESTAMP() \n                    WHERE name='last_cron'");
                    do_cron();
                }
            }
        }
        header('Content-Type: image/gif');
        //tiniest transparent GIF, credit: http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever
        echo base64_decode('R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
    } else {
        do_cron();
        if (getVar("manual")) {
            addInfoMessage(t("cronjob.succeed"));
            return " ";
        }
    }
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:36,代码来源:cron.php

示例3: getMasterData

 /**
  * @see CTModuleInterface::getMasterData()
  */
 public function getMasterData()
 {
     global $user;
     $res = array();
     include_once CHURCHCAL . '/churchcal_db.php';
     $res = $this->getMasterDataTables();
     $res["masterDataTables"] = $this->getMasterDataTablenames();
     $res["entriesLastDays"] = getConf("churchresource_entries_last_days", 90);
     $res["auth"] = churchresource_getAuthForAjax();
     $res["status"] = churchcore_getTableData("cr_status");
     $res["minutes"] = churchcore_getTableData("cr_minutes");
     $res["hours"] = churchcore_getTableData("cr_hours");
     $res["repeat"] = churchcore_getTableData("cc_repeat");
     $res["cdb_bereich"] = churchcore_getTableData("cdb_bereich");
     $res["cdb_status"] = churchcore_getTableData("cdb_status");
     $res["cdb_station"] = churchcore_getTableData("cdb_station");
     $res["modulename"] = $this->getModuleName();
     $res["modulespath"] = $this->getModulePath();
     $res["userid"] = $user->cmsuserid;
     // CMS Username#
     $res["user_pid"] = $user->id;
     $res["user_name"] = "{$user->vorname} {$user->name}";
     $res["settings"] = $this->getSettings();
     $res["lastLogId"] = churchresource_getLastLogId();
     $res["churchcal_name"] = getConf('churchcal_name');
     $res["category"] = churchcore_getTableData("cc_calcategory", null, null, "id, color, bezeichnung");
     $res["views"] = array("WeekView" => array("filename" => "cr_weekview"), "MaintainView" => array("filename" => "cr_maintainview"));
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:32,代码来源:CTChurchResourceModule.class.php

示例4: testDataFiles

    public function testDataFiles()
    {
        newConf('df', "components:\n  df:\n    files_path: /var/www/imagineapuddle.com/www/siteplay/site/test/files/\n");
        if (!file_exists(dirname(__FILE__) . '/files/')) {
            mkdir(dirname(__FILE__) . '/files/');
        }
        if (!file_exists(dirname(__FILE__) . '/files/test/')) {
            mkdir(dirname(__FILE__) . '/files/test/');
        }
        file_put_contents(dirname(__FILE__) . '/files/test/testfile', 'Title: A Bing-a-bong
Bar Biz: Bang

Content
');
        $site = new Site(getConf('df'));
        $this->assertType('SiteDataFilesController', $site->df);
        $this->assertType('SiteDataFiles', $site->df->test);
        $f = $site->df->test->get(array('title' => 'A Bing-a-bong'));
        $this->assertType('SiteDataFile', $f);
        $this->assertEquals($f->title, 'A Bing-a-bong');
        $this->assertEquals($f->bar_biz, 'Bang');
        $this->assertEquals($f->content, "Content\n");
        $f = $site->df->test->get(array('title' => 'Not-a-Title'));
        $this->assertNull($f);
        unlink(dirname(__FILE__) . '/files/test/.index');
        unlink(dirname(__FILE__) . '/files/test/testfile');
        rmdir(dirname(__FILE__) . '/files/test/');
        rmdir(dirname(__FILE__) . '/files/');
        killConf('df');
    }
开发者ID:ericpridham,项目名称:site,代码行数:30,代码来源:SiteDFTest.php

示例5: getMasterData

 /**
  *
  * @see CTModuleInterface::getMasterData()
  */
 public function getMasterData()
 {
     global $user, $base_url, $files_dir, $config;
     include_once CHURCHCAL . '/churchcal_db.php';
     $auth = churchservice_getAuthorization();
     $res = $this->getMasterDataTables();
     $res["masterDataTables"] = $this->getMasterDataTablenames();
     $res["auth"] = $auth;
     $res["modulespath"] = churchservice_getModulesPath();
     $res["base_url"] = $base_url;
     $res["files_url"] = $base_url . $files_dir;
     $res["files_dir"] = $files_dir;
     $res["modulename"] = "churchservice";
     $res["adminemail"] = getConf('site_mail', '');
     $res["user_pid"] = $user->id;
     $res["user_name"] = $user->vorname . " " . $user->name;
     $res["userid"] = $user->cmsuserid;
     $res["settings"] = churchservice_getUserSettings($user->id);
     $res["notification"] = churchcore_getMyNotifications();
     $res["notificationtype"] = churchcore_getTableData("cc_notificationtype");
     $res["lastLogId"] = churchservice_getLastLogId();
     $res["eventtemplate"] = churchcore_getTableData("cs_eventtemplate", "sortkey");
     $res["category"] = churchcal_getAllowedCategories(false);
     $res["repeat"] = churchcore_getTableData("cc_repeat");
     $res["eventtemplate_services"] = churchservice_getEventtemplateServices($auth);
     $res["churchcal_name"] = $config["churchcal_name"];
     $res["churchservice_name"] = $config["churchservice_name"];
     $res["songwithcategoryasdir"] = getConf("churchservice_songwithcategoryasdir", "0");
     $res["songcategory"] = churchcore_getTableData("cs_songcategory", "sortkey");
     $res["views"] = array("ListView" => array("filename" => "cs_listview"), "SettingsView" => array("filename" => "cs_settingsview"), "CalView" => array("filename" => "cs_calview"), "SongView" => array("filename" => "cs_songview"), "AgendaView" => array("filename" => "cs_agendaview"), "FactView" => array("filename" => "cs_factview"), "MaintainView" => array("filename" => "cs_maintainview"));
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:36,代码来源:CTChurchServiceModule.class.php

示例6: testAddons

    public function testAddons()
    {
        newConf('addons', "\naddon_path: " . dirname(__FILE__) . "/addons1/:" . dirname(__FILE__) . "/addons2/\n");
        if (!file_exists(dirname(__FILE__) . '/addons1/')) {
            mkdir(dirname(__FILE__) . '/addons1/');
        }
        if (!file_exists(dirname(__FILE__) . '/addons2/')) {
            mkdir(dirname(__FILE__) . '/addons2/');
        }
        file_put_contents(dirname(__FILE__) . '/addons1/addon1.php', '
<?php
class SiteAddon1 extends SiteComponent {
}
?>
');
        file_put_contents(dirname(__FILE__) . '/addons2/addon2.php', '
<?php
class SiteAddon2 extends SiteComponent {
}
?>
');
        $site = new Site(getConf('addons'));
        $this->assertType('SiteAddon1', $site->addon1);
        $this->assertType('SiteAddon2', $site->addon2);
        unlink(dirname(__FILE__) . '/addons1/addon1.php');
        unlink(dirname(__FILE__) . '/addons2/addon2.php');
        rmdir(dirname(__FILE__) . '/addons1/');
        rmdir(dirname(__FILE__) . '/addons2/');
        killConf('addons');
    }
开发者ID:ericpridham,项目名称:site,代码行数:30,代码来源:SiteTest.php

示例7: getMasterData

 /**
  * get MasterData
  *
  * @return array with objects
  *
  */
 public function getMasterData()
 {
     global $config;
     $res = array();
     $res["auth_table_plain"] = getAuthTable();
     foreach ($res["auth_table_plain"] as $auth) {
         if ($auth->datenfeld && !isset($res[$auth->datenfeld])) {
             $res[$auth->datenfeld] = churchcore_getTableData($auth->datenfeld);
         }
     }
     $res["modules"] = churchcore_getModulesSorted(true, false);
     $res["person"] = churchcore_getTableData("cdb_person", "name, vorname", null, "id, concat(name, ', ', vorname) as bezeichnung");
     $res["person"][-1] = new stdClass();
     $res["person"][-1]->id = -1;
     $res["person"][-1]->bezeichnung = "- " . t("public.user") . " -";
     $res["publiccalendar_name"] = getConf("churchcal_maincalname", "Church Calendar");
     $res["gruppe"] = churchcore_getTableData("cdb_gruppe", null, null, "id, bezeichnung");
     $res["status"] = churchcore_getTableData("cdb_status");
     $res["category"] = churchcore_getTableData("cc_calcategory", null, null, "id, bezeichnung, privat_yn, oeffentlich_yn");
     $res["modulename"] = "churchcore";
     $res["admins"] = $config["admin_ids"];
     $auths = churchcore_getTableData("cc_domain_auth");
     if ($auths) {
         foreach ($auths as $auth) {
             $domaintype = array();
             // initalize $res[domain_tye]
             if (isset($res[$auth->domain_type])) {
                 $domaintype = $res[$auth->domain_type];
             }
             $object = new stdClass();
             if (isset($domaintype[$auth->domain_id])) {
                 $object = $domaintype[$auth->domain_id];
             } else {
                 $object->id = $auth->domain_id;
                 if (isset($db[$auth->domain_type][$auth->domain_id])) {
                     $object->bezeichnung = $db[$auth->domain_type][$auth->domain_id]->bezeichnung;
                 } else {
                     $object->bezeichnung = t("non.existent");
                 }
             }
             if ($auth->daten_id == null) {
                 $object->auth[$auth->auth_id] = $auth->auth_id;
             } else {
                 if (!isset($object->auth[$auth->auth_id])) {
                     $object->auth[$auth->auth_id] = array();
                 }
                 $object->auth[$auth->auth_id][$auth->daten_id] = $auth->daten_id;
             }
             $domaintype[$auth->domain_id] = $object;
             $res[$auth->domain_type] = $domaintype;
         }
     }
     foreach (churchcore_getModulesSorted() as $name) {
         if (isset($config[$name . "_name"])) {
             $res["names"][$name] = $config[$name . "_name"];
         }
     }
     return $res;
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:65,代码来源:CTAuthModule.class.php

示例8: getOverloadConf

/**
 * Get overloaded configuration value
 *
 * @param string $path Config path
 *
 * @return null|string
 */
function getOverloadConf($path)
{
    include __DIR__ . "/../includes/config_overload.php";
    if (empty($dPconfig)) {
        return null;
    }
    return getConf($path, $dPconfig);
}
开发者ID:fbone,项目名称:mediboard4,代码行数:15,代码来源:getConfig.php

示例9: __construct

 public function __construct()
 {
     $application = getConf();
     $database = getConf()['database'];
     $host = getConf()['host'];
     $port = getConf()['port'];
     parent::__construct("mysql:dbname={$database};" . "host={$host};" . "port={$port};", getConf()['user'], getConf()['password']);
 }
开发者ID:bigeyessolution,项目名称:FestivalEdesio,代码行数:8,代码来源:Database.php

示例10: parseaddons

function parseaddons($addonspath, $filename, $shop_lang)
{
    global $modx, $modulea, $moduleid, $tables, $tsvshop;
    $out = "";
    $tmp = "";
    $temp = "";
    $num = 1;
    $lang = isset($lang) ? $lang : $modx->config['manager_language'];
    //$filename=$modx->config['base_path'].'assets/snippets/tsvshop/admin/tpl/addonstable.tpl';
    $tpl = get_file_contents($filename);
    if (!empty($addonspath) && !empty($filename)) {
        $folders = scandir($addonspath, 1);
        foreach ($folders as $folder) {
            if ($folder != "." && $folder != ".." && file_exists($addonspath . $folder . "/main.inc.php")) {
                $temp = str_replace('[+moduleid+]', $_GET['id'], $tpl);
                $temp = str_replace('[+lang+]', $lang, $temp);
                $temp = str_replace('[+num+]', $num++, $temp);
                $temp = str_replace('[+addon+]', $shop_lang[$folder . '_title'], $temp);
                if (is_install($folder)) {
                    if ($tables[$folder] == "system") {
                        $temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
                    } else {
                        $temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonuninstall&addon=' . $folder . '" title="' . $shop_lang['addons_uninstall'] . '" onclick="uninstall(\'' . $shop_lang['addons_uninstall_question'] . '\');return false"><img src="' . TSVSHOP_SURL . 'addons/addons/img/uninstall.png" alt="' . $shop_lang['addons_uninstall'] . '" /></a>', $temp);
                    }
                    if (getConf("addons", $folder . "_active") == "yes") {
                        if ($tables[$folder] == "system") {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
                        } else {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_on.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonoff&addon=' . $folder . '" title="' . $shop_lang['addons_off_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_off_act'] . '" /></a>', $temp);
                        }
                    } else {
                        if ($tables[$folder] == "system") {
                            $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="" />', $temp);
                        } else {
                            $temp = str_replace('[+status+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addonon&addon=' . $folder . '" title="' . $shop_lang['addons_on_act'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on_act'] . '" /></a> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_off.png" alt="' . $shop_lang['addons_off'] . '" title="' . $shop_lang['addons_off'] . '" />', $temp);
                        }
                    }
                } else {
                    if ($tables[$folder] == "system") {
                        $temp = str_replace('[+actions+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/system.png" alt="" />', $temp);
                        $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
                    } else {
                        $temp = str_replace('[+actions+]', '<a href="/' . MGR_DIR . '/index.php?id=' . $moduleid . '&a=' . $modulea . '&act=addoninstall&addon=' . $folder . '" title="' . $shop_lang['addons_install'] . '"><img src="' . TSVSHOP_SURL . 'addons/addons/img/install.png" alt="' . $shop_lang['addons_install'] . '" /></a>', $temp);
                        $temp = str_replace('[+status+]', '<img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" /> <img src="' . TSVSHOP_SURL . 'addons/addons/img/addon_un.png" alt="' . $shop_lang['addons_on'] . '" title="' . $shop_lang['addons_on'] . '" />', $temp);
                    }
                }
                $temp = str_replace('[+description+]', $shop_lang[$folder . '_desc'], $temp);
                $out .= $temp;
            }
        }
        $out = preg_replace('/(\\[\\+.*?\\+\\])/', '', $out);
        return $out;
    } else {
        return "";
    }
}
开发者ID:myindexlike,项目名称:tsvshop,代码行数:56,代码来源:functions.inc.php

示例11: __construct

 public function __construct($modulename)
 {
     global $config;
     parent::__construct("AdminForm_{$modulename}", "admin_saveSettings");
     if ($m = getConf($modulename . "_name")) {
         $this->addField($modulename . "_inmenu", "", "CHECKBOX", t("add.to.menu", $m))->setValue(getConf($modulename . "_inmenu", "0"));
         $this->addField($modulename . "_startbutton", "", "CHECKBOX", t('show.as.button.on.home', $m))->setValue(getConf($modulename . "_startbutton", "0"));
         $this->addField($modulename . "_sortcode", "", "INPUT_REQUIRED", t('sortorder.in.menu'))->setValue(getConf($modulename . "_sortcode", "0"));
     }
 }
开发者ID:toXel,项目名称:churchtools_basic,代码行数:10,代码来源:CTModuleForm.class.php

示例12: getDatabaseConnection

function getDatabaseConnection()
{
    $conf = getConf();
    $db = $conf['db'];
    $databaseConnection = new mysqli($db['host'], $db['username'], $db['password'], $db['name']);
    if ($databaseConnection->connect_error) {
        throw new Exception("Could not connect to database.");
    }
    return $databaseConnection;
}
开发者ID:WBittner,项目名称:Warkle2,代码行数:10,代码来源:Connect.php

示例13: churchresource_getAdminForm

/**
 * form for admin seddings
 * @return CTModuleForm
 */
function churchresource_getAdminForm()
{
    global $config;
    $model = new CTModuleForm("churchresource");
    $model->addField("churchresource_entries_last_days", "", "INPUT_REQUIRED", t('data.from.x.how.many.days.in.the.past.to.load', 'ChurchResource'))->setValue($config["churchresource_entries_last_days"]);
    if (getConf("churchresource_send_emails", null) == null) {
        $config["churchresource_send_emails"] = true;
    }
    $model->addField("churchresource_send_emails", "", "CHECKBOX", t('enable.sending.emails'))->setValue($config["churchresource_send_emails"]);
    return $model;
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:15,代码来源:churchresource.php

示例14: logout_main

function logout_main()
{
    logout_current_user();
    // When called per tool (api), then offer a JSEND-answer
    if (isset($_POST['directtool'])) {
        include_once CHURCHCORE . '/churchcore_db.php';
        drupal_json_output(jsend()->success());
    } else {
        header("Location: ?q=" . getConf("site_startpage", "home"));
    }
}
开发者ID:toXel,项目名称:churchtools_basic,代码行数:11,代码来源:logout.php

示例15: testDBs

 public function testDBs()
 {
     newConf('dbs', "\ncomponents:\n  dbs:\n    rw:\n      model: true\n      pool:\n        - host: localhost\n          username: fake\n          password: fake\n          database: fake\n        - host: localhost\n          username: sitetest\n          password: st123\n          database: sitetest_rw2\n    ro:\n      model: true\n      host: localhost\n      username: sitetest\n      password: st123\n      database: sitetest_ro1\n\n    rw1:\n      model: true\n      host: localhost\n      username: sitetest\n      password: st123\n      database: sitetest_rw1\n    ro1:\n      model: true\n      host: localhost\n      username: sitetest\n      password: st123\n      database: sitetest_ro1\n");
     $site = new Site(getConf('dbs'));
     $this->assertType('SiteDatabase', $site->dbs->rw);
     $this->assertType('SiteDatabase', $site->dbs->ro);
     $this->assertFalse($site->dbs->rw === $site->dbs->ro);
     $this->assertType('null', $site->dbs->notadb);
     $site->dbs->ro1->ro1->all(1);
     $site->dbs->rw1->rw1->all(1);
     killConf('dbs');
 }
开发者ID:ericpridham,项目名称:site,代码行数:12,代码来源:SiteDBsTest.php


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