Skip to content

Commit c607631

Browse files
committed
Merge branch 'v1_8'
2 parents 44ca88c + b43ad58 commit c607631

188 files changed

Lines changed: 658 additions & 602 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0)
22
set( CMAKE_EXPORT_COMPILE_COMMANDS ON)
33

4-
Project(openlitespeed VERSION 1.8.4)
4+
Project(openlitespeed VERSION 1.8.5)
55
INCLUDE( ${PROJECT_SOURCE_DIR}/CMakeModules/common.cmake)
66
INCLUDE(GNUInstallDirs)
77

LSQUICCOMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
70486141724f85e97b08f510673e29f399bbae8f
1+
133998f9581fe2ef672d858ffc45a079b533d753

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for openlitespeed 1.8.4.
3+
# Generated by GNU Autoconf 2.69 for openlitespeed 1.8.5.
44
#
55
# Report bugs to <info@litespeedtech.com>.
66
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
590590
# Identity of this package.
591591
PACKAGE_NAME='openlitespeed'
592592
PACKAGE_TARNAME='openlitespeed'
593-
PACKAGE_VERSION='1.8.4'
594-
PACKAGE_STRING='openlitespeed 1.8.4'
593+
PACKAGE_VERSION='1.8.5'
594+
PACKAGE_STRING='openlitespeed 1.8.5'
595595
PACKAGE_BUGREPORT='info@litespeedtech.com'
596596
PACKAGE_URL='http://www.litespeedtech.com/'
597597

