コード例 #1
0
 /**
  * Get the test configuration overlay (configuration overwritten in instance)
  *
  * @param integer $testUid UID of the test
  * @return array
  */
 public function getTestConfigurationOverlayForTestUid($testUid)
 {
     $overlayConfig = FALSE;
     if ($this->testConfigurationOverlay) {
         $fftools = new t3lib_flexformtools();
         $tests = $fftools->getArrayValueByPath('data/sDEF/lDEF/testconfigurations/el', $this->testConfigurationOverlay);
         if (is_array($tests)) {
             foreach ($tests as $key => $el) {
                 if ($tests[$key]['test']['el']['test_service']['vDEF'] == $testUid) {
                     $overlayConfig = $tests[$key]['test']['el']['test_conf']['vDEF'];
                     $overlayConfig['hidden'] = $tests[$key]['test']['el']['test_hidden']['vDEF'];
                     $overlayConfig['overwritten_in']['title'] = $this->title;
                     $overlayConfig['overwritten_in']['uid'] = $this->uid;
                     $overlayConfig['overwritten_in']['id'] = $this->getCaretakerNodeId();
                 }
             }
         }
     }
     if (!$overlayConfig && $this->parent && method_exists($this->parent, 'getTestConfigurationOverlayForTestUid')) {
         $overlayConfig = $this->parent->getTestConfigurationOverlayForTestUid($testUid);
     }
     return $overlayConfig;
 }
 protected function getFFValue($table, $row, $field, $itemFormElName)
 {
     $path = str_replace('data[' . $table . '][' . $row['uid'] . '][' . $field . '][', '', $itemFormElName);
     $path = rtrim($path, ']');
     $path = explode('][', $path);
     $fftools = new t3lib_flexformtools();
     $val = $fftools->getArrayValueByPath($path, t3lib_div::xml2array($row[$field]));
     return $val;
 }
コード例 #3
0
 /**
  * @return array
  */
 public function getCurlOptions()
 {
     $curl_options = array();
     if ($this->testConfigurationOverlay) {
         $fftools = new t3lib_flexformtools();
         $options = $fftools->getArrayValueByPath('data/sDEF/lDEF/testconfigurations/el', $this->testConfigurationOverlay);
         if ($options && is_array($options)) {
             foreach ($options as $key => $el) {
                 if (is_array($el['curl_option'])) {
                     $currentEl = $el['curl_option']['el'];
                     $value = '';
                     if (!defined($currentEl['option']['vDEF'])) {
                         continue;
                     }
                     switch ($currentEl['option']['vDEF']) {
                         case 'CURLOPT_SSL_VERIFYPEER':
                             $value = (bool) ($currentEl['value_bool']['vDEF'] != 'false');
                             break;
                         case 'CURLOPT_TIMEOUT_MS':
                             $value = intval($currentEl['value_int']['vDEF']);
                             break;
                         case 'CURLOPT_INTERFACE':
                             $value = (string) $currentEl['value_ip']['vDEF'];
                             break;
                         case 'CURLOPT_USERPWD':
                             $value = (string) $currentEl['value_string']['vDEF'];
                             break;
                         case 'CURLOPT_HTTPAUTH':
                             $value = intval($currentEl['value_httpauth']['vDEF']);
                             break;
                     }
                     $curl_options[constant($currentEl['option']['vDEF'])] = $value;
                 }
             }
         }
     }
     return $curl_options;
 }