Example #1
0
 /**
  * Get path to cache folder for the current running workflow
  *
  * @param bool $global get the global cache (default is /runtime/cache)
  *
  * @return string
  */
 public static function getCachePath($global = false)
 {
     $globalPath = self::$globalCache;
     if ($global) {
         $return = WEB_ROOT . 'sites/' . SITE_DIR . '/protected/runtime' . '/' . $globalPath . '/';
         makeWritable($return);
     } elseif (self::$workflowCachePath == null) {
         $return = WEB_ROOT . 'sites/' . SITE_DIR . '/protected/runtime' . '/' . $globalPath . '/' . WORKFLOW_ID . '/';
         self::$workflowCachePath = $return;
         makeWritable($return);
     } else {
         $return = self::$workflowCachePath;
     }
     return $return;
 }