com php-src: ...: phpdbg_prompt.c test.php
| From: | Bob Weinand | Date: | Sun, 10 Nov 2013 21:07:29 +0000 |
| Subject: | com php-src: ...: phpdbg_prompt.c test.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75172@lists.php.net to get a copy of this message | ||
Commit: 6203c96061501091ba6851fca655c5c02252581d
Author: krakjoe <joe.watkins@live.co.uk> Sun, 10 Nov 2013 21:07:29 +0000
Parents: 05c9f82a159a674f9ccf2178c05d2e84c78963e9
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6203c96061501091ba6851fca655c5c02252581d
Log:
..
Changed paths:
M phpdbg_prompt.c
M test.php
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 9ef5ecf..483835f 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -56,17 +56,23 @@ static inline int phpdbg_compile(TSRMLS_D) /* {{{ */
{
zend_file_handle fh;
- printf("Attempting compilation of %s\n", PHPDBG_G(exec));
-
- if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh,
- USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS) {
- PHPDBG_G(ops) = zend_compile_file(&fh, ZEND_INCLUDE TSRMLS_CC);
- zend_destroy_file_handle(&fh TSRMLS_CC);
- printf("Success\n");
- return SUCCESS;
- }
-
- printf("Could not open file %s\n", PHPDBG_G(exec));
+ if (!EG(in_execution)) {
+ printf("Attempting compilation of %s\n", PHPDBG_G(exec));
+
+ if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh,
+ USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS) {
+ PHPDBG_G(ops) = zend_compile_file(
+ &fh, ZEND_INCLUDE TSRMLS_CC);
+ zend_destroy_file_handle(&fh TSRMLS_CC);
+ printf("Success\n");
+ return SUCCESS;
+ } else {
+ printf("Could not open file %s\n", PHPDBG_G(exec));
+ }
+ } else {
+ printf("Cannot compile while in execution\n");
+ }
+
return FAILURE;
} /* }}} */
@@ -77,6 +83,7 @@ static PHPDBG_COMMAND(compile) /* {{{ */
printf("Destroying compiled opcodes\n");
destroy_op_array(PHPDBG_G(ops) TSRMLS_CC);
efree(PHPDBG_G(ops));
+ PHPDBG_G(ops)=NULL;
}
return phpdbg_compile(TSRMLS_C);
diff --git a/test.php b/test.php
index d67540e..a433605 100644
--- a/test.php
+++ b/test.php
@@ -2,6 +2,9 @@
function test() {
echo "Hello World\n";
}
+function test2() {
+ echo "Hello World 2\n";
+}
if (!isset($greeting)) {
echo test();
}