當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CsviHelper::recurseArrayDiff方法代碼示例

本文整理匯總了PHP中CsviHelper::recurseArrayDiff方法的典型用法代碼示例。如果您正苦於以下問題:PHP CsviHelper::recurseArrayDiff方法的具體用法?PHP CsviHelper::recurseArrayDiff怎麽用?PHP CsviHelper::recurseArrayDiff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CsviHelper的用法示例。


在下文中一共展示了CsviHelper::recurseArrayDiff方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCronLine

 /**
  * Build the command to use for the cron command to do an import/export
  *
  * @copyright
  * @author 		RolandD
  * @todo
  * @see
  * @access 		public
  * @param
  * @return 		string	the parameters for the cron line
  * @since 		3.0
  */
 public function getCronLine()
 {
     $jinput = JFactory::getApplication()->input;
     $db = JFactory::getDbo();
     $settings = $jinput->get('com_csvi.data', array(), 'array');
     $cronline = '';
     $notemplate = false;
     $details = new StdClass();
     // Get the template used
     $template_id = $jinput->get('template_id', 0, 'int');
     if ($template_id) {
         $cronline .= ' template_id="' . $template_id . '"';
         // Load the template settings to compare against selection
         $query = $db->getQuery(true);
         $query->select('settings');
         $query->from('#__csvi_template_settings');
         $query->where('id = ' . $template_id);
         $db->setQuery($query);
         $template = new CsviTemplate(json_decode($db->loadResult(), true));
         $details->type = $template->get('action', 'options');
     } else {
         $notemplate = true;
         // Initialise the details
         $details->type = $settings['options']['action'];
     }
     // Check if this is an import or export cron
     if ($details->type == 'export') {
         foreach ($settings as $group => $values) {
             switch ($group) {
                 case 'options':
                     break;
                 case 'general':
                     if ($notemplate) {
                         $general = $settings['general'];
                     } else {
                         $general = CsviHelper::recurseArrayDiff($settings['general'], $template->get('general'));
                     }
                     foreach ($general as $name => $setting) {
                         switch ($name) {
                             case 'exportto':
                                 if (!empty($setting)) {
                                     if ($setting == 'todownload') {
                                         $setting = 'tofile';
                                     }
                                     $cronline .= ' jform:general:' . $name . '="' . $setting . '" ';
                                 }
                                 break;
                             case 'localpath':
                                 if (!empty($setting)) {
                                     if ($template->get('exportto', 'general') == 'todownload' || $template->get('exportto', 'general') == 'tofile') {
                                         $cronline .= ' jform:general:' . $name . '="' . $setting . '" ';
                                     }
                                 }
                                 break;
                             default:
                                 if (!empty($setting)) {
                                     $cronline .= ' jform:general:' . $name . '="' . $setting . '" ';
                                 }
                                 break;
                         }
                     }
                     break;
                 case 'export_fields':
                     if ($notemplate) {
                         if (array_key_exists('export_fields', $settings)) {
                             $fields = $settings['export_fields'];
                         } else {
                             $fields = array();
                         }
                     } else {
                         $fields = $template->get('export_fields', '', array());
                     }
                     if (!empty($fields)) {
                         $fields['_selected_name'] = CsviHelper::recurseArrayDiff($settings['export_fields']['_selected_name'], $fields['_selected_name']);
                         if (!empty($fields['_selected_name'])) {
                             $cronline .= ' jform:export_fields:_selected_name = "' . implode('|', $settings['export_fields']['_selected_name']) . '|"';
                             $cronline .= ' jform:export_fields:_column_header = "' . implode('|', $settings['export_fields']['_column_header']) . '|"';
                             $cronline .= ' jform:export_fields:_default_value = "' . implode('|', $settings['export_fields']['_default_value']) . '|"';
                             $cronline .= ' jform:export_fields:_process_field = "' . implode('|', $settings['export_fields']['_process_field']) . '|"';
                         }
                     }
                     break;
                 default:
                     if ($notemplate) {
                         $values = $settings[$group];
                     } else {
                         $values = CsviHelper::recurseArrayDiff($settings[$group], $template->get($group));
                     }
//.........這裏部分代碼省略.........
開發者ID:alesconti,項目名稱:FF_2015,代碼行數:101,代碼來源:cron.php


注:本文中的CsviHelper::recurseArrayDiff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。