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


PHP Registry::getConfig方法代码示例

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


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

示例1: get_json

 public function get_json()
 {
     if (Registry::getConfig('DEBUG')) {
         return array('message' => $this->message, 'exception_message' => $this->e_message, 'trace' => $this->trace);
     } else {
         return array('message' => $this->message);
     }
 }
开发者ID:aber-cs22120-group-15,项目名称:TaskerMAN,代码行数:8,代码来源:FatalException.class.php

示例2: __construct

 /**
  * Create a Data Map
  * 
  * @param string $connection [optional] database connection info
  * @param string $username   [optional] username to connect with
  * @param string $password   [optional] password to connect with
  */
 public function __construct($connection = null, $username = null, $password = null)
 {
     $this->registry = Registry::getInstance();
     // take conn and credentials from config, unless overriden in constructor
     if ($connection == null) {
         $connection = $this->registry->getConfig("DATABASE_CONNECTION", true);
     }
     if ($username == null) {
         $username = $this->registry->getConfig("DATABASE_USERNAME", true);
     }
     if ($password == null) {
         $password = $this->registry->getConfig("DATABASE_PASSWORD", true);
     }
     // assign it
     $this->connection = $connection;
     $this->username = $username;
     $this->password = $password;
 }
开发者ID:fresnostate-library,项目名称:xerxes,代码行数:25,代码来源:DatabaseConnection.php

示例3: getRequestEscapedParameter

 /**
  * Returns escaped value of parameter stored in POST,GET.
  *
  * @param string $name         Name of parameter.
  * @param string $defaultValue Default value if no value provided.
  *
  * @return mixed
  */
 public function getRequestEscapedParameter($name, $defaultValue = null)
 {
     $value = $this->getRequestParameter($name, $defaultValue);
     // TODO: remove this after special chars concept implementation
     $isAdmin = Registry::getConfig()->isAdmin() && Registry::getSession()->getVariable("blIsAdmin");
     if ($value !== null && !$isAdmin) {
         $this->checkParamSpecialChars($value);
     }
     return $value;
 }
开发者ID:Alpha-Sys,项目名称:oxideshop_ce,代码行数:18,代码来源:Request.php

示例4: index

 public function index()
 {
     $config = Registry::getConfig();
     $pag['total'] = 0;
     $pag['limit'] = $_REQUEST['limit'] ? $_REQUEST['limit'] : $config->get("defaultLimit");
     $pag['limitStart'] = $_REQUEST['limitStart'];
     $this->setData("results", User::select($_REQUEST, $pag['limit'], $pag['limitStart'], $pag['total']));
     $this->setData("pag", $pag);
     $html = $this->view("views.list");
     $this->render($html);
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:11,代码来源:users.php

示例5: generate

 /**
  * @return string
  */
 public static function generate()
 {
     $length = OptinCodeGenerator::DEFAULT_CODE_LENGTH;
     $config = Registry::getConfig();
     $optinConfig = $config->get('optin');
     if ($optinConfig) {
         $length = Registry::getConfig()->optin->code->length;
     }
     $randomCharacters = str_split(md5(mt_rand(0, 200000) . microtime(true)));
     $mergedCharacters = array_merge($randomCharacters, range('a', 'z'));
     shuffle($mergedCharacters);
     return substr(implode('', $mergedCharacters), 0, $length);
 }
开发者ID:rukzuk,项目名称:rukzuk,代码行数:16,代码来源:OptinCodeGenerator.php

示例6: index

 public function index()
 {
     //Remember filters
     if (!$_REQUEST['fresh']) {
         rememberFilter('search');
         rememberFilter('limit');
         rememberFilter('limitStart');
         rememberFilter('order');
         rememberFilter('orderDir');
     }
     $config = Registry::getConfig();
     $pag['total'] = 0;
     $pag['limit'] = $_REQUEST['limit'] ? $_REQUEST['limit'] : $config->get("defaultLimit");
     $pag['limitStart'] = $_REQUEST['limitStart'];
     $this->setData("results", Entrada::select($_REQUEST, $pag['limit'], $pag['limitStart'], $pag['total']));
     $this->setData("pag", $pag);
     $html = $this->view("views.list");
     $this->render($html);
     //Log
     Log::add(LOG_LISTAR_ENTRADA);
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:21,代码来源:entradas.php

示例7: required

 /**
  * Check whether or not an installation is required 
  * 
  * @return boolean
  */
 public static function required()
 {
     $query = new DBQuery("SHOW TABLES IN " . Registry::getConfig('DB_DATABASE'));
     $query->execute();
     $tables_in_db = array();
     while ($row = $query->rowNotAssoc()) {
         $tables_in_db[] = $row[0];
     }
     foreach (self::$required_tables as $table => $statement) {
         if (!in_array($table, $tables_in_db)) {
             return true;
         }
     }
     // Count number of users in database
     $query = new DBQuery("SELECT COUNT(*) AS `NumRows` FROM `users`");
     $query->execute();
     $row = $query->row();
     // If no users, offer installation
     if ($row['NumRows'] == 0) {
         return true;
     }
     return false;
 }
开发者ID:aber-cs22120-group-15,项目名称:TaskerMAN,代码行数:28,代码来源:Install.class.php

示例8: defined

<?php

defined('_EXE') or die('Restricted access');
?>

<!-- Debugging Modals -->
<?php 
$config = Registry::getConfig();
if ($config->get("debug")) {
    ?>
    <?php 
    $debug = Registry::getDebug();
    ?>
    <!-- Current Queries Debug Modal -->
    <?php 
    $controller->setData("debug", $debug);
    ?>
    <?php 
    $controller->setData("debugModalId", "Current");
    ?>
    <?php 
    echo $controller->view("modules.debug.modalQueries");
    ?>
    <!-- Previous Queries Debug Modal -->
    <?php 
    if ($_SESSION['debug']['queries']) {
        ?>
        <?php 
        $controller->setData("debug", $_SESSION['debug']);
        ?>
        <?php 
开发者ID:flafuente,项目名称:parrillas,代码行数:31,代码来源:menu.view.php

示例9: logout

 /**
  * Logout
  *
  * @return bool
  */
 public static function logout()
 {
     $config = Registry::getConfig();
     //Destroy Cookies
     unset($_COOKIE[$config->get("cookie")]);
     setcookie($config->get("cookie"), null, -1, "/");
     //Log
     Log::add(LOG_LOGOUT);
     return true;
 }
开发者ID:flafuente,项目名称:parrillas,代码行数:15,代码来源:User.php

示例10: __construct

 public function __construct(Registry $registry)
 {
     $this->config = $registry->getConfig();
     $this->registry = $registry;
 }
开发者ID:visapi,项目名称:amun,代码行数:5,代码来源:Security.php


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