Why VuFind 2.0?
The VuFind 1.x line has been a very popular piece of software, and dozens of institutions have successfully adopted and customized it. It was a big decision to undertake a new major version, and users happy with 1.x may wonder whether it's worth the effort to upgrade. This page lists some of the technical reasons for the change.
- The way VuFind 1.x maps URLs to PHP
actions is entirely custom-built. While easy to understand, the pattern used relies on some complex mod_rewrite rules and has some limitations due to its simplicity. By switching to the widely-used Zend Framework
, VuFind gains greater flexibility and uses a thoroughly-tested design. Some specific advantages:
- Zend's Router logic allows URLs to be mapped to PHP
code in a very flexible way without requiring any changes to Apache mod_rewrite rules. Routes can be added or changed to allow alternate URL
text without modifying other code.
Clearer flow - Zend's forward() and redirect() controller helpers provide an easy-to-understand way of controlling flow from one action to another (1.x's “header redirect and die” approach is not very readable).
Simplified login process - VuFind 1.x's logic for redirecting a user through the login process is extremely confusing; with the help of Zend's easy-to-use session access logic, this has been vastly simplified.
Autoloading and Namespaces - VuFind 1.x is littered with include and require statements to pull in libraries, and many of its classes have names that could easily collide with third-party libraries. VuFind 2.0 will use Zend's autoloader so that classes will be retrieved only when needed without any include or require statements. All class names will live within the VuFind namespace to avoid collisions. The new naming scheme should also allow a slightly cleaner file organization; VuFind 1.x has a lot of unrelated files dropped into the web/sys directory. VuFind 2.0 will have more directories of related files rather than one huge directory containing everything.
Outdated Technologies - VuFind 1.x is built on some components that are no longer as popular as they once were.
Obsolete PEAR Libraries
- Several of VuFind's core dependencies are deprecated PEAR libraries which are beginning to cause minor errors (just warning messages now, but perhaps more serious problems in the future) due to incompatibilities with newer versions of PHP
. All of these old libraries can be easily replaced by Zend framework core components.
PEAR Error Handling
- VuFind 1.x uses PEAR_Error objects to handle error conditions. Now that PHP
supports Exception-driven programming with try..catch blocks, this is unnecessarily clunky.
itself is a powerful templating language, and introducing a separate templating language no longer makes a lot of sense – it increases the learning curve for working with the software and potentially introduces a performance lag.
Cleaner Design - VuFind 1.x has developed organically over several years. Some of its components have become unnecessarily complex or fail to comply with model-view-controller design patterns due to the way they developed. VuFind 2.0 will address these design issues and provide the same functionality in less (or at least clearer) code whenever possible.
Bundled Dependencies - VuFind 1.x is designed to retrieve its dependencies as part of the installation process. This frequently causes problems when third-party sites go out of service or libraries change unexpectedly; it can also lead to conflicts with other applications that require different versions of the same dependencies. To avoid all of these problems, VuFind 2.0 will bundle of its dependencies – the relatively small cost in extra disk space is outweighed by the great increase in convenience and simplicity.