Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Endpoints / Proxy Update #315

Merged
merged 37 commits into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8b14292
Preparing pull request. See: websharks/comet-cache#47
Apr 25, 2017
b9608e1
Adding Memcached class.
Apr 25, 2017
6ae4d43
Prepping shared utils.
Apr 25, 2017
9da4550
Adding option keys.
Apr 25, 2017
6052230
Drop-in for event constants to come soon. See: https://github.com/web…
Apr 25, 2017
00edd75
Filling in event consts.
Apr 25, 2017
aa0b67b
Refactor; wrap as memory utils & implement adv cache constants.
Apr 25, 2017
d55e54f
Line-delimited servers only.
Apr 25, 2017
6280c77
Adding `memEnabled()`
Apr 25, 2017
62a401c
Beginning work on `CacheIoUtils{}`
Apr 25, 2017
2627849
`cacheRead()`
Apr 25, 2017
4c7547d
Beginning work on `cacheWrite()`
Apr 25, 2017
7398253
Polishing `CacheIoUtils{}`
Apr 26, 2017
2433fe1
Polishing back compat. methods.
Apr 26, 2017
3ca54f9
Polishing `ObUtils{}`
Apr 26, 2017
75c8c4f
Implementing `cacheWrite()`
Apr 26, 2017
9f8140c
Refactor `cacheRead()`
Apr 26, 2017
80b63f8
Magic number `524288`
Apr 26, 2017
c195111
Implement `cacheRead()`
Apr 26, 2017
9915f80
Implement `cacheRead()`
Apr 26, 2017
12f15d1
Refactor options (breaking apart).
Apr 26, 2017
4f2bb8b
Adding menu page options for Memcached.
Apr 26, 2017
8b0e033
Indicate where cache was loaded from.
Apr 26, 2017
80704e4
Indicate where cache was loaded from.
Apr 26, 2017
05427dc
Note about auto-prefixing.
Apr 26, 2017
e021b7c
Updating build.
Apr 26, 2017
4adcf42
Adding `memClear()`
Apr 26, 2017
864b137
Use `static::$memcached`
Apr 26, 2017
fdd65b1
Auto-clear memory cache.
Apr 26, 2017
69477e3
Add missing colon to placeholder.
Apr 26, 2017
ffbcc5a
_is_ necessary
Apr 26, 2017
94909c8
Memcached tweaks.
Apr 27, 2017
89c92f5
Bring software up-to-date with latest endpoints/strategy. See: https:…
Apr 28, 2017
5fccb44
Disable Memcached for logged-in users. See: https://github.com/websha…
May 12, 2017
8d6f501
Updating to latest phings release.
May 12, 2017
67af485
Improve wording in note about logged-in users. See: https://github.co…
May 12, 2017
b18cd49
Updating dotfiles.
May 12, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitchange
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
1491589996
2ea258a033ce686450ef6bccbc0f66efdba74ac1:58ffb9673670b6.69941207
35 changes: 20 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"type": "library",
"license": "GPL-3.0+",
"name": "websharks/comet-cache-pro",

"homepage": "https://github.com/websharks/comet-cache-pro",
"support": {
"source": "https://github.com/websharks/comet-cache-pro",
"issues": "https://github.com/websharks/comet-cache/issues"
},

"description": "A popular caching plugin for WordPress.",
"keywords": [
"websharks",
Expand All @@ -9,44 +17,39 @@
"caching",
"cache"
],
"type": "library",
"license": "GPL-3.0+",

"authors": [{
"name": "websharks",
"homepage": "http://websharks-inc.com/",
"homepage": "http://websharks.org",
"role": "company"
}, {
"name": "jaswsinc",
"homepage": "http://jaswsinc.com/",
"name": "jaswrks",
"homepage": "http://jaswrks.com",
"role": "developer"
}, {
"name": "raamdev",
"homepage": "https://raamdev.com/",
"homepage": "https://raamdev.com",
"role": "developer"
}],
"support": {
"source": "https://github.com/websharks/comet-cache-pro",
"issues": "https://github.com/websharks/comet-cache/issues"
},

"require": {
"php": ">=5.4",
"websharks/sharkicons": "160221",
"websharks/wp-php-rv": "160824.6416",
"websharks/html-compressor": "170420.24924",
"thadafinser/user-agent-parser": "1.5.0",
"browscap/browscap-php": "3.0.0",
"websharks/sharkicons": "160221"
"ramsey/uuid": "3.*"
},
"require-lite": {
"php": ">=5.4",
"websharks/wp-php-rv": "160824.6416",
"websharks/sharkicons": "160221"
"websharks/sharkicons": "160221",
"websharks/wp-php-rv": "160824.6416"
},
"require-dev": {
"package/bourbon": "4.2.3",
"websharks/wp-i18n-tools": "dev-master"
},
"minimum-stability": "dev",
"prefer-stable": true,

