本文整理汇总了PHP中config类的典型用法代码示例。如果您正苦于以下问题:PHP config类的具体用法?PHP config怎么用?PHP config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了config类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
include "config.php";
$config = new config();
define("LOGIN_PATH", dirname(__FILE__) . "/" . $config->get("auth", "login-path"));
session_start();
if (isset($_POST["email"]) and isset($_POST["password"])) {
// load user information
$users = $config->get("auth", "users");
// find current user
foreach ($users as $user) {
if ($user["email"] == $_POST["email"]) {
break;
}
}
// verify password and set session cookie
if (password_verify($_POST["password"], $user["hash"])) {
$_SESSION["user"] = array("email" => $user["email"], "name" => $user["name"]);
} else {
$this->login();
}
} elseif (!isset($_SESSION["user"])) {
$this->login();
}
}
开发者ID:JonathanHolvey,项目名称:php-cms-tools,代码行数:25,代码来源:auth.php
示例2: AbreBancoJP
function AbreBancoJP()
{
$con = new config();
$id = AbreBanco($con->get_host(), $con->get_login(), $con->get_pass(), $con->get_banco());
mysql_set_charset('utf8', $id);
return $id;
}
开发者ID:kevinMoreira,项目名称:Lab,代码行数:7,代码来源:sistemaJP.php
示例3: get_table_group
function get_table_group($table, $primaryKey, $columns, $where, $group)
{
$config = new config();
$sql_details = $config->sql_details();
require 'ssp.class.php';
echo json_encode(SSP::simplewheregroup($_POST, $sql_details, $table, $primaryKey, $columns, $where, $group));
}
开发者ID:datadigicore,项目名称:admin_cat,代码行数:7,代码来源:datatable.php
示例4: roundedBox
function roundedBox()
{
$objconfig = new config();
$this->getDomainPath = $objconfig->get_domain_path();
$this->color = "";
$this->heading = "";
}
开发者ID:sknlim,项目名称:classified-2,代码行数:7,代码来源:display.class.php
示例5: getNice
function getNice()
{
if ($this->config['source']['type'] == 'table' && isset($this->config['source']['name'])) {
global $thinkedit;
$config = new config();
//$table = $thinkedit->newTable($this->config['source']['name']);
//
//$source->filter('id', '=', $this->getRaw());
$source_table = $this->config['source']['name'];
$title_fields = $config->getTitleFields($source_table);
require_once 'query.class.php';
$query = new query();
$query->addTable($this->config['source']['name']);
$query->addWhere('id', '=', $this->getRaw());
$results = $query->select();
if (count($results) > 0) {
foreach ($config->getTitleFields($source_table) as $field) {
$out .= $results[0][$field] . ' ';
}
return $out;
} else {
return $this->getRaw();
}
} else {
return $this->getRaw();
}
}
开发者ID:BackupTheBerlios,项目名称:thinkedit-svn,代码行数:27,代码来源:field.lookup.class.php
示例6: __construct
public function __construct(&$theArray)
{
ENTER("minimenu::minimenu", __LINE__);
$a = new config("gilles", $anElement);
unset($anOption);
foreach ($anElement as $a) {
switch ($a->getType()) {
case MINIMENU_CATEGORY:
$anOption[] = "+ " . $a->name;
break;
case MINIMENU_PROGRAM:
$anOption[] = "* " . $a->name;
break;
case MINIMENU_DOCUMENT:
$anOption[] = $a->name;
break;
}
}
$this->_myTerminal = new enhancedTerminal();
if (!$this->_myTerminal->isBuild()) {
$this->_myTerminal = new dumbTerminal($theTerminal);
}
$this->myDialog = new cliDialog($this->_myTerminal, false);
$aTitle = "";
$theText = NULL;
$theSelectedOption = NULL;
$theKeyIsDisplayed = false;
$this->myDialog->menu($aTitle, $anOption, &$aResult, NULL, NULL, false);
}
开发者ID:BackupTheBerlios,项目名称:oralux,代码行数:29,代码来源:minimenu.php
示例7: Objeto
function Objeto($valor)
{
require_once "clase/config.class.php";
setlocale(LC_MONETARY, 'en_US');
$esta_configuracion = new config();
$configuracion = $esta_configuracion->variable();
include_once $configuracion["raiz_documento"] . $configuracion["clases"] . "/funcionGeneral.class.php";
include_once $configuracion["raiz_documento"] . $configuracion["clases"] . "/html.class.php";
$conexion = new funcionGeneral();
$conexionOracle = $conexion->conectarDB($configuracion, "oracle3");
$html = new html();
$busqueda = "SELECT ";
$busqueda .= "obj_cod, ";
$busqueda .= "obj_nombre ";
$busqueda .= "FROM ";
$busqueda .= "objetos ";
$busqueda .= "WHERE ";
$busqueda .= "obj_tio_cod =" . $valor;
$resultado = $conexion->ejecutarSQL($configuracion, $conexionOracle, $busqueda, "busqueda");
if (is_array($resultado)) {
$mi_cuadro = $html->cuadro_lista($resultado, 'objeto', $configuracion, -1, 2, FALSE, $tab++, "objeto", 100);
} else {
$mi_cuadro = "No hay registros relacionados";
}
$respuesta = new xajaxResponse();
$respuesta->addAssign("divObjeto", "innerHTML", $mi_cuadro);
return $respuesta;
}
开发者ID:udistrital,项目名称:PROVEEDOR_PRODUCCION,代码行数:28,代码来源:blogdev.class.php
示例8: get_table_join
function get_table_join($table, $table2, $primaryKey, $columns, $on, $where, $group, $dataArray)
{
$config = new config();
$sql_details = $config->sql_details();
require 'ssp.class.php';
echo json_encode(SSP::complexjoin($_POST, $sql_details, $table, $table2, $primaryKey, $columns, $on, $where, $group, $dataArray));
}
开发者ID:datadigicore,项目名称:siprisdik,代码行数:7,代码来源:datatable.php
示例9: checktoken
function checktoken()
{
if ($this->shopid) {
$config = new config("autorun_{$this->shopid}.php", hopedir);
} else {
$config = new config('autorun.php', hopedir);
}
$tempinfo = $config->getInfo();
if (isset($tempinfo['access_token']) && isset($tempinfo['wx_time'])) {
$btime = time() - $tempinfo['wx_time'];
if ($btime < 7000) {
$this->access_token = $tempinfo['access_token'];
return true;
}
}
//通过post方法获取 当前token;
$info = $this->vpost('https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' . $this->wxappid . '&secret=' . $this->wxsecret);
$info = json_decode($info, true);
if (isset($info['access_token'])) {
$test['access_token'] = $info['access_token'];
$this->access_token = $info['access_token'];
$test['wx_time'] = time();
$config->write($test);
return true;
} else {
$this->errId = $info['errcode'];
return false;
}
}
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:29,代码来源:wx_s.php
示例10: dato
function dato($Campo)
{
global $folder;
include_once $folder . "class/config.php";
$config = new config();
$cnf = $config->mostrarConfig($Campo);
return htmlspecialchars($cnf['Valor']);
}
开发者ID:anthonycab15,项目名称:colegio,代码行数:8,代码来源:funciones.php
示例11: getPassword
function getPassword($fEmail, $sqlconn)
{
$table = 'UserInfo';
$queryType = 'Select';
$condition = array('Email', $fEmail, 'text');
$types = array('text');
$columns = array('Password');
$values = array(null);
$args = array('column' => $columns, 'value' => $values, 'type' => $types);
$xml = createXML($table, $args);
$res = $sqlconn->query($xml, $queryType, $condition);
$thepassword = getValue($res);
if ($thepassword == '') {
echo 'Account does not exist';
} else {
$mail = new PHPMailer(true);
//New instance, with exceptions enabled
$body = "Password: " . $thepassword . "\r\nReturn to site: http://www.you-mix.com";
$body = preg_replace('/\\\\/', '', $body);
//Strip backslashes
$mail->IsSMTP();
// telling the class to use SMTP
//$mail->Host = "mail.you-mix.com"; // SMTP server
$mail->Host = "smtp.sendgrid.net";
//$mail->Host = "smtp.mail.me.com"; // SMTP server
$mail->SMTPDebug = 1;
// enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only // tell the class to use SMTP
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->Port = 25;
// set the SMTP server port
//$mail->Port = 587; // set the SMTP server port
$mail->Username = "seh264";
// SMTP server username
//$mail->Username = "[email protected]"; // SMTP server username
$config = new config();
$mail->Password = $config->getSMTPPass();
// SMTP server password
$mail->AddReplyTo("[email protected]", "YouMix");
$mail->From = "[email protected]";
$mail->FromName = "YouMix";
//$to = "[email protected]";
$mail->AddAddress($fEmail);
$mail->Subject = "you-mix.com: Password retrieval";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
// optional, comment out and test
$mail->WordWrap = 80;
// set word wrap
$mail->MsgHTML($body);
$mail->IsHTML(true);
// send as HTML
$mail->Send();
echo 'Password has been sent.';
}
}
开发者ID:benjiboybenjamin,项目名称:you-mix,代码行数:57,代码来源:SendPassword.php
示例12: establishConnection
public static function establishConnection($cmd)
{
$config = new config();
$dsn = $config->getDSN();
if ($cmd = 'open') {
return MDB2::connect($dsn);
} else {
if ($cmd = 'close') {
return null;
}
}
}
开发者ID:benjiboybenjamin,项目名称:you-mix,代码行数:12,代码来源:MySQLConnect.php
示例13: photo
function photo($files)
{
$objConfig = new config();
$objCommon = new common();
$this->domainPath = $objConfig->get_domain_path();
$this->fullPath = $objConfig->get_full_domain_path();
$this->uploadDir = $objConfig->get_upload_dir();
$this->imageQuality = $objCommon->getConfigValue("imageQuality");
$this->files = $files;
$this->description = "";
$this->fileType = "";
$this->title = "";
$this->tags = "";
}
开发者ID:sknlim,项目名称:classified-2,代码行数:14,代码来源:photo.class.php
示例14: tearDown
public function tearDown()
{
parent::tearDown();
/* required for PHP < 5.3 */
config::$chroot_dir = "";
config::$compile_temp_directory = "/tmp";
}
开发者ID:rajatkhanduja,项目名称:opc,代码行数:7,代码来源:PreWithChrootTest.php
示例15: plugin_initconfig_spamx
/**
* Initialize Spam-X plugin configuration
*
* Creates the database entries for the configuation if they don't already
* exist. Initial values will be taken from $_SPX_CONF if available (e.g. from
* an old config.php), uses $_SPX_DEFAULT otherwise.
*
* @return boolean true: success; false: an error occurred
*
*/
function plugin_initconfig_spamx()
{
global $_CONF, $_SPX_CONF, $_SPX_DEFAULT;
if (is_array($_SPX_CONF) && count($_SPX_CONF) > 1) {
$_SPX_DEFAULT = array_merge($_SPX_DEFAULT, $_SPX_CONF);
}
$c = config::get_instance();
if (!$c->group_exists('spamx')) {
$enable_email = true;
if (empty($_SPX_DEFAULT['notification_email']) || $_SPX_DEFAULT['notification_email'] == $_CONF['site_mail']) {
$enable_email = false;
}
$c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'spamx');
$c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'spamx');
$c->add('logging', $_SPX_DEFAULT['logging'], 'select', 0, 0, 1, 10, true, 'spamx');
$c->add('admin_override', $_SPX_DEFAULT['admin_override'], 'select', 0, 0, 1, 20, true, 'spamx');
$c->add('timeout', $_SPX_DEFAULT['timeout'], 'text', 0, 0, null, 30, true, 'spamx');
$c->add('notification_email', $_SPX_DEFAULT['notification_email'], 'text', 0, 0, null, 40, $enable_email, 'spamx');
$c->add('action', $_SPX_DEFAULT['action'], 'text', 0, 0, null, 50, false, 'spamx');
$c->add('fs_sfs', NULL, 'fieldset', 0, 1, NULL, 0, true, 'spamx');
$c->add('sfs_username_check', $_SPX_DEFAULT['sfs_username_check'], 'select', 0, 1, 1, 10, true, 'spamx');
$c->add('sfs_email_check', $_SPX_DEFAULT['sfs_email_check'], 'select', 0, 1, 1, 20, true, 'spamx');
$c->add('sfs_ip_check', $_SPX_DEFAULT['sfs_ip_check'], 'select', 0, 1, 1, 30, true, 'spamx');
$c->add('sfs_username_confidence', $_SPX_DEFAULT['sfs_username_confidence'], 'text', 0, 1, 1, 40, true, 'spamx');
$c->add('sfs_email_confidence', $_SPX_DEFAULT['sfs_email_confidence'], 'text', 0, 1, 1, 50, true, 'spamx');
$c->add('sfs_ip_confidence', $_SPX_DEFAULT['sfs_ip_confidence'], 'text', 0, 1, 1, 60, true, 'spamx');
$c->add('fs_slc', NULL, 'fieldset', 0, 2, NULL, 0, true, 'spamx');
$c->add('slc_max_links', 5, 'text', 0, 1, 1, 10, true, 'spamx');
}
return true;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:41,代码来源:install_defaults.php
示例16: execute
private static function execute($display = TRUE, $define = [], $assign = [])
{
if ($define) {
self::define($define);
}
if ($assign) {
self::assign($assign);
}
if (config::defined('template')) {
$definition = config::import('template');
if (gettype($definition) == "object" && $definition instanceof \Closure) {
return $definition($display);
}
}
// default
$tpl = new view\php();
$tpl->define(self::getDefine());
$tpl->assign(self::getAssign());
if ($define) {
$tpl->define($define);
}
if ($assign) {
$tpl->assign($assign);
}
return $tpl->show("layout", $display);
}
开发者ID:rubythonode,项目名称:limepie-php,代码行数:26,代码来源:view.php
示例17: polls_upgrade
function polls_upgrade()
{
global $_TABLES, $_CONF, $_PO_CONF;
$currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='polls'");
switch ($currentVersion) {
case '2.0.0':
case '2.0.1':
case '2.0.2':
case '2.0.3':
case '2.0.4':
case '2.0.5':
case '2.0.6':
case '2.0.7':
case '2.0.8':
case '2.0.9':
case '2.1.0':
$c = config::get_instance();
$c->add('displayblocks', 0, 'select', 0, 0, 13, 85, true, 'polls');
case '2.1.1':
DB_query("ALTER TABLE {$_TABLES['pollanswers']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL DEFAULT '';", 1);
DB_query("ALTER TABLE {$_TABLES['pollquestions']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL;", 1);
DB_query("ALTER TABLE {$_TABLES['polltopics']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL;", 1);
DB_query("ALTER TABLE {$_TABLES['pollvoters']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL DEFAULT '';", 1);
default:
DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='" . $_PO_CONF['pi_version'] . "',pi_gl_version='" . $_PO_CONF['gl_version'] . "' WHERE pi_name='polls' LIMIT 1");
break;
}
if (DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='polls'") == $_PO_CONF['pi_version']) {
return true;
} else {
return false;
}
}
开发者ID:JohnToro,项目名称:glfusion,代码行数:33,代码来源:upgrade.php
示例18: run
public static function run()
{
if (!isset($_SERVER['REDIRECT_URL'])) {
throw new Exception();
}
$_SERVER['REDIRECT_URL'] = substr($_SERVER['REDIRECT_URL'], strlen(config::prefix()));
$path = explode('/', $_SERVER['REDIRECT_URL']);
//array_shift($path);
if ($path && preg_match('/^[0-9a-z]+$/i', $path[0])) {
req::$controller = array_shift($path);
if ($path && preg_match('/^[0-9a-z]+$/i', $path[0])) {
req::$function = array_shift($path);
}
}
unset($path);
session::get_instance()->start();
if (uuid::check(req::$controller)) {
$obj = state::load(req::$controller);
if (!$obj instanceof ctrl) {
throw new Exception();
}
call_user_func(array($obj, req::$function));
} else {
$obj = eval('return new ' . req::$controller . '_ctrl();');
if (!$obj instanceof ctrl) {
throw new Exception();
}
util::redirect($obj, req::$function, $_GET);
}
}
开发者ID:RuschGaming,项目名称:twitch,代码行数:30,代码来源:engine.php
示例19: render
function render()
{
$current_user =& singleton("current_user");
global $TPL;
// Get averages for hours worked over the past fortnight and year
$t = new timeSheetItem();
$day = 60 * 60 * 24;
//mktime(0,0,0,date("m"),date("d")-1, date("Y"))
$today = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
$yestA = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 2, date("Y")));
$yestB = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 1, date("Y")));
$fortn = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 14, date("Y")));
list($hours_sum_today, $dollars_sum_today) = $t->get_averages($today, $current_user->get_id());
list($hours_sum_yesterday, $dollars_sum_yesterday) = $t->get_averages($yestA, $current_user->get_id(), null, $yestB);
list($hours_sum_fortnight, $dollars_sum_fortnight) = $t->get_averages($fortn, $current_user->get_id());
list($hours_avg_fortnight, $dollars_avg_fortnight) = $t->get_fortnightly_average($current_user->get_id());
$TPL["hours_sum_today"] = sprintf("%0.2f", $hours_sum_today[$current_user->get_id()]);
$TPL["dollars_sum_today"] = page::money_print($dollars_sum_today[$current_user->get_id()]);
$TPL["hours_sum_yesterday"] = sprintf("%0.2f", $hours_sum_yesterday[$current_user->get_id()]);
$TPL["dollars_sum_yesterday"] = page::money_print($dollars_sum_yesterday[$current_user->get_id()]);
$TPL["hours_sum_fortnight"] = sprintf("%0.2f", $hours_sum_fortnight[$current_user->get_id()]);
$TPL["dollars_sum_fortnight"] = page::money_print($dollars_sum_fortnight[$current_user->get_id()]);
$TPL["hours_avg_fortnight"] = sprintf("%0.2f", $hours_avg_fortnight[$current_user->get_id()]);
$TPL["dollars_avg_fortnight"] = page::money(config::get_config_item("currency"), $dollars_avg_fortnight[$current_user->get_id()], "%s%m %c");
$TPL["dateFrom"] = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 28, date("Y")));
$TPL["dateTo"] = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y")));
return true;
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:28,代码来源:timeSheetStatusHomeItem.inc.php
示例20: set_default_quality
/**
* Set the default image quality.
*
* @deprecated 3.2 Use the "GDBackend.default_quality" config setting instead
* @param quality int A number from 0 to 100, 100 being the best quality.
*/
public static function set_default_quality($quality)
{
Deprecation::notice('3.2', 'Use the "GDBackend.default_quality" config setting instead');
if (is_numeric($quality) && (int) $quality >= 0 && (int) $quality <= 100) {
config::inst()->update('GDBackend', 'default_quality', (int) $quality);
}
}
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:13,代码来源:GD.php
注:本文中的config类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论