1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 13:12:41 +00:00

Added Composer file and re-arranged dependent libs

This commit is contained in:
J. King 2017-02-09 11:01:24 -05:00
parent 3a9753fd22
commit 9491d082ed
5 changed files with 41 additions and 22 deletions

7
.gitignore vendored
View file

@ -1,8 +1,7 @@
#dependencies
vendor/simplepie
vendor/JKingWeb/DrUUID
vendor/org
vendor/Webmozart
vendor
!vendor/jkingweb/newssync
composer.lock
#temp files
cache/*

View file

@ -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());

35
composer.json Normal file
View file

@ -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/"
}
}
}

View file

@ -19,11 +19,11 @@ class TestLang extends \PHPUnit\Framework\TestCase {
'en-us.php' => '<?php return ["Test.presentText" => "and the Sorcerer\'s Stone"];',
'fr.php' => '<?php return ["Test.presentText" => "à l\'école des sorciers"];',
'ja.php' => '<?php return ["Test.absentText" => "賢者の石"];',
'de.php' => '<?php return ["Test.presentText" => "und der Stein der Weisen"];',
// corrupt files
'it.php' => '<?php return 0;',
'zh.php' => '<?php return 0',
'ko.php' => 'DEAD BEEF',
// empty file
'fr-ca.php' => '',
// unreadable file
'ru.php' => '',

View file

@ -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") {