Skip to content

Commit

Permalink
bug #40877 [Config] Make sure one can build cache on Windows and then…
Browse files Browse the repository at this point in the history
… run in (Docker) Linux (Nyholm)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[Config] Make sure one can build cache on Windows and then run in (Docker) Linux

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

The generated ConfigBuilders should use the `\DirectorySeparator` constant. The resulting string will look like this:

```php
<?php

namespace Symfony\Config;

require_once __DIR__.\DIRECTORY_SEPARATOR.'Twig'.\DIRECTORY_SEPARATOR.'GlobalConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'Twig'.\DIRECTORY_SEPARATOR.'DateConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'Twig'.\DIRECTORY_SEPARATOR.'NumberFormatConfig.php';

/**
 * This class is automatically generated to help creating config.
 *
 * @experimental in 5.3
 */
class TwigConfig implements \Symfony\Component\Config\Builder\ConfigBuilderInterface
{
    private $formThemes;
```

Commits
-------

555c7dd [Config] Make sure one can build cache on Windows and then run in (Docker) Linux
  • Loading branch information
nicolas-grekas committed Apr 21, 2021
2 parents f82c118 + 555c7dd commit 71c6c42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Config/Builder/ClassBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function build(): string
}
unset($path[$key]);
}
$require .= sprintf('require_once __DIR__.\'%s\';', \DIRECTORY_SEPARATOR.implode(\DIRECTORY_SEPARATOR, $path))."\n";
$require .= sprintf('require_once __DIR__.\DIRECTORY_SEPARATOR.\'%s\';', implode('\'.\DIRECTORY_SEPARATOR.\'', $path))."\n";
}

$implements = [] === $this->implements ? '' : 'implements '.implode(', ', $this->implements);
Expand Down

0 comments on commit 71c6c42

Please sign in to comment.