當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。