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


PHP fn_array_merge函数代码示例

本文整理汇总了PHP中fn_array_merge函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_array_merge函数的具体用法?PHP fn_array_merge怎么用?PHP fn_array_merge使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fn_array_merge函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: apiUpdateOrder

 public static function apiUpdateOrder($order, $response)
 {
     if (!defined('ORDER_MANAGEMENT')) {
         define('ORDER_MANAGEMENT', true);
     }
     if (!empty($order['status'])) {
         $statuses = fn_get_statuses(STATUSES_ORDER, false, true);
         if (!isset($statuses[$order['status']])) {
             $response->addError('ERROR_OBJECT_UPDATE', str_replace('[object]', 'orders', __('twgadmin_wrong_api_object_data')));
         } else {
             fn_change_order_status($order['order_id'], $order['status']);
         }
     }
     $cart = array();
     fn_clear_cart($cart, true);
     $customer_auth = fn_fill_auth(array(), array(), false, 'C');
     fn_form_cart($order['order_id'], $cart, $customer_auth);
     $cart['order_id'] = $order['order_id'];
     // update only profile data
     $profile_data = fn_check_table_fields($order, 'user_profiles');
     $cart['user_data'] = fn_array_merge($cart['user_data'], $profile_data);
     $cart['user_data'] = fn_array_merge($cart['user_data'], $order);
     fn_calculate_cart_content($cart, $customer_auth, 'A', true, 'I');
     if (!empty($order['details'])) {
         db_query('UPDATE ?:orders SET details = ?s WHERE order_id = ?i', $order['details'], $order['order_id']);
     }
     if (!empty($order['notes'])) {
         $cart['notes'] = $order['notes'];
     }
     fn_update_payment_surcharge($cart, $customer_auth);
     list($order_id, $process_payment) = fn_place_order($cart, $customer_auth, 'save');
     return array($order_id, $process_payment);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:33,代码来源:TwigmoOrder.php

示例2: clear

 static function clear($changed_tables)
 {
     $tags = array();
     foreach ($changed_tables as $table => $flag) {
         if (!empty(self::$_cache_handlers[$table])) {
             $tags = fn_array_merge($tags, array_keys(self::$_cache_handlers[$table]), false);
         }
     }
     self::$db->query("DELETE FROM cache WHERE tags IN ('" . implode("', '", $tags) . "')");
     self::$db->query("REPLACE INTO cache (name, data) VALUES ('cache_handlers', '" . sqlite_escape_string(serialize(self::$_cache_handlers)) . "')");
     return true;
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:12,代码来源:class.cache_backend_sqlite.php

示例3: clear

 static function clear($changed_tables)
 {
     $tags = array();
     foreach ($changed_tables as $table => $flag) {
         if (!empty(self::$_cache_handlers[$table])) {
             $tags = fn_array_merge($tags, array_keys(self::$_cache_handlers[$table]), false);
         }
     }
     db_query("DELETE FROM ?:cache WHERE tags IN (?a)", $tags);
     db_query("REPLACE INTO ?:cache ?e", array('name' => 'cache_handlers', 'data' => serialize(self::$_cache_handlers)));
     return true;
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:12,代码来源:class.cache_backend_mysql.php

示例4: fn_google_anaylitics_send

function fn_google_anaylitics_send($account, $order_info, $refuse = false)
{
    $url = 'http://www.google-analytics.com/collect';
    $sign = $refuse == true ? '-' : '';
    //Common data which should be sent with any request
    $required_data = array('v' => '1', 'tid' => $account, 'cid' => md5($order_info['email']), 'ti' => $order_info['order_id'], 'cu' => $order_info['secondary_currency']);
    $transaction = array('t' => 'transaction', 'tr' => $sign . $order_info['total'], 'ts' => $sign . $order_info['shipping_cost'], 'tt' => $sign . $order_info['tax_subtotal']);
    $result = Http::get($url, fn_array_merge($required_data, $transaction));
    foreach ($order_info['products'] as $item) {
        $item = array('t' => 'item', 'in' => $item['product'], 'ip' => fn_format_price($item['subtotal'] / $item['amount']), 'iq' => $sign . $item['amount'], 'ic' => $item['product_code'], 'iv' => fn_ga_get_main_category($item['product_id'], $order_info['lang_code']));
        $result = Http::get($url, fn_array_merge($required_data, $item));
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:13,代码来源:func.php

示例5: clear

 static function clear($changed_tables)
 {
     $tags = array();
     foreach ($changed_tables as $table => $flag) {
         if (!empty(self::$_cache_handlers[$table])) {
             $tags = fn_array_merge($tags, array_keys(self::$_cache_handlers[$table]), false);
         }
     }
     foreach ($tags as $tag) {
         fn_rm(DIR_CACHE . $tag, true);
     }
     fn_put_contents(DIR_CACHE . self::$_handlers_name, serialize(self::$_cache_handlers));
     return true;
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:14,代码来源:class.cache_backend_file.php

示例6: _prepareAnywhere

 private function _prepareAnywhere()
 {
     $company_suburb = Registry::get('settings.Company.company_suburb');
     $code = $this->_shipping_info['service_params']['temando_method'];
     $origination = $this->_shipping_info['package_info']['origination'];
     $location = $this->_shipping_info['package_info']['location'];
     if ($code != 'Door to Door') {
         $x = array('originState' => $origination['state'], 'originCity' => $origination['city'], 'destinationState' => $location['state'], 'destinationCity' => $location['city']);
     } else {
         $x = array('originSuburb' => !empty($company_suburb) ? $company_suburb : $origination['city'], 'destinationSuburb' => $location['suburb']);
     }
     $where = array('itemNature' => 'Domestic', 'itemMethod' => $code, 'originCountry' => 'AU', 'originCode' => $origination['zipcode'], 'destinationCountry' => 'AU', 'destinationCode' => $location['zipcode'], 'destinationIs' => 'Residence', 'originIs' => 'Business');
     return fn_array_merge($where, $x);
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:14,代码来源:Temando.php

示例7: instance

 /**
  * Gets storage object instance
  *
  * @param  string  $type    type of storage
  * @param  array   $options options
  * @return Storage storage object instance
  */
 public static function instance($type, $options = array())
 {
     $options = empty($options) ? Registry::get('runtime.storage') : $options;
     $storage = $options['storage'];
     if (empty($storage)) {
         throw new DeveloperException('Storage: undefined storage backend');
     }
     if (!Registry::get('config.storage.' . $type)) {
         throw new DeveloperException('Storage: undefined storage type - ' . $type);
     }
     if (empty(self::$_instance[$storage])) {
         $class = '\\Tygh\\Backend\\Storage\\' . ucfirst($storage);
         self::$_instance[$storage] = new $class();
     }
     self::$_instance[$storage]->options = fn_array_merge($options, Registry::get('config.storage.' . $type));
     self::$_instance[$storage]->type = $type;
     return self::$_instance[$storage];
 }
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:25,代码来源:Storage.php

示例8: preloadLangVars

 /**
  * Loads received language variables into language cache
  *
  * @param array  $var_names Language variable that to be loaded
  * @param string $lang_code 2-letter language code
  *
  * @return boolean True if any of received language variables were added into cache; false otherwise
  */
 public static function preloadLangVars($var_names, $lang_code = CART_LANGUAGE)
 {
     Registry::registerCache('lang_cache', array('language_values', 'ult_language_values'), Registry::cacheLevel('dispatch'), true);
     $values = Registry::get('lang_cache.' . $lang_code);
     if (empty($values)) {
         $values = array();
     }
     $var_names = array_diff($var_names, array_keys($values));
     if ($var_names) {
         foreach ($var_names as $index => $var_name) {
             $var_names[$index] = strtolower($var_name);
             if (isset($values[$var_name])) {
                 unset($var_names[$index]);
             }
         }
         if (empty($var_names)) {
             return true;
         }
         $fields = array('lang.name' => true, 'lang.value' => true);
         $tables = array('?:language_values lang');
         $left_join = array();
         $condition = array(db_quote('lang.lang_code = ?s', $lang_code), db_quote('lang.name IN (?a)', $var_names));
         $params = array();
         fn_set_hook('get_lang_var', $fields, $tables, $left_join, $condition, $params);
         $joins = !empty($left_join) ? ' LEFT JOIN ' . implode(', ', $left_join) : '';
         $new_values = db_get_hash_single_array('SELECT ' . implode(', ', array_keys($fields)) . ' FROM ' . implode(', ', $tables) . $joins . ' WHERE ' . implode(' AND ', $condition), array('name', 'value'));
         foreach ($var_names as $var_name) {
             if (!isset($new_values[$var_name])) {
                 $new_values[$var_name] = '_' . $var_name;
             }
         }
         $values = fn_array_merge($values, $new_values);
         Registry::set('lang_cache.' . $lang_code, $values);
         return true;
     }
     return false;
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:45,代码来源:Helper.php

示例9: fn_update_image_pairs

function fn_update_image_pairs($icons, $detailed, $pairs_data, $object_id = 0, $object_type = 'product_lists', $object_ids = array(), $update_alt_desc = true, $lang_code = CART_LANGUAGE)
{
    $pair_ids = array();
    if (!empty($pairs_data)) {
        foreach ($pairs_data as $k => $p_data) {
            $data = array();
            $pair_id = !empty($p_data['pair_id']) ? $p_data['pair_id'] : 0;
            $o_id = !empty($object_id) ? $object_id : (!empty($p_data['object_id']) ? $p_data['object_id'] : 0);
            if ($o_id == 0 && !empty($object_ids[$k])) {
                $o_id = $object_ids[$k];
            } elseif (!empty($object_ids) && empty($object_ids[$k])) {
                continue;
            }
            // Check if main pair is exists
            if (empty($pair_id) && !empty($p_data['type']) && $p_data['type'] == 'M') {
                $pair_data = db_get_row("SELECT pair_id, image_id, detailed_id FROM ?:images_links WHERE object_id = ?i AND object_type = ?s AND type = ?s", $o_id, $object_type, $p_data['type']);
                $pair_id = !empty($pair_data['pair_id']) ? $pair_data['pair_id'] : 0;
            } else {
                $pair_data = db_get_row("SELECT image_id, detailed_id FROM ?:images_links WHERE pair_id = ?i", $pair_id);
                if (empty($pair_data)) {
                    $pair_id = 0;
                }
            }
            // Update detailed image
            if (!empty($detailed[$k]) && !empty($detailed[$k]['size'])) {
                if (fn_get_image_size($detailed[$k]['path'])) {
                    $data['detailed_id'] = fn_update_image($detailed[$k], !empty($pair_data['detailed_id']) ? $pair_data['detailed_id'] : 0, 'detailed');
                }
            }
            // Update icon
            if (!empty($icons[$k]) && !empty($icons[$k]['size'])) {
                if (fn_get_image_size($icons[$k]['path'])) {
                    $data['image_id'] = fn_update_image($icons[$k], !empty($pair_data['image_id']) ? $pair_data['image_id'] : 0, $object_type);
                }
            }
            // Update alt descriptions
            if ((empty($data) && !empty($pair_id) || !empty($data)) && $update_alt_desc == true) {
                $image_ids = array();
                if (!empty($pair_id)) {
                    $image_ids = db_get_row("SELECT image_id, detailed_id FROM ?:images_links WHERE pair_id = ?i", $pair_id);
                }
                $image_ids = fn_array_merge($image_ids, $data);
                $fields = array('detailed', 'image');
                foreach ($fields as $field) {
                    if (!empty($image_ids[$field . '_id']) && isset($p_data[$field . '_alt'])) {
                        if (!is_array($p_data[$field . '_alt'])) {
                            $_data = array('description' => empty($p_data[$field . '_alt']) ? '' : trim($p_data[$field . '_alt']), 'object_holder' => 'images');
                            // check, if this is new record, create new descriptions for all languages
                            $is_exists = db_get_field('SELECT object_id FROM ?:common_descriptions WHERE object_id = ?i AND lang_code = ?s AND object_holder = ?s', $image_ids[$field . '_id'], $lang_code, 'images');
                            if (!$is_exists) {
                                fn_create_description('common_descriptions', 'object_id', $image_ids[$field . '_id'], $_data);
                            } else {
                                db_query('UPDATE ?:common_descriptions SET ?u WHERE object_id = ?i AND lang_code = ?s AND object_holder = ?s', $_data, $image_ids[$field . '_id'], $lang_code, 'images');
                            }
                        } else {
                            foreach ($p_data[$field . '_alt'] as $lc => $_v) {
                                $_data = array('object_id' => $image_ids[$field . '_id'], 'description' => empty($_v) ? '' : trim($_v), 'lang_code' => $lc, 'object_holder' => 'images');
                                db_query("REPLACE INTO ?:common_descriptions ?e", $_data);
                            }
                        }
                    }
                }
            }
            if (empty($data)) {
                continue;
            }
            // Pair is exists
            $data['position'] = !empty($p_data['position']) ? $p_data['position'] : 0;
            // set data position
            if (!empty($pair_id)) {
                db_query("UPDATE ?:images_links SET ?u WHERE pair_id = ?i", $data, $pair_id);
            } else {
                $data['type'] = $p_data['type'];
                // set link type
                $data['object_id'] = $o_id;
                // assign pair to object
                $data['object_type'] = $object_type;
                $pair_id = db_query("INSERT INTO ?:images_links ?e", $data);
            }
            $pairs_data[$k]['pair_id'] = $pair_id;
            $pair_ids[] = $pair_id;
        }
    }
    fn_set_hook('update_image_pairs', $pair_ids, $icons, $detailed, $pairs_data, $object_id, $object_type, $object_ids, $update_alt_desc, $lang_code);
    return $pair_ids;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:86,代码来源:fn.images.php

示例10: foreach

 if (!empty($registers)) {
     foreach ($registers as $register_id => $register) {
         $spsr_invoices = db_get_array("SELECT * FROM ?:rus_spsr_invoices WHERE order_id = ?i AND register_id = ?i ", $order_info['order_id'], $register['register_id']);
         if (!empty($spsr_invoices)) {
             $_invoices = array();
             foreach ($spsr_invoices as $invoice) {
                 $_invoices[] = $invoice['invoice_number'];
                 if (!empty($invoice['invoice_number'])) {
                     $spsr_invoice_info[$invoice['invoice_number']] = $invoice;
                 }
                 unset($spsr_shipments[$invoice['shipment_id']]);
             }
             $spsr_couriers = RusSpsr::WAGetActiveOrders();
             Tygh::$app['view']->assign('spsr_couriers', $spsr_couriers);
             $invoice_info = RusSpsr::WAGetInvoiceInfo($_invoices);
             $spsr_invoice_info = fn_array_merge($invoice_info, $spsr_invoice_info);
             if (!empty($invoice_info)) {
                 $spsr_register = 1;
             }
         }
         if ($register['status'] == 'S') {
             $register_status = 'Y';
         }
     }
     Tygh::$app['view']->assign('spsr_invoice_info', $spsr_invoice_info);
 }
 Tygh::$app['view']->assign('spsr_register_status', $register_status);
 Tygh::$app['view']->assign('spsr_register', $spsr_register);
 foreach ($spsr_shipments as $shipment) {
     $shipping_data = fn_get_shipping_info($shipment['shipping_id'], DESCR_SL);
     $shipping_data['rate'] = $order_info['shipping_cost'];
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:orders.post.php

示例11: _getSettingItem

 /**
  * Returns array of setting item data from xml node
  * @param $xml_node
  * @return array
  */
 protected function _getSettingItem($xml_node)
 {
     $addon_id = (string) $this->_xml->id;
     $default_language = $this->getDefaultLanguage();
     foreach (fn_get_translation_languages() as $lang_code => $_v) {
         $items[$lang_code] = $this->getPoValues($lang_code, 'SettingsOptions');
     }
     if (isset($xml_node['id'])) {
         $_types = $this->_getTypes();
         $translations = $this->_getTranslations($xml_node, 'SettingsOptions', $addon_id);
         $tooltip_translations = $this->_getTranslations($xml_node, 'SettingsTooltips', $addon_id, 'tooltip');
         $setting = array('edition_type' => $this->_getEditionType($xml_node), 'id' => (string) $xml_node['id'], 'name' => isset($items[$default_language][(string) $xml_node['id']]) ? $items[$default_language][(string) $xml_node['id']] : (string) $xml_node->name, 'type' => isset($_types[(string) $xml_node->type]) ? $_types[(string) $xml_node->type] : '', 'translations' => fn_array_merge($translations, $tooltip_translations), 'default_value' => isset($xml_node->default_value) ? (string) $xml_node->default_value : '', 'variants' => $this->_getVariants($xml_node), 'handler' => isset($xml_node->handler) ? (string) $xml_node->handler : '', 'parent_id' => isset($xml_node['parent_id']) ? (string) $xml_node['parent_id'] : '');
         return $setting;
     } else {
         return array();
     }
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:22,代码来源:XmlScheme3.php

示例12: __construct

 /**
  * Init backend
  *
  * @param array $config global configuration params
  * @param array $params additional params passed from Session class
  *
  * @return bool true if backend was init correctly, false otherwise
  */
 public function __construct($config, $params = array())
 {
     parent::__construct($config, $params);
     $this->config = fn_array_merge(array('redis_server' => $config['session_redis_server'], 'saas_uid' => !empty($config['saas_uid']) ? $config['saas_uid'] : null), $this->config);
     return $this->connect();
 }
开发者ID:askzap,项目名称:ultimate,代码行数:14,代码来源:Redis.php

示例13: die

if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    //
    // Creation gift certificate
    //
    if ($mode == 'create_gift_certificate') {
        $change_return_status = $_REQUEST['change_return_status'];
        if (!empty($_REQUEST['accepted'])) {
            $total = 0;
            $return_info = fn_get_return_info($change_return_status['return_id']);
            foreach ((array) $_REQUEST['accepted'] as $item_id => $v) {
                if (isset($v['chosen']) && $v['chosen'] == 'Y') {
                    $total += $v['amount'] * $return_info['items'][RETURN_PRODUCT_ACCEPTED][$item_id]['price'];
                }
            }
            if ($total > 0) {
                $certificate = fn_create_return_gift_certificate($return_info['order_id'], fn_format_price($total));
                $return_info['extra'] = unserialize($return_info['extra']);
                if (!isset($return_info['extra']['gift_certificates'])) {
                    $return_info['extra']['gift_certificates'] = array();
                }
                $return_info['extra']['gift_certificates'] = fn_array_merge($return_info['extra']['gift_certificates'], $certificate);
                $_data = array('extra' => serialize($return_info['extra']));
                db_query("UPDATE ?:rma_returns SET ?u WHERE return_id = ?i", $_data, $change_return_status['return_id']);
            }
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'rma.details?return_id=' . $change_return_status['return_id']);
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:rma.post.php

示例14: _prepareData

 /**
  * Parses request URL to use in request
  * @param  string $method request method
  * @param  string $url    request URL
  * @param  mixed  $data   request data
  * @return array  parsed URL and URL-encoded data
  */
 private static function _prepareData($method, $url, $data)
 {
     $components = parse_url($url);
     $upass = '';
     if (!empty($components['user'])) {
         $upass = $components['user'] . (!empty($components['pass']) ? ':' . $components['pass'] : '') . '@';
     }
     if (empty($components['path'])) {
         $components['path'] = '/';
     }
     $port = empty($components['port']) ? '' : ':' . $components['port'];
     $url = $components['scheme'] . '://' . $upass . $components['host'] . $port . $components['path'];
     if (!empty($components['query'])) {
         if ($method == self::GET) {
             parse_str($components['query'], $args);
             if (!empty($data) && !is_array($data) && !empty($args)) {
                 throw new DeveloperException('Http: incompatible data type passed');
             }
             $data = fn_array_merge($args, $data);
         } else {
             $url .= '?' . $components['query'];
         }
     }
     return array($url, is_array($data) ? http_build_query($data) : $data);
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:32,代码来源:Http.php

示例15: fn_get_patterns

/**
 * Gets all available patterns for the section
 *
 * @param string $section section to get patterns for
 * @param string $get_for get import or export patterns
 * @return array
 */
function fn_get_patterns($section, $get_for)
{
    // Get core patterns
    $files = fn_get_dir_contents(Registry::get('config.dir.schemas') . 'exim', false, true, '.php');
    foreach (Registry::get('addons') as $addon_name => $addon_data) {
        if ($addon_data['status'] != 'A') {
            continue;
        }
        $schema_dir = Registry::get('config.dir.addons') . $addon_name . '/schemas/exim';
        if (is_dir($schema_dir)) {
            $_files = fn_get_dir_contents($schema_dir, false, true, '.php');
            foreach ($_files as $key => $filename) {
                if (strpos($filename, '.post.php') !== false) {
                    unset($_files[$key]);
                }
            }
            if (!empty($_files)) {
                $files = fn_array_merge($files, $_files, false);
            }
        }
    }
    $patterns = array();
    $sections = array();
    foreach ($files as $schema_file) {
        if (strpos($schema_file, '.functions.') !== false) {
            // skip functions schema definition
            continue;
        }
        $pattern_id = str_replace('.php', '', $schema_file);
        $pattern = fn_get_pattern_definition($pattern_id, $get_for);
        if (empty($pattern) || !fn_check_pattern_permissions($pattern, $get_for, $_SESSION['auth']['user_id'])) {
            continue;
        }
        $sections[$pattern['section']] = array('title' => __($pattern['section']), 'href' => 'exim.' . Registry::get('runtime.mode') . '?section=' . $pattern['section']);
        if ($pattern['section'] == $section) {
            $patterns[$pattern_id] = $pattern;
        }
    }
    if (Registry::get('runtime.company_id')) {
        $schema = fn_get_permissions_schema('vendor');
        // Check if the selected section is available
        if (isset($schema[$get_for]['sections'][$section]['permission']) && !$schema[$get_for]['sections'][$section]['permission']) {
            return array('', '');
        }
        if (!empty($schema[$get_for]['sections'])) {
            foreach ($schema[$get_for]['sections'] as $section_id => $data) {
                if (isset($data['permission']) && !$data['permission']) {
                    unset($sections[$section_id]);
                }
            }
        }
        if (!empty($schema[$get_for]['patterns'])) {
            foreach ($schema[$get_for]['patterns'] as $pattern_id => $data) {
                if (isset($data['permission']) && !$data['permission']) {
                    unset($patterns[$pattern_id]);
                }
            }
        }
    }
    ksort($sections, SORT_STRING);
    uasort($patterns, 'fn_sort_patterns');
    return array($sections, $patterns);
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:70,代码来源:exim.php


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