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


PHP c_ws_plugin__s2member_utils_dirs::strip_dir_app_data方法代码示例

本文整理汇总了PHP中c_ws_plugin__s2member_utils_dirs::strip_dir_app_data方法的典型用法代码示例。如果您正苦于以下问题:PHP c_ws_plugin__s2member_utils_dirs::strip_dir_app_data方法的具体用法?PHP c_ws_plugin__s2member_utils_dirs::strip_dir_app_data怎么用?PHP c_ws_plugin__s2member_utils_dirs::strip_dir_app_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在c_ws_plugin__s2member_utils_dirs的用法示例。


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

示例1: S2FilePicker_init

function S2FilePicker_init()
{
    if (is_plugin_active('s2member/s2member.php')) {
        /**/
        if (!is_dir($files_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'])) {
            if (is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir)))) {
                mkdir($files_dir, 0777, true);
            }
        }
        /**/
        if (is_dir($files_dir) && is_writable($files_dir)) {
            if (!file_exists($htaccess = $files_dir . '/.htaccess') || !apply_filters('ws_plugin__s2member_preserve_files_dir_htaccess', false, get_defined_vars())) {
                file_put_contents($htaccess, trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']["s2member"]["c"]['files_dir_htaccess']))));
            }
        }
        add_action('media_buttons', 'S2FilePicker_btn', 20);
        add_action('media_upload_s2fpicker', 'S2FilePicker_media_upload_handler');
        add_action('media_upload_type_S2FilePicker_frame', 'S2FilePicker_media_upload_content');
    } else {
        add_action('admin_notices', 'S2FilePicker_warning');
    }
}
开发者ID:hiryu85,项目名称:s2member-secure-file-picker,代码行数:22,代码来源:s2member-secure-file-picker.php

示例2: s2sfu_initialization

function s2sfu_initialization()
{
    $active_plugins = get_option('active_plugins');
    $required_plugin = 's2member/s2member.php';
    if (in_array($required_plugin, $active_plugins)) {
        /**/
        if (!is_dir($files_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'])) {
            if (is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir)))) {
                mkdir($files_dir, 0777, true);
            }
        }
        /**/
        if (is_dir($files_dir) && is_writable($files_dir)) {
            if (!file_exists($htaccess = $files_dir . '/.htaccess') || !apply_filters('ws_plugin__s2member_preserve_files_dir_htaccess', false, get_defined_vars())) {
                file_put_contents($htaccess, trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']["s2member"]["c"]['files_dir_htaccess']))));
            }
        }
        add_action('media_buttons', 's2sfu_media_button', 20);
        add_action('media_upload_s2sfu', 's2sfu_media_upload_handler');
    } else {
        add_action('admin_notices', 's2sfu_warning');
    }
}
开发者ID:hiryu85,项目名称:s2member-secure-file-uploader,代码行数:23,代码来源:s2member-secure-file-uploader.php

示例3: logs_page

 /**
  * Builds and handles the Logs page.
  *
  * @package s2Member\Menu_Pages
  * @since 120310
  */
 public static function logs_page()
 {
     do_action('ws_plugin__s2member_before_logs_page', get_defined_vars());
     c_ws_plugin__s2member_menu_pages::update_all_options();
     c_ws_plugin__s2member_menu_pages::archive_logs_start_fresh();
     c_ws_plugin__s2member_menu_pages::delete_logs_start_fresh();
     $logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'];
     if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir)))) {
         mkdir($logs_dir, 0777, TRUE) . clearstatcache();
     }
     $htaccess = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'] . '/.htaccess';
     $htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir_htaccess'])));
     if (is_dir($logs_dir) && is_writable($logs_dir) && !file_exists($htaccess)) {
         file_put_contents($htaccess, $htaccess_contents) . clearstatcache();
     }
     if (!is_dir($logs_dir)) {
         // If the security-enabled logs directory does not exist yet.
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) does not exist. Please create this directory manually &amp; make it writable (chmod 777).', TRUE);
     } else {
         if (!is_writable($logs_dir)) {
             // If the logs directory is not writable yet.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) is not writable. Please make this directory writable (chmod 777).', TRUE);
         }
     }
     if (!file_exists($htaccess)) {
         // If the .htaccess file has not been created yet.
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', TRUE);
     } else {
         if (!preg_match('/deny from all/i', file_get_contents($htaccess))) {
             // Else if the .htaccess file does not offer the required protection.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', TRUE);
         }
     }
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['gateway_debug_logs']) {
         // Logging disabled?
         c_ws_plugin__s2member_admin_notices::display_admin_notice('Logging is currently disabled by your configuration.');
     }
     include_once dirname(dirname(__FILE__)) . '/menu-pages/logs.inc.php';
     do_action('ws_plugin__s2member_after_logs_page', get_defined_vars());
 }
