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


PHP config类代码示例

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


在下文中一共展示了config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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   = "seh264@gmail.com";     // SMTP server username
        $config = new config();
        $mail->Password = $config->getSMTPPass();
        // SMTP server password
        $mail->AddReplyTo("seh264@gmail.com.com", "YouMix");
        $mail->From = "admin@you-mix.com";
        $mail->FromName = "YouMix";
        //$to = "seh264test1234@yahoo.com";
        $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


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