Exemplo n.º 1
0
 /**
  *
  * @param CBitrixCloudOption $option
  * @return CBitrixCloudCDNClasses
  *
  */
 public static function fromOption(CBitrixCloudOption $option)
 {
     $classes = new CBitrixCloudCDNClasses();
     foreach ($option->getArrayValue() as $class_name => $extensions) {
         $classes->addClass(new CBitrixCloudCDNClass($class_name, explode(",", $extensions)));
     }
     return $classes;
 }
Exemplo n.º 2
0
 /**
  *
  * @param CBitrixCloudOption $option
  * @return CBitrixCloudCDNQuota
  *
  */
 public static function fromOption(CBitrixCloudOption $option)
 {
     $quota = new CBitrixCloudCDNQuota();
     $values = $option->getArrayValue();
     $quota->setExpires(intval($values["expires"]));
     $quota->setAllowedSize(doubleval($values["allow"]));
     $quota->setTrafficSize(doubleval($values["traffic"]));
     return $quota;
 }
Exemplo n.º 3
0
 public static function loadFromOptions($name, CBitrixCloudOption $option)
 {
     $tests = array();
     foreach ($option->getArrayValue() as $testName => $testResult) {
         $testResult = unserialize($testResult);
         if (is_array($testResult)) {
             $test = new CBitrixCloudMonitoringTest($testName, $testResult["status"], $testResult["time"], $testResult["uptime"], $testResult["result"]);
             $tests[$test->getName()] = $test;
         }
     }
     return new CBitrixCloudMonitoringDomainResult($name, $tests);
 }
Exemplo n.º 4
0
 /**
  *
  * @param CBitrixCloudOption $option
  * @return CBitrixCloudCDNServerGroups
  *
  */
 public static function fromOption(CBitrixCloudOption $option)
 {
     $groups = new CBitrixCloudCDNServerGroups();
     foreach ($option->getArrayValue() as $group_name => $servers) {
         $groups->addGroup(new CBitrixCloudCDNServerGroup($group_name, explode(",", $servers)));
     }
     return $groups;
 }
Exemplo n.º 5
0
 /**
  *
  * @param CBitrixCloudOption $option
  * @param CBitrixCloudCDNConfig $config
  * @return CBitrixCloudCDNLocations
  *
  */
 public static function fromOption(CBitrixCloudOption $option, CBitrixCloudCDNConfig $config)
 {
     $locations = new CBitrixCloudCDNLocations();
     foreach ($option->getArrayValue() as $location_name => $location_value) {
         $locations->addLocation(CBitrixCloudCDNLocation::fromOptionValue($location_name, $location_value, $config));
     }
     return $locations;
 }