开发者ID:adnandot,项目名称:intenseburn,代码行数:46,代码来源:menu-pages.inc.php

示例4: alipay_ops_page

 /**
  * Builds the options panel for this Payment Gateway.
  *
  * @package s2Member\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function alipay_ops_page()
 {
     c_ws_plugin__s2member_menu_pages::update_all_options();
     // Updates options.
     $logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"];
     if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir)))) {
         mkdir($logs_dir, 0777, true) . clearstatcache();
     }
     $htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"] . "/.htaccess";
     $htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir_htaccess"])));
     if (is_dir($logs_dir) && is_writable($logs_dir) && !file_exists($htaccess)) {
         file_put_contents($htaccess, $htaccess_contents) . clearstatcache();
     }
     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
         if (!is_dir($logs_dir)) {
             // If the security-enabled logs directory does not exist yet.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) does not exist. Please create this directory manually &amp; make it writable (chmod 777).', true);
         } else {
             if (!is_writable($logs_dir)) {
                 // If the logs directory is not writable yet.
                 c_ws_plugin__s2member_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) is not writable. Please make this directory writable (chmod 777).', true);
             }
         }
         if (!file_exists($htaccess)) {
             // If the .htaccess file has not been created yet.
             c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
         } else {
             if (!preg_match("/deny from all/i", file_get_contents($htaccess))) {
                 // Else if the .htaccess file does not offer the required protection.
                 c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
             }
         }
     }
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/alipay-ops.inc.php";
     return;
 }
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:44,代码来源:alipay-menu-pages.inc.php

示例5: uninstall

 /**
  * Uninstall routines for s2Member.
  *
  * @package s2Member\Installation
  * @since 3.5
  */
 public static function uninstall()
 {
     global $wpdb;
     /** @var $wpdb wpdb */
     global $current_site, $current_blog;
     // Multisite.
     do_action('ws_plugin__s2member_before_uninstall', get_defined_vars());
     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['run_uninstall_routines']) {
         c_ws_plugin__s2member_roles_caps::unlink_roles();
         c_ws_plugin__s2member_files::remove_no_gzip_from_root_htaccess();
         if (is_dir($files_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['files_dir'])) {
             if (file_exists($htaccess = $files_dir . '/.htaccess')) {
                 if (is_writable($htaccess)) {
                     unlink($htaccess);
                 }
             }
             @rmdir($files_dir) . @rmdir(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir));
         }
         if (is_dir($logs_dir = $GLOBALS['WS_PLUGIN__']['s2member']['c']['logs_dir'])) {
             foreach (scandir($logs_dir) as $log_file) {
                 if (is_file($log_file = $logs_dir . '/' . $log_file)) {
                     if (is_writable($log_file)) {
                         unlink($log_file);
                     }
                 }
             }
             @rmdir($logs_dir) . @rmdir(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir));
         }
         delete_option('ws_plugin__s2member_cache');
         delete_option('ws_plugin__s2member_notices');
         delete_option('ws_plugin__s2member_options');
         delete_option('ws_plugin__s2member_configured');
         delete_option('ws_plugin__s2member_activated_levels');
         delete_option('ws_plugin__s2member_activated_version');
         delete_option('ws_plugin__s2member_activated_mms_version');
         if (is_multisite() && is_main_site()) {
             delete_site_option('ws_plugin__s2member_options');
         }
         $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` LIKE '" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('s2m_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` LIKE '%" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('_s2m_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` LIKE '%" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('s2member_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->usermeta . "` WHERE `meta_key` LIKE '" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('s2m_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->usermeta . "` WHERE `meta_key` LIKE '%" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('_s2m_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->usermeta . "` WHERE `meta_key` LIKE '%" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('s2member_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('s2m_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '%" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('_s2m_')) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '%" . esc_sql(c_ws_plugin__s2member_utils_strings::like_escape('s2member_')) . "%'");
         do_action('ws_plugin__s2member_during_uninstall', get_defined_vars());
     }
     do_action('ws_plugin__s2member_after_uninstall', get_defined_vars());
 }
