Skip to content

Commit

Permalink
Organize the project more like a conventional PHP project
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwins committed Sep 7, 2024
1 parent d241e79 commit 26e7a55
Show file tree
Hide file tree
Showing 104 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"autoload": {
"psr-4": {
"Talapoin\\" : "lib/Talapoin/"
"Talapoin\\" : "src/"
}
},
"require": {
Expand Down
4 changes: 2 additions & 2 deletions config/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
encode zstd gzip

# our root is in /srv
root * /app/site
root * /app/public

# pass everything else to php
php_fastcgi talapoin:9000 {
php_fastcgi backend:9000 {
env HTTPS on
env SERVER_PORT 443
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
hostname: talapoin
env_file: ./.env
environment:
- TS_SERVE_CONFIG=/config/talapoin.json
- TS_SERVE_CONFIG=/config/backend.json
- TS_STATE_DIR=/var/lib/tailscale
volumes:
- tailscalestate:/var/lib/tailscale
Expand All @@ -26,7 +26,7 @@ services:
- caddy_config:/config
restart: unless-stopped

talapoin:
backend:
image: jimwins/talapoin
build: ./
env_file: ./.env
Expand Down
6 changes: 3 additions & 3 deletions phinx.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
paths:
migrations: '%%PHINX_CONFIG_DIR%%/db/migrations'
seeds: '%%PHINX_CONFIG_DIR%%/db/seeds'
migrations: '%%PHINX_CONFIG_DIR%%/resources/migrations'
seeds: '%%PHINX_CONFIG_DIR%%/resources/seeds'

templates:
file: 'db/templates/migration.php'
file: 'resources/templates/migration.php'

environments:
default_migration_table: phinxlog
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<arg name="extensions" value="php"/>

<file>lib</file>
<file>site</file>
<file>public</file>
</ruleset>
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ parameters:
- Talapoin\Model
level: 5
paths:
- site
- public
- lib
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion site/index.php → public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
$container->set('view', function ($container) use ($tz) {
/* We use two loaders and chain them together. */
$db_loader = new \Talapoin\PageLoader($container->get(\Talapoin\Service\Page::class));
$file_loader = new \Twig\Loader\FilesystemLoader('../ui');
$file_loader = new \Twig\Loader\FilesystemLoader('../templates');
$loader = new \Twig\Loader\ChainLoader([ $db_loader, $file_loader]);

/* No cache for now */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 26e7a55

Please sign in to comment.