• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_filesystem_method函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_filesystem_method函数的典型用法代码示例。如果您正苦于以下问题:PHP get_filesystem_method函数的具体用法?PHP get_filesystem_method怎么用?PHP get_filesystem_method使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: admin_init

 public function admin_init()
 {
     if (!empty($_GET['developer_plugin_reset']) && current_user_can('manage_options')) {
         delete_option(self::OPTION);
     }
     $this->recommended_plugins = array('debug-bar' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar', 'a8c-developer'), 'active' => class_exists('Debug_Bar')), 'debug-bar-console' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Console', 'a8c-developer'), 'active' => function_exists('debug_bar_console_panel')), 'debug-bar-cron' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Cron', 'a8c-developer'), 'active' => function_exists('zt_add_debug_bar_cron_panel')), 'debug-bar-extender' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Extender', 'a8c-developer'), 'active' => class_exists('Debug_Bar_Extender')), 'rewrite-rules-inspector' => array('project_type' => 'all', 'name' => esc_html__('Rewrite Rules Inspector', 'a8c-developer'), 'active' => class_exists('Rewrite_Rules_Inspector')), 'log-deprecated-notices' => array('project_type' => 'all', 'name' => esc_html__('Log Deprecated Notices', 'a8c-developer'), 'active' => class_exists('Deprecated_Log')), 'log-viewer' => array('project_type' => 'all', 'name' => esc_html__('Log Viewer', 'a8c-developer'), 'active' => class_exists('ciLogViewer')), 'vip-scanner' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('VIP Scanner', 'a8c-developer'), 'active' => class_exists('VIP_Scanner')), 'jetpack' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Jetpack', 'a8c-developer'), 'active' => class_exists('Jetpack')), 'polldaddy' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Polldaddy Polls & Ratings', 'a8c-developer'), 'active' => class_exists('WP_Polldaddy')), 'monster-widget' => array('project_type' => 'all', 'name' => esc_html__('Monster Widget', 'a8c-developer'), 'active' => class_exists('Monster_Widget')), 'user-switching' => array('project_type' => 'all', 'name' => esc_html__('User Switching', 'a8c-developer'), 'active' => class_exists('user_switching')), 'piglatin' => array('project_type' => array('wporg-theme', 'wporg'), 'name' => esc_html__('Pig Latin', 'a8c-developer'), 'active' => class_exists('PigLatin')), 'rtl-tester' => array('project_type' => 'wporg-theme', 'name' => esc_html__('RTL Tester', 'a8c-developer'), 'active' => class_exists('RTLTester')), 'regenerate-thumbnails' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Regenerate Thumbnails', 'a8c-developer'), 'active' => class_exists('RegenerateThumbnails')), 'simply-show-ids' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Simply Show IDs', 'a8c-developer'), 'active' => function_exists('ssid_add')), 'theme-test-drive' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Theme Test Drive', 'a8c-developer'), 'active' => function_exists('TTD_filters'), 'filename' => 'themedrive.php'), 'theme-check' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Theme Check', 'a8c-developer'), 'active' => function_exists('tc_add_headers')));
     if (!self::is_dev_version()) {
         $this->recommended_plugins['wordpress-beta-tester'] = array('project_type' => 'all', 'name' => esc_html__('Beta Tester', 'a8c-developer'), 'active' => class_exists('wp_beta_tester'), 'filename' => 'wp-beta-tester.php');
     }
     $this->recommended_constants = array('WP_DEBUG' => array('project_type' => 'all', 'description' => __('Enables <a href="http://codex.wordpress.org/Debugging_in_WordPress" target="_blank">debug mode</a> which helps identify and resolve issues', 'a8c-developer')), 'SAVEQUERIES' => array('project_type' => 'all', 'description' => esc_html__('Logs database queries to an array so you can review them. The Debug Bar plugin will list out database queries if you set this constant.', 'a8c-developer')), 'JETPACK_DEV_DEBUG' => array('project_type' => 'wpcom-vip', 'description' => __('Enables <a href="http://jetpack.me/2013/03/28/jetpack-dev-mode-release/">Development Mode</a> in Jetpack for testing features without a connection to WordPress.com.', 'a8c-developer')));
     register_setting(self::OPTION, self::OPTION, array($this, 'settings_validate'));
     wp_register_script('a8c-developer', plugins_url('developer.js', __FILE__), array('jquery'), self::VERSION);
     $strings = array('settings_slug' => self::PAGE_SLUG, 'go_to_step_2' => current_user_can('install_plugins') && current_user_can('activate_plugins') && 'direct' == get_filesystem_method() ? 'yes' : 'no', 'lightbox_title' => __('Developer: Plugin Setup', 'a8c-developer'), 'saving' => __('Saving...', 'a8c-developer'), 'installing' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Installing...', 'a8c-developer'), 'installed' => __('Installed', 'a8c-developer'), 'activating' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Activating...', 'a8c-developer'), 'activated' => __('Activated', 'a8c-developer'), 'error' => __('Error!', 'a8c-developer'), 'ACTIVE' => __('ACTIVE', 'a8c-developer'), 'INSTALLED' => __('INSTALLED', 'a8c-developer'), 'ERROR' => __('ERROR!', 'a8c-developer'));
     wp_localize_script('a8c-developer', 'a8c_developer_i18n', $strings);
     wp_register_style('a8c-developer', plugins_url('developer.css', __FILE__), array(), self::VERSION);
     // Handle the submission of the lightbox form if step 2 won't be shown
     if (!empty($_POST['action']) && 'a8c_developer_lightbox_step_1' == $_POST['action'] && !empty($_POST['a8c_developer_project_type']) && check_admin_referer('a8c_developer_lightbox_step_1')) {
         $this->save_project_type($_POST['a8c_developer_project_type']);
         add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
     }
     if (!get_option(self::OPTION)) {
         if (!empty($_GET['a8cdev_errorsaving'])) {
             add_settings_error(self::PAGE_SLUG, self::PAGE_SLUG . '_error_saving', __('Error saving settings. Please try again.', 'a8c-developer'));
         } elseif (!is_network_admin() && current_user_can('manage_options')) {
             add_action('admin_enqueue_scripts', array($this, 'load_lightbox_scripts_and_styles'));
             add_action('admin_footer', array($this, 'output_setup_box_html'));
         }
     }
 }
