本文整理汇总了PHP中JRegistry::loadINI方法的典型用法代码示例。如果您正苦于以下问题:PHP JRegistry::loadINI方法的具体用法?PHP JRegistry::loadINI怎么用?PHP JRegistry::loadINI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRegistry
的用法示例。
在下文中一共展示了JRegistry::loadINI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveItemPrices
function saveItemPrices($d, $commissionType)
{
$db = $this->getDbo();
$params = new JRegistry();
//load old params, so params for other commission types does not get overwritten
$params->loadINI($this->loadPricingObject()->params, null, true);
$params->set($commissionType . '.default_price', JArrayHelper::getValue($d, 'default_price'));
$params->set($commissionType . '.price_powerseller', JArrayHelper::getValue($d, 'price_powerseller'));
$params->set($commissionType . '.price_verified', JArrayHelper::getValue($d, 'price_verified'));
$params->set($commissionType . '.category_pricing_enabled', JArrayHelper::getValue($d, 'category_pricing_enabled'));
$email_text = base64_encode(JArrayHelper::getValue($d, 'email_text'));
$params->set($commissionType . '.email_text', $email_text);
$p = $params->toString('INI');
$db->setQuery("update `#__" . APP_PREFIX . "_pricing`\r\n set `params`='{$p}'\r\n where `itemname`='{$this->name}'");
$db->query();
$db->setQuery("delete from `#__" . APP_PREFIX . "_pricing_categories` where `itemname`='" . $commissionType . '.' . $this->name . "'");
$db->query();
$category_pricing = JArrayHelper::getValue($d, 'category_pricing', array(), 'array');
foreach ($category_pricing as $k => $v) {
if (!empty($v) || $v === '0') {
$db->setQuery("insert into `#__" . APP_PREFIX . "_pricing_categories` (`category`,`price`,`itemname`) values ('{$k}','{$v}','" . $commissionType . '.' . $this->name . "')");
$db->query();
}
}
}
示例2: installMessage
function installMessage()
{
$db =& JFactory::getDBO();
$lang =& JFactory::getLanguage();
$currentlang = $lang->getTag();
$objectReadxmlDetail = new JSNISReadXmlDetails();
$infoXmlDetail = $objectReadxmlDetail->parserXMLDetails();
$langSupport = $infoXmlDetail['langs'];
$registry = new JRegistry();
$newStrings = array();
$path = null;
$realLang = null;
$queries = array();
if (array_key_exists($currentlang, $langSupport)) {
$path = JLanguage::getLanguagePath(JPATH_BASE, $currentlang);
$realLang = $currentlang;
} else {
$filepath = JPATH_ROOT . DS . 'administrator' . DS . 'language';
$foldersLang = $this->getFolder($filepath);
foreach ($foldersLang as $value) {
if (in_array($value, $langSupport) == true) {
$path = JLanguage::getLanguagePath(JPATH_BASE, $value);
$realLang = $value;
break;
}
}
}
$filename = $path . DS . $realLang . '.com_imageshow.ini';
$content = @file_get_contents($filename);
if ($content) {
$registry->loadINI($content);
$newStrings = $registry->toArray();
if (count($newStrings)) {
if (count($infoXmlDetail['menu'])) {
$queries[] = 'TRUNCATE TABLE `#__imageshow_messages`';
foreach ($infoXmlDetail['menu'] as $value) {
$index = 1;
while (isset($newStrings['MESSAGE ' . $value . ' ' . $index . ' PRIMARY'])) {
$queries[] = 'INSERT INTO `#__imageshow_messages` (`msg_id`,`msg_screen`,`published`,`ordering`) VALUES (NULL, "' . $value . '", 1, ' . $index . ')';
$index++;
}
}
}
}
if (count($queries)) {
foreach ($queries as $query) {
$query = trim($query);
if ($query != '') {
$db->setQuery($query);
$db->query();
}
}
}
}
return true;
}
示例3: loadPlugins
/**
* Parses "plugins.list" files and loads all plugins listed there
*
* @access public
* @return bool true on success , false on failure
*/
function loadPlugins()
{
$pluginPath = JWF_BACKEND_PATH . DS . 'plugins' . DS . 'field_handlers' . DS;
$registry = new JRegistry();
$registry->loadINI(file_get_contents($pluginPath . 'plugins.list'));
$plugins = $registry->toArray();
include_once $pluginPath . 'base.php';
foreach ($plugins as $id => $pluginName) {
$this->_loadPlugin($id, $pluginName);
}
return true;
}
示例4: getParams
function getParams($ini, $path = '')
{
$xml = $this->_getXML($path);
if (!$ini) {
return $this->_arrayToObject($xml);
}
$registry = new JRegistry();
$registry->loadINI($ini);
$params = $registry->toArray();
unset($registry);
if (!empty($xml)) {
$params = array_merge($xml, $params);
}
return $this->_arrayToObject($params);
}
示例5: save
public function save()
{
$data = self::$registry->toString('INI');
$db =& JFactory::getDBO();
// An interesting discovery: if your component is manually updating its
// component parameters before Live Update is called, then calling Live
// Update will reset the modified component parameters because
// JComponentHelper::getComponent() returns the old, cached version of
// them. So, we have to forget the following code and shoot ourselves in
// the feet. Dammit!!!
/*
jimport('joomla.html.parameter');
jimport('joomla.application.component.helper');
$component =& JComponentHelper::getComponent(self::$component);
$params = new JParameter($component->params);
$params->setValue(self::$key, $data);
*/
if (version_compare(JVERSION, '1.6.0', 'ge')) {
$sql = $db->getQuery(true)->select($db->nq('params'))->from($db->nq('#__extensions'))->where($db->nq('type') . ' = ' . $db->q('component'))->where($db->nq('element') . ' = ' . $db->q(self::$component));
} else {
$sql = 'SELECT ' . $db->nameQuote('params') . ' FROM ' . $db->nameQuote('#__components') . ' WHERE ' . $db->nameQuote('option') . ' = ' . $db->Quote(self::$component) . " AND `parent` = 0 AND `menuid` = 0";
}
$db->setQuery($sql);
$rawparams = $db->loadResult();
$params = new JRegistry();
if (version_compare(JVERSION, '1.6.0', 'ge')) {
$params->loadJSON($rawparams);
} else {
$params->loadINI($rawparams);
}
$params->setValue(self::$key, $data);
if (version_compare(JVERSION, '1.6.0', 'ge')) {
// Joomla! 1.6
$data = $params->toString('JSON');
$sql = $db->getQuery(true)->update($db->nq('#__extensions'))->set($db->nq('params') . ' = ' . $db->q($data))->where($db->nq('type') . ' = ' . $db->q('component'))->where($db->nq('element') . ' = ' . $db->q(self::$component));
} else {
// Joomla! 1.5
$data = $params->toString('INI');
$sql = 'UPDATE `#__components` SET `params` = ' . $db->Quote($data) . ' WHERE ' . "`option` = " . $db->Quote(self::$component) . " AND `parent` = 0 AND `menuid` = 0";
}
$db->setQuery($sql);
$db->query();
}
示例6: getParams
function getParams($ini, $path = '')
{
$xml = $this->_getXML($path);
if (!$ini) {
return (object) $xml;
}
if (!is_object($ini)) {
$registry = new JRegistry();
$registry->loadINI($ini);
$params = $registry->toObject();
} else {
$params = $ini;
}
if (!empty($xml)) {
foreach ($xml as $key => $val) {
if (!isset($params->{$key}) || $params->{$key} == '') {
$params->{$key} = $val;
}
}
}
return $params;
}
示例7: getForm
function getForm($formname)
{
global $mainframe;
$database =& JFactory::getDBO();
if (!trim($formname)) {
if (JRequest::getVar('chronoformname')) {
JRequest::setVar('chronoformname', preg_replace('/[^A-Za-z0-9_]/', '', JRequest::getVar('chronoformname')));
}
$formname = JRequest::getVar('chronoformname');
if (!$formname) {
$params =& $mainframe->getPageParameters('com_chronocontact');
$formname = preg_replace('/[^A-Za-z0-9_]/', '', $params->get('formname'));
}
}
$query = "SELECT * FROM `#__chrono_contact` WHERE `name` = '" . $formname . "'";
$database->setQuery($query);
$cf_rows = $database->loadObjectList();
if (count($cf_rows)) {
$this->formrow = $cf_rows[0];
$this->formname = "ChronoContact_" . $this->formrow->name;
//load titles
$registry = new JRegistry();
$registry->loadINI($cf_rows[0]->titlesall);
$titlesvalues = $registry->toObject();
//load params
$paramsvalues = new JParameter($this->formrow->paramsall);
$this->formparams = $paramsvalues;
return true;
} else {
$emptyForm = new StdClass();
$emptyForm->id = 0;
$emptyForm->name = '';
$this->formrow = $emptyForm;
$paramsvalues = new JParameter('');
$this->formparams = $paramsvalues;
return false;
}
}
示例8: MenuSelect
/**
* Legacy function, deprecated
*
* @deprecated As of version 1.5
*/
function MenuSelect($name = 'menuselect', $javascript = NULL)
{
$db =& JFactory::getDBO();
$query = 'SELECT params' . ' FROM #__modules' . ' WHERE module = "mod_mainmenu"';
$db->setQuery($query);
$menus = $db->loadObjectList();
$total = count($menus);
$menuselect = array();
$usedmenus = array();
for ($i = 0; $i < $total; $i++) {
$registry = new JRegistry();
$registry->loadINI($menus[$i]->params);
$params = $registry->toObject();
if (!in_array($params->menutype, $usedmenus)) {
$menuselect[$i]->value = $params->menutype;
$menuselect[$i]->text = $params->menutype;
$usedmenus[] = $params->menutype;
}
}
// sort array of objects
JArrayHelper::sortObjects($menuselect, 'text', 1);
$menus = JHTML::_('select.genericlist', $menuselect, $name, 'class="inputbox" size="10" ' . $javascript, 'value', 'text');
return $menus;
}
示例9: foreach
if (!empty($processform)) {
foreach ($processform as $key => $value) {
$processform[$key] = RemoveXSS($processform[$key]);
}
}
$GLOBALS['formeConfig'] = buildFormeConfig();
$database =& JFactory::getDBO();
//get fid
$fid = JRequest::getVar('fid', '', 'GET', 'string', '');
if (!$fid) {
$query = "\r\n SELECT params\r\n FROM #__menu\r\n WHERE id='" . $_GET['Itemid'] . "' AND type='component'";
$database->setQuery($query);
$menurow = $database->loadResult();
if ($menurow) {
$registry = new JRegistry();
$registry->loadINI($menurow);
$configs = $registry->toObject();
$fid = $configs->fid;
}
}
require_once dirname(__FILE__) . '/../../plugins/system/legacy/functions.php';
switch ($func) {
case 'thankyou':
thankyou($option, $did);
break;
case 'captcha':
genCaptcha();
break;
case 'test':
test();
break;
示例10: basename
/**
* Loads a language file and returns the parsed values
*
* @access private
* @param string The name of the file
* @return mixed Array of parsed values if successful, boolean False if failed
*/
function _load($filename)
{
if ($content = @file_get_contents($filename)) {
if ($this->_identifyer === null) {
$this->_identifyer = basename($filename, '.ini');
}
$registry = new JRegistry();
$registry->loadINI($content);
return $registry->toArray();
}
return false;
}
示例11: refreshMessage
/**
* Refesh all messages
*
* @return true.
*/
public function refreshMessage()
{
$db = JFactory::getDBO();
$lang = JFactory::getLanguage();
$currentlang = $lang->getTag();
$objectReadxmlDetail = JSNISFactory::getObj('classes.jsn_is_readxmldetails');
$objJNSUtils = JSNISFactory::getObj('classes.jsn_is_utils');
$infoXmlDetail = $objectReadxmlDetail->parserXMLDetails();
$langSupport = $infoXmlDetail['langs'];
$registry = new JRegistry();
$newStrings = array();
$path = null;
$realLang = null;
$queries = array();
$pathEn = JLanguage::getLanguagePath(JPATH_BASE, 'en-GB');
if (array_key_exists($currentlang, $langSupport)) {
$path = JLanguage::getLanguagePath(JPATH_BASE, $currentlang);
$realLang = $currentlang;
} else {
if (!JFolder::exists($pathEn)) {
$filepath = JPATH_ROOT . DS . 'administrator' . DS . 'language';
$foldersLang = $this->getFolder($filepath);
foreach ($foldersLang as $value) {
if (in_array($value, $langSupport)) {
$path = JLanguage::getLanguagePath(JPATH_BASE, $value);
$realLang = $value;
break;
}
}
}
}
if (JFolder::exists($pathEn)) {
$filename = $pathEn . DS . 'en-GB' . '.com_imageshow.ini';
} else {
$filename = $path . DS . $realLang . '.com_imageshow.ini';
}
$content = $objJNSUtils->readFileToString($filename);
if ($content) {
$registry->loadINI($content);
$newStrings = $registry->toArray();
if (count($newStrings)) {
if (count($infoXmlDetail['menu'])) {
$queries[] = 'TRUNCATE TABLE #__jsn_imageshow_messages';
foreach ($infoXmlDetail['menu'] as $value) {
$index = 1;
while (isset($newStrings['MESSAGE_' . $value . '_' . $index . '_PRIMARY'])) {
$queries[] = 'INSERT INTO #__jsn_imageshow_messages (msg_screen, published, ordering) VALUES (\'' . $value . '\', 1, ' . $index . ')';
$index++;
}
}
}
}
if (count($queries)) {
foreach ($queries as $query) {
$query = trim($query);
if ($query != '') {
$db->setQuery($query);
$db->query();
}
}
}
}
return true;
}
示例12: JRegistry
// $_SESSION['templateName'], $data[3] );
$dataAll = iland4_layDanhSachBDS($dbConfig, $returnField, $conditionParam, $currentPage, $limit, $ordering, $language);
$data = $dataAll[3];
$templatePath = $_GET['template_path'];
$templateName = $_GET['template_name'];
include $templatePath . DS . $templateName . '.php';
} else {
if ($task == 'dsbds') {
// load tieu de theo language
$lang = 'vi-VN';
$path = JLanguage::getLanguagePath(JPATH_BASE, $lang);
$filename = 'vi-VN.mod_danh_sach_BDS.ini';
$filename = $path . DS . $filename;
$content = @file_get_contents($filename);
$registry = new JRegistry();
$registry->loadINI($content);
$titleStrings = $registry->toArray();
//$currentPage = 1;
$condition = $_GET['condition'];
if (!empty($_GET['page'])) {
$currentPage = $_GET['page'];
}
//if ( )
//$limit = $_GET['limit'];
$limit = 1000000000;
$price[] = array();
$price['price_min'] = 0;
$price['price_max'] = 0;
//$price['price_min']=$_GET['price_min'];
//$price['price_max']=$_GET['price_max'];
$returnField = $_GET['returnField'];
示例13: moduledelete
//.........这里部分代码省略.........
echo _SW_UPGRADE_LINK;
?>
</a>
</li>
</ul>
</td>
</tr>
</table>
<div style="clear:both;"></div>
<table align="left" cellpadding="0" cellspacing="0" border="0" width="760" >
<tr><td width="520" valign="top">
<table cellpadding="2" cellspacing="0" border="0" width="99%" align="left">
<tr><td colspan="7" class="swmenu_tabheading"># <?php
echo _SW_MENU_MODULES;
?>
</td>
</tr>
<?php
if (!file_exists($absolute_path . "/modules/mod_swmenupro/mod_swmenupro.php")) {
echo "<tr><td><b>" . _SW_NO_MODULE_NOTICE . "</td></tr></b>";
} else {
if (!count($rows)) {
echo "<tr><td><b>" . _SW_MAKE_MODULE_NOTICE . "</td></tr></b>";
}
}
$k = 0;
for ($i = 0, $n = count($rows); $i < $n; $i++) {
$row =& $rows[$i];
$registry = new JRegistry();
$registry->loadINI($row->params);
$params = $registry->toObject();
$menutype = @$params->menutype ? $params->menutype : 'mainmenu';
$moduletype = @$params->menustyle ? $params->menustyle : 'mambo standard';
?>
<tr class="swmenu_row<?php
echo $k;
?>
">
<td width="10"><?php
echo $i + $pageNav->limitstart + 1;
?>
</td>
<td width="10"><input type="checkbox" id="cb<?php
echo $i;
?>
" name="cid[]" value="<?php
echo $row->id;
?>
" /></td>
<td width="160"><div align="left"> <a href="#edit" onmouseover="this.T_WIDTH=180;return escape('<?php
echo sprintf(_SW_MODULE_TIP, $moduletype, $menutype, $row->position, $row->groupname, $row->published ? _SW_YES : _SW_NO);
?>
')" onclick="return listItemTask('cb<?php
echo $i;
?>
','editDhtmlMenu')"><?php
echo $row->title;
?>
</a></div></td>
<td align="right">
<?php
示例14: check
/**
* Performs a check to see if a job is due to be executed
*
* @access public
* @return void
*/
function check()
{
if (!file_exists(JWF_CRON_CRONTAB)) {
return;
}
$cronJobs = new JRegistry();
$cronJobs->loadINI(JFile::read(JWF_CRON_CRONTAB));
$jobsArray = $cronJobs->toArray();
$jobsDone = 0;
foreach ($jobsArray as $jobName => $jobFrequency) {
$seconds = JWFCronJobManager::getTimeUnit('s', $jobFrequency);
$minutes = JWFCronJobManager::getTimeUnit('m', $jobFrequency);
$hours = JWFCronJobManager::getTimeUnit('h', $jobFrequency);
$days = JWFCronJobManager::getTimeUnit('d', $jobFrequency);
$weeks = JWFCronJobManager::getTimeUnit('w', $jobFrequency);
$frequency = $seconds + $minutes * 60 + $hours * 3600 + $days * 86400 + $weeks * 604800;
$lastExecuteTime = JWFCronJobManager::getLastExecuteTime($jobName);
$nextExecuteTime = $lastExecuteTime + $frequency;
$doneEnoughJobs = $jobsDone >= JWF_CRON_MAXJOBPERCYCLE;
if (($lastExecuteTime == 0 || $nextExecuteTime <= time()) && !$doneEnoughJobs && JWF_CRON_MAXJOBPERCYCLE != 0) {
JWFCronJobManager::setLastExecuteTime($jobName);
call_user_func($jobName);
$jobsDone++;
}
}
}
示例15: stdClass
/**
* Loads a single plugin from XML file including language files
*
* @access private
* @param string $id identification name of the plugin ,see plugins.list for more information
* @param string $name title of the plugin
* @return bool true on success , false on failure
*/
function _loadPlugin($id, $name)
{
$plugin = new stdClass();
$plugin->id = $id;
$plugin->name = $name;
$componentPluginsPath = JWF_BACKEND_PATH . DS . 'plugins' . DS . 'component_handlers' . DS;
$plugin->php = $componentPluginsPath . $id . DS . $id . '.php';
$registry = new JRegistry();
$registry->loadINI(file_get_contents($componentPluginsPath . $id . DS . $id . '.ini'));
$params = $registry->toArray();
$plugin->trigger = $params['Trigger'];
$this->loadedPlugins[$id] = $plugin;
//Load language files
$lang =& JFactory::getLanguage();
$lang->load('component.' . ucfirst($id), JWF_BACKEND_PATH, null, false);
return true;
}