diff --git a/.gitignore b/.gitignore index a799967..d50f0fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ #dependencies -vendor/simplepie -vendor/JKingWeb/DrUUID -vendor/org -vendor/Webmozart +vendor +!vendor/jkingweb/newssync +composer.lock #temp files cache/* diff --git a/bootstrap.php b/bootstrap.php index 850c331..c185552 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -7,15 +7,7 @@ const NS_BASE = __NAMESPACE__."\\"; if(!defined(NS_BASE."INSTALL")) define(NS_BASE."INSTALL", false); -spl_autoload_register(function ($class) { - if($class=="SimplePie") return; - $file = str_replace("\\", DIRECTORY_SEPARATOR, $class); - $file = BASE."vendor".DIRECTORY_SEPARATOR.$file.".php"; - if (file_exists($file)) { - require_once $file; - } -}); - +require_once BASE."vendor".DIRECTORY_SEPARATOR."autoload.php"; ignore_user_abort(true); $data = new RuntimeData(new Conf()); \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..92b21d3 --- /dev/null +++ b/composer.json @@ -0,0 +1,35 @@ +{ + "name": "jkingweb/arsse", + "type": "library", + "description": "TODO", + "keywords": ["rss"], + "license": "MIT", + "authors": [ + { + "name": "J. King", + "email": "jking@jkingweb.ca", + "homepage": "https://jkingweb.ca/" + }, + { + "name": "Dustin Wilson", + "email": "dustin@dustinwilson.com", + "homepage": "https://dustinwilson.com/" + } + + ], + "require": { + "php": "^7.0.0", + "simplepie/simplepie": "^1.4.3", + "jkingweb/druuid": "^3.0.0", + "phpseclib/phpseclib": "^2.0.4", + "webmozart/glob": "^4.1.0" + }, + "require-dev": { + "mikey179/vfsStream": "^1.6.4" + }, + "autoload": { + "psr-4": { + "JKingWeb\\NewsSync\\": "vendor/jkingweb/newssync/" + } + } +} \ No newline at end of file diff --git a/tests/TestLang.php b/tests/TestLang.php index be07fa8..aa9e8e6 100644 --- a/tests/TestLang.php +++ b/tests/TestLang.php @@ -19,11 +19,11 @@ class TestLang extends \PHPUnit\Framework\TestCase { 'en-us.php' => ' "and the Sorcerer\'s Stone"];', 'fr.php' => ' "à l\'école des sorciers"];', 'ja.php' => ' "賢者の石"];', + 'de.php' => ' "und der Stein der Weisen"];', // corrupt files 'it.php' => ' ' 'DEAD BEEF', - // empty file 'fr-ca.php' => '', // unreadable file 'ru.php' => '', diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d4d768c..371301c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -5,14 +5,7 @@ namespace JKingWeb\NewsSync; const BASE = __DIR__.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR; const NS_BASE = __NAMESPACE__."\\"; -spl_autoload_register(function ($class) { - if($class=="SimplePie") return; - $file = str_replace("\\", DIRECTORY_SEPARATOR, $class); - $file = BASE."vendor".DIRECTORY_SEPARATOR.$file.".php"; - if (file_exists($file)) { - require_once $file; - } -}); +require_once BASE."vendor".DIRECTORY_SEPARATOR."autoload.php"; trait TestingHelpers { function assertException(string $msg, string $prefix = "", string $type = "Exception") {