Skip to content

Commit 65a837e

Browse files
authored
Merge pull request #3 from LinkNexus/master
Master
2 parents 2d21ade + f889dd9 commit 65a837e

21 files changed

+139
-2
lines changed

.htaccess

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine On
3+
4+
# Redirect all requests to the public/ directory
5+
RewriteCond %{REQUEST_URI} !^/public/
6+
RewriteRule ^(.*)$ /public/$1 [L]
7+
8+
# Handle the front controller
9+
RewriteCond %{REQUEST_FILENAME} !-f
10+
RewriteCond %{REQUEST_FILENAME} !-d
11+
RewriteRule ^ /public/index.php [L]
12+
</IfModule>

.idea/php.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/symfony-blog.iml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"leapt/froala-editor-bundle": "^1.7",
1818
"phpdocumentor/reflection-docblock": "^5.4",
1919
"phpstan/phpdoc-parser": "^1.29",
20+
"symfony/apache-pack": "^1.0",
2021
"symfony/asset": "7.1.*",
2122
"symfony/console": "7.1.*",
2223
"symfony/doctrine-messenger": "7.1.*",

composer.lock

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/.htaccess

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Use the front controller as index file. It serves as a fallback solution when
2+
# every other rewrite/redirect fails (e.g. in an aliased environment without
3+
# mod_rewrite). Additionally, this reduces the matching process for the
4+
# start page (path "/") because otherwise Apache will apply the rewriting rules
5+
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
6+
DirectoryIndex index.php
7+
8+
# By default, Apache does not evaluate symbolic links if you did not enable this
9+
# feature in your server configuration. Uncomment the following line if you
10+
# install assets as symlinks or if you experience problems related to symlinks
11+
# when compiling LESS/Sass/CoffeScript assets.
12+
# Options +SymLinksIfOwnerMatch
13+
14+
# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
15+
# to the front controller "/index.php" but be rewritten to "/index.php/index".
16+
<IfModule mod_negotiation.c>
17+
Options -MultiViews
18+
</IfModule>
19+
20+
<IfModule mod_rewrite.c>
21+
# This Option needs to be enabled for RewriteRule, otherwise it will show an error like
22+
# 'Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden'
23+
Options +SymLinksIfOwnerMatch
24+
25+
RewriteEngine On
26+
27+
# Determine the RewriteBase automatically and set it as environment variable.
28+
# If you are using Apache aliases to do mass virtual hosting or installed the
29+
# project in a subdirectory, the base path will be prepended to allow proper
30+
# resolution of the index.php file and to redirect to the correct URI. It will
31+
# work in environments without path prefix as well, providing a safe, one-size
32+
# fits all solution. But as you do not need it in this case, you can comment
33+
# the following 2 lines to eliminate the overhead.
34+
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
35+
RewriteRule .* - [E=BASE:%1]
36+
37+
# Sets the HTTP_AUTHORIZATION header removed by Apache
38+
RewriteCond %{HTTP:Authorization} .+
39+
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]
40+
41+
# Redirect to URI without front controller to prevent duplicate content
42+
# (with and without `/index.php`). Only do this redirect on the initial
43+
# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
44+
# endless redirect loop (request -> rewrite to front controller ->
45+
# redirect -> request -> ...).
46+
# So in case you get a "too many redirects" error or you always get redirected
47+
# to the start page because your Apache does not expose the REDIRECT_STATUS
48+
# environment variable, you have 2 choices:
49+
# - disable this feature by commenting the following 2 lines or
50+
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
51+
# following RewriteCond (best solution)
52+
RewriteCond %{ENV:REDIRECT_STATUS} =""
53+
RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
54+
55+
# If the requested filename exists, simply serve it.
56+
# We only want to let Apache serve files and not directories.
57+
# Rewrite all other queries to the front controller.
58+
RewriteCond %{REQUEST_FILENAME} !-f
59+
RewriteRule ^ %{ENV:BASE}/index.php [L]
60+
</IfModule>
61+
62+
<IfModule !mod_rewrite.c>
63+
<IfModule mod_alias.c>
64+
# When mod_rewrite is not available, we instruct a temporary redirect of
65+
# the start page to the front controller explicitly so that the website
66+
# and the generated links can still be used.
67+
RedirectMatch 307 ^/$ /index.php/
68+
# RedirectTemp cannot be used instead
69+
</IfModule>
70+
</IfModule>

src/Entity/Block.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77