开发者ID:adnandot,项目名称:intenseburn,代码行数:57,代码来源:installation.inc.php

示例6: down_ops_page

 /**
  * Builds and handles the Download Options page.
  * 
  * @package s2Member\Menu_Pages
  * @since 3.5
  * 
  * @return null
  */
 public static function down_ops_page()
 {
     do_action("ws_plugin__s2member_before_down_ops_page", get_defined_vars());
     /**/
     c_ws_plugin__s2member_menu_pages::update_all_options();
     /**/
     $files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"];
     /**/
     if (!is_dir($files_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir)))) {
         mkdir($files_dir, 0777, true) . clearstatcache();
     }
     /**/
     $htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"] . "/.htaccess";
     $htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir_htaccess"])));
     /**/
     if (is_dir($files_dir) && is_writable($files_dir) && !file_exists($htaccess)) {
         file_put_contents($htaccess, $htaccess_contents) . clearstatcache();
     }
     /**/
     if (!is_dir($files_dir)) {
         /* If the security-enabled files directory does not exist yet. */
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled files directory ( <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($files_dir)) . '</code> ) does not exist. Please create this directory manually.', true);
     }
     /**/
     if (!file_exists($htaccess)) {
         /* If the .htaccess file has not been created yet. */
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file ( <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code> ) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
     } else {
         if (!preg_match("/deny from all/i", file_get_contents($htaccess))) {
             /* Else if the .htaccess file does not offer the required protection. */
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file ( <code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code> ) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
         }
     }
     /**/
     if (!empty($_POST["ws_plugin__s2member_amazon_cf_files_auto_configure_distros"]) && ($nonce = $_POST["ws_plugin__s2member_amazon_cf_files_auto_configure_distros"]) && wp_verify_nonce($nonce, "ws-plugin--s2member-amazon-cf-files-auto-configure-distros")) {
         if (($amazon_cf_auto_configure_distros = c_ws_plugin__s2member_files_in::amazon_cf_auto_configure_distros()) && $amazon_cf_auto_configure_distros["success"]) {
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Amazon® CloudFront Distributions auto-configured successfully. Please allow 30 minutes for propagation.' . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"] ? '<br /><em>Downloads Distribution CNAME: <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_cname"]) . ' &mdash;&raquo; ' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_downloads_dname"]) . '</code></em>' : '') . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"] ? '<br /><em>Streaming Distribution CNAME: <code>' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_cname"]) . ' &mdash;&raquo; ' . esc_html($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["amazon_cf_files_distro_streaming_dname"]) . '</code></em>' : ''));
         } else {
             /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */
             (c_ws_plugin__s2member_menu_pages::$pre_display_errors["cf_files_auto_configure_distros"] = true) . c_ws_plugin__s2member_admin_notices::display_admin_notice('Unable to auto-configure Amazon® CloudFront Distributions.<br />Error code: <code>' . esc_html($amazon_cf_auto_configure_distros["code"]) . '</code>. Error Message: <code>' . esc_html($amazon_cf_auto_configure_distros["message"]) . '</code>', true);
         }
     }
     /**/
     if (!empty($_POST["ws_plugin__s2member_amazon_s3_files_auto_configure_acls"]) && ($nonce = $_POST["ws_plugin__s2member_amazon_s3_files_auto_configure_acls"]) && wp_verify_nonce($nonce, "ws-plugin--s2member-amazon-s3-files-auto-configure-acls")) {
         if (($amazon_s3_auto_configure_acls = c_ws_plugin__s2member_files_in::amazon_s3_auto_configure_acls()) && $amazon_s3_auto_configure_acls["success"]) {
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Amazon® S3 ACLs auto-configured successfully.');
         } else {
             /* Else there was an error. We need to report this back to the site owner so they can understand what's going on. */
             (c_ws_plugin__s2member_menu_pages::$pre_display_errors["s3_files_auto_configure_acls"] = true) . c_ws_plugin__s2member_admin_notices::display_admin_notice('Unable to auto-configure Amazon® S3 ACLs.<br />Error code: <code>' . esc_html($amazon_s3_auto_configure_acls["code"]) . '</code>. Error Message: <code>' . esc_html($amazon_s3_auto_configure_acls["message"]) . '</code>', true);
         }
     }
     /**/
     include_once dirname(dirname(__FILE__)) . "/menu-pages/down-ops.inc.php";
     /**/
     do_action("ws_plugin__s2member_after_down_ops_page", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:67,代码来源:menu-pages.inc.php

示例7: deactivate

 /**
  * Deactivation routines for s2Member.
  *
  * @package s2Member\Installation
  * @since 3.5
  *
  * @return null
  */
 public static function deactivate()
 {
     global $wpdb;
     global $current_site, $current_blog;
     do_action("ws_plugin__s2member_before_deactivation", get_defined_vars());
     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_deactivation_routines"]) {
         c_ws_plugin__s2member_roles_caps::unlink_roles();
         c_ws_plugin__s2member_files::remove_no_gzip_from_root_htaccess();
         if (is_dir($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) {
             if (file_exists($htaccess = $files_dir . "/.htaccess")) {
                 if (is_writable($htaccess)) {
                     unlink($htaccess);
                 }
             }
             @rmdir($files_dir) . @rmdir(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir));
         }
         if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
             foreach (scandir($logs_dir) as $log_file) {
                 if (is_file($log_file = $logs_dir . "/" . $log_file)) {
                     if (is_writable($log_file)) {
                         unlink($log_file);
                     }
                 }
             }
             @rmdir($logs_dir) . @rmdir(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir));
         }
         delete_option("ws_plugin__s2member_cache");
         delete_option("ws_plugin__s2member_notices");
         delete_option("ws_plugin__s2member_options");
         delete_option("ws_plugin__s2member_configured");
         delete_option("ws_plugin__s2member_activated_levels");
         delete_option("ws_plugin__s2member_activated_version");
         delete_option("ws_plugin__s2member_activated_mms_version");
         if (is_multisite() && is_main_site()) {
             delete_site_option("ws_plugin__s2member_options");
         }
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '%" . esc_sql(like_escape("s2member_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql(like_escape("_transient_s2m_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql(like_escape("_transient_timeout_s2m_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` LIKE '%" . esc_sql(like_escape("s2member_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->usermeta . "` WHERE `meta_key` LIKE '%" . esc_sql(like_escape("s2member_")) . "%'");
         do_action("ws_plugin__s2member_during_deactivation", get_defined_vars());
     }
     do_action("ws_plugin__s2member_after_deactivation", get_defined_vars());
     return;
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:54,代码来源:installation.inc.php