开发者ID:9pmStudios,项目名称:developer,代码行数:29,代码来源:developer.php


示例2: admin_init

 public function admin_init()
 {
     $this->recommended_plugins = array('debug-bar' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar', 'a8c-developer'), 'active' => class_exists('Debug_Bar')), 'debug-bar-cron' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Cron', 'a8c-developer'), 'active' => function_exists('zt_add_debug_bar_cron_panel')), 'rewrite-rules-inspector' => array('project_type' => 'all', 'name' => esc_html__('Rewrite Rules Inspector', 'a8c-developer'), 'active' => class_exists('Rewrite_Rules_Inspector')), 'log-deprecated-notices' => array('project_type' => 'all', 'name' => esc_html__('Log Deprecated Notices', 'a8c-developer'), 'active' => class_exists('Deprecated_Log')), 'vip-scanner' => array('project_type' => 'all', 'name' => esc_html__('VIP Scanner', 'a8c-developer'), 'active' => class_exists('VIP_Scanner')), 'grunion-contact-form' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Grunion Contact Form', 'a8c-developer'), 'active' => defined('GRUNION_PLUGIN_DIR')), 'polldaddy' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Polldaddy Polls & Ratings', 'a8c-developer'), 'active' => class_exists('WP_Polldaddy')), 'monster-widget' => array('project_type' => 'all', 'name' => esc_html__('Monster Widget', 'a8c-developer'), 'active' => class_exists('Monster_Widget')), 'wordpress-beta-tester' => array('project_type' => 'all', 'name' => esc_html__('Beta Tester', 'a8c-developer'), 'active' => class_exists('wp_beta_tester'), 'filename' => 'wp-beta-tester.php'));
     $this->recommended_constants = array('WP_DEBUG' => __('Enables <a href="http://codex.wordpress.org/Debugging_in_WordPress" target="_blank">debug mode</a> which helps identify and resolve issues', 'a8c-developer'), 'SAVEQUERIES' => esc_html__('Logs database queries to an array so you can review them. The Debug Bar plugin will list out database queries if you set this constant.', 'a8c-developer'));
     register_setting(self::OPTION, self::OPTION, array($this, 'settings_validate'));
     wp_register_script('a8c-developer', plugins_url('developer.js', __FILE__), array('jquery'), self::VERSION);
     $strings = array('settings_slug' => self::PAGE_SLUG, 'go_to_step_2' => current_user_can('install_plugins') && current_user_can('activate_plugins') && 'direct' == get_filesystem_method() ? 'yes' : 'no', 'lightbox_title' => __('Developer: Plugin Setup', 'a8c-developer'), 'saving' => __('Saving...', 'a8c-developer'), 'installing' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Installing...', 'a8c-developer'), 'installed' => __('Installed', 'a8c-developer'), 'activating' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Activating...', 'a8c-developer'), 'activated' => __('Activated', 'a8c-developer'), 'error' => __('Error!', 'a8c-developer'), 'ACTIVE' => __('ACTIVE', 'a8c-developer'), 'INSTALLED' => __('INSTALLED', 'a8c-developer'), 'ERROR' => __('ERROR!', 'a8c-developer'));
     wp_localize_script('a8c-developer', 'a8c_developer_i18n', $strings);
     wp_register_style('a8c-developer', plugins_url('developer.css', __FILE__), array(), self::VERSION);
     // Handle the submission of the lightbox form if step 2 won't be shown
     if (!empty($_POST['a8c_developer_action'])) {
         if ('lightbox_step_1' == $_POST['a8c_developer_action'] && !empty($_POST['a8c_developer_project_type']) && check_admin_referer('a8c_developer_action_lightbox_step_1')) {
             $this->save_project_type($_POST['a8c_developer_project_type']);
             add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
         }
     }
     if (!get_option(self::OPTION)) {
         if (!empty($_GET['a8cdev_errorsaving'])) {
             add_settings_error(self::PAGE_SLUG, self::PAGE_SLUG . '_error_saving', __('Error saving settings. Please try again.', 'a8c-developer'));
         } elseif (current_user_can('manage_options')) {
             add_action('admin_enqueue_scripts', array($this, 'load_lightbox_scripts_and_styles'));
             add_action('admin_footer', array($this, 'output_setup_box_html'));
         }
     }
 }
