Browse Source

Added Composer file and re-arranged dependent libs

microsub
J. King 7 years ago
parent
commit
9491d082ed
  1. 7
      .gitignore
  2. 10
      bootstrap.php
  3. 35
      composer.json
  4. 2
      tests/TestLang.php
  5. 9
      tests/bootstrap.php

7
.gitignore

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

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

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

2
tests/TestLang.php

@ -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' => '',

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

Loading…
Cancel
Save