Upgrading from 0.5.1 to 0.6
Before you start the upgrade process please take a full backup of both your website files and also your database. Please also take your site offline by replacing the index.php file with a static one.
Important: Please read the documentation on the new Asset Library and Site Library before continuing with the upgrade process.
Step 1: Update Files
Replace the files in the following folders with the newly downloaded versions.
- assets
- modules
- system/application
Note: If you have any custom developed files in these folders please make copies of them first. This may include customer user authentication and custom website preference forms.
Step 2: Upgrade from old Page Library to Site Library
Since this update uses a new library you will have to update some old code you made calls to, please run the follow replacements on your website code:
- Replace page->icon with bep_assets->icon.
- Replace page->set_metatag with bep_site->set_metatag.
- Replace page->set_crumb with bep_site->set_crumb.
- Replace page->set_variable with bep_site->set_variable.
- Replace page->set_js with bep_site->set_js_block.
- Replace page->output_js with bep_site->get_js_blocks.
- Do a search for $this->page->output_metatags(), the new method only returns the string so you will have to print it now as well (where as the old method could do both) replace with print $this->bep_site->get_metatags().
- Do a search for $this->page->output_breadcrumb(), the new method only returns the string so you will have to print it now as well (where as the old method could do both) replace with print $this->bep_site->get_breadcrumb().
- Do a search for $this->page->output_variables() the new method only returns the string so you will have to print it now as well (where as the old method could do both) replace with print $this->bep_site->get_variables().
- Do a search for $this->page->output_assets the new method only returns the string so you will have to print it now as well (where as the old method could do both) replace with print $this->bep_assets->get_header_assets().
Step 3: Relocate JS to PHP Variables
We must now relocate the default JS to PHP variable array. Open modules/page/config/page.php and locate default_page_variables. Copy the contents of the array and now open modules/site/config/bep_site.php. Paste the contents of the array into default_site_variables.
Step 4: Add the new get_footer_assets() code
The new Asset Library comes with the ability to output assets to the footer of the page (please read the documentation as to why). In any non BackendPro container view you must add the following code just before the </body> tag.
print $this->bep_assets->get_footer_assets();
Step 5: Transfer current assets over to the new Asset Library
Copy all shared/public/admin css/js assets into there new folders assets/css/ & assets/js/ respectively. You may need to give some of them unique names.
Now open modules/site/config/bep_assets.php and setup your new asset references and asset groups.
You will then need to do a search for page->set_asset and replace any old asset loading code with the new bep_assets->load_asset code.
Step 6: Delete Page Module
Once you are happy with the new Asset and Site Libraries working fine, delete the old Page module folder and old admin/public/shared asset folders.
Step 7: Update the Database
Please run the following SQL queries on your BackendPro database:
- DELETE FROM `be_preferences` WHERE `be_preferences`.`name` = 'maintenance_message';
- DELETE FROM `be_preferences` WHERE `be_preferences`.`name` = 'maintenance_mode';
Step 8: Update your user guide
Please replace your local copy of the user guide with the new version, including the image files.