Skip to content

Commit e79b538

Browse files
authored
Merge pull request #14 from factorio-item-browser/project-phoenix
2 parents afeab12 + 9541a4b commit e79b538

File tree

385 files changed

+17819
-27016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+17819
-27016
lines changed

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
/.idea
22
/data/*
3-
/test/log
3+
/test/coverage
44
/vendor
55

6+
/config/autoload/development/factorio-mod-portal-client.local.php
67
/.phpunit.result.cache
7-
8-
/factorio/*
9-
!/factorio/mods
10-
/factorio/mods/*
11-
!/factorio/mods/Dump_1.0.0
12-
/factorio/mods/Dump_1.0.0/info.json

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ language: php
33
matrix:
44
fast_finish: true
55
include:
6-
- php: 7.2
7-
- php: 7.3
6+
- php: '7.3'
7+
- php: '7.4'
88

99
cache:
1010
directories:
@@ -15,7 +15,8 @@ install:
1515

1616
script:
1717
- composer validate --strict
18-
- vendor/bin/phpunit --coverage-clover=coverage.xml
18+
- vendor/bin/phpunit --testsuite=unit-test --coverage-clover=coverage.xml
19+
- vendor/bin/phpunit --testsuite=serializer-test
1920
- vendor/bin/coverage-check coverage.xml 100
2021
- vendor/bin/phpcs -np --colors
2122
- vendor/bin/phpstan analyse --no-interaction

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Unreleased
3+
## 2.0.0 - 2020-04-15
44

55
- Full re-implementation of the export project.
66

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
.PHONY: help bash install test update
1+
.PHONY: help bash fix install test update
22

33
help: ## Show this help.
44
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
55

66
bash: ## Run the docker container and connect to it using bash.
77
docker-compose run php bash
88

9+
build-cache: ## Cleans and re-nuilds the cache.
10+
docker-compose run php composer build-cache
11+
12+
fix: ## Fixes codestyle issues.
13+
docker-compose run php composer phpcbf
14+
915
install: ## Installs the dependencies of the project without updating any of them.
1016
docker-compose run php install
1117

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Factorio Item Browser - Export
22

3-
[![Latest Stable Version](https://poser.pugx.org/factorio-item-browser/export/v/stable)](https://packagist.org/packages/factorio-item-browser/export) [![License](https://poser.pugx.org/factorio-item-browser/export/license)](https://packagist.org/packages/factorio-item-browser/export) [![Build Status](https://travis-ci.org/factorio-item-browser/export.svg?branch=master)](https://travis-ci.org/factorio-item-browser/export) [![codecov](https://codecov.io/gh/factorio-item-browser/export/branch/master/graph/badge.svg)](https://codecov.io/gh/factorio-item-browser/export)
3+
[![Latest Stable Version](https://poser.pugx.org/factorio-item-browser/export/v/stable)](https://packagist.org/packages/factorio-item-browser/export)
4+
[![License](https://poser.pugx.org/factorio-item-browser/export/license)](https://packagist.org/packages/factorio-item-browser/export)
5+
[![Build Status](https://travis-ci.com/factorio-item-browser/export.svg?branch=master)](https://travis-ci.com/factorio-item-browser/export)
6+
[![codecov](https://codecov.io/gh/factorio-item-browser/export/branch/master/graph/badge.svg)](https://codecov.io/gh/factorio-item-browser/export)
47

58
This project is the exporting part of the Factorio Item Browser, generating all the needed data to be imported into the
69
database.

bin/build-cache.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
declare(strict_types=1);
5+
6+
/**
7+
* The script for building up the config caches.
8+
*
9+
* @author BluePsyduck <[email protected]>
10+
* @license http://opensource.org/licenses/GPL-3.0 GPL v3
11+
*/
12+
13+
namespace FactorioItemBrowser\Api\Server;
14+
15+
use Psr\Container\ContainerInterface;
16+
17+
chdir(dirname(__DIR__));
18+
require(__DIR__ . '/../vendor/autoload.php');
19+
20+
(function () {
21+
/* @var ContainerInterface $container */
22+
$container = require(__DIR__ . '/../config/container.php');
23+
$config = $container->get('config');
24+
25+
foreach (array_keys($config['dependencies']['factories'] ?? []) as $alias) {
26+
$container->get($alias);
27+
}
28+
})();

bin/cli.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
*/
1212

1313
use Psr\Container\ContainerInterface;
14-
use Zend\Console\Console;
15-
use ZF\Console\Application;
16-
use ZF\Console\Dispatcher;
14+
use Symfony\Component\Console\Application;
15+
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
1716

1817
chdir(dirname(__DIR__));
1918
require(__DIR__ . '/../vendor/autoload.php');
@@ -22,18 +21,10 @@
2221
/* @var ContainerInterface $container */
2322
$container = require(__DIR__ . '/../config/container.php');
2423
$config = $container->get('config');
25-
$dispatcher = new Dispatcher($container);
2624

