Re: Fw: [PHP-CVS] cvs: php4 /sapi/cli php_cli.c

From: Date: Fri, 08 Mar 2002 23:25:35 +0000
Subject: Re: Fw: [PHP-CVS] cvs: php4 /sapi/cli php_cli.c
References: 1  Groups: php.qa 
Request: Send a blank email to php-qa+get-4477@lists.php.net to get a copy of this message
On Fri, 8 Mar 2002, Edin Kadribasic wrote: > Hi Derick, > > Do you think release brach could use this nifty little feature? The policy is that no new functionality is going to be merged into the release branch, so I wouldn't opt to get this in. Jani, what's your opinion about this? Derick > > Edin > ----- Original Message ----- > From: "Edin Kadribasic" <edink@proventum.net> > To: <php-cvs@lists.php.net> > Sent: Friday, March 08, 2002 10:47 AM > Subject: [PHP-CVS] cvs: php4 /sapi/cli php_cli.c > > > > edink Fri Mar 8 04:47:55 2002 EDT > > > > Modified files: > > /php4/sapi/cli php_cli.c > > Log: > > @- Added -r option to the CLI version of PHP which executes a piece of > PHP > > @ code directly from the commmand line. (Edin) > > > > > > Index: php4/sapi/cli/php_cli.c > > diff -u php4/sapi/cli/php_cli.c:1.7 php4/sapi/cli/php_cli.c:1.8 > > --- php4/sapi/cli/php_cli.c:1.7 Fri Feb 15 04:06:45 2002 > > +++ php4/sapi/cli/php_cli.c Fri Mar 8 04:47:52 2002 > > @@ -81,11 +81,12 @@ > > #define PHP_MODE_INDENT 3 > > #define PHP_MODE_LINT 4 > > #define PHP_MODE_STRIP 5 > > +#define PHP_MODE_CLI_DIRECT 6 > > > > extern char *ap_php_optarg; > > extern int ap_php_optind; > > > > -#define OPTSTRING "aCc:d:ef:g:hilmnqsw?vz:" > > +#define OPTSTRING "aCc:d:ef:g:hilmnqr:sw?vz:" > > > > static int _print_module_info(zend_module_entry *module, void *arg > TSRMLS_DC) > > { > > @@ -252,6 +253,7 @@ > > " -l Syntax check only (lint)\n" > > " -m Show compiled in modules\n" > > " -i PHP information\n" > > + " -r <code> Run PHP <code>\n" > > " -h This help\n", prog); > > } > > /* }}} */ > > @@ -302,6 +304,8 @@ > > char *script_file=NULL; > > zend_llist global_vars; > > int interactive=0; > > + char *exec_direct=NULL; > > + char *compiled_string_description; > > /* end of temporary locals */ > > #ifdef ZTS > > zend_compiler_globals *compiler_globals; > > @@ -475,6 +479,11 @@ > > case 's': /* generate highlighted HTML from source */ > > behavior=PHP_MODE_HIGHLIGHT; > > break; > > + > > + case 'r': /* generate highlighted HTML from source */ > > + behavior=PHP_MODE_CLI_DIRECT; > > + exec_direct=ap_php_optarg; > > + break; > > > > case 'v': /* show php version & quit */ > > no_headers = 1; > > @@ -595,6 +604,12 @@ > > return SUCCESS; > > break; > > #endif > > + case PHP_MODE_CLI_DIRECT: > > + compiled_string_description = > zend_make_compiled_string_description("Command line code" TSRMLS_CC); > > + if (zend_eval_string(exec_direct, NULL, > compiled_string_description TSRMLS_CC) == FAILURE) { > > + exit_status=254; > > + } > > + efree(compiled_string_description); > > } > > > > php_request_shutdown((void *) 0); > > > > > > > > -- > > PHP CVS Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > ---------------------------------------------------------------------- PHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Site Resource Manager - www.vl-srm.net -----------------------------------------------------------------------

« previous php.qa (#4477) next »