LogoLogo
9.0.x
9.0.x
  • Overview
    • About Varbase
    • Roadmap
    • Release Cycle and Supported Versions
    • How to Get Support
  • Developers
    • Getting Started
    • Installing Varbase
      • Requirements
      • Installing Varbase with DDEV
      • Installing Varbase with Lando
    • Understanding Varbase
      • Basic Concepts
      • Core Components
        • Varbase Core
          • Varbase Admin
          • Varbase Page
          • Varbase Security
          • Varbase Webform
          • Varbase Default Content
          • Varbase Tour
        • Varbase Media
        • Varbase Editor
        • Varbase Email
        • Varbase SEO
        • Varbase Workflow
        • Varbase Layout Builder
          • Varbase Landing page (Layout Builder)
          • Varbase Heading Block
          • Varbase Rich Text Block
          • Varbase HTML Code Block
          • Varbase Media (Image/Video) Block
          • Varbase Gallery Block
        • Varbase Total Control Dashboard
        • Vartheme Claro
        • Vartheme BS4
      • Optional Components
        • Varbase API
        • Varbase Internationalization
        • Varbase Media Hero Slider
        • Varbase Carousels
        • Varbase Blog
        • Varbase Search
        • Varbase Social Single Sign-On
        • Varbase Media Twitter
        • Varbase Media Instagram
        • Varbase Content Planner
        • Varbase Bootstrap Paragraphs
          • Varbase Bootstrap Paragraphs Text and Image
        • Varbase Landing Page (Paragraphs)
      • Additional Components
        • Varbase Media Header
        • Varbase FAQs
        • Varbase Reports
        • Varbase Commerce
        • Varbase YouTube Import
      • Development Components
        • Varbase Development
        • Varbase Style Guide
        • Reroute Email
        • Varbase Updates Helper
    • Configuring a Varbase Site
      • Navigation
        • Defining Active Menu Trail Using Menu Position
      • Using View Modes Inventory
      • Content Moderation and Workflows
      • URL Aliases in Varbase/Drupal
        • Configuring URL Aliases
        • Managing URL Aliases
      • Managing URL Patterns for Multilingual Websites
      • Managing Date and Time Formats to Display Across the Site
      • Using Varbase Layout Builder
        • Creating a Landing Page With Varbase Layout Builder
        • Activating Varbase Layout Builder for Content Types
      • Configuring Pathologic When Going Live
      • Configuring SEO Features
        • Disallow Oembed Media Links
      • Configuring Security Features
        • Spam Protection
        • Password Policies
        • Other Security Kits
        • Flood Contorl
        • Enable HTTP Password Authentication
      • Configuring JSON:API Features
      • Configure Varbase Media Hero Slider
      • Configuring Varbase Media Header
      • Configuring Varbase Mailer Settings
        • Configure Symfony Mailer
        • Configure Swift Mailer
        • Switch From Swift Mailer to Symfony Mailer
      • Entity Definition Update Manager Class
      • Module Installer Factory Class
    • Theme Development with Varbase
      • Understanding The Vartheme Base Theme
      • Creating Your Own Theme
      • Local Tasks and Moderation Sidebar
      • Add Preloaded Fonts in Vartheme
      • Switch From Node SASS to Dart SASS for Old Sub-Themes
    • Launching a Varbase Site to Production
    • Updating a Varbase Site
      • Understanding Varbase Updater Package
      • Handling Patches When Updating
      • Handling Configuration Updates
      • Updating Varbase to work with Composer 2.0
      • Updating Drush to the Latest Stable Version
      • Version Update Guides
        • Updating Varbase ~9.0 to Drupal 10
        • Switch from CKEditor 4 to CKEditor 5 in Varbase ~9.1.0
        • Updating from Varbase 8.x to 9.x
    • Varbase Patches
    • Frequently Asked Questions (FAQs)
    • Extending Varbase
      • Overriding Varbase
      • Creating Your Own Feature
      • Creating A Sub Profile From Varbase
        • Varbase Sub Profile Generator
        • Varbase Sub Profile Basic Template
        • Varbase Sub Profile Basic Project Template
      • Install Needed YARN and Gulp Tools
      • Compiling Provided Component Styles
      • Check Standards/Practice Coding And Linting
  • Content Designers
    • Terminology
    • Accessing the Administration Area
      • Website Environments
    • User Management
      • Allow Email/Username Login & Registration
      • Default Roles and Site Personas
        • Edit Roles' Permissions
        • Managing Roles
      • Add User
      • Edit User
      • Masquerading as another user
    • Dashboard
      • Reports
    • Content Structure
      • EntityQueues
      • Menu Management
        • Add Menu Items
        • Update Menu Items
        • Adding a Page to the Menu
      • Taxonomies
        • Manage Vocabulary
        • Edit Vocabulary
        • List Terms
        • Add Terms
        • Reorder and Edit Terms
      • Webforms
        • Setting up Emails Handler Conditions
        • Setting up Confirmations Message Settings Types
    • Content Management
      • Create Content
        • Add a Basic page
        • Add a Landing page
        • Add Blog
        • Add Media
          • Image
          • Remote video
          • Video
      • Modify Content
      • Delete Content
      • Preview Content
      • Bulk Edit Content
      • Content Moderation
      • Publish Content
      • URL Alias
    • About Layout Builder
      • Section
      • Custom Blocks
        • Heading Block
        • Basic Block
        • Media Block(Image/Video)
        • Rich-Text Editor “WYSIWYG”
      • Managing Blocks
    • Search Engine Optimization
      • XML Sitemap
      • Meta Tags in Varbase
      • URL Redirects
      • Domain Redirects
      • Prevent a Single Content From Being Indexed
    • Site Configuration
      • System
        • Clearing Varbase Cache
        • Google analytics
        • Mail templates
      • User interface
      • Development
      • Varbase settings
      • Web services
    • Common Error Handling Tips
  • Contributing
    • Contributing to Documentation
