Skip to content

Commit

Permalink
Releasing ZenCache v160120-RC
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Jan 20, 2016
1 parent 3abdc82 commit d833241
Show file tree
Hide file tree
Showing 207 changed files with 24,549 additions and 7,422 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

209 changes: 103 additions & 106 deletions zencache/CHANGELOG.md → CHANGELOG.md

Large diffs are not rendered by default.

676 changes: 676 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions README.md

This file was deleted.

11 changes: 0 additions & 11 deletions apigen.neon

This file was deleted.

Binary file removed assets/banner-772x250.png
Binary file not shown.
Binary file removed assets/icon-128x128.png
Binary file not shown.
Binary file removed assets/icon-256x256.png
Binary file not shown.
Binary file removed assets/screenshot-1.png
Binary file not shown.
Binary file removed assets/screenshot-10.png
Binary file not shown.
Binary file removed assets/screenshot-11.png
Binary file not shown.
Binary file removed assets/screenshot-12.png
Binary file not shown.
Binary file removed assets/screenshot-13.png
Binary file not shown.
Binary file removed assets/screenshot-14.png
Binary file not shown.
Binary file removed assets/screenshot-2.png
Binary file not shown.
Binary file removed assets/screenshot-3.png
Binary file not shown.
Binary file removed assets/screenshot-4.png
Binary file not shown.
Binary file removed assets/screenshot-5.png
Binary file not shown.
Binary file removed assets/screenshot-6.png
Binary file not shown.
Binary file removed assets/screenshot-7.png
Binary file not shown.
Binary file removed assets/screenshot-8.png
Binary file not shown.
Binary file removed assets/screenshot-9.png
Binary file not shown.
50 changes: 46 additions & 4 deletions zencache/includes/share.php → includes/share.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
<?php
/*
* Back compat. only.
*
* This file satisfies the older copy of `advanced-cache.php`.
* Important only during an upgrade from the old to new copy.
*/
namespace zencache // Root namespace.
{
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));

$_SERVER['ZENCACHE_ALLOWED'] = FALSE; // Disallow.
if(!defined('ZENCACHE_ALLOWED')) // Disallow.
define('ZENCACHE_ALLOWED', FALSE);

