作曲家转储自动加载和混帐 [英] composer dump autoload and git
问题描述
为了部署的实用性,我们决定在我们的git repo中提交供应商目录。事情正在工作,但每次我们运行作曲家转储自动加载它修改以下文件,这是非常恼人的,因为它似乎并不代表文件的特定状态,它看起来像一个随机数,每次你重新运行它。我应该如何处理?
vendor / autoload.php
$ b
return ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222 :: getLoader();
vendor / composer / autoload_real.php $ b
spl_autoload_register(array('ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222','loadClassLoader'),true,true);
self :: $ loader = $ loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222','loadClassLoader'));
Git检测到这些已更改,但根本看不到任何更改,甚至说0行添加,删除了0行
vendor / composer / ClassLoader.php
$ b
vendor / composer / autoload_classmap.php
$ b
vendor / composer / autoload_files.php
$ b vendor / composer / autoload_namespace.php
$ b vendor / composer / include_paths.php
据我所知,不建议使用以前的Composer自动加载文件。我尝试了一次,因为我使用Beanstalkapp +它的部署功能,但相当快,我发现它并不是一个好主意,因为没有任何东西被加载,我得到了一些重大错误。
也许这是一个想法,根本不包括供应商文件夹,只在部署服务器本身上进行这些作曲家更新。
作为一个快速提示,您通常不希望在实时服务器上更新Composer软件包。有些事情可能会破坏,它会让你头疼。
We have decided to commit the vendor directory inside our git repo for deployment practicality. Things are working however everytime we run composer dump-autoload it modifies the following files which is quite annoying as it doesn't seem to represent a specific state of files it looks like a random number every time you re-run it. How should I handle this?
vendor/autoload.php
return ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222::getLoader();
vendor/composer/autoload_real.php
spl_autoload_register(array('ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit54ff9d13a4342a89ea5000269df2222', 'loadClassLoader'));
Git detects these as changed but I can't see any changes at all, it even says 0 lines added, 0 lines removed
vendor/composer/ClassLoader.php
vendor/composer/autoload_classmap.php
vendor/composer/autoload_files.php
vendor/composer/autoload_namespace.php
vendor/composer/include_paths.php
To my knowledge it is not advisable to use previous Composer Autoload files. I tried it once, since I was using Beanstalkapp + it's deployment feature but rather quickly I found out that it wasn't such a brilliant idea since nothing was loaded and I was getting some major errors.
Maybe it's an idea to not include the vendor folder at all and only do those composer updates on the deployment server itself.
And as a quick tip, you generally don't want to update your Composer packages on a live server. Some things might break and it'll cause you a headache to fix.
这篇关于作曲家转储自动加载和混帐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!