27-
$application = new Application(
28-
$config['name'],
29-
$config['version'],
30-
$config['routes'],
31-
Console::getInstance(),
32-
$dispatcher
33-
);
34-
35-
$application->setBannerDisabledForUserCommands(isset($_ENV['SUBCMD']));
25+
$application = new Application($config['name'], $config['version']);
26+
$application->setCommandLoader(new ContainerCommandLoader($container, $config['commands']));
3627

3728
$exit = $application->run();
3829
exit ($exit);
39-
})();
30+
})();

composer.json

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,38 @@
1313
],
1414
"minimum-stability": "stable",
1515
"require": {
16-
"php": "^7.2",
16+
"php": "^7.3",
17+
"ext-ftp": "*",
1718
"ext-gd": "*",
1819
"ext-json": "*",
1920
"ext-PDO": "*",
2021
"ext-zip": "*",
21-
"bluepsyduck/common": "^1.0",
22+
"bluepsyduck/factorio-mod-portal-client": "^1.2",
2223
"bluepsyduck/symfony-process-manager": "^1.0",
24+
"bluepsyduck/laminas-autowire-factory": "^1.0",
25+
"doctrine/cache": "^1.8",
2326
"factorio-item-browser/common": "^1.2",
24-
"factorio-item-browser/export-data": "^2.1",
27+
"factorio-item-browser/export-data": "^3.0",
28+
"factorio-item-browser/export-queue-client": "^1.1",
2529
"imagine/imagine": "^1.2",
26-
"symfony/process": "^4.1",
27-
"zendframework/zend-config-aggregator": "^1.0",
28-
"zendframework/zend-i18n": "^2.7",
29-
"zendframework/zend-progressbar": "^2.6",
30-
"zendframework/zend-servicemanager": "^3.3",
31-
"zfcampus/zf-console": "^1.3"
30+
"laminas/laminas-config-aggregator": "^1.0",
31+
"laminas/laminas-i18n": "^2.7",
32+
"laminas/laminas-servicemanager": "^3.3",
33+
"laminas/laminas-stdlib": "^3.2",
34+
"nicolab/php-ftp-client": "^1.5",
35+
"ramsey/uuid": "^3.8",
36+
"symfony/console": "^5.0",
37+
"symfony/filesystem": "^5.0",
38+
"symfony/process": "^5.0"
3239
},
3340
"require-dev": {
41+
"bluepsyduck/test-helper": "^1.0",
3442
"mikey179/vfsstream": "^1.6",
35-
"phpstan/phpstan": "^0.11",
36-
"phpstan/phpstan-phpunit": "^0.11",
37-
"phpstan/phpstan-strict-rules": "^0.11",
43+
"phpstan/phpstan": "^0.12",
44+
"phpstan/phpstan-phpunit": "^0.12",
45+
"phpstan/phpstan-strict-rules": "^0.12",
3846
"phpunit/phpunit": "^8.0",
39-
"rregeer/phpunit-coverage-check": "^0.1",
47+
"rregeer/phpunit-coverage-check": "^0.3",
4048
"squizlabs/php_codesniffer": "^3.3"
4149
},
4250
"autoload": {
@@ -46,24 +54,32 @@
4654
},
4755
"autoload-dev": {
4856
"psr-4": {
49-
"FactorioItemBrowserTest\\Export\\": "test/src"
57+
"FactorioItemBrowserTest\\Export\\": "test/src",
58+
"FactorioItemBrowserTestAsset\\Export\\": "test/asset",
59+
"FactorioItemBrowserTestSerializer\\Export\\": "test/serializer"
5060
}
5161
},
5262
"scripts": {
53-
"coverage-check": "coverage-check test/log/clover.xml 100",
63+
"build-cache": [
64+
"rm -rf data/cache/*",
65+
"bin/build-cache.php",
66+
"chown -R www-data:www-data data/cache/*"
67+
],
68+
"coverage-check": "coverage-check test/coverage/clover.xml 100",
5469
"install-factorio": "bin/install-factorio.sh",
5570
"phpcbf": "phpcbf -p --colors",
5671
"phpcs": "phpcs -p --colors",
5772
"phpstan": "phpstan analyse --no-interaction --ansi",
58-
"phpunit": "phpunit --colors=always --coverage-html=test/log --coverage-clover=test/log/clover.xml",
73+
"test-unit": "phpunit --testsuite unit-test --colors=always --coverage-html=test/coverage --coverage-clover=test/coverage/clover.xml",
74+
"test-serialize": "phpunit --testsuite serializer-test --colors=always",
5975
"post-autoload-dump": [
60-
"mkdir -p data/cache data/export factorio/instances",
61-
"chmod 0777 data/cache data/export factorio/instances factorio/mods/Dump_1.0.0"
76+
"mkdir -p data/cache data/mods data/temp data/instances",
77+
"chmod 0777 data/cache data/mods data/temp data/instances"
6278
],
63-
"run": "@php bin/cli.php",
6479
"test": [
6580
"@composer validate --strict",
66-
"@phpunit",
81+
"@test-unit",
82+
"@test-serialize",
6783
"@coverage-check",
6884
"@phpcs",
6985
"@phpstan"

0 commit comments

Comments
 (0)