Fuel CMS as dependency

edited December 2015 in News & Announcements
Hi there,

I think this question is asked before but i couldn't find an answer which cover my needs.

We got an Fuel CMS project which covers around 11 websites with the same base. To keep this up to date is an time consuming task. So I want to discover a way to load Fuel CMS as an submodule (or dependency in composer) so it's possible to set the new version in an instant.

The problem we got here is that offcourse the config files are in the application folder and would be overridden. Same with the Modules folder and the custom views.

I can't imagine some of you guys haven't found an solid solution for this and i would love to hear them.

Kind regards,
Augus

Comments

  • I use git to control the source via GitLab repos and use a deployment php script (with a GitLab web-hook) to pull in the changed files. By using .gitignore file, you can specify what you want to update and what to leave alone.

    For sites running off the same server, it would be nice to find a way to store a single copy of Fuel outside the www directory and link to it. I've seen comments online saying that CodeIgniter can do this but haven't ever looked at whether Fuel could. I'm guessing this is what you're after? Me too, I've just never got around to looking into it since most of my sites are published onto 3rd party shared hosting...
  • edited 5:01AM
    The fuel_constants.php file has a MODULES_FOLDER and constant defined which specifies where, relative to the application folder, the module folders are stored. The tricky thing then is if there are any changes to the application folder, which doesn't happen that often but does from time to time (additional configs, default views, etc), those changes would need to be manually updated across all the specific application folders. Additionally, the index.php file needs to have the system and application folders adjusted. There are also fuel/module/fuel/assets/ files that needs to remain below the web root.

    Here are some of the steps I took to separate the application and fuel module folders

    1. Moved the entire fuel folder to above the web root directory one level
    2. From the moved fuel folder, moved the application folder to exist right next to it at the same level above the web root and renamed the folder from application to just website (could be your website name)
    3. Changed the application/config/constants.php line 40 to:
    include_once(APPPATH.'../fuel/modules/fuel/config/fuel_constants.php');
    4. Change the INSTALL_ROOT constant in the CI index.php bootstrap to include an additional ../ like so:
    define('INSTALL_ROOT', str_replace('\\', '/', realpath(dirname(__FILE__))).'/../fuel/');
    5. Also in the index.php file, change the $application_folder variable to:
    $application_folder = INSTALL_ROOT.'../website';
    6. Changed the MODULES_FOLDERS constant in fuel/modules/fuel/config/fuel_constants.php to:
    define('MODULES_FOLDER', '../fuel/modules');
    7. Move the fuel/modules/fuel/assets folder to the web root (so the paths wouldn't change. There is a $config['fuel_assets_path'] FUEL config value that can be specified if this needs to be adjusted.
    8. Move the fuel/index.php file so that /fuel/ will properly redirect

    The final folder structure looks like the following:
    fuel website |__index.php |__/fuel/modules/fuel/assets/ |__/fuel/index.php
    Also, I just pushed a change to the develop branch which would allow you to define the MODULES_FOLDER path in your index.php file.
  • edited 5:01AM
    Hi,

    I tried this but this doesn't really creates the situation i want to have. My main problem is that i want to create a composer file which would be able to just update fuelCMS to it's latest version from github.

    This isn't possible at the moment cause almost all configuration and modules MUST be placed inside this project. So somehow i need to or override them, or be able to create some sort of inclusion of fuelCMS where i can create my own modules and set my own config in a seperate folder.
Sign In or Register to comment.