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


PHP ITSEC_Lib::get_memory_limit方法代碼示例

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


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

示例1: admin_enqueue_scripts

 /**
  * Add Files Admin Javascript
  *
  * @since 4.0
  *
  * @return void
  */
 public function admin_enqueue_scripts()
 {
     global $itsec_globals;
     wp_enqueue_script('itsec_file_change_warning_js', $this->module_path . 'js/admin-file-change-warning.js', array('jquery'), $itsec_globals['plugin_build']);
     wp_localize_script('itsec_file_change_warning_js', 'itsec_file_change_warning', array('nonce' => wp_create_nonce('itsec_file_change_warning'), 'url' => admin_url() . 'admin.php?page=toplevel_page_itsec_logs&itsec_log_filter=file_change'));
     if (isset(get_current_screen()->id) && (strpos(get_current_screen()->id, 'security_page_toplevel_page_itsec_settings') !== false || strpos(get_current_screen()->id, 'security_page_toplevel_page_itsec_logs') !== false || strpos(get_current_screen()->id, 'dashboard') !== false)) {
         wp_enqueue_script('itsec_file_change_js', $this->module_path . 'js/admin-file-change.js', array('jquery'), $itsec_globals['plugin_build']);
         wp_localize_script('itsec_file_change_js', 'itsec_file_change', array('mem_limit' => ITSEC_Lib::get_memory_limit(), 'text' => __('Warning: Your server has less than 128MB of RAM dedicated to PHP. If you have many files in your installation or a lot of active plugins activating this feature may result in your site becoming disabled with a memory error. See the plugin homepage for more information.', 'it-l10n-better-wp-security'), 'module_path' => $this->module_path, 'button_text' => isset($this->settings['split']) && $this->settings['split'] === true ? __('Scan Next File Chunk', 'it-l10n-better-wp-security') : __('Scan Files Now', 'it-l10n-better-wp-security'), 'scanning_button_text' => __('Scanning...', 'it-l10n-better-wp-security'), 'no_changes' => __('No changes were detected.', 'it-l10n-better-wp-security'), 'changes' => __('Changes were detected. Please check the log page for details.', 'it-l10n-better-wp-security'), 'error' => __('An error occured. Please try again later', 'it-l10n-better-wp-security'), 'ABSPATH' => ITSEC_Lib::get_home_path(), 'nonce' => wp_create_nonce('itsec_do_file_check')));
         wp_enqueue_script('itsec_jquery_filetree', $this->module_path . 'filetree/jqueryFileTree.js', array('jquery'), '1.01');
         wp_localize_script('itsec_jquery_filetree', 'itsec_jquery_filetree', array('nonce' => wp_create_nonce('itsec_jquery_filetree')));
         wp_register_style('itsec_jquery_filetree_style', $this->module_path . 'filetree/jqueryFileTree.css', array(), $itsec_globals['plugin_build']);
         //add multi-select css
         wp_enqueue_style('itsec_jquery_filetree_style');
         wp_register_style('itsec_file_change_css', $this->module_path . 'css/admin-file-change.css', array(), $itsec_globals['plugin_build']);
         //add multi-select css
         wp_enqueue_style('itsec_file_change_css');
     }
 }
開發者ID:px9,項目名稱:MariaQueenMaria3,代碼行數:25,代碼來源:class-itsec-file-change-admin.php

示例2: metabox_advanced_file_change_settings

 /**
  * Render the settings metabox
  *
  * Displays the contents of the module's settings metabox on the "Settings"
  * page with all module options.
  *
  * @since 4.0.0
  *
  * @return void
  */
 public function metabox_advanced_file_change_settings()
 {
     echo '<p>' . __('Even the best security solutions can fail. How do you know if someone gets into your site? You will know because they will change something. File Change detection will tell you what files have changed in your WordPress installation alerting you to changes not made by yourself. Unlike other solutions this plugin will look only at your installation and compare files to the last check instead of comparing them with a remote installation thereby taking into account whether or not you modify the files yourself.', 'better-wp-security') . '</p>';
     if (ITSEC_Lib::get_memory_limit() < 128) {
         echo '<div class="itsec-warning-message">' . __('Warning: Your server has less than 128MB of RAM dedicated to PHP. If you have many files in your installation or a lot of active plugins activating this feature may result in your site becoming disabled with a memory error. See the plugin homepage for more information.', 'better-wp-security') . '</div>';
     }
     echo $this->file_change_form('logs');
     $this->core->do_settings_section('security_page_toplevel_page_itsec_settings', 'file_change-enabled', false);
     $this->core->do_settings_section('security_page_toplevel_page_itsec_settings', 'file_change-settings', false);
     echo '<p>' . PHP_EOL;
     settings_fields('security_page_toplevel_page_itsec_settings');
     echo '<input class="button-primary" name="submit" type="submit" value="' . __('Save All Changes', 'better-wp-security') . '" />' . PHP_EOL;
     echo '</p>' . PHP_EOL;
 }
開發者ID:Garth619,項目名稱:DMA-Franconnect-Local,代碼行數:24,代碼來源:class-itsec-file-change-admin.php


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