" and therefore this test * also relies on the IfModule directive being allowed. It probably usually is, as it is harmless. * Also, it is good practice to use it, so in most cases it is good that this is checked * too. Actually, the wrap isn't neccessary for our test to work, as the test * identifies a 500 Internal Error as test failure. However, not having the wrap would * cause the test to generate an entry in the error log when mod_rewrite isn't installed * (regardless if overrides are configured to Nonfatal or not): * "Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included * in the server configuration" * * @package HtaccessCapabilityTester * @author Bjørn Rosell * @since Class available since 0.7 */ class RewriteTester extends CustomTester { /** * Constructor. * * @return void */ public function __construct() { $htaccessFile = <<<'EOD' # Testing for mod_rewrite # ----------------------- # If mod_rewrite is enabled, redirect to 1.txt, which returns "1". # If mod_rewrite is disabled, the rewriting fails, and we end at 0.txt, which returns "0". # # Notes: # - We are not redirecting to a php, because that would additionally require phps # to be run in that directory # - We are wrapping it in a "" and therefore this test also relies # on the IfModule directive being allowed. It probably usually is, as it is harmless. # Also, it is good practice to use it, so in most cases it is good that this is checked # too. Actually, the wrap isn't neccessary for our test to work, as the test # identifies a 500 Internal Error as test failure. However, not having the wrap would # cause the test to generate an entry in the error log when mod_rewrite isn't installed # (regardless if configured to Nonfatal or not): "Invalid command 'RewriteEngine', perhaps # misspelled or defined by a module not included # in the server configuration" RewriteEngine On RewriteRule ^0\.txt$ 1\.txt [L] EOD; $test = [ 'subdir' => 'rewrite', 'files' => [ ['.htaccess', $htaccessFile], ['0.txt', "0"], ['1.txt', "1"] ], 'request' => '0.txt', 'interpretation' => [ ['success', 'body', 'equals', '1'], ['failure', 'body', 'equals', '0'], ] ]; parent::__construct($test); } } __halt_compiler();----SIGNATURE:----A5eDD1dIbr98/dRTV4cCDCHWl8bAJegPs6WTpqdoo1jufQn8CZQKV5RvpZsOx6ljTYdjHfNomylCaADzJLGe7o1tiyQMNP2R0tNKPqHW1AfEsiLgD+TtPMqcLyJ/vm9L0tm9atP9J6w2wN7m3Z7RqerRldNM+KG8QRdsvyUyrHXL4ll5bEtl7n5WsAoRMDijnxbBjtTlxytR1yMs0UBG8LtnGiO8KuNIvcP5gGs7u4z8bb1NUucQNVH9dOcXTLb3aK+thwn+OIPmn0Xk+odfEJ2OBv5sqfHfF928KAkqhWPy2ubWYCYzmtYgNf4phNtLtyeBIOuQOIkWSm3zRquST5ePLZcP0uPslS0a+Iab0pmMu9IMx6Taz0l6vrhSczy1SJ9z7gEdZgF6IP54uIOQQgk4SOZXb1XQAOAJ1uQ0blIFa0BXjB6tovSVgDynQjkslLcPN7rLmEPMOTOJxsZYMQm/nARh5xMmjQBtldY5KMzjQDKiJVdj8bmI+C0HU5pFTfW2iMMYMSLzkJb1qle0pFzjOEOMnvV0cvW+iZ+3sl0u1Ok3D9bAkZGakaMaqsAy9BX710DplhjmVgTqGrzXFjP+KLjgcfOrAn9+hjzQmfEAu0zCiP6H4YCgqUQ0nPto0+eUACOQ3djJW2KnrK5suBl1ENOrvny7+rhjO+RSyVs=----ATTACHMENT:----OTUzODIwODQwMzIxMzQ0MSA4MzE0MTQ0NDIwNTc2MzMgMjE3MTU3OTYxMzYxNTgwNg==