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

PHP w3_writable_error函数代码示例

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

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



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

示例1: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     if (!$this->locked() && !@copy(W3TC_INSTALL_FILE_OBJECT_CACHE, W3TC_ADDIN_FILE_OBJECT_CACHE)) {
         w3_writable_error(W3TC_ADDIN_FILE_OBJECT_CACHE);
     }
     $this->schedule();
 }
开发者ID:niko-lgdcom,项目名称:archives,代码行数:10,代码来源:ObjectCache.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

 /**
  * 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


示例4: activate

 /**
  * Activate plugin action (called by W3_PluginProxy)
  */
 function activate()
 {
     require_once W3TC_INC_DIR . '/functions/activation.php';
     if (!$this->locked() && !@copy(W3TC_INSTALL_FILE_OBJECT_CACHE, W3TC_ADDIN_FILE_OBJECT_CACHE)) {
         w3_writable_error(W3TC_ADDIN_FILE_OBJECT_CACHE);
     }
     $this->schedule();
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:11,代码来源:ObjectCache.php


示例5: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     if (!$this->locked()) {
         $file_db = WP_CONTENT_DIR . '/db.php';
         if (@copy(W3TC_INSTALL_DIR . '/db.php', $file_db)) {
             @chmod($file_db, 0644);
         } else {
             w3_writable_error($file_db);
         }
     }
     $this->schedule();
 }
开发者ID:alx,项目名称:SBek-Arak,代码行数:15,代码来源:DbCache.php


示例6: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     require_once W3TC_INC_DIR . '/functions/activation.php';
     if (!@is_dir(W3TC_CONTENT_MINIFY_DIR) && !@mkdir(W3TC_CONTENT_MINIFY_DIR)) {
         w3_writable_error(W3TC_CONTENT_MINIFY_DIR);
     }
     $file_index = W3TC_CONTENT_MINIFY_DIR . '/index.php';
     if (!@copy(W3TC_INSTALL_MINIFY_DIR . '/index.php', $file_index)) {
         w3_writable_error($file_index);
     }
     if ($this->_config->get_boolean('minify.enabled') && $this->_config->get_boolean('minify.rewrite')) {
         if (w3_can_modify_rules(w3_get_minify_rules_core_path())) {
             $this->write_rules_core();
         }
         if ($this->_config->get_string('minify.engine') == 'file' && w3_can_modify_rules(w3_get_minify_rules_cache_path())) {
             $this->write_rules_cache();
         }
     }
     $this->schedule();
 }
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:23,代码来源:MinifyAdmin.php


示例7: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     if (!is_dir(W3TC_CONTENT_MINIFY_DIR)) {
         if (@mkdir(W3TC_CONTENT_MINIFY_DIR, 0755)) {
             @chmod(W3TC_CONTENT_MINIFY_DIR, 0755);
         } else {
             w3_writable_error(W3TC_CONTENT_MINIFY_DIR);
         }
     }
     $file_index = W3TC_CONTENT_MINIFY_DIR . '/index.php';
     if (@copy(W3TC_INSTALL_MINIFY_DIR . '/index.php', $file_index)) {
         @chmod($file_index, 0644);
     } else {
         w3_writable_error($file_index);
     }
     if ($this->_config->get_boolean('minify.rewrite') && !$this->write_rules()) {
         w3_writable_error(W3TC_CONTENT_MINIFY_DIR . '/.htaccess');
     }
     $this->schedule();
 }
开发者ID:kennethreitz-archive,项目名称:wordpress-skeleton,代码行数:23,代码来源:Minify.php


示例8: 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


示例9: 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


示例10: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     if (!is_dir(W3TC_CONTENT_DIR)) {
         if (@mkdir(W3TC_CONTENT_DIR, 0755)) {
             @chmod(W3TC_CONTENT_DIR, 0755);
         } else {
             w3_writable_error(W3TC_CONTENT_DIR);
         }
     }
     if (!is_dir(W3TC_CACHE_FILE_DBCACHE_DIR)) {
         if (@mkdir(W3TC_CACHE_FILE_DBCACHE_DIR, 0755)) {
             @chmod(W3TC_CACHE_FILE_DBCACHE_DIR, 0755);
         } else {
             w3_writable_error(W3TC_CACHE_FILE_DBCACHE_DIR);
         }
     }
     if (!is_dir(W3TC_CACHE_FILE_PGCACHE_DIR)) {
         if (@mkdir(W3TC_CACHE_FILE_PGCACHE_DIR, 0755)) {
             @chmod(W3TC_CACHE_FILE_PGCACHE_DIR, 0755);
         } else {
             w3_writable_error(W3TC_CACHE_FILE_PGCACHE_DIR);
         }
     }
     if (!is_dir(W3TC_CACHE_FILE_MINIFY_DIR)) {
         if (@mkdir(W3TC_CACHE_FILE_MINIFY_DIR, 0755)) {
             @chmod(W3TC_CACHE_FILE_MINIFY_DIR, 0755);
         } else {
             w3_writable_error(W3TC_CACHE_FILE_MINIFY_DIR);
         }
     }
     if (!is_dir(W3TC_LOG_DIR)) {
         if (@mkdir(W3TC_LOG_DIR, 0755)) {
             @chmod(W3TC_LOG_DIR, 0755);
         } else {
             w3_writable_error(W3TC_LOG_DIR);
         }
     }
     if (!is_dir(W3TC_TMP_DIR)) {
         if (@mkdir(W3TC_TMP_DIR, 0755)) {
             @chmod(W3TC_TMP_DIR, 0755);
         } else {
             w3_writable_error(W3TC_TMP_DIR);
         }
     }
     if (!$this->_config->get_integer('common.install')) {
         $this->_config->set('common.install', time());
     }
     if (w3_is_wpmu()) {
         $this->_config->load_master();
     }
     if (!$this->_config->save()) {
         w3_writable_error(W3TC_CONFIG_PATH);
     }
     delete_option('w3tc_request_data');
     add_option('w3tc_request_data', '', null, 'no');
     $this->link_update();
 }
开发者ID:alx,项目名称:SBek-Arak,代码行数:60,代码来源:TotalCache.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP w3_zlib_output_compression函数代码示例发布时间:2022-05-23
下一篇:
PHP w3_upload_info函数代码示例发布时间: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