本文整理汇总了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');
}
示例2: __construct
function __construct()
{
$this->emailTranslation = getLanguageStringsPHP('Email');
$conf = Configuration::getInstance();
$this->role = $conf->get('notificationRole');
$this->fromAddr = $conf->get('changeNotifierEmailAddress');
}
示例3: __construct
function __construct()
{
require_once 'Configuration.php';
$conf = Configuration::getInstance();
$this->storageDirectory = $conf->get('storageDirectory');
$this->rootDirStringLength = strlen($this->storageDirectory);
}
示例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');
}
示例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');
}
示例6: getDbalManager
/**
*
*/
public function getDbalManager()
{
$oConfig = Configuration::getInstance();
$oConfig->read($this->sConfigPath);
$oFactory = new DriverFactory();
return new DbalManager($oFactory, $oConfig);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}