Add deprecation warning to old .composer files
parent
d57ad21346
commit
11edea8aee
|
@ -129,15 +129,17 @@ EOF;
|
||||||
file_put_contents($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, true, true, (Boolean) $includePathFile, $targetDirLoader));
|
file_put_contents($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, true, true, (Boolean) $includePathFile, $targetDirLoader));
|
||||||
copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
|
copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
|
||||||
|
|
||||||
// TODO BC feature, add E_DEPRECATED in autoload.php on April 30th, remove after May 30th
|
// TODO BC feature, remove after June 15th
|
||||||
if ($bcLinks) {
|
if ($bcLinks) {
|
||||||
$filesystem->ensureDirectoryExists($vendorPath.'/.composer');
|
$filesystem->ensureDirectoryExists($vendorPath.'/.composer');
|
||||||
file_put_contents($vendorPath.'/.composer/autoload_namespaces.php', "<?php\n// Deprecated file, use the one in root of vendor dir\nreturn include dirname(__DIR__).'/composer/autoload_namespaces.php';\n");
|
$deprecated = "// Deprecated file, use the one in root of vendor dir\n".
|
||||||
file_put_contents($vendorPath.'/.composer/autoload_classmap.php', "<?php\n// Deprecated file, use the one in root of vendor dir\nreturn include dirname(__DIR__).'/composer/autoload_classmap.php';\n");
|
"trigger_error(__FILE__.' is deprecated, please use vendor/autoload.php or vendor/composer/autoload_* instead'.PHP_EOL.'See https://groups.google.com/forum/#!msg/composer-dev/fWIs3KocwoA/nU3aLko9LhQJ for details', E_USER_DEPRECATED);\n";
|
||||||
file_put_contents($vendorPath.'/.composer/autoload.php', "<?php\n// Deprecated file, use the one in root of vendor dir\nreturn include dirname(__DIR__).'/autoload.php';\n");
|
file_put_contents($vendorPath.'/.composer/autoload_namespaces.php', "<?php\n{$deprecated}\nreturn include dirname(__DIR__).'/composer/autoload_namespaces.php';\n");
|
||||||
file_put_contents($vendorPath.'/.composer/ClassLoader.php', "<?php\n// Deprecated file, use the one in root of vendor dir\nreturn include dirname(__DIR__).'/composer/ClassLoader.php';\n");
|
file_put_contents($vendorPath.'/.composer/autoload_classmap.php', "<?php\n{$deprecated}\nreturn include dirname(__DIR__).'/composer/autoload_classmap.php';\n");
|
||||||
|
file_put_contents($vendorPath.'/.composer/autoload.php', "<?php\n{$deprecated}\nreturn include dirname(__DIR__).'/autoload.php';\n");
|
||||||
|
file_put_contents($vendorPath.'/.composer/ClassLoader.php', "<?php\n{$deprecated}\nreturn include dirname(__DIR__).'/composer/ClassLoader.php';\n");
|
||||||
if ($includePathFile) {
|
if ($includePathFile) {
|
||||||
file_put_contents($vendorPath.'/.composer/include_paths.php', "<?php\n// Deprecated file, use the one in root of vendor dir\nreturn include dirname(__DIR__).'/composer/include_paths.php';\n");
|
file_put_contents($vendorPath.'/.composer/include_paths.php', "<?php\n{$deprecated}\nreturn include dirname(__DIR__).'/composer/include_paths.php';\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,7 +159,7 @@ class Factory
|
||||||
|
|
||||||
protected function addLocalRepository(RepositoryManager $rm, $vendorDir)
|
protected function addLocalRepository(RepositoryManager $rm, $vendorDir)
|
||||||
{
|
{
|
||||||
// TODO BC feature, remove after May 30th
|
// TODO BC feature, remove after June 15th
|
||||||
if (file_exists($vendorDir.'/.composer/installed.json')) {
|
if (file_exists($vendorDir.'/.composer/installed.json')) {
|
||||||
if (!is_dir($vendorDir.'/composer')) { mkdir($vendorDir.'/composer/', 0777, true); }
|
if (!is_dir($vendorDir.'/composer')) { mkdir($vendorDir.'/composer/', 0777, true); }
|
||||||
rename($vendorDir.'/.composer/installed.json', $vendorDir.'/composer/installed.json');
|
rename($vendorDir.'/.composer/installed.json', $vendorDir.'/composer/installed.json');
|
||||||
|
|
Loading…
Reference in New Issue