本文整理汇总了PHP中Conf::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Conf::getInstance方法的具体用法?PHP Conf::getInstance怎么用?PHP Conf::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conf
的用法示例。
在下文中一共展示了Conf::getInstance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setConexion
private function setConexion()
{
$conf = Conf::getInstance();
$this->db_host = $conf->getHostDB();
$this->db_name = $conf->getNameDB();
$this->db_user = $conf->getUserDB();
$this->db_pass = $conf->getPassDB();
}
示例2: setConexion
private function setConexion()
{
$conf = Conf::getInstance();
$this->servidor = $conf->getHostDB();
$this->base_datos = $conf->getDB();
$this->usuario = $conf->getUserDB();
$this->password = $conf->getPassDB();
}
示例3: cached_curl_exec
function cached_curl_exec($ch)
{
if (Conf::getInstance("main")->get("cache", "on") == "yes") {
$id = "" . $ch->options[CURLOPT_URL];
$contents = Cache::get($id);
if ($contents == null) {
$contents = curl_exec($ch);
Cache::set($id, $contents);
}
return $contents;
} else {
return curl_exec($ch);
}
}
示例4: init
/**
* Initialize the application
*/
public function init()
{
// Load the application configuration
$this->singleton('conf', Conf::getInstance());
// Load the application error Handler
$this->singleton('errorHandler', ErrorHandler::getInstance());
// Load the application logger
$this->singleton('logger', Logger::getInstance());
// Load the filesystem library
$this->singleton('fs', FileSystem::getInstance());
// Load the application session
$this->singleton('session', Session::getInstance());
// Load the application router
$this->singleton('router', Router::getInstance());
// Load the application HTTP request
$this->singleton('request', Request::getInstance());
// Load the application HTTP response
$this->singleton('response', Response::getInstance());
// Load the application cache
$this->singleton('cache', Cache::getInstance());
}
示例5: setConexion
private function setConexion($db_name)
{
$conf = Conf::getInstance();
$this->hostname = $conf->getHostDB();
$this->user = $conf->getUserDB();
$this->password = $conf->getPassDB();
$this->dbname = $db_name;
}
示例6:
<?
global $mainConf;
$pageId = Conf::getInstance("accounts")->get("facebook", "pageId")
?>
示例7: chdir
<?
chdir("..");
require_once 'library/conf.php';
require_once 'library/text2image.php';
$conf = Conf::getInstance("private");
text2image(16, $conf->get("contact", "fax"));
?>
示例8: foreach
<?
require_once 'code/audio.php';
$config= "";
foreach(Conf::getInstance("main")->get("music_player_options") as $name=>$value)
$config.= "<parameter name=\"$name\" value=\"$value\"/>";
?>
示例9: Facebook
<?
require 'facebook/facebook.php';
require_once 'library/conf.php';
$conf = Conf::getInstance("main");
$accounts = Conf::getInstance("accounts");
Query::$facebook = new Facebook(array(
'appId' => $accounts->get("facebook", "appId"),
'secret' => $accounts->get("facebook", "secret"),
'cookie' => true, // enable optional cookie support
));
Query::$pageId = $accounts->get("facebook", "pageId");
class Query
{
static $facebook;
static $pageId;
static function getObject($address="", $base=null)
{
$page = Query::$pageId;
if($base == null) $base = "$page/";
$uri = "/$base$address";
return Query::$facebook->api($uri);
}
static function getEventsIds()
{
$feedItems = Query::getObject("feed");
$result = array();
foreach($feedItems["data"] as $item)
{
$pattern = "event.php?eid=";
$link = $item["link"];
$pos = strpos($link, $pattern);
示例10:
</label>
</td>
<td>
<input type="text" name="buscarCentroCosto" id="buscarCentroCosto" value="" autocomplete="on" onfocus="llenarConsultaLista('CentroCosto',document.getElementById('buscarCentroCosto'));" onclick="xajax_llenarCentroCosto(document.getElementById('filtroCentroCosto').innerHTML, document.getElementById('buscarCentroCosto').value.replace('*','%').replace('*','%'), '','', 1)"/>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<?php
require_once '../clases/db.class.php';
require_once '../clases/conf.class.php';
$conf = Conf::getInstance();
$sql = "select TABLE_NAME, TABLE_ROWS from INFORMATION_SCHEMA.TABLES \n where TABLE_NAME = 'Conectividad' and TABLE_SCHEMA= '" . $conf->getDB() . "' ";
//echo $sql;
/*Ejecutamos la query*/
$bd = Db::getInstance();
$query = $bd->ConsultarVista($sql);
if ($query[0]['TABLE_ROWS'] > 0) {
?>
<tr>
<td>
<label>Bases de Datos</label>
</td>
<td>
<input type="text" id="buscarConectividad" name="buscarConectividad" value="" style="width: 250px;" autocomplete="off" onfocus="llenarConsultaLista('Conectividad',document.getElementById('buscarConectividad'));" onclick="xajax_llenarConectividad(document.getElementById('filtroConectividad').innerHTML, document.getElementById('buscarConectividad').value.replace('*','%').replace('*','%'), '',1)">
</td>
</tr>
示例11: foreach
<?
require_once 'library/conf.php';
$menuItems="";
foreach(Conf::getInstance("main")->get("menu_names") as $id=>$name)
$menuItems .= "<item id=\"$id\">$name</item>";
?>