airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject [23/40] airavata-php-gateway git commit: fixing experiment data root misconfiguration issues
Date Tue, 14 Jul 2015 16:38:28 GMT
fixing experiment data root misconfiguration issues


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/86542bc1
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/86542bc1
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/86542bc1

Branch: refs/heads/0.15-release-branch
Commit: 86542bc16d52b3910d080ae8116f0ae5ed31e230
Parents: f97fcd5
Author: Supun Nakandala <scnakandala@apache.org>
Authored: Thu Jun 25 02:05:50 2015 +0530
Committer: Supun Nakandala <scnakandala@apache.org>
Committed: Thu Jun 25 02:06:40 2015 +0530

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/86542bc1/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index a5c83a6..e0885b7 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -81,7 +81,7 @@ class ExperimentUtilities
             if ($matchingAppInput->type == DataType::URI) {
                 $explode = explode('/', $input->value);
                 echo '<p><a target="_blank"
-                        href="' . URL::to("/") . "/../../" . Config::get('pga_config.airavata')['experiment-data-root']
. $explode[sizeof($explode) - 2] . '/' . $explode[sizeof($explode) - 1] . '">' .
+                        href="' . URL::to("/") . Config::get('pga_config.airavata')['experiment-data-dir']
. $explode[sizeof($explode) - 2] . '/' . $explode[sizeof($explode) - 1] . '">' .
                     $explode[sizeof($explode) - 1] . '
                 <span class="glyphicon glyphicon-new-window"></span></a></p>';
             } elseif ($matchingAppInput->type == DataType::STRING) {
@@ -161,10 +161,9 @@ class ExperimentUtilities
         $advHandling = new AdvancedOutputDataHandling();
         $sshUser = "root";
         $hostName = $_SERVER['SERVER_NAME'];
-        $expPathConstant = 'file://' . $sshUser . '@' . $hostName . ':' . Config::get('pga_config.airavata')['experiment-data-root'];
+        $expPathConstant = 'file://' . $sshUser . '@' . $hostName . ':' . Config::get('pga_config.airavata')['experiment-data-absolute-path'];
 
-        $advHandling->outputDataDir = str_replace(base_path() . Config::get('pga_config.airavata')['experiment-data-root'],
-            $expPathConstant, ExperimentUtilities::$experimentPath);
+        $advHandling->outputDataDir = Config::get('pga_config.airavata')['experiment-data-absolute-path'];
         $userConfigData->advanceOutputDataHandling = $advHandling;
 
         //TODO: replace constructor with a call to airvata to get a prepopulated experiment
template
@@ -288,8 +287,7 @@ class ExperimentUtilities
                         $experimentAssemblySuccessful = false;
                     }
 
-                    $experimentInput->value = str_replace(base_path() . Config::get('pga_config.airavata')['experiment-data-root'],
-                        ExperimentUtilities::get_path_constants(), $filePath);
+                    $experimentInput->value = Config::get('pga_config.airavata')['experiment-data-absolute-path'];
                     $experimentInput->type = $applicationInput->type;
 
                 } else {
@@ -325,7 +323,8 @@ class ExperimentUtilities
     public static function create_experiment_folder_path()
     {
         do {
-            ExperimentUtilities::$experimentPath = base_path() . Config::get('pga_config.airavata')['experiment-data-root']
. str_replace(' ', '', Session::get('username')) . md5(rand() * time()) . '/';
+            ExperimentUtilities::$experimentPath = Config::get('pga_config.airavata')['experiment-data-absolute-path']
.
+                "/" . str_replace(' ', '', Session::get('username')) . md5(rand() * time())
. '/';
         } while (is_dir(ExperimentUtilities::$experimentPath)); // if dir already exists,
try again
         // create upload directory
         if (!mkdir(ExperimentUtilities::$experimentPath)) {


Mime
View raw message