When you have finished the phpBB first installation next to login a button saying 'Delete install file' which would then remove /install/
So basiclly means the end-user does not have to go into FTP and delete /install/ themselves after installation.
Install File Auto-Remove
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Install File Auto-Remove
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
Re: Install File Auto-Remove
Most Unix-like environments would not have permissions set allowing such button to work, I would think. Could be handy for other environments though, but in those you may be unable to remove a directory in which the file being executed is placed (you were thinking of having this functionality in installer, yes?).
Re: Install File Auto-Remove
Since the actual executable is either the webserver or PHP that should not be an issue.nn- wrote:Could be handy for other environments though, but in those you may be unable to remove a directory in which the file being executed is placed (you were thinking of having this functionality in installer, yes?).
Re: Install File Auto-Remove
If php either 1) does chdir into directory of script being executed, which is a very reasonable expectation considering how file-related functions work, or 2) holds script file open for reading while the script is being executed, I suspect windows will not allow you to remove the script's directory.
If so, auto-remove functionality as described would only work in a very limited number of environments.
I suggest writing a script which attempts to delete itself and the directory it's in, and running it on windows to ascertain whether this approach works.
E.g. try this code under cygwin:
Edit: running php from console does not change working directory; for proper results you'll have to invoke php script via web browser.
I tested it on my machine and it works with proper permissions, which of course I will never use on a production system if I have any choice over the matter.
If so, auto-remove functionality as described would only work in a very limited number of environments.
I suggest writing a script which attempts to delete itself and the directory it's in, and running it on windows to ascertain whether this approach works.
E.g. try this code under cygwin:
Code: Select all
mkdir -p install &&
cat >install/remove.php <<EOT &&
<?php
unlink("$PWD/install/remove.php");
rmdir("$PWD/install");
EOT
php install/remove.php &&
! test -e install &&
echo Success
I tested it on my machine and it works with proper permissions, which of course I will never use on a production system if I have any choice over the matter.
Re: Install File Auto-Remove
I think this would be a good idea, the installer should check if it can delete the folder. If that's not possible, it can ask the user for FTP/SFTP credentials or to do it manually.
Re: Install File Auto-Remove
First see if it already has permissions to delete it.
If not run the
command for the install file changing it so it can be deleted. (For more info about PHP chmodding files see here)
If that doesn't work as some webservers don't allow PHP to chmod it could ask for SFTP/FTP login credentials.
Basiclly what evil said except for the attempt to chmod the install file before asking the user for FTP details.
If not run the
Code: Select all
bool chmod ( string $filename , int $mode )
If that doesn't work as some webservers don't allow PHP to chmod it could ask for SFTP/FTP login credentials.
Basiclly what evil said except for the attempt to chmod the install file before asking the user for FTP details.
Formerly known as Unknown Bliss
No unsolicited PMs please except for quotes.psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"