开发者ID:nicoladj77,项目名称:developer,代码行数:25,代码来源:developer.php


示例3: install_branch

 public function install_branch()
 {
     include_once ABSPATH . '/wp-admin/includes/file.php';
     if (get_filesystem_method() === 'direct' && !is_dir(WP_CONTENT_DIR . '/thesis') && is_dir(THESIS_SKINS)) {
         // first, set up wp_filesystem
         WP_Filesystem();
         $f = $GLOBALS['wp_filesystem'];
         // directories
         $directories = array('thesis/', 'thesis/boxes/', 'thesis/packages/', 'thesis/skins/');
         foreach ($directories as $dir) {
             $f->mkdir($f->wp_content_dir() . $dir);
         }
         // master.php
         $f->put_contents($f->wp_content_dir() . 'thesis/master.php', "<?php\n// This is the Thesis master.php file.\n// Use this file to affect every site on your network.\n// Note: this is the last file included in Thesis!\n");
         // move skins
         $from = trailingslashit($f->find_folder(THESIS_SKINS));
         $to = $f->wp_content_dir() . 'thesis/skins/';
         $skins = array_keys($f->dirlist($from));
         foreach ($skins as $skin) {
             $f->move($from . $skin, $to . $skin);
             if (!$f->exists($to . $skin . '/images')) {
                 $f->mkdir($to . $skin . '/images');
             }
             if (!$f->exists($to . $skin . '/custom.php')) {
                 $f->put_contents($to . $skin . '/custom.php', "<?php\n/*\n\tThis file is for skin specific customizations. Be careful not to change your skin's skin.php file as that will be upgraded in the future and your work will be lost.\n\tIf you are more comfortable with PHP, we recommend using the super powerful Thesis Box system to create elements that you can interact with in the Thesis HTML Editor.\n*/");
             }
         }
         // clean up
         if (($lib = array_keys($f->dirlist(THESIS_SKINS))) && empty($lib)) {
             $f->delete(THESIS_SKINS);
         }
     }
 }
