• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getConfig函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了getConfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 <[email protected]>\r\n" . "Reply-To: [email protected]\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


示例16: __construct

 function __construct($config)
 {
     $this->config = $config;
     $this->dbh = new PDO("sqlite:" . getConfig($this->config, 'ftc_data_db', TRUE), NULL, NULL, array(PDO::ATTR_PERSISTENT => TRUE));
     /* FIXME: move to SETUP procedure? */
     $this->dbh->query('CREATE TABLE IF NOT EXISTS storageNodes (id INTEGER PRIMARY KEY AUTOINCREMENT, displayName TEXT, apiUrl TEXT, consumerKey TEXT, consumerSecret TEXT, storageOwner TEXT)');
 }
开发者ID:kaichuang1992,项目名称:filetrader,代码行数:7,代码来源:StorageNodes.class.php


示例17: PHPlistMailer

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


示例18: __call

 public function __call($func, $argv)
 {
     if (substr($func, 0, 3) == 'get') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         if (isset($argv[0])) {
             $environment = $argv[0];
         } else {
             $environment = APPLICATION_ENV;
         }
         return getConfig($key, $environment);
     } elseif (substr($func, 0, 3) == 'set') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         $value = Arrays::first($argv);
         if (isset($argv[1])) {
             $environment = $argv[1];
         } else {
             $environment = 'all';
         }
         setConfig($key, $value, $environment);
         return $this;
     } elseif (substr($func, 0, 3) == 'has') {
         $uncamelizeMethod = Inflector::uncamelize(lcfirst(substr($func, 3)));
         $key = Inflector::lower($uncamelizeMethod);
         if (isset($argv[0])) {
             $environment = $argv[0];
         } else {
             $environment = APPLICATION_ENV;
         }
         return null !== getConfig($key, $environment);
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:33,代码来源:Configdata.php


示例19: rssUserHasContent

function rssUserHasContent($userid,$messageid,$frequency) {
	global $tables;
  switch ($frequency) {
    case "weekly":
      $interval = 'interval 7 day';break;
    case "monthly":
      $interval = 'interval 1 month';break;
    case "daily":
    default:
      $interval = 'interval 1 day';break;
  }
  
	$cansend_req = Sql_Query(sprintf('select date_add(last,%s) < now() from %s where userid = %d',
      $interval,$tables["user_rss"],$userid));
	$exists = Sql_Affected_Rows();
	$cansend = Sql_Fetch_Row($cansend_req);
  if (!$exists || $cansend[0]) {
  	# we can send this user as far as the frequency is concerned
    # now check whether there is actually some content

    # check what lists to use. This is the intersection of the lists for the
    # user and the lists for the message
    $lists = array();
    $listsreq = Sql_Query(sprintf('
    	select %s.listid from %s,%s where %s.listid = %s.listid and %s.userid = %d and
      %s.messageid = %d',
      $tables["listuser"],$tables["listuser"],$tables["listmessage"],
			$tables["listuser"],$tables["listmessage"],
      $tables["listuser"],$userid,$tables["listmessage"],$messageid));
   	while ($row = Sql_Fetch_Row($listsreq)) {
    	array_push($lists,$row[0]);
    }
    if (!sizeof($lists))
    	return 0;
    $liststosend = join(",",$lists);
    # request the rss items that match these lists and that have not been sent to this user
    $itemstosend = array();
		$max = sprintf('%d',getConfig("rssmax"));
		if (!$max) {
			$max = 30;
		}

    $itemreq = Sql_Query("select {$tables["rssitem"]}.*
	    from {$tables["rssitem"]} where {$tables["rssitem"]}.list in ($liststosend) order by added desc, list,title limit $max");
    while ($item = Sql_Fetch_Array($itemreq)) {
    	Sql_Query("select * from {$tables["rssitem_user"]} where itemid = {$item["id"]} and userid = $userid");
      if (!Sql_Affected_Rows()) {
				array_push($itemstosend,$item["id"]);
      }
    }
  #  print "<br/>Items to send for user $userid: ".sizeof($itemstosend);
    # if it is less than the treshold return nothing
    $treshold = getConfig("rsstheshold");
    if (sizeof($itemstosend) >= $treshold)
     	return $itemstosend;
    else
      return array();
  }
 	return array();
}
开发者ID:radicaldesigns,项目名称:amp,代码行数:60,代码来源:rsslib.php


示例20: db_mysqli_query_fetch_list

function db_mysqli_query_fetch_list($mysqli, $query, $MYSQLI_TYPE)
{
    $config = getConfig();
    $params = $config['memcache'];
    $memcache = memcache_connect($params['host'], $params['port']);
    $memcacheQueryKey = 'QUERY' . $query['slow'];
    $data = memcache_get($memcache, $memcacheQueryKey);
    if (!empty($data)) {
    } else {
        if (!empty($query['fast'])) {
            $result = mysqli_query($mysqli, $query['fast']);
        } else {
            $result = mysqli_query($mysqli, $query['slow']);
        }
        $data = [];
        while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
            $data[] = $row;
        }
        //another proc
        /* $pid = pcntl_fork();
           if ($pid == 0) {*/
        memcache_set($memcache, $memcacheQueryKey, $data, 0, 60 * 10);
        /*    posix_kill(posix_getpid(), SIGTERM);
              }*/
    }
    memcache_close($memcache);
    return $data;
}
开发者ID:fedotovaleksandr,项目名称:vkTest,代码行数:28,代码来源:db_mysqli_query_fetch_list.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getConfigFiles函数代码示例发布时间:2022-05-15
下一篇:
PHP getConf函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap