lundager Posted December 17, 2012 Share Posted December 17, 2012 Hello, I'm making my own CMS, not a simple one neither a very advanced one. I just finished my installation page, where users can input their database information, and can continue on to create their admin account. My question is, I'm having a bit of a struggle figuring out, how I should check if the CMS has already been installed, and redirect the users to the login screen. I sneak peaked at wordpresses code, and saw that they check their cache and some other advanced stuff, that I couldn't really understand 100%. So does anybody have a suggestion on how I should manage to do this, or could tell me how I can do it the same way wordpress does, or something close to that! Thank you ! Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/ Share on other sites More sharing options...
Christian F. Posted December 17, 2012 Share Posted December 17, 2012 Check if there's a config file and/or if it has content, or set a constant named "INSTALLED" (or something like that). Many ways to skin a fish, after all. Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/#findComment-1399885 Share on other sites More sharing options...
WhyNotThis Posted July 13, 2013 Share Posted July 13, 2013 How did you solved your installation check? I'm searching for the best way to do it because it is a proccess that must run at the begining on every request. I'm trying to develop my CMS light and fast as possible and Wordpress costs lot of server resources and takes too long to send a response back. Christian, i want to set a constant as you told, but this only makes sense to be defined after the instalation was checked. WP makes one select for each db table to see if it exists, wouldn't be better to run only one sql statement to get the full schema? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/#findComment-1440567 Share on other sites More sharing options...
web_craftsman Posted July 13, 2013 Share Posted July 13, 2013 I suggest you try it this way: 1) index.php starts 2) it checks whether there is installation.php file 3) if there is no ===> run cms 4) if there is ===> run/( redirect to) installation.php And at the end of installation of the system you need to delete installation.php file. Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/#findComment-1440572 Share on other sites More sharing options...
trq Posted July 13, 2013 Share Posted July 13, 2013 Surely this would all be better installed via Composer these days? Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/#findComment-1440573 Share on other sites More sharing options...
WhyNotThis Posted July 13, 2013 Share Posted July 13, 2013 Thank you for the answers. I know this technic of renaming the installation folder after installing, it is used by XTCommerce (or XTC Modified, open source version), it is a shop system which i'm familiar with. But i don't want to do it this way I will take a look to Composer, but doesn't it require that every host where i install my application has Composer installed? Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/#findComment-1440607 Share on other sites More sharing options...
trq Posted July 13, 2013 Share Posted July 13, 2013 I will take a look to Composer, but doesn't it require that every host where i install my application has Composer installed? Who doesn't have composer installed these days? Even if you don't, it's a single simple command to install it. Quote Link to comment https://forums.phpfreaks.com/topic/272103-check-if-cms-is-already-installed/#findComment-1440648 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.