本文整理汇总了PHP中ini_parse函数的典型用法代码示例。如果您正苦于以下问题:PHP ini_parse函数的具体用法?PHP ini_parse怎么用?PHP ini_parse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ini_parse函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: BoxchooserSettingsForm
function BoxchooserSettingsForm()
{
parent::MailForm();
page_title(intl_get('Box Settings'));
//set(array('title'=>'Add a Box'));
global $cgi;
//set
if (!$cgi->box) {
echo 'Missing parameter: box';
exit;
}
ini_add_filter('ini_filter_split_comma_single', array('rule 0', 'rule 1', 'rule 2', 'rule 3', 'rule 4', 'rule 5', 'rule 6', 'rule 7', 'rule 8', 'button 0', 'button 1', 'button 2', 'button 3', 'button 4', 'button 5', 'button 6', 'button 7', 'button 8'));
$this->_box_settings = ini_parse('inc/app/' . $cgi->app . '/boxes/' . $cgi->box . '/settings.php');
ini_clear();
unset($this->_box_settings['Meta']);
if (count($this->_box_settings) === 0) {
$this->onSubmit((array) $cgi);
return;
}
foreach ($this->_box_settings as $k => $v) {
$this->createWidget($k, $v);
}
$this->addWidget('hidden', 'app');
$this->addWidget('hidden', 'box');
$this->addWidget('hidden', 'name');
$w =& $this->addWidget('submit', 'sub');
$w->setValues(intl_get('Done'));
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:28,代码来源:index.php
示例2: SitetemplateEditsetForm
function SitetemplateEditsetForm()
{
parent::MailForm();
global $cgi;
$set = $cgi->set;
$this->parseSettings('inc/app/sitetemplate/forms/editset/settings.php');
$settings = array();
if (file_exists('inc/html/' . $set . '/config.ini.php')) {
$settings = ini_parse('inc/html/' . $set . '/config.ini.php', false);
}
$name = $settings['set_name'];
if (!$name) {
$name = $set;
}
$settings['set'] = $set;
//put form values into respective forms
foreach ($settings as $k => $v) {
$this->widgets[$k]->setDefault($v);
}
if (@file_exists('inc/html/' . $set . '/modes.php')) {
$this->widgets['modes']->setDefault(@join('', @file('inc/html/' . $set . '/modes.php')));
} else {
$this->widgets['modes']->setDefault($modesd);
}
$this->widgets['submit_button']->buttons[1]->extra = 'onclick="history.go (-1); return false"';
page_title(intl_get('Editing Properties') . ': ' . $name);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:27,代码来源:index.php
示例3: onSubmit
function onSubmit($vals)
{
$file = $this->_file;
$info = ini_parse($file);
$code = $vals['code'];
if (!empty($vals['locale'])) {
$code .= '-' . $vals['locale'];
}
$info[$code] = array('name' => $vals['name'], 'code' => $vals['code'], 'locale' => $vals['locale'], 'charset' => $vals['charset'], 'fallback' => $vals['fallback'], 'default' => $vals['default']);
$fp = fopen($file, 'w');
if (!$fp) {
echo 'Error: Failed to open languages.php file!';
return;
}
fwrite($fp, ini_write($info));
fclose($fp);
/*header (
sprintf (
'Location: %s/index/appdoc-translation-strings-action?appname=%s&lang=%s&charset=%s',
site_prefix (),
$vals['appname'],
$code,
$vals['charset']
)
);*/
header('Location: ' . site_prefix() . '/index/multilingual-languages-action');
exit;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:28,代码来源:index.php
示例4: sitesearch_filter_ctype
function sitesearch_filter_ctype($ctype)
{
$info = ini_parse('inc/app/cms/conf/collections/' . $ctype . '.php');
if (isset($info['Collection']['display'])) {
return $info['Collection']['display'];
}
return $ctype;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:8,代码来源:Filters.php
示例5: SitewikiSettingsForm
function SitewikiSettingsForm()
{
parent::MailForm(__FILE__);
$settings = ini_parse('inc/app/sitewiki/conf/settings.php', false);
foreach ($settings as $k => $v) {
$this->widgets[$k]->setValue($v);
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:8,代码来源:index.php
示例6: help_get_access
/**
* Looks recursively through the directory structure for an access.php file.
* If found, it will return this file parsed into an array.
*
* @param string
* @param string
* @return array
*
*/
function help_get_access($path, $stop)
{
if (@file_exists($path . '/access.php')) {
return ini_parse($path . '/access.php', false);
}
$info = pathinfo($path);
$newpath = $info['dirname'];
if ($newpath == $stop) {
return array();
}
return help_get_access($newpath, $stop);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:21,代码来源:functions.php
示例7: Rex
function Rex($collection)
{
// gets collection definition from inc/app/cms/conf/collections
$this->info = ini_parse('inc/app/cms/conf/collections/' . $collection . '.php');
if (!is_array($this->info) || count($this->info) == 0) {
$this->collection = false;
return;
}
$this->collection = $this->info['Collection']['name'];
$this->key = $this->info['Collection']['key_field'];
$this->title = $this->info['Collection']['title_field'];
$this->body = $this->info['Collection']['body_field'];
$this->isVersioned = $this->info['Collection']['is_versioned'];
$this->allowUppercaseKey = $this->info['Collection']['allow_uppercase_key'];
foreach ($this->info as $key => $settings) {
if (strpos($key, 'facet:') === 0) {
$key = substr($key, 6);
$this->addFacet($key, $settings);
/*
$type = $settings['type'];
if (strpos ($type, '.') !== false) {
loader_import ($type);
$type = array_pop (explode ('.', $type));
}
$type = 'r' . ucfirst (strtolower ($type)) . 'Facet';
$this->facets[$key] = new $type ($key, $settings);
$this->facets[$key]->preserve = array ('collection', 'orderBy', 'sort');
if ($settings['fields']) {
$this->facets[$key]->fields = preg_split ('/, ?/', $settings['fields'], -1, PREG_SPLIT_NO_EMPTY);
}*/
}
}
$this->rev = new Rev($this->info['Source']['name'], $this->info['Store']['name']);
$this->rev->isVersioned = $this->isVersioned;
$this->rev->allowUppercaseKey = $this->allowUppercaseKey;
foreach ($this->info['Source'] as $k => $v) {
if ($k == 'name') {
continue;
}
$this->rev->source->{$k} = $v;
}
foreach ($this->info['Store'] as $k => $v) {
if ($k == 'name') {
continue;
}
$this->rev->store->{$k} = $v;
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:48,代码来源:Rex.php
示例8: UsradmSettingsForm
function UsradmSettingsForm()
{
parent::MailForm(__FILE__);
page_add_style('
td.label {
width: 200px;
}
td.field {
padding-left: 7px;
padding-right: 7px;
}
');
$config = ini_parse('inc/conf/config.ini.php');
foreach ($config as $cname => $conf) {
foreach ($conf as $k => $v) {
if (isset($this->widgets[$cname . '_' . $k])) {
$this->widgets[$cname . '_' . $k]->setValue($v);
}
}
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:21,代码来源:index.php
示例9: onSubmit
function onSubmit($vals)
{
// overwrite file
$cache = array('Cache' => array(), 'Cacheable' => array());
$cacheable = $vals['cacheable'];
unset($vals['cacheable']);
unset($vals['submit_button']);
foreach ($vals as $k => $v) {
$cache['Cache'][$k] = $v;
}
$cacheable = ini_parse($cacheable, false);
foreach ($this->ignore as $i) {
$cacheable[$i] = false;
}
$cache['Cacheable'] = $cacheable;
loader_import('saf.File');
if (!file_overwrite('inc/conf/cache.php', ini_write($cache))) {
die('Error writing to file: inc/conf/cache.php');
}
echo '<p>' . intl_get('Cache settings saved.') . ' <a href="' . site_prefix() . '/index/cms-cpanel-action">' . intl_get('Continue') . '</a></p>';
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:21,代码来源:index.php
示例10: ini_parse
<?php
// This is where app-level variables can be centrally stored. This file is
// automatically included when the first call to your app is made. Use the
// appconf_set ('name', 'value'); function to add values here.
$conf = ini_parse('inc/app/sitewiki/conf/settings.php', false);
foreach ($conf as $k => $v) {
if ($k == 'template' && $context == 'action') {
page_template($v);
} else {
appconf_set($k, $v);
}
}
appconf_set('default_page', 'HomePage');
appconf_set('date_format', 'F j, Y g:i A');
appconf_set('levels', array('0' => intl_get('Anyone'), '1' => intl_get('Registered Users Only'), '2' => intl_get('Admin-Level Users Only'), '3' => intl_get('Owner Only')));
appconf_set('yesno', array('0' => intl_get('No'), '1' => intl_get('Yes')));
//page_template ('full');
page_add_link('alternate', 'application/rss+xml', site_url() . '/index/sitewiki-feeds-short-action');
page_add_link('alternate', 'application/rss+xml', site_url() . '/index/sitewiki-feeds-full-action');
开发者ID:vojtajina,项目名称:sitellite,代码行数:20,代码来源:properties.php
示例11: getFormSettings
function getFormSettings($name)
{
$app = $this->getApp($name);
$name = $this->removeApp($name, $app);
if (@file_exists($this->prefix . '/' . $app . '/' . $this->formPath . '/' . $name . '/settings.php')) {
return ini_parse($this->prefix . '/' . $app . '/' . $this->formPath . '/' . $name . '/settings.php', true);
}
return array();
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:9,代码来源:Loader.php
示例12: array
$rules = array();
foreach ($value as $k => $v) {
if (strpos($k, 'rule ') === 0) {
$rules[] = $v;
}
}
if (count($rules) == 0) {
$rules = false;
}
$data['params'][$key]['rules'] = $rules;
}
ob_start();
highlight_file($path . '/index.php');
$data['source'] = ob_get_contents();
ob_end_clean();
$info = ini_parse(getcwd() . '/inc/app/' . $parameters['appname'] . '/conf/config.ini.php', false);
$fullname = $info['app_name'];
if (!$fullname) {
$fullname = ucfirst($parameters['appname']);
}
$pathinfo = explode('/', $parameters['form']);
foreach ($pathinfo as $key => $value) {
$pathinfo[$key] = ucfirst($value);
}
if (!empty($data['info']['name'])) {
$pathinfo[count($pathinfo) - 1] = $data['info']['name'];
}
$name = join(' / ', $pathinfo);
page_title(intl_get('AppDoc') . ': ' . $fullname . ' / ' . $name);
echo template_simple('<p><a href="{site/prefix}/index/appdoc-appinfo-action?appname={cgi/appname}">{intl Back}</a></p>');
echo template_simple('formviewer.spt', $data);
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php
示例13: parseSettings
/**
* Parses the specified file using the parse_ini_file()
* function. Sections in the file correspond to the names of
* widgets you wish to create, in addition to a [Form] section
* that sets properties for the form itself. The values in
* each section correspond to properties or methods of the
* widgets. This method can be used to simplify the process
* of defining and customizing a form.
*
* @access public
* @param string $file
* @return boolean
*
*/
function parseSettings($file)
{
if (!@file_exists($file)) {
return false;
}
ini_add_filter('ini_filter_split_comma_single', array('rule 0', 'rule 1', 'rule 2', 'rule 3', 'rule 4', 'rule 5', 'rule 6', 'rule 7', 'rule 8', 'button 0', 'button 1', 'button 2', 'button 3', 'button 4', 'button 5', 'button 6', 'button 7', 'button 8', 'submitButtons'));
$conf = ini_parse($file, true);
ini_clear();
if (count($conf) == 0) {
return false;
}
// form properties, optional
if (is_array($conf['Form'])) {
foreach ($conf['Form'] as $key => $value) {
if (($key == 'title' || $key == 'message') && function_exists('intl_get')) {
$value = intl_get($value);
}
$this->{$key} = $value;
}
unset($conf['Form']);
}
foreach ($conf as $name => $data) {
$this->createWidget($name, $data);
}
return true;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:40,代码来源:MailForm.php
示例14: active
/**
* Determines whether the specified service is active.
*
* @access public
* @param string
* @param array
* @return boolean
*
*/
function active($service, $actions)
{
foreach ($actions as $action) {
$c = ini_parse('inc/app/cms/conf/services/' . $action . '.php');
if (isset($c['service:' . $service])) {
return true;
}
}
return false;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:19,代码来源:Workflow.php
示例15: array
}
if (!isset($cgi->offset)) {
if (isset($cgi->osoffset)) {
$cgi->offset = ($cgi->osoffset - 1) * $cgi->limit;
} else {
$cgi->offset = 0;
}
}
$settings = @parse_ini_file('inc/app/sitesearch/conf/server.ini.php');
$sitesearch_allowed = array();
loader_import('saf.File.Directory');
foreach (Dir::fetch('inc/app/cms/conf/collections') as $file) {
if (strpos($file, '.') === 0 || @is_dir('inc/app/cms/conf/collections/' . $file)) {
continue;
}
$config = ini_parse('inc/app/cms/conf/collections/' . $file);
if (isset($config['Collection']['sitesearch_url'])) {
if (isset($config['Collection']['sitesearch_access']) && session_allowed($config['Collection']['sitesearch_access'], 'r', 'access')) {
$sitesearch_allowed[] = $config['Collection']['name'];
}
}
}
if (!empty($parameters['query'])) {
loader_import('sitesearch.SiteSearch');
$searcher = new SiteSearch();
if (is_array($parameters['ctype'])) {
$collections = $parameters['ctype'];
foreach ($collections as $k => $ctype) {
if (!in_array($ctype, $sitesearch_allowed)) {
unset($collections[$k]);
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php
示例16: ucfirst
if (isset($info['app_name'])) {
$name = $info['app_name'];
} else {
$name = ucfirst($file);
}
page_title(intl_get('Application Settings') . ' - ' . $name);
if (!is_writeable(getcwd() . '/inc/app/' . $parameters['appname'] . '/conf/settings.ini.php')) {
echo '<p class="invalid">' . intl_getf('Warning: The settings file is not writeable. Please verify that the file %s is writeable by the web server user.', 'inc/app/' . $parameters['appname'] . '/conf/settings.ini.php') . '</p>';
return;
}
global $intl;
$old_intl_path = $intl->directory;
$intl->directory = 'inc/app/' . $parameters['appname'] . '/lang';
$intl->getIndex();
$intl->directory = $old_intl_path;
$settings = ini_parse(getcwd() . '/inc/app/' . $parameters['appname'] . '/conf/settings.ini.php', true);
global $cgi;
loader_import('saf.MailForm');
$form = new MailForm();
$w =& $form->addWidget('hidden', 'appname');
$w->setValue($parameters['appname']);
foreach ($settings as $k => $v) {
if (!isset($v['type'])) {
$v['type'] = 'text';
}
if (isset($v['value'])) {
$val = $v['value'];
unset($v['value']);
} else {
$val = false;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php
示例17: array_merge
$attrs = array_merge($attrs, $defaults);
}
$css = new CSS_Parser();
$classes = array();
$ids = array();
foreach (Dir::find('*.css', 'inc/html/' . conf('Server', 'default_template_set')) as $file) {
$css->parse(@join('', @file($file)));
$classes = array_merge($classes, $css->getClasses($cgi->tag));
$ids = array_merge($ids, $css->getIDs($cgi->tag));
}
$classes = array_unique($classes);
$ids = array_unique($ids);
$form = new MailForm();
ini_add_filter('ini_filter_split_comma_single', array('rule 0', 'rule 1', 'rule 2', 'rule 3', 'rule 4', 'rule 5', 'rule 6', 'rule 7', 'rule 8', 'button 0', 'button 1', 'button 2', 'button 3', 'button 4', 'button 5', 'button 6', 'button 7', 'button 8', 'submitButtons'));
foreach ($attrs as $attr) {
$w =& $form->createWidget($attr->name, ini_parse($attr->typedef, false));
if (isset($cgi->{$attr->name})) {
$w->setDefault($cgi->{$attr->name});
}
}
ini_clear();
if (isset($form->widgets['id'])) {
$form->widgets['id']->setValues(array_merge(array('' => '- ' . intl_get('SELECT') . ' -'), assocify($ids)));
}
if (isset($form->widgets['class'])) {
$form->widgets['class']->setValues(array_merge(array('' => '- ' . intl_get('SELECT') . ' -'), assocify($classes)));
}
$w =& $form->addWidget('hidden', 'ifname');
$w->setValue($cgi->ifname);
$w =& $form->addWidget('hidden', 'tag');
$w->setValue($cgi->tag);
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php
示例18: array
<?php
global $cgi;
$data = array();
$content_types = array();
$GLOBALS['_content_weights'] = array();
$applications = parse_ini_file('inc/conf/auth/applications/index.php');
loader_import('saf.File.Directory');
$files = Dir::find('*.php', 'inc/app/cms/conf/collections', false);
foreach ($files as $file) {
if (strstr($file, '/.')) {
continue;
}
$data = ini_parse($file);
$GLOBALS['_content_weights'][$data['Collection']['name']] = $data['Collection']['list_weight'];
if (!isset($data['Collection']['visible']) || $data['Collection']['visible'] != false) {
if (session_is_resource($data['Collection']['name']) && !session_allowed($data['Collection']['name'], 'rw', 'resource')) {
continue;
}
if (isset($data['Collection']['app']) && isset($applications[$data['Collection']['app']]) && !$applications[$data['Collection']['app']]) {
continue;
}
$content_types[$data['Collection']['name']] = intl_get($data['Collection']['display']);
}
}
function cms_collection_sort($a, $b)
{
global $_content_weights, $_content_types;
if ($a == $b) {
return 0;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php
示例19: header
<?php
global $cgi;
if (empty($cgi->appname) || strstr($cgi->appname, '..') || !@is_dir('inc/app/' . $cgi->appname)) {
header('Location: ' . site_prefix() . '/index/appdoc-app');
exit;
}
if (empty($cgi->lang)) {
$cgi->lang = 'en';
}
$info = ini_parse(getcwd() . '/inc/app/' . $cgi->appname . '/conf/config.ini.php', false);
page_title(intl_get('Help Files') . ': ' . $info['app_name']);
if (!@is_dir('inc/app/' . $cgi->appname . '/docs/' . $cgi->lang)) {
loader_import('saf.File.Directory');
$res = Dir::build('inc/app/' . $cgi->appname . '/docs/' . $cgi->lang, 0777);
if (!$res) {
echo '<p>' . intl_get('Failed to create directory') . ': docs/' . $cgi->lang . '</p>';
echo '<p><a href="javascript: history.go (-1)">' . intl_get('Back') . '</a></p>';
return;
}
}
loader_import('help.Help');
$data = array('appname' => $cgi->appname, 'lang' => $cgi->lang, 'files' => array(), 'langs' => help_get_langs($cgi->appname));
$files = help_get_pages($cgi->appname, $cgi->lang);
if (!is_array($files)) {
$files = array();
}
foreach ($files as $file) {
$id = help_get_id($file);
$body = @join('', @file($file));
$word_count = count(preg_split('/\\W+/s', strip_tags($body), -1, PREG_SPLIT_NO_EMPTY));
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php
示例20: display
function display($generate_html = 0)
{
parent::display($generate_html);
global $intl, $simple, $cgi;
// needs browser check to display textarea as alternative
$this->initial_value = $this->formatValue($this->data_value);
$this->scroller_data = $this->formatValue($this->scroller_data);
if ($this->reference !== false) {
if (empty($this->reference)) {
$this->reference = '<br />';
}
$this->reference = $this->formatValue($this->reference);
}
loader_import('ext.phpsniff');
$ua = new phpSniff();
if ($ua->property('browser') == 'ie' && $ua->property('platform') == 'win' && $ua->property('version') >= '5.5' || $ua->property('browser') == 'mz' && $ua->property('version') >= '1.3' || $ua->property('browser') == 'ns' && $ua->property('version') >= '5.0' || $ua->property('browser') == 'fb' && $ua->property('version') >= '0.7' || $ua->property('browser') == 'ca' && $ua->property('version') >= '1.0' || $ua->property('browser') == 'sf' && $ua->property('version') >= '522' || strpos($ua->property('ua'), 'adobeair')) {
// go xed
if ($ua->property('browser') == 'ie') {
$this->msie = true;
if ($ua->property('version') >= '7.0') {
$this->msie7 = 'true';
}
}
if ($ua->property('browser') == 'sf') {
$this->safari = 'true';
} elseif (strpos($ua->property('ua'), 'adobeair')) {
$this->safari = 'true';
$this->adobeair = 'true';
}
if (@file_exists('inc/html/' . conf('Server', 'default_template_set') . '/images.php')) {
if ($cgi->_collection) {
$collection = $cgi->_collection;
} elseif ($cgi->collection) {
$collection = $cgi->collection;
} else {
$collection = false;
}
if ($collection) {
$images = ini_parse('inc/html/' . conf('Server', 'default_template_set') . '/images.php');
if (isset($images[$collection])) {
$this->max_height = $images[$collection]['max_height'];
$this->max_width = $images[$collection]['max_width'];
if ($images[$collection]['popup']) {
$this->img_popup = 'true';
} else {
$this->img_popup = 'false';
}
} else {
$this->max_height = 'false';
$this->max_width = 'false';
$this->img_popup = 'false';
}
} else {
$this->max_height = 'false';
$this->max_width = 'false';
$this->img_popup = 'false';
}
} else {
$this->max_height = 'false';
$this->max_width = 'false';
$this->img_popup = 'false';
}
// initialize modal dialog event handlers
page_onload('xed_init (\'' . $this->name . '\')');
page_onclick('checkModal ()');
page_onfocus('return checkModal ()');
template_bind('/html/body', ' <form style="display: inline" id="xed-' . $this->name . '-fsform" method="post" action="' . site_prefix() . '/index/xed-fullscreen-form" target="xedFullscreenWindow">
<input type="hidden" name="ifname" value="' . $this->name . '" />
<input type="hidden" name="xeditor" value="" />
</form>');
$this->templates = db_fetch_array('select * from xed_templates');
foreach ($this->templates as $k => $t) {
$this->templates[$k]->body = $this->formatValue($t->body);
}
$this->source_height = $this->height + 2;
loader_import('saf.GUI.Prompt');
$template = join('', file('inc/app/xed/html/xed.spt'));
return template_simple($template, $this);
} else {
// return a textarea
return '<tr><td class="field" colspan="2"><textarea name="' . $this->name . '" cols="50" rows="10">' . htmlentities_compat($this->data_value, ENT_COMPAT, $intl->charset) . '</textarea></td></tr>';
}
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:83,代码来源:Xeditor.php
注:本文中的ini_parse函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论