88
#[ORM\Entity(repositoryClass: BlockRepository::class)]
9+
#[ORM\Table(name: 'blog_blocks')]
910
class Block
1011
{
1112
#[ORM\Id]

src/Entity/Category.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Doctrine\ORM\Mapping as ORM;
1010

1111
#[ORM\Entity(repositoryClass: CategoryRepository::class)]
12+
#[ORM\Table(name: 'blog_categories')]
1213
class Category
1314
{
1415
#[ORM\Id]

src/Entity/Comment.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Doctrine\ORM\Mapping as ORM;
1010

1111
#[ORM\Entity(repositoryClass: CommentRepository::class)]
12+
#[ORM\Table(name: 'blog_comments')]
1213
class Comment implements \JsonSerializable
1314
{
1415
#[ORM\Id]

src/Entity/CommentReaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77

88
#[ORM\Entity(repositoryClass: CommentReactionRepository::class)]
9+
#[ORM\Table(name: 'blog_comments_reactions')]
910
class CommentReaction implements \JsonSerializable
1011
{
1112
#[ORM\Id]

src/Entity/HiddenComment.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77

88
#[ORM\Entity(repositoryClass: HiddenCommentRepository::class)]
9+
#[ORM\Table(name: 'blog_hidden_comments')]
910
class HiddenComment
1011
{
1112
#[ORM\Id]

src/Entity/HiddenPost.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77

88
#[ORM\Entity(repositoryClass: HiddenPostRepository::class)]
9+
#[ORM\Table(name: 'blog_hidden_posts')]
910
class HiddenPost
1011
{
1112
#[ORM\Id]

src/Entity/Post.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Doctrine\ORM\Mapping as ORM;
1010

1111
#[ORM\Entity(repositoryClass: PostRepository::class)]
12+
#[ORM\Table(name: 'blog_posts')]
1213
class Post implements \JsonSerializable
1314
{
1415
#[ORM\Id]

src/Entity/PostAudience.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Doctrine\ORM\Mapping as ORM;
99

1010
#[ORM\Entity(repositoryClass: PostAudienceRepository::class)]
11+
#[ORM\Table(name: 'blog_posts_audiences')]
1112
class PostAudience
1213
{
1314
#[ORM\Id]

src/Entity/PostModification.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\ORM\Mapping as ORM;
88

99
#[ORM\Entity(repositoryClass: PostModificationRepository::class)]
10+
#[ORM\Table(name: 'blog_posts_modifications')]
1011
class PostModification
1112
{
1213
#[ORM\Id]

src/Entity/PostReaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77

88
#[ORM\Entity(repositoryClass: PostReactionRepository::class)]
9+
#[ORM\Table(name: 'blog_posts_reactions')]
910
class PostReaction
1011
{
1112
#[ORM\Id]

src/Entity/ResetPasswordRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use SymfonyCasts\Bundle\ResetPassword\Model\ResetPasswordRequestTrait;
99

1010
#[ORM\Entity(repositoryClass: ResetPasswordRequestRepository::class)]
11+
#[ORM\Table(name: 'blog_reset_password_requests')]
1112
class ResetPasswordRequest implements ResetPasswordRequestInterface
1213
{
1314
use ResetPasswordRequestTrait;

src/Entity/Snooze.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Doctrine\ORM\Mapping as ORM;
77

88
#[ORM\Entity(repositoryClass: SnoozeRepository::class)]
9+
#[ORM\Table(name: 'blog_snoozes')]
910
class Snooze
1011
{
1112
#[ORM\Id]

src/Entity/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Symfony\Component\Validator\Constraints as Assert;
1313

1414
#[ORM\Entity(repositoryClass: UserRepository::class)]
15-
#[ORM\Table(name: '`user`')]
15+
#[ORM\Table(name: 'blog_users')]
1616
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_USERNAME', fields: ['username'])]
1717
#[UniqueEntity(fields: ['username'], message: 'There is already an account with this username')]
1818
#[UniqueEntity('email', message: 'There is already an account with this email')]

src/Entity/Warning.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\ORM\Mapping as ORM;
88

99
#[ORM\Entity(repositoryClass: WarningRepository::class)]
10+
#[ORM\Table(name: 'blog_warnings')]
1011
class Warning
1112
{
1213
#[ORM\Id]

symfony.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@
6565
"./tests/bootstrap.php"
6666
]
6767
},
68+
"symfony/apache-pack": {
69+
"version": "1.0",
70+
"recipe": {
71+
"repo": "github.com/symfony/recipes-contrib",
72+
"branch": "main",
73+
"version": "1.0",
74+
"ref": "0f18b4decdf5695d692c1d0dfd65516a07a6adf1"
75+
},
76+
"files": [
77+
"./public/.htaccess"
78+
]
79+
},
6880
"symfony/console": {
6981
"version": "7.1",
7082
"recipe": {

0 commit comments

Comments
 (0)