开发者ID:areveal,项目名称:marketing-site,代码行数:33,代码来源:filesystem.php


示例4: render

 function render()
 {
     $css = $this->ctc()->css;
     $themes = $this->ctc()->themes;
     $child = $css->get_prop('child');
     $hidechild = count($themes['child']) ? '' : 'style="display:none"';
     $enqueueset = isset($css->enqueue) && $child;
     $this->ctc()->debug('Enqueue set: ' . ($enqueueset ? 'TRUE' : 'FALSE'), __FUNCTION__);
     if (empty($css->nowarn)) {
         $this->parent_theme_check();
     }
     $imports = $css->get_prop('imports');
     $id = 0;
     $this->ctc()->fs_method = get_filesystem_method();
     add_thickbox();
     add_filter('chld_thm_cfg_files_tab_filter', array($this, 'render_files_tab_options'));
     add_action('chld_thm_cfg_tabs', array($this, 'render_addl_tabs'), 10, 4);
     add_action('chld_thm_cfg_panels', array($this, 'render_addl_panels'), 10, 4);
     add_action('chld_thm_cfg_related_links', array($this, 'lilaea_plug'));
     if ($this->ctc()->is_debug) {
         $this->ctc()->debug('adding new debug action...', __FUNCTION__);
         add_action('chld_thm_cfg_print_debug', array($this->ctc(), 'print_debug'));
     }
     include CHLD_THM_CFG_DIR . '/includes/forms/main.php';
 }
开发者ID:BastienMottier,项目名称:teknologeek,代码行数:25,代码来源:class-ctc-ui.php


示例5: is_server_writable

 function is_server_writable()
 {
     if ((!defined('FTP_HOST') || !defined('FTP_USER') || !defined('FTP_PASS')) && get_filesystem_method(array(), ABSPATH) != 'direct') {
         return false;
     } else {
         return true;
     }
 }
开发者ID:Trideon,项目名称:gigolo,代码行数:8,代码来源:file_editor.class.php


示例6: pre_check_custom_css_writable

/**
 * Check custom css directory
 */
function pre_check_custom_css_writable()
{
    // custom css directory
    $the_dir = get_template_directory() . "/lib/css";
    if (!get_filesystem_method(array(), $the_dir) == "direct") {
        add_action("admin_notices", "pre_notice_custom_css_permission");
    }
}
开发者ID:webtechfreaky,项目名称:vienna-content-focused-personal-blog-theme,代码行数:11,代码来源:scripts.php


示例7: check_filesystem_api

 public static function check_filesystem_api()
 {
     global $gfpdfe_data;
     $access_type = get_filesystem_method();
     $gfpdfe_data->automated = false;
     if ($access_type === 'direct') {
         $gfpdfe_data->automated = true;
     }
 }
开发者ID:quinntron,项目名称:tmad,代码行数:9,代码来源:installation-update-manager.php


