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


PHP JRegistry::loadINI方法代码示例

本文整理汇总了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();
         }
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:25,代码来源:comission.php

示例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;
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:56,代码来源:jsn_is_installermessage.php

示例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;
 }
开发者ID:BGCX261,项目名称:zonales-svn-to-git,代码行数:18,代码来源:field.php

示例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);
 }
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:15,代码来源:parameters.php

示例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();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:43,代码来源:component.php

示例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;
 }
开发者ID:jtresca,项目名称:nysurveyor,代码行数:22,代码来源:parameters.php

示例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;
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:38,代码来源:chronoform.php

示例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;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:29,代码来源:menu.php

示例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;
开发者ID:RangerWalt,项目名称:ecci,代码行数:31,代码来源:forme.php

示例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;
 }
开发者ID:kumarsivarajan,项目名称:jaderp,代码行数:19,代码来源:jajax.php

示例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;
 }
开发者ID:NallelyFlores89,项目名称:basvec,代码行数:69,代码来源:jsn_is_message.php

示例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'];
开发者ID:omarmm,项目名称:MangLuoiBDS,代码行数:31,代码来源:ajax_function.php

示例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 
开发者ID:vnishukov,项目名称:agere,代码行数:67,代码来源:admin.swmenupro.html.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++;
         }
     }
 }
开发者ID:BGCX261,项目名称:zonales-svn-to-git,代码行数:32,代码来源:jwf.cron.php

示例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;
 }
开发者ID:BGCX261,项目名称:zonales-svn-to-git,代码行数:25,代码来源:component.php


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