version: #4 (current)  |  last edited by: romcart  |  on: tuesday, march 23, 2010, 5:40 pm pdt (about 5 months ago)


Upgrading from Qcodo 0.3.x to 0.4.x

For the most part, upgrading from your Qcodo 0.3.x-based application to Qcodo 0.4.x should be pretty straightforward.  I've migrated a few applications thus far and for the most part, as long as you're not doing too many customizations inside of _core directories, the process should only take 1-2 hours, as long as you follow the following steps, ESPECIALLY Step #1.

So the following is a BASIC set of instructions to help/assist with the Qcodo update process.  Please keep in mind that since so many Qcodo installations are different due to different folder hierarchies and structures, customizations to both core and non-core files, etc., these instructions should simply be used as a guideline and should NOT be blindly followed.

Also, note that I have assumed a default Qcodo 0.3.x folder structure -- remember that the folder structure differs from Qcodo 0.3.x and 0.4.x in a few small but significant ways, namely:

  • includes has been moved outside of wwwroot/
  • wwwroot has been renamed to www
  • _devtools_cli has been renamed cli
  • wwwroot/_devtools have been removed
  • wwwroot/examples no longer exists (it is now its own QPM package)

But the good news is that you can continue to follow the old 0.3.x folder hierarchy if you wish, or you can manually move to the 0.4.x hierarchy, or you can continue using whatever custom folder hierarchy you wish -- that is the beauty of the directory constants in configuration.inc.php!

The only other really significant thing to address is that prepend.inc.php has been simplified tremendously, and that a new QApplication.class.php file has taken over a lot of what prepend.inc.php used to do.  This will be addressed in the installation guidelines below.

Installation Guidelines

Remember: these are guidelines/suggestions and should NOT be followed blindly!  All commands are being run assuming you are in the top level directory in your qcodo installation (e.g. the directory that contains your wwwroot and _devtools_cli directory), and the commands assume a unix/mac/linux OS and an update to 0.4.14.  Obviously, if you have a different OS and/or are upgrading to a different version of 0.4.x Qcodo and/or a folder hierarchy, make adjustments accordingly.

  1. New Manifest Directory
    • Because manifest is in a new location, we will need to have both manifest locations valid as we do this update process.
    • mkdir wwwroot/includes/qcodo/_core/manifest
    • cp wwwroot/includes/qcodo/_core/manifest.xml wwwroot/includes/qcodo/_core/manifest
  2. Run the Qcodo Updater
    • _devtools_cli/qcodo_updater.cli stable
    • Be sure to keep tabs on any files that you end up “Save As” and renaming
    • You will likely get an error in the report saying “Unable to download file from webservice for version 0.4.14: _QCODO_CORE_ manifest.xml [File Not Found]” - this is fine for now
  3. Create the QApplication class file
    • cp wwwroot/includes/qcodo/_core/QApplication.class.php-dist wwwroot/includes/QApplication.class.php
  4. Update the QApplication Class File
    • Copy any contents of your QApplication class definition from prepend.inc.php to QApplication.class.php
  5. Toss out any other customizations in your old prepend.inc.php
    • Move any other customizations in prepend.inc.php to it's own new file in the auto_include folder
  6. Get rid of your old prepend.inc.php
    • At this point, you should be able to replace your old prepend.inc.php file
    • mv wwwroot/includes/prepend\ \(0.4.14\).inc.php wwwroot/includes/prepend.inc.php
  7. Setup and Test the Qcodo CLI
    • chmod ugo+x _devtools_cli/qcodo
    • you obviously do not need to chmod anything if on Windows, but you may want to ensure the contents of _devtools_cli/qcodo.bat are correct
    • you may need to update the relative path to your includes directory as defined in _devtools_cli/qcodo_cli.inc.php
    • go ahead and run _devtools_cli/qcodo or _devtools_cli/qcodo.bat -- if you see the instructions and no errors, then it's working properly
  8. Download New and Delete Old Manifest
    • devtools_cli/qcodo qcodo-downloader 0.4.14 __QCODO_CORE_ manifest/manifest.xml wwwroot/includes/qcodo/_core/manifest/manifest.xml
    • rm wwwroot/includes/qcodo/_core/manifest.xml
  9. Fix Up Any Other Files
    • At this point, you should go through all the “Saved As...” files from Step #1 and reconcile any differences between your customized version and the distribution version.  Be sure to do this for all files.
  10. Remove Old PHP Assets
    • There are a lot of files in the old PHP Assets directory that aren't true PHP Assets, and thus have been moved elsewhere
    • To avoid confusion, remove any files that are NOT supposed to be in wwwroot/assets/php/_core anymore
    • For a list of the current set of files that are in the current distribution, you can refer to GitHub
    • Finally, you may need to update the relative path to your prepend.inc.php file as defined in wwwroot/assets/php/_require_prepend.inc.php
  11. Remove Old CLI Commands
    • In the same vein, to avoid confusion, remove any old _devtools_cli that use the old “cli_prepend.inc.php”-based approach of running Qcodo CLI
  12. Create the codegen.xml file
    • cp _devtools_cli/settings/codegen.xml-dist _devtools_cli/settings/codegen.xml
  13. Replace old configuration.inc.php
    • Backup your old configuration.inc.php
    • cp wwwroot/includes/qcodo/_core/configuration.inc.php-dist wwwroot/includes/configuration.inc.php
    • Apply customizations from old configuration.inc.php to the new one

That should do it!  If you have any questions/issues, please feel free to post.  If you see any mistakes or corrections that can be made to this Wiki page, please feel free to edit and fix -- remember, all Wiki Pages are versioned, so there's no risk of you messing anything up. =)



Copyright © 2005 - 2010, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.