Giter Site home page Giter Site logo

symfony / recipes-contrib Goto Github PK

View Code? Open in Web Editor NEW
515.0 34.0 616.0 4.18 MB

Symfony Contrib Recipes Repositories

Home Page: https://github.com/symfony/recipes-contrib/blob/flex/main/RECIPES.md

License: MIT License

PHP 98.51% CSS 0.52% Gherkin 0.70% JavaScript 0.04% SCSS 0.23%
symfony recipes

recipes-contrib's Introduction

Symfony Recipes (Contrib)

Symfony recipes allow the automation of Composer packages configuration via the Symfony Flex Composer plugin.

This repository hosts contributed recipes for Composer packages that are not part of the "official" Symfony recipes. To enable recipes defined in this repository for your project, run the following command:

composer config extra.symfony.allow-contrib true

See RECIPES.md for a full list of recipes that live in this repository.

Contributing

For more information about contributing a recipe, read the documentation on the main repository and the Best Practices below.

Unlike for official recipes, the pull requests for new contrib recipes are managed by the community. Pull requests are reviewed by the Symfony Bot and automatically merged when the following conditions are met (in that order):

  • The pull request title does not contain "WIP";
  • The Symfony Bot approved the pull request and reported no validation errors;
  • Someone (not the Symfony bot nor the pull request author) approved the pull request;
  • The pull request author or the reviewer is a Symfony Core Merger.

Best Practices

Default Bundle Config

A recipe for a bundle should not contain all the configuration the bundle has to offer. A good recipe only contains a suggestion config for an application. That is config that needs to be configured but no real default value exists.

Example: The "items per page" in a paginator bundle or API credentials for an API client bundle.

If environment variables are used, they must be provided to the bundle's config.

A bundle without config or routes do not need a recipe. Flex is smart enough to install that bundle anyways.

Modify Other Bundle's config

The general rule is that no recipe should modify other bundle's configuration. There is however one exception. A recipe is allowed to append to a "config collection".

Example: Add a new connection to DoctrineBundle or add a new cache adapter to Symfony Framework bundle.

Maintainability

The symfony/recipes-contrib repository should contain the config for packages. Using "copy-from-package Configurator" for routes and config is not allowed. That would make the recipes impossible to maintain and to assure their quality.

Recipes is also not a replacement for composer create-project. That means it is not intended to be used as "bootstrap full application" and copy a lot of PHP code, front-end assets etc. Recipes are for quick installation of packages.

recipes-contrib's People

Contributors

20uf avatar allypost avatar andchir avatar birkof avatar cedrickoka avatar ckrack avatar covex-nn avatar crayner avatar derstoffel avatar drupol avatar ekkinox avatar electricmaxxx avatar endroid avatar fabpot avatar gquemener avatar gregoirehebert avatar javiereguiluz avatar mael-91 avatar makasim avatar mbo2olivier avatar nicolas-grekas avatar nicolasthal avatar nyholm avatar oskarstark avatar peter-gribanov avatar picoss avatar ro0nl avatar spomky avatar symfony-bot avatar ychadwick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

recipes-contrib's Issues

Possible nelmio/alice recipie misconfiguration

I am new to this stuff so tell me if I am wrong.

Regarding https://github.com/symfony/recipes-contrib/tree/master/nelmio/alice/3.2

manifest.json says:

"bundles": {
        "Nelmio\\Alice\\Bridge\\Symfony\\NelmioAliceBundle": ["dev", "test"]
    },

But directory structure is config/packages/nelmio_alice.yaml. This mean that it will be on in all environments including prod which is not listed in bundles so it fails to load the configuration for 'nelmio_alice'.

Tell me if I am right and I will try to provide PR for it to fix.

[nelmio/api-doc-bundle] needs to support 3.0

3.0 is released at https://github.com/nelmio/NelmioApiDocBundle 2 days ago, and if we run:

$ php composer.phar req nelmio/api-doc-bundle
Using version ^3.0 for nelmio/api-doc-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 5 installs, 0 updates, 0 removals
  - Installing zircote/swagger-php (2.0.13): Downloading (100%)         
  - Installing symfony/inflector (v3.4.1): Downloading (100%)         
  - Installing symfony/property-info (v3.4.1): Downloading (100%)         
  - Installing exsyst/swagger (v0.3.1): Downloading (100%)         
  - Installing nelmio/api-doc-bundle (v3.0.0): Downloading (100%)         
