CodeIgniter Forums
Create Installer. Load Only for first time. i.e WordPress installer - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Create Installer. Load Only for first time. i.e WordPress installer (/showthread.php?tid=67953)



Create Installer. Load Only for first time. i.e WordPress installer - ardavan - 04-30-2017

Hi,

I'm working on my new project and need to have an Installer controller to install few things first.
If you wanna get some idea what I'm looking for, you can imagine the WordPress installer (for the very first time will install certain thing for you just with few clicks) Cool .

My Question is:
What approach is the best practice to do like that?
  1. My thought was to have a Welcome controller and check if it's the first time go to $this->installer else go to $this->homePage
  2. Change $route['default_controller']
  3. What else can be the best practice?  Huh

Thanks for your help
Ardawan


RE: Create Installer. Load Only for first time. i.e WordPress installer - InsiteFX - 04-30-2017

This may help you with what your trying to do:

ApPHP EasyInstaller FREE


RE: Create Installer. Load Only for first time. i.e WordPress installer - skunkbad - 04-30-2017

It depends what you need to install. If you're just talking about a database and database config, then you first need to check the database config exists. If it doesn't exist, allow for editing it. Once you have config, then of course you will check to see if the database exists, the tables exist, the data itself exists...


RE: Create Installer. Load Only for first time. i.e WordPress installer - webdev25 - 04-30-2017

(04-30-2017, 08:35 AM)ardavan Wrote: Hi,

I'm working on my new project and need to have an Installer controller to install few things first.
If you wanna get some idea what I'm looking for, you can imagine the WordPress installer (for the very first time will install certain thing for you just with few clicks) Cool .

My Question is:
What approach is the best practice to do like that?
  1. My thought was to have a Welcome controller and check if it's the first time go to $this->installer else go to $this->homePage
  2. Change $route['default_controller']
  3. What else can be the best practice?  Huh

Thanks for your help
Ardawan

Extend the CI_Controller ( https://www.codeigniter.com/userguide3/general/core_classes.html ) and write a method to look for a signal in the __construct() method of your controller, if it exists redirect() to your installer controller, this signal could be looking for a database or tables, looking for a file or folder permissions, whatever your application requires.

Dont forget to take into account your installer controller so your signal check doesnt trigger for that controller otherwise you'll end up in a redirect loop.


RE: Create Installer. Load Only for first time. i.e WordPress installer - creativecomputerconsulting - 05-25-2017

Have you tried Install Creator 2?

http://www.clickteam.com/install-creator-2


RE: Create Installer. Load Only for first time. i.e WordPress installer - arisroyo - 07-02-2017

Hi Guys,

I fork and improve the UI of https://github.com/mikecrittenden/codeigniter-installer
you can download mine here https://github.com/arisroyo/codeigniter-installer