Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webfactory/webfactorylegacyintegrationbundle
A battle-proven approach to facilitate the incremental migration of legacy applications to the Symfony2 stack.
https://github.com/webfactory/webfactorylegacyintegrationbundle
bundle legacy php symfony
Last synced: 8 days ago
JSON representation
A battle-proven approach to facilitate the incremental migration of legacy applications to the Symfony2 stack.
- Host: GitHub
- URL: https://github.com/webfactory/webfactorylegacyintegrationbundle
- Owner: webfactory
- License: mit
- Created: 2013-12-18T16:06:09.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-14T15:56:04.000Z (8 months ago)
- Last Synced: 2024-03-15T12:54:30.783Z (8 months ago)
- Topics: bundle, legacy, php, symfony
- Language: PHP
- Size: 112 KB
- Stars: 16
- Watchers: 13
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
WebfactoryLegacyIntegrationBundle
===================================This bundle provides an approach to integrate existing legacy applications with
Symfony2.In brief, the approach is to run a particular event listener on the kernel.controller
event. This event listener will decide whether and how to run the legacy application.
The response generated by the legacy application will then be captured.Later, after the Symfony2 Controller has been executed and a Twig template is being
rendered, fragments of the "legacy response" can be retrieved and be used as part
of the output.That way, you can start with your legacy application and Symfony2 in coexistence
next to each other. You can then incrementally start to shift functionality over
to the Symfony2 stack while maintaining a coherent user experience.Because Symfony2 is driving this process and Twig templates have the control
authority of which parts of the legacy response are being used, this approach
will naturally "grow" away from the legacy application towards the Symfony2 stack.*Take care:* This bundle currently uses webfactory/dom, a small set of utilities
on top of PHP's DOM extension, to process the legacy application's repsonse and
provide XPath-based access to it. It will only work if your old application
returns well-formed XHTML or Polyglot HTML5.To learn more about this concept, its benefits and caveats, use your time-machine
and visit the [Symfony2 User Group Colone meeting on 2013-12-18](http://de.slideshare.net/webfactory/marry-me-public).Installation
---Just like any other Symfony2 bundle, left as an exercise to the reader.
Configuration
---```
webfactory_legacy_integration:
# Whether your legacy application returns text/html as XHTML 1.0 or Polyglot HTML5.
parsingMode: xhtml10|html5
# Bootstrap file for the legacy application (see next section)
legacyApplicationBootstrapFile: www/index-legacy.php
```The legacy "bootstrap" file
---You must provide a single file that can be `include()`ed in order to run your
legacy application. Typically you will already have this - it should be your
legacy application's front controller.If you are running PHP < 5.4, this file should _return_ the HTTP status code
sent by the legacy application. Starting with PHP 5.4, `http_response_code()`
will be used to detect it.Also, as this bundle will try to capture the response including headers using
output buffering, you must not flush the response body or headers
to the client.Using it
---Once you're set up, use the @Dispatch annotation on your controller to run the
legacy application before your controller - like so:```php
...
...
{{ legacyApplication.xpath('//*[@id="content"]/*') | raw }}
...