if(!class_exists('\\'.__NAMESPACE__.'\\share'))
{
/**
Expand Down Expand Up @@ -52,7 +62,7 @@ abstract class share // Shared between {@link advanced_cache} and {@link plugin}
*
* @var boolean `TRUE` for ZenCache Pro.
*/
public $is_pro = FALSE;
public $is_pro = TRUE;

/**
* Version string in YYMMDD[+build] format.
Expand All @@ -61,14 +71,12 @@ abstract class share // Shared between {@link advanced_cache} and {@link plugin}
*
* @var string Current version of the software.
*/
public $version = '151107';
public $version = '150409';

/**
* Plugin slug; based on `__NAMESPACE__`.
*
* @since 150218 Refactoring.
*
* @var string Plugin slug; based on `__NAMESPACE__`.
*/
public $slug = '';

Expand Down Expand Up @@ -1296,6 +1304,40 @@ public function http_status()
* Misc. utility methods.
-------------------------------------------------------------------------------------- */

/**
* Trims strings deeply.
*
* @since 150409
*
* @param mixed $values Any value can be converted into a trimmed string.
* Actually, objects can't, but this recurses into objects.
*
* @param string $chars Specific chars to trim.
* Defaults to PHP's trim: " \r\n\t\0\x0B". Use an empty string to bypass.
*
* @param string $extra_chars Additional chars to trim.
*
* @return string|array|object Trimmed string, array, object.
*/
public function trim_deep($values, $chars = '', $extra_chars = '')
{
if(is_array($values) || is_object($values))
{
foreach($values as $_key => &$_values)
$_values = $this->trim_deep($_values, $chars, $extra_chars);
unset($_key, $_values); // Housekeeping.
return $values; // Trimmed deeply.
}
$string = (string)$values;
$chars = (string)$chars;
$extra_chars = (string)$extra_chars;

$chars = isset($chars[0]) ? $chars : " \r\n\t\0\x0B";
$chars = $chars.$extra_chars; // Concatenate.

return trim($string, $chars);
}

/**
* Escape single quotes.
*
Expand Down
66 changes: 66 additions & 0 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
if (!defined('WPINC')) {
exit('Do NOT access this file directly: '.basename(__FILE__));
}
$GLOBALS['wp_php_rv'] = '5.3.2'; //php-required-version// // Leaving this at v5.3.2 so that we can have more control over Dashboard messages below.

if (require(dirname(__FILE__).'/src/vendor/websharks/wp-php-rv/src/includes/check.php')) {
${__FILE__}['apc_enabled'] = (extension_loaded('apc') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.cache_by_default'), FILTER_VALIDATE_BOOLEAN) && stripos((string)ini_get('apc.filters'), 'zencache') === false) ? true : false;

if ((!version_compare(PHP_VERSION, '5.4', '>=') || ${__FILE__}['apc_enabled'])) {

if (!version_compare(PHP_VERSION, '5.4', '>=') && is_admin()) {
${__FILE__}['php54_notice'] = '<h3 style="margin:.5em 0 .25em 0;">'.__('<strong>NOTICE: ZenCache Minimum PHP Version</strong></h3>', 'zencache');
${__FILE__}['php54_notice'] .= '<p style="margin-top:0;">'.sprintf(__('<strong>As of December 1st, 2015 ZenCache requires PHP 5.4 or higher.</strong> Your server is currently running PHP v%1$s. You will need to upgrade to PHP 5.4 or higher to run this version of ZenCache.', 'zencache'), esc_html(PHP_VERSION)).'</p>';
${__FILE__}['php54_notice'] .= '<p style="margin-top:0;">'.__('Learn more about this change here: <a href="http://zencache.com/r/new-minimum-php-version-php-5-4/" target="_blank">New Minimum PHP Version: PHP 5.4</a>', 'zencache').'</p>';
if (${__FILE__}['apc_enabled']) {
${__FILE__}['php54_notice'] .= '<p style="margin-top:0;">'.__('Your server is also running the <strong>outdated PHP APC extension</strong>. Please see: <a href="http://zencache.com/r/php-apc-extension-no-longer-supported/" target="_blank">PHP APC Extension No Longer Supported</a>', 'zencache').'</p>';
}

add_action(
'all_admin_notices', create_function(
'', 'if(!current_user_can(\'activate_plugins\'))'.
' return;'."\n".// User missing capability.

'echo \''.// Wrap `$notice` inside a WordPress error.

'<div class="error">'.
' '.str_replace("'", "\\'", ${__FILE__}['php54_notice']).
'</div>'.

'\';'
)
);
} elseif (${__FILE__}['apc_enabled'] && is_admin()) {
${__FILE__}['apc_deprecated_notice'] = '<h3 style="margin:.5em 0 .25em 0;">'.__('<strong>NOTICE: ZenCache + PHP APC Extension</strong></h3>', 'zencache');
${__FILE__}['apc_deprecated_notice'] .= '<p style="margin-top:0;">'.sprintf(__('<strong>As of December 1st, 2015 ZenCache no longer runs with the outdated PHP APC extension.</strong> It appears that you\'re currently running PHP v%1$s with APC enabled. You will need to follow one of the actions below to run this version of ZenCache.', 'zencache'), esc_html(PHP_VERSION)).'</p>';
${__FILE__}['apc_deprecated_notice'] .= __('<h4 style="margin:0 0 .5em 0; font-size:1.25em;"><span class="dashicons dashicons-lightbulb"></span> Options Available (Action Required):</h4>', 'zencache');
${__FILE__}['apc_deprecated_notice'] .= '<ul style="margin-left:2em; list-style:disc;">';
${__FILE__}['apc_deprecated_notice'] .= ' <li>'.__('Please add <code>ini_set(\'apc.cache_by_default\', false);</code> to the top of your <code>/wp-config.php</code> file. That will get rid of this message and allow ZenCache to run without issue.', 'zencache').'</li>';
${__FILE__}['apc_deprecated_notice'] .= ' <li>'.__('Or, contact your web hosting provider and ask about upgrading to PHP v5.5+; which includes the new <a href="http://zencache.com/r/php-opcache-extension/" target="_blank">OPcache extension for PHP</a>. The new OPcache extension replaces APC in modern versions of PHP.', 'zencache').'</li>';
${__FILE__}['apc_deprecated_notice'] .= '</ul>';
${__FILE__}['apc_deprecated_notice'] .= '<p style="margin-top:0;">'.__('To learn more about this change, please see the announcement: <a href="http://zencache.com/r/php-apc-extension-no-longer-supported/" target="_blank">PHP APC Extension No Longer Supported</a>', 'zencache').'</p>';

add_action(
'all_admin_notices', create_function(
'', 'if(!current_user_can(\'activate_plugins\'))'.
' return;'."\n".// User missing capability.

'echo \''.// Wrap `$notice` inside a WordPress error.

'<div class="error">'.
' '.str_replace("'", "\\'", ${__FILE__}['apc_deprecated_notice']).
'</div>'.

'\';'
)
);
}
} else {
require_once dirname(__FILE__).'/src/includes/plugin.php';
}
} else {
wp_php_rv_notice('ZenCache');
}

unset(${__FILE__}); // Housekeeping.
Loading

0 comments on commit d833241

Please sign in to comment.