static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, void *arg) { switch (callback_type) { case ZEND_INI_PARSER_ENTRY: { zval *entry; if (!arg2) { break; } if (!strcasecmp(Z_STRVAL_P(arg1), "extension")) { /* load function module */ zval copy; copy = *arg2; zval_copy_ctor(©); copy.refcount = 0; zend_llist_add_element(&extension_lists.functions, ©); } else if (!strcasecmp(Z_STRVAL_P(arg1), ZEND_EXTENSION_TOKEN)) { /* load Zend extension */ char *extension_name = estrndup(Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)); zend_llist_add_element(&extension_lists.engine, &extension_name); } else { zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, arg2, sizeof(zval), (void **) &entry); Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry)); } } break; case ZEND_INI_PARSER_SECTION: break; } }
void copy_zend_constant(zend_constant *c) { c->name = zend_strndup(c->name, c->name_len - 1); if (!(c->flags & CONST_PERSISTENT)) { zval_copy_ctor(&c->value); } }
static void register_standard_class(TSRMLS_D) { zend_standard_class_def.type = ZEND_INTERNAL_CLASS; zend_standard_class_def.name_length = sizeof("stdClass") - 1; zend_standard_class_def.name = zend_strndup("stdClass", zend_standard_class_def.name_length); zend_standard_class_def.parent = NULL; zend_hash_init_ex(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1, 0); zend_hash_init_ex(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1, 0); zend_standard_class_def.handle_function_call = NULL; zend_standard_class_def.handle_property_get = NULL; zend_standard_class_def.handle_property_set = NULL; zend_standard_class_def.refcount = (int *) malloc(sizeof(int)); *zend_standard_class_def.refcount = 1; zend_hash_add(CG(class_table), "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry), NULL); }
static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end) { char buf[128]; char *tmp = buf; int buf_size = sizeof(buf); int name_len, val_len; char *s; int ret = 1; while (p < end) { name_len = *p++; if (name_len >= 128) { name_len = ((name_len & 0x7f) << 24); name_len |= (*p++ << 16); name_len |= (*p++ << 8); name_len |= *p++; } val_len = *p++; if (val_len >= 128) { val_len = ((val_len & 0x7f) << 24); val_len |= (*p++ << 16); val_len |= (*p++ << 8); val_len |= *p++; } if (p + name_len + val_len > end) { /* Malformated request */ ret = 0; break; } if (name_len+1 >= buf_size) { buf_size = name_len + 64; tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size)); } memcpy(tmp, p, name_len); tmp[name_len] = 0; s = zend_strndup((char*)p + name_len, val_len); zend_hash_update(&req->env, tmp, name_len+1, &s, sizeof(char*), NULL); p += name_len + val_len; } if (tmp != buf && tmp != NULL) { efree(tmp); } return ret; }
/* {{{ mysqlnd_pam_auth_get_auth_data */ static zend_uchar * mysqlnd_pam_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self, size_t * auth_data_len, MYSQLND_CONN_DATA * conn, const char * const user, const char * const passwd, const size_t passwd_len, zend_uchar * auth_plugin_data, size_t auth_plugin_data_len, const MYSQLND_OPTIONS * const options, const MYSQLND_NET_OPTIONS * const net_options, zend_ulong mysql_flags ) { zend_uchar * ret = NULL; /* copy pass*/ if (passwd && passwd_len) { ret = (zend_uchar*) zend_strndup(passwd, passwd_len); } *auth_data_len = passwd_len; return ret; }
int php_init_config(char *php_ini_path_override) { char *env_location, *php_ini_search_path; int safe_mode_state; char *open_basedir; int free_ini_search_path=0; zend_file_handle fh; PLS_FETCH(); if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1)==FAILURE) { return FAILURE; } zend_llist_init(&extension_lists.engine, sizeof(zval), (llist_dtor_func_t) free_estring, 1); zend_llist_init(&extension_lists.functions, sizeof(zval), (llist_dtor_func_t) ZVAL_DESTRUCTOR, 1); safe_mode_state = PG(safe_mode); open_basedir = PG(open_basedir); env_location = getenv("PHPRC"); if (!env_location) { env_location=""; } if (php_ini_path_override) { php_ini_search_path = php_ini_path_override; free_ini_search_path = 0; } else { char *default_location; int free_default_location; #ifdef PHP_WIN32 default_location = (char *) emalloc(512); if (!GetWindowsDirectory(default_location,255)) { default_location[0]=0; } free_default_location=1; #else default_location = PHP_CONFIG_FILE_PATH; free_default_location=0; #endif php_ini_search_path = (char *) emalloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1); free_ini_search_path = 1; if(env_location && env_location[0]) { sprintf(php_ini_search_path, ".%c%s%c%s", ZEND_PATHS_SEPARATOR, env_location, ZEND_PATHS_SEPARATOR, default_location); } else { sprintf(php_ini_search_path, ".%c%s", ZEND_PATHS_SEPARATOR, default_location); } if (free_default_location) { efree(default_location); } } PG(safe_mode) = 0; PG(open_basedir) = NULL; fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path); if (free_ini_search_path) { efree(php_ini_search_path); } PG(safe_mode) = safe_mode_state; PG(open_basedir) = open_basedir; if (!fh.handle.fp) { return SUCCESS; /* having no configuration file is ok */ } fh.type = ZEND_HANDLE_FP; fh.filename = php_ini_opened_path; zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, &extension_lists); if (php_ini_opened_path) { zval tmp; tmp.value.str.len = strlen(php_ini_opened_path); tmp.value.str.val = zend_strndup(php_ini_opened_path, tmp.value.str.len); tmp.type = IS_STRING; zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"),(void *) &tmp,sizeof(zval), NULL); persist_alloc(php_ini_opened_path); } return SUCCESS; }
void zend_accel_blacklist_load(zend_blacklist *blacklist, char *filename) { char buf[MAXPATHLEN+1], real_path[MAXPATHLEN+1]; FILE *fp; int path_length; TSRMLS_FETCH(); if ((fp=fopen(filename, "r"))==NULL) { zend_accel_error(ACCEL_LOG_WARNING, "Cannot load blacklist file: %s\n", filename); return; } zend_accel_error(ACCEL_LOG_DEBUG,"Loading blacklist file: '%s'", filename); memset(buf, 0, sizeof(buf)); memset(real_path, 0, sizeof(real_path)); while (fgets(buf, MAXPATHLEN, fp)!=NULL) { char *path_dup, *pbuf; path_length = strlen(buf); if (path_length > 0 && buf[path_length-1]=='\n') { buf[--path_length] = 0; if (path_length > 0 && buf[path_length-1]=='\r') { buf[--path_length] = 0; } } /* Strip ctrl-m prefix */ pbuf = &buf[0]; while(*pbuf == '\r') { *pbuf++ = 0; path_length--; } /* strip \" */ if( pbuf[0] == '\"' && pbuf[path_length-1]== '\"' ){ *pbuf++ = 0; path_length-=2; } if (path_length==0) { continue; } path_dup = zend_strndup(pbuf, path_length); expand_filepath(path_dup, real_path TSRMLS_CC); path_length = strlen(real_path); free(path_dup); zend_accel_blacklist_allocate(blacklist); blacklist->entries[blacklist->pos].path_length = path_length; blacklist->entries[blacklist->pos].path = (char *) malloc(path_length+1); if (!blacklist->entries[blacklist->pos].path) { zend_accel_error(ACCEL_LOG_ERROR, "malloc() failed\n"); return; } blacklist->entries[blacklist->pos].id = blacklist->pos; memcpy(blacklist->entries[blacklist->pos].path, real_path, path_length+1); blacklist->pos++; } fclose(fp); zend_accel_blacklist_update_regexp(blacklist); }
static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars) /* {{{ */ { char *decode = NULL; switch (type &~ EXT_TYPE_UNUSED) { case IS_CV: { zend_string *var = ops->vars[EX_VAR_TO_NUM(op->var)]; asprintf(&decode, "$%.*s%c", var->len <= 19 ? (int) var->len : 18, var->val, var->len <= 19 ? 0 : '+'); } break; case IS_VAR: case IS_TMP_VAR: { zend_ulong id = 0, *pid = NULL; if (vars != NULL) { if ((pid = zend_hash_index_find_ptr(vars, (zend_ulong) ops->vars - op->var))) { id = *pid; } else { id = zend_hash_num_elements(vars); zend_hash_index_update_mem(vars, (zend_ulong) ops->vars - op->var, &id, sizeof(zend_ulong)); } } asprintf(&decode, "@" ZEND_ULONG_FMT, id); } break; case IS_CONST: { zval *literal = RT_CONSTANT(ops, *op); switch (Z_TYPE_P(literal)) { case IS_UNDEF: decode = zend_strndup("", 0); break; case IS_NULL: decode = zend_strndup(ZEND_STRL("null")); break; case IS_FALSE: decode = zend_strndup(ZEND_STRL("false")); break; case IS_TRUE: decode = zend_strndup(ZEND_STRL("true")); break; case IS_LONG: asprintf(&decode, "%lld", Z_LVAL_P(literal)); break; case IS_DOUBLE: asprintf(&decode, "%.*G", 14, Z_DVAL_P(literal)); break; case IS_STRING: { int i; zend_string *str = php_addcslashes(Z_STR_P(literal), 0, "\\\"", 2); for (i = 0; i < str->len; i++) { if (str->val[i] < 32) { str->val[i] = ' '; } } asprintf(&decode, "\"%.*s\"%c", str->len <= 18 ? (int) str->len : 17, str->val, str->len <= 18 ? 0 : '+'); zend_string_release(str); } break; case IS_RESOURCE: asprintf(&decode, "Rsrc #%d", Z_RES_HANDLE_P(literal)); break; case IS_ARRAY: asprintf(&decode, "array(%d)", zend_hash_num_elements(Z_ARR_P(literal))); break; case IS_OBJECT: { zend_string *str = Z_OBJCE_P(literal)->name; asprintf(&decode, "%.*s%c", str->len <= 18 ? (int) str->len : 18, str->val, str->len <= 18 ? 0 : '+'); } break; case IS_CONSTANT: decode = zend_strndup(ZEND_STRL("<constant>")); break; case IS_CONSTANT_AST: decode = zend_strndup(ZEND_STRL("<ast>")); break; default: asprintf(&decode, "unknown type: %d", Z_TYPE_P(literal)); break; } } break; case IS_UNUSED: asprintf(&decode, "<unused>"); break; } return decode; } /* }}} */
int phpdbg_lex (phpdbg_param_t* yylval) { restart: LEX(text) = YYCURSOR; #line 49 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" { YYCTYPE yych; unsigned int yyaccept = 0; if (YYGETCONDITION() < 2) { if (YYGETCONDITION() < 1) { goto yyc_NORMAL; } else { goto yyc_PRE_RAW; } } else { if (YYGETCONDITION() < 3) { goto yyc_RAW; } else { goto yyc_INITIAL; } } /* *********************************** */ yyc_INITIAL: { static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 96, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; YYDEBUG(0, *YYCURSOR); YYFILL(4); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy4; } if (yych <= 'E') { if (yych <= '\f') { if (yych <= 0x00) goto yy7; if (yych != '\t') goto yy12; } else { if (yych <= 0x1F) { if (yych >= 0x0E) goto yy12; } else { if (yych <= ' ') goto yy2; if (yych <= 'D') goto yy12; goto yy8; } } } else { if (yych <= 'd') { if (yych <= 'Q') goto yy12; if (yych <= 'R') goto yy11; if (yych <= 'S') goto yy9; goto yy12; } else { if (yych <= 'q') { if (yych <= 'e') goto yy8; goto yy12; } else { if (yych <= 'r') goto yy10; if (yych <= 's') goto yy9; goto yy12; } } } yy2: YYDEBUG(2, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '\f') { if (yych <= 0x00) goto yy29; if (yych <= 0x08) goto yy3; if (yych <= '\n') goto yy29; } else { if (yych <= '\r') goto yy29; if (yych == ' ') goto yy29; } yy3: YYDEBUG(3, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 176 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(NORMAL); YYCURSOR = LEX(text); goto restart; } #line 161 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy4: YYDEBUG(4, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(5, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy28; } if (yych <= 0x00) goto yy27; if (yych == '\n') goto yy4; yy6: YYDEBUG(6, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } #line 180 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy7: YYDEBUG(7, *YYCURSOR); yych = *++YYCURSOR; goto yy3; yy8: YYDEBUG(8, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'V') goto yy23; if (yych == 'v') goto yy23; goto yy3; yy9: YYDEBUG(9, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'H') goto yy19; if (yych == 'h') goto yy19; goto yy3; yy10: YYDEBUG(10, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { goto yy16; } if (yych == 'U') goto yy13; if (yych == 'u') goto yy13; goto yy3; yy11: YYDEBUG(11, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'U') goto yy13; if (yych == 'u') goto yy13; goto yy3; yy12: YYDEBUG(12, *YYCURSOR); yych = *++YYCURSOR; goto yy3; yy13: YYDEBUG(13, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy15; if (yych == 'n') goto yy15; yy14: YYDEBUG(14, *YYCURSOR); YYCURSOR = YYMARKER; goto yy3; yy15: YYDEBUG(15, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { goto yy16; } goto yy14; yy16: YYDEBUG(16, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(17, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy16; } YYDEBUG(18, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 163 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_RUN; } #line 253 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy19: YYDEBUG(19, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\f') { if (yych <= 0x08) goto yy14; if (yych >= '\v') goto yy14; } else { if (yych <= '\r') goto yy20; if (yych != ' ') goto yy14; } yy20: YYDEBUG(20, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(21, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy22; if (yych <= '\n') goto yy20; } else { if (yych <= '\r') goto yy20; if (yych == ' ') goto yy20; } yy22: YYDEBUG(22, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 158 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_SHELL; } #line 286 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy23: YYDEBUG(23, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\f') { if (yych <= 0x08) goto yy14; if (yych >= '\v') goto yy14; } else { if (yych <= '\r') goto yy24; if (yych != ' ') goto yy14; } yy24: YYDEBUG(24, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(25, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy26; if (yych <= '\n') goto yy24; } else { if (yych <= '\r') goto yy24; if (yych == ' ') goto yy24; } yy26: YYDEBUG(26, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 153 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(PRE_RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_EVAL; } #line 319 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy27: YYDEBUG(27, *YYCURSOR); yych = *++YYCURSOR; goto yy6; yy28: YYDEBUG(28, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy29: YYDEBUG(29, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy28; } if (yych <= 0x00) goto yy27; if (yych == '\n') goto yy4; YYDEBUG(30, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } #line 344 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" } /* *********************************** */ yyc_NORMAL: { static const unsigned char yybm[] = { 0, 8, 8, 8, 8, 8, 8, 8, 8, 66, 68, 8, 8, 66, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 66, 8, 8, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 8, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 0, 8, 8, 8, 8, 8, 8, 168, 168, 168, 168, 168, 168, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 8, 8, 8, 8, 8, 168, 168, 168, 168, 168, 168, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, }; YYDEBUG(31, *YYCURSOR); YYFILL(11); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy33; } if (yych <= 'N') { if (yych <= '0') { if (yych <= '#') { if (yych <= '\t') { if (yych <= 0x00) goto yy39; goto yy43; } else { if (yych <= '\n') goto yy36; if (yych <= '"') goto yy43; goto yy58; } } else { if (yych <= '-') { if (yych <= ',') goto yy43; goto yy40; } else { if (yych <= '.') goto yy45; if (yych <= '/') goto yy43; goto yy48; } } } else { if (yych <= 'E') { if (yych <= ':') { if (yych <= '9') goto yy45; goto yy60; } else { if (yych <= 'C') goto yy43; if (yych <= 'D') goto yy49; goto yy50; } } else { if (yych <= 'H') { if (yych <= 'F') goto yy51; goto yy43; } else { if (yych <= 'I') goto yy42; if (yych <= 'M') goto yy43; goto yy52; } } } } else { if (yych <= 'f') { if (yych <= 'Y') { if (yych <= 'S') { if (yych <= 'O') goto yy53; goto yy43; } else { if (yych <= 'T') goto yy54; if (yych <= 'X') goto yy43; goto yy55; } } else { if (yych <= 'c') { if (yych <= 'Z') goto yy56; goto yy43; } else { if (yych <= 'd') goto yy49; if (yych <= 'e') goto yy50; goto yy51; } } } else { if (yych <= 'o') { if (yych <= 'i') { if (yych <= 'h') goto yy43; goto yy42; } else { if (yych <= 'm') goto yy43; if (yych <= 'n') goto yy52; goto yy53; } } else { if (yych <= 'x') { if (yych == 't') goto yy54; goto yy43; } else { if (yych <= 'y') goto yy55; if (yych <= 'z') goto yy57; goto yy43; } } } } yy33: YYDEBUG(33, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(34, *YYCURSOR); if (yybm[0+yych] & 2) { goto yy33; } if (yych <= 0x00) goto yy39; if (yych == '\n') goto yy36; YYDEBUG(35, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } #line 493 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy36: YYDEBUG(36, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(37, *YYCURSOR); if (yybm[0+yych] & 2) { goto yy33; } if (yych <= 0x00) goto yy39; if (yych == '\n') goto yy36; yy38: YYDEBUG(38, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } #line 512 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy39: YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; goto yy38; yy40: YYDEBUG(40, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { goto yy45; } if (yych == 'r') goto yy113; goto yy44; yy41: YYDEBUG(41, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 133 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_ID; } #line 536 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy42: YYDEBUG(42, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'F') goto yy109; if (yych == 'f') goto yy109; goto yy44; yy43: YYDEBUG(43, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; yy44: YYDEBUG(44, *YYCURSOR); if (yybm[0+yych] & 8) { goto yy43; } if (yych <= '9') goto yy41; goto yy65; yy45: YYDEBUG(45, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; YYDEBUG(46, *YYCURSOR); if (yybm[0+yych] & 16) { goto yy45; } if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy47; if (yych <= 0x08) goto yy43; } else { if (yych != '\r') goto yy43; } } else { if (yych <= '#') { if (yych <= ' ') goto yy47; if (yych <= '"') goto yy43; } else { if (yych == ':') goto yy65; goto yy43; } } yy47: YYDEBUG(47, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 114 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = atoi(yytext); return T_DIGITS; } #line 592 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy48: YYDEBUG(48, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { goto yy45; } if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy47; if (yych <= 0x08) goto yy44; goto yy47; } else { if (yych == '\r') goto yy47; goto yy44; } } else { if (yych <= '#') { if (yych <= ' ') goto yy47; if (yych <= '"') goto yy44; goto yy47; } else { if (yych == 'x') goto yy105; goto yy44; } } yy49: YYDEBUG(49, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'I') goto yy99; if (yych == 'i') goto yy99; goto yy44; yy50: YYDEBUG(50, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'N') goto yy94; if (yych == 'n') goto yy94; goto yy44; yy51: YYDEBUG(51, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'A') goto yy91; if (yych == 'a') goto yy91; goto yy44; yy52: YYDEBUG(52, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'O') goto yy87; if (yych == 'o') goto yy87; goto yy44; yy53: YYDEBUG(53, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { if (yych == 'F') goto yy86; if (yych <= 'M') goto yy44; goto yy80; } else { if (yych <= 'f') { if (yych <= 'e') goto yy44; goto yy86; } else { if (yych == 'n') goto yy80; goto yy44; } } yy54: YYDEBUG(54, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'R') goto yy84; if (yych == 'r') goto yy84; goto yy44; yy55: YYDEBUG(55, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy79; if (yych == 'e') goto yy79; goto yy44; yy56: YYDEBUG(56, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy76; goto yy44; yy57: YYDEBUG(57, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'e') goto yy64; goto yy44; yy58: YYDEBUG(58, *YYCURSOR); ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 92 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return T_POUND; } #line 699 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy60: YYDEBUG(60, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == ':') goto yy62; YYDEBUG(61, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 98 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return T_COLON; } #line 710 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy62: YYDEBUG(62, *YYCURSOR); ++YYCURSOR; YYDEBUG(63, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 95 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return T_DCOLON; } #line 720 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy64: YYDEBUG(64, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'n') goto yy70; goto yy44; yy65: YYDEBUG(65, *YYCURSOR); yych = *++YYCURSOR; if (yych == '/') goto yy67; yy66: YYDEBUG(66, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 2) { if (yyaccept <= 1) { if (yyaccept <= 0) { goto yy41; } else { goto yy47; } } else { goto yy75; } } else { if (yyaccept <= 3) { goto yy108; } else { goto yy119; } } yy67: YYDEBUG(67, *YYCURSOR); yych = *++YYCURSOR; if (yych != '/') goto yy66; YYDEBUG(68, *YYCURSOR); ++YYCURSOR; YYDEBUG(69, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 86 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_PROTO; } #line 766 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy70: YYDEBUG(70, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych != 'd') goto yy44; YYDEBUG(71, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych != '_') goto yy44; yy72: YYDEBUG(72, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { goto yy73; } goto yy44; yy73: YYDEBUG(73, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; YYDEBUG(74, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy73; } if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy75; if (yych <= 0x08) goto yy43; } else { if (yych != '\r') goto yy43; } } else { if (yych <= '#') { if (yych <= ' ') goto yy75; if (yych <= '"') goto yy43; } else { if (yych == ':') goto yy65; goto yy43; } } yy75: YYDEBUG(75, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 126 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, OP_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_OPCODE; } #line 820 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy76: YYDEBUG(76, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych != 'N') goto yy44; YYDEBUG(77, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych != 'D') goto yy44; YYDEBUG(78, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == '_') goto yy72; goto yy44; yy79: YYDEBUG(79, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'S') goto yy80; if (yych != 's') goto yy44; yy80: YYDEBUG(80, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { goto yy81; } goto yy44; yy81: YYDEBUG(81, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(82, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy81; } YYDEBUG(83, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 102 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 1; return T_TRUTHY; } #line 866 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy84: YYDEBUG(84, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'U') goto yy85; if (yych != 'u') goto yy44; yy85: YYDEBUG(85, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy80; if (yych == 'e') goto yy80; goto yy44; yy86: YYDEBUG(86, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'F') goto yy87; if (yych != 'f') goto yy44; yy87: YYDEBUG(87, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy44; if (yych >= '\v') goto yy44; } else { if (yych <= '\r') goto yy88; if (yych != ' ') goto yy44; } yy88: YYDEBUG(88, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(89, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy90; if (yych <= '\n') goto yy88; } else { if (yych <= '\r') goto yy88; if (yych == ' ') goto yy88; } yy90: YYDEBUG(90, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 108 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, NUMERIC_PARAM); yylval->num = 0; return T_FALSY; } #line 919 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy91: YYDEBUG(91, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'L') goto yy92; if (yych != 'l') goto yy44; yy92: YYDEBUG(92, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'S') goto yy93; if (yych != 's') goto yy44; yy93: YYDEBUG(93, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy87; if (yych == 'e') goto yy87; goto yy44; yy94: YYDEBUG(94, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'A') goto yy95; if (yych != 'a') goto yy44; yy95: YYDEBUG(95, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'B') goto yy96; if (yych != 'b') goto yy44; yy96: YYDEBUG(96, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'L') goto yy97; if (yych != 'l') goto yy44; yy97: YYDEBUG(97, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy98; if (yych != 'e') goto yy44; yy98: YYDEBUG(98, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'D') goto yy80; if (yych == 'd') goto yy80; goto yy44; yy99: YYDEBUG(99, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'S') goto yy100; if (yych != 's') goto yy44; yy100: YYDEBUG(100, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'A') goto yy101; if (yych != 'a') goto yy44; yy101: YYDEBUG(101, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'B') goto yy102; if (yych != 'b') goto yy44; yy102: YYDEBUG(102, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'L') goto yy103; if (yych != 'l') goto yy44; yy103: YYDEBUG(103, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy104; if (yych != 'e') goto yy44; yy104: YYDEBUG(104, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'D') goto yy87; if (yych == 'd') goto yy87; goto yy44; yy105: YYDEBUG(105, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { goto yy106; } goto yy44; yy106: YYDEBUG(106, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; YYDEBUG(107, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy106; } if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy108; if (yych <= 0x08) goto yy43; } else { if (yych != '\r') goto yy43; } } else { if (yych <= '#') { if (yych <= ' ') goto yy108; if (yych <= '"') goto yy43; } else { if (yych == ':') goto yy65; goto yy43; } } yy108: YYDEBUG(108, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 120 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, ADDR_PARAM); yylval->addr = strtoul(yytext, 0, 16); return T_ADDR; } #line 1050 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy44; if (yych >= '\v') goto yy44; } else { if (yych <= '\r') goto yy110; if (yych != ' ') goto yy44; } yy110: YYDEBUG(110, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(111, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy112; if (yych <= '\n') goto yy110; } else { if (yych <= '\r') goto yy110; if (yych == ' ') goto yy110; } yy112: YYDEBUG(112, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 80 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(RAW); phpdbg_init_param(yylval, EMPTY_PARAM); return T_IF; } #line 1084 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy113: YYDEBUG(113, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { if (yych <= '\f') { if (yych <= 0x08) goto yy44; if (yych >= '\v') goto yy44; } else { if (yych <= '\r') goto yy114; if (yych <= 0x1F) goto yy44; } } else { if (yych <= '.') { if (yych <= ',') goto yy44; if (yych <= '-') goto yy116; goto yy117; } else { if (yych <= '/') goto yy44; if (yych <= '9') goto yy117; goto yy44; } } yy114: YYDEBUG(114, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; YYDEBUG(115, *YYCURSOR); if (yych <= ' ') { if (yych <= '\f') { if (yych <= 0x08) goto yy66; if (yych <= '\n') goto yy114; goto yy66; } else { if (yych <= '\r') goto yy114; if (yych <= 0x1F) goto yy66; goto yy114; } } else { if (yych <= '.') { if (yych <= ',') goto yy66; if (yych <= '-') goto yy120; goto yy121; } else { if (yych <= '/') goto yy66; if (yych <= '9') goto yy121; goto yy66; } } yy116: YYDEBUG(116, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy117; if (yych <= '/') goto yy44; if (yych >= ':') goto yy44; yy117: YYDEBUG(117, *YYCURSOR); yyaccept = 4; YYMARKER = ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; YYDEBUG(118, *YYCURSOR); if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy119; if (yych <= 0x08) goto yy43; } else { if (yych == '\r') goto yy119; if (yych <= 0x1F) goto yy43; } } else { if (yych <= '.') { if (yych == '#') goto yy119; if (yych <= '-') goto yy43; goto yy117; } else { if (yych <= '/') goto yy43; if (yych <= '9') goto yy117; if (yych <= ':') goto yy65; goto yy43; } } yy119: YYDEBUG(119, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 73 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { char *text = yytext + 2; while (*++text < '0'); yylval->num = atoi(text); return T_REQ_ID; } #line 1179 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy120: YYDEBUG(120, *YYCURSOR); yych = *++YYCURSOR; if (yych == '.') goto yy121; if (yych <= '/') goto yy66; if (yych >= ':') goto yy66; yy121: YYDEBUG(121, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(122, *YYCURSOR); if (yych == '.') goto yy121; if (yych <= '/') goto yy119; if (yych <= '9') goto yy121; goto yy119; } /* *********************************** */ yyc_PRE_RAW: { static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 48, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; YYDEBUG(123, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yybm[0+yych] & 16) { goto yy127; } if (yych <= '\r') { if (yych <= 0x08) { if (yych <= 0x00) goto yy130; goto yy132; } else { if (yych <= '\t') goto yy125; if (yych <= '\f') goto yy132; } } else { if (yych <= ' ') { if (yych <= 0x1F) goto yy132; } else { if (yych == '-') goto yy131; goto yy132; } } yy125: YYDEBUG(125, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '\f') { if (yych <= 0x00) goto yy142; if (yych <= 0x08) goto yy126; if (yych <= '\n') goto yy142; } else { if (yych <= '\r') goto yy142; if (yych == ' ') goto yy142; } yy126: YYDEBUG(126, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 169 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { YYSETCONDITION(RAW); YYCURSOR = LEX(text); goto restart; } #line 1277 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy127: YYDEBUG(127, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(128, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy141; } if (yych <= 0x00) goto yy140; if (yych == '\n') goto yy127; yy129: YYDEBUG(129, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } #line 1296 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy130: YYDEBUG(130, *YYCURSOR); yych = *++YYCURSOR; goto yy126; yy131: YYDEBUG(131, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'r') goto yy133; goto yy126; yy132: YYDEBUG(132, *YYCURSOR); yych = *++YYCURSOR; goto yy126; yy133: YYDEBUG(133, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; YYDEBUG(134, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy133; } if (yych <= '.') { if (yych <= ',') goto yy135; if (yych <= '-') goto yy136; goto yy137; } else { if (yych <= '/') goto yy135; if (yych <= '9') goto yy137; } yy135: YYDEBUG(135, *YYCURSOR); YYCURSOR = YYMARKER; goto yy126; yy136: YYDEBUG(136, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { goto yy137; } goto yy135; yy137: YYDEBUG(137, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(138, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy137; } YYDEBUG(139, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 73 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { char *text = yytext + 2; while (*++text < '0'); yylval->num = atoi(text); return T_REQ_ID; } #line 1357 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy140: YYDEBUG(140, *YYCURSOR); yych = *++YYCURSOR; goto yy129; yy141: YYDEBUG(141, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy142: YYDEBUG(142, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy141; } if (yych <= 0x00) goto yy140; if (yych == '\n') goto yy127; YYDEBUG(143, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } #line 1382 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" } /* *********************************** */ yyc_RAW: { static const unsigned char yybm[] = { 0, 128, 128, 128, 128, 128, 128, 128, 128, 160, 64, 128, 128, 160, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 160, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; YYDEBUG(144, *YYCURSOR); YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy146; } if (yych <= 0x00) goto yy152; if (yych == '\n') goto yy149; goto yy153; yy146: YYDEBUG(146, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(147, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy146; } if (yych <= 0x00) goto yy152; if (yych == '\n') goto yy149; goto yy153; yy148: YYDEBUG(148, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 140 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { phpdbg_init_param(yylval, STR_PARAM); yylval->str = zend_strndup(yytext, yyleng); yylval->len = yyleng; return T_INPUT; } #line 1452 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy149: YYDEBUG(149, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(150, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy149; } if (yych <= '\f') { if (yych <= 0x00) goto yy152; if (yych == '\t') goto yy155; } else { if (yych <= '\r') goto yy155; if (yych == ' ') goto yy155; } yy151: YYDEBUG(151, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 69 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { return 0; } #line 1476 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" yy152: YYDEBUG(152, *YYCURSOR); yych = *++YYCURSOR; goto yy151; yy153: YYDEBUG(153, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(154, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy153; } goto yy148; yy155: YYDEBUG(155, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(156, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy149; } if (yych <= '\f') { if (yych <= 0x00) goto yy152; if (yych == '\t') goto yy155; } else { if (yych <= '\r') goto yy155; if (yych == ' ') goto yy155; } YYDEBUG(157, *YYCURSOR); yyleng = (size_t) YYCURSOR - (size_t) yytext; #line 147 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" { /* ignore whitespace */ goto restart; } #line 1515 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.c" } } #line 183 "/Users/Bob/php-src-5.6/sapi/phpdbg/phpdbg_lexer.l" }
/* {{{ php_init_config */ int php_init_config(void) { char *php_ini_file_name = NULL; char *php_ini_search_path = NULL; int php_ini_scanned_path_len; char *open_basedir; int free_ini_search_path = 0; zend_file_handle fh; zend_hash_init(&configuration_hash, 8, NULL, config_zval_dtor, 1); if (sapi_module.ini_defaults) { sapi_module.ini_defaults(&configuration_hash); } zend_llist_init(&extension_lists.engine, sizeof(char *), (llist_dtor_func_t) free_estring, 1); zend_llist_init(&extension_lists.functions, sizeof(char *), (llist_dtor_func_t) free_estring, 1); open_basedir = PG(open_basedir); if (sapi_module.php_ini_path_override) { php_ini_file_name = sapi_module.php_ini_path_override; php_ini_search_path = sapi_module.php_ini_path_override; free_ini_search_path = 0; } else if (!sapi_module.php_ini_ignore) { int search_path_size; char *default_location; char *env_location; static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 }; #ifdef PHP_WIN32 char *reg_location; char phprc_path[MAXPATHLEN]; #endif env_location = getenv("PHPRC"); #ifdef PHP_WIN32 if (!env_location) { char dummybuf; int size; SetLastError(0); /*If the given bugger is not large enough to hold the data, the return value is the buffer size, in characters, required to hold the string and its terminating null character. We use this return value to alloc the final buffer. */ size = GetEnvironmentVariableA("PHPRC", &dummybuf, 0); if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) { /* The environment variable doesn't exist. */ env_location = ""; } else { if (size == 0) { env_location = ""; } else { size = GetEnvironmentVariableA("PHPRC", phprc_path, size); if (size == 0) { env_location = ""; } else { env_location = phprc_path; } } } } #else if (!env_location) { env_location = ""; } #endif /* * Prepare search path */ search_path_size = MAXPATHLEN * 4 + (int)strlen(env_location) + 3 + 1; php_ini_search_path = (char *) emalloc(search_path_size); free_ini_search_path = 1; php_ini_search_path[0] = 0; /* Add environment location */ if (env_location[0]) { if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, env_location, search_path_size); php_ini_file_name = env_location; } #ifdef PHP_WIN32 /* Add registry location */ reg_location = GetIniPathFromRegistry(); if (reg_location != NULL) { if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, reg_location, search_path_size); efree(reg_location); } #endif /* Add cwd (not with CLI) */ if (!sapi_module.php_ini_ignore_cwd) { if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, ".", search_path_size); } if (PG(php_binary)) { char *separator_location, *binary_location; binary_location = estrdup(PG(php_binary)); separator_location = strrchr(binary_location, DEFAULT_SLASH); if (separator_location && separator_location != binary_location) { *(separator_location) = 0; } if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, binary_location, search_path_size); efree(binary_location); } /* Add default location */ #ifdef PHP_WIN32 default_location = (char *) emalloc(MAXPATHLEN + 1); if (0 < GetWindowsDirectory(default_location, MAXPATHLEN)) { if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, default_location, search_path_size); } /* For people running under terminal services, GetWindowsDirectory will * return their personal Windows directory, so lets add the system * windows directory too */ if (0 < GetSystemWindowsDirectory(default_location, MAXPATHLEN)) { if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, default_location, search_path_size); } efree(default_location); #else default_location = PHP_CONFIG_FILE_PATH; if (*php_ini_search_path) { strlcat(php_ini_search_path, paths_separator, search_path_size); } strlcat(php_ini_search_path, default_location, search_path_size); #endif } PG(open_basedir) = NULL; /* * Find and open actual ini file */ memset(&fh, 0, sizeof(fh)); /* If SAPI does not want to ignore all ini files OR an overriding file/path is given. * This allows disabling scanning for ini files in the PHP_CONFIG_FILE_SCAN_DIR but still * load an optional ini file. */ if (!sapi_module.php_ini_ignore || sapi_module.php_ini_path_override) { /* Check if php_ini_file_name is a file and can be opened */ if (php_ini_file_name && php_ini_file_name[0]) { zend_stat_t statbuf; if (!VCWD_STAT(php_ini_file_name, &statbuf)) { if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) { fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r"); if (fh.handle.fp) { fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL); } } } } /* Otherwise search for php-%sapi-module-name%.ini file in search path */ if (!fh.handle.fp) { const char *fmt = "php-%s.ini"; char *ini_fname; spprintf(&ini_fname, 0, fmt, sapi_module.name); fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path); efree(ini_fname); if (fh.handle.fp) { fh.filename = php_ini_opened_path; } } /* If still no ini file found, search for php.ini file in search path */ if (!fh.handle.fp) { fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path); if (fh.handle.fp) { fh.filename = php_ini_opened_path; } } } if (free_ini_search_path) { efree(php_ini_search_path); } PG(open_basedir) = open_basedir; if (fh.handle.fp) { fh.type = ZEND_HANDLE_FP; RESET_ACTIVE_INI_HASH(); zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash); { zval tmp; ZVAL_NEW_STR(&tmp, zend_string_init(fh.filename, strlen(fh.filename), 1)); zend_hash_str_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path")-1, &tmp); if (php_ini_opened_path) { efree(php_ini_opened_path); } php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); } } /* Check for PHP_INI_SCAN_DIR environment variable to override/set config file scan directory */ php_ini_scanned_path = getenv("PHP_INI_SCAN_DIR"); if (!php_ini_scanned_path) { /* Or fall back using possible --with-config-file-scan-dir setting (defaults to empty string!) */ php_ini_scanned_path = PHP_CONFIG_FILE_SCAN_DIR; } php_ini_scanned_path_len = (int)strlen(php_ini_scanned_path); /* Scan and parse any .ini files found in scan path if path not empty. */ if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) { struct dirent **namelist; int ndir, i; zend_stat_t sb; char ini_file[MAXPATHLEN]; char *p; zend_file_handle fh2; zend_llist scanned_ini_list; zend_llist_element *element; int l, total_l = 0; char *bufpath, *debpath, *endpath; int lenpath; zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1); memset(&fh2, 0, sizeof(fh2)); bufpath = estrdup(php_ini_scanned_path); for (debpath = bufpath ; debpath ; debpath=endpath) { endpath = strchr(debpath, DEFAULT_DIR_SEPARATOR); if (endpath) { *(endpath++) = 0; } if (!debpath[0]) { /* empty string means default builtin value to allow "/foo/phd.d:" or ":/foo/php.d" */ debpath = PHP_CONFIG_FILE_SCAN_DIR; } lenpath = (int)strlen(debpath); if (lenpath > 0 && (ndir = php_scandir(debpath, &namelist, 0, php_alphasort)) > 0) { for (i = 0; i < ndir; i++) { /* check for any file with .ini extension */ if (!(p = strrchr(namelist[i]->d_name, '.')) || (p && strcmp(p, ".ini"))) { free(namelist[i]); continue; } /* Reset active ini section */ RESET_ACTIVE_INI_HASH(); if (IS_SLASH(debpath[lenpath - 1])) { snprintf(ini_file, MAXPATHLEN, "%s%s", debpath, namelist[i]->d_name); } else { snprintf(ini_file, MAXPATHLEN, "%s%c%s", debpath, DEFAULT_SLASH, namelist[i]->d_name); } if (VCWD_STAT(ini_file, &sb) == 0) { if (S_ISREG(sb.st_mode)) { if ((fh2.handle.fp = VCWD_FOPEN(ini_file, "r"))) { fh2.filename = ini_file; fh2.type = ZEND_HANDLE_FP; if (zend_parse_ini_file(&fh2, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash) == SUCCESS) { /* Here, add it to the list of ini files read */ l = (int)strlen(ini_file); total_l += l + 2; p = estrndup(ini_file, l); zend_llist_add_element(&scanned_ini_list, &p); } } } } free(namelist[i]); } free(namelist); } } efree(bufpath); if (total_l) { int php_ini_scanned_files_len = (php_ini_scanned_files) ? (int)strlen(php_ini_scanned_files) + 1 : 0; php_ini_scanned_files = (char *) realloc(php_ini_scanned_files, php_ini_scanned_files_len + total_l + 1); if (!php_ini_scanned_files_len) { *php_ini_scanned_files = '\0'; } total_l += php_ini_scanned_files_len; for (element = scanned_ini_list.head; element; element = element->next) { if (php_ini_scanned_files_len) { strlcat(php_ini_scanned_files, ",\n", total_l); } strlcat(php_ini_scanned_files, *(char **)element->data, total_l); strlcat(php_ini_scanned_files, element->next ? ",\n" : "\n", total_l); } } zend_llist_destroy(&scanned_ini_list); } else { /* Make sure an empty php_ini_scanned_path ends up as NULL */ php_ini_scanned_path = NULL; } if (sapi_module.ini_entries) { /* Reset active ini section */ RESET_ACTIVE_INI_HASH(); zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash); } return SUCCESS; }
static zval *get_trace_detail(const jsonlite_decoder *self) { HashTable *array = NULL; HashPosition *pointer = NULL; zval *traces = NULL; zval *trace = NULL; zval **val = NULL; zval **msg = NULL; zval **range_start = NULL; zval **range_end = NULL; zval *range = NULL; char *str = NULL; zval *chars = NULL; zval **detail = NULL; int start = 0; int end = 0; array = Z_ARRVAL_P(self->trace); ALLOC_INIT_ZVAL(traces); array_init(traces); zend_hash_internal_pointer_reset_ex(array, pointer); while (zend_hash_has_more_elements_ex(array, pointer) == SUCCESS) { if (zend_hash_get_current_data_ex(array, (void **) &val, pointer) == SUCCESS) { if (val && Z_TYPE_PP(val) == IS_ARRAY) { zend_hash_index_find(Z_ARRVAL_PP(val), 0, (void **) &msg); zend_hash_index_find(Z_ARRVAL_PP(val), 1, (void **) &range_start); zend_hash_index_find(Z_ARRVAL_PP(val), 2, (void **) &range_end); if (zend_hash_index_exists(Z_ARRVAL_PP(val), 3) == 1) { zend_hash_index_find(Z_ARRVAL_PP(val), 3, (void **) &detail); } ALLOC_INIT_ZVAL(trace); array_init(trace); zval_add_ref(msg); add_assoc_zval_ex(trace, ZEND_STRS("msg"), *msg); ALLOC_INIT_ZVAL(range); array_init(range); zval_add_ref(range_start); add_next_index_zval(range, *range_start); zval_add_ref(range_end); add_next_index_zval(range, *range_end); add_assoc_zval_ex(trace, ZEND_STRS("range"), range); start = Z_LVAL_PP(range_start); if (start > 0) { start--; } end = Z_LVAL_PP(range_end); if (end < self->length) { end++; } str = zend_strndup((self->jsonlite + start), end - start); add_assoc_string_ex(trace, ZEND_STRS("chars"), str, 1); free(str); if (detail != NULL) { zval_add_ref(detail); add_assoc_zval_ex(trace, ZEND_STRS("detail"), *detail); } add_next_index_zval(traces, trace); detail = NULL; trace = NULL; } } if (zend_hash_move_forward_ex(array, pointer) == FAILURE) { break; } } return traces; }