ElkArte Community

Elk Development => Feature Discussion => Topic started by: Joshua Dickerson on August 29, 2015, 03:41:40 pm

Title: Install directory
Post by: Joshua Dickerson on August 29, 2015, 03:41:40 pm
Not completely setup with my development environment - I still can't seem to get PHPUnit to work with PhpStorm - but I did get Elkarte installed.

After installation I automatically get redirected to /install/install.php. Not sure how I can keep the install directory so I can work on it but still test Elkarte. I don't think there is a way to do this without copying the files which is a huge pain for developers.

Instead of requiring me to delete the directory, I think we should put a setting in Settings.php $ignore_install_dir. If it is set, it will ignore the install directory warnings.

Of course, this means that we need to move the install check further down because we need to load Settings.php. So this proposal is kind of long but before I submit a PR I want to get your opinion.


Even this method seems hacky to me but it's the best solution I can come up with right now.
Title: Re: Install directory
Post by: Joshua Dickerson on August 29, 2015, 03:43:49 pm
btw, how do we not have a button to create a sub list? The editor is really missing the ability to indent.
Title: Re: Install directory
Post by: emanuele on August 29, 2015, 04:41:51 pm
Use the debug variable? If true ignore install, otherwise no?
Title: Re: Install directory
Post by: Joshua Dickerson on August 29, 2015, 05:38:16 pm
I was thinking that but I want to be able to test a page with and without debugging on. Also, this would only be for developers, not admins trying to debug their site or mod developers.
Title: Re: Install directory
Post by: Joshua Dickerson on August 29, 2015, 05:51:45 pm
I just went ahead and submitted a PR: https://github.com/elkarte/Elkarte/pull/2198

It's on my main branch so hopefully it gets merged so I don't have to rebase or do anything crazy like that.
Title: Re: Install directory
Post by: Ant59 on August 29, 2015, 06:19:01 pm
You can use the Vagrant setup I provided to avoid needing to mess about with the install directory.
Title: Re: Install directory
Post by: Joshua Dickerson on August 29, 2015, 06:48:22 pm
I wouldn't be able to edit things and then click refresh to see them changed. I'd have to do another step which defeats the purpose.

This makes it much easier for developers to develop. Anything we can do to make development faster/better we should do.

On another note, I just found a whole couple of undefined indices on my install :)
Title: Re: Install directory
Post by: Joshua Dickerson on August 29, 2015, 06:56:41 pm
Ugh, it removed the sample Settings file and I committed that change >:(

Okay, in install.php > action_checkFilesExist() instead of renaming the files, it should make a copy of the files. Is there any issue with that? If it's an issue with permissions, we can try to copy it and if that doesn't work rename it.
Title: Re: Install directory
Post by: emanuele on August 30, 2015, 04:48:20 am
If I remember correctly, yes, I did a rename to avoid altogether issues with creating new files.
No strong opinions on how to deal with it.

Title: Re: Install directory
Post by: Joshua Dickerson on August 30, 2015, 01:26:08 pm
I'm not a Git expert so I need to figure out how best to change this back. A revert will result in another commit which will be ugly.
Title: Re: Install directory
Post by: Spuds on August 30, 2015, 03:55:58 pm
Revert it an force update your branch
Title: Re: Install directory
Post by: emanuele on August 30, 2015, 05:03:09 pm
If you don't want to have the commit, you could do a rebase -i, remove the commit and then a push -f
Title: Re: Install directory
Post by: Joshua Dickerson on August 30, 2015, 05:43:00 pm
Yeah, someone else said to rebase but I don't really understand how to do it.
Title: Re: Install directory
Post by: Spuds on August 30, 2015, 06:47:46 pm
You can also start a new branch from 1.1 and then cherry pick the (2) commits from your other branch and submit that as a new PR and cancel the current ... git be wild !

A good right-click tool is tortoisegit, easier than learning the CLI.  PHPStorm also has a history view, so if you open the file you accidentally chanced, you can get the last history, save and re-commit it (undoing the changes) .. extra commit in the PR but should work as well.
Title: Re: Install directory
Post by: emanuele on August 31, 2015, 01:52:51 am
You can see rebase as an automated cherry-picking: you go back of a certain amount of commits (e.g. HEAD~6 six commits) and you do what you want with them, including removing, merging, splitting, reorder, etc.
Title: Re: Install directory
Post by: Joshua Dickerson on August 31, 2015, 06:27:19 am
As you can see I just went with revert/commit. I tried doing a reset but that didn't seem to work. Maybe I'll just use command line instead of SmartGit.
Title: Re: Install directory
Post by: Ant59 on August 31, 2015, 06:29:50 am
Quote from: Joshua Dickerson – I wouldn't be able to edit things and then click refresh to see them changed. I'd have to do another step which defeats the purpose.

That's exactly how the Vagrant setup works. What extra step do you mean?

https://github.com/Ant59/elkarte-vagrant/blob/master/provision/setup.sh
Title: Re: Install directory
Post by: Joshua Dickerson on August 31, 2015, 08:49:42 pm
You have to provision each time you make a change. I just save and refresh my browser. It's like having a local copy.
Title: Re: Install directory
Post by: Ant59 on September 01, 2015, 04:02:45 am
Quote from: Joshua Dickerson – You have to provision each time you make a change. I just save and refresh my browser. It's like having a local copy.

Certainly not :) That's what I'm trying to say. With my Vagrant setup, you just change, save and refresh. No need to re-provision.