Skip to content

Commit c3f8726

Browse files
authored
Remove obsolete package (#23)
SimpleLogger has been abandoned for a while, and was apparently deleted at Github. This removes the dependency to prevent downstream breakage.
1 parent c087798 commit c3f8726

File tree

5 files changed

+12
-23
lines changed

5 files changed

+12
-23
lines changed

bin/generate_endpoint

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
<?php
33
declare(strict_types=1);
44

5-
use SimpleLogger\Stderr;
6-
75
$config = require 'load_config.php';
86

97
if ($argc < 2) {
10-
(new Stderr())->error('File name is required');
8+
fwrite(STDERR, 'File name is required');
119
exit(1);
1210
}
1311

bin/generate_endpoint_list

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
<?php
33
declare(strict_types=1);
44

5-
use SimpleLogger\Stdout;
6-
75
$config = require 'load_config.php';
8-
$logger = new Stdout();
96

107
// Build out the endpoint map
118
(new Firehed\Common\ClassMapGenerator())
@@ -17,7 +14,8 @@ $logger = new Stdout();
1714
->setOutputFile(getcwd().'/__endpoint_list__.json')
1815
->generate();
1916

20-
$logger->info(
17+
fwrite(
18+
STDOUT,
2119
'Wrote endpoint map to __endpoint_list__.json. Be sure to commit this ' .
2220
'file to version control.'
2321
);

bin/generate_front_controller

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
<?php
33
declare(strict_types=1);
44

5-
use SimpleLogger\Stdout;
6-
75
$config = require 'load_config.php';
8-
$logger = new Stdout();
96

107
// Returns a series of '/..'s to get from the directory of the webroot to that
118
// of the project root
@@ -75,8 +72,8 @@ $fc = sprintf(
7572

7673
$dir = $config['local_project_root'].'/'.$config['webroot'];
7774
if (!file_exists($dir)) {
78-
$logger->info("Making '$dir' with 0755 permissions");
75+
fwrite(STDOUT, "Making '$dir' with 0755 permissions");
7976
mkdir($dir, 0755, true);
8077
}
8178
file_put_contents($dir.'/index.php', $fc);
82-
$logger->info("Wrote front controller to $dir/index.php");
79+
fwrite(STDOUT, "Wrote front controller to $dir/index.php");

bin/load_config.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
declare(strict_types=1);
33

44
use Psr\Container\ContainerInterface;
5-
use SimpleLogger\Stderr;
65

76
$root = __DIR__;
87
while (!file_exists($root.'/vendor/autoload.php') && $root != DIRECTORY_SEPARATOR) {
@@ -11,20 +10,18 @@
1110

1211
require $root.'/vendor/autoload.php';
1312

14-
$stderr = new Stderr();
15-
1613
$file = '/.apiconfig';
1714
$config_file = $root.$file;
1815

1916
if (!file_exists($config_file) || !is_readable($config_file)) {
20-
$stderr->error(".apiconfig file not found");
17+
fwrite(STDERR, ".apiconfig file not found");
2118
exit(1);
2219
}
2320

2421
$config = json_decode(file_get_contents($config_file), true);
2522

2623
if (JSON_ERROR_NONE !== json_last_error()) {
27-
$stderr->error(".apiconfig contains invalid JSON");
24+
fwrite(STDERR, ".apiconfig contains invalid JSON");
2825
exit(1);
2926
}
3027

@@ -46,7 +43,7 @@
4643
$keysInConfig = array_keys($config);
4744

4845
if ($diff = array_diff($keysInConfig, $allKeys)) {
49-
$stderr->error(sprintf(
46+
fwrite(STDERR, sprintf(
5047
'Found unexpected config keys in .apiconfig: %s',
5148
implode(', ', $diff)
5249
));
@@ -55,15 +52,15 @@
5552

5653
foreach ($required_keys as $required_key) {
5754
if (!array_key_exists($required_key, $config)) {
58-
$stderr->error(".apiconfig is missing value for '$required_key'");
55+
fwrite(STDERR, ".apiconfig is missing value for '$required_key'");
5956
exit(1);
6057
}
6158
}
6259

6360
if (array_key_exists('container', $config)) {
6461
$file = $config['container'];
6562
if (!file_exists($file)) {
66-
$stderr->error(".apiconfig[container] must point to a file returning a PSR-11 container");
63+
fwrite(STDERR, ".apiconfig[container] must point to a file returning a PSR-11 container");
6764
exit(1);
6865
}
6966

@@ -75,7 +72,7 @@
7572
try {
7673
$container = $load($config['container']);
7774
} catch (TypeError $e) {
78-
$stderr->error(".apiconfig[container] must point to a file returning a PSR-11 container");
75+
fwrite(STDERR, ".apiconfig[container] must point to a file returning a PSR-11 container");
7976
exit(1);
8077
}
8178
}

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"php": ">=7",
88
"zendframework/zend-diactoros": "^1.3",
99
"psr/container": "^1.0",
10-
"psr/log": "^1.0",
11-
"fguillot/simpleLogger": "^1.0"
10+
"psr/log": "^1.0"
1211
},
1312
"suggest": {
1413
"firehed/inputobjects": "Pre-made Input components for validation"

0 commit comments

Comments
 (0)