コード例 #1
0
  <p>Paste your JS code in the textbox below and COMPRESS !</p>
  <form action="<?php 
echo \Lobby::u();
?>
" method="POST">
    <center>
      <textarea name="code"></textarea></textarea><cl/>
      <button class="btn blue" style="font-size: 18px;">Compress</button>
    </center>
  </form>
  <?php 
if (isset($_POST['code'])) {
    require_once $this->dir . "/src/inc/class.site-compressor.php";
    require_once $this->dir . "/src/inc/jshrink.php";
    $code = $_POST['code'];
    $cmp = Lobby\App\site_compressor\SiteCompressor::_compressor("js", $code);
    $cmp = htmlspecialchars($cmp);
    ?>
    <h2>Compressed Code</h2>
    <p>Here is the compressed code. Hurray!</p>
    <textarea><?php 
    echo $cmp;
    ?>
</textarea>
  <?php 
}
?>
  <style>
    textarea{height: 200px;width: 600px;}
  </style>
</div>
コード例 #2
0
<?php

ini_set('max_execution_time', 0);
set_time_limit(0);
require_once $this->dir . "/src/inc/class.site-compressor.php";
require_once $this->dir . "/src/inc/min-css.php";
require_once $this->dir . "/src/inc/jshrink.php";
require_once $this->dir . "/src/inc/html-compress.php";
$this->removeData("compress-msg");
$this->removeData("log");
$SC = new Lobby\App\site_compressor\SiteCompressor($this);
$SC->setOptions($this->getSiteInfo($siteID));
$SC->checkOptions();
$SC->startCompress();