airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: setting relative experimentDataDir
Date Mon, 11 Jan 2016 17:41:46 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master ab3b0c85c -> c0ac20806


setting relative experimentDataDir


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

Branch: refs/heads/master
Commit: c0ac208064a3c6051e487d093c1d4415944d74da
Parents: ab3b0c8
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Mon Jan 11 12:41:41 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Mon Jan 11 12:41:41 2016 -0500

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


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c0ac2080/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index c0a6b35..e19cab8 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -21,6 +21,8 @@ class ExperimentUtilities
 {
     private static $experimentPath;
 
+    private static $relativeExperimentDataDir;
+
     /**
      * Launch the experiment with the given ID
      * @param $expId
@@ -196,7 +198,7 @@ class ExperimentUtilities
         if (ExperimentUtilities::$experimentPath == null) {
             ExperimentUtilities::create_experiment_folder_path();
         }
-        $userConfigData->experimentDataDir = ExperimentUtilities::$experimentPath;
+        $userConfigData->experimentDataDir = ExperimentUtilities::$relativeExperimentDataDir;
 
         $experiment = new ExperimentModel();
         // required
@@ -361,8 +363,9 @@ class ExperimentUtilities
     public static function create_experiment_folder_path()
     {
         do {
+            ExperimentUtilities::$relativeExperimentDataDir = "/" . Session::get('username')
. "/" . md5(rand() * time()) . '/';
             ExperimentUtilities::$experimentPath = Config::get('pga_config.airavata')['experiment-data-absolute-path']
.
-                "/" . Session::get('username') . "/" . md5(rand() * time()) . '/';
+                ExperimentUtilities::$relativeExperimentDataDir;
         } while (is_dir(ExperimentUtilities::$experimentPath)); // if dir already exists,
try again
         // create upload directory
         if (!mkdir(ExperimentUtilities::$experimentPath, 0755, true)) {
@@ -454,7 +457,7 @@ class ExperimentUtilities
                     $experimentInput->value = $hostPathConstant . $newInputPath;
                 }
             }
-            $experiment->userConfigurationData->experimentDataDir = ExperimentUtilities::$experimentPath;
+            $experiment->userConfigurationData->experimentDataDir = ExperimentUtilities::$relativeExperimentDataDir;
             Airavata::updateExperiment(Session::get('authz-token'), $cloneId, $experiment);
             return $cloneId;
         } catch (InvalidRequestException $ire) {
@@ -1111,7 +1114,7 @@ class ExperimentUtilities
         $experimentInputs = $experiment->experimentInputs; // get current inputs
         //var_dump($experimentInputs);
         $experimentInputs = ExperimentUtilities::process_inputs($applicationInputs, $experimentInputs);
// get new inputs
-        $experiment->userConfigurationData->experimentDataDir = ExperimentUtilities::$experimentPath;
+        $experiment->userConfigurationData->experimentDataDir = ExperimentUtilities::$relativeExperimentDataDir;
         //var_dump($experimentInputs);
 
         if ($experimentInputs) {


Mime
View raw message