Skip to content
Snippets Groups Projects
Commit caa8c23d authored by alvaro's avatar alvaro
Browse files

Merge branch 'master' into hotfixes

parents babde289 bcda7de3
No related branches found
No related tags found
No related merge requests found
......@@ -71,13 +71,19 @@ class ServiceModule extends abstractModule{
}
}
$segmentConnector = "";
for($i=0;$i<sizeof($params);$i++){
$auxPrefix = Utils::getPrefix($params[$i]);
if($auxPrefix['ns'] != NULL){
$prefixHeader[] = $auxPrefix;
}
$args["arg".$i]=$params[$i];
$args["all"] .= $segmentConnector.$params[$i];
if($segmentConnector == ""){
$segmentConnector = "/";
}
}
var_dump($_SERVER['QUERY_STRING']);exit(0);
$results['params'] = $params;
......
......@@ -9,7 +9,7 @@ if [[ $# -eq 0 || "$1" == "--help" ]]; then
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
operations=( create delete debug backup )
operations=( create delete debug backup restore )
currentOperation=
if [[ ${operations[@]} =~ $1 ]]; then
......@@ -25,6 +25,11 @@ if [[ $currentOperation == "backup" ]]; then
$DIR/modules/backup.sh
fi
## Restore
if [[ $currentOperation == "restore" ]]; then
$DIR/modules/restore.sh
fi
## Create/delete
if [[ $currentOperation == "create" || $currentOperation == "delete" ]]; then
modules=( type service uri )
......
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BACKUPDIR=$HOME/lodspeakr_backup
cd $DIR
BASE=`php getvar.php basedir`
NAME=`echo $BASE |sed -e 's/^http:\/\///g' -e 's/\/$//g' -e 's/\//_/g'`
cd $DIR/../..
BACKUPDIR=$HOME/lodspeakr_backup
if [[ ! -d $BACKUPDIR ]]; then
echo "WARNING: No $BACKUPDIR dir. Creating it." >&2
mkdir $BACKUPDIR
......@@ -13,7 +17,7 @@ if [[ ! -d $BACKUPDIR ]]; then
exit 1
fi
tmpFile=lodspeakr_backup_`date +%Y%m%d%H%M%S`.tar.gz
tmpFile=$NAME"-backup-"`date +%Y%m%d%H%M%S`.tar.gz
tar -czf $tmpFile settings.inc.php models views
......
<?
//error_reporting(E_ERROR);
require_once('../../settings.inc.php');
echo $conf[$argv[1]];
?>
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
BASE=`php getvar.php basedir`
NAME=`echo $BASE |sed -e 's/^http:\/\///g' -e 's/\/$//g' -e 's/\//_/g'`
cd $DIR/../..
BACKUPDIR=$HOME/lodspeakr_backup
if [[ ! -d $BACKUPDIR ]]; then
echo "ERROR: No $BACKUPDIR dir." >&2
exit 1
fi
LIST=( `ls $BACKUPDIR/$NAME-backup*` )
CHOSEN=-1
while [[ "$CHOSEN" -lt 0 || "$CHOSEN" -ge "${#LIST[@]}" ]] ;do
j=0
echo
echo "Choose from the following available backups"
for i in ${LIST[@]}; do
echo "["$j"]" `basename $i`
let j=$j+1
done
echo -n "Select which backup to restore: "
read -u 1 CHOSEN
done
echo
echo "*** ATTENTION ***"
echo "Are you sure you want to restore this backup? This may lead to overrite settings.inc.php, models/ and views/"
echo -n "(write 'yes' if you are sure): "
confirm=no
read confirm
if [[ "$confirm" != "yes" ]];then
echo "Nothing done"
exit 0
fi
RESTORE=`basename ${LIST[$CHOSEN]}`
echo "Restoring "$RESTORE"..."
cp ${LIST[$CHOSEN]} .
tar zxf $RESTORE
if [[ $? -eq 0 ]];then
echo Restore successful
else
echo A problem occurred in the restoring process
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment