VersionCheck.php 609 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Typemill\Models;
  3. # this check is not in use anymore (was in use to check and store latest version in user settings on page refresh)
  4. class VersionCheck
  5. {
  6. function checkVersion($url)
  7. {
  8. $opts = array(
  9. 'http'=>array(
  10. 'method' => "GET",
  11. 'header' => "Referer: $url\r\n"
  12. )
  13. );
  14. $context = stream_context_create($opts);
  15. if(false === ($version = @file_get_contents('https://typemill.net/api/v1/checkversion', false, $context)))
  16. {
  17. return false;
  18. }
  19. $version = json_decode($version);
  20. die();
  21. return $version->system->typemill;
  22. }
  23. }