aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.markdownlintignore2
-rw-r--r--.typos.toml2
-rw-r--r--lib/.gitignore6
-rw-r--r--lib/CssXPath/NotYetImplementedException.php4
-rw-r--r--lib/composer.json2
-rw-r--r--lib/lib_rss.php7
-rw-r--r--lib/phpgt/cssxpath/LICENSE (renamed from lib/CssXPath/LICENSE)0
-rw-r--r--lib/phpgt/cssxpath/README.md (renamed from lib/CssXPath/README.md)0
-rw-r--r--lib/phpgt/cssxpath/src/CssXPathException.php (renamed from lib/CssXPath/CssXPathException.php)2
-rw-r--r--lib/phpgt/cssxpath/src/NotYetImplementedException.php4
-rw-r--r--lib/phpgt/cssxpath/src/Translator.php (renamed from lib/CssXPath/Translator.php)0
-rw-r--r--phpcs.xml2
-rw-r--r--tests/lib/CssXPath/CssXPathTest.php8
-rw-r--r--tests/lib/PHPMailer/PHPMailerTest.php4
14 files changed, 31 insertions, 12 deletions
diff --git a/.markdownlintignore b/.markdownlintignore
index b31ea81ba..1a634e542 100644
--- a/.markdownlintignore
+++ b/.markdownlintignore
@@ -1,4 +1,4 @@
-lib/CssXPath/
+lib/phpgt/
lib/phpmailer/
node_modules/
p/scripts/vendor/
diff --git a/.typos.toml b/.typos.toml
index b05117ccf..3e150d7dc 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -29,7 +29,7 @@ extend-exclude = [
"bin/",
"data/",
"docs/fr/",
- "lib/CssXPath/",
+ "lib/phpgt/",
"lib/phpmailer/",
"lib/SimplePie/",
"node_modules/",
diff --git a/lib/.gitignore b/lib/.gitignore
index f1e6fdd7e..b599767a7 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -1,6 +1,12 @@
autoload.php
composer.lock
composer/
+phpgt/cssxpath/.github/
+phpgt/cssxpath/.gitignore
+phpgt/cssxpath/.scrutinizer.yml
+phpgt/cssxpath/composer.json
+phpgt/cssxpath/CONTRIBUTING.md
+phpgt/cssxpath/test/
phpmailer/phpmailer/*oauth*
phpmailer/phpmailer/COMMITMENT*
phpmailer/phpmailer/composer.*
diff --git a/lib/CssXPath/NotYetImplementedException.php b/lib/CssXPath/NotYetImplementedException.php
deleted file mode 100644
index 70d9492cf..000000000
--- a/lib/CssXPath/NotYetImplementedException.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-namespace Gt\CssXPath;
-
-class NotYetImplementedException extends CssXPathException {}
diff --git a/lib/composer.json b/lib/composer.json
index 3d307f6e8..6fdc90ef4 100644
--- a/lib/composer.json
+++ b/lib/composer.json
@@ -6,9 +6,11 @@
"license": "AGPL-3.0",
"require": {
"php": ">=7.0.0",
+ "phpgt/cssxpath": "v1.1.4",
"phpmailer/phpmailer": "6.6.0"
},
"config": {
+ "sort-packages": true,
"vendor-dir": "./"
},
"scripts": {
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index a4a9df36a..96a9cb2a8 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -52,8 +52,11 @@ function classAutoloader($class) {
include(LIB_PATH . '/' . str_replace('_', '/', $class) . '.php');
} elseif (strpos($class, 'SimplePie') === 0) {
include(LIB_PATH . '/SimplePie/' . str_replace('_', '/', $class) . '.php');
- } elseif (strpos($class, 'CssXPath') !== false) {
- include(LIB_PATH . '/CssXPath/' . basename(str_replace('\\', '/', $class)) . '.php');
+ } elseif (str_starts_with($class, 'Gt\\CssXPath\\')) {
+ $prefix = 'Gt\\CssXPath\\';
+ $base_dir = LIB_PATH . '/phpgt/cssxpath/src/';
+ $relative_class_name = substr($class, strlen($prefix));
+ require $base_dir . str_replace('\\', '/', $relative_class_name) . '.php';
} elseif (str_starts_with($class, 'PHPMailer\\PHPMailer\\')) {
$prefix = 'PHPMailer\\PHPMailer\\';
$base_dir = LIB_PATH . '/phpmailer/phpmailer/src/';
diff --git a/lib/CssXPath/LICENSE b/lib/phpgt/cssxpath/LICENSE
index 12b514c97..12b514c97 100644
--- a/lib/CssXPath/LICENSE
+++ b/lib/phpgt/cssxpath/LICENSE
diff --git a/lib/CssXPath/README.md b/lib/phpgt/cssxpath/README.md
index 9082c8bbf..9082c8bbf 100644
--- a/lib/CssXPath/README.md
+++ b/lib/phpgt/cssxpath/README.md
diff --git a/lib/CssXPath/CssXPathException.php b/lib/phpgt/cssxpath/src/CssXPathException.php
index bd7798243..81ad3ac9d 100644
--- a/lib/CssXPath/CssXPathException.php
+++ b/lib/phpgt/cssxpath/src/CssXPathException.php
@@ -3,4 +3,4 @@ namespace Gt\CssXPath;
use RuntimeException;
-class CssXPathException extends RuntimeException {}
+class CssXPathException extends RuntimeException {} \ No newline at end of file
diff --git a/lib/phpgt/cssxpath/src/NotYetImplementedException.php b/lib/phpgt/cssxpath/src/NotYetImplementedException.php
new file mode 100644
index 000000000..39d12b3bc
--- /dev/null
+++ b/lib/phpgt/cssxpath/src/NotYetImplementedException.php
@@ -0,0 +1,4 @@
+<?php
+namespace Gt\CssXPath;
+
+class NotYetImplementedException extends CssXPathException {} \ No newline at end of file
diff --git a/lib/CssXPath/Translator.php b/lib/phpgt/cssxpath/src/Translator.php
index 140909099..140909099 100644
--- a/lib/CssXPath/Translator.php
+++ b/lib/phpgt/cssxpath/src/Translator.php
diff --git a/phpcs.xml b/phpcs.xml
index 2d53b5996..21458e27d 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -3,8 +3,8 @@
<description>Created with the PHP Coding Standard Generator. https://edorian.github.com/php-coding-standard-generator/</description>
<arg name="extensions" value="php,phtml,css,js"/>
<arg name="tab-width" value="4"/>
- <exclude-pattern>./lib/CssXPath/</exclude-pattern>
<exclude-pattern>./lib/SimplePie/</exclude-pattern>
+ <exclude-pattern>./lib/phpgt/</exclude-pattern>
<exclude-pattern>./lib/phpmailer/</exclude-pattern>
<exclude-pattern>./lib/http-conditional.php</exclude-pattern>
<exclude-pattern>./node_modules/</exclude-pattern>
diff --git a/tests/lib/CssXPath/CssXPathTest.php b/tests/lib/CssXPath/CssXPathTest.php
new file mode 100644
index 000000000..c6fe24fc8
--- /dev/null
+++ b/tests/lib/CssXPath/CssXPathTest.php
@@ -0,0 +1,8 @@
+<?php
+
+class CssXPathTest extends PHPUnit\Framework\TestCase
+{
+ public function testCssXPathTranslatorClassExists() {
+ $this->assertTrue(class_exists('Gt\\CssXPath\\Translator'));
+ }
+}
diff --git a/tests/lib/PHPMailer/PHPMailerTest.php b/tests/lib/PHPMailer/PHPMailerTest.php
index 4707e2a1e..8fc14b815 100644
--- a/tests/lib/PHPMailer/PHPMailerTest.php
+++ b/tests/lib/PHPMailer/PHPMailerTest.php
@@ -1,7 +1,7 @@
<?php
-class PHPMailerTest extends PHPUnit\Framework\TestCase {
-
+class PHPMailerTest extends PHPUnit\Framework\TestCase
+{
public function testPHPMailerClassExists() {
$this->assertTrue(class_exists('PHPMailer\\PHPMailer\\PHPMailer'));
}