You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
running rector process --debug src/extensions/aus_project/ext_tables.php in /app directory.
Producess:
[ERROR] Could not process "src/extensions/aus_project/ext_tables.php" file, due to:
"System error: "Unable to create a directory at /src/extensions/aus_project/Configuration/TCA/Overrides.
mkdir(): Permission denied"
Stack trace:
#0 vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(297):
League\Flysystem\UnableToCreateDirectory::atLocation('/src/extensions...', 'mkdir(): Permis...')
#1 vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(116):
League\Flysystem\Local\LocalFilesystemAdapter->ensureDirectoryExists('/src/extensions...', 448)
#2 vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php(102):
League\Flysystem\Local\LocalFilesystemAdapter->writeToFile('src/extensions/...', '<?php\n\n// Inclu...',
Object(League\Flysystem\Config))
#3 vendor/league/flysystem/src/Filesystem.php(41):
League\Flysystem\Local\LocalFilesystemAdapter->write('src/extensions/...', '<?php\n\n// Inclu...',
Object(League\Flysystem\Config))
#4 vendor/ssch/typo3-rector/src/Filesystem/FlysystemFilesystem.php(24):
League\Flysystem\Filesystem->write('src/extensions/...', '<?php\n\n// Inclu...')
#5
vendor/ssch/typo3-rector/rules/CodeQuality/General/MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesR
ector.php(121): Ssch\TYPO3Rector\Filesystem\FlysystemFilesystem->write('src/extensions/...', '<?php\n\n//
Inclu...')
#6 vendor/rector/rector/src/Rector/AbstractRector.php(136):
Ssch\TYPO3Rector\CodeQuality\General\MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector->refact
or(Object(PhpParser\Node\Stmt\Expression))
#7 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(176):
Rector\Rector\AbstractRector->enterNode(Object(PhpParser\Node\Stmt\Expression))
#8 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105):
PhpParser\NodeTraverser->traverseArray(Array)
#9 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(133):
PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Expr\Closure))
#10 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(196):
PhpParser\NodeTraverser->traverseNode(Object(PhpParser\Node\Arg))
#11 vendor/rector/rector/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(105):
PhpParser\NodeTraverser->traverseArray(Array)
this bug is only cased if the rector config as Paths specified directly to a PHP file.
eg through the cli: rector process src/extension/test_extension/ext_tables.php
or by a config line like this: in the rector.php
If you run the rector command from a different folder than your rector.php file, than it will try to create the files in the wrong location. Relative to the current working directory instead of relative to the project root :/
vendor/rector/rector/src/Rector/AbstractRector.php:121.
Here the $file is different if you specify a filename instead of a directory.
With a directory, $file is an absolute path.
With a file, $file is a relative path.
Minimal PHP Code Causing Issue
given:
file in
/app/src/extensions/aus_project/ext_tables.php
with content:running
rector process --debug src/extensions/aus_project/ext_tables.php
in /app directory.Producess:
this bug is only cased if the rector config as Paths specified directly to a PHP file.
eg through the cli:
rector process src/extension/test_extension/ext_tables.php
or by a config line like this: in the
rector.php
Applied rules
MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector
but this should affect every Rector rule that writes files the same way.Expected Behaviour
But should try to create files in
/app/src/...
Package Version
<2.6.1 && > 2.6.4
PHP Version
TYPO3 Version
Notes
Related Issues:
The text was updated successfully, but these errors were encountered: