mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Merge pull request #899 from romainneutron/plugins-absolute-dirs
[3.8] Fix generated twig paths for plugins : make them relative
This commit is contained in:
@@ -196,19 +196,19 @@ EOF;
|
||||
|
||||
foreach ($manifests as $manifest) {
|
||||
$namespace = $this->quote('plugin-' . $manifest->getName());
|
||||
$path = $this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'views';
|
||||
$path = DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . 'views';
|
||||
|
||||
if (is_dir($path)) {
|
||||
if (is_dir($this->pluginDirectory . $path)) {
|
||||
$path = $this->quote($path);
|
||||
$buffer .= <<<EOF
|
||||
$namespace => $path,
|
||||
$namespace => __DIR__ . $path,
|
||||
EOF;
|
||||
}
|
||||
|
||||
foreach ($manifest->getTwigPaths() as $path) {
|
||||
$path = $this->quote($this->pluginDirectory . DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . $path);
|
||||
$path = $this->quote(DIRECTORY_SEPARATOR . $manifest->getName() . DIRECTORY_SEPARATOR . $path);
|
||||
$buffer .= <<<EOF
|
||||
$path,
|
||||
__DIR__ . $path,
|
||||
EOF;
|
||||
}
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ class AutoloaderGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertInstanceOf('Vendor\CustomCommand', $cli['console']->find('hello:world'));
|
||||
|
||||
$mapping = require $pluginsDir . '/twig-paths.php';
|
||||
$this->assertSame(array('plugin-test-plugin' => $pluginsDir . '/test-plugin/views', $pluginsDir . '/test-plugin/views', $pluginsDir . '/test-plugin/twig-views'), $mapping);
|
||||
$this->assertSame(array('plugin-test-plugin' => realpath($pluginsDir) . '/test-plugin/views', realpath($pluginsDir) . '/test-plugin/views', realpath($pluginsDir) . '/test-plugin/twig-views'), $mapping);
|
||||
|
||||
$this->assertRegExp('#@import#', file_get_contents($pluginsDir . '/login.less'));
|
||||
$this->assertRegExp('#@import#', file_get_contents($pluginsDir . '/account.less'));
|
||||
|
Reference in New Issue
Block a user