issue0149.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. ISSUE #149 (Phar mount points not working this OPcache enabled)
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. phar.readonly=0
  7. --SKIPIF--
  8. <?php require_once('skipif.inc'); ?>
  9. <?php if (!extension_loaded("phar")) die("skip"); ?>
  10. <?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
  11. --FILE--
  12. <?php
  13. $stub = "<?php header('Content-Type: text/plain;');
  14. Phar::mount('this.file', '". __FILE__ . "');
  15. echo 'OK\n';
  16. __HALT_COMPILER(); ?>";
  17. $p = new Phar(__DIR__ . '/issue0149.phar.php', 0, 'this');
  18. $p['index.php'] = ""; # A Phar must have at least one file, hence this dummy
  19. $p->setStub($stub);
  20. unset($p);
  21. include "php_cli_server.inc";
  22. php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1');
  23. echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
  24. echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
  25. echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
  26. ?>
  27. --CLEAN--
  28. <?php
  29. @unlink(__DIR__ . '/issue0149.phar.php');
  30. ?>
  31. --EXPECT--
  32. OK
  33. OK
  34. OK