Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DI] Add a simple CSV env var processor#25627

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
dunglas wants to merge2 commits intosymfony:masterfromdunglas:csv-env-processor

Conversation

dunglas
Copy link
Member

@dunglasdunglas commentedDec 29, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Add a new environment variable processor to parse the very popular comma separated array format likefoo,bar. As it uses thestr_getcsv, it also supports escaping and enclosure.

I'm not sure about the name, maybearray orsimple_array would be better.

GromNaN reacted with thumbs up emoji
@javiereguiluz
Copy link
Member

I consider that thecsv name describes this processor perfectly 👍array orsimple_array would be confusing in this case.

nicolas-grekas, dunglas, jvasseur, and gregoirepaqueron reacted with thumbs up emoji

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice :)

@nicolas-grekas
Copy link
Member

(fixture needs an update to make tests green)

@dunglas
Copy link
MemberAuthor

I don't get how to make the test green. The base64 test is green and it's almost the same. Do you have a hint?

{
private $parameters;
private $targetDirs = array();
private $privates = array();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

--- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_csv_env.php+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_csv_env.php@@ -18,7 +18,11 @@ class Symfony_DI_PhpDumper_Test_CsvParameters extends Container {     private $parameters;     private $targetDirs = array();-    private $privates = array();++    /**+     * @internal but protected for BC on cache:clear+     */+    protected $privates = array();      public function __construct()     {

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

But then it will fail for master right?

Copy link
Member

@nicolas-grekasnicolas-grekasDec 29, 2017
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not sure what you mean: this is for master already.

@javiereguiluzjaviereguiluz changed the title[DI] Add a simple array env var processor[DI] Add a simple CSV env var processorJan 3, 2018
@nicolas-grekas
Copy link
Member

@dunglas fabbot failure here

@nicolas-grekas
Copy link
Member

OH, in fact this CS fix has already been done on master AFAIK, so please just rebase to relaunch tests.

@ostrolucky
Copy link
Contributor

Can we rename tocsv_row instead ofcsv? Someone might think this should parse csv string with newlines into array of arrays and submit bug reports.csv_row is less ambiguous and more future proof.

@nicolas-grekas
Copy link
Member

@ostrolucky "csv_row" looks like noisy boilerplate to me. Native'sstr_getcsv doesn't have "row" in its name btw.

dunglas reacted with thumbs up emoji

@fabpot
Copy link
Member

Thank you@dunglas.

@fabpotfabpot closed thisJan 19, 2018
fabpot added a commit that referenced this pull requestJan 19, 2018
This PR was squashed before being merged into the 4.1-dev branch (closes#25627).Discussion----------[DI] Add a simple CSV env var processor| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aAdd a new environment variable processor to parse the very popular comma separated array format like `foo,bar`. As it uses the `str_getcsv`, it also support escaping and enclosure.I'm not sure about the name, maybe `array` or `simple_array` would be better.Commits-------d730209 [DI] Add a simple CSV env var processor
@dunglasdunglas deleted the csv-env-processor branchJanuary 19, 2018 07:26
@fabpotfabpot mentioned this pull requestMay 7, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@fabpotfabpotfabpot approved these changes

@chalasrchalasrchalasr approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
4.1
Development

Successfully merging this pull request may close these issues.

7 participants
@dunglas@javiereguiluz@nicolas-grekas@ostrolucky@fabpot@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp