當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Configuration::getInstance方法代碼示例

本文整理匯總了PHP中Configuration::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configuration::getInstance方法的具體用法?PHP Configuration::getInstance怎麽用?PHP Configuration::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Configuration的用法示例。


在下文中一共展示了Configuration::getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getImageHtml

function getImageHtml($focus, $name, $value, $view)
{
    if ('EditView' != $view && 'DetailView' != $view) {
        return "";
        // skip the rest of the method if another view calls this method
    }
    global $app_list_strings;
    $languageStrings = $app_list_strings["oqc"]["Services"];
    require_once 'include/Sugar_Smarty.php';
    //1.7.6 Workaround for image display without modifying htaccess file
    require_once 'include/oqc/common/Configuration.php';
    if (isset($focus->image_unique_filename)) {
        global $sugar_config;
        $conf = Configuration::getInstance();
        $oqc_uploadDir = $conf->get('fileUploadDir');
        $uploadDir = $oqc_uploadDir ? $oqc_uploadDir : $sugar_config['upload_dir'];
        if (file_exists($uploadDir . "th" . $focus->image_unique_filename)) {
            $imageurl = "oqc/GetImage.php?module=oqc_Product&id=th" . $focus->image_unique_filename;
        } else {
            $imageurl = "oqc/GetImage.php?module=oqc_Product&id=" . $focus->image_unique_filename;
        }
    } else {
        $imageurl = '';
    }
    $smarty = new Sugar_Smarty();
    $smarty->assign('image_url', $imageurl);
    $smarty->assign('languageStrings', $languageStrings);
    return $smarty->fetch('include/oqc/Products/Image.' . $view . '.html');
}
開發者ID:santara12,項目名稱:OpenQuotesAndContracts,代碼行數:29,代碼來源:Image.php

示例2: __construct

 function __construct()
 {
     $this->emailTranslation = getLanguageStringsPHP('Email');
     $conf = Configuration::getInstance();
     $this->role = $conf->get('notificationRole');
     $this->fromAddr = $conf->get('changeNotifierEmailAddress');
 }
開發者ID:santara12,項目名稱:OpenQuotesAndContracts,代碼行數:7,代碼來源:ChangeNotifier.php

示例3: __construct

 function __construct()
 {
     require_once 'Configuration.php';
     $conf = Configuration::getInstance();
     $this->storageDirectory = $conf->get('storageDirectory');
     $this->rootDirStringLength = strlen($this->storageDirectory);
 }
開發者ID:santara12,項目名稱:OpenQuotesAndContracts,代碼行數:7,代碼來源:DirectoryPrinter.php

示例4: __construct

 private function __construct()
 {
     $conf = Configuration::getInstance();
     $this->inbox = $conf->get('Mail', 'Inbox');
     $this->user = $conf->get('Mail', 'User');
     $this->passwd = $conf->get('Mail', 'Password');
 }
開發者ID:hlag,項目名稱:svs,代碼行數:7,代碼來源:ImapMailer.php

示例5: __construct

 public function __construct()
 {
     require_once 'include/oqc/common/Configuration.php';
     $conf = Configuration::getInstance();
     $this->CONVERTER = $conf->get('pathDocumentConverter');
     $this->PAGE_INSERTER = $conf->get('pathPageInserter');
 }
開發者ID:santara12,項目名稱:OpenQuotesAndContracts,代碼行數:7,代碼來源:oqc_CreatePdf.php

示例6: getDbalManager

 /**
  * 
  */
 public function getDbalManager()
 {
     $oConfig = Configuration::getInstance();
     $oConfig->read($this->sConfigPath);
     $oFactory = new DriverFactory();
     return new DbalManager($oFactory, $oConfig);
 }
開發者ID:Beanbiscuit,項目名稱:examples,代碼行數:10,代碼來源:OrmManager.php

