Move source code to sub folder so we can re-integrate ion

This commit is contained in:
Timothy Warren 2020-03-11 22:11:00 -04:00
parent 6718fc78e9
commit ef7c1da5f2
117 changed files with 27 additions and 14 deletions

View File

@ -4,11 +4,11 @@
"license": "MIT", "license": "MIT",
"autoload": { "autoload": {
"files": [ "files": [
"src/constants.php", "src/AnimeClient/constants.php",
"src/AnimeClient.php" "src/AnimeClient/AnimeClient.php"
], ],
"psr-4": { "psr-4": {
"Aviat\\AnimeClient\\": "src/" "Aviat\\": "src/"
} }
}, },
"autoload-dev": { "autoload-dev": {

View File

@ -18,6 +18,7 @@ namespace Aviat\AnimeClient;
use function Amp\Promise\wait; use function Amp\Promise\wait;
use Amp\Http\Client\Request;
use Amp\Http\Client\Response; use Amp\Http\Client\Response;
use Amp\Http\Client\HttpClient; use Amp\Http\Client\HttpClient;
use Amp\Http\Client\HttpClientBuilder; use Amp\Http\Client\HttpClientBuilder;
@ -180,8 +181,8 @@ function checkFolderPermissions(ConfigInterface $config): array
$publicDir = $config->get('asset_dir'); $publicDir = $config->get('asset_dir');
$pathMap = [ $pathMap = [
'app/config' => realpath(__DIR__ . '/../app/config'), 'app/config' => realpath(__DIR__ . '/../../app/config'),
'app/logs' => realpath(__DIR__ . '/../app/logs'), 'app/logs' => realpath(__DIR__ . '/../../app/logs'),
'public/images/avatars' => "{$publicDir}/images/avatars", 'public/images/avatars' => "{$publicDir}/images/avatars",
'public/images/anime' => "{$publicDir}/images/anime", 'public/images/anime' => "{$publicDir}/images/anime",
'public/images/characters' => "{$publicDir}/images/characters", 'public/images/characters' => "{$publicDir}/images/characters",
@ -229,13 +230,20 @@ function getApiClient ()
/** /**
* Simplify making a request with Http\Client * Simplify making a request with Http\Client
* *
* @param $request * @param string|Request $request
* @return Response * @return Response
* @throws \Throwable * @throws \Throwable
*/ */
function getResponse ($request): Response function getResponse ($request): Response
{ {
$client = getApiClient(); $client = getApiClient();
if (is_string($request))
{
$request = new Request($request);
}
return wait($client->request($request)); return wait($client->request($request));
} }

View File

@ -68,7 +68,7 @@ abstract class BaseCommand extends Command {
*/ */
protected function setupContainer(): Container protected function setupContainer(): Container
{ {
$APP_DIR = realpath(__DIR__ . '/../../app'); $APP_DIR = realpath(__DIR__ . '/../../../app');
$APPCONF_DIR = realpath("{$APP_DIR}/appConf/"); $APPCONF_DIR = realpath("{$APP_DIR}/appConf/");
$CONF_DIR = realpath("{$APP_DIR}/config/"); $CONF_DIR = realpath("{$APP_DIR}/config/");
$baseConfig = require $APPCONF_DIR . '/base_config.php'; $baseConfig = require $APPCONF_DIR . '/base_config.php';

View File

@ -207,7 +207,7 @@ final class Settings {
return FALSE; return FALSE;
} }
$savePath = realpath(_dir(__DIR__, '..', '..', 'app', 'config')); $savePath = realpath(_dir(__DIR__, '..', '..', '..', 'app', 'config'));
$saveFile = _dir($savePath, 'admin-override.toml'); $saveFile = _dir($savePath, 'admin-override.toml');
$saved = file_put_contents($saveFile, arrayToToml($settings)); $saved = file_put_contents($saveFile, arrayToToml($settings));

Some files were not shown because too many files have changed in this diff Show More