本文整理汇总了PHP中ini函数的典型用法代码示例。如果您正苦于以下问题:PHP ini函数的具体用法?PHP ini怎么用?PHP ini使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ini函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit()
{
$this->CheckAdminPrivs('catalog');
$id = post('id', 'int');
if ($id> 0) {
$data = ini('catalog.icon');
$script = post('script', 'string');
$result = logic('upload')->Save('catalog_image', false, false);
$data[$id] = array('icon'=>$result['url'],'script'=>$script);
ini('catalog.icon', $data);
$this->Messager('分类配置已经更新!', '?mod=catalog');
}else{
$id = get('id', 'int');
$data = ini('catalog.icon');
if($data && is_array($data)){
foreach ($data as $key => $value) {
if ($key != $id) {
unset($data[$key]);
}
$data[$key]['script'] = stripcslashes($value['script']);
}
}
include handler('template')->file('@admin/catalog_edit');
}
}
示例2: ModuleObject
function ModuleObject( $config )
{
$this->MasterObject($config);
$rtype = user()->get('role_type');
$rtype || $rtype = 'normal';
$artypes = explode(',', ini('upload.role'));
if (false === array_search($rtype, $artypes))
{
$msg = 'Access Deined';
if ($this->Code == 'image')
{
$ops = array(
'status' => 'fails',
'msg' => $msg
);
}
elseif ($this->Code == 'editor')
{
$ops = array(
'error' => 1,
'message' => $msg
);
}
else
{
exit($msg);
}
exit(jsonEncode($ops));
}
$runCode = Load::moduleCode($this);
$this->$runCode();
}
示例3: Main
function Main()
{
$clientUser = get('u', 'int');
if ( $clientUser != '' )
{
handler('cookie')->setVar('finderid', $clientUser);
handler('cookie')->setVar('findtime', time());
}
$data = logic('product')->display();
if (!$data && get('page', 'int') == 0)
{
header('Location: '.rewrite('?mod=subscribe&code=mail'));
exit;
}
$product = $data['product'];
$this->Title = $data['mutiView'] ? '' : $product['name'];
$data['mutiView'] || mocod('product.view');
$data['mutiView'] || productCurrentView($product);
$favorited = logic('favorite')->get_one($product['id']);
if(INDEX_DEFAULT === true && ini('settings.template_path') == 'meituan'){
$new_product = logic('product')->GetNewList(10, true);
if(empty($new_product)) {
$new_product = logic('product')->GetNewList(10);
}
}
include handler('template')->file($data['file']);
}
示例4: INITParameter_all
private function INITParameter_all($payment, $parameter)
{
$this->api()->hd('request')->setParameter("partner", $payment['config']['bargainor']);
$this->api()->hd('request')->setParameter("out_trade_no", $parameter['sign']);
$this->api()->hd('request')->setParameter("total_fee", $parameter['price'] * 100);
$this->api()->hd('request')->setParameter("return_url", $parameter['notify_url']);
$this->api()->hd('request')->setParameter("notify_url", $parameter['notify_url']);
$this->api()->hd('request')->setParameter("body", cut_str($parameter['detail'], 88));
$this->api()->hd('request')->setParameter("bank_type", 'DEFAULT');
$this->api()->hd('request')->setParameter("spbill_create_ip", $_SERVER['REMOTE_ADDR']);
$this->api()->hd('request')->setParameter("fee_type", "1");
$this->api()->hd('request')->setParameter("subject", $parameter['name']);
$this->api()->hd('request')->setParameter("sign_type", "MD5");
$this->api()->hd('request')->setParameter("service_version", "1.0");
$this->api()->hd('request')->setParameter("input_charset", ini('settings.charset'));
$this->api()->hd('request')->setParameter("sign_key_index", "1");
$this->api()->hd('request')->setParameter("attach", "");
$this->api()->hd('request')->setParameter("product_fee", "");
$this->api()->hd('request')->setParameter("transport_fee", "0");
$this->api()->hd('request')->setParameter("time_start", date("YmdHis"));
$this->api()->hd('request')->setParameter("time_expire", "");
$this->api()->hd('request')->setParameter("buyer_id", "");
$this->api()->hd('request')->setParameter("goods_tag", "");
$this->api()->hd('request')->setParameter("transport_desc","");
$this->api()->hd('request')->setParameter("trans_type","1");
$this->api()->hd('request')->setParameter("agentid","");
$this->api()->hd('request')->setParameter("agent_type","");
$this->api()->hd('request')->setParameter("seller_id","");
if ($payment['config']['service'] == 'direct')
{
$this->api()->hd('request')->setParameter("trade_mode", 1); }
if ($payment['config']['service'] == 'medi')
{
$this->api()->hd('request')->setParameter("trade_mode", 2); }
}
示例5: install_links
/**
* @copyright (C)2014 Cenwor Inc.
* @author Cenwor <www.cenwor.com>
* @package php
* @name install.live.php
* @date 2014-09-05 16:22:08
*/
function install_links()
{
$zzxgj = ini('link.link_list.zzxgj');
if (!$zzxgj)
{
$zzxgj_link_list = array(
array (
'name' => _getaarrayrandval(array('企业微博系统','企业2.0系统','企业社交平台','企业社会化交流平台','企业微博系统','企业社交网络','企业微博程序',)),
'url' => 'http:/'.'/www.wangqibao.com',
),
array (
'name' => _getaarrayrandval(array('微博系统下载','开源微博系统','PHP微博程序','企业微博系统','企业微博程序',)),
'url' => 'http:/'.'/jishigou.net',
),
array (
'name' => _getaarrayrandval(array('天天团购系统','团购系统','php团购系统','免费团购程序','开源团购程序','天天团购','团购网站程序','团购网站源码','团购源码下载','团购程序',)),
'url' => 'http:/'.'/www.tttuangou.net',
),
);
$links['zzxgj'] = _getaarrayrandval($zzxgj_link_list);
$links['zzxgj1'] = _getaarrayrandval($zzxgj_link_list);
$links['zzxgj']['order'] = $links['zzxgj1']['order'] = 100;
if($links['zzxgj']['url'] == $links['zzxgj1']['url']) {
unset($links['zzxgj1']);
}
ini('link.link_list', $links);
}
}
示例6: Set
public function Set()
{
$path = get('path', 'txt');
$data = get('data');
$data = (strlen($data) <= 5) ? (($data == 'true') ? true : (($data == 'false') ? false : $data)) : $data;
exit(jsonEncode(ini($path, $data)));
}
示例7: Main
function Main()
{
$pid = get('pid');
$pid || $pid = post('pid');
$pid || exit($this->Ends());
preg_match('/^[a-z0-9]+$/i', $pid) || exit($this->Ends());
$payment = logic('pay')->GetOne($pid);
$payment || exit($this->Ends());
$status = logic('pay')->Verify($payment);
$status || exit($this->Ends());
$trade = logic('pay')->TradeData($payment);
$trade || exit($this->Ends());
if ($payment['code'] == 'alipay' || $payment['code'] == 'tenpay')
{
if (ini('payment.lp.enabled'))
{
if (MEMBER_ID)
{
header('Location: '.rewrite('index.php?mod=buy&code=order&op=process&sign='.$trade['sign']));
exit;
}
}
}
$parserAPI = logic('callback')->Parser($trade);
$parserAPI->MasterIframe($this);
preg_match('/^[a-z_]+$/i', $status) || exit($this->Ends());
$code = 'Parse_'.$status;
method_exists($parserAPI, $code) || exit($this->Ends());
$parserAPI->$code($payment);
}
示例8: Batch
function Batch()
{
$this->CheckAdminPrivs('ordermanage');
$searchWhere = get('ssrc') ? ini('isearcher.map.'.get('ssrc').'.name') : '任意';
$searchValue = get('sstr') ? get('sstr') : '任意';
$ordSTA = get('ordsta', 'number');
is_numeric($ordSTA) || $ordSTA = ORD_STA_ANY;
$searchSTA = logic('order')->STA_Name($ordSTA);
$ordPROC = get('ordproc', 'string');
$ordSPROC = $ordPROC ? $ordPROC : '*';
$ordPROC = $ordPROC ? ('process="'.$ordPROC.'"') : '1';
$searchPROC = logic('order')->PROC_Name($ordSPROC);
$_GET[EXPORT_GENEALL_FLAG] = EXPORT_GENEALL_VALUE;
$_GET['code'] = 'vlist';
if(MEMBER_ROLE_TYPE == 'seller'){
$pids = logic('product')->GetUserSellerProduct(MEMBER_ID);
$asql = 0;
if($pids){
$asql = implode(',',$pids);
}
$ordPROC .= ' AND productid IN('.$asql.')';
}
$list = logic('order')->GetList(0, $ordSTA, ORD_PAID_ANY, $ordPROC);
$allCount = $list ? count($list) : 0;
$_GET['code'] = 'batch';
$ccURL = str_replace('code=batch', 'code=batch&op=done', page_moyo_request_uri());
include handler('template')->file('@admin/order_process_batch');
}
示例9: TemplateHandler
function TemplateHandler(&$config=null)
{
if (!is_null($config))
{
$this->TemplateRootPath=isset($config['template_root_path'])?$config['template_root_path']:"./templates/";
$this->TemplateDir=$config['template_path'];
$this->TemplatePath=$this->TemplateRootPath.$this->TemplateDir.'/';
if(!isset($config['compiled_root_path']) or $config['compiled_root_path']=='')
{
$this->CompiledPath=$this->TemplatePath.$this->CompiledFolder;
}
else
{
$this->CompiledPath=$config['compiled_root_path'].'/'.$this->TemplateDir.'/';
}
}
else
{
$this->TemplateRootPath = ini('settings.template_root_path');
$this->TemplateDir = ini('settings.template_path');
$this->TemplatePath=$this->TemplateRootPath.$this->TemplateDir.'/';
$cpl_path = ini('settings.compiled_root_path');
if(!$cpl_path || $cpl_path == '')
{
$this->CompiledPath=$this->TemplatePath.$this->CompiledFolder;
}
else
{
$this->CompiledPath = $cpl_path.'/'.$this->TemplateDir.'/';
}
}
}
示例10: load
public function load($idx)
{
$map = ini('isearcher.map');
$fidString = ini('isearcher.idx.'.$idx);
$fids = explode(',', $fidString);
$filter = ini('isearcher.filter');
$ffsString = ini('isearcher.frc.'.$idx);
$frcs = explode(',', $ffsString);
$timev = ini('isearcher.timev');
$tvString = ini('isearcher.tvs.'.$idx);
$tvss = explode(',', $tvString);
$tvinputs = array();
foreach ($tvss as $tvsk)
{
if (isset($_GET['iscp_tvbegin_'.$tvsk]))
{
$tvinputs[$tvsk]['begin'] = get('iscp_tvbegin_'.$tvsk, 'txt');
}
if (isset($_GET['iscp_tvfinish_'.$tvsk]))
{
$tvinputs[$tvsk]['finish'] = get('iscp_tvfinish_'.$tvsk, 'txt');
}
}
$iscp_input_value = ($_GET['iscp_input_value'] ? $_GET['iscp_input_value'] : $_POST['iscp_input_value']);
include handler('template')->file('@html/isearcher/index');
}
示例11: load
function load( $area = '' )
{
if ($area == '')
{
$area = str_replace('.', '_', mocod());
}
$pox = 'widget.'.$area.'.blocks';
$list = ini($pox);
if ( false === $list )
{
if (substr($area, 0, 5) == 'html_')
{
$html = logic('html')->query(substr($area, 5));
ini('widget.'.$area, array('name' => $html['title'], 'blocks' => array()));
}
else
{
ini('widget.~@config.listener.enabled') && ini($pox, array());
}
return;
}
echo '<!'.'-- widget @ [ '.$area.' ] --'.'>';
foreach ( $list as $name => $one )
{
if (isset($one['enabled']) && $one['enabled'])
{
handler('template')->load('@widget/' . $name);
}
}
}
示例12: add_score
public function add_score($pid=0,$uid=0,$score=0,$type='buy',$share=''){
$info = '';
if(!in_array($type,array('buy','reply','forward'))){
$type='buy';
}
if($type != 'buy'){
$set_scores = ini('credits.config');
$score = (int)$set_scores[$type];
}
$products = dbc(DBCMax)->select('product')->in('name')->where('`id`='. (int)$pid)->limit(1)->done();
if($products['name']){
if($type == 'buy'){
$info = '购买产品:'.$products['name'];
}elseif($type == 'reply'){
$info = '评论产品:'.$products['name'];
}elseif($type == 'forward' && $share && $uid > 0){
$chx = dbc(DBCMax)->select('credit')->where(array('uid'=>$uid,'pid'=>$pid,'type'=>'forward'))->limit(1)->done();
if(!$chx){
$info = '分享产品:'.$products['name'].' 到:'.$share;
}
}
}
if($uid > 0 && $score > 0 && $info){
$data = array(
'uid' => $uid,
'pid' => $pid,
'info' => $info,
'score'=> $score,
'type' => $type,
'gettime' => time(),
);
dbc(DBCMax)->insert('credit')->data($data)->done();
dbc(DBCMax)->update('members')->data('scores=scores+'.$score)->where('uid='.(int)$uid)->done();
}
}
示例13: get_all
public function get_all()
{
$tpl_root = handler('template')->TemplateRootPath.'themes/';
$styles_io = handler('io')->ReadDir($tpl_root);
$styles_lc = ini('styles.local');
$styles_lc || $styles_lc = array();
$styles_ms = $styles_lc;
foreach ($styles_io as $i => $style_name)
{
$style_name = str_replace($tpl_root, '', $style_name);
if (isset($styles_lc[$style_name]))
{
unset($styles_ms[$style_name]);
}
else
{
$styles_lc[$style_name] = array(
'name' => '新增皮肤',
'enabled' => false
);
}
}
foreach ($styles_ms as $style_name => $style_data)
{
$styles_lc[$style_name] = array(
'name' => $style_data['name'].'[已失效]',
'enabled' => false
);
}
return $styles_lc;
}
示例14: iGOS_save
function iGOS_save()
{
$this->CheckAdminPrivs('uiigos');
$style = post('style', 'txt');
ini('ui.igos.style', $style);
$this->Messager(__('保存成功!'));
}
示例15: Import
function Import()
{
$flag = get('flag', 'txt');
if (!$flag || !ini('alipay.address.import.source.'.$flag)) exit('ERROR: no Import Source');
$html = logic('address')->import()->linker($flag);
logic('address')->import()->referer($_SERVER['HTTP_REFERER']);
include handler('template')->file('@address/import/redirect');
}