Skip to content

Commit

Permalink
Check in 1.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlst committed Feb 20, 2020
1 parent f05271e commit 59bb5a9
Show file tree
Hide file tree
Showing 28 changed files with 384 additions and 119 deletions.
2 changes: 1 addition & 1 deletion LSQUICCOMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4ab453a18498a089088ad6382b7eda6ab98151d0
aa820211702c148b95f2be18eb4643a029b653dc
20 changes: 10 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for openlitespeed 1.6.8.
# Generated by GNU Autoconf 2.69 for openlitespeed 1.6.9.
#
# Report bugs to <info@litespeedtech.com>.
#
Expand Down Expand Up @@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='openlitespeed'
PACKAGE_TARNAME='openlitespeed'
PACKAGE_VERSION='1.6.8'
PACKAGE_STRING='openlitespeed 1.6.8'
PACKAGE_VERSION='1.6.9'
PACKAGE_STRING='openlitespeed 1.6.9'
PACKAGE_BUGREPORT='info@litespeedtech.com'
PACKAGE_URL='http://www.litespeedtech.com/'

Expand Down Expand Up @@ -1395,7 +1395,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures openlitespeed 1.6.8 to adapt to many kinds of systems.
\`configure' configures openlitespeed 1.6.9 to adapt to many kinds of systems.

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

Expand Down Expand Up @@ -1465,7 +1465,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of openlitespeed 1.6.8:";;
short | recursive ) echo "Configuration of openlitespeed 1.6.9:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1621,7 +1621,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
openlitespeed configure 1.6.8
openlitespeed configure 1.6.9
generated by GNU Autoconf 2.69

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

It was created by openlitespeed $as_me 1.6.8, which was
It was created by openlitespeed $as_me 1.6.9, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -3161,7 +3161,7 @@ fi

# Define the identity of the package.
PACKAGE='openlitespeed'
VERSION='1.6.8'
VERSION='1.6.9'


# Some tools Automake needs.
Expand Down Expand Up @@ -18872,7 +18872,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by openlitespeed $as_me 1.6.8, which was
This file was extended by openlitespeed $as_me 1.6.9, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -18939,7 +18939,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
openlitespeed config.status 1.6.8
openlitespeed config.status 1.6.9
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ m4_include(ax_check_libudns.m4)
m4_include(ax_check_ip2location.m4)

dnl Process this file with autoconf to produce a configure script.
AC_INIT([openlitespeed],[1.6.8],[info@litespeedtech.com],[openlitespeed],[http://www.litespeedtech.com/])
AC_INIT([openlitespeed],[1.6.9],[info@litespeedtech.com],[openlitespeed],[http://www.litespeedtech.com/])
AM_INIT_AUTOMAKE([1.0 foreign no-define ])

AC_CONFIG_HEADERS(src/config.h:src/config.h.in)
Expand Down
2 changes: 1 addition & 1 deletion dist/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.8
1.6.9
2 changes: 1 addition & 1 deletion dist/add-ons/webcachemgr/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.7
1.10
59 changes: 35 additions & 24 deletions dist/add-ons/webcachemgr/src/CliController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class CliController
private $commands = array();

/**
* @var string Default value set while parsing commands.
* @var string
*/
private $svrCacheRoot;
private $svrCacheRootParam = '';

/**
* @var string
*/
private $vhCacheRoot = 'lscache';
private $vhCacheRootParam = '';

/**
* @var boolean
Expand Down Expand Up @@ -131,7 +131,8 @@ private function checkDataFile( $action,
&& $wpInstallStorage->getCount() == 0 ) {

$msg = 'No WordPress installations discovered in the previous scan. If you have any newly '
. "installed WordPress installations, please scan again.\n";
. "installed WordPress installations, please scan again or add them with"
. "command 'addinstalls'.\n";
}

if ( $msg != '' ) {
Expand Down Expand Up @@ -205,16 +206,17 @@ private function handleSetCacheRootInput( &$args )

if ( ($key = array_search('-svr', $args)) !== false ) {

if ( empty($args[$key + 1]) ) {
if ( empty($args[$key + 1])
|| ($this->svrCacheRootParam = trim($args[$key + 1])) == '' ) {

throw new LSCMException('Invalid Command, missing server cache root value.');
}

$this->svrCacheRoot = $args[$key + 1];
$currSvrCacheRoot = $controlPanel->getServerCacheRoot();

if ( $this->svrCacheRoot != $currSvrCacheRoot) {
if ( $this->svrCacheRootParam != $currSvrCacheRoot) {

if (!Util::is_dir_empty($this->svrCacheRoot) ) {
if ( !Util::is_dir_empty($this->svrCacheRootParam) ) {
throw new LSCMException(
'Provided server level cache root must be an empty directory.');
}
Expand All @@ -226,15 +228,16 @@ private function handleSetCacheRootInput( &$args )
}

if ( ($key = array_search('-vh', $args)) !== false ) {
$setvhCacheRoot = false;

if ( empty($args[$key + 1])
|| ($this->vhCacheRootParam = trim($args[$key + 1])) == '' ) {

if ( empty($args[$key + 1]) ) {
throw new LSCMException(
'Invalid Command, missing virtual host cache root value.');
}

$vhCacheRoot = $args[$key + 1];

if ( strpos($vhCacheRoot, '$') !== false ) {
if ( strpos($this->vhCacheRootParam, '$') !== false ) {
throw new LSCMException(
'Invalid Command, virtual host cache root value cannot contain any \'$\' '
. 'characters. \'$vh_user\' will be automatically added to the end of virtual '
Expand All @@ -243,24 +246,29 @@ private function handleSetCacheRootInput( &$args )

$currVHCacheRoot = $controlPanel->getVHCacheRoot();

if ( $vhCacheRoot[0] == '/' ) {
$vhCacheRoot = rtrim($vhCacheRoot, '/') . '/$vh_user';
if ( $this->vhCacheRootParam[0] == '/' ) {
$updatedVhCacheRoot =
rtrim($this->vhCacheRootParam, '/') . '/$vh_user';

if ( $this->vhCacheRoot != $currVHCacheRoot
&& !Util::is_dir_empty($vhCacheRoot) ) {
if ( $updatedVhCacheRoot != $currVHCacheRoot
&& ! Util::is_dir_empty($this->vhCacheRootParam) ) {

throw new LSCMException('Provided absolute path for virtual host level '
. 'cache root must be an empty directory.');
}

$this->vhCacheRootParam = $updatedVhCacheRoot;
$setvhCacheRoot = true;
}
elseif ( $this->vhCacheRootParam != $currVHCacheRoot ) {
$setvhCacheRoot = true;
}

$this->vhCacheRoot = $vhCacheRoot;
unset($args[$key], $args[$key + 1]);

if ( $this->vhCacheRoot != $currVHCacheRoot ) {
if ( $setvhCacheRoot ) {
$this->cacheRootCmds[] = 'setVHCacheRoot';
}

unset($args[$key], $args[$key + 1]);
}
}

Expand Down Expand Up @@ -652,12 +660,15 @@ private function parseCommands( $args )

$controlPanel = ControlPanel::getClassInstance($panelClassName);

$this->svrCacheRoot = $controlPanel->getDefaultSvrCacheRoot();

$cmd = array_shift($args);

switch ($cmd) {
case 'setcacheroot':
if ( $panelClassName == 'custom' ) {
$msg = 'Command \'setcacheroot\' cannot be used in the CustomPanel context.';
throw new LSCMException($msg);
}

$this->handleSetCacheRootInput($args);
break;

Expand Down Expand Up @@ -718,12 +729,12 @@ private function doCacheRootCommand( $action )

switch ( $action ) {
case 'setSvrCacheRoot':
$controlPanel->setServerCacheRoot($this->svrCacheRoot);
$controlPanel->setServerCacheRoot($this->svrCacheRootParam);
$restartRequired = true;
break;

case 'setVHCacheRoot':
$controlPanel->setVHCacheRoot($this->vhCacheRoot);
$controlPanel->setVHCacheRoot($this->vhCacheRootParam);
$restartRequired = true;
break;

Expand Down
26 changes: 25 additions & 1 deletion dist/add-ons/webcachemgr/src/Panel/ControlPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class ControlPanel
/**
* @var string
*/
const PANEL_API_VERSION = '1.9.8';
const PANEL_API_VERSION = '1.10';

/**
* @since 1.9
Expand Down Expand Up @@ -148,6 +148,29 @@ public static function initByClassName( $className )
{
if ( self::$instance == null ) {

if ( $className == 'custom' ) {
$lsws_home = realpath(__DIR__ . '/../../../../');
$customPanelFile = "{$lsws_home}/admin/lscdata/custom/CustomPanel.php";

if ( ! file_exists($customPanelFile)
|| ! include_once $customPanelFile ) {

throw new LSCMException(
"Unable to include file {$customPanelFile}");
}

$className = '\Lsc\Wp\Panel\CustomPanel';

$isSubClass =
is_subclass_of($className, '\Lsc\Wp\Panel\CustomPanelBase');

if ( ! $isSubClass ) {
$msg = 'Class CustomPanel must extend class '
. '\Lsc\Wp\Panel\CustomPanelBase';
throw new LSCMException($msg);
}
}

try{
self::$instance = new $className();
}
Expand Down Expand Up @@ -816,6 +839,7 @@ public static function meetsMinAPIVerRequirement()
public static function checkPanelAPICompatibility( $panelAPIVer )
{
$supportedAPIVers = array (
'1.10',
'1.9.8',
'1.9.7',
'1.9.6.1',
Expand Down
75 changes: 75 additions & 0 deletions dist/add-ons/webcachemgr/src/Panel/CustomPanel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php

/* * ******************************************
* LiteSpeed Web Server Cache Manager
*
* @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com)
* @copyright (c) 2020
* ******************************************* */

namespace Lsc\Wp\Panel;

use \Lsc\Wp\WPInstall;

class CustomPanel
extends CustomPanelBase
{
protected function __construct()
{
/**
* Panel name can be set to whatever you'd like.
*/
$this->panelName = 'customPanel';

parent::__construct();
}

/**
* Gets a list of found docroots and associated server names.
* Only needed for lscmctl 'scan' command.
*/
protected function prepareDocrootMap()
{
/**
* This function can be left as is if you do not intend to use
* the lscmctl 'scan' command. In this case lscmctl command
* 'addinstalls' can be used to add WordPress installations to the
* custom data file instead.
*
* If you would like to add support for the lscmctl 'scan' command,
* implement this function so that it searches for all document root,
* server name, and server alias groups and uses this information to
* populate $this->docRootMap as follows:
*
* array(
* 'docroots' => array(index => docroot),
* 'names' => array("server name/alias" => index)
* );
*
* Where the value of each discovered servername/alias in the 'names'
* array matches the index of the related document root in the
* 'docroots' array.
*/
$this->docRootMap = array('docroots' => array(), 'names' => array());
}

/**
* This function returns the PHP binary to be used when performing
* WordPress related actions for the WordPress installation associated with
* the passed in WPInstall object.
*
* @param WPInstall $wpInstall
* @return string
*/
public function getPhpBinary( WPInstall $wpInstall )
{
/**
* If PHP binary $phpBin can be more accurately detected for the given
* installation, do so here.
*/
$phpBin = 'php';

return "{$phpBin} {$this->phpOptions}";
}

}
Loading

0 comments on commit 59bb5a9

Please sign in to comment.