" 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:----PhGMrCVdnvnvMxaOIlpui1fBs3VjIaeAAp5vuCFRmPs/HSJo4HGlWKJ1tlKSsnB5GA0pEoAYBqx4bPrTrYrz378Autj5Q4jc1i2DmMm2UIvUmIKKFPH4dC4rG7psl+32w+qZTsolKnc8NuVllFJrQjyY8oeOHhkmuqgm3RZDzrusQZrPhFJV8GyIr+Xo+JBjGcN6TiAefzFMKDo5SNUsWPFYE3FHUzj7bG+zTLeHCXGrVSLih6V5h1CNYr0vt8W0hdWEHY96K0GDf53G44caZ9WoLP2z/8oyuW29MfsZO/qf67vSJXtouQ+z/di6+SrG6mJd8oshoWTSg7XFwKyHWmA/0LVRSKrLv04/04IvGwDCXWrXddvTFHP25hXYKteMQVheYmPuU0x24JRXT28KcLxUrrAcGFEeLo1BZXiFgmm/tHfcO9WEUW25FMtMSvJ8/tPXa+Tx4TQlhkVzRR4hWqgDlKhjZILZ/L6n+gdkxSCxL46nGieL/zP8ohn1MI9THKP8LrYXFA4QhmF+jB5zFKTSrSSQQE9+MmHdsJeK7g7Jomoh+2fCh5KV6+N2z2W4UIJQyHnJFfWcfpd8oYGLbSV04F66uWx2J2nnS/dRIOLKd1SfWAEJv4HruVAMYmEPlFR7X7GVLeID2o6LJA8v6dGPiZ0OrmFBbpzLD4vJMeo=----ATTACHMENT:----NTY5Mjg1MzAyNjgyMjYxNiAzNjkzODY4NDA5NTA4OTMyIDcxNDI3NjEyNjc4MTkwNzA=