I'm not really familiar with subversion (or composer for that matter). The website our company uses has a lot of legacy code that depends on Zend's DB class from version 1.10.4. I am trying to figure out how to install it using composer.
Here is my composer.json
file.
{
"repositories": [
{
"type": "vcs",
"url": "http://framework.zend.com/svn/framework/standard/"
}
],
"require": {
"framework.zend/framework": "1.10.4"
}
}
They give some instructions here, but I can't seem to get it to work. I get one of two results when I run php composer.phar update
.
If I use the composer.json above I get:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package framework.zend/framework could not be found in any version, there may be a typo in the package name.
If I change my require key to "zendframework/zf1": "1.10.4"
it will say it is checking all of the composer.json files from version 0.0.1 all the way up to the newest version and then give me the same error as above (except for the name changes). I am guessing this is because it is referring to the git repo, and ignored the stuff in the "repositories" field.
Can someone please provide a composer.json example that will download ZF1.
Bonus points if you can figure out how to only include certain components, like DB, Acl, and Cache, for example... or you can for certain determine this is not possible so I don't waste my time.
Thanks in advance.
I've looked around a bit on https://packagist.org to see which Zend framework 1 versions are available.
I haven't found one that is version 1.10 - if you look closely, you may find one, though. The official version supported from Zend is 1.12. I found one repo having 1.11 and 1.12, with the problem of a missing "replace" statement for 1.11.0 (and maybe other versions as well), which will be a problem if you include this package, and a second one that has "zendframework/zendframework1" as a dependency.
Also note that simply using someone's version might not contain the original code, you'd have to check that the code you import still does what you expect - and does not install any security problems or worse.
On the other hand, you could directly add the original SVN repository of ZF1 and then grab all versions from there. However, a SVN download is a very slow process, because it moves around 50 to 100 MB of data in single small files for any version of ZF1.
My own approach to get an unreleased older version was to create the necessary metadata needed to pull the download ZIP, and integrate that into the already existing Satis repo in the company network. Local downloads for developers and deployment are much faster. Effectively, you could add a "package" repository bearing almost all the metadata of the composer.json of the released ZF1, add the correct version and a download URL for the ZIP at the Zend download server. For only one application, it might be a usable solution.
But in the end, you may guess it already, the best option is to update your Zend framework to an available version 1.12.x, preferably the latest one.