示例7: get

 public function get()
 {
     $page = Request::getQuery('page', 1);
     $per = Configuration::getInstance()->per;
     $start = ($page - 1) * $per;
     return array('personas' => Personas::all(null, array('inscripcion' => 'DESC'), array($start, $per)), 'count' => Personas::count(), 'start' => $start, 'page' => $page, 'per' => $per);
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:7,代碼來源:Principal.php

示例8: init

 public function init()
 {
     if (!Session::getInstance()->usuario) {
         return '/admin/ingresar';
     }
     $configuration = Configuration::getInstance();
     $this->config = array('nombre' => Request::getPost('nombre', $configuration->nombre), 'idioma' => Request::getPost('idioma', $configuration->idioma), 'efecto' => Request::getPost('efecto', $configuration->efecto), 'twitter' => Request::getPost('twitter', $configuration->twitter), 'per' => Request::getPost('per', $configuration->per));
     return true;
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:9,代碼來源:Configuracion.php

示例9: getConnection

 /**
  * Singleton pattern
  */
 static function getConnection()
 {
     if (!self::$_conn) {
         $configDb = Configuration::getInstance()->get('config.db');
         self::$_conn = new PDO('mysql:host=' . $configDb['host'] . ';dbname=' . $configDb['db'], $configDb['username'], $configDb['pass']);
     }
     self::$_conn->exec('CHARSET UTF8');
     self::$_conn->exec('SET NAMES UTF8');
     return self::$_conn;
 }
開發者ID:ntcnhjdobr,項目名稱:simpleSite,代碼行數:13,代碼來源:Database.php

示例10: dispatchHostname

 public static function dispatchHostname()
 {
     $default = Configuration::getInstance()->idioma;
     $server = explode('.', $_SERVER['SERVER_NAME']);
     $idioma = array_shift($server);
     if (!Translate::locale($idioma)) {
         return $default;
     }
     return true;
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:10,代碼來源:Router.php

示例11: loadTemplate

 private function loadTemplate($templateName)
 {
     $configuration = Configuration::getInstance();
     $filepath = $configuration->get("modulespath") . "/layout/templates/" . $templateName . ".php";
     if (file_exists($filepath)) {
         $this->layoutpath = $filepath;
         //$this->layouttemplate=file_get_contents($filepath);
     } else {
         throw new Exception("File not found: " . $filepath, 404);
     }
 }
開發者ID:jgillespie,項目名稱:phencha,代碼行數:11,代碼來源:extlayout.class.php

示例12: get

 public function get()
 {
     $configuracion = Configuration::getInstance();
     $current = substr(Router::$current, strpos(Router::$current, '_') + 1);
     if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
         $parent = strstr($current, '_', true);
     } else {
         $parent = substr($current, 0, strpos($current, '_'));
     }
     return array('parent' => $parent, 'current' => $current, 'title' => $this->title, 'nombre' => $configuracion->nombre);
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:11,代碼來源:Header.php

示例13: exceptionHandler

 /**
  * 
  * classic exeption Handler
  * 
  * @param unknown_type $e
  */
 public static function exceptionHandler($e)
 {
     Logger::write('error', $e->getMessage() . PHP_EOL . $e->getFile() . PHP_EOL . $e->getLine());
     if (Configuration::getInstance()->get('config.showErrors')) {
         echo '<h1>' . get_class($e) . '</h1>';
         echo implode(PHP_EOL, array($e->getMessage(), $e->getFile(), $e->getLine()));
         var_dump($e);
         exit;
     }
     return self::_renderErrorPage($e);
 }
開發者ID:ntcnhjdobr,項目名稱:simpleSite,代碼行數:17,代碼來源:Core.php

示例14: mail

 /**
  * Sends receipt
  * @return bool 
  */
 public function mail()
 {
     $this->read();
     $invoice = new Invoice($this->invoice_id);
     // make e-mail template
     $template = new Template(Configuration::get('base_dir') . DS . 'templates' . DS . 'mail.php');
     $template->replaceFromPHPFile('content', Configuration::get('base_dir') . DS . 'templates' . DS . 'payment-mail.php', array('invoice' => $invoice->read(), 'payment' => $this->toClone()));
     // send e-mail
     $config = Configuration::getInstance();
     $header = "From: {$config['user']['name']} <{$config['user']['email']}>";
     return mail($invoice->client_email, "A payment was made", $template->toString(), $header);
 }
開發者ID:amad4biz,項目名稱:invoices,代碼行數:16,代碼來源:Payment.php

示例15: init

 public function init($idioma)
 {
     if (!Session::getInstance()->usuario) {
         return '/admin/ingresar';
     }
     $this->idioma = $idioma;
     $this->config = Configuration::getInstance();
     $this->config->setIdioma($this->idioma);
     $this->title = $this->config->getContent('title');
     $this->keywords = $this->config->getContent('keywords');
     $this->description = $this->config->getContent('description');
     return true;
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:13,代碼來源:Contenido.php


注:本文中的Configuration::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。