mirror of https://github.com/FreshRSS/FreshRSS.git
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>
This commit is contained in:
parent
ffd1061850
commit
d6fd78b968
|
@ -1,4 +1,4 @@
|
|||
lib/CssXPath/
|
||||
lib/phpgt/
|
||||
lib/phpmailer/
|
||||
node_modules/
|
||||
p/scripts/vendor/
|
||||
|
|
|
@ -29,7 +29,7 @@ extend-exclude = [
|
|||
"bin/",
|
||||
"data/",
|
||||
"docs/fr/",
|
||||
"lib/CssXPath/",
|
||||
"lib/phpgt/",
|
||||
"lib/phpmailer/",
|
||||
"lib/SimplePie/",
|
||||
"node_modules/",
|
||||
|
|
|
@ -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.*
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
<?php
|
||||
namespace Gt\CssXPath;
|
||||
|
||||
class NotYetImplementedException extends CssXPathException {}
|
|
@ -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": {
|
||||
|
|
|
@ -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/';
|
||||
|
|
|
@ -3,4 +3,4 @@ namespace Gt\CssXPath;
|
|||
|
||||
use RuntimeException;
|
||||
|
||||
class CssXPathException extends RuntimeException {}
|
||||
class CssXPathException extends RuntimeException {}
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
namespace Gt\CssXPath;
|
||||
|
||||
class NotYetImplementedException extends CssXPathException {}
|
|
@ -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>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
class CssXPathTest extends PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testCssXPathTranslatorClassExists() {
|
||||
$this->assertTrue(class_exists('Gt\\CssXPath\\Translator'));
|
||||
}
|
||||
}
|
|
@ -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'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue