当前位置: 首页>>代码示例>>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;未经允许,请勿转载。