Writing lock file
Generating autoload files
Symfony operations: 1 recipe (be0b2c4d4fe82c143c60dcbf76d3a361)
  - Configuring nelmio/api-doc-bundle (>=2.13): From github.com/symfony/recipes-contrib:master
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!   // Clearing the cache for the dev environment with debug                       
!!   // true                                                                        
!!  
!!  
!!  In FileLoader.php line 168:
!!                                                                                 
!!    Unable to find file "@NelmioApiDocBundle/Resources/config/routing.yml" in @  
!!    NelmioApiDocBundle/Resources/config/routing.yml (which is being imported fr  
!!    om "/Users/jhkchan/workspace/symfony34/config/routes/nelmio_a  
!!    pi_doc.yaml"). Make sure the "NelmioApiDocBundle" bundle is correctly regis  
!!    tered and loaded in the application kernel class. If the bundle is register  
!!    ed, make sure the bundle path "@NelmioApiDocBundle/Resources/config/routing  
!!    .yml" is not empty.                                                          
!!                                                                                 
!!  
!!  In Kernel.php line 307:
!!                                                                             
!!    Unable to find file "@NelmioApiDocBundle/Resources/config/routing.yml".  
!!                                                                             
!!  
!!  cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
!!  
!!  

It would check 3.0 there and 2.13 on recipe, the routing path would break.

Error when installing guzzleBundle

Hello,

Cannot install guzzle bundle.

composer create-project "symfony/skeleton:v4.0.0-BETA2"

composer require eightpoints/guzzle-bundle
Using version ^7.2 for eightpoints/guzzle-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
  - Installing symfony/expression-language (v4.0.0-BETA4): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.4.2): Loading from cache
  - Installing guzzlehttp/guzzle (6.3.0): Loading from cache
  - Installing eightpoints/guzzle-bundle (v7.2.1): Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 1 recipe (6dd3d05634b6cc068157511b4a9257ca)
  -  WARNING  eightpoints/guzzle-bundle (7.0): From github.com/symfony/recipes-contrib:master
    The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    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 eightpoints/guzzle-bundle (7.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!  In ArrayNode.php line 319:
!!
!!    Unrecognized option "plugin" under "eight_points_guzzle.clients.my_client.options"
!!
!!
!!

[IvoryCKEditorBundle] Prepare for new major release (6.x)

Hey!

I'm going to release the new major release (6.x) of IvoryCKEditorBundle due to a license mismatch... The new version removes CKEditor source from the bundle and introduce a command to easily download/install it by your own. Since Flex should automate most of the installation process, I open this issue in order to discuss what should/can be done here.

My interest is first to allow to install the 6.x version as well as automate the CKEditor installtion. There is two choices:

  1. Just inform user that the installation is not complete, it should now install CKEditor with the command
  2. Automatically append the command as Composer script (after clear cache but before assets install)

WDYT?

Unable to add nelmio/api-doc-bundle

When you try to add nelmio/api-doc-bundle, using

composer req nelmio/api-doc-bundle

It will return the following error

Using version ^2.13 for nelmio/api-doc-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
Executing script make cache-warmup [KO]
 [KO]
Script make cache-warmup returned with error code 2
!!  
!!  
!!                                                                                 
!!  
!!    [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]   
!!  
!!    The service "nelmio_api_doc.formatter.html_formatter" has a dependency on a  
!!  
!!     non-existent service "templating".                                          
!!  
!!                                                                                 
!!  
!!  
!!  
!!  make: *** [cache-clear] Error 1
!!  
!!  

Installation failed, reverting ./composer.json to its original content.

This will occur event if you had run

composer req template

Another approach to the manifest

Hello,

I would like to know what is your interest in having a recipes repository for packages not maintained by Symfony?

Why not an approach of a manifest in the original repository?

Is it for the purpose of filtering ?
Is not against the sense for the community?

The idea is good but there is a lot of constraint in this practice:

  • Maintain this repository (versions ..)
  • Being dependent on a response time / validation
  • bundling of bundles

Regards,

.htaccess file still set in "public" directory wether it been changed

Starting with a fresh install of Symfony with:
$ composer create-project symfony/skeleton my_project

I rename my public folder to dist as I need and add this to the composer.json file:

// composer.json
{
    "...": "...",
    "extra": {
        "...": "...",
        "symfony-public-dir": "dist"
    }
}

then I run:
$ composer require symfony/apache-pack

Install is OK but the script create new public folder with the .htaccess file in it.

// directory structure
โ”œโ”€ dist/
โ”‚  โ””โ”€ index.php
โ”œโ”€ public/
โ”‚  โ””โ”€ .htaccess

What's wrong?

[symfony-flex-server] auto validation status is frozen

The status page of symfony-flex-server validation keeps saying The pull request does not exist, is closed, or has already been merged. at PR #613

more specifically: I opened a PR and the validation result required changes. I amended my last commit and force-pushed my changes in my branch. The validation didn't run again and kept being at Pending state. So, I closed the PR, and opened a new one (thinking that now it will rerun). But, again, the status of symfony-flex-server was the one mentioned above. After that, I tried opening a PR from a different branch, but still, the result is that the PR is closed/merged/deleted. Relevant PRs #611 #612 #613

[RFC] Directory name for metadata configuration

In my PR #302 with an Entity class i included two files with metadata configuration: SonataNotificationMessage.orm.xml for Doctrine ORM mapping and Entity.SonataNotificationMessage.xml for JMS serializer. I put that files into metadata/doctrine/ and metadata/jms_serializer/ directories accordingly.

First i tried to put metadata/ directory to config/metadata/ of course, but my files did not pass Flex Server validation: i've got error Underscore notation is required for file names under config/. And i could not rename them, because files with underscore notation are not supported by doctrine bundle and jms serializer bundle.

And from one side i cannot put my files into config/ because of validation, but from another side i cannot put them into metadata/ because it is not standard directory name for such important files. A same problem with naming i've got in my another PR #293.

So, my question is - where i should put my files with metadata configuration?

Missing Resources/config in 3.4

Hi all.
I've got an issue in my bundle wow-apps/symfony-slack-bot

wow-apps/symfony-slack-bot#3

Let's start step-by-step:

Configuration:

  • Symfony 3.4.14
  • PHP 7.1.16 (cli)
  • Composer version 1.6.5 2018-05-04 11:44:59
  • MacOS 10.13.6 (17G65)
  1. Install:
alexeysamara: ~/projects/symfony-slack-bot/test/3.4  $ composer update
...
- Installing wow-apps/symfony-slack-bot (3.2.3): Downloading (100%)
Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
  1. Bundle were initialized in AppKernel.php

  2. run console and got next result:

alexeysamara: ~/projects/symfony-slack-bot/test/3.4  $ ./bin/console

In FileLocator.php line 71:

  The file "services.yaml" does not exist (in: /Users/alexeysamara/projects/symfony-slack-bot/test/3.4/vendor/wow-apps/symfony-slack-bot/DependencyInjection/../Resources/config).

In package repository, you can find a services.yaml https://github.com/wow-apps/symfony-slack-bot/tree/master/Resources/config

But, it was removed after installation by composer!

image

I have a recipe https://github.com/symfony/recipes-contrib/tree/master/wow-apps/symfony-slack-bot/3.2

Did somebody know, where is the problem?

Thank you.

FOSUserBundle recipe

I installed FOSUserBundle and saw that there was no recipe and looking here I saw a lot of PR for the same thing.

At first I do not understand why there were no recipes, so here is the thread

Issue in FriendsOfSymfony/FOSUserBundle#2704
Solution PR : FriendsOfSymfony/FOSUserBundle#2708

Recipe PR on this repo :

  • #270 -> Need to be review
  • #343 -> Should be closed
  • #345 -> Should be closed
  • #363 -> Should be closed

Why do not we keep a valid one while waiting for the compatibility and close the others ?

Error installing eightpoints/guzzle-bundle

Hi, I get an error when I try to install eightpoints/guzzle-bundle. Steps to reproduce:

$ composer create-project "symfony/skeleton:v4.0.0-RC1"
$ composer config extra.symfony.allow-contrib true
$ composer require eightpoints/guzzle-bundle

Resulting in:

Using version ^7.2 for eightpoints/guzzle-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 6 installs, 0 updates, 0 removals
  - Installing symfony/expression-language (v4.0.0-RC1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.4.2): Loading from cache
  - Installing guzzlehttp/guzzle (6.3.0): Loading from cache
  - Installing eightpoints/guzzle-bundle (v7.2.1): Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 1 recipe (99f63a6aef859e3864e34da287bcc653)
  - Configuring eightpoints/guzzle-bundle (7.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [OK]
Executing script assets:install --symlink --relative public [KO]
 [KO]
Script assets:install --symlink --relative %PUBLIC_DIR% returned with error code 1
!!  
!!   Trying to install assets as relative symbolic links.
!!  
!!   --- ------------------------- ------------------------------------ 
!!        Bundle                    Method / Error                      
!!   --- ------------------------- ------------------------------------ 
!!    โœ˜   EightPointsGuzzleBundle   The start path "" is not absolute.  
!!   --- ------------------------- ------------------------------------ 
!!  
!!                                                                                  
!!   [ERROR] Some errors occurred while installing assets.                          
!!                                                                                  
!!  
!!  

Installation failed, reverting ./composer.json to its original content.

HttpPlug missed logger dependency

dev@dev:~/vhosts/gleb-migrator$ cat composer.json
{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
       "php-http/guzzle6-adapter": "^1.1",
        "php-http/httplug-bundle": "^1.7",
        "symfony/console": "^3.3",
        "symfony/flex": "^1.0",
        "symfony/framework-bundle": "^3.3",
        "symfony/orm-pack": "^1.0",
        "symfony/var-dumper": "^3.3",
        "symfony/yaml": "^3.3"
    },
    "require-dev": {
        "symfony/dotenv": "^3.3"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "scripts": {
        "auto-scripts": {
            "make cache-warmup": "script",
            "assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*",
        "symfony/twig-bundle": "<3.3",
        "symfony/debug": "<3.3"
    },
    "extra": {
        "symfony": {
            "id": "xxx",
            "allow-contrib": false
        }
    }
}
dev@dev:~/vhosts/gleb-migrator$ cat config/bundles.php
<?php

return [
    'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all' => true],
    'Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle' => ['all' => true],
    'Doctrine\Bundle\DoctrineBundle\DoctrineBundle' => ['all' => true],
    'Http\HttplugBundle\HttplugBundle' => ['all' => true],
];

There is no httpplug config inside packages https://github.com/symfony/recipes-contrib/blob/master/php-http/httplug-bundle/1.6/config/packages/httplug.yaml

dev@dev:~/vhosts/gleb-migrator$ ll config/
total 28
drwxrwxr-x 4 dev dev 4096 Aug  4 13:46 ./
drwxrwxr-x 8 dev dev 4096 Aug  4 12:43 ../
-rw-rw-r-- 1 dev dev  305 Aug  4 12:34 bundles.php
drwxrwxr-x 5 dev dev 4096 Aug  4 13:39 packages/
drwxrwxr-x 2 dev dev 4096 Aug  4 12:29 routes/
-rw-rw-r-- 1 dev dev  317 Aug  4 12:20 routes.yaml
-rw-rw-r-- 1 dev dev 1291 Aug  4 12:20 services.yaml
dev@dev:~/vhosts/gleb-migrator$ ll config/packages/
total 32
drwxrwxr-x 5 dev dev 4096 Aug  4 13:39 ./
drwxrwxr-x 4 dev dev 4096 Aug  4 13:46 ../
drwxrwxr-x 2 dev dev 4096 Aug  4 13:39 dev/
-rw-rw-r-- 1 dev dev  431 Aug  4 12:27 doctrine.yaml
-rw-rw-r-- 1 dev dev  437 Aug  4 12:20 framework.yaml
drwxrwxr-x 2 dev dev 4096 Aug  4 12:29 prod/
-rw-rw-r-- 1 dev dev   54 Aug  4 12:20 routing.yaml
drwxrwxr-x 2 dev dev 4096 Aug  4 12:29 test/

Is a small project ok ?

Hello, I've created a SEO generator with decent test coverage and documentation (to me). I've used it in multiple production projects with success. The thing is, it doesn't have plenty of stars and contribs like the others.
I'd like to make a PR to add it here. Is that ok? Or should I come back later when the project gets more notoriety?

Cheers.

[symfony/apache-pack] Use DOCUMENT_ROOT to check if requested filename exist

I recently deployed one of my Symfony application on my production server, nothing fancy, but it was the first time I've set up a LAMP manually.

Before going further my configuration is as follows:

  • CentOS Linux release 7.4.1708 (Core)
  • Server version: Apache/2.4.29 (CentOS) Server built: Oct 23 2017 14:34:32
  • PHP 7.1.14 (fpm-fcgi) (built: Feb 1 2018 15:33:20)
  • Symfony 4.1.1

My application is simple, one controller, a few templates, and an SQLite database. I've used the symfony/apache-pack to set up my Apache configuration, and according to the documentation (https://symfony.com/doc/current/setup/web_server_configuration.html) I've moved the rewrite rules to my VirtualHost configuration.
I have some assets I include in my templates, for simplicity I've created them directly in my public folder, no symlinks.

My issue is that the rewrite rules are working fine, I can request my different routes I'm redirected to the front controller, but no styles on my pages because my assets are not loaded (404 Not found). The Rewrite rules from the symfony/apache-pack are supposed to take care of existing files and let the Apache server serve them but it didn't work for me.

After playing a bit (a few hours... haha) with the Rewrite rules I've realized the %{REQUEST_FILENAME} wasn't enough to check if the requested filename exists, so my solution was to prefix it using the %{DOCUMENT_ROOT}.

Here is my full VirtualHost:

<VirtualHost *:80>
    ServerName my-site.com
    ServerAlias my-site.com

    DocumentRoot /var/www/html/my-site.com/public
    DirectoryIndex index.php

    ErrorLog /var/www/html/my-site.com/error.log
    CustomLog /var/www/html/my-site.com/requests.log combined env=!dontlog

    <Directory /var/www/html/my-site.com/public>
        Require all granted
    </Directory>

    <FilesMatch \.php$>
        SetHandler proxy:fcgi://127.0.0.1:9000
    </FilesMatch>

    Options -MultiViews

    RewriteEngine On

    # Determine the RewriteBase automatically and set it as environment variable.
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    # Sets the HTTP_AUTHORIZATION header removed by Apache.
    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect to URI without front controller to prevent duplicate content.
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    # If the requested filename exists, simply serve it.
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    # Rewrite all other queries to the front controller.
    RewriteRule ^ %{ENV:BASE}/index.php [L]
</VirtualHost>

Now it's pretty new for me to play with Apache VirtualHost and Rewrite rules, so my question is, is my solution legit or could it be because I've missed something in my VirtualHost configuration?

In the case this solution is a "good one" and could help others, I've taken the time to create a PR to update the .htaccess to add the RewriteCond, I'm using a [OR] condition to be backward compatible.

Link to the PR: #421

Flex server do not error when using an unknown endpoint

When using a wrong SYMFONY_ENDPOINT environment variable (I found this issue after my PR was merged), composer req [...] will not install the recipe but will succeed.

The reason for that is that the Flex server returns a valid JSON response for the /p/[...] API. Let's take the example of my merged PR #126:

  1. The URL https://symfony.sh/r/github.com/symfony/recipes-contrib/126 displays "UNAVAILABLE" as it was merged, this makes sense. First of all, maybe it should return something else than 200. 404 maybe?
  2. The main issue: The URL used by Composer (https://symfony.sh/r/github.com/symfony/recipes-contrib/126/p/sroze,openwhisk-bundle,i0.2.0,1509194154) returns a valid JSON response, but with no recipes:
{"locks":{"sroze/openwhisk-bundle":{"version":"0.2.0"}},"manifests":{},"vulnerabilities":{}}

(note that this will do the exact same with a PR number that do not exists at all either)

If this endpoint(s) would return an HTTP error, then the composer req would fail and this would make sense :)

[RFC] Let contributors be 100% responsible for their own recipe

This would relieve the time, effort and responsibility to core members. More, contributive recipes changes would be more quick and more active because they no longer depend on the expectation of a review/merge. To do this, @symfony-bot could be smart enough to merge PR when the following condition is valid:

author username === root dir of all changed files
&& all checks in symfony.sh are green
&& 'Status: MERGE' === last comment

Redirect when fetching the package require command in Travis build

Context

I'm working on a recipe for https://github.com/xsolve-pl/xsolve-face-validator-bundle. The build for my PR was green but I also wanted to test it manually. I've created new Symfony project but couldn't get it working locally so I checked the Travis build logs

The bug

The output from echo "$PACKAGES" was empty so I started digging and it seems that the curl command in the before_install section of the build configuration is hitting the 301 redirection so the output of curl -s $SYMFONY_ENDPOINT | sed -En 's/.*composer req "([^"]+)".*/\1/p' is always empty. Which means the build is always green because it doesn't add any packages to the composer.

How to fix

Either the URL in the Travis config should be corrected from symfony.sh to flex.symfony.com or -L option should be added to the curl command in order to follow the redirections. Or both ๐Ÿ™‚

SncRedisBundle fails if predis is not present

Currently, when installing SncRedisBundle, it seems to assume that Predis is installed:

PS D:\Dev\Pi\pi-wifi-web> composer require snc/redis-bundle
Using version ^2.0 for snc/redis-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing snc/redis-bundle (2.0.6): Downloading (100%)
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (20805ee9e510b690176a43d9411aaa83)
  -  WARNING  snc/redis-bundle (>=2.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/snc/redis-bundle/2.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 snc/redis-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!
!!  Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Factory" from namespace "Predis\Profile".
!!  Did you forget a "use" statement for another namespace? in D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php:175
!!  Stack trace:
!!  #0 D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php(105): Snc\RedisBundle\DependencyInjection\SncRedisExtension->loadPredisClient(Array, Object(Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder))
!!  #1 D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php(52): Snc\RedisBundle\DependencyInjection\SncRedisExtension->loadClient(Array, Object(Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder))
!!  #2 D:\Dev\Pi\pi-wifi-web\vendor\symfony\dependency-injection\Compiler\MergeExtensionConfigurationPass.php(71): Snc\RedisBundle\DependencyInjection\SncRedisExtension->load(Array, Obj in D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php on line 175
!!

Installation failed, reverting ./composer.json to its original content.

I guess this error comes from the default configuration which has predis as default connection type. After installing predis, the bundle can be installed.

[Recipes doc] Need for documentation

I think a recipe might need a link for its documentation.

As we already know that a recipe is "accepted" if it's well documented and maintained, it could be necessary to require the presence of a documentation link somewhere.

Most bundle proposals include "default options" in their configuration, it gives the end user an example of config, but a bundle can have a more complex config, and having a direct link to documentation might be interesting to just ctrl+click / copy/paste to get more information about the possible config options.

The link could either be in the config file or in the recipe file, I don't know what's the best option, but for example, the SecurityBundle has documentation links in its security.yaml file, so it could be just a good practice.

What do you think?

Why not allow aliases for contrib recipes?

It would be allowed with some restrictions, like

  • only one allowed unique alias,
  • required prefix like _ for marking a difference with official recipes (example: _elastica).

[Bug ?] - install symfony/apache-pack does not create .htaccess file

Hello there,

I am working on a Symfony 4 application and I am deploying this project to Heroku.

Everything seems to work fine on local but on the dev server, only the route "/" is accessible. The other routes I created give me 404. After looking at the internet I saw it can be because of my Apache Heroku configuration.

The documentation tells me I need to install this package https://symfony.com/doc/current/setup/web_server_configuration.html and it will create a .htaccess into my public directory and it seems that no file is created.

For your information, I am using a Symfony 4.3 version with the buidpack heroku/php and my Procfile is this one: web $(composer config bin-dir)/heroku-php-apache2 public/

I think I am closed to find out what's wrong but it would be great to have your help ๐Ÿ˜„ .

An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'db_user'@'localhost' (using password: YES)

My problem is that travis stops every time when he clear the cache. He shows me the error:

An exception occurred in driver: SQLSTATE [HY000] [1045] Access denied for user 'db_user' @ 'localhost' (using password: YES)

I tried to do the same travis procedures locally and everything works.
I do not understand why Travis is trying to connect to the database.
My composer.json:

{
    "name": "octopouce-mu/admin-bundle",
    "type": "symfony-bundle",
    "description": "Admin bundle",
    "license": "MIT",
    "authors": [
        {
            "name": "Kevin Hilairet",
            "email": "[email protected]"
        },
        {
            "name": "Octopouce",
            "homepage": "http://www.octopouce.mu"
        }
    ],
    "require": {
        "php": "^7.1.3",
        "symfony/framework-bundle": "^3.4|^4.0",
        "symfony/form": "^3.4|^4.0",
        "symfony/asset": "^3.4|^4.0",
        "symfony/security-bundle": "^3.4|^4.0",
        "symfony/swiftmailer-bundle": "^3.1",
        "symfony/orm-pack": "*",
        "symfony/yaml": "^3.4|^4.0",
        "symfony/twig-bundle": "^3.4|^4.0",
        "symfony/translation": "^3.4|^4.0",
        "doctrine/doctrine-fixtures-bundle": "^3.0",
        "twig/extensions": "^1.5",
        "sensio/framework-extra-bundle": "^5.1",
        "stof/doctrine-extensions-bundle": "^1.3",
        "facebook/graph-sdk": "^5.6",
        "google/apiclient": "^2.2",
        "friendsofsymfony/jsrouting-bundle": "^2.2"
    },
    "require-dev": {
    },
    "autoload": {
        "psr-4": {
            "Octopouce\\AdminBundle\\": ""
        }
    },
    "extra": {
        "symfony": {
            "allow-contrib": "true",
            "require": "4.*"
        }
    }
}

Thank you for helping me, it remains to me that this error so that my recip is to accept

Crash when $choices' values are arrays

Hi! I have one of my ENUM implemented like this

class VehicleColorType extends AbstractEnumType
{
    public const OTHER = 0;
    public const WHITE = 1;
    protected static $choices = [
        self::OTHER  => [
            'name' => 'Other',
            'code' => '',
        ],
        self::WHITE  => [
            'name' => 'White',
            'code' => '#FFFFFF',
        ],
   ];
}

And when I do, for example, findOneBy() request, I get an error like on the picture
image

What do you think?

Assetic default parameters in framework

Using symfony flex and symfony 4.x creation project doc:

composer create-project symfony/skeleton admin-theme-test
Installing symfony/skeleton (v3.3.2)
  - Installing symfony/skeleton (v3.3.2) Loading from cache
Created project in admin-theme-test
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 23 installs, 0 updates, 0 removals
  - Installing symfony/flex (v1.0.20) Loading from cache
  - Installing symfony/stopwatch (v3.3.9) Loading from cache
  - Installing symfony/routing (v3.3.9) Loading from cache
  - Installing symfony/polyfill-mbstring (v1.5.0) Loading from cache
  - Installing symfony/http-foundation (v3.3.9) Loading from cache
  - Installing symfony/event-dispatcher (v3.3.9) Loading from cache
  - Installing psr/log (1.0.2) Loading from cache
  - Installing symfony/debug (v3.3.9) Loading from cache
  - Installing symfony/http-kernel (v3.3.9) Loading from cache
  - Installing symfony/finder (v3.3.9) Loading from cache
  - Installing symfony/filesystem (v3.3.9) Loading from cache
  - Installing psr/container (1.0.0) Loading from cache
  - Installing symfony/dependency-injection (v3.3.9) Loading from cache
  - Installing symfony/config (v3.3.9) Loading from cache
  - Installing symfony/class-loader (v3.3.9) Loading from cache
  - Installing symfony/polyfill-apcu (v1.5.0) Loading from cache
  - Installing psr/simple-cache (1.0.0) Loading from cache
  - Installing psr/cache (1.0.1) Loading from cache
  - Installing symfony/cache (v3.3.9) Loading from cache
  - Installing doctrine/cache (v1.7.1) Loading from cache
  - Installing symfony/framework-bundle (v3.3.9) Loading from cache
  - Installing symfony/yaml (v3.3.9) Loading from cache
  - Installing symfony/dotenv (v3.3.9) Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 3 recipes
  - Configuring symfony/flex (1.0): From github.com/symfony/recipes:master
  - Configuring symfony/routing (3.3): From github.com/symfony/recipes:master
  - Configuring symfony/framework-bundle (3.3): From github.com/symfony/recipes:master
Executing script make cache-warmup [OK]
Skipping "assets:install --symlink --relative public" (needs symfony/console to run).

              
 What's next? 
              

  * Run your application:
    1. Change to the project directory
    2. Execute the make serve command;
    3. Browse to the http://localhost:8000/ URL.

  * Read the documentation at https://symfony.com/doc

Note the warning about assets not generated because symfony/console is not included

After install the console:

$ composer req console
Using version ^3.3 for symfony/console
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing symfony/console (v3.3.9) Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 1 recipe
  - Configuring symfony/console (3.3): From github.com/symfony/recipes:master
Executing script make cache-warmup [OK]
Executing script assets:install --symlink --relative public [OK]

After that trying to install assetic:

$ composer req symfony/assetic-bundle
Using version ^2.8 for symfony/assetic-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
  - Installing symfony/process (v3.3.9) Loading from cache
  - Installing kriswallsmith/assetic (v1.4.0) Loading from cache
  - Installing symfony/assetic-bundle (v2.8.2) Loading from cache
Writing lock file
Generating autoload files
Symfony operations: 1 recipe
  - Configuring symfony/assetic-bundle (v2.8.2): From auto-generated recipe
Executing script make cache-warmup [KO]
 [KO]
Script make cache-warmup returned with error code 2
!!  
!!  
!!                                                                                  
!!    [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]  
!!  
!!    You have requested a non-existent parameter "templating.engines".             
!!  
!!                                                                                  
!!  
!!  
!!  Makefile:15: recipe for target 'cache-clear' failed
!!  
!!  make: *** [cache-clear] Error 1
!!  
!!  

Installation failed, reverting ./composer.json to its original content.

This is because in config/packages/framework.yaml is missing:

framework:
    templating:
        engines: ['twig', 'php']

And it is not automatically updated or added when you install assetic

How to test recipes locally

I'd like to create recipes for some of my open sourced bundles.

Before submitting a PR, I'd like to test the recipes locally.

Unfortunately I cannot find any information about how to do this, but I know it is possible.

Anyone that can explain me the flow to use to test locally the recipes? Thankyou!

ping @dunglas

[friendsofsymfony/jsrouting-bundle] bad configuration when using Flex with Symfony 3.4

We are using Symfony 3.4 (current LTS) and Flex.

The recipe has configured everything according to the new file structure but it seems to have assumed that the app is a Symfony 4.X app so in the routing file reference it points to the file specifically create for symfony 4, the one that ends with "-sf4.xml".

Just removing the "-s4" part made everything work.

Improve CI with prefer lowest

I'm currently contributing a new recipe (#259) and I'm greatly appreciating the automatic review and CI process.

I think that the second part, the CI on Travis, should be improved with a --prefer-lowest job, were we validate the fact that the lowest version defined by the contributed recipe is in fact correct.

[Bug] Recipe cached and not refreshed?

When I install my recipe (that is not yet merged), symfony flex use a recipe not up to date. Here it's what I do:

cd $(mktemp -d)
composer create-project symfony/skeleton .
composer config extra.symfony.allow-contrib true
export SYMFONY_ENDPOINT=https://symfony.sh/r/github.com/symfony/recipes-contrib/44
composer req "mykiwi/docker-symfony-php71-nginx-db-alpine:^0.4"
ls -l docker*

No docker* files are here, because the recipe downloaded is not sync with the recipe from the PR:

cat $HOME/.composer/cache/repo/https---symfony.sh-r-github.com-symfony-recipes-contrib-44/m-mykiwi-docker-symfony-php71-nginx-db-alpine-v0.4.1 | json_pp

{
   "body" : {
      "version" : "0.4",
      "package" : "mykiwi/docker-symfony-php71-nginx-db-alpine",
      "manifest" : {
         "copy-from-package" : {
            "docker-compose.override.yml.dist" : "/",
            "docker" : "/",
            "docker-compose.yml" : "/"
         },
         "gitignore" : [
            "docker-compose.override.yml"
         ]
      }
   },
   "headers" : {
      "accept-ranges" : [
         "bytes"
      ],
      "last-modified" : [
         "Tue, 30 May 2017 07:03:27 GMT"
      ],
      "content-length" : [
         "229"
      ],
      "content-type" : [
         "application/json"
      ],
      "date" : [
         "Tue, 30 May 2017 09:02:18 GMT"
      ],
      "vary" : [
         "Origin"
      ],
      "connection" : [
         "close"
      ]
   }
}

But my recipe is actually:

{
    "copy-from-package": {
        "docker-compose.yml": "docker-compose.yml",
        "docker-compose.override.yml.dist": "docker-compose.override.yml.dist",
        "docker/": "docker/"
    },
    "gitignore": [
        "docker-compose.override.yml"
    ]
}

So maybe there is a cache problem somewhere in the infra?

Recipes Server Guide for testing recipe locally is Linux-only

This way if setting the ENV variable does not work on Windows:

export SYMFONY_ENDPOINT=https://symfony.sh/r/github.com/symfony/recipes-contrib/300

This must be used instead:

SET SYMFONY_ENDPOINT=https://symfony.sh/r/github.com/symfony/recipes-contrib/300

Similarly, instead of unset SYMFONY_ENDPOINT you have to use SET SYMFONY_ENDPOINT=.

So maybe the https://symfony.sh/r/github.com/symfony/recipes-contrib/300 should display both options?

[vich/uploader-bundle] Missing templates files ?

Hi.

I really don't know if I post it in the right place, but the bundle provides some twig templates which are not created at the configuration.

Composer found the recipe at the installation and create the config/vich_uploader.yaml but nothing in templates

Is it a wanted behaviour ? Maybe I should post it in the vich repo ?

Thanks !

[bug] Flex Server: Unable to parse git ls-tree output

I'm not sure where to report this. While working on a contrib pull-request (#124) I am using the SYMFONY_ENDPOINT environment variable to use a given "pull-request environment". It was working impressively well yesterday, but this morning, Composer complained:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing sroze/openwhisk-bundle (0.2.0): Loading from cache
Writing lock file
Generating autoload files

Installation failed, reverting ./composer.json to its original content.


  [Composer\Downloader\TransportException]
  The "https://symfony.sh/r/github.com/symfony/recipes-contrib/124/p/sroze,openwhisk-bundle,i0.2.0,1509194154" file could not be downloaded (HTTP/1.1 500 Internal Server Error)

The symfony.sh URL returns the following:

< HTTP/1.1 500 Internal Server Error
< Content-Length: 34
< Content-Type: text/plain; charset=utf-8
< Date: Sun, 29 Oct 2017 09:33:01 GMT
< Vary: Origin
< X-Correlation-Id: khhctnfqwrbagxbu4budujoc
< X-Sensiocloud-Cache: MISS
< X-Sensiocloud-Cluster: egjbl6qhu5lse-master-7rqtwti
< X-Sensiocloud-Processor: 7zwai3z77ggmnxkao6dhwzsjxq
< X-Sensiocloud-Router: 3hjnjz4dfxtohh4gibk6eanr7y

unable to parse git ls-tree output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.