"autoload": {
"psr-4": {
Expand All @@ -59,6 +62,8 @@
"vendor-dir": "src/vendor",
"preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true,

"repositories": [{
"type": "package",
Expand Down
132 changes: 131 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion phings
1 change: 1 addition & 0 deletions src/includes/classes/AbsBaseAp.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ abstract class AbsBaseAp extends AbsBase
use Traits\Shared\HttpUtils;
use Traits\Shared\I18nUtils;
use Traits\Shared\IpAddrUtils;
use Traits\Shared\MemoryUtils;
use Traits\Shared\PatternUtils;
use Traits\Shared\ReplaceUtils;
use Traits\Shared\ServerUtils;
Expand Down
72 changes: 40 additions & 32 deletions src/includes/classes/AdvCacheBackCompat.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,83 @@
class AdvCacheBackCompat
{
/**
* Back compat. with `zcAC` and `zcABC`.
* Back compat with `zc` vars.
*
* @since 150422 Rewrite.
* @since 17xxxx Polishing a little.
* @since 17xxxx Making this more dynamic.
*/
public static function zcRequestVars()
{
$super_gs = [
$super_globals = [
'_GET' => &$_GET,
'_REQUEST' => &$_REQUEST,
];
$zc_suffixes = ['AC', 'ABC'];
$key_suffixes = ['AC', 'ABC'];
$lc_short_name = mb_strtolower(SHORT_NAME);

foreach ($super_gs as $_super_g_key => &$_super_g_value) {
foreach ($zc_suffixes as $_zc_suffix) {
if (array_key_exists('zc'.$_zc_suffix, $_super_g_value)) {
if ($_super_g_key === '_GET' && !isset($_GET['cc'.$_zc_suffix])) {
$_GET['cc'.$_zc_suffix] = $_super_g_value['zc'.$_zc_suffix];
}
foreach ($super_gs as $__super_g_key => &$__super_g_value) {
unset($__super_g_value['zc'.$_zc_suffix]);
}
unset($__super_g_key, $__super_g_value); // Housekeeping.
foreach ($super_globals as $_key => &$_array) {
foreach ($key_suffixes as $_suffix) {
if (!array_key_exists('zc'.$_suffix, $_array)) {
continue; // No relevant key in array.
}
}
}
unset($_super_g_key, $_super_g_value, $_zc_suffix);
if ($_key === '_GET' && !isset($_GET[$lc_short_name.$_suffix])) {
$_GET[$lc_short_name.$_suffix] = $_array['zc'.$_suffix];
} // This sets the new key with the value from the old key.

foreach ($super_globals as $__key => &$__array) {
unset($__array['zc'.$_suffix]); // Purge old key.
} // Must unset temporary vars by reference.
unset($__key, $__array); // Housekeeping.
//
} // unset($_suffix); // Housekeeping.
} // Must unset temporary vars by reference.
unset($_key, $_array);
}

/**
* Back compat. with `ZENCACHE_` constants.
*
* @since 150422 Rewrite.
* @since 17xxxx Polishing a little.
* @since 17xxxx Making this more dynamic.
*/
public static function zenCacheConstants()
{
$_global_ns = mb_strtoupper(GLOBAL_NS);
$uc_global_ns = mb_strtoupper(GLOBAL_NS);

if (!($constants = get_defined_constants(true)) || empty($constants['user'])) {
return; // Nothing to do; i.e. no user-defined constants.
}
foreach ($constants['user'] as $_constant => $_value) {
if (mb_stripos($_constant, 'ZENCACHE_') !== 0) {
continue; // Nothing to do here.
}
if (!($_constant_sub_name = mb_substr($_constant, 9))) {
} elseif (!($_constant_sub_name = mb_substr($_constant, 9))) {
continue; // Nothing to do here.
}
if (!defined($_global_ns.'_'.$_constant_sub_name)) {
define($_global_ns.'_'.$_constant_sub_name, $_value);
}
}
if (isset($_SERVER['ZENCACHE_ALLOWED']) && !isset($_SERVER[$_global_ns.'_ALLOWED'])) {
$_SERVER[$_global_ns.'_ALLOWED'] = $_SERVER['ZENCACHE_ALLOWED'];
}
if (!defined($uc_global_ns.'_'.$_constant_sub_name)) {
define($uc_global_ns.'_'.$_constant_sub_name, $_value);
} // Sets new const with the value from the old const.
} // unset($_constant, $_value); // Just a little housekeeping.

unset($_constant, $_value, $_global_ns); // Housekeeping.
if (isset($_SERVER['ZENCACHE_ALLOWED']) && !isset($_SERVER[$uc_global_ns.'_ALLOWED'])) {
$_SERVER[$uc_global_ns.'_ALLOWED'] = $_SERVER['ZENCACHE_ALLOWED'];
} // Sets new super-global with the value from the old super-global key.
}

/**
* Back compat. with `COMET_CACHE_ALLOW_BROWSER_CACHE` constants.
* Back compat. with constants.
*
* @since 160706 Renaming COMET_CACHE_ALLOW_BROWSER_CACHE to COMET_CACHE_ALLOW_CLIENT_SIDE_CACHE
* @since 160706 Renaming `*_ALLOW_BROWSER_CACHE` to `*_ALLOW_CLIENT_SIDE_CACHE`.
* @since 17xxxx Polishing things up a little.
* @since 17xxxx Making this more dynamic.
*/
public static function browserCacheConstant()
{
$_global_ns = mb_strtoupper(GLOBAL_NS);
$uc_global_ns = mb_strtoupper(GLOBAL_NS);

if (defined('COMET_CACHE_ALLOW_BROWSER_CACHE')) {
define($_global_ns.'_ALLOW_CLIENT_SIDE_CACHE', COMET_CACHE_ALLOW_BROWSER_CACHE);
if (defined($uc_global_ns.'_ALLOW_BROWSER_CACHE')) {
define($uc_global_ns.'_ALLOW_CLIENT_SIDE_CACHE', constant($uc_global_ns.'_ALLOW_BROWSER_CACHE'));
}
}
}
1 change: 1 addition & 0 deletions src/includes/classes/AdvancedCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class AdvancedCache extends AbsBaseAp
/*[.build.php-auto-generate-use-Traits]*/
use Traits\Ac\AbortUtils;
use Traits\Ac\AcPluginUtils;
use Traits\Ac\CacheIoUtils;
use Traits\Ac\ClientSideUtils;
use Traits\Ac\HtmlCUtils;
use Traits\Ac\NcDebugUtils;
Expand Down
Loading