aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.0/src/private/createproblemzip.php
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-06 17:59:23 +0000
committercassiopc <cassiopc@gmail.com>2012-08-06 17:59:23 +0000
commitf8c7c32e3ea6417ccf04309ec521b39a0c20414d (patch)
tree86befe96e554f00d25e1f3717d456ef6da470405 /boca-1.5.0/src/private/createproblemzip.php
parentd75956684f9599b8daf705b11d67c75186ea7e3f (diff)
downloadboca-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-xboca-1.5.0/src/private/createproblemzip.php21
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;