Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert to full Symfony framework #35

Merged
merged 36 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
79ca1d1
feat: switch to symfony/skeleton 7.2
chuckadams Nov 30, 2024
c7d6134
chore: move old composer.json to attic
chuckadams Nov 30, 2024
50b83c0
chore: move AspirePress\AspireSync -> App
chuckadams Nov 30, 2024
41ecc83
chore: add all old deps except phpcs
chuckadams Nov 30, 2024
d8c1522
wip: wire up dependencies enough to not error out
chuckadams Nov 30, 2024
7310b1c
fix: wire up flysystem and guzzle properly
chuckadams Nov 30, 2024
3dadfc2
fix: disable psr-3 logging in ErrorWritingTrait (it's not compatible)
chuckadams Nov 30, 2024
5e7526c
fix: add missing symfony/process dep
chuckadams Nov 30, 2024
360e892
fix: bump memory limit to 4G
chuckadams Nov 30, 2024
30ff959
feat: add symfony/monolog-bundle
chuckadams Nov 30, 2024
7903a66
refactor: rm styled output which is redundant with monolog
chuckadams Nov 30, 2024
3ed264e
refactor: rm more unused services
chuckadams Nov 30, 2024
646e148
chore: rm more cruft
chuckadams Nov 30, 2024
2351bd5
fix: add missing endpoint to S3Client service
chuckadams Nov 30, 2024
10b30ae
ci: don't copy .env.dist, that's not a thing anymore
chuckadams Nov 30, 2024
a6e0efb
docs: update README for bin/console
chuckadams Nov 30, 2024
f7ab585
chore: sweep composer.json out of attic
chuckadams Nov 30, 2024
338ad4d
refactor: rename commands to all use sync: prefix
chuckadams Nov 30, 2024
0f18ca5
chore: rm bin/aspiresync
chuckadams Nov 30, 2024
294d92d
fix: use logger in commands
chuckadams Nov 30, 2024
5dc36f5
tmp: change dirname for case-insensitive rename
chuckadams Nov 30, 2024
acda61c
tmp: more gitwtf
chuckadams Nov 30, 2024
e4d9b84
tmp: rename back for proper case
chuckadams Nov 30, 2024
42ca499
fix: uppercase names for test suite
chuckadams Nov 30, 2024
8000805
feat: add symfony/maker-bundle
chuckadams Nov 30, 2024
53873f1
feat: add symfony/uid
chuckadams Nov 30, 2024
b662a18
feat: add SyncAsset and SyncResource entities
chuckadams Dec 1, 2024
a4deb43
chore: add doctrine-migrations-bindle
chuckadams Dec 1, 2024
d5af27a
chore: give names to indexes
chuckadams Dec 1, 2024
b13689d
feat: add migration
chuckadams Dec 1, 2024
83d9cf9
feat: new docker-compose stack
chuckadams Dec 1, 2024
208eb80
fix: use timestamp(0) instead of datetime (really, postgres?)
chuckadams Dec 1, 2024
251133e
chore: switch to postgres backend
chuckadams Dec 1, 2024
f6b4fbd
fix: use full hostname on aspirenet so container names don't collide
chuckadams Dec 1, 2024
4bb0b97
fix: appease phpstan
chuckadams Dec 1, 2024
ed02f83
chore: sweep out the attic
chuckadams Dec 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

# Copy these directories
!bin/
!config/
!.ATTIC/config/
!src

# Copy these files
!.env
!README.md
!composer.json
!.ATTIC/composer.json
!composer.lock
!docker/php.ini
!docker/webapp/php.ini
!docker/webapp/Caddyfile
46 changes: 46 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

########## AspireSync Config

# TODO: ditch log config in here and use symfony config
# Log level may be one of: emergency | alert | critical | error | warning | notice | info | debug
# LOG_FILE=/tmp/aspiresync.log
#LOG_FILE=/dev/null
#LOG_LEVEL=debug

DOWNLOADS_FILESYSTEM=local
#DOWNLOADS_DIR=/path/to/downloads/dir

#DOWNLOADS_FILESYSTEM=s3
#S3_BUCKET=
#S3_KEY=
#S3_SECRET=
#S3_REGION=
#S3_ENDPOINT=

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
DATABASE_URL="postgresql://postgres:[email protected]:5432/aspiresync?serverVersion=16&charset=utf8"
# DATABASE_URL="sqlite:///%kernel.project_dir%/aspiresync.sqlite"
###< doctrine/doctrine-bundle ###
14 changes: 0 additions & 14 deletions .env.dist

This file was deleted.

6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
1 change: 0 additions & 1 deletion .github/workflows/run-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:

- name: Build Dependencies
run: |
cp .env.dist .env
composer install
# not running phpcs right now, it's going to be replaced by php-cs-fixer soon
Expand Down
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
/data/
vendor/
.env
.phpcs-cache
*.sqlite
*.sqlite-journal

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AspireSync is designed to enumerate and download the plugins and themes stored i

```shell
make
bin/aspiresync list
bin/console list sync
```

## Configuration
Expand Down
47 changes: 0 additions & 47 deletions bin/aspiresync

This file was deleted.

21 changes: 21 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

if (!is_dir(dirname(__DIR__) . '/vendor')) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

if (!is_file(dirname(__DIR__) . '/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';

return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
151 changes: 92 additions & 59 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,95 @@
{
"require": {
"php": "^8.3",
"ext-pdo": "*",
"ext-simplexml": "*",
"ext-sqlite3": "*",
"doctrine/dbal": "^4.2",
"guzzlehttp/guzzle": "^7.9.2",
"laminas/laminas-coding-standard": "^2.5",
"league/flysystem": "^3.29.1",
"league/flysystem-aws-s3-v3": "^3.29",
"ramsey/uuid": "^4.7.6",
"saloonphp/rate-limit-plugin": "^2.0",
"saloonphp/saloon": "^3.10",
"symfony/config": "^7.1.7",
"symfony/console": "^7.1.7",
"symfony/dependency-injection": "^7.1.6",
"symfony/dotenv": "^7.1.6",
"symfony/expression-language": "^7.1.6",
"symfony/finder": "^7.1",
"symfony/process": "^7.1.7",
"symfony/var-dumper": "^7.1.7",
"thecodingmachine/safe": "^2.5"
},
"require-dev": {
"phpstan/phpstan": "^1.12.6",
"phpunit/phpunit": "^11.4.1",
"roave/security-advisories": "dev-latest",
"thecodingmachine/phpstan-safe-rule": "^1.2"
},
"autoload": {
"psr-4": {
"AspirePress\\AspireSync\\": "./src"
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.3",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": ">=2.13.1",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": ">=3.3",
"guzzlehttp/guzzle": ">=7.9.2",
"league/flysystem": ">=3.29.1",
"league/flysystem-aws-s3-v3": ">=3.29",
"league/flysystem-bundle": ">=3.3.5",
"ramsey/uuid": ">=4.7.6",
"saloonphp/rate-limit-plugin": ">=2",
"saloonphp/saloon": ">=3.10",
"symfony/console": "7.2.*",
"symfony/dotenv": "7.2.*",
"symfony/expression-language": "7.2.*",
"symfony/flex": "^2.4.7",
"symfony/framework-bundle": "7.2.*",
"symfony/monolog-bundle": "^3.10",
"symfony/process": "7.2.*",
"symfony/runtime": "7.2.*",
"symfony/uid": "7.2.*",
"symfony/yaml": "7.2.*",
"thecodingmachine/safe": ">=2.5"
},
"require-dev": {
"phpstan/phpstan": ">=1.12.12",
"phpunit/phpunit": ">=11.4.4",
"roave/security-advisories": "dev-latest",
"symfony/maker-bundle": "^1.61",
"thecodingmachine/phpstan-safe-rule": ">=1.2"
},
"config": {
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
},
"bump-after-update": true,
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"symfony/polyfill-php80": "*",
"symfony/polyfill-php81": "*",
"symfony/polyfill-php82": "*"
},
"scripts": {
"phpstan": "phpstan --verbose --memory-limit=2G",
"phpunit": "phpunit",
"test": "@phpunit",
"test:unit": "@phpunit --testsuite=Unit",
"test:functional": "@phpunit --testsuite=functional",
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": true,
"require": "7.2.*",
"docker": true
}
}
},
"autoload-dev": {
"psr-4": {
"AspirePress\\AspireSync\\Tests\\Unit\\": "./tests/unit",
"AspirePress\\AspireSync\\Tests\\Functional\\": "./tests/functional",
"AspirePress\\AspireSync\\Tests\\Stubs\\": "./tests/stubs"
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"phpstan": "phpstan --verbose --memory-limit=2G",
"phpunit": "phpunit",
"phpcs": "phpcs --parallel=4",
"phpcbf": "phpcbf --parallel=4",
"test": "@phpunit",
"test:unit": "@phpunit --testsuite=unit",
"test:functional": "@phpunit --testsuite=functional",
"style:check": "@phpcs",
"style:fix": "@phpcbf"
}
}
Loading