@@ -2523,40 +2523,7 @@ PHP_METHOD(Redis, slowlog) {
25232523
25242524/* {{{ proto Redis::wait(int num_slaves, int ms) }}} */
25252525PHP_METHOD (Redis , wait ) {
2526- zval * object ;
2527- RedisSock * redis_sock ;
2528- zend_long num_slaves , timeout ;
2529- char * cmd ;
2530- int cmd_len ;
2531-
2532- /* Make sure arguments are valid */
2533- if (zend_parse_method_parameters (ZEND_NUM_ARGS (), getThis (), "Oll" ,
2534- & object , redis_ce , & num_slaves , & timeout )
2535- == FAILURE )
2536- {
2537- RETURN_FALSE ;
2538- }
2539-
2540- /* Don't even send this to Redis if our args are negative */
2541- if (num_slaves < 0 || timeout < 0 ) {
2542- RETURN_FALSE ;
2543- }
2544-
2545- /* Grab our socket */
2546- if ((redis_sock = redis_sock_get (object , 0 )) == NULL ) {
2547- RETURN_FALSE ;
2548- }
2549-
2550- // Construct the command
2551- cmd_len = REDIS_SPPRINTF (& cmd , "WAIT" , "ll" , num_slaves , timeout );
2552-
2553- /* Kick it off */
2554- REDIS_PROCESS_REQUEST (redis_sock , cmd , cmd_len );
2555- if (IS_ATOMIC (redis_sock )) {
2556- redis_long_response (INTERNAL_FUNCTION_PARAM_PASSTHRU , redis_sock , NULL ,
2557- NULL );
2558- }
2559- REDIS_PROCESS_RESPONSE (redis_long_response );
2526+ REDIS_PROCESS_KW_CMD ("WAIT" , redis_long_long_cmd , redis_long_response );
25602527}
25612528
25622529/*
@@ -2588,46 +2555,9 @@ PHP_METHOD(Redis, evalsha_ro) {
25882555 REDIS_PROCESS_KW_CMD ("EVALSHA_RO" , redis_eval_cmd , redis_read_raw_variant_reply );
25892556}
25902557
2591- /* {{{ proto status Redis::script('flush')
2592- * {{{ proto status Redis::script('kill')
2593- * {{{ proto string Redis::script('load', lua_script)
2594- * {{{ proto int Reids::script('exists', script_sha1 [, script_sha2, ...])
2595- */
2558+ /* {{{ public function script($args...): mixed }}} */
25962559PHP_METHOD (Redis , script ) {
2597- zval * z_args ;
2598- RedisSock * redis_sock ;
2599- smart_string cmd = {0 };
2600- int argc = ZEND_NUM_ARGS ();
2601-
2602- /* Attempt to grab our socket */
2603- if (argc < 1 || (redis_sock = redis_sock_get (getThis (), 0 )) == NULL ) {
2604- RETURN_FALSE ;
2605- }
2606-
2607- /* Allocate an array big enough to store our arguments */
2608- z_args = ecalloc (argc , sizeof (zval ));
2609-
2610- /* Make sure we can grab our arguments, we have a string directive */
2611- if (zend_get_parameters_array (ht , argc , z_args ) == FAILURE ||
2612- redis_build_script_cmd (& cmd , argc , z_args ) == NULL
2613- ) {
2614- efree (z_args );
2615- RETURN_FALSE ;
2616- }
2617-
2618- /* Free our allocated arguments */
2619- efree (z_args );
2620-
2621- // Kick off our request
2622- REDIS_PROCESS_REQUEST (redis_sock , cmd .c , cmd .len );
2623- if (IS_ATOMIC (redis_sock )) {
2624- if (redis_read_variant_reply (INTERNAL_FUNCTION_PARAM_PASSTHRU ,
2625- redis_sock , NULL , NULL ) < 0 )
2626- {
2627- RETURN_FALSE ;
2628- }
2629- }
2630- REDIS_PROCESS_RESPONSE (redis_read_variant_reply );
2560+ REDIS_PROCESS_KW_CMD ("SCRIPT" , redis_vararg_cmd , redis_read_variant_reply );
26312561}
26322562
26332563/* {{{ proto DUMP key */
0 commit comments