/etc/cron.d/blv-config_extension.cron // echo 'require_once("testsdf_config.php.extension");' >> /var/lib/sdfrance/testsdf_config.php $config_extension = './testsdf_config.php.extension'; # connect to soap server ini_set('soap.wsdl_cache_enabled',0); try { $soaphandle = new SoapClient('http://81.93.246.177/believe_vlan/soap/SoapService.php?wsdl&className=believe_vlan', array( 'trace' => 1, 'soap_version' => SOAP_1_1, 'login' => 'believe_vlan', 'password' => 'ifduezoifduoezdjzjed' ) ); } catch (Exception $e) { var_dump($e); die('Could not connect to soap server' . "\n"); } # fetch data try { $output = $soaphandle->monitoring_config_extension_get(); } catch (Exception $e) { var_dump($e); die('soap call error' . "\n"); } print "output = [$output]"; # write to temp file $r = file_put_contents($config_extension . '.new', ''); if ( $r === FALSE ) { die('Could not write to temp file' . "\n"); } # rename file $r = rename($config_extension . '.new', $config_extension); if ( $r == FALSE ) { die('Could not rename temp file' . "\n"); } echo('All OK' . "\n"); ?>