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


PHP getConfig函数代码示例

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


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

示例1: loadAppServices

 function loadAppServices($appName = SITENAME)
 {
     if (defined("BASEPATH")) {
         trigger_logikserror("App <b>'" . $appName . "'</b> has already been activated", E_ERROR);
     }
     define("BASEPATH", APPS_FOLDER . $appName . "/");
     define("APPROOT", ROOT . BASEPATH);
     define("WEBAPPROOT", SiteLocation . BASEPATH);
     if (!file_exists(APPROOT)) {
         trigger_logikserror("Site Not Found <b>'" . $appName . "'</b>", E_ERROR);
     }
     $apps_cfg = APPROOT . "apps.cfg";
     if (!file_exists($apps_cfg)) {
         trigger_logikserror("Site <b>'" . $appName . "'</b> Has Not Yet Been Activated (missing apps.cfg).", E_ERROR);
     }
     loadConfigs($apps_cfg);
     loadConfigDir(APPROOT . "config/");
     if (!defined("APPS_CONFIG_FOLDER")) {
         loadConfigs(ROOT . "config/masters/folders.cfg");
     }
     if (defined("LINGUALIZER_DICTIONARIES")) {
         Lingulizer::getInstance()->loadLocaleFile(LINGUALIZER_DICTIONARIES);
     }
     if (!defined("APPS_THEME")) {
         define("APPS_THEME", getConfig("APPS_THEME"));
     }
     if (!defined("APPS_TEMPLATEENGINE")) {
         define("APPS_TEMPLATEENGINE", getConfig("APPS_TEMPLATEENGINE"));
     }
     if (!defined("APPNAME")) {
         define("APPNAME", SITENAME);
     }
     return true;
 }
开发者ID:logiks,项目名称:logiks-core,代码行数:34,代码来源:app.php

示例2: listAction

function listAction()
{
    $config = getConfig();
    $columnsName = [];
    foreach ($_GET['columns'] as $column) {
        if (!empty($column['data'])) {
            $columnsName[] = $column['data'];
        }
    }
    $order = $_GET['order'][0];
    $orderColumn = $order['column'];
    $start = intval($_GET['start']);
    $sqlAssoc = ['table' => ['name' => 'item', 'dbname' => 'db_vktest', 'as' => 'i'], 'query' => ['select' => $columnsName, 'from' => 'item', 'order' => ['column' => $columnsName[$orderColumn], 'dir' => $order['dir']], 'start' => $start, 'length' => $_GET['length']]];
    $mysqli = db_mysqli_connect($sqlAssoc['table']['dbname']);
    $rowStore = db_mysqli_query_fetch_store($mysqli, 'SELECT s.countitems FROM store AS s WHERE s.idstore = 1', MYSQLI_ASSOC)[0];
    $sqlQueryes = buildListItemQuery($sqlAssoc, $rowStore['countitems']);
    $rows = db_mysqli_query_fetch_list($mysqli, $sqlQueryes, MYSQLI_ASSOC);
    db_mysqli_close($mysqli);
    //    var_dump($_SESSION);
    //    var_dump($sqlQueryes);
    $_SESSION['list'] = ['lastitem' => $rows[count($rows) - 1], 'firstitem' => $rows[0], 'lastpage' => $start, 'slowQueryType' => $sqlQueryes['slowQueryType']];
    //for cahce before last result
    afterLictAction($sqlAssoc, $rowStore);
    $response = ['recordsTotal' => $rowStore['countitems'], 'recordsFiltered' => $rowStore['countitems'], 'data' => $rows, 'draw' => $_GET['draw'], 'start' => $_GET['start']];
    echo json_encode($response);
}
开发者ID:fedotovaleksandr,项目名称:vkTest,代码行数:26,代码来源:listAction.php