@@ -1409,7 +1409,7 @@ if test "$ac_init_help" = "long"; then
14091409
# Omit some internal or obsolete options to make the list less imposing.
14101410
# This message is too long to be a string in the A/UX 3.1 sh.
14111411
cat <<_ACEOF
1412-
\`configure' configures openlitespeed 1.8.4 to adapt to many kinds of systems.
1412+
\`configure' configures openlitespeed 1.8.5 to adapt to many kinds of systems.
14131413

14141414
Usage: $0 [OPTION]... [VAR=VALUE]...
14151415

@@ -1480,7 +1480,7 @@ fi
14801480

14811481
if test -n "$ac_init_help"; then
14821482
case $ac_init_help in
1483-
short | recursive ) echo "Configuration of openlitespeed 1.8.4:";;
1483+
short | recursive ) echo "Configuration of openlitespeed 1.8.5:";;
14841484
esac
14851485
cat <<\_ACEOF
14861486

@@ -1641,7 +1641,7 @@ fi
16411641
test -n "$ac_init_help" && exit $ac_status
16421642
if $ac_init_version; then
16431643
cat <<\_ACEOF
1644-
openlitespeed configure 1.8.4
1644+
openlitespeed configure 1.8.5
16451645
generated by GNU Autoconf 2.69
16461646

16471647
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2315,7 +2315,7 @@ cat >config.log <<_ACEOF
23152315
This file contains any messages produced by compilers while
23162316
running configure, to aid debugging if configure makes a mistake.
23172317

2318-
It was created by openlitespeed $as_me 1.8.4, which was
2318+
It was created by openlitespeed $as_me 1.8.5, which was
23192319
generated by GNU Autoconf 2.69. Invocation command line was
23202320

23212321
$ $0 $@
@@ -3181,7 +3181,7 @@ fi
31813181

31823182
# Define the identity of the package.
31833183
PACKAGE='openlitespeed'
3184-
VERSION='1.8.4'
3184+
VERSION='1.8.5'
31853185

31863186

31873187
# Some tools Automake needs.
@@ -19637,7 +19637,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1963719637
# report actual input values of CONFIG_FILES etc. instead of their
1963819638
# values after options handling.
1963919639
ac_log="
19640-
This file was extended by openlitespeed $as_me 1.8.4, which was
19640+
This file was extended by openlitespeed $as_me 1.8.5, which was
1964119641
generated by GNU Autoconf 2.69. Invocation command line was
1964219642

1964319643
CONFIG_FILES = $CONFIG_FILES
@@ -19704,7 +19704,7 @@ _ACEOF
1970419704
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1970519705
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1970619706
ac_cs_version="\\
19707-
openlitespeed config.status 1.8.4
19707+
openlitespeed config.status 1.8.5
1970819708
configured by $0, generated by GNU Autoconf 2.69,
1970919709
with options \\"\$ac_cs_config\\"
1971019710

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ m4_include(ax_check_libudns.m4)
77
m4_include(ax_check_ip2location.m4)
88

99
dnl Process this file with autoconf to produce a configure script.
10-
AC_INIT([openlitespeed],[1.8.4],[info@litespeedtech.com],[openlitespeed],[http://www.litespeedtech.com/])
10+
AC_INIT([openlitespeed],[1.8.5],[info@litespeedtech.com],[openlitespeed],[http://www.litespeedtech.com/])
1111
AM_INIT_AUTOMAKE([1.0 foreign no-define subdir-objects])
1212

1313
AC_CONFIG_HEADERS(src/config.h:src/config.h.in)

dist/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.4
1+
1.8.5

dist/add-ons/webcachemgr/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.4.2
1+
1.17.5

dist/add-ons/webcachemgr/src/Panel/ControlPanel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class ControlPanel
3636
/**
3737
* @var string
3838
*/
39-
const PANEL_API_VERSION = '1.17.4.2';
39+
const PANEL_API_VERSION = '1.17.5';
4040

4141
/**
4242
* @since 1.9
@@ -1047,6 +1047,7 @@ public static function meetsMinAPIVerRequirement()
10471047
public static function checkPanelAPICompatibility( $panelAPIVer )
10481048
{
10491049
$supportedAPIVers = array(
1050+
'1.17.5',
10501051
'1.17.4.2',
10511052
'1.17.4.1',
10521053
'1.17.4',

dist/add-ons/webcachemgr/src/PanelController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,6 @@ protected function checkRefreshAction()
765765
}
766766

767767
/**
768-
*
769-
* @deprecated release_ver_placeholder
770768
*
771769
* @return bool|void Function outputs ajax and exits without returning a
772770
* value when $init is evaluated to be false.

dist/add-ons/webcachemgr/src/PluginVersion.php

Lines changed: 79 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
/** *********************************************
44
* LiteSpeed Web Server Cache Manager
55
*
6-
* @author Michael Alegre
7-
* @copyright (c) 2018-2023 LiteSpeed Technologies, Inc.
6+
* @author Michael Alegre
7+
* @copyright 2018-2025 LiteSpeed Technologies, Inc.
88
* *******************************************
99
*/
1010

1111
namespace Lsc\Wp;
1212

1313
use Lsc\Wp\Context\Context;
14-
use LsUserPanel\Lsc\UserLSCMException;
1514

1615
class PluginVersion
1716
{
@@ -28,10 +27,16 @@ class PluginVersion
2827
const DOWNLOAD_DIR = '/usr/src/litespeed-wp-plugin';
2928

3029
/**
31-
* @var string
30+
* @var string Old conf file name.
3231
*/
3332
const LSCWP_DEFAULTS_INI_FILE_NAME = 'const.default.ini';
3433

34+
/**
35+
* @since 1.17.5
36+
* @var string New conf file name.
37+
*/
38+
const LSCWP_DEFAULTS_JSON_FILE_NAME = 'const.default.json';
39+
3540
/**
3641
* @var string
3742
*/
@@ -51,13 +56,13 @@ class PluginVersion
5156
* @deprecated 4.1.3 Will be removed in favor of $this->shortVersions.
5257
* @var string[]
5358
*/
54-
protected $knownVersions = array();
59+
protected $knownVersions = [];
5560

5661
/**
5762
* @since 4.1.3
5863
* @var string[]
5964
*/
60-
protected $shortVersions = array();
65+
protected $shortVersions = [];
6166

6267
/**
6368
* @var string[]
@@ -248,7 +253,8 @@ protected function createDownloadDir()
248253
protected function setVersionFiles()
249254
{
250255
$this->versionFile = Context::LOCAL_PLUGIN_DIR . '/lscwp_versions_v2';
251-
$this->activeFile = Context::LOCAL_PLUGIN_DIR . '/lscwp_active_version';
256+
$this->activeFile =
257+
Context::LOCAL_PLUGIN_DIR . '/lscwp_active_version';
252258
}
253259

254260
/**
@@ -263,7 +269,7 @@ protected function setVersionFiles()
263269
*/
264270
protected function checkOldVersionFiles()
265271
{
266-
$dataDir = Context::getLSCMDataDir();
272+
$dataDir = Context::getLSCMDataDir();
267273
$oldActiveFile = "$dataDir/lscwp_active_version";
268274

269275
if ( file_exists($oldActiveFile) ) {
@@ -319,9 +325,11 @@ public function setCurrentVersion()
319325
*/
320326
private function getActiveVersion()
321327
{
322-
if ( file_exists($this->activeFile)
323-
&& ($content = file_get_contents($this->activeFile)) ) {
324-
328+
if (
329+
file_exists($this->activeFile)
330+
&&
331+
($content = file_get_contents($this->activeFile))
332+
) {
325333
return trim($content);
326334
}
327335

@@ -386,13 +394,11 @@ protected function setAllowedVersions()
386394
);
387395
}
388396

389-
$matchFound = preg_match(
390-
'/allowed\s{(.*)}/sU',
391-
trim($content),
392-
$m
393-
);
394-
395-
if ( !$matchFound || ($list = trim($m[1])) == '' ) {
397+
if (
398+
!preg_match('/allowed\s{(.*)}/sU', trim($content), $m)
399+
||
400+
($list = trim($m[1])) == ''
401+
) {
396402
throw new LSCMException(
397403
'LSCWP version list is empty.',
398404
LSCMException::E_NON_FATAL
@@ -426,13 +432,11 @@ protected function setShortVersions()
426432
);
427433
}
428434

429-
$matchFound = preg_match(
430-
'/short\s{(.*)}/sU',
431-
trim($content),
432-
$m
433-
);
434-
435-
if ( !$matchFound || ($list = trim($m[1])) == '' ) {
435+
if (
436+
!preg_match('/short\s{(.*)}/sU', trim($content), $m)
437+
||
438+
($list = trim($m[1])) == ''
439+
) {
436440
throw new LSCMException(
437441
'LSCWP version list is empty.',
438442
LSCMException::E_NON_FATAL
@@ -498,16 +502,21 @@ public function setActiveVersion( $version, $init = false )
498502

499503
/**
500504
*
501-
* @param bool $isforced
505+
* @param bool $isForced
502506
*
503507
* @throws LSCMException Thrown indirectly by Logger::info() call.
504508
*/
505-
protected function refreshVersionList( $isforced = false )
509+
protected function refreshVersionList( $isForced = false )
506510
{
507511
clearstatcache();
508512

509-
if ( $isforced || !file_exists($this->versionFile)
510-
|| (time() - filemtime($this->versionFile)) > 86400 ) {
513+
if (
514+
$isForced
515+
||
516+
!file_exists($this->versionFile)
517+
||
518+
(time() - filemtime($this->versionFile)) > 86400
519+
) {
511520

512521
if ( !file_exists(Context::LOCAL_PLUGIN_DIR) ) {
513522
$this->createDownloadDir();
@@ -550,6 +559,34 @@ protected function filterVerList( $ver )
550559
return Util::betterVersionCompare($ver, '1.2.2', '>');
551560
}
552561

562+
/**
563+
*
564+
* @since 1.17.5
565+
*
566+
* @param string $pluginDir The WordPress plugin directory.
567+
*/
568+
public static function tryCopyLscwpDefaultConf( $pluginDir )
569+
{
570+
foreach (
571+
[
572+
self::LSCWP_DEFAULTS_INI_FILE_NAME,
573+
self::LSCWP_DEFAULTS_JSON_FILE_NAME
574+
]
575+
as
576+
$customConfFileName
577+
) {
578+
$customConfFilePath =
579+
Context::LOCAL_PLUGIN_DIR . "/$customConfFileName";
580+
581+
if ( file_exists($customConfFilePath) ) {
582+
copy(
583+
$customConfFilePath,
584+
"$pluginDir/litespeed-cache/data/$customConfFileName"
585+
);
586+
}
587+
}
588+
}
589+
553590
/**
554591
* Checks the current installation for existing LSCWP plugin files and
555592
* copies them to the installation's plugins directory if not found.
@@ -596,7 +633,9 @@ public static function prepareUserInstall( $pluginDir, $version = '' )
596633

597634
exec(
598635
'/bin/cp --preserve=mode -rf '
599-
. Context::LOCAL_PLUGIN_DIR . "/$version/" . self::PLUGIN_NAME
636+
. Context::LOCAL_PLUGIN_DIR
637+
. "/$version/"
638+
. self::PLUGIN_NAME
600639
. " $pluginDir"
601640
);
602641

@@ -607,16 +646,7 @@ public static function prepareUserInstall( $pluginDir, $version = '' )
607646
);
608647
}
609648

610-
$customIni = Context::LOCAL_PLUGIN_DIR . '/'
611-
. self::LSCWP_DEFAULTS_INI_FILE_NAME;
612-
613-
if ( file_exists($customIni) ) {
614-
copy(
615-
$customIni,
616-
"$pluginDir/litespeed-cache/data/"
617-
. self::LSCWP_DEFAULTS_INI_FILE_NAME
618-
);
619-
}
649+
self::tryCopyLscwpDefaultConf($pluginDir);
620650

621651
Logger::debug(
622652
'Copied LSCache for WordPress plugin files into plugins directory '
@@ -634,15 +664,15 @@ public static function prepareUserInstall( $pluginDir, $version = '' )
634664
*/
635665
protected function hasDownloadedVersion( $version )
636666
{
637-
$dir = Context::LOCAL_PLUGIN_DIR . "/$version";
667+
$dir = Context::LOCAL_PLUGIN_DIR . "/$version";
638668
$md5file = "$dir/" . self::VER_MD5;
639-
$plugin = "$dir/" . self::PLUGIN_NAME;
669+
$plugin = "$dir/" . self::PLUGIN_NAME;
640670

641671
if ( !file_exists($md5file) || !is_dir($plugin) ) {
642672
return false;
643673
}
644674

645-
return ( file_get_contents($md5file) == Util::DirectoryMd5($plugin) );
675+
return (file_get_contents($md5file) == Util::DirectoryMd5($plugin));
646676
}
647677

648678
/**
@@ -772,8 +802,7 @@ public static function retrieveTranslation( $locale, $pluginVer )
772802
exec(
773803
'wget -q --tries=1 --no-check-certificate '
774804
. 'https://downloads.wordpress.org/translation/plugin/'
775-
. "litespeed-cache/$pluginVer/$locale.zip "
776-
. "-P $translationDir",
805+
. "litespeed-cache/$pluginVer/$locale.zip -P $translationDir",
777806
$output,
778807
$return_var
779808
);
@@ -805,9 +834,11 @@ public static function removeTranslationZip( $locale, $pluginVer )
805834
Context::LOCAL_PLUGIN_DIR . "/$pluginVer/translations/$locale.zip"
806835
);
807836

808-
$realPathStart = substr($zipFile, 0, strlen(Context::LOCAL_PLUGIN_DIR));
809-
810-
if ( $realPathStart === Context::LOCAL_PLUGIN_DIR ) {
837+
if (
838+
substr($zipFile, 0, strlen(Context::LOCAL_PLUGIN_DIR))
839+
===
840+
Context::LOCAL_PLUGIN_DIR
841+
) {
811842
unlink($zipFile);
812843
}
813844
}

0 commit comments

Comments
 (0)