reload / restart

General discussions related to php

Moderators: macek, egami, gesf

skipzoid
New php-forum User
New php-forum User
Posts: 1
Joined: Sat Mar 09, 2013 6:13 am

reload / restart

Postby skipzoid » Sat Mar 09, 2013 6:38 am

Hello,
I'm working on a script that am constantly developing and tweaking about with. It will be running on a remote machine which i often wont have direct access too but will want the script to terminate and restart, mainly when i have changed something and need the changes to take effect.

I've thought of a few different ways to do this and wondered what other suggestions people might have.

My thought was to have a bootstrap script that then runs the second script, the second script from time to time checks for a new version of its self and if one exists it exits, returning back to the parent script which in turn starts the second script again.

viper94x
New php-forum User
New php-forum User
Posts: 15
Joined: Mon Apr 16, 2012 2:15 am
Location: Netherlands

Re: reload / restart

Postby viper94x » Tue Mar 12, 2013 2:02 am

Could you explain 'running'. PHP scripts only run when a user makes a request, so its not like a windows program that runs all the time.
If you mean disabling, I would create a secure (pass protected) page which lets you disable / enable the script.
So:
Protected page will update a mysql table.
When the ' running' script is prompted it will check for that value in the mysql table, if set to false don't run the code. If set to true, run the code.

If you need help coding, let me know in a PM

Sam

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: reload / restart

Postby seandisanti » Tue Mar 12, 2013 8:20 am

yeah, assuming you're using ftp to update your script; each time its run, only the newest version will be run. If you're not doing it that way, you definitely should be.


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron