From 27aaeb2ca138c3509dcbca6c5adce2a6918802b3 Mon Sep 17 00:00:00 2001 From: do3meli Date: Wed, 14 Oct 2015 11:41:41 +0200 Subject: [PATCH 1/6] removed unused .gitignore entries --- .gitignore | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 77d40a0..bcf20d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1,15 @@ # files that get generated by piLogger etc/devices.scanned -etc/piLogger.conf -etc/aliases.conf etc/*.conf -bin/.*.swp html/cache html/graphs html/xml -html/index.html include/composer.phar include/composer.lock include/vendor -# ignore AbioWire files -AbioWire +# ignore temporary, hidden system files *.swp - -# ignore some OSX files when not working directly from my raspberry pi .DS_Store .AppleDouble .LSOverride From afe411fee8734ab1a4d2d1e80f0c4399414a1be1 Mon Sep 17 00:00:00 2001 From: do3meli Date: Wed, 14 Oct 2015 11:45:24 +0200 Subject: [PATCH 2/6] moved composer.json to root directory --- .gitignore | 7 ++++--- include/composer.json => composer.json | 0 2 files changed, 4 insertions(+), 3 deletions(-) rename include/composer.json => composer.json (100%) diff --git a/.gitignore b/.gitignore index bcf20d2..3401503 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,10 @@ etc/*.conf html/cache html/graphs html/xml -include/composer.phar -include/composer.lock -include/vendor + +# composer files +composer.lock +vendor # ignore temporary, hidden system files *.swp diff --git a/include/composer.json b/composer.json similarity index 100% rename from include/composer.json rename to composer.json From aeb942a59078351049dc7b5b9d615bad3de2018f Mon Sep 17 00:00:00 2001 From: do3meli Date: Wed, 14 Oct 2015 11:47:54 +0200 Subject: [PATCH 3/6] removed unused comments --- html/api/rest.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/html/api/rest.php b/html/api/rest.php index 0339882..a875b57 100644 --- a/html/api/rest.php +++ b/html/api/rest.php @@ -1,13 +1,4 @@ Date: Wed, 14 Oct 2015 12:00:43 +0200 Subject: [PATCH 4/6] installing composer globally - close #114 --- bin/functions-upgrade | 6 +++--- setup.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/functions-upgrade b/bin/functions-upgrade index 42fb050..68a2540 100644 --- a/bin/functions-upgrade +++ b/bin/functions-upgrade @@ -270,9 +270,9 @@ function piLogger_doUpgrade_20150628-001_to_20150823-001(){ # now we can get composer and use php5-cli for it echo " - Installing composer" - cd $baseDir/include - curl -s https://getcomposer.org/installer | php - ./composer.phar install + cd $baseDir + curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer + composer install # we will restart lighttpd just to be sure it picked up the correct config file sudo dpkg -s lighttpd >/dev/null 2>&1 && { sudo /etc/init.d/lighttpd restart ; } diff --git a/setup.sh b/setup.sh index 0fcfb64..9d80fcd 100755 --- a/setup.sh +++ b/setup.sh @@ -239,9 +239,9 @@ $this_dir/bin/upgrade.sh --doIt #================================ # Run composer #================================ -cd $this_dir/include -curl -s https://getcomposer.org/installer | php -./composer.phar install +curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer +cd $this_dir +composer install cd - #================================ From 08da70e7428e5fcda121619b53d5314557daf401 Mon Sep 17 00:00:00 2001 From: do3meli Date: Wed, 14 Oct 2015 12:07:51 +0200 Subject: [PATCH 5/6] changed vendor directory path #133 --- html/api/rest.php | 3 +-- html/index.php | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/html/api/rest.php b/html/api/rest.php index a875b57..fbe593c 100644 --- a/html/api/rest.php +++ b/html/api/rest.php @@ -15,8 +15,7 @@ if(isset($ENV['debug'])) { print "apa\n"; }; require_once($_SERVER['DOCUMENT_ROOT']."/stub.php"); - require_once($root."/vendor/autoload.php"); - + require_once($root."/../vendor/autoload.php"); require_once($root . "myfunctions.inc"); #--- instantiate Slim and SlimJson diff --git a/html/index.php b/html/index.php index dde5704..0559a98 100644 --- a/html/index.php +++ b/html/index.php @@ -2,6 +2,7 @@ require_once("./stub.php"); require_once($root . "myfunctions.inc"); + require_once($root."/../vendor/autoload.php"); //set up environment for cli if (!(isset($_SERVER['DOCUMENT_ROOT']) && $_SERVER['DOCUMENT_ROOT'] !== "")) { @@ -10,16 +11,13 @@ $_SERVER['DOCUMENT_ROOT'] = __DIR__ . "/.."; $argv = $GLOBALS['argv']; array_shift($GLOBALS['argv']); - #$pathInfo = implode('/', $argv); $pathInfo = $argv[0]; } - require_once($root."/vendor/autoload.php"); - #--- instantiate Slim and SlimJson $app = new \Slim\Slim(array( 'templates.path' => 'templates') - ); + ); //if run from the command-line if ($_SERVER['HTTP_HOST'] === "cron"){ From c801cd6776e8b6cbdb2c8be6833542aca3c36ea6 Mon Sep 17 00:00:00 2001 From: do3meli Date: Wed, 14 Oct 2015 12:31:26 +0200 Subject: [PATCH 6/6] new version upgrade for composer - close #133 --- bin/functions-upgrade | 18 ++++++++++++++++++ bin/upgrade.sh | 3 ++- currentVersion | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/bin/functions-upgrade b/bin/functions-upgrade index 68a2540..37b0b81 100644 --- a/bin/functions-upgrade +++ b/bin/functions-upgrade @@ -375,3 +375,21 @@ function piLogger_doUpgrade_20150920-002_to_20151020-001(){ return $?; fi } + +#======================================== +# from 20151020-001 to 20151014-001 +#======================================== +function piLogger_doUpgrade_20151020-001_to_20151014-001(){ + + echo " - moving composer files from previous installations if necessary" + [ -d $baseDir/include/vendor ] && mv $baseDir/include/vendor $baseDir/vendor + [ -f $baseDir/include/composer.lock ] && mv $baseDir/include/composer.lock $baseDir/composer.lock + + echo " - check if composer files are at the correct place now" + if [ -d $baseDir/vendor ] && [ -f $baseDir/composer.lock ]; then + return 0; + else + return -1; + fi + +} diff --git a/bin/upgrade.sh b/bin/upgrade.sh index 1ff7df2..48a785e 100755 --- a/bin/upgrade.sh +++ b/bin/upgrade.sh @@ -103,7 +103,8 @@ versions="20150422-001 20150918-001 20150920-001 20150920-002 -20151020-001" +20151020-001 +20151014-001" fromVersion="" for toVersion in $versions diff --git a/currentVersion b/currentVersion index 1983e33..8c91102 100644 --- a/currentVersion +++ b/currentVersion @@ -1 +1 @@ -20151002-001 +20151014-001