示例#1
0
 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
0
 private function setConexion()
 {
     $conf = Conf::getInstance();
     $this->servidor = $conf->getHostDB();
     $this->base_datos = $conf->getDB();
     $this->usuario = $conf->getUserDB();
     $this->password = $conf->getPassDB();
 }
示例#3
0
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
0
文件: App.php 项目: elvyrra/hawk
 /**
  * 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
0
 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
0
<?
global $mainConf;
$pageId = Conf::getInstance("accounts")->get("facebook", "pageId")
?>
示例#7
0
<?
chdir("..");
require_once 'library/conf.php';
require_once 'library/text2image.php';
$conf = Conf::getInstance("private");
text2image(16, $conf->get("contact", "fax"));
?>

示例#8
0
<?
require_once 'code/audio.php';
$config= "";
foreach(Conf::getInstance("main")->get("music_player_options") as $name=>$value)
	$config.= "<parameter name=\"$name\" value=\"$value\"/>";
?>

示例#9
0
<?
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
0
                                </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>
                                &nbsp;
                            </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
0
<?
require_once 'library/conf.php';
$menuItems="";
foreach(Conf::getInstance("main")->get("menu_names") as $id=>$name)
	$menuItems .= "<item id=\"$id\">$name</item>";
?>