示例3: editor

 function editor($fieldname, $content)
 {
     if (!is_file($this->coderoot . '/fckeditor/fckeditor.php')) {
         return '<textarea name="' . $fieldname . '">' . htmlspecialchars($content) . '</textarea>';
     }
     include_once $this->coderoot . '/fckeditor/fckeditor.php';
     if (!class_exists('FCKeditor')) {
         return 'Editor class not found';
     }
     $oFCKeditor = new FCKeditor($fieldname);
     $fckPath = getConfig("fckeditor_path");
     $oFCKeditor->BasePath = $fckPath;
     $oFCKeditor->ToolbarSet = 'Default';
     $oFCKeditor->Value = $content;
     $w = getConfig("fckeditor_width");
     $h = getConfig("fckeditor_height");
     if (isset($_SESSION["fckeditor_height"])) {
         $h = sprintf('%d', $_SESSION["fckeditor_height"]);
     }
     # for version 2.0
     if ($h < 400) {
         $h = 400;
     }
     $oFCKeditor->Height = $h;
     $oFCKeditor->Width = $w;
     return $oFCKeditor->CreateHtml();
 }
开发者ID:juvenal,项目名称:PHPlist,代码行数:27,代码来源:fckphplist.php

示例4: onAction

    public function onAction()
    {
        parent::onAction();
        // TODO proper email sending
        $target = $this->plugin->getData('target');
        $actionResp = getApi()->invoke("/action/{$target['id']}/view.json", EpiRoute::httpGet);
        if ($actionResp['code'] !== 200) {
            return;
        }
        $action = $actionResp['result'];
        $email = getConfig()->get('user')->email;
        $subject = 'You got a new comment on your photo';
        if ($action['type'] == 'comment') {
            $body = <<<BODY
{$action['email']} left a comment on your photo.

====
{$action['value']}
====

See the comment here: {$action['permalink']}
BODY;
        } else {
            $body = <<<BODY
{$action['email']} favorited a photo of yours.

See the favorite here: {$action['permalink']}
BODY;
        }
        $headers = "From: Trovebox Robot <no-reply@trovebox.com>\r\n" . "Reply-To: no-reply@trovebox.com\r\n" . 'X-Mailer: Trovebox';
        mail($email, $subject, $body, $headers);
    }
开发者ID:gg1977,项目名称:frontend,代码行数:32,代码来源:EmailNotificationPlugin.php

示例5: formatProductDetailsPrice

/**
 * Return a formatted price for a product for display on product detail pages.
 * Detail pages are defined as those product pages which contain the primary
 * details for a product.
 *
 * @see formatProductPrice
 * @param array $product Array containing the product to format the price for.
 * @param array $options Array of options, passed to formatProductPrice
 * @return string Generated HTML to display the price for the product.
 */