示例8: get_creds

 private function get_creds()
 {
     $access_type = get_filesystem_method();
     if ($access_type === 'direct') {
         $creds = request_filesystem_credentials(site_url() . '/wp-admin/', '', false, false, array());
     } else {
         $creds = $this->get_ftp_creds($access_type);
     }
     return $creds;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:10,代码来源:FrmCreateFile.php


示例9: __construct

 public function __construct()
 {
     require_once ABSPATH . 'wp-admin/includes/file.php';
     $upload_dir = wp_upload_dir();
     if (get_filesystem_method(array(), $upload_dir['basedir']) !== 'direct' || !WP_Filesystem(request_filesystem_credentials(admin_url()))) {
         self::$useFS = false;
         add_action('wp_ajax_wpservefile', array($this, 'serve_file'));
         add_action('wp_ajax_nopriv_wpservefile', array($this, 'serve_file'));
     } else {
         self::$useFS = true;
     }
 }
开发者ID:marco-c,项目名称:wp_serve_file,代码行数:12,代码来源:WP_Serve_File.php


示例10: can_write_files

 function can_write_files()
 {
     $access_type = get_filesystem_method();
     ob_start();
     $creds = request_filesystem_credentials(site_url() . '/wp-admin/', '', false, false, null);
     $_c = ob_get_clean();
     if ($access_type === 'direct' || WP_Filesystem($creds)) {
         return true;
     }
     $this->errors[] = "WordPress does not have access to it's own file system!";
     $this->consequences[] = "Images, CSS Files, Cache Files will be included with an alternative inline method, which is slower.";
     $this->solutions[] = "\r\n        <ol>\r\n        <li>\r\n        You will have to fill in FTP credentials into the wp-config.php file.<br><br>\r\n        <strong>define( 'FTP_USER', 'username' );<br>\r\n        define( 'FTP_PASS', 'password' );<br>\r\n        define( 'FTP_HOST', 'ftp.example.org' );</strong> <br><br>\r\n        In some cases more constants might be required. <br>\r\n        Please read: <a href='https://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants'>WordPress Upgrage Constants</a> \r\n        </li>\r\n        <li>\r\n        ADVANCED USERS ONLY!<br><br>\r\n        Change ownership of the WordPress directory and all of its contents via SSH for the <strong>www-data</strong> process.<br><br>\r\n        \r\n        <a href='http://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress'>Changing Ownership if WordPress is in the ROOT directory</a>\r\n        </li>\r\n        </ol>";
     return false;
 }
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:14,代码来源:compatibility.class.php


示例11: update_theme

 function update_theme()
 {
     if (isset($_REQUEST['page'])) {
         // Sanitize page being requested.
         $_page = esc_attr($_REQUEST['page']);
         if ('spyropress-update' == $_page) {
             //Setup Filesystem
             $method = get_filesystem_method();
             if (isset($_POST['spyropress_ftp_cred'])) {
                 $cred = spyropress_decode($_POST['spyropress_ftp_cred']);
                 $filesystem = WP_Filesystem($cred);
             } else {
                 $filesystem = WP_Filesystem();
             }
             if (false == $filesystem && 'Proceed' != $_POST['upgrade']) {
                 add_error_message(sprintf(__('Failed: Filesystem preventing downloads. (%s)', 'spyropress'), $method));
                 return;
             }
             if (isset($_REQUEST['spyropress_updater'])) {
                 // Sanitize action being requested.
                 $_action = esc_attr($_REQUEST['spyropress_updater']);
                 if ('framework' == $_action) {
                     locate_template('framework/utilities/envato/class-envato-wordpress-theme-upgrader.php', true);
                     $envato_api_key = get_option('_spyropress_envato_api_key_' . get_internal_name());
                     $envato_username = get_option('_spyropress_envato_username_' . get_internal_name());
                     $upgrader = new Envato_WordPress_Theme_Upgrader($envato_username, $envato_api_key);
                     $result = $upgrader->upgrade_theme();
                     // Successfully Updated
                     if ($result->success) {
                         $message = __('New version successfully downloaded, extracted and updated.', 'spyropress');
                         $message .= '<script type="text/javascript">
                             //<![CDATA[
                                 window.location.replace("' . admin_url('admin.php?page=spyropress-update') . '");
                             //]]>
                         </script>';
                         add_success_message($message);
                     } else {
                         add_error_message($result->errors[0]);
                     }
                 }
             }
         }
         // END UPDATE HERE
     }
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:45,代码来源:class-theme-updater.php


示例12: file_system_write_access

 /**
  * Returns true if the site has file write access false otherwise.
  * @return string ( '1' | '0' )
  **/
 public static function file_system_write_access()
 {
     if (!function_exists('get_filesystem_method')) {
         require_once ABSPATH . 'wp-admin/includes/file.php';
     }
     require_once ABSPATH . 'wp-admin/includes/template.php';
     $filesystem_method = get_filesystem_method();
     if ($filesystem_method === 'direct') {
         return 1;
     }
     ob_start();
     $filesystem_credentials_are_stored = request_filesystem_credentials(self_admin_url());
     ob_end_clean();
     if ($filesystem_credentials_are_stored) {
         return 1;
     }
     return 0;
 }
开发者ID:elliott-stocks,项目名称:jetpack,代码行数:22,代码来源:class.jetpack-sync-functions.php


示例13: vstrsnln_insert_rows

 function vstrsnln_insert_rows($number_file = false, $noscript = false)
 {
     global $wpdb, $wp_filesystem;
     if (false == $noscript) {
         check_ajax_referer('bws_plugin', 'vstrsnln_ajax_nonce_field');
     }
     $prefix_bws = $wpdb->base_prefix . 'bws_';
     $vstrsnln_access_type = get_filesystem_method();
     if ($vstrsnln_access_type == 'direct') {
         $vstrsnln_creds = request_filesystem_credentials(site_url() . '/wp-admin/', '', false, false, array());
         if (!WP_Filesystem($vstrsnln_creds)) {
             if ($number_file == false) {
                 echo false;
             } else {
                 return false;
             }
         }
         if ($number_file == false) {
             if (isset($_POST['count']) && file_exists(plugin_dir_path(__FILE__) . 'file_' . $_POST['count'] . '.csv')) {
                 $filename = plugin_dir_path(__FILE__) . 'file_' . $_POST['count'] . '.csv';
                 $data_array = $wp_filesystem->get_contents_array($filename);
                 if (false !== $data_array && is_array($data_array) && !empty($data_array)) {
                     $sql = "INSERT IGNORE INTO `" . $prefix_bws . "country`\n                            ( `ip_from`, `ip_to`, `ip_from_int`, `ip_to_int`, `short_country`, `name_country` )\n                            VALUES ( " . implode(" ) , ( ", $data_array) . " );";
                     $result = $wpdb->query($sql);
                     unlink($filename);
                     echo $result;
                 }
             }
         } else {
             if ($number_file > 0 && file_exists(plugin_dir_path(__FILE__) . 'file_' . $number_file . '.csv')) {
                 $filename = plugin_dir_path(__FILE__) . 'file_' . $number_file . '.csv';
                 $data_array = $wp_filesystem->get_contents_array($filename);
                 if (false !== $data_array && is_array($data_array) && !empty($data_array)) {
                     $sql = "INSERT IGNORE INTO `" . $prefix_bws . "country`\n                            ( `ip_from`, `ip_to`, `ip_from_int`, `ip_to_int`, `short_country`, `name_country` )\n                            VALUES ( " . implode(" ) , ( ", $data_array) . " );";
                     $result = $wpdb->query($sql);
                     unlink($filename);
                     return $result;
                 }
             }
         }
     }
     /* This is required to terminate immediately and return a proper response */
     wp_die();
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:44,代码来源:import-country.php


示例14: _getFileSystem

 /**
  * @return WP_Filesystem_Direct
  */
 private function _getFileSystem()
 {
     if (!function_exists('get_filesystem_method')) {
         require_once ABSPATH . '/wp-admin/includes/file.php';
         $fileSystem = WP_Filesystem();
     } else {
         global $wp_filesystem;
         $fileSystem = $wp_filesystem;
     }
     $method = get_filesystem_method();
     if ($method != 'direct') {
         $notificationText = __('Fresh Framework requires File System Direct to install itself. If you cant achieve this, ', 'zero');
         $notificationText .= _('please install Fresh Framework plugin, otherwise our theme will not work<br><br>', 'zero');
         $notificationText .= __('Plugin could be found here: ', 'zero') . get_template_directory() . '/install/fresh-framework.zip';
         $this->_addNotification($notificationText);
         return false;
     }
     return $fileSystem;
 }
开发者ID:gidbot,项目名称:treble_zero,代码行数:22,代码来源:init.php


示例15: render

 function render()
 {
     // load web fonts for this theme
     if ($imports = $this->css()->get_prop('imports')) {
         $ext = 0;
         foreach ($imports as $import) {
             $this->ctc()->convert_import_to_enqueue($import, ++$ext, TRUE);
         }
     }
     $themes = $this->ctc()->themes;
     $child = $this->css()->get_prop('child');
     $hidechild = apply_filters('chld_thm_cfg_hidechild', count($themes['child']) ? '' : 'style="display:none"');
     $enqueueset = isset($this->css()->enqueue) && $child;
     $this->ctc()->debug('Enqueue set: ' . ($enqueueset ? 'TRUE' : 'FALSE'), __FUNCTION__, __CLASS__);
     $imports = $this->css()->get_prop('imports');
     $id = 0;
     $this->ctc()->fs_method = get_filesystem_method();
     add_thickbox();
     include CHLD_THM_CFG_DIR . '/includes/forms/main.php';
 }
开发者ID:pacificano,项目名称:pacificano,代码行数:20,代码来源:class-ctc-ui.php


示例16: setup_filesystem

 /**
  * Sets up the filesystem to be able to write to the server.
  *
  * If filesystem credentials are required and haven't been entered yet,
  * a form to enter them will be shown and the request will exit afterwards.
  *
  * @since 1.0.0
  * @access public
  * @static
  *
  * @param string $form_post    The location to post the form to.
  * @param array  $extra_fields Additional fields to include in the form post request.
  * @return bool True if the filesystem was setup successfully, false otherwise.
  */
 public static function setup_filesystem($form_post, $extra_fields = array())
 {
     global $wp_filesystem;
     $paths = self::get_filesystem_paths();
     $type = 'direct';
     $is_direct = true;
     foreach ($paths as $key => $path) {
         $type = get_filesystem_method(array(), $paths[$key], true);
         if ('direct' !== $type) {
             $is_direct = false;
             break;
         }
     }
     ob_start();
     if (false === ($credentials = request_filesystem_credentials($form_post, $type, false, $paths[0], $extra_fields, true))) {
         $data = ob_get_clean();
         if (!empty($data)) {
             include_once ABSPATH . 'wp-admin/admin-header.php';
             echo $data;
             include ABSPATH . 'wp-admin/admin-footer.php';
             exit;
         }
         return false;
     }
     if (!WP_Filesystem($credentials, $paths[0], true)) {
         $error = isset($wp_filesystem) && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ? $wp_filesystem->errors : true;
         request_filesystem_credentials($form_post, $type, $error, $paths[0], $extra_fields, true);
         $data = ob_get_clean();
         if (!empty($data)) {
             include_once ABSPATH . 'wp-admin/admin-header.php';
             echo $data;
             include ABSPATH . 'wp-admin/admin-footer.php';
             exit;
         }
         return false;
     }
     if (!is_object($wp_filesystem) || is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
         return false;
     }
     return true;
 }
开发者ID:felixarntz,项目名称:wp-encrypt,代码行数:55,代码来源:Util.php


示例17: request_access

 /**
  * Request WP Filesystem access
  * @param string $context
  * @param string $url
  * @param array $extra_fields
  * @return bool
  */
 public static final function request_access($context, $url, $extra_fields = array())
 {
     if (get_filesystem_method() === 'direct') {
         // in case if direct access is available
         /* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
         $creds = request_filesystem_credentials(site_url() . '/wp-admin/', '', false, false, null);
         /* initialize the API */
         if (!WP_Filesystem($creds)) {
             /* any problems and we exit */
             trigger_error(__('Cannot connect to Filesystem directly', 'fw'), E_USER_WARNING);
             return false;
         }
     } else {
         $creds = request_filesystem_credentials($url, '', false, $context, $extra_fields);
         if (!$creds) {
             // the form was printed to the user
             return false;
         }
         /* initialize the API */
         if (!WP_Filesystem($creds)) {
             /* any problems and we exit */
             request_filesystem_credentials($url, '', true, $context, $extra_fields);
             // the third parameter is true to show error to the user
             return false;
         }
     }
     global $wp_filesystem;
     if (!is_object($wp_filesystem)) {
         return false;
     }
     if (is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
         return false;
     }
     if ($wp_filesystem->abspath() && $wp_filesystem->wp_content_dir() && $wp_filesystem->wp_plugins_dir() && $wp_filesystem->wp_themes_dir() && $wp_filesystem->find_folder($context)) {
         // ok
     } else {
         return false;
     }
     return true;
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:47,代码来源:class-fw-wp-filesystem.php


示例18: extension_ftp_fix

    /**
     * Fix issue with WordPress FTP credential form stripping params from URL
     */
    function extension_ftp_fix()
    {
        // if no pl GET param then do nothing. Or if using direct fs
        if (!isset($_GET['pl']) || 'direct' == get_filesystem_method()) {
            return false;
        }
        // The WordPress FTP form strips our custom parameters for fetching the zip
        // So we need to add these back in.
        ?>
<script>
      ! function($) {
        $(document).ready(function(){
          var url = window.location.href
          var form = $('#request-filesystem-credentials-form')
          if( $(form).length ) {
            $(form).closest('form').attr('action',url)
          }
        })
      }(window.jQuery)
    </script>
    <?php 
    }
开发者ID:voomco,项目名称:WordPress,代码行数:25,代码来源:operations.php


示例19: uncode_init_admin_css

function uncode_init_admin_css()
{
    wp_enqueue_style('ot-admin', get_template_directory_uri() . '/core/theme-options/assets/css/ot-admin.css', false, UNCODE_VERSION);
    wp_enqueue_style('admin-uncode-icons', get_template_directory_uri() . '/library/css/uncode-icons.css', false, UNCODE_VERSION);
    global $wp_filesystem;
    if (empty($wp_filesystem)) {
        require_once ABSPATH . '/wp-admin/includes/file.php';
        WP_Filesystem();
    }
    $access_type = get_filesystem_method();
    if ($access_type === 'direct') {
        wp_enqueue_style('custom-style', get_template_directory_uri() . '/core/assets/css/admin-custom.css', false, UNCODE_VERSION);
    } else {
        $styles = uncode_create_dynamic_css();
        wp_add_inline_style('ot-admin', uncode_compress_css_inline($styles['admin']));
    }
    $fonts = get_option('uncode_font_options');
    if (isset($fonts['font_stack']) && $fonts['font_stack'] !== '[]') {
        $upload_dir = wp_upload_dir();
        if (@file_exists(trailingslashit($upload_dir['basedir']) . 'uncode-fonts/uncodefont.css')) {
            wp_enqueue_style('uf-font-squirrel', $upload_dir['baseurl'] . '/uncode-fonts/uncodefont.css', false, UNCODE_VERSION);
        }
    }
}
开发者ID:b0123498765,项目名称:fithealthyandwealthy,代码行数:24,代码来源:admin.php


示例20: wp_print_request_filesystem_credentials_modal

/**
 * Print the filesystem credentials modal when needed.
 *
 * @since 4.2.0
 */
function wp_print_request_filesystem_credentials_modal() {
	$filesystem_method = get_filesystem_method();
	ob_start();
	$filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() );
	ob_end_clean();
	$request_filesystem_credentials = ( $filesystem_method != 'direct' && ! $filesystem_credentials_are_stored );
	if ( ! $request_filesystem_credentials ) {
		return;
	}
	?>
	<div id="request-filesystem-credentials-dialog" class="notification-dialog-wrap request-filesystem-credentials-dialog">
		<div class="notification-dialog-background"></div>
		<div class="notification-dialog" role="dialog" aria-labelledby="request-filesystem-credentials-title" tabindex="0">
			<div class="request-filesystem-credentials-dialog-content">
				<?php request_filesystem_credentials( site_url() ); ?>
			<div>
		</div>
	</div>
	<?php
}
开发者ID:ShankarVellal,项目名称:WordPress,代码行数:25,代码来源:file.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_filetime函数代码示例发布时间:2022-05-15
下一篇:
PHP get_filesize函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap