Sfoglia il codice sorgente

Merge pull request #9 from avindra/patch-2

Use json_encode to dump out booleans
Andrew Collington 9 anni fa
parent
commit
0c9492f828
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      index.php

+ 3 - 3
index.php

@@ -366,9 +366,9 @@ $opcache = OpCacheService::init($options);
 <script type="text/javascript">
     var realtime = false;
     var opstate = <?php echo json_encode($opcache->getData()); ?>;
-    var canInvalidate = <?php echo ($opcache->canInvalidate() ? 'true' : 'false'); ?>;
-    var useCharts = <?php echo ($opcache->getOption('charts') ? 'true' : 'false'); ?>;
-    var allowFiles = <?php echo ($opcache->getOption('allow_filelist') ? 'true' : 'false'); ?>;
+    var canInvalidate = <?php echo json_encode($opcache->canInvalidate()); ?>;
+    var useCharts = <?php echo json_encode($opcache->getOption('charts')); ?>;
+    var allowFiles = <?php echo json_encode($opcache->getOption('allow_filelist')); ?>;
 
     <?php if ($opcache->getOption('charts')): ?>
     var Gauge = function(el, colour) {