Powered by GitBook
On this page
  1. Developers
  2. Updating a Varbase Site

Updating Varbase to work with Composer 2.0

PreviousHandling Configuration UpdatesNextUpdating Drush to the Latest Stable Version

Last updated 1 year ago

Recommended to read:

As for and , Varbase works with both Composer 1.0 and Composer 2.0

Recommended to build all new Varbase Projects with Composer 2.0

If the site was built recently with the listed latest releases or , but the project was built using the Composer 1.0 version. The site is ready to start using Composer 2.0

Only update the Composer from 1.0 to 2.0

Do acomposer updateto update the autoloaders, namespaces map, and classes map.

If the site was built with Varbase 8.8.7 and older, Follow the following steps:

Step #1: Update composer to latest composer 1.0 by

composer self-update --1

Step #2: Update Varbase projectcomposer.josn file

Change the following:

    "composer/installers": "~1.0",
    "oomphinc/composer-installers-extender": "~1.0",
    "cweagans/composer-patches": "~1.0",
    "drupal/drupal-library-installer-plugin": "^0.3",

To:

    "composer/installers": "~2.0",
    "oomphinc/composer-installers-extender": "~2.0",
    "cweagans/composer-patches": "~1.0",

Remove drupal/drupal-library-installer-plugin

Step #3: Update Varbase to 8.8.8 or 9.0.0-rc1 with Composer 1.0

cd /PATH_TO_THE_PROJECT
composer update -vvv

Repeat this composer update 2 or 3 times to make sure that their are no updates

Step #4: Update composer to latest composer 2.0 by

composer self-update --2

Step #5: Rebuild the autoloader for map of classes and namespaces

cd /PATH_TO_THE_PROJECT
rm -rf composer.lock bin/ vendor/ docroot/modules/contrib/ docroot/themes/contrib/ docroot/profiles/varbase/ docroot/libraries/
composer install -vvv
cd docroot/
drush cr

At this point the autoload and real autoload files + mapping should be changed.

When having any custom composer plugins or still having issues. Or if modules are using the old way of autoloading

Custom Composer plugins must have "composer-plugin-api": "^1.1 || ^2"

Make sure that the root composer.json file do not have invalid PSR-0 / PSR-4 . And the class configurations will not autoload anymore in optimized-autoloader mode, as per the warnings introduced in 1.10

Known issues:

Update the root composer.json file with the following composer config

  "config": {
    "bin-dir": "bin/",
    "secure-http": false,
    "optimize-autoloader": true,
    "preferred-install": {
      "drupal/core": "dist"
    },
    "allow-plugins": {
      "composer/installers": true,
      "cweagans/composer-patches": true,
      "oomphinc/composer-installers-extender": true,
      "drupal/core-composer-scaffold": true,
      "drupal/core-project-message": true,
      "vardot/varbase-updater": true
    }
  },

Rebuild the autoloader for map of classes and namespaces

cd /PATH_TO_YOUR_PROJECT
rm -rf composer.lock bin/ vendor/ docroot/modules/contrib/ docroot/themes/contrib/ docroot/profiles/varbase/ docroot/libraries/
composer install -vvv
cd docroot/
drush cr

Check the complete changelog.

After was released 2021-12-22

Fixed plugin autoloading including files autoload rules from the root package ()

Composer 2.0 is now available!
Upgrade guides for Composer 1.x to 2.0
Varbase 8.8.8
Varbase 9.0.0-rc1
Varbase 8.8.8
Varbase 9.0.0-rc1
https://github.com/composer/composer/releases/tag/2.0.0
Composer 2.0 issue for bower-asset/jqueryui-touch-punch library default branch
Composer 2.2.1
#10382