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

PHP w3_activate_error函数代码示例

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

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



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

示例1: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     if (!$this->update_wp_config()) {
         $error = sprintf('<strong>%swp-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'WP_CACHE\', true);</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong><br />then re-activate plugin.', ABSPATH);
         w3_activate_error($error);
     }
     if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_pgcache') {
         /**
          * Disable enchanged mode if permalink structure is disabled
          */
         $permalink_structure = get_option('permalink_structure');
         if ($permalink_structure == '') {
             $this->_config->set('pgcache.engine', 'file');
             $this->_config->save();
         } else {
             if (!w3_is_wpmu() && !$this->write_rules_core()) {
                 w3_writable_error(ABSPATH . '.htaccess');
             }
             if (!$this->write_rules_cache()) {
                 w3_writable_error(W3TC_CACHE_FILE_PGCACHE_DIR . '/.htaccess');
             }
         }
     }
     if (!$this->locked()) {
         if (@copy(W3TC_INSTALL_DIR . '/advanced-cache.php', WP_CONTENT_DIR . '/advanced-cache.php')) {
             @chmod(WP_CONTENT_DIR . '/advanced-cache.php', 0644);
         } else {
             w3_writable_error(WP_CONTENT_DIR . '/advanced-cache.php');
         }
     }
     $this->schedule();
 }
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:35,代码来源:PgCache.php


示例2: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     require_once W3TC_INC_DIR . '/functions/activation.php';
     if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_generic') {
         /**
          * Disable enhanced mode if permalink structure is disabled
          */
         $permalink_structure = get_option('permalink_structure');
         if ($permalink_structure == '') {
             $this->_config->set('pgcache.engine', 'file');
             $this->_config->save();
         } else {
             if (w3_can_modify_rules(w3_get_pgcache_rules_core_path())) {
                 $this->write_rules_core();
             }
             if (w3_can_modify_rules(w3_get_pgcache_rules_cache_path())) {
                 $this->write_rules_cache();
             }
         }
     }
     if (!$this->locked()) {
         if (!@copy(W3TC_INSTALL_FILE_ADVANCED_CACHE, W3TC_ADDIN_FILE_ADVANCED_CACHE)) {
             w3_writable_error(W3TC_ADDIN_FILE_ADVANCED_CACHE);
         }
         if ((!defined('WP_CACHE') || !WP_CACHE) && !$this->enable_wp_cache()) {
             $reactivate_url = wp_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
             $reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($reactivate_url));
             $error = sprintf('<strong>%swp-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'WP_CACHE\', true);</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'wp-settings.php\');</strong><br />then %s.', ABSPATH, $reactivate_button);
             w3_activate_error($error);
         }
     }
     $this->schedule();
     $this->schedule_prime();
 }
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:37,代码来源:PgCacheAdmin.php


示例3: activate

 /**
  * Activation action
  */
 function activate()
 {
     global $wpdb;
     $this->schedule();
     $this->schedule_upload();
     if ($this->_config->get_boolean('cdn.enabled') && !w3_is_cdn_mirror($this->_config->get_string('cdn.engine')) && !$this->table_create(true)) {
         $error = sprintf('Unable to create table <strong>%s%s</strong>: %s', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE, $wpdb->last_error);
         w3_activate_error($error);
     }
 }
开发者ID:niko-lgdcom,项目名称:archives,代码行数:13,代码来源:Cdn.php


示例4: w3_writable_error

/**
 * W3 writable error
 *
 * @param string $path
 * @return string
 */
function w3_writable_error($path)
{
    $reactivate_url = nxt_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
    $reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($reactivate_url));
    require_once W3TC_INC_DIR . '/functions/file.php';
    if (w3_check_open_basedir($path)) {
        $error = sprintf('<strong>%s</strong> could not be created, please run following command:<br /><strong style="color: #f00;">chmod 777 %s</strong><br />then %s.', $path, file_exists($path) ? $path : dirname($path), $reactivate_button);
    } else {
        $error = sprintf('<strong>%s</strong> could not be created, <strong>open_basedir</strong> restriction in effect, please check your php.ini settings:<br /><strong style="color: #f00;">open_basedir = "%s"</strong><br />then %s.', $path, ini_get('open_basedir'), $reactivate_button);
    }
    w3_activate_error($error);
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:18,代码来源:activation.php


示例5: activate

 /**
  * Activation action
  */
 function activate()
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     global $wpdb;
     $this->schedule();
     $this->schedule_upload();
     if ($this->_config->get_boolean('cdn.enabled') && !w3_is_cdn_mirror($this->_config->get_string('cdn.engine')) && !$this->table_create(true)) {
         $error = sprintf('Unable to create table <strong>%s%s</strong>: %s', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE, $wpdb->last_error);
         w3_activate_error($error);
     }
     if ($this->_config->get_boolean('cdn.enabled')) {
         if (w3_can_modify_rules(w3_get_browsercache_rules_cache_path())) {
             try {
                 $this->write_rules();
             } catch (Exception $e) {
             }
         }
     }
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:22,代码来源:CdnAdmin.php


