From ccc2cce5dcb7f9f9bcfda19b6d4a3e1b840d9195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morel=20Se=CC=81bastien?= Date: Thu, 9 Feb 2017 00:51:57 -0800 Subject: [PATCH 1/2] First Draft Legacy Install on top of eZ Platform --- INSTALL.md | 200 +++++++++++++----- .../override/browse.ini.append.php | 15 ++ .../override/content.ini.append.php | 94 ++++++++ .../contentstructuremenu.ini.append.php | 15 ++ .../override/ezjscore.ini.append.php | 6 + .../override/ezmultiupload.ini.append.php | 7 + .../override/ezoe.ini.append.php | 5 + .../override/ezoe_attributes.ini.append.php | 35 +++ .../override/ezxml.ini.append.php | 6 + .../override/forum.ini.append.php | 5 + .../override/i18n.ini.append.php | 5 + .../override/image.ini.append.php | 7 + .../override/layout.ini.append.php | 6 + .../override/menu.ini.append.php | 21 ++ .../override/site.ini.append.php | 101 +++++++++ .../override/viewcache.ini.append.php | 109 ++++++++++ .../administration/content.ini.append.php | 9 + .../administration/override.ini.append.php | 62 ++++++ .../administration/site.ini.append.php | 45 ++++ .../administration/toolbar.ini.append.php | 70 ++++++ 20 files changed, 766 insertions(+), 57 deletions(-) create mode 100644 settings_template/override/browse.ini.append.php create mode 100644 settings_template/override/content.ini.append.php create mode 100644 settings_template/override/contentstructuremenu.ini.append.php create mode 100644 settings_template/override/ezjscore.ini.append.php create mode 100644 settings_template/override/ezmultiupload.ini.append.php create mode 100644 settings_template/override/ezoe.ini.append.php create mode 100644 settings_template/override/ezoe_attributes.ini.append.php create mode 100644 settings_template/override/ezxml.ini.append.php create mode 100644 settings_template/override/forum.ini.append.php create mode 100644 settings_template/override/i18n.ini.append.php create mode 100644 settings_template/override/image.ini.append.php create mode 100644 settings_template/override/layout.ini.append.php create mode 100644 settings_template/override/menu.ini.append.php create mode 100644 settings_template/override/site.ini.append.php create mode 100644 settings_template/override/viewcache.ini.append.php create mode 100644 settings_template/siteaccess/administration/content.ini.append.php create mode 100644 settings_template/siteaccess/administration/override.ini.append.php create mode 100644 settings_template/siteaccess/administration/site.ini.append.php create mode 100644 settings_template/siteaccess/administration/toolbar.ini.append.php diff --git a/INSTALL.md b/INSTALL.md index c1287dce..885e8d8e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,97 +1,113 @@ # Installing the eZ Platform legacy bridge Unlike eZ Publish 5.x, eZ Platform does not include the Legacy stack by default. -Even though it is not officially supported, eZ Publish Legacy can easily be installed -on top of Platform using Composer. +eZ Publish Legacy can easily be installed on top of Platform using Composer. -### Missing legacy extensions +### eZ Plaftorm installation -Several ezpublish-legacy extensions are no longer installed by default, such as ezfind or eztags. -They can still be manually added to the root `composer.json`. +We are assuming you have a fresh [eZ Platform installation here](https://www.ezplatform.com/), +that basically you have run: -### Add the composer `legacy post-*-scripts` +```bash +php -d memory_limit=-1 composer create-project ezsystems/ezplatform +php app/console doctrine:database:create +php app/console ezplatform:install clean +``` -Edit `composer.json`, and add those lines to both `post-update-cmd` and `post-install-cmd` blocks at the end: +At this point you should be able to reach Platform UI at the URL http://{YOURPROJECTHOST}/ez -``` +### Legacy Bridge Installation Steps + +#### Adapt your composer.json + +Edit `composer.json`, and add those lines to both `post-update-cmd`, `post-install-cmd` and `extra` blocks at the end: + +```json "scripts": { "post-install-cmd": [ ..., "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installAssets", "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installLegacyBundlesExtensions", - "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateAutoloads" + "Novactive\\EzLegacyToolsBundle\\Composer\\ScriptHandler::installLegacyBundlesSettings", + "Novactive\\EzLegacyToolsBundle\\Composer\\ScriptHandler::executeLegacyScripts", + "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateAutoloads", + "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateKernelOverrideAutoloads", ], "post-update-cmd": [ ..., "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installAssets", "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::installLegacyBundlesExtensions", - "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateAutoloads" + "Novactive\\EzLegacyToolsBundle\\Composer\\ScriptHandler::installLegacyBundlesSettings", + "Novactive\\EzLegacyToolsBundle\\Composer\\ScriptHandler::executeLegacyScripts", + "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateAutoloads", + "eZ\\Bundle\\EzPublishLegacyBundle\\Composer\\ScriptHandler::generateKernelOverrideAutoloads", ], + ..., + "extra": { + ..., + "ezpublish-legacy-dir": "ezpublish_legacy", + "legacy-settings-install": ["force", "relative"], + "legacy-scripts-execution": [] + } } ``` -### Enable EzPublishLegacyBundle -Edit `app/AppKernel.php` (or `ezpublish/EzPublishKernel` before ezplatform 2015.12), -and add `new eZ\Bundle\EzPublishLegacyBundle\EzPublishLegacyBundle( $this )` at the end of -the `$bundles` array. Pay close attention to the `$this` argument. The LegacyBundle is a bit -of a spoiled brat, and has high expectations from its collaborators. +#### Enable the new bundles -### Add legacy routes -Edit `app/config/routing.yml`, and add the LegacyBundle routes. +Edit `app/AppKernel.php` (or `ezpublish/EzPublishKernel` before ezplatform 2015.12), and add -``` -_ezpublishLegacyRoutes: - resource: @EzPublishLegacyBundle/Resources/config/routing.yml -``` - -### Enable legacy_mode for your backoffice siteaccess - -The Legacy Backoffice requires the `legacy_mode` option to be enabled. -This can be done in app/config/config.yml or app/config/ezplatform.yml: - -``` -ez_publish_legacy: - system: - site_admin: - legacy_mode: true -``` - -### Optional: add security rules for the Setup Wizard - -If you intend to run the legacy setup wizard, you need to allow it in `app/config/security.yml`. +```php +new Novactive\EzLegacyToolsBundle\NovactiveEzLegacyToolsBundle(), +new EzSystems\EzPlatformXmlTextFieldTypeBundle\EzSystemsEzPlatformXmlTextFieldTypeBundle(), +new eZ\Bundle\EzPublishLegacyBundle\EzPublishLegacyBundle( $this ) ``` -ezpublish_setup: - pattern: ^/ezsetup - security: false -``` +at the end of the `$bundles` array. +Pay close attention to the `$this` argument. The LegacyBundle is a bit of a spoiled brat, and has high expectations +from its collaborators. -### Configure ezpublish legacy's location in `composer.json` -`ezsystems/ezpublish-legacy` needs to be installed in a particular location to work. +#### Add legacy routes -Edit `composer.json`, and add `"ezpublish-legacy-dir": "ezpublish_legacy"` to the `extra` array: +Edit `app/config/routing.yml`, and add the LegacyBundle routes. -``` - "extra": { - "ezpublish-legacy-dir": "ezpublish_legacy", +```yaml +_ezpublishLegacyRoutes: + resource: @EzPublishLegacyBundle/Resources/config/routing.yml ``` -### Install `ezsystems/legacy-bridge` +#### Install the bundles **Make sure you have set the ezpublish legacy folder in composer.json, as instructed above** -`ezsystems/legacy-bridge` contains the libraries previous included in `ezsystems/ezpublish-kernel`. +```bash +composer require "ezsystems/legacy-bridge:1.1.x" "novactive/ezlegacy-tools-bundle:dev-master" "ezsystems/ezplatform-xmltext-fieldtype" netgen/ngsymfonytools netgen/ezplatformsearch --no-scripts +``` -It must be installed using Composer. Take care to use `^1.0.4` as version constraint, since previous versions lack some important fixes for newer versions of eZ Platform: +#### Create you legacy bundle +```bash +php app/console generate:bundle --namespace=Acme/Bundle/LegacyBundle --format=annotation --bundle-name=AcmeLegacyBundle --dir=src -n ``` -composer require --update-no-dev "ezsystems/legacy-bridge:^1.0.4" + +Create 2 folders for legacy + +```bash +cd src/Acme/Bundle/LegacyBundle +mkdir ezpublish_legacy legacy_settings +cd - ``` -### Configuring Symfony app folder in legacy +Copy the config.php-RECOMMENDED in legacy_settings -In eZ Publish 5, Symfony app folder was named `ezpublish`. This was changed in eZ Platform, and now the folder name is `app`, which is Symfony recommended name. eZ Publish Legacy supports both of these folder names, however, `ezpublish` is still the default one in latest tagged release (v2015.01.3). This means that you need to make eZ Publish Legacy aware of the new folder name. You can do this by using `config.php` file which you can place in `ezpublish_legacy` folder with the following content: +```bash +cp ezpublish_legacy/config.php-RECOMMENDED src/Acme/Bundle/LegacyBundle/legacy_settings/config.php +``` +In eZ Publish 5, Symfony app folder was named `ezpublish`. This was changed in eZ Platform, +and now the folder name is `app`, which is Symfony recommended name. +eZ Publish Legacy supports both of these folder names, however, `ezpublish` is still the default +one in latest tagged release (v2015.01.3). This means that you need to make eZ Publish Legacy aware of the +new folder name. You can do this by editing `config.php` and uncommenting: ```php Please refer to doc/nginx for more information (complete vhost without these rules you need) + Or if using nginx: ``` @@ -127,7 +148,6 @@ Or if using nginx: #rewrite "^/var/([^/]+/)?storage/images(-versioned)?/(.*)" "/index.php" break; #rewrite "^/var/([^/]+/)?cache/(texttoimage|public)/(.*)" "/index_cluster.php" break; -rewrite "^/var/([^/]+/)?storage/images(-versioned)?/(.*)" "/var/$1storage/images$2/$3" break; rewrite "^/var/([^/]+/)?cache/(texttoimage|public)/(.*)" "/var/$1cache/$2/$3" break; rewrite "^/design/([^/]+)/(stylesheets|images|javascript|fonts)/(.*)" "/design/$1/$2/$3" break; rewrite "^/share/icons/(.*)" "/share/icons/$1" break; @@ -137,8 +157,74 @@ rewrite "^/packages/styles/(.+)/thumbnail/(.*)" "/packages/styles/$1/thumbnail/$ rewrite "^/var/storage/packages/(.*)" "/var/storage/packages/$1" break; ``` +> Please refer to doc/nginx for more information (complete vhost without these rules you need) + + +!! Restart your webserver !! + +> Yes, don't forget ;-) + +#### Configure you administration siteaccess. + +The Legacy Backoffice requires the `legacy_mode` option to be enabled. +This can be done in app/config/config.yml or app/config/ezplatform.yml: + +We are using here: administration as SiteAccessName + +```yaml + +# app/config/ezplatform.yml + +ezpublish: + repositories: + default: + storage: ~ + search: + engine: %search_engine% + connection: default + siteaccess: + list: [site, administration] + groups: + site_group: [site, administration] + default_siteaccess: site + match: + URIElement: 1 + + system: + site_group: + cache_pool_name: '%cache_pool%' + var_dir: var/site + languages: [eng-GB] + + +ez_publish_legacy: + system: + administration: + legacy_mode: true +``` + + +Because your are not running the wizard you have to manually create the settings for you legacy siteaccess. +We are providing a template: +```bash +cp -r vendor/ezsystems/legacy-bridge/settings_template/* src/Acme/Bundle/LegacyBundle/legacy_settings +``` + + +### Test ! + +*/ez* for Plaftform UI +*/administration* for Legacy Admin + + ### Setup Folder Permissions Last step, if you are on *nix operation system, is to make sure to run the appropriate command for setting correct folder permissions, you can find the information you need in installation guide for eZ Publish 5.x. + + +### Missing legacy extensions + +Several ezpublish-legacy extensions are no longer installed by default, such as ezfind or eztags. +They can still be manually added to the root `composer.json`. diff --git a/settings_template/override/browse.ini.append.php b/settings_template/override/browse.ini.append.php new file mode 100644 index 00000000..07da2bdf --- /dev/null +++ b/settings_template/override/browse.ini.append.php @@ -0,0 +1,15 @@ + diff --git a/settings_template/override/content.ini.append.php b/settings_template/override/content.ini.append.php new file mode 100644 index 00000000..277a5dfd --- /dev/null +++ b/settings_template/override/content.ini.append.php @@ -0,0 +1,94 @@ + diff --git a/settings_template/override/contentstructuremenu.ini.append.php b/settings_template/override/contentstructuremenu.ini.append.php new file mode 100644 index 00000000..5f48b348 --- /dev/null +++ b/settings_template/override/contentstructuremenu.ini.append.php @@ -0,0 +1,15 @@ + diff --git a/settings_template/override/ezjscore.ini.append.php b/settings_template/override/ezjscore.ini.append.php new file mode 100644 index 00000000..f79575d9 --- /dev/null +++ b/settings_template/override/ezjscore.ini.append.php @@ -0,0 +1,6 @@ + diff --git a/settings_template/override/ezmultiupload.ini.append.php b/settings_template/override/ezmultiupload.ini.append.php new file mode 100644 index 00000000..58c3ac89 --- /dev/null +++ b/settings_template/override/ezmultiupload.ini.append.php @@ -0,0 +1,7 @@ + diff --git a/settings_template/override/ezoe.ini.append.php b/settings_template/override/ezoe.ini.append.php new file mode 100644 index 00000000..e75ca676 --- /dev/null +++ b/settings_template/override/ezoe.ini.append.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/settings_template/override/ezoe_attributes.ini.append.php b/settings_template/override/ezoe_attributes.ini.append.php new file mode 100644 index 00000000..09211544 --- /dev/null +++ b/settings_template/override/ezoe_attributes.ini.append.php @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/settings_template/override/ezxml.ini.append.php b/settings_template/override/ezxml.ini.append.php new file mode 100644 index 00000000..449d3e36 --- /dev/null +++ b/settings_template/override/ezxml.ini.append.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/settings_template/override/forum.ini.append.php b/settings_template/override/forum.ini.append.php new file mode 100644 index 00000000..c9108808 --- /dev/null +++ b/settings_template/override/forum.ini.append.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/settings_template/override/i18n.ini.append.php b/settings_template/override/i18n.ini.append.php new file mode 100644 index 00000000..611aa913 --- /dev/null +++ b/settings_template/override/i18n.ini.append.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/settings_template/override/image.ini.append.php b/settings_template/override/image.ini.append.php new file mode 100644 index 00000000..e414fdfe --- /dev/null +++ b/settings_template/override/image.ini.append.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/settings_template/override/layout.ini.append.php b/settings_template/override/layout.ini.append.php new file mode 100644 index 00000000..030fd6c8 --- /dev/null +++ b/settings_template/override/layout.ini.append.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/settings_template/override/menu.ini.append.php b/settings_template/override/menu.ini.append.php new file mode 100644 index 00000000..89a44815 --- /dev/null +++ b/settings_template/override/menu.ini.append.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/settings_template/override/site.ini.append.php b/settings_template/override/site.ini.append.php new file mode 100644 index 00000000..167253ac --- /dev/null +++ b/settings_template/override/site.ini.append.php @@ -0,0 +1,101 @@ + diff --git a/settings_template/override/viewcache.ini.append.php b/settings_template/override/viewcache.ini.append.php new file mode 100644 index 00000000..4e9185df --- /dev/null +++ b/settings_template/override/viewcache.ini.append.php @@ -0,0 +1,109 @@ + \ No newline at end of file diff --git a/settings_template/siteaccess/administration/content.ini.append.php b/settings_template/siteaccess/administration/content.ini.append.php new file mode 100644 index 00000000..c3bb4c39 --- /dev/null +++ b/settings_template/siteaccess/administration/content.ini.append.php @@ -0,0 +1,9 @@ + diff --git a/settings_template/siteaccess/administration/override.ini.append.php b/settings_template/siteaccess/administration/override.ini.append.php new file mode 100644 index 00000000..0d626ef3 --- /dev/null +++ b/settings_template/siteaccess/administration/override.ini.append.php @@ -0,0 +1,62 @@ + diff --git a/settings_template/siteaccess/administration/site.ini.append.php b/settings_template/siteaccess/administration/site.ini.append.php new file mode 100644 index 00000000..369e9d2c --- /dev/null +++ b/settings_template/siteaccess/administration/site.ini.append.php @@ -0,0 +1,45 @@ + diff --git a/settings_template/siteaccess/administration/toolbar.ini.append.php b/settings_template/siteaccess/administration/toolbar.ini.append.php new file mode 100644 index 00000000..61bbd342 --- /dev/null +++ b/settings_template/siteaccess/administration/toolbar.ini.append.php @@ -0,0 +1,70 @@ + \ No newline at end of file From 04998a1d2928ea37de4c75ee9effd77324c2a094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morel=20Se=CC=81bastien?= Date: Thu, 9 Feb 2017 01:42:23 -0800 Subject: [PATCH 2/2] Optim order --- INSTALL.md | 94 ++++++++++++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 885e8d8e..438ae6c6 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -115,6 +115,52 @@ new folder name. You can do this by editing `config.php` and uncommenting: define( 'EZP_APP_FOLDER_NAME', 'app' ); ``` +#### Configure you administration siteaccess. + +The Legacy Backoffice requires the `legacy_mode` option to be enabled. +This can be done in app/config/config.yml or app/config/ezplatform.yml: + +We are using here: administration as SiteAccessName + +```yaml + +# app/config/ezplatform.yml + +ezpublish: + repositories: + default: + storage: ~ + search: + engine: %search_engine% + connection: default + siteaccess: + list: [site, administration] + groups: + site_group: [site, administration] + default_siteaccess: site + match: + URIElement: 1 + + system: + site_group: + cache_pool_name: '%cache_pool%' + var_dir: var/site + languages: [eng-GB] + + +ez_publish_legacy: + system: + administration: + legacy_mode: true +``` + + +Because your are not running the wizard you have to manually create the settings for you legacy siteaccess. +We are providing a template: +```bash +cp -r vendor/ezsystems/legacy-bridge/settings_template/* src/Acme/Bundle/LegacyBundle/legacy_settings +``` + #### Finalize the installation (as we did --no-scripts before) ```bash @@ -159,58 +205,10 @@ rewrite "^/var/storage/packages/(.*)" "/var/storage/packages/$1" break; > Please refer to doc/nginx for more information (complete vhost without these rules you need) - !! Restart your webserver !! > Yes, don't forget ;-) -#### Configure you administration siteaccess. - -The Legacy Backoffice requires the `legacy_mode` option to be enabled. -This can be done in app/config/config.yml or app/config/ezplatform.yml: - -We are using here: administration as SiteAccessName - -```yaml - -# app/config/ezplatform.yml - -ezpublish: - repositories: - default: - storage: ~ - search: - engine: %search_engine% - connection: default - siteaccess: - list: [site, administration] - groups: - site_group: [site, administration] - default_siteaccess: site - match: - URIElement: 1 - - system: - site_group: - cache_pool_name: '%cache_pool%' - var_dir: var/site - languages: [eng-GB] - - -ez_publish_legacy: - system: - administration: - legacy_mode: true -``` - - -Because your are not running the wizard you have to manually create the settings for you legacy siteaccess. -We are providing a template: -```bash -cp -r vendor/ezsystems/legacy-bridge/settings_template/* src/Acme/Bundle/LegacyBundle/legacy_settings -``` - - ### Test ! */ez* for Plaftform UI