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

[WIP] symfony port #68

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
94344ba
fix: scrape laravel off, saving some pieces in .ATTIC
chuckadams Oct 23, 2024
f9e0a9b
feat: minimal symfony install
chuckadams Oct 23, 2024
1b223b5
feat: install doctrine/doctrine-bundle
chuckadams Oct 23, 2024
eb17f09
fix: install and configure doctrine/orm
chuckadams Oct 23, 2024
f8a673c
feat: add doctrine/doctrine-migrations-bundle
chuckadams Oct 23, 2024
5c801d1
feat: add symfony/maker-bundle
chuckadams Oct 23, 2024
6a7c652
feat: SyncPlugin and SyncPluginFile entities and migrations
chuckadams Oct 24, 2024
476fcff
temp: add some migrations to attic
chuckadams Oct 24, 2024
b97d658
feat: add sync_stats migration
chuckadams Oct 24, 2024
952e743
chore: add remaining sync tables
chuckadams Oct 24, 2024
d98dea5
chore: add sync_revisions table
chuckadams Oct 24, 2024
d0f4788
chore: add some indexes to sync tables
chuckadams Oct 24, 2024
4f61574
fix: add Table attribute to SyncPluginFile
chuckadams Oct 24, 2024
1d71c4b
fix: make hash column nullable
chuckadams Oct 24, 2024
f7b867f
feat: add request_data table
chuckadams Oct 24, 2024
89e1b90
feat: add full plugins and themes tables
chuckadams Oct 24, 2024
c279910
feat: add SecretKeyController
chuckadams Oct 24, 2024
d0f2aed
feat: port PassThroughController
chuckadams Oct 24, 2024
9b95a65
wip: partial port of ThemeController
chuckadams Oct 24, 2024
0919dab
fix: enableall theme endpoints (still stubs)
chuckadams Oct 24, 2024
d4b4aec
wip: sweep out the attic some
chuckadams Oct 24, 2024
7053967
feat: add create-entity Make target
chuckadams Oct 24, 2024
03d5290
chore: add Plugin entity class/repo
chuckadams Oct 24, 2024
dbf8ea1
chore: add SyncTheme and SyncThemeFile entities/repos
chuckadams Oct 24, 2024
55c2c23
wip: checking in progress as-is
chuckadams Oct 24, 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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

DB_HOST=postgres
DB_PORT=5432
DB_DATABASE=ac2
DB_USERNAME=postgres
DB_PASSWORD=password

# root credentials used for initial db creation, not used at runtime.
# production should never contain these values.
DB_ROOT_USERNAME=postgres
DB_ROOT_PASSWORD=password

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

###> doctrine/doctrine-bundle ###
# Format described at 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:password@postgres:5432/ac2?serverVersion=16&charset=utf8"
###< doctrine/doctrine-bundle ###
33 changes: 10 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
/public/storage
/storage/*.key
/storage/pail
/vendor
.env
.env.backup
.env.production
.phpactor.json
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.cache
/.fleet
/.idea
/.vscode
/.zed

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###
34 changes: 11 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ ifneq (,$(wildcard ./.env))
export
endif

CONSOLE = bin/dcrun bin/console

list:
@grep -E '^[a-zA-Z%_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | perl -ne '/^(?:.*?:)?(.*?):.*##(.*$$)/ and printf "\033[36m%-30s\033[0m %s\n", $$1, $$2'

init: check-env dirs down clean build network up install-composer reset-database generate-key ## Initial configuration tasks
init: check-env dirs down clean build network up install-composer reset-database ## Initial configuration tasks

dirs:
mkdir -p .cache
Expand Down Expand Up @@ -72,7 +74,7 @@ sh-%: ## Execute shell for the container where % is a service name (webapp, post
docker compose exec $* sh || docker compose run --rm $* sh

clear-cache: ## Clear cache
bin/dcrun php artisan optimize:clear
$(CONSOLE) cache:clear

lint: style quality ## Check code standards conformance

Expand All @@ -86,39 +88,25 @@ style: ## Run code style checks
fix-style: ## Run code style fixes
bin/dcrun vendor/bin/php-cs-fixer fix

create-migration: ## Create a new database migration
bin/dcrun php artisan make:migration
create-entity: ## Create a new Doctrine entity
$(CONSOLE) make:entity --with-uuid

create-seed: ## Create a new database seed
bin/dcrun php artisan make:seed
create-migration: ## Create a new database migration
$(CONSOLE) make:migration --formatted

migrate: ## Run database migrations
bin/dcrun php artisan migrate --force --no-interaction
$(CONSOLE) doctrine:migrations:migrate --no-interaction --allow-no-migration

migration-rollback: ## Rollback database migrations
bin/dcrun php artisan migrate --force --no-interaction

seed: ## Run database seeds
bin/dcrun php artisan db:seed

migrate-testing: ## Run database migrations
bin/dcrun php artisan migrate --database=test --force --no-interaction

seed-testing: ## Run database seeds
bin/dcrun php artisan db:seed --database=test

generate-key: ## Generate APP_KEY environment var
bin/dcrun php artisan key:generate
$(CONSOLE) doctrine:migrations:migrate prev --no-interaction

drop-database:
bin/dcrun sh -c "export PGPASSWORD=${DB_ROOT_PASSWORD} && psql -U ${DB_ROOT_USERNAME} -h ${DB_HOST} -c 'drop database if exists ${DB_DATABASE}'"

create-database:
bin/dcrun sh -c "export PGPASSWORD=${DB_ROOT_PASSWORD} && psql -U ${DB_ROOT_USERNAME} -h ${DB_HOST} -c 'create database ${DB_DATABASE} owner ${DB_USERNAME}'"

reset-database: drop-database create-database migrate seed ## run migrations and seeds

reset-testing-database: migrate-testing seed-testing
reset-database: drop-database create-database migrate ## recreate database

run-psql: ## Runs Postgres on the command line using the .env file variables
bin/dcrun sh -c "PGPASSWORD=${DB_PASSWORD} psql -U ${DB_USERNAME} -h ${DB_HOST} -p ${DB_PORT} -d ${DB_USERNAME}"
Expand Down
17 changes: 0 additions & 17 deletions app/Data/WpOrg/Author.php

This file was deleted.

14 changes: 0 additions & 14 deletions app/Data/WpOrg/PageInfo.php

This file was deleted.

59 changes: 0 additions & 59 deletions app/Data/WpOrg/Themes/QueryThemesRequest.php

This file was deleted.

25 changes: 0 additions & 25 deletions app/Data/WpOrg/Themes/ThemeInformationRequest.php

This file was deleted.

69 changes: 0 additions & 69 deletions app/Data/WpOrg/Themes/ThemeResponse.php

This file was deleted.

Loading
Loading