示例6: activate

 /**
  * Activation action
  */
 function activate()
 {
     global $wpdb;
     $upload_info = w3_upload_info();
     if (!$upload_info) {
         $upload_path = get_option('upload_path');
         $upload_path = trim($upload_path);
         if (empty($upload_path)) {
             echo 'Your store uploads folder is not available. Default WordPress directories will be created: <strong>wp-content/uploads/</strong>.<br />';
             $upload_path = WP_CONTENT_DIR . '/uploads';
         }
         w3_writable_error($upload_path);
     }
     $sql = sprintf('DROP TABLE IF EXISTS `%s%s`', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE);
     $wpdb->query($sql);
     $sql = sprintf("CREATE TABLE IF NOT EXISTS `%s%s` (\r\n            `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n            `local_path` varchar(150) NOT NULL DEFAULT '',\r\n            `remote_path` varchar(150) NOT NULL DEFAULT '',\r\n            `command` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1 - Upload, 2 - Delete',\r\n            `last_error` varchar(150) NOT NULL DEFAULT '',\r\n            `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n            PRIMARY KEY (`id`),\r\n            UNIQUE KEY `path` (`local_path`, `remote_path`),\r\n            KEY `date` (`date`)\r\n        ) /*!40100 CHARACTER SET latin1 */", $wpdb->prefix, W3TC_CDN_TABLE_QUEUE);
     $wpdb->query($sql);
     if (!$wpdb->result) {
         $error = sprintf('Unable to create table <strong>%s%s</strong>: %s', $wpdb->prefix, W3TC_CDN_TABLE_QUEUE, $wpdb->last_error);
         w3_activate_error($error);
     }
     $this->schedule();
 }
开发者ID:alx,项目名称:SBek-Arak,代码行数:26,代码来源:Cdn.php


示例7: activate

 /**
  * Activate plugin action
  *
  * @return void
  */
 function activate()
 {
     require_once W3TC_INC_DIR . '/functions/activation.php';
     /**
      * Disable buggy sitewide activation in WPMU and WP 3.0
      */
     if (w3_is_wpmu() && isset($_GET['sitewide']) || w3_is_multisite() && isset($_GET['networkwide'])) {
         w3_network_activate_error();
     }
     /**
      * Check installation files
      */
     $files = array(W3TC_INSTALL_FILE_ADVANCED_CACHE, W3TC_INSTALL_FILE_DB, W3TC_INSTALL_FILE_OBJECT_CACHE);
     $nonexistent_files = array();
     foreach ($files as $file) {
         if (!file_exists($file)) {
             $nonexistent_files[] = $file;
         }
     }
     if (count($nonexistent_files)) {
         $error = sprintf('Unfortunately core file(s): (<strong>%s</strong>) are missing, so activation will fail. Please re-start the installation process from the beginning.', implode(', ', $nonexistent_files));
         w3_activate_error($error);
     }
     if (!@is_dir(W3TC_CONTENT_DIR) && !@mkdir(W3TC_CONTENT_DIR)) {
         w3_writable_error(W3TC_CONTENT_DIR);
     }
     if (!@is_dir(W3TC_CACHE_FILE_DBCACHE_DIR) && !@mkdir(W3TC_CACHE_FILE_DBCACHE_DIR)) {
         w3_writable_error(W3TC_CACHE_FILE_DBCACHE_DIR);
     }
     if (!@is_dir(W3TC_CACHE_FILE_OBJECTCACHE_DIR) && !@mkdir(W3TC_CACHE_FILE_OBJECTCACHE_DIR)) {
         w3_writable_error(W3TC_CACHE_FILE_OBJECTCACHE_DIR);
     }
     if (!@is_dir(W3TC_CACHE_FILE_PGCACHE_DIR) && !@mkdir(W3TC_CACHE_FILE_PGCACHE_DIR)) {
         w3_writable_error(W3TC_CACHE_FILE_PGCACHE_DIR);
     }
     if (!@is_dir(W3TC_CACHE_FILE_MINIFY_DIR) && !@mkdir(W3TC_CACHE_FILE_MINIFY_DIR)) {
         w3_writable_error(W3TC_CACHE_FILE_MINIFY_DIR);
     }
     if (!@is_dir(W3TC_LOG_DIR) && !@mkdir(W3TC_LOG_DIR)) {
         w3_writable_error(W3TC_LOG_DIR);
     }
     if (!@is_dir(W3TC_TMP_DIR) && !@mkdir(W3TC_TMP_DIR)) {
         w3_writable_error(W3TC_TMP_DIR);
     }
     if (w3_is_network() && file_exists(W3TC_CONFIG_MASTER_PATH)) {
         /**
          * For multisite load master config
          */
         $this->_config->load_master();
         if (!$this->_config->save(false)) {
             w3_writable_error(W3TC_CONFIG_PATH);
         }
     } elseif (!file_exists(W3TC_CONFIG_PATH)) {
         /**
          * Set default settings
          */
         $this->_config->set_defaults();
         /**
          * If config doesn't exist enable preview mode
          */
         if (!$this->_config->save(true)) {
             w3_writable_error(W3TC_CONFIG_PREVIEW_PATH);
         }
     }
     /**
      * Save blognames into file
      */
     if (w3_is_network() && !w3_is_subdomain_install()) {
         if (!w3_save_blognames()) {
             w3_writable_error(W3TC_BLOGNAMES_PATH);
         }
     }
     delete_option('w3tc_request_data');
     add_option('w3tc_request_data', '', null, 'no');
 }
开发者ID:nuevomediagroup,项目名称:nmg-code,代码行数:80,代码来源:TotalCacheActivation.php


示例8: w3_activation_error_on_exception

/**
 * Print activation error with repeat button based on exception
 *
 * @param $e
 */
function w3_activation_error_on_exception($e)
{
    $reactivate_url = wp_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
    $reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($reactivate_url));
    w3_activate_error(sprintf('%s<br />then %s.', $e->getMessage(), $reactivate_button));
}
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:11,代码来源:activation.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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