We need to support several major and minor versions of the web service, so we decided to use the version in the URL as follows:
http: // service / # last deployed version of service
http: // service / 1 / # symlink that points to the last deployed major version 1.x
http: //service/1.2/ # symlink that points to the last deployed minor version 1.2.x
We save all tags in folders and make symbolic links in the correct versions:
Here the root directory for apache:
lrwxr-xr-x 1 xxxx xxxx 28 May 23 15:21 1 -> / home / site / tags / 20120523084844-HEAD
lrwxr-xr-x 1 xxxx xxxx 28 Apr 27 15:21 1.1 -> / home / site / tags / 20120427152123-HEAD
lrwxr-xr-x 1 xxxx xxxx 28 May 23 08:48 1.2 -> / home / site / tags / 20120523084844-HEAD
lrwxr-xr-x 1 xxxx xxxx 28 May 24 16:12 2 -> / home / site / tags / 20120524161232-HEAD
(source code here for last deployed version)
.....
Here's the problem, because we will have the version prefix in REQUEST_URI in PHP, and the Symfony router will not match it with patterns. How can we shorten this version prefix, but still use a specific directory as the root of the document?
For example, when we make a request to http://service/1.2/some/handler/pattern, then the code from the 1.2 directory will be used, and REQUEST_URI in PHP will be / some / handler / pattern
source
share