示例8: logs_page

 /**
  * Builds and handles the Logs page.
  *
  * @package s2Member\Menu_Pages
  * @since 120310
  *
  * @return null
  */
 public static function logs_page()
 {
     do_action("ws_plugin__s2member_before_logs_page", get_defined_vars());
     c_ws_plugin__s2member_menu_pages::update_all_options();
     c_ws_plugin__s2member_menu_pages::archive_logs_start_fresh();
     c_ws_plugin__s2member_menu_pages::delete_logs_start_fresh();
     $logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"];
     if (!is_dir($logs_dir) && is_writable(dirname(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir)))) {
         mkdir($logs_dir, 0777, true) . clearstatcache();
     }
     $htaccess = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"] . "/.htaccess";
     $htaccess_contents = trim(c_ws_plugin__s2member_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir_htaccess"])));
     if (is_dir($logs_dir) && is_writable($logs_dir) && !file_exists($htaccess)) {
         file_put_contents($htaccess, $htaccess_contents) . clearstatcache();
     }
     if (!is_dir($logs_dir)) {
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) does not exist. Please create this directory manually &amp; make it writable (chmod 777).', true);
     } else {
         if (!is_writable($logs_dir)) {
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Permissions error. The security-enabled logs directory (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($logs_dir)) . '</code>) is not writable. Please make this directory writable (chmod 777).', true);
         }
     }
     if (!file_exists($htaccess)) {
         c_ws_plugin__s2member_admin_notices::display_admin_notice('The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not exist. Please create this file manually. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
     } else {
         if (!preg_match("/deny from all/i", file_get_contents($htaccess))) {
             c_ws_plugin__s2member_admin_notices::display_admin_notice('Unprotected. The .htaccess protection file (<code>' . esc_html(c_ws_plugin__s2member_utils_dirs::doc_root_path($htaccess)) . '</code>) does not contain <code>deny from all</code>. Inside your .htaccess file, add this:<br /><pre>' . esc_html($htaccess_contents) . '</pre>', true);
         }
     }
     if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["gateway_debug_logs"]) {
         c_ws_plugin__s2member_admin_notices::display_admin_notice('Logging is currently disabled by your configuration.');
     }
     include_once dirname(dirname(__FILE__)) . "/menu-pages/logs.inc.php";
     do_action("ws_plugin__s2member_after_logs_page", get_defined_vars());
     return;
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:44,代码来源:menu-pages.inc.php

