对基于现有项目库的composer.json文件进行反向工程? [英] Reverse engineering a composer.json file based on existing project library?
问题描述
这可能是一个毫无意义的问题,但认为提问没有害处.
This is probably a pointless question but figured theres no harm in asking.
我继承了一个网站,据我所知,它使用的是某些Zend库和Doctrine ...我想,请原谅我的无知,因为我对Zend框架的了解并不多.
I have inherited a website which from what I can gather is using some Zend libraries and Doctrine... I think, excuse my ignorance as I'm not very clued up on the Zend framework.
无论如何,都要求我更新其中的许多不赞成使用的代码实例.我以为只是在应用程序代码中,所以我可以在这里和那里等更新功能.
In anycase I have been asked to update the numerous instances of depreacated code in among it. Which I thought would just have been within the application code so I could just update functions here and there etc etc.
事实证明,大多数需要更新的代码都在library文件夹中,从我可以收集到的所有库中,我本以为可以使用composer来建立这些库,但其中没有提及composer.json文件.代码库.
It turns out most of the code needing updated is within the library folder which from what I can gather is all libraries which I would have thought would have been set up using composer but theres no mention of a composer.json file within the codebase.
所以我现在很茫然,因为我有一堆不知道如何更新的库.这使我想到了什么,解决这个问题的最佳方法是什么?
So im now at a loss as I have a bunch of libraries that I have no idea how to update. Which brings me to my question, what would be the best way to attack this problem?
我在考虑是否有某种方法可以根据上述库文件夹的内容对composer.json文件进行反向工程,这将是一个不错的开始,因为我可以以此为基础,将库文件夹替换为更新了作曲家提供的库,但我感觉我可能会紧抓稻草.
I was thinking if there was someway to reverse engineer a composer.json file based on the contents of the aforemetnioned library folder, that would be a good start as I could then use that as the basis for replacing the library folder with the updated libraries pulled in by composer but I have a feeling im probably clutching at straws.
给出一些想法,这是库文件夹的顶级文件夹结构:
To give some idea, this is the top level folder structure of the library folder:
鉴于列出的子文件夹中的子文件夹数量以及所有相关性,毫无疑问,我想手动更新它们将是一个不起眼的事情.
Given the amount of subfolders within those listed and all the dependencies no doubt involved I would imagine manually updating them would be a nonstarter.
希望对这里的最佳行动方案有想法.
Would be interested to get thoughts on the best course of action here.
推荐答案
如果我在您的位置,我将创建一个composer.json并添加尝试逐个添加文件夹中的库的内容,并检查该应用程序是否仍然有效并逐一修复依赖关系,我还看到其中有一个vendor文件夹,这可能是composer.json的结果,可以很容易地将其添加到新的composer.json中,但是您必须将这些库放到一个一个.
If I were in your spot I would create a composer.json and add try to add the libraries from the folder one by one and check if the app still works and fix dependencies one by one, I also see there is a vendor folder in there, that may have been the result of a composer.json which could be easily added in a new composer.json, but you will have to take the libraries one by one.
这篇关于对基于现有项目库的composer.json文件进行反向工程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!