Last active
June 25, 2018 14:04
-
-
Save w33tmaricich/80d5ba435078be697371ea70e0b68b01 to your computer and use it in GitHub Desktop.
php: load and save xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fileName = "fun.xml"; | |
$keystorepath = "this/is/a/path.jks"; | |
$keystorepassword = "keystorepassword"; | |
$fileContents = file_get_contents($fileName); | |
$xml = simplexml_load_string($fileContents); | |
foreach ($xml->Root->VHost->HostPortList->HostPort as $property) { | |
if ($property->Name == "Default SSL Streaming") { | |
$property->SSLConfig->KeyStorePath = $keystorepath; | |
$property->SSLConfig->KeyStorePassword = $keystorepassword; | |
$property->SSLConfig->KeyStoreType = "JKS"; | |
//var_dump($property); | |
} | |
} | |
$xml->asXml($fileName); | |
echo "...done."; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment