-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: UCS command line updater cannot run because of undefined constant
Fixed: UCS command line updater changed to ucs_upload.sh.php and run with "commandlineshell# php -f ucs_upload.sh.php
- Loading branch information
Showing
4 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/bin/php | ||
<?php | ||
/** | ||
* Copyright (C) 2010 Arie Nugraha ([email protected]) | ||
|
@@ -21,14 +20,21 @@ | |
|
||
/* Send ALL Catalog data to UCS server */ | ||
|
||
// check if we are running from command line or not | ||
if (php_sapi_name() != 'cli') { | ||
die('This script intended to be run on command line interface only!'); | ||
} | ||
|
||
set_time_limit(0); | ||
|
||
define('INDEX_AUTH', 1); | ||
|
||
// main system configuration | ||
require '../../../sysconfig.inc.php'; | ||
|
||
// check if UCS is enabled or not | ||
if (!$sysconf['ucs']['enable']) { | ||
die(__('UCS is not enabled! Change global system configuration to enable UCS')); | ||
die(__('UCS is not enabled! Change global system configuration to enable UCS')); | ||
} | ||
|
||
require SB.'ucnode.inc.php'; | ||
|
@@ -99,3 +105,4 @@ | |
} else { | ||
exit(0); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ function stripslashes_deep($value) | |
$_REQUEST = array_map('stripslashes_deep', $_REQUEST); | ||
} | ||
// turn off all error messages for security reason | ||
@ini_set('display_errors',true); | ||
@ini_set('display_errors', true); | ||
// check if safe mode is on | ||
if ((bool) ini_get('safe_mode')) { | ||
define('SENAYAN_IN_SAFE_MODE', 1); | ||
|
@@ -104,7 +104,7 @@ function stripslashes_deep($value) | |
// senayan web doc root dir | ||
/* Custom base URL */ | ||
$sysconf['baseurl'] = ''; | ||
$temp_senayan_web_root_dir = preg_replace('@admin.*@i', '', dirname($_SERVER['PHP_SELF'])); | ||
$temp_senayan_web_root_dir = preg_replace('@admin.*@i', '', dirname(@$_SERVER['PHP_SELF'])); | ||
define('SWB', $sysconf['baseurl'].$temp_senayan_web_root_dir.(preg_match('@\/$@i', $temp_senayan_web_root_dir)?'':'/')); | ||
|
||
// admin section web root dir | ||
|
@@ -153,12 +153,12 @@ function stripslashes_deep($value) | |
header('Content-type: text/html; charset=UTF-8'); | ||
|
||
/* GUI Template config */ | ||
ob_start(); | ||
include $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/tinfo.inc.php'; | ||
ob_end_clean(); | ||
$sysconf['template']['dir'] = 'template'; | ||
$sysconf['template']['theme'] = 'default'; | ||
$sysconf['template']['css'] = $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/style.css'; | ||
ob_start(); | ||
include $sysconf['template']['dir'].'/'.$sysconf['template']['theme'].'/tinfo.inc.php'; | ||
ob_end_clean(); | ||
|
||
/* ADMIN SECTION GUI Template config */ | ||
$sysconf['admin_template']['dir'] = 'admin_template'; | ||
|
@@ -484,7 +484,7 @@ function stripslashes_deep($value) | |
// OAI-PMH settings | ||
$sysconf['OAI']['enable'] = false; | ||
$sysconf['OAI']['identifierPrefix'] = 'oai:slims/'; | ||
$sysconf['OAI']['Identify']['baseURL'] = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].SWB.'oai.php'; | ||
$sysconf['OAI']['Identify']['baseURL'] = 'http://'.@$_SERVER['SERVER_NAME'].':'.@$_SERVER['SERVER_PORT'].SWB.'oai.php'; | ||
$sysconf['OAI']['Identify']['repositoryName'] = 'SLiMS Senayan Library Management System OAI-PMh'; | ||
$sysconf['OAI']['Identify']['adminEmail'] = '[email protected]'; | ||
$sysconf['OAI']['Identify']['granularity'] = 'YYYY-MM-DDThh:mm:ssZ'; | ||
|
@@ -528,7 +528,7 @@ function stripslashes_deep($value) | |
/* MYSQLI */ | ||
$dbs = @new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME, DB_PORT); | ||
if (mysqli_connect_error()) { | ||
die('<div style="border: 1px dotted #FF0000; color: #FF0000; padding: 5px;">Error Connecting to Database. Please check your configuration</div>'); | ||
die("Error Connecting to Database with message: ".mysqli_connect_error().". Please check your configuration!\n"); | ||
} | ||
} else { | ||
/* MYSQL */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters