Switching Tiki from Zend Framework1 (ZF1) to Zend Framework2 (ZF2)

 The switch from zf1 to zf2 has been completed with r56812

Why?

Tiki15 is planned to be a LTS release. As of 2015-10 trunk (future Tiki15) is still on Zend Framework 1.

Zend Framework 1 is in maintenance mode . End of Life (EoL) is not yet announced, their FAQ says We currently plan to fully support Zend Framework 1 until at least early 2014, including maintenance and security updates.. This date has passed already, seems like there is no new target date set yet, however most probably ZF1 will be retired during the lifespan of Tiki15.

It does not seem to be a good idea to release a Tiki LTS with a core component being left without official support while Tiki15 itself is meant to be supported.

Zend Framework 2 has an LTS release, which seems to be a good candidate to make the switch to.

What?

Phase1: Assess the feasibility of making the switch before Tiki15 is released using exerimental branch
Phase2: Make the switch (merge back the experimental branch)

When?

Phase1 - Assessment: november 2015 done
Phase2 - Merging to trunk: done with r56812

Where?

Create an experimental branch for the assessment, probably execute there than merge into trunk. Also probably will need to stop auto merging between tiki14 and trunk once it starts.
The experimental branch is live in branches/experimental/zf1-to-zf2

Who?

- gezza: consultation, testing
- Ricardo Melo: code review, make the switch

Assessment

Copy to clipboard
//List of zf1 components being used and possible alternatives when switching to ZF2 //caption: current ZF1 = future ZF2 Zend_Captcha = Zend\Captcha Zend_Config = Zend\Config Zend_Date = DateTime Zend_Exception = Needs to be reviewed case by case, no base class Zend_Feed = Zend\Feed Zend_Filter = Zend\Filter Zend_Gdata = No component Zend_Http = Zend\Http Zend_Log = Zend\Log Zend_Mail = Zend\Mail Zend_Mime = Zend\Mime Zend_Oauth = ZendOAuth Zend_OpenId = ZendOpenId Zend_Search = ZendSearch Zend_Service_Akismet = ZendService\Akismet Zend_Service_Twitter = ZendService\Twitter Zend_Session = Zend\Session Zend_Soap = Zend\Soap Zend_Tag = Zend\Tag Zend_Uri = Zend\Uri Zend_Validate = Zend\Validator Zend_View = Zend\View

Copy to clipboard
//Files that need to be changed db/tiki-db.php installer/tiki-installer.php lib/accounting/accountinglib.php lib/captcha/Captcha_Questions.php lib/captcha/captchalib.php lib/comments/commentslib.php lib/core/DeclFilter.php lib/core/FutureLink/FutureUI.php lib/core/FutureLink/SendToFuture.php lib/core/Math/Formula/Runner.php lib/core/Search/ContentFilter/VersionNumber.php lib/core/Search/Elastic/Connection.php lib/core/Search/Indexer.php lib/core/Search/Lucene/HighlightHelper.php lib/core/Search/Lucene/Index.php lib/core/Search/MySql/HighlightHelper.php lib/core/Search/ResultSet.php lib/core/Search/ResultSet/SnippetHelper.php lib/core/StandardAnalyzer/Analyzer/Standard.php lib/core/StandardAnalyzer/Analyzer/Standard/English.php lib/core/StandardAnalyzer/Readme.txt lib/core/StandardAnalyzer/TokenFilter/EnglishStemmer.php lib/core/Tiki/Command/IndexCatchUpCommand.php lib/core/Tiki/Command/MailQueueSendCommand.php lib/core/Tiki/Connect/Server.php lib/core/Tiki/MailIn/Source/Imap.php lib/core/Tiki/MailIn/Source/Pop3.php lib/core/TikiFilter.php lib/core/TikiFilter/AttributeType.php lib/core/TikiFilter/Callback.php lib/core/TikiFilter/HtmlPurifier.php lib/core/TikiFilter/IsoDate.php lib/core/TikiFilter/PreventXss.php lib/core/TikiFilter/RawUnsafe.php lib/core/TikiFilter/WikiContent.php lib/core/TikiFilter/Word.php lib/filegals/filegallib.php lib/freetag/freetaglib.php lib/importer/tikiimporter_blog_wordpress.php lib/mail/maillib.php lib/messu/messulib.php lib/metadata/datatypes/exif.php lib/metadata/datatypes/xmp.php lib/newsletters/nllib.php lib/oauthlib.php lib/openpgp/OpenPGP_Zend_Mail.php lib/openpgp/OpenPGP_Zend_Mail_Transport_Abstract.php lib/openpgp/OpenPGP_Zend_Mail_Transport_Sendmail.php lib/openpgp/OpenPGP_Zend_Mail_Transport_Smtp.php lib/payment/israelpostlib.php lib/perspective/binderlib.php lib/prefs/unified.php lib/rss/rsslib.php lib/search/refresh-functions.php lib/search/searchlib-unified.php lib/shipping/provider_ups.php lib/soap/soaplib.php lib/socialnetworkslib.php lib/test/bootstrap.php lib/test/core/DeclFilter/ConfigureTest.php lib/test/core/JitFilter/AccessTest.php lib/test/core/JitFilter/FilterTest.php lib/test/core/JitFilter/IteratorTest.php lib/test/core/Search/FormatterTest.php lib/test/importer/TikiImporterBlogWordpressTest.php lib/tikilib.php lib/trackers/trackerlib.php lib/webmail/tikimaillib.php lib/webmail/webmaillib.php lib/wiki-plugins/wikiplugin_redirect.php lib/wiki-plugins/wikiplugin_subscribegroup.php lib/wiki-plugins/wikiplugin_tracker.php lib/zoterolib.php modules/mod-func-last_youtube_playlist_videos.php modules/mod-func-youtube.php themes/base_files/css/tiki_base.css themes/base_files/less/tiki-categories.less themes/ohia/need-fix-or-merge-tiki.css tiki-admin.php tiki-check.php tiki-setup_base.php tiki-webservices.php

Progress

All components have been migrated and merged to trunk

To make sure that the branch can be test during the process, the following process has been adopted:

  1. Add the new ZF dependency, using the last LTS version from ZF2 (~2.4.0), or the last minor version for ZendServices done
  2. Replace all ZF1 calls with the new ZF2 calls (adapt, test, commit) done
  3. Last Step: after all ZF1 components been replaced, remove the dependency from ZF1 from composer. done

Composer Zend
Zend Framework

Known issues

PHP Intl needed - fixed

http://php.net/manual/en/intl.installation.php
Error:
On a windows setup this error might come in the installer: "Fatal error: Uncaught exception 'Zend\I18n\Exception\ExtensionNotLoadedException' with message 'Zend\I18n\Filter component requires the intl PHP extension' "
Solution:
In php.ini enable "extension=php_intl.dll", restart apache
If it does not help, than read: http://stackoverflow.com/questions/1451468/intl-extension-installing-php-intl-dll/6086991#6086991
UPDATE: the installer is still showing some error/notice at the final step, I attached screenshot about it.
UPDATE2: r56682 (experimental branch) fixed it

Show PHP error messages