-
Notifications
You must be signed in to change notification settings - Fork 8
/
runserver.php
executable file
·44 lines (35 loc) · 1.21 KB
/
runserver.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
#
# Runs a web server and various other background tasks on development computers.
# (On a production server, these background tasks are run via /etc/init.d/ scripts.)
#
require_once "scripts/cmdline.php";
require_once "start.php";
function start_sphinx()
{
$sphinx_bin_dir = Config::get('sphinx:bin_dir');
$sphinx_conf_dir = Config::get('sphinx:conf_dir');
$sphinx_pid_dir = Config::get('sphinx:pid_dir');
if (!is_dir($sphinx_pid_dir))
{
mkdir($sphinx_pid_dir, 0777, true);
}
$sphinx = run_task(escapeshellcmd("$sphinx_bin_dir/searchd")." --config ".escapeshellarg("$sphinx_conf_dir/sphinx.conf"));
while (true)
{
if (Sphinx::is_server_available())
break;
echo "Waiting for sphinx to start...\n";
sleep(1);
}
return $sphinx;
}
/*
* We don't use the resource handles from proc_open, but they're necessary at least on Windows
* or proc_open will execute the process synchronously.
*/
$web_server = run_task("php scripts/web_server.php");
//$sphinx = start_sphinx();
//$qworkers = run_task("php scripts/qworkers.php");
//$cron = run_task("php scripts/cron.php");
while(true) { sleep(2); }