Make update script executable from anywhere
This commit is contained in:
parent
df0866c824
commit
ace2cd93a7
10
update.php
10
update.php
|
@ -59,7 +59,6 @@ if (empty($argc) || $argc != 3) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
echo "Example:\n";
|
echo "Example:\n";
|
||||||
echo " php update.php /tmp/import oai_dc\n";
|
echo " php update.php /tmp/import oai_dc\n";
|
||||||
echo "\n";
|
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
@ -87,9 +86,16 @@ if (!is_dir($sourceDir) || !is_readable($sourceDir)) {
|
||||||
|
|
||||||
$sourceDir = rtrim($sourceDir, '/').'/';
|
$sourceDir = rtrim($sourceDir, '/').'/';
|
||||||
|
|
||||||
// Check dataDir permissions
|
// Prepend script's path if dataDir is not an absolute path
|
||||||
$dataDir = rtrim($config['dataDirectory'], '/').'/'.$metadataPrefix.'/';
|
$dataDir = rtrim($config['dataDirectory'], '/').'/'.$metadataPrefix.'/';
|
||||||
|
|
||||||
|
if (strpos($dataDir, '/') !== 0) {
|
||||||
|
|
||||||
|
$dataDir = dirname(__FILE__).'/'.$dataDir;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check dataDir permissions
|
||||||
if (!is_dir($dataDir) || !is_writable($dataDir)) {
|
if (!is_dir($dataDir) || !is_writable($dataDir)) {
|
||||||
|
|
||||||
echo "Error: $dataDir not writable\n";
|
echo "Error: $dataDir not writable\n";
|
||||||
|
|
Loading…
Reference in New Issue