Skip to content

Commit

Permalink
added appserver_redefine to test php script
Browse files Browse the repository at this point in the history
  • Loading branch information
zelgerj committed Oct 17, 2013
1 parent 5ab3309 commit db0e469
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/appserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@
* @author Johann Zelger <[email protected]>
*/

header('X-Powered-By: appserver');
header('Location: http://www.google.de');

echo "SAPI_TYPE: " . PHP_SAPI;
appserver_redefine('PHP_SAPI', 'appserver');
echo "CALL appserver_redefine('PHP_SAPI', 'appserver'): -> SAPI_TYPE: " . PHP_SAPI;
echo PHP_EOL . "==========================================". PHP_EOL;

appserver_set_headers_sent(true);
$result = var_export(headers_sent(), true);
echo "CALL appserver_set_headers_sent(true): -> headers_sent = " . $result . PHP_EOL;
appserver_set_headers_sent(false);
$result = var_export(headers_sent(), true);
echo "CALL appserver_set_headers_sent(false): -> headers_sent = " . $result . PHP_EOL;
echo "CALL appserver_set_headers_sent(false): -> headers_sent = " . $result;
echo PHP_EOL . "==========================================". PHP_EOL;

appserver_set_headers_sent(false);
header('X-Powered-By: appserver');
header('Location: http://www.google.de');
echo "CALL appserver_get_headers(): -> ";
echo var_export(appserver_get_headers(), true);
echo PHP_EOL . "==========================================". PHP_EOL;
Expand All @@ -52,7 +53,7 @@
echo "CALL #$index appserver_register_file_upload(): -> ";
echo var_export(appserver_register_file_upload($temp_filename), true);
echo PHP_EOL . "==========================================". PHP_EOL;

echo "CALL #$index move_uploaded_file: -> " .var_export(move_uploaded_file($temp_filename, '/tmp/move_uploaded_file_success'), true);
echo PHP_EOL . "==========================================". PHP_EOL;
}
}

0 comments on commit db0e469

Please sign in to comment.