本文整理汇总了PHP中zen_set_time_limit函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_set_time_limit函数的具体用法?PHP zen_set_time_limit怎么用?PHP zen_set_time_limit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_set_time_limit函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unlink
if (file_exists(DIR_FS_BACKUP . $backup_file)) {
@exec('gzip ' . DIR_FS_BACKUP . $backup_file);
}
break;
case 'zip':
@exec(LOCAL_EXE_ZIP . ' -j ' . DIR_FS_BACKUP . $backup_file . '.zip ' . DIR_FS_BACKUP . $backup_file);
if (file_exists(DIR_FS_BACKUP . $backup_file) && file_exists(DIR_FS_BACKUP . $backup_file . 'zip')) {
unlink(DIR_FS_BACKUP . $backup_file);
}
}
}
zen_redirect(zen_href_link(FILENAME_BACKUP_MYSQL));
break;
case 'restorenow':
case 'restorelocalnow':
zen_set_time_limit(300);
$specified_restore_file = isset($_GET['file']) ? $_GET['file'] : '';
if ($specified_restore_file != '' && file_exists(DIR_FS_BACKUP . $specified_restore_file)) {
$restore_file = DIR_FS_BACKUP . $specified_restore_file;
$extension = substr($specified_restore_file, -3);
//determine file format and unzip if needed
if ($extension == 'sql' || $extension == '.gz' || $extension == 'zip') {
switch ($extension) {
case 'sql':
$restore_from = $restore_file;
$remove_raw = false;
break;
case '.gz':
$restore_from = substr($restore_file, 0, -3);
exec(LOCAL_EXE_GUNZIP . ' ' . $restore_file . ' -c > ' . $restore_from);
$remove_raw = true;
示例2: zen_redirect
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath));
}
// future cat specific deletion
$delete_linked = 'true';
if ($_POST['delete_linked'] == 'delete_linked_no') {
$delete_linked = 'false';
} else {
$delete_linked = 'true';
}
// delete category and products
if (isset($_POST['categories_id'])) {
$categories_id = zen_db_prepare_input($_POST['categories_id']);
// create list of any subcategories in the selected category,
$categories = zen_get_category_tree($categories_id, '', '0', '', true);
zen_set_time_limit(600);
// loop through this cat and subcats for delete-processing.
for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
$sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
$category_products = $db->Execute($sql);
while (!$category_products->EOF) {
$cascaded_prod_id_for_delete = $category_products->fields['products_id'];
$cascaded_prod_cat_for_delete = array();
$cascaded_prod_cat_for_delete[] = $categories[$i]['id'];
//echo 'processing product_id: ' . $cascaded_prod_id_for_delete . ' in category: ' . $cascaded_prod_cat_for_delete . '<br>';
// determine product-type-specific override script for this product
$product_type = zen_get_products_type($category_products->fields['products_id']);
// now loop thru the delete_product_confirm script for each product in the current category
if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
require DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php';
} else {
示例3: messageStack
require DIR_WS_CLASSES . 'box.php';
// initialize the message stack for output messages
require DIR_WS_CLASSES . 'message_stack.php';
$messageStack = new messageStack();
// split-page-results
// require(DIR_FS_CATALOG . DIR_WS_CLASSES . 'split_page_results.php');
require DIR_WS_CLASSES . 'split_page_results.php';
// entry/item info classes
require DIR_WS_CLASSES . 'object_info.php';
// email classes
require DIR_WS_CLASSES . 'mime.php';
require DIR_FS_CATALOG . DIR_WS_CLASSES . 'email.php';
// file uploading class
require DIR_WS_CLASSES . 'upload.php';
// set a default time limit
zen_set_time_limit(GLOBAL_SET_TIME_LIMIT);
// auto activate and expire banners
require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'banner.php';
zen_activate_banners();
zen_expire_banners();
// auto expire special products
require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'specials.php';
zen_start_specials();
zen_expire_specials();
// auto expire featured products
require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'featured.php';
zen_start_featured();
zen_expire_featured();
// auto expire salemaker sales
require DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'salemaker.php';
zen_start_salemaker();
示例4: import_subscriptions
function import_subscriptions($delim = ',', $encl = false, $sample = '', $def_format = 'TEXT', $header_row = true)
{
global $db;
$email_elem = false;
$format_elem = false;
$error = '';
$sample_arr = explode(' ', trim($sample));
$elems = count($sample_arr);
$email_elem = array_search('email', $sample_arr);
$format_elem = array_search('format', $sample_arr);
if ($email_elem === false) {
$error = 'Upload failed: No email element specified.';
}
$import_file = $_FILES['subscriber_import_file']['tmp_name'];
$import_error = $_FILES['subscriber_import_file']['error'];
if (!empty($import_error)) {
switch ($import_error) {
case 1:
case 2:
$error = 'Upload failed: The uploaded file exceeds the upload_max_filesize<br/>';
break;
case 3:
$error = 'Upload failed: The uploaded file was only partially uploaded.<br/>';
break;
case 4:
$error = 'Upload failed: No file was uploaded.<br/>';
break;
case 6:
$error = 'Upload failed: Missing a temporary folder.<br/>';
break;
default:
$error = 'Upload failed: Unknown error uploading file.<br />';
break;
}
} elseif (empty($import_file)) {
$error = 'Upload failed: File not found/uploaded.<br />';
return false;
}
if (empty($error)) {
switch ($delim) {
case '\\n':
$delim = "\n";
break;
case '\\t':
$delim = "\t";
break;
case '\\a':
$delim = "\\a";
break;
case ' ':
case '':
$delim = "\t";
break;
}
$row = 1;
$imported = 0;
$handle = fopen($import_file, "r");
zen_set_time_limit(600);
for ($row = 1; ($data = fgetcsv($handle, 10000, $delim)) !== FALSE; $row++) {
if (count($data) == 1 && strlen($data[0]) < 3) {
/* empty row */
} elseif ($header_row && $row == 1) {
} else {
$ea = empty($data[$email_elem]) ? '' : $data[$email_elem];
$ef = !empty($data[$format_elem]) && in_array(strtoupper($data[$format_elem]), array('HTML', 'TEXT')) ? strtoupper($data[$format_elem]) : $def_format;
if (!empty($ea)) {
$db->Execute("REPLACE INTO " . TABLE_SUBSCRIBERS . " ( email_address, email_format, confirmed, subscribed_date ) VALUES ( '{$ea}', '{$ef}', '1', NOW() )");
$imported++;
}
}
}
fclose($handle);
}
return array($imported, $error);
}
示例5: messageStack
// initialize the message stack for output messages
require_once DIR_WS_CLASSES . 'message_stack.php';
$messageStack = new messageStack();
$gBitSmarty->assign_by_ref('messageStack', $messageStack);
// split-page-results
// require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'split_page_results.php');
require_once DIR_WS_CLASSES . 'split_page_results.php';
// entry/item info classes
require_once DIR_WS_CLASSES . 'object_info.php';
// email classes
require_once DIR_WS_CLASSES . 'mime.php';
require_once DIR_FS_CATALOG . DIR_WS_CLASSES . 'email.php';
// file uploading class
require_once DIR_WS_CLASSES . 'upload.php';
// set a default time limit
zen_set_time_limit($gCommerceSystem->getConfig('GLOBAL_SET_TIME_LIMIT', 600));
// auto activate and expire banners
require_once DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'banner.php';
zen_activate_banners();
zen_expire_banners();
// auto expire special products
require_once DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'specials.php';
zen_start_specials();
zen_expire_specials();
// auto expire featured products
require_once DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'featured.php';
zen_start_featured();
zen_expire_featured();
// auto expire salemaker sales
require_once DIR_FS_CATALOG . DIR_WS_FUNCTIONS . 'salemaker.php';
zen_start_salemaker();
示例6: delete_category
function delete_category($categories_id)
{
global $db, $zc_products;
// future cat specific deletion
$delete_linked = 'true';
if ($_POST['delete_linked'] == 'delete_linked_no') {
$delete_linked = 'false';
} else {
$delete_linked = 'true';
}
// delete category and products
$categories_id = zen_db_prepare_input($categories_id);
// create list of any subcategories in the selected category,
$categories = zen_get_category_tree($categories_id, '', '0', '', true);
zen_set_time_limit(600);
// loop through this cat and subcats for delete-processing.
for ($i = 0, $n = sizeof($categories); $i < $n; $i++) {
$sql = "select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $categories[$i]['id'] . "'";
$category_products = $db->Execute($sql);
while (!$category_products->EOF) {
// determine product-type-specific override script for this product
$product_type = zen_get_products_type($category_products->fields['products_id']);
// now loop thru the delete_product_confirm script for each product in the current category
if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php')) {
require DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/delete_product_confirm.php';
} else {
require DIR_WS_MODULES . 'delete_product_confirm.php';
}
// THIS LINE COMMENTED BECAUSE IT'S DONE ALREADY DURING DELETE_PRODUCT_CONFIRM.PHP:
//zen_remove_product($category_products->fields['products_id'], $delete_linked);
$category_products->MoveNext();
}
zen_remove_category($categories[$i]['id']);
}
// end for loop
}