You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/07/13 19:25:18 UTC

[24/42] airavata-php-gateway git commit: fixing experiment data root misconfiguration issues

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/ae461127
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/ae461127
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/ae461127

Branch: refs/heads/airavata-php-gateway-0.15-release
Commit: ae4611273a00b219b7200b90dffbf9b78bcb88aa
Parents: d5290f5
Author: Supun Nakandala <sc...@apache.org>
Authored: Thu Jun 25 02:05:50 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Thu Jun 25 02:05:50 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/ae461127/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index eb4a987..34d8ac9 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)) {