diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-08-06 17:59:23 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-08-06 17:59:23 +0000 |
| commit | f8c7c32e3ea6417ccf04309ec521b39a0c20414d (patch) | |
| tree | 86befe96e554f00d25e1f3717d456ef6da470405 /boca-1.5.0/src/private/createproblemzip.php | |
| parent | d75956684f9599b8daf705b11d67c75186ea7e3f (diff) | |
| download | boca-f8c7c32e3ea6417ccf04309ec521b39a0c20414d.tar.gz boca-f8c7c32e3ea6417ccf04309ec521b39a0c20414d.zip | |
fix some concurrency issues when judging a run; update scripts to look for /etc/boca.conf if it exists
Diffstat (limited to 'boca-1.5.0/src/private/createproblemzip.php')
| -rwxr-xr-x | boca-1.5.0/src/private/createproblemzip.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/boca-1.5.0/src/private/createproblemzip.php b/boca-1.5.0/src/private/createproblemzip.php index 1b3b3cc..bbcacf9 100755 --- a/boca-1.5.0/src/private/createproblemzip.php +++ b/boca-1.5.0/src/private/createproblemzip.php @@ -16,17 +16,24 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -//Last updated 21/jul/2012 by cassio@ime.usp.br +//Last updated 06/aug/2012 by cassio@ime.usp.br $ds = DIRECTORY_SEPARATOR; if($ds=="") $ds = "/"; -if(is_readable(getcwd() . $ds . '..' .$ds . 'db.php')) { - require_once(getcwd() . $ds . '..' .$ds . 'db.php'); - @include_once(getcwd() . $ds . '..' .$ds . 'version.php'); +if(is_readable('/etc/boca.conf')) { + $pif=parse_ini_file('/etc/boca.conf'); + $bocadir = trim($pif['bocadir']) . $ds . 'src'; } else { - if(is_readable(getcwd() . $ds . 'db.php')) { - require_once(getcwd() . $ds . 'db.php'); - @include_once(getcwd() . $ds . 'version.php'); + $bocadir = getcwd(); +} + +if(is_readable($bocadir . $ds . '..' .$ds . 'db.php')) { + require_once($bocadir . $ds . '..' .$ds . 'db.php'); + @include_once($bocadir . $ds . '..' .$ds . 'version.php'); +} else { + if(is_readable($bocadir . $ds . 'db.php')) { + require_once($bocadir . $ds . 'db.php'); + @include_once($bocadir . $ds . 'version.php'); } else { echo "unable to find db.php"; exit; |