/**
  * execute 
  *      Main wrapper command for executing rightscale fetches
  *
  * @param mixed $className 
  * @static
  * @access public
  * @return void
  */
 public static function execute($className, $forceRelogin = false)
 {
     if (!preg_match(self::CLASSNAME_REGEX, $className)) {
         $className = RS_LOC_PREFIX . $className;
     }
     if (!class_exists($className)) {
         throw new RSQueryWrapperException($className . self::MISSING_CLASS);
     } else {
         if ($className == RS_LOC_PREFIX) {
             throw new RSQueryWrapperException(self::COLLISION . RS_LOC_PREFIX);
         }
     }
     $result = null;
     $queryObj = new RSQueryObj();
     $rootClass = new $className($queryObj);
     if ($className == 'RSMultiAD') {
         $rs = new RS(NULL);
         RSDataGrouperCache::init();
         foreach ($queryObj->getArrayLoop() as $loop) {
             $rootClass->buildQueryUrl('array', $queryObj, $loop);
             $rs->addObserver($queryObj);
             RSLoginWrapper::login($rs);
             $rs->fetch($queryObj);
         }
         foreach ($queryObj->getDeploymentLoop() as $loop) {
             $rootClass->buildQueryUrl('deployment', $queryObj, $loop);
             $rs->addObserver($queryObj);
             RSLoginWrapper::login($rs);
             $rs->fetch($queryObj);
         }
         $cache = RSDataGrouperCache::getCache(true);
         if (!!($executor = RSArgParser::getExecutor())) {
             $executorObj = new $executor();
             $result = $executorObj->execute($cache);
         }
     } else {
         $rs = new RS(NULL);
         RSDataGrouperCache::init();
         foreach ($queryObj->getLoop() as $loop) {
             $rootClass->buildQueryUrl($queryObj, $loop);
             $rs->addObserver($queryObj);
             RSLoginWrapper::login($rs, $forceRelogin);
             $rs->fetch($queryObj);
         }
         $cache = RSDataGrouperCache::getCache(true);
         if (!!($executor = RSArgParser::getExecutor())) {
             $executorObj = new $executor();
             $result = $executorObj->execute($cache);
         }
     }
     return $result;
 }
 /**
  * execute 
  *      Main wrapper command for executing rightscale fetches
  *
  * @param mixed $className 
  * @static
  * @access public
  * @return void
  */
 public static function execute($className, $forceRelogin = false)
 {
     if (!preg_match(self::CLASSNAME_REGEX, $className)) {
         $className = RS_LOC_PREFIX . $className;
     }
     if (!class_exists($className)) {
         throw new RSQueryWrapperException($className . self::MISSING_CLASS);
     } else {
         if ($className == RS_LOC_PREFIX) {
             throw new RSQueryWrapperException(self::COLLISION . RS_LOC_PREFIX);
         }
     }
     $queryObj = new RSQueryObj();
     new $className($queryObj);
     $rs = new RS(NULL);
     $rs->addObserver($queryObj);
     RSLoginWrapper::login($rs, $forceRelogin);
     return $rs->fetch($queryObj);
 }
        if ($site_login && $site_pass) {
            $_REQUEST['my_login'] = $site_login;
            $_REQUEST['my_pass'] = $site_pass;
            $_REQUEST['carrier'] = $carrier;
            $_REQUEST['action'] = 'COMMENCEUPLOAD';
            echo "<center><b>Use Default login/pass...</b></center>\n";
        } else {
            html_error('Not all required values were set. Either enter your user and pass and account type, or enter them inside the file.');
        }
    } else {
        $_REQUEST['action'] = 'COMMENCEUPLOAD';
    }
}
try {
    //initiate the RS uploader class
    $rs = new RS($lfile, $_REQUEST['carrier']);
    //upload the file
    $rs->upload();
    echo "<script>document.getElementById('progressblock').style.display='none';</script>";
    $download_link = $rs->download_link;
    $delete_link = $rs->delete_link;
} catch (Exception $e) {
    html_error($e->getMessage());
}
class RS
{
    /////Only change the values below if you know what you are doing, or if you want to experiment!
    public $file;
    // the full path to the file we want to upload
    public $uploadpath = 'l3';
    // depending on your [server|pc] location you can change this to any of the carriers rs.com uses such as 'cg' or others