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


PHP WPSC_Countries::active_wpsc_country_by_country_id方法代碼示例

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


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

示例1: _clean_data_maps

 /**
  * Create the empty maps used by this class to do it's work.
  *
  * This functions contributes greatly to the performance of the class. Data maps that are named
  * can store and retrieve themselves at the time of the first request. That means they don't need to
  * be rebuilt every time, nor does all of the data have to be loaded and waiting for a request that
  * may never come.
  *
  * Because the geographic data managed by this class can be accessed hundreds or even
  * thousands of times when creating WPeC pages, moderate gains here can translate into
  * substantial gains in end user perfroamnce. For this reason this class will try to keep
  * the smaller frequently references data sets (data maps) intact and always available.
  * Potentially large data sets, such as the global list of all countires with all regions,
  * are only loaded when they are accessed. The WPSC_Data_Map provides the transpernet
  * loading and creating functions for these data sets.
  *
  *
  * @access private
  *
  * @static
  *
  * @since 3.8.14
  *
  */
 private static function _clean_data_maps()
 {
     /*
      * maps without names will be loaded with the core class, we maintain
      * a list as they are created
      */
     self::$_maps_to_save_with_core_class = array();
     // at 3.8.14 checked and this is about 1 KB of data
     if (is_a(self::$region_by_region_id, 'WPSC_Data_Map')) {
         self::$region_by_region_id->clear();
     } else {
         self::$region_by_region_id = new WPSC_Data_Map(null, array(__CLASS__, '_create_region_by_region_id_map'));
     }
     self::$_maps_to_save_with_core_class['region_by_region_id'] = true;
     // at 3.14 checked and this is about 1 KB of data
     if (is_a(self::$region_code_by_region_id, 'WPSC_Data_Map')) {
         self::$region_code_by_region_id->clear();
     } else {
         self::$region_code_by_region_id = new WPSC_Data_Map(null, array(__CLASS__, '_create_region_code_by_region_id_map'));
     }
     self::$_maps_to_save_with_core_class['region_code_by_region_id'] = true;
     // at 3.8.14 checked and this is about 1 KB of data
     if (is_a(self::$country_id_by_region_id, 'WPSC_Data_Map')) {
         self::$country_id_by_region_id->clear();
     } else {
         self::$country_id_by_region_id = new WPSC_Data_Map(null, array(__CLASS__, '_create_country_id_by_region_id_map'));
     }
     self::$_maps_to_save_with_core_class['country_id_by_region_id'] = true;
     // at 3.8.14 checked and this is about 1 KB of data
     if (is_a(self::$country_id_by_iso_code, 'WPSC_Data_Map')) {
         self::$country_id_by_iso_code->clear();
     } else {
         self::$country_id_by_iso_code = new WPSC_Data_Map(null, array(__CLASS__, '_create_country_id_by_iso_code_map'));
     }
     self::$_maps_to_save_with_core_class['country_id_by_iso_code'] = true;
     // at 3.8.14 checked and this is about 1 KB of data
     if (is_a(self::$country_code_by_country_id, 'WPSC_Data_Map')) {
         self::$country_code_by_country_id->clear();
     } else {
         self::$country_code_by_country_id = new WPSC_Data_Map(null, array(__CLASS__, '_create_country_code_by_country_id'));
     }
     self::$_maps_to_save_with_core_class['country_code_by_country_id'] = true;
     // at 3.8.14 checked and this is about 2KB of data with 7 countries active, including US and CA
     if (is_a(self::$active_wpsc_country_by_country_id, 'WPSC_Data_Map')) {
         self::$active_wpsc_country_by_country_id->clear();
     } else {
         self::$active_wpsc_country_by_country_id = new WPSC_Data_Map(null, array(__CLASS__, '_create_active_countries_map'));
     }
     self::$_maps_to_save_with_core_class['active_wpsc_country_by_country_id'] = true;
     // at 3.8.14 checked and this is about 1 KB of data
     if (is_a(self::$currencies, 'WPSC_Data_Map')) {
         self::$currencies->clear();
     } else {
         self::$currencies = new WPSC_Data_Map(null, array(__CLASS__, '_create_currency_by_currency_code_map'));
     }
     self::$_maps_to_save_with_core_class['currencies'] = true;
     /*
      * maps with names can optionally reload thier data themselves when the first request
      * is processed, this class does not need to load/ re-load them because the WPSC_Data_Map
      * class takes care of that transparently. This goes a long way towards keeping the size of
      * of the transient used to cache this classes data small, making WPeC intitialization faster.
      */
     // at 3.14 checked and this is about 3KB of data, this map isn't as frequently used so we will load it if it
     // needed
     if (is_a(self::$country_id_by_country_name, 'WPSC_Data_Map')) {
         self::$country_id_by_country_name->clear();
     } else {
         self::$country_id_by_country_name = new WPSC_Data_Map('$country_id_by_country_name', array(__CLASS__, '_create_country_id_by_country_name_map'));
     }
     self::$_maps_to_save_with_core_class['country_id_by_country_name'] = false;
     // at 3.14 checked and this is about 23KB of data, not a big hit if there is a memory based object cache
     // but impacts perfomance on lower end (default) configurations that use the database to store transients
     if (is_a(self::$all_wpsc_country_by_country_id, 'WPSC_Data_Map')) {
         self::$all_wpsc_country_by_country_id->clear();
     } else {
         self::$all_wpsc_country_by_country_id = new WPSC_Data_Map('$all_wpsc_country_by_country_id', array(__CLASS__, '_create_all_countries_map'));
//.........這裏部分代碼省略.........
開發者ID:RJHanson292,項目名稱:WP-e-Commerce,代碼行數:101,代碼來源:wpsc-countries.class.php


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