Permalink
Browse files

Update CLI tool so it works for those testing it

Will be updated further once the API changes/update feature is complete.
  • Loading branch information...
1 parent 497ea16 commit 12be2b9c214f00735e3d90c128bd9640da143922 @EvanDotPro committed Sep 18, 2012
Showing with 6 additions and 3 deletions.
  1. +3 −3 bin/update-ca-bundle
  2. +3 −0 src/Sslurp/CaRootPemBundle.php
View
@@ -25,10 +25,10 @@ if (isset($opts['o']) && is_array($opts['o'])) {
$opts['o'] = null;
}
-if ($opts['o'] == '-') $opts['o'] = null;
+if ($opts['o'] == '-') $opts['o'] = 'ca-bundle.pem';
-$caRootPemBundle = new Sslurp\CaRootPemBundle();
-$caBundle = $caRootPemBundle->getContent();
+$caRootPemBundle = new Sslurp\CaRootPemBundle($opts['o']);
+$caBundle = $caRootPemBundle->getUpdatedCaRootBundle();
if (!$caBundle) {
echo "Sorry, there was an error building the latest root CA bundle.\n";
@@ -31,6 +31,9 @@ class CaRootPemBundle extends AbstractCaRootData
public function __construct($filename = null, MozillaCertData $mozCertData = null)
{
+ if (!file_exists($filename)) {
+ touch($filename);
+ }
$this->fileObject = new SplFileObject($filename, 'r+');
$this->mozCertData = $mozCertData ?: new MozillaCertData();
}

0 comments on commit 12be2b9

Please sign in to comment.