Skip to content

Purpose of this package #5

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

Open
mauricios opened this issue Jan 8, 2020 · 3 comments
Open

Purpose of this package #5

mauricios opened this issue Jan 8, 2020 · 3 comments

Comments

@mauricios
Copy link

I'm upgrading a Symfony 2.6 installation and found this package as a dependency. This package seems to be empty and it doesn't add any functionality. Is this package/project deprecated?. Can I safely remove it from the composer dependencies?

@florianrusch
Copy link

florianrusch commented Jan 9, 2020

@mauricios if I'm correct, it should bring you the .htaccess file into your public folder. (https://symfony.com/doc/current/setup/web_server_configuration.html#adding-rewrite-rules)

It seems for me, that the .htaccess files comes from this repo: https://github.com/symfony/recipes-contrib/blob/master/symfony/apache-pack/1.0/public/.htaccess

But I have no clue how 🙈 maybe this issue could give you more informations: #1

I've added this package a view minutes ago into my symfony 4.4 project:

$ composer require symfony/apache-pack
Using version ^1.0 for symfony/apache-pack
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Package operations: 1 install, 0 updates, 0 removals
  - Installing symfony/apache-pack (v1.0.1): Downloading (100%)         
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (f9810c626acc52037e6c45db73be494f)
  -  WARNING  symfony/apache-pack (>=1.0): From github.com/symfony/recipes-contrib:master
    The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/symfony/apache-pack/1.0

    Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n): y
  - Configuring symfony/apache-pack (>=1.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [OK]
Executing script assets:install public [OK]

Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.

$ ll public 
-rw-r--r--   1 florianrusch  staff   3.2K Jan  9 21:43 .htaccess
-rw-r--r--   1 florianrusch  staff   6.6K Nov  9 12:03 apple-touch-icon.png
drwxr-xr-x   6 florianrusch  staff   192B Jan  6 19:11 css
-rw-r--r--   1 florianrusch  staff   6.4K Nov  9 12:03 favicon.ico
drwxr-xr-x   7 florianrusch  staff   224B Nov 24 13:03 images
-rw-r--r--   1 florianrusch  staff   805B Jan  7 17:26 index.php
drwxr-xr-x   5 florianrusch  staff   160B Jan  6 19:11 js
drwxr-xr-x   3 florianrusch  staff    96B Nov 16 10:41 uploads

@ixalsera
Copy link

Was wondering the same as @mauricios as the Composer file lists no requirements and the repo itself contains no code. Thanks to the above from @florianrusch and the Symfony docs though, it looks like this is a Symfony Flex package.

@mauricios , to answer your question then, if you are using Symfony Flex in your application, then leave it in as it may be adding in the .htaccess rules (for things like CORS). If you aren't, then it's safe to remove.

However, I will go on to say that even if you are, if the .htaccess file is the only file it adds through the Flex recipe, I would only add it as a dev requirement and rather add the rules from it in to your main production Apache config for faster resolution (if you have access to the httpd.conf file), as suggested here.

@Tobion
Copy link

Tobion commented Jul 14, 2021

This repo is only there so symfony flex can execute the recipe when installing, adding the .htaccess file automatically.
I think we should add a note in the readme of this repo to make this clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants