Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Reusability of code
  • Hi all,

    I've developed an admin panel. I would like to reuse it in my future projects.

    What should I do ? Create a package ?

    The idea is to create a "package" that I will add in my future projects simply. And if I do an update of my "pcakage", I can deploy it simply updating the "package" in each project.

    Thank you in advance for your help :)
  • HarroHarro
    Accepted Answer
    FuelPHP has been designed with such re-use in mind.

    In general, modules are extensions of the application, and packages are extensions of the core.

    Since an admin panel will have controllers, a module is a more obvious candidate than a package.
  • Ok, thank you for your answer.

    And for the modules updates, is there a method ? For example, my web application is online (in production), and I made some changes in modules on my PC, in local.
    How can I update my modules online easily ?
  • There are a lot of ways to deploy an application, it is difficult to give a single-fits-all advice, it depends to much on your skills and environment.

    Some people simply ftp their entire app (or parts of it) to their production server. We use our own internal "packagist" server and deploy using composer for the applications we host ourselfs, and use RPM packages via our own yum repo server for applications we sell (as a virtual machine).

    And there are options in between, for example using git branches. We have clients for which we run the develop branch locally, and the master runs the production. A release means a merge of (parts of) develop into master, and then push master to the production server. The repo on the production server then uses a post-commit hook to deploy, and to run any migrations after deployment.

    For Fuel's online docs, we simply have the git repository as the documentroot of the website. And we have a cron job that does a "git pull" every 10 minutes, so the docs are never more than 10 minutes behind...

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion