Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: PHP Start/Stop script  (Read 5994 times)

Offline TmR

  • Full Member
  • ***
  • Posts: 94
PHP Start/Stop script
« on: February 21, 2012, 05:33:40 PM »
Alright, as requested by MordyT in here, i uploaded my self created start/stop script.
It's very (very!) simpel, code might not be that nice, but it works! :)

- edit password.php line 52. change   'password'   to your own  'p4$$w0rd' =)

- edit b3start.php line 4
Change $cmd = exec('C:\B3\b3_tmr\b3_run.exe -c C:\B3\b3_tmr\conf\b3_tmr.xml');
to your own b3_run.exe + config file location.

- It's possible, that you'll have to change the http service daemon, to run under a specific account, or that the .exe files in the b3 folder need permission to run as system.
When i run my apache as system, all i got was an 'cmd.exe' in my task list. So i changed the user as which the service is running, and it worked.

- Change your b3.xml file, in the server section (   <settings name="server"> )
add (for example, i did) :
      <set name="local_game_log">C:\B3\b3_tmr\gamelog_tmr.log</set>


The reason for this last change:
When i didnt use this line, i got me gamelog.log in my htdocs directory.
I'm using xampp for this, but any php version should work i think?!

Let me know, what you guys think, if you have any additions, ideas or whatever... tell me! :)

I'll subscribe for any questions

[attachment deleted by maintenance]
« Last Edit: February 22, 2012, 03:54:50 PM by TmR »

Offline TmR

  • Full Member
  • ***
  • Posts: 94
Re: PHP Start/Stop script
« Reply #1 on: February 22, 2012, 11:39:09 AM »
Changelog v 0.2 -- 22-2-12:
- Modified the header, with a link to this topic and b3 forums.
- Moved the menu a bit more up, so it's nice 'outlined'

Changelog v 0.1 -- 21-2-12:
Initial 'release'

ToDo:
- i'm getting password on almost every page.. need to check that out

« Last Edit: February 22, 2012, 11:42:33 AM by TmR »

Offline TmR

  • Full Member
  • ***
  • Posts: 94
Re: PHP Start/Stop script
« Reply #2 on: May 04, 2012, 10:25:30 AM »
Since we've had to change from me being host and some downtime, to a new host (unix vps), the files had to be modified. Will post a working unix version after some testing =) (thnx to [oOc]Sc0rpi0n who worked hard on the unix version)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: PHP Start/Stop script
« Reply #3 on: May 05, 2012, 03:04:51 AM »
I had something like that once. But then I figured out something better (for my requirements).
If you host the b3 on a dedicated machine and you have access to ssh there is not reason to have a bash script to start b3 and also a PHP script. My current configuration is:

- bash script (self coded with auto b3 restart after a crash)
- php function which uses ssh2_connect to launch the bash script

At least if you need to add some modification to the start script you have to do it just once ^^
But obviously is just a personal opinion ^^

Offline TmR

  • Full Member
  • ***
  • Posts: 94
Re: PHP Start/Stop script
« Reply #4 on: May 05, 2012, 04:17:36 PM »
can you post what you have now? =)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: PHP Start/Stop script
« Reply #5 on: May 05, 2012, 06:58:40 PM »
I will, after my provider put my server back online.... >:( >:( >:( >:( >:( >:(

 


Rate this page +1 at Google Search