示例9: deactivate

 /**
  * Deactivation routines for s2Member.
  *
  * @package s2Member\Installation
  * @since 3.5
  *
  * @return null
  */
 public static function deactivate()
 {
     global $wpdb;
     /* Global database object reference. */
     global $current_site, $current_blog;
     /* Multisite. */
     /**/
     do_action("ws_plugin__s2member_before_deactivation", get_defined_vars());
     /**/
     if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["run_deactivation_routines"]) {
         c_ws_plugin__s2member_roles_caps::unlink_roles();
         /* Unlink Roles/Caps. */
         /**/
         if (is_dir($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"])) {
             if (file_exists($htaccess = $files_dir . "/.htaccess")) {
                 if (is_writable($htaccess)) {
                     unlink($htaccess);
                 }
             }
             /**/
             @rmdir($files_dir) . @rmdir(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($files_dir));
         }
         /**/
         if (is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["logs_dir"])) {
             foreach (scandir($logs_dir) as $log_file) {
                 if (is_file($log_file = $logs_dir . "/" . $log_file)) {
                     if (is_writable($log_file)) {
                         unlink($log_file);
                     }
                 }
             }
             /**/
             @rmdir($logs_dir) . @rmdir(c_ws_plugin__s2member_utils_dirs::strip_dir_app_data($logs_dir));
         }
         /**/
         delete_option("ws_plugin__s2member_cache");
         delete_option("ws_plugin__s2member_notices");
         delete_option("ws_plugin__s2member_options");
         delete_option("ws_plugin__s2member_configured");
         delete_option("ws_plugin__s2member_activated_levels");
         delete_option("ws_plugin__s2member_activated_version");
         delete_option("ws_plugin__s2member_activated_mms_version");
         /**/
         if (is_multisite() && is_main_site()) {
             /* Site options? */
             delete_site_option("ws_plugin__s2member_options");
         }
         /**/
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '%" . esc_sql(like_escape("s2member_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql(like_escape("_transient_s2m_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '" . esc_sql(like_escape("_transient_timeout_s2m_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` LIKE '%" . esc_sql(like_escape("s2member_")) . "%'");
         $wpdb->query("DELETE FROM `" . $wpdb->usermeta . "` WHERE `meta_key` LIKE '%" . esc_sql(like_escape("s2member_")) . "%'");
         /**/
         do_action("ws_plugin__s2member_during_deactivation", get_defined_vars());
     }
     /**/
     do_action("ws_plugin__s2member_after_deactivation", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:70,代码来源:installation.inc.php


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