function formatProductDetailsPrice($product, array $options = array())
{
	$displayFormat = getConfig('taxDefaultTaxDisplayProducts');
	$options['displayInclusive'] = $displayFormat;

	if($displayFormat != TAX_PRICES_DISPLAY_BOTH) {
		return formatProductPrice($product, $product['prodcalculatedprice'], $options);
	}

	$options['displayInclusive'] = TAX_PRICES_DISPLAY_INCLUSIVE;
	$priceIncTax = formatProductPrice($product, $product['prodcalculatedprice'], $options);

	$options['displayInclusive'] = TAX_PRICES_DISPLAY_EXCLUSIVE;
	$priceExTax = formatProductPrice($product, $product['prodcalculatedprice'], $options);

	$output = '<span class="ProductDetailsPriceIncTax">';
	$output .= $priceIncTax;
	$output .= getLang('ProductDetailsPriceIncTaxLabel', array(
		'label' => getConfig('taxLabel')
	));
	$output .= '</span> ';
	$output .= '<span class="ProductDetailsPriceExTax">';
	$output .= $priceExTax;
	$output .= getLang('ProductDetailsPriceExTaxLabel', array(
		'label' => getConfig('taxLabel')
	));
	$output  .= '</span>';
	return $output;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:39,代码来源:pricing.php

示例6: getFs

 /**
  * The public interface for instantiating a file system obect.
  * This returns the appropriate type of object by reading the config.
  * Accepts a set of params that must include a type and targetType
  *
  * @param string $type Optional type parameter which defines the type of file system.
  * @return object A file system object that implements FileSystemInterface
  */
 function getFs()
 {
     static $filesystem, $type;
     if ($filesystem) {
         return $filesystem;
     }
     if (func_num_args() == 1) {
         $type = func_get_arg(0);
     }
     // load configs only once
     if (!$type) {
         $type = getConfig()->get('systems')->fileSystem;
     }
     switch ($type) {
         case 'Local':
             $filesystem = new FileSystemLocal();
             break;
         case 'LocalDropbox':
             $filesystem = new FileSystemLocalDropbox();
             break;
         case 'S3':
             $filesystem = new FileSystemS3();
             break;
         case 'S3Dropbox':
             $filesystem = new FileSystemS3Dropbox();
             break;
     }
     if ($filesystem) {
         return $filesystem;
     }
     throw new Exception("FileSystem Provider {$type} does not exist", 404);
 }
开发者ID:nicolargo,项目名称:frontend,代码行数:40,代码来源:FileSystem.php

示例7: __construct

 function __construct()
 {
     parent::phplistplugin();
     $this->numcriterias = 2;
     $this->numcriterias = getConfig('simpleattributeselect_numcriterias');
     $GLOBALS['simpleattributeselect_criteriacache'] = array();
 }
开发者ID:antonne,项目名称:phplist-plugin-attributeselect,代码行数:7,代码来源:simpleattributeselect.php

示例8: PHPlistMailer

 function PHPlistMailer($messageid, $email)
 {
     #  parent::PHPMailer();
     parent::SetLanguage('en', dirname(__FILE__) . '/phpmailer/language/');
     $this->addCustomHeader("X-Mailer: phplist v" . VERSION);
     $this->addCustomHeader("X-MessageID: {$messageid}");
     $this->addCustomHeader("X-ListMember: {$email}");
     $this->addCustomHeader("Precedence: bulk");
     $this->CharSet = getConfig("html_charset");
     if (defined('PHPMAILERHOST') && PHPMAILERHOST != '') {
         //logEvent('Sending email via '.PHPMAILERHOST);
         $this->SMTPAuth = true;
         $this->Helo = getConfig("website");
         $this->Host = PHPMAILERHOST;
         if (isset($GLOBALS['phpmailer_smtpuser']) && $GLOBALS['phpmailer_smtpuser'] != '' && isset($GLOBALS['phpmailer_smtppassword']) && $GLOBALS['phpmailer_smtppassword']) {
             $this->Username = $GLOBALS['phpmailer_smtpuser'];
             $this->Password = $GLOBALS['phpmailer_smtppassword'];
         }
         $this->Mailer = "smtp";
     } else {
         #  logEvent('Sending via mail');
         $this->Mailer = "mail";
     }
     //$ip = gethostbyname($this->Host);
     if ($GLOBALS["message_envelope"]) {
         $this->Sender = $GLOBALS["message_envelope"];
         $this->addCustomHeader("Errors-To: " . $GLOBALS["message_envelope"]);
     }
 }
开发者ID:ber5ien,项目名称:www.jade-palace.co.uk,代码行数:29,代码来源:class.phplistmailer.php

示例9: __construct

 public function __construct()
 {
     $this->config = getConfig()->get();
     $this->db = getDb();
     $this->utility = new Utility();
     $this->user = new User();
 }
开发者ID:hfiguiere,项目名称:frontend,代码行数:7,代码来源:LoginSelf.php

示例10: import

/**
 * 导入组件,比如import("Lib.File.Image");
 * @author linyh
 * @param $className
 * @return bool 是否成功导入
 */
function import($className)
{
    static $cacheClass;
    if (strstr($className, '.') === false) {
        $className = getConfig("classHash", $className);
    }
    // 检查是否导入过
    if (isset($cacheClass[$className])) {
        return true;
    }
    $sEach = explode(".", $className);
    // 检查是否符合要求
    foreach ($sEach as $v) {
        if (!validateVar($v)) {
            trigger_error("需要导入的路径{$v}不符合变量名定义", E_USER_ERROR);
        }
    }
    // 最后一个点之后的内容大小写不变,其他的都变成小写
    $componentPath = '';
    for ($i = 0; $i < sizeof($sEach) - 1; $i++) {
        $componentPath .= strtolower($sEach[$i]) . '/';
    }
    $componentPath .= $sEach[$i] . ".class.php";
    // 按照物理路径导入
    if (require $componentPath) {
        $cacheClass[$className] = true;
        return true;
    } else {
        trigger_error("需要导入的类{$className}未找到:{$componentPath}", E_USER_WARNING);
        return false;
    }
}
开发者ID:cumtCsdn,项目名称:cumtxa,代码行数:38,代码来源:lang.system.php

示例11: restApiQuery

 public static function restApiQuery($method, $uri = '', $query = array(), $postfields = array(), $options = array())
 {
     $restApiServer = getConfig()->get('javamonitor-rest')->restApiServer;
     if (empty($restApiServer)) {
         $restApiServer = $_SERVER['HTTP_HOST'];
     }
     $restApiPath = getConfig()->get('javamonitor-rest')->restApiPath;
     $restApiPort = getConfig()->get('javamonitor-rest')->restApiPort;
     $restApiProtocol = getConfig()->get('javamonitor-rest')->restApiProtocol;
     $restApiUrl = $restApiProtocol . "://" . $restApiServer . ":" . $restApiPort . $restApiPath;
     $restApiOptionDefaults = getConfig()->get('javamonitor-rest')->restApiOptionDefaults;
     $restApiPw = getConfig()->get('javamonitor-rest')->restApiPw;
     //print_r($restApiUrl);
     //if ($uri != '') $uri = '/' . $uri;
     // Connect
     $restApiHandle = curl_init();
     //echo "DB operation: $method $uri\n";
     //print_r($query);
     // Compose query
     $queryPw = array('pw' => $restApiPw);
     $options = array(CURLOPT_URL => $restApiUrl . $uri . '?' . http_build_query($query + $queryPw), CURLOPT_CUSTOMREQUEST => $method, CURLOPT_POSTFIELDS => http_build_query($postfields));
     curl_setopt_array($restApiHandle, $options + $restApiOptionDefaults);
     // send request and wait for response
     $response = json_decode(curl_exec($restApiHandle), true);
     //$response =  curl_exec($restApiHandle);
     //If the response is single lined, we turn it into an indexed array
     if (!is_array($response[0])) {
         $response = array($response);
     }
     //echo "Response from DB: \n";
     //print_r($response);
     curl_close($restApiHandle);
     return $response;
 }
开发者ID:pielonet,项目名称:cktJavaMonitor,代码行数:34,代码来源:api.class.php

示例12: C_start

 /**
  * 初始化方法
  */
 public function C_start()
 {
     parent::C_start();
     $this->setServiceBean('admin.keywords.service');
     $types = getConfig('system.keywords.type');
     $this->assign('types', $types);
 }
开发者ID:jifangshiyanshi,项目名称:tuonews,代码行数:10,代码来源:KeywordsAction.class.php

示例13: __construct

 public function __construct($params = null)
 {
     if (isset($params['config'])) {
         $this->config = $params['config'];
     } else {
         $path = dirname(dirname(dirname(__FILE__)));
         $params = parse_ini_file(sprintf('%s/configs/defaults.ini', $path), true);
         if (file_exists($overrideIni = sprintf('%s/configs/override.ini', $path))) {
             $override = parse_ini_file($overrideIni, true);
             foreach ($override as $key => $value) {
                 if (array_key_exists($key, $params)) {
                     if (is_array($value)) {
                         $params[$key] = array_merge((array) $params[$key], $value);
                     } else {
                         $params[$key] = $value;
                     }
                 } else {
                     $params[$key] = $value;
                 }
             }
         }
         $configParams = array($params['epi']['config']);
         if (isset($params['epiConfigParams'])) {
             $configParams = array_merge($configParams, $params['epiConfigParams']);
         }
         EpiConfig::employ($configParams);
         $this->config = getConfig();
     }
     if (isset($params['utility'])) {
         $this->utility = $params['utility'];
     }
     $this->basePath = dirname(dirname(dirname(__FILE__)));
     $this->host = $_SERVER['HTTP_HOST'];
     // TODO this isn't the best idea
 }
开发者ID:nicolargo,项目名称:frontend,代码行数:35,代码来源:UserConfig.php

示例14: SetPanelSettings

	/**
	 * Set the panel settings.
	 */
	public function SetPanelSettings()
	{
		if(GetConfig('HomeFeaturedProducts') <= 0) {
			$this->DontDisplay = true;
			return false;
		}

		$GLOBALS['SNIPPETS']['VendorFeaturedItems'] = '';

		if(!getProductReviewsEnabled()) {
			$GLOBALS['HideProductRating'] = "display: none";
		}

		$cVendor = GetClass('ISC_VENDORS');
		$vendor = $cVendor->GetVendor();

		$query = $this->getProductQuery(
			'p.prodvendorid='.(int)$vendor['vendorid'],
			'p.prodvendorfeatured DESC, RAND()',
			getConfig('HomeFeaturedProducts')
		);
		$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

		$GLOBALS['AlternateClass'] = '';
		while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$this->setProductGlobals($row);
			$GLOBALS['SNIPPETS']['VendorFeaturedItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("VendorFeaturedItemsItem");
		}

		$GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor);

		if(!$GLOBALS['SNIPPETS']['VendorFeaturedItems']) {
			$this->DontDisplay = true;
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:38,代码来源:VendorFeaturedItems.php

示例15: lotto_editLottery

function lotto_editLottery()
{
    // We need some globals
    global $MySelf;
    global $DB;
    $formDisable = "";
    if (lotto_getOpenDrawing()) {
        $formDisable = "disabled";
    }
    // is Lotto enabled at all?
    if (!getConfig("lotto")) {
        makeNotice("Your CEO disabled the Lotto module, request denied.", "warning", "Lotto Module Offline");
    }
    // Deny access to non-lotto-officials.
    if (!$MySelf->isLottoOfficial()) {
        makeNotice("You are not allowed to do this!", "error", "Permission denied");
    }
    $table = new table(2, true);
    $table->addHeader(">> Open new drawing");
    $table->addRow();
    $table->addCol("Number of tickets in draw:");
    $table->addCol("<input type=\"text\" name=\"count\" " . $formDisable . " value=\"30\">");
    //	$newLotto = new table (2);
    $table->addHeaderCentered("<input type=\"submit\" name=\"submit\" " . $formDisable . " value=\"open new drawing\">", array("bold" => true, "colspan" => 2));
    $html = "<h2>Lotto Administration</h2>";
    $html .= "<form action=\"index.php\" method=\"POST\">";
    $html .= "<input type=\"hidden\" name=\"check\" value=\"true\">";
    $html .= "<input type=\"hidden\" name=\"action\" value=\"createDrawing\">";
    $html .= $table->flush();
    $html .= "</form>";
    if (lotto_getOpenDrawing()) {
        $html .= "[<a href=\"index.php?action=drawLotto\">Draw Winner</a>]";
    }
    return $html;
}
开发者ID:nuxi,项目名称:MiningBuddy,代码行数:35,代码来源:lotto_editLottery.php


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