diff options
| author | 2022-05-16 12:04:43 +0200 | |
|---|---|---|
| committer | 2022-05-16 12:04:43 +0200 | |
| commit | d6fd78b96837969dc36ff852a3288fd45f8f9e61 (patch) | |
| tree | 74d5482fad307e0e62c751535298d1e7c8f1ee5b /lib/lib_rss.php | |
| parent | ffd1061850d73182d40126658a0e9dd7f28f646e (diff) | |
Allow CssXPath updates with composer (#4368)
* Install CssXPath with composer
* Fix code style in tests
* fix pathnames for tests and linting
* add irrelevant files to .gitignore
* Alphabetic order
* let composer sort the packages alphabetically
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 7 |
1 files changed, 5 insertions, 2 deletions
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/'; |
