| 1 |
<?php |
| 2 |
// @codingStandardsIgnoreFile |
| 3 |
/** |
| 4 |
* Database routines. |
| 5 |
* |
| 6 |
* Copyright: © 2009-2011 |
| 7 |
* {@link http://websharks-inc.com/ WebSharks, Inc.} |
| 8 |
* (coded in the USA) |
| 9 |
* |
| 10 |
* Released under the terms of the GNU General Public License. |
| 11 |
* You should have received a copy of the GNU General Public License, |
| 12 |
* along with this software. In the main directory, see: /licensing/ |
| 13 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 14 |
* |
| 15 |
* @package s2Member\Database |
| 16 |
* @since 130625 |
| 17 |
*/ |
| 18 |
if(!defined('WPINC')) // MUST have WordPress. |
| 19 |
exit ("Do not access this file directly."); |
| 20 |
|
| 21 |
if (!class_exists ("c_ws_plugin__s2member_database")) |
| 22 |
{ |
| 23 |
/** |
| 24 |
* Database routines. |
| 25 |
* |
| 26 |
* @package s2Member\Database |
| 27 |
* @since 130625 |
| 28 |
*/ |
| 29 |
class c_ws_plugin__s2member_database |
| 30 |
{ |
| 31 |
/** |
| 32 |
* @package s2Member\Database |
| 33 |
* @since 130625 |
| 34 |
* |
| 35 |
* @attaches-to ``add_action("init");`` |
| 36 |
*/ |
| 37 |
public static function wait_timeout () |
| 38 |
{ |
| 39 |
global $wpdb; // Global database object reference. |
| 40 |
|
| 41 |
if(c_ws_plugin__s2member_systematics::is_s2_systematic_use_page () |
| 42 |
|| (!empty($_SERVER["QUERY_STRING"]) && preg_match ("/[\?&]s2member/", $_SERVER["QUERY_STRING"]))) |
| 43 |
$increase_wait_timeout = TRUE; |
| 44 |
|
| 45 |
if(empty($increase_wait_timeout) && !empty($_POST)) foreach(array_keys($_POST) as $post_key) |
| 46 |
if(strpos($post_key, "s2member") === 0) { $increase_wait_timeout = TRUE; break; } |
| 47 |
|
| 48 |
if(!empty($increase_wait_timeout)) $wpdb->query("SET SESSION `wait_timeout` = 300"); |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|