PK! 97 7 inspector.phpnu[is_enabled = is_null( $option ) ? $is_debug : 'enable' === $option; if ( $this->is_enabled ) { add_action( 'admin_bar_menu', [ $this, 'add_menu_in_admin_bar' ], 201 ); } add_action( 'elementor/admin/after_create_settings/' . Tools::PAGE_ID, [ $this, 'register_admin_tools_fields' ], 50 ); } /** * @since 2.1.3 * @access public */ public function is_enabled() { return $this->is_enabled; } /** * @since 2.1.3 * @access public */ public function register_admin_tools_fields( Tools $tools ) { $tools->add_fields( Settings::TAB_GENERAL, 'tools', [ 'enable_inspector' => [ 'label' => esc_html__( 'Debug Bar', 'elementor' ), 'field_args' => [ 'type' => 'select', 'std' => $this->is_enabled ? 'enable' : '', 'options' => [ '' => esc_html__( 'Disable', 'elementor' ), 'enable' => esc_html__( 'Enable', 'elementor' ), ], 'desc' => esc_html__( 'Debug Bar adds an admin bar menu that lists all the templates that are used on a page that is being displayed.', 'elementor' ), ], ], ] ); } /** * @since 2.1.2 * @access public */ public function parse_template_path( $template ) { // `untrailingslashit` for windows path style. if ( 0 === strpos( $template, untrailingslashit( ELEMENTOR_PATH ) ) ) { return 'Elementor - ' . basename( $template ); } if ( 0 === strpos( $template, get_stylesheet_directory() ) ) { return wp_get_theme()->get( 'Name' ) . ' - ' . basename( $template ); } $plugins_dir = dirname( ELEMENTOR_PATH ); if ( 0 === strpos( $template, $plugins_dir ) ) { return ltrim( str_replace( $plugins_dir, '', $template ), '/\\' ); } return str_replace( WP_CONTENT_DIR, '', $template ); } /** * @since 2.1.2 * @access public */ public function add_log( $module, $title, $url = '' ) { if ( ! $this->is_enabled ) { return; } if ( ! isset( $this->log[ $module ] ) ) { $this->log[ $module ] = []; } $this->log[ $module ][] = [ 'title' => $title, 'url' => $url, ]; } /** * @since 2.1.2 * @access public */ public function add_menu_in_admin_bar( \WP_Admin_Bar $wp_admin_bar ) { if ( empty( $this->log ) ) { return; } $wp_admin_bar->add_node( [ 'id' => 'elementor_inspector', 'title' => esc_html__( 'Elementor Debugger', 'elementor' ), ] ); foreach ( $this->log as $module => $log ) { $module_id = sanitize_key( $module ); $wp_admin_bar->add_menu( [ 'id' => 'elementor_inspector_' . $module_id, 'parent' => 'elementor_inspector', 'title' => $module, ] ); foreach ( $log as $index => $row ) { $url = $row['url']; unset( $row['url'] ); $wp_admin_bar->add_menu( [ 'id' => 'elementor_inspector_log_' . $module_id . '_' . $index, 'parent' => 'elementor_inspector_' . $module_id, 'href' => $url, 'title' => implode( ' > ', $row ), 'meta' => [ 'target' => '_blank', ], ] ); } } } } PK! classes/shop-page-edit.phpnu[message = esc_html__( 'Your site\'s .htaccess file appears to be missing.', 'elementor' ); } public function run() { $safe_mode_enabled = get_option( Safe_Mode::OPTION_ENABLED, '' ); if ( empty( $safe_mode_enabled ) || is_multisite() ) { return true; } $permalink_structure = get_option( 'permalink_structure' ); if ( empty( $permalink_structure ) || empty( $_SERVER['SERVER_SOFTWARE'] ) ) { return true; } $server = strtoupper( Utils::get_super_global_value( $_SERVER, 'SERVER_SOFTWARE' ) ); if ( strstr( $server, 'APACHE' ) ) { $htaccess_file = get_home_path() . '.htaccess'; /* translators: %s: Path to .htaccess file. */ $this->message .= ' ' . sprintf( esc_html__( 'File Path: %s', 'elementor' ), $htaccess_file ) . ' '; return file_exists( $htaccess_file ); } return true; } public function get_name() { return 'apache-htaccess'; } public function get_message() { return $this->message; } public function get_help_doc_url() { return 'https://go.elementor.com/preview-not-loaded/#htaccess'; } } PK!sclasses/inspection-base.phpnu[exists(); } public function get_name() { return 'theme-missing'; } public function get_message() { return esc_html__( 'Some of your theme files are missing.', 'elementor' ); } public function get_help_doc_url() { return 'https://go.elementor.com/preview-not-loaded/#theme-files'; } } PK!loading-inspection-manager.phpnu[inspections['theme-missing'] = new Theme_Missing(); $this->inspections['htaccess'] = new Htaccess(); $is_editing_shop_page = Utils::get_super_global_value( $_GET, 'post' ) == get_option( 'woocommerce_shop_page_id' ); if ( $is_editing_shop_page ) { $this->inspections['shop-page-edit'] = new Shop_Page_Edit(); } } /** * @param Inspection_Base $inspection */ public function register_inspection( $inspection ) { $this->inspections[ $inspection->get_name() ] = $inspection; } public function run_inspections() { $debug_data = [ 'message' => esc_html__( "We’re sorry, but something went wrong. Click on 'Learn more' and follow each of the steps to quickly solve it.", 'elementor' ), 'header' => esc_html__( 'The preview could not be loaded', 'elementor' ), 'doc_url' => 'https://go.elementor.com/preview-not-loaded/', ]; foreach ( $this->inspections as $inspection ) { if ( ! $inspection->run() ) { $debug_data = [ 'message' => $inspection->get_message(), 'header' => $inspection->get_header_message(), 'doc_url' => $inspection->get_help_doc_url(), 'error' => true, ]; break; } } return $debug_data; } } PK!e٨ss delay-gen.sonuȯELF>`!@l@8@HH KK K px 0K0K 0K pp$$Ptd@:@:@:QtdRtdKK K GNU0AR#-HHU) U rm35\!yi cGAi6, F"\E~=7[OPs$IlP __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClasses__gf_freexlator_mem_acct_init_gf_logdefault_notifyrandusleepdefault_renamedefault_ipcdefault_setactivelkdefault_flushdefault_readdirdefault_setxattrdefault_mknoddefault_fsetxattrdefault_readvdefault_inodelkdefault_fremovexattrdefault_opendefault_xattropdefault_entrylkdefault_getactivelkdefault_finodelkdefault_createdefault_discarddefault_mkdirdefault_lkdefault_writevdefault_accessdefault_lookupdefault_rmdirdefault_fallocatedefault_fstatdefault_leasedefault_statdefault_truncatedefault_getxattrdefault_symlinkdefault_zerofilldefault_fsyncdirdefault_fgetxattrdefault_readdirpdefault_linkdefault_fxattropdefault_ftruncatedefault_rchecksumdefault_unlinkdefault_fentrylkdefault_getspecdefault_setattrdefault_fsyncdefault_statfsdefault_seekdefault_fsetattrdefault_opendirdefault_readlinkdefault_removexattr__gf_calloc__glusterfs_this_locationxlator_option_init_percentxlator_option_init_strxlator_option_init_int32strlen__gf_mallocmemcpygf_fop_int__stack_chk_failxlator_apilibglusterfs.so.0libz.so.1libm.so.6libuuid.so.1librt.so.1libdl.so.2libpthread.so.0libcrypto.so.10libc.so.6delay-gen.soGLIBC_2.14GLIBC_2.4GLIBC_2.2.5ii ui  K "K !(K (K P 8 P T 0P 48P "@P "HP "XP #`P P hP P P P"P `"P p"P -P 04P `%P )Q 1Q +Q -Q `# Q /(Q P-0Q 0'8Q  &@Q *HQ 2PQ P$XQ 2`Q %hQ -pQ 4xQ 3Q .Q +Q )Q `0Q `,Q @*Q `+Q $Q &Q (Q 'Q `1Q 'Q 0Q /Q %R 0R  2R 3R P/8R 1@R &HR ,PR )XR P.`R #hR  3pR ,R `(R $T 8V 8V H9V 8Y 88[ 8@[ x9p[ 8] 8_ 8_ 9_ 8O O O O O M M M M M M M M  M  N  N  N  N  N (N 0N 8N @N HN PN XN `N hN pN xN N N N N  N !N "N #N $N %N &N 'N (N )N *N +N ,O -O .O /O 0 O 1(O 20O 38O 4@O 5HO 6PO 7XO 8`O 9hO :pO ;xO <O =O >O ?O @O AO BO CO DO EO FO GHH2 HtkH50 %0 @%0 h%0 h%0 h%z0 h%r0 h%j0 h%b0 h%Z0 hp%R0 h`%J0 h P%B0 h @%:0 h 0%20 h %*0 h %"0 h%0 h%0 h% 0 h%0 h%/ h%/ h%/ h%/ h%/ hp%/ h`%/ hP%/ h@%/ h0%/ h %/ h%/ h%/ h%/ h %/ h!%/ h"%z/ h#%r/ h$%j/ h%%b/ h&%Z/ h'p%R/ h(`%J/ h)P%B/ h*@%:/ h+0%2/ h, %*/ h-%"/ h.%/ h/%/ h0% / h1%/ h2%. h3%. h4%. h5%. h6%. h7p%. h8`%. h9P%. h:@%. h;0%. h< %. h=%. h>%. h?%. h@%. hA%. hB%z. hCH E H=E UH)HHw]Hd. Ht]@HD H=D UH)HHHH?HHu]H/. Ht]H@=D u'H=. UHt H=:) h]D @f.H=) t&H- HtUH=( H]WKf.1f.1f.1f.1f.H@USHHHtJ}x1t*H;L H/H5A9H[]H1HSHHct u1[ %);}⋻fAUIATIUHSHHHLD$LD$LLHHH1[]A\A]DAUIATAUHSH1HH=LDHHekG# |tgN59=g I)a]ߌraAc`t[6|˩5_4J`Q&:JätT]|7[";ĚPc2n6o׻+]1C壏1!AoQl{^s!< _zP+`_AMUEr,}Rj]pS3?SZ~$3Q?B&7tF}tt2@[6zBؘBD4S9ezzb |PpYI}DI),2<gVB g+8r.: j.kz Zjh2[8BYz&R%]JSpfc z7|MB6VHx?yn jXI l50,>:sL 깑@'ŋum*s  oTM3ܫJy'S`6oA4UJstM@ulL-~4.J;zkoߋ! gE+`z*,衏NPlh^1,\QkU~Ov!ؑZar 2: H!Y81uJ2"ݣř`$"A_P&^i]sSg@D2xV垖trLv"i(;3U'-=!EB< Y7\ l# rҿu,ncp֓a}-6(JvUA# [YG~!rGR)s?K›aRƏl]죮Ђq;@x*lj594hM!NbA)86AP>ߏl}Y^ VsKĹk ꚭ OZ0nmt#rQҼ>:O { hЙ$ )HB.gYZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.data.rel.ro.dynamic.got.data.bss.gnu_debuglink.gnu_debugdata $o$( 08oEo@T^B`hcPn`!`!t<8<8 zP8P8@:@:8<8<| K KK K K K(K (K0K 0KpM M`P P f fffPkPK!)`` io-stats.sonuȯELF>7@@8@4_4_ ii"i"( jj"j"pp$$Ptd///QtdRtdii"i"GNU4ǽ=<U5;4*mmn|\ U 4!i*sCN M( ",d, 4F"mXl@#w i=\?R^az.)2F{n:GN f p"__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesgf_assert_gf_msg__gf_callocpthread_mutex_initgettimeofdaymemcmp__stack_chk_failfd_ctx_getmem_get0pthread_mutex_lockpthread_mutex_unlock__glusterfs_this_locationtimespec_nowlog_base2fnmatchdict_foreach_matchxlator_mem_acct_init_gf_log__gf_freepthread_mutex_destroyuuid_compareinode_ctx_del2__snprintf_chkvsnprintfgf_proc_dump_writegf_fop_liststrlen__gf_mallocmemcpyinode_ctx_set0uuid_copyinode_ctx_get0__fprintf_chkfputclocaltime_rstrftimegf_log_get_localtimegmtime_rstrncpy_gf_timestuff__progname__ctype_tolower_locgf_upcall_listsyncop_getxattrdata_to_int32dict_unrefsysconfgetpwuid_rgetgrgid_rgf_fop_stringfop_enum_to_pri_stringstrrchrgf_rev_dns_lookup_cached__sprintf_chkfputsfwritedict_set_int32dict_set_uint64dict_set_doublememsetdata_to_strstrstrstrchrgetpidfopen64fclosesys_mkdirpthread_setcanceltypesleep__errno_locationstrerrorfd_ctx_setdict_set_strdict_set_dynstrdefault_notifydict_get_str_booleandict_get_int32dict_get_doublepthread_cancelpthread_joingf_log_set_loglevelxlator_option_reconf_boolxlator_option_reconf_int32xlator_option_reconf_strglusterd_check_log_levelset_sys_log_levelgf_check_loggergf_log_set_loggergf_check_log_formatgf_log_set_logformatxlator_option_reconf_uint32gf_log_set_log_buf_sizexlator_option_reconf_timegf_log_set_log_flush_timeoutgf_thread_createdict_get_strxlator_option_init_boolxlator_option_init_int32xlator_option_init_strgf_dnscache_initxlator_option_init_uint32xlator_option_init_timexlator_apilibglusterfs.so.0libz.so.1libm.so.6libuuid.so.1librt.so.1libdl.so.2libpthread.so.0libcrypto.so.10libc.so.6program_invocation_short_nameio-stats.soUUID_1.0GLIBC_2.2.5GLIBC_2.14GLIBC_2.3GLIBC_2.4GLIBC_2.3.4 '  ui #ii .ii 8ti Bui i"8i"`8j"j"8p"$@p"u"Pp"Xp"`p"hp"`xp"p"q"p"p"p"t"p"p"5p"8q"PRq"Uq"Wq" q"Z(q"0]0q"_8q"b@q"PeHq"jPq"Xq"pm`q"@phq"0wpq"yxq"|q"@q"@q"q"q"Pq"q"q"Кq"Pq"q"Oq"q"Dq"PGq">q"Ar" Jr"Lr"r" r"(r"h0r"8r"`r"@hr"pr"Хxr"r"Pr"r"@r"pr"r"r"@tt"u"-8w":@w"pw"$y"^{"H{"8{"$~"x8"H@"p"$"""Ȃ"Ђ""""$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O1~?BH?L $H*H5AGG?(?@HLh8@H8HH^L.?MHc=Hx^@HLh8R@H8HL$ HL{< H|$ Ht ?<@HLh8 @H8HL$@HfL5<H|$@Ht?tH+??HLh8?H8HL$(HUL;rH|$(Ht <=>?HLh8t?H8HL$0HDL;,H|$0Ht >=:?HLh8.?H8HL$H#L;|$v9?HLh8>H8HL$HL:|$<(HHb4H0L 11ƃ9ƃ8Hz=AtKƃ9$L "H}H(H5A1< H}HM1HSHtGHHǃH;L [H(H5'A1u<D[HHio-stats.cgf_io_stats_mt_ios_statio_stats_entrylk_cbkstack-traceio_stats_fentrylk_cbkio_stats_inodelk_cbkio_stats_finodelk_cbkio_stats_xattrop_cbkio_stats_fxattrop_cbkio_stats_lookup_cbkio_stats_stat_cbkio_stats_readlink_cbkio_stats_mknod_cbkio_stats_unlink_cbkio_stats_rmdir_cbkio_stats_symlink_cbkio_stats_rename_cbkio_stats_link_cbkio_stats_setattr_cbkio_stats_truncate_cbkio_stats_readv_cbkio_stats_writev_cbkio_stats_copy_file_range_cbkio_stats_statfs_cbkio_stats_flush_cbkio_stats_fsync_cbkio_stats_getxattr_cbkio_stats_removexattr_cbkio_stats_fsetxattr_cbkio_stats_fgetxattr_cbkio_stats_fremovexattr_cbkio_stats_opendir_cbkio_stats_readdirp_cbkio_stats_readdir_cbkio_stats_fsyncdir_cbkio_stats_access_cbkio_stats_ftruncate_cbkio_stats_fstat_cbkio_stats_fallocate_cbkio_stats_discard_cbkio_stats_zerofill_cbkio_stats_ipc_cbkio_stats_lk_cbkio_stats_rchecksum_cbkio_stats_seek_cbkio_stats_lease_cbkio_stats_getactivelk_cbkio_stats_setactivelk_cbkio_stats_compound_cbk*io*stat*dumpio_stats_setxattr_cbkMemory accounting init failedjsontextgf_io_stats_mt_ios_stat_listcould not get inode ctx%s.cumulative.data_readcumulative.data_writtenincremental.data_readincremental.data_written%s.cumulative%s.incremental%ld,%ld,%.03f,%.03f,%.03fgf_common_mt_strdupio_stats_mkdir_cbkio_stats_open_cbkio_stats_create_cbkgf_io_stats_mt_ios_sample_bufgf_io_stats_mt_ios_sample%-12.0f %sN/A.%06ld%s %-10.2f %snfsdgluster.brickglustershdnfs-serverglusterfsdgf_common_mt_char%s.%s.%saggrintermbkb{"%s.%s.read_%d%s": %lu,"%s.%s.write_%d%s": %lu,"%s.%s.fds.open_count": %ld,"%s.%s.fop.%s.count": %lu,io-thread-queue-size"%s.%s.%s.queue_size": %d,"%s.%s.uptime": %ld,"%s.%s.bytes_read": %lu,"%s.%s.bytes_written": %lu}Unknown === Cumulative stats === === Interval %d stats === Duration : %ld secs BytesRead : %lu BytesWritten : %lu Block Size%-12s %cRead CountWrite Count%16dB+%18ld%18s%18lu%s Avg-LatencyCall CountFop%-13s %10s %14s %14s %14sMax-LatencyMin-Latency----------- COUNT: FILE NAME COUNT: DIRECTORY NAMEfailed to set interval %d%d-duration%d-total-read%d-total-write%d-read-%d%d-write-%d%d-%d-hits%d-%d-avglatency%d-%d-minlatency%d-%d-maxlatency%d-%d-upcall-hits../%s: no "../" allowed in path/var/run/gluster%s/%s.%sNo filename givenw+failed to open %s for writing*io*stat*%d_json_dump/var/lib/glusterd/stats/var/log/glusterfs/samples%s/%s_%s_%s.dump%s/%s_%s_%s.samp%s/%s_%s.dump%s/%s_%s.samp--- fd stats --- Filename : %s BytesRead : %ld bytes BytesWritten : %ld bytes Read %06db+ :%ldWrite %06db+ : %ldgf_io_stats_mt_ios_fdstack!framecurrent-openmax-openmax-openfd-timetop-opfilename%s-%dvaluetime-sectime-usecmembersclear-statsFailed to set top-op in dictFailed to reset top statsstats-clearedlist-cntthroughputinfo-opFailed to set info-op in dictpeekUnknown upcall event type :%dFailed to clear info statsio-statsdump-fd-statscount-fop-hitslatency-measurementios-dump-intervaliosdumpios-sample-intervalios-dump-formatios-sample-buf-sizesys-log-levelreconfigure returning %dgf_io_stats_mt_ios_confunique-idOut of memory.ios-dnscache-ttl-secio-stats translator unloadedoff6553586400DEBUGWARNINGERRORINFOCRITICALNONETRACEclient-log-levelGluster's syslog log-levelbrick-log-levelgluster-logsyslogclient-loggerbrick-loggerno-msg-idwith-msg-idclient-log-formatbrick-log-formatclient-log-buf-sizebrick-log-buf-size120client-log-flush-timeoutbrick-log-flush-timeout/no/such/pathUnique ID for our files.Assertion failed: To attach gdb and coredump, Run the script under "glusterfs/extras/debug/gfcore.py"(this->children->xlator)->fops->entrylkstack-address: %p, winding from %s to %s(this->children->xlator)->fops->fentrylk(this->children->xlator)->fops->inodelk(this->children->xlator)->fops->finodelk(this->children->xlator)->fops->xattrop(this->children->xlator)->fops->fxattrop(this->children->xlator)->fops->lookup(this->children->xlator)->fops->stat(this->children->xlator)->fops->readlink(this->children->xlator)->fops->mknod(this->children->xlator)->fops->unlink(this->children->xlator)->fops->rmdir(this->children->xlator)->fops->symlink(this->children->xlator)->fops->rename(this->children->xlator)->fops->link(this->children->xlator)->fops->setattr(this->children->xlator)->fops->truncate(this->children->xlator)->fops->readv(this->children->xlator)->fops->writev(this->children->xlator)->fops->copy_file_range(this->children->xlator)->fops->statfs(this->children->xlator)->fops->flush(this->children->xlator)->fops->fsync(this->children->xlator)->fops->getxattr(this->children->xlator)->fops->removexattr(this->children->xlator)->fops->fsetxattr(this->children->xlator)->fops->fgetxattr(this->children->xlator)->fops->fremovexattr(this->children->xlator)->fops->opendir(this->children->xlator)->fops->readdirp(this->children->xlator)->fops->readdir(this->children->xlator)->fops->fsyncdir(this->children->xlator)->fops->access(this->children->xlator)->fops->ftruncate(this->children->xlator)->fops->fsetattr(this->children->xlator)->fops->fstat(this->children->xlator)->fops->fallocate(this->children->xlator)->fops->discard(this->children->xlator)->fops->zerofill(this->children->xlator)->fops->ipc(this->children->xlator)->fops->lk(this->children->xlator)->fops->rchecksum(this->children->xlator)->fops->seek(this->children->xlator)->fops->lease(this->children->xlator)->fops->getactivelk(this->children->xlator)->fops->setactivelk(this->children->xlator)->fops->compound(this->children->xlator)->fops->setxattr(this->children->xlator)->fops->mkdir(this->children->xlator)->fops->open(this->children->xlator)->fops->create"%s.%s.read_%d%s_per_sec": %0.2lf,"%s.%s.write_%d%s_per_sec": %0.2lf,"%s.%s.fds.max_open_count": %ld,"%s.%s.fop.%s.per_sec": %0.2lf,"%s.%s.fop.%s.latency_ave_usec": %0.2lf,"%s.%s.fop.%s.latency_min_usec": %0.2lf,"%s.%s.fop.%s.latency_max_usec": %0.2lf,"%s.%s.fop.weighted_latency_ave_usec_nozerofill": %0.4lf,"%s.%s.fop.weighted_latency_ave_usec": %0.4lf,"%s.%s.fop.weighted_fop_count": %ld,"%s.%s.fop.unweighted_latency_ave_usec":%0.4lf,Unable to get queue size counts from the io-threads translator!"%s.%s.sample_interval_sec": %0.2lf,"%s.%s.bytes_read_per_sec": %0.2lf,"%s.%s.bytes_written_per_sec": %0.2lfgf_strdup failed, failing username resolution.%0.6lf,%s,%s,%0.4lf,%s,%s,%s,%s,%s,%sError parsing socket identifierSampling buffer is null, bailing!No samples, dump not required.Failed to init new sampling buffer, out of memory?%-13s %10lu %11s us %11s us %11s us%-13s %10lu %11.2lf us %11.2lf us %11.2lf us%-13s %10ld %11s us %11s us %11s us------ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Current open fd's: %ld Max open fd's: %ld time %s ==========Open File Stats======== ==========Read File Stats======== ==========Write File Stats======== ==========Directory open stats======== ========Directory readdirp Stats======= ========Read Throughput File Stats===== TIMESTAMP THROUGHPUT(KBPS) FILE NAME ======Write Throughput File Stats======failed to set duration(%d) - %ldfailed to set total read(%d) - %lufailed to set total write(%d) - %lufailed to set read-%db+, with: %ldfailed to set write-%db+, with: %ldfailed to set %s-fop-hits: %lufailed to set %s avglatency(%d) with %ffailed to set %s minlatency(%d) with %ffailed to set %s maxlatency(%d) with %ffailed to set %s-upcall-hits: %lutaking io-stats dump using setxattr not permitted on brick. Use 'gluster profile' insteadIO stats dump thread started, polling IO stats every %d secondscould not create stats-dump directory %scould not create stats-sample directory %sInvalid path for stats dump (%s) and/or latency samples (%s)could not open stats-dump file %s (%s)could not open samples-dump file %s (%s)IO stats dump thread terminated Lifetime : %ldsecs, %ldusecsstack-address: %p, %s returned %d error: %sstack-address: %p, %s returned %dFailed to set stats-cleared in dictConfigure ios_sample_buf size is 1024 because ios_sample_interval is 0Failed to start threadwhile reconfigure. Returning %dio_stats translator requires at least one subvolumedangling volume. check volfile Failed to start threadin init. Returning %dIf on stats related to file-operations would be tracked inside GlusterFS data-structures.Interval (in seconds) at which to auto-dump statistics. Zero disables automatic dumping.Interval in which we want to collect FOP latency samples. 2 means collect a sample every 2nd FOP. The dump-format option specifies the format in which to dump the statistics. Select between "text", "json", "dict" and "samples". Default is "json".The maximum size of our FOP sampling ring buffer.The interval after wish a cached DNS entry will be re-validated. Default: 24 hrsIf on stats related to the latency of each operation would be tracked inside GlusterFS data-structures. Changes the log-level of the clientsChanges the log-level of the bricksChanges the logging sub-system to log to, for the clientsChanges the logging sub-system to log to, for the bricksChanges log format for the clientsChanges the log format for the bricksThis option determines the maximum number of unique log messages that can be buffered for a time equal to the value of the option client-log-flush-timeout.This option determines the maximum number of unique log messages that can be buffered for a time equal to the value of the option brick-log-flush-timeout. 8Phxio_stats_clearnotifyfiniios_init_top_statsinitios_destroy_top_statsmem_acct_initreconfigureios_sample_buf_size_configurexlator_set_loglevelios_stats_cleanupio_stats_compoundio_stats_setactivelkio_stats_getactivelkio_stats_leaseio_stats_seekio_stats_rchecksumio_stats_lkio_stats_ipcio_stats_zerofillio_stats_discardio_stats_fallocateio_stats_fstatio_stats_fsetattrio_stats_ftruncateio_stats_accessio_stats_fsyncdirio_stats_readdirio_stats_readdirpio_stats_opendirio_stats_fremovexattrio_stats_fgetxattrio_stats_fsetxattrio_stats_removexattrio_stats_getxattrio_stats_setxattr_ios_dump_threadconditional_dumpio_stats_fsyncio_stats_flushio_stats_statfsio_stats_copy_file_rangeio_stats_writevio_stats_readvio_stats_createio_stats_openio_stats_truncateio_stats_setattrio_stats_linkio_stats_renameio_stats_symlinkio_stats_rmdirio_stats_unlinkio_stats_mkdirio_stats_mknodio_stats_readlinkio_stats_statio_stats_lookupio_stats_fxattropio_stats_xattropio_stats_finodelkio_stats_finodelk_cbkio_stats_inodelkio_stats_fentrylkio_stats_entrylkio_stats_inodelk_cbkio_stats_fxattrop_cbkio_stats_xattrop_cbkio_stats_compound_cbkio_stats_setactivelk_cbkio_stats_getactivelk_cbkio_stats_lease_cbkio_stats_seek_cbkio_stats_rchecksum_cbkio_stats_fentrylk_cbkio_stats_entrylk_cbkio_stats_lk_cbkio_stats_ipc_cbkio_stats_zerofill_cbkio_stats_discard_cbkio_stats_fallocate_cbkio_stats_fstat_cbkio_stats_ftruncate_cbkio_stats_access_cbkio_stats_fsyncdir_cbkio_stats_fremovexattr_cbkio_stats_fgetxattr_cbkio_stats_fsetxattr_cbkio_stats_removexattr_cbkio_stats_getxattr_cbkio_stats_setxattr_cbkio_stats_statfs_cbkio_stats_truncate_cbkio_stats_rmdir_cbkio_stats_opendir_cbkio_stats_flush_cbkio_stats_link_cbkio_stats_mkdir_cbkio_stats_mknod_cbkio_stats_symlink_cbkio_stats_lookup_cbkio_stats_readlink_cbkio_stats_rename_cbkio_stats_unlink_cbkio_stats_setattr_cbkio_stats_fsync_cbkio_stats_readdir_cbkio_stats_readdirp_cbkio_stats_copy_file_range_cbkio_stats_writev_cbkio_stats_readv_cbkio_stats_stat_cbkio_stats_open_cbkis_fop_latency_startedio_stats_create_cbkupdate_ios_latency_statsio_stats_dump_fdios_global_stats_cleario_stats_dumpios_dump_args_initio_stats_dump_globalio_stats_dump_global_to_dictio_stats_dump_global_to_logfpios_init_sample_bufio_stats_dump_latency_samples_logfp_io_stats_write_latency_sample_resolve_group_name_resolve_usernameio_stats_dump_global_to_json_logfpios_dump_throughput_statsios_dump_file_statsC.AM@eA@@;H x 8 hx  ( (H8H ("xh%( *h - H0 3X 5 h8 (;H = @ D8 G HJ L( Ox hR (UWhZh](`XbexhH8kmp8hs8vx({xh~(hhX؎Ȕ`(h80xx(XX0 X@8ج8p8h xP`h8xXHH0xH( xhh" &X 8) x, /H!2!h6!98"<"X@"C(#(Gx#J#M$hQh$T$W%[X%H^%xa%dH&g&k&8n8'hq't'w(({x(H~()Ȅh))(*XX**Ȕ*H+(+X+8,,,(-Hx-x-x.X.Ƚx...(/x8/hx/zRx $`FJ w?;*3$"D !,\8ACG@ AAB ,jADG@y AAI DBDA D@  CABE D  FABA $(AGPN AA $DOAG @ AA LlBEE E(A0A8D  8C0A(B BBBE Lh BEE E(A0A8D  8C0A(B BBBE L  BEE E(A0A8D 8C0A(B BBBH L\xBEE E(A0A8D 8C0A(B BBBH LBEE E(A0A8D 8C0A(B BBBF LhBEE E(A0A8D 8C0A(B BBBF LLBEE B(A0D8D 8C0A(B BBBD L8BEE B(A0D8D 8C0A(B BBBF LBEE E(A0A8D 8C0A(B BBBC L<BEE E(A0A8D 8C0A(B BBBG Lx!BEE E(A0A8D 8C0A(B BBBE L#BEE E(A0A8D 8C0A(B BBBE L,8&BEE E(A0A8D 8C0A(B BBBI L|(BEE E(A0A8D 8C0A(B BBBC L+BEE E(A0A8D 8C0A(B BBBC Lh-BEE E(A0A8D  8C0A(B BBBD Ll/BEE E(A0A8D 8C0A(B BBBC L82BEE B(A0D8D 8C0A(B BBBI L 4BBB E(D0D8G6 8A0A(B BBBF L\h8BEE E(A0A8D1 8C0A(B BBBD L;BEE B(A0D8D 8C0A(B BBBI Lh=BEE B(A0D8D 8C0A(B BBBI LL?BEE E(A0A8D 8C0A(B BBBE L(BBEE E(A0A8D 8C0A(B BBBF LDBEE E(A0A8D 8C0A(B BBBF L< GBEE E(A0A8D  8C0A(B BBBD L xIBEE E(A0A8D 8C0A(B BBBF L KBEE E(A0A8D 8C0A(B BBBF L, XNBEE E(A0A8D 8C0A(B BBBF L| PBEE B(A0D8D 8C0A(B BBBD L HSBEE E(A0A8D  8C0A(B BBBD L UBEE E(A0A8D 8C0A(B BBBH Ll (XBEE E(A0A8D 8C0A(B BBBH L ZBEE E(A0A8D 8C0A(B BBBF L ]BEE E(A0A8D  8C0A(B BBBD L\ x_BEE B(A0D8D 8C0A(B BBBD L aBEE E(A0A8D 8C0A(B BBBJ L XdBEE E(A0A8D  8C0A(B BBBD LL fBEE E(A0A8D  8C0A(B BBBD L 8iBEE B(A0D8D 8C0A(B BBBF L kBEE E(A0A8D 8C0A(B BBBF L<nBEE E(A0A8D  8C0A(B BBBD LxpBEE E(A0A8D  8C0A(B BBBD LrBEE E(A0A8D 8C0A(B BBBF L,XuBEE B(A0D8D 8C0A(B BBBD L|wBEE E(A0A8D 8C0A(B BBBF L(zBEE B(A0D8D 8C0A(B BBBD |KPL4|BEH B(A0D8D] 8A0A(B BBBG ,`_AAG E AAH 109AwLPuBEB B(A0D8Dx 8C0A(B BBBH DTBBE A(A0DPJ 0D(A BBBE $AJ g AE 0$AJ AC LpBBB B(A0A8JaY 8A0A(B BBBA LTBEE B(A0D8DK 8C0A(B BBBB L`BEE B(A0D8DK 8C0A(B BBBB LBEE B(A0D8Di 8C0A(B BBBD DED y A LdBJJ L(A0I8D@ 8D0A(B BBBA $OAG @ AA ,ȒAZD Q AAF , (AAG@w ACA <AP4\BED D(D@(C ABBL0TBEE J(D0A8G" 8A0A(B BBBA ,@-AC FEH E ,@0AF I G ,D@ AC DD G ,t AC DD K ,AJ I F \YBTE A(A0 (A BBGI l (A BBDK l(A BBGL4BBE B(A0D8L 8A0A(B BBBA L BBE J(A0A8J 8A0A(B BBBG iBEE D(D0GP 0F(A BBBD H 0D(A KBBL H 0D(A KBBL H 0D(A KBBE D\BDD F@  FABH H  CABA LBBE E(D0A8G0 8A0A(B BBBF ,AP P A ,$@Ac HKk F DTBBB D(A0D` 0A(A BBBA 4BDA G0  AABA DyBEE H(D0D@B 0A(A BBBJ ,HBDD G0 CABLLBBE E(A0D8F} 8C0A(B BBBF LBEB B(D0C8G 8A0A(B BBBC L+BBE B(D0C8G] 8C0A(B BBBF L<BEB E(D0D8I 8A0A(B BBBG L8BEB B(D0D8I 8A0A(B BB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+BBE B(D0C8G] 8C0A(B BBBF L 'hr#BBE B(D0C8GQ 8C0A(B BBBJ L\'Hu+BBE B(D0C8G] 8C0A(B BBBF L'(x+BBE B(D0C8G] 8C0A(B BBBF L'{+BBE B(D0C8G] 8C0A(B BBBF LL(}#BBE B(D0C8GQ 8C0A(B BBBJ L(Ȁ#BBE B(D0C8GQ 8C0A(B BBBJ L(BEJ B(A0A8I 8A0A(B BBBH <<)X BBA D(J (A ABBC |)(2ApD)HBAC G@V  AABI K  CABE )1<)2BBD A(D (A ABBD <*BDv F A<\*8BBA D(D  (A ABBH *RDg e A8`8j"q p1 Ti"i"oh  N l"x '8 oooooj"11111122&262F2V2f2v22222222233&363F3V3f3v33333333344&464F4V4f4v44444444455&565F5V5f5v55555555566&666F6V6f6v66666666677&767F7V7f7v77777777$u"`q"p"t"58PRUWZ0]_bPejpm@p0wy|@@PКPODPG>A JLh@ХP@p@t-:!$^ @H8!$x@H!$y!$@0A>!$?AD!$J:(!$;$JPX^clqwJPX^clq^#$PX^ccJPX^clq^!$0u#$(0u!$h0u#$ 0u!$44@B4@B0u#$.4@BX 0u!$d >@r@AE >@r@A0u#$^ >@r@AX 0u!$vio-stats.so.debugXg7zXZִF!t/& F]?Eh=ڊ2N WqI#i}qzςv_ `+6bZޯWw@9z9TMaˢ0*-̇az ~o<>A ~+2 ׿|#m]ޔT3C#Kd,YBU! g>| Ʌ_(Q5Q 9)0^9 gXURq `N;Hzk6/O ^}oZ֢T%WpubڴIcfT)U{`%@ 5T94 Q[Mĥn [ّ1w(;|%cWU> ͭ'CT!q5bމ&D%~rDASbŭGqlWskaP&ЉjgU5ShfasSÏßJ1=@-µ1$rMrb)tG)|C MY vт; ׆?[-š]-ёќM|veU,#\ŏ,BepiRT;QK\gb A \,DZ)qq.UGlׇƵL1r`Lnͱ0i,X6QoYӪ r6Kp\ C`?}ȅ!gnơ'ɰJBV&Eya菜Ϗx$ G.c"Ҹ.Ec| 6V]f"FÏhĄd5h3. ~*ؿ7[A%AYx(f8c2m2?ͧyrɃr*J73>.`CͱP&E&S ˬEFK+XA#;R6i/ѬL W/[m\xb[;Ji#\[WJO B[18'Jlqpጜli7+fdǟ9#$x]JI5^&Z,f^Zءݰaݱ5,~X]xlNxӽtPK(>mW,! Ddj01M,}?]Oplɝzc ԟ\sp5ƒs:!bҚs#Qʚ^$u"ǵx"tɈQ"hTO@yXk$5/I: ;Tbs=d^L\_7*d`}&Q8* ݟXpBJ<,T\]1hgI'!;(jR#?wUбu $Y+R6ץYfBՉ?xhɀY<;_vؘp=Ԭ_`Ђ8;11ؿew"^iYF/S܈2ryukI7"&pq?잸-nTy Q<Ha9 n5=Roc]ci!Q}13C-ȕBF-o6/J5G=!pʄ0oV1iBZM@7/ĄUYaՋ-"W"4āX=Vj,n>2.WSGnS:r__4Hɕ+;Y'l!m6|g lS:Mў 7l t'.JsDc $<1Yxa馅]7ʫ]&CCk\rDB5lzsGs,Z %ᓒ6?11ZQ6KnXֶՈs'#:,Et7UԱƹu+HJ<$X(2AGXj̆*PpU\yG﹄|bR#&_I#"'Ĥ^_ʑs P2r:sӨ>!Qn d:B9 Ybb{x>s%-趇H見qV.q>)❓ nP@@8@DD !!($* !!pp$$PtdTTTQtdRtd!!((GNUx[J)N7kɎpPf //iM U |'{ q, F"3 YBsMc-Y !__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesuuid_utoa__snprintf_chk__glusterfs_this_location_gf_log_gf_log_eh__stack_chk_failfd_ctx_set_gf_msgpthread_mutex_lockpthread_mutex_unlockstrerrortimespec_nowmem_get0pthread_mutex_initxlator_mem_acct_initeh_destroyuuid_utoa_rvsnprintfgf_proc_dump_add_sectioneh_dump__errno_locationgf_log_get_localtimelocaltime_rstrftimestrncpygf_proc_dump_writegmtime_r_gf_timestuffinode_ctx_set0strcasecmpstrchrdict_getdata_to_strgf_fop_listxlator_option_reconf_bool__gf_callocxlator_option_init_size__gf_freexlator_option_init_booleh_newgf_log_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Lt$0\$(HI=HH5H=AAHHD$$HD$ I$HD$H!HD$1I$Mt$M|$0HxoI<$An89(ID$((H +AT$tHH HHDAT$tHH»HHDI$H|$`L,LHH1l$$诬A~MHT$`H5C H=!<1z.AWAVAUIATIUHSHLL$HL$0 dH%(H$1LDD$XLL$8HH$H|$H HA?AIE0HH@HL(HEH@HxH HHHEL5H{@1HIE0HLs0HkH[hHC(H66HH2HH*H:HEHx荫H}HCHHHSHHSHHSHBE8賫IE0HH@HL,L0$IU0HHHH5CH5H==E1A HHD$(IHD$ HEHD$$HD$H!HD$13IE0H0HxHFHHS(H(H+BHHPStHHLprivatehistory-sizehistory size %lulogging to file %slogging to history %sforce-log-levelINFOTRACEERRORDEBUGWARNINGCRITICALNONEincludeexclude1024no%ld: gfid=%s op_ret=%d, op_errno=%d, *fd=%pstack-address: %p, %s returned %dstack-address: %p, %s returned %d error: %s%ld : gfid=%s op_ret=%d, op_errno=%d%ld: gfid=%s op_ret=%d, op_errno=%d%ld: gfid=%s op_ret=%d, op_errno=%d, fd=%p%ld: ({f_bsize=%lu, f_frsize=%lu, f_blocks=%lu, f_bfree=%lu, f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_favail=%lu, f_fsid=%lu, f_flag=%lu, f_namemax=%lu}) => ret=%d%ld: gfid=%s op_ret=%d, op_errno=%d, dict=%p%ld: gfid=%s op_ret=%d, op_errno=%d)%ld: gfid=%s op_ret=%d, {l_type=%d, l_whence=%d, l_start=%ld, l_len=%ld, l_pid=%u})%ld: gfid=%s op_ret=%d op_errno=%d%ld: gfid=%s op_ret=%d op_errno=%d, offset=%ld%ld: gfid=%s volume=%s, (path=%s basename=%s, cmd=%s, type=%s)(this->children->xlator)->fops->entrylkstack-address: %p, winding from %s to %s%ld: gfid=%s volume=%s, (path=%s cmd=%s, type=%s, start=%llu, len=%llu, pid=%llu)(this->children->xlator)->fops->inodelk%ld: gfid=%s volume=%s, (fd =%p cmd=%s, type=%s, start=%llu, len=%llu, pid=%llu)(this->children->xlator)->fops->finodelk%ld: gfid=%s (path=%s flags=%d)(this->children->xlator)->fops->xattrop(this->children->xlator)->fops->fxattrop(this->children->xlator)->fops->lookup(this->children->xlator)->fops->stat%ld: gfid=%s path=%s, size=%zu)(this->children->xlator)->fops->readlink%ld: gfid=%s path=%s mode=%d umask=0%o, dev=%lu)(this->children->xlator)->fops->mknod%ld: gfid=%s path=%s mode=%d umask=0%o(this->children->xlator)->fops->mkdir(this->children->xlator)->fops->unlink(this->children->xlator)->fops->rmdir%ld: gfid=%s linkpath=%s, path=%s umask=0%o(this->children->xlator)->fops->symlink%ld: gfid=%s path=%s, offset=%ld(this->children->xlator)->fops->truncate%ld: gfid=%s path=%s flags=%d fd=%p(this->children->xlator)->fops->open%ld: gfid=%s path=%s, fd=%p, flags=0%o mode=0%o umask=0%o(this->children->xlator)->fops->create%ld: gfid=%s fd=%p, size=%zuoffset=%ld flags=0%x)(this->children->xlator)->fops->readv%ld: gfid=%s fd=%p, count=%d, offset=%ld flags=0%x write_size=%zu(this->children->xlator)->fops->writev(this->children->xlator)->fops->statfs(this->children->xlator)->fops->flush(this->children->xlator)->fops->fsync(this->children->xlator)->fops->setxattr(this->children->xlator)->fops->getxattr(this->children->xlator)->fops->removexattr(this->children->xlator)->fops->opendir%ld: gfid=%s fd=%p, size=%zu, offset=%ld dict=%p(this->children->xlator)->fops->readdirp%ld: gfid=%s fd=%p, size=%zu, offset=%ld(this->children->xlator)->fops->readdir%ld: gfid=%s datasync=%d fd=%p(this->children->xlator)->fops->fsyncdir(this->children->xlator)->fops->access%ld: gfid=%s offset=%ldlen=%u fd=%p(this->children->xlator)->fops->rchecksum%ld: gfid=%s volume=%s, (fd=%p basename=%s, cmd=%s, type=%s)(this->children->xlator)->fops->fentrylk(this->children->xlator)->fops->fgetxattr(this->children->xlator)->fops->fsetxattr(this->children->xlator)->fops->ftruncate(this->children->xlator)->fops->fstat%ld: gfid=%s fd=%p, cmd=%d, lock {l_type=%d, l_whence=%d, l_start=%ld, l_len=%ld, l_pid=%u})(this->children->xlator)->fops->lk%ld: gfid=%s fd=%p offset=%ld what=%d(this->children->xlator)->fops->seek%ld: oldgfid=%s oldpath=%s --> newgfid=%s newpath=%s(this->children->xlator)->fops->rename(this->children->xlator)->fops->linkinvalid argument: this->historygfid=%s ino=%lu, mode=%o, nlink=%u, uid=%u, gid=%u, size=%lu, blocks=%lu, atime=%s mtime=%s ctime=%s atime_sec=%ld, atime_nsec=%u, mtime_sec=%ld, mtime_nsec=%u, ctime_sec=%ld, ctime_nsec=%u%ld: gfid=%s (op_ret=%d *buf {%s}, *postparent {%s}%ld: op_ret=%d, *prebuf = {%s}, *postbuf = {%s} )%ld: (op_ret=%d, *prebuf = {%s}, *postbuf = {%s} )%ld: gfid=%s op_ret=%d, *prebuf={%s}, *postbuf={%s}%ld: (op_ret=%d, *stbuf = {%s}, *prebuf = {%s}, *postbuf = {%s})%ld: gfid=%s (op_ret=%d , *stbuf = {%s}, *prebuf = {%s}, *postbuf = {%s} )%ld: gfid=%s (op_ret=%d *stbuf = {%s}, *preparent = {%s}, *postparent = {%s})%ld: (op_ret=%d, op_errno=%d,buf=%s, stbuf = { %s })%ld: (op_ret=%d, *stbuf = {%s}, *preoldparent = {%s}, *postoldparent = {%s} *prenewparent = {%s}, *postnewparent = {%s})%ld: gfid=%s op_ret=%d, *preparent = {%s}, *postparent = {%s})%ld: (op_ret=%d, *prebuf = {%s}, *postbuf = {%s})%ld: (op_ret=%d, *prebuf = {%s}, *postbuf = {%s}entry no. %d, pargfid=%s, bname=%s *buf {%s}%ld: gfid=%s (op_ret=%d, fd=%p*stbuf {%s}, *preparent {%s}, *postparent = {%s})%ld: gfid=%s path=%s uid=%o, gid=%o%ld: gfid=%s path=%s ia_atime=%s, ia_mtime=%s(this->children->xlator)->fops->setattr%ld: gfid=%s fd=%p, uid=%o, gid=%o%ld: gfid=%s fd=%p ia_atime=%s, ia_mtime=%s(this->children->xlator)->fops->fsetattrinvalid argument: this->privatemust specify only one of 'include-ops' and 'exclude-ops'trace translator requires one subvolumedangling volume. check volfile event history cannot be initialized@` trace_seek_cbktrace_seekfiniinitreconfiguremem_acct_inittrace_dump_historytrace_releasetrace_releasedirtrace_forgettrace_lktrace_fstattrace_ftruncatetrace_fsetxattrtrace_fgetxattrtrace_fentrylktrace_rchecksumtrace_accesstrace_fsyncdirtrace_readdirtrace_readdirptrace_opendirtrace_removexattrtrace_getxattrtrace_setxattrtrace_fsynctrace_flushtrace_statfstrace_writevtrace_readvtrace_createtrace_opentrace_truncatetrace_fsetattrtrace_setattrtrace_linktrace_renametrace_symlinktrace_rmdirtrace_unlinktrace_mkdirtrace_mknodtrace_readlinktrace_stattrace_lookuptrace_fxattroptrace_xattroptrace_finodelktrace_inodelktrace_entrylktrace_rchecksum_cbktrace_finodelk_cbktrace_inodelk_cbktrace_fxattrop_cbktrace_xattrop_cbktrace_fentrylk_cbktrace_entrylk_cbktrace_lk_cbktrace_fstat_cbktrace_ftruncate_cbktrace_access_cbktrace_fsyncdir_cbktrace_removexattr_cbktrace_fgetxattr_cbktrace_fsetxattr_cbktrace_getxattr_cbktrace_setxattr_cbktrace_statfs_cbktrace_truncate_cbktrace_rmdir_cbktrace_opendir_cbktrace_flush_cbktrace_link_cbktrace_mkdir_cbktrace_mknod_cbktrace_symlink_cbktrace_lookup_cbktrace_readlink_cbktrace_rename_cbktrace_unlink_cbktrace_fsetattr_cbktrace_setattr_cbktrace_fsync_cbktrace_readdirp_cbktrace_readdir_cbktrace_writev_cbktrace_readv_cbktrace_stat_cbktrace_open_cbktrace_create_cbk;aLn,qTr,t\uLy< },|l lܗ| \,̪Ll,< , , | ,  l l < \ L ,L l<,,| l< \L" &L)-|1<<5 9L=, A|DH_AAG E AAH ,X>JDh \ ALL>7BGB B(D0D8G"M 8A0A(B BBBE LxB7BGB B(D0D8G"M 8A0A(B BBBE $hFAJ AG 4PGyBFA J   AABA <LHBGA D(GN (A ABBG LJ=BGE B(A0A8G 8A0A(B BBBF LNBEB B(D0D8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[}Ϳ_K`SI#zYؙ%d64,^?.F?i)QjM{K A6R.I 97 $ *Cxښ@J;H;hFH6f8w*K DN)v$IЂUBo!P1W.1Pȣ2;aB$ Rǝ`3>di9EWCy6~#w2Fy@WT}"Vc<( FWnngfף>xdbb؍8b7E@'f#W`GcZU4!JMNՓ }8NȰrHm ChUijvB#$uNYgN9|SPF C>sVƔ?Kw8y[)jFno]R9eWMIk*Fg#0 r]>4~;wz_鈲gi(tfV 9g{((hn~Jfl=ySً>߈DBCN>֗V4< C)jWUއbv8'v1q5MY)̓"^G^T:̢ 7ıgYZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.data.rel.ro.dynamic.got.data.bss.gnu_debuglink.gnu_debugdata $o$( 0W8o `EoP P `T ^BhxxcnPPlt za"TThh!!!!!ph!h! ! PK!kLXX error-gen.sonuȯELF>@@8@ (( ( -p. HH H pp$$PtdQtdRtd(( ( GNUW*)v3lL_u)TOݳw%% U K  , F" BX<~d)k/*#iO$d __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesxlator_mem_acct_init_gf_loggf_assert_gf_msg__glusterfs_this_locationgf_fop_intpthread_mutex_destroy__gf_free__snprintf_chk__vsnprintf_chk__stack_chk_failpthread_mutex_trylockgf_proc_dump_add_sectiongf_proc_dump_writepthread_mutex_unlockstrcmpxlator_option_reconf_strxlator_option_reconf_percentxlator_option_reconf_bool__gf_callocpthread_mutex_initxlator_option_init_strxlator_option_init_percentxlator_option_init_booltimesrandpthread_mutex_lockstrerrortimespec_now__gf_mallocxlator_apilibglusterfs.so.0libz.so.1libm.so.6libuuid.so.1librt.so.1libdl.so.2libpthread.so.0libcrypto.so.10libc.so.6error-gen.soGLIBC_2.4GLIBC_2.2.5GLIBC_2.3.4@ii ui ti ui ( `0  @ @ 8 @  P @#X ` !h   @ ! @ *  ? B PF I pM P T @X 4 _ @c g | `k n 0( 0 P8 u@ PyH ;P [X 08` Prh @p &x  П p   0   0 -  1 p p @ @  @ X ֹ` ݹh p x        " ( . 4 ;  L R Y ` g m  s     !(!`!p!                  ( 0 8 @ H P X ` h p x         ! " # $HHe Ht#H5* %, @%* h%" h% h% h% h% h% h% hp% h`% h P% h @% h 0% h % h % h% h% h% h% h% h% h% h%z h%r hp%j h`%b hP%Z h@%R h0%J h %B h%: h%2 h%* h Hp H=b UH)HHw]H Ht]@H9 H=2 UH)HHHH?HHu]H Ht]H@= u'H= UHt H= h] @f.H= t&Ho HtUH= H]WKf.USHHHtJ}1t*H;L VHeH5fAH[]SHH Ht ^Y,H [D$HqHH5H=HD$$HD$E1A61RD$f.AUIATIUSH([MH(H_1@AHH=uMu fIAE<,tI]u"H([]A\A]D<,HSHuMtLEtSHA@H<,ttHC,HHtWHuHtIHLuL,$H}L ΞHwH5AU1@HHSH}L tH3H5ZAL11AHH=uHHH5 H=HD$$HD$E1AF1lQRH;HH5H=YHD$$HD$E1AE1USHHHtRHHtFHzH2H;HL z[]HۦH52A1fH[]fSHHHL$8LD$@LL$Ht7)D$P)L$`)T$p)$)$)$)$)$dH%(HD$1L LHH4xpH$HL$ )HLH<HT$HL$HcIH$D$0xHD$dH3%(uH[fffDAUATAUSHHdH%(H$1Ht"HHtLLAt0H$dH3 %(DH[]A\A]H3H=N1H H›H5H1DH5ĜH=1H5H=1nH5H=1SH5rH=u17L/*5DSHc1҃-HH Hq H 9[fDSHH=+H8u [f.H=Hް8tH= Hް$8tH=Hް 8tH=˚Hް 8tH=Hް8_H=Hް 8>H5H+¸ ;EH5`H¸H5IH¸H52H¸H5H¸H5H¸H5Hn¸cH5әHP¸'EH5H2¸'H5H¸ H5H¸H5rH¸H5[H¸H5DH¸&H5-H~¸sH5H`¸UH5HB% [À{I{O {[ÐAUATUSHH8dH%(HD$(1HHD$HD$HD$ ?L1MIHl$H8HnHLH|$tHcA$H8HL$ HFLH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0L0IFHLH2Ls(HoL gL0_HH5H5*H=8,E1A HHD$(I$HD$$HD$ HHD$H-HD$1͆AtCILIML$LHT$@LHAȇL HX1[]A\A]A^A_@I~0uĸIDf IDIXIpAt~!LӕA衆H$I}L +H4H5r)1A҆HDaI Ll$0D$(H4HH5))H=*EAHHD$$HD$ HHD$H7,HD$1sHLkL{0Hx蟆H;Am8D;(tHC(D(H H^L0VIU(HH3CpHHC(Hui$StHH HHD StHH»HHDE1IU(HshELH,$AЅL0HdI}0uIQs@H{)H3H5'H=`)HD$$HD$E1A1"f.AWMAVAUIATULSHHXHHT$@L$L(IE0L0IFHLH.Ls(H߄L ׄL0τHH52H5&H=(E1A 1HHD$(I$HD$$HD$ HHD$HQ*HD$1=AtCILIML$LHT$@LHA8L HX1[]A\A]A^A_@I~0uĸIDf IDIXIpAt~"LCAH$I}L 'H1H5%1A+BHDтIyLl$0D$(H0HH5%H=E'EA,HHD$$HD$ HHD$H(HD$1HLkL{0HxH;Am8D;(tHC(D(H Hc΂L0ƂIU(HH(0CpHHC(Hui蔂StHH HHDzStHH»HHDE1IU(HshELH,$A@L0HԀI}0uIs@H%Hj/H51$H=%HD$$HD$E1A,1蒀f.AWAVIAUATMUHSHHHHHT$8@LHE0H(HEHLH>+Hk(HVL8NH(FHH.H5s#H=%E1A JHHD$(IHD$$HD$ HHD$H&HD$1tfops->statFIRST_CHILD(this)->fops->linkFIRST_CHILD(this)->fops->opengf_common_mt_iovecFIRST_CHILD(this)->fops->lkEIOEMLINKENODEVEAGAINofferror-fopsAssertion failed: To attach gdb and coredump, Run the script under "glusterfs/extras/debug/gfcore.py"xlator.debug.error-gen.%s.priverror-gen not configured with one subvolumedangling volume. check volfile stack-address: %p, %s returned %d error: %sFIRST_CHILD(this)->fops->lookupstack-address: %p, winding from %s to %sFIRST_CHILD(this)->fops->setattrFIRST_CHILD(this)->fops->fsetattrFIRST_CHILD(this)->fops->truncateFIRST_CHILD(this)->fops->ftruncateFIRST_CHILD(this)->fops->accessFIRST_CHILD(this)->fops->readlinkFIRST_CHILD(this)->fops->mknodFIRST_CHILD(this)->fops->mkdirFIRST_CHILD(this)->fops->unlinkFIRST_CHILD(this)->fops->rmdirFIRST_CHILD(this)->fops->symlinkFIRST_CHILD(this)->fops->renameFIRST_CHILD(this)->fops->createFIRST_CHILD(this)->fops->readvFIRST_CHILD(this)->fops->writevFIRST_CHILD(this)->fops->flushFIRST_CHILD(this)->fops->fsyncFIRST_CHILD(this)->fops->fstatFIRST_CHILD(this)->fops->opendirFIRST_CHILD(this)->fops->fsyncdirFIRST_CHILD(this)->fops->statfsFIRST_CHILD(this)->fops->setxattrFIRST_CHILD(this)->fops->getxattrFIRST_CHILD(this)->fops->fsetxattrFIRST_CHILD(this)->fops->fgetxattrFIRST_CHILD(this)->fops->xattropFIRST_CHILD(this)->fops->fxattropFIRST_CHILD(this)->fops->removexattrFIRST_CHILD(this)->fops->fremovexattrFIRST_CHILD(this)->fops->inodelkFIRST_CHILD(this)->fops->finodelkFIRST_CHILD(this)->fops->entrylkFIRST_CHILD(this)->fops->fentrylkFIRST_CHILD(this)->fops->getspecFIRST_CHILD(this)->fops->readdirFIRST_CHILD(this)->fops->readdirpPercentage failure of operations when enabled.Accepts a string which takes ',' separated fop strings to denote which fops are enabled for errorfiniiniterror_gen_set_failureerror_gen_parse_fill_fopsreconfiguremem_acct_initerror_gen_readdirperror_gen_readdirerror_gen_getspecerror_gen_fentrylkerror_gen_entrylkerror_gen_finodelkerror_gen_inodelkerror_gen_lkerror_gen_fremovexattrerror_gen_removexattrerror_gen_fxattroperror_gen_xattroperror_gen_fgetxattrerror_gen_fsetxattrerror_gen_getxattrerror_gen_setxattrerror_gen_statfserror_gen_fsyncdirerror_gen_opendirerror_gen_fstaterror_gen_fsyncerror_gen_flusherror_gen_writeverror_gen_readverror_gen_openerror_gen_createerror_gen_linkerror_gen_renameerror_gen_symlinkerror_gen_rmdirerror_gen_unlinkerror_gen_mkdirerror_gen_mknoderror_gen_readlinkerror_gen_accesserror_gen_ftruncateerror_gen_truncateerror_gen_fsetattrerror_gen_setattrerror_gen_staterror_gen_lookupY@0A;5MPXQ(QPTTUV0VPZx[]^Hhbexi8mpt(xwxz~HhȅHX8H X 8 ( (( x   h  X  H(8h(8xzRx $L FJ w?;*3$",DN_AAG E AAH $t(OAG0c AA <O)BED A(DP\ (A ABBF 4QgAAG l HAb DAA$Q AJ AC <<R+BBG A(J [ (A ABBI |S*Ah$SAd K  A a<VBBA A(G`S (A ABBJ <W$BBA D(DP (A ABBA LDY BBD A(D0M (C ABBF N (A CBBB LZBBE E(A0D8G 8C0A(B BBBK L]cBBE E(A0D8G 8C0A(B BBBG L4`BEB E(A0D8G 8C0A(B BBBG L8dBEB E(A0D8G 8C0A(B BBBC Lxg{BBE B(D0D8G 8C0A(B BBBH L$j{BBE B(D0D8G 8C0A(B BBBB LtmkBBE B(D0D8G 8C0A(B BBBB Lp{BBE B(D0D8G 8C0A(B BBBH L(tBEE B(D0A8G 8C0A(B BBBA LdwBEB E(A0D8G 8C0A(B BBBF Lz{BBE B(D0D8G 8C0A(B BBBH L~{BBE B(D0D8G 8C0A(B BBBH LT8BEE B(D0A8G 8C0A(B BBBK LBBE E(A0D8G 8C0A(B BBBH LBBE E(A0D8G 8C0A(B BBBH LD8BEE B(D0A8G  8C0A(B BBBF LȎsBEB E(A0D8G 8C0A(B BBBF LBEE B(D0A8G 8C0A(B BBBG L4hXBEE B(D0A8G. 8C0A(B BBBD LxcBBE E(A0D8G 8C0A(B BBBE L{BBE B(D0D8G 8C0A(B BBBD L$ ȟsBBE E(A0D8G 8C0A(B BBBG Lt sBBE B(D0D8G 8C0A(B BBBF L (kBBE B(D0D8G 8C0A(B BBBB L HcBBE E(A0D8G 8C0A(B BBBA Ld h{BEB E(A0D8G 8C0A(B BBBF L sBBE B(D0D8G 8C0A(B BBBB L Ȳ{BEB E(A0D8G 8C0A(B BBBC LT sBBE B(D0D8G 8C0A(B BBBG L (BEB E(A0D8G 8C0A(B BBBE L hBEB E(A0D8G 8C0A(B BBBE LD kBBE B(D0D8G 8C0A(B BBBB L sBBE B(D0D8G 8C0A(B BBBG L BEB E(A0D8G 8C0A(B BBBH L4 8BEE B(D0A8G 8C0A(B BBBI L BEE B(D0A8G 8C0A(B BBBI L BEE B(D0A8G  8C0A(B BBBF L$8BEE B(D0A8G 8C0A(B BBBG LtkBBE E(A0D8G 8C0A(B BBBD LBEB E(A0D8G 8C0A(B BBBF LBEE B(D0A8G 8C0A(B BBBF ` @ o h ( 0 o   Ph  oo oooZH &6FVfv&6FVfv $  $  $  $  $   ' $  $  $  $ $  $ $ $ & $&  $ $ $ $  $ $ $ $  $   $ $ $ $  $&  $ $ $   $    $ $ @#! @ !@ * ?BPFIpMPT@X4_@cg|`kn0PuPy;[08Pr@&Пp00- 1pp@@ֹݹ "(.4;LRY`gmsperror-gen.so.debuguZ7zXZִF!t/#]?Eh=ڊ2Ny^ wu֔$: Bd  `D<8[uM Dw/ aW͟<37铺ﲦ(Jk>gJ`(6<;5.'57+mFJ ^(mՁ8pau{4y[, o"zJ*fd[$t Ŷ6^bJMgD.s$0:|#¡@-Hd H[4a%д|Zz(0Q, J[LM|+^8n(?EnX{V3/x RL+lblZ5j~7u·- hLM]Lɥ&R}މߥK[Hh#󺖙)I+&~|n))A0f 7;8hr]"o"Z,rݭj5>mߣpR8`=g7N(z ~®/Y)_ވzjo2ӈ[8śiAy $.CCsu=@%a{@KCE9X" 䤚rnTrnm}]>f׀]Q46Xg*OϔIrϰGR[߈80 miAO1>wDg UMm?J} >6^e%xKp T7(h-<41 u0i0Bpv>uGܣnă/S v\%F70 9 {%YۊI4XE5΁[MVr)ݻW ?sپU bAq_.D,nj&`+S!u^&3i6ƿ꤀$-CɌ] :]},a$R3٧i9{OU r $%p\\ka- ]R.p L>g4ٳmeaSB{8(׾_7D:]?BUGP!X0;*P6)pE *kUR5ӞУ>D|Ď?oj;' *gW/gYZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.data.rel.ro.dynamic.got.data.bss.gnu_debuglink.gnu_debugdata $o$( 08oLEo  `Th h ^BPPhhhc n[t z ``d( (0 08 8@ @H Hp H *  ! x  8 dPK!0 / /sink.sonuȯELF>p@`(@8@t t   80   pp$$Ptd\ \ \ 44QtdRtd  GNU@禦cS3/ #p   U  , F"ix __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesdefault_notify__glusterfs_this_location_gf_msgpthread_mutex_lockpthread_mutex_unlocktimespec_now__stack_chk_failxlator_apilibglusterfs.so.0libz.so.1libm.so.6libuuid.so.1librt.so.1libdl.so.2libpthread.so.0libcrypto.so.10libc.so.6sink.soGLIBC_2.2.5GLIBC_2.44 ui fTii rui f       @$ 0 ` 8 p X  `  h ( P!                    HH% Ht#H5 % @% h% h% h% h% h% h%z h%r hp%j h`H H= UH)HHw]HT Ht]@Hy H=r UH)HHHH?HHu]H Ht]H@=9 u'H= UHt H= h] @f.H= t&H HtUH= H]WKf.1f.@f.Htu 11H1l1HDAWAVAUI͹ATUSHHLd$@L$dH%(H$x1LHHLDŽ$HID$(HHH5H=E1A EHHD$$HD$ HHD$HHD$1yHC0HkHD$0HHxm8H;HLJ HLJvHHD$8iHU(HHkCpHHC(HulMMOHshHU(E11HLt$Ll$L$$HD$0Ht$8H01H$xdH34%(HĈ[]A\A]A^A_fHtH}0uHap@E1qHfHH5KH=KHD$$HD$E1AE1[CHHsink.cstack!framestack-tracesinkstack-address: %p, %s returned %dsink_lookup;0tLt$dzRx $ FJ w?;*3$"D\tx;D\ H RL-BBB J(A0A8J 8A0A(B BBBC  )4DT^    oh | x P ooooo  &6FVfy @$ ` p ( sink.so.debug(B7zXZִF!t/ ']?Eh=ڊ2N$D I{n$+gٔdxgkZRs<D?HOjZNzkzG ڭ4{ƶ{?F1EF.]ͭN]ڝq ,W2A.Q-c^MFIUP$.4-h~|4%/w$ CvB: kʵw_Mu~"O [CF8e$?lw?啍ud}C!j 'paLڲR S[a1Gח@`Ce[rdV.jr4b!fK|qZ 1Au+iց_a ?byX;ylн2%Z3vc* gYZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.data.rel.ro.dynamic.got.data.bss.gnu_debuglink.gnu_debugdata $o$( P0hh|8oEoPTPP^Bhcnpp}t z \\ \ 4      px x   $ $  $4$0d'PK!Kp\O 2php-5.6.40/build-cgi/main/internal_functions_cli.cnu[/* -*- C -*- +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andi Gutmans | | Zeev Suraski | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "php.h" #include "php_main.h" #include "zend_modules.h" #include "zend_compile.h" #include #include #include #include "ext/date/php_date.h" #include "ext/ereg/php_ereg.h" #include "ext/libxml/php_libxml.h" #include "ext/openssl/php_openssl.h" #include "ext/pcre/php_pcre.h" #include "ext/zlib/php_zlib.h" #include "ext/filter/php_filter.h" #include "ext/hash/php_hash.h" #include "ext/pcntl/php_pcntl.h" #include "ext/readline/php_readline.h" #include "ext/reflection/php_reflection.h" #include "ext/session/php_session.h" #include "ext/spl/php_spl.h" #include "ext/standard/php_standard.h" static zend_module_entry *php_builtin_extensions[] = { phpext_date_ptr, phpext_ereg_ptr, phpext_libxml_ptr, phpext_openssl_ptr, phpext_pcre_ptr, phpext_zlib_ptr, phpext_filter_ptr, phpext_hash_ptr, phpext_pcntl_ptr, phpext_readline_ptr, phpext_reflection_ptr, phpext_spl_ptr, phpext_session_ptr, phpext_standard_ptr, }; #define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *)) PHPAPI int php_register_internal_extensions(TSRMLS_D) { return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC); } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ PK!s,php-5.6.40/build-cgi/Zend/zend_ini_scanner.cnu[/* Generated by re2c 0.13.5 */ #line 1 "Zend/zend_ini_scanner.l" /* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ | Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Zeev Suraski | | Jani Taskinen | | Marcus Boerger | | Nuno Lopes | | Scott MacVicar | +----------------------------------------------------------------------+ */ /* $Id$ */ #include #include "zend.h" #include "zend_API.h" #include "zend_globals.h" #include #include "zend_ini_scanner.h" #if 0 # define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c) #else # define YYDEBUG(s, c) #endif #include "zend_ini_scanner_defs.h" #define YYCTYPE unsigned char /* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD) * so that if will be able to terminate to match the current token (e.g. non-enclosed string) */ #define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; } #define YYCURSOR SCNG(yy_cursor) #define YYLIMIT SCNG(yy_limit) #define YYMARKER SCNG(yy_marker) #define YYGETCONDITION() SCNG(yy_state) #define YYSETCONDITION(s) SCNG(yy_state) = s #define STATE(name) yyc##name /* emulate flex constructs */ #define BEGIN(state) YYSETCONDITION(STATE(state)) #define YYSTATE YYGETCONDITION() #define yytext ((char*)SCNG(yy_text)) #define yyleng SCNG(yy_leng) #define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \ yyleng = (unsigned int)x; } while(0) /* #define yymore() goto yymore_restart */ /* perform sanity check. If this message is triggered you should increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */ #define YYMAXFILL 6 #if ZEND_MMAP_AHEAD < (YYMAXFILL + 1) # error ZEND_MMAP_AHEAD should be greater than YYMAXFILL #endif /* How it works (for the core ini directives): * =========================================== * * 1. Scanner scans file for tokens and passes them to parser. * 2. Parser parses the tokens and passes the name/value pairs to the callback * function which stores them in the configuration hash table. * 3. Later REGISTER_INI_ENTRIES() is called which triggers the actual * registering of ini entries and uses zend_get_configuration_directive() * to fetch the previously stored name/value pair from configuration hash table * and registers the static ini entries which match the name to the value * into EG(ini_directives) hash table. * 4. PATH section entries are used per-request from down to top, each overriding * previous if one exists. zend_alter_ini_entry() is called for each entry. * Settings in PATH section are ZEND_INI_SYSTEM accessible and thus mimics the * php_admin_* directives used within Apache httpd.conf when PHP is compiled as * module for Apache. * 5. User defined ini files (like .htaccess for apache) are parsed for each request and * stored in separate hash defined by SAPI. */ /* TODO: (ordered by importance :-) * =============================================================================== * * - Separate constant lookup totally from plain strings (using CONSTANT pattern) * - Add #if .. #else .. #endif and ==, !=, <, > , <=, >= operators * - Add #include "some.ini" * - Allow variables to refer to options also when using parse_ini_file() * */ /* Globals Macros */ #define SCNG INI_SCNG #ifdef ZTS ZEND_API ts_rsrc_id ini_scanner_globals_id; #else ZEND_API zend_ini_scanner_globals ini_scanner_globals; #endif /* Eat leading whitespace */ #define EAT_LEADING_WHITESPACE() \ while (yyleng) { \ if (yytext[0] == ' ' || yytext[0] == '\t') { \ SCNG(yy_text)++; \ yyleng--; \ } else { \ break; \ } \ } /* Eat trailing whitespace + extra char */ #define EAT_TRAILING_WHITESPACE_EX(ch) \ while (yyleng && ( \ (ch != 'X' && yytext[yyleng - 1] == ch) || \ yytext[yyleng - 1] == '\n' || \ yytext[yyleng - 1] == '\r' || \ yytext[yyleng - 1] == '\t' || \ yytext[yyleng - 1] == ' ') \ ) { \ yyleng--; \ } /* Eat trailing whitespace */ #define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X') #define zend_ini_copy_value(retval, str, len) { \ Z_STRVAL_P(retval) = zend_strndup(str, len); \ Z_STRLEN_P(retval) = len; \ Z_TYPE_P(retval) = IS_STRING; \ } #define RETURN_TOKEN(type, str, len) { \ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \ zend_ini_copy_typed_value(ini_lval, type, str, len); \ } else { \ zend_ini_copy_value(ini_lval, str, len); \ } \ return type; \ } static inline int convert_to_number(zval *retval, const char *str, const int str_len) { zend_uchar type; int overflow; long lval; double dval; if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) { if (type == IS_LONG) { ZVAL_LONG(retval, lval); return SUCCESS; } else if (type == IS_DOUBLE && !overflow) { ZVAL_DOUBLE(retval, dval); return SUCCESS; } } return FAILURE; } static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len) { switch (type) { case BOOL_FALSE: case BOOL_TRUE: ZVAL_BOOL(retval, type == BOOL_TRUE); break; case NULL_NULL: ZVAL_NULL(retval); break; case TC_NUMBER: if (convert_to_number(retval, str, len) == SUCCESS) { break; } /* intentional fall-through */ default: zend_ini_copy_value(retval, str, len); } } static void _yy_push_state(int new_state TSRMLS_DC) { zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int)); YYSETCONDITION(new_state); } #define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm) static void yy_pop_state(TSRMLS_D) { int *stack_state; zend_stack_top(&SCNG(state_stack), (void **) &stack_state); YYSETCONDITION(*stack_state); zend_stack_del_top(&SCNG(state_stack)); } static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC) { YYCURSOR = (YYCTYPE*)str; SCNG(yy_start) = YYCURSOR; YYLIMIT = YYCURSOR + len; } #define ini_filename SCNG(filename) /* {{{ init_ini_scanner() */ static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC) { /* Sanity check */ if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) { zend_error(E_WARNING, "Invalid scanner mode"); return FAILURE; } SCNG(lineno) = 1; SCNG(scanner_mode) = scanner_mode; SCNG(yy_in) = fh; if (fh != NULL) { ini_filename = zend_strndup(fh->filename, strlen(fh->filename)); } else { ini_filename = NULL; } zend_stack_init(&SCNG(state_stack)); BEGIN(INITIAL); return SUCCESS; } /* }}} */ /* {{{ shutdown_ini_scanner() */ void shutdown_ini_scanner(TSRMLS_D) { zend_stack_destroy(&SCNG(state_stack)); if (ini_filename) { free(ini_filename); } } /* }}} */ /* {{{ zend_ini_scanner_get_lineno() */ int zend_ini_scanner_get_lineno(TSRMLS_D) { return SCNG(lineno); } /* }}} */ /* {{{ zend_ini_scanner_get_filename() */ char *zend_ini_scanner_get_filename(TSRMLS_D) { return ini_filename ? ini_filename : "Unknown"; } /* }}} */ /* {{{ zend_ini_open_file_for_scanning() */ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC) { char *buf; size_t size; if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) { return FAILURE; } if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) { zend_file_handle_dtor(fh TSRMLS_CC); return FAILURE; } yy_scan_buffer(buf, size TSRMLS_CC); return SUCCESS; } /* }}} */ /* {{{ zend_ini_prepare_string_for_scanning() */ int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC) { int len = strlen(str); if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) { return FAILURE; } yy_scan_buffer(str, len TSRMLS_CC); return SUCCESS; } /* }}} */ /* {{{ zend_ini_escape_string() */ static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC) { register char *s, *t; char *end; zend_ini_copy_value(lval, str, len); /* convert escape sequences */ s = t = Z_STRVAL_P(lval); end = s + Z_STRLEN_P(lval); while (s < end) { if (*s == '\\') { s++; if (s >= end) { *t++ = '\\'; continue; } switch (*s) { case '"': if (*s != quote_type) { *t++ = '\\'; *t++ = *s; break; } case '\\': case '$': *t++ = *s; Z_STRLEN_P(lval)--; break; default: *t++ = '\\'; *t++ = *s; break; } } else { *t++ = *s; } if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) { SCNG(lineno)++; } s++; } *t = 0; } /* }}} */ int ini_lex(zval *ini_lval TSRMLS_DC) { restart: SCNG(yy_text) = YYCURSOR; /* yymore_restart: */ /* detect EOF */ if (YYCURSOR >= YYLIMIT) { if (YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW)) { BEGIN(INITIAL); return END_OF_LINE; } return 0; } /* Eat any UTF-8 BOM we find in the first 3 bytes */ if (YYCURSOR == SCNG(yy_start) && YYCURSOR + 3 < YYLIMIT) { if (memcmp(YYCURSOR, "\xef\xbb\xbf", 3) == 0) { YYCURSOR += 3; goto restart; } } #line 384 "Zend/zend_ini_scanner.c" { YYCTYPE yych; unsigned int yyaccept = 0; if (YYGETCONDITION() < 4) { if (YYGETCONDITION() < 2) { if (YYGETCONDITION() < 1) { goto yyc_INITIAL; } else { goto yyc_ST_OFFSET; } } else { if (YYGETCONDITION() < 3) { goto yyc_ST_SECTION_VALUE; } else { goto yyc_ST_VALUE; } } } else { if (YYGETCONDITION() < 6) { if (YYGETCONDITION() < 5) { goto yyc_ST_SECTION_RAW; } else { goto yyc_ST_DOUBLE_QUOTES; } } else { if (YYGETCONDITION() < 7) { goto yyc_ST_VARNAME; } else { goto yyc_ST_RAW; } } } /* *********************************** */ yyc_INITIAL: { static const unsigned char yybm[] = { 144, 144, 144, 144, 144, 144, 144, 144, 144, 160, 0, 144, 144, 0, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 240, 128, 128, 144, 128, 144, 128, 144, 128, 128, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 128, 144, 128, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 128, 144, 144, 128, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 128, 128, 128, 128, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, }; YYDEBUG(0, *YYCURSOR); YYFILL(5); yych = *YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case '\t': goto yy4; case '\n': goto yy6; case '\r': goto yy8; case ' ': goto yy9; case '!': case '"': case '$': case '&': case '(': case ')': case '^': case '{': case '|': case '}': case '~': goto yy10; case '#': goto yy12; case '%': case '\'': case '*': case '+': case ',': case '-': case '.': case '/': case ':': case '<': case '>': case '?': case '@': case ']': goto yy13; case ';': goto yy14; case '=': goto yy16; case 'F': case 'f': goto yy18; case 'N': case 'n': goto yy19; case 'O': case 'o': goto yy20; case 'T': case 't': goto yy21; case 'Y': case 'y': goto yy22; case '[': goto yy23; default: goto yy2; } yy2: YYDEBUG(2, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy26; yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 480 "Zend/zend_ini_scanner.l" { /* Get option name */ /* Eat leading whitespace */ EAT_LEADING_WHITESPACE(); /* Eat trailing whitespace */ EAT_TRAILING_WHITESPACE(); RETURN_TOKEN(TC_LABEL, yytext, yyleng); } #line 523 "Zend/zend_ini_scanner.c" yy4: YYDEBUG(4, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy73; yy5: YYDEBUG(5, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 626 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; } #line 537 "Zend/zend_ini_scanner.c" yy6: YYDEBUG(6, *YYCURSOR); ++YYCURSOR; yy7: YYDEBUG(7, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 631 "Zend/zend_ini_scanner.l" { SCNG(lineno)++; return END_OF_LINE; } #line 549 "Zend/zend_ini_scanner.c" yy8: YYDEBUG(8, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy76; goto yy7; yy9: YYDEBUG(9, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x08) goto yy26; if (yych <= '\t') goto yy72; goto yy76; } else { if (yych == '\r') goto yy77; if (yych <= 0x1F) goto yy26; goto yy74; } } else { if (yych <= ':') { if (yych == '#') goto yy63; goto yy26; } else { if (yych <= ';') goto yy58; if (yych == '=') goto yy56; goto yy26; } } yy10: YYDEBUG(10, *YYCURSOR); ++YYCURSOR; YYDEBUG(11, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 554 "Zend/zend_ini_scanner.l" { /* Disallow these chars outside option values */ return yytext[0]; } #line 588 "Zend/zend_ini_scanner.c" yy12: YYDEBUG(12, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); goto yy64; yy13: YYDEBUG(13, *YYCURSOR); yych = *++YYCURSOR; goto yy26; yy14: YYDEBUG(14, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); goto yy59; YYDEBUG(15, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 654 "Zend/zend_ini_scanner.l" { return 0; } #line 609 "Zend/zend_ini_scanner.c" yy16: YYDEBUG(16, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy57; yy17: YYDEBUG(17, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 490 "Zend/zend_ini_scanner.l" { /* Start option value */ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { yy_push_state(ST_RAW TSRMLS_CC); } else { yy_push_state(ST_VALUE TSRMLS_CC); } return '='; } #line 627 "Zend/zend_ini_scanner.c" yy18: YYDEBUG(18, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy53; if (yych == 'a') goto yy53; goto yy26; yy19: YYDEBUG(19, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'O') goto yy44; if (yych <= 'T') goto yy26; goto yy45; } else { if (yych <= 'o') { if (yych <= 'n') goto yy26; goto yy44; } else { if (yych == 'u') goto yy45; goto yy26; } } yy20: YYDEBUG(20, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'F') goto yy38; if (yych <= 'M') goto yy26; goto yy31; } else { if (yych <= 'f') { if (yych <= 'e') goto yy26; goto yy38; } else { if (yych == 'n') goto yy31; goto yy26; } } yy21: YYDEBUG(21, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy36; if (yych == 'r') goto yy36; goto yy26; yy22: YYDEBUG(22, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy27; if (yych == 'e') goto yy27; goto yy26; yy23: YYDEBUG(23, *YYCURSOR); ++YYCURSOR; YYDEBUG(24, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 405 "Zend/zend_ini_scanner.l" { /* Section start */ /* Enter section data lookup state */ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { yy_push_state(ST_SECTION_RAW TSRMLS_CC); } else { yy_push_state(ST_SECTION_VALUE TSRMLS_CC); } return TC_SECTION; } #line 693 "Zend/zend_ini_scanner.c" yy25: YYDEBUG(25, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy26: YYDEBUG(26, *YYCURSOR); if (yybm[0+yych] & 16) { goto yy25; } if (yych == '[') goto yy28; goto yy3; yy27: YYDEBUG(27, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy31; if (yych == 's') goto yy31; goto yy26; yy28: YYDEBUG(28, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(29, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy28; } YYDEBUG(30, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 430 "Zend/zend_ini_scanner.l" { /* Start of option with offset */ /* Eat leading whitespace */ EAT_LEADING_WHITESPACE(); /* Eat trailing whitespace and [ */ EAT_TRAILING_WHITESPACE_EX('['); /* Enter offset lookup state */ yy_push_state(ST_OFFSET TSRMLS_CC); RETURN_TOKEN(TC_OFFSET, yytext, yyleng); } #line 736 "Zend/zend_ini_scanner.c" yy31: YYDEBUG(31, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(32, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy31; } if (yych <= '\'') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x08) goto yy25; if (yych <= '\t') goto yy34; } else { if (yych != '\r') goto yy25; } } else { if (yych <= '$') { if (yych == '#') goto yy25; } else { if (yych != '&') goto yy25; } } } else { if (yych <= 'Z') { if (yych <= ';') { if (yych <= ')') goto yy33; if (yych <= ':') goto yy25; } else { if (yych != '=') goto yy25; } } else { if (yych <= '^') { if (yych <= '[') goto yy28; if (yych <= ']') goto yy25; } else { if (yych <= 'z') goto yy25; if (yych >= 0x7F) goto yy25; } } } yy33: YYDEBUG(33, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 468 "Zend/zend_ini_scanner.l" { /* TRUE value (when used outside option value/offset this causes parse error!) */ RETURN_TOKEN(BOOL_TRUE, "1", 1); } #line 786 "Zend/zend_ini_scanner.c" yy34: YYDEBUG(34, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(35, *YYCURSOR); if (yych == '\t') goto yy34; if (yych == ' ') goto yy34; goto yy33; yy36: YYDEBUG(36, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy37; if (yych != 'u') goto yy26; yy37: YYDEBUG(37, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy31; if (yych == 'e') goto yy31; goto yy26; yy38: YYDEBUG(38, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'F') goto yy39; if (yych != 'f') goto yy26; yy39: YYDEBUG(39, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(40, *YYCURSOR); if (yych <= '&') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x08) goto yy25; if (yych <= '\t') goto yy42; } else { if (yych != '\r') goto yy25; } } else { if (yych <= '#') { if (yych <= ' ') goto yy39; if (yych >= '#') goto yy25; } else { if (yych == '%') goto yy25; } } } else { if (yych <= '=') { if (yych <= ':') { if (yych <= '\'') goto yy25; if (yych >= '*') goto yy25; } else { if (yych == '<') goto yy25; } } else { if (yych <= ']') { if (yych == '[') goto yy28; goto yy25; } else { if (yych <= '^') goto yy41; if (yych <= 'z') goto yy25; if (yych >= 0x7F) goto yy25; } } } yy41: YYDEBUG(41, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 472 "Zend/zend_ini_scanner.l" { /* FALSE value (when used outside option value/offset this causes parse error!)*/ RETURN_TOKEN(BOOL_FALSE, "", 0); } #line 860 "Zend/zend_ini_scanner.c" yy42: YYDEBUG(42, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(43, *YYCURSOR); if (yych == '\t') goto yy42; if (yych == ' ') goto yy42; goto yy41; yy44: YYDEBUG(44, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\'') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x08) goto yy26; if (yych <= '\t') goto yy42; goto yy41; } else { if (yych == '\r') goto yy41; goto yy26; } } else { if (yych <= '#') { if (yych <= ' ') goto yy39; if (yych <= '"') goto yy41; goto yy26; } else { if (yych == '%') goto yy26; if (yych <= '&') goto yy41; goto yy26; } } } else { if (yych <= 'N') { if (yych <= ';') { if (yych <= ')') goto yy41; if (yych <= ':') goto yy26; goto yy41; } else { if (yych == '=') goto yy41; if (yych <= 'M') goto yy26; goto yy52; } } else { if (yych <= 'm') { if (yych == '^') goto yy41; goto yy26; } else { if (yych <= 'n') goto yy52; if (yych <= 'z') goto yy26; if (yych <= '~') goto yy41; goto yy26; } } } yy45: YYDEBUG(45, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'L') goto yy46; if (yych != 'l') goto yy26; yy46: YYDEBUG(46, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'L') goto yy47; if (yych != 'l') goto yy26; yy47: YYDEBUG(47, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(48, *YYCURSOR); if (yych <= '&') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x08) goto yy25; if (yych <= '\t') goto yy50; } else { if (yych != '\r') goto yy25; } } else { if (yych <= '#') { if (yych <= ' ') goto yy47; if (yych >= '#') goto yy25; } else { if (yych == '%') goto yy25; } } } else { if (yych <= '=') { if (yych <= ':') { if (yych <= '\'') goto yy25; if (yych >= '*') goto yy25; } else { if (yych == '<') goto yy25; } } else { if (yych <= ']') { if (yych == '[') goto yy28; goto yy25; } else { if (yych <= '^') goto yy49; if (yych <= 'z') goto yy25; if (yych >= 0x7F) goto yy25; } } } yy49: YYDEBUG(49, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 476 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(NULL_NULL, "", 0); } #line 975 "Zend/zend_ini_scanner.c" yy50: YYDEBUG(50, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(51, *YYCURSOR); if (yych == '\t') goto yy50; if (yych == ' ') goto yy50; goto yy49; yy52: YYDEBUG(52, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy39; if (yych == 'e') goto yy39; goto yy26; yy53: YYDEBUG(53, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'L') goto yy54; if (yych != 'l') goto yy26; yy54: YYDEBUG(54, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy55; if (yych != 's') goto yy26; yy55: YYDEBUG(55, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy39; if (yych == 'e') goto yy39; goto yy26; yy56: YYDEBUG(56, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy57: YYDEBUG(57, *YYCURSOR); if (yych == '\t') goto yy56; if (yych == ' ') goto yy56; goto yy17; yy58: YYDEBUG(58, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy59: YYDEBUG(59, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy58; } if (yych >= '\r') goto yy62; yy60: YYDEBUG(60, *YYCURSOR); ++YYCURSOR; yy61: YYDEBUG(61, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 636 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } #line 1040 "Zend/zend_ini_scanner.c" yy62: YYDEBUG(62, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy60; goto yy61; yy63: YYDEBUG(63, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy64: YYDEBUG(64, *YYCURSOR); if (yych <= '\'') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x08) goto yy63; if (yych >= '\n') goto yy69; } else { if (yych == '\r') goto yy71; goto yy63; } } else { if (yych <= '$') { if (yych == '#') goto yy63; } else { if (yych != '&') goto yy63; } } } else { if (yych <= 'Z') { if (yych <= ';') { if (yych <= ')') goto yy65; if (yych <= ':') goto yy63; } else { if (yych != '=') goto yy63; } } else { if (yych <= '^') { if (yych <= '[') goto yy67; if (yych <= ']') goto yy63; } else { if (yych <= 'z') goto yy63; if (yych >= 0x7F) goto yy63; } } } yy65: YYDEBUG(65, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; YYDEBUG(66, *YYCURSOR); if (yych == '\n') goto yy69; if (yych == '\r') goto yy71; goto yy65; yy67: YYDEBUG(67, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; YYDEBUG(68, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy65; if (yych <= '\t') goto yy67; if (yych >= '\v') goto yy65; } else { if (yych <= '\r') goto yy71; if (yych == ' ') goto yy67; goto yy65; } yy69: YYDEBUG(69, *YYCURSOR); ++YYCURSOR; yy70: YYDEBUG(70, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 642 "Zend/zend_ini_scanner.l" { /* #Comment */ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno)); BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } #line 1126 "Zend/zend_ini_scanner.c" yy71: YYDEBUG(71, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy69; goto yy70; yy72: YYDEBUG(72, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy73: YYDEBUG(73, *YYCURSOR); if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x08) goto yy5; if (yych <= '\t') goto yy72; goto yy76; } else { if (yych == '\r') goto yy77; if (yych <= 0x1F) goto yy5; goto yy72; } } else { if (yych <= ':') { if (yych == '#') goto yy65; goto yy5; } else { if (yych <= ';') goto yy58; if (yych == '=') goto yy56; goto yy5; } } yy74: YYDEBUG(74, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; YYDEBUG(75, *YYCURSOR); if (yych <= '&') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x08) goto yy25; if (yych <= '\t') goto yy72; } else { if (yych == '\r') goto yy77; goto yy25; } } else { if (yych <= '#') { if (yych <= ' ') goto yy74; if (yych <= '"') goto yy3; goto yy63; } else { if (yych == '%') goto yy25; goto yy3; } } } else { if (yych <= '=') { if (yych <= ':') { if (yych <= '\'') goto yy25; if (yych <= ')') goto yy3; goto yy25; } else { if (yych <= ';') goto yy58; if (yych <= '<') goto yy25; goto yy56; } } else { if (yych <= ']') { if (yych == '[') goto yy28; goto yy25; } else { if (yych <= '^') goto yy3; if (yych <= 'z') goto yy25; if (yych <= '~') goto yy3; goto yy25; } } } yy76: YYDEBUG(76, *YYCURSOR); yych = *++YYCURSOR; goto yy7; yy77: YYDEBUG(77, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '\n') goto yy76; goto yy7; } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: { static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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(78, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych == '"') goto yy82; if (yych == '$') goto yy84; YYDEBUG(80, *YYCURSOR); ++YYCURSOR; yy81: YYDEBUG(81, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 586 "Zend/zend_ini_scanner.l" { /* Escape double quoted string contents */ if (YYCURSOR > YYLIMIT) { return 0; } while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { case '"': if (YYCURSOR < YYLIMIT && YYCURSOR[-2] == '\\' && *YYCURSOR != '\r' && *YYCURSOR != '\n') { continue; } break; case '$': if (*YYCURSOR == '{') { break; } continue; case '\\': if (YYCURSOR < YYLIMIT && *YYCURSOR != '"') { YYCURSOR++; } /* fall through */ default: continue; } YYCURSOR--; break; } yyleng = YYCURSOR - SCNG(yy_text); zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC); return TC_QUOTED_STRING; } #line 1302 "Zend/zend_ini_scanner.c" yy82: YYDEBUG(82, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy88; yy83: YYDEBUG(83, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 581 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string ends */ yy_pop_state(TSRMLS_C); return '"'; } #line 1316 "Zend/zend_ini_scanner.c" yy84: YYDEBUG(84, *YYCURSOR); yych = *++YYCURSOR; if (yych != '{') goto yy81; YYDEBUG(85, *YYCURSOR); ++YYCURSOR; YYDEBUG(86, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 448 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } #line 1330 "Zend/zend_ini_scanner.c" yy87: YYDEBUG(87, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy88: YYDEBUG(88, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy87; } goto yy83; } /* *********************************** */ yyc_ST_OFFSET: { static const unsigned char yybm[] = { 66, 66, 66, 66, 66, 66, 66, 66, 66, 194, 64, 66, 66, 64, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 194, 66, 64, 66, 68, 66, 66, 0, 66, 66, 66, 66, 66, 66, 66, 66, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 66, 64, 66, 66, 66, 66, 66, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 66, 72, 64, 66, 82, 66, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, }; YYDEBUG(89, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '-') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x08) goto yy91; if (yych <= '\t') goto yy93; goto yy94; } else { if (yych == '\r') goto yy94; if (yych >= ' ') goto yy93; } } else { if (yych <= '$') { if (yych == '"') goto yy96; if (yych >= '$') goto yy98; } else { if (yych == '\'') goto yy99; if (yych >= '-') goto yy100; } } } else { if (yych <= 'Z') { if (yych <= '9') { if (yych <= '.') goto yy101; if (yych >= '0') goto yy102; } else { if (yych == ';') goto yy94; if (yych >= 'A') goto yy104; } } else { if (yych <= '^') { if (yych <= '[') goto yy91; if (yych <= '\\') goto yy106; if (yych <= ']') goto yy107; } else { if (yych == '`') goto yy91; if (yych <= 'z') goto yy104; } } } yy91: YYDEBUG(91, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy110; yy92: YYDEBUG(92, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 572 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } #line 1434 "Zend/zend_ini_scanner.c" yy93: YYDEBUG(93, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { goto yy136; } if (yych == '"') goto yy138; if (yych == ']') goto yy139; goto yy110; yy94: YYDEBUG(94, *YYCURSOR); ++YYCURSOR; yy95: YYDEBUG(95, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 654 "Zend/zend_ini_scanner.l" { return 0; } #line 1455 "Zend/zend_ini_scanner.c" yy96: YYDEBUG(96, *YYCURSOR); ++YYCURSOR; yy97: YYDEBUG(97, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 576 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } #line 1467 "Zend/zend_ini_scanner.c" yy98: YYDEBUG(98, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { if (yych <= 0x00) goto yy95; if (yych <= '[') goto yy109; goto yy114; } else { if (yych == '{') goto yy134; goto yy109; } yy99: YYDEBUG(99, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { goto yy130; } goto yy95; yy100: YYDEBUG(100, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy110; if (yych <= '9') goto yy128; goto yy110; yy101: YYDEBUG(101, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy110; if (yych <= '9') goto yy126; goto yy110; yy102: YYDEBUG(102, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\'') { if (yych <= '\r') { if (yych == '\n') goto yy103; if (yych <= '\f') goto yy110; } else { if (yych == '"') goto yy103; if (yych <= '&') goto yy110; } } else { if (yych <= '9') { if (yych == '.') goto yy122; if (yych <= '/') goto yy110; goto yy124; } else { if (yych <= ';') { if (yych <= ':') goto yy110; } else { if (yych != ']') goto yy110; } } } yy103: YYDEBUG(103, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 550 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } #line 1533 "Zend/zend_ini_scanner.c" yy104: YYDEBUG(104, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { goto yy120; } if (yych <= '"') { if (yych <= '\f') { if (yych != '\n') goto yy110; } else { if (yych <= '\r') goto yy105; if (yych <= '!') goto yy110; } } else { if (yych <= ':') { if (yych != '\'') goto yy110; } else { if (yych <= ';') goto yy105; if (yych != ']') goto yy110; } } yy105: YYDEBUG(105, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 546 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } #line 1563 "Zend/zend_ini_scanner.c" yy106: YYDEBUG(106, *YYCURSOR); yych = *++YYCURSOR; goto yy109; yy107: YYDEBUG(107, *YYCURSOR); ++YYCURSOR; yy108: YYDEBUG(108, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 443 "Zend/zend_ini_scanner.l" { /* End of section or an option offset */ BEGIN(INITIAL); return ']'; } #line 1579 "Zend/zend_ini_scanner.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy110: YYDEBUG(110, *YYCURSOR); if (yybm[0+yych] & 2) { goto yy109; } if (yych == '$') goto yy112; if (yych != '\\') goto yy92; yy111: YYDEBUG(111, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; goto yy109; yy112: YYDEBUG(112, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { if (yych <= 0x00) goto yy113; if (yych <= '[') goto yy109; goto yy114; } else { if (yych != '{') goto yy109; } yy113: YYDEBUG(113, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept <= 0) { goto yy92; } else { goto yy95; } } else { if (yyaccept <= 2) { goto yy103; } else { goto yy105; } } yy114: YYDEBUG(114, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 4) { goto yy115; } if (yych == '\\') goto yy117; goto yy109; yy115: YYDEBUG(115, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(116, *YYCURSOR); if (yybm[0+yych] & 4) { goto yy115; } if (yych == '\\') goto yy119; goto yy109; yy117: YYDEBUG(117, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(118, *YYCURSOR); if (yybm[0+yych] & 4) { goto yy115; } if (yych == '\\') goto yy117; goto yy109; yy119: YYDEBUG(119, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 4) { goto yy115; } if (yych == '\\') goto yy117; goto yy109; yy120: YYDEBUG(120, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(121, *YYCURSOR); if (yybm[0+yych] & 16) { goto yy120; } if (yych <= '$') { if (yych <= '\r') { if (yych == '\n') goto yy105; if (yych <= '\f') goto yy109; goto yy105; } else { if (yych == '"') goto yy105; if (yych <= '#') goto yy109; goto yy112; } } else { if (yych <= ';') { if (yych == '\'') goto yy105; if (yych <= ':') goto yy109; goto yy105; } else { if (yych <= '[') goto yy109; if (yych <= '\\') goto yy111; if (yych <= ']') goto yy105; goto yy109; } } yy122: YYDEBUG(122, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(123, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy122; } if (yych <= '$') { if (yych <= '\r') { if (yych == '\n') goto yy103; if (yych <= '\f') goto yy109; goto yy103; } else { if (yych == '"') goto yy103; if (yych <= '#') goto yy109; goto yy112; } } else { if (yych <= ';') { if (yych == '\'') goto yy103; if (yych <= ':') goto yy109; goto yy103; } else { if (yych <= '[') goto yy109; if (yych <= '\\') goto yy111; if (yych <= ']') goto yy103; goto yy109; } } yy124: YYDEBUG(124, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(125, *YYCURSOR); if (yych <= '\'') { if (yych <= '!') { if (yych <= '\n') { if (yych <= '\t') goto yy109; goto yy103; } else { if (yych == '\r') goto yy103; goto yy109; } } else { if (yych <= '#') { if (yych <= '"') goto yy103; goto yy109; } else { if (yych <= '$') goto yy112; if (yych <= '&') goto yy109; goto yy103; } } } else { if (yych <= ':') { if (yych <= '.') { if (yych <= '-') goto yy109; goto yy122; } else { if (yych <= '/') goto yy109; if (yych <= '9') goto yy124; goto yy109; } } else { if (yych <= '[') { if (yych <= ';') goto yy103; goto yy109; } else { if (yych <= '\\') goto yy111; if (yych <= ']') goto yy103; goto yy109; } } } yy126: YYDEBUG(126, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(127, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { if (yych == '\n') goto yy103; if (yych <= '\f') goto yy109; goto yy103; } else { if (yych <= '"') { if (yych <= '!') goto yy109; goto yy103; } else { if (yych == '$') goto yy112; goto yy109; } } } else { if (yych <= ':') { if (yych <= '\'') goto yy103; if (yych <= '/') goto yy109; if (yych <= '9') goto yy126; goto yy109; } else { if (yych <= '[') { if (yych <= ';') goto yy103; goto yy109; } else { if (yych <= '\\') goto yy111; if (yych <= ']') goto yy103; goto yy109; } } } yy128: YYDEBUG(128, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(129, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { if (yych == '\n') goto yy103; if (yych <= '\f') goto yy109; goto yy103; } else { if (yych <= '"') { if (yych <= '!') goto yy109; goto yy103; } else { if (yych == '$') goto yy112; goto yy109; } } } else { if (yych <= ':') { if (yych <= '\'') goto yy103; if (yych <= '/') goto yy109; if (yych <= '9') goto yy128; goto yy109; } else { if (yych <= '[') { if (yych <= ';') goto yy103; goto yy109; } else { if (yych <= '\\') goto yy111; if (yych <= ']') goto yy103; goto yy109; } } } yy130: YYDEBUG(130, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(131, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy130; } YYDEBUG(132, *YYCURSOR); ++YYCURSOR; YYDEBUG(133, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 415 "Zend/zend_ini_scanner.l" { /* Raw string */ /* Eat leading and trailing single quotes */ if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { SCNG(yy_text)++; yyleng = yyleng - 2; } RETURN_TOKEN(TC_RAW, yytext, yyleng); } #line 1878 "Zend/zend_ini_scanner.c" yy134: YYDEBUG(134, *YYCURSOR); ++YYCURSOR; YYDEBUG(135, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 448 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } #line 1889 "Zend/zend_ini_scanner.c" yy136: YYDEBUG(136, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(137, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy136; } if (yych <= '$') { if (yych <= '\r') { if (yych == '\n') goto yy92; if (yych <= '\f') goto yy109; goto yy92; } else { if (yych == '"') goto yy138; if (yych <= '#') goto yy109; goto yy112; } } else { if (yych <= ';') { if (yych == '\'') goto yy92; if (yych <= ':') goto yy109; goto yy92; } else { if (yych <= '[') goto yy109; if (yych <= '\\') goto yy111; if (yych <= ']') goto yy139; goto yy109; } } yy138: YYDEBUG(138, *YYCURSOR); yych = *++YYCURSOR; goto yy97; yy139: YYDEBUG(139, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy108; } /* *********************************** */ yyc_ST_RAW: { static const unsigned char yybm[] = { 64, 64, 64, 64, 64, 64, 64, 64, 64, 192, 0, 64, 64, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 192, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, }; YYDEBUG(140, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '\f') { if (yych <= 0x08) { if (yych >= 0x01) goto yy144; } else { if (yych <= '\t') goto yy146; if (yych <= '\n') goto yy147; goto yy144; } } else { if (yych <= ' ') { if (yych <= '\r') goto yy149; if (yych <= 0x1F) goto yy144; goto yy146; } else { if (yych == ';') goto yy150; goto yy144; } } YYDEBUG(142, *YYCURSOR); ++YYCURSOR; YYDEBUG(143, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 649 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } #line 1999 "Zend/zend_ini_scanner.c" yy144: YYDEBUG(144, *YYCURSOR); ++YYCURSOR; yy145: YYDEBUG(145, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 499 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ char *sc = NULL; while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR) { case '\n': case '\r': goto end_raw_value_chars; break; case ';': if (sc == NULL) { sc = YYCURSOR; } /* no break */ default: YYCURSOR++; break; } } end_raw_value_chars: yyleng = YYCURSOR - SCNG(yy_text); /* Eat trailing semicolons */ while (yytext[yyleng - 1] == ';') { yyleng--; } /* Eat leading and trailing double quotes */ if (yyleng > 1 && yytext[0] == '"' && yytext[yyleng - 1] == '"') { SCNG(yy_text)++; yyleng = yyleng - 2; } else if (sc) { YYCURSOR = sc; yyleng = YYCURSOR - SCNG(yy_text); } RETURN_TOKEN(TC_RAW, yytext, yyleng); } #line 2043 "Zend/zend_ini_scanner.c" yy146: YYDEBUG(146, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\r') { if (yych <= 0x08) goto yy145; if (yych <= '\n') goto yy158; if (yych <= '\f') goto yy145; goto yy158; } else { if (yych <= ' ') { if (yych <= 0x1F) goto yy145; goto yy158; } else { if (yych == ';') goto yy158; goto yy145; } } yy147: YYDEBUG(147, *YYCURSOR); ++YYCURSOR; yy148: YYDEBUG(148, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 540 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } #line 2074 "Zend/zend_ini_scanner.c" yy149: YYDEBUG(149, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy156; goto yy148; yy150: YYDEBUG(150, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); goto yy152; yy151: YYDEBUG(151, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy152: YYDEBUG(152, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy151; } if (yych >= '\r') goto yy155; yy153: YYDEBUG(153, *YYCURSOR); ++YYCURSOR; yy154: YYDEBUG(154, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 636 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } #line 2108 "Zend/zend_ini_scanner.c" yy155: YYDEBUG(155, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy153; goto yy154; yy156: YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; goto yy148; yy157: YYDEBUG(157, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy158: YYDEBUG(158, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy157; } if (yych <= '\f') { if (yych == '\n') goto yy156; } else { if (yych <= '\r') goto yy160; if (yych == ';') goto yy151; } YYDEBUG(159, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 626 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; } #line 2142 "Zend/zend_ini_scanner.c" yy160: YYDEBUG(160, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '\n') goto yy156; goto yy148; } /* *********************************** */ yyc_ST_SECTION_RAW: { static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 192, 0, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 192, 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, 0, 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(161, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '\f') { if (yych == '\n') goto yy165; } else { if (yych <= '\r') goto yy165; if (yych == ']') goto yy167; } YYDEBUG(163, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy174; yy164: YYDEBUG(164, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 536 "Zend/zend_ini_scanner.l" { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ RETURN_TOKEN(TC_RAW, yytext, yyleng); } #line 2206 "Zend/zend_ini_scanner.c" yy165: YYDEBUG(165, *YYCURSOR); ++YYCURSOR; YYDEBUG(166, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 654 "Zend/zend_ini_scanner.l" { return 0; } #line 2216 "Zend/zend_ini_scanner.c" yy167: YYDEBUG(167, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy170; yy168: YYDEBUG(168, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 424 "Zend/zend_ini_scanner.l" { /* End of section */ BEGIN(INITIAL); SCNG(lineno)++; return ']'; } #line 2231 "Zend/zend_ini_scanner.c" yy169: YYDEBUG(169, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy170: YYDEBUG(170, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy169; } if (yych == '\n') goto yy171; if (yych == '\r') goto yy172; goto yy168; yy171: YYDEBUG(171, *YYCURSOR); yych = *++YYCURSOR; goto yy168; yy172: YYDEBUG(172, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy171; goto yy168; yy173: YYDEBUG(173, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy174: YYDEBUG(174, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy173; } goto yy164; } /* *********************************** */ yyc_ST_SECTION_VALUE: { static const unsigned char yybm[] = { 132, 132, 132, 132, 132, 132, 132, 132, 132, 134, 128, 132, 132, 128, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 134, 132, 128, 132, 136, 132, 132, 0, 132, 132, 132, 132, 132, 132, 132, 132, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 132, 128, 132, 132, 132, 132, 132, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 132, 144, 128, 132, 164, 132, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, }; YYDEBUG(175, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '-') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x08) goto yy177; if (yych <= '\t') goto yy179; goto yy180; } else { if (yych == '\r') goto yy180; if (yych >= ' ') goto yy179; } } else { if (yych <= '$') { if (yych == '"') goto yy182; if (yych >= '$') goto yy184; } else { if (yych == '\'') goto yy185; if (yych >= '-') goto yy186; } } } else { if (yych <= 'Z') { if (yych <= '9') { if (yych <= '.') goto yy187; if (yych >= '0') goto yy188; } else { if (yych == ';') goto yy180; if (yych >= 'A') goto yy190; } } else { if (yych <= '^') { if (yych <= '[') goto yy177; if (yych <= '\\') goto yy192; if (yych <= ']') goto yy193; } else { if (yych == '`') goto yy177; if (yych <= 'z') goto yy190; } } } yy177: YYDEBUG(177, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy200; yy178: YYDEBUG(178, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 572 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } #line 2357 "Zend/zend_ini_scanner.c" yy179: YYDEBUG(179, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { if (yych == '\t') goto yy226; goto yy200; } else { if (yych <= ' ') goto yy226; if (yych == '"') goto yy228; goto yy200; } yy180: YYDEBUG(180, *YYCURSOR); ++YYCURSOR; yy181: YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 654 "Zend/zend_ini_scanner.l" { return 0; } #line 2380 "Zend/zend_ini_scanner.c" yy182: YYDEBUG(182, *YYCURSOR); ++YYCURSOR; yy183: YYDEBUG(183, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 576 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } #line 2392 "Zend/zend_ini_scanner.c" yy184: YYDEBUG(184, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { if (yych <= 0x00) goto yy181; if (yych <= '[') goto yy199; goto yy204; } else { if (yych == '{') goto yy224; goto yy199; } yy185: YYDEBUG(185, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { goto yy220; } goto yy181; yy186: YYDEBUG(186, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy200; if (yych <= '9') goto yy218; goto yy200; yy187: YYDEBUG(187, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy200; if (yych <= '9') goto yy216; goto yy200; yy188: YYDEBUG(188, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '\'') { if (yych <= '\r') { if (yych == '\n') goto yy189; if (yych <= '\f') goto yy200; } else { if (yych == '"') goto yy189; if (yych <= '&') goto yy200; } } else { if (yych <= '9') { if (yych == '.') goto yy212; if (yych <= '/') goto yy200; goto yy214; } else { if (yych <= ';') { if (yych <= ':') goto yy200; } else { if (yych != ']') goto yy200; } } } yy189: YYDEBUG(189, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 550 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } #line 2458 "Zend/zend_ini_scanner.c" yy190: YYDEBUG(190, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { goto yy210; } if (yych <= '"') { if (yych <= '\f') { if (yych != '\n') goto yy200; } else { if (yych <= '\r') goto yy191; if (yych <= '!') goto yy200; } } else { if (yych <= ':') { if (yych != '\'') goto yy200; } else { if (yych <= ';') goto yy191; if (yych != ']') goto yy200; } } yy191: YYDEBUG(191, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 546 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } #line 2488 "Zend/zend_ini_scanner.c" yy192: YYDEBUG(192, *YYCURSOR); yych = *++YYCURSOR; goto yy199; yy193: YYDEBUG(193, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy196; yy194: YYDEBUG(194, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 424 "Zend/zend_ini_scanner.l" { /* End of section */ BEGIN(INITIAL); SCNG(lineno)++; return ']'; } #line 2507 "Zend/zend_ini_scanner.c" yy195: YYDEBUG(195, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy196: YYDEBUG(196, *YYCURSOR); if (yybm[0+yych] & 2) { goto yy195; } if (yych == '\n') goto yy197; if (yych == '\r') goto yy198; goto yy194; yy197: YYDEBUG(197, *YYCURSOR); yych = *++YYCURSOR; goto yy194; yy198: YYDEBUG(198, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy197; goto yy194; yy199: YYDEBUG(199, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy200: YYDEBUG(200, *YYCURSOR); if (yybm[0+yych] & 4) { goto yy199; } if (yych == '$') goto yy202; if (yych != '\\') goto yy178; yy201: YYDEBUG(201, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; goto yy199; yy202: YYDEBUG(202, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { if (yych <= 0x00) goto yy203; if (yych <= '[') goto yy199; goto yy204; } else { if (yych != '{') goto yy199; } yy203: YYDEBUG(203, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept <= 0) { goto yy178; } else { goto yy181; } } else { if (yyaccept <= 2) { goto yy189; } else { goto yy191; } } yy204: YYDEBUG(204, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { goto yy205; } if (yych == '\\') goto yy207; goto yy199; yy205: YYDEBUG(205, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(206, *YYCURSOR); if (yybm[0+yych] & 8) { goto yy205; } if (yych == '\\') goto yy209; goto yy199; yy207: YYDEBUG(207, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(208, *YYCURSOR); if (yybm[0+yych] & 8) { goto yy205; } if (yych == '\\') goto yy207; goto yy199; yy209: YYDEBUG(209, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { goto yy205; } if (yych == '\\') goto yy207; goto yy199; yy210: YYDEBUG(210, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(211, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy210; } if (yych <= '$') { if (yych <= '\r') { if (yych == '\n') goto yy191; if (yych <= '\f') goto yy199; goto yy191; } else { if (yych == '"') goto yy191; if (yych <= '#') goto yy199; goto yy202; } } else { if (yych <= ';') { if (yych == '\'') goto yy191; if (yych <= ':') goto yy199; goto yy191; } else { if (yych <= '[') goto yy199; if (yych <= '\\') goto yy201; if (yych <= ']') goto yy191; goto yy199; } } yy212: YYDEBUG(212, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(213, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy212; } if (yych <= '$') { if (yych <= '\r') { if (yych == '\n') goto yy189; if (yych <= '\f') goto yy199; goto yy189; } else { if (yych == '"') goto yy189; if (yych <= '#') goto yy199; goto yy202; } } else { if (yych <= ';') { if (yych == '\'') goto yy189; if (yych <= ':') goto yy199; goto yy189; } else { if (yych <= '[') goto yy199; if (yych <= '\\') goto yy201; if (yych <= ']') goto yy189; goto yy199; } } yy214: YYDEBUG(214, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(215, *YYCURSOR); if (yych <= '\'') { if (yych <= '!') { if (yych <= '\n') { if (yych <= '\t') goto yy199; goto yy189; } else { if (yych == '\r') goto yy189; goto yy199; } } else { if (yych <= '#') { if (yych <= '"') goto yy189; goto yy199; } else { if (yych <= '$') goto yy202; if (yych <= '&') goto yy199; goto yy189; } } } else { if (yych <= ':') { if (yych <= '.') { if (yych <= '-') goto yy199; goto yy212; } else { if (yych <= '/') goto yy199; if (yych <= '9') goto yy214; goto yy199; } } else { if (yych <= '[') { if (yych <= ';') goto yy189; goto yy199; } else { if (yych <= '\\') goto yy201; if (yych <= ']') goto yy189; goto yy199; } } } yy216: YYDEBUG(216, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(217, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { if (yych == '\n') goto yy189; if (yych <= '\f') goto yy199; goto yy189; } else { if (yych <= '"') { if (yych <= '!') goto yy199; goto yy189; } else { if (yych == '$') goto yy202; goto yy199; } } } else { if (yych <= ':') { if (yych <= '\'') goto yy189; if (yych <= '/') goto yy199; if (yych <= '9') goto yy216; goto yy199; } else { if (yych <= '[') { if (yych <= ';') goto yy189; goto yy199; } else { if (yych <= '\\') goto yy201; if (yych <= ']') goto yy189; goto yy199; } } } yy218: YYDEBUG(218, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(219, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { if (yych == '\n') goto yy189; if (yych <= '\f') goto yy199; goto yy189; } else { if (yych <= '"') { if (yych <= '!') goto yy199; goto yy189; } else { if (yych == '$') goto yy202; goto yy199; } } } else { if (yych <= ':') { if (yych <= '\'') goto yy189; if (yych <= '/') goto yy199; if (yych <= '9') goto yy218; goto yy199; } else { if (yych <= '[') { if (yych <= ';') goto yy189; goto yy199; } else { if (yych <= '\\') goto yy201; if (yych <= ']') goto yy189; goto yy199; } } } yy220: YYDEBUG(220, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(221, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy220; } YYDEBUG(222, *YYCURSOR); ++YYCURSOR; YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 415 "Zend/zend_ini_scanner.l" { /* Raw string */ /* Eat leading and trailing single quotes */ if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { SCNG(yy_text)++; yyleng = yyleng - 2; } RETURN_TOKEN(TC_RAW, yytext, yyleng); } #line 2828 "Zend/zend_ini_scanner.c" yy224: YYDEBUG(224, *YYCURSOR); ++YYCURSOR; YYDEBUG(225, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 448 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } #line 2839 "Zend/zend_ini_scanner.c" yy226: YYDEBUG(226, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(227, *YYCURSOR); if (yych <= '"') { if (yych <= '\f') { if (yych <= 0x08) goto yy199; if (yych <= '\t') goto yy226; if (yych <= '\n') goto yy178; goto yy199; } else { if (yych <= 0x1F) { if (yych <= '\r') goto yy178; goto yy199; } else { if (yych <= ' ') goto yy226; if (yych <= '!') goto yy199; } } } else { if (yych <= ':') { if (yych <= '$') { if (yych <= '#') goto yy199; goto yy202; } else { if (yych == '\'') goto yy178; goto yy199; } } else { if (yych <= '[') { if (yych <= ';') goto yy178; goto yy199; } else { if (yych <= '\\') goto yy201; if (yych <= ']') goto yy178; goto yy199; } } } yy228: YYDEBUG(228, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy183; } /* *********************************** */ yyc_ST_VALUE: { static const unsigned char yybm[] = { 160, 162, 162, 162, 162, 162, 162, 162, 162, 176, 128, 162, 162, 128, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 176, 160, 160, 162, 168, 162, 160, 32, 160, 160, 162, 162, 162, 162, 162, 162, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 162, 160, 162, 160, 162, 162, 162, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 162, 162, 162, 160, 166, 162, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 162, 160, 162, 160, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, }; YYDEBUG(229, *YYCURSOR); YYFILL(6); yych = *YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 0x00: goto yy231; case '\t': case ' ': goto yy235; case '\n': goto yy237; case '\r': goto yy239; case '!': case '&': case '(': case ')': case '^': case '|': case '~': goto yy240; case '"': goto yy242; case '$': goto yy244; case '\'': goto yy245; case '-': goto yy246; case '.': goto yy247; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': goto yy248; case ';': goto yy250; case '=': goto yy251; case 'A': case 'B': case 'C': case 'D': case 'E': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'P': case 'Q': case 'R': case 'S': case 'U': case 'V': case 'W': case 'X': case 'Z': case '_': case 'a': case 'b': case 'c': case 'd': case 'e': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'p': case 'q': case 'r': case 's': case 'u': case 'v': case 'w': case 'x': case 'z': goto yy253; case 'F': case 'f': goto yy255; case 'N': case 'n': goto yy256; case 'O': case 'o': goto yy257; case 'T': case 't': goto yy258; case 'Y': case 'y': goto yy259; default: goto yy233; } yy231: YYDEBUG(231, *YYCURSOR); ++YYCURSOR; yy232: YYDEBUG(232, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 649 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } #line 3025 "Zend/zend_ini_scanner.c" yy233: YYDEBUG(233, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy261; yy234: YYDEBUG(234, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 568 "Zend/zend_ini_scanner.l" { /* Get everything else as option/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } #line 3038 "Zend/zend_ini_scanner.c" yy235: YYDEBUG(235, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); goto yy315; yy236: YYDEBUG(236, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 622 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng); } #line 3051 "Zend/zend_ini_scanner.c" yy237: YYDEBUG(237, *YYCURSOR); ++YYCURSOR; yy238: YYDEBUG(238, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 540 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } #line 3064 "Zend/zend_ini_scanner.c" yy239: YYDEBUG(239, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy313; goto yy238; yy240: YYDEBUG(240, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy312; yy241: YYDEBUG(241, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 558 "Zend/zend_ini_scanner.l" { /* Boolean operators */ return yytext[0]; } #line 3082 "Zend/zend_ini_scanner.c" yy242: YYDEBUG(242, *YYCURSOR); ++YYCURSOR; yy243: YYDEBUG(243, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 576 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } #line 3094 "Zend/zend_ini_scanner.c" yy244: YYDEBUG(244, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { if (yych <= 0x00) goto yy232; if (yych <= '[') goto yy260; goto yy267; } else { if (yych == '{') goto yy309; goto yy260; } yy245: YYDEBUG(245, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { goto yy305; } goto yy232; yy246: YYDEBUG(246, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy261; if (yych <= '9') goto yy303; goto yy261; yy247: YYDEBUG(247, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy261; if (yych <= '9') goto yy301; goto yy261; yy248: YYDEBUG(248, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy249; if (yych <= 0x08) goto yy261; } else { if (yych != '\r') goto yy261; } } else { if (yych <= ')') { if (yych <= '"') goto yy249; if (yych <= '%') goto yy261; } else { if (yych == '.') goto yy297; goto yy261; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= '9') goto yy299; if (yych <= ':') goto yy261; } else { if (yych != '=') goto yy261; } } else { if (yych <= '|') { if (yych <= '^') goto yy249; if (yych <= '{') goto yy261; } else { if (yych != '~') goto yy261; } } } yy249: YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 550 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } #line 3173 "Zend/zend_ini_scanner.c" yy250: YYDEBUG(250, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); goto yy293; yy251: YYDEBUG(251, *YYCURSOR); ++YYCURSOR; YYDEBUG(252, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 562 "Zend/zend_ini_scanner.l" { /* Make = used in option value to trigger error */ yyless(0); BEGIN(INITIAL); return END_OF_LINE; } #line 3190 "Zend/zend_ini_scanner.c" yy253: YYDEBUG(253, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { goto yy262; } if (yych <= ':') { if (yych <= '\r') { if (yych <= 0x08) { if (yych >= 0x01) goto yy261; } else { if (yych <= '\n') goto yy254; if (yych <= '\f') goto yy261; } } else { if (yych <= '"') { if (yych <= 0x1F) goto yy261; } else { if (yych <= '%') goto yy261; if (yych >= '*') goto yy261; } } } else { if (yych <= '^') { if (yych <= '<') { if (yych >= '<') goto yy261; } else { if (yych <= '=') goto yy254; if (yych <= ']') goto yy261; } } else { if (yych <= '|') { if (yych <= '{') goto yy261; } else { if (yych != '~') goto yy261; } } } yy254: YYDEBUG(254, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 546 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } #line 3237 "Zend/zend_ini_scanner.c" yy255: YYDEBUG(255, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '/') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; goto yy261; } else { if (yych <= '9') goto yy262; if (yych == ';') goto yy254; goto yy261; } } } else { if (yych <= '_') { if (yych <= 'A') { if (yych <= '=') goto yy254; if (yych <= '@') goto yy261; goto yy289; } else { if (yych <= 'Z') goto yy262; if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; goto yy262; } } else { if (yych <= '{') { if (yych <= '`') goto yy261; if (yych <= 'a') goto yy289; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy256: YYDEBUG(256, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { if (yych <= '%') { if (yych <= '\f') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; if (yych <= '\n') goto yy254; goto yy261; } else { if (yych <= '\r') goto yy254; if (yych <= 0x1F) goto yy261; if (yych <= '"') goto yy254; goto yy261; } } else { if (yych <= ':') { if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; if (yych <= '9') goto yy262; goto yy261; } else { if (yych <= '<') { if (yych <= ';') goto yy254; goto yy261; } else { if (yych <= '=') goto yy254; if (yych <= '@') goto yy261; goto yy262; } } } } else { if (yych <= 'n') { if (yych <= 'Z') { if (yych <= 'O') goto yy281; if (yych == 'U') goto yy282; goto yy262; } else { if (yych <= '^') { if (yych <= ']') goto yy261; goto yy254; } else { if (yych == '`') goto yy261; goto yy262; } } } else { if (yych <= 'z') { if (yych <= 'o') goto yy281; if (yych == 'u') goto yy282; goto yy262; } else { if (yych <= '|') { if (yych <= '{') goto yy261; goto yy254; } else { if (yych == '~') goto yy254; goto yy261; } } } } yy257: YYDEBUG(257, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { if (yych <= '%') { if (yych <= '\f') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; if (yych <= '\n') goto yy254; goto yy261; } else { if (yych <= '\r') goto yy254; if (yych <= 0x1F) goto yy261; if (yych <= '"') goto yy254; goto yy261; } } else { if (yych <= ':') { if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; if (yych <= '9') goto yy262; goto yy261; } else { if (yych <= '<') { if (yych <= ';') goto yy254; goto yy261; } else { if (yych <= '=') goto yy254; if (yych <= '@') goto yy261; goto yy262; } } } } else { if (yych <= 'e') { if (yych <= 'Z') { if (yych <= 'F') goto yy276; if (yych == 'N') goto yy270; goto yy262; } else { if (yych <= '^') { if (yych <= ']') goto yy261; goto yy254; } else { if (yych == '`') goto yy261; goto yy262; } } } else { if (yych <= 'z') { if (yych <= 'f') goto yy276; if (yych == 'n') goto yy270; goto yy262; } else { if (yych <= '|') { if (yych <= '{') goto yy261; goto yy254; } else { if (yych == '~') goto yy254; goto yy261; } } } } yy258: YYDEBUG(258, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych == 'R') goto yy274; goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'r') goto yy274; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy259: YYDEBUG(259, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych == 'E') goto yy264; goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'e') goto yy264; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy260: YYDEBUG(260, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy261: YYDEBUG(261, *YYCURSOR); if (yybm[0+yych] & 2) { goto yy260; } if (yych == '$') goto yy265; goto yy234; yy262: YYDEBUG(262, *YYCURSOR); yyaccept = 4; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(263, *YYCURSOR); if (yybm[0+yych] & 4) { goto yy262; } if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { if (yych <= 0x00) goto yy254; goto yy260; } else { if (yych <= '\n') goto yy254; if (yych <= '\f') goto yy260; goto yy254; } } else { if (yych <= '#') { if (yych <= 0x1F) goto yy260; if (yych <= '"') goto yy254; goto yy260; } else { if (yych <= '$') goto yy265; if (yych <= '%') goto yy260; goto yy254; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= ':') goto yy260; goto yy254; } else { if (yych == '=') goto yy254; goto yy260; } } else { if (yych <= '|') { if (yych <= '^') goto yy254; if (yych <= '{') goto yy260; goto yy254; } else { if (yych == '~') goto yy254; goto yy260; } } } yy264: YYDEBUG(264, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych == 'S') goto yy270; goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 's') goto yy270; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy265: YYDEBUG(265, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { if (yych <= 0x00) goto yy266; if (yych <= '[') goto yy260; goto yy267; } else { if (yych != '{') goto yy260; } yy266: YYDEBUG(266, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 3) { if (yyaccept <= 1) { if (yyaccept <= 0) { goto yy234; } else { goto yy236; } } else { if (yyaccept <= 2) { goto yy232; } else { goto yy249; } } } else { if (yyaccept <= 5) { if (yyaccept <= 4) { goto yy254; } else { goto yy271; } } else { if (yyaccept <= 6) { goto yy278; } else { goto yy285; } } } yy267: YYDEBUG(267, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { goto yy268; } goto yy260; yy268: YYDEBUG(268, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(269, *YYCURSOR); if (yybm[0+yych] & 8) { goto yy268; } if (yych <= 0x00) goto yy234; if (yych == '\\') goto yy267; goto yy260; yy270: YYDEBUG(270, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { goto yy272; } if (yych <= ';') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy271; if (yych <= '\t') goto yy261; } else { if (yych != '\r') goto yy261; } } else { if (yych <= ')') { if (yych <= '"') goto yy271; if (yych <= '%') goto yy261; } else { if (yych <= '/') goto yy261; if (yych <= '9') goto yy262; if (yych <= ':') goto yy261; } } } else { if (yych <= '_') { if (yych <= '@') { if (yych != '=') goto yy261; } else { if (yych <= 'Z') goto yy262; if (yych <= ']') goto yy261; if (yych >= '_') goto yy262; } } else { if (yych <= '{') { if (yych <= '`') goto yy261; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych >= 0x7F) goto yy261; } } } yy271: YYDEBUG(271, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 468 "Zend/zend_ini_scanner.l" { /* TRUE value (when used outside option value/offset this causes parse error!) */ RETURN_TOKEN(BOOL_TRUE, "1", 1); } #line 3753 "Zend/zend_ini_scanner.c" yy272: YYDEBUG(272, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(273, *YYCURSOR); if (yybm[0+yych] & 16) { goto yy272; } goto yy271; yy274: YYDEBUG(274, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych != 'U') goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'u') goto yy275; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy275: YYDEBUG(275, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych == 'E') goto yy270; goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'e') goto yy270; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy276: YYDEBUG(276, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych != 'F') goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'f') goto yy277; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy277: YYDEBUG(277, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { goto yy262; } if (yych <= ')') { if (yych <= '\f') { if (yych <= 0x08) { if (yych >= 0x01) goto yy261; } else { if (yych <= '\t') goto yy279; if (yych >= '\v') goto yy261; } } else { if (yych <= ' ') { if (yych <= '\r') goto yy278; if (yych <= 0x1F) goto yy261; goto yy279; } else { if (yych <= '"') goto yy278; if (yych <= '%') goto yy261; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= ':') goto yy261; } else { if (yych != '=') goto yy261; } } else { if (yych <= '|') { if (yych <= '^') goto yy278; if (yych <= '{') goto yy261; } else { if (yych != '~') goto yy261; } } } yy278: YYDEBUG(278, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 472 "Zend/zend_ini_scanner.l" { /* FALSE value (when used outside option value/offset this causes parse error!)*/ RETURN_TOKEN(BOOL_FALSE, "", 0); } #line 3963 "Zend/zend_ini_scanner.c" yy279: YYDEBUG(279, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(280, *YYCURSOR); if (yych == '\t') goto yy279; if (yych == ' ') goto yy279; goto yy278; yy281: YYDEBUG(281, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '<') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy278; if (yych <= 0x08) goto yy261; if (yych <= '\t') goto yy279; goto yy278; } else { if (yych == '\r') goto yy278; if (yych <= 0x1F) goto yy261; goto yy279; } } else { if (yych <= '/') { if (yych <= '"') goto yy278; if (yych <= '%') goto yy261; if (yych <= ')') goto yy278; goto yy261; } else { if (yych <= '9') goto yy262; if (yych == ';') goto yy278; goto yy261; } } } else { if (yych <= '_') { if (yych <= 'N') { if (yych <= '=') goto yy278; if (yych <= '@') goto yy261; if (yych <= 'M') goto yy262; goto yy288; } else { if (yych <= 'Z') goto yy262; if (yych <= ']') goto yy261; if (yych <= '^') goto yy278; goto yy262; } } else { if (yych <= 'z') { if (yych <= '`') goto yy261; if (yych == 'n') goto yy288; goto yy262; } else { if (yych <= '|') { if (yych <= '{') goto yy261; goto yy278; } else { if (yych == '~') goto yy278; goto yy261; } } } } yy282: YYDEBUG(282, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych != 'L') goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'l') goto yy283; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy283: YYDEBUG(283, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych != 'L') goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'l') goto yy284; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy284: YYDEBUG(284, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { goto yy262; } if (yych <= ')') { if (yych <= '\f') { if (yych <= 0x08) { if (yych >= 0x01) goto yy261; } else { if (yych <= '\t') goto yy286; if (yych >= '\v') goto yy261; } } else { if (yych <= ' ') { if (yych <= '\r') goto yy285; if (yych <= 0x1F) goto yy261; goto yy286; } else { if (yych <= '"') goto yy285; if (yych <= '%') goto yy261; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= ':') goto yy261; } else { if (yych != '=') goto yy261; } } else { if (yych <= '|') { if (yych <= '^') goto yy285; if (yych <= '{') goto yy261; } else { if (yych != '~') goto yy261; } } } yy285: YYDEBUG(285, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 476 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(NULL_NULL, "", 0); } #line 4178 "Zend/zend_ini_scanner.c" yy286: YYDEBUG(286, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(287, *YYCURSOR); if (yych == '\t') goto yy286; if (yych == ' ') goto yy286; goto yy285; yy288: YYDEBUG(288, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych == 'E') goto yy277; goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'e') goto yy277; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy289: YYDEBUG(289, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych != 'L') goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'l') goto yy290; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy290: YYDEBUG(290, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych != 'S') goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 's') goto yy291; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy291: YYDEBUG(291, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { if (yych <= 0x00) goto yy254; if (yych <= 0x08) goto yy261; goto yy254; } else { if (yych == '\r') goto yy254; if (yych <= 0x1F) goto yy261; goto yy254; } } else { if (yych <= '9') { if (yych <= '%') goto yy261; if (yych <= ')') goto yy254; if (yych <= '/') goto yy261; goto yy262; } else { if (yych == ';') goto yy254; if (yych <= '<') goto yy261; goto yy254; } } } else { if (yych <= '`') { if (yych <= 'Z') { if (yych <= '@') goto yy261; if (yych == 'E') goto yy277; goto yy262; } else { if (yych <= ']') goto yy261; if (yych <= '^') goto yy254; if (yych <= '_') goto yy262; goto yy261; } } else { if (yych <= '{') { if (yych == 'e') goto yy277; if (yych <= 'z') goto yy262; goto yy261; } else { if (yych == '}') goto yy261; if (yych <= '~') goto yy254; goto yy261; } } } yy292: YYDEBUG(292, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy293: YYDEBUG(293, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy292; } if (yych >= '\r') goto yy296; yy294: YYDEBUG(294, *YYCURSOR); ++YYCURSOR; yy295: YYDEBUG(295, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 636 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } #line 4413 "Zend/zend_ini_scanner.c" yy296: YYDEBUG(296, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\n') goto yy294; goto yy295; yy297: YYDEBUG(297, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(298, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy297; } if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { if (yych <= 0x00) goto yy249; goto yy260; } else { if (yych <= '\n') goto yy249; if (yych <= '\f') goto yy260; goto yy249; } } else { if (yych <= '#') { if (yych <= 0x1F) goto yy260; if (yych <= '"') goto yy249; goto yy260; } else { if (yych <= '$') goto yy265; if (yych <= '%') goto yy260; goto yy249; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= ':') goto yy260; goto yy249; } else { if (yych == '=') goto yy249; goto yy260; } } else { if (yych <= '|') { if (yych <= '^') goto yy249; if (yych <= '{') goto yy260; goto yy249; } else { if (yych == '~') goto yy249; goto yy260; } } } yy299: YYDEBUG(299, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(300, *YYCURSOR); if (yych <= '.') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy249; if (yych <= 0x08) goto yy260; goto yy249; } else { if (yych == '\r') goto yy249; goto yy260; } } else { if (yych <= '$') { if (yych <= '"') goto yy249; if (yych <= '#') goto yy260; goto yy265; } else { if (yych <= '%') goto yy260; if (yych <= ')') goto yy249; if (yych <= '-') goto yy260; goto yy297; } } } else { if (yych <= '=') { if (yych <= ':') { if (yych <= '/') goto yy260; if (yych <= '9') goto yy299; goto yy260; } else { if (yych == '<') goto yy260; goto yy249; } } else { if (yych <= '{') { if (yych == '^') goto yy249; goto yy260; } else { if (yych == '}') goto yy260; if (yych <= '~') goto yy249; goto yy260; } } } yy301: YYDEBUG(301, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(302, *YYCURSOR); if (yych <= '/') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy249; if (yych <= 0x08) goto yy260; goto yy249; } else { if (yych == '\r') goto yy249; goto yy260; } } else { if (yych <= '$') { if (yych <= '"') goto yy249; if (yych <= '#') goto yy260; goto yy265; } else { if (yych <= '%') goto yy260; if (yych <= ')') goto yy249; goto yy260; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= '9') goto yy301; if (yych <= ':') goto yy260; goto yy249; } else { if (yych == '=') goto yy249; goto yy260; } } else { if (yych <= '|') { if (yych <= '^') goto yy249; if (yych <= '{') goto yy260; goto yy249; } else { if (yych == '~') goto yy249; goto yy260; } } } yy303: YYDEBUG(303, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(304, *YYCURSOR); if (yych <= '/') { if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x00) goto yy249; if (yych <= 0x08) goto yy260; goto yy249; } else { if (yych == '\r') goto yy249; goto yy260; } } else { if (yych <= '$') { if (yych <= '"') goto yy249; if (yych <= '#') goto yy260; goto yy265; } else { if (yych <= '%') goto yy260; if (yych <= ')') goto yy249; goto yy260; } } } else { if (yych <= ']') { if (yych <= ';') { if (yych <= '9') goto yy303; if (yych <= ':') goto yy260; goto yy249; } else { if (yych == '=') goto yy249; goto yy260; } } else { if (yych <= '|') { if (yych <= '^') goto yy249; if (yych <= '{') goto yy260; goto yy249; } else { if (yych == '~') goto yy249; goto yy260; } } } yy305: YYDEBUG(305, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; YYDEBUG(306, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy305; } YYDEBUG(307, *YYCURSOR); ++YYCURSOR; YYDEBUG(308, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 415 "Zend/zend_ini_scanner.l" { /* Raw string */ /* Eat leading and trailing single quotes */ if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { SCNG(yy_text)++; yyleng = yyleng - 2; } RETURN_TOKEN(TC_RAW, yytext, yyleng); } #line 4640 "Zend/zend_ini_scanner.c" yy309: YYDEBUG(309, *YYCURSOR); ++YYCURSOR; YYDEBUG(310, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 448 "Zend/zend_ini_scanner.l" { /* Variable start */ yy_push_state(ST_VARNAME TSRMLS_CC); return TC_DOLLAR_CURLY; } #line 4651 "Zend/zend_ini_scanner.c" yy311: YYDEBUG(311, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy312: YYDEBUG(312, *YYCURSOR); if (yych == '\t') goto yy311; if (yych == ' ') goto yy311; goto yy241; yy313: YYDEBUG(313, *YYCURSOR); yych = *++YYCURSOR; goto yy238; yy314: YYDEBUG(314, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; yy315: YYDEBUG(315, *YYCURSOR); if (yych <= 0x1F) { if (yych <= '\n') { if (yych <= 0x08) goto yy236; if (yych <= '\t') goto yy314; goto yy313; } else { if (yych == '\r') goto yy317; goto yy236; } } else { if (yych <= '"') { if (yych <= ' ') goto yy314; if (yych <= '!') goto yy236; } else { if (yych == ';') goto yy292; goto yy236; } } YYDEBUG(316, *YYCURSOR); yych = *++YYCURSOR; goto yy243; yy317: YYDEBUG(317, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '\n') goto yy313; goto yy238; } /* *********************************** */ yyc_ST_VARNAME: { static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 128, 0, 128, 0, 128, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 0, 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, 0, 128, 128, 0, 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, 0, 0, 0, 0, 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(318, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= ')') { if (yych <= '"') { if (yych <= '\f') { if (yych <= 0x08) goto yy320; if (yych <= '\n') goto yy322; } else { if (yych <= '\r') goto yy322; if (yych >= '!') goto yy322; } } else { if (yych <= '%') { if (yych == '$') goto yy322; } else { if (yych != '\'') goto yy322; } } } else { if (yych <= '[') { if (yych <= '<') { if (yych == ';') goto yy322; } else { if (yych <= '=') goto yy322; if (yych >= '[') goto yy322; } } else { if (yych <= 'z') { if (yych == '^') goto yy322; } else { if (yych == '}') goto yy324; if (yych <= '~') goto yy322; } } } yy320: YYDEBUG(320, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; goto yy327; yy321: YYDEBUG(321, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 453 "Zend/zend_ini_scanner.l" { /* Variable name */ /* Eat leading whitespace */ EAT_LEADING_WHITESPACE(); /* Eat trailing whitespace */ EAT_TRAILING_WHITESPACE(); RETURN_TOKEN(TC_VARNAME, yytext, yyleng); } #line 4792 "Zend/zend_ini_scanner.c" yy322: YYDEBUG(322, *YYCURSOR); ++YYCURSOR; YYDEBUG(323, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 654 "Zend/zend_ini_scanner.l" { return 0; } #line 4802 "Zend/zend_ini_scanner.c" yy324: YYDEBUG(324, *YYCURSOR); ++YYCURSOR; YYDEBUG(325, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 463 "Zend/zend_ini_scanner.l" { /* Variable end */ yy_pop_state(TSRMLS_C); return '}'; } #line 4813 "Zend/zend_ini_scanner.c" yy326: YYDEBUG(326, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; yy327: YYDEBUG(327, *YYCURSOR); if (yybm[0+yych] & 128) { goto yy326; } goto yy321; } } #line 658 "Zend/zend_ini_scanner.l" } PK!L1php-5.6.40/build-cgi/Zend/zend_language_scanner.cnu[/* Generated by re2c 0.13.5 */ #line 1 "Zend/zend_language_scanner.l" /* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ | Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.zend.com/license/2_00.txt. | | If you did not receive a copy of the Zend license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@zend.com so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Marcus Boerger | | Nuno Lopes | | Scott MacVicar | | Flex version authors: | | Andi Gutmans | | Zeev Suraski | +----------------------------------------------------------------------+ */ /* $Id$ */ #if 0 # define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c) #else # define YYDEBUG(s, c) #endif #include "zend_language_scanner_defs.h" #include #include "zend.h" #ifdef PHP_WIN32 # include #endif #include "zend_alloc.h" #include #include "zend_compile.h" #include "zend_language_scanner.h" #include "zend_highlight.h" #include "zend_constants.h" #include "zend_variables.h" #include "zend_operators.h" #include "zend_API.h" #include "zend_strtod.h" #include "zend_exceptions.h" #include "zend_virtual_cwd.h" #include "tsrm_config_common.h" #define YYCTYPE unsigned char #define YYFILL(n) { if ((YYCURSOR + n) >= (YYLIMIT + ZEND_MMAP_AHEAD)) { return 0; } } #define YYCURSOR SCNG(yy_cursor) #define YYLIMIT SCNG(yy_limit) #define YYMARKER SCNG(yy_marker) #define YYGETCONDITION() SCNG(yy_state) #define YYSETCONDITION(s) SCNG(yy_state) = s #define STATE(name) yyc##name /* emulate flex constructs */ #define BEGIN(state) YYSETCONDITION(STATE(state)) #define YYSTATE YYGETCONDITION() #define yytext ((char*)SCNG(yy_text)) #define yyleng SCNG(yy_leng) #define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \ yyleng = (unsigned int)x; } while(0) #define yymore() goto yymore_restart /* perform sanity check. If this message is triggered you should increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */ #define YYMAXFILL 16 #if ZEND_MMAP_AHEAD < YYMAXFILL # error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL #endif #ifdef HAVE_STDARG_H # include #endif #ifdef HAVE_UNISTD_H # include #endif /* Globals Macros */ #define SCNG LANG_SCNG #ifdef ZTS ZEND_API ts_rsrc_id language_scanner_globals_id; #else ZEND_API zend_php_scanner_globals language_scanner_globals; #endif #define HANDLE_NEWLINES(s, l) \ do { \ char *p = (s), *boundary = p+(l); \ \ while (p= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z') || (c) == '_' || (c) >= 0x7F) #define ZEND_IS_OCT(c) ((c)>='0' && (c)<='7') #define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F')) BEGIN_EXTERN_C() static size_t encoding_filter_script_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)); return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, LANG_SCNG(script_encoding) TSRMLS_CC); } static size_t encoding_filter_script_to_intermediate(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { return zend_multibyte_encoding_converter(to, to_length, from, from_length, zend_multibyte_encoding_utf8, LANG_SCNG(script_encoding) TSRMLS_CC); } static size_t encoding_filter_intermediate_to_script(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { return zend_multibyte_encoding_converter(to, to_length, from, from_length, LANG_SCNG(script_encoding), zend_multibyte_encoding_utf8 TSRMLS_CC); } static size_t encoding_filter_intermediate_to_internal(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); assert(internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)); return zend_multibyte_encoding_converter(to, to_length, from, from_length, internal_encoding, zend_multibyte_encoding_utf8 TSRMLS_CC); } static void _yy_push_state(int new_state TSRMLS_DC) { zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int)); YYSETCONDITION(new_state); } #define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm) static void yy_pop_state(TSRMLS_D) { int *stack_state; zend_stack_top(&SCNG(state_stack), (void **) &stack_state); YYSETCONDITION(*stack_state); zend_stack_del_top(&SCNG(state_stack)); } static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC) { YYCURSOR = (YYCTYPE*)str; YYLIMIT = YYCURSOR + len; if (!SCNG(yy_start)) { SCNG(yy_start) = YYCURSOR; } } void startup_scanner(TSRMLS_D) { CG(parse_error) = 0; CG(doc_comment) = NULL; CG(doc_comment_len) = 0; zend_stack_init(&SCNG(state_stack)); zend_ptr_stack_init(&SCNG(heredoc_label_stack)); } static void heredoc_label_dtor(zend_heredoc_label *heredoc_label) { efree(heredoc_label->label); } void shutdown_scanner(TSRMLS_D) { CG(parse_error) = 0; RESET_DOC_COMMENT(); zend_stack_destroy(&SCNG(state_stack)); zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1); zend_ptr_stack_destroy(&SCNG(heredoc_label_stack)); } ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC) { lex_state->yy_leng = SCNG(yy_leng); lex_state->yy_start = SCNG(yy_start); lex_state->yy_text = SCNG(yy_text); lex_state->yy_cursor = SCNG(yy_cursor); lex_state->yy_marker = SCNG(yy_marker); lex_state->yy_limit = SCNG(yy_limit); lex_state->state_stack = SCNG(state_stack); zend_stack_init(&SCNG(state_stack)); lex_state->heredoc_label_stack = SCNG(heredoc_label_stack); zend_ptr_stack_init(&SCNG(heredoc_label_stack)); lex_state->in = SCNG(yy_in); lex_state->yy_state = YYSTATE; lex_state->filename = zend_get_compiled_filename(TSRMLS_C); lex_state->lineno = CG(zend_lineno); lex_state->script_org = SCNG(script_org); lex_state->script_org_size = SCNG(script_org_size); lex_state->script_filtered = SCNG(script_filtered); lex_state->script_filtered_size = SCNG(script_filtered_size); lex_state->input_filter = SCNG(input_filter); lex_state->output_filter = SCNG(output_filter); lex_state->script_encoding = SCNG(script_encoding); } ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) { SCNG(yy_leng) = lex_state->yy_leng; SCNG(yy_start) = lex_state->yy_start; SCNG(yy_text) = lex_state->yy_text; SCNG(yy_cursor) = lex_state->yy_cursor; SCNG(yy_marker) = lex_state->yy_marker; SCNG(yy_limit) = lex_state->yy_limit; zend_stack_destroy(&SCNG(state_stack)); SCNG(state_stack) = lex_state->state_stack; zend_ptr_stack_clean(&SCNG(heredoc_label_stack), (void (*)(void *)) &heredoc_label_dtor, 1); zend_ptr_stack_destroy(&SCNG(heredoc_label_stack)); SCNG(heredoc_label_stack) = lex_state->heredoc_label_stack; SCNG(yy_in) = lex_state->in; YYSETCONDITION(lex_state->yy_state); CG(zend_lineno) = lex_state->lineno; zend_restore_compiled_filename(lex_state->filename TSRMLS_CC); if (SCNG(script_filtered)) { efree(SCNG(script_filtered)); SCNG(script_filtered) = NULL; } SCNG(script_org) = lex_state->script_org; SCNG(script_org_size) = lex_state->script_org_size; SCNG(script_filtered) = lex_state->script_filtered; SCNG(script_filtered_size) = lex_state->script_filtered_size; SCNG(input_filter) = lex_state->input_filter; SCNG(output_filter) = lex_state->output_filter; SCNG(script_encoding) = lex_state->script_encoding; RESET_DOC_COMMENT(); } ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) { zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles); /* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */ file_handle->opened_path = NULL; if (file_handle->free_filename) { file_handle->filename = NULL; } } #define BOM_UTF32_BE "\x00\x00\xfe\xff" #define BOM_UTF32_LE "\xff\xfe\x00\x00" #define BOM_UTF16_BE "\xfe\xff" #define BOM_UTF16_LE "\xff\xfe" #define BOM_UTF8 "\xef\xbb\xbf" static const zend_encoding *zend_multibyte_detect_utf_encoding(const unsigned char *script, size_t script_size TSRMLS_DC) { const unsigned char *p; int wchar_size = 2; int le = 0; /* utf-16 or utf-32? */ p = script; while ((p-script) < script_size) { p = memchr(p, 0, script_size-(p-script)-2); if (!p) { break; } if (*(p+1) == '\0' && *(p+2) == '\0') { wchar_size = 4; break; } /* searching for UTF-32 specific byte orders, so this will do */ p += 4; } /* BE or LE? */ p = script; while ((p-script) < script_size) { if (*p == '\0' && *(p+wchar_size-1) != '\0') { /* BE */ le = 0; break; } else if (*p != '\0' && *(p+wchar_size-1) == '\0') { /* LE* */ le = 1; break; } p += wchar_size; } if (wchar_size == 2) { return le ? zend_multibyte_encoding_utf16le : zend_multibyte_encoding_utf16be; } else { return le ? zend_multibyte_encoding_utf32le : zend_multibyte_encoding_utf32be; } return NULL; } static const zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D) { const zend_encoding *script_encoding = NULL; int bom_size; unsigned char *pos1, *pos2; if (LANG_SCNG(script_org_size) < sizeof(BOM_UTF32_LE)-1) { return NULL; } /* check out BOM */ if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_BE, sizeof(BOM_UTF32_BE)-1)) { script_encoding = zend_multibyte_encoding_utf32be; bom_size = sizeof(BOM_UTF32_BE)-1; } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_LE, sizeof(BOM_UTF32_LE)-1)) { script_encoding = zend_multibyte_encoding_utf32le; bom_size = sizeof(BOM_UTF32_LE)-1; } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_BE, sizeof(BOM_UTF16_BE)-1)) { script_encoding = zend_multibyte_encoding_utf16be; bom_size = sizeof(BOM_UTF16_BE)-1; } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_LE, sizeof(BOM_UTF16_LE)-1)) { script_encoding = zend_multibyte_encoding_utf16le; bom_size = sizeof(BOM_UTF16_LE)-1; } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF8, sizeof(BOM_UTF8)-1)) { script_encoding = zend_multibyte_encoding_utf8; bom_size = sizeof(BOM_UTF8)-1; } if (script_encoding) { /* remove BOM */ LANG_SCNG(script_org) += bom_size; LANG_SCNG(script_org_size) -= bom_size; return script_encoding; } /* script contains NULL bytes -> auto-detection */ if ((pos1 = memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size)))) { /* check if the NULL byte is after the __HALT_COMPILER(); */ pos2 = LANG_SCNG(script_org); while (pos1 - pos2 >= sizeof("__HALT_COMPILER();")-1) { pos2 = memchr(pos2, '_', pos1 - pos2); if (!pos2) break; pos2++; if (strncasecmp((char*)pos2, "_HALT_COMPILER", sizeof("_HALT_COMPILER")-1) == 0) { pos2 += sizeof("_HALT_COMPILER")-1; while (*pos2 == ' ' || *pos2 == '\t' || *pos2 == '\r' || *pos2 == '\n') { pos2++; } if (*pos2 == '(') { pos2++; while (*pos2 == ' ' || *pos2 == '\t' || *pos2 == '\r' || *pos2 == '\n') { pos2++; } if (*pos2 == ')') { pos2++; while (*pos2 == ' ' || *pos2 == '\t' || *pos2 == '\r' || *pos2 == '\n') { pos2++; } if (*pos2 == ';') { return NULL; } } } } } /* make best effort if BOM is missing */ return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC); } return NULL; } static const zend_encoding* zend_multibyte_find_script_encoding(TSRMLS_D) { const zend_encoding *script_encoding; if (CG(detect_unicode)) { /* check out bom(byte order mark) and see if containing wchars */ script_encoding = zend_multibyte_detect_unicode(TSRMLS_C); if (script_encoding != NULL) { /* bom or wchar detection is prior to 'script_encoding' option */ return script_encoding; } } /* if no script_encoding specified, just leave alone */ if (!CG(script_encoding_list) || !CG(script_encoding_list_size)) { return NULL; } /* if multiple encodings specified, detect automagically */ if (CG(script_encoding_list_size) > 1) { return zend_multibyte_encoding_detector(LANG_SCNG(script_org), LANG_SCNG(script_org_size), CG(script_encoding_list), CG(script_encoding_list_size) TSRMLS_CC); } return CG(script_encoding_list)[0]; } ZEND_API int zend_multibyte_set_filter(const zend_encoding *onetime_encoding TSRMLS_DC) { const zend_encoding *internal_encoding = zend_multibyte_get_internal_encoding(TSRMLS_C); const zend_encoding *script_encoding = onetime_encoding ? onetime_encoding: zend_multibyte_find_script_encoding(TSRMLS_C); if (!script_encoding) { return FAILURE; } /* judge input/output filter */ LANG_SCNG(script_encoding) = script_encoding; LANG_SCNG(input_filter) = NULL; LANG_SCNG(output_filter) = NULL; if (!internal_encoding || LANG_SCNG(script_encoding) == internal_encoding) { if (!zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) { /* and if not, work around w/ script_encoding -> utf-8 -> script_encoding conversion */ LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate; LANG_SCNG(output_filter) = encoding_filter_intermediate_to_script; } else { LANG_SCNG(input_filter) = NULL; LANG_SCNG(output_filter) = NULL; } return SUCCESS; } if (zend_multibyte_check_lexer_compatibility(internal_encoding)) { LANG_SCNG(input_filter) = encoding_filter_script_to_internal; LANG_SCNG(output_filter) = NULL; } else if (zend_multibyte_check_lexer_compatibility(LANG_SCNG(script_encoding))) { LANG_SCNG(input_filter) = NULL; LANG_SCNG(output_filter) = encoding_filter_script_to_internal; } else { /* both script and internal encodings are incompatible w/ flex */ LANG_SCNG(input_filter) = encoding_filter_script_to_intermediate; LANG_SCNG(output_filter) = encoding_filter_intermediate_to_internal; } return 0; } ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) { const char *file_path = NULL; char *buf; size_t size, offset = 0; /* The shebang line was read, get the current position to obtain the buffer start */ if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) { if ((offset = ftell(file_handle->handle.fp)) == -1) { offset = 0; } } if (zend_stream_fixup(file_handle, &buf, &size TSRMLS_CC) == FAILURE) { return FAILURE; } zend_llist_add_element(&CG(open_files), file_handle); if (file_handle->handle.stream.handle >= (void*)file_handle && file_handle->handle.stream.handle <= (void*)(file_handle+1)) { zend_file_handle *fh = (zend_file_handle*)zend_llist_get_last(&CG(open_files)); size_t diff = (char*)file_handle->handle.stream.handle - (char*)file_handle; fh->handle.stream.handle = (void*)(((char*)fh) + diff); file_handle->handle.stream.handle = fh->handle.stream.handle; } /* Reset the scanner for scanning the new file */ SCNG(yy_in) = file_handle; SCNG(yy_start) = NULL; if (size != -1) { if (CG(multibyte)) { SCNG(script_org) = (unsigned char*)buf; SCNG(script_org_size) = size; SCNG(script_filtered) = NULL; zend_multibyte_set_filter(NULL TSRMLS_CC); if (SCNG(input_filter)) { if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) { zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected " "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding))); } buf = (char*)SCNG(script_filtered); size = SCNG(script_filtered_size); } } SCNG(yy_start) = (unsigned char *)buf - offset; yy_scan_buffer(buf, size TSRMLS_CC); } else { zend_error_noreturn(E_COMPILE_ERROR, "zend_stream_mmap() failed"); } BEGIN(INITIAL); if (file_handle->opened_path) { file_path = file_handle->opened_path; } else { file_path = file_handle->filename; } zend_set_compiled_filename(file_path TSRMLS_CC); if (CG(start_lineno)) { CG(zend_lineno) = CG(start_lineno); CG(start_lineno) = 0; } else { CG(zend_lineno) = 1; } RESET_DOC_COMMENT(); CG(increment_lineno) = 0; return SUCCESS; } END_EXTERN_C() ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) { zend_lex_state original_lex_state; zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); zend_op_array *original_active_op_array = CG(active_op_array); zend_op_array *retval=NULL; int compiler_result; zend_bool compilation_successful=0; znode retval_znode; zend_bool original_in_compilation = CG(in_compilation); retval_znode.op_type = IS_CONST; INIT_PZVAL(&retval_znode.u.constant); ZVAL_LONG(&retval_znode.u.constant, 1); zend_save_lexical_state(&original_lex_state TSRMLS_CC); retval = op_array; /* success oriented */ if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) { if (type==ZEND_REQUIRE) { zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC); zend_bailout(); } else { zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC); } compilation_successful=0; } else { init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); CG(in_compilation) = 1; CG(active_op_array) = op_array; zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); compiler_result = zendparse(TSRMLS_C); zend_do_return(&retval_znode, 0 TSRMLS_CC); CG(in_compilation) = original_in_compilation; if (compiler_result != 0) { /* parser error */ zend_bailout(); } compilation_successful=1; } if (retval) { CG(active_op_array) = original_active_op_array; if (compilation_successful) { pass_two(op_array TSRMLS_CC); zend_release_labels(0 TSRMLS_CC); } else { efree(op_array); retval = NULL; } } zend_restore_lexical_state(&original_lex_state TSRMLS_CC); return retval; } zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) { zend_file_handle file_handle; zval tmp; zend_op_array *retval; char *opened_path = NULL; if (filename->type != IS_STRING) { tmp = *filename; zval_copy_ctor(&tmp); convert_to_string(&tmp); filename = &tmp; } file_handle.filename = Z_STRVAL_P(filename); file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; file_handle.handle.fp = NULL; retval = zend_compile_file(&file_handle, type TSRMLS_CC); if (retval && file_handle.handle.stream.handle) { int dummy = 1; if (!file_handle.opened_path) { file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename)); } zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); if (opened_path) { efree(opened_path); } } zend_destroy_file_handle(&file_handle TSRMLS_CC); if (filename==&tmp) { zval_dtor(&tmp); } return retval; } ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC) { char *buf; size_t size; /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */ Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD); memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD); SCNG(yy_in) = NULL; SCNG(yy_start) = NULL; buf = Z_STRVAL_P(str); size = Z_STRLEN_P(str); if (CG(multibyte)) { SCNG(script_org) = (unsigned char*)buf; SCNG(script_org_size) = size; SCNG(script_filtered) = NULL; zend_multibyte_set_filter(zend_multibyte_get_internal_encoding(TSRMLS_C) TSRMLS_CC); if (SCNG(input_filter)) { if ((size_t)-1 == SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) { zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected " "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding))); } buf = (char*)SCNG(script_filtered); size = SCNG(script_filtered_size); } } yy_scan_buffer(buf, size TSRMLS_CC); zend_set_compiled_filename(filename TSRMLS_CC); CG(zend_lineno) = 1; CG(increment_lineno) = 0; RESET_DOC_COMMENT(); return SUCCESS; } ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D) { size_t offset = SCNG(yy_cursor) - SCNG(yy_start); if (SCNG(input_filter)) { size_t original_offset = offset, length = 0; do { unsigned char *p = NULL; if ((size_t)-1 == SCNG(input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC)) { return (size_t)-1; } efree(p); if (length > original_offset) { offset--; } else if (length < original_offset) { offset++; } } while (original_offset != length); } return offset; } zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) { zend_lex_state original_lex_state; zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); zend_op_array *original_active_op_array = CG(active_op_array); zend_op_array *retval; zval tmp; int compiler_result; zend_bool original_in_compilation = CG(in_compilation); if (Z_STRLEN_P(source_string)==0) { efree(op_array); return NULL; } CG(in_compilation) = 1; tmp = *source_string; zval_copy_ctor(&tmp); convert_to_string(&tmp); source_string = &tmp; zend_save_lexical_state(&original_lex_state TSRMLS_CC); if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) { efree(op_array); retval = NULL; } else { zend_bool orig_interactive = CG(interactive); CG(interactive) = 0; init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); CG(interactive) = orig_interactive; CG(active_op_array) = op_array; zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); BEGIN(ST_IN_SCRIPTING); compiler_result = zendparse(TSRMLS_C); if (SCNG(script_filtered)) { efree(SCNG(script_filtered)); SCNG(script_filtered) = NULL; } if (compiler_result != 0) { CG(active_op_array) = original_active_op_array; CG(unclean_shutdown)=1; destroy_op_array(op_array TSRMLS_CC); efree(op_array); retval = NULL; } else { zend_do_return(NULL, 0 TSRMLS_CC); CG(active_op_array) = original_active_op_array; pass_two(op_array TSRMLS_CC); zend_release_labels(0 TSRMLS_CC); retval = op_array; } } zend_restore_lexical_state(&original_lex_state TSRMLS_CC); zval_dtor(&tmp); CG(in_compilation) = original_in_compilation; return retval; } BEGIN_EXTERN_C() int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) { zend_lex_state original_lex_state; zend_file_handle file_handle; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = filename; file_handle.free_filename = 0; file_handle.opened_path = NULL; zend_save_lexical_state(&original_lex_state TSRMLS_CC); if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) { zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename TSRMLS_CC); zend_restore_lexical_state(&original_lex_state TSRMLS_CC); return FAILURE; } zend_highlight(syntax_highlighter_ini TSRMLS_CC); if (SCNG(script_filtered)) { efree(SCNG(script_filtered)); SCNG(script_filtered) = NULL; } zend_destroy_file_handle(&file_handle TSRMLS_CC); zend_restore_lexical_state(&original_lex_state TSRMLS_CC); return SUCCESS; } int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC) { zend_lex_state original_lex_state; zval tmp = *str; str = &tmp; zval_copy_ctor(str); zend_save_lexical_state(&original_lex_state TSRMLS_CC); if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) { zend_restore_lexical_state(&original_lex_state TSRMLS_CC); return FAILURE; } BEGIN(INITIAL); zend_highlight(syntax_highlighter_ini TSRMLS_CC); if (SCNG(script_filtered)) { efree(SCNG(script_filtered)); SCNG(script_filtered) = NULL; } zend_restore_lexical_state(&original_lex_state TSRMLS_CC); zval_dtor(str); return SUCCESS; } ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, const zend_encoding *old_encoding TSRMLS_DC) { size_t length; unsigned char *new_yy_start; /* convert and set */ if (!SCNG(input_filter)) { if (SCNG(script_filtered)) { efree(SCNG(script_filtered)); SCNG(script_filtered) = NULL; } SCNG(script_filtered_size) = 0; length = SCNG(script_org_size); new_yy_start = SCNG(script_org); } else { if ((size_t)-1 == SCNG(input_filter)(&new_yy_start, &length, SCNG(script_org), SCNG(script_org_size) TSRMLS_CC)) { zend_error_noreturn(E_COMPILE_ERROR, "Could not convert the script from the detected " "encoding \"%s\" to a compatible encoding", zend_multibyte_get_encoding_name(LANG_SCNG(script_encoding))); } SCNG(script_filtered) = new_yy_start; SCNG(script_filtered_size) = length; } SCNG(yy_cursor) = new_yy_start + (SCNG(yy_cursor) - SCNG(yy_start)); SCNG(yy_marker) = new_yy_start + (SCNG(yy_marker) - SCNG(yy_start)); SCNG(yy_text) = new_yy_start + (SCNG(yy_text) - SCNG(yy_start)); SCNG(yy_limit) = new_yy_start + (SCNG(yy_limit) - SCNG(yy_start)); SCNG(yy_start) = new_yy_start; } # define zend_copy_value(zendlval, yytext, yyleng) \ if (SCNG(output_filter)) { \ size_t sz = 0; \ SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ Z_STRLEN_P(zendlval) = sz; \ } else { \ Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \ Z_STRLEN_P(zendlval) = yyleng; \ } static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC) { register char *s, *t; char *end; ZVAL_STRINGL(zendlval, str, len, 1); /* convert escape sequences */ s = t = Z_STRVAL_P(zendlval); end = s+Z_STRLEN_P(zendlval); while (s= end) { *t++ = '\\'; break; } switch(*s) { case 'n': *t++ = '\n'; Z_STRLEN_P(zendlval)--; break; case 'r': *t++ = '\r'; Z_STRLEN_P(zendlval)--; break; case 't': *t++ = '\t'; Z_STRLEN_P(zendlval)--; break; case 'f': *t++ = '\f'; Z_STRLEN_P(zendlval)--; break; case 'v': *t++ = '\v'; Z_STRLEN_P(zendlval)--; break; case 'e': #ifdef PHP_WIN32 *t++ = VK_ESCAPE; #else *t++ = '\e'; #endif Z_STRLEN_P(zendlval)--; break; case '"': case '`': if (*s != quote_type) { *t++ = '\\'; *t++ = *s; break; } case '\\': case '$': *t++ = *s; Z_STRLEN_P(zendlval)--; break; case 'x': case 'X': if (ZEND_IS_HEX(*(s+1))) { char hex_buf[3] = { 0, 0, 0 }; Z_STRLEN_P(zendlval)--; /* for the 'x' */ hex_buf[0] = *(++s); Z_STRLEN_P(zendlval)--; if (ZEND_IS_HEX(*(s+1))) { hex_buf[1] = *(++s); Z_STRLEN_P(zendlval)--; } *t++ = (char) strtol(hex_buf, NULL, 16); } else { *t++ = '\\'; *t++ = *s; } break; default: /* check for an octal */ if (ZEND_IS_OCT(*s)) { char octal_buf[4] = { 0, 0, 0, 0 }; octal_buf[0] = *s; Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[1] = *(++s); Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[2] = *(++s); Z_STRLEN_P(zendlval)--; } } *t++ = (char) strtol(octal_buf, NULL, 8); } else { *t++ = '\\'; *t++ = *s; } break; } } else { *t++ = *s; } if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) { CG(zend_lineno)++; } s++; } *t = 0; if (SCNG(output_filter)) { size_t sz = 0; s = Z_STRVAL_P(zendlval); SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); Z_STRLEN_P(zendlval) = sz; efree(s); } } int lex_scan(zval *zendlval TSRMLS_DC) { restart: SCNG(yy_text) = YYCURSOR; yymore_restart: #line 1001 "Zend/zend_language_scanner.c" { YYCTYPE yych; unsigned int yyaccept = 0; if (YYGETCONDITION() < 5) { if (YYGETCONDITION() < 2) { if (YYGETCONDITION() < 1) { goto yyc_ST_IN_SCRIPTING; } else { goto yyc_ST_LOOKING_FOR_PROPERTY; } } else { if (YYGETCONDITION() < 3) { goto yyc_ST_BACKQUOTE; } else { if (YYGETCONDITION() < 4) { goto yyc_ST_DOUBLE_QUOTES; } else { goto yyc_ST_HEREDOC; } } } } else { if (YYGETCONDITION() < 7) { if (YYGETCONDITION() < 6) { goto yyc_ST_LOOKING_FOR_VARNAME; } else { goto yyc_ST_VAR_OFFSET; } } else { if (YYGETCONDITION() < 8) { goto yyc_INITIAL; } else { if (YYGETCONDITION() < 9) { goto yyc_ST_END_HEREDOC; } else { goto yyc_ST_NOWDOC; } } } } /* *********************************** */ yyc_INITIAL: { static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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(8); yych = *YYCURSOR; if (yych != '<') goto yy4; YYDEBUG(2, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '?') { if (yych == '%') goto yy7; if (yych >= '?') goto yy5; } else { if (yych <= 'S') { if (yych >= 'S') goto yy9; } else { if (yych == 's') goto yy9; } } yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 1749 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; } inline_char_handler: while (1) { YYCTYPE *ptr = memchr(YYCURSOR, '<', YYLIMIT - YYCURSOR); YYCURSOR = ptr ? ptr + 1 : YYLIMIT; if (YYCURSOR < YYLIMIT) { switch (*YYCURSOR) { case '?': if (CG(short_tags) || !strncasecmp((char*)YYCURSOR + 1, "php", 3) || (*(YYCURSOR + 1) == '=')) { /* Assume [ \t\n\r] follows "php" */ break; } continue; case '%': if (CG(asp_tags)) { break; } continue; case 's': case 'S': /* Probably NOT an opening PHP " #ifdef HAVE_FPM_LQ "%.2f" #endif "%zu" "\n" ; full_post = "\n"; } /* JSON */ } else if (fpm_php_get_string_from_table("_GET", "json" TSRMLS_CC)) { sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC); time_format = "%s"; short_syntax = "{" "\"pool\":\"%s\"," "\"process manager\":\"%s\"," "\"start time\":%s," "\"start since\":%lu," "\"accepted conn\":%lu," #ifdef HAVE_FPM_LQ "\"listen queue\":%u," "\"max listen queue\":%u," "\"listen queue len\":%d," #endif "\"idle processes\":%d," "\"active processes\":%d," "\"total processes\":%d," "\"max active processes\":%d," "\"max children reached\":%u," "\"slow requests\":%lu"; if (!full) { short_post = "}"; } else { full_separator = ","; full_pre = ", \"processes\":["; full_syntax = "{" "\"pid\":%d," "\"state\":\"%s\"," "\"start time\":%s," "\"start since\":%lu," "\"requests\":%lu," "\"request duration\":%lu," "\"request method\":\"%s\"," "\"request uri\":\"%s%s%s\"," "\"content length\":%zu," "\"user\":\"%s\"," "\"script\":\"%s\"," #ifdef HAVE_FPM_LQ "\"last request cpu\":%.2f," #endif "\"last request memory\":%zu" "}"; full_post = "]}"; } /* TEXT */ } else { sapi_add_header_ex(ZEND_STRL("Content-Type: text/plain"), 1, 1 TSRMLS_CC); time_format = "%d/%b/%Y:%H:%M:%S %z"; short_syntax = "pool: %s\n" "process manager: %s\n" "start time: %s\n" "start since: %lu\n" "accepted conn: %lu\n" #ifdef HAVE_FPM_LQ "listen queue: %u\n" "max listen queue: %u\n" "listen queue len: %d\n" #endif "idle processes: %d\n" "active processes: %d\n" "total processes: %d\n" "max active processes: %d\n" "max children reached: %u\n" "slow requests: %lu\n"; if (full) { full_syntax = "\n" "************************\n" "pid: %d\n" "state: %s\n" "start time: %s\n" "start since: %lu\n" "requests: %lu\n" "request duration: %lu\n" "request method: %s\n" "request URI: %s%s%s\n" "content length: %zu\n" "user: %s\n" "script: %s\n" #ifdef HAVE_FPM_LQ "last request cpu: %.2f\n" #endif "last request memory: %zu\n"; } } strftime(time_buffer, sizeof(time_buffer) - 1, time_format, localtime(&scoreboard.start_epoch)); now_epoch = time(NULL); spprintf(&buffer, 0, short_syntax, scoreboard.pool, PM2STR(scoreboard.pm), time_buffer, now_epoch - scoreboard.start_epoch, scoreboard.requests, #ifdef HAVE_FPM_LQ scoreboard.lq, scoreboard.lq_max, scoreboard.lq_len, #endif scoreboard.idle, scoreboard.active, scoreboard.idle + scoreboard.active, scoreboard.active_max, scoreboard.max_children_reached, scoreboard.slow_rq); PUTS(buffer); efree(buffer); if (short_post) { PUTS(short_post); } /* no need to test the var 'full' */ if (full_syntax) { int i, first; size_t len; char *query_string; struct timeval duration, now; #ifdef HAVE_FPM_LQ float cpu; #endif fpm_clock_get(&now); if (full_pre) { PUTS(full_pre); } first = 1; for (i=0; inprocs; i++) { if (!scoreboard_p->procs[i] || !scoreboard_p->procs[i]->used) { continue; } proc = *scoreboard_p->procs[i]; if (first) { first = 0; } else { if (full_separator) { PUTS(full_separator); } } query_string = NULL; len = 0; if (proc.query_string[0] != '\0') { if (!encode) { query_string = proc.query_string; } else { query_string = php_escape_html_entities_ex((unsigned char *)proc.query_string, strlen(proc.query_string), &len, 1, ENT_HTML_IGNORE_ERRORS & ENT_COMPAT, NULL, 1 TSRMLS_CC); } } #ifdef HAVE_FPM_LQ /* prevent NaN */ if (proc.cpu_duration.tv_sec == 0 && proc.cpu_duration.tv_usec == 0) { cpu = 0.; } else { cpu = (proc.last_request_cpu.tms_utime + proc.last_request_cpu.tms_stime + proc.last_request_cpu.tms_cutime + proc.last_request_cpu.tms_cstime) / fpm_scoreboard_get_tick() / (proc.cpu_duration.tv_sec + proc.cpu_duration.tv_usec / 1000000.) * 100.; } #endif if (proc.request_stage == FPM_REQUEST_ACCEPTING) { duration = proc.duration; } else { timersub(&now, &proc.accepted, &duration); } strftime(time_buffer, sizeof(time_buffer) - 1, time_format, localtime(&proc.start_epoch)); spprintf(&buffer, 0, full_syntax, proc.pid, fpm_request_get_stage_name(proc.request_stage), time_buffer, now_epoch - proc.start_epoch, proc.requests, duration.tv_sec * 1000000UL + duration.tv_usec, proc.request_method[0] != '\0' ? proc.request_method : "-", proc.request_uri[0] != '\0' ? proc.request_uri : "-", query_string ? "?" : "", query_string ? query_string : "", proc.content_length, proc.auth_user[0] != '\0' ? proc.auth_user : "-", proc.script_filename[0] != '\0' ? proc.script_filename : "-", #ifdef HAVE_FPM_LQ proc.request_stage == FPM_REQUEST_ACCEPTING ? cpu : 0., #endif proc.request_stage == FPM_REQUEST_ACCEPTING ? proc.memory : 0); PUTS(buffer); efree(buffer); if (len > 0 && query_string) { efree(query_string); } } if (full_post) { PUTS(full_post); } } return 1; } return 0; } /* }}} */ PK! $php-5.6.40/sapi/fpm/fpm/fpm_atomic.hnu[ /* $Id: fpm_atomic.h,v 1.3 2008/09/18 23:34:11 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_ATOMIC_H #define FPM_ATOMIC_H 1 #if HAVE_INTTYPES_H # include #else # include #endif #include #ifdef HAVE_BUILTIN_ATOMIC /** * all the cases below (as provided by upstream) define: * word as atomic_int_t, and * unsigned word as atomic_uint_t * and only use volatile atomic_uint_t as atomic_t */ typedef volatile unsigned long atomic_t; #define atomic_cmp_set(a,b,c) __sync_bool_compare_and_swap(a,b,c) #elif ( __i386__ || __i386 ) typedef int32_t atomic_int_t; typedef uint32_t atomic_uint_t; typedef volatile atomic_uint_t atomic_t; static inline atomic_int_t atomic_fetch_add(atomic_t *value, atomic_int_t add) /* {{{ */ { __asm__ volatile ( "lock;" "xaddl %0, %1;" : "+r" (add) : "m" (*value) : "memory"); return add; } /* }}} */ static inline atomic_uint_t atomic_cmp_set(atomic_t *lock, atomic_uint_t old, atomic_uint_t set) /* {{{ */ { unsigned char res; __asm__ volatile ( "lock;" "cmpxchgl %3, %1;" "sete %0;" : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "memory"); return res; } /* }}} */ #elif ( __amd64__ || __amd64 || __x86_64__ ) typedef int64_t atomic_int_t; typedef uint64_t atomic_uint_t; typedef volatile atomic_uint_t atomic_t; static inline atomic_int_t atomic_fetch_add(atomic_t *value, atomic_int_t add) /* {{{ */ { __asm__ volatile ( "lock;" "xaddq %0, %1;" : "+r" (add) : "m" (*value) : "memory"); return add; } /* }}} */ static inline atomic_uint_t atomic_cmp_set(atomic_t *lock, atomic_uint_t old, atomic_uint_t set) /* {{{ */ { unsigned char res; __asm__ volatile ( "lock;" "cmpxchgq %3, %1;" "sete %0;" : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "memory"); return res; } /* }}} */ #if (__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) #elif ( __arm__ || __arm ) /* W-Mark Kubacki */ #if (__arch64__ || __arch64) typedef int64_t atomic_int_t; typedef uint64_t atomic_uint_t; #else typedef int32_t atomic_int_t; typedef uint32_t atomic_uint_t; #endif #define atomic_cmp_set(a,b,c) __sync_bool_compare_and_swap(a,b,c) #endif /* defined (__GNUC__) &&... */ #elif ( __sparc__ || __sparc ) /* Marcin Ochab */ #if (__sparcv9 || __sparcv9__) #if (__arch64__ || __arch64) typedef uint64_t atomic_uint_t; typedef volatile atomic_uint_t atomic_t; static inline int atomic_cas_64(atomic_t *lock, atomic_uint_t old, atomic_uint_t new) /* {{{ */ { __asm__ __volatile__("casx [%2], %3, %0 " : "=&r"(new) : "0"(new), "r"(lock), "r"(old): "memory"); return new; } /* }}} */ static inline atomic_uint_t atomic_cmp_set(atomic_t *lock, atomic_uint_t old, atomic_uint_t set) /* {{{ */ { return (atomic_cas_64(lock, old, set)==old); } /* }}} */ #else typedef uint32_t atomic_uint_t; typedef volatile atomic_uint_t atomic_t; static inline int atomic_cas_32(atomic_t *lock, atomic_uint_t old, atomic_uint_t new) /* {{{ */ { __asm__ __volatile__("cas [%2], %3, %0 " : "=&r"(new) : "0"(new), "r"(lock), "r"(old): "memory"); return new; } /* }}} */ static inline atomic_uint_t atomic_cmp_set(atomic_t *lock, atomic_uint_t old, atomic_uint_t set) /* {{{ */ { return (atomic_cas_32(lock, old, set)==old); } /* }}} */ #endif #else /* #if (__sparcv9 || __sparcv9__) */ #error Sparc v8 and predecessors are not and will not be supported (see bug report 53310) #endif /* #if (__sparcv9 || __sparcv9__) */ #else #error Unsupported processor. Please open a bug report (bugs.php.net). #endif static inline int fpm_spinlock(atomic_t *lock, int try_once) /* {{{ */ { if (try_once) { return atomic_cmp_set(lock, 0, 1) ? 1 : 0; } for (;;) { if (atomic_cmp_set(lock, 0, 1)) { break; } sched_yield(); } return 1; } /* }}} */ #define fpm_unlock(lock) lock = 0 #endif PK!C!php-5.6.40/sapi/fpm/fpm/fpm_shm.cnu[ /* $Id: fpm_shm.c,v 1.3 2008/05/24 17:38:47 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin, Jerome Loyet */ #include #include #include #include "fpm_shm.h" #include "zlog.h" /* MAP_ANON is deprecated, but not in macosx */ #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) #define MAP_ANONYMOUS MAP_ANON #endif static size_t fpm_shm_size = 0; void *fpm_shm_alloc(size_t size) /* {{{ */ { void *mem; mem = mmap(0, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0); #ifdef MAP_FAILED if (mem == MAP_FAILED) { zlog(ZLOG_SYSERROR, "unable to allocate %zu bytes in shared memory: %s", size, strerror(errno)); return NULL; } #endif if (!mem) { zlog(ZLOG_SYSERROR, "unable to allocate %zu bytes in shared memory", size); return NULL; } fpm_shm_size += size; return mem; } /* }}} */ int fpm_shm_free(void *mem, size_t size) /* {{{ */ { if (!mem) { zlog(ZLOG_ERROR, "mem is NULL"); return 0; } if (munmap(mem, size) == -1) { zlog(ZLOG_SYSERROR, "Unable to free shm"); return 0; } if (fpm_shm_size - size > 0) { fpm_shm_size -= size; } else { fpm_shm_size = 0; } return 1; } /* }}} */ size_t fpm_shm_get_size_allocated() /* {{{*/ { return fpm_shm_size; } /* }}} */ PK!zq!php-5.6.40/sapi/fpm/fpm/fpm_php.hnu[ /* $Id: fpm_php.h,v 1.10.2.1 2008/11/15 00:57:24 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_PHP_H #define FPM_PHP_H 1 #include #include "php.h" #include "build-defs.h" /* for PHP_ defines */ #include "fpm/fpm_conf.h" #define FPM_PHP_INI_TO_EXPAND \ { \ "error_log", \ "extension_dir", \ "mime_magic.magicfile", \ "sendmail_path", \ "session.cookie_path", \ "session_pgsql.sem_file_name", \ "soap.wsdl_cache_dir", \ "uploadprogress.file.filename_template", \ "xdebug.output_dir", \ "xdebug.profiler_output_dir", \ "xdebug.trace_output_dir", \ "xmms.path", \ "axis2.client_home", \ "blenc.key_file", \ "coin_acceptor.device", \ NULL \ } struct fpm_worker_pool_s; int fpm_php_init_child(struct fpm_worker_pool_s *wp); char *fpm_php_script_filename(TSRMLS_D); char *fpm_php_request_uri(TSRMLS_D); char *fpm_php_request_method(TSRMLS_D); char *fpm_php_query_string(TSRMLS_D); char *fpm_php_auth_user(TSRMLS_D); size_t fpm_php_content_length(TSRMLS_D); void fpm_php_soft_quit(); int fpm_php_init_main(); int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode); int fpm_php_limit_extensions(char *path); char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC); #endif PK!hC "php-5.6.40/sapi/fpm/fpm/fpm_conf.hnu[ /* $Id: fpm_conf.h,v 1.12.2.2 2008/12/13 03:46:49 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_CONF_H #define FPM_CONF_H 1 #include #include "php.h" #define PM2STR(a) (a == PM_STYLE_STATIC ? "static" : (a == PM_STYLE_DYNAMIC ? "dynamic" : "ondemand")) #define FPM_CONF_MAX_PONG_LENGTH 64 struct key_value_s; struct key_value_s { struct key_value_s *next; char *key; char *value; }; /* * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in */ struct fpm_global_config_s { char *pid_file; char *error_log; #ifdef HAVE_SYSLOG_H char *syslog_ident; int syslog_facility; #endif int log_level; int emergency_restart_threshold; int emergency_restart_interval; int process_control_timeout; int process_max; int process_priority; int daemonize; int rlimit_files; int rlimit_core; char *events_mechanism; #ifdef HAVE_SYSTEMD int systemd_watchdog; int systemd_interval; #endif }; extern struct fpm_global_config_s fpm_global_config; /* * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in */ struct fpm_worker_pool_config_s { char *name; char *prefix; char *user; char *group; char *listen_address; int listen_backlog; /* Using chown */ char *listen_owner; char *listen_group; char *listen_mode; char *listen_allowed_clients; int process_priority; int process_dumpable; int pm; int pm_max_children; int pm_start_servers; int pm_min_spare_servers; int pm_max_spare_servers; int pm_process_idle_timeout; int pm_max_requests; char *pm_status_path; char *ping_path; char *ping_response; char *access_log; char *access_format; char *slowlog; int request_slowlog_timeout; int request_terminate_timeout; int rlimit_files; int rlimit_core; char *chroot; char *chdir; int catch_workers_output; int clear_env; char *security_limit_extensions; struct key_value_s *env; struct key_value_s *php_admin_values; struct key_value_s *php_values; #ifdef HAVE_APPARMOR char *apparmor_hat; #endif #ifdef HAVE_FPM_ACL /* Using Posix ACL */ char *listen_acl_users; char *listen_acl_groups; #endif }; struct ini_value_parser_s { char *name; char *(*parser)(zval *, void **, intptr_t); intptr_t offset; }; enum { PM_STYLE_STATIC = 1, PM_STYLE_DYNAMIC = 2, PM_STYLE_ONDEMAND = 3 }; int fpm_conf_init_main(int test_conf, int force_daemon); int fpm_worker_pool_config_free(struct fpm_worker_pool_config_s *wpc); int fpm_conf_write_pid(); int fpm_conf_unlink_pid(); #endif PK!.\]%php-5.6.40/sapi/fpm/fpm/fpm_systemd.hnu[#ifndef FPM_SYSTEMD_H #define FPM_SYSTEMD_H 1 #include "fpm_events.h" /* 10s (in ms) heartbeat for systemd status */ #define FPM_SYSTEMD_DEFAULT_HEARTBEAT (10000) void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg); int fpm_systemd_conf(); #endif PK!fi%php-5.6.40/sapi/fpm/fpm/fpm_sockets.hnu[ /* $Id: fpm_sockets.h,v 1.12 2008/08/26 15:09:15 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_MISC_H #define FPM_MISC_H 1 #include #include #include #include #include #include "fpm_worker_pool.h" /* On FreeBSD and OpenBSD, backlog negative values are truncated to SOMAXCONN */ #if (__FreeBSD__) || (__OpenBSD__) #define FPM_BACKLOG_DEFAULT -1 #else #define FPM_BACKLOG_DEFAULT 65535 #endif enum fpm_address_domain fpm_sockets_domain_from_address(char *addr); int fpm_sockets_init_main(); int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq); int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen); static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ { int flags = fcntl(fd, F_GETFL); if (flags < 0) { return -1; } if (blocked) { flags &= ~O_NONBLOCK; } else { flags |= O_NONBLOCK; } return fcntl(fd, F_SETFL, flags); } /* }}} */ #endif PK!ؐv!php-5.6.40/sapi/fpm/fpm/fpm_env.hnu[ /* $Id: fpm_env.h,v 1.9 2008/09/18 23:19:59 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_ENV_H #define FPM_ENV_H 1 #include "fpm_worker_pool.h" #define SETPROCTITLE_PREFIX "php-fpm: " int fpm_env_init_child(struct fpm_worker_pool_s *wp); int fpm_env_init_main(); void fpm_env_setproctitle(char *title); extern char **environ; #ifndef HAVE_SETENV int setenv(char *name, char *value, int overwrite); #endif #ifndef HAVE_CLEARENV void clearenv(); #endif #endif PK!M9zKK&php-5.6.40/sapi/fpm/fpm/events/epoll.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef FPM_EVENTS_EPOLL_H #define FPM_EVENTS_EPOLL_H #include "../fpm_config.h" #include "../fpm_events.h" struct fpm_event_module_s *fpm_event_epoll_module(); #endif /* FPM_EVENTS_EPOLL_H */ PK!Б]]'php-5.6.40/sapi/fpm/fpm/events/select.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "../fpm_config.h" #include "../fpm_events.h" #include "../fpm.h" #include "../zlog.h" #if HAVE_SELECT /* According to POSIX.1-2001 */ #include /* According to earlier standards */ #include #include #include #include static int fpm_event_select_init(int max); static int fpm_event_select_wait(struct fpm_event_queue_s *queue, unsigned long int timeout); static int fpm_event_select_add(struct fpm_event_s *ev); static int fpm_event_select_remove(struct fpm_event_s *ev); static struct fpm_event_module_s select_module = { .name = "select", .support_edge_trigger = 0, .init = fpm_event_select_init, .clean = NULL, .wait = fpm_event_select_wait, .add = fpm_event_select_add, .remove = fpm_event_select_remove, }; static fd_set fds; #endif /* HAVE_SELECT */ /* * return the module configuration */ struct fpm_event_module_s *fpm_event_select_module() /* {{{ */ { #if HAVE_SELECT return &select_module; #else return NULL; #endif /* HAVE_SELECT */ } /* }}} */ #if HAVE_SELECT /* * Init the module */ static int fpm_event_select_init(int max) /* {{{ */ { FD_ZERO(&fds); return 0; } /* }}} */ /* * wait for events or timeout */ static int fpm_event_select_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */ { int ret; struct fpm_event_queue_s *q; fd_set current_fds; struct timeval t; /* copy fds because select() alters it */ current_fds = fds; /* fill struct timeval with timeout */ t.tv_sec = timeout / 1000; t.tv_usec = (timeout % 1000) * 1000; /* wait for inconming event or timeout */ ret = select(FD_SETSIZE, ¤t_fds, NULL, NULL, &t); if (ret == -1) { /* trigger error unless signal interrupt */ if (errno != EINTR) { zlog(ZLOG_WARNING, "poll() returns %d", errno); return -1; } } /* events have been triggered */ if (ret > 0) { /* trigger POLLIN events */ q = queue; while (q) { if (q->ev) { /* sanity check */ /* check if the event has been triggered */ if (FD_ISSET(q->ev->fd, ¤t_fds)) { /* fire the event */ fpm_event_fire(q->ev); /* sanity check */ if (fpm_globals.parent_pid != getpid()) { return -2; } } } q = q->next; /* iterate */ } } return ret; } /* }}} */ /* * Add a FD to the fd set */ static int fpm_event_select_add(struct fpm_event_s *ev) /* {{{ */ { /* check size limitation */ if (ev->fd >= FD_SETSIZE) { zlog(ZLOG_ERROR, "select: not enough space in the select fd list (max = %d). Please consider using another event mechanism.", FD_SETSIZE); return -1; } /* add the FD if not already in */ if (!FD_ISSET(ev->fd, &fds)) { FD_SET(ev->fd, &fds); ev->index = ev->fd; } return 0; } /* }}} */ /* * Remove a FD from the fd set */ static int fpm_event_select_remove(struct fpm_event_s *ev) /* {{{ */ { /* remove the fd if it's in */ if (FD_ISSET(ev->fd, &fds)) { FD_CLR(ev->fd, &fds); ev->index = -1; } return 0; } /* }}} */ #endif /* HAVE_SELECT */ PK!5(php-5.6.40/sapi/fpm/fpm/events/devpoll.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "../fpm_config.h" #include "../fpm_events.h" #include "../fpm.h" #include "../zlog.h" #if HAVE_DEVPOLL #include #include #include #include #include #include static int fpm_event_devpoll_init(int max); static int fpm_event_devpoll_clean(); static int fpm_event_devpoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout); static int fpm_event_devpoll_add(struct fpm_event_s *ev); static int fpm_event_devpoll_remove(struct fpm_event_s *ev); static struct fpm_event_module_s devpoll_module = { .name = "/dev/poll", .support_edge_trigger = 0, .init = fpm_event_devpoll_init, .clean = fpm_event_devpoll_clean, .wait = fpm_event_devpoll_wait, .add = fpm_event_devpoll_add, .remove = fpm_event_devpoll_remove, }; int dpfd = -1; static struct pollfd *pollfds = NULL; static struct pollfd *active_pollfds = NULL; static int npollfds = 0; #endif /* HAVE_DEVPOLL */ struct fpm_event_module_s *fpm_event_devpoll_module() /* {{{ */ { #if HAVE_DEVPOLL return &devpoll_module; #else return NULL; #endif /* HAVE_DEVPOLL */ } /* }}} */ #if HAVE_DEVPOLL /* * Init module */ static int fpm_event_devpoll_init(int max) /* {{{ */ { int i; /* open /dev/poll for future usages */ dpfd = open("/dev/poll", O_RDWR); if (dpfd < 0) { zlog(ZLOG_ERROR, "Unable to open /dev/poll"); return -1; } if (max < 1) { return 0; } /* alloc and clear pollfds */ pollfds = malloc(sizeof(struct pollfd) * max); if (!pollfds) { zlog(ZLOG_ERROR, "poll: unable to allocate %d events", max); return -1; } memset(pollfds, 0, sizeof(struct pollfd) * max); /* set all fd to -1 in order to ensure it's not set */ for (i = 0; i < max; i++) { pollfds[i].fd = -1; } /* alloc and clear active_pollfds */ active_pollfds = malloc(sizeof(struct pollfd) * max); if (!active_pollfds) { free(pollfds); zlog(ZLOG_ERROR, "poll: unable to allocate %d events", max); return -1; } memset(active_pollfds, 0, sizeof(struct pollfd) * max); /* save max */ npollfds = max; return 0; } /* }}} */ /* * Clean the module */ static int fpm_event_devpoll_clean() /* {{{ */ { /* close /dev/poll if open */ if (dpfd > -1) { close(dpfd); dpfd = -1; } /* free pollfds */ if (pollfds) { free(pollfds); pollfds = NULL; } /* free active_pollfds */ if (active_pollfds) { free(active_pollfds); active_pollfds = NULL; } npollfds = 0; return 0; } /* }}} */ /* * wait for events or timeout */ static int fpm_event_devpoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */ { int ret, i; struct fpm_event_queue_s *q; struct dvpoll dopoll; /* setup /dev/poll */ dopoll.dp_fds = active_pollfds; dopoll.dp_nfds = npollfds; dopoll.dp_timeout = (int)timeout; /* wait for inconming event or timeout */ ret = ioctl(dpfd, DP_POLL, &dopoll); if (ret < 0) { /* trigger error unless signal interrupt */ if (errno != EINTR) { zlog(ZLOG_WARNING, "/dev/poll: ioctl() returns %d", errno); return -1; } } /* iterate throught triggered events */ for (i = 0; i < ret; i++) { /* find the corresponding event */ q = queue; while (q) { /* found */ if (q->ev && q->ev->fd == active_pollfds[i].fd) { /* fire the event */ fpm_event_fire(q->ev); /* sanity check */ if (fpm_globals.parent_pid != getpid()) { return -2; } break; /* next triggered event */ } q = q->next; /* iterate */ } } return ret; } /* }}} */ /* * Add a FD from the fd set */ static int fpm_event_devpoll_add(struct fpm_event_s *ev) /* {{{ */ { struct pollfd pollfd; /* fill pollfd with event informations */ pollfd.fd = ev->fd; pollfd.events = POLLIN; pollfd.revents = 0; /* add the event to the internal queue */ if (write(dpfd, &pollfd, sizeof(struct pollfd)) != sizeof(struct pollfd)) { zlog(ZLOG_ERROR, "/dev/poll: Unable to add the event in the internal queue"); return -1; } /* mark the event as registered */ ev->index = ev->fd; return 0; } /* }}} */ /* * Remove a FD from the fd set */ static int fpm_event_devpoll_remove(struct fpm_event_s *ev) /* {{{ */ { struct pollfd pollfd; /* fill pollfd with the same informations as fpm_event_devpoll_add */ pollfd.fd = ev->fd; pollfd.events = POLLIN | POLLREMOVE; pollfd.revents = 0; /* add the event to the internal queue */ if (write(dpfd, &pollfd, sizeof(struct pollfd)) != sizeof(struct pollfd)) { zlog(ZLOG_ERROR, "/dev/poll: Unable to remove the event in the internal queue"); return -1; } /* mark the event as registered */ ev->index = -1; return 0; } /* }}} */ #endif /* HAVE_DEVPOLL */ PK!C.OO'php-5.6.40/sapi/fpm/fpm/events/select.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef FPM_EVENTS_SELECT_H #define FPM_EVENTS_SELECT_H #include "../fpm_config.h" #include "../fpm_events.h" struct fpm_event_module_s *fpm_event_select_module(); #endif /* FPM_EVENTS_SELECT_H */ PK!-la'php-5.6.40/sapi/fpm/fpm/events/kqueue.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "../fpm_config.h" #include "../fpm_events.h" #include "../fpm.h" #include "../zlog.h" #if HAVE_KQUEUE #include #include #include #include static int fpm_event_kqueue_init(int max); static int fpm_event_kqueue_clean(); static int fpm_event_kqueue_wait(struct fpm_event_queue_s *queue, unsigned long int timeout); static int fpm_event_kqueue_add(struct fpm_event_s *ev); static int fpm_event_kqueue_remove(struct fpm_event_s *ev); static struct fpm_event_module_s kqueue_module = { .name = "kqueue", .support_edge_trigger = 1, .init = fpm_event_kqueue_init, .clean = fpm_event_kqueue_clean, .wait = fpm_event_kqueue_wait, .add = fpm_event_kqueue_add, .remove = fpm_event_kqueue_remove, }; static struct kevent *kevents = NULL; static int nkevents = 0; static int kfd = 0; #endif /* HAVE_KQUEUE */ /* * Return the module configuration */ struct fpm_event_module_s *fpm_event_kqueue_module() /* {{{ */ { #if HAVE_KQUEUE return &kqueue_module; #else return NULL; #endif /* HAVE_KQUEUE */ } /* }}} */ #if HAVE_KQUEUE /* * init kqueue and stuff */ static int fpm_event_kqueue_init(int max) /* {{{ */ { if (max < 1) { return 0; } kfd = kqueue(); if (kfd < 0) { zlog(ZLOG_ERROR, "kqueue: unable to initialize"); return -1; } kevents = malloc(sizeof(struct kevent) * max); if (!kevents) { zlog(ZLOG_ERROR, "epoll: unable to allocate %d events", max); return -1; } memset(kevents, 0, sizeof(struct kevent) * max); nkevents = max; return 0; } /* }}} */ /* * release kqueue stuff */ static int fpm_event_kqueue_clean() /* {{{ */ { if (kevents) { free(kevents); kevents = NULL; } nkevents = 0; return 0; } /* }}} */ /* * wait for events or timeout */ static int fpm_event_kqueue_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */ { struct timespec t; int ret, i; /* ensure we have a clean kevents before calling kevent() */ memset(kevents, 0, sizeof(struct kevent) * nkevents); /* convert ms to timespec struct */ t.tv_sec = timeout / 1000; t.tv_nsec = (timeout % 1000) * 1000 * 1000; /* wait for incoming event or timeout */ ret = kevent(kfd, NULL, 0, kevents, nkevents, &t); if (ret == -1) { /* trigger error unless signal interrupt */ if (errno != EINTR) { zlog(ZLOG_WARNING, "epoll_wait() returns %d", errno); return -1; } } /* fire triggered events */ for (i = 0; i < ret; i++) { if (kevents[i].udata) { struct fpm_event_s *ev = (struct fpm_event_s *)kevents[i].udata; fpm_event_fire(ev); /* sanity check */ if (fpm_globals.parent_pid != getpid()) { return -2; } } } return ret; } /* }}} */ /* * Add a FD to to kevent queue */ static int fpm_event_kqueue_add(struct fpm_event_s *ev) /* {{{ */ { struct kevent k; int flags = EV_ADD; if (ev->flags & FPM_EV_EDGE) { flags = flags | EV_CLEAR; } EV_SET(&k, ev->fd, EVFILT_READ, flags, 0, 0, (void *)ev); if (kevent(kfd, &k, 1, NULL, 0, NULL) < 0) { zlog(ZLOG_ERROR, "kevent: unable to add event"); return -1; } /* mark the event as registered */ ev->index = ev->fd; return 0; } /* }}} */ /* * Remove a FD from the kevent queue */ static int fpm_event_kqueue_remove(struct fpm_event_s *ev) /* {{{ */ { struct kevent k; int flags = EV_DELETE; if (ev->flags & FPM_EV_EDGE) { flags = flags | EV_CLEAR; } EV_SET(&k, ev->fd, EVFILT_READ, flags, 0, 0, (void *)ev); if (kevent(kfd, &k, 1, NULL, 0, NULL) < 0) { zlog(ZLOG_ERROR, "kevent: unable to add event"); return -1; } /* mark the vent as not registered */ ev->index = -1; return 0; } /* }}} */ #endif /* HAVE_KQUEUE */ PK! _%php-5.6.40/sapi/fpm/fpm/events/poll.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "../fpm_config.h" #include "../fpm_events.h" #include "../fpm.h" #include "../zlog.h" #if HAVE_POLL #include #include #include static int fpm_event_poll_init(int max); static int fpm_event_poll_clean(); static int fpm_event_poll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout); static int fpm_event_poll_add(struct fpm_event_s *ev); static int fpm_event_poll_remove(struct fpm_event_s *ev); static struct fpm_event_module_s poll_module = { .name = "poll", .support_edge_trigger = 0, .init = fpm_event_poll_init, .clean = fpm_event_poll_clean, .wait = fpm_event_poll_wait, .add = fpm_event_poll_add, .remove = fpm_event_poll_remove, }; static struct pollfd *pollfds = NULL; static struct pollfd *active_pollfds = NULL; static int npollfds = 0; static int next_free_slot = 0; #endif /* HAVE_POLL */ /* * return the module configuration */ struct fpm_event_module_s *fpm_event_poll_module() /* {{{ */ { #if HAVE_POLL return &poll_module; #else return NULL; #endif /* HAVE_POLL */ } /* }}} */ #if HAVE_POLL /* * Init the module */ static int fpm_event_poll_init(int max) /* {{{ */ { int i; if (max < 1) { return 0; } /* alloc and clear pollfds */ pollfds = malloc(sizeof(struct pollfd) * max); if (!pollfds) { zlog(ZLOG_ERROR, "poll: unable to allocate %d events", max); return -1; } memset(pollfds, 0, sizeof(struct pollfd) * max); /* set all fd to -1 in order to ensure it's not set */ for (i = 0; i < max; i++) { pollfds[i].fd = -1; } /* alloc and clear active_pollfds */ active_pollfds = malloc(sizeof(struct pollfd) * max); if (!active_pollfds) { free(pollfds); zlog(ZLOG_ERROR, "poll: unable to allocate %d events", max); return -1; } memset(active_pollfds, 0, sizeof(struct pollfd) * max); /* save max */ npollfds = max; return 0; } /* }}} */ /* * Clean the module */ static int fpm_event_poll_clean() /* {{{ */ { /* free pollfds */ if (pollfds) { free(pollfds); pollfds = NULL; } /* free active_pollfds */ if (active_pollfds) { free(active_pollfds); active_pollfds = NULL; } npollfds = 0; return 0; } /* }}} */ /* * wait for events or timeout */ static int fpm_event_poll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */ { int ret; struct fpm_event_queue_s *q; if (npollfds > 0) { /* copy pollfds because poll() alters it */ memcpy(active_pollfds, pollfds, sizeof(struct pollfd) * npollfds); } /* wait for inconming event or timeout */ ret = poll(active_pollfds, npollfds, timeout); if (ret == -1) { /* trigger error unless signal interrupt */ if (errno != EINTR) { zlog(ZLOG_WARNING, "poll() returns %d", errno); return -1; } } /* events have been triggered */ if (ret > 0) { /* trigger POLLIN events */ q = queue; while (q) { /* ensure ev->index is valid */ if (q->ev && q->ev->index >= 0 && q->ev->index < npollfds && q->ev->fd == active_pollfds[q->ev->index].fd) { /* has the event has been triggered ? */ if (active_pollfds[q->ev->index].revents & POLLIN) { /* fire the event */ fpm_event_fire(q->ev); /* sanity check */ if (fpm_globals.parent_pid != getpid()) { return -2; } } } q = q->next; /* iterate */ } } return ret; } /* }}} */ /* * Add a FD to the fd set */ static int fpm_event_poll_add(struct fpm_event_s *ev) /* {{{ */ { int i; /* do we have a direct free slot */ if (pollfds[next_free_slot].fd == -1) { /* register the event */ pollfds[next_free_slot].fd = ev->fd; pollfds[next_free_slot].events = POLLIN; /* remember the event place in the fd list and suppose next slot is free */ ev->index = next_free_slot++; if (next_free_slot >= npollfds) { next_free_slot = 0; } return 0; } /* let's search */ for (i = 0; i < npollfds; i++) { if (pollfds[i].fd != -1) { /* not free */ continue; } /* register the event */ pollfds[i].fd = ev->fd; pollfds[i].events = POLLIN; /* remember the event place in the fd list and suppose next slot is free */ ev->index = next_free_slot++; if (next_free_slot >= npollfds) { next_free_slot = 0; } return 0; } zlog(ZLOG_ERROR, "poll: not enought space to add event (fd=%d)", ev->fd); return -1; } /* }}} */ /* * Remove a FD from the fd set */ static int fpm_event_poll_remove(struct fpm_event_s *ev) /* {{{ */ { int i; /* do we have a direct access */ if (ev->index >= 0 && ev->index < npollfds && pollfds[ev->index].fd == ev->fd) { /* remember this slot as free */ next_free_slot = ev->index; /* clear event in pollfds */ pollfds[ev->index].fd = -1; pollfds[ev->index].events = 0; /* mark the event as not registered */ ev->index = -1; return 0; } /* let's search */ for (i = 0; i < npollfds; i++) { if (pollfds[i].fd != ev->fd) { /* not found */ continue; } /* remember this slot as free */ next_free_slot = i; /* clear event in pollfds */ pollfds[i].fd = -1; pollfds[i].events = 0; /* mark the event as not registered */ ev->index = -1; return 0; } zlog(ZLOG_ERROR, "poll: unable to remove event: not found (fd=%d, index=%d)", ev->fd, ev->index); return -1; } /* }}} */ #endif /* HAVE_POLL */ PK!\{1GG%php-5.6.40/sapi/fpm/fpm/events/poll.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef FPM_EVENTS_POLL_H #define FPM_EVENTS_POLL_H #include "../fpm_config.h" #include "../fpm_events.h" struct fpm_event_module_s *fpm_event_poll_module(); #endif /* FPM_EVENTS_POLL_H */ PK!ԗSS(php-5.6.40/sapi/fpm/fpm/events/devpoll.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef FPM_EVENTS_DEVPOLL_H #define FPM_EVENTS_DEVPOLL_H #include "../fpm_config.h" #include "../fpm_events.h" struct fpm_event_module_s *fpm_event_devpoll_module(); #endif /* FPM_EVENTS_DEVPOLL_H */ PK!τXOO'php-5.6.40/sapi/fpm/fpm/events/kqueue.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef FPM_EVENTS_KQUEUE_H #define FPM_EVENTS_KQUEUE_H #include "../fpm_config.h" #include "../fpm_events.h" struct fpm_event_module_s *fpm_event_kqueue_module(); #endif /* FPM_EVENTS_KQUEUE_H */ PK!\%php-5.6.40/sapi/fpm/fpm/events/port.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "../fpm_config.h" #include "../fpm_events.h" #include "../fpm.h" #include "../zlog.h" #if HAVE_PORT #include #include #include static int fpm_event_port_init(int max); static int fpm_event_port_clean(); static int fpm_event_port_wait(struct fpm_event_queue_s *queue, unsigned long int timeout); static int fpm_event_port_add(struct fpm_event_s *ev); static int fpm_event_port_remove(struct fpm_event_s *ev); static struct fpm_event_module_s port_module = { .name = "port", .support_edge_trigger = 0, .init = fpm_event_port_init, .clean = fpm_event_port_clean, .wait = fpm_event_port_wait, .add = fpm_event_port_add, .remove = fpm_event_port_remove, }; port_event_t *events = NULL; int nevents = 0; static int pfd = -1; #endif /* HAVE_PORT */ struct fpm_event_module_s *fpm_event_port_module() /* {{{ */ { #if HAVE_PORT return &port_module; #else return NULL; #endif /* HAVE_PORT */ } /* }}} */ #if HAVE_PORT /* * Init the module */ static int fpm_event_port_init(int max) /* {{{ */ { /* open port */ pfd = port_create(); if (pfd < 0) { zlog(ZLOG_ERROR, "port: unable to initialize port_create()"); return -1; } if (max < 1) { return 0; } /* alloc and clear active_pollfds */ events = malloc(sizeof(port_event_t) * max); if (!events) { zlog(ZLOG_ERROR, "port: Unable to allocate %d events", max); return -1; } nevents = max; return 0; } /* }}} */ /* * Clean the module */ static int fpm_event_port_clean() /* {{{ */ { if (pfd > -1) { close(pfd); pfd = -1; } if (events) { free(events); events = NULL; } nevents = 0; return 0; } /* }}} */ /* * wait for events or timeout */ static int fpm_event_port_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */ { int ret, i, nget; timespec_t t; /* convert timeout into timespec_t */ t.tv_sec = (int)(timeout / 1000); t.tv_nsec = (timeout % 1000) * 1000 * 1000; /* wait for inconming event or timeout. We want at least one event or timeout */ nget = 1; ret = port_getn(pfd, events, nevents, &nget, &t); if (ret < 0) { /* trigger error unless signal interrupt or timeout */ if (errno != EINTR && errno != ETIME) { zlog(ZLOG_WARNING, "poll() returns %d", errno); return -1; } } for (i = 0; i < nget; i++) { /* do we have a ptr to the event ? */ if (!events[i].portev_user) { continue; } /* fire the event */ fpm_event_fire((struct fpm_event_s *)events[i].portev_user); /* sanity check */ if (fpm_globals.parent_pid != getpid()) { return -2; } } return nget; } /* }}} */ /* * Add a FD to the fd set */ static int fpm_event_port_add(struct fpm_event_s *ev) /* {{{ */ { /* add the event to port */ if (port_associate(pfd, PORT_SOURCE_FD, ev->fd, POLLIN, (void *)ev) < 0) { zlog(ZLOG_ERROR, "port: unable to add the event"); return -1; } return 0; } /* }}} */ /* * Remove a FD from the fd set */ static int fpm_event_port_remove(struct fpm_event_s *ev) /* {{{ */ { /* remove the event from port */ if (port_dissociate(pfd, PORT_SOURCE_FD, ev->fd) < 0) { zlog(ZLOG_ERROR, "port: unable to add the event"); return -1; } return 0; } /* }}} */ #endif /* HAVE_PORT */ PK!6&php-5.6.40/sapi/fpm/fpm/events/epoll.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "../fpm_config.h" #include "../fpm_events.h" #include "../fpm.h" #include "../zlog.h" #if HAVE_EPOLL #include #include static int fpm_event_epoll_init(int max); static int fpm_event_epoll_clean(); static int fpm_event_epoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout); static int fpm_event_epoll_add(struct fpm_event_s *ev); static int fpm_event_epoll_remove(struct fpm_event_s *ev); static struct fpm_event_module_s epoll_module = { .name = "epoll", .support_edge_trigger = 1, .init = fpm_event_epoll_init, .clean = fpm_event_epoll_clean, .wait = fpm_event_epoll_wait, .add = fpm_event_epoll_add, .remove = fpm_event_epoll_remove, }; static struct epoll_event *epollfds = NULL; static int nepollfds = 0; static int epollfd = -1; #endif /* HAVE_EPOLL */ struct fpm_event_module_s *fpm_event_epoll_module() /* {{{ */ { #if HAVE_EPOLL return &epoll_module; #else return NULL; #endif /* HAVE_EPOLL */ } /* }}} */ #if HAVE_EPOLL /* * Init the module */ static int fpm_event_epoll_init(int max) /* {{{ */ { if (max < 1) { return 0; } /* init epoll */ epollfd = epoll_create(max + 1); if (epollfd < 0) { zlog(ZLOG_ERROR, "epoll: unable to initialize"); return -1; } /* allocate fds */ epollfds = malloc(sizeof(struct epoll_event) * max); if (!epollfds) { zlog(ZLOG_ERROR, "epoll: unable to allocate %d events", max); return -1; } memset(epollfds, 0, sizeof(struct epoll_event) * max); /* save max */ nepollfds = max; return 0; } /* }}} */ /* * Clean the module */ static int fpm_event_epoll_clean() /* {{{ */ { /* free epollfds */ if (epollfds) { free(epollfds); epollfds = NULL; } if (epollfd != -1) { close(epollfd); epollfd = -1; } nepollfds = 0; return 0; } /* }}} */ /* * wait for events or timeout */ static int fpm_event_epoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout) /* {{{ */ { int ret, i; /* ensure we have a clean epoolfds before calling epoll_wait() */ memset(epollfds, 0, sizeof(struct epoll_event) * nepollfds); /* wait for inconming event or timeout */ ret = epoll_wait(epollfd, epollfds, nepollfds, timeout); if (ret == -1) { /* trigger error unless signal interrupt */ if (errno != EINTR) { zlog(ZLOG_WARNING, "epoll_wait() returns %d", errno); return -1; } } /* events have been triggered, let's fire them */ for (i = 0; i < ret; i++) { /* do we have a valid ev ptr ? */ if (!epollfds[i].data.ptr) { continue; } /* fire the event */ /* XXX - JIRA EA-???? Ignore EPOLLUP that is causing EBADF on unreadable FD's https://bugs.php.net/bug.php?id=65398 */ if (epollfds[i].events != EPOLLHUP) fpm_event_fire((struct fpm_event_s *)epollfds[i].data.ptr); /* sanity check */ if (fpm_globals.parent_pid != getpid()) { return -2; } } return ret; } /* }}} */ /* * Add a FD to the fd set */ static int fpm_event_epoll_add(struct fpm_event_s *ev) /* {{{ */ { struct epoll_event e; /* fill epoll struct */ e.events = EPOLLIN; e.data.fd = ev->fd; e.data.ptr = (void *)ev; if (ev->flags & FPM_EV_EDGE) { e.events = e.events | EPOLLET; } /* add the event to epoll internal queue */ if (epoll_ctl(epollfd, EPOLL_CTL_ADD, ev->fd, &e) == -1) { zlog(ZLOG_ERROR, "epoll: unable to add fd %d", ev->fd); return -1; } /* mark the event as registered */ ev->index = ev->fd; return 0; } /* }}} */ /* * Remove a FD from the fd set */ static int fpm_event_epoll_remove(struct fpm_event_s *ev) /* {{{ */ { struct epoll_event e; /* fill epoll struct the same way we did in fpm_event_epoll_add() */ e.events = EPOLLIN; e.data.fd = ev->fd; e.data.ptr = (void *)ev; if (ev->flags & FPM_EV_EDGE) { e.events = e.events | EPOLLET; } /* remove the event from epoll internal queue */ if (epoll_ctl(epollfd, EPOLL_CTL_DEL, ev->fd, &e) == -1) { zlog(ZLOG_ERROR, "epoll: unable to remove fd %d", ev->fd); return -1; } /* mark the event as not registered */ ev->index = -1; return 0; } /* }}} */ #endif /* HAVE_EPOLL */ PK!GG%php-5.6.40/sapi/fpm/fpm/events/port.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Jerome Loyet | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef FPM_EVENTS_PORT_H #define FPM_EVENTS_PORT_H #include "../fpm_config.h" #include "../fpm_events.h" struct fpm_event_module_s *fpm_event_port_module(); #endif /* FPM_EVENTS_PORT_H */ PK!S4;;%php-5.6.40/sapi/fpm/fpm/fpm_signals.hnu[ /* $Id: fpm_signals.h,v 1.5 2008/05/24 17:38:47 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_SIGNALS_H #define FPM_SIGNALS_H 1 #include int fpm_signals_init_main(); int fpm_signals_init_child(); int fpm_signals_get_fd(); extern const char *fpm_signal_names[NSIG + 1]; #endif PK!ǵ#php-5.6.40/sapi/fpm/fpm/fpm_trace.cnu[ /* $Id: fpm_trace.c,v 1.1 2008/07/20 20:59:00 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #include "fpm_config.h" #include #include "fpm_trace.h" int fpm_trace_get_strz(char *buf, size_t sz, long addr) /* {{{ */ { int i; long l; char *lc = (char *) &l; if (0 > fpm_trace_get_long(addr, &l)) { return -1; } i = l % SIZEOF_LONG; l -= i; for (addr = l; ; addr += SIZEOF_LONG) { if (0 > fpm_trace_get_long(addr, &l)) { return -1; } for ( ; i < SIZEOF_LONG; i++) { --sz; if (sz && lc[i]) { *buf++ = lc[i]; continue; } *buf = '\0'; return 0; } i = 0; } } /* }}} */ PK!zL_php-5.6.40/sapi/fpm/fpm/zlog.cnu[ /* $Id: zlog.c,v 1.7 2008/05/22 21:08:32 anight Exp $ */ /* (c) 2004-2007 Andrei Nigmatulin */ #include "fpm_config.h" #include #include #include #include #include #include #include #include "php_syslog.h" #include "zlog.h" #include "fpm.h" #define MAX_LINE_LENGTH 1024 static int zlog_fd = -1; static int zlog_level = ZLOG_NOTICE; static int launched = 0; static void (*external_logger)(int, char *, size_t) = NULL; static const char *level_names[] = { [ZLOG_DEBUG] = "DEBUG", [ZLOG_NOTICE] = "NOTICE", [ZLOG_WARNING] = "WARNING", [ZLOG_ERROR] = "ERROR", [ZLOG_ALERT] = "ALERT", }; #ifdef HAVE_SYSLOG_H const int syslog_priorities[] = { [ZLOG_DEBUG] = LOG_DEBUG, [ZLOG_NOTICE] = LOG_NOTICE, [ZLOG_WARNING] = LOG_WARNING, [ZLOG_ERROR] = LOG_ERR, [ZLOG_ALERT] = LOG_ALERT, }; #endif void zlog_set_external_logger(void (*logger)(int, char *, size_t)) /* {{{ */ { external_logger = logger; } /* }}} */ const char *zlog_get_level_name(int log_level) /* {{{ */ { if (log_level < 0) { log_level = zlog_level; } else if (log_level < ZLOG_DEBUG || log_level > ZLOG_ALERT) { return "unknown value"; } return level_names[log_level]; } /* }}} */ void zlog_set_launched(void) { launched = 1; } size_t zlog_print_time(struct timeval *tv, char *timebuf, size_t timebuf_len) /* {{{ */ { struct tm t; size_t len; len = strftime(timebuf, timebuf_len, "[%d-%b-%Y %H:%M:%S", localtime_r((const time_t *) &tv->tv_sec, &t)); if (zlog_level == ZLOG_DEBUG) { len += snprintf(timebuf + len, timebuf_len - len, ".%06d", (int) tv->tv_usec); } len += snprintf(timebuf + len, timebuf_len - len, "] "); return len; } /* }}} */ int zlog_set_fd(int new_fd) /* {{{ */ { int old_fd = zlog_fd; zlog_fd = new_fd; return old_fd; } /* }}} */ int zlog_set_level(int new_value) /* {{{ */ { int old_value = zlog_level; if (new_value < ZLOG_DEBUG || new_value > ZLOG_ALERT) return old_value; zlog_level = new_value; return old_value; } /* }}} */ void zlog_ex(const char *function, int line, int flags, const char *fmt, ...) /* {{{ */ { struct timeval tv; char buf[MAX_LINE_LENGTH]; const size_t buf_size = MAX_LINE_LENGTH; va_list args; size_t len = 0; int truncated = 0; int saved_errno; if (external_logger) { va_start(args, fmt); len = vsnprintf(buf, buf_size, fmt, args); va_end(args); if (len >= buf_size) { memcpy(buf + buf_size - sizeof("..."), "...", sizeof("...") - 1); len = buf_size - 1; } external_logger(flags & ZLOG_LEVEL_MASK, buf, len); len = 0; memset(buf, '\0', buf_size); } if ((flags & ZLOG_LEVEL_MASK) < zlog_level) { return; } saved_errno = errno; #ifdef HAVE_SYSLOG_H if (zlog_fd == ZLOG_SYSLOG /* && !fpm_globals.is_child */) { len = 0; if (zlog_level == ZLOG_DEBUG) { len += snprintf(buf, buf_size, "[%s] %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], function, line); } else { len += snprintf(buf, buf_size, "[%s] ", level_names[flags & ZLOG_LEVEL_MASK]); } } else #endif { if (!fpm_globals.is_child) { gettimeofday(&tv, 0); len = zlog_print_time(&tv, buf, buf_size); } if (zlog_level == ZLOG_DEBUG) { if (!fpm_globals.is_child) { len += snprintf(buf + len, buf_size - len, "%s: pid %d, %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], getpid(), function, line); } else { len += snprintf(buf + len, buf_size - len, "%s: %s(), line %d: ", level_names[flags & ZLOG_LEVEL_MASK], function, line); } } else { len += snprintf(buf + len, buf_size - len, "%s: ", level_names[flags & ZLOG_LEVEL_MASK]); } } if (len > buf_size - 1) { truncated = 1; } if (!truncated) { va_start(args, fmt); len += vsnprintf(buf + len, buf_size - len, fmt, args); va_end(args); if (len >= buf_size) { truncated = 1; } } if (!truncated) { if (flags & ZLOG_HAVE_ERRNO) { len += snprintf(buf + len, buf_size - len, ": %s (%d)", strerror(saved_errno), saved_errno); if (len >= buf_size) { truncated = 1; } } } if (truncated) { memcpy(buf + buf_size - sizeof("..."), "...", sizeof("...") - 1); len = buf_size - 1; } #ifdef HAVE_SYSLOG_H if (zlog_fd == ZLOG_SYSLOG) { buf[len] = '\0'; php_syslog(syslog_priorities[zlog_level], "%s", buf); buf[len++] = '\n'; } else #endif { buf[len++] = '\n'; write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len); } if (zlog_fd != STDERR_FILENO && zlog_fd != -1 && !launched && (flags & ZLOG_LEVEL_MASK) >= ZLOG_NOTICE) { write(STDERR_FILENO, buf, len); } } /* }}} */ PK!u !php-5.6.40/sapi/fpm/fpm/fpm_shm.hnu[ /* $Id: fpm_shm.h,v 1.3 2008/05/24 17:38:47 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_SHM_H #define FPM_SHM_H 1 void *fpm_shm_alloc(size_t size); int fpm_shm_free(void *mem, size_t size); size_t fpm_shm_get_size_allocated(); #endif PK!{H"php-5.6.40/sapi/fpm/fpm/fpm_unix.hnu[ /* $Id: fpm_unix.h,v 1.8 2008/05/25 13:21:13 anight Exp $ */ /* (c) 2007,2008 Andrei Nigmatulin */ #ifndef FPM_UNIX_H #define FPM_UNIX_H 1 #include "fpm_worker_pool.h" int fpm_unix_resolve_socket_premissions(struct fpm_worker_pool_s *wp); int fpm_unix_set_socket_premissions(struct fpm_worker_pool_s *wp, const char *path); int fpm_unix_free_socket_premissions(struct fpm_worker_pool_s *wp); int fpm_unix_init_child(struct fpm_worker_pool_s *wp); int fpm_unix_init_main(); extern size_t fpm_pagesize; #endif PK!Sb?Q?Q-php-5.6.40/sapi/apache2handler/sapi_apache2.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Parts based on Apache 1.3 SAPI module by | | Rasmus Lerdorf and Zeev Suraski | +----------------------------------------------------------------------+ */ /* $Id$ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #include "php.h" #include "php_main.h" #include "php_ini.h" #include "php_variables.h" #include "SAPI.h" #include #include "ext/standard/php_smart_str.h" #ifndef NETWARE #include "ext/standard/php_standard.h" #else #include "ext/standard/basic_functions.h" #endif #include "apr_strings.h" #include "ap_config.h" #include "util_filter.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_log.h" #include "http_main.h" #include "util_script.h" #include "http_core.h" #include "ap_mpm.h" #include "php_apache.h" #ifdef PHP_WIN32 # if _MSC_VER <= 1300 # include "win32/php_strtoi64.h" # endif #endif /* UnixWare and Netware define shutdown to _shutdown, which causes problems later * on when using a structure member named shutdown. Since this source * file does not use the system call shutdown, it is safe to #undef it.K */ #undef shutdown #define PHP_MAGIC_TYPE "application/x-httpd-php" #define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source" #define PHP_SCRIPT "php5-script" /* A way to specify the location of the php.ini dir in an apache directive */ char *apache2_php_ini_path_override = NULL; static int php_apache_sapi_ub_write(const char *str, uint str_length TSRMLS_DC) { request_rec *r; php_struct *ctx; ctx = SG(server_context); r = ctx->r; if (ap_rwrite(str, str_length, r) < 0) { php_handle_aborted_connection(); } return str_length; /* we always consume all the data passed to us. */ } static int php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC) { php_struct *ctx; char *val, *ptr; ctx = SG(server_context); switch (op) { case SAPI_HEADER_DELETE: apr_table_unset(ctx->r->headers_out, sapi_header->header); return 0; case SAPI_HEADER_DELETE_ALL: apr_table_clear(ctx->r->headers_out); return 0; case SAPI_HEADER_ADD: case SAPI_HEADER_REPLACE: val = strchr(sapi_header->header, ':'); if (!val) { return 0; } ptr = val; *val = '\0'; do { val++; } while (*val == ' '); if (!strcasecmp(sapi_header->header, "content-type")) { if (ctx->content_type) { efree(ctx->content_type); } ctx->content_type = estrdup(val); } else if (!strcasecmp(sapi_header->header, "content-length")) { apr_off_t clen = 0; if (APR_SUCCESS != apr_strtoff(&clen, val, (char **) NULL, 10)) { /* We'll fall back to strtol, since that's what we used to * do anyway. */ clen = (apr_off_t) strtol(val, (char **) NULL, 10); } ap_set_content_length(ctx->r, clen); } else if (op == SAPI_HEADER_REPLACE) { apr_table_set(ctx->r->headers_out, sapi_header->header, val); } else { apr_table_add(ctx->r->headers_out, sapi_header->header, val); } *ptr = ':'; return SAPI_HEADER_ADD; default: return 0; } } static int php_apache_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { php_struct *ctx = SG(server_context); const char *sline = SG(sapi_headers).http_status_line; ctx->r->status = SG(sapi_headers).http_response_code; /* httpd requires that r->status_line is set to the first digit of * the status-code: */ if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ') { ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9); ctx->r->proto_num = 1000 + (sline[7]-'0'); if ((sline[7]-'0') == 0) { apr_table_set(ctx->r->subprocess_env, "force-response-1.0", "true"); } } /* call ap_set_content_type only once, else each time we call it, configured output filters for that content type will be added */ if (!ctx->content_type) { ctx->content_type = sapi_get_default_content_type(TSRMLS_C); } ap_set_content_type(ctx->r, apr_pstrdup(ctx->r->pool, ctx->content_type)); efree(ctx->content_type); ctx->content_type = NULL; return SAPI_HEADER_SENT_SUCCESSFULLY; } static int php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) { apr_size_t len, tlen=0; php_struct *ctx = SG(server_context); request_rec *r; apr_bucket_brigade *brigade; r = ctx->r; brigade = ctx->brigade; len = count_bytes; /* * This loop is needed because ap_get_brigade() can return us partial data * which would cause premature termination of request read. Therefor we * need to make sure that if data is available we fill the buffer completely. */ while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) { apr_brigade_flatten(brigade, buf, &len); apr_brigade_cleanup(brigade); tlen += len; if (tlen == count_bytes || !len) { break; } buf += len; len = count_bytes - tlen; } return tlen; } static struct stat* php_apache_sapi_get_stat(TSRMLS_D) { php_struct *ctx = SG(server_context); ctx->finfo.st_uid = ctx->r->finfo.user; ctx->finfo.st_gid = ctx->r->finfo.group; ctx->finfo.st_dev = ctx->r->finfo.device; ctx->finfo.st_ino = ctx->r->finfo.inode; #if defined(NETWARE) && defined(CLIB_STAT_PATCH) ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime); ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime); ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime); #else ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); #endif ctx->finfo.st_size = ctx->r->finfo.size; ctx->finfo.st_nlink = ctx->r->finfo.nlink; return &ctx->finfo; } static char * php_apache_sapi_read_cookies(TSRMLS_D) { php_struct *ctx = SG(server_context); const char *http_cookie; http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); /* The SAPI interface should use 'const char *' */ return (char *) http_cookie; } static char * php_apache_sapi_getenv(char *name, size_t name_len TSRMLS_DC) { php_struct *ctx = SG(server_context); const char *env_var; if (ctx == NULL) { return NULL; } env_var = apr_table_get(ctx->r->subprocess_env, name); return (char *) env_var; } static void php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC) { php_struct *ctx = SG(server_context); const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); char *key, *val; int new_val_len; APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) { val = ""; } if (sapi_module.input_filter(PARSE_SERVER, key, &val, strlen(val), (unsigned int *)&new_val_len TSRMLS_CC)) { php_register_variable_safe(key, val, new_val_len, track_vars_array TSRMLS_CC); } APR_ARRAY_FOREACH_CLOSE() if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), (unsigned int *)&new_val_len TSRMLS_CC)) { php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array TSRMLS_CC); } } static void php_apache_sapi_flush(void *server_context) { php_struct *ctx; request_rec *r; TSRMLS_FETCH(); ctx = server_context; /* If we haven't registered a server_context yet, * then don't bother flushing. */ if (!server_context) { return; } r = ctx->r; sapi_send_headers(TSRMLS_C); r->status = SG(sapi_headers).http_response_code; SG(headers_sent) = 1; if (ap_rflush(r) < 0 || r->connection->aborted) { php_handle_aborted_connection(); } } static void php_apache_sapi_log_message(char *msg TSRMLS_DC) { php_struct *ctx; ctx = SG(server_context); if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */ ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg); } else { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "%s", msg); } } static void php_apache_sapi_log_message_ex(char *msg, request_rec *r TSRMLS_DC) { if (r) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename); } else { php_apache_sapi_log_message(msg TSRMLS_CC); } } static double php_apache_sapi_get_request_time(TSRMLS_D) { php_struct *ctx = SG(server_context); return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; } extern zend_module_entry php_apache_module; static int php_apache2_startup(sapi_module_struct *sapi_module) { if (php_module_startup(sapi_module, &php_apache_module, 1)==FAILURE) { return FAILURE; } return SUCCESS; } static sapi_module_struct apache2_sapi_module = { "apache2handler", "Apache 2.0 Handler", php_apache2_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ NULL, /* activate */ NULL, /* deactivate */ php_apache_sapi_ub_write, /* unbuffered write */ php_apache_sapi_flush, /* flush */ php_apache_sapi_get_stat, /* get uid */ php_apache_sapi_getenv, /* getenv */ php_error, /* error handler */ php_apache_sapi_header_handler, /* header handler */ php_apache_sapi_send_headers, /* send headers handler */ NULL, /* send header handler */ php_apache_sapi_read_post, /* read POST data */ php_apache_sapi_read_cookies, /* read Cookies */ php_apache_sapi_register_variables, php_apache_sapi_log_message, /* Log message */ php_apache_sapi_get_request_time, /* Request Time */ NULL, /* Child Terminate */ STANDARD_SAPI_MODULE_PROPERTIES }; static apr_status_t php_apache_server_shutdown(void *tmp) { apache2_sapi_module.shutdown(&apache2_sapi_module); sapi_shutdown(); #ifdef ZTS tsrm_shutdown(); #endif return APR_SUCCESS; } static apr_status_t php_apache_child_shutdown(void *tmp) { apache2_sapi_module.shutdown(&apache2_sapi_module); #if defined(ZTS) && !defined(PHP_WIN32) tsrm_shutdown(); #endif return APR_SUCCESS; } static void php_apache_add_version(apr_pool_t *p) { TSRMLS_FETCH(); if (PG(expose_php)) { ap_add_version_component(p, "PHP/" PHP_VERSION); } } static int php_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) { #ifndef ZTS int threaded_mpm; ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded_mpm); if(threaded_mpm) { ap_log_error(APLOG_MARK, APLOG_CRIT, 0, 0, "Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP."); return DONE; } #endif /* When this is NULL, apache won't override the hard-coded default * php.ini path setting. */ apache2_php_ini_path_override = NULL; return OK; } static int php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { void *data = NULL; const char *userdata_key = "apache2hook_post_config"; /* Apache will load, unload and then reload a DSO module. This * prevents us from starting PHP until the second load. */ apr_pool_userdata_get(&data, userdata_key, s->process->pool); if (data == NULL) { /* We must use set() here and *not* setn(), otherwise the * static string pointed to by userdata_key will be mapped * to a different location when the DSO is reloaded and the * pointers won't match, causing get() to return NULL when * we expected it to return non-NULL. */ apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, s->process->pool); return OK; } /* Set up our overridden path. */ if (apache2_php_ini_path_override) { apache2_sapi_module.php_ini_path_override = apache2_php_ini_path_override; } #ifdef ZTS tsrm_startup(1, 1, 0, NULL); #endif sapi_startup(&apache2_sapi_module); apache2_sapi_module.startup(&apache2_sapi_module); apr_pool_cleanup_register(pconf, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); php_apache_add_version(pconf); return OK; } static apr_status_t php_server_context_cleanup(void *data_) { void **data = data_; *data = NULL; return APR_SUCCESS; } static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC) { char *content_length; const char *auth; SG(sapi_headers).http_response_code = !r->status ? HTTP_OK : r->status; SG(request_info).content_type = apr_table_get(r->headers_in, "Content-Type"); SG(request_info).query_string = apr_pstrdup(r->pool, r->args); SG(request_info).request_method = r->method; SG(request_info).proto_num = r->proto_num; SG(request_info).request_uri = apr_pstrdup(r->pool, r->uri); SG(request_info).path_translated = apr_pstrdup(r->pool, r->filename); r->no_local_copy = 1; content_length = (char *) apr_table_get(r->headers_in, "Content-Length"); SG(request_info).content_length = (content_length ? atol(content_length) : 0); apr_table_unset(r->headers_out, "Content-Length"); apr_table_unset(r->headers_out, "Last-Modified"); apr_table_unset(r->headers_out, "Expires"); apr_table_unset(r->headers_out, "ETag"); auth = apr_table_get(r->headers_in, "Authorization"); php_handle_auth_data(auth TSRMLS_CC); if (SG(request_info).auth_user == NULL && r->user) { SG(request_info).auth_user = estrdup(r->user); } ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); return php_request_startup(TSRMLS_C); } static void php_apache_request_dtor(request_rec *r TSRMLS_DC) { php_request_shutdown(NULL); } static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC) { if (strcmp(r->protocol, "INCLUDED")) { zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); } else { typedef struct { HashTable config; } php_conf_rec; char *str; uint str_len; php_conf_rec *c = ap_get_module_config(r->per_dir_config, &php5_module); for (zend_hash_internal_pointer_reset(&c->config); zend_hash_get_current_key_ex(&c->config, &str, &str_len, NULL, 0, NULL) == HASH_KEY_IS_STRING; zend_hash_move_forward(&c->config) ) { zend_restore_ini_entry(str, str_len, ZEND_INI_STAGE_SHUTDOWN); } } if (p) { ((php_struct *)SG(server_context))->r = p; } else { apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup); } } static int php_handler(request_rec *r) { php_struct * volatile ctx; void *conf; apr_bucket_brigade * volatile brigade; apr_bucket *bucket; apr_status_t rv; request_rec * volatile parent_req = NULL; TSRMLS_FETCH(); #define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC); conf = ap_get_module_config(r->per_dir_config, &php5_module); /* apply_config() needs r in some cases, so allocate server_context early */ ctx = SG(server_context); if (ctx == NULL || (ctx && ctx->request_processed && !strcmp(r->protocol, "INCLUDED"))) { normal: ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); /* register a cleanup so we clear out the SG(server_context) * after each request. Note: We pass in the pointer to the * server_context in case this is handled by a different thread. */ apr_pool_cleanup_register(r->pool, (void *)&SG(server_context), php_server_context_cleanup, apr_pool_cleanup_null); ctx->r = r; ctx = NULL; /* May look weird to null it here, but it is to catch the right case in the first_try later on */ } else { parent_req = ctx->r; ctx->r = r; } apply_config(conf); if (strcmp(r->handler, PHP_MAGIC_TYPE) && strcmp(r->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(r->handler, PHP_SCRIPT)) { /* Check for xbithack in this case. */ if (!AP2(xbithack) || strcmp(r->handler, "text/html") || !(r->finfo.protection & APR_UEXECUTE)) { PHPAP_INI_OFF; return DECLINED; } } /* Give a 404 if PATH_INFO is used but is explicitly disabled in * the configuration; default behaviour is to accept. */ if (r->used_path_info == AP_REQ_REJECT_PATH_INFO && r->path_info && r->path_info[0]) { PHPAP_INI_OFF; return HTTP_NOT_FOUND; } /* handle situations where user turns the engine off */ if (!AP2(engine)) { PHPAP_INI_OFF; return DECLINED; } if (r->finfo.filetype == 0) { php_apache_sapi_log_message_ex("script '%s' not found or unable to stat", r TSRMLS_CC); PHPAP_INI_OFF; return HTTP_NOT_FOUND; } if (r->finfo.filetype == APR_DIR) { php_apache_sapi_log_message_ex("attempt to invoke directory '%s' as script", r TSRMLS_CC); PHPAP_INI_OFF; return HTTP_FORBIDDEN; } /* Setup the CGI variables if this is the main request */ if (r->main == NULL || /* .. or if the sub-request environment differs from the main-request. */ r->subprocess_env != r->main->subprocess_env ) { /* setup standard CGI variables */ ap_add_common_vars(r); ap_add_cgi_vars(r); } zend_first_try { if (ctx == NULL) { brigade = apr_brigade_create(r->pool, r->connection->bucket_alloc); ctx = SG(server_context); ctx->brigade = brigade; if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { zend_bailout(); } } else { if (!parent_req) { parent_req = ctx->r; } if (parent_req && parent_req->handler && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) { if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) { zend_bailout(); } } /* * check if coming due to ErrorDocument * We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs * during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting * PHP instance to handle the request rather then creating a new one. */ if (parent_req && parent_req->status != HTTP_OK && parent_req->status != 413 && strcmp(r->protocol, "INCLUDED")) { parent_req = NULL; goto normal; } ctx->r = r; brigade = ctx->brigade; } if (AP2(last_modified)) { ap_update_mtime(r, r->finfo.mtime); ap_set_last_modified(r); } /* Determine if we need to parse the file or show the source */ if (strncmp(r->handler, PHP_SOURCE_MAGIC_TYPE, sizeof(PHP_SOURCE_MAGIC_TYPE) - 1) == 0) { zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC); } else { zend_file_handle zfd; zfd.type = ZEND_HANDLE_FILENAME; zfd.filename = (char *) r->filename; zfd.free_filename = 0; zfd.opened_path = NULL; if (!parent_req) { php_execute_script(&zfd TSRMLS_CC); } else { zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &zfd); } apr_table_set(r->notes, "mod_php_memory_usage", apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1 TSRMLS_CC))); } } zend_end_try(); if (!parent_req) { php_apache_request_dtor(r TSRMLS_CC); ctx->request_processed = 1; apr_brigade_cleanup(brigade); bucket = apr_bucket_eos_create(r->connection->bucket_alloc); APR_BRIGADE_INSERT_TAIL(brigade, bucket); rv = ap_pass_brigade(r->output_filters, brigade); if (rv != APR_SUCCESS || r->connection->aborted) { zend_first_try { php_handle_aborted_connection(); } zend_end_try(); } apr_brigade_cleanup(brigade); apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup); } else { ctx->r = parent_req; } return OK; } static void php_apache_child_init(apr_pool_t *pchild, server_rec *s) { apr_pool_cleanup_register(pchild, NULL, php_apache_child_shutdown, apr_pool_cleanup_null); } void php_ap2_register_hook(apr_pool_t *p) { ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_handler(php_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(php_apache_child_init, NULL, NULL, APR_HOOK_MIDDLE); } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!>$)php-5.6.40/sapi/apache2handler/mod_php5.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Sascha Schumann | | Parts based on Apache 1.3 SAPI module by | | Rasmus Lerdorf and Zeev Suraski | +----------------------------------------------------------------------+ */ /* $Id$ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #include "php.h" #include "php_apache.h" AP_MODULE_DECLARE_DATA module php5_module = { STANDARD20_MODULE_STUFF, create_php_config, /* create per-directory config structure */ merge_php_config, /* merge per-directory config structures */ NULL, /* create per-server config structure */ NULL, /* merge per-server config structures */ php_dir_cmds, /* command apr_table_t */ php_ap2_register_hook /* register hooks */ }; /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!|)4jj.php-5.6.40/sapi/apache2handler/apache_config.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ */ /* $Id$ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #include "php.h" #include "php_ini.h" #include "php_apache.h" #include "apr_strings.h" #include "ap_config.h" #include "util_filter.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_log.h" #include "http_main.h" #include "util_script.h" #include "http_core.h" #ifdef PHP_AP_DEBUG #define phpapdebug(a) fprintf a #else #define phpapdebug(a) #endif typedef struct { HashTable config; } php_conf_rec; typedef struct { char *value; size_t value_len; char status; char htaccess; } php_dir_entry; static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status) { php_conf_rec *d = dummy; php_dir_entry e; phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, zend_hash_num_elements(&d->config))); if (!strncasecmp(value, "none", sizeof("none"))) { value = ""; } e.value = apr_pstrdup(cmd->pool, value); e.value_len = strlen(value); e.status = status; e.htaccess = ((cmd->override & (RSRC_CONF|ACCESS_CONF)) == 0); zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL); return NULL; } static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status) { char bool_val[2]; if (!strcasecmp(arg2, "On") || (arg2[0] == '1' && arg2[1] == '\0')) { bool_val[0] = '1'; } else { bool_val[0] = '0'; } bool_val[1] = 0; return real_value_hnd(cmd, dummy, arg1, bool_val, status); } static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_PERDIR); } static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value) { return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM); } static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg) { if (apache2_php_ini_path_override) { return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; } apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg); return NULL; } static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_dir_entry *new_per_dir_entry, zend_hash_key *hash_key, void *pData) { php_dir_entry *orig_per_dir_entry; if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) { return 1; /* does not exist in dest, copy from source */ } if (new_per_dir_entry->status >= orig_per_dir_entry->status) { /* use new entry */ phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", hash_key->arKey, new_per_dir_entry->status, orig_per_dir_entry->status)); return 1; } else { return 0; } } void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) { php_conf_rec *d = base_conf, *e = new_conf, *n = NULL; #if STAS_0 php_dir_entry *pe; php_dir_entry *data; char *str; uint str_len; ulong num_index; #endif n = create_php_config(p, "merge_php_config"); /* copy old config */ zend_hash_copy(&n->config, &d->config, NULL, NULL, sizeof(php_dir_entry)); /* merge new config */ phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n)); zend_hash_merge_ex(&n->config, &e->config, NULL, sizeof(php_dir_entry), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); #if STAS_0 for (zend_hash_internal_pointer_reset(&d->config); zend_hash_get_current_key_ex(&d->config, &str, &str_len, &num_index, 0, NULL) == HASH_KEY_IS_STRING; zend_hash_move_forward(&d->config)) { pe = NULL; zend_hash_get_current_data(&d->config, (void **) &data); if (zend_hash_find(&n->config, str, str_len, (void **) &pe) == SUCCESS) { if (pe->status >= data->status) continue; } phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1)); zend_hash_update(&n->config, str, str_len, data, sizeof(*data), NULL); } #endif return n; } char *get_php_config(void *conf, char *name, size_t name_len) { php_conf_rec *d = conf; php_dir_entry *pe; if (zend_hash_find(&d->config, name, name_len, (void **) &pe) == SUCCESS) { return pe->value; } return ""; } void apply_config(void *dummy) { php_conf_rec *d = dummy; char *str; uint str_len; php_dir_entry *data; for (zend_hash_internal_pointer_reset(&d->config); zend_hash_get_current_key_ex(&d->config, &str, &str_len, NULL, 0, NULL) == HASH_KEY_IS_STRING; zend_hash_move_forward(&d->config)) { if (zend_hash_get_current_data(&d->config, (void **) &data) == SUCCESS) { phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value)); if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, data->htaccess?PHP_INI_STAGE_HTACCESS:PHP_INI_STAGE_ACTIVATE) == FAILURE) { phpapdebug((stderr, "..FAILED\n")); } } } } const command_rec php_dir_cmds[] = { AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "PHP Value Modifier"), AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, "PHP Flag Modifier"), AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Value Modifier (Admin)"), AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"), AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"), {NULL} }; static apr_status_t destroy_php_config(void *data) { php_conf_rec *d = data; phpapdebug((stderr, "Destroying config %p\n", data)); zend_hash_destroy(&d->config); return APR_SUCCESS; } void *create_php_config(apr_pool_t *p, char *dummy) { php_conf_rec *newx = (php_conf_rec *) apr_pcalloc(p, sizeof(*newx)); phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); zend_hash_init(&newx->config, 0, NULL, NULL, 1); apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null); return (void *) newx; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK! m +php-5.6.40/sapi/apache2handler/php_apache.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_APACHE_H #define PHP_APACHE_H #include "httpd.h" #include "http_config.h" #include "http_core.h" /* Declare this so we can get to it from outside the sapi_apache2.c file */ extern module AP_MODULE_DECLARE_DATA php5_module; /* A way to specify the location of the php.ini dir in an apache directive */ extern char *apache2_php_ini_path_override; /* The server_context used by PHP */ typedef struct php_struct { int state; request_rec *r; apr_bucket_brigade *brigade; /* stat structure of the current file */ #if defined(NETWARE) && defined(CLIB_STAT_PATCH) struct stat_libc finfo; #else struct stat finfo; #endif /* Whether or not we've processed PHP in the output filters yet. */ int request_processed; /* final content type */ char *content_type; } php_struct; void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf); void *create_php_config(apr_pool_t *p, char *dummy); char *get_php_config(void *conf, char *name, size_t name_len); void apply_config(void *); extern const command_rec php_dir_cmds[]; void php_ap2_register_hook(apr_pool_t *p); #define APR_ARRAY_FOREACH_OPEN(arr, key, val) \ { \ apr_table_entry_t *elts; \ int i; \ elts = (apr_table_entry_t *) arr->elts; \ for (i = 0; i < arr->nelts; i++) { \ key = elts[i].key; \ val = elts[i].val; #define APR_ARRAY_FOREACH_CLOSE() }} typedef struct { long engine; long xbithack; long last_modified; } php_apache2_info_struct; extern zend_module_entry apache2_module_entry; #ifdef ZTS extern int php_apache2_info_id; #define AP2(v) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v) #else extern php_apache2_info_struct php_apache2_info; #define AP2(v) (php_apache2_info.v) #endif /* fix for gcc4 visibility patch */ #ifndef PHP_WIN32 # undef AP_MODULE_DECLARE_DATA # define AP_MODULE_DECLARE_DATA PHPAPI #endif #endif /* PHP_APACHE_H */ PK!6;;.php-5.6.40/sapi/apache2handler/php_functions.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sascha Schumann | +----------------------------------------------------------------------+ */ /* $Id$ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS #include "php.h" #include "ext/standard/php_smart_str.h" #include "ext/standard/info.h" #include "ext/standard/head.h" #include "php_ini.h" #include "SAPI.h" #define CORE_PRIVATE #include "apr_strings.h" #include "apr_time.h" #include "ap_config.h" #include "util_filter.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_log.h" #include "http_main.h" #include "util_script.h" #include "http_core.h" #include "ap_mpm.h" #if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE) #include "unixd.h" #endif #include "php_apache.h" #ifdef ZTS int php_apache2_info_id; #else php_apache2_info_struct php_apache2_info; #endif #define SECTION(name) PUTS("

" name "

\n") static request_rec *php_apache_lookup_uri(char *filename TSRMLS_DC) { php_struct *ctx = SG(server_context); if (!filename || !ctx || !ctx->r) { return NULL; } return ap_sub_req_lookup_uri(filename, ctx->r, ctx->r->output_filters); } /* {{{ proto bool virtual(string uri) Perform an apache sub-request */ PHP_FUNCTION(virtual) { char *filename; int filename_len; request_rec *rr; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { return; } if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); RETURN_FALSE; } if (rr->status != HTTP_OK) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } /* Flush everything. */ php_output_end_all(TSRMLS_C); php_header(TSRMLS_C); /* Ensure that the ap_r* layer for the main request is flushed, to * work around http://issues.apache.org/bugzilla/show_bug.cgi?id=17629 */ ap_rflush(rr->main); if (ap_run_sub_req(rr)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } ap_destroy_sub_req(rr); RETURN_TRUE; } /* }}} */ #define ADD_LONG(name) \ add_property_long(return_value, #name, rr->name) #define ADD_TIME(name) \ add_property_long(return_value, #name, apr_time_sec(rr->name)); #define ADD_STRING(name) \ if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1) PHP_FUNCTION(apache_lookup_uri) { request_rec *rr; char *filename; int filename_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { return; } if (!(rr = php_apache_lookup_uri(filename TSRMLS_CC))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename); RETURN_FALSE; } if (rr->status == HTTP_OK) { object_init(return_value); ADD_LONG(status); ADD_STRING(the_request); ADD_STRING(status_line); ADD_STRING(method); ADD_TIME(mtime); ADD_LONG(clength); #if MODULE_MAGIC_NUMBER < 20020506 ADD_STRING(boundary); #endif ADD_STRING(range); ADD_LONG(chunked); ADD_STRING(content_type); ADD_STRING(handler); ADD_LONG(no_cache); ADD_LONG(no_local_copy); ADD_STRING(unparsed_uri); ADD_STRING(uri); ADD_STRING(filename); ADD_STRING(path_info); ADD_STRING(args); ADD_LONG(allowed); ADD_LONG(sent_bodyct); ADD_LONG(bytes_sent); ADD_LONG(mtime); ADD_TIME(request_time); ap_destroy_sub_req(rr); return; } php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename); ap_destroy_sub_req(rr); RETURN_FALSE; } /* {{{ proto array getallheaders(void) Fetch all HTTP request headers */ PHP_FUNCTION(apache_request_headers) { php_struct *ctx; const apr_array_header_t *arr; char *key, *val; if (zend_parse_parameters_none() == FAILURE) { return; } array_init(return_value); ctx = SG(server_context); arr = apr_table_elts(ctx->r->headers_in); APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) val = ""; add_assoc_string(return_value, key, val, 1); APR_ARRAY_FOREACH_CLOSE() } /* }}} */ /* {{{ proto array apache_response_headers(void) Fetch all HTTP response headers */ PHP_FUNCTION(apache_response_headers) { php_struct *ctx; const apr_array_header_t *arr; char *key, *val; if (zend_parse_parameters_none() == FAILURE) { return; } array_init(return_value); ctx = SG(server_context); arr = apr_table_elts(ctx->r->headers_out); APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) val = ""; add_assoc_string(return_value, key, val, 1); APR_ARRAY_FOREACH_CLOSE() } /* }}} */ /* {{{ proto string apache_note(string note_name [, string note_value]) Get and set Apache request notes */ PHP_FUNCTION(apache_note) { php_struct *ctx; char *note_name, *note_val = NULL; int note_name_len, note_val_len; char *old_note_val=NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", ¬e_name, ¬e_name_len, ¬e_val, ¬e_val_len) == FAILURE) { return; } ctx = SG(server_context); old_note_val = (char *) apr_table_get(ctx->r->notes, note_name); if (note_val) { apr_table_set(ctx->r->notes, note_name, note_val); } if (old_note_val) { RETURN_STRING(old_note_val, 1); } RETURN_FALSE; } /* }}} */ /* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top]) Set an Apache subprocess_env variable */ /* * XXX this doesn't look right. shouldn't it be the parent ?*/ PHP_FUNCTION(apache_setenv) { php_struct *ctx; char *variable=NULL, *string_val=NULL; int variable_len, string_val_len; zend_bool walk_to_top = 0; int arg_count = ZEND_NUM_ARGS(); request_rec *r; if (zend_parse_parameters(arg_count TSRMLS_CC, "ss|b", &variable, &variable_len, &string_val, &string_val_len, &walk_to_top) == FAILURE) { return; } ctx = SG(server_context); r = ctx->r; if (arg_count == 3) { if (walk_to_top) { while(r->prev) { r = r->prev; } } } apr_table_set(r->subprocess_env, variable, string_val); RETURN_TRUE; } /* }}} */ /* {{{ proto bool apache_getenv(string variable [, bool walk_to_top]) Get an Apache subprocess_env variable */ /* * XXX: shouldn't this be the parent not the 'prev' */ PHP_FUNCTION(apache_getenv) { php_struct *ctx; char *variable=NULL; int variable_len; zend_bool walk_to_top = 0; int arg_count = ZEND_NUM_ARGS(); char *env_val=NULL; request_rec *r; if (zend_parse_parameters(arg_count TSRMLS_CC, "s|b", &variable, &variable_len, &walk_to_top) == FAILURE) { return; } ctx = SG(server_context); r = ctx->r; if (arg_count == 2) { if (walk_to_top) { while(r->prev) { r = r->prev; } } } env_val = (char*) apr_table_get(r->subprocess_env, variable); if (env_val != NULL) { RETURN_STRING(env_val, 1); } RETURN_FALSE; } /* }}} */ static char *php_apache_get_version() { #if MODULE_MAGIC_NUMBER_MAJOR >= 20060905 return (char *) ap_get_server_banner(); #else return (char *) ap_get_server_version(); #endif } /* {{{ proto string apache_get_version(void) Fetch Apache version */ PHP_FUNCTION(apache_get_version) { char *apv = php_apache_get_version(); if (apv && *apv) { RETURN_STRING(apv, 1); } else { RETURN_FALSE; } } /* }}} */ /* {{{ proto array apache_get_modules(void) Get a list of loaded Apache modules */ PHP_FUNCTION(apache_get_modules) { int n; char *p; array_init(return_value); for (n = 0; ap_loaded_modules[n]; ++n) { char *s = (char *) ap_loaded_modules[n]->name; if ((p = strchr(s, '.'))) { add_next_index_stringl(return_value, s, (p - s), 1); } else { add_next_index_string(return_value, s, 1); } } } /* }}} */ PHP_MINFO_FUNCTION(apache) { char *apv = php_apache_get_version(); smart_str tmp1 = {0}; char tmp[1024]; int n, max_requests; char *p; server_rec *serv = ((php_struct *) SG(server_context))->r->server; #if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE) #if MODULE_MAGIC_NUMBER_MAJOR >= 20081201 AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config; #else AP_DECLARE_DATA extern unixd_config_rec unixd_config; #endif #endif for (n = 0; ap_loaded_modules[n]; ++n) { char *s = (char *) ap_loaded_modules[n]->name; if ((p = strchr(s, '.'))) { smart_str_appendl(&tmp1, s, (p - s)); } else { smart_str_appends(&tmp1, s); } smart_str_appendc(&tmp1, ' '); } if ((tmp1.len - 1) >= 0) { tmp1.c[tmp1.len - 1] = '\0'; } php_info_print_table_start(); if (apv && *apv) { php_info_print_table_row(2, "Apache Version", apv); } snprintf(tmp, sizeof(tmp), "%d", MODULE_MAGIC_NUMBER); php_info_print_table_row(2, "Apache API Version", tmp); if (serv->server_admin && *(serv->server_admin)) { php_info_print_table_row(2, "Server Administrator", serv->server_admin); } snprintf(tmp, sizeof(tmp), "%s:%u", serv->server_hostname, serv->port); php_info_print_table_row(2, "Hostname:Port", tmp); #if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE) #if MODULE_MAGIC_NUMBER_MAJOR >= 20081201 snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id); #else snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id); #endif php_info_print_table_row(2, "User/Group", tmp); #endif ap_mpm_query(AP_MPMQ_MAX_REQUESTS_DAEMON, &max_requests); snprintf(tmp, sizeof(tmp), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests, (serv->keep_alive ? "on":"off"), serv->keep_alive_max); php_info_print_table_row(2, "Max Requests", tmp); apr_snprintf(tmp, sizeof tmp, "Connection: %" APR_TIME_T_FMT " - Keep-Alive: %" APR_TIME_T_FMT, apr_time_sec(serv->timeout), apr_time_sec(serv->keep_alive_timeout)); php_info_print_table_row(2, "Timeouts", tmp); php_info_print_table_row(2, "Virtual Server", (serv->is_virtual ? "Yes" : "No")); php_info_print_table_row(2, "Server Root", ap_server_root); php_info_print_table_row(2, "Loaded Modules", tmp1.c); smart_str_free(&tmp1); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); { const apr_array_header_t *arr = apr_table_elts(((php_struct *) SG(server_context))->r->subprocess_env); char *key, *val; SECTION("Apache Environment"); php_info_print_table_start(); php_info_print_table_header(2, "Variable", "Value"); APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) { val = ""; } php_info_print_table_row(2, key, val); APR_ARRAY_FOREACH_CLOSE() php_info_print_table_end(); SECTION("HTTP Headers Information"); php_info_print_table_start(); php_info_print_table_colspan_header(2, "HTTP Request Headers"); php_info_print_table_row(2, "HTTP Request", ((php_struct *) SG(server_context))->r->the_request); arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_in); APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) { val = ""; } php_info_print_table_row(2, key, val); APR_ARRAY_FOREACH_CLOSE() php_info_print_table_colspan_header(2, "HTTP Response Headers"); arr = apr_table_elts(((php_struct *) SG(server_context))->r->headers_out); APR_ARRAY_FOREACH_OPEN(arr, key, val) if (!val) { val = ""; } php_info_print_table_row(2, key, val); APR_ARRAY_FOREACH_CLOSE() php_info_print_table_end(); } } /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_apache2handler_lookup_uri, 0, 0, 1) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apache2handler_virtual, 0, 0, 1) ZEND_ARG_INFO(0, uri) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_apache2handler_response_headers, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_apache2handler_getallheaders, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apache2handler_note, 0, 0, 1) ZEND_ARG_INFO(0, note_name) ZEND_ARG_INFO(0, note_value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apache2handler_setenv, 0, 0, 2) ZEND_ARG_INFO(0, variable) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, walk_to_top) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apache2handler_getenv, 0, 0, 1) ZEND_ARG_INFO(0, variable) ZEND_ARG_INFO(0, walk_to_top) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_apache2handler_get_version, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_apache2handler_get_modules, 0) ZEND_END_ARG_INFO() /* }}} */ static const zend_function_entry apache_functions[] = { PHP_FE(apache_lookup_uri, arginfo_apache2handler_lookup_uri) PHP_FE(virtual, arginfo_apache2handler_virtual) PHP_FE(apache_request_headers, arginfo_apache2handler_getallheaders) PHP_FE(apache_response_headers, arginfo_apache2handler_response_headers) PHP_FE(apache_setenv, arginfo_apache2handler_setenv) PHP_FE(apache_getenv, arginfo_apache2handler_getenv) PHP_FE(apache_note, arginfo_apache2handler_note) PHP_FE(apache_get_version, arginfo_apache2handler_get_version) PHP_FE(apache_get_modules, arginfo_apache2handler_get_modules) PHP_FALIAS(getallheaders, apache_request_headers, arginfo_apache2handler_getallheaders) {NULL, NULL, NULL} }; PHP_INI_BEGIN() STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateLong, xbithack, php_apache2_info_struct, php_apache2_info) STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateLong, engine, php_apache2_info_struct, php_apache2_info) STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateLong, last_modified, php_apache2_info_struct, php_apache2_info) PHP_INI_END() static PHP_MINIT_FUNCTION(apache) { #ifdef ZTS ts_allocate_id(&php_apache2_info_id, sizeof(php_apache2_info_struct), (ts_allocate_ctor) NULL, NULL); #endif REGISTER_INI_ENTRIES(); return SUCCESS; } static PHP_MSHUTDOWN_FUNCTION(apache) { UNREGISTER_INI_ENTRIES(); return SUCCESS; } zend_module_entry php_apache_module = { STANDARD_MODULE_HEADER, "apache2handler", apache_functions, PHP_MINIT(apache), PHP_MSHUTDOWN(apache), NULL, NULL, PHP_MINFO(apache), NULL, STANDARD_MODULE_PROPERTIES }; /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!W q,,$php-5.6.40/sapi/litespeed/lsapidef.hnu[/* Copyright (c) 2002-2018, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Lite Speed Technologies Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _LSAPIDEF_H_ #define _LSAPIDEF_H_ #include #if defined (c_plusplus) || defined (__cplusplus) extern "C" { #endif enum { H_ACCEPT = 0, H_ACC_CHARSET, H_ACC_ENCODING, H_ACC_LANG, H_AUTHORIZATION, H_CONNECTION, H_CONTENT_TYPE, H_CONTENT_LENGTH, H_COOKIE, H_COOKIE2, H_HOST, H_PRAGMA, H_REFERER, H_USERAGENT, H_CACHE_CTRL, H_IF_MODIFIED_SINCE, H_IF_MATCH, H_IF_NO_MATCH, H_IF_RANGE, H_IF_UNMOD_SINCE, H_KEEP_ALIVE, H_RANGE, H_X_FORWARDED_FOR, H_VIA, H_TRANSFER_ENCODING }; #define LSAPI_SOCK_FILENO 0 #define LSAPI_VERSION_B0 'L' #define LSAPI_VERSION_B1 'S' /* Values for m_flag in lsapi_packet_header */ #define LSAPI_ENDIAN_LITTLE 0 #define LSAPI_ENDIAN_BIG 1 #define LSAPI_ENDIAN_BIT 1 #if defined(__i386__)||defined( __x86_64 )||defined( __x86_64__ ) #define LSAPI_ENDIAN LSAPI_ENDIAN_LITTLE #else #define LSAPI_ENDIAN LSAPI_ENDIAN_BIG #endif /* Values for m_type in lsapi_packet_header */ #define LSAPI_BEGIN_REQUEST 1 #define LSAPI_ABORT_REQUEST 2 #define LSAPI_RESP_HEADER 3 #define LSAPI_RESP_STREAM 4 #define LSAPI_RESP_END 5 #define LSAPI_STDERR_STREAM 6 #define LSAPI_REQ_RECEIVED 7 #define LSAPI_CONN_CLOSE 8 #define LSAPI_INTERNAL_ERROR 9 #define LSAPI_MAX_HEADER_LEN 65535 #define LSAPI_MAX_DATA_PACKET_LEN 16384 #define LSAPI_RESP_HTTP_HEADER_MAX 32768 #define LSAPI_PACKET_HEADER_LEN 8 struct lsapi_packet_header { char m_versionB0; /* LSAPI protocol version */ char m_versionB1; char m_type; char m_flag; union { int32_t m_iLen; /* include this header */ char m_bytes[4]; }m_packetLen; }; /* LSAPI request header packet 1. struct lsapi_req_header 2. struct lsapi_http_header_index 3. lsapi_header_offset * unknownHeaders 4. org http request header 5. request body if available */ struct lsapi_req_header { struct lsapi_packet_header m_pktHeader; int32_t m_httpHeaderLen; int32_t m_reqBodyLen; int32_t m_scriptFileOff; /* path to the script file. */ int32_t m_scriptNameOff; /* decrypted URI, without pathinfo, */ int32_t m_queryStringOff; /* Query string inside env */ int32_t m_requestMethodOff; int32_t m_cntUnknownHeaders; int32_t m_cntEnv; int32_t m_cntSpecialEnv; } ; struct lsapi_http_header_index { uint16_t m_headerLen[H_TRANSFER_ENCODING+1]; int32_t m_headerOff[H_TRANSFER_ENCODING+1]; } ; struct lsapi_header_offset { int32_t nameOff; int32_t nameLen; int32_t valueOff; int32_t valueLen; } ; struct lsapi_resp_info { int32_t m_cntHeaders; int32_t m_status; }; struct lsapi_resp_header { struct lsapi_packet_header m_pktHeader; struct lsapi_resp_info m_respInfo; }; #if defined (c_plusplus) || defined (__cplusplus) } #endif #endif PK!Y//$php-5.6.40/sapi/litespeed/lsapilib.hnu[/* Copyright (c) 2002-2018, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Lite Speed Technologies Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _LSAPILIB_H_ #define _LSAPILIB_H_ #if defined (c_plusplus) || defined (__cplusplus) extern "C" { #endif #include "lsapidef.h" #include #include #include struct LSAPI_key_value_pair { char * pKey; char * pValue; int keyLen; int valLen; }; struct lsapi_child_status; #define LSAPI_MAX_RESP_HEADERS 1000 typedef struct lsapi_request { int m_fdListen; int m_fd; long m_lLastActive; long m_lReqBegin; char * m_pReqBuf; int m_reqBufSize; char * m_pRespBuf; char * m_pRespBufEnd; char * m_pRespBufPos; char * m_pRespHeaderBuf; char * m_pRespHeaderBufEnd; char * m_pRespHeaderBufPos; struct lsapi_child_status * child_status; struct iovec * m_pIovec; struct iovec * m_pIovecEnd; struct iovec * m_pIovecCur; struct iovec * m_pIovecToWrite; struct lsapi_packet_header * m_respPktHeaderEnd; struct lsapi_req_header * m_pHeader; struct LSAPI_key_value_pair * m_pEnvList; struct LSAPI_key_value_pair * m_pSpecialEnvList; int m_envListSize; int m_specialEnvListSize; struct lsapi_http_header_index * m_pHeaderIndex; struct lsapi_header_offset * m_pUnknownHeader; char * m_pScriptFile; char * m_pScriptName; char * m_pQueryString; char * m_pHttpHeader; char * m_pRequestMethod; int m_totalLen; int m_reqState; off_t m_reqBodyLen; off_t m_reqBodyRead; int m_bufProcessed; int m_bufRead; struct lsapi_packet_header m_respPktHeader[5]; struct lsapi_resp_header m_respHeader; short m_respHeaderLen[LSAPI_MAX_RESP_HEADERS]; void * m_pAppData; }LSAPI_Request; extern LSAPI_Request g_req; /* return: >0 continue, ==0 stop, -1 failed */ typedef int (*LSAPI_CB_EnvHandler )( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ); int LSAPI_Init(void); void LSAPI_Stop(void); int LSAPI_Is_Listen_r( LSAPI_Request * pReq); int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ); int LSAPI_Accept_r( LSAPI_Request * pReq ); void LSAPI_Reset_r( LSAPI_Request * pReq ); int LSAPI_Finish_r( LSAPI_Request * pReq ); int LSAPI_Release_r( LSAPI_Request * pReq ); char * LSAPI_GetHeader_r( LSAPI_Request * pReq, int headerIndex ); int LSAPI_ForeachHeader_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ); int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ); int LSAPI_ForeachEnv_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ); int LSAPI_ForeachSpecialEnv_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ); char * LSAPI_GetEnv_r( LSAPI_Request * pReq, const char * name ); ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t len ); int LSAPI_ReqBodyGetChar_r( LSAPI_Request * pReq ); int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen, int *getLF ); int LSAPI_FinalizeRespHeaders_r( LSAPI_Request * pReq ); ssize_t LSAPI_Write_r( LSAPI_Request * pReq, const char * pBuf, size_t len ); ssize_t LSAPI_sendfile_r( LSAPI_Request * pReq, int fdIn, off_t* off, size_t size ); ssize_t LSAPI_Write_Stderr_r( LSAPI_Request * pReq, const char * pBuf, size_t len ); int LSAPI_Flush_r( LSAPI_Request * pReq ); int LSAPI_AppendRespHeader_r( LSAPI_Request * pReq, const char * pBuf, int len ); int LSAPI_AppendRespHeader2_r( LSAPI_Request * pReq, const char * pHeaderName, const char * pHeaderValue ); int LSAPI_ErrResponse_r( LSAPI_Request * pReq, int code, const char ** pRespHeaders, const char * pBody, int bodyLen ); static inline int LSAPI_SetRespStatus_r( LSAPI_Request * pReq, int code ) { if ( !pReq ) return -1; pReq->m_respHeader.m_respInfo.m_status = code; return 0; } static inline int LSAPI_SetAppData_r( LSAPI_Request * pReq, void * data ) { if ( !pReq ) return -1; pReq->m_pAppData = data; return 0; } static inline void * LSAPI_GetAppData_r( LSAPI_Request * pReq ) { if ( !pReq ) return NULL; return pReq->m_pAppData; } static inline char * LSAPI_GetQueryString_r( LSAPI_Request * pReq ) { if ( pReq ) return pReq->m_pQueryString; return NULL; } static inline char * LSAPI_GetScriptFileName_r( LSAPI_Request * pReq ) { if ( pReq ) return pReq->m_pScriptFile; return NULL; } static inline char * LSAPI_GetScriptName_r( LSAPI_Request * pReq ) { if ( pReq ) return pReq->m_pScriptName; return NULL; } static inline char * LSAPI_GetRequestMethod_r( LSAPI_Request * pReq) { if ( pReq ) return pReq->m_pRequestMethod; return NULL; } static inline off_t LSAPI_GetReqBodyLen_r( LSAPI_Request * pReq ) { if ( pReq ) return pReq->m_reqBodyLen; return -1; } static inline off_t LSAPI_GetReqBodyRemain_r( LSAPI_Request * pReq ) { if ( pReq ) return pReq->m_reqBodyLen - pReq->m_reqBodyRead; return -1; } int LSAPI_End_Response_r(LSAPI_Request * pReq); int LSAPI_Is_Listen(void); static inline int LSAPI_Accept( void ) { return LSAPI_Accept_r( &g_req ); } static inline int LSAPI_Finish(void) { return LSAPI_Finish_r( &g_req ); } static inline char * LSAPI_GetHeader( int headerIndex ) { return LSAPI_GetHeader_r( &g_req, headerIndex ); } static inline int LSAPI_ForeachHeader( LSAPI_CB_EnvHandler fn, void * arg ) { return LSAPI_ForeachHeader_r( &g_req, fn, arg ); } static inline int LSAPI_ForeachOrgHeader( LSAPI_CB_EnvHandler fn, void * arg ) { return LSAPI_ForeachOrgHeader_r( &g_req, fn, arg ); } static inline int LSAPI_ForeachEnv( LSAPI_CB_EnvHandler fn, void * arg ) { return LSAPI_ForeachEnv_r( &g_req, fn, arg ); } static inline int LSAPI_ForeachSpecialEnv( LSAPI_CB_EnvHandler fn, void * arg ) { return LSAPI_ForeachSpecialEnv_r( &g_req, fn, arg ); } static inline char * LSAPI_GetEnv( const char * name ) { return LSAPI_GetEnv_r( &g_req, name ); } static inline char * LSAPI_GetQueryString(void) { return LSAPI_GetQueryString_r( &g_req ); } static inline char * LSAPI_GetScriptFileName(void) { return LSAPI_GetScriptFileName_r( &g_req ); } static inline char * LSAPI_GetScriptName(void) { return LSAPI_GetScriptName_r( &g_req ); } static inline char * LSAPI_GetRequestMethod(void) { return LSAPI_GetRequestMethod_r( &g_req ); } static inline off_t LSAPI_GetReqBodyLen(void) { return LSAPI_GetReqBodyLen_r( &g_req ); } static inline off_t LSAPI_GetReqBodyRemain(void) { return LSAPI_GetReqBodyRemain_r( &g_req ); } static inline ssize_t LSAPI_ReadReqBody( char * pBuf, size_t len ) { return LSAPI_ReadReqBody_r( &g_req, pBuf, len ); } static inline int LSAPI_ReqBodyGetChar(void) { return LSAPI_ReqBodyGetChar_r( &g_req ); } static inline int LSAPI_ReqBodyGetLine( char * pBuf, int len, int *getLF ) { return LSAPI_ReqBodyGetLine_r( &g_req, pBuf, len, getLF ); } static inline int LSAPI_FinalizeRespHeaders(void) { return LSAPI_FinalizeRespHeaders_r( &g_req ); } static inline ssize_t LSAPI_Write( const char * pBuf, ssize_t len ) { return LSAPI_Write_r( &g_req, pBuf, len ); } static inline ssize_t LSAPI_sendfile( int fdIn, off_t* off, size_t size ) { return LSAPI_sendfile_r(&g_req, fdIn, off, size ); } static inline ssize_t LSAPI_Write_Stderr( const char * pBuf, ssize_t len ) { return LSAPI_Write_Stderr_r( &g_req, pBuf, len ); } static inline int LSAPI_Flush(void) { return LSAPI_Flush_r( &g_req ); } static inline int LSAPI_AppendRespHeader( char * pBuf, int len ) { return LSAPI_AppendRespHeader_r( &g_req, pBuf, len ); } static inline int LSAPI_SetRespStatus( int code ) { return LSAPI_SetRespStatus_r( &g_req, code ); } static inline int LSAPI_ErrResponse( int code, const char ** pRespHeaders, const char * pBody, int bodyLen ) { return LSAPI_ErrResponse_r( &g_req, code, pRespHeaders, pBody, bodyLen ); } static inline int LSAPI_End_Response(void) { return LSAPI_End_Response_r( &g_req ); } int LSAPI_IsRunning(void); int LSAPI_CreateListenSock( const char * pBind, int backlog ); typedef int (*fn_select_t)( int, fd_set *, fd_set *, fd_set *, struct timeval * ); int LSAPI_Init_Prefork_Server( int max_children, fn_select_t fp, int avoidFork ); void LSAPI_Set_Server_fd( int fd ); int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ); void LSAPI_No_Check_ppid(void); void LSAPI_Set_Max_Reqs( int reqs ); void LSAPI_Set_Max_Idle( int secs ); void LSAPI_Set_Max_Children( int maxChildren ); void LSAPI_Set_Max_Idle_Children( int maxIdleChld ); void LSAPI_Set_Server_Max_Idle_Secs( int serverMaxIdle ); void LSAPI_Set_Max_Process_Time( int secs ); int LSAPI_Init_Env_Parameters( fn_select_t fp ); void LSAPI_Set_Slow_Req_Msecs( int msecs ); int LSAPI_Get_Slow_Req_Msecs(void); int LSAPI_is_suEXEC_Daemon(void); int LSAPI_Set_Restored_Parent_Pid(int pid); typedef void (*LSAPI_On_Timer_pf)(int *forked_child_pid); void LSAPI_Register_Pgrp_Timer_Callback(LSAPI_On_Timer_pf); int LSAPI_Inc_Req_Processed(int cnt); int LSAPI_Accept_Before_Fork(LSAPI_Request * pReq); int LSAPI_Postfork_Child(LSAPI_Request * pReq); int LSAPI_Postfork_Parent(LSAPI_Request * pReq); #define LSAPI_LOG_LEVEL_BITS 0xff #define LSAPI_LOG_FLAG_NONE 0 #define LSAPI_LOG_FLAG_DEBUG 1 #define LSAPI_LOG_FLAG_INFO 2 #define LSAPI_LOG_FLAG_NOTICE 3 #define LSAPI_LOG_FLAG_WARN 4 #define LSAPI_LOG_FLAG_ERROR 5 #define LSAPI_LOG_FLAG_CRIT 6 #define LSAPI_LOG_FLAG_FATAL 7 #define LSAPI_LOG_TIMESTAMP_BITS (0xff00) #define LSAPI_LOG_TIMESTAMP_FULL (0x100) #define LSAPI_LOG_TIMESTAMP_HMS (0x200) #define LSAPI_LOG_TIMESTAMP_STDERR (0x400) #define LSAPI_LOG_PID (0x10000) void LSAPI_Log(int flag, const char * fmt, ...) #if __GNUC__ __attribute__((format(printf, 2, 3))) #endif ; #if defined (c_plusplus) || defined (__cplusplus) } #endif #endif PK!=\R\R"php-5.6.40/sapi/litespeed/lscriu.cnu[/* Copyright (c) 2002-2018, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Lite Speed Technologies Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define HAVE_MSGHDR_MSG_CONTROL #include "lsapilib.h" #include #if HAVE_STDLIB_H #include #endif #if HAVE_UNISTD_H #include #endif #include #include #if HAVE_SYS_TYPES_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lscriu.h" #define LSCRIU_PATH 256 // Begin CRIU inclusion //CRIU inclusion static int s_initial_start_reqs = 0; static int s_requests_count = 0; static int s_restored = 0; static int (*s_lscapi_dump_me)(void) = NULL; static int (*s_lscapi_prepare_me)(void) = NULL; static int s_native = 0; static int s_tried_checkpoint = 0; static int s_fd_native = -1; static char *s_criu_image_path = NULL; static int s_pid = 0; typedef enum { CRIU_GCOUNTER_SHM, CRIU_GCOUNTER_SIG, CRIU_GCOUNTER_PIPE } GlobalCounterType_t; static GlobalCounterType_t s_global_counter_type = CRIU_GCOUNTER_SHM; #ifndef sighandler_t typedef void (*sighandler_t)(int); #endif void lsapi_perror( const char * pMessage, int err_no ); void LSAPI_reset_server_state( void ); int LSAPI_Get_ppid(void); #ifdef LSAPILIB_DEBUG_CRIU static int s_criu_debug = 0; #define lscriu_dbg(...) \ do { if (s_criu_debug) fprintf(stderr, __VA_ARGS__); } while(0) #else #define lscriu_dbg(...) #endif #define lscriu_err(...) fprintf(stderr, __VA_ARGS__) #define SUN_PATH_MAX (sizeof(((struct sockaddr_un *)NULL)->sun_path)) typedef struct { pid_t m_iPidToDump; char m_chImageDirectory[1024]; char m_chSocketDir[SUN_PATH_MAX]; char m_chServiceAddress[SUN_PATH_MAX]; } criu_native_dump_t; typedef struct { int m_iDumpResult; char m_chDumpResponseMessage[1024]; } criu_native_dump_response_t; typedef sem_t * (*psem_open_t) (const char *__name, int __oflag, ...); typedef int (*psem_post_t) (sem_t *__sem); typedef int (*psem_close_t) (sem_t *__sem); psem_open_t psem_open = NULL; psem_post_t psem_post = NULL; psem_close_t psem_close = NULL; static void lsapi_criu_signal(int signo, sighandler_t handler) { struct sigaction sa; sigaction(signo, NULL, &sa); if (sa.sa_handler == SIG_DFL) { sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = handler; sigaction(signo, &sa, NULL); } } static void lsapi_siguser2(int sig) { // child requests counter for master process ++s_requests_count; } static void LSCRIU_Set_Initial_Start_Reqs(int reqs) { s_initial_start_reqs = reqs; } static void LSCRIU_Set_Global_Counter_Type(GlobalCounterType_t tp) { if ((tp == CRIU_GCOUNTER_SHM) || (tp == CRIU_GCOUNTER_SIG) || (tp == CRIU_GCOUNTER_PIPE)) { s_global_counter_type = tp; } else { s_global_counter_type = CRIU_GCOUNTER_SHM; } } static int LSCRIU_Get_Global_Counter_Type(void) { return s_global_counter_type; } static int LSCRIU_Init_Global_Counter(int value) { if (LSCRIU_Get_Global_Counter_Type() != CRIU_GCOUNTER_SHM || !s_initial_start_reqs) { return 0; } return 0; } static void LSCRIU_Increase_Global_Counter(void) { if (LSCRIU_Get_Global_Counter_Type() != CRIU_GCOUNTER_SHM || !s_initial_start_reqs) { return; } s_requests_count = LSAPI_Inc_Req_Processed(1); } static void LSCRIU_Get_Global_Counter(void) { if (!s_initial_start_reqs) { return; } s_requests_count = LSAPI_Inc_Req_Processed(0); } static int LSCRIU_need_checkpoint(void) { if (!s_initial_start_reqs) { return 0; } if (LSCRIU_Get_Global_Counter_Type() == CRIU_GCOUNTER_SHM && s_requests_count <= s_initial_start_reqs) { LSCRIU_Get_Global_Counter(); } if (s_initial_start_reqs > 0 && s_requests_count >= s_initial_start_reqs) { return 1; } return 0; } static int LSCRIU_load_liblscapi(void) { void *lib_handle = NULL; void *pthread_lib_handle = NULL; if (s_native) return 0; // Numerical signals indicates Apache int error = 1; char *last; if (!(lib_handle = dlopen(last = "liblscapi.so", RTLD_NOW | RTLD_GLOBAL)) /*|| !(pthread_lib_handle = dlopen(last = "libpthread.so", RTLD_NOW | RTLD_GLOBAL))*/) fprintf(stderr, "LSCRIU (%d): failed to dlopen %s: %s - ignore CRIU\n", s_pid, last, dlerror()); else if (!(s_lscapi_dump_me = dlsym(lib_handle, last = "lscapi_dump_me")) || !(s_lscapi_prepare_me = dlsym(lib_handle, last = "lscapi_prepare_me")) || !(psem_open = dlsym(pthread_lib_handle, last = "sem_open")) || !(psem_post = dlsym(pthread_lib_handle, last = "sem_post")) || !(psem_close = dlsym(pthread_lib_handle, last = "sem_close"))) fprintf(stderr, "LSCRIU (%d): failed to dlsym %s: %s - ignore CRIU\n", s_pid, last, dlerror()); else error = 0; if (error) { // close the dll handles so we release the resources if (lib_handle) dlclose(lib_handle); if (pthread_lib_handle) dlclose(pthread_lib_handle); return -1; } return 0; } static void LSCRIU_Wink_Server_is_Ready(void) { char sem_name[60]; if (s_native) { // Not used for native return; } if (getenv("LSAPI_UNIQE")) snprintf(sem_name, sizeof sem_name - 1, "lsphp[hash=%s].is_ready", getenv("LSAPI_UNIQE")); else snprintf(sem_name, sizeof sem_name - 1, "lsphp[euid=0x%x].is_ready", geteuid()); sem_t *is_ready_sem = psem_open(sem_name, O_RDWR); if (is_ready_sem) { if (psem_post(is_ready_sem) < 0) lsapi_perror(sem_name, errno); if (psem_close(is_ready_sem) < 0) lsapi_perror(sem_name, errno); } else if (errno != ENOENT) lsapi_perror(sem_name, errno); } #ifdef LSAPILIB_DEBUG_CRIU static char *LSCRIU_Error_File_Name(char *pchFile, int max_len) { const char *pchDefaultSocketPath = "/tmp/"; const char *pchDefaultLogFileName = "lsws_error.log"; snprintf(pchFile, max_len, "%s%s", pchDefaultSocketPath, pchDefaultLogFileName); return pchFile; } static void LSCRIU_Debugging(void) { char *pchCRIUDebug; pchCRIUDebug = getenv("LSAPI_CRIU_DEBUG"); if (!pchCRIUDebug) pchCRIUDebug = getenv("LSCAPI_CRIU_DEBUG"); //fprintf(stderr,"(%d) LSCRIU: CRIU debug environment variable: %s\n", // s_pid, pchCRIUDebug); // I've made it easy to turn on debugging. CloudLinux Apache sets // LSCAPI_CRIU_DEBUG to nothing to indicate it's on. Sigh. if ((!pchCRIUDebug) || ((!*pchCRIUDebug) || (*pchCRIUDebug == '0') || (*pchCRIUDebug == 'f') || (*pchCRIUDebug == 'F') || (((*pchCRIUDebug == 'O') || (*pchCRIUDebug == 'o')) && ((*(pchCRIUDebug + 1)) && ((*(pchCRIUDebug + 1) == 'F') || (*(pchCRIUDebug + 1) == 'f')))))) { lscriu_dbg("LSCRIU (%d): CRIU Debugging disabled by environment\n", s_pid); s_criu_debug = 0; } else { s_criu_debug = 1; lscriu_dbg("LSCRIU (%d): CRIU Debugging enabled by environment\n", s_pid); fprintf(stderr,"LSCRIU (%d): CRIU debug environment variable: %s\n", s_pid, pchCRIUDebug); } } static void LSCRIU_Restored_Error(int iFatal, char *format, ...) { // This routine deals with the awful situation of trying to get info while the stderr handle is closed on purpose. int iOldUMask; int iFd = -1; char chFile[1024]; if (!iFatal) { // LSCRIU_Debugging(); if (!s_criu_debug) { // Debugging message and debugging is off return; } } if (!LSCRIU_Error_File_Name(chFile, sizeof(chFile))) { // We're done here...nowhere to write return; } iOldUMask = umask(0); iFd = open( chFile, O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); umask(iOldUMask); if (iFd >= 0) { char chFullMessage[0x1000]; struct timeb sTimeb; struct tm sTm; ftime(&sTimeb); localtime_r(&sTimeb.time,&sTm); va_list ap; va_start(ap, format); char buf[0x1000]; vsnprintf(buf, sizeof(buf), format, ap); va_end(ap); int n = snprintf(chFullMessage, sizeof(chFullMessage), "%04d-%02d-%02d %02d:%02d:%02d.%03d: LSCRIU (%d): %s %s\n", sTm.tm_year + 1900, sTm.tm_mon + 1, sTm.tm_mday, sTm.tm_hour, sTm.tm_min, sTm.tm_sec, sTimeb.millitm, s_pid, iFatal ? "FATAL! " : "(debug) ", buf); if (n > (int)sizeof(chFullMessage)) n = sizeof(chFullMessage); write(iFd, chFullMessage, n); close(iFd); } } #else // no debugging static void LSCRIU_Debugging(void) {} static void LSCRIU_Restored_Error(int iFatal, char *format, ...) {} #endif static int LSCRIU_Native_Dump(pid_t iPid, char *pchImagePath, int iFdNative) { criu_native_dump_t criu_native_dump; char *pchLastSlash; //criu_native_dump_response_t criu_native_dump_response; memset(&criu_native_dump, 0, sizeof(criu_native_dump)); criu_native_dump.m_iPidToDump = iPid; strncpy(criu_native_dump.m_chImageDirectory, pchImagePath, sizeof(criu_native_dump.m_chImageDirectory)); pchLastSlash = strrchr(criu_native_dump.m_chSocketDir,'/'); if (pchLastSlash) { pchLastSlash++; (*pchLastSlash) = 0; } lscriu_dbg("LSCRIU (%d): Sent the dump request to the listener\n", s_pid); if (write(iFdNative, &criu_native_dump, sizeof(criu_native_dump)) == -1) { lscriu_err("LSCRIU (%d): Error sending dump request to the listener: %s\n", s_pid, strerror(errno)); return(-1); } return 0; /* do not wait response. //while (sleep(7200)); if (read(iFdNative, &criu_native_dump_response, sizeof(criu_native_dump_response)) == -1) { // The test will actually fail it! //LSCRIU_Restored_Error(1, "Error reading dump socket #%d from parent: %s", // iFdNative, strerror(errno)); //return(-1); } return(-1); */ } static void LSCRIU_CloudLinux_Checkpoint(void) { int iRet; if ((!s_native) && (!s_lscapi_dump_me)) { lscriu_dbg("LSCRIU (%d): Not native and unable to dump - abandon one-time " "dump\n", s_pid); return; } iRet = s_lscapi_dump_me(); if (iRet < 0) { lscriu_err("LSCRIU: CloudLinux dump of PID: %d, error: %s\n", s_pid, strerror(errno)); } if (iRet == 0) { // Dumped. To continue the child must send us the handles back lscriu_err("LSCRIU: Successful CloudLinux dump of PID: %d\n", s_pid); } else { s_restored = 1; LSAPI_reset_server_state(); /* Here we have restored the php process, so we should to tell (via semaphore) mod_lsapi that we are started and ready to receive data. */ LSCRIU_Wink_Server_is_Ready(); lscriu_err("LSCRIU: Successful CloudLinux restore of PID: %d, parent: %d.\n", getpid(), getppid()); } LSCRIU_Set_Initial_Start_Reqs(0); } static void LSCRIU_Wait_Dump_Finish_Or_Restored(int pid_parent) { // Now get restored. We know if we're restored if the ppid changes! // If we're dumped, we're killed (no use worrying about that!). time_t iTimeStart = 0; time_t iTimeNow; int iRestored = 0; do { usleep(1000); time(&iTimeNow); if (!iTimeStart) { iTimeStart = iTimeNow; } else if ((pid_parent != getppid()) || (iTimeNow - iTimeStart > 10)) { iRestored = 1; } else if (iTimeNow - iTimeStart > 5) { LSCRIU_Restored_Error(1, "Timed out waiting to be dumped"); exit(1); } } while (!iRestored); } static void LSCRIU_try_checkpoint(int *forked_pid) { pid_t iPid; if (s_tried_checkpoint) { lscriu_dbg("LSCRIU (%d): Already tried checkpoint - one time per customer\n", getpid()); return; } lscriu_dbg("LSCRIU (%d): Trying checkpoint\n", getpid()); s_tried_checkpoint = 1; if (!s_native) { LSCRIU_CloudLinux_Checkpoint(); return; } lscriu_dbg("LSCRIU (%d): fork!\n", getpid()); iPid = fork(); if (iPid < 0) { lscriu_err("LSCRIU (%d): Can't checkpoint due to a fork error: %s\n", getpid(), strerror(errno)); return; } if (iPid == 0) { pid_t iPidParent = getppid(); s_pid = getpid(); setsid(); LSCRIU_Native_Dump(s_pid, s_criu_image_path, s_fd_native); close(s_fd_native); LSCRIU_Wait_Dump_Finish_Or_Restored(iPidParent); LSCRIU_Restored_Error(0, "Restored!"); LSAPI_reset_server_state(); s_restored = 1; } else { if (forked_pid) *forked_pid = iPid; } LSCRIU_Set_Initial_Start_Reqs(0); } static int init_native_env(void) { char *pchFd; pchFd = getenv("LSAPI_CRIU_SYNC_FD"); if (!pchFd) pchFd = getenv("LSCAPI_CRIU_SYNC_FD"); const char *image_path; image_path = getenv("LSAPI_CRIU_IMAGE_PATH"); if (!pchFd) { lscriu_err("LSCRIU (%d): LSAPI_CRIU_SYNC_FD internal environment " "variable not set - contact Litespeed tech support\n", getpid()); return -1; } if (!image_path) { lscriu_err("LSCRIU (%d): LSAPI_CRIU_IMAGE_PATH internal environment " "variable not set - contact Litespeed tech support\n", getpid()); return -1; } lscriu_dbg("LSCRIU (%d): Checkpoint dump. ImagePath: %s\n", getpid(), image_path); s_fd_native = atoi(pchFd); lscriu_dbg("LSCRIU (%d): Native checkpoint. Use filepointer %d (%s) to send " "pid %d\n", getpid(), s_fd_native, pchFd, iPidDump); s_criu_image_path = strdup(image_path); return 0; } static int LSCRIU_Init_Env_Parameters(void) { const char *p; int n; p = getenv("LSAPI_INITIAL_START"); if (!p) p = getenv("LSAPI_BACKEND_INITIAL_START"); if (p) { n = atoi(p); if (n > 0) { lscriu_dbg("LSCRIU (%d): Set start requests based on environment (%d)\n", getpid(), n); LSCRIU_Set_Initial_Start_Reqs(n); } else { lscriu_dbg("LSCRIU (%d): LSAPI_INITIAL_START set to 0 disabled\n", getpid()); return 0; } } else { lscriu_dbg("LSCRIU (%d): LSAPI_INITIAL_START NOT set - disabled\n", getpid()); return 0; } if (LSAPI_Is_Listen()) { lscriu_dbg("LSCRIU (%d): Listening...\n", getpid()); GlobalCounterType_t gc_type = CRIU_GCOUNTER_SHM; char *env; if ((env = getenv("LSAPI_CRIU_USE_SHM"))) { // CloudLinux doc: Off (shared memory) or Signals. // Litespeed doc: On (shared memory) or Signals // So just check the first character for an 'S' and if not, then // use shared memory. Pipe support is lost (sigh). if ((*env == 'S') || (*env == 's')) gc_type = CRIU_GCOUNTER_SIG; // Just assume the rest is signals // else use the default of shared memory } else if ((env = getenv("LSAPI_SIGNALS"))) { if ((*env == '1') || (*env == 'Y') || (*env == 'y') || (*env == 'T') || (*env == 't') || (((*env == 'O') || (*env == 'o')) && ((*(env + 1) == 'N') || (*(env + 1) == 'n')))) gc_type = CRIU_GCOUNTER_SIG; else if (*env == 2) gc_type = CRIU_GCOUNTER_PIPE; // The only case for pipe //else use the default of shared memory } if (gc_type != CRIU_GCOUNTER_SHM) { lscriu_dbg("LSCRIU (%d): Use %s\n", getpid(), gc_type == CRIU_GCOUNTER_SIG ? "signals" : "pipe"); lsapi_criu_signal(SIGUSR2, lsapi_siguser2); } else { lscriu_dbg("LSCRIU (%d): Use shared memory\n", getpid()); } LSCRIU_Set_Global_Counter_Type(gc_type); } else { lscriu_dbg("LSCRIU (%d): NOT Listening\n", getpid()); } char *criu_mode = NULL; criu_mode = getenv("LSAPI_CRIU"); // 0 disabled // 1 cloudlinux // 2 native if (criu_mode) { if (*criu_mode == '0') { lscriu_dbg("LSCRIU (%d): Disabled by environment.\n", getpid()); LSCRIU_Set_Initial_Start_Reqs(0); } else if (*criu_mode == '2') { lscriu_dbg("LSCRIU (%d): Disabled by environment.\n", getpid()); s_native = 1; } } if (s_native && init_native_env() == -1) LSCRIU_Set_Initial_Start_Reqs(0); //unset_lsapi_envs(); return 0; } void LSCRIU_inc_req_processed(void) { if (!LSCRIU_Get_Global_Counter_Type()) { ++s_requests_count; } lscriu_dbg("LSCRIU (%d): s_requests_count %d counter %d\n", getpid(), s_requests_count, s_initial_start_reqs); if (s_initial_start_reqs > 0 && s_requests_count <= s_initial_start_reqs) { if (LSCRIU_Get_Global_Counter_Type() == CRIU_GCOUNTER_SHM) { LSCRIU_Increase_Global_Counter(); if (s_requests_count >= s_initial_start_reqs) { //Maybe this time we can stop to send signal and wait for //1 second of select timeout //kill( LSCRIU_Get_ppid(), SIGUSR2 ); lscriu_dbg("LSCRIU (%d): Time to dump main process with semaphore\n", getpid()); } } else { kill(LSAPI_Get_ppid(), SIGUSR2); lscriu_dbg("LSCRIU (%d): Send kill to main process with signals\n", getpid()); } } } static void LSCRIU_on_timer(int *forked_pid) { lscriu_dbg("LSCRIU (%d): LSCRIU_on_timer\n", getpid()); if (LSCRIU_need_checkpoint()) { LSCRIU_try_checkpoint(forked_pid); } } int LSCRIU_Init(void) { s_pid = getpid(); LSCRIU_Debugging(); LSCRIU_Init_Env_Parameters(); if (s_initial_start_reqs && !s_native) { if (LSCRIU_load_liblscapi() == -1) s_initial_start_reqs = 0; } if (s_initial_start_reqs) { LSCRIU_Wink_Server_is_Ready(); lscriu_dbg("LSCRIU (%d): LSAPI_Register_Pgrp_Timer_Callback\n", s_pid); LSAPI_Register_Pgrp_Timer_Callback(LSCRIU_on_timer); LSCRIU_Init_Global_Counter(0); } return s_initial_start_reqs > 0; } PK!ga׸&php-5.6.40/sapi/litespeed/lsapi_main.cnu[/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: George Wang | +----------------------------------------------------------------------+ */ #include "php.h" #include "SAPI.h" #include "php_main.h" #include "php_ini.h" #include "php_variables.h" #include "zend_highlight.h" #include "zend.h" #include "ext/standard/head.h" #include "ext/standard/php_standard.h" #include "lsapilib.h" #include #if HAVE_STDLIB_H #include #endif #if HAVE_UNISTD_H #include #endif #ifdef PHP_WIN32 #include #include #include "win32/php_registry.h" #else #include #endif #include #if HAVE_SYS_TYPES_H #include #endif #if HAVE_SIGNAL_H #include #endif #include #include #include #include #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) #include "lscriu.c" #endif #define SAPI_LSAPI_MAX_HEADER_LENGTH LSAPI_RESP_HTTP_HEADER_MAX #ifndef TSRMLS_DC #define TSRMLS_D void #define TSRMLS_DC #define TSRMLS_C #define TSRMLS_CC #endif /* Key for each cache entry is dirname(PATH_TRANSLATED). * * NOTE: Each cache entry config_hash contains the combination from all user ini files found in * the path starting from doc_root throught to dirname(PATH_TRANSLATED). There is no point * storing per-file entries as it would not be possible to detect added / deleted entries * between separate files. */ typedef struct _user_config_cache_entry { time_t expires; HashTable user_config; } user_config_cache_entry; static HashTable user_config_cache; static int lsapi_mode = 0; static char *php_self = ""; static char *script_filename = ""; static int source_highlight = 0; static int ignore_php_ini = 0; static char * argv0 = NULL; static int engine = 1; static int parse_user_ini = 0; static int max_cmd_script_path_len = 45; #ifdef ZTS zend_compiler_globals *compiler_globals; zend_executor_globals *executor_globals; php_core_globals *core_globals; sapi_globals_struct *sapi_globals; void ***tsrm_ls; #endif zend_module_entry litespeed_module_entry; static void init_sapi_from_env(sapi_module_struct *sapi_module) { char *p; p = getenv("LSPHPRC"); if (p) sapi_module->php_ini_path_override = p; } /* {{{ php_lsapi_startup */ static int php_lsapi_startup(sapi_module_struct *sapi_module) { if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { return FAILURE; } argv0 = sapi_module->executable_location; return SUCCESS; } /* }}} */ /* {{{ sapi_lsapi_ini_defaults */ /* overwriteable ini defaults must be set in sapi_cli_ini_defaults() */ #define INI_DEFAULT(name,value)\ ZVAL_STRING(tmp, value, 0);\ zend_hash_update(configuration_hash, name, sizeof(name), tmp, sizeof(zval), (void**)&entry);\ Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry)) static void sapi_lsapi_ini_defaults(HashTable *configuration_hash) { #if PHP_MAJOR_VERSION > 4 /* zval *tmp, *entry; MAKE_STD_ZVAL(tmp); INI_DEFAULT("register_long_arrays", "0"); FREE_ZVAL(tmp); */ #endif } /* }}} */ /* {{{ sapi_lsapi_ub_write */ #if PHP_MAJOR_VERSION >= 7 static size_t sapi_lsapi_ub_write(const char *str, size_t str_length TSRMLS_DC) #else static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) #endif { int ret; int remain; if ( lsapi_mode ) { ret = LSAPI_Write( str, str_length ); if ( ret < str_length ) { php_handle_aborted_connection(); return str_length - ret; } } else { remain = str_length; while( remain > 0 ) { ret = write( 1, str, remain ); if ( ret <= 0 ) { php_handle_aborted_connection(); return str_length - remain; } str += ret; remain -= ret; } } return str_length; } /* }}} */ /* {{{ sapi_lsapi_flush */ static void sapi_lsapi_flush(void * server_context) { if ( lsapi_mode ) { if ( LSAPI_Flush() == -1) { php_handle_aborted_connection(); } } } /* }}} */ /* {{{ sapi_lsapi_deactivate */ static int sapi_lsapi_deactivate(TSRMLS_D) { if ( SG(request_info).path_translated ) { efree( SG(request_info).path_translated ); SG(request_info).path_translated = NULL; } return SUCCESS; } /* }}} */ /* {{{ sapi_lsapi_getenv */ #if PHP_MAJOR_VERSION <= 7 static char *sapi_lsapi_getenv(char * name, size_t name_len TSRMLS_DC) #else static char *sapi_lsapi_getenv(const char * name, size_t name_len TSRMLS_DC) #endif { if ( lsapi_mode ) { return LSAPI_GetEnv( name ); } else { return getenv( name ); } } /* }}} */ #if PHP_MAJOR_VERSION > 4 static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg TSRMLS_DC) { #if PHP_MAJOR_VERSION >= 7 int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) ? PARSE_ENV : PARSE_SERVER; size_t new_val_len; #else int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; unsigned int new_val_len; #endif char * new_val = (char *) pValue; if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len TSRMLS_CC)) { php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg TSRMLS_CC); } return 1; } #else static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { zval * gpc_element, **gpc_element_p; HashTable * symtable1 = Z_ARRVAL_P((zval * )arg); register char * pKey1 = (char *)pKey; MAKE_STD_ZVAL(gpc_element); Z_STRLEN_P( gpc_element ) = valLen; Z_STRVAL_P( gpc_element ) = estrndup(pValue, valLen); Z_TYPE_P( gpc_element ) = IS_STRING; zend_hash_update( symtable1, pKey1, keyLen + 1, &gpc_element, sizeof( zval *), (void **) &gpc_element_p ); return 1; } #endif #if defined(ZTS) && PHP_MAJOR_VERSION < 7 struct param_zts { void *arg; TSRMLS_D ; }; static int add_variable_zts(const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { struct param_zts * params = (struct param_zts *)arg; return add_variable(pKey, keyLen, pValue, valLen, params->arg, params->TSRMLS_C); } #endif static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC) { char buf[128]; char **env, *p, *t = buf; size_t alloc_size = sizeof(buf); unsigned long nlen; /* ptrdiff_t is not portable */ #if PHP_MAJOR_VERSION >= 7 if (Z_TYPE(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_ENV]) && zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_ENV])) > 0 ) { zval_dtor(array_ptr); ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_ENV]); return; } else if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && Z_ARR_P(array_ptr) != Z_ARR(PG(http_globals)[TRACK_VARS_SERVER]) && zend_hash_num_elements(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER])) > 0 ) { zval_dtor(array_ptr); ZVAL_DUP(array_ptr, &PG(http_globals)[TRACK_VARS_SERVER]); return; } #else if (PG(http_globals)[TRACK_VARS_ENV] && array_ptr != PG(http_globals)[TRACK_VARS_ENV] && Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0 ) { zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } else if (PG(http_globals)[TRACK_VARS_SERVER] && array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0 ) { zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } #endif for (env = environ; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); if (!p) { /* malformed entry? */ continue; } nlen = p - *env; if (nlen >= alloc_size) { alloc_size = nlen + 64; t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size)); } memcpy(t, *env, nlen); t[nlen] = '\0'; add_variable(t, nlen, p + 1, strlen( p + 1 ), array_ptr TSRMLS_CC); } if (t != buf && t != NULL) { efree(t); } } #if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5) #include "ext/standard/php_string.h" static int add_variable_magic_quote( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { zval * gpc_element, **gpc_element_p; HashTable * symtable1 = Z_ARRVAL_P((zval * )arg); register char * pKey1 = (char *)pKey; MAKE_STD_ZVAL(gpc_element); Z_STRLEN_P( gpc_element ) = valLen; Z_STRVAL_P( gpc_element ) = php_addslashes((char *)pValue, valLen, &Z_STRLEN_P( gpc_element ), 0 ); Z_TYPE_P( gpc_element ) = IS_STRING; #if PHP_MAJOR_VERSION > 4 zend_symtable_update( symtable1, pKey1, keyLen + 1, &gpc_element, sizeof( zval *), (void **) &gpc_element_p ); #else zend_hash_update( symtable1, pKey1, keyLen + 1, &gpc_element, sizeof( zval *), (void **) &gpc_element_p ); #endif return 1; } #endif /* {{{ sapi_lsapi_register_variables */ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) { char * php_self = ""; #if defined(ZTS) && PHP_MAJOR_VERSION < 7 struct param_zts params; params.arg = track_vars_array; params.TSRMLS_C = TSRMLS_C; #endif if ( lsapi_mode ) { if ( (SG(request_info).request_uri ) ) php_self = (SG(request_info).request_uri ); litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC); #if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5) if (!PG(magic_quotes_gpc)) { #endif #if defined(ZTS) && PHP_MAJOR_VERSION < 7 LSAPI_ForeachHeader( add_variable_zts, ¶ms ); LSAPI_ForeachEnv( add_variable_zts, ¶ms ); #else LSAPI_ForeachHeader( add_variable, track_vars_array ); LSAPI_ForeachEnv( add_variable, track_vars_array ); #endif add_variable("PHP_SELF", 8, php_self, strlen( php_self ), track_vars_array TSRMLS_CC); #if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5) } else { LSAPI_ForeachHeader( add_variable_magic_quote, track_vars_array ); LSAPI_ForeachEnv( add_variable_magic_quote, track_vars_array ); add_variable_magic_quote("PHP_SELF", 8, php_self, strlen( php_self ), track_vars_array ); } #endif } else { php_import_environment_variables(track_vars_array TSRMLS_CC); php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC); php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC); php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC); php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC); php_register_variable("DOCUMENT_ROOT", "", track_vars_array TSRMLS_CC); } } /* }}} */ /* {{{ sapi_lsapi_read_post */ #if PHP_MAJOR_VERSION >= 7 static size_t sapi_lsapi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) #else static int sapi_lsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) #endif { if ( lsapi_mode ) { ssize_t rv = LSAPI_ReadReqBody(buffer, (unsigned long long)count_bytes); return (rv >= 0) ? (size_t)rv : 0; } else { return 0; } } /* }}} */ /* {{{ sapi_lsapi_read_cookies */ static char *sapi_lsapi_read_cookies(TSRMLS_D) { if ( lsapi_mode ) { return LSAPI_GetHeader( H_COOKIE ); } else { return NULL; } } /* }}} */ typedef struct _http_error { int code; const char* msg; } http_error; static const http_error http_error_codes[] = { {100, "Continue"}, {101, "Switching Protocols"}, {200, "OK"}, {201, "Created"}, {202, "Accepted"}, {203, "Non-Authoritative Information"}, {204, "No Content"}, {205, "Reset Content"}, {206, "Partial Content"}, {300, "Multiple Choices"}, {301, "Moved Permanently"}, {302, "Moved Temporarily"}, {303, "See Other"}, {304, "Not Modified"}, {305, "Use Proxy"}, {400, "Bad Request"}, {401, "Unauthorized"}, {402, "Payment Required"}, {403, "Forbidden"}, {404, "Not Found"}, {405, "Method Not Allowed"}, {406, "Not Acceptable"}, {407, "Proxy Authentication Required"}, {408, "Request Time-out"}, {409, "Conflict"}, {410, "Gone"}, {411, "Length Required"}, {412, "Precondition Failed"}, {413, "Request Entity Too Large"}, {414, "Request-URI Too Large"}, {415, "Unsupported Media Type"}, {428, "Precondition Required"}, {429, "Too Many Requests"}, {431, "Request Header Fields Too Large"}, {451, "Unavailable For Legal Reasons"}, {500, "Internal Server Error"}, {501, "Not Implemented"}, {502, "Bad Gateway"}, {503, "Service Unavailable"}, {504, "Gateway Time-out"}, {505, "HTTP Version not supported"}, {511, "Network Authentication Required"}, {0, NULL} }; static int sapi_lsapi_send_headers_like_cgi(sapi_headers_struct *sapi_headers TSRMLS_DC) { char buf[SAPI_LSAPI_MAX_HEADER_LENGTH]; sapi_header_struct *h; zend_llist_position pos; zend_bool ignore_status = 0; int response_status = SG(sapi_headers).http_response_code; if (SG(request_info).no_headers == 1) { LSAPI_FinalizeRespHeaders(); return SAPI_HEADER_SENT_SUCCESSFULLY; } if (SG(sapi_headers).http_response_code != 200) { int len; zend_bool has_status = 0; char *s; if (SG(sapi_headers).http_status_line && (s = strchr(SG(sapi_headers).http_status_line, ' ')) != 0 && (s - SG(sapi_headers).http_status_line) >= 5 && strncasecmp(SG(sapi_headers).http_status_line, "HTTP/", 5) == 0 ) { len = slprintf(buf, sizeof(buf), "Status:%s", s); response_status = atoi((s + 1)); } else { h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { if (h->header_len > sizeof("Status:")-1 && strncasecmp(h->header, "Status:", sizeof("Status:")-1) == 0 ) { has_status = 1; break; } h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); } if (!has_status) { http_error *err = (http_error*)http_error_codes; while (err->code != 0) { if (err->code == SG(sapi_headers).http_response_code) { break; } err++; } if (err->msg) { len = slprintf(buf, sizeof(buf), "Status: %d %s", SG(sapi_headers).http_response_code, err->msg); } else { len = slprintf(buf, sizeof(buf), "Status: %d", SG(sapi_headers).http_response_code); } } } if (!has_status) { LSAPI_AppendRespHeader( buf, len ); ignore_status = 1; } } h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { /* prevent CRLFCRLF */ if (h->header_len) { if (h->header_len > sizeof("Status:")-1 && strncasecmp(h->header, "Status:", sizeof("Status:")-1) == 0 ) { if (!ignore_status) { ignore_status = 1; LSAPI_AppendRespHeader(h->header, h->header_len); } } else if (response_status == 304 && h->header_len > sizeof("Content-Type:")-1 && strncasecmp(h->header, "Content-Type:", sizeof("Content-Type:")-1) == 0 ) { h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); continue; } else { LSAPI_AppendRespHeader(h->header, h->header_len); } } h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); } LSAPI_FinalizeRespHeaders(); return SAPI_HEADER_SENT_SUCCESSFULLY; } /* mod_lsapi mode or legacy LS mode */ static int mod_lsapi_mode = 0; /* {{{ sapi_lsapi_send_headers */ static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { sapi_header_struct *h; zend_llist_position pos; if ( mod_lsapi_mode ) { /* mod_lsapi mode */ return sapi_lsapi_send_headers_like_cgi(sapi_headers TSRMLS_CC); } /* Legacy mode */ if ( lsapi_mode ) { LSAPI_SetRespStatus( SG(sapi_headers).http_response_code ); h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { if ( h->header_len > 0 ) { LSAPI_AppendRespHeader(h->header, h->header_len); } h = zend_llist_get_next_ex(&sapi_headers->headers, &pos); } if (SG(sapi_headers).send_default_content_type) { char *hd; int len; char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH]; hd = sapi_get_default_content_type(TSRMLS_C); len = snprintf( headerBuf, SAPI_LSAPI_MAX_HEADER_LENGTH - 1, "Content-type: %s", hd ); efree(hd); LSAPI_AppendRespHeader( headerBuf, len ); } } LSAPI_FinalizeRespHeaders(); return SAPI_HEADER_SENT_SUCCESSFULLY; } /* }}} */ /* {{{ sapi_lsapi_send_headers */ #if PHP_MAJOR_VERSION > 7 static void sapi_lsapi_log_message(const char *message, int syslog_type_int) #else static void sapi_lsapi_log_message(char *message #if (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 1) , int syslog_type_int /* unused */ #endif TSRMLS_DC) #endif { char buf[8192]; int len = strlen( message ); if ( *(message + len - 1 ) != '\n' ) { snprintf( buf, 8191, "%s\n", message ); message = buf; if (len > 8191) len = 8191; ++len; } LSAPI_Write_Stderr( message, len); } /* }}} */ /* Set to 1 to turn on log messages useful during development: */ #if 0 static void log_message (const char *fmt, ...) { va_list ap; va_start(ap, fmt); char buf[0x100]; vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); sapi_lsapi_log_message(buf #if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 1) , 0 #endif ); } #define DEBUG_MESSAGE(fmt, ...) log_message("LS:%d " fmt "\n", __LINE__, ##__VA_ARGS__) #else #define DEBUG_MESSAGE(fmt, ...) #endif static int lsapi_activate_user_ini(TSRMLS_D); static int sapi_lsapi_activate(TSRMLS_D) { #if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) char *path,*server_name; size_t path_len, server_name_len; /* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */ if (!SG(request_info).path_translated) { return FAILURE; } if (php_ini_has_per_host_config()) { server_name = sapi_lsapi_getenv("SERVER_NAME", 0 #if defined(ZTS) && PHP_MAJOR_VERSION < 7 TSRMLS_CC #endif ); /* SERVER_NAME should also be defined at this stage..but better check it anyway */ if (server_name) { server_name_len = strlen(server_name); server_name = estrndup(server_name, server_name_len); zend_str_tolower(server_name, server_name_len); php_ini_activate_per_host_config(server_name, server_name_len #if PHP_MAJOR_VERSION < 7 + 1 TSRMLS_CC #endif ); efree(server_name); } } if (php_ini_has_per_dir_config()) { /* Prepare search path */ path_len = strlen(SG(request_info).path_translated); /* Make sure we have trailing slash! */ if (!IS_SLASH(SG(request_info).path_translated[path_len])) { path = emalloc(path_len + 2); memcpy(path, SG(request_info).path_translated, path_len + 1); path_len = zend_dirname(path, path_len); path[path_len++] = DEFAULT_SLASH; } else { path = estrndup(SG(request_info).path_translated, path_len); path_len = zend_dirname(path, path_len); } path[path_len] = 0; /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ php_ini_activate_per_dir_config(path, path_len); /* Note: for global settings sake we check from root to path */ efree(path); } if (parse_user_ini && lsapi_activate_user_ini(TSRMLS_C) == FAILURE) { return FAILURE; } #endif return SUCCESS; } /* {{{ sapi_module_struct cgi_sapi_module */ static sapi_module_struct lsapi_sapi_module = { "litespeed", "LiteSpeed V8.0.1", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ sapi_lsapi_activate, /* activate */ sapi_lsapi_deactivate, /* deactivate */ sapi_lsapi_ub_write, /* unbuffered write */ sapi_lsapi_flush, /* flush */ NULL, /* get uid */ sapi_lsapi_getenv, /* getenv */ php_error, /* error handler */ NULL, /* header handler */ sapi_lsapi_send_headers, /* send headers handler */ NULL, /* send header handler */ sapi_lsapi_read_post, /* read POST data */ sapi_lsapi_read_cookies, /* read Cookies */ sapi_lsapi_register_variables, /* register server variables */ sapi_lsapi_log_message, /* Log message */ #if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 1) NULL, /* Get request time */ NULL, /* Child terminate */ #else NULL, /* php.ini path override */ NULL, /* block interruptions */ NULL, /* unblock interruptions */ NULL, /* default post reader */ NULL, /* treat data */ NULL, /* executable location */ 0, /* php.ini ignore */ #endif STANDARD_SAPI_MODULE_PROPERTIES }; /* }}} */ static void init_request_info( TSRMLS_D ) { char * pContentType = LSAPI_GetHeader( H_CONTENT_TYPE ); char * pAuth; SG(request_info).content_type = pContentType ? pContentType : ""; SG(request_info).request_method = LSAPI_GetRequestMethod(); SG(request_info).query_string = LSAPI_GetQueryString(); SG(request_info).request_uri = LSAPI_GetScriptName(); SG(request_info).content_length = LSAPI_GetReqBodyLen(); SG(request_info).path_translated = estrdup( LSAPI_GetScriptFileName()); /* It is not reset by zend engine, set it to 200. */ SG(sapi_headers).http_response_code = 200; pAuth = LSAPI_GetHeader( H_AUTHORIZATION ); php_handle_auth_data(pAuth TSRMLS_CC); } #if PHP_MAJOR_VERSION < 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION < 4) ZEND_API void zend_stream_init_filename(zend_file_handle *handle, const char *filename) { memset(handle, 0, sizeof(zend_file_handle)); handle->type = ZEND_HANDLE_FILENAME; handle->filename = (char *)filename; } ZEND_API void zend_stream_init_fp(zend_file_handle *handle, FILE *fp, const char *filename) { memset(handle, 0, sizeof(zend_file_handle)); handle->type = ZEND_HANDLE_FP; handle->handle.fp = fp; handle->filename = (char *)filename; } #endif static int lsapi_execute_script(TSRMLS_D) { zend_file_handle file_handle; char *p; int len; zend_stream_init_filename(&file_handle, SG(request_info).path_translated); #if PHP_MAJOR_VERSION > 8 || (PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION >= 1) file_handle.primary_script = true; #endif p = argv0; *p++ = ':'; len = strlen( SG(request_info).path_translated ); if (len > max_cmd_script_path_len - 1) len = len - max_cmd_script_path_len + 1; else len = 0; memccpy(p, SG(request_info).path_translated + len, 0, max_cmd_script_path_len); php_execute_script(&file_handle TSRMLS_CC); #if PHP_MAJOR_VERSION > 8 || (PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION >= 1) zend_destroy_file_handle(&file_handle); #endif return 0; } static void lsapi_sigsegv( int signal ) { //fprintf(stderr, "lsapi_sigsegv: %d: Segmentation violation signal is caught during request shutdown\n", getpid()); _exit(1); } #if PHP_MAJOR_VERSION >= 7 static int do_clean_shutdown = 1; #else static int do_clean_shutdown = 0; #endif static int clean_onexit = 1; static void lsapi_clean_shutdown(void) { struct sigaction act; struct itimerval tmv; #if PHP_MAJOR_VERSION >= 7 zend_string * key; #endif clean_onexit = 1; sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = lsapi_sigsegv; sigaction(SIGINT, &act, NULL); sigaction(SIGQUIT, &act, NULL); sigaction(SIGILL, &act, NULL); sigaction(SIGABRT, &act, NULL); sigaction(SIGBUS, &act, NULL); sigaction(SIGSEGV, &act, NULL); sigaction(SIGTERM, &act, NULL); sigaction(SIGPROF, &act, NULL); memset(&tmv, 0, sizeof(struct itimerval)); tmv.it_value.tv_sec = 0; tmv.it_value.tv_usec = 100000; setitimer(ITIMER_PROF, &tmv, NULL); #if PHP_MAJOR_VERSION >= 7 key = zend_string_init("error_reporting", 15, 1); zend_alter_ini_entry_chars_ex(key, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_SHUTDOWN, 1); zend_string_release(key); #else zend_alter_ini_entry("error_reporting", 16, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_SHUTDOWN); #endif zend_try { php_request_shutdown(NULL); } zend_end_try(); } static void lsapi_sigterm(int signal) { // fprintf(stderr, "lsapi_sigterm: %d: clean_onexit %d\n", getpid(), clean_onexit ); if(!clean_onexit) { lsapi_clean_shutdown(); } exit(1); } static void lsapi_atexit(void) { //fprintf(stderr, "lsapi_atexit: %d: clean_onexit %d\n", getpid(), clean_onexit ); if(!clean_onexit) { lsapi_clean_shutdown(); } } static int lsapi_module_main(int show_source TSRMLS_DC) { struct sigaction act; if (php_request_startup(TSRMLS_C) == FAILURE ) { return -1; } if (do_clean_shutdown) { sigemptyset(&act.sa_mask); act.sa_flags = SA_NODEFER; act.sa_handler = lsapi_sigterm; sigaction( SIGINT, &act, NULL); sigaction( SIGQUIT, &act, NULL); sigaction( SIGILL, &act, NULL); sigaction( SIGABRT, &act, NULL); sigaction( SIGBUS, &act, NULL); sigaction( SIGSEGV, &act, NULL); sigaction( SIGTERM, &act, NULL); clean_onexit = 0; } if (show_source) { zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); } else { lsapi_execute_script(TSRMLS_C); } zend_try { php_request_shutdown(NULL); clean_onexit = 1; memset(argv0, 0, max_cmd_script_path_len); } zend_end_try(); return 0; } static int alter_ini( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { #if PHP_MAJOR_VERSION >= 7 zend_string * psKey; #endif int type = ZEND_INI_PERDIR; int stage = PHP_INI_STAGE_RUNTIME; if ( '\001' == *pKey ) { ++pKey; if ( *pKey == 4 ) { type = ZEND_INI_SYSTEM; /* Use ACTIVATE stage in legacy mode only. RUNTIME stage should be used here, as with ACTIVATE it's impossible to change the option from script with ini_set */ if(!mod_lsapi_mode) { stage = PHP_INI_STAGE_ACTIVATE; } } #if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) else { stage = PHP_INI_STAGE_HTACCESS; } #endif ++pKey; --keyLen; if (( keyLen == 7 )&&( strncasecmp( pKey, "engine", 6 )== 0 )) { if ( *pValue == '0' ) engine = 0; } else { #if PHP_MAJOR_VERSION >= 7 --keyLen; psKey = zend_string_init( pKey, keyLen, 1 ); zend_alter_ini_entry_chars(psKey, (char *)pValue, valLen, type, stage); zend_string_release( psKey ); #else zend_alter_ini_entry((char *)pKey, keyLen, (char *)pValue, valLen, type, stage); #endif } } return 1; } static void user_config_cache_entry_dtor( #if PHP_MAJOR_VERSION >= 7 zval #else void #endif *el) { user_config_cache_entry *entry = #if PHP_MAJOR_VERSION >= 7 (user_config_cache_entry *)Z_PTR_P(el) #else *(user_config_cache_entry **)el #endif ; zend_hash_destroy(&entry->user_config); free(entry); } static void user_config_cache_init(void) { zend_hash_init(&user_config_cache, 0, NULL, user_config_cache_entry_dtor, 1); } static int pathlen_without_trailing_slash(char *path) { int len = (int)strlen(path); while (len > 1 && /* mind "/" as root dir */ path[len-1] == DEFAULT_SLASH) { --len; } return len; } static inline char* skip_slash(char *s) { while (*s == DEFAULT_SLASH) { ++s; } return s; } /** * Walk down the path_stop starting at path_start. * * If path_start = "/path1" and path_stop = "/path1/path2/path3" * the callback will be called 3 times with the next args: * * 1. "/path1/path2/path3" * ^ end * ^ start * 2. "/path1/path2/path3" * ^ end * ^ start * 3. "/path1/path2/path3" * ^ end * ^ start * * path_stop has to be a subdir of path_start * or to be path_start itself. * * Both path args have to be absolute. * Trailing slashes are allowed. * NULL or empty string args are not allowed. */ static void walk_down_the_path(char* path_start, char* path_stop, void (*cb)(char* begin, char* end, void* data), void* data) { char *pos = path_stop + pathlen_without_trailing_slash(path_start); cb(path_stop, pos, data); while ((pos = skip_slash(pos))[0]) { pos = strchr(pos, DEFAULT_SLASH); if (!pos) { /* The last token without trailing slash */ cb(path_stop, path_stop + strlen(path_stop), data); return; } cb(path_stop, pos, data); } } #if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) typedef struct { char *path; uint path_len; char *doc_root; user_config_cache_entry *entry; #if defined(ZTS) && PHP_MAJOR_VERSION < 7 TSRMLS_D ; #endif } _lsapi_activate_user_ini_ctx; typedef int (*fn_activate_user_ini_chain_t) (_lsapi_activate_user_ini_ctx *ctx, void* next); static int lsapi_activate_user_ini_basic_checks(_lsapi_activate_user_ini_ctx *ctx, void* next) { int rc = SUCCESS; fn_activate_user_ini_chain_t *fn_next = next; if (!PG(user_ini_filename) || !*PG(user_ini_filename)) { return SUCCESS; } /* PATH_TRANSLATED should be defined at this stage */ ctx->path = SG(request_info).path_translated; if (!ctx->path || !*ctx->path) { return FAILURE; } ctx->doc_root = sapi_lsapi_getenv("DOCUMENT_ROOT", 0 #if defined(ZTS) && PHP_MAJOR_VERSION < 7 , ctx->TSRMLS_C #endif ); if (*fn_next) { rc = (*fn_next)(ctx, fn_next + 1); } return rc; } static int lsapi_activate_user_ini_mk_path(_lsapi_activate_user_ini_ctx *ctx, void* next) { char *path; int rc = SUCCESS; fn_activate_user_ini_chain_t *fn_next = next; /* Extract dir name from path_translated * and store it in 'path' */ ctx->path_len = strlen(ctx->path); path = ctx->path = estrndup(SG(request_info).path_translated, ctx->path_len); if (!path) return FAILURE; ctx->path_len = zend_dirname(path, ctx->path_len); if (*fn_next) { rc = (*fn_next)(ctx, fn_next + 1); } efree(path); return rc; } static int lsapi_activate_user_ini_mk_realpath(_lsapi_activate_user_ini_ctx *ctx, void* next) { char *real_path; int rc = SUCCESS; fn_activate_user_ini_chain_t *fn_next = next; if (!IS_ABSOLUTE_PATH(ctx->path, ctx->path_len)) { real_path = tsrm_realpath(ctx->path, NULL #if defined(ZTS) && PHP_MAJOR_VERSION < 7 , ctx->TSRMLS_C #endif ); if (!real_path) { return SUCCESS; } ctx->path = real_path; ctx->path_len = strlen(ctx->path); } else { real_path = NULL; } if (*fn_next) { rc = (*fn_next)(ctx, fn_next + 1); } if (real_path) efree(real_path); return rc; } static int lsapi_activate_user_ini_mk_user_config(_lsapi_activate_user_ini_ctx *ctx, void* next) { fn_activate_user_ini_chain_t *fn_next = next; /* Find cached config entry: If not found, create one */ #if PHP_MAJOR_VERSION >= 7 ctx->entry = zend_hash_str_find_ptr(&user_config_cache, ctx->path, ctx->path_len); #else { user_config_cache_entry **entry_pp; if (SUCCESS == zend_hash_find(&user_config_cache, ctx->path, ctx->path_len + 1, (void **) &entry_pp)) ctx->entry = *entry_pp; else ctx->entry = NULL; } #endif if (!ctx->entry) { ctx->entry = pemalloc(sizeof(user_config_cache_entry), 1); ctx->entry->expires = 0; zend_hash_init(&ctx->entry->user_config, 0, NULL, #if PHP_MAJOR_VERSION <= 5 (dtor_func_t) #endif config_zval_dtor, 1); #if PHP_MAJOR_VERSION >= 7 zend_hash_str_update_ptr(&user_config_cache, ctx->path, ctx->path_len, ctx->entry); #else zend_hash_update(&user_config_cache, ctx->path, ctx->path_len + 1, &ctx->entry, sizeof(&ctx->entry), NULL); #endif } if (*fn_next) { return (*fn_next)(ctx, fn_next + 1); } else { return SUCCESS; } } static void walk_down_the_path_callback(char* begin, char* end, void* data) { _lsapi_activate_user_ini_ctx *ctx = data; char tmp = end[0]; end[0] = 0; php_parse_user_ini_file(begin, PG(user_ini_filename), &ctx->entry->user_config #if defined(ZTS) && PHP_MAJOR_VERSION < 7 , ctx->TSRMLS_C #endif ); end[0] = tmp; } static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_ctx *ctx, void* next) { time_t request_time = sapi_get_request_time( #if defined(ZTS) && PHP_MAJOR_VERSION < 7 ctx->TSRMLS_C #endif ); uint docroot_len; int rc = SUCCESS; fn_activate_user_ini_chain_t *fn_next = next; if (!ctx->entry->expires || request_time > ctx->entry->expires) { docroot_len = ctx->doc_root && ctx->doc_root[0] ? pathlen_without_trailing_slash(ctx->doc_root) : 0; int is_outside_of_docroot = !docroot_len || ctx->path_len < docroot_len || strncmp(ctx->path, ctx->doc_root, docroot_len) != 0; if (is_outside_of_docroot) { php_parse_user_ini_file(ctx->path, PG(user_ini_filename), &ctx->entry->user_config #if defined(ZTS) && PHP_MAJOR_VERSION < 7 , ctx->TSRMLS_C #endif ); } else { walk_down_the_path(ctx->doc_root, ctx->path, &walk_down_the_path_callback, ctx); } ctx->entry->expires = request_time + PG(user_ini_cache_ttl); } if (*fn_next) { rc = (*fn_next)(ctx, fn_next + 1); } return rc; } static int lsapi_activate_user_ini_finally(_lsapi_activate_user_ini_ctx *ctx, void* next) { int rc = SUCCESS; fn_activate_user_ini_chain_t *fn_next = next; php_ini_activate_config(&ctx->entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS #if defined(ZTS) && PHP_MAJOR_VERSION < 7 , ctx->TSRMLS_C #endif ); if (*fn_next) { rc = (*fn_next)(ctx, fn_next + 1); } return rc; } static int lsapi_activate_user_ini(TSRMLS_D) { _lsapi_activate_user_ini_ctx ctx; /** * The reason to have this function list stacked * is each function now can define a scoped destructor. * * Passing control via function pointer is a sign of low coupling, * which means dependencies between these functions are to be * controlled from a single place * (here below, by modifying this function list order) */ static const fn_activate_user_ini_chain_t fn_chain[] = { &lsapi_activate_user_ini_basic_checks, &lsapi_activate_user_ini_mk_path, &lsapi_activate_user_ini_mk_realpath, &lsapi_activate_user_ini_mk_user_config, &lsapi_activate_user_ini_walk_down_the_path, &lsapi_activate_user_ini_finally, NULL }; #if defined(ZTS) && PHP_MAJOR_VERSION < 7 ctx.TSRMLS_C = TSRMLS_C; #endif return fn_chain[0](&ctx, (fn_activate_user_ini_chain_t*)(fn_chain + 1)); } #endif static void override_ini(void) { LSAPI_ForeachSpecialEnv( alter_ini, NULL ); } static int processReq( TSRMLS_D ) { int ret = 0; zend_first_try { /* avoid server_context==NULL checks */ SG(server_context) = (void *) 1; engine = 1; override_ini(); if ( engine ) { init_request_info( TSRMLS_C ); if ( lsapi_module_main( source_highlight TSRMLS_CC ) == -1 ) { ret = -1; } } else { LSAPI_AppendRespHeader( "status: 403", 11 ); LSAPI_AppendRespHeader( "content-type: text/html", 23 ); LSAPI_Write( "Forbidden: PHP engine is disable.\n", 34 ); } } zend_end_try(); return ret; } static void cli_usage( TSRMLS_D ) { static const char * usage = "Usage: php\n" " php -[b|c|n|h|i|q|s|v|?] [] [args...]\n" " Run in LSAPI mode, only '-b', '-s' and '-c' are effective\n" " Run in Command Line Interpreter mode when parameters are specified\n" "\n" " -b | Bind Path for external LSAPI Server mode\n" " -c | Look for php.ini file in this directory\n" " -n No php.ini file will be used\n" " -h This help\n" " -i PHP information\n" " -l Syntax check\n" " -q Quiet-mode. Suppress HTTP Header output.\n" " -s Display colour syntax highlighted source.\n" " -v Version number\n" " -? This help\n" "\n" " args... Arguments passed to script.\n"; php_output_startup(); php_output_activate(TSRMLS_C); php_printf( "%s", usage ); #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); #else php_end_ob_buffers(1 TSRMLS_CC); #endif } static int parse_opt( int argc, char * argv[], int *climode, char **php_ini_path, char ** php_bind ) { char ** p = &argv[1]; char ** argend= &argv[argc]; int c; while (( p < argend )&&(**p == '-' )) { c = *((*p)+1); ++p; switch( c ) { case 'b': if ( p >= argend ) { fprintf( stderr, "TCP or socket address must be specified following '-b' option.\n"); return -1; } *php_bind = strdup(*p++); break; case 'c': if ( p >= argend ) { fprintf( stderr, " or must be specified following '-c' option.\n"); return -1; } *php_ini_path = strdup( *p++ ); break; case 's': source_highlight = 1; break; case 'n': ignore_php_ini = 1; break; case '?': if ( *((*(p-1))+2) == 's' ) exit( 99 ); /* fall through */ case 'h': case 'i': case 'l': case 'q': case 'v': default: *climode = 1; break; } } if ( p - argv < argc ) { *climode = 1; } return 0; } static int cli_main( int argc, char * argv[] ) { static const char * ini_defaults[] = { "report_zend_debug", "0", "display_errors", "1", "register_argc_argv", "1", "html_errors", "0", "implicit_flush", "1", "output_buffering", "0", "max_execution_time", "0", "max_input_time", "-1", NULL }; const char ** ini; char ** p = &argv[1]; char ** argend= &argv[argc]; int ret = -1; int c; #if PHP_MAJOR_VERSION >= 7 zend_string * psKey; #endif lsapi_mode = 0; /* enter CLI mode */ #ifdef PHP_WIN32 _fmode = _O_BINARY; /*sets default for file streams to binary */ setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif zend_first_try { SG(server_context) = (void *) 1; zend_uv.html_errors = 0; /* tell the engine we're in non-html mode */ CG(in_compilation) = 0; /* not initialized but needed for several options */ SG(options) |= SAPI_OPTION_NO_CHDIR; #if PHP_MAJOR_VERSION < 7 EG(uninitialized_zval_ptr) = NULL; #endif for( ini = ini_defaults; *ini; ini+=2 ) { #if PHP_MAJOR_VERSION >= 7 psKey = zend_string_init( *ini, strlen( *ini ), 1 ); zend_alter_ini_entry_chars( psKey, (char *)*(ini+1), strlen( *(ini+1) ), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); zend_string_release( psKey ); #else zend_alter_ini_entry( (char *)*ini, strlen( *ini )+1, (char *)*(ini+1), strlen( *(ini+1) ), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); #endif } while (( p < argend )&&(**p == '-' )) { c = *((*p)+1); ++p; switch( c ) { case 'q': break; case 'i': if (php_request_startup(TSRMLS_C) != FAILURE) { php_print_info(0xFFFFFFFF TSRMLS_CC); #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); #else php_end_ob_buffers(1 TSRMLS_CC); #endif php_request_shutdown( NULL ); ret = 0; } break; case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); #else php_end_ob_buffers(1 TSRMLS_CC); #endif php_request_shutdown( NULL ); ret = 0; } break; case 'c': ++p; /* fall through */ case 's': break; case 'l': source_highlight = 2; break; case 'h': case '?': default: cli_usage(TSRMLS_C); ret = 0; break; } } if ( ret == -1 ) { if ( *p ) { zend_file_handle file_handle; zend_stream_init_fp(&file_handle, VCWD_FOPEN(*p, "rb"), *p); #if PHP_MAJOR_VERSION > 8 || (PHP_MAJOR_VERSION == 8 && PHP_MINOR_VERSION >= 1) file_handle.primary_script = true; #endif if ( file_handle.handle.fp ) { script_filename = *p; php_self = *p; SG(request_info).path_translated = estrdup(*p); SG(request_info).argc = argc - (p - argv); SG(request_info).argv = p; if (php_request_startup(TSRMLS_C) == FAILURE ) { fclose( file_handle.handle.fp ); ret = 2; } else { if (source_highlight == 1) { zend_syntax_highlighter_ini syntax_highlighter_ini; php_get_highlight_struct(&syntax_highlighter_ini); highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC); } else if (source_highlight == 2) { ret = php_lint_script(&file_handle TSRMLS_CC); if (ret == SUCCESS) { zend_printf("No syntax errors detected in %s\n", *p); } else { zend_printf("Errors parsing %s\n", *p); } } else { php_execute_script(&file_handle TSRMLS_CC); ret = EG(exit_status); } php_request_shutdown( NULL ); } } else { php_printf("Could not open input file: %s.\n", *p); } } else { cli_usage(TSRMLS_C); } } }zend_end_try(); php_module_shutdown(TSRMLS_C); #ifdef ZTS tsrm_shutdown(); #endif return ret; } static int s_stop; void litespeed_cleanup(int signal) { s_stop = signal; } void start_children( int children ) { struct sigaction act, old_term, old_quit, old_int, old_usr1; int running = 0; int status; pid_t pid; /* Create a process group */ setsid(); /* Set up handler to kill children upon exit */ sigemptyset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = litespeed_cleanup; if( sigaction( SIGTERM, &act, &old_term ) || sigaction( SIGINT, &act, &old_int ) || sigaction( SIGUSR1, &act, &old_usr1 ) || sigaction( SIGQUIT, &act, &old_quit )) { perror( "Can't set signals" ); exit( 1 ); } s_stop = 0; while( 1 ) { while((!s_stop )&&( running < children )) { pid = fork(); switch( pid ) { case 0: /* children process */ /* don't catch our signals */ sigaction( SIGTERM, &old_term, 0 ); sigaction( SIGQUIT, &old_quit, 0 ); sigaction( SIGINT, &old_int, 0 ); sigaction( SIGUSR1, &old_usr1, 0 ); return ; case -1: perror( "php (pre-forking)" ); exit( 1 ); break; default: /* parent process */ running++; break; } } if ( s_stop ) { break; } pid = wait( &status ); running--; } kill( -getpgrp(), SIGUSR1 ); exit( 0 ); } void setArgv0( int argc, char * argv[] ) { char * p; int i; argv0 = argv[0] + strlen( argv[0] ); p = argv0; while(( p > argv[0] )&&( p[-1] != '/')) --p; if ( p > argv[0] ) { memmove( argv[0], p, argv0 - p ); memset( argv[0] + ( argv0 - p ), 0, p - argv[0] ); argv0 = argv[0] + (argv0 - p); } for( i = 1; i < argc; ++i ) { memset( argv[i], 0, strlen( argv[i] ) ); } } #include int main( int argc, char * argv[] ) { int ret; int bindFd; char * php_ini_path = NULL; char * php_bind = NULL; int n; int climode = 0; struct timeval tv_req_begin; struct timeval tv_req_end; int slow_script_msec = 0; char time_buf[40]; #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) signal(SIGPIPE, SIG_IGN); #endif #endif #ifdef ZTS tsrm_startup(1, 1, 0, NULL); #endif #if PHP_MAJOR_VERSION >= 7 #if defined(ZEND_SIGNALS) || PHP_MINOR_VERSION > 0 zend_signal_startup(); #endif #endif if (argc > 1 ) { if ( parse_opt( argc, argv, &climode, &php_ini_path, &php_bind ) == -1 ) { return 1; } } if ( climode ) { lsapi_sapi_module.phpinfo_as_text = 1; } else { setArgv0(argc, argv ); } sapi_startup(&lsapi_sapi_module); #ifdef ZTS compiler_globals = ts_resource(compiler_globals_id); executor_globals = ts_resource(executor_globals_id); core_globals = ts_resource(core_globals_id); sapi_globals = ts_resource(sapi_globals_id); tsrm_ls = ts_resource(0); SG(request_info).path_translated = NULL; #endif lsapi_sapi_module.executable_location = argv[0]; /* Initialize from environment variables before processing command-line * options: the latter override the former. */ init_sapi_from_env(&lsapi_sapi_module); if ( ignore_php_ini ) lsapi_sapi_module.php_ini_ignore = 1; if ( php_ini_path ) { lsapi_sapi_module.php_ini_path_override = php_ini_path; } lsapi_sapi_module.ini_defaults = sapi_lsapi_ini_defaults; if (php_module_startup(&lsapi_sapi_module, &litespeed_module_entry, 1) == FAILURE) { #ifdef ZTS tsrm_shutdown(); #endif return FAILURE; } if ( climode ) { return cli_main(argc, argv); } if ( php_bind ) { bindFd = LSAPI_CreateListenSock( php_bind, 10 ); if ( bindFd == -1 ) { fprintf( stderr, "Failed to bind socket [%s]: %s\n", php_bind, strerror( errno ) ); exit( 2 ); } if ( bindFd != 0 ) { dup2( bindFd, 0 ); close( bindFd ); } } LSAPI_Init(); #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) int is_criu = LSCRIU_Init(); // Must be called before the regular init as it unsets the parameters. #endif LSAPI_Init_Env_Parameters( NULL ); lsapi_mode = 1; slow_script_msec = LSAPI_Get_Slow_Req_Msecs(); if ( php_bind ) { LSAPI_No_Check_ppid(); free( php_bind ); php_bind = NULL; } int result; if (do_clean_shutdown) atexit(lsapi_atexit); while( ( result = LSAPI_Prefork_Accept_r( &g_req )) >= 0 ) { #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) if (is_criu && !result) { LSCRIU_inc_req_processed(); } #endif if ( slow_script_msec ) { gettimeofday( &tv_req_begin, NULL ); } ret = processReq(TSRMLS_C); if ( slow_script_msec ) { gettimeofday( &tv_req_end, NULL ); n = ((long) tv_req_end.tv_sec - tv_req_begin.tv_sec ) * 1000 + (tv_req_end.tv_usec - tv_req_begin.tv_usec) / 1000; if ( n > slow_script_msec ) { strftime( time_buf, 30, "%d/%b/%Y:%H:%M:%S", localtime( &tv_req_end.tv_sec ) ); fprintf( stderr, "[%s] Slow PHP script: %d ms\n URL: %s %s\n Query String: %s\n Script: %s\n", time_buf, n, LSAPI_GetRequestMethod(), LSAPI_GetScriptName(), LSAPI_GetQueryString(), LSAPI_GetScriptFileName() ); } } LSAPI_Finish(); if ( ret ) { break; } } php_module_shutdown(TSRMLS_C); #ifdef ZTS tsrm_shutdown(); #endif return ret; } /* LiteSpeed PHP module starts here */ #if PHP_MAJOR_VERSION > 4 /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO(arginfo_litespeed__void, 0) ZEND_END_ARG_INFO() /* }}} */ #else #define arginfo_litespeed__void NULL #endif PHP_FUNCTION(litespeed_request_headers); PHP_FUNCTION(litespeed_response_headers); PHP_FUNCTION(apache_get_modules); PHP_FUNCTION(litespeed_finish_request); PHP_MINFO_FUNCTION(litespeed); static const zend_function_entry litespeed_functions[] = { PHP_FE(litespeed_request_headers, arginfo_litespeed__void) PHP_FE(litespeed_response_headers, arginfo_litespeed__void) PHP_FE(apache_get_modules, arginfo_litespeed__void) PHP_FE(litespeed_finish_request, arginfo_litespeed__void) PHP_FALIAS(getallheaders, litespeed_request_headers, arginfo_litespeed__void) PHP_FALIAS(apache_request_headers, litespeed_request_headers, arginfo_litespeed__void) PHP_FALIAS(apache_response_headers, litespeed_response_headers, arginfo_litespeed__void) PHP_FE_END }; static PHP_MINIT_FUNCTION(litespeed) { user_config_cache_init(); const char *p = getenv("LSPHP_ENABLE_USER_INI"); if (p && 0 == strcasecmp(p, "on")) parse_user_ini = 1; p = getenv("LSAPI_CLEAN_SHUTDOWN"); if (p) { if (*p == '1' || 0 == strcasecmp(p, "on")) do_clean_shutdown = 1; else if (*p == '0' || 0 == strcasecmp(p, "off")) do_clean_shutdown = 0; } p = getenv("LSAPI_MAX_CMD_SCRIPT_PATH_LEN"); if (p) { int len = atoi(p); if (len > 0 && len < 256) max_cmd_script_path_len = len; } /* * mod_lsapi always sets this env var, * so we can detect mod_lsapi mode with its presense. */ mod_lsapi_mode = ( getenv("LSAPI_DISABLE_CPAN_BEHAV") != NULL ); /* REGISTER_INI_ENTRIES(); */ return SUCCESS; } static PHP_MSHUTDOWN_FUNCTION(litespeed) { zend_hash_destroy(&user_config_cache); /* UNREGISTER_INI_ENTRIES(); */ return SUCCESS; } zend_module_entry litespeed_module_entry = { STANDARD_MODULE_HEADER, "litespeed", litespeed_functions, PHP_MINIT(litespeed), PHP_MSHUTDOWN(litespeed), NULL, NULL, NULL, NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; static int add_associate_array( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { #if PHP_MAJOR_VERSION < 7 add_assoc_string_ex((zval *)arg, (char *)pKey, keyLen+1, (char *)pValue, 1); #else add_assoc_string_ex((zval *)arg, (char *)pKey, keyLen, (char *)pValue); #endif return 1; } /* {{{ proto array litespeed_request_headers(void) Fetch all HTTP request headers */ PHP_FUNCTION(litespeed_request_headers) { /* TODO: */ if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } array_init(return_value); LSAPI_ForeachOrgHeader( add_associate_array, return_value ); } /* }}} */ /* {{{ proto array litespeed_response_headers(void) Fetch all HTTP response headers */ PHP_FUNCTION(litespeed_response_headers) { sapi_header_struct *h; zend_llist_position pos; char * p; int len; char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH]; if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } if (!&SG(sapi_headers).headers) { RETURN_FALSE; } array_init(return_value); h = zend_llist_get_first_ex(&SG(sapi_headers).headers, &pos); while (h) { if ( h->header_len > 0 ) { p = strchr( h->header, ':' ); len = p - h->header; if (p && len > 0 && len < LSAPI_RESP_HTTP_HEADER_MAX) { memmove( headerBuf, h->header, len ); while( len > 0 && (isspace( headerBuf[len-1])) ) { --len; } headerBuf[len] = 0; if ( len ) { while( isspace(*++p)); #if PHP_MAJOR_VERSION < 7 add_assoc_string_ex(return_value, headerBuf, len+1, p, 1); #else add_assoc_string_ex(return_value, headerBuf, len, p); #endif } } } h = zend_llist_get_next_ex(&SG(sapi_headers).headers, &pos); } } /* }}} */ /* {{{ proto array apache_get_modules(void) Fetch all loaded module names */ PHP_FUNCTION(apache_get_modules) { static const char * mod_names[] = { "mod_rewrite", "mod_mime", "mod_headers", "mod_expires", "mod_auth_basic", NULL }; const char **name = mod_names; /* TODO: */ if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } array_init(return_value); while( *name ) { add_next_index_string(return_value, (char *)*name #if PHP_MAJOR_VERSION < 7 , 1 #endif ); ++name; } } /* }}} */ /* {{{ proto array litespeed_finish_request(void) Flushes all response data to the client */ PHP_FUNCTION(litespeed_finish_request) { if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); #else php_end_ob_buffers(1 TSRMLS_CC); #endif php_header(TSRMLS_C); if (LSAPI_End_Response() != -1) { RETURN_TRUE; } RETURN_FALSE; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!,  $php-5.6.40/sapi/litespeed/lsapilib.cnu[//#define LSAPI_DEBUG /* Copyright (c) 2002-2018, Lite Speed Technologies Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Lite Speed Technologies Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lsapilib.h" #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) #include #endif #if defined(__FreeBSD__ ) || defined(__NetBSD__) || defined(__OpenBSD__) \ || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) #include #endif #include #ifndef uint32 #define uint32 uint32_t #endif struct lsapi_MD5Context { uint32 buf[4]; uint32 bits[2]; unsigned char in[64]; }; void lsapi_MD5Init(struct lsapi_MD5Context *context); void lsapi_MD5Update(struct lsapi_MD5Context *context, unsigned char const *buf, unsigned len); void lsapi_MD5Final(unsigned char digest[16], struct lsapi_MD5Context *context); /* * This is needed to make RSAREF happy on some MS-DOS compilers. */ typedef struct lsapi_MD5Context lsapi_MD5_CTX; #define LSAPI_ST_REQ_HEADER 1 #define LSAPI_ST_REQ_BODY 2 #define LSAPI_ST_RESP_HEADER 4 #define LSAPI_ST_RESP_BODY 8 #define LSAPI_ST_BACKGROUND 16 #define LSAPI_RESP_BUF_SIZE 8192 #define LSAPI_INIT_RESP_HEADER_LEN 4096 enum { LSAPI_STATE_IDLE, LSAPI_STATE_CONNECTED, LSAPI_STATE_ACCEPTING, }; typedef struct lsapi_child_status { int m_pid; long m_tmStart; volatile short m_iKillSent; volatile char m_inProcess; volatile char m_state; volatile int m_iReqCounter; volatile long m_tmWaitBegin; volatile long m_tmReqBegin; volatile long m_tmLastCheckPoint; } lsapi_child_status; static lsapi_child_status * s_worker_status = NULL; static int g_inited = 0; static int g_running = 1; static int s_ppid; static int s_restored_ppid = 0; static int s_pid = 0; static int s_slow_req_msecs = 0; static int s_keep_listener = 1; static int s_dump_debug_info = 0; static int s_pid_dump_debug_info = 0; static int s_req_processed = 0; static int s_skip_write = 0; static int (*pthread_atfork_func)(void (*prepare)(void), void (*parent)(void), void (*child)(void)) = NULL; static int *s_busy_workers = NULL; static int *s_accepting_workers = NULL; static int *s_global_counter = &s_req_processed; static int s_max_busy_workers = -1; static char *s_stderr_log_path = NULL; static int s_stderr_is_pipe = 0; static int s_ignore_pid = -1; static size_t s_total_pages = 1; static size_t s_min_avail_pages = 256 * 1024; static size_t *s_avail_pages = &s_total_pages; LSAPI_Request g_req = { .m_fdListen = -1, .m_fd = -1 }; static char s_secret[24]; static LSAPI_On_Timer_pf s_proc_group_timer_cb = NULL; void Flush_RespBuf_r( LSAPI_Request * pReq ); static int lsapi_reopen_stderr(const char *p); static const char *CGI_HEADERS[H_TRANSFER_ENCODING+1] = { "HTTP_ACCEPT", "HTTP_ACCEPT_CHARSET", "HTTP_ACCEPT_ENCODING", "HTTP_ACCEPT_LANGUAGE", "HTTP_AUTHORIZATION", "HTTP_CONNECTION", "CONTENT_TYPE", "CONTENT_LENGTH", "HTTP_COOKIE", "HTTP_COOKIE2", "HTTP_HOST", "HTTP_PRAGMA", "HTTP_REFERER", "HTTP_USER_AGENT", "HTTP_CACHE_CONTROL", "HTTP_IF_MODIFIED_SINCE", "HTTP_IF_MATCH", "HTTP_IF_NONE_MATCH", "HTTP_IF_RANGE", "HTTP_IF_UNMODIFIED_SINCE", "HTTP_KEEP_ALIVE", "HTTP_RANGE", "HTTP_X_FORWARDED_FOR", "HTTP_VIA", "HTTP_TRANSFER_ENCODING" }; static int CGI_HEADER_LEN[H_TRANSFER_ENCODING+1] = { 11, 19, 20, 20, 18, 15, 12, 14, 11, 12, 9, 11, 12, 15, 18, 22, 13, 18, 13, 24, 15, 10, 20, 8, 22 }; static const char *HTTP_HEADERS[H_TRANSFER_ENCODING+1] = { "Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", "Authorization", "Connection", "Content-Type", "Content-Length", "Cookie", "Cookie2", "Host", "Pragma", "Referer", "User-Agent", "Cache-Control", "If-Modified-Since", "If-Match", "If-None-Match", "If-Range", "If-Unmodified-Since", "Keep-Alive", "Range", "X-Forwarded-For", "Via", "Transfer-Encoding" }; static int HTTP_HEADER_LEN[H_TRANSFER_ENCODING+1] = { 6, 14, 15, 15, 13, 10, 12, 14, 6, 7, 4, 6, 7, 10, //user-agent 13,17, 8, 13, 8, 19, 10, 5, 15, 3, 17 }; static const char *s_log_level_names[8] = { "", "DEBUG","INFO", "NOTICE", "WARN", "ERROR", "CRIT", "FATAL" }; void LSAPI_Log(int flag, const char * fmt, ...) { char buf[1024]; char *p = buf; if ((flag & LSAPI_LOG_TIMESTAMP_BITS) && !(s_stderr_is_pipe)) { struct timeval tv; struct tm tm; gettimeofday(&tv, NULL); localtime_r(&tv.tv_sec, &tm); if (flag & LSAPI_LOG_TIMESTAMP_FULL) { p += snprintf(p, 1024, "%04d-%02d-%02d %02d:%02d:%02d.%06d ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, (int)tv.tv_usec); } else if (flag & LSAPI_LOG_TIMESTAMP_HMS) { p += snprintf(p, 1024, "%02d:%02d:%02d ", tm.tm_hour, tm.tm_min, tm.tm_sec); } } int level = flag & LSAPI_LOG_LEVEL_BITS; if (level && level <= LSAPI_LOG_FLAG_FATAL) { p += snprintf(p, 100, "[%s] ", s_log_level_names[level]); } if (flag & LSAPI_LOG_PID) { p += snprintf(p, 100, "[UID:%d][%d] ", getuid(), s_pid); } if (p > buf) fprintf(stderr, "%.*s", (int)(p - buf), buf); va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); } #ifdef LSAPI_DEBUG #define DBGLOG_FLAG (LSAPI_LOG_TIMESTAMP_FULL|LSAPI_LOG_FLAG_DEBUG|LSAPI_LOG_PID) #define lsapi_dbg(...) LSAPI_Log(DBGLOG_FLAG, __VA_ARGS__) #else #define lsapi_dbg(...) #endif #define lsapi_log(...) LSAPI_Log(LSAPI_LOG_TIMESTAMP_FULL|LSAPI_LOG_PID, __VA_ARGS__) void lsapi_perror(const char * pMessage, int err_no) { lsapi_log("%s, errno: %d (%s)\n", pMessage, err_no, strerror(err_no)); } static int lsapi_parent_dead() { // Return non-zero if the parent is dead. 0 if still alive. if (!s_ppid) { // not checking, so not dead return(0); } if (s_restored_ppid) { if (kill(s_restored_ppid,0) == -1) { if (errno == EPERM) { return(0); // no permission, but it's still there. } return(1); // Dead } return(0); // it worked, so it's not dead } return(s_ppid != getppid()); } static void lsapi_sigpipe( int sig ) { } static void lsapi_siguser1( int sig ) { g_running = 0; } #ifndef sighandler_t typedef void (*sighandler_t)(int); #endif static void lsapi_signal(int signo, sighandler_t handler) { struct sigaction sa; sigaction(signo, NULL, &sa); if (sa.sa_handler == SIG_DFL) { sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sa.sa_handler = handler; sigaction(signo, &sa, NULL); } } static int s_enable_core_dump = 0; static void lsapi_enable_core_dump(void) { #if defined(__FreeBSD__ ) || defined(__NetBSD__) || defined(__OpenBSD__) \ || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) int mib[2]; size_t len; #if !defined(__OpenBSD__) len = 2; if ( sysctlnametomib("kern.sugid_coredump", mib, &len) == 0 ) { len = sizeof(s_enable_core_dump); if (sysctl(mib, 2, NULL, 0, &s_enable_core_dump, len) == -1) perror( "sysctl: Failed to set 'kern.sugid_coredump', " "core dump may not be available!"); } #else int set = 3; len = sizeof(set); mib[0] = CTL_KERN; mib[1] = KERN_NOSUIDCOREDUMP; if (sysctl(mib, 2, NULL, 0, &set, len) == 0) { s_enable_core_dump = 1; } #endif #endif #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) if (prctl(PR_SET_DUMPABLE, s_enable_core_dump,0,0,0) == -1) perror( "prctl: Failed to set dumpable, " "core dump may not be available!"); #endif } static inline void lsapi_buildPacketHeader( struct lsapi_packet_header * pHeader, char type, int len ) { pHeader->m_versionB0 = LSAPI_VERSION_B0; /* LSAPI protocol version */ pHeader->m_versionB1 = LSAPI_VERSION_B1; pHeader->m_type = type; pHeader->m_flag = LSAPI_ENDIAN; pHeader->m_packetLen.m_iLen = len; } static int lsapi_set_nblock( int fd, int nonblock ) { int val = fcntl( fd, F_GETFL, 0 ); if ( nonblock ) { if (!( val & O_NONBLOCK )) { return fcntl( fd, F_SETFL, val | O_NONBLOCK ); } } else { if ( val & O_NONBLOCK ) { return fcntl( fd, F_SETFL, val &(~O_NONBLOCK) ); } } return 0; } static int lsapi_close( int fd ) { int ret; while( 1 ) { ret = close( fd ); if (( ret == -1 )&&( errno == EINTR )&&(g_running)) continue; return ret; } } static void lsapi_close_connection(LSAPI_Request *pReq) { if (pReq->m_fd == -1) return; lsapi_close(pReq->m_fd); pReq->m_fd = -1; if (s_busy_workers) __sync_fetch_and_sub(s_busy_workers, 1); if (s_worker_status) __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_IDLE); } static inline ssize_t lsapi_read( int fd, void * pBuf, size_t len ) { ssize_t ret; while( 1 ) { ret = read( fd, (char *)pBuf, len ); if (( ret == -1 )&&( errno == EINTR )&&(g_running)) continue; return ret; } } /* static int lsapi_write( int fd, const void * pBuf, int len ) { int ret; const char * pCur; const char * pEnd; if ( len == 0 ) return 0; pCur = (const char *)pBuf; pEnd = pCur + len; while( g_running && (pCur < pEnd) ) { ret = write( fd, pCur, pEnd - pCur ); if ( ret >= 0) pCur += ret; else if (( ret == -1 )&&( errno != EINTR )) return ret; } return pCur - (const char *)pBuf; } */ static int lsapi_writev( int fd, struct iovec ** pVec, int count, int totalLen ) { int ret; int left = totalLen; int n = count; if (s_skip_write) return totalLen; while(( left > 0 )&&g_running ) { ret = writev( fd, *pVec, n ); if ( ret > 0 ) { left -= ret; if (( left <= 0)||( !g_running )) return totalLen - left; while( ret > 0 ) { if ( (*pVec)->iov_len <= (unsigned int )ret ) { ret -= (*pVec)->iov_len; ++(*pVec); } else { (*pVec)->iov_base = (char *)(*pVec)->iov_base + ret; (*pVec)->iov_len -= ret; break; } } } else if ( ret == -1 ) { if ( errno == EAGAIN ) { if ( totalLen - left > 0 ) return totalLen - left; else return -1; } else if ( errno != EINTR ) return ret; } } return totalLen - left; } /* static int getTotalLen( struct iovec * pVec, int count ) { struct iovec * pEnd = pVec + count; int total = 0; while( pVec < pEnd ) { total += pVec->iov_len; ++pVec; } return total; } */ static inline int allocateBuf( LSAPI_Request * pReq, int size ) { char * pBuf = (char *)realloc( pReq->m_pReqBuf, size ); if ( pBuf ) { pReq->m_pReqBuf = pBuf; pReq->m_reqBufSize = size; pReq->m_pHeader = (struct lsapi_req_header *)pReq->m_pReqBuf; return 0; } return -1; } static int allocateIovec( LSAPI_Request * pReq, int n ) { struct iovec * p = (struct iovec *)realloc( pReq->m_pIovec, sizeof(struct iovec) * n ); if ( !p ) return -1; pReq->m_pIovecToWrite = p + ( pReq->m_pIovecToWrite - pReq->m_pIovec ); pReq->m_pIovecCur = p + ( pReq->m_pIovecCur - pReq->m_pIovec ); pReq->m_pIovec = p; pReq->m_pIovecEnd = p + n; return 0; } static int allocateRespHeaderBuf( LSAPI_Request * pReq, int size ) { char * p = (char *)realloc( pReq->m_pRespHeaderBuf, size ); if ( !p ) return -1; pReq->m_pRespHeaderBufPos = p + ( pReq->m_pRespHeaderBufPos - pReq->m_pRespHeaderBuf ); pReq->m_pRespHeaderBuf = p; pReq->m_pRespHeaderBufEnd = p + size; return 0; } static inline int verifyHeader( struct lsapi_packet_header * pHeader, char pktType ) { if (( LSAPI_VERSION_B0 != pHeader->m_versionB0 )|| ( LSAPI_VERSION_B1 != pHeader->m_versionB1 )|| ( pktType != pHeader->m_type )) return -1; if ( LSAPI_ENDIAN != (pHeader->m_flag & LSAPI_ENDIAN_BIT )) { register char b; b = pHeader->m_packetLen.m_bytes[0]; pHeader->m_packetLen.m_bytes[0] = pHeader->m_packetLen.m_bytes[3]; pHeader->m_packetLen.m_bytes[3] = b; b = pHeader->m_packetLen.m_bytes[1]; pHeader->m_packetLen.m_bytes[1] = pHeader->m_packetLen.m_bytes[2]; pHeader->m_packetLen.m_bytes[2] = b; } return pHeader->m_packetLen.m_iLen; } static int allocateEnvList( struct LSAPI_key_value_pair ** pEnvList, int *curSize, int newSize ) { struct LSAPI_key_value_pair * pBuf; if ( *curSize >= newSize ) return 0; if ( newSize > 8192 ) return -1; pBuf = (struct LSAPI_key_value_pair *)realloc( *pEnvList, newSize * sizeof(struct LSAPI_key_value_pair) ); if ( pBuf ) { *pEnvList = pBuf; *curSize = newSize; return 0; } else return -1; } static inline int isPipe( int fd ) { char achPeer[128]; socklen_t len = 128; if (( getpeername( fd, (struct sockaddr *)achPeer, &len ) != 0 )&& ( errno == ENOTCONN )) return 0; else return 1; } static int parseEnv( struct LSAPI_key_value_pair * pEnvList, int count, char **pBegin, char * pEnd ) { struct LSAPI_key_value_pair * pEnvEnd; int keyLen = 0, valLen = 0; if ( count > 8192 ) return -1; pEnvEnd = pEnvList + count; while( pEnvList != pEnvEnd ) { if ( pEnd - *pBegin < 4 ) return -1; keyLen = *((unsigned char *)((*pBegin)++)); keyLen = (keyLen << 8) + *((unsigned char *)((*pBegin)++)); valLen = *((unsigned char *)((*pBegin)++)); valLen = (valLen << 8) + *((unsigned char *)((*pBegin)++)); if ( *pBegin + keyLen + valLen > pEnd ) return -1; if (( !keyLen )||( !valLen )) return -1; pEnvList->pKey = *pBegin; *pBegin += keyLen; pEnvList->pValue = *pBegin; *pBegin += valLen; pEnvList->keyLen = keyLen - 1; pEnvList->valLen = valLen - 1; ++pEnvList; } if ( memcmp( *pBegin, "\0\0\0\0", 4 ) != 0 ) return -1; *pBegin += 4; return 0; } static inline void swapIntEndian( int * pInteger ) { char * p = (char *)pInteger; register char b; b = p[0]; p[0] = p[3]; p[3] = b; b = p[1]; p[1] = p[2]; p[2] = b; } static inline void fixEndian( LSAPI_Request * pReq ) { struct lsapi_req_header *p= pReq->m_pHeader; swapIntEndian( &p->m_httpHeaderLen ); swapIntEndian( &p->m_reqBodyLen ); swapIntEndian( &p->m_scriptFileOff ); swapIntEndian( &p->m_scriptNameOff ); swapIntEndian( &p->m_queryStringOff ); swapIntEndian( &p->m_requestMethodOff ); swapIntEndian( &p->m_cntUnknownHeaders ); swapIntEndian( &p->m_cntEnv ); swapIntEndian( &p->m_cntSpecialEnv ); } static void fixHeaderIndexEndian( LSAPI_Request * pReq ) { int i; for( i = 0; i < H_TRANSFER_ENCODING; ++i ) { if ( pReq->m_pHeaderIndex->m_headerOff[i] ) { register char b; char * p = (char *)(&pReq->m_pHeaderIndex->m_headerLen[i]); b = p[0]; p[0] = p[1]; p[1] = b; swapIntEndian( &pReq->m_pHeaderIndex->m_headerOff[i] ); } } if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) { struct lsapi_header_offset * pCur, *pEnd; pCur = pReq->m_pUnknownHeader; pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; while( pCur < pEnd ) { swapIntEndian( &pCur->nameOff ); swapIntEndian( &pCur->nameLen ); swapIntEndian( &pCur->valueOff ); swapIntEndian( &pCur->valueLen ); ++pCur; } } } static int validateHeaders( LSAPI_Request * pReq ) { int totalLen = pReq->m_pHeader->m_httpHeaderLen; int i; for(i = 0; i < H_TRANSFER_ENCODING; ++i) { if ( pReq->m_pHeaderIndex->m_headerOff[i] ) { if (pReq->m_pHeaderIndex->m_headerOff[i] > totalLen || pReq->m_pHeaderIndex->m_headerLen[i] + pReq->m_pHeaderIndex->m_headerOff[i] > totalLen) return -1; } } if (pReq->m_pHeader->m_cntUnknownHeaders > 0) { struct lsapi_header_offset * pCur, *pEnd; pCur = pReq->m_pUnknownHeader; pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; while( pCur < pEnd ) { if (pCur->nameOff > totalLen || pCur->nameOff + pCur->nameLen > totalLen || pCur->valueOff > totalLen || pCur->valueOff + pCur->valueLen > totalLen) return -1; ++pCur; } } return 0; } static uid_t s_uid = 0; static uid_t s_defaultUid; //web server need set this static gid_t s_defaultGid; #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) #define LSAPI_LVE_DISABLED 0 #define LSAPI_LVE_ENABLED 1 #define LSAPI_CAGEFS_ENABLED 2 #define LSAPI_CAGEFS_NO_SUEXEC 3 struct liblve; static int s_enable_lve = LSAPI_LVE_DISABLED; static struct liblve * s_lve = NULL; static void *s_liblve; static int (*fp_lve_is_available)(void) = NULL; static int (*fp_lve_instance_init)(struct liblve *) = NULL; static int (*fp_lve_destroy)(struct liblve *) = NULL; static int (*fp_lve_enter)(struct liblve *, uint32_t, int32_t, int32_t, uint32_t *) = NULL; static int (*fp_lve_leave)(struct liblve *, uint32_t *) = NULL; static int (*fp_lve_jail)( struct passwd *, char *) = NULL; static int lsapi_load_lve_lib(void) { s_liblve = dlopen("liblve.so.0", RTLD_NOW | RTLD_GLOBAL); if (s_liblve) { fp_lve_is_available = dlsym(s_liblve, "lve_is_available"); if (dlerror() == NULL) { if ( !(*fp_lve_is_available)() ) { int uid = getuid(); if ( uid ) { if (setreuid( s_uid, uid )) {}; if ( !(*fp_lve_is_available)() ) s_enable_lve = 0; if (setreuid( uid, s_uid )) {}; } } } } else { s_enable_lve = LSAPI_LVE_DISABLED; } return (s_liblve)? 0 : -1; } static int init_lve_ex(void) { int rc; if ( !s_liblve ) return -1; fp_lve_instance_init = dlsym(s_liblve, "lve_instance_init"); fp_lve_destroy = dlsym(s_liblve, "lve_destroy"); fp_lve_enter = dlsym(s_liblve, "lve_enter"); fp_lve_leave = dlsym(s_liblve, "lve_leave"); if ( s_enable_lve >= LSAPI_CAGEFS_ENABLED ) fp_lve_jail = dlsym(s_liblve, "jail" ); if ( s_lve == NULL ) { rc = (*fp_lve_instance_init)(NULL); s_lve = malloc(rc); } rc = (*fp_lve_instance_init)(s_lve); if (rc != 0) { perror( "LSAPI: Unable to initialize LVE" ); free( s_lve ); s_lve = NULL; return -1; } return 0; } #endif static int readSecret( const char * pSecretFile ) { struct stat st; int fd = open( pSecretFile, O_RDONLY , 0600 ); if ( fd == -1 ) { lsapi_log("LSAPI: failed to open secret file: %s!\n", pSecretFile ); return -1; } if ( fstat( fd, &st ) == -1 ) { lsapi_log("LSAPI: failed to check state of file: %s!\n", pSecretFile ); close( fd ); return -1; } /* if ( st.st_uid != s_uid ) { lsapi_log("LSAPI: file owner check failure: %s!\n", pSecretFile ); close( fd ); return -1; } */ if ( st.st_mode & 0077 ) { lsapi_log("LSAPI: file permission check failure: %s\n", pSecretFile ); close( fd ); return -1; } if ( read( fd, s_secret, 16 ) < 16 ) { lsapi_log("LSAPI: failed to read secret from secret file: %s\n", pSecretFile ); close( fd ); return -1; } close( fd ); return 0; } int LSAPI_is_suEXEC_Daemon(void) { if (( !s_uid )&&( s_secret[0] )) return 1; else return 0; } static int LSAPI_perror_r( LSAPI_Request * pReq, const char * pErr1, const char *pErr2 ) { char achError[4096]; int n = snprintf(achError, sizeof(achError), "[UID:%d][%d] %s:%s: %s\n", getuid(), getpid(), pErr1, (pErr2)?pErr2:"", strerror(errno)); if (n > (int)sizeof(achError)) n = sizeof(achError); if ( pReq ) LSAPI_Write_Stderr_r( pReq, achError, n ); else if (write( STDERR_FILENO, achError, n )) {}; return 0; } static int lsapi_lve_error( LSAPI_Request * pReq ) { static const char * headers[] = { "Cache-Control: private, no-cache, no-store, must-revalidate, max-age=0", "Pragma: no-cache", "Retry-After: 60", "Content-Type: text/html", NULL }; static const char achBody[] = "\n" "\n508 Resource Limit Is Reached\n" "\n" "

Resource Limit Is Reached

\n" "The website is temporarily unable to service your request as it exceeded resource limit.\n" "Please try again later.\n" "
\n" "\n"; LSAPI_ErrResponse_r( pReq, 508, headers, achBody, sizeof( achBody ) - 1 ); return 0; } static int lsapi_enterLVE( LSAPI_Request * pReq, uid_t uid ) { #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) if ( s_lve && uid ) //root user should not do that { uint32_t cookie; int ret = -1; ret = (*fp_lve_enter)(s_lve, uid, -1, -1, &cookie); if ( ret < 0 ) { //lsapi_log("enter LVE (%d) : result: %d !\n", uid, ret ); LSAPI_perror_r(pReq, "LSAPI: lve_enter() failure, reached resource limit.", NULL ); lsapi_lve_error( pReq ); return -1; } } #endif return 0; } static int lsapi_jailLVE( LSAPI_Request * pReq, uid_t uid, struct passwd * pw ) { int ret = 0; #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) char error_msg[1024] = ""; ret = (*fp_lve_jail)( pw, error_msg ); if ( ret < 0 ) { lsapi_log("LSAPI: LVE jail(%d) result: %d, error: %s !\n", uid, ret, error_msg ); LSAPI_perror_r( pReq, "LSAPI: jail() failure.", NULL ); return -1; } #endif return ret; } #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) static int lsapi_initLVE(void) { const char * pEnv; if ( (pEnv = getenv( "LSAPI_LVE_ENABLE" ))!= NULL ) { s_enable_lve = atol( pEnv ); pEnv = NULL; } else if ( (pEnv = getenv( "LVE_ENABLE" ))!= NULL ) { s_enable_lve = atol( pEnv ); pEnv = NULL; } if ( s_enable_lve && !s_uid ) { lsapi_load_lve_lib(); if ( s_enable_lve ) { return init_lve_ex(); } } return 0; } #endif static int setUID_LVE(LSAPI_Request * pReq, uid_t uid, gid_t gid, const char * pChroot) { int rv; struct passwd * pw; pw = getpwuid( uid ); #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) if ( s_lve ) { if( lsapi_enterLVE( pReq, uid ) == -1 ) return -1; if ( pw && fp_lve_jail) { rv = lsapi_jailLVE( pReq, uid, pw ); if ( rv == -1 ) return -1; if (( rv == 1 )&&(s_enable_lve == LSAPI_CAGEFS_NO_SUEXEC )) //this mode only use cageFS, does not use suEXEC { uid = s_defaultUid; gid = s_defaultGid; pw = getpwuid( uid ); } } } #endif //if ( !uid || !gid ) //do not allow root //{ // return -1; //} #if defined(__FreeBSD__ ) || defined(__NetBSD__) || defined(__OpenBSD__) \ || defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) if ( s_enable_core_dump ) lsapi_enable_core_dump(); #endif rv = setgid(gid); if (rv == -1) { LSAPI_perror_r(pReq, "LSAPI: setgid()", NULL); return -1; } if ( pw && (pw->pw_gid == gid )) { rv = initgroups( pw->pw_name, gid ); if (rv == -1) { LSAPI_perror_r(pReq, "LSAPI: initgroups()", NULL); return -1; } } else { rv = setgroups(1, &gid); if (rv == -1) { LSAPI_perror_r(pReq, "LSAPI: setgroups()", NULL); } } if ( pChroot ) { rv = chroot( pChroot ); if ( rv == -1 ) { LSAPI_perror_r(pReq, "LSAPI: chroot()", NULL); return -1; } } rv = setuid(uid); if (rv == -1) { LSAPI_perror_r(pReq, "LSAPI: setuid()", NULL); return -1; } #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) if ( s_enable_core_dump ) lsapi_enable_core_dump(); #endif return 0; } static int lsapi_suexec_auth( LSAPI_Request *pReq, char * pAuth, int len, char * pUgid, int ugidLen ) { lsapi_MD5_CTX md5ctx; unsigned char achMD5[16]; if ( len < 32 ) return -1; memmove( achMD5, pAuth + 16, 16 ); memmove( pAuth + 16, s_secret, 16 ); lsapi_MD5Init( &md5ctx ); lsapi_MD5Update( &md5ctx, (unsigned char *)pAuth, 32 ); lsapi_MD5Update( &md5ctx, (unsigned char *)pUgid, 8 ); lsapi_MD5Final( (unsigned char *)pAuth + 16, &md5ctx); if ( memcmp( achMD5, pAuth + 16, 16 ) == 0 ) return 0; return 1; } static int lsapi_changeUGid( LSAPI_Request * pReq ) { int uid = s_defaultUid; int gid = s_defaultGid; const char *pStderrLog; const char *pChroot = NULL; struct LSAPI_key_value_pair * pEnv; struct LSAPI_key_value_pair * pAuth; int i; if ( s_uid ) return 0; //with special ID 0x00 //authenticate the suEXEC request; //first one should be MD5( nonce + lscgid secret ) //remember to clear the secret after verification //it should be set at the end of special env i = pReq->m_pHeader->m_cntSpecialEnv - 1; if ( i >= 0 ) { pEnv = pReq->m_pSpecialEnvList + i; if (( *pEnv->pKey == '\000' )&& ( strcmp( pEnv->pKey+1, "SUEXEC_AUTH" ) == 0 )) { --pReq->m_pHeader->m_cntSpecialEnv; pAuth = pEnv--; if (( *pEnv->pKey == '\000' )&& ( strcmp( pEnv->pKey+1, "SUEXEC_UGID" ) == 0 )) { --pReq->m_pHeader->m_cntSpecialEnv; uid = *(uint32_t *)pEnv->pValue; gid = *(((uint32_t *)pEnv->pValue) + 1 ); //lsapi_log("LSAPI: SUEXEC_UGID set UID: %d, GID: %d\n", uid, gid ); } else { lsapi_log("LSAPI: missing SUEXEC_UGID env, use default user!\n" ); pEnv = NULL; } if ( pEnv&& lsapi_suexec_auth( pReq, pAuth->pValue, pAuth->valLen, pEnv->pValue, pEnv->valLen ) == 0 ) { //read UID, GID from specialEnv } else { //authentication error lsapi_log("LSAPI: SUEXEC_AUTH authentication failed, use default user!\n" ); uid = 0; } } else { //lsapi_log("LSAPI: no SUEXEC_AUTH env, use default user!\n" ); } } if ( !uid ) { uid = s_defaultUid; gid = s_defaultGid; } //change uid if ( setUID_LVE( pReq, uid, gid, pChroot ) == -1 ) { return -1; } s_uid = uid; if ( pReq->m_fdListen != -1 ) { close( pReq->m_fdListen ); pReq->m_fdListen = -1; } pStderrLog = LSAPI_GetEnv_r( pReq, "LSAPI_STDERR_LOG"); if (pStderrLog) lsapi_reopen_stderr(pStderrLog); return 0; } static int parseContentLenFromHeader(LSAPI_Request * pReq) { const char * pContentLen = LSAPI_GetHeader_r( pReq, H_CONTENT_LENGTH ); if ( pContentLen ) pReq->m_reqBodyLen = strtoll( pContentLen, NULL, 10 ); return 0; } static int parseRequest( LSAPI_Request * pReq, int totalLen ) { int shouldFixEndian; char * pBegin = pReq->m_pReqBuf + sizeof( struct lsapi_req_header ); char * pEnd = pReq->m_pReqBuf + totalLen; shouldFixEndian = ( LSAPI_ENDIAN != ( pReq->m_pHeader->m_pktHeader.m_flag & LSAPI_ENDIAN_BIT ) ); if ( shouldFixEndian ) { fixEndian( pReq ); } if ( (pReq->m_specialEnvListSize < pReq->m_pHeader->m_cntSpecialEnv )&& allocateEnvList( &pReq->m_pSpecialEnvList, &pReq->m_specialEnvListSize, pReq->m_pHeader->m_cntSpecialEnv ) == -1 ) return -1; if ( (pReq->m_envListSize < pReq->m_pHeader->m_cntEnv )&& allocateEnvList( &pReq->m_pEnvList, &pReq->m_envListSize, pReq->m_pHeader->m_cntEnv ) == -1 ) return -1; if ( parseEnv( pReq->m_pSpecialEnvList, pReq->m_pHeader->m_cntSpecialEnv, &pBegin, pEnd ) == -1 ) return -1; if ( parseEnv( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv, &pBegin, pEnd ) == -1 ) return -1; if (pReq->m_pHeader->m_scriptFileOff < 0 || pReq->m_pHeader->m_scriptFileOff >= totalLen || pReq->m_pHeader->m_scriptNameOff < 0 || pReq->m_pHeader->m_scriptNameOff >= totalLen || pReq->m_pHeader->m_queryStringOff < 0 || pReq->m_pHeader->m_queryStringOff >= totalLen || pReq->m_pHeader->m_requestMethodOff < 0 || pReq->m_pHeader->m_requestMethodOff >= totalLen) { lsapi_log("Bad request header - ERROR#1\n"); return -1; } pReq->m_pScriptFile = pReq->m_pReqBuf + pReq->m_pHeader->m_scriptFileOff; pReq->m_pScriptName = pReq->m_pReqBuf + pReq->m_pHeader->m_scriptNameOff; pReq->m_pQueryString = pReq->m_pReqBuf + pReq->m_pHeader->m_queryStringOff; pReq->m_pRequestMethod = pReq->m_pReqBuf + pReq->m_pHeader->m_requestMethodOff; pBegin = pReq->m_pReqBuf + (( pBegin - pReq->m_pReqBuf + 7 ) & (~0x7)); pReq->m_pHeaderIndex = ( struct lsapi_http_header_index * )pBegin; pBegin += sizeof( struct lsapi_http_header_index ); pReq->m_pUnknownHeader = (struct lsapi_header_offset *)pBegin; pBegin += sizeof( struct lsapi_header_offset) * pReq->m_pHeader->m_cntUnknownHeaders; pReq->m_pHttpHeader = pBegin; pBegin += pReq->m_pHeader->m_httpHeaderLen; if ( pBegin != pEnd ) { lsapi_log("Request header does match total size, total: %d, " "real: %ld\n", totalLen, pBegin - pReq->m_pReqBuf ); return -1; } if ( shouldFixEndian ) { fixHeaderIndexEndian( pReq ); } if (validateHeaders(pReq) == -1) { lsapi_log("Bad request header - ERROR#2\n"); return -1; } pReq->m_reqBodyLen = pReq->m_pHeader->m_reqBodyLen; if ( pReq->m_reqBodyLen == -2 ) { parseContentLenFromHeader(pReq); } return 0; } //OPTIMIZATION static char s_accept_notify = 0; static char s_schedule_notify = 0; static char s_notify_scheduled = 0; static char s_notified_pid = 0; static struct lsapi_packet_header s_ack = {'L', 'S', LSAPI_REQ_RECEIVED, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} }; static struct lsapi_packet_header s_conn_close_pkt = {'L', 'S', LSAPI_CONN_CLOSE, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} }; static inline int send_notification_pkt( int fd, struct lsapi_packet_header *pkt ) { if ( write( fd, pkt, LSAPI_PACKET_HEADER_LEN ) < LSAPI_PACKET_HEADER_LEN ) return -1; return 0; } static inline int send_req_received_notification( int fd ) { return send_notification_pkt(fd, &s_ack); } static inline int send_conn_close_notification( int fd ) { return send_notification_pkt(fd, &s_conn_close_pkt); } //static void lsapi_sigalarm( int sig ) //{ // if ( s_notify_scheduled ) // { // s_notify_scheduled = 0; // if ( g_req.m_fd != -1 ) // write_req_received_notification( g_req.m_fd ); // } //} static inline int lsapi_schedule_notify(void) { if ( !s_notify_scheduled ) { alarm( 2 ); s_notify_scheduled = 1; } return 0; } static inline int notify_req_received( int fd ) { if ( s_schedule_notify ) return lsapi_schedule_notify(); return send_req_received_notification( fd ); } static inline int lsapi_notify_pid( int fd ) { char achBuf[16]; lsapi_buildPacketHeader( (struct lsapi_packet_header *)achBuf, LSAPI_STDERR_STREAM, 8 + LSAPI_PACKET_HEADER_LEN ); memmove( &achBuf[8], "\0PID", 4 ); *((int *)&achBuf[12]) = getpid(); if ( write( fd, achBuf, 16 ) < 16 ) return -1; return 0; } static char s_conn_key_packet[16]; static inline int init_conn_key( int fd ) { struct lsapi_packet_header * pHeader = (struct lsapi_packet_header *)s_conn_key_packet; struct timeval tv; int i; gettimeofday( &tv, NULL ); srand( (tv.tv_sec % 0x1000 + tv.tv_usec) ^ rand() ); for( i = 8; i < 16; ++i ) { s_conn_key_packet[i]=(int) (256.0*rand()/(RAND_MAX+1.0)); } lsapi_buildPacketHeader( pHeader, LSAPI_REQ_RECEIVED, 8 + LSAPI_PACKET_HEADER_LEN ); if ( write( fd, s_conn_key_packet, LSAPI_PACKET_HEADER_LEN+8 ) < LSAPI_PACKET_HEADER_LEN+8 ) return -1; return 0; } static int readReq( LSAPI_Request * pReq ) { int len; int packetLen; if ( !pReq ) return -1; if ( pReq->m_reqBufSize < 8192 ) { if ( allocateBuf( pReq, 8192 ) == -1 ) return -1; } while ( pReq->m_bufRead < LSAPI_PACKET_HEADER_LEN ) { len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf, pReq->m_reqBufSize ); if ( len <= 0 ) return -1; pReq->m_bufRead += len; } pReq->m_reqState = LSAPI_ST_REQ_HEADER; packetLen = verifyHeader( &pReq->m_pHeader->m_pktHeader, LSAPI_BEGIN_REQUEST ); if ( packetLen < 0 ) { lsapi_log("packetLen < 0\n"); return -1; } if ( packetLen > LSAPI_MAX_HEADER_LEN ) { lsapi_log("packetLen > %d\n", LSAPI_MAX_HEADER_LEN ); return -1; } if ( packetLen + 1024 > pReq->m_reqBufSize ) { if ( allocateBuf( pReq, packetLen + 1024 ) == -1 ) return -1; } while( packetLen > pReq->m_bufRead ) { len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf + pReq->m_bufRead, packetLen - pReq->m_bufRead ); if ( len <= 0 ) return -1; pReq->m_bufRead += len; } if ( parseRequest( pReq, packetLen ) < 0 ) { lsapi_log("ParseRequest error\n"); return -1; } pReq->m_reqState = LSAPI_ST_REQ_BODY | LSAPI_ST_RESP_HEADER; if ( !s_uid ) { if ( lsapi_changeUGid( pReq ) ) return -1; memset(s_secret, 0, sizeof(s_secret)); } pReq->m_bufProcessed = packetLen; //OPTIMIZATION if ( !s_accept_notify && !s_notified_pid ) return notify_req_received( pReq->m_fd ); else { s_notified_pid = 0; return 0; } } int LSAPI_Init(void) { if ( !g_inited ) { s_uid = geteuid(); s_secret[0] = 0; lsapi_signal(SIGPIPE, lsapi_sigpipe); lsapi_signal(SIGUSR1, lsapi_siguser1); #if defined(SIGXFSZ) && defined(SIG_IGN) signal(SIGXFSZ, SIG_IGN); #endif /* let STDOUT function as STDERR, just in case writing to STDOUT directly */ dup2( 2, 1 ); if ( LSAPI_InitRequest( &g_req, LSAPI_SOCK_FILENO ) == -1 ) return -1; g_inited = 1; s_ppid = getppid(); void *pthread_lib = dlopen("libpthread.so", RTLD_LAZY); if (pthread_lib) pthread_atfork_func = dlsym(pthread_lib, "pthread_atfork"); } return 0; } void LSAPI_Stop(void) { g_running = 0; } int LSAPI_IsRunning(void) { return g_running; } void LSAPI_Register_Pgrp_Timer_Callback(LSAPI_On_Timer_pf cb) { s_proc_group_timer_cb = cb; } int LSAPI_InitRequest( LSAPI_Request * pReq, int fd ) { int newfd; if ( !pReq ) return -1; memset( pReq, 0, sizeof( LSAPI_Request ) ); if ( allocateIovec( pReq, 16 ) == -1 ) return -1; pReq->m_pRespBuf = pReq->m_pRespBufPos = (char *)malloc( LSAPI_RESP_BUF_SIZE ); if ( !pReq->m_pRespBuf ) return -1; pReq->m_pRespBufEnd = pReq->m_pRespBuf + LSAPI_RESP_BUF_SIZE; pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec + 1; pReq->m_respPktHeaderEnd = &pReq->m_respPktHeader[5]; if ( allocateRespHeaderBuf( pReq, LSAPI_INIT_RESP_HEADER_LEN ) == -1 ) return -1; if ( fd == STDIN_FILENO ) { fd = dup( fd ); newfd = open( "/dev/null", O_RDWR ); dup2( newfd, STDIN_FILENO ); } if ( isPipe( fd ) ) { pReq->m_fdListen = -1; pReq->m_fd = fd; } else { pReq->m_fdListen = fd; pReq->m_fd = -1; lsapi_set_nblock( fd, 1 ); } return 0; } int LSAPI_Is_Listen( void ) { return LSAPI_Is_Listen_r( &g_req ); } int LSAPI_Is_Listen_r( LSAPI_Request * pReq) { return pReq->m_fdListen != -1; } int LSAPI_Accept_r( LSAPI_Request * pReq ) { char achPeer[128]; socklen_t len; int nodelay = 1; if ( !pReq ) return -1; if ( LSAPI_Finish_r( pReq ) == -1 ) return -1; lsapi_set_nblock( pReq->m_fdListen , 0 ); while( g_running ) { if ( pReq->m_fd == -1 ) { if ( pReq->m_fdListen != -1) { len = sizeof( achPeer ); pReq->m_fd = accept( pReq->m_fdListen, (struct sockaddr *)&achPeer, &len ); if ( pReq->m_fd == -1 ) { if (( errno == EINTR )||( errno == EAGAIN)) continue; else return -1; } else { if (s_worker_status) __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_CONNECTED); if (s_busy_workers) __sync_fetch_and_add(s_busy_workers, 1); lsapi_set_nblock( pReq->m_fd , 0 ); if (((struct sockaddr *)&achPeer)->sa_family == AF_INET ) { setsockopt(pReq->m_fd, IPPROTO_TCP, TCP_NODELAY, (char *)&nodelay, sizeof(nodelay)); } //init_conn_key( pReq->m_fd ); //OPTIMIZATION if ( s_accept_notify ) if ( notify_req_received( pReq->m_fd ) == -1 ) return -1; } } else return -1; } if ( !readReq( pReq ) ) break; //abort(); lsapi_close_connection(pReq); LSAPI_Reset_r( pReq ); } return 0; } static struct lsapi_packet_header finish_close[2] = { {'L', 'S', LSAPI_RESP_END, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} }, {'L', 'S', LSAPI_CONN_CLOSE, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} } }; int LSAPI_Finish_r( LSAPI_Request * pReq ) { /* finish req body */ if ( !pReq ) return -1; if (pReq->m_reqState) { if ( pReq->m_fd != -1 ) { if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) { LSAPI_FinalizeRespHeaders_r( pReq ); } if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) { Flush_RespBuf_r( pReq ); } pReq->m_pIovecCur->iov_base = (void *)finish_close; pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; pReq->m_totalLen += LSAPI_PACKET_HEADER_LEN; ++pReq->m_pIovecCur; LSAPI_Flush_r( pReq ); } LSAPI_Reset_r( pReq ); } return 0; } int LSAPI_End_Response_r(LSAPI_Request * pReq) { if (!pReq) return -1; if (pReq->m_reqState & LSAPI_ST_BACKGROUND) return 0; if (pReq->m_reqState) { if ( pReq->m_fd != -1 ) { if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) { if ( pReq->m_pRespHeaderBufPos <= pReq->m_pRespHeaderBuf ) return 0; LSAPI_FinalizeRespHeaders_r( pReq ); } if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) { Flush_RespBuf_r( pReq ); } pReq->m_pIovecCur->iov_base = (void *)finish_close; pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN << 1; pReq->m_totalLen += LSAPI_PACKET_HEADER_LEN << 1; ++pReq->m_pIovecCur; LSAPI_Flush_r( pReq ); lsapi_close_connection(pReq); } pReq->m_reqState |= LSAPI_ST_BACKGROUND; } return 0; } void LSAPI_Reset_r( LSAPI_Request * pReq ) { pReq->m_pRespBufPos = pReq->m_pRespBuf; pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec + 1; pReq->m_pRespHeaderBufPos = pReq->m_pRespHeaderBuf; memset( &pReq->m_pHeaderIndex, 0, (char *)(pReq->m_respHeaderLen) - (char *)&pReq->m_pHeaderIndex ); } int LSAPI_Release_r( LSAPI_Request * pReq ) { if ( pReq->m_pReqBuf ) free( pReq->m_pReqBuf ); if ( pReq->m_pSpecialEnvList ) free( pReq->m_pSpecialEnvList ); if ( pReq->m_pEnvList ) free( pReq->m_pEnvList ); if ( pReq->m_pRespHeaderBuf ) free( pReq->m_pRespHeaderBuf ); return 0; } char * LSAPI_GetHeader_r( LSAPI_Request * pReq, int headerIndex ) { int off; if ( !pReq || ((unsigned int)headerIndex > H_TRANSFER_ENCODING) ) return NULL; off = pReq->m_pHeaderIndex->m_headerOff[ headerIndex ]; if ( !off ) return NULL; if ( *(pReq->m_pHttpHeader + off + pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) ) { *( pReq->m_pHttpHeader + off + pReq->m_pHeaderIndex->m_headerLen[ headerIndex ]) = 0; } return pReq->m_pHttpHeader + off; } static int readBodyToReqBuf( LSAPI_Request * pReq ) { off_t bodyLeft; ssize_t len = pReq->m_bufRead - pReq->m_bufProcessed; if ( len > 0 ) return len; pReq->m_bufRead = pReq->m_bufProcessed = pReq->m_pHeader->m_pktHeader.m_packetLen.m_iLen; bodyLeft = pReq->m_reqBodyLen - pReq->m_reqBodyRead; len = pReq->m_reqBufSize - pReq->m_bufRead; if ( len < 0 ) return -1; if ( len > bodyLeft ) len = bodyLeft; len = lsapi_read( pReq->m_fd, pReq->m_pReqBuf + pReq->m_bufRead, len ); if ( len > 0 ) pReq->m_bufRead += len; return len; } int LSAPI_ReqBodyGetChar_r( LSAPI_Request * pReq ) { if (!pReq || (pReq->m_fd ==-1) ) return EOF; if ( pReq->m_bufProcessed >= pReq->m_bufRead ) { if ( readBodyToReqBuf( pReq ) <= 0 ) return EOF; } ++pReq->m_reqBodyRead; return (unsigned char)*(pReq->m_pReqBuf + pReq->m_bufProcessed++); } int LSAPI_ReqBodyGetLine_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen, int *getLF ) { ssize_t len; ssize_t left; char * pBufEnd = pBuf + bufLen - 1; char * pBufCur = pBuf; char * pCur; char * p; if (!pReq || pReq->m_fd == -1 || !pBuf || !getLF) return -1; *getLF = 0; while( (left = pBufEnd - pBufCur ) > 0 ) { len = pReq->m_bufRead - pReq->m_bufProcessed; if ( len <= 0 ) { if ( (len = readBodyToReqBuf( pReq )) <= 0 ) { *getLF = 1; break; } } if ( len > left ) len = left; pCur = pReq->m_pReqBuf + pReq->m_bufProcessed; p = memchr( pCur, '\n', len ); if ( p ) len = p - pCur + 1; memmove( pBufCur, pCur, len ); pBufCur += len; pReq->m_bufProcessed += len; pReq->m_reqBodyRead += len; if ( p ) { *getLF = 1; break; } } *pBufCur = 0; return pBufCur - pBuf; } ssize_t LSAPI_ReadReqBody_r( LSAPI_Request * pReq, char * pBuf, size_t bufLen ) { ssize_t len; off_t total; /* char *pOldBuf = pBuf; */ if (!pReq || pReq->m_fd == -1 || !pBuf || (ssize_t)bufLen < 0) return -1; total = pReq->m_reqBodyLen - pReq->m_reqBodyRead; if ( total <= 0 ) return 0; if ( total < (ssize_t)bufLen ) bufLen = total; total = 0; len = pReq->m_bufRead - pReq->m_bufProcessed; if ( len > 0 ) { if ( len > (ssize_t)bufLen ) len = bufLen; memmove( pBuf, pReq->m_pReqBuf + pReq->m_bufProcessed, len ); pReq->m_bufProcessed += len; total += len; pBuf += len; bufLen -= len; } while( bufLen > 0 ) { len = lsapi_read( pReq->m_fd, pBuf, bufLen ); if ( len > 0 ) { total += len; pBuf += len; bufLen -= len; } else if ( len <= 0 ) { if ( !total) return -1; break; } } pReq->m_reqBodyRead += total; return total; } ssize_t LSAPI_Write_r( LSAPI_Request * pReq, const char * pBuf, size_t len ) { struct lsapi_packet_header * pHeader; const char * pEnd; const char * p; ssize_t bufLen; ssize_t toWrite; ssize_t packetLen; int skip = 0; if (!pReq || !pBuf) return -1; if (pReq->m_reqState & LSAPI_ST_BACKGROUND) return len; if (pReq->m_fd == -1) return -1; if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) { LSAPI_FinalizeRespHeaders_r( pReq ); /* if ( *pBuf == '\r' ) { ++skip; } if ( *pBuf == '\n' ) { ++skip; } */ } pReq->m_reqState |= LSAPI_ST_RESP_BODY; if ( ((ssize_t)len - skip) < pReq->m_pRespBufEnd - pReq->m_pRespBufPos ) { memmove( pReq->m_pRespBufPos, pBuf + skip, len - skip ); pReq->m_pRespBufPos += len - skip; return len; } pHeader = pReq->m_respPktHeader; p = pBuf + skip; pEnd = pBuf + len; bufLen = pReq->m_pRespBufPos - pReq->m_pRespBuf; while( ( toWrite = pEnd - p ) > 0 ) { packetLen = toWrite + bufLen; if ( LSAPI_MAX_DATA_PACKET_LEN < packetLen) { packetLen = LSAPI_MAX_DATA_PACKET_LEN; toWrite = packetLen - bufLen; } lsapi_buildPacketHeader( pHeader, LSAPI_RESP_STREAM, packetLen + LSAPI_PACKET_HEADER_LEN ); pReq->m_totalLen += packetLen + LSAPI_PACKET_HEADER_LEN; pReq->m_pIovecCur->iov_base = (void *)pHeader; pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; ++pReq->m_pIovecCur; ++pHeader; if ( bufLen > 0 ) { pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespBuf; pReq->m_pIovecCur->iov_len = bufLen; pReq->m_pRespBufPos = pReq->m_pRespBuf; ++pReq->m_pIovecCur; bufLen = 0; } pReq->m_pIovecCur->iov_base = (void *)p; pReq->m_pIovecCur->iov_len = toWrite; ++pReq->m_pIovecCur; p += toWrite; if ( pHeader >= pReq->m_respPktHeaderEnd - 1) { if ( LSAPI_Flush_r( pReq ) == -1 ) return -1; pHeader = pReq->m_respPktHeader; } } if ( pHeader != pReq->m_respPktHeader ) if ( LSAPI_Flush_r( pReq ) == -1 ) return -1; return p - pBuf; } #if defined(__FreeBSD__ ) ssize_t gsendfile( int fdOut, int fdIn, off_t* off, size_t size ) { ssize_t ret; off_t written; ret = sendfile( fdIn, fdOut, *off, size, NULL, &written, 0 ); if ( written > 0 ) { ret = written; *off += ret; } return ret; } #endif #if defined(__OpenBSD__) || defined(__NetBSD__) ssize_t gsendfile( int fdOut, int fdIn, off_t* off, size_t size ) { ssize_t ret; off_t written = 0; const size_t bufsiz = 16384; unsigned char in[bufsiz] = {0}; if (lseek(fdIn, *off, SEEK_SET) == -1) { return -1; } while (size > 0) { size_t tor = size > sizeof(in) ? sizeof(in) : size; ssize_t c = read(fdIn, in, tor); if (c <= 0) { goto end; } ssize_t w = write(fdOut, in, c); if (w > 0) written += w; if (w != c) { goto end; } size -= c; } end: *off += written; return 0; } #endif #if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) ssize_t gsendfile( int fdOut, int fdIn, off_t* off, size_t size ) { ssize_t ret; off_t len = size; ret = sendfile( fdIn, fdOut, *off, &len, NULL, 0 ); if (( ret == 0 )&&( len > 0 )) { ret = len; *off += len; } return ret; } #endif #if defined(sun) || defined(__sun) #include ssize_t gsendfile( int fdOut, int fdIn, off_t *off, size_t size ) { int n = 0 ; sendfilevec_t vec[1]; vec[n].sfv_fd = fdIn; vec[n].sfv_flag = 0; vec[n].sfv_off = *off; vec[n].sfv_len = size; ++n; size_t written; ssize_t ret = sendfilev( fdOut, vec, n, &written ); if (( !ret )||( errno == EAGAIN )) ret = written; if ( ret > 0 ) *off += ret; return ret; } #endif #if defined(linux) || defined(__linux) || defined(__linux__) || \ defined(__gnu_linux__) #include #define gsendfile sendfile #endif #if defined(HPUX) ssize_t gsendfile( int fdOut, int fdIn, off_t * off, size_t size ) { return sendfile( fdOut, fdIn, off, size, NULL, 0 ); } #endif ssize_t LSAPI_sendfile_r( LSAPI_Request * pReq, int fdIn, off_t* off, size_t size ) { struct lsapi_packet_header * pHeader = pReq->m_respPktHeader; if ( !pReq || (pReq->m_fd == -1) || fdIn == -1 ) return -1; if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) { LSAPI_FinalizeRespHeaders_r( pReq ); } pReq->m_reqState |= LSAPI_ST_RESP_BODY; LSAPI_Flush_r(pReq); lsapi_buildPacketHeader( pHeader, LSAPI_RESP_STREAM, size + LSAPI_PACKET_HEADER_LEN ); if (write(pReq->m_fd, (const char *) pHeader, LSAPI_PACKET_HEADER_LEN ) != LSAPI_PACKET_HEADER_LEN) return -1; return gsendfile( pReq->m_fd, fdIn, off, size ); } void Flush_RespBuf_r( LSAPI_Request * pReq ) { struct lsapi_packet_header * pHeader = pReq->m_respPktHeader; int bufLen = pReq->m_pRespBufPos - pReq->m_pRespBuf; pReq->m_reqState |= LSAPI_ST_RESP_BODY; lsapi_buildPacketHeader( pHeader, LSAPI_RESP_STREAM, bufLen + LSAPI_PACKET_HEADER_LEN ); pReq->m_totalLen += bufLen + LSAPI_PACKET_HEADER_LEN; pReq->m_pIovecCur->iov_base = (void *)pHeader; pReq->m_pIovecCur->iov_len = LSAPI_PACKET_HEADER_LEN; ++pReq->m_pIovecCur; ++pHeader; if ( bufLen > 0 ) { pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespBuf; pReq->m_pIovecCur->iov_len = bufLen; pReq->m_pRespBufPos = pReq->m_pRespBuf; ++pReq->m_pIovecCur; bufLen = 0; } } int LSAPI_Flush_r( LSAPI_Request * pReq ) { int ret = 0; int n; if ( !pReq ) return -1; n = pReq->m_pIovecCur - pReq->m_pIovecToWrite; if (( 0 == n )&&( pReq->m_pRespBufPos == pReq->m_pRespBuf )) return 0; if ( pReq->m_fd == -1 ) { pReq->m_pRespBufPos = pReq->m_pRespBuf; pReq->m_totalLen = 0; pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec; return -1; } if ( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) { LSAPI_FinalizeRespHeaders_r( pReq ); } if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) { Flush_RespBuf_r( pReq ); } n = pReq->m_pIovecCur - pReq->m_pIovecToWrite; if ( n > 0 ) { ret = lsapi_writev( pReq->m_fd, &pReq->m_pIovecToWrite, n, pReq->m_totalLen ); if ( ret < pReq->m_totalLen ) { lsapi_close_connection(pReq); ret = -1; } pReq->m_totalLen = 0; pReq->m_pIovecCur = pReq->m_pIovecToWrite = pReq->m_pIovec; } return ret; } ssize_t LSAPI_Write_Stderr_r( LSAPI_Request * pReq, const char * pBuf, size_t len ) { struct lsapi_packet_header header; const char * pEnd; const char * p; ssize_t packetLen; ssize_t totalLen; int ret; struct iovec iov[2]; struct iovec *pIov; if ( !pReq ) return -1; if (s_stderr_log_path || pReq->m_fd == -1 || pReq->m_fd == pReq->m_fdListen) return write( 2, pBuf, len ); if ( pReq->m_pRespBufPos != pReq->m_pRespBuf ) { LSAPI_Flush_r( pReq ); } p = pBuf; pEnd = pBuf + len; while( ( packetLen = pEnd - p ) > 0 ) { if ( LSAPI_MAX_DATA_PACKET_LEN < packetLen) { packetLen = LSAPI_MAX_DATA_PACKET_LEN; } lsapi_buildPacketHeader( &header, LSAPI_STDERR_STREAM, packetLen + LSAPI_PACKET_HEADER_LEN ); totalLen = packetLen + LSAPI_PACKET_HEADER_LEN; iov[0].iov_base = (void *)&header; iov[0].iov_len = LSAPI_PACKET_HEADER_LEN; iov[1].iov_base = (void *)p; iov[1].iov_len = packetLen; p += packetLen; pIov = iov; ret = lsapi_writev( pReq->m_fd, &pIov, 2, totalLen ); if ( ret < totalLen ) { lsapi_close_connection(pReq); ret = -1; } } return p - pBuf; } static char * GetHeaderVar( LSAPI_Request * pReq, const char * name ) { int i; char * pValue; for( i = 0; i < H_TRANSFER_ENCODING; ++i ) { if ( pReq->m_pHeaderIndex->m_headerOff[i] ) { if ( strcmp( name, CGI_HEADERS[i] ) == 0 ) { pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; if ( *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) != '\0') { *(pValue + pReq->m_pHeaderIndex->m_headerLen[i]) = '\0'; } return pValue; } } } if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) { const char *p; char *pKey; char *pKeyEnd; int keyLen; struct lsapi_header_offset * pCur, *pEnd; pCur = pReq->m_pUnknownHeader; pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; while( pCur < pEnd ) { pKey = pReq->m_pHttpHeader + pCur->nameOff; keyLen = pCur->nameLen; pKeyEnd = pKey + keyLen; p = &name[5]; while(( pKey < pKeyEnd )&&( *p )) { char ch = toupper( *pKey ); if ((ch != *p )||(( *p == '_' )&&( ch != '-'))) break; ++p; ++pKey; } if (( pKey == pKeyEnd )&& (!*p )) { pValue = pReq->m_pHttpHeader + pCur->valueOff; if ( *(pValue + pCur->valueLen) != '\0') { *(pValue + pCur->valueLen) = '\0'; } return pValue; } ++pCur; } } return NULL; } char * LSAPI_GetEnv_r( LSAPI_Request * pReq, const char * name ) { struct LSAPI_key_value_pair * pBegin = pReq->m_pEnvList; struct LSAPI_key_value_pair * pEnd = pBegin + pReq->m_pHeader->m_cntEnv; if ( !pReq || !name ) return NULL; if ( strncmp( name, "HTTP_", 5 ) == 0 ) { return GetHeaderVar( pReq, name ); } while( pBegin < pEnd ) { if ( strcmp( name, pBegin->pKey ) == 0 ) return pBegin->pValue; ++pBegin; } return NULL; } struct _headerInfo { const char * _name; int _nameLen; const char * _value; int _valueLen; }; int compareValueLocation(const void * v1, const void *v2 ) { return ((const struct _headerInfo *)v1)->_value - ((const struct _headerInfo *)v2)->_value; } int LSAPI_ForeachOrgHeader_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ) { int i; int len = 0; char * pValue; int ret; int count = 0; struct _headerInfo headers[512]; if ( !pReq || !fn ) return -1; if ( !pReq->m_pHeaderIndex ) return 0; for( i = 0; i < H_TRANSFER_ENCODING; ++i ) { if ( pReq->m_pHeaderIndex->m_headerOff[i] ) { len = pReq->m_pHeaderIndex->m_headerLen[i]; pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; *(pValue + len ) = 0; headers[count]._name = HTTP_HEADERS[i]; headers[count]._nameLen = HTTP_HEADER_LEN[i]; headers[count]._value = pValue; headers[count]._valueLen = len; ++count; //ret = (*fn)( HTTP_HEADERS[i], HTTP_HEADER_LEN[i], // pValue, len, arg ); //if ( ret <= 0 ) // return ret; } } if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) { char *pKey; int keyLen; struct lsapi_header_offset * pCur, *pEnd; pCur = pReq->m_pUnknownHeader; pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; while( pCur < pEnd ) { pKey = pReq->m_pHttpHeader + pCur->nameOff; keyLen = pCur->nameLen; *(pKey + keyLen ) = 0; pValue = pReq->m_pHttpHeader + pCur->valueOff; *(pValue + pCur->valueLen ) = 0; headers[count]._name = pKey; headers[count]._nameLen = keyLen; headers[count]._value = pValue; headers[count]._valueLen = pCur->valueLen; ++count; if ( count == 512 ) break; //ret = (*fn)( pKey, keyLen, // pValue, pCur->valueLen, arg ); //if ( ret <= 0 ) // return ret; ++pCur; } } qsort( headers, count, sizeof( struct _headerInfo ), compareValueLocation ); for( i = 0; i < count; ++i ) { ret = (*fn)( headers[i]._name, headers[i]._nameLen, headers[i]._value, headers[i]._valueLen, arg ); if ( ret <= 0 ) return ret; } return count; } int LSAPI_ForeachHeader_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ) { int i; int len = 0; char * pValue; int ret; int count = 0; if ( !pReq || !fn ) return -1; for( i = 0; i < H_TRANSFER_ENCODING; ++i ) { if ( pReq->m_pHeaderIndex->m_headerOff[i] ) { len = pReq->m_pHeaderIndex->m_headerLen[i]; pValue = pReq->m_pHttpHeader + pReq->m_pHeaderIndex->m_headerOff[i]; *(pValue + len ) = 0; ret = (*fn)( CGI_HEADERS[i], CGI_HEADER_LEN[i], pValue, len, arg ); ++count; if ( ret <= 0 ) return ret; } } if ( pReq->m_pHeader->m_cntUnknownHeaders > 0 ) { char achHeaderName[256]; char *p; char *pKey; char *pKeyEnd ; int keyLen; struct lsapi_header_offset * pCur, *pEnd; pCur = pReq->m_pUnknownHeader; pEnd = pCur + pReq->m_pHeader->m_cntUnknownHeaders; while( pCur < pEnd ) { pKey = pReq->m_pHttpHeader + pCur->nameOff; keyLen = pCur->nameLen; if ( keyLen > 250 ) keyLen = 250; pKeyEnd = pKey + keyLen; memcpy( achHeaderName, "HTTP_", 5 ); p = &achHeaderName[5]; while( pKey < pKeyEnd ) { char ch = *pKey++; if ( ch == '-' ) *p++ = '_'; else *p++ = toupper( ch ); } *p = 0; keyLen += 5; pValue = pReq->m_pHttpHeader + pCur->valueOff; *(pValue + pCur->valueLen ) = 0; ret = (*fn)( achHeaderName, keyLen, pValue, pCur->valueLen, arg ); if ( ret <= 0 ) return ret; ++pCur; } } return count + pReq->m_pHeader->m_cntUnknownHeaders; } static int EnvForeach( struct LSAPI_key_value_pair * pEnv, int n, LSAPI_CB_EnvHandler fn, void * arg ) { struct LSAPI_key_value_pair * pEnd = pEnv + n; int ret; if ( !pEnv || !fn ) return -1; while( pEnv < pEnd ) { ret = (*fn)( pEnv->pKey, pEnv->keyLen, pEnv->pValue, pEnv->valLen, arg ); if ( ret <= 0 ) return ret; ++pEnv; } return n; } int LSAPI_ForeachEnv_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ) { if ( !pReq || !fn ) return -1; if ( pReq->m_pHeader->m_cntEnv > 0 ) { return EnvForeach( pReq->m_pEnvList, pReq->m_pHeader->m_cntEnv, fn, arg ); } return 0; } int LSAPI_ForeachSpecialEnv_r( LSAPI_Request * pReq, LSAPI_CB_EnvHandler fn, void * arg ) { if ( !pReq || !fn ) return -1; if ( pReq->m_pHeader->m_cntSpecialEnv > 0 ) { return EnvForeach( pReq->m_pSpecialEnvList, pReq->m_pHeader->m_cntSpecialEnv, fn, arg ); } return 0; } int LSAPI_FinalizeRespHeaders_r( LSAPI_Request * pReq ) { if ( !pReq || !pReq->m_pIovec ) return -1; if ( !( pReq->m_reqState & LSAPI_ST_RESP_HEADER ) ) return 0; pReq->m_reqState &= ~LSAPI_ST_RESP_HEADER; if ( pReq->m_pRespHeaderBufPos > pReq->m_pRespHeaderBuf ) { pReq->m_pIovecCur->iov_base = (void *)pReq->m_pRespHeaderBuf; pReq->m_pIovecCur->iov_len = pReq->m_pRespHeaderBufPos - pReq->m_pRespHeaderBuf; pReq->m_totalLen += pReq->m_pIovecCur->iov_len; ++pReq->m_pIovecCur; } pReq->m_pIovec->iov_len = sizeof( struct lsapi_resp_header) + pReq->m_respHeader.m_respInfo.m_cntHeaders * sizeof( short ); pReq->m_totalLen += pReq->m_pIovec->iov_len; lsapi_buildPacketHeader( &pReq->m_respHeader.m_pktHeader, LSAPI_RESP_HEADER, pReq->m_totalLen ); pReq->m_pIovec->iov_base = (void *)&pReq->m_respHeader; pReq->m_pIovecToWrite = pReq->m_pIovec; return 0; } int LSAPI_AppendRespHeader2_r( LSAPI_Request * pReq, const char * pHeaderName, const char * pHeaderValue ) { int nameLen, valLen, len; if ( !pReq || !pHeaderName || !pHeaderValue ) return -1; if ( pReq->m_reqState & LSAPI_ST_RESP_BODY ) return -1; if ( pReq->m_respHeader.m_respInfo.m_cntHeaders >= LSAPI_MAX_RESP_HEADERS ) return -1; nameLen = strlen( pHeaderName ); valLen = strlen( pHeaderValue ); if ( nameLen == 0 ) return -1; while( nameLen > 0 ) { char ch = *(pHeaderName + nameLen - 1 ); if (( ch == '\n' )||( ch == '\r' )) --nameLen; else break; } if ( nameLen <= 0 ) return 0; while( valLen > 0 ) { char ch = *(pHeaderValue + valLen - 1 ); if (( ch == '\n' )||( ch == '\r' )) --valLen; else break; } len = nameLen + valLen + 1; if ( len > LSAPI_RESP_HTTP_HEADER_MAX ) return -1; if ( pReq->m_pRespHeaderBufPos + len + 1 > pReq->m_pRespHeaderBufEnd ) { int newlen = pReq->m_pRespHeaderBufPos + len + 4096 - pReq->m_pRespHeaderBuf; newlen -= newlen % 4096; if ( allocateRespHeaderBuf( pReq, newlen ) == -1 ) return -1; } memmove( pReq->m_pRespHeaderBufPos, pHeaderName, nameLen ); pReq->m_pRespHeaderBufPos += nameLen; *pReq->m_pRespHeaderBufPos++ = ':'; memmove( pReq->m_pRespHeaderBufPos, pHeaderValue, valLen ); pReq->m_pRespHeaderBufPos += valLen; *pReq->m_pRespHeaderBufPos++ = 0; ++len; /* add one byte padding for \0 */ pReq->m_respHeaderLen[pReq->m_respHeader.m_respInfo.m_cntHeaders] = len; ++pReq->m_respHeader.m_respInfo.m_cntHeaders; return 0; } int LSAPI_AppendRespHeader_r( LSAPI_Request * pReq, const char * pBuf, int len ) { if ( !pReq || !pBuf || len <= 0 || len > LSAPI_RESP_HTTP_HEADER_MAX ) return -1; if ( pReq->m_reqState & LSAPI_ST_RESP_BODY ) return -1; if ( pReq->m_respHeader.m_respInfo.m_cntHeaders >= LSAPI_MAX_RESP_HEADERS ) return -1; while( len > 0 ) { char ch = *(pBuf + len - 1 ); if (( ch == '\n' )||( ch == '\r' )) --len; else break; } if ( len <= 0 ) return 0; if ( pReq->m_pRespHeaderBufPos + len + 1 > pReq->m_pRespHeaderBufEnd ) { int newlen = pReq->m_pRespHeaderBufPos + len + 4096 - pReq->m_pRespHeaderBuf; newlen -= newlen % 4096; if ( allocateRespHeaderBuf( pReq, newlen ) == -1 ) return -1; } memmove( pReq->m_pRespHeaderBufPos, pBuf, len ); pReq->m_pRespHeaderBufPos += len; *pReq->m_pRespHeaderBufPos++ = 0; ++len; /* add one byte padding for \0 */ pReq->m_respHeaderLen[pReq->m_respHeader.m_respInfo.m_cntHeaders] = len; ++pReq->m_respHeader.m_respInfo.m_cntHeaders; return 0; } int LSAPI_CreateListenSock2( const struct sockaddr * pServerAddr, int backlog ) { int ret; int fd; int flag = 1; int addr_len; switch( pServerAddr->sa_family ) { case AF_INET: addr_len = 16; break; case AF_INET6: addr_len = sizeof( struct sockaddr_in6 ); break; case AF_UNIX: addr_len = sizeof( struct sockaddr_un ); unlink( ((struct sockaddr_un *)pServerAddr)->sun_path ); break; default: return -1; } fd = socket( pServerAddr->sa_family, SOCK_STREAM, 0 ); if ( fd == -1 ) return -1; fcntl( fd, F_SETFD, FD_CLOEXEC ); if(setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, (char *)( &flag ), sizeof(flag)) == 0) { ret = bind( fd, pServerAddr, addr_len ); if ( !ret ) { ret = listen( fd, backlog ); if ( !ret ) return fd; } } ret = errno; close(fd); errno = ret; return -1; } int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr ) { char achAddr[256]; char * p = achAddr; char * pEnd; struct addrinfo *res, hints; int doAddrInfo = 0; int port; if ( !pBind ) return -1; while( isspace( *pBind ) ) ++pBind; strncpy(achAddr, pBind, 255); achAddr[255] = 0; switch( *p ) { case '/': pAddr->sa_family = AF_UNIX; strncpy( ((struct sockaddr_un *)pAddr)->sun_path, p, sizeof(((struct sockaddr_un *)pAddr)->sun_path) ); return 0; case '[': pAddr->sa_family = AF_INET6; ++p; pEnd = strchr( p, ']' ); if ( !pEnd ) return -1; *pEnd++ = 0; if ( *p == '*' ) { strcpy( achAddr, "::" ); p = achAddr; } doAddrInfo = 1; break; default: pAddr->sa_family = AF_INET; pEnd = strchr( p, ':' ); if ( !pEnd ) return -1; *pEnd++ = 0; doAddrInfo = 0; if ( *p == '*' ) { ((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl(INADDR_ANY); } else if (!strcasecmp( p, "localhost" ) ) ((struct sockaddr_in *)pAddr)->sin_addr.s_addr = htonl( INADDR_LOOPBACK ); else { #ifdef HAVE_INET_PTON if (!inet_pton(AF_INET, p, &((struct sockaddr_in *)pAddr)->sin_addr)) #else ((struct sockaddr_in *)pAddr)->sin_addr.s_addr = inet_addr( p ); if ( ((struct sockaddr_in *)pAddr)->sin_addr.s_addr == INADDR_BROADCAST) #endif { doAddrInfo = 1; } } break; } if ( *pEnd == ':' ) ++pEnd; port = atoi( pEnd ); if (( port <= 0 )||( port > 65535 )) return -1; if ( doAddrInfo ) { memset(&hints, 0, sizeof(hints)); hints.ai_family = pAddr->sa_family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; if ( getaddrinfo(p, NULL, &hints, &res) ) { return -1; } memcpy(pAddr, res->ai_addr, res->ai_addrlen); freeaddrinfo(res); } if ( pAddr->sa_family == AF_INET ) ((struct sockaddr_in *)pAddr)->sin_port = htons( port ); else ((struct sockaddr_in6 *)pAddr)->sin6_port = htons( port ); return 0; } int LSAPI_CreateListenSock( const char * pBind, int backlog ) { char serverAddr[128]; int ret; int fd = -1; ret = LSAPI_ParseSockAddr( pBind, (struct sockaddr *)serverAddr ); if ( !ret ) { fd = LSAPI_CreateListenSock2( (struct sockaddr *)serverAddr, backlog ); } return fd; } static fn_select_t g_fnSelect = select; typedef struct _lsapi_prefork_server { int m_fd; int m_iMaxChildren; int m_iExtraChildren; int m_iCurChildren; int m_iMaxIdleChildren; int m_iServerMaxIdle; int m_iChildrenMaxIdleTime; int m_iMaxReqProcessTime; int m_iAvoidFork; lsapi_child_status * m_pChildrenStatus; lsapi_child_status * m_pChildrenStatusCur; lsapi_child_status * m_pChildrenStatusEnd; }lsapi_prefork_server; static lsapi_prefork_server * g_prefork_server = NULL; int LSAPI_Init_Prefork_Server( int max_children, fn_select_t fp, int avoidFork ) { if ( g_prefork_server ) return 0; if ( max_children <= 1 ) return -1; if ( max_children >= 10000) max_children = 10000; if (s_max_busy_workers == 0) s_max_busy_workers = max_children / 2 + 1; g_prefork_server = (lsapi_prefork_server *)malloc( sizeof( lsapi_prefork_server ) ); if ( !g_prefork_server ) return -1; memset( g_prefork_server, 0, sizeof( lsapi_prefork_server ) ); if ( fp != NULL ) g_fnSelect = fp; s_ppid = getppid(); s_pid = getpid(); setpgid( s_pid, s_pid ); #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) s_total_pages = sysconf(_SC_PHYS_PAGES); #endif g_prefork_server->m_iAvoidFork = avoidFork; g_prefork_server->m_iMaxChildren = max_children; g_prefork_server->m_iExtraChildren = ( avoidFork ) ? 0 : (max_children / 3) ; g_prefork_server->m_iMaxIdleChildren = ( avoidFork ) ? (max_children + 1) : (max_children / 3); if ( g_prefork_server->m_iMaxIdleChildren == 0 ) g_prefork_server->m_iMaxIdleChildren = 1; g_prefork_server->m_iChildrenMaxIdleTime = 300; g_prefork_server->m_iMaxReqProcessTime = 3600; setsid(); return 0; } void LSAPI_Set_Server_fd( int fd ) { if( g_prefork_server ) g_prefork_server->m_fd = fd; } static int lsapi_accept( int fdListen ) { int fd; int nodelay = 1; socklen_t len; char achPeer[128]; len = sizeof( achPeer ); fd = accept( fdListen, (struct sockaddr *)&achPeer, &len ); if ( fd != -1 ) { if (((struct sockaddr *)&achPeer)->sa_family == AF_INET ) { setsockopt( fd, IPPROTO_TCP, TCP_NODELAY, (char *)&nodelay, sizeof(nodelay)); } //OPTIMIZATION //if ( s_accept_notify ) // notify_req_received( fd ); } return fd; } static unsigned int s_max_reqs = UINT_MAX; static int s_max_idle_secs = 300; static int s_stop; static void lsapi_cleanup(int signal) { s_stop = signal; } static lsapi_child_status * find_child_status( int pid ) { lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd; while( pStatus < pEnd ) { if ( pStatus->m_pid == pid ) { if (pid == 0) { memset(pStatus, 0, sizeof( *pStatus ) ); pStatus->m_pid = -1; } if ( pStatus + 1 > g_prefork_server->m_pChildrenStatusCur ) g_prefork_server->m_pChildrenStatusCur = pStatus + 1; return pStatus; } ++pStatus; } return NULL; } void LSAPI_reset_server_state( void ) { /* Reset child status */ g_prefork_server->m_iCurChildren = 0; lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusEnd; while( pStatus < pEnd ) { pStatus->m_pid = 0; ++pStatus; } if (s_busy_workers) __sync_lock_release(s_busy_workers); if (s_accepting_workers) __sync_lock_release(s_accepting_workers); } static void lsapi_sigchild( int signal ) { int status, pid; lsapi_child_status * child_status; if (g_prefork_server == NULL) return; while( 1 ) { pid = waitpid( -1, &status, WNOHANG|WUNTRACED ); if ( pid <= 0 ) { break; } if ( WIFSIGNALED( status )) { int sig_num = WTERMSIG( status ); #ifdef WCOREDUMP const char * dump = WCOREDUMP( status ) ? "yes" : "no"; #else const char * dump = "unknown"; #endif lsapi_log("Child process with pid: %d was killed by signal: " "%d, core dumped: %s\n", pid, sig_num, dump ); } if ( pid == s_pid_dump_debug_info ) { pid = 0; continue; } if ( pid == s_ignore_pid ) { pid = 0; s_ignore_pid = -1; continue; } child_status = find_child_status( pid ); if ( child_status ) { if (__sync_bool_compare_and_swap(&child_status->m_state, LSAPI_STATE_CONNECTED, LSAPI_STATE_IDLE)) { if (s_busy_workers) __sync_fetch_and_sub(s_busy_workers, 1); } else if (__sync_bool_compare_and_swap(&child_status->m_state, LSAPI_STATE_ACCEPTING, LSAPI_STATE_IDLE)) { if (s_accepting_workers) __sync_fetch_and_sub(s_accepting_workers, 1); } child_status->m_pid = 0; --g_prefork_server->m_iCurChildren; } } while(( g_prefork_server->m_pChildrenStatusCur > g_prefork_server->m_pChildrenStatus ) &&( g_prefork_server->m_pChildrenStatusCur[-1].m_pid == 0 )) --g_prefork_server->m_pChildrenStatusCur; } static int lsapi_init_children_status(void) { char * pBuf; int size = 4096; int max_children; if (g_prefork_server->m_pChildrenStatus) return 0; max_children = g_prefork_server->m_iMaxChildren + g_prefork_server->m_iExtraChildren; size = max_children * sizeof( lsapi_child_status ) * 2 + 3 * sizeof(int); size = (size + 4095) / 4096 * 4096; pBuf =( char*) mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, -1, 0 ); if ( pBuf == MAP_FAILED ) { perror( "Anonymous mmap() failed" ); return -1; } memset( pBuf, 0, size ); g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + max_children; s_busy_workers = (int *)g_prefork_server->m_pChildrenStatusEnd; s_accepting_workers = s_busy_workers + 1; s_global_counter = s_accepting_workers + 1; s_avail_pages = (size_t *)(s_global_counter + 1); setsid(); return 0; } static void dump_debug_info( lsapi_child_status * pStatus, long tmCur ) { char achCmd[1024]; if ( s_pid_dump_debug_info ) { if ( kill( s_pid_dump_debug_info, 0 ) == 0 ) return; } lsapi_log("Possible runaway process, UID: %d, PPID: %d, PID: %d, " "reqCount: %d, process time: %ld, checkpoint time: %ld, start " "time: %ld\n", getuid(), getppid(), pStatus->m_pid, pStatus->m_iReqCounter, tmCur - pStatus->m_tmReqBegin, tmCur - pStatus->m_tmLastCheckPoint, tmCur - pStatus->m_tmStart ); s_pid_dump_debug_info = fork(); if (s_pid_dump_debug_info == 0) { snprintf( achCmd, 1024, "gdb --batch -ex \"attach %d\" -ex \"set height 0\" " "-ex \"bt\" >&2;PATH=$PATH:/usr/sbin lsof -p %d >&2", pStatus->m_pid, pStatus->m_pid ); if ( system( achCmd ) == -1 ) perror( "system()" ); exit( 0 ); } } static void lsapi_check_child_status( long tmCur ) { int idle = 0; int tobekilled; int dying = 0; int count = 0; lsapi_child_status * pStatus = g_prefork_server->m_pChildrenStatus; lsapi_child_status * pEnd = g_prefork_server->m_pChildrenStatusCur; while( pStatus < pEnd ) { tobekilled = 0; if ( pStatus->m_pid != 0 && pStatus->m_pid != -1) { ++count; if ( !pStatus->m_inProcess ) { if (g_prefork_server->m_iCurChildren - dying > g_prefork_server->m_iMaxChildren || idle > g_prefork_server->m_iMaxIdleChildren) { ++pStatus->m_iKillSent; //tobekilled = SIGUSR1; } else { if (s_max_idle_secs> 0 && tmCur - pStatus->m_tmWaitBegin > s_max_idle_secs + 5) { ++pStatus->m_iKillSent; //tobekilled = SIGUSR1; } } if (!pStatus->m_iKillSent) ++idle; } else { if (tmCur - pStatus->m_tmReqBegin > g_prefork_server->m_iMaxReqProcessTime) { if ((pStatus->m_iKillSent % 5) == 0 && s_dump_debug_info) dump_debug_info( pStatus, tmCur ); if ( pStatus->m_iKillSent > 5 ) { tobekilled = SIGKILL; lsapi_log("Force killing runaway process PID: %d" " with SIGKILL\n", pStatus->m_pid ); } else { tobekilled = SIGTERM; lsapi_log("Killing runaway process PID: %d with " "SIGTERM\n", pStatus->m_pid ); } } } if ( tobekilled ) { if (( kill( pStatus->m_pid, tobekilled ) == -1 ) && ( errno == ESRCH )) { pStatus->m_pid = 0; --count; } else { ++pStatus->m_iKillSent; ++dying; } } } ++pStatus; } if ( abs( g_prefork_server->m_iCurChildren - count ) > 1 ) { lsapi_log("Children tracking is wrong: Cur Children: %d," " count: %d, idle: %d, dying: %d\n", g_prefork_server->m_iCurChildren, count, idle, dying ); } } //static int lsapi_all_children_must_die(void) //{ // int maxWait; // int sec =0; // g_prefork_server->m_iMaxReqProcessTime = 10; // g_prefork_server->m_iMaxIdleChildren = -1; // maxWait = 15; // // while( g_prefork_server->m_iCurChildren && (sec < maxWait) ) // { // lsapi_check_child_status(time(NULL)); // sleep( 1 ); // sec++; // } // if ( g_prefork_server->m_iCurChildren != 0 ) // kill( -getpgrp(), SIGKILL ); // return 0; //} void set_skip_write() { s_skip_write = 1; } int is_enough_free_mem() { #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) //minimum 1GB or 10% available free memory return (*s_avail_pages > s_min_avail_pages || (*s_avail_pages * 10) / s_total_pages > 0); #endif return 1; } static int lsapi_prefork_server_accept( lsapi_prefork_server * pServer, LSAPI_Request * pReq ) { struct sigaction act, old_term, old_quit, old_int, old_usr1, old_child; lsapi_child_status * child_status; int wait_secs = 0; int ret = 0; int pid; time_t lastTime = 0; time_t curTime = 0; fd_set readfds; struct timeval timeout; sigset_t mask; sigset_t orig_mask; lsapi_init_children_status(); act.sa_flags = 0; act.sa_handler = lsapi_sigchild; sigemptyset(&(act.sa_mask)); if( sigaction( SIGCHLD, &act, &old_child ) ) { perror( "Can't set signal handler for SIGCHILD" ); return -1; } /* Set up handler to kill children upon exit */ act.sa_flags = 0; act.sa_handler = lsapi_cleanup; sigemptyset(&(act.sa_mask)); if( sigaction( SIGTERM, &act, &old_term ) || sigaction( SIGINT, &act, &old_int ) || sigaction( SIGUSR1, &act, &old_usr1 ) || sigaction( SIGQUIT, &act, &old_quit )) { perror( "Can't set signals" ); return -1; } while( !s_stop ) { if (s_proc_group_timer_cb != NULL) { s_proc_group_timer_cb(&s_ignore_pid); } curTime = time( NULL ); if (curTime != lastTime ) { lastTime = curTime; if (lsapi_parent_dead()) break; lsapi_check_child_status(curTime ); if (pServer->m_iServerMaxIdle) { if ( pServer->m_iCurChildren <= 0 ) { ++wait_secs; if ( wait_secs > pServer->m_iServerMaxIdle ) return -1; } else wait_secs = 0; } } #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) *s_avail_pages = sysconf(_SC_AVPHYS_PAGES); // lsapi_log("Memory total: %zd, free: %zd, free %%%zd\n", // s_total_pages, *s_avail_pages, *s_avail_pages * 100 / s_total_pages); #endif FD_ZERO( &readfds ); FD_SET( pServer->m_fd, &readfds ); timeout.tv_sec = 1; timeout.tv_usec = 0; ret = (*g_fnSelect)(pServer->m_fd+1, &readfds, NULL, NULL, &timeout); if (ret == 1 ) { int accepting = 0; if (s_accepting_workers) accepting = __sync_add_and_fetch(s_accepting_workers, 0); if (pServer->m_iCurChildren > 0 && accepting > 0) { usleep(400); while(accepting-- > 0) sched_yield(); continue; } } else if ( ret == -1 ) { if ( errno == EINTR ) continue; /* perror( "select()" ); */ break; } else { continue; } if (pServer->m_iCurChildren >= pServer->m_iMaxChildren + pServer->m_iExtraChildren) { lsapi_log("Reached max children process limit: %d, extra: %d," " current: %d, busy: %d, please increase LSAPI_CHILDREN.\n", pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren, s_busy_workers ? *s_busy_workers : -1 ); usleep( 100000 ); continue; } pReq->m_fd = lsapi_accept( pServer->m_fd ); if ( pReq->m_fd != -1 ) { wait_secs = 0; child_status = find_child_status( 0 ); sigemptyset( &mask ); sigaddset( &mask, SIGCHLD ); if ( sigprocmask(SIG_BLOCK, &mask, &orig_mask) < 0 ) { perror( "sigprocmask(SIG_BLOCK) to block SIGCHLD" ); } pid = fork(); if ( !pid ) { setsid(); if (sigprocmask(SIG_SETMASK, &orig_mask, NULL) < 0) perror( "sigprocmask( SIG_SETMASK ) to restore SIGMASK in child" ); g_prefork_server = NULL; s_ppid = getppid(); s_pid = getpid(); s_req_processed = 0; s_proc_group_timer_cb = NULL; s_worker_status = child_status; if (pthread_atfork_func) (*pthread_atfork_func)(NULL, NULL, set_skip_write); __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_CONNECTED); if (s_busy_workers) __sync_add_and_fetch(s_busy_workers, 1); lsapi_set_nblock( pReq->m_fd, 0 ); //keep it open if busy_count is used. if (!s_keep_listener && s_busy_workers && *s_busy_workers > (pServer->m_iMaxChildren >> 1)) s_keep_listener = 1; if ((s_uid == 0 || !s_keep_listener || !is_enough_free_mem()) && pReq->m_fdListen != -1 ) { close( pReq->m_fdListen ); pReq->m_fdListen = -1; } /* don't catch our signals */ sigaction( SIGCHLD, &old_child, 0 ); sigaction( SIGTERM, &old_term, 0 ); sigaction( SIGQUIT, &old_quit, 0 ); sigaction( SIGINT, &old_int, 0 ); sigaction( SIGUSR1, &old_usr1, 0 ); //init_conn_key( pReq->m_fd ); lsapi_notify_pid( pReq->m_fd ); s_notified_pid = 1; //if ( s_accept_notify ) // return notify_req_received( pReq->m_fd ); return 0; } else if ( pid == -1 ) { lsapi_perror("fork() failed, please increase process limit", errno); if (child_status) child_status->m_pid = 0; } else { ++pServer->m_iCurChildren; if ( child_status ) { child_status->m_pid = pid; child_status->m_tmWaitBegin = curTime; child_status->m_tmStart = curTime; } } close( pReq->m_fd ); pReq->m_fd = -1; if (sigprocmask(SIG_SETMASK, &orig_mask, NULL) < 0) perror( "sigprocmask( SIG_SETMASK ) to restore SIGMASK" ); } else { if (( errno == EINTR )||( errno == EAGAIN)) continue; lsapi_perror("accept() failed", errno); return -1; } } sigaction( SIGUSR1, &old_usr1, 0 ); //kill( -getpgrp(), SIGUSR1 ); //lsapi_all_children_must_die(); /* Sorry, children ;-) */ return -1; } static struct sigaction old_term, old_quit, old_int, old_usr1, old_child; int LSAPI_Postfork_Child(LSAPI_Request * pReq) { int max_children = g_prefork_server->m_iMaxChildren; s_pid = getpid(); __sync_lock_test_and_set(&pReq->child_status->m_pid, s_pid); s_worker_status = pReq->child_status; setsid(); g_prefork_server = NULL; s_ppid = getppid(); s_req_processed = 0; s_proc_group_timer_cb = NULL; if (pthread_atfork_func) (*pthread_atfork_func)(NULL, NULL, set_skip_write); __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_CONNECTED); if (s_busy_workers) __sync_add_and_fetch(s_busy_workers, 1); lsapi_set_nblock( pReq->m_fd, 0 ); //keep it open if busy_count is used. if (!s_keep_listener && s_busy_workers && *s_busy_workers > (max_children >> 1)) s_keep_listener = 1; if ((s_uid == 0 || !s_keep_listener || !is_enough_free_mem()) && pReq->m_fdListen != -1 ) { close(pReq->m_fdListen); pReq->m_fdListen = -1; } //init_conn_key( pReq->m_fd ); lsapi_notify_pid(pReq->m_fd); s_notified_pid = 1; //if ( s_accept_notify ) // return notify_req_received( pReq->m_fd ); return 0; } int LSAPI_Postfork_Parent(LSAPI_Request * pReq) { ++g_prefork_server->m_iCurChildren; if (pReq->child_status) { time_t curTime = time( NULL ); pReq->child_status->m_tmWaitBegin = curTime; pReq->child_status->m_tmStart = curTime; } close(pReq->m_fd); pReq->m_fd = -1; return 0; } int LSAPI_Accept_Before_Fork(LSAPI_Request * pReq) { time_t lastTime = 0; time_t curTime = 0; fd_set readfds; struct timeval timeout; int wait_secs = 0; int ret = 0; lsapi_prefork_server * pServer = g_prefork_server; struct sigaction act; lsapi_init_children_status(); act.sa_flags = 0; act.sa_handler = lsapi_sigchild; sigemptyset(&(act.sa_mask)); if (sigaction(SIGCHLD, &act, &old_child)) { perror( "Can't set signal handler for SIGCHILD" ); return -1; } /* Set up handler to kill children upon exit */ act.sa_flags = 0; act.sa_handler = lsapi_cleanup; sigemptyset(&(act.sa_mask)); if (sigaction(SIGTERM, &act, &old_term) || sigaction(SIGINT, &act, &old_int ) || sigaction(SIGUSR1, &act, &old_usr1) || sigaction(SIGQUIT, &act, &old_quit)) { perror( "Can't set signals" ); return -1; } s_stop = 0; pReq->m_reqState = 0; while(!s_stop) { if (s_proc_group_timer_cb != NULL) { s_proc_group_timer_cb(&s_ignore_pid); } curTime = time(NULL); if (curTime != lastTime) { lastTime = curTime; if (lsapi_parent_dead()) break; lsapi_check_child_status(curTime); if (pServer->m_iServerMaxIdle) { if (pServer->m_iCurChildren <= 0) { ++wait_secs; if ( wait_secs > pServer->m_iServerMaxIdle ) return -1; } else wait_secs = 0; } } #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) *s_avail_pages = sysconf(_SC_AVPHYS_PAGES); // lsapi_log("Memory total: %zd, free: %zd, free %%%zd\n", // s_total_pages, *s_avail_pages, *s_avail_pages * 100 / s_total_pages); #endif FD_ZERO(&readfds); FD_SET(pServer->m_fd, &readfds); timeout.tv_sec = 1; timeout.tv_usec = 0; ret = (*g_fnSelect)(pServer->m_fd+1, &readfds, NULL, NULL, &timeout); if (ret == 1 ) { int accepting = 0; if (s_accepting_workers) accepting = __sync_add_and_fetch(s_accepting_workers, 0); if (pServer->m_iCurChildren > 0 && accepting > 0) { usleep( 400); while(accepting-- > 0) sched_yield(); continue; } } else if (ret == -1) { if (errno == EINTR) continue; /* perror( "select()" ); */ break; } else { continue; } if (pServer->m_iCurChildren >= pServer->m_iMaxChildren + pServer->m_iExtraChildren) { lsapi_log("Reached max children process limit: %d, extra: %d," " current: %d, busy: %d, please increase LSAPI_CHILDREN.\n", pServer->m_iMaxChildren, pServer->m_iExtraChildren, pServer->m_iCurChildren, s_busy_workers ? *s_busy_workers : -1); usleep(100000); continue; } pReq->m_fd = lsapi_accept(pServer->m_fd); if (pReq->m_fd != -1) { wait_secs = 0; pReq->child_status = find_child_status(0); ret = 0; break; } else { if ((errno == EINTR) || (errno == EAGAIN)) continue; lsapi_perror("accept() failed", errno); ret = -1; break; } } sigaction(SIGCHLD, &old_child, 0); sigaction(SIGTERM, &old_term, 0); sigaction(SIGQUIT, &old_quit, 0); sigaction(SIGINT, &old_int, 0); sigaction(SIGUSR1, &old_usr1, 0); return ret; } int LSAPI_Prefork_Accept_r( LSAPI_Request * pReq ) { int fd; int ret; int wait_secs; fd_set readfds; struct timeval timeout; if (s_skip_write) return -1; LSAPI_Finish_r( pReq ); if ( g_prefork_server ) { if ( g_prefork_server->m_fd != -1 ) if ( lsapi_prefork_server_accept( g_prefork_server, pReq ) == -1 ) return -1; } else if (s_req_processed > 0 && s_max_busy_workers > 0 && s_busy_workers) { ret = __sync_fetch_and_add(s_busy_workers, 0); if (ret >= s_max_busy_workers) { send_conn_close_notification(pReq->m_fd); lsapi_close_connection(pReq); } } if ( (unsigned int)s_req_processed > s_max_reqs ) return -1; if ( s_worker_status ) { s_worker_status->m_tmWaitBegin = time( NULL ); } while( g_running ) { if ( pReq->m_fd != -1 ) { fd = pReq->m_fd; } else if ( pReq->m_fdListen != -1 ) fd = pReq->m_fdListen; else { break; } wait_secs = 0; while( 1 ) { if ( !g_running ) return -1; if (s_req_processed && s_worker_status && s_worker_status->m_iKillSent) return -1; FD_ZERO( &readfds ); FD_SET( fd, &readfds ); timeout.tv_sec = 1; timeout.tv_usec = 0; if (fd == pReq->m_fdListen) { if (s_worker_status) __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_ACCEPTING); if (s_accepting_workers) __sync_fetch_and_add(s_accepting_workers, 1); } ret = (*g_fnSelect)(fd+1, &readfds, NULL, NULL, &timeout); if (fd == pReq->m_fdListen) { if (s_accepting_workers) __sync_fetch_and_sub(s_accepting_workers, 1); if (s_worker_status) __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_IDLE); } if ( ret == 0 ) { if ( s_worker_status ) { s_worker_status->m_inProcess = 0; if (fd == pReq->m_fdListen) { if (s_keep_listener == 0 || !is_enough_free_mem()) return -1; if (s_keep_listener == 1) { int wait_time = 10; if (s_busy_workers) wait_time += *s_busy_workers * 10; if (s_accepting_workers) wait_time >>= (*s_accepting_workers); if (wait_secs >= wait_time) return -1; } } } ++wait_secs; if (( s_max_idle_secs > 0 )&&(wait_secs >= s_max_idle_secs )) return -1; if ( lsapi_parent_dead() ) return -1; } else if ( ret == -1 ) { if ( errno == EINTR ) continue; else return -1; } else if ( ret >= 1 ) { if (s_req_processed && s_worker_status && s_worker_status->m_iKillSent) return -1; if ( fd == pReq->m_fdListen ) { pReq->m_fd = lsapi_accept( pReq->m_fdListen ); if ( pReq->m_fd != -1 ) { if (s_worker_status) __sync_lock_test_and_set(&s_worker_status->m_state, LSAPI_STATE_CONNECTED); if (s_busy_workers) __sync_fetch_and_add(s_busy_workers, 1); fd = pReq->m_fd; lsapi_set_nblock( fd, 0 ); //init_conn_key( pReq->m_fd ); if (!s_keep_listener) { close( pReq->m_fdListen ); pReq->m_fdListen = -1; } if ( s_accept_notify ) if ( notify_req_received( pReq->m_fd ) == -1 ) return -1; } else { if (( errno == EINTR )||( errno == EAGAIN)) continue; lsapi_perror( "lsapi_accept() error", errno ); return -1; } } else break; } } if ( !readReq( pReq ) ) { if ( s_worker_status ) { s_worker_status->m_iKillSent = 0; s_worker_status->m_inProcess = 1; ++s_worker_status->m_iReqCounter; s_worker_status->m_tmReqBegin = s_worker_status->m_tmLastCheckPoint = time(NULL); } ++s_req_processed; return 0; } lsapi_close_connection(pReq); LSAPI_Reset_r( pReq ); } return -1; } void LSAPI_Set_Max_Reqs( int reqs ) { s_max_reqs = reqs - 1; } void LSAPI_Set_Max_Idle( int secs ) { s_max_idle_secs = secs; } void LSAPI_Set_Max_Children( int maxChildren ) { if ( g_prefork_server ) g_prefork_server->m_iMaxChildren = maxChildren; } void LSAPI_Set_Extra_Children( int extraChildren ) { if (( g_prefork_server )&&( extraChildren >= 0 )) g_prefork_server->m_iExtraChildren = extraChildren; } void LSAPI_Set_Max_Process_Time( int secs ) { if (( g_prefork_server )&&( secs > 0 )) g_prefork_server->m_iMaxReqProcessTime = secs; } void LSAPI_Set_Max_Idle_Children( int maxIdleChld ) { if (( g_prefork_server )&&( maxIdleChld > 0 )) g_prefork_server->m_iMaxIdleChildren = maxIdleChld; } void LSAPI_Set_Server_Max_Idle_Secs( int serverMaxIdle ) { if ( g_prefork_server ) g_prefork_server->m_iServerMaxIdle = serverMaxIdle; } void LSAPI_Set_Slow_Req_Msecs( int msecs ) { s_slow_req_msecs = msecs; } int LSAPI_Get_Slow_Req_Msecs(void) { return s_slow_req_msecs; } void LSAPI_No_Check_ppid(void) { s_ppid = 0; } int LSAPI_Get_ppid() { return(s_ppid); } #if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) #include #else extern char ** environ; #endif static void unset_lsapi_envs(void) { char **env; #if defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) env = *_NSGetEnviron(); #else env = environ; #endif while( env != NULL && *env != NULL ) { if (!strncmp(*env, "LSAPI_", 6) || !strncmp( *env, "PHP_LSAPI_", 10 ) || (!strncmp( *env, "PHPRC=", 6 )&&(!s_uid))) { char ** del = env; do *del = del[1]; while( *del++ ); } else ++env; } } static int lsapi_initSuEXEC(void) { int i; struct passwd * pw; s_defaultUid = 0; s_defaultGid = 0; if ( s_uid == 0 ) { const char * p = getenv( "LSAPI_DEFAULT_UID" ); if ( p ) { i = atoi( p ); if ( i > 0 ) s_defaultUid = i; } p = getenv( "LSAPI_DEFAULT_GID" ); if ( p ) { i = atoi( p ); if ( i > 0 ) s_defaultGid = i; } p = getenv( "LSAPI_SECRET" ); if (( !p )||( readSecret(p) == -1 )) return -1; if ( g_prefork_server ) { if ( g_prefork_server->m_iMaxChildren < 100 ) g_prefork_server->m_iMaxChildren = 100; if ( g_prefork_server->m_iExtraChildren < 1000 ) g_prefork_server->m_iExtraChildren = 1000; } } if ( !s_defaultUid || !s_defaultGid ) { pw = getpwnam( "nobody" ); if ( pw ) { if ( !s_defaultUid ) s_defaultUid = pw->pw_uid; if ( !s_defaultGid ) s_defaultGid = pw->pw_gid; } else { if ( !s_defaultUid ) s_defaultUid = 10000; if ( !s_defaultGid ) s_defaultGid = 10000; } } return 0; } static int lsapi_check_path(const char *p, char *final, int max_len) { char resolved_path[PATH_MAX+1]; int len = 0; char *end; if (*p != '/') { if (getcwd(final, max_len) == NULL) return -1; len = strlen(final); *(final + len) = '/'; ++len; } end = memccpy(&final[len], p, '\0', PATH_MAX - len); if (!end) { errno = EINVAL; return -1; } p = final; if (realpath(p, resolved_path) == NULL && errno != ENOENT && errno != EACCES) return -1; if (strncmp(resolved_path, "/etc/", 5) == 0) { errno = EPERM; return -1; } return 0; } static int lsapi_reopen_stderr2(const char *full_path) { int newfd = open(full_path, O_WRONLY | O_CREAT | O_APPEND, 0644); if (newfd == -1) { LSAPI_perror_r(NULL, "Failed to open custom stderr log", full_path); return -1; } if (newfd != 2) { dup2(newfd, 2); close(newfd); dup2(2, 1); } if (s_stderr_log_path && full_path != s_stderr_log_path) { free(s_stderr_log_path); s_stderr_log_path = NULL; } s_stderr_log_path = strdup(full_path); return 0; } static int lsapi_reopen_stderr(const char *p) { char full_path[PATH_MAX]; if (s_uid == 0) return -1; if (lsapi_check_path(p, full_path, PATH_MAX) == -1) { LSAPI_perror_r(NULL, "Invalid custom stderr log path", p); return -1; } return lsapi_reopen_stderr2(full_path); } int LSAPI_Init_Env_Parameters( fn_select_t fp ) { const char *p; char ch; int n; int avoidFork = 0; p = getenv("LSAPI_STDERR_LOG"); if (p) { lsapi_reopen_stderr(p); } if (!s_stderr_log_path) s_stderr_is_pipe = isPipe(STDERR_FILENO); p = getenv( "PHP_LSAPI_MAX_REQUESTS" ); if ( !p ) p = getenv( "LSAPI_MAX_REQS" ); if ( p ) { n = atoi( p ); if ( n > 0 ) LSAPI_Set_Max_Reqs( n ); } p = getenv( "LSAPI_KEEP_LISTEN" ); if ( p ) { n = atoi( p ); s_keep_listener = n; } p = getenv( "LSAPI_AVOID_FORK" ); if ( p ) { avoidFork = atoi( p ); if (avoidFork) { s_keep_listener = 2; ch = *(p + strlen(p) - 1); if ( ch == 'G' || ch == 'g' ) avoidFork *= 1024 * 1024 * 1024; else if ( ch == 'M' || ch == 'm' ) avoidFork *= 1024 * 1024; if (avoidFork >= 1024 * 10240) s_min_avail_pages = avoidFork / 4096; } } p = getenv( "LSAPI_ACCEPT_NOTIFY" ); if ( p ) { s_accept_notify = atoi( p ); } p = getenv( "LSAPI_SLOW_REQ_MSECS" ); if ( p ) { n = atoi( p ); LSAPI_Set_Slow_Req_Msecs( n ); } #if defined( RLIMIT_CORE ) p = getenv( "LSAPI_ALLOW_CORE_DUMP" ); if ( !p ) { struct rlimit limit = { 0, 0 }; setrlimit( RLIMIT_CORE, &limit ); } else s_enable_core_dump = 1; #endif p = getenv( "LSAPI_MAX_IDLE" ); if ( p ) { n = atoi( p ); LSAPI_Set_Max_Idle( n ); } if ( LSAPI_Is_Listen() ) { n = 0; p = getenv( "PHP_LSAPI_CHILDREN" ); if ( !p ) p = getenv( "LSAPI_CHILDREN" ); if ( p ) n = atoi( p ); if ( n > 1 ) { LSAPI_Init_Prefork_Server( n, fp, avoidFork != 0 ); LSAPI_Set_Server_fd( g_req.m_fdListen ); } p = getenv( "LSAPI_EXTRA_CHILDREN" ); if ( p ) LSAPI_Set_Extra_Children( atoi( p ) ); p = getenv( "LSAPI_MAX_IDLE_CHILDREN" ); if ( p ) LSAPI_Set_Max_Idle_Children( atoi( p ) ); p = getenv( "LSAPI_PGRP_MAX_IDLE" ); if ( p ) { LSAPI_Set_Server_Max_Idle_Secs( atoi( p ) ); } p = getenv( "LSAPI_MAX_PROCESS_TIME" ); if ( p ) LSAPI_Set_Max_Process_Time( atoi( p ) ); if ( getenv( "LSAPI_PPID_NO_CHECK" ) ) { LSAPI_No_Check_ppid(); } p = getenv("LSAPI_MAX_BUSY_WORKER"); if (p) { n = atoi(p); s_max_busy_workers = n; if (n >= 0) LSAPI_No_Check_ppid(); } p = getenv( "LSAPI_DUMP_DEBUG_INFO" ); if ( p ) s_dump_debug_info = atoi( p ); if ( lsapi_initSuEXEC() == -1 ) return -1; #if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) lsapi_initLVE(); #endif } unset_lsapi_envs(); return 0; } int LSAPI_ErrResponse_r( LSAPI_Request * pReq, int code, const char ** pRespHeaders, const char * pBody, int bodyLen ) { LSAPI_SetRespStatus_r( pReq, code ); if ( pRespHeaders ) { while( *pRespHeaders ) { LSAPI_AppendRespHeader_r( pReq, *pRespHeaders, strlen( *pRespHeaders ) ); ++pRespHeaders; } } if ( pBody &&( bodyLen > 0 )) { LSAPI_Write_r( pReq, pBody, bodyLen ); } LSAPI_Finish_r( pReq ); return 0; } static void lsapi_MD5Transform(uint32 buf[4], uint32 const in[16]); /* * Note: this code is harmless on little-endian machines. */ static void byteReverse(unsigned char *buf, unsigned longs) { uint32 t; do { t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | ((unsigned) buf[1] << 8 | buf[0]); *(uint32 *) buf = t; buf += 4; } while (--longs); } /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void lsapi_MD5Init(struct lsapi_MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void lsapi_MD5Update(struct lsapi_MD5Context *ctx, unsigned char const *buf, unsigned len) { register uint32 t; /* Update bitcount */ t = ctx->bits[0]; if ((ctx->bits[0] = t + ((uint32) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ /* Handle any leading odd-sized chunks */ if (t) { unsigned char *p = (unsigned char *) ctx->in + t; t = 64 - t; if (len < t) { memmove(p, buf, len); return; } memmove(p, buf, t); byteReverse(ctx->in, 16); lsapi_MD5Transform(ctx->buf, (uint32 *) ctx->in); buf += t; len -= t; } /* Process data in 64-byte chunks */ while (len >= 64) { memmove(ctx->in, buf, 64); byteReverse(ctx->in, 16); lsapi_MD5Transform(ctx->buf, (uint32 *) ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memmove(ctx->in, buf, len); } /* * Final wrap-up - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void lsapi_MD5Final(unsigned char digest[16], struct lsapi_MD5Context *ctx) { unsigned int count; unsigned char *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); byteReverse(ctx->in, 16); lsapi_MD5Transform(ctx->buf, (uint32 *) ctx->in); /* Now fill the next block with 56 bytes */ memset(ctx->in, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count - 8); } byteReverse(ctx->in, 14); /* Append length in bits and transform */ ((uint32 *) ctx->in)[14] = ctx->bits[0]; ((uint32 *) ctx->in)[15] = ctx->bits[1]; lsapi_MD5Transform(ctx->buf, (uint32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memmove(digest, ctx->buf, 16); memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ static void lsapi_MD5Transform(uint32 buf[4], uint32 const in[16]) { register uint32 a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } int LSAPI_Set_Restored_Parent_Pid(int pid) { int old_ppid = s_ppid; s_restored_ppid = pid; return old_ppid; } int LSAPI_Inc_Req_Processed(int cnt) { return __sync_add_and_fetch(s_global_counter, cnt); } PK!1]>>+php-5.6.40/sapi/cli/php_cli_process_title.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Keyur Govande (kgovande@gmail.com) | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_PS_TITLE_HEADER #define PHP_PS_TITLE_HEADER ZEND_BEGIN_ARG_INFO(arginfo_cli_set_process_title, 0) ZEND_ARG_INFO(0, title) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_cli_get_process_title, 0) ZEND_END_ARG_INFO() PHP_FUNCTION(cli_set_process_title); PHP_FUNCTION(cli_get_process_title); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!uRsphp-5.6.40/sapi/cli/php_cli.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Edin Kadribasic | | Marcus Boerger | | Johannes Schlueter | | Parts based on CGI SAPI Module by | | Rasmus Lerdorf, Stig Bakken and Zeev Suraski | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "php.h" #include "php_globals.h" #include "php_variables.h" #include "zend_hash.h" #include "zend_modules.h" #include "zend_interfaces.h" #include "ext/reflection/php_reflection.h" #include "SAPI.h" #include #include "php.h" #ifdef PHP_WIN32 #include "win32/time.h" #include "win32/signal.h" #include #endif #if HAVE_SYS_TIME_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SIGNAL_H #include #endif #if HAVE_SETLOCALE #include #endif #include "zend.h" #include "zend_extensions.h" #include "php_ini.h" #include "php_globals.h" #include "php_main.h" #include "fopen_wrappers.h" #include "ext/standard/php_standard.h" #include "cli.h" #ifdef PHP_WIN32 #include #include #include "win32/php_registry.h" #endif #if HAVE_SIGNAL_H #include #endif #ifdef __riscos__ #include #endif #include "zend_compile.h" #include "zend_execute.h" #include "zend_highlight.h" #include "zend_indent.h" #include "zend_exceptions.h" #include "php_getopt.h" #ifndef PHP_CLI_WIN32_NO_CONSOLE #include "php_cli_server.h" #endif #include "ps_title.h" #include "php_cli_process_title.h" #ifndef PHP_WIN32 # define php_select(m, r, w, e, t) select(m, r, w, e, t) #else # include "win32/select.h" #endif #if defined(PHP_WIN32) && defined(HAVE_OPENSSL) # include "openssl/applink.c" #endif PHPAPI extern char *php_ini_opened_path; PHPAPI extern char *php_ini_scanned_path; PHPAPI extern char *php_ini_scanned_files; #ifndef O_BINARY #define O_BINARY 0 #endif #define PHP_MODE_STANDARD 1 #define PHP_MODE_HIGHLIGHT 2 #define PHP_MODE_INDENT 3 #define PHP_MODE_LINT 4 #define PHP_MODE_STRIP 5 #define PHP_MODE_CLI_DIRECT 6 #define PHP_MODE_PROCESS_STDIN 7 #define PHP_MODE_REFLECTION_FUNCTION 8 #define PHP_MODE_REFLECTION_CLASS 9 #define PHP_MODE_REFLECTION_EXTENSION 10 #define PHP_MODE_REFLECTION_EXT_INFO 11 #define PHP_MODE_REFLECTION_ZEND_EXTENSION 12 #define PHP_MODE_SHOW_INI_CONFIG 13 cli_shell_callbacks_t cli_shell_callbacks = { NULL, NULL, NULL }; PHP_CLI_API cli_shell_callbacks_t *php_cli_get_shell_callbacks() { return &cli_shell_callbacks; } const char HARDCODED_INI[] = "html_errors=0\n" "register_argc_argv=1\n" "implicit_flush=1\n" "output_buffering=0\n" "max_execution_time=0\n" "max_input_time=-1\n\0"; const opt_struct OPTIONS[] = { {'a', 0, "interactive"}, {'B', 1, "process-begin"}, {'C', 0, "no-chdir"}, /* for compatibility with CGI (do not chdir to script directory) */ {'c', 1, "php-ini"}, {'d', 1, "define"}, {'E', 1, "process-end"}, {'e', 0, "profile-info"}, {'F', 1, "process-file"}, {'f', 1, "file"}, {'h', 0, "help"}, {'i', 0, "info"}, {'l', 0, "syntax-check"}, {'m', 0, "modules"}, {'n', 0, "no-php-ini"}, {'q', 0, "no-header"}, /* for compatibility with CGI (do not generate HTTP headers) */ {'R', 1, "process-code"}, {'H', 0, "hide-args"}, {'r', 1, "run"}, {'s', 0, "syntax-highlight"}, {'s', 0, "syntax-highlighting"}, {'S', 1, "server"}, {'t', 1, "docroot"}, {'w', 0, "strip"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, {'z', 1, "zend-extension"}, {10, 1, "rf"}, {10, 1, "rfunction"}, {11, 1, "rc"}, {11, 1, "rclass"}, {12, 1, "re"}, {12, 1, "rextension"}, {13, 1, "rz"}, {13, 1, "rzendextension"}, {14, 1, "ri"}, {14, 1, "rextinfo"}, {15, 0, "ini"}, {'-', 0, NULL} /* end of args */ }; static int print_module_info(zend_module_entry *module TSRMLS_DC) /* {{{ */ { php_printf("%s\n", module->name); return ZEND_HASH_APPLY_KEEP; } /* }}} */ static int module_name_cmp(const void *a, const void *b TSRMLS_DC) /* {{{ */ { Bucket *f = *((Bucket **) a); Bucket *s = *((Bucket **) b); return strcasecmp(((zend_module_entry *)f->pData)->name, ((zend_module_entry *)s->pData)->name); } /* }}} */ static void print_modules(TSRMLS_D) /* {{{ */ { HashTable sorted_registry; zend_module_entry tmp; zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); zend_hash_apply(&sorted_registry, (apply_func_t) print_module_info TSRMLS_CC); zend_hash_destroy(&sorted_registry); } /* }}} */ static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) /* {{{ */ { php_printf("%s\n", ext->name); return ZEND_HASH_APPLY_KEEP; } /* }}} */ static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) /* {{{ */ { return strcmp(((zend_extension *)(*f)->data)->name, ((zend_extension *)(*s)->data)->name); } /* }}} */ static void print_extensions(TSRMLS_D) /* {{{ */ { zend_llist sorted_exts; zend_llist_copy(&sorted_exts, &zend_extensions); sorted_exts.dtor = NULL; zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); zend_llist_apply(&sorted_exts, (llist_apply_func_t) print_extension_info TSRMLS_CC); zend_llist_destroy(&sorted_exts); } /* }}} */ #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif static inline int sapi_cli_select(int fd TSRMLS_DC) { fd_set wfd, dfd; struct timeval tv; int ret; FD_ZERO(&wfd); FD_ZERO(&dfd); PHP_SAFE_FD_SET(fd, &wfd); tv.tv_sec = FG(default_socket_timeout); tv.tv_usec = 0; ret = php_select(fd+1, &dfd, &wfd, &dfd, &tv); return ret != -1; } PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ { #ifdef PHP_WRITE_STDOUT long ret; #else size_t ret; #endif if (cli_shell_callbacks.cli_shell_write) { size_t shell_wrote; shell_wrote = cli_shell_callbacks.cli_shell_write(str, str_length TSRMLS_CC); if (shell_wrote > -1) { return shell_wrote; } } #ifdef PHP_WRITE_STDOUT do { ret = write(STDOUT_FILENO, str, str_length); } while (ret <= 0 && errno == EAGAIN && sapi_cli_select(STDOUT_FILENO TSRMLS_CC)); if (ret <= 0) { return 0; } return ret; #else ret = fwrite(str, 1, MIN(str_length, 16384), stdout); return ret; #endif } /* }}} */ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ { const char *ptr = str; uint remaining = str_length; size_t ret; if (!str_length) { return 0; } if (cli_shell_callbacks.cli_shell_ub_write) { int ub_wrote; ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length TSRMLS_CC); if (ub_wrote > -1) { return ub_wrote; } } while (remaining > 0) { ret = sapi_cli_single_write(ptr, remaining TSRMLS_CC); if (!ret) { #ifndef PHP_CLI_WIN32_NO_CONSOLE php_handle_aborted_connection(); #endif break; } ptr += ret; remaining -= ret; } return (ptr - str); } /* }}} */ static void sapi_cli_flush(void *server_context) /* {{{ */ { /* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams * are/could be closed before fflush() is called. */ if (fflush(stdout)==EOF && errno!=EBADF) { #ifndef PHP_CLI_WIN32_NO_CONSOLE php_handle_aborted_connection(); #endif } } /* }}} */ static char *php_self = ""; static char *script_filename = ""; static void sapi_cli_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { unsigned int len; char *docroot = ""; /* In CGI mode, we consider the environment to be a part of the server * variables */ php_import_environment_variables(track_vars_array TSRMLS_CC); /* Build the special-case PHP_SELF variable for the CLI version */ len = strlen(php_self); if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, len, &len TSRMLS_CC)) { php_register_variable("PHP_SELF", php_self, track_vars_array TSRMLS_CC); } if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_NAME", &php_self, len, &len TSRMLS_CC)) { php_register_variable("SCRIPT_NAME", php_self, track_vars_array TSRMLS_CC); } /* filenames are empty for stdin */ len = strlen(script_filename); if (sapi_module.input_filter(PARSE_SERVER, "SCRIPT_FILENAME", &script_filename, len, &len TSRMLS_CC)) { php_register_variable("SCRIPT_FILENAME", script_filename, track_vars_array TSRMLS_CC); } if (sapi_module.input_filter(PARSE_SERVER, "PATH_TRANSLATED", &script_filename, len, &len TSRMLS_CC)) { php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array TSRMLS_CC); } /* just make it available */ len = 0U; if (sapi_module.input_filter(PARSE_SERVER, "DOCUMENT_ROOT", &docroot, len, &len TSRMLS_CC)) { php_register_variable("DOCUMENT_ROOT", docroot, track_vars_array TSRMLS_CC); } } /* }}} */ static void sapi_cli_log_message(char *message TSRMLS_DC) /* {{{ */ { fprintf(stderr, "%s\n", message); } /* }}} */ static int sapi_cli_deactivate(TSRMLS_D) /* {{{ */ { fflush(stdout); if(SG(request_info).argv0) { free(SG(request_info).argv0); SG(request_info).argv0 = NULL; } return SUCCESS; } /* }}} */ static char* sapi_cli_read_cookies(TSRMLS_D) /* {{{ */ { return NULL; } /* }}} */ static int sapi_cli_header_handler(sapi_header_struct *h, sapi_header_op_enum op, sapi_headers_struct *s TSRMLS_DC) /* {{{ */ { return 0; } /* }}} */ static int sapi_cli_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ { /* We do nothing here, this function is needed to prevent that the fallback * header handling is called. */ return SAPI_HEADER_SENT_SUCCESSFULLY; } /* }}} */ static void sapi_cli_send_header(sapi_header_struct *sapi_header, void *server_context TSRMLS_DC) /* {{{ */ { } /* }}} */ static int php_cli_startup(sapi_module_struct *sapi_module) /* {{{ */ { if (php_module_startup(sapi_module, NULL, 0)==FAILURE) { return FAILURE; } return SUCCESS; } /* }}} */ /* {{{ sapi_cli_ini_defaults */ /* overwriteable ini defaults must be set in sapi_cli_ini_defaults() */ #define INI_DEFAULT(name,value)\ Z_SET_REFCOUNT(tmp, 0);\ Z_UNSET_ISREF(tmp); \ ZVAL_STRINGL(&tmp, zend_strndup(value, sizeof(value)-1), sizeof(value)-1, 0);\ zend_hash_update(configuration_hash, name, sizeof(name), &tmp, sizeof(zval), NULL);\ static void sapi_cli_ini_defaults(HashTable *configuration_hash) { zval tmp; INI_DEFAULT("report_zend_debug", "0"); INI_DEFAULT("display_errors", "1"); } /* }}} */ /* {{{ sapi_module_struct cli_sapi_module */ static sapi_module_struct cli_sapi_module = { "cli", /* name */ "Command Line Interface", /* pretty name */ php_cli_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ NULL, /* activate */ sapi_cli_deactivate, /* deactivate */ sapi_cli_ub_write, /* unbuffered write */ sapi_cli_flush, /* flush */ NULL, /* get uid */ NULL, /* getenv */ php_error, /* error handler */ sapi_cli_header_handler, /* header handler */ sapi_cli_send_headers, /* send headers handler */ sapi_cli_send_header, /* send header handler */ NULL, /* read POST data */ sapi_cli_read_cookies, /* read Cookies */ sapi_cli_register_variables, /* register server variables */ sapi_cli_log_message, /* Log message */ NULL, /* Get request time */ NULL, /* Child terminate */ STANDARD_SAPI_MODULE_PROPERTIES }; /* }}} */ /* {{{ arginfo ext/standard/dl.c */ ZEND_BEGIN_ARG_INFO(arginfo_dl, 0) ZEND_ARG_INFO(0, extension_filename) ZEND_END_ARG_INFO() /* }}} */ static const zend_function_entry additional_functions[] = { ZEND_FE(dl, arginfo_dl) PHP_FE(cli_set_process_title, arginfo_cli_set_process_title) PHP_FE(cli_get_process_title, arginfo_cli_get_process_title) {NULL, NULL, NULL} }; /* {{{ php_cli_usage */ static void php_cli_usage(char *argv0) { char *prog; prog = strrchr(argv0, '/'); if (prog) { prog++; } else { prog = "php"; } printf( "Usage: %s [options] [-f] [--] [args...]\n" " %s [options] -r [--] [args...]\n" " %s [options] [-B ] -R [-E ] [--] [args...]\n" " %s [options] [-B ] -F [-E ] [--] [args...]\n" " %s [options] -S : [-t docroot]\n" " %s [options] -- [args...]\n" " %s [options] -a\n" "\n" #if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) " -a Run as interactive shell\n" #else " -a Run interactively\n" #endif " -c | Look for php.ini file in this directory\n" " -n No php.ini file will be used\n" " -d foo[=bar] Define INI entry foo with value 'bar'\n" " -e Generate extended information for debugger/profiler\n" " -f Parse and execute .\n" " -h This help\n" " -i PHP information\n" " -l Syntax check only (lint)\n" " -m Show compiled in modules\n" " -r Run PHP without using script tags \n" " -B Run PHP before processing input lines\n" " -R Run PHP for every input line\n" " -F Parse and execute for every input line\n" " -E Run PHP after processing all input lines\n" " -H Hide any passed arguments from external tools.\n" " -S : Run with built-in web server.\n" " -t Specify document root for built-in web server.\n" " -s Output HTML syntax highlighted source.\n" " -v Version number\n" " -w Output source with stripped comments and whitespace.\n" " -z Load Zend extension .\n" "\n" " args... Arguments passed to script. Use -- args when first argument\n" " starts with - or script is read from stdin\n" "\n" " --ini Show configuration file names\n" "\n" " --rf Show information about function .\n" " --rc Show information about class .\n" " --re Show information about extension .\n" " --rz Show information about Zend extension .\n" " --ri Show configuration for extension .\n" "\n" , prog, prog, prog, prog, prog, prog, prog); } /* }}} */ static php_stream *s_in_process = NULL; static void cli_register_file_handles(TSRMLS_D) /* {{{ */ { zval *zin, *zout, *zerr; php_stream *s_in, *s_out, *s_err; php_stream_context *sc_in=NULL, *sc_out=NULL, *sc_err=NULL; zend_constant ic, oc, ec; MAKE_STD_ZVAL(zin); MAKE_STD_ZVAL(zout); MAKE_STD_ZVAL(zerr); s_in = php_stream_open_wrapper_ex("php://stdin", "rb", 0, NULL, sc_in); s_out = php_stream_open_wrapper_ex("php://stdout", "wb", 0, NULL, sc_out); s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err); if (s_in==NULL || s_out==NULL || s_err==NULL) { FREE_ZVAL(zin); FREE_ZVAL(zout); FREE_ZVAL(zerr); if (s_in) php_stream_close(s_in); if (s_out) php_stream_close(s_out); if (s_err) php_stream_close(s_err); return; } #if PHP_DEBUG /* do not close stdout and stderr */ s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE; s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE; #endif s_in_process = s_in; php_stream_to_zval(s_in, zin); php_stream_to_zval(s_out, zout); php_stream_to_zval(s_err, zerr); ic.value = *zin; ic.flags = CONST_CS; ic.name = zend_strndup(ZEND_STRL("STDIN")); ic.name_len = sizeof("STDIN"); ic.module_number = 0; zend_register_constant(&ic TSRMLS_CC); oc.value = *zout; oc.flags = CONST_CS; oc.name = zend_strndup(ZEND_STRL("STDOUT")); oc.name_len = sizeof("STDOUT"); oc.module_number = 0; zend_register_constant(&oc TSRMLS_CC); ec.value = *zerr; ec.flags = CONST_CS; ec.name = zend_strndup(ZEND_STRL("STDERR")); ec.name_len = sizeof("STDERR"); ec.module_number = 0; zend_register_constant(&ec TSRMLS_CC); FREE_ZVAL(zin); FREE_ZVAL(zout); FREE_ZVAL(zerr); } /* }}} */ static const char *param_mode_conflict = "Either execute direct code, process stdin or use a file.\n"; /* {{{ cli_seek_file_begin */ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, int *lineno TSRMLS_DC) { int c; *lineno = 1; file_handle->type = ZEND_HANDLE_FP; file_handle->opened_path = NULL; file_handle->free_filename = 0; if (!(file_handle->handle.fp = VCWD_FOPEN(script_file, "rb"))) { php_printf("Could not open input file: %s\n", script_file); return FAILURE; } file_handle->filename = script_file; /* #!php support */ c = fgetc(file_handle->handle.fp); if (c == '#' && (c = fgetc(file_handle->handle.fp)) == '!') { while (c != '\n' && c != '\r' && c != EOF) { c = fgetc(file_handle->handle.fp); /* skip to end of line */ } /* handle situations where line is terminated by \r\n */ if (c == '\r') { if (fgetc(file_handle->handle.fp) != '\n') { long pos = ftell(file_handle->handle.fp); fseek(file_handle->handle.fp, pos - 1, SEEK_SET); } } *lineno = 2; } else { rewind(file_handle->handle.fp); } return SUCCESS; } /* }}} */ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ { int c; zend_file_handle file_handle; int behavior = PHP_MODE_STANDARD; char *reflection_what = NULL; volatile int request_started = 0; volatile int exit_status = 0; char *php_optarg = NULL, *orig_optarg = NULL; int php_optind = 1, orig_optind = 1; char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL; char *arg_free=NULL, **arg_excp=&arg_free; char *script_file=NULL, *translated_path = NULL; int interactive=0; int lineno = 0; const char *param_error=NULL; int hide_argv = 0; zend_try { CG(in_compilation) = 0; /* not initialized but needed for several options */ EG(uninitialized_zval_ptr) = NULL; while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) { switch (c) { case 'i': /* php info & quit */ if (php_request_startup(TSRMLS_C)==FAILURE) { goto err; } request_started = 1; php_print_info(0xFFFFFFFF TSRMLS_CC); php_output_end_all(TSRMLS_C); exit_status = (c == '?' && argc > 1 && !strchr(argv[1], c)); goto out; case 'v': /* show php version & quit */ php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, #if ZEND_DEBUG && defined(HAVE_GCOV) "(DEBUG GCOV)", #elif ZEND_DEBUG "(DEBUG)", #elif defined(HAVE_GCOV) "(GCOV)", #else "", #endif get_zend_version() ); sapi_deactivate(TSRMLS_C); goto out; case 'm': /* list compiled in modules */ if (php_request_startup(TSRMLS_C)==FAILURE) { goto err; } request_started = 1; php_printf("[PHP Modules]\n"); print_modules(TSRMLS_C); php_printf("\n[Zend Modules]\n"); print_extensions(TSRMLS_C); php_printf("\n"); php_output_end_all(TSRMLS_C); exit_status=0; goto out; default: break; } } /* Set some CLI defaults */ SG(options) |= SAPI_OPTION_NO_CHDIR; php_optind = orig_optind; php_optarg = orig_optarg; while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) { switch (c) { case 'a': /* interactive mode */ if (!interactive) { if (behavior != PHP_MODE_STANDARD) { param_error = param_mode_conflict; break; } interactive=1; } break; case 'C': /* don't chdir to the script directory */ /* This is default so NOP */ break; case 'F': if (behavior == PHP_MODE_PROCESS_STDIN) { if (exec_run || script_file) { param_error = "You can use -R or -F only once.\n"; break; } } else if (behavior != PHP_MODE_STANDARD) { param_error = param_mode_conflict; break; } behavior=PHP_MODE_PROCESS_STDIN; script_file = php_optarg; break; case 'f': /* parse file */ if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { param_error = param_mode_conflict; break; } else if (script_file) { param_error = "You can use -f only once.\n"; break; } script_file = php_optarg; break; case 'l': /* syntax check mode */ if (behavior != PHP_MODE_STANDARD) { break; } behavior=PHP_MODE_LINT; break; #if 0 /* not yet operational, see also below ... */ case '': /* generate indented source mode*/ if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { param_error = "Source indenting only works for files.\n"; break; } behavior=PHP_MODE_INDENT; break; #endif case 'q': /* do not generate HTTP headers */ /* This is default so NOP */ break; case 'r': /* run code from command line */ if (behavior == PHP_MODE_CLI_DIRECT) { if (exec_direct || script_file) { param_error = "You can use -r only once.\n"; break; } } else if (behavior != PHP_MODE_STANDARD || interactive) { param_error = param_mode_conflict; break; } behavior=PHP_MODE_CLI_DIRECT; exec_direct=php_optarg; break; case 'R': if (behavior == PHP_MODE_PROCESS_STDIN) { if (exec_run || script_file) { param_error = "You can use -R or -F only once.\n"; break; } } else if (behavior != PHP_MODE_STANDARD) { param_error = param_mode_conflict; break; } behavior=PHP_MODE_PROCESS_STDIN; exec_run=php_optarg; break; case 'B': if (behavior == PHP_MODE_PROCESS_STDIN) { if (exec_begin) { param_error = "You can use -B only once.\n"; break; } } else if (behavior != PHP_MODE_STANDARD || interactive) { param_error = param_mode_conflict; break; } behavior=PHP_MODE_PROCESS_STDIN; exec_begin=php_optarg; break; case 'E': if (behavior == PHP_MODE_PROCESS_STDIN) { if (exec_end) { param_error = "You can use -E only once.\n"; break; } } else if (behavior != PHP_MODE_STANDARD || interactive) { param_error = param_mode_conflict; break; } behavior=PHP_MODE_PROCESS_STDIN; exec_end=php_optarg; break; case 's': /* generate highlighted HTML from source */ if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { param_error = "Source highlighting only works for files.\n"; break; } behavior=PHP_MODE_HIGHLIGHT; break; case 'w': if (behavior == PHP_MODE_CLI_DIRECT || behavior == PHP_MODE_PROCESS_STDIN) { param_error = "Source stripping only works for files.\n"; break; } behavior=PHP_MODE_STRIP; break; case 'z': /* load extension file */ zend_load_extension(php_optarg); break; case 'H': hide_argv = 1; break; case 10: behavior=PHP_MODE_REFLECTION_FUNCTION; reflection_what = php_optarg; break; case 11: behavior=PHP_MODE_REFLECTION_CLASS; reflection_what = php_optarg; break; case 12: behavior=PHP_MODE_REFLECTION_EXTENSION; reflection_what = php_optarg; break; case 13: behavior=PHP_MODE_REFLECTION_ZEND_EXTENSION; reflection_what = php_optarg; break; case 14: behavior=PHP_MODE_REFLECTION_EXT_INFO; reflection_what = php_optarg; break; case 15: behavior = PHP_MODE_SHOW_INI_CONFIG; break; default: break; } } if (param_error) { PUTS(param_error); exit_status=1; goto err; } if (interactive) { #if (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE) printf("Interactive shell\n\n"); #else printf("Interactive mode enabled\n\n"); #endif fflush(stdout); } CG(interactive) = interactive; /* only set script_file if not set already and not in direct mode and not at end of parameter list */ if (argc > php_optind && !script_file && behavior!=PHP_MODE_CLI_DIRECT && behavior!=PHP_MODE_PROCESS_STDIN && strcmp(argv[php_optind-1],"--")) { script_file=argv[php_optind]; php_optind++; } if (script_file) { if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { goto err; } else { char real_path[MAXPATHLEN]; if (VCWD_REALPATH(script_file, real_path)) { translated_path = strdup(real_path); } script_filename = script_file; } } else { /* We could handle PHP_MODE_PROCESS_STDIN in a different manner */ /* here but this would make things only more complicated. And it */ /* is consitent with the way -R works where the stdin file handle*/ /* is also accessible. */ file_handle.filename = "-"; file_handle.handle.fp = stdin; } file_handle.type = ZEND_HANDLE_FP; file_handle.opened_path = NULL; file_handle.free_filename = 0; php_self = (char*)file_handle.filename; /* before registering argv to module exchange the *new* argv[0] */ /* we can achieve this without allocating more memory */ SG(request_info).argc=argc-php_optind+1; arg_excp = argv+php_optind-1; arg_free = argv[php_optind-1]; SG(request_info).path_translated = translated_path? translated_path: (char*)file_handle.filename; argv[php_optind-1] = (char*)file_handle.filename; SG(request_info).argv=argv+php_optind-1; if (php_request_startup(TSRMLS_C)==FAILURE) { *arg_excp = arg_free; fclose(file_handle.handle.fp); PUTS("Could not startup.\n"); goto err; } request_started = 1; CG(start_lineno) = lineno; *arg_excp = arg_free; /* reconstuct argv */ if (hide_argv) { int i; for (i = 1; i < argc; i++) { memset(argv[i], 0, strlen(argv[i])); } } zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); PG(during_request_startup) = 0; switch (behavior) { case PHP_MODE_STANDARD: if (strcmp(file_handle.filename, "-")) { cli_register_file_handles(TSRMLS_C); } if (interactive && cli_shell_callbacks.cli_shell_run) { exit_status = cli_shell_callbacks.cli_shell_run(TSRMLS_C); } else { php_execute_script(&file_handle TSRMLS_CC); exit_status = EG(exit_status); } break; case PHP_MODE_LINT: exit_status = php_lint_script(&file_handle TSRMLS_CC); if (exit_status==SUCCESS) { zend_printf("No syntax errors detected in %s\n", file_handle.filename); } else { zend_printf("Errors parsing %s\n", file_handle.filename); } break; case PHP_MODE_STRIP: if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { zend_strip(TSRMLS_C); } goto out; break; case PHP_MODE_HIGHLIGHT: { zend_syntax_highlighter_ini syntax_highlighter_ini; if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); zend_highlight(&syntax_highlighter_ini TSRMLS_CC); } goto out; } break; #if 0 /* Zeev might want to do something with this one day */ case PHP_MODE_INDENT: open_file_for_scanning(&file_handle TSRMLS_CC); zend_indent(); zend_file_handle_dtor(file_handle.handle TSRMLS_CC); goto out; break; #endif case PHP_MODE_CLI_DIRECT: cli_register_file_handles(TSRMLS_C); if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } break; case PHP_MODE_PROCESS_STDIN: { char *input; size_t len, index = 0; zval *argn, *argi; cli_register_file_handles(TSRMLS_C); if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } ALLOC_ZVAL(argi); Z_TYPE_P(argi) = IS_LONG; Z_LVAL_P(argi) = index; INIT_PZVAL(argi); zend_hash_update(&EG(symbol_table), "argi", sizeof("argi"), &argi, sizeof(zval *), NULL); while (exit_status == SUCCESS && (input=php_stream_gets(s_in_process, NULL, 0)) != NULL) { len = strlen(input); while (len-- && (input[len]=='\n' || input[len]=='\r')) { input[len] = '\0'; } ALLOC_ZVAL(argn); Z_TYPE_P(argn) = IS_STRING; Z_STRLEN_P(argn) = ++len; Z_STRVAL_P(argn) = estrndup(input, len); INIT_PZVAL(argn); zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(zval *), NULL); Z_LVAL_P(argi) = ++index; if (exec_run) { if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } } else { if (script_file) { if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) { exit_status = 1; } else { CG(start_lineno) = lineno; php_execute_script(&file_handle TSRMLS_CC); exit_status = EG(exit_status); } } } efree(input); } if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } break; } case PHP_MODE_REFLECTION_FUNCTION: case PHP_MODE_REFLECTION_CLASS: case PHP_MODE_REFLECTION_EXTENSION: case PHP_MODE_REFLECTION_ZEND_EXTENSION: { zend_class_entry *pce = NULL; zval *arg, *ref; zend_execute_data execute_data; switch (behavior) { default: break; case PHP_MODE_REFLECTION_FUNCTION: if (strstr(reflection_what, "::")) { pce = reflection_method_ptr; } else { pce = reflection_function_ptr; } break; case PHP_MODE_REFLECTION_CLASS: pce = reflection_class_ptr; break; case PHP_MODE_REFLECTION_EXTENSION: pce = reflection_extension_ptr; break; case PHP_MODE_REFLECTION_ZEND_EXTENSION: pce = reflection_zend_extension_ptr; break; } MAKE_STD_ZVAL(arg); ZVAL_STRING(arg, reflection_what, 1); ALLOC_ZVAL(ref); object_init_ex(ref, pce); INIT_PZVAL(ref); memset(&execute_data, 0, sizeof(zend_execute_data)); EG(current_execute_data) = &execute_data; EX(function_state).function = pce->constructor; zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, arg); if (EG(exception)) { zval *msg = zend_read_property(zend_exception_get_default(TSRMLS_C), EG(exception), "message", sizeof("message")-1, 0 TSRMLS_CC); zend_printf("Exception: %s\n", Z_STRVAL_P(msg)); zval_ptr_dtor(&EG(exception)); EG(exception) = NULL; } else { zend_call_method_with_1_params(NULL, reflection_ptr, NULL, "export", NULL, ref); } zval_ptr_dtor(&ref); zval_ptr_dtor(&arg); break; } case PHP_MODE_REFLECTION_EXT_INFO: { int len = strlen(reflection_what); char *lcname = zend_str_tolower_dup(reflection_what, len); zend_module_entry *module; if (zend_hash_find(&module_registry, lcname, len+1, (void**)&module) == FAILURE) { if (!strcmp(reflection_what, "main")) { display_ini_entries(NULL); } else { zend_printf("Extension '%s' not present.\n", reflection_what); exit_status = 1; } } else { php_info_print_module(module TSRMLS_CC); } efree(lcname); break; } case PHP_MODE_SHOW_INI_CONFIG: { zend_printf("Configuration File (php.ini) Path: %s\n", PHP_CONFIG_FILE_PATH); zend_printf("Loaded Configuration File: %s\n", php_ini_opened_path ? php_ini_opened_path : "(none)"); zend_printf("Scan for additional .ini files in: %s\n", php_ini_scanned_path ? php_ini_scanned_path : "(none)"); zend_printf("Additional .ini files parsed: %s\n", php_ini_scanned_files ? php_ini_scanned_files : "(none)"); break; } } } zend_end_try(); out: if (request_started) { php_request_shutdown((void *) 0); } if (translated_path) { free(translated_path); } if (exit_status == 0) { exit_status = EG(exit_status); } return exit_status; err: sapi_deactivate(TSRMLS_C); zend_ini_deactivate(TSRMLS_C); exit_status = 1; goto out; } /* }}} */ /* {{{ main */ #ifdef PHP_CLI_WIN32_NO_CONSOLE int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) #else int main(int argc, char *argv[]) #endif { #ifdef ZTS void ***tsrm_ls; #endif #ifdef PHP_CLI_WIN32_NO_CONSOLE int argc = __argc; char **argv = __argv; #endif int c; int exit_status = SUCCESS; int module_started = 0, sapi_started = 0; char *php_optarg = NULL; int php_optind = 1, use_extended_info = 0; char *ini_path_override = NULL; char *ini_entries = NULL; int ini_entries_len = 0; int ini_ignore = 0; sapi_module_struct *sapi_module = &cli_sapi_module; /* * Do not move this initialization. It needs to happen before argv is used * in any way. */ argv = save_ps_args(argc, argv); cli_sapi_module.additional_functions = additional_functions; #if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP) { int tmp_flag; _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF; tmp_flag |= _CRTDBG_LEAK_CHECK_DF; _CrtSetDbgFlag(tmp_flag); } #endif #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so that sockets created via fsockopen() don't kill PHP if the remote site closes it. in apache|apxs mode apache does that for us! thies@thieso.net 20000419 */ #endif #endif #ifdef ZTS tsrm_startup(1, 1, 0, NULL); tsrm_ls = ts_resource(0); #endif #ifdef PHP_WIN32 _fmode = _O_BINARY; /*sets default for file streams to binary */ setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2))!=-1) { switch (c) { case 'c': if (ini_path_override) { free(ini_path_override); } ini_path_override = strdup(php_optarg); break; case 'n': ini_ignore = 1; break; case 'd': { /* define ini entries on command line */ int len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { val++; if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') { ini_entries = realloc(ini_entries, ini_entries_len + len + sizeof("\"\"\n\0")); memcpy(ini_entries + ini_entries_len, php_optarg, (val - php_optarg)); ini_entries_len += (val - php_optarg); memcpy(ini_entries + ini_entries_len, "\"", 1); ini_entries_len++; memcpy(ini_entries + ini_entries_len, val, len - (val - php_optarg)); ini_entries_len += len - (val - php_optarg); memcpy(ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0")); ini_entries_len += sizeof("\n\0\"") - 2; } else { ini_entries = realloc(ini_entries, ini_entries_len + len + sizeof("\n\0")); memcpy(ini_entries + ini_entries_len, php_optarg, len); memcpy(ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0")); ini_entries_len += len + sizeof("\n\0") - 2; } } else { ini_entries = realloc(ini_entries, ini_entries_len + len + sizeof("=1\n\0")); memcpy(ini_entries + ini_entries_len, php_optarg, len); memcpy(ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0")); ini_entries_len += len + sizeof("=1\n\0") - 2; } break; } #ifndef PHP_CLI_WIN32_NO_CONSOLE case 'S': sapi_module = &cli_server_sapi_module; cli_server_sapi_module.additional_functions = server_additional_functions; break; #endif case 'h': /* help & quit */ case '?': php_cli_usage(argv[0]); goto out; case 'i': case 'v': case 'm': sapi_module = &cli_sapi_module; goto exit_loop; case 'e': /* enable extended info output */ use_extended_info = 1; break; } } exit_loop: sapi_module->ini_defaults = sapi_cli_ini_defaults; sapi_module->php_ini_path_override = ini_path_override; sapi_module->phpinfo_as_text = 1; sapi_module->php_ini_ignore_cwd = 1; sapi_startup(sapi_module); sapi_started = 1; sapi_module->php_ini_ignore = ini_ignore; sapi_module->executable_location = argv[0]; if (sapi_module == &cli_sapi_module) { if (ini_entries) { ini_entries = realloc(ini_entries, ini_entries_len + sizeof(HARDCODED_INI)); memmove(ini_entries + sizeof(HARDCODED_INI) - 2, ini_entries, ini_entries_len + 1); memcpy(ini_entries, HARDCODED_INI, sizeof(HARDCODED_INI) - 2); } else { ini_entries = malloc(sizeof(HARDCODED_INI)); memcpy(ini_entries, HARDCODED_INI, sizeof(HARDCODED_INI)); } ini_entries_len += sizeof(HARDCODED_INI) - 2; } sapi_module->ini_entries = ini_entries; /* startup after we get the above ini override se we get things right */ if (sapi_module->startup(sapi_module) == FAILURE) { /* there is no way to see if we must call zend_ini_deactivate() * since we cannot check if EG(ini_directives) has been initialised * because the executor's constructor does not set initialize it. * Apart from that there seems no need for zend_ini_deactivate() yet. * So we goto out_err.*/ exit_status = 1; goto out; } module_started = 1; /* -e option */ if (use_extended_info) { CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO; } zend_first_try { #ifndef PHP_CLI_WIN32_NO_CONSOLE if (sapi_module == &cli_sapi_module) { #endif exit_status = do_cli(argc, argv TSRMLS_CC); #ifndef PHP_CLI_WIN32_NO_CONSOLE } else { exit_status = do_cli_server(argc, argv TSRMLS_CC); } #endif } zend_end_try(); out: if (ini_path_override) { free(ini_path_override); } if (ini_entries) { free(ini_entries); } if (module_started) { php_module_shutdown(TSRMLS_C); } if (sapi_started) { sapi_shutdown(); } #ifdef ZTS tsrm_shutdown(); #endif /* * Do not move this de-initialization. It needs to happen right before * exiting. */ cleanup_ps_args(argv); exit(exit_status); } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!vʢ%%$php-5.6.40/sapi/cli/php_cli_server.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | | Xinchen Hui | +----------------------------------------------------------------------+ */ /* $Id: php_cli.c 306938 2011-01-01 02:17:06Z felipe $ */ #include #include #include #include #ifdef PHP_WIN32 # include # include # include "win32/time.h" # include "win32/signal.h" # include "win32/php_registry.h" # include #else # include "php_config.h" #endif #ifdef __riscos__ #include #endif #if HAVE_TIME_H #include #endif #if HAVE_SYS_TIME_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_SIGNAL_H #include #endif #if HAVE_SETLOCALE #include #endif #if HAVE_DLFCN_H #include #endif #include "SAPI.h" #include "php.h" #include "php_ini.h" #include "php_main.h" #include "php_globals.h" #include "php_variables.h" #include "zend_hash.h" #include "zend_modules.h" #include "fopen_wrappers.h" #include "zend_compile.h" #include "zend_execute.h" #include "zend_highlight.h" #include "zend_indent.h" #include "zend_exceptions.h" #include "php_getopt.h" #ifndef PHP_WIN32 # define php_select(m, r, w, e, t) select(m, r, w, e, t) # define SOCK_EINVAL EINVAL # define SOCK_EAGAIN EAGAIN # define SOCK_EINTR EINTR # define SOCK_EADDRINUSE EADDRINUSE #else # include "win32/select.h" # define SOCK_EINVAL WSAEINVAL # define SOCK_EAGAIN WSAEWOULDBLOCK # define SOCK_EINTR WSAEINTR # define SOCK_EADDRINUSE WSAEADDRINUSE #endif #ifndef S_ISDIR #define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) #endif #include "ext/standard/file.h" /* for php_set_sock_blocking() :-( */ #include "ext/standard/php_smart_str.h" #include "ext/standard/html.h" #include "ext/standard/url.h" /* for php_raw_url_decode() */ #include "ext/standard/php_string.h" /* for php_dirname() */ #include "php_network.h" #include "php_http_parser.h" #include "php_cli_server.h" #include "php_cli_process_title.h" #define OUTPUT_NOT_CHECKED -1 #define OUTPUT_IS_TTY 1 #define OUTPUT_NOT_TTY 0 typedef struct php_cli_server_poller { fd_set rfds, wfds; struct { fd_set rfds, wfds; } active; php_socket_t max_fd; } php_cli_server_poller; typedef struct php_cli_server_request { enum php_http_method request_method; int protocol_version; char *request_uri; size_t request_uri_len; char *vpath; size_t vpath_len; char *path_translated; size_t path_translated_len; char *path_info; size_t path_info_len; char *query_string; size_t query_string_len; HashTable headers; HashTable headers_original_case; char *content; size_t content_len; const char *ext; size_t ext_len; struct stat sb; } php_cli_server_request; typedef struct php_cli_server_chunk { struct php_cli_server_chunk *next; enum php_cli_server_chunk_type { PHP_CLI_SERVER_CHUNK_HEAP, PHP_CLI_SERVER_CHUNK_IMMORTAL } type; union { struct { void *block; char *p; size_t len; } heap; struct { const char *p; size_t len; } immortal; } data; } php_cli_server_chunk; typedef struct php_cli_server_buffer { php_cli_server_chunk *first; php_cli_server_chunk *last; } php_cli_server_buffer; typedef struct php_cli_server_content_sender { php_cli_server_buffer buffer; } php_cli_server_content_sender; typedef struct php_cli_server_client { struct php_cli_server *server; php_socket_t sock; struct sockaddr *addr; socklen_t addr_len; char *addr_str; size_t addr_str_len; php_http_parser parser; unsigned int request_read:1; char *current_header_name; size_t current_header_name_len; unsigned int current_header_name_allocated:1; size_t post_read_offset; php_cli_server_request request; unsigned int content_sender_initialized:1; php_cli_server_content_sender content_sender; int file_fd; } php_cli_server_client; typedef struct php_cli_server { php_socket_t server_sock; php_cli_server_poller poller; int is_running; char *host; int port; int address_family; char *document_root; size_t document_root_len; char *router; size_t router_len; socklen_t socklen; HashTable clients; } php_cli_server; typedef struct php_cli_server_http_response_status_code_pair { int code; const char *str; } php_cli_server_http_response_status_code_pair; typedef struct php_cli_server_ext_mime_type_pair { const char *ext; const char *mime_type; } php_cli_server_ext_mime_type_pair; static php_cli_server_http_response_status_code_pair status_map[] = { { 100, "Continue" }, { 101, "Switching Protocols" }, { 200, "OK" }, { 201, "Created" }, { 202, "Accepted" }, { 203, "Non-Authoritative Information" }, { 204, "No Content" }, { 205, "Reset Content" }, { 206, "Partial Content" }, { 300, "Multiple Choices" }, { 301, "Moved Permanently" }, { 302, "Found" }, { 303, "See Other" }, { 304, "Not Modified" }, { 305, "Use Proxy" }, { 307, "Temporary Redirect" }, { 308, "Permanent Redirect" }, { 400, "Bad Request" }, { 401, "Unauthorized" }, { 402, "Payment Required" }, { 403, "Forbidden" }, { 404, "Not Found" }, { 405, "Method Not Allowed" }, { 406, "Not Acceptable" }, { 407, "Proxy Authentication Required" }, { 408, "Request Timeout" }, { 409, "Conflict" }, { 410, "Gone" }, { 411, "Length Required" }, { 412, "Precondition Failed" }, { 413, "Request Entity Too Large" }, { 414, "Request-URI Too Long" }, { 415, "Unsupported Media Type" }, { 416, "Requested Range Not Satisfiable" }, { 417, "Expectation Failed" }, { 426, "Upgrade Required" }, { 428, "Precondition Required" }, { 429, "Too Many Requests" }, { 431, "Request Header Fields Too Large" }, { 451, "Unavailable For Legal Reasons"}, { 500, "Internal Server Error" }, { 501, "Not Implemented" }, { 502, "Bad Gateway" }, { 503, "Service Unavailable" }, { 504, "Gateway Timeout" }, { 505, "HTTP Version Not Supported" }, { 511, "Network Authentication Required" }, }; static php_cli_server_http_response_status_code_pair template_map[] = { { 400, "

%s

Your browser sent a request that this server could not understand.

" }, { 404, "

%s

The requested resource %s was not found on this server.

" }, { 500, "

%s

The server is temporarily unavailable.

" }, { 501, "

%s

Request method not supported.

" } }; static php_cli_server_ext_mime_type_pair mime_type_map[] = { { "html", "text/html" }, { "htm", "text/html" }, { "js", "text/javascript" }, { "css", "text/css" }, { "gif", "image/gif" }, { "jpg", "image/jpeg" }, { "jpeg", "image/jpeg" }, { "jpe", "image/jpeg" }, { "pdf", "application/pdf" }, { "png", "image/png" }, { "svg", "image/svg+xml" }, { "txt", "text/plain" }, { "webm", "video/webm" }, { "ogv", "video/ogg" }, { "ogg", "audio/ogg" }, { "3gp", "video/3gpp" }, /* This is standard video format used for MMS in phones */ { "apk", "application/vnd.android.package-archive" }, { "avi", "video/x-msvideo" }, { "bmp", "image/x-ms-bmp" }, { "csv", "text/comma-separated-values" }, { "doc", "application/msword" }, { "docx", "application/msword" }, { "flac", "audio/flac" }, { "gz", "application/x-gzip" }, { "gzip", "application/x-gzip" }, { "ics", "text/calendar" }, { "kml", "application/vnd.google-earth.kml+xml" }, { "kmz", "application/vnd.google-earth.kmz" }, { "m4a", "audio/mp4" }, { "mp3", "audio/mpeg" }, { "mp4", "video/mp4" }, { "mpg", "video/mpeg" }, { "mpeg", "video/mpeg" }, { "mov", "video/quicktime" }, { "odp", "application/vnd.oasis.opendocument.presentation" }, { "ods", "application/vnd.oasis.opendocument.spreadsheet" }, { "odt", "application/vnd.oasis.opendocument.text" }, { "oga", "audio/ogg" }, { "pdf", "application/pdf" }, { "pptx", "application/vnd.ms-powerpoint" }, { "pps", "application/vnd.ms-powerpoint" }, { "qt", "video/quicktime" }, { "swf", "application/x-shockwave-flash" }, { "tar", "application/x-tar" }, { "text", "text/plain" }, { "tif", "image/tiff" }, { "wav", "audio/wav" }, { "wmv", "video/x-ms-wmv" }, { "xls", "application/vnd.ms-excel" }, { "xlsx", "application/vnd.ms-excel" }, { "zip", "application/x-zip-compressed" }, { "xml", "application/xml" }, { "xsl", "application/xml" }, { "xsd", "application/xml" }, { NULL, NULL } }; static int php_cli_output_is_tty = OUTPUT_NOT_CHECKED; static size_t php_cli_server_client_send_through(php_cli_server_client *client, const char *str, size_t str_len); static php_cli_server_chunk *php_cli_server_chunk_heap_new_self_contained(size_t len); static void php_cli_server_buffer_append(php_cli_server_buffer *buffer, php_cli_server_chunk *chunk); static void php_cli_server_logf(const char *format TSRMLS_DC, ...); static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message TSRMLS_DC); ZEND_DECLARE_MODULE_GLOBALS(cli_server); /* {{{ static char php_cli_server_css[] * copied from ext/standard/info.c */ static const char php_cli_server_css[] = "\n"; /* }}} */ #ifdef PHP_WIN32 int php_cli_server_get_system_time(char *buf) { struct _timeb system_time; errno_t err; if (buf == NULL) { return -1; } _ftime(&system_time); err = ctime_s(buf, 52, &(system_time.time) ); if (err) { return -1; } return 0; } #else int php_cli_server_get_system_time(char *buf) { struct timeval tv; struct tm tm; gettimeofday(&tv, NULL); /* TODO: should be checked for NULL tm/return vaue */ php_localtime_r(&tv.tv_sec, &tm); php_asctime_r(&tm, buf); return 0; } #endif static void char_ptr_dtor_p(char **p) /* {{{ */ { pefree(*p, 1); } /* }}} */ static char *get_last_error() /* {{{ */ { return pestrdup(strerror(errno), 1); } /* }}} */ static int status_comp(const void *a, const void *b) /* {{{ */ { const php_cli_server_http_response_status_code_pair *pa = (const php_cli_server_http_response_status_code_pair *) a; const php_cli_server_http_response_status_code_pair *pb = (const php_cli_server_http_response_status_code_pair *) b; if (pa->code < pb->code) { return -1; } else if (pa->code > pb->code) { return 1; } return 0; } /* }}} */ static const char *get_status_string(int code) /* {{{ */ { php_cli_server_http_response_status_code_pair needle, *result = NULL; needle.code = code; needle.str = NULL; result = bsearch(&needle, status_map, sizeof(status_map) / sizeof(needle), sizeof(needle), status_comp); if (result) { return result->str; } /* Returning NULL would require complicating append_http_status_line() to * not segfault in that case, so let's just return a placeholder, since RFC * 2616 requires a reason phrase. This is basically what a lot of other Web * servers do in this case anyway. */ return "Unknown Status Code"; } /* }}} */ static const char *get_template_string(int code) /* {{{ */ { size_t e = (sizeof(template_map) / sizeof(php_cli_server_http_response_status_code_pair)); size_t s = 0; while (e != s) { size_t c = MIN((e + s + 1) / 2, e - 1); int d = template_map[c].code; if (d > code) { e = c; } else if (d < code) { s = c; } else { return template_map[c].str; } } return NULL; } /* }}} */ static void append_http_status_line(smart_str *buffer, int protocol_version, int response_code, int persistent) /* {{{ */ { if (!response_code) { response_code = 200; } smart_str_appendl_ex(buffer, "HTTP", 4, persistent); smart_str_appendc_ex(buffer, '/', persistent); smart_str_append_generic_ex(buffer, protocol_version / 100, persistent, int, _unsigned); smart_str_appendc_ex(buffer, '.', persistent); smart_str_append_generic_ex(buffer, protocol_version % 100, persistent, int, _unsigned); smart_str_appendc_ex(buffer, ' ', persistent); smart_str_append_generic_ex(buffer, response_code, persistent, int, _unsigned); smart_str_appendc_ex(buffer, ' ', persistent); smart_str_appends_ex(buffer, get_status_string(response_code), persistent); smart_str_appendl_ex(buffer, "\r\n", 2, persistent); } /* }}} */ static void append_essential_headers(smart_str* buffer, php_cli_server_client *client, int persistent) /* {{{ */ { { char **val; if (SUCCESS == zend_hash_find(&client->request.headers, "host", sizeof("host"), (void**)&val)) { smart_str_appendl_ex(buffer, "Host", sizeof("Host") - 1, persistent); smart_str_appendl_ex(buffer, ": ", sizeof(": ") - 1, persistent); smart_str_appends_ex(buffer, *val, persistent); smart_str_appendl_ex(buffer, "\r\n", 2, persistent); } } smart_str_appendl_ex(buffer, "Connection: close\r\n", sizeof("Connection: close\r\n") - 1, persistent); } /* }}} */ static const char *get_mime_type(const char *ext, size_t ext_len) /* {{{ */ { php_cli_server_ext_mime_type_pair *pair; for (pair = mime_type_map; pair->ext; pair++) { size_t len = strlen(pair->ext); if (len == ext_len && memcmp(pair->ext, ext, len) == 0) { return pair->mime_type; } } return NULL; } /* }}} */ PHP_FUNCTION(apache_request_headers) /* {{{ */ { php_cli_server_client *client; HashTable *headers; char *key; uint key_len; char **value_pointer; HashPosition pos; if (zend_parse_parameters_none() == FAILURE) { return; } client = SG(server_context); headers = &client->request.headers_original_case; array_init_size(return_value, zend_hash_num_elements(headers)); zend_hash_internal_pointer_reset_ex(headers, &pos); while (zend_hash_get_current_data_ex(headers, (void **)&value_pointer, &pos) == SUCCESS) { zend_hash_get_current_key_ex(headers, &key, &key_len, NULL, 0, &pos); add_assoc_string_ex(return_value, key, key_len, *value_pointer, 1); zend_hash_move_forward_ex(headers, &pos); } } /* }}} */ static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */ { char *s, *p; int len; ALLOCA_FLAG(use_heap) if (h->header_len > 0) { p = strchr(h->header, ':'); len = p - h->header; if (p && (len > 0)) { while (len > 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t')) { len--; } if (len) { s = do_alloca(len + 1, use_heap); memcpy(s, h->header, len); s[len] = 0; do { p++; } while (*p == ' ' || *p == '\t'); add_assoc_stringl_ex(return_value, s, len+1, p, h->header_len - (p - h->header), 1); free_alloca(s, use_heap); } } } } /* }}} */ PHP_FUNCTION(apache_response_headers) /* {{{ */ { if (zend_parse_parameters_none() == FAILURE) { return; } if (!&SG(sapi_headers).headers) { RETURN_FALSE; } array_init(return_value); zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value TSRMLS_CC); } /* }}} */ /* {{{ cli_server module */ static void cli_server_init_globals(zend_cli_server_globals *cg TSRMLS_DC) { cg->color = 0; } PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("cli_server.color", "0", PHP_INI_ALL, OnUpdateBool, color, zend_cli_server_globals, cli_server_globals) PHP_INI_END() static PHP_MINIT_FUNCTION(cli_server) { ZEND_INIT_MODULE_GLOBALS(cli_server, cli_server_init_globals, NULL); REGISTER_INI_ENTRIES(); return SUCCESS; } static PHP_MSHUTDOWN_FUNCTION(cli_server) { UNREGISTER_INI_ENTRIES(); return SUCCESS; } static PHP_MINFO_FUNCTION(cli_server) { DISPLAY_INI_ENTRIES(); } zend_module_entry cli_server_module_entry = { STANDARD_MODULE_HEADER, "cli_server", NULL, PHP_MINIT(cli_server), PHP_MSHUTDOWN(cli_server), NULL, NULL, PHP_MINFO(cli_server), PHP_VERSION, STANDARD_MODULE_PROPERTIES }; /* }}} */ ZEND_BEGIN_ARG_INFO(arginfo_no_args, 0) ZEND_END_ARG_INFO() const zend_function_entry server_additional_functions[] = { PHP_FE(cli_set_process_title, arginfo_cli_set_process_title) PHP_FE(cli_get_process_title, arginfo_cli_get_process_title) PHP_FE(apache_request_headers, arginfo_no_args) PHP_FE(apache_response_headers, arginfo_no_args) PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args) {NULL, NULL, NULL} }; static int sapi_cli_server_startup(sapi_module_struct *sapi_module) /* {{{ */ { if (php_module_startup(sapi_module, &cli_server_module_entry, 1) == FAILURE) { return FAILURE; } return SUCCESS; } /* }}} */ static int sapi_cli_server_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ */ { php_cli_server_client *client = SG(server_context); if (!client) { return 0; } return php_cli_server_client_send_through(client, str, str_length); } /* }}} */ static void sapi_cli_server_flush(void *server_context) /* {{{ */ { php_cli_server_client *client = server_context; TSRMLS_FETCH(); if (!client) { return; } if (client->sock < 0) { php_handle_aborted_connection(); return; } if (!SG(headers_sent)) { sapi_send_headers(TSRMLS_C); SG(headers_sent) = 1; } } /* }}} */ static int sapi_cli_server_discard_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */{ return SAPI_HEADER_SENT_SUCCESSFULLY; } /* }}} */ static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ */ { php_cli_server_client *client = SG(server_context); smart_str buffer = { 0 }; sapi_header_struct *h; zend_llist_position pos; if (client == NULL || SG(request_info).no_headers) { return SAPI_HEADER_SENT_SUCCESSFULLY; } if (SG(sapi_headers).http_status_line) { smart_str_appends(&buffer, SG(sapi_headers).http_status_line); smart_str_appendl(&buffer, "\r\n", 2); } else { append_http_status_line(&buffer, client->request.protocol_version, SG(sapi_headers).http_response_code, 0); } append_essential_headers(&buffer, client, 0); h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { if (h->header_len) { smart_str_appendl(&buffer, h->header, h->header_len); smart_str_appendl(&buffer, "\r\n", 2); } h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); } smart_str_appendl(&buffer, "\r\n", 2); php_cli_server_client_send_through(client, buffer.c, buffer.len); smart_str_free(&buffer); return SAPI_HEADER_SENT_SUCCESSFULLY; } /* }}} */ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */ { php_cli_server_client *client = SG(server_context); char **val; if (FAILURE == zend_hash_find(&client->request.headers, "cookie", sizeof("cookie"), (void**)&val)) { return NULL; } return *val; } /* }}} */ static int sapi_cli_server_read_post(char *buf, uint count_bytes TSRMLS_DC) /* {{{ */ { php_cli_server_client *client = SG(server_context); if (client->request.content) { size_t content_len = client->request.content_len; size_t nbytes_copied = MIN(client->post_read_offset + count_bytes, content_len) - client->post_read_offset; memmove(buf, client->request.content + client->post_read_offset, nbytes_copied); client->post_read_offset += nbytes_copied; return nbytes_copied; } return 0; } /* }}} */ static void sapi_cli_server_register_variable(zval *track_vars_array, const char *key, const char *val TSRMLS_DC) /* {{{ */ { char *new_val = (char *)val; uint new_val_len; if (NULL == val) { return; } if (sapi_module.input_filter(PARSE_SERVER, (char*)key, &new_val, strlen(val), &new_val_len TSRMLS_CC)) { php_register_variable_safe((char *)key, new_val, new_val_len, track_vars_array TSRMLS_CC); } } /* }}} */ static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zval *track_vars_array = va_arg(args, zval *); if (hash_key->nKeyLength) { char *real_key, *key; uint i; key = estrndup(hash_key->arKey, hash_key->nKeyLength); for(i=0; inKeyLength; i++) { if (key[i] == '-') { key[i] = '_'; } else { key[i] = toupper(key[i]); } } spprintf(&real_key, 0, "%s_%s", "HTTP", key); if (strcmp(key, "CONTENT_TYPE") == 0 || strcmp(key, "CONTENT_LENGTH") == 0) { sapi_cli_server_register_variable(track_vars_array, key, *entry TSRMLS_CC); } sapi_cli_server_register_variable(track_vars_array, real_key, *entry TSRMLS_CC); efree(key); efree(real_key); } return ZEND_HASH_APPLY_KEEP; } /* }}} */ static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ */ { php_cli_server_client *client = SG(server_context); sapi_cli_server_register_variable(track_vars_array, "DOCUMENT_ROOT", client->server->document_root TSRMLS_CC); { char *tmp; if ((tmp = strrchr(client->addr_str, ':'))) { char addr[64], port[8]; strncpy(port, tmp + 1, 8); port[7] = '\0'; strncpy(addr, client->addr_str, tmp - client->addr_str); addr[tmp - client->addr_str] = '\0'; sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", addr TSRMLS_CC); sapi_cli_server_register_variable(track_vars_array, "REMOTE_PORT", port TSRMLS_CC); } else { sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str TSRMLS_CC); } } { char *tmp; spprintf(&tmp, 0, "PHP %s Development Server", PHP_VERSION); sapi_cli_server_register_variable(track_vars_array, "SERVER_SOFTWARE", tmp TSRMLS_CC); efree(tmp); } { char *tmp; spprintf(&tmp, 0, "HTTP/%d.%d", client->request.protocol_version / 100, client->request.protocol_version % 100); sapi_cli_server_register_variable(track_vars_array, "SERVER_PROTOCOL", tmp TSRMLS_CC); efree(tmp); } sapi_cli_server_register_variable(track_vars_array, "SERVER_NAME", client->server->host TSRMLS_CC); { char *tmp; spprintf(&tmp, 0, "%i", client->server->port); sapi_cli_server_register_variable(track_vars_array, "SERVER_PORT", tmp TSRMLS_CC); efree(tmp); } sapi_cli_server_register_variable(track_vars_array, "REQUEST_URI", client->request.request_uri TSRMLS_CC); sapi_cli_server_register_variable(track_vars_array, "REQUEST_METHOD", SG(request_info).request_method TSRMLS_CC); sapi_cli_server_register_variable(track_vars_array, "SCRIPT_NAME", client->request.vpath TSRMLS_CC); if (SG(request_info).path_translated) { sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", SG(request_info).path_translated TSRMLS_CC); } else if (client->server->router) { char *temp; spprintf(&temp, 0, "%s/%s", client->server->document_root, client->server->router); sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", temp TSRMLS_CC); efree(temp); } if (client->request.path_info) { sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info TSRMLS_CC); } if (client->request.path_info_len) { char *tmp; spprintf(&tmp, 0, "%s%s", client->request.vpath, client->request.path_info); sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", tmp TSRMLS_CC); efree(tmp); } else { sapi_cli_server_register_variable(track_vars_array, "PHP_SELF", client->request.vpath TSRMLS_CC); } if (client->request.query_string) { sapi_cli_server_register_variable(track_vars_array, "QUERY_STRING", client->request.query_string TSRMLS_CC); } zend_hash_apply_with_arguments(&client->request.headers TSRMLS_CC, (apply_func_args_t)sapi_cli_server_register_entry_cb, 1, track_vars_array); } /* }}} */ static void sapi_cli_server_log_message(char *msg TSRMLS_DC) /* {{{ */ { char buf[52]; if (php_cli_server_get_system_time(buf) != 0) { memmove(buf, "unknown time, can't be fetched", sizeof("unknown time, can't be fetched")); } else { size_t l = strlen(buf); if (l > 0) { buf[l - 1] = '\0'; } else { memmove(buf, "unknown", sizeof("unknown")); } } fprintf(stderr, "[%s] %s\n", buf, msg); } /* }}} */ /* {{{ sapi_module_struct cli_server_sapi_module */ sapi_module_struct cli_server_sapi_module = { "cli-server", /* name */ "Built-in HTTP server", /* pretty name */ sapi_cli_server_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ NULL, /* activate */ NULL, /* deactivate */ sapi_cli_server_ub_write, /* unbuffered write */ sapi_cli_server_flush, /* flush */ NULL, /* get uid */ NULL, /* getenv */ php_error, /* error handler */ NULL, /* header handler */ sapi_cli_server_send_headers, /* send headers handler */ NULL, /* send header handler */ sapi_cli_server_read_post, /* read POST data */ sapi_cli_server_read_cookies, /* read Cookies */ sapi_cli_server_register_variables, /* register server variables */ sapi_cli_server_log_message, /* Log message */ NULL, /* Get request time */ NULL, /* Child terminate */ STANDARD_SAPI_MODULE_PROPERTIES }; /* }}} */ static int php_cli_server_poller_ctor(php_cli_server_poller *poller) /* {{{ */ { FD_ZERO(&poller->rfds); FD_ZERO(&poller->wfds); poller->max_fd = -1; return SUCCESS; } /* }}} */ static void php_cli_server_poller_add(php_cli_server_poller *poller, int mode, int fd) /* {{{ */ { if (mode & POLLIN) { PHP_SAFE_FD_SET(fd, &poller->rfds); } if (mode & POLLOUT) { PHP_SAFE_FD_SET(fd, &poller->wfds); } if (fd > poller->max_fd) { poller->max_fd = fd; } } /* }}} */ static void php_cli_server_poller_remove(php_cli_server_poller *poller, int mode, int fd) /* {{{ */ { if (mode & POLLIN) { PHP_SAFE_FD_CLR(fd, &poller->rfds); } if (mode & POLLOUT) { PHP_SAFE_FD_CLR(fd, &poller->wfds); } #ifndef PHP_WIN32 if (fd == poller->max_fd) { while (fd > 0) { fd--; if (PHP_SAFE_FD_ISSET(fd, &poller->rfds) || PHP_SAFE_FD_ISSET(fd, &poller->wfds)) { break; } } poller->max_fd = fd; } #endif } /* }}} */ static int php_cli_server_poller_poll(php_cli_server_poller *poller, struct timeval *tv) /* {{{ */ { memmove(&poller->active.rfds, &poller->rfds, sizeof(poller->rfds)); memmove(&poller->active.wfds, &poller->wfds, sizeof(poller->wfds)); return php_select(poller->max_fd + 1, &poller->active.rfds, &poller->active.wfds, NULL, tv); } /* }}} */ static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, void *opaque, int(*callback)(void *, int fd, int events)) /* {{{ */ { int retval = SUCCESS; #ifdef PHP_WIN32 struct socket_entry { SOCKET fd; int events; } entries[FD_SETSIZE * 2]; php_socket_t fd = 0; size_t i; struct socket_entry *n = entries, *m; for (i = 0; i < poller->active.rfds.fd_count; i++) { n->events = POLLIN; n->fd = poller->active.rfds.fd_array[i]; n++; } m = n; for (i = 0; i < poller->active.wfds.fd_count; i++) { struct socket_entry *e; SOCKET fd = poller->active.wfds.fd_array[i]; for (e = entries; e < m; e++) { if (e->fd == fd) { e->events |= POLLOUT; } } if (e == m) { assert(n < entries + FD_SETSIZE * 2); n->events = POLLOUT; n->fd = fd; n++; } } { struct socket_entry *e = entries; for (; e < n; e++) { if (SUCCESS != callback(opaque, e->fd, e->events)) { retval = FAILURE; } } } #else php_socket_t fd; const php_socket_t max_fd = poller->max_fd; for (fd=0 ; fd<=max_fd ; fd++) { if (PHP_SAFE_FD_ISSET(fd, &poller->active.rfds)) { if (SUCCESS != callback(opaque, fd, POLLIN)) { retval = FAILURE; } } if (PHP_SAFE_FD_ISSET(fd, &poller->active.wfds)) { if (SUCCESS != callback(opaque, fd, POLLOUT)) { retval = FAILURE; } } } #endif return retval; } /* }}} */ static size_t php_cli_server_chunk_size(const php_cli_server_chunk *chunk) /* {{{ */ { switch (chunk->type) { case PHP_CLI_SERVER_CHUNK_HEAP: return chunk->data.heap.len; case PHP_CLI_SERVER_CHUNK_IMMORTAL: return chunk->data.immortal.len; } return 0; } /* }}} */ static void php_cli_server_chunk_dtor(php_cli_server_chunk *chunk) /* {{{ */ { switch (chunk->type) { case PHP_CLI_SERVER_CHUNK_HEAP: if (chunk->data.heap.block != chunk) { pefree(chunk->data.heap.block, 1); } break; case PHP_CLI_SERVER_CHUNK_IMMORTAL: break; } } /* }}} */ static void php_cli_server_buffer_dtor(php_cli_server_buffer *buffer) /* {{{ */ { php_cli_server_chunk *chunk, *next; for (chunk = buffer->first; chunk; chunk = next) { next = chunk->next; php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); } } /* }}} */ static void php_cli_server_buffer_ctor(php_cli_server_buffer *buffer) /* {{{ */ { buffer->first = NULL; buffer->last = NULL; } /* }}} */ static void php_cli_server_buffer_append(php_cli_server_buffer *buffer, php_cli_server_chunk *chunk) /* {{{ */ { php_cli_server_chunk *last; for (last = chunk; last->next; last = last->next); if (!buffer->last) { buffer->first = chunk; } else { buffer->last->next = chunk; } buffer->last = last; } /* }}} */ static void php_cli_server_buffer_prepend(php_cli_server_buffer *buffer, php_cli_server_chunk *chunk) /* {{{ */ { php_cli_server_chunk *last; for (last = chunk; last->next; last = last->next); last->next = buffer->first; if (!buffer->last) { buffer->last = last; } buffer->first = chunk; } /* }}} */ static size_t php_cli_server_buffer_size(const php_cli_server_buffer *buffer) /* {{{ */ { php_cli_server_chunk *chunk; size_t retval = 0; for (chunk = buffer->first; chunk; chunk = chunk->next) { retval += php_cli_server_chunk_size(chunk); } return retval; } /* }}} */ static php_cli_server_chunk *php_cli_server_chunk_immortal_new(const char *buf, size_t len) /* {{{ */ { php_cli_server_chunk *chunk = pemalloc(sizeof(php_cli_server_chunk), 1); if (!chunk) { return NULL; } chunk->type = PHP_CLI_SERVER_CHUNK_IMMORTAL; chunk->next = NULL; chunk->data.immortal.p = buf; chunk->data.immortal.len = len; return chunk; } /* }}} */ static php_cli_server_chunk *php_cli_server_chunk_heap_new(char *block, char *buf, size_t len) /* {{{ */ { php_cli_server_chunk *chunk = pemalloc(sizeof(php_cli_server_chunk), 1); if (!chunk) { return NULL; } chunk->type = PHP_CLI_SERVER_CHUNK_HEAP; chunk->next = NULL; chunk->data.heap.block = block; chunk->data.heap.p = buf; chunk->data.heap.len = len; return chunk; } /* }}} */ static php_cli_server_chunk *php_cli_server_chunk_heap_new_self_contained(size_t len) /* {{{ */ { php_cli_server_chunk *chunk = pemalloc(sizeof(php_cli_server_chunk) + len, 1); if (!chunk) { return NULL; } chunk->type = PHP_CLI_SERVER_CHUNK_HEAP; chunk->next = NULL; chunk->data.heap.block = chunk; chunk->data.heap.p = (char *)(chunk + 1); chunk->data.heap.len = len; return chunk; } /* }}} */ static void php_cli_server_content_sender_dtor(php_cli_server_content_sender *sender) /* {{{ */ { php_cli_server_buffer_dtor(&sender->buffer); } /* }}} */ static void php_cli_server_content_sender_ctor(php_cli_server_content_sender *sender) /* {{{ */ { php_cli_server_buffer_ctor(&sender->buffer); } /* }}} */ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sender, php_socket_t fd, size_t *nbytes_sent_total) /* {{{ */ { php_cli_server_chunk *chunk, *next; size_t _nbytes_sent_total = 0; for (chunk = sender->buffer.first; chunk; chunk = next) { ssize_t nbytes_sent; next = chunk->next; switch (chunk->type) { case PHP_CLI_SERVER_CHUNK_HEAP: nbytes_sent = send(fd, chunk->data.heap.p, chunk->data.heap.len, 0); if (nbytes_sent < 0) { *nbytes_sent_total = _nbytes_sent_total; return php_socket_errno(); } else if (nbytes_sent == chunk->data.heap.len) { php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); sender->buffer.first = next; if (!next) { sender->buffer.last = NULL; } } else { chunk->data.heap.p += nbytes_sent; chunk->data.heap.len -= nbytes_sent; } _nbytes_sent_total += nbytes_sent; break; case PHP_CLI_SERVER_CHUNK_IMMORTAL: nbytes_sent = send(fd, chunk->data.immortal.p, chunk->data.immortal.len, 0); if (nbytes_sent < 0) { *nbytes_sent_total = _nbytes_sent_total; return php_socket_errno(); } else if (nbytes_sent == chunk->data.immortal.len) { php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); sender->buffer.first = next; if (!next) { sender->buffer.last = NULL; } } else { chunk->data.immortal.p += nbytes_sent; chunk->data.immortal.len -= nbytes_sent; } _nbytes_sent_total += nbytes_sent; break; } } *nbytes_sent_total = _nbytes_sent_total; return 0; } /* }}} */ static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read) /* {{{ */ { ssize_t _nbytes_read; php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(131072); _nbytes_read = read(fd, chunk->data.heap.p, chunk->data.heap.len); if (_nbytes_read < 0) { char *errstr = get_last_error(); TSRMLS_FETCH(); php_cli_server_logf("%s" TSRMLS_CC, errstr); pefree(errstr, 1); php_cli_server_chunk_dtor(chunk); pefree(chunk, 1); return 1; } chunk->data.heap.len = _nbytes_read; php_cli_server_buffer_append(&sender->buffer, chunk); *nbytes_read = _nbytes_read; return 0; } /* }}} */ #if HAVE_UNISTD_H static int php_cli_is_output_tty() /* {{{ */ { if (php_cli_output_is_tty == OUTPUT_NOT_CHECKED) { php_cli_output_is_tty = isatty(STDOUT_FILENO); } return php_cli_output_is_tty; } /* }}} */ #endif static void php_cli_server_log_response(php_cli_server_client *client, int status, const char *message TSRMLS_DC) /* {{{ */ { int color = 0, effective_status = status; char *basic_buf, *message_buf = "", *error_buf = ""; zend_bool append_error_message = 0; if (PG(last_error_message)) { switch (PG(last_error_type)) { case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: case E_PARSE: if (status == 200) { /* the status code isn't changed by a fatal error, so fake it */ effective_status = 500; } append_error_message = 1; break; } } #if HAVE_UNISTD_H if (CLI_SERVER_G(color) && php_cli_is_output_tty() == OUTPUT_IS_TTY) { if (effective_status >= 500) { /* server error: red */ color = 1; } else if (effective_status >= 400) { /* client error: yellow */ color = 3; } else if (effective_status >= 200) { /* success: green */ color = 2; } } #endif /* basic */ spprintf(&basic_buf, 0, "%s [%d]: %s", client->addr_str, status, client->request.request_uri); if (!basic_buf) { return; } /* message */ if (message) { spprintf(&message_buf, 0, " - %s", message); if (!message_buf) { efree(basic_buf); return; } } /* error */ if (append_error_message) { spprintf(&error_buf, 0, " - %s in %s on line %d", PG(last_error_message), PG(last_error_file), PG(last_error_lineno)); if (!error_buf) { efree(basic_buf); if (message) { efree(message_buf); } return; } } if (color) { php_cli_server_logf("\x1b[3%dm%s%s%s\x1b[0m" TSRMLS_CC, color, basic_buf, message_buf, error_buf); } else { php_cli_server_logf("%s%s%s" TSRMLS_CC, basic_buf, message_buf, error_buf); } efree(basic_buf); if (message) { efree(message_buf); } if (append_error_message) { efree(error_buf); } } /* }}} */ static void php_cli_server_logf(const char *format TSRMLS_DC, ...) /* {{{ */ { char *buf = NULL; va_list ap; #ifdef ZTS va_start(ap, tsrm_ls); #else va_start(ap, format); #endif vspprintf(&buf, 0, format, ap); va_end(ap); if (!buf) { return; } if (sapi_module.log_message) { sapi_module.log_message(buf TSRMLS_CC); } efree(buf); } /* }}} */ static int php_network_listen_socket(const char *host, int *port, int socktype, int *af, socklen_t *socklen, char **errstr TSRMLS_DC) /* {{{ */ { int retval = SOCK_ERR; int err = 0; struct sockaddr *sa = NULL, **p, **sal; int num_addrs = php_network_getaddresses(host, socktype, &sal, errstr TSRMLS_CC); if (num_addrs == 0) { return -1; } for (p = sal; *p; p++) { if (sa) { pefree(sa, 1); sa = NULL; } retval = socket((*p)->sa_family, socktype, 0); if (retval == SOCK_ERR) { continue; } switch ((*p)->sa_family) { #if HAVE_GETADDRINFO && HAVE_IPV6 case AF_INET6: sa = pemalloc(sizeof(struct sockaddr_in6), 1); if (!sa) { closesocket(retval); retval = SOCK_ERR; *errstr = NULL; goto out; } *(struct sockaddr_in6 *)sa = *(struct sockaddr_in6 *)*p; ((struct sockaddr_in6 *)sa)->sin6_port = htons(*port); *socklen = sizeof(struct sockaddr_in6); break; #endif case AF_INET: sa = pemalloc(sizeof(struct sockaddr_in), 1); if (!sa) { closesocket(retval); retval = SOCK_ERR; *errstr = NULL; goto out; } *(struct sockaddr_in *)sa = *(struct sockaddr_in *)*p; ((struct sockaddr_in *)sa)->sin_port = htons(*port); *socklen = sizeof(struct sockaddr_in); break; default: /* Unknown family */ *socklen = 0; closesocket(retval); continue; } #ifdef SO_REUSEADDR { int val = 1; setsockopt(retval, SOL_SOCKET, SO_REUSEADDR, (char*)&val, sizeof(val)); } #endif if (bind(retval, sa, *socklen) == SOCK_CONN_ERR) { err = php_socket_errno(); if (err == SOCK_EINVAL || err == SOCK_EADDRINUSE) { goto out; } closesocket(retval); retval = SOCK_ERR; continue; } err = 0; *af = sa->sa_family; if (*port == 0) { if (getsockname(retval, sa, socklen)) { err = php_socket_errno(); goto out; } switch (sa->sa_family) { #if HAVE_GETADDRINFO && HAVE_IPV6 case AF_INET6: *port = ntohs(((struct sockaddr_in6 *)sa)->sin6_port); break; #endif case AF_INET: *port = ntohs(((struct sockaddr_in *)sa)->sin_port); break; } } break; } if (retval == SOCK_ERR) { goto out; } if (listen(retval, SOMAXCONN)) { err = php_socket_errno(); goto out; } out: if (sa) { pefree(sa, 1); } if (sal) { php_network_freeaddresses(sal); } if (err) { if (retval >= 0) { closesocket(retval); } if (errstr) { *errstr = php_socket_strerror(err, NULL, 0); } return SOCK_ERR; } return retval; } /* }}} */ static int php_cli_server_request_ctor(php_cli_server_request *req) /* {{{ */ { req->protocol_version = 0; req->request_uri = NULL; req->request_uri_len = 0; req->vpath = NULL; req->vpath_len = 0; req->path_translated = NULL; req->path_translated_len = 0; req->path_info = NULL; req->path_info_len = 0; req->query_string = NULL; req->query_string_len = 0; zend_hash_init(&req->headers, 0, NULL, (void(*)(void*))char_ptr_dtor_p, 1); zend_hash_init(&req->headers_original_case, 0, NULL, NULL, 1); req->content = NULL; req->content_len = 0; req->ext = NULL; req->ext_len = 0; return SUCCESS; } /* }}} */ static void php_cli_server_request_dtor(php_cli_server_request *req) /* {{{ */ { if (req->request_uri) { pefree(req->request_uri, 1); } if (req->vpath) { pefree(req->vpath, 1); } if (req->path_translated) { pefree(req->path_translated, 1); } if (req->path_info) { pefree(req->path_info, 1); } if (req->query_string) { pefree(req->query_string, 1); } zend_hash_destroy(&req->headers); zend_hash_destroy(&req->headers_original_case); if (req->content) { pefree(req->content, 1); } } /* }}} */ static void php_cli_server_request_translate_vpath(php_cli_server_request *request, const char *document_root, size_t document_root_len) /* {{{ */ { struct stat sb; static const char *index_files[] = { "index.php", "index.html", NULL }; char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1); char *p = buf, *prev_path = NULL, *q, *vpath; size_t prev_path_len = 0; int is_static_file = 0; if (!buf) { return; } memmove(p, document_root, document_root_len); p += document_root_len; vpath = p; if (request->vpath_len > 0 && request->vpath[0] != '/') { *p++ = DEFAULT_SLASH; } q = request->vpath + request->vpath_len; while (q > request->vpath) { if (*q-- == '.') { is_static_file = 1; break; } } memmove(p, request->vpath, request->vpath_len); #ifdef PHP_WIN32 q = p + request->vpath_len; do { if (*q == '/') { *q = '\\'; } } while (q-- > p); #endif p += request->vpath_len; *p = '\0'; q = p; while (q > buf) { if (!stat(buf, &sb)) { if (sb.st_mode & S_IFDIR) { const char **file = index_files; if (q[-1] != DEFAULT_SLASH) { *q++ = DEFAULT_SLASH; } while (*file) { size_t l = strlen(*file); memmove(q, *file, l + 1); if (!stat(buf, &sb) && (sb.st_mode & S_IFREG)) { q += l; break; } file++; } if (!*file || is_static_file) { if (prev_path) { pefree(prev_path, 1); } pefree(buf, 1); return; } } break; /* regular file */ } if (prev_path) { pefree(prev_path, 1); *q = DEFAULT_SLASH; } while (q > buf && *(--q) != DEFAULT_SLASH); prev_path_len = p - q; prev_path = pestrndup(q, prev_path_len, 1); *q = '\0'; } if (prev_path) { request->path_info_len = prev_path_len; #ifdef PHP_WIN32 while (prev_path_len--) { if (prev_path[prev_path_len] == '\\') { prev_path[prev_path_len] = '/'; } } #endif request->path_info = prev_path; pefree(request->vpath, 1); request->vpath = pestrndup(vpath, q - vpath, 1); request->vpath_len = q - vpath; request->path_translated = buf; request->path_translated_len = q - buf; } else { pefree(request->vpath, 1); request->vpath = pestrndup(vpath, q - vpath, 1); request->vpath_len = q - vpath; request->path_translated = buf; request->path_translated_len = q - buf; } #ifdef PHP_WIN32 { uint i = 0; for (;ivpath_len;i++) { if (request->vpath[i] == '\\') { request->vpath[i] = '/'; } } } #endif request->sb = sb; } /* }}} */ static void normalize_vpath(char **retval, size_t *retval_len, const char *vpath, size_t vpath_len, int persistent) /* {{{ */ { char *decoded_vpath = NULL; char *decoded_vpath_end; char *p; *retval = NULL; decoded_vpath = pestrndup(vpath, vpath_len, persistent); if (!decoded_vpath) { return; } decoded_vpath_end = decoded_vpath + php_raw_url_decode(decoded_vpath, vpath_len); #ifdef PHP_WIN32 { char *p = decoded_vpath; do { if (*p == '\\') { *p = '/'; } } while (*p++); } #endif p = decoded_vpath; if (p < decoded_vpath_end && *p == '/') { char *n = p; while (n < decoded_vpath_end && *n == '/') n++; memmove(++p, n, decoded_vpath_end - n); decoded_vpath_end -= n - p; } while (p < decoded_vpath_end) { char *n = p; while (n < decoded_vpath_end && *n != '/') n++; if (n - p == 2 && p[0] == '.' && p[1] == '.') { if (p > decoded_vpath) { --p; for (;;) { if (p == decoded_vpath) { if (*p == '/') { p++; } break; } if (*(--p) == '/') { p++; break; } } } while (n < decoded_vpath_end && *n == '/') n++; memmove(p, n, decoded_vpath_end - n); decoded_vpath_end -= n - p; } else if (n - p == 1 && p[0] == '.') { while (n < decoded_vpath_end && *n == '/') n++; memmove(p, n, decoded_vpath_end - n); decoded_vpath_end -= n - p; } else { if (n < decoded_vpath_end) { char *nn = n; while (nn < decoded_vpath_end && *nn == '/') nn++; p = n + 1; memmove(p, nn, decoded_vpath_end - nn); decoded_vpath_end -= nn - p; } else { p = n; } } } *decoded_vpath_end = '\0'; *retval = decoded_vpath; *retval_len = decoded_vpath_end - decoded_vpath; } /* }}} */ /* {{{ php_cli_server_client_read_request */ static int php_cli_server_client_read_request_on_message_begin(php_http_parser *parser) { return 0; } static int php_cli_server_client_read_request_on_path(php_http_parser *parser, const char *at, size_t length) { php_cli_server_client *client = parser->data; { char *vpath; size_t vpath_len; normalize_vpath(&vpath, &vpath_len, at, length, 1); client->request.vpath = vpath; client->request.vpath_len = vpath_len; } return 0; } static int php_cli_server_client_read_request_on_query_string(php_http_parser *parser, const char *at, size_t length) { php_cli_server_client *client = parser->data; client->request.query_string = pestrndup(at, length, 1); client->request.query_string_len = length; return 0; } static int php_cli_server_client_read_request_on_url(php_http_parser *parser, const char *at, size_t length) { php_cli_server_client *client = parser->data; client->request.request_method = parser->method; client->request.request_uri = pestrndup(at, length, 1); client->request.request_uri_len = length; return 0; } static int php_cli_server_client_read_request_on_fragment(php_http_parser *parser, const char *at, size_t length) { return 0; } static int php_cli_server_client_read_request_on_header_field(php_http_parser *parser, const char *at, size_t length) { php_cli_server_client *client = parser->data; if (client->current_header_name_allocated) { pefree(client->current_header_name, 1); client->current_header_name_allocated = 0; } client->current_header_name = (char *)at; client->current_header_name_len = length; return 0; } static int php_cli_server_client_read_request_on_header_value(php_http_parser *parser, const char *at, size_t length) { php_cli_server_client *client = parser->data; char *value = pestrndup(at, length, 1); if (!value) { return 1; } { /* strip off the colon */ char *orig_header_name = estrndup(client->current_header_name, client->current_header_name_len); char *lc_header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); zend_hash_add(&client->request.headers, lc_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); zend_hash_add(&client->request.headers_original_case, orig_header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); efree(lc_header_name); efree(orig_header_name); } if (client->current_header_name_allocated) { pefree(client->current_header_name, 1); client->current_header_name_allocated = 0; } return 0; } static int php_cli_server_client_read_request_on_headers_complete(php_http_parser *parser) { php_cli_server_client *client = parser->data; if (client->current_header_name_allocated) { pefree(client->current_header_name, 1); client->current_header_name_allocated = 0; } client->current_header_name = NULL; return 0; } static int php_cli_server_client_read_request_on_body(php_http_parser *parser, const char *at, size_t length) { php_cli_server_client *client = parser->data; if (!client->request.content) { client->request.content = pemalloc(parser->content_length, 1); if (!client->request.content) { return -1; } client->request.content_len = 0; } client->request.content = perealloc(client->request.content, client->request.content_len + length, 1); memmove(client->request.content + client->request.content_len, at, length); client->request.content_len += length; return 0; } static int php_cli_server_client_read_request_on_message_complete(php_http_parser *parser) { php_cli_server_client *client = parser->data; client->request.protocol_version = parser->http_major * 100 + parser->http_minor; php_cli_server_request_translate_vpath(&client->request, client->server->document_root, client->server->document_root_len); { const char *vpath = client->request.vpath, *end = vpath + client->request.vpath_len, *p = end; client->request.ext = end; client->request.ext_len = 0; while (p > vpath) { --p; if (*p == '.') { ++p; client->request.ext = p; client->request.ext_len = end - p; break; } } } client->request_read = 1; return 0; } static int php_cli_server_client_read_request(php_cli_server_client *client, char **errstr TSRMLS_DC) { char buf[16384]; static const php_http_parser_settings settings = { php_cli_server_client_read_request_on_message_begin, php_cli_server_client_read_request_on_path, php_cli_server_client_read_request_on_query_string, php_cli_server_client_read_request_on_url, php_cli_server_client_read_request_on_fragment, php_cli_server_client_read_request_on_header_field, php_cli_server_client_read_request_on_header_value, php_cli_server_client_read_request_on_headers_complete, php_cli_server_client_read_request_on_body, php_cli_server_client_read_request_on_message_complete }; size_t nbytes_consumed; int nbytes_read; if (client->request_read) { return 1; } nbytes_read = recv(client->sock, buf, sizeof(buf) - 1, 0); if (nbytes_read < 0) { int err = php_socket_errno(); if (err == SOCK_EAGAIN) { return 0; } *errstr = php_socket_strerror(err, NULL, 0); return -1; } else if (nbytes_read == 0) { *errstr = estrdup("Unexpected EOF"); return -1; } client->parser.data = client; nbytes_consumed = php_http_parser_execute(&client->parser, &settings, buf, nbytes_read); if (nbytes_consumed != nbytes_read) { if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) { *errstr = estrdup("Unsupported SSL request"); } else { *errstr = estrdup("Malformed HTTP request"); } return -1; } if (client->current_header_name) { char *header_name = safe_pemalloc(client->current_header_name_len, 1, 1, 1); if (!header_name) { return -1; } memmove(header_name, client->current_header_name, client->current_header_name_len); client->current_header_name = header_name; client->current_header_name_allocated = 1; } return client->request_read ? 1: 0; } /* }}} */ static size_t php_cli_server_client_send_through(php_cli_server_client *client, const char *str, size_t str_len) /* {{{ */ { struct timeval tv = { 10, 0 }; ssize_t nbytes_left = str_len; do { ssize_t nbytes_sent = send(client->sock, str + str_len - nbytes_left, nbytes_left, 0); if (nbytes_sent < 0) { int err = php_socket_errno(); if (err == SOCK_EAGAIN) { int nfds = php_pollfd_for(client->sock, POLLOUT, &tv); if (nfds > 0) { continue; } else if (nfds < 0) { /* error */ php_handle_aborted_connection(); return nbytes_left; } else { /* timeout */ php_handle_aborted_connection(); return nbytes_left; } } else { php_handle_aborted_connection(); return nbytes_left; } } nbytes_left -= nbytes_sent; } while (nbytes_left > 0); return str_len; } /* }}} */ static void php_cli_server_client_populate_request_info(const php_cli_server_client *client, sapi_request_info *request_info) /* {{{ */ { char **val; request_info->request_method = php_http_method_str(client->request.request_method); request_info->proto_num = client->request.protocol_version; request_info->request_uri = client->request.request_uri; request_info->path_translated = client->request.path_translated; request_info->query_string = client->request.query_string; request_info->content_length = client->request.content_len; request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; if (SUCCESS == zend_hash_find(&client->request.headers, "content-type", sizeof("content-type"), (void**)&val)) { request_info->content_type = *val; } } /* }}} */ static void destroy_request_info(sapi_request_info *request_info) /* {{{ */ { } /* }}} */ static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, int client_sock, struct sockaddr *addr, socklen_t addr_len TSRMLS_DC) /* {{{ */ { client->server = server; client->sock = client_sock; client->addr = addr; client->addr_len = addr_len; { char *addr_str = 0; long addr_str_len = 0; php_network_populate_name_from_sockaddr(addr, addr_len, &addr_str, &addr_str_len, NULL, 0 TSRMLS_CC); client->addr_str = pestrndup(addr_str, addr_str_len, 1); client->addr_str_len = addr_str_len; efree(addr_str); } php_http_parser_init(&client->parser, PHP_HTTP_REQUEST); client->request_read = 0; client->current_header_name = NULL; client->current_header_name_len = 0; client->current_header_name_allocated = 0; client->post_read_offset = 0; if (FAILURE == php_cli_server_request_ctor(&client->request)) { return FAILURE; } client->content_sender_initialized = 0; client->file_fd = -1; return SUCCESS; } /* }}} */ static void php_cli_server_client_dtor(php_cli_server_client *client) /* {{{ */ { php_cli_server_request_dtor(&client->request); if (client->file_fd >= 0) { close(client->file_fd); client->file_fd = -1; } pefree(client->addr, 1); pefree(client->addr_str, 1); if (client->content_sender_initialized) { php_cli_server_content_sender_dtor(&client->content_sender); } } /* }}} */ static void php_cli_server_close_connection(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { #ifdef DEBUG php_cli_server_logf("%s Closing" TSRMLS_CC, client->addr_str); #endif zend_hash_index_del(&server->clients, client->sock); } /* }}} */ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server_client *client, int status TSRMLS_DC) /* {{{ */ { char *escaped_request_uri = NULL; size_t escaped_request_uri_len; const char *status_string = get_status_string(status); const char *content_template = get_template_string(status); char *errstr = get_last_error(); assert(status_string && content_template); php_cli_server_content_sender_ctor(&client->content_sender); client->content_sender_initialized = 1; escaped_request_uri = php_escape_html_entities_ex((unsigned char *)client->request.request_uri, client->request.request_uri_len, &escaped_request_uri_len, 0, ENT_QUOTES, NULL, 0 TSRMLS_CC); { static const char prologue_template[] = "%d %s"; php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(strlen(prologue_template) + 3 + strlen(status_string) + 1); if (!chunk) { goto fail; } snprintf(chunk->data.heap.p, chunk->data.heap.len, prologue_template, status, status_string, escaped_request_uri); chunk->data.heap.len = strlen(chunk->data.heap.p); php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } { php_cli_server_chunk *chunk = php_cli_server_chunk_immortal_new(php_cli_server_css, sizeof(php_cli_server_css) - 1); if (!chunk) { goto fail; } php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } { static const char template[] = ""; php_cli_server_chunk *chunk = php_cli_server_chunk_immortal_new(template, sizeof(template) - 1); if (!chunk) { goto fail; } php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } { php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(strlen(content_template) + escaped_request_uri_len + 3 + strlen(status_string) + 1); if (!chunk) { goto fail; } snprintf(chunk->data.heap.p, chunk->data.heap.len, content_template, status_string, escaped_request_uri); chunk->data.heap.len = strlen(chunk->data.heap.p); php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } { static const char epilogue_template[] = ""; php_cli_server_chunk *chunk = php_cli_server_chunk_immortal_new(epilogue_template, sizeof(epilogue_template) - 1); if (!chunk) { goto fail; } php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } { php_cli_server_chunk *chunk; smart_str buffer = { 0 }; append_http_status_line(&buffer, client->request.protocol_version, status, 1); if (!buffer.c) { /* out of memory */ goto fail; } append_essential_headers(&buffer, client, 1); smart_str_appends_ex(&buffer, "Content-Type: text/html; charset=UTF-8\r\n", 1); smart_str_appends_ex(&buffer, "Content-Length: ", 1); smart_str_append_generic_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1, size_t, _unsigned); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); chunk = php_cli_server_chunk_heap_new(buffer.c, buffer.c, buffer.len); if (!chunk) { smart_str_free_ex(&buffer, 1); goto fail; } php_cli_server_buffer_prepend(&client->content_sender.buffer, chunk); } php_cli_server_log_response(client, status, errstr ? errstr : "?" TSRMLS_CC); php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); if (errstr) { pefree(errstr, 1); } efree(escaped_request_uri); return SUCCESS; fail: if (errstr) { pefree(errstr, 1); } efree(escaped_request_uri); return FAILURE; } /* }}} */ static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { if (strlen(client->request.path_translated) != client->request.path_translated_len) { /* can't handle paths that contain nul bytes */ return php_cli_server_send_error_page(server, client, 400 TSRMLS_CC); } { zend_file_handle zfd; zfd.type = ZEND_HANDLE_FILENAME; zfd.filename = SG(request_info).path_translated; zfd.handle.fp = NULL; zfd.free_filename = 0; zfd.opened_path = NULL; zend_try { php_execute_script(&zfd TSRMLS_CC); } zend_end_try(); } php_cli_server_log_response(client, SG(sapi_headers).http_response_code, NULL TSRMLS_CC); return SUCCESS; } /* }}} */ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { int fd; int status = 200; if (client->request.path_translated && strlen(client->request.path_translated) != client->request.path_translated_len) { /* can't handle paths that contain nul bytes */ return php_cli_server_send_error_page(server, client, 400 TSRMLS_CC); } #ifdef PHP_WIN32 /* The win32 namespace will cut off trailing dots and spaces. Since the VCWD functionality isn't used here, a sophisticated functionality would have to be reimplemented to know ahead there are no files with invalid names there. The simplest is just to forbid invalid filenames, which is done here. */ if (client->request.path_translated && ('.' == client->request.path_translated[client->request.path_translated_len-1] || ' ' == client->request.path_translated[client->request.path_translated_len-1])) { return php_cli_server_send_error_page(server, client, 500 TSRMLS_CC); } #endif fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1; if (fd < 0) { return php_cli_server_send_error_page(server, client, 404 TSRMLS_CC); } php_cli_server_content_sender_ctor(&client->content_sender); client->content_sender_initialized = 1; client->file_fd = fd; { php_cli_server_chunk *chunk; smart_str buffer = { 0 }; const char *mime_type = get_mime_type(client->request.ext, client->request.ext_len); if (!mime_type) { mime_type = "application/octet-stream"; } append_http_status_line(&buffer, client->request.protocol_version, status, 1); if (!buffer.c) { /* out of memory */ php_cli_server_log_response(client, 500, NULL TSRMLS_CC); return FAILURE; } append_essential_headers(&buffer, client, 1); smart_str_appendl_ex(&buffer, "Content-Type: ", sizeof("Content-Type: ") - 1, 1); smart_str_appends_ex(&buffer, mime_type, 1); if (strncmp(mime_type, "text/", 5) == 0) { smart_str_appends_ex(&buffer, "; charset=UTF-8", 1); } smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appends_ex(&buffer, "Content-Length: ", 1); smart_str_append_generic_ex(&buffer, client->request.sb.st_size, 1, size_t, _unsigned); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); smart_str_appendl_ex(&buffer, "\r\n", 2, 1); chunk = php_cli_server_chunk_heap_new(buffer.c, buffer.c, buffer.len); if (!chunk) { smart_str_free_ex(&buffer, 1); php_cli_server_log_response(client, 500, NULL TSRMLS_CC); return FAILURE; } php_cli_server_buffer_append(&client->content_sender.buffer, chunk); } php_cli_server_log_response(client, 200, NULL TSRMLS_CC); php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); return SUCCESS; } /* }}} */ static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ char **auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); if (SUCCESS == zend_hash_find(&client->request.headers, "authorization", sizeof("authorization"), (void**)&auth)) { php_handle_auth_data(*auth TSRMLS_CC); } SG(sapi_headers).http_response_code = 200; if (FAILURE == php_request_startup(TSRMLS_C)) { /* should never be happen */ destroy_request_info(&SG(request_info)); return FAILURE; } PG(during_request_startup) = 0; return SUCCESS; } /* }}} */ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ php_request_shutdown(0); php_cli_server_close_connection(server, client TSRMLS_CC); destroy_request_info(&SG(request_info)); SG(server_context) = NULL; SG(rfc1867_uploaded_files) = NULL; return SUCCESS; } /* }}} */ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { int decline = 0; zend_file_handle zfd; char *old_cwd; ALLOCA_FLAG(use_heap) old_cwd = do_alloca(MAXPATHLEN, use_heap); old_cwd[0] = '\0'; php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1)); zfd.type = ZEND_HANDLE_FILENAME; zfd.filename = server->router; zfd.handle.fp = NULL; zfd.free_filename = 0; zfd.opened_path = NULL; zend_try { zval *retval = NULL; if (SUCCESS == zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, &retval, 1, &zfd)) { if (retval) { decline = Z_TYPE_P(retval) == IS_BOOL && !Z_LVAL_P(retval); zval_ptr_dtor(&retval); } } else { decline = 1; } } zend_end_try(); if (old_cwd[0] != '\0') { php_ignore_value(VCWD_CHDIR(old_cwd)); } free_alloca(old_cwd, use_heap); return decline; } /* }}} */ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { int is_static_file = 0; SG(server_context) = client; if (client->request.ext_len != 3 || memcmp(client->request.ext, "php", 3) || !client->request.path_translated) { is_static_file = 1; } if (server->router || !is_static_file) { if (FAILURE == php_cli_server_request_startup(server, client TSRMLS_CC)) { SG(server_context) = NULL; php_cli_server_close_connection(server, client TSRMLS_CC); destroy_request_info(&SG(request_info)); return SUCCESS; } } if (server->router) { if (!php_cli_server_dispatch_router(server, client TSRMLS_CC)) { php_cli_server_request_shutdown(server, client TSRMLS_CC); return SUCCESS; } } if (!is_static_file) { if (SUCCESS == php_cli_server_dispatch_script(server, client TSRMLS_CC) || SUCCESS != php_cli_server_send_error_page(server, client, 500 TSRMLS_CC)) { if (SG(sapi_headers).http_response_code == 304) { SG(sapi_headers).send_default_content_type = 0; } php_cli_server_request_shutdown(server, client TSRMLS_CC); return SUCCESS; } } else { if (server->router) { static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC); send_header_func = sapi_module.send_headers; /* do not generate default content type header */ SG(sapi_headers).send_default_content_type = 0; /* we don't want headers to be sent */ sapi_module.send_headers = sapi_cli_server_discard_headers; php_request_shutdown(0); sapi_module.send_headers = send_header_func; SG(sapi_headers).send_default_content_type = 1; SG(rfc1867_uploaded_files) = NULL; } if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) { php_cli_server_close_connection(server, client TSRMLS_CC); } SG(server_context) = NULL; return SUCCESS; } SG(server_context) = NULL; destroy_request_info(&SG(request_info)); return SUCCESS; } /* }}} */ static void php_cli_server_dtor(php_cli_server *server TSRMLS_DC) /* {{{ */ { zend_hash_destroy(&server->clients); if (server->server_sock >= 0) { closesocket(server->server_sock); } if (server->host) { pefree(server->host, 1); } if (server->document_root) { pefree(server->document_root, 1); } if (server->router) { pefree(server->router, 1); } } /* }}} */ static void php_cli_server_client_dtor_wrapper(php_cli_server_client **p) /* {{{ */ { closesocket((*p)->sock); php_cli_server_poller_remove(&(*p)->server->poller, POLLIN | POLLOUT, (*p)->sock); php_cli_server_client_dtor(*p); pefree(*p, 1); } /* }}} */ static int php_cli_server_ctor(php_cli_server *server, const char *addr, const char *document_root, const char *router TSRMLS_DC) /* {{{ */ { int retval = SUCCESS; char *host = NULL; char *errstr = NULL; char *_document_root = NULL; char *_router = NULL; int err = 0; int port = 3000; php_socket_t server_sock = SOCK_ERR; char *p = NULL; if (addr[0] == '[') { host = pestrdup(addr + 1, 1); if (!host) { return FAILURE; } p = strchr(host, ']'); if (p) { *p++ = '\0'; if (*p == ':') { port = strtol(p + 1, &p, 10); if (port <= 0 || port > 65535) { p = NULL; } } else if (*p != '\0') { p = NULL; } } } else { host = pestrdup(addr, 1); if (!host) { return FAILURE; } p = strchr(host, ':'); if (p) { *p++ = '\0'; port = strtol(p, &p, 10); if (port <= 0 || port > 65535) { p = NULL; } } } if (!p) { fprintf(stderr, "Invalid address: %s\n", addr); retval = FAILURE; goto out; } server_sock = php_network_listen_socket(host, &port, SOCK_STREAM, &server->address_family, &server->socklen, &errstr TSRMLS_CC); if (server_sock == SOCK_ERR) { php_cli_server_logf("Failed to listen on %s:%d (reason: %s)" TSRMLS_CC, host, port, errstr ? errstr: "?"); efree(errstr); retval = FAILURE; goto out; } server->server_sock = server_sock; err = php_cli_server_poller_ctor(&server->poller); if (SUCCESS != err) { goto out; } php_cli_server_poller_add(&server->poller, POLLIN, server_sock); server->host = host; server->port = port; zend_hash_init(&server->clients, 0, NULL, (void(*)(void*))php_cli_server_client_dtor_wrapper, 1); { size_t document_root_len = strlen(document_root); _document_root = pestrndup(document_root, document_root_len, 1); if (!_document_root) { retval = FAILURE; goto out; } server->document_root = _document_root; server->document_root_len = document_root_len; } if (router) { size_t router_len = strlen(router); _router = pestrndup(router, router_len, 1); if (!_router) { retval = FAILURE; goto out; } server->router = _router; server->router_len = router_len; } else { server->router = NULL; server->router_len = 0; } server->is_running = 1; out: if (retval != SUCCESS) { if (host) { pefree(host, 1); } if (_document_root) { pefree(_document_root, 1); } if (_router) { pefree(_router, 1); } if (server_sock > -1) { closesocket(server_sock); } } return retval; } /* }}} */ static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { char *errstr = NULL; int status = php_cli_server_client_read_request(client, &errstr TSRMLS_CC); if (status < 0) { php_cli_server_logf("%s Invalid request (%s)" TSRMLS_CC, client->addr_str, errstr); efree(errstr); php_cli_server_close_connection(server, client TSRMLS_CC); return FAILURE; } else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) { return php_cli_server_send_error_page(server, client, 501 TSRMLS_CC); } else if (status == 1) { php_cli_server_poller_remove(&server->poller, POLLIN, client->sock); php_cli_server_dispatch(server, client TSRMLS_CC); } else { php_cli_server_poller_add(&server->poller, POLLIN, client->sock); } return SUCCESS; } /* }}} */ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */ { if (client->content_sender_initialized) { if (client->file_fd >= 0 && !client->content_sender.buffer.first) { size_t nbytes_read; if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read)) { php_cli_server_close_connection(server, client TSRMLS_CC); return FAILURE; } if (nbytes_read == 0) { close(client->file_fd); client->file_fd = -1; } } { size_t nbytes_sent; int err = php_cli_server_content_sender_send(&client->content_sender, client->sock, &nbytes_sent); if (err && err != SOCK_EAGAIN) { php_cli_server_close_connection(server, client TSRMLS_CC); return FAILURE; } } if (!client->content_sender.buffer.first && client->file_fd < 0) { php_cli_server_close_connection(server, client TSRMLS_CC); } } return SUCCESS; } /* }}} */ typedef struct php_cli_server_do_event_for_each_fd_callback_params { #ifdef ZTS void ***tsrm_ls; #endif php_cli_server *server; int(*rhandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC); int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC); } php_cli_server_do_event_for_each_fd_callback_params; static int php_cli_server_do_event_for_each_fd_callback(void *_params, int fd, int event) /* {{{ */ { php_cli_server_do_event_for_each_fd_callback_params *params = _params; #ifdef ZTS void ***tsrm_ls = params->tsrm_ls; #endif php_cli_server *server = params->server; if (server->server_sock == fd) { php_cli_server_client *client = NULL; php_socket_t client_sock; socklen_t socklen = server->socklen; struct sockaddr *sa = pemalloc(server->socklen, 1); if (!sa) { return FAILURE; } client_sock = accept(server->server_sock, sa, &socklen); if (client_sock < 0) { char *errstr; errstr = php_socket_strerror(php_socket_errno(), NULL, 0); php_cli_server_logf("Failed to accept a client (reason: %s)" TSRMLS_CC, errstr); efree(errstr); pefree(sa, 1); return SUCCESS; } if (SUCCESS != php_set_sock_blocking(client_sock, 0 TSRMLS_CC)) { pefree(sa, 1); closesocket(client_sock); return SUCCESS; } if (!(client = pemalloc(sizeof(php_cli_server_client), 1)) || FAILURE == php_cli_server_client_ctor(client, server, client_sock, sa, socklen TSRMLS_CC)) { php_cli_server_logf("Failed to create a new request object" TSRMLS_CC); pefree(sa, 1); closesocket(client_sock); return SUCCESS; } #ifdef DEBUG php_cli_server_logf("%s Accepted" TSRMLS_CC, client->addr_str); #endif zend_hash_index_update(&server->clients, client_sock, &client, sizeof(client), NULL); php_cli_server_recv_event_read_request(server, client TSRMLS_CC); } else { php_cli_server_client **client; if (SUCCESS == zend_hash_index_find(&server->clients, fd, (void **)&client)) { if (event & POLLIN) { params->rhandler(server, *client TSRMLS_CC); } if (event & POLLOUT) { params->whandler(server, *client TSRMLS_CC); } } } return SUCCESS; } /* }}} */ static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rhandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC), int(*whandler)(php_cli_server*, php_cli_server_client* TSRMLS_DC) TSRMLS_DC) /* {{{ */ { php_cli_server_do_event_for_each_fd_callback_params params = { #ifdef ZTS tsrm_ls, #endif server, rhandler, whandler }; php_cli_server_poller_iter_on_active(&server->poller, ¶ms, php_cli_server_do_event_for_each_fd_callback); } /* }}} */ static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ */ { int retval = SUCCESS; while (server->is_running) { struct timeval tv = { 1, 0 }; int n = php_cli_server_poller_poll(&server->poller, &tv); if (n > 0) { php_cli_server_do_event_for_each_fd(server, php_cli_server_recv_event_read_request, php_cli_server_send_event TSRMLS_CC); } else if (n == 0) { /* do nothing */ } else { int err = php_socket_errno(); if (err != SOCK_EINTR) { char *errstr = php_socket_strerror(err, NULL, 0); php_cli_server_logf("%s" TSRMLS_CC, errstr); efree(errstr); retval = FAILURE; goto out; } } } out: return retval; } /* }}} */ static php_cli_server server; static void php_cli_server_sigint_handler(int sig) /* {{{ */ { server.is_running = 0; } /* }}} */ int do_cli_server(int argc, char **argv TSRMLS_DC) /* {{{ */ { char *php_optarg = NULL; int php_optind = 1; int c; const char *server_bind_address = NULL; extern const opt_struct OPTIONS[]; const char *document_root = NULL; const char *router = NULL; char document_root_buf[MAXPATHLEN]; while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2))!=-1) { switch (c) { case 'S': server_bind_address = php_optarg; break; case 't': document_root = php_optarg; break; } } if (document_root) { struct stat sb; if (stat(document_root, &sb)) { fprintf(stderr, "Directory %s does not exist.\n", document_root); return 1; } if (!S_ISDIR(sb.st_mode)) { fprintf(stderr, "%s is not a directory.\n", document_root); return 1; } if (VCWD_REALPATH(document_root, document_root_buf)) { document_root = document_root_buf; } } else { char *ret = NULL; #if HAVE_GETCWD ret = VCWD_GETCWD(document_root_buf, MAXPATHLEN); #elif HAVE_GETWD ret = VCWD_GETWD(document_root_buf); #endif document_root = ret ? document_root_buf: "."; } if (argc > php_optind) { router = argv[php_optind]; } if (FAILURE == php_cli_server_ctor(&server, server_bind_address, document_root, router TSRMLS_CC)) { return 1; } sapi_module.phpinfo_as_text = 0; { char buf[52]; if (php_cli_server_get_system_time(buf) != 0) { memmove(buf, "unknown time, can't be fetched", sizeof("unknown time, can't be fetched")); } printf("PHP %s Development Server started at %s" "Listening on http://%s\n" "Document root is %s\n" "Press Ctrl-C to quit.\n", PHP_VERSION, buf, server_bind_address, document_root); } #if defined(HAVE_SIGNAL_H) && defined(SIGINT) signal(SIGINT, php_cli_server_sigint_handler); #endif php_cli_server_do_event_loop(&server TSRMLS_CC); php_cli_server_dtor(&server TSRMLS_CC); return 0; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!4g/ / +php-5.6.40/sapi/cli/php_cli_process_title.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Keyur Govande (kgovande@gmail.com) | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_cli_process_title.h" #include "ps_title.h" /* {{{ proto boolean cli_set_process_title(string arg) Return a boolean to confirm if the process title was successfully changed or not */ PHP_FUNCTION(cli_set_process_title) { char *title = NULL; int title_len; int rc; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &title, &title_len) == FAILURE) { return; } rc = set_ps_title(title); if (rc == PS_TITLE_SUCCESS) { RETURN_TRUE; } php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_set_process_title had an error: %s", ps_title_errno(rc)); RETURN_FALSE; } /* }}} */ /* {{{ proto string cli_get_process_title() Return a string with the current process title. NULL if error. */ PHP_FUNCTION(cli_get_process_title) { int length = 0; const char* title = NULL; int rc; if (zend_parse_parameters_none() == FAILURE) { return; } rc = get_ps_title(&length, &title); if (rc != PS_TITLE_SUCCESS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "cli_get_process_title had an error: %s", ps_title_errno(rc)); RETURN_NULL(); } RETURN_STRINGL(title, length, 1); } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!Vphp-5.6.40/sapi/cli/ps_title.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Keyur Govande | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PS_TITLE_HEADER #define PS_TITLE_HEADER #define PS_TITLE_SUCCESS 0 #define PS_TITLE_NOT_AVAILABLE 1 #define PS_TITLE_NOT_INITIALIZED 2 #define PS_TITLE_BUFFER_NOT_AVAILABLE 3 #define PS_TITLE_WINDOWS_ERROR 4 extern char** save_ps_args(int argc, char** argv); extern int set_ps_title(const char* new_str); extern int get_ps_title(int* displen, const char** string); extern const char* ps_title_errno(int rc); extern int is_ps_title_available(); extern void cleanup_ps_args(char **argv); #endif // PS_TITLE_HEADER PK!saFYEE$php-5.6.40/sapi/cli/php_cli_server.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Moriyoshi Koizumi | +----------------------------------------------------------------------+ */ /* $Id: php_cli.c 306938 2011-01-01 02:17:06Z felipe $ */ #ifndef PHP_CLI_SERVER_H #define PHP_CLI_SERVER_H #include "SAPI.h" extern const zend_function_entry server_additional_functions[]; extern sapi_module_struct cli_server_sapi_module; extern int do_cli_server(int argc, char **argv TSRMLS_DC); ZEND_BEGIN_MODULE_GLOBALS(cli_server) short color; ZEND_END_MODULE_GLOBALS(cli_server) #ifdef ZTS #define CLI_SERVER_G(v) TSRMG(cli_server_globals_id, zend_cli_server_globals *, v) #else #define CLI_SERVER_G(v) (cli_server_globals.v) #endif #endif /* PHP_CLI_SERVER_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!lW00php-5.6.40/sapi/cli/ps_title.cnu[/* * PostgreSQL is released under the PostgreSQL License, a liberal Open Source * license, similar to the BSD or MIT licenses. * PostgreSQL Database Management System (formerly known as Postgres, then as * Postgres95) * * Portions Copyright (c) 1996-2015, The PostgreSQL Global Development Group * * Portions Copyright (c) 1994, The Regents of the University of California * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without a written * agreement is hereby granted, provided that the above copyright notice * and this paragraph and the following two paragraphs appear in all copies. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, * EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN * "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * The following code is adopted from the PostgreSQL's ps_status(.h/.c). */ #include "ps_title.h" #include #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef PHP_WIN32 #include "config.w32.h" #include #include #else #include "php_config.h" extern char** environ; #endif #ifdef HAVE_SYS_PSTAT_H #include /* for HP-UX */ #endif #ifdef HAVE_PS_STRINGS #include /* for old BSD */ #include #endif #if defined(DARWIN) #include #endif /* * Ways of updating ps display: * * PS_USE_SETPROCTITLE * use the function setproctitle(const char *, ...) * (newer BSD systems) * PS_USE_PSTAT * use the pstat(PSTAT_SETCMD, ) * (HPUX) * PS_USE_PS_STRINGS * assign PS_STRINGS->ps_argvstr = "string" * (some BSD systems) * PS_USE_CHANGE_ARGV * assign argv[0] = "string" * (some other BSD systems) * PS_USE_CLOBBER_ARGV * write over the argv and environment area * (Linux and most SysV-like systems) * PS_USE_WIN32 * push the string out as the name of a Windows event * PS_USE_NONE * don't update ps display * (This is the default, as it is safest.) */ #if defined(HAVE_SETPROCTITLE) #define PS_USE_SETPROCTITLE #elif defined(HAVE_SYS_PSTAT_H) && defined(PSTAT_SETCMD) #define PS_USE_PSTAT #elif defined(HAVE_PS_STRINGS) #define PS_USE_PS_STRINGS #elif defined(BSD) && !defined(DARWIN) #define PS_USE_CHANGE_ARGV #elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(ultrix) || defined(__osf__) || defined(DARWIN) #define PS_USE_CLOBBER_ARGV #elif defined(PHP_WIN32) #define PS_USE_WIN32 #else #define PS_USE_NONE #endif /* Different systems want the buffer padded differently */ #if defined(_AIX) || defined(__linux__) || defined(DARWIN) #define PS_PADDING '\0' #else #define PS_PADDING ' ' #endif #ifdef PS_USE_WIN32 static char windows_error_details[64]; static char ps_buffer[MAX_PATH]; static const size_t ps_buffer_size = MAX_PATH; #elif defined(PS_USE_CLOBBER_ARGV) static char *ps_buffer; /* will point to argv area */ static size_t ps_buffer_size; /* space determined at run time */ static char *empty_environ[] = {0}; /* empty environment */ #else #define PS_BUFFER_SIZE 256 static char ps_buffer[PS_BUFFER_SIZE]; static const size_t ps_buffer_size = PS_BUFFER_SIZE; #endif static size_t ps_buffer_cur_len; /* actual string length in ps_buffer */ /* save the original argv[] location here */ static int save_argc; static char** save_argv; /* * This holds the 'locally' allocated environ from the save_ps_args method. * This is subsequently free'd at exit. */ static char** frozen_environ, **new_environ; /* * Call this method early, before any code has used the original argv passed in * from main(). * If needed, this code will make deep copies of argv and environ and return * these to the caller for further use. The original argv is then 'clobbered' * to store the process title. */ char** save_ps_args(int argc, char** argv) { save_argc = argc; save_argv = argv; #if defined(PS_USE_CLOBBER_ARGV) /* * If we're going to overwrite the argv area, count the available space. * Also move the environment to make additional room. */ { char* end_of_area = NULL; int non_contiguous_area = 0; int i; /* * check for contiguous argv strings */ for (i = 0; (non_contiguous_area == 0) && (i < argc); i++) { if (i != 0 && end_of_area + 1 != argv[i]) non_contiguous_area = 1; end_of_area = argv[i] + strlen(argv[i]); } /* * check for contiguous environ strings following argv */ for (i = 0; (non_contiguous_area == 0) && (environ[i] != NULL); i++) { if (end_of_area + 1 != environ[i]) non_contiguous_area = 1; end_of_area = environ[i] + strlen(environ[i]); } if (non_contiguous_area != 0) goto clobber_error; ps_buffer = argv[0]; ps_buffer_size = end_of_area - argv[0]; /* * move the environment out of the way */ new_environ = (char **) malloc((i + 1) * sizeof(char *)); frozen_environ = (char **) malloc((i + 1) * sizeof(char *)); if (!new_environ || !frozen_environ) goto clobber_error; for (i = 0; environ[i] != NULL; i++) { new_environ[i] = strdup(environ[i]); if (!new_environ[i]) goto clobber_error; } new_environ[i] = NULL; environ = new_environ; memcpy((char *)frozen_environ, (char *)new_environ, sizeof(char *) * (i + 1)); } #endif /* PS_USE_CLOBBER_ARGV */ #if defined(PS_USE_CHANGE_ARGV) || defined(PS_USE_CLOBBER_ARGV) /* * If we're going to change the original argv[] then make a copy for * argument parsing purposes. * * (NB: do NOT think to remove the copying of argv[]! * On some platforms, getopt() keeps pointers into the argv array, and * will get horribly confused when it is re-called to analyze a subprocess' * argument string if the argv storage has been clobbered meanwhile. * Other platforms have other dependencies on argv[].) */ { char** new_argv; int i; new_argv = (char **) malloc((argc + 1) * sizeof(char *)); if (!new_argv) goto clobber_error; for (i = 0; i < argc; i++) { new_argv[i] = strdup(argv[i]); if (!new_argv[i]) goto clobber_error; } new_argv[argc] = NULL; #if defined(DARWIN) /* * Darwin (and perhaps other NeXT-derived platforms?) has a static * copy of the argv pointer, which we may fix like so: */ *_NSGetArgv() = new_argv; #endif argv = new_argv; } #endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */ #if defined(PS_USE_CLOBBER_ARGV) { /* make extra argv slots point at end_of_area (a NUL) */ int i; for (i = 1; i < save_argc; i++) save_argv[i] = ps_buffer + ps_buffer_size; } #endif /* PS_USE_CLOBBER_ARGV */ #ifdef PS_USE_CHANGE_ARGV save_argv[0] = ps_buffer; /* ps_buffer here is a static const array of size PS_BUFFER_SIZE */ save_argv[1] = NULL; #endif /* PS_USE_CHANGE_ARGV */ return argv; #if defined(PS_USE_CHANGE_ARGV) || defined(PS_USE_CLOBBER_ARGV) clobber_error: /* probably can't happen?! * if we ever get here, argv still points to originally passed * in argument */ save_argv = NULL; save_argc = 0; ps_buffer = NULL; ps_buffer_size = 0; return argv; #endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */ } /* * Returns PS_TITLE_SUCCESS if the OS supports this functionality * and the init function was called. * Otherwise returns NOT_AVAILABLE or NOT_INITIALIZED */ int is_ps_title_available() { #ifdef PS_USE_NONE return PS_TITLE_NOT_AVAILABLE; /* disabled functionality */ #endif if (!save_argv) return PS_TITLE_NOT_INITIALIZED; #ifdef PS_USE_CLOBBER_ARGV if (!ps_buffer) return PS_TITLE_BUFFER_NOT_AVAILABLE; #endif /* PS_USE_CLOBBER_ARGV */ return PS_TITLE_SUCCESS; } /* * Convert error codes into error strings */ const char* ps_title_errno(int rc) { switch(rc) { case PS_TITLE_SUCCESS: return "Success"; case PS_TITLE_NOT_AVAILABLE: return "Not available on this OS"; case PS_TITLE_NOT_INITIALIZED: return "Not initialized correctly"; case PS_TITLE_BUFFER_NOT_AVAILABLE: return "Buffer not contiguous"; #ifdef PS_USE_WIN32 case PS_TITLE_WINDOWS_ERROR: sprintf(windows_error_details, "Windows error code: %d", GetLastError()); return windows_error_details; #endif } return "Unknown error code"; } /* * Set a new process title. * Returns the appropriate error code if if there's an error * (like the functionality is compile time disabled, or the * save_ps_args() was not called. * Else returns 0 on success. */ int set_ps_title(const char* title) { int rc = is_ps_title_available(); if (rc != PS_TITLE_SUCCESS) return rc; strncpy(ps_buffer, title, ps_buffer_size); ps_buffer[ps_buffer_size - 1] = '\0'; ps_buffer_cur_len = strlen(ps_buffer); #ifdef PS_USE_SETPROCTITLE setproctitle("%s", ps_buffer); #endif #ifdef PS_USE_PSTAT { union pstun pst; pst.pst_command = ps_buffer; pstat(PSTAT_SETCMD, pst, ps_buffer_cur_len, 0, 0); } #endif /* PS_USE_PSTAT */ #ifdef PS_USE_PS_STRINGS PS_STRINGS->ps_nargvstr = 1; PS_STRINGS->ps_argvstr = ps_buffer; #endif /* PS_USE_PS_STRINGS */ #ifdef PS_USE_CLOBBER_ARGV /* pad unused memory */ if (ps_buffer_cur_len < ps_buffer_size) { memset(ps_buffer + ps_buffer_cur_len, PS_PADDING, ps_buffer_size - ps_buffer_cur_len); } #endif /* PS_USE_CLOBBER_ARGV */ #ifdef PS_USE_WIN32 { if (!SetConsoleTitle(ps_buffer)) return PS_TITLE_WINDOWS_ERROR; } #endif /* PS_USE_WIN32 */ return PS_TITLE_SUCCESS; } /* * Returns the current ps_buffer value into string. On some platforms * the string will not be null-terminated, so return the effective * length into *displen. * The return code indicates the error. */ int get_ps_title(int *displen, const char** string) { int rc = is_ps_title_available(); if (rc != PS_TITLE_SUCCESS) return rc; #ifdef PS_USE_WIN32 if (!(ps_buffer_cur_len = GetConsoleTitle(ps_buffer, ps_buffer_size))) return PS_TITLE_WINDOWS_ERROR; #endif *displen = (int)ps_buffer_cur_len; *string = ps_buffer; return PS_TITLE_SUCCESS; } /* * Clean up the allocated argv and environ if applicable. Only call * this right before exiting. * This isn't needed per-se because the OS will clean-up anyway, but * having and calling this will ensure Valgrind doesn't output 'false * positives'. */ void cleanup_ps_args(char **argv) { #ifndef PS_USE_NONE if (save_argv) { save_argv = NULL; save_argc = 0; #ifdef PS_USE_CLOBBER_ARGV { int i; for (i = 0; frozen_environ[i] != NULL; i++) free(frozen_environ[i]); free(frozen_environ); free(new_environ); /* leave a sane environment behind since some atexit() handlers call getenv(). */ environ = empty_environ; } #endif /* PS_USE_CLOBBER_ARGV */ #if defined(PS_USE_CHANGE_ARGV) || defined(PS_USE_CLOBBER_ARGV) { int i; for (i=0; argv[i] != NULL; i++) free(argv[i]); free(argv); } #endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */ } #endif /* PS_USE_NONE */ return; } PK!8%php-5.6.40/sapi/cli/php_http_parser.hnu[/* Copyright 2009,2010 Ryan Dahl * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /* modified by Moriyoshi Koizumi to make it fit to PHP source tree. */ #ifndef php_http_parser_h #define php_http_parser_h #ifdef __cplusplus extern "C" { #endif #include #if defined(_WIN32) && !defined(__MINGW32__) # include # include "config.w32.h" #else # include "php_config.h" #endif #include "php_stdint.h" /* Compile with -DPHP_HTTP_PARSER_STRICT=0 to make less checks, but run * faster */ #ifndef PHP_HTTP_PARSER_STRICT # define PHP_HTTP_PARSER_STRICT 1 #else # define PHP_HTTP_PARSER_STRICT 0 #endif /* Maximium header size allowed */ #define PHP_HTTP_MAX_HEADER_SIZE (80*1024) typedef struct php_http_parser php_http_parser; typedef struct php_http_parser_settings php_http_parser_settings; /* Callbacks should return non-zero to indicate an error. The parser will * then halt execution. * * The one exception is on_headers_complete. In a PHP_HTTP_RESPONSE parser * returning '1' from on_headers_complete will tell the parser that it * should not expect a body. This is used when receiving a response to a * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding: * chunked' headers that indicate the presence of a body. * * http_data_cb does not return data chunks. It will be call arbitrarally * many times for each string. E.G. you might get 10 callbacks for "on_path" * each providing just a few characters more data. */ typedef int (*php_http_data_cb) (php_http_parser*, const char *at, size_t length); typedef int (*php_http_cb) (php_http_parser*); /* Request Methods */ enum php_http_method { PHP_HTTP_DELETE = 0 , PHP_HTTP_GET , PHP_HTTP_HEAD , PHP_HTTP_POST , PHP_HTTP_PUT , PHP_HTTP_PATCH /* pathological */ , PHP_HTTP_CONNECT , PHP_HTTP_OPTIONS , PHP_HTTP_TRACE /* webdav */ , PHP_HTTP_COPY , PHP_HTTP_LOCK , PHP_HTTP_MKCOL , PHP_HTTP_MOVE , PHP_HTTP_MKCALENDAR , PHP_HTTP_PROPFIND , PHP_HTTP_PROPPATCH , PHP_HTTP_UNLOCK /* subversion */ , PHP_HTTP_REPORT , PHP_HTTP_MKACTIVITY , PHP_HTTP_CHECKOUT , PHP_HTTP_MERGE /* upnp */ , PHP_HTTP_MSEARCH , PHP_HTTP_NOTIFY , PHP_HTTP_SUBSCRIBE , PHP_HTTP_UNSUBSCRIBE /* unknown, not implemented */ , PHP_HTTP_NOT_IMPLEMENTED }; enum php_http_parser_type { PHP_HTTP_REQUEST, PHP_HTTP_RESPONSE, PHP_HTTP_BOTH }; struct php_http_parser { /** PRIVATE **/ unsigned char type : 2; unsigned char flags : 6; unsigned char state; unsigned char header_state; unsigned char index; uint32_t nread; ssize_t content_length; /** READ-ONLY **/ unsigned short http_major; unsigned short http_minor; unsigned short status_code; /* responses only */ unsigned char method; /* requests only */ /* 1 = Upgrade header was present and the parser has exited because of that. * 0 = No upgrade header present. * Should be checked when http_parser_execute() returns in addition to * error checking. */ char upgrade; /** PUBLIC **/ void *data; /* A pointer to get hook to the "connection" or "socket" object */ }; struct php_http_parser_settings { php_http_cb on_message_begin; php_http_data_cb on_path; php_http_data_cb on_query_string; php_http_data_cb on_url; php_http_data_cb on_fragment; php_http_data_cb on_header_field; php_http_data_cb on_header_value; php_http_cb on_headers_complete; php_http_data_cb on_body; php_http_cb on_message_complete; }; void php_http_parser_init(php_http_parser *parser, enum php_http_parser_type type); size_t php_http_parser_execute(php_http_parser *parser, const php_http_parser_settings *settings, const char *data, size_t len); /* If php_http_should_keep_alive() in the on_headers_complete or * on_message_complete callback returns true, then this will be should be * the last message on the connection. * If you are the server, respond with the "Connection: close" header. * If you are the client, close the connection. */ int php_http_should_keep_alive(php_http_parser *parser); /* Returns a string version of the HTTP method. */ const char *php_http_method_str(enum php_http_method); #ifdef __cplusplus } #endif #endif PK! P%php-5.6.40/sapi/cli/php_http_parser.cnu[/* Copyright 2009,2010 Ryan Dahl * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #include #include #include "php_http_parser.h" #ifndef MIN # define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif #define CALLBACK2(FOR) \ do { \ if (settings->on_##FOR) { \ if (0 != settings->on_##FOR(parser)) return (p - data); \ } \ } while (0) #define MARK(FOR) \ do { \ FOR##_mark = p; \ } while (0) #define CALLBACK_NOCLEAR(FOR) \ do { \ if (FOR##_mark) { \ if (settings->on_##FOR) { \ if (0 != settings->on_##FOR(parser, \ FOR##_mark, \ p - FOR##_mark)) \ { \ return (p - data); \ } \ } \ } \ } while (0) #ifdef PHP_WIN32 # undef CALLBACK #endif #define CALLBACK(FOR) \ do { \ CALLBACK_NOCLEAR(FOR); \ FOR##_mark = NULL; \ } while (0) #define PROXY_CONNECTION "proxy-connection" #define CONNECTION "connection" #define CONTENT_LENGTH "content-length" #define TRANSFER_ENCODING "transfer-encoding" #define UPGRADE "upgrade" #define CHUNKED "chunked" #define KEEP_ALIVE "keep-alive" #define CLOSE "close" static const char *method_strings[] = { "DELETE" , "GET" , "HEAD" , "POST" , "PUT" , "PATCH" , "CONNECT" , "OPTIONS" , "TRACE" , "COPY" , "LOCK" , "MKCOL" , "MOVE" , "MKCALENDAR" , "PROPFIND" , "PROPPATCH" , "UNLOCK" , "REPORT" , "MKACTIVITY" , "CHECKOUT" , "MERGE" , "M-SEARCH" , "NOTIFY" , "SUBSCRIBE" , "UNSUBSCRIBE" , "NOTIMPLEMENTED" }; /* Tokens as defined by rfc 2616. Also lowercases them. * token = 1* * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT */ static const char tokens[256] = { /* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */ 0, 0, 0, 0, 0, 0, 0, 0, /* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */ 0, 0, 0, 0, 0, 0, 0, 0, /* 16 dle 17 dc1 18 dc2 19 dc3 20 dc4 21 nak 22 syn 23 etb */ 0, 0, 0, 0, 0, 0, 0, 0, /* 24 can 25 em 26 sub 27 esc 28 fs 29 gs 30 rs 31 us */ 0, 0, 0, 0, 0, 0, 0, 0, /* 32 sp 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' */ ' ', '!', '"', '#', '$', '%', '&', '\'', /* 40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 / */ 0, 0, '*', '+', 0, '-', '.', '/', /* 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 */ '0', '1', '2', '3', '4', '5', '6', '7', /* 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ? */ '8', '9', 0, 0, 0, 0, 0, 0, /* 64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G */ 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', /* 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O */ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', /* 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W */ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', /* 88 X 89 Y 90 Z 91 [ 92 \ 93 ] 94 ^ 95 _ */ 'x', 'y', 'z', 0, 0, 0, '^', '_', /* 96 ` 97 a 98 b 99 c 100 d 101 e 102 f 103 g */ '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', /* 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o */ 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', /* 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w */ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', /* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */ 'x', 'y', 'z', 0, '|', '}', '~', 0 }; static const int8_t unhex[256] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 , 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1 ,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }; static const uint8_t normal_url_char[256] = { /* 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel */ 0, 0, 0, 0, 0, 0, 0, 0, /* 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si */ 0, 0, 0, 0, 0, 0, 0, 0, /* 16 dle 17 dc1 18 dc2 19 dc3 20 dc4 21 nak 22 syn 23 etb */ 0, 0, 0, 0, 0, 0, 0, 0, /* 24 can 25 em 26 sub 27 esc 28 fs 29 gs 30 rs 31 us */ 0, 0, 0, 0, 0, 0, 0, 0, /* 32 sp 33 ! 34 " 35 # 36 $ 37 % 38 & 39 ' */ 0, 1, 1, 0, 1, 1, 1, 1, /* 40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 / */ 1, 1, 1, 1, 1, 1, 1, 1, /* 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 */ 1, 1, 1, 1, 1, 1, 1, 1, /* 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ? */ 1, 1, 1, 1, 1, 1, 1, 0, /* 64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G */ 1, 1, 1, 1, 1, 1, 1, 1, /* 72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O */ 1, 1, 1, 1, 1, 1, 1, 1, /* 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W */ 1, 1, 1, 1, 1, 1, 1, 1, /* 88 X 89 Y 90 Z 91 [ 92 \ 93 ] 94 ^ 95 _ */ 1, 1, 1, 1, 1, 1, 1, 1, /* 96 ` 97 a 98 b 99 c 100 d 101 e 102 f 103 g */ 1, 1, 1, 1, 1, 1, 1, 1, /* 104 h 105 i 106 j 107 k 108 l 109 m 110 n 111 o */ 1, 1, 1, 1, 1, 1, 1, 1, /* 112 p 113 q 114 r 115 s 116 t 117 u 118 v 119 w */ 1, 1, 1, 1, 1, 1, 1, 1, /* 120 x 121 y 122 z 123 { 124 | 125 } 126 ~ 127 del */ 1, 1, 1, 1, 1, 1, 1, 0 }; enum state { s_dead = 1 /* important that this is > 0 */ , s_start_req_or_res , s_res_or_resp_H , s_start_res , s_res_H , s_res_HT , s_res_HTT , s_res_HTTP , s_res_first_http_major , s_res_http_major , s_res_first_http_minor , s_res_http_minor , s_res_first_status_code , s_res_status_code , s_res_status , s_res_line_almost_done , s_start_req , s_req_method , s_req_spaces_before_url , s_req_schema , s_req_schema_slash , s_req_schema_slash_slash , s_req_host , s_req_port , s_req_path , s_req_query_string_start , s_req_query_string , s_req_fragment_start , s_req_fragment , s_req_http_start , s_req_http_H , s_req_http_HT , s_req_http_HTT , s_req_http_HTTP , s_req_first_http_major , s_req_http_major , s_req_first_http_minor , s_req_http_minor , s_req_line_almost_done , s_header_field_start , s_header_field , s_header_value_start , s_header_value , s_header_almost_done , s_headers_almost_done /* Important: 's_headers_almost_done' must be the last 'header' state. All * states beyond this must be 'body' states. It is used for overflow * checking. See the PARSING_HEADER() macro. */ , s_chunk_size_start , s_chunk_size , s_chunk_size_almost_done , s_chunk_parameters , s_chunk_data , s_chunk_data_almost_done , s_chunk_data_done , s_body_identity , s_body_identity_eof }; #define PARSING_HEADER(state) (state <= s_headers_almost_done && 0 == (parser->flags & F_TRAILING)) enum header_states { h_general = 0 , h_C , h_CO , h_CON , h_matching_connection , h_matching_proxy_connection , h_matching_content_length , h_matching_transfer_encoding , h_matching_upgrade , h_connection , h_content_length , h_transfer_encoding , h_upgrade , h_matching_transfer_encoding_chunked , h_matching_connection_keep_alive , h_matching_connection_close , h_transfer_encoding_chunked , h_connection_keep_alive , h_connection_close }; enum flags { F_CHUNKED = 1 << 0 , F_CONNECTION_KEEP_ALIVE = 1 << 1 , F_CONNECTION_CLOSE = 1 << 2 , F_TRAILING = 1 << 3 , F_UPGRADE = 1 << 4 , F_SKIPBODY = 1 << 5 }; #define CR '\r' #define LF '\n' #define LOWER(c) (unsigned char)(c | 0x20) #define TOKEN(c) tokens[(unsigned char)c] #define start_state (parser->type == PHP_HTTP_REQUEST ? s_start_req : s_start_res) #if HTTP_PARSER_STRICT # define STRICT_CHECK(cond) if (cond) goto error # define NEW_MESSAGE() (http_should_keep_alive(parser) ? start_state : s_dead) #else # define STRICT_CHECK(cond) # define NEW_MESSAGE() start_state #endif size_t php_http_parser_execute (php_http_parser *parser, const php_http_parser_settings *settings, const char *data, size_t len) { char c, ch; const char *p = data, *pe; size_t to_read; enum state state = (enum state) parser->state; enum header_states header_state = (enum header_states) parser->header_state; uint32_t index = parser->index; uint32_t nread = parser->nread; /* technically we could combine all of these (except for url_mark) into one variable, saving stack space, but it seems more clear to have them separated. */ const char *header_field_mark = 0; const char *header_value_mark = 0; const char *fragment_mark = 0; const char *query_string_mark = 0; const char *path_mark = 0; const char *url_mark = 0; if (len == 0) { if (state == s_body_identity_eof) { CALLBACK2(message_complete); } return 0; } if (state == s_header_field) header_field_mark = data; if (state == s_header_value) header_value_mark = data; if (state == s_req_fragment) fragment_mark = data; if (state == s_req_query_string) query_string_mark = data; if (state == s_req_path) path_mark = data; if (state == s_req_path || state == s_req_schema || state == s_req_schema_slash || state == s_req_schema_slash_slash || state == s_req_port || state == s_req_query_string_start || state == s_req_query_string || state == s_req_host || state == s_req_fragment_start || state == s_req_fragment) url_mark = data; for (p=data, pe=data+len; p != pe; p++) { ch = *p; if (PARSING_HEADER(state)) { ++nread; /* Buffer overflow attack */ if (nread > PHP_HTTP_MAX_HEADER_SIZE) goto error; } switch (state) { case s_dead: /* this state is used after a 'Connection: close' message * the parser will error out if it reads another message */ goto error; case s_start_req_or_res: { if (ch == CR || ch == LF) break; parser->flags = 0; parser->content_length = -1; CALLBACK2(message_begin); if (ch == 'H') state = s_res_or_resp_H; else { parser->type = PHP_HTTP_REQUEST; goto start_req_method_assign; } break; } case s_res_or_resp_H: if (ch == 'T') { parser->type = PHP_HTTP_RESPONSE; state = s_res_HT; } else { if (ch != 'E') goto error; parser->type = PHP_HTTP_REQUEST; parser->method = PHP_HTTP_HEAD; index = 2; state = s_req_method; } break; case s_start_res: { parser->flags = 0; parser->content_length = -1; CALLBACK2(message_begin); switch (ch) { case 'H': state = s_res_H; break; case CR: case LF: break; default: goto error; } break; } case s_res_H: STRICT_CHECK(ch != 'T'); state = s_res_HT; break; case s_res_HT: STRICT_CHECK(ch != 'T'); state = s_res_HTT; break; case s_res_HTT: STRICT_CHECK(ch != 'P'); state = s_res_HTTP; break; case s_res_HTTP: STRICT_CHECK(ch != '/'); state = s_res_first_http_major; break; case s_res_first_http_major: if (ch < '1' || ch > '9') goto error; parser->http_major = ch - '0'; state = s_res_http_major; break; /* major HTTP version or dot */ case s_res_http_major: { if (ch == '.') { state = s_res_first_http_minor; break; } if (ch < '0' || ch > '9') goto error; parser->http_major *= 10; parser->http_major += ch - '0'; if (parser->http_major > 999) goto error; break; } /* first digit of minor HTTP version */ case s_res_first_http_minor: if (ch < '0' || ch > '9') goto error; parser->http_minor = ch - '0'; state = s_res_http_minor; break; /* minor HTTP version or end of request line */ case s_res_http_minor: { if (ch == ' ') { state = s_res_first_status_code; break; } if (ch < '0' || ch > '9') goto error; parser->http_minor *= 10; parser->http_minor += ch - '0'; if (parser->http_minor > 999) goto error; break; } case s_res_first_status_code: { if (ch < '0' || ch > '9') { if (ch == ' ') { break; } goto error; } parser->status_code = ch - '0'; state = s_res_status_code; break; } case s_res_status_code: { if (ch < '0' || ch > '9') { switch (ch) { case ' ': state = s_res_status; break; case CR: state = s_res_line_almost_done; break; case LF: state = s_header_field_start; break; default: goto error; } break; } parser->status_code *= 10; parser->status_code += ch - '0'; if (parser->status_code > 999) goto error; break; } case s_res_status: /* the human readable status. e.g. "NOT FOUND" * we are not humans so just ignore this */ if (ch == CR) { state = s_res_line_almost_done; break; } if (ch == LF) { state = s_header_field_start; break; } break; case s_res_line_almost_done: STRICT_CHECK(ch != LF); state = s_header_field_start; break; case s_start_req: { if (ch == CR || ch == LF) break; parser->flags = 0; parser->content_length = -1; CALLBACK2(message_begin); if (ch < 'A' || 'Z' < ch) goto error; start_req_method_assign: parser->method = (enum php_http_method) 0; index = 1; switch (ch) { case 'C': parser->method = PHP_HTTP_CONNECT; /* or COPY, CHECKOUT */ break; case 'D': parser->method = PHP_HTTP_DELETE; break; case 'G': parser->method = PHP_HTTP_GET; break; case 'H': parser->method = PHP_HTTP_HEAD; break; case 'L': parser->method = PHP_HTTP_LOCK; break; case 'M': parser->method = PHP_HTTP_MKCOL; /* or MOVE, MKCALENDAR, MKACTIVITY, MERGE, M-SEARCH */ break; case 'N': parser->method = PHP_HTTP_NOTIFY; break; case 'O': parser->method = PHP_HTTP_OPTIONS; break; case 'P': parser->method = PHP_HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break; case 'R': parser->method = PHP_HTTP_REPORT; break; case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break; case 'T': parser->method = PHP_HTTP_TRACE; break; case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; default: parser->method = PHP_HTTP_NOT_IMPLEMENTED; break; } state = s_req_method; break; } case s_req_method: { const char *matcher; if (ch == '\0') goto error; matcher = method_strings[parser->method]; if (ch == ' ') { if (parser->method != PHP_HTTP_NOT_IMPLEMENTED && matcher[index] != '\0') { parser->method = PHP_HTTP_NOT_IMPLEMENTED; } state = s_req_spaces_before_url; } else if (parser->method == PHP_HTTP_NOT_IMPLEMENTED || ch == matcher[index]) { ; /* nada */ } else if (parser->method == PHP_HTTP_CONNECT) { if (index == 1 && ch == 'H') { parser->method = PHP_HTTP_CHECKOUT; } else if (index == 2 && ch == 'P') { parser->method = PHP_HTTP_COPY; } else { parser->method = PHP_HTTP_NOT_IMPLEMENTED; } } else if (parser->method == PHP_HTTP_MKCOL) { if (index == 1 && ch == 'O') { parser->method = PHP_HTTP_MOVE; } else if (index == 3 && ch == 'A') { parser->method = PHP_HTTP_MKCALENDAR; } else if (index == 1 && ch == 'E') { parser->method = PHP_HTTP_MERGE; } else if (index == 1 && ch == '-') { parser->method = PHP_HTTP_MSEARCH; } else if (index == 2 && ch == 'A') { parser->method = PHP_HTTP_MKACTIVITY; } else { parser->method = PHP_HTTP_NOT_IMPLEMENTED; } } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'R') { parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */ } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') { parser->method = PHP_HTTP_PUT; } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'A') { parser->method = PHP_HTTP_PATCH; } else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') { parser->method = PHP_HTTP_UNSUBSCRIBE; } else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') { parser->method = PHP_HTTP_PROPPATCH; } else { parser->method = PHP_HTTP_NOT_IMPLEMENTED; } ++index; break; } case s_req_spaces_before_url: { if (ch == ' ') break; if (ch == '/' || ch == '*') { MARK(url); MARK(path); state = s_req_path; break; } c = LOWER(ch); if (c >= 'a' && c <= 'z') { MARK(url); state = s_req_schema; break; } goto error; } case s_req_schema: { c = LOWER(ch); if (c >= 'a' && c <= 'z') break; if (ch == ':') { state = s_req_schema_slash; break; } else if (ch == '.') { state = s_req_host; break; } else if ('0' <= ch && ch <= '9') { state = s_req_host; break; } goto error; } case s_req_schema_slash: STRICT_CHECK(ch != '/'); state = s_req_schema_slash_slash; break; case s_req_schema_slash_slash: STRICT_CHECK(ch != '/'); state = s_req_host; break; case s_req_host: { c = LOWER(ch); if (c >= 'a' && c <= 'z') break; if ((ch >= '0' && ch <= '9') || ch == '.' || ch == '-') break; switch (ch) { case ':': state = s_req_port; break; case '/': MARK(path); state = s_req_path; break; case ' ': /* The request line looks like: * "GET http://foo.bar.com HTTP/1.1" * That is, there is no path. */ CALLBACK(url); state = s_req_http_start; break; default: goto error; } break; } case s_req_port: { if (ch >= '0' && ch <= '9') break; switch (ch) { case '/': MARK(path); state = s_req_path; break; case ' ': /* The request line looks like: * "GET http://foo.bar.com:1234 HTTP/1.1" * That is, there is no path. */ CALLBACK(url); state = s_req_http_start; break; default: goto error; } break; } case s_req_path: { if (normal_url_char[(unsigned char)ch]) break; switch (ch) { case ' ': CALLBACK(url); CALLBACK(path); state = s_req_http_start; break; case CR: CALLBACK(url); CALLBACK(path); parser->http_major = 0; parser->http_minor = 9; state = s_req_line_almost_done; break; case LF: CALLBACK(url); CALLBACK(path); parser->http_major = 0; parser->http_minor = 9; state = s_header_field_start; break; case '?': CALLBACK(path); state = s_req_query_string_start; break; case '#': CALLBACK(path); state = s_req_fragment_start; break; default: goto error; } break; } case s_req_query_string_start: { if (normal_url_char[(unsigned char)ch]) { MARK(query_string); state = s_req_query_string; break; } switch (ch) { case '?': break; /* XXX ignore extra '?' ... is this right? */ case ' ': CALLBACK(url); state = s_req_http_start; break; case CR: CALLBACK(url); parser->http_major = 0; parser->http_minor = 9; state = s_req_line_almost_done; break; case LF: CALLBACK(url); parser->http_major = 0; parser->http_minor = 9; state = s_header_field_start; break; case '#': state = s_req_fragment_start; break; default: goto error; } break; } case s_req_query_string: { if (normal_url_char[(unsigned char)ch]) break; switch (ch) { case '?': /* allow extra '?' in query string */ break; case ' ': CALLBACK(url); CALLBACK(query_string); state = s_req_http_start; break; case CR: CALLBACK(url); CALLBACK(query_string); parser->http_major = 0; parser->http_minor = 9; state = s_req_line_almost_done; break; case LF: CALLBACK(url); CALLBACK(query_string); parser->http_major = 0; parser->http_minor = 9; state = s_header_field_start; break; case '#': CALLBACK(query_string); state = s_req_fragment_start; break; default: goto error; } break; } case s_req_fragment_start: { if (normal_url_char[(unsigned char)ch]) { MARK(fragment); state = s_req_fragment; break; } switch (ch) { case ' ': CALLBACK(url); state = s_req_http_start; break; case CR: CALLBACK(url); parser->http_major = 0; parser->http_minor = 9; state = s_req_line_almost_done; break; case LF: CALLBACK(url); parser->http_major = 0; parser->http_minor = 9; state = s_header_field_start; break; case '?': MARK(fragment); state = s_req_fragment; break; case '#': break; default: goto error; } break; } case s_req_fragment: { if (normal_url_char[(unsigned char)ch]) break; switch (ch) { case ' ': CALLBACK(url); CALLBACK(fragment); state = s_req_http_start; break; case CR: CALLBACK(url); CALLBACK(fragment); parser->http_major = 0; parser->http_minor = 9; state = s_req_line_almost_done; break; case LF: CALLBACK(url); CALLBACK(fragment); parser->http_major = 0; parser->http_minor = 9; state = s_header_field_start; break; case '?': case '#': break; default: goto error; } break; } case s_req_http_start: switch (ch) { case 'H': state = s_req_http_H; break; case ' ': break; default: goto error; } break; case s_req_http_H: STRICT_CHECK(ch != 'T'); state = s_req_http_HT; break; case s_req_http_HT: STRICT_CHECK(ch != 'T'); state = s_req_http_HTT; break; case s_req_http_HTT: STRICT_CHECK(ch != 'P'); state = s_req_http_HTTP; break; case s_req_http_HTTP: STRICT_CHECK(ch != '/'); state = s_req_first_http_major; break; /* first digit of major HTTP version */ case s_req_first_http_major: if (ch < '1' || ch > '9') goto error; parser->http_major = ch - '0'; state = s_req_http_major; break; /* major HTTP version or dot */ case s_req_http_major: { if (ch == '.') { state = s_req_first_http_minor; break; } if (ch < '0' || ch > '9') goto error; parser->http_major *= 10; parser->http_major += ch - '0'; if (parser->http_major > 999) goto error; break; } /* first digit of minor HTTP version */ case s_req_first_http_minor: if (ch < '0' || ch > '9') goto error; parser->http_minor = ch - '0'; state = s_req_http_minor; break; /* minor HTTP version or end of request line */ case s_req_http_minor: { if (ch == CR) { state = s_req_line_almost_done; break; } if (ch == LF) { state = s_header_field_start; break; } /* XXX allow spaces after digit? */ if (ch < '0' || ch > '9') goto error; parser->http_minor *= 10; parser->http_minor += ch - '0'; if (parser->http_minor > 999) goto error; break; } /* end of request line */ case s_req_line_almost_done: { if (ch != LF) goto error; state = s_header_field_start; break; } case s_header_field_start: { if (ch == CR) { state = s_headers_almost_done; break; } if (ch == LF) { /* they might be just sending \n instead of \r\n so this would be * the second \n to denote the end of headers*/ state = s_headers_almost_done; goto headers_almost_done; } c = TOKEN(ch); if (!c) goto error; MARK(header_field); index = 0; state = s_header_field; switch (c) { case 'c': header_state = h_C; break; case 'p': header_state = h_matching_proxy_connection; break; case 't': header_state = h_matching_transfer_encoding; break; case 'u': header_state = h_matching_upgrade; break; default: header_state = h_general; break; } break; } case s_header_field: { c = TOKEN(ch); if (c) { switch (header_state) { case h_general: break; case h_C: index++; header_state = (c == 'o' ? h_CO : h_general); break; case h_CO: index++; header_state = (c == 'n' ? h_CON : h_general); break; case h_CON: index++; switch (c) { case 'n': header_state = h_matching_connection; break; case 't': header_state = h_matching_content_length; break; default: header_state = h_general; break; } break; /* connection */ case h_matching_connection: index++; if (index > sizeof(CONNECTION)-1 || c != CONNECTION[index]) { header_state = h_general; } else if (index == sizeof(CONNECTION)-2) { header_state = h_connection; } break; /* proxy-connection */ case h_matching_proxy_connection: index++; if (index > sizeof(PROXY_CONNECTION)-1 || c != PROXY_CONNECTION[index]) { header_state = h_general; } else if (index == sizeof(PROXY_CONNECTION)-2) { header_state = h_connection; } break; /* content-length */ case h_matching_content_length: index++; if (index > sizeof(CONTENT_LENGTH)-1 || c != CONTENT_LENGTH[index]) { header_state = h_general; } else if (index == sizeof(CONTENT_LENGTH)-2) { header_state = h_content_length; } break; /* transfer-encoding */ case h_matching_transfer_encoding: index++; if (index > sizeof(TRANSFER_ENCODING)-1 || c != TRANSFER_ENCODING[index]) { header_state = h_general; } else if (index == sizeof(TRANSFER_ENCODING)-2) { header_state = h_transfer_encoding; } break; /* upgrade */ case h_matching_upgrade: index++; if (index > sizeof(UPGRADE)-1 || c != UPGRADE[index]) { header_state = h_general; } else if (index == sizeof(UPGRADE)-2) { header_state = h_upgrade; } break; case h_connection: case h_content_length: case h_transfer_encoding: case h_upgrade: if (ch != ' ') header_state = h_general; break; default: assert(0 && "Unknown header_state"); break; } break; } if (ch == ':') { CALLBACK(header_field); state = s_header_value_start; break; } if (ch == CR) { state = s_header_almost_done; CALLBACK(header_field); break; } if (ch == LF) { CALLBACK(header_field); state = s_header_field_start; break; } goto error; } case s_header_value_start: { if (ch == ' ') break; MARK(header_value); state = s_header_value; index = 0; c = LOWER(ch); if (ch == CR) { CALLBACK(header_value); header_state = h_general; state = s_header_almost_done; break; } if (ch == LF) { CALLBACK(header_value); state = s_header_field_start; break; } switch (header_state) { case h_upgrade: parser->flags |= F_UPGRADE; header_state = h_general; break; case h_transfer_encoding: /* looking for 'Transfer-Encoding: chunked' */ if ('c' == c) { header_state = h_matching_transfer_encoding_chunked; } else { header_state = h_general; } break; case h_content_length: if (ch < '0' || ch > '9') goto error; parser->content_length = ch - '0'; break; case h_connection: /* looking for 'Connection: keep-alive' */ if (c == 'k') { header_state = h_matching_connection_keep_alive; /* looking for 'Connection: close' */ } else if (c == 'c') { header_state = h_matching_connection_close; } else { header_state = h_general; } break; default: header_state = h_general; break; } break; } case s_header_value: { c = LOWER(ch); if (ch == CR) { CALLBACK(header_value); state = s_header_almost_done; break; } if (ch == LF) { CALLBACK(header_value); goto header_almost_done; } switch (header_state) { case h_general: break; case h_connection: case h_transfer_encoding: assert(0 && "Shouldn't get here."); break; case h_content_length: if (ch == ' ') break; if (ch < '0' || ch > '9') goto error; parser->content_length *= 10; parser->content_length += ch - '0'; break; /* Transfer-Encoding: chunked */ case h_matching_transfer_encoding_chunked: index++; if (index > sizeof(CHUNKED)-1 || c != CHUNKED[index]) { header_state = h_general; } else if (index == sizeof(CHUNKED)-2) { header_state = h_transfer_encoding_chunked; } break; /* looking for 'Connection: keep-alive' */ case h_matching_connection_keep_alive: index++; if (index > sizeof(KEEP_ALIVE)-1 || c != KEEP_ALIVE[index]) { header_state = h_general; } else if (index == sizeof(KEEP_ALIVE)-2) { header_state = h_connection_keep_alive; } break; /* looking for 'Connection: close' */ case h_matching_connection_close: index++; if (index > sizeof(CLOSE)-1 || c != CLOSE[index]) { header_state = h_general; } else if (index == sizeof(CLOSE)-2) { header_state = h_connection_close; } break; case h_transfer_encoding_chunked: case h_connection_keep_alive: case h_connection_close: if (ch != ' ') header_state = h_general; break; default: state = s_header_value; header_state = h_general; break; } break; } case s_header_almost_done: header_almost_done: { STRICT_CHECK(ch != LF); state = s_header_field_start; switch (header_state) { case h_connection_keep_alive: parser->flags |= F_CONNECTION_KEEP_ALIVE; break; case h_connection_close: parser->flags |= F_CONNECTION_CLOSE; break; case h_transfer_encoding_chunked: parser->flags |= F_CHUNKED; break; default: break; } break; } case s_headers_almost_done: headers_almost_done: { STRICT_CHECK(ch != LF); if (parser->flags & F_TRAILING) { /* End of a chunked request */ CALLBACK2(message_complete); state = NEW_MESSAGE(); break; } nread = 0; if (parser->flags & F_UPGRADE || parser->method == PHP_HTTP_CONNECT) { parser->upgrade = 1; } /* Here we call the headers_complete callback. This is somewhat * different than other callbacks because if the user returns 1, we * will interpret that as saying that this message has no body. This * is needed for the annoying case of receiving a response to a HEAD * request. */ if (settings->on_headers_complete) { switch (settings->on_headers_complete(parser)) { case 0: break; case 1: parser->flags |= F_SKIPBODY; break; default: return p - data; /* Error */ } } /* Exit, the rest of the connect is in a different protocol. */ if (parser->upgrade) { CALLBACK2(message_complete); return (p - data); } if (parser->flags & F_SKIPBODY) { CALLBACK2(message_complete); state = NEW_MESSAGE(); } else if (parser->flags & F_CHUNKED) { /* chunked encoding - ignore Content-Length header */ state = s_chunk_size_start; } else { if (parser->content_length == 0) { /* Content-Length header given but zero: Content-Length: 0\r\n */ CALLBACK2(message_complete); state = NEW_MESSAGE(); } else if (parser->content_length > 0) { /* Content-Length header given and non-zero */ state = s_body_identity; } else { if (parser->type == PHP_HTTP_REQUEST || php_http_should_keep_alive(parser)) { /* Assume content-length 0 - read the next */ CALLBACK2(message_complete); state = NEW_MESSAGE(); } else { /* Read body until EOF */ state = s_body_identity_eof; } } } break; } case s_body_identity: to_read = MIN(pe - p, (size_t)parser->content_length); if (to_read > 0) { if (settings->on_body) settings->on_body(parser, p, to_read); p += to_read - 1; parser->content_length -= to_read; if (parser->content_length == 0) { CALLBACK2(message_complete); state = NEW_MESSAGE(); } } break; /* read until EOF */ case s_body_identity_eof: to_read = pe - p; if (to_read > 0) { if (settings->on_body) settings->on_body(parser, p, to_read); p += to_read - 1; } break; case s_chunk_size_start: { assert(parser->flags & F_CHUNKED); c = unhex[(unsigned char)ch]; if (c == -1) goto error; parser->content_length = c; state = s_chunk_size; break; } case s_chunk_size: { assert(parser->flags & F_CHUNKED); if (ch == CR) { state = s_chunk_size_almost_done; break; } c = unhex[(unsigned char)ch]; if (c == -1) { if (ch == ';' || ch == ' ') { state = s_chunk_parameters; break; } goto error; } parser->content_length *= 16; parser->content_length += c; break; } case s_chunk_parameters: { assert(parser->flags & F_CHUNKED); /* just ignore this shit. TODO check for overflow */ if (ch == CR) { state = s_chunk_size_almost_done; break; } break; } case s_chunk_size_almost_done: { assert(parser->flags & F_CHUNKED); STRICT_CHECK(ch != LF); if (parser->content_length == 0) { parser->flags |= F_TRAILING; state = s_header_field_start; } else { state = s_chunk_data; } break; } case s_chunk_data: { assert(parser->flags & F_CHUNKED); to_read = MIN(pe - p, (size_t)(parser->content_length)); if (to_read > 0) { if (settings->on_body) settings->on_body(parser, p, to_read); p += to_read - 1; } if (to_read == parser->content_length) { state = s_chunk_data_almost_done; } parser->content_length -= to_read; break; } case s_chunk_data_almost_done: assert(parser->flags & F_CHUNKED); STRICT_CHECK(ch != CR); state = s_chunk_data_done; break; case s_chunk_data_done: assert(parser->flags & F_CHUNKED); STRICT_CHECK(ch != LF); state = s_chunk_size_start; break; default: assert(0 && "unhandled state"); goto error; } } CALLBACK_NOCLEAR(header_field); CALLBACK_NOCLEAR(header_value); CALLBACK_NOCLEAR(fragment); CALLBACK_NOCLEAR(query_string); CALLBACK_NOCLEAR(path); CALLBACK_NOCLEAR(url); parser->state = state; parser->header_state = header_state; parser->index = index; parser->nread = nread; return len; error: parser->state = s_dead; return (p - data); } int php_http_should_keep_alive (php_http_parser *parser) { if (parser->http_major > 0 && parser->http_minor > 0) { /* HTTP/1.1 */ if (parser->flags & F_CONNECTION_CLOSE) { return 0; } else { return 1; } } else { /* HTTP/1.0 or earlier */ if (parser->flags & F_CONNECTION_KEEP_ALIVE) { return 1; } else { return 0; } } } const char * php_http_method_str (enum php_http_method m) { return method_strings[m]; } void php_http_parser_init (php_http_parser *parser, enum php_http_parser_type t) { parser->type = t; parser->state = (t == PHP_HTTP_REQUEST ? s_start_req : (t == PHP_HTTP_RESPONSE ? s_start_res : s_start_req_or_res)); parser->nread = 0; parser->upgrade = 0; parser->flags = 0; parser->method = 0; } PK!>php-5.6.40/sapi/cli/cli.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Johannes Schlueter | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef CLI_H #define CLI_H #ifdef PHP_WIN32 # define PHP_CLI_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_CLI_API __attribute__ ((visibility("default"))) #else # define PHP_CLI_API #endif extern PHP_CLI_API size_t sapi_cli_single_write(const char *str, uint str_length TSRMLS_DC); typedef struct { size_t (*cli_shell_write)(const char *str, uint str_length TSRMLS_DC); int (*cli_shell_ub_write)(const char *str, uint str_length TSRMLS_DC); int (*cli_shell_run)(TSRMLS_D); } cli_shell_callbacks_t; extern PHP_CLI_API cli_shell_callbacks_t *php_cli_get_shell_callbacks(); #endif /* CLI_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK!~~php-5.6.40/sapi/cgi/fastcgi.hnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ */ /* $Id$ */ /* FastCGI protocol */ #define FCGI_VERSION_1 1 #define FCGI_MAX_LENGTH 0xffff #define FCGI_KEEP_CONN 1 /* this is near the perfect hash function for most useful FastCGI variables * which combines efficiency and minimal hash collisions */ #define FCGI_HASH_FUNC(var, var_len) \ (UNEXPECTED(var_len < 3) ? var_len : \ (((unsigned int)var[3]) << 2) + \ (((unsigned int)var[var_len-2]) << 4) + \ (((unsigned int)var[var_len-1]) << 2) + \ var_len) #define FCGI_GETENV(request, name) \ fcgi_quick_getenv(request, name, sizeof(name)-1, FCGI_HASH_FUNC(name, sizeof(name)-1)) #define FCGI_PUTENV(request, name, value) \ fcgi_quick_putenv(request, name, sizeof(name)-1, FCGI_HASH_FUNC(name, sizeof(name)-1), value) typedef enum _fcgi_role { FCGI_RESPONDER = 1, FCGI_AUTHORIZER = 2, FCGI_FILTER = 3 } fcgi_role; typedef enum _fcgi_request_type { FCGI_BEGIN_REQUEST = 1, /* [in] */ FCGI_ABORT_REQUEST = 2, /* [in] (not supported) */ FCGI_END_REQUEST = 3, /* [out] */ FCGI_PARAMS = 4, /* [in] environment variables */ FCGI_STDIN = 5, /* [in] post data */ FCGI_STDOUT = 6, /* [out] response */ FCGI_STDERR = 7, /* [out] errors */ FCGI_DATA = 8, /* [in] filter data (not supported) */ FCGI_GET_VALUES = 9, /* [in] */ FCGI_GET_VALUES_RESULT = 10 /* [out] */ } fcgi_request_type; typedef enum _fcgi_protocol_status { FCGI_REQUEST_COMPLETE = 0, FCGI_CANT_MPX_CONN = 1, FCGI_OVERLOADED = 2, FCGI_UNKNOWN_ROLE = 3 } dcgi_protocol_status; typedef struct _fcgi_header { unsigned char version; unsigned char type; unsigned char requestIdB1; unsigned char requestIdB0; unsigned char contentLengthB1; unsigned char contentLengthB0; unsigned char paddingLength; unsigned char reserved; } fcgi_header; typedef struct _fcgi_begin_request { unsigned char roleB1; unsigned char roleB0; unsigned char flags; unsigned char reserved[5]; } fcgi_begin_request; typedef struct _fcgi_begin_request_rec { fcgi_header hdr; fcgi_begin_request body; } fcgi_begin_request_rec; typedef struct _fcgi_end_request { unsigned char appStatusB3; unsigned char appStatusB2; unsigned char appStatusB1; unsigned char appStatusB0; unsigned char protocolStatus; unsigned char reserved[3]; } fcgi_end_request; typedef struct _fcgi_end_request_rec { fcgi_header hdr; fcgi_end_request body; } fcgi_end_request_rec; /* FastCGI client API */ typedef void (*fcgi_apply_func)(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC); typedef struct _fcgi_request fcgi_request; int fcgi_init(void); void fcgi_shutdown(void); int fcgi_is_fastcgi(void); int fcgi_in_shutdown(void); void fcgi_terminate(void); int fcgi_listen(const char *path, int backlog); fcgi_request* fcgi_init_request(int listen_socket); void fcgi_destroy_request(fcgi_request *req); int fcgi_accept_request(fcgi_request *req); int fcgi_finish_request(fcgi_request *req, int force_close); char* fcgi_getenv(fcgi_request *req, const char* var, int var_len); char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val); char* fcgi_quick_getenv(fcgi_request *req, const char* var, int var_len, unsigned int hash_value); char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int hash_value, char* val); void fcgi_loadenv(fcgi_request *req, fcgi_apply_func load_func, zval *array TSRMLS_DC); int fcgi_read(fcgi_request *req, char *str, int len); int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len); int fcgi_flush(fcgi_request *req, int close); #ifdef PHP_WIN32 void fcgi_impersonate(void); #endif void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len); void fcgi_free_mgmt_var_cb(void * ptr); /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!R??php-5.6.40/sapi/cgi/fastcgi.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Dmitry Stogov | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "php.h" #include "fastcgi.h" #include #include #include #include #include #ifndef MAXFQDNLEN #define MAXFQDNLEN 255 #endif #ifdef _WIN32 #include typedef unsigned int in_addr_t; struct sockaddr_un { short sun_family; char sun_path[MAXPATHLEN]; }; static HANDLE fcgi_accept_mutex = INVALID_HANDLE_VALUE; static int is_impersonate = 0; #define FCGI_LOCK(fd) \ if (fcgi_accept_mutex != INVALID_HANDLE_VALUE) { \ DWORD ret; \ while ((ret = WaitForSingleObject(fcgi_accept_mutex, 1000)) == WAIT_TIMEOUT) { \ if (in_shutdown) return -1; \ } \ if (ret == WAIT_FAILED) { \ fprintf(stderr, "WaitForSingleObject() failed\n"); \ return -1; \ } \ } #define FCGI_UNLOCK(fd) \ if (fcgi_accept_mutex != INVALID_HANDLE_VALUE) { \ ReleaseMutex(fcgi_accept_mutex); \ } #else # include # include # include # include # include # include # include # include # include # include # include # define closesocket(s) close(s) # if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) # include # endif # if defined(HAVE_SYS_SELECT_H) # include # endif #ifndef INADDR_NONE #define INADDR_NONE ((unsigned long) -1) #endif # ifndef HAVE_SOCKLEN_T typedef unsigned int socklen_t; # endif # ifdef USE_LOCKING # define FCGI_LOCK(fd) \ do { \ struct flock lock; \ lock.l_type = F_WRLCK; \ lock.l_start = 0; \ lock.l_whence = SEEK_SET; \ lock.l_len = 0; \ if (fcntl(fd, F_SETLKW, &lock) != -1) { \ break; \ } else if (errno != EINTR || in_shutdown) { \ return -1; \ } \ } while (1) # define FCGI_UNLOCK(fd) \ do { \ int orig_errno = errno; \ while (1) { \ struct flock lock; \ lock.l_type = F_UNLCK; \ lock.l_start = 0; \ lock.l_whence = SEEK_SET; \ lock.l_len = 0; \ if (fcntl(fd, F_SETLK, &lock) != -1) { \ break; \ } else if (errno != EINTR) { \ return -1; \ } \ } \ errno = orig_errno; \ } while (0) # else # define FCGI_LOCK(fd) # define FCGI_UNLOCK(fd) # endif #endif typedef union _sa_t { struct sockaddr sa; struct sockaddr_un sa_unix; struct sockaddr_in sa_inet; } sa_t; static HashTable fcgi_mgmt_vars; static int is_initialized = 0; static int is_fastcgi = 0; static int in_shutdown = 0; static in_addr_t *allowed_clients = NULL; /* hash table */ #define FCGI_HASH_TABLE_SIZE 128 #define FCGI_HASH_TABLE_MASK (FCGI_HASH_TABLE_SIZE - 1) #define FCGI_HASH_SEG_SIZE 4096 typedef struct _fcgi_hash_bucket { unsigned int hash_value; unsigned int var_len; char *var; unsigned int val_len; char *val; struct _fcgi_hash_bucket *next; struct _fcgi_hash_bucket *list_next; } fcgi_hash_bucket; typedef struct _fcgi_hash_buckets { unsigned int idx; struct _fcgi_hash_buckets *next; struct _fcgi_hash_bucket data[FCGI_HASH_TABLE_SIZE]; } fcgi_hash_buckets; typedef struct _fcgi_data_seg { char *pos; char *end; struct _fcgi_data_seg *next; char data[1]; } fcgi_data_seg; typedef struct _fcgi_hash { fcgi_hash_bucket *hash_table[FCGI_HASH_TABLE_SIZE]; fcgi_hash_bucket *list; fcgi_hash_buckets *buckets; fcgi_data_seg *data; } fcgi_hash; static void fcgi_hash_init(fcgi_hash *h) { memset(h->hash_table, 0, sizeof(h->hash_table)); h->list = NULL; h->buckets = (fcgi_hash_buckets*)malloc(sizeof(fcgi_hash_buckets)); h->buckets->idx = 0; h->buckets->next = NULL; h->data = (fcgi_data_seg*)malloc(sizeof(fcgi_data_seg) - 1 + FCGI_HASH_SEG_SIZE); h->data->pos = h->data->data; h->data->end = h->data->pos + FCGI_HASH_SEG_SIZE; h->data->next = NULL; } static void fcgi_hash_destroy(fcgi_hash *h) { fcgi_hash_buckets *b; fcgi_data_seg *p; b = h->buckets; while (b) { fcgi_hash_buckets *q = b; b = b->next; free(q); } p = h->data; while (p) { fcgi_data_seg *q = p; p = p->next; free(q); } } static void fcgi_hash_clean(fcgi_hash *h) { memset(h->hash_table, 0, sizeof(h->hash_table)); h->list = NULL; /* delete all bucket blocks except the first one */ while (h->buckets->next) { fcgi_hash_buckets *q = h->buckets; h->buckets = h->buckets->next; free(q); } h->buckets->idx = 0; /* delete all data segments except the first one */ while (h->data->next) { fcgi_data_seg *q = h->data; h->data = h->data->next; free(q); } h->data->pos = h->data->data; } static inline char* fcgi_hash_strndup(fcgi_hash *h, char *str, unsigned int str_len) { char *ret; if (UNEXPECTED(h->data->pos + str_len + 1 >= h->data->end)) { unsigned int seg_size = (str_len + 1 > FCGI_HASH_SEG_SIZE) ? str_len + 1 : FCGI_HASH_SEG_SIZE; fcgi_data_seg *p = (fcgi_data_seg*)malloc(sizeof(fcgi_data_seg) - 1 + seg_size); p->pos = p->data; p->end = p->pos + seg_size; p->next = h->data; h->data = p; } ret = h->data->pos; memcpy(ret, str, str_len); ret[str_len] = 0; h->data->pos += str_len + 1; return ret; } static char* fcgi_hash_set(fcgi_hash *h, unsigned int hash_value, char *var, unsigned int var_len, char *val, unsigned int val_len) { unsigned int idx = hash_value & FCGI_HASH_TABLE_MASK; fcgi_hash_bucket *p = h->hash_table[idx]; while (UNEXPECTED(p != NULL)) { if (UNEXPECTED(p->hash_value == hash_value) && p->var_len == var_len && memcmp(p->var, var, var_len) == 0) { p->val_len = val_len; p->val = fcgi_hash_strndup(h, val, val_len); return p->val; } p = p->next; } if (UNEXPECTED(h->buckets->idx >= FCGI_HASH_TABLE_SIZE)) { fcgi_hash_buckets *b = (fcgi_hash_buckets*)malloc(sizeof(fcgi_hash_buckets)); b->idx = 0; b->next = h->buckets; h->buckets = b; } p = h->buckets->data + h->buckets->idx; h->buckets->idx++; p->next = h->hash_table[idx]; h->hash_table[idx] = p; p->list_next = h->list; h->list = p; p->hash_value = hash_value; p->var_len = var_len; p->var = fcgi_hash_strndup(h, var, var_len); p->val_len = val_len; p->val = fcgi_hash_strndup(h, val, val_len); return p->val; } static void fcgi_hash_del(fcgi_hash *h, unsigned int hash_value, char *var, unsigned int var_len) { unsigned int idx = hash_value & FCGI_HASH_TABLE_MASK; fcgi_hash_bucket **p = &h->hash_table[idx]; while (*p != NULL) { if ((*p)->hash_value == hash_value && (*p)->var_len == var_len && memcmp((*p)->var, var, var_len) == 0) { (*p)->val = NULL; /* NULL value means deleted */ (*p)->val_len = 0; *p = (*p)->next; return; } p = &(*p)->next; } } static char *fcgi_hash_get(fcgi_hash *h, unsigned int hash_value, char *var, unsigned int var_len, unsigned int *val_len) { unsigned int idx = hash_value & FCGI_HASH_TABLE_MASK; fcgi_hash_bucket *p = h->hash_table[idx]; while (p != NULL) { if (p->hash_value == hash_value && p->var_len == var_len && memcmp(p->var, var, var_len) == 0) { *val_len = p->val_len; return p->val; } p = p->next; } return NULL; } static void fcgi_hash_apply(fcgi_hash *h, fcgi_apply_func func, void *arg TSRMLS_DC) { fcgi_hash_bucket *p = h->list; while (p) { if (EXPECTED(p->val != NULL)) { func(p->var, p->var_len, p->val, p->val_len, arg TSRMLS_CC); } p = p->list_next; } } struct _fcgi_request { int listen_socket; int tcp; int fd; int id; int keep; #ifdef TCP_NODELAY int nodelay; #endif int closed; int in_len; int in_pad; fcgi_header *out_hdr; unsigned char *out_pos; unsigned char out_buf[1024*8]; unsigned char reserved[sizeof(fcgi_end_request_rec)]; int has_env; fcgi_hash env; }; #ifdef _WIN32 static DWORD WINAPI fcgi_shutdown_thread(LPVOID arg) { HANDLE shutdown_event = (HANDLE) arg; WaitForSingleObject(shutdown_event, INFINITE); in_shutdown = 1; return 0; } #else static void fcgi_signal_handler(int signo) { if (signo == SIGUSR1 || signo == SIGTERM) { in_shutdown = 1; } } static void fcgi_setup_signals(void) { struct sigaction new_sa, old_sa; sigemptyset(&new_sa.sa_mask); new_sa.sa_flags = 0; new_sa.sa_handler = fcgi_signal_handler; sigaction(SIGUSR1, &new_sa, NULL); sigaction(SIGTERM, &new_sa, NULL); sigaction(SIGPIPE, NULL, &old_sa); if (old_sa.sa_handler == SIG_DFL) { sigaction(SIGPIPE, &new_sa, NULL); } } #endif int fcgi_in_shutdown(void) { return in_shutdown; } void fcgi_terminate(void) { in_shutdown = 1; } int fcgi_init(void) { if (!is_initialized) { #ifndef _WIN32 sa_t sa; socklen_t len = sizeof(sa); #endif zend_hash_init(&fcgi_mgmt_vars, 0, NULL, fcgi_free_mgmt_var_cb, 1); fcgi_set_mgmt_var("FCGI_MPXS_CONNS", sizeof("FCGI_MPXS_CONNS")-1, "0", sizeof("0")-1); is_initialized = 1; #ifdef _WIN32 # if 0 /* TODO: Support for TCP sockets */ WSADATA wsaData; if (WSAStartup(MAKEWORD(2,0), &wsaData)) { fprintf(stderr, "Error starting Windows Sockets. Error: %d", WSAGetLastError()); return 0; } # endif if ((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) && (GetStdHandle(STD_ERROR_HANDLE) == INVALID_HANDLE_VALUE) && (GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE)) { char *str; DWORD pipe_mode = PIPE_READMODE_BYTE | PIPE_WAIT; HANDLE pipe = GetStdHandle(STD_INPUT_HANDLE); SetNamedPipeHandleState(pipe, &pipe_mode, NULL, NULL); str = getenv("_FCGI_SHUTDOWN_EVENT_"); if (str != NULL) { HANDLE shutdown_event = (HANDLE) atoi(str); if (!CreateThread(NULL, 0, fcgi_shutdown_thread, shutdown_event, 0, NULL)) { return -1; } } str = getenv("_FCGI_MUTEX_"); if (str != NULL) { fcgi_accept_mutex = (HANDLE) atoi(str); } return is_fastcgi = 1; } else { return is_fastcgi = 0; } #else errno = 0; if (getpeername(0, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) { fcgi_setup_signals(); return is_fastcgi = 1; } else { return is_fastcgi = 0; } #endif } return is_fastcgi; } int fcgi_is_fastcgi(void) { if (!is_initialized) { return fcgi_init(); } else { return is_fastcgi; } } void fcgi_shutdown(void) { if (is_initialized) { zend_hash_destroy(&fcgi_mgmt_vars); } is_fastcgi = 0; if (allowed_clients) { free(allowed_clients); } } #ifdef _WIN32 /* Do some black magic with the NT security API. * We prepare a DACL (Discretionary Access Control List) so that * we, the creator, are allowed all access, while "Everyone Else" * is only allowed to read and write to the pipe. * This avoids security issues on shared hosts where a luser messes * with the lower-level pipe settings and screws up the FastCGI service. */ static PACL prepare_named_pipe_acl(PSECURITY_DESCRIPTOR sd, LPSECURITY_ATTRIBUTES sa) { DWORD req_acl_size; char everyone_buf[32], owner_buf[32]; PSID sid_everyone, sid_owner; SID_IDENTIFIER_AUTHORITY siaWorld = SECURITY_WORLD_SID_AUTHORITY, siaCreator = SECURITY_CREATOR_SID_AUTHORITY; PACL acl; sid_everyone = (PSID)&everyone_buf; sid_owner = (PSID)&owner_buf; req_acl_size = sizeof(ACL) + (2 * ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + GetSidLengthRequired(1))); acl = malloc(req_acl_size); if (acl == NULL) { return NULL; } if (!InitializeSid(sid_everyone, &siaWorld, 1)) { goto out_fail; } *GetSidSubAuthority(sid_everyone, 0) = SECURITY_WORLD_RID; if (!InitializeSid(sid_owner, &siaCreator, 1)) { goto out_fail; } *GetSidSubAuthority(sid_owner, 0) = SECURITY_CREATOR_OWNER_RID; if (!InitializeAcl(acl, req_acl_size, ACL_REVISION)) { goto out_fail; } if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_GENERIC_READ | FILE_GENERIC_WRITE, sid_everyone)) { goto out_fail; } if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_ALL_ACCESS, sid_owner)) { goto out_fail; } if (!InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) { goto out_fail; } if (!SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE)) { goto out_fail; } sa->lpSecurityDescriptor = sd; return acl; out_fail: free(acl); return NULL; } #endif static int is_port_number(const char *bindpath) { while (*bindpath) { if (*bindpath < '0' || *bindpath > '9') { return 0; } bindpath++; } return 1; } int fcgi_listen(const char *path, int backlog) { char *s; int tcp = 0; char host[MAXPATHLEN]; short port = 0; int listen_socket; sa_t sa; socklen_t sock_len; #ifdef SO_REUSEADDR # ifdef _WIN32 BOOL reuse = 1; # else int reuse = 1; # endif #endif if ((s = strchr(path, ':'))) { port = atoi(s+1); if (port != 0 && (s-path) < MAXPATHLEN) { strncpy(host, path, s-path); host[s-path] = '\0'; tcp = 1; } } else if (is_port_number(path)) { port = atoi(path); if (port != 0) { host[0] = '\0'; tcp = 1; } } /* Prepare socket address */ if (tcp) { memset(&sa.sa_inet, 0, sizeof(sa.sa_inet)); sa.sa_inet.sin_family = AF_INET; sa.sa_inet.sin_port = htons(port); sock_len = sizeof(sa.sa_inet); if (!*host || !strncmp(host, "*", sizeof("*")-1)) { sa.sa_inet.sin_addr.s_addr = htonl(INADDR_ANY); } else { sa.sa_inet.sin_addr.s_addr = inet_addr(host); if (sa.sa_inet.sin_addr.s_addr == INADDR_NONE) { struct hostent *hep; if(strlen(host) > MAXFQDNLEN) { hep = NULL; } else { hep = gethostbyname(host); } if (!hep || hep->h_addrtype != AF_INET || !hep->h_addr_list[0]) { fprintf(stderr, "Cannot resolve host name '%s'!\n", host); return -1; } else if (hep->h_addr_list[1]) { fprintf(stderr, "Host '%s' has multiple addresses. You must choose one explicitly!\n", host); return -1; } sa.sa_inet.sin_addr.s_addr = ((struct in_addr*)hep->h_addr_list[0])->s_addr; } } } else { #ifdef _WIN32 SECURITY_DESCRIPTOR sd; SECURITY_ATTRIBUTES saw; PACL acl; HANDLE namedPipe; memset(&sa, 0, sizeof(saw)); saw.nLength = sizeof(saw); saw.bInheritHandle = FALSE; acl = prepare_named_pipe_acl(&sd, &saw); namedPipe = CreateNamedPipe(path, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_READMODE_BYTE, PIPE_UNLIMITED_INSTANCES, 8192, 8192, 0, &saw); if (namedPipe == INVALID_HANDLE_VALUE) { return -1; } listen_socket = _open_osfhandle((long)namedPipe, 0); if (!is_initialized) { fcgi_init(); } is_fastcgi = 1; return listen_socket; #else int path_len = strlen(path); if (path_len >= sizeof(sa.sa_unix.sun_path)) { fprintf(stderr, "Listening socket's path name is too long.\n"); return -1; } memset(&sa.sa_unix, 0, sizeof(sa.sa_unix)); sa.sa_unix.sun_family = AF_UNIX; memcpy(sa.sa_unix.sun_path, path, path_len + 1); sock_len = (size_t)(((struct sockaddr_un *)0)->sun_path) + path_len; #ifdef HAVE_SOCKADDR_UN_SUN_LEN sa.sa_unix.sun_len = sock_len; #endif unlink(path); #endif } /* Create, bind socket and start listen on it */ if ((listen_socket = socket(sa.sa.sa_family, SOCK_STREAM, 0)) < 0 || #ifdef SO_REUSEADDR setsockopt(listen_socket, SOL_SOCKET, SO_REUSEADDR, (char*)&reuse, sizeof(reuse)) < 0 || #endif bind(listen_socket, (struct sockaddr *) &sa, sock_len) < 0 || listen(listen_socket, backlog) < 0) { fprintf(stderr, "Cannot bind/listen socket - [%d] %s.\n",errno, strerror(errno)); return -1; } if (!tcp) { chmod(path, 0777); } else { char *ip = getenv("FCGI_WEB_SERVER_ADDRS"); char *cur, *end; int n; if (ip) { ip = strdup(ip); cur = ip; n = 0; while (*cur) { if (*cur == ',') n++; cur++; } allowed_clients = malloc(sizeof(in_addr_t) * (n+2)); n = 0; cur = ip; while (cur) { end = strchr(cur, ','); if (end) { *end = 0; end++; } allowed_clients[n] = inet_addr(cur); if (allowed_clients[n] == INADDR_NONE) { fprintf(stderr, "Wrong IP address '%s' in FCGI_WEB_SERVER_ADDRS\n", cur); } n++; cur = end; } allowed_clients[n] = INADDR_NONE; free(ip); } } if (!is_initialized) { fcgi_init(); } is_fastcgi = 1; #ifdef _WIN32 if (tcp) { listen_socket = _open_osfhandle((long)listen_socket, 0); } #else fcgi_setup_signals(); #endif return listen_socket; } fcgi_request *fcgi_init_request(int listen_socket) { fcgi_request *req = (fcgi_request*)calloc(1, sizeof(fcgi_request)); req->listen_socket = listen_socket; req->fd = -1; req->id = -1; req->in_len = 0; req->in_pad = 0; req->out_hdr = NULL; req->out_pos = req->out_buf; #ifdef _WIN32 req->tcp = !GetNamedPipeInfo((HANDLE)_get_osfhandle(req->listen_socket), NULL, NULL, NULL, NULL); #endif #ifdef TCP_NODELAY req->nodelay = 0; #endif fcgi_hash_init(&req->env); return req; } void fcgi_destroy_request(fcgi_request *req) { fcgi_hash_destroy(&req->env); free(req); } static inline ssize_t safe_write(fcgi_request *req, const void *buf, size_t count) { int ret; size_t n = 0; do { errno = 0; #ifdef _WIN32 if (!req->tcp) { ret = write(req->fd, ((char*)buf)+n, count-n); } else { ret = send(req->fd, ((char*)buf)+n, count-n, 0); if (ret <= 0) { errno = WSAGetLastError(); } } #else ret = write(req->fd, ((char*)buf)+n, count-n); #endif if (ret > 0) { n += ret; } else if (ret <= 0 && errno != 0 && errno != EINTR) { return ret; } } while (n != count); return n; } static inline ssize_t safe_read(fcgi_request *req, const void *buf, size_t count) { int ret; size_t n = 0; do { errno = 0; #ifdef _WIN32 if (!req->tcp) { ret = read(req->fd, ((char*)buf)+n, count-n); } else { ret = recv(req->fd, ((char*)buf)+n, count-n, 0); if (ret <= 0) { errno = WSAGetLastError(); } } #else ret = read(req->fd, ((char*)buf)+n, count-n); #endif if (ret > 0) { n += ret; } else if (ret == 0 && errno == 0) { return n; } else if (ret <= 0 && errno != 0 && errno != EINTR) { return ret; } } while (n != count); return n; } static inline int fcgi_make_header(fcgi_header *hdr, fcgi_request_type type, int req_id, int len) { int pad = ((len + 7) & ~7) - len; hdr->contentLengthB0 = (unsigned char)(len & 0xff); hdr->contentLengthB1 = (unsigned char)((len >> 8) & 0xff); hdr->paddingLength = (unsigned char)pad; hdr->requestIdB0 = (unsigned char)(req_id & 0xff); hdr->requestIdB1 = (unsigned char)((req_id >> 8) & 0xff); hdr->reserved = 0; hdr->type = type; hdr->version = FCGI_VERSION_1; if (pad) { memset(((unsigned char*)hdr) + sizeof(fcgi_header) + len, 0, pad); } return pad; } static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end) { unsigned int name_len, val_len; while (p < end) { name_len = *p++; if (UNEXPECTED(name_len >= 128)) { if (UNEXPECTED(p + 3 >= end)) return 0; name_len = ((name_len & 0x7f) << 24); name_len |= (*p++ << 16); name_len |= (*p++ << 8); name_len |= *p++; } if (UNEXPECTED(p >= end)) return 0; val_len = *p++; if (UNEXPECTED(val_len >= 128)) { if (UNEXPECTED(p + 3 >= end)) return 0; val_len = ((val_len & 0x7f) << 24); val_len |= (*p++ << 16); val_len |= (*p++ << 8); val_len |= *p++; } if (UNEXPECTED(name_len + val_len > (unsigned int) (end - p))) { /* Malformated request */ return 0; } fcgi_hash_set(&req->env, FCGI_HASH_FUNC(p, name_len), (char*)p, name_len, (char*)p + name_len, val_len); p += name_len + val_len; } return 1; } static int fcgi_read_request(fcgi_request *req) { fcgi_header hdr; int len, padding; unsigned char buf[FCGI_MAX_LENGTH+8]; req->keep = 0; req->closed = 0; req->in_len = 0; req->out_hdr = NULL; req->out_pos = req->out_buf; req->has_env = 1; if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || hdr.version < FCGI_VERSION_1) { return 0; } len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; padding = hdr.paddingLength; while (hdr.type == FCGI_STDIN && len == 0) { if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || hdr.version < FCGI_VERSION_1) { return 0; } len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; padding = hdr.paddingLength; } if (len + padding > FCGI_MAX_LENGTH) { return 0; } req->id = (hdr.requestIdB1 << 8) + hdr.requestIdB0; if (hdr.type == FCGI_BEGIN_REQUEST && len == sizeof(fcgi_begin_request)) { if (safe_read(req, buf, len+padding) != len+padding) { return 0; } req->keep = (((fcgi_begin_request*)buf)->flags & FCGI_KEEP_CONN); #ifdef TCP_NODELAY if (req->keep && req->tcp && !req->nodelay) { # ifdef _WIN32 BOOL on = 1; # else int on = 1; # endif setsockopt(req->fd, IPPROTO_TCP, TCP_NODELAY, (char*)&on, sizeof(on)); req->nodelay = 1; } #endif switch ((((fcgi_begin_request*)buf)->roleB1 << 8) + ((fcgi_begin_request*)buf)->roleB0) { case FCGI_RESPONDER: fcgi_hash_set(&req->env, FCGI_HASH_FUNC("FCGI_ROLE", sizeof("FCGI_ROLE")-1), "FCGI_ROLE", sizeof("FCGI_ROLE")-1, "RESPONDER", sizeof("RESPONDER")-1); break; case FCGI_AUTHORIZER: fcgi_hash_set(&req->env, FCGI_HASH_FUNC("FCGI_ROLE", sizeof("FCGI_ROLE")-1), "FCGI_ROLE", sizeof("FCGI_ROLE")-1, "AUTHORIZER", sizeof("AUTHORIZER")-1); break; case FCGI_FILTER: fcgi_hash_set(&req->env, FCGI_HASH_FUNC("FCGI_ROLE", sizeof("FCGI_ROLE")-1), "FCGI_ROLE", sizeof("FCGI_ROLE")-1, "FILTER", sizeof("FILTER")-1); break; default: return 0; } if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || hdr.version < FCGI_VERSION_1) { return 0; } len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; padding = hdr.paddingLength; while (hdr.type == FCGI_PARAMS && len > 0) { if (len + padding > FCGI_MAX_LENGTH) { return 0; } if (safe_read(req, buf, len+padding) != len+padding) { req->keep = 0; return 0; } if (!fcgi_get_params(req, buf, buf+len)) { req->keep = 0; return 0; } if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || hdr.version < FCGI_VERSION_1) { req->keep = 0; return 0; } len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; padding = hdr.paddingLength; } } else if (hdr.type == FCGI_GET_VALUES) { unsigned char *p = buf + sizeof(fcgi_header); zval ** value; unsigned int zlen; fcgi_hash_bucket *q; if (safe_read(req, buf, len+padding) != len+padding) { req->keep = 0; return 0; } if (!fcgi_get_params(req, buf, buf+len)) { req->keep = 0; return 0; } q = req->env.list; while (q != NULL) { if (zend_hash_find(&fcgi_mgmt_vars, q->var, q->var_len, (void**) &value) != SUCCESS) { q = q->list_next; continue; } zlen = Z_STRLEN_PP(value); if ((p + 4 + 4 + q->var_len + zlen) >= (buf + sizeof(buf))) { break; } if (q->var_len < 0x80) { *p++ = q->var_len; } else { *p++ = ((q->var_len >> 24) & 0xff) | 0x80; *p++ = (q->var_len >> 16) & 0xff; *p++ = (q->var_len >> 8) & 0xff; *p++ = q->var_len & 0xff; } if (zlen < 0x80) { *p++ = zlen; } else { *p++ = ((zlen >> 24) & 0xff) | 0x80; *p++ = (zlen >> 16) & 0xff; *p++ = (zlen >> 8) & 0xff; *p++ = zlen & 0xff; } memcpy(p, q->var, q->var_len); p += q->var_len; memcpy(p, Z_STRVAL_PP(value), zlen); p += zlen; q = q->list_next; } len = p - buf - sizeof(fcgi_header); len += fcgi_make_header((fcgi_header*)buf, FCGI_GET_VALUES_RESULT, 0, len); if (safe_write(req, buf, sizeof(fcgi_header)+len) != (int)sizeof(fcgi_header)+len) { req->keep = 0; return 0; } return 0; } else { return 0; } return 1; } int fcgi_read(fcgi_request *req, char *str, int len) { int ret, n, rest; fcgi_header hdr; unsigned char buf[255]; n = 0; rest = len; while (rest > 0) { if (req->in_len == 0) { if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) || hdr.version < FCGI_VERSION_1 || hdr.type != FCGI_STDIN) { req->keep = 0; return 0; } req->in_len = (hdr.contentLengthB1 << 8) | hdr.contentLengthB0; req->in_pad = hdr.paddingLength; if (req->in_len == 0) { return n; } } if (req->in_len >= rest) { ret = safe_read(req, str, rest); } else { ret = safe_read(req, str, req->in_len); } if (ret < 0) { req->keep = 0; return ret; } else if (ret > 0) { req->in_len -= ret; rest -= ret; n += ret; str += ret; if (req->in_len == 0) { if (req->in_pad) { if (safe_read(req, buf, req->in_pad) != req->in_pad) { req->keep = 0; return ret; } } } else { return n; } } else { return n; } } return n; } static inline void fcgi_close(fcgi_request *req, int force, int destroy) { if (destroy && req->has_env) { fcgi_hash_clean(&req->env); req->has_env = 0; } #ifdef _WIN32 if (is_impersonate && !req->tcp) { RevertToSelf(); } #endif if ((force || !req->keep) && req->fd >= 0) { #ifdef _WIN32 if (!req->tcp) { HANDLE pipe = (HANDLE)_get_osfhandle(req->fd); if (!force) { FlushFileBuffers(pipe); } DisconnectNamedPipe(pipe); } else { if (!force) { fcgi_header buf; shutdown(req->fd, 1); /* read the last FCGI_STDIN header (it may be omitted) */ recv(req->fd, (char *)(&buf), sizeof(buf), 0); } closesocket(req->fd); } #else if (!force) { fcgi_header buf; shutdown(req->fd, 1); /* read the last FCGI_STDIN header (it may be omitted) */ recv(req->fd, (char *)(&buf), sizeof(buf), 0); } close(req->fd); #endif #ifdef TCP_NODELAY req->nodelay = 0; #endif req->fd = -1; } } int fcgi_accept_request(fcgi_request *req) { #ifdef _WIN32 HANDLE pipe; OVERLAPPED ov; #endif while (1) { if (req->fd < 0) { while (1) { if (in_shutdown) { return -1; } #ifdef _WIN32 if (!req->tcp) { pipe = (HANDLE)_get_osfhandle(req->listen_socket); FCGI_LOCK(req->listen_socket); ov.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if (!ConnectNamedPipe(pipe, &ov)) { errno = GetLastError(); if (errno == ERROR_IO_PENDING) { while (WaitForSingleObject(ov.hEvent, 1000) == WAIT_TIMEOUT) { if (in_shutdown) { CloseHandle(ov.hEvent); FCGI_UNLOCK(req->listen_socket); return -1; } } } else if (errno != ERROR_PIPE_CONNECTED) { } } CloseHandle(ov.hEvent); req->fd = req->listen_socket; FCGI_UNLOCK(req->listen_socket); } else { SOCKET listen_socket = (SOCKET)_get_osfhandle(req->listen_socket); #else { int listen_socket = req->listen_socket; #endif sa_t sa; socklen_t len = sizeof(sa); FCGI_LOCK(req->listen_socket); req->fd = accept(listen_socket, (struct sockaddr *)&sa, &len); FCGI_UNLOCK(req->listen_socket); if (req->fd >= 0) { if (((struct sockaddr *)&sa)->sa_family == AF_INET) { #ifndef _WIN32 req->tcp = 1; #endif if (allowed_clients) { int n = 0; int allowed = 0; while (allowed_clients[n] != INADDR_NONE) { if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) { allowed = 1; break; } n++; } if (!allowed) { fprintf(stderr, "Connection from disallowed IP address '%s' is dropped.\n", inet_ntoa(sa.sa_inet.sin_addr)); closesocket(req->fd); req->fd = -1; continue; } } #ifndef _WIN32 } else { req->tcp = 0; #endif } } } #ifdef _WIN32 if (req->fd < 0 && (in_shutdown || errno != EINTR)) { #else if (req->fd < 0 && (in_shutdown || (errno != EINTR && errno != ECONNABORTED))) { #endif return -1; } #ifdef _WIN32 break; #else if (req->fd >= 0) { #if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL) struct pollfd fds; int ret; fds.fd = req->fd; fds.events = POLLIN; fds.revents = 0; do { errno = 0; ret = poll(&fds, 1, 5000); } while (ret < 0 && errno == EINTR); if (ret > 0 && (fds.revents & POLLIN)) { break; } fcgi_close(req, 1, 0); #else if (req->fd < FD_SETSIZE) { struct timeval tv = {5,0}; fd_set set; int ret; FD_ZERO(&set); FD_SET(req->fd, &set); do { errno = 0; ret = select(req->fd + 1, &set, NULL, NULL, &tv) >= 0; } while (ret < 0 && errno == EINTR); if (ret > 0 && FD_ISSET(req->fd, &set)) { break; } fcgi_close(req, 1, 0); } else { fprintf(stderr, "Too many open file descriptors. FD_SETSIZE limit exceeded."); fcgi_close(req, 1, 0); } #endif } #endif } } else if (in_shutdown) { return -1; } if (fcgi_read_request(req)) { #ifdef _WIN32 if (is_impersonate && !req->tcp) { pipe = (HANDLE)_get_osfhandle(req->fd); if (!ImpersonateNamedPipeClient(pipe)) { fcgi_close(req, 1, 1); continue; } } #endif return req->fd; } else { fcgi_close(req, 1, 1); } } } static inline fcgi_header* open_packet(fcgi_request *req, fcgi_request_type type) { req->out_hdr = (fcgi_header*) req->out_pos; req->out_hdr->type = type; req->out_pos += sizeof(fcgi_header); return req->out_hdr; } static inline void close_packet(fcgi_request *req) { if (req->out_hdr) { int len = req->out_pos - ((unsigned char*)req->out_hdr + sizeof(fcgi_header)); req->out_pos += fcgi_make_header(req->out_hdr, (fcgi_request_type)req->out_hdr->type, req->id, len); req->out_hdr = NULL; } } int fcgi_flush(fcgi_request *req, int close) { int len; close_packet(req); len = req->out_pos - req->out_buf; if (close) { fcgi_end_request_rec *rec = (fcgi_end_request_rec*)(req->out_pos); fcgi_make_header(&rec->hdr, FCGI_END_REQUEST, req->id, sizeof(fcgi_end_request)); rec->body.appStatusB3 = 0; rec->body.appStatusB2 = 0; rec->body.appStatusB1 = 0; rec->body.appStatusB0 = 0; rec->body.protocolStatus = FCGI_REQUEST_COMPLETE; len += sizeof(fcgi_end_request_rec); } if (safe_write(req, req->out_buf, len) != len) { req->keep = 0; req->out_pos = req->out_buf; return 0; } req->out_pos = req->out_buf; return 1; } int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len) { int limit, rest; if (len <= 0) { return 0; } if (req->out_hdr && req->out_hdr->type != type) { close_packet(req); } #if 0 /* Unoptimized, but clear version */ rest = len; while (rest > 0) { limit = sizeof(req->out_buf) - (req->out_pos - req->out_buf); if (!req->out_hdr) { if (limit < sizeof(fcgi_header)) { if (!fcgi_flush(req, 0)) { return -1; } } open_packet(req, type); } limit = sizeof(req->out_buf) - (req->out_pos - req->out_buf); if (rest < limit) { memcpy(req->out_pos, str, rest); req->out_pos += rest; return len; } else { memcpy(req->out_pos, str, limit); req->out_pos += limit; rest -= limit; str += limit; if (!fcgi_flush(req, 0)) { return -1; } } } #else /* Optimized version */ limit = sizeof(req->out_buf) - (req->out_pos - req->out_buf); if (!req->out_hdr) { limit -= sizeof(fcgi_header); if (limit < 0) limit = 0; } if (len < limit) { if (!req->out_hdr) { open_packet(req, type); } memcpy(req->out_pos, str, len); req->out_pos += len; } else if (len - limit < sizeof(req->out_buf) - sizeof(fcgi_header)) { if (!req->out_hdr) { open_packet(req, type); } if (limit > 0) { memcpy(req->out_pos, str, limit); req->out_pos += limit; } if (!fcgi_flush(req, 0)) { return -1; } if (len > limit) { open_packet(req, type); memcpy(req->out_pos, str + limit, len - limit); req->out_pos += len - limit; } } else { int pos = 0; int pad; close_packet(req); while ((len - pos) > 0xffff) { open_packet(req, type); fcgi_make_header(req->out_hdr, type, req->id, 0xfff8); req->out_hdr = NULL; if (!fcgi_flush(req, 0)) { return -1; } if (safe_write(req, str + pos, 0xfff8) != 0xfff8) { req->keep = 0; return -1; } pos += 0xfff8; } pad = (((len - pos) + 7) & ~7) - (len - pos); rest = pad ? 8 - pad : 0; open_packet(req, type); fcgi_make_header(req->out_hdr, type, req->id, (len - pos) - rest); req->out_hdr = NULL; if (!fcgi_flush(req, 0)) { return -1; } if (safe_write(req, str + pos, (len - pos) - rest) != (len - pos) - rest) { req->keep = 0; return -1; } if (pad) { open_packet(req, type); memcpy(req->out_pos, str + len - rest, rest); req->out_pos += rest; } } #endif return len; } int fcgi_finish_request(fcgi_request *req, int force_close) { int ret = 1; if (req->fd >= 0) { if (!req->closed) { ret = fcgi_flush(req, 1); req->closed = 1; } fcgi_close(req, force_close, 1); } return ret; } char* fcgi_getenv(fcgi_request *req, const char* var, int var_len) { unsigned int val_len; if (!req) return NULL; return fcgi_hash_get(&req->env, FCGI_HASH_FUNC(var, var_len), (char*)var, var_len, &val_len); } char* fcgi_quick_getenv(fcgi_request *req, const char* var, int var_len, unsigned int hash_value) { unsigned int val_len; return fcgi_hash_get(&req->env, hash_value, (char*)var, var_len, &val_len); } char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val) { if (!req) return NULL; if (val == NULL) { fcgi_hash_del(&req->env, FCGI_HASH_FUNC(var, var_len), var, var_len); return NULL; } else { return fcgi_hash_set(&req->env, FCGI_HASH_FUNC(var, var_len), var, var_len, val, strlen(val)); } } char* fcgi_quick_putenv(fcgi_request *req, char* var, int var_len, unsigned int hash_value, char* val) { if (val == NULL) { fcgi_hash_del(&req->env, hash_value, var, var_len); return NULL; } else { return fcgi_hash_set(&req->env, hash_value, var, var_len, val, strlen(val)); } } void fcgi_loadenv(fcgi_request *req, fcgi_apply_func func, zval *array TSRMLS_DC) { fcgi_hash_apply(&req->env, func, array TSRMLS_CC); } #ifdef _WIN32 void fcgi_impersonate(void) { char *os_name; os_name = getenv("OS"); if (os_name && stricmp(os_name, "Windows_NT") == 0) { is_impersonate = 1; } } #endif void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, size_t value_len) { zval * zvalue; zvalue = pemalloc(sizeof(*zvalue), 1); Z_TYPE_P(zvalue) = IS_STRING; Z_STRVAL_P(zvalue) = pestrndup(value, value_len, 1); Z_STRLEN_P(zvalue) = value_len; zend_hash_add(&fcgi_mgmt_vars, name, name_len, &zvalue, sizeof(zvalue), NULL); } void fcgi_free_mgmt_var_cb(void * ptr) { zval ** var = (zval **)ptr; pefree(Z_STRVAL_PP(var), 1); pefree(*var, 1); } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!4܎$$php-5.6.40/sapi/cgi/cgi_main.cnu[/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2016 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf | | Stig Bakken | | Zeev Suraski | | FastCGI: Ben Mansell | | Shane Caraveo | | Dmitry Stogov | +----------------------------------------------------------------------+ */ /* $Id$ */ #include "php.h" #include "php_globals.h" #include "php_variables.h" #include "zend_modules.h" #include "SAPI.h" #include #include "php.h" #ifdef PHP_WIN32 # include "win32/time.h" # include "win32/signal.h" # include #endif #if HAVE_SYS_TIME_H # include #endif #if HAVE_UNISTD_H # include #endif #if HAVE_SIGNAL_H # include #endif #if HAVE_SETLOCALE # include #endif #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_WAIT_H # include #endif #include "zend.h" #include "zend_extensions.h" #include "php_ini.h" #include "php_globals.h" #include "php_main.h" #include "fopen_wrappers.h" #include "ext/standard/php_standard.h" #include "ext/standard/url.h" #ifdef PHP_WIN32 # include # include # include "win32/php_registry.h" #endif #ifdef __riscos__ # include int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS; #endif #include "zend_compile.h" #include "zend_execute.h" #include "zend_highlight.h" #include "zend_indent.h" #include "php_getopt.h" #include "fastcgi.h" #if defined(PHP_WIN32) && defined(HAVE_OPENSSL) # include "openssl/applink.c" #endif #ifndef PHP_WIN32 /* XXX this will need to change later when threaded fastcgi is implemented. shane */ struct sigaction act, old_term, old_quit, old_int; #endif static void (*php_php_import_environment_variables)(zval *array_ptr TSRMLS_DC); #ifndef PHP_WIN32 /* these globals used for forking children on unix systems */ /** * Number of child processes that will get created to service requests */ static int children = 0; /** * Set to non-zero if we are the parent process */ static int parent = 1; /* Did parent received exit signals SIG_TERM/SIG_INT/SIG_QUIT */ static int exit_signal = 0; /* Is Parent waiting for children to exit */ static int parent_waiting = 0; /** * Process group */ static pid_t pgroup; #endif #define PHP_MODE_STANDARD 1 #define PHP_MODE_HIGHLIGHT 2 #define PHP_MODE_INDENT 3 #define PHP_MODE_LINT 4 #define PHP_MODE_STRIP 5 static char *php_optarg = NULL; static int php_optind = 1; static zend_module_entry cgi_module_entry; static const opt_struct OPTIONS[] = { {'a', 0, "interactive"}, {'b', 1, "bindpath"}, {'C', 0, "no-chdir"}, {'c', 1, "php-ini"}, {'d', 1, "define"}, {'e', 0, "profile-info"}, {'f', 1, "file"}, {'h', 0, "help"}, {'i', 0, "info"}, {'l', 0, "syntax-check"}, {'m', 0, "modules"}, {'n', 0, "no-php-ini"}, {'q', 0, "no-header"}, {'s', 0, "syntax-highlight"}, {'s', 0, "syntax-highlighting"}, {'w', 0, "strip"}, {'?', 0, "usage"},/* help alias (both '?' and 'usage') */ {'v', 0, "version"}, {'z', 1, "zend-extension"}, {'T', 1, "timing"}, {'-', 0, NULL} /* end of args */ }; typedef struct _php_cgi_globals_struct { zend_bool rfc2616_headers; zend_bool nph; zend_bool check_shebang_line; zend_bool fix_pathinfo; zend_bool force_redirect; zend_bool discard_path; zend_bool fcgi_logging; char *redirect_status_env; #ifdef PHP_WIN32 zend_bool impersonate; #endif HashTable user_config_cache; } php_cgi_globals_struct; /* {{{ user_config_cache * * Key for each cache entry is dirname(PATH_TRANSLATED). * * NOTE: Each cache entry config_hash contains the combination from all user ini files found in * the path starting from doc_root throught to dirname(PATH_TRANSLATED). There is no point * storing per-file entries as it would not be possible to detect added / deleted entries * between separate files. */ typedef struct _user_config_cache_entry { time_t expires; HashTable *user_config; } user_config_cache_entry; static void user_config_cache_entry_dtor(user_config_cache_entry *entry) { zend_hash_destroy(entry->user_config); free(entry->user_config); } /* }}} */ #ifdef ZTS static int php_cgi_globals_id; #define CGIG(v) TSRMG(php_cgi_globals_id, php_cgi_globals_struct *, v) #else static php_cgi_globals_struct php_cgi_globals; #define CGIG(v) (php_cgi_globals.v) #endif #ifdef PHP_WIN32 #define TRANSLATE_SLASHES(path) \ { \ char *tmp = path; \ while (*tmp) { \ if (*tmp == '\\') *tmp = '/'; \ tmp++; \ } \ } #else #define TRANSLATE_SLASHES(path) #endif static int print_module_info(zend_module_entry *module, void *arg TSRMLS_DC) { php_printf("%s\n", module->name); return 0; } static int module_name_cmp(const void *a, const void *b TSRMLS_DC) { Bucket *f = *((Bucket **) a); Bucket *s = *((Bucket **) b); return strcasecmp( ((zend_module_entry *)f->pData)->name, ((zend_module_entry *)s->pData)->name); } static void print_modules(TSRMLS_D) { HashTable sorted_registry; zend_module_entry tmp; zend_hash_init(&sorted_registry, 50, NULL, NULL, 1); zend_hash_copy(&sorted_registry, &module_registry, NULL, &tmp, sizeof(zend_module_entry)); zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0 TSRMLS_CC); zend_hash_apply_with_argument(&sorted_registry, (apply_func_arg_t) print_module_info, NULL TSRMLS_CC); zend_hash_destroy(&sorted_registry); } static int print_extension_info(zend_extension *ext, void *arg TSRMLS_DC) { php_printf("%s\n", ext->name); return 0; } static int extension_name_cmp(const zend_llist_element **f, const zend_llist_element **s TSRMLS_DC) { return strcmp( ((zend_extension *)(*f)->data)->name, ((zend_extension *)(*s)->data)->name); } static void print_extensions(TSRMLS_D) { zend_llist sorted_exts; zend_llist_copy(&sorted_exts, &zend_extensions); sorted_exts.dtor = NULL; zend_llist_sort(&sorted_exts, extension_name_cmp TSRMLS_CC); zend_llist_apply_with_argument(&sorted_exts, (llist_apply_with_arg_func_t) print_extension_info, NULL TSRMLS_CC); zend_llist_destroy(&sorted_exts); } #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif static inline size_t sapi_cgi_single_write(const char *str, uint str_length TSRMLS_DC) { #ifdef PHP_WRITE_STDOUT long ret; ret = write(STDOUT_FILENO, str, str_length); if (ret <= 0) return 0; return ret; #else size_t ret; ret = fwrite(str, 1, MIN(str_length, 16384), stdout); return ret; #endif } static int sapi_cgi_ub_write(const char *str, uint str_length TSRMLS_DC) { const char *ptr = str; uint remaining = str_length; size_t ret; while (remaining > 0) { ret = sapi_cgi_single_write(ptr, remaining TSRMLS_CC); if (!ret) { php_handle_aborted_connection(); return str_length - remaining; } ptr += ret; remaining -= ret; } return str_length; } static int sapi_fcgi_ub_write(const char *str, uint str_length TSRMLS_DC) { const char *ptr = str; uint remaining = str_length; fcgi_request *request = (fcgi_request*) SG(server_context); while (remaining > 0) { long ret = fcgi_write(request, FCGI_STDOUT, ptr, remaining); if (ret <= 0) { php_handle_aborted_connection(); return str_length - remaining; } ptr += ret; remaining -= ret; } return str_length; } static void sapi_cgi_flush(void *server_context) { if (fflush(stdout) == EOF) { php_handle_aborted_connection(); } } static void sapi_fcgi_flush(void *server_context) { fcgi_request *request = (fcgi_request*) server_context; if ( #ifndef PHP_WIN32 !parent && #endif request && !fcgi_flush(request, 0)) { php_handle_aborted_connection(); } } #define SAPI_CGI_MAX_HEADER_LENGTH 1024 typedef struct _http_error { int code; const char* msg; } http_error; static const http_error http_error_codes[] = { {100, "Continue"}, {101, "Switching Protocols"}, {200, "OK"}, {201, "Created"}, {202, "Accepted"}, {203, "Non-Authoritative Information"}, {204, "No Content"}, {205, "Reset Content"}, {206, "Partial Content"}, {300, "Multiple Choices"}, {301, "Moved Permanently"}, {302, "Moved Temporarily"}, {303, "See Other"}, {304, "Not Modified"}, {305, "Use Proxy"}, {400, "Bad Request"}, {401, "Unauthorized"}, {402, "Payment Required"}, {403, "Forbidden"}, {404, "Not Found"}, {405, "Method Not Allowed"}, {406, "Not Acceptable"}, {407, "Proxy Authentication Required"}, {408, "Request Time-out"}, {409, "Conflict"}, {410, "Gone"}, {411, "Length Required"}, {412, "Precondition Failed"}, {413, "Request Entity Too Large"}, {414, "Request-URI Too Large"}, {415, "Unsupported Media Type"}, {428, "Precondition Required"}, {429, "Too Many Requests"}, {431, "Request Header Fields Too Large"}, {451, "Unavailable For Legal Reasons"}, {500, "Internal Server Error"}, {501, "Not Implemented"}, {502, "Bad Gateway"}, {503, "Service Unavailable"}, {504, "Gateway Time-out"}, {505, "HTTP Version not supported"}, {511, "Network Authentication Required"}, {0, NULL} }; static int sapi_cgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { char buf[SAPI_CGI_MAX_HEADER_LENGTH]; sapi_header_struct *h; zend_llist_position pos; zend_bool ignore_status = 0; int response_status = SG(sapi_headers).http_response_code; if (SG(request_info).no_headers == 1) { return SAPI_HEADER_SENT_SUCCESSFULLY; } if (CGIG(nph) || SG(sapi_headers).http_response_code != 200) { int len; zend_bool has_status = 0; if (CGIG(rfc2616_headers) && SG(sapi_headers).http_status_line) { char *s; len = slprintf(buf, SAPI_CGI_MAX_HEADER_LENGTH, "%s\r\n", SG(sapi_headers).http_status_line); if ((s = strchr(SG(sapi_headers).http_status_line, ' '))) { response_status = atoi((s + 1)); } if (len > SAPI_CGI_MAX_HEADER_LENGTH) { len = SAPI_CGI_MAX_HEADER_LENGTH; } } else { char *s; if (SG(sapi_headers).http_status_line && (s = strchr(SG(sapi_headers).http_status_line, ' ')) != 0 && (s - SG(sapi_headers).http_status_line) >= 5 && strncasecmp(SG(sapi_headers).http_status_line, "HTTP/", 5) == 0 ) { len = slprintf(buf, sizeof(buf), "Status:%s\r\n", s); response_status = atoi((s + 1)); } else { h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { if (h->header_len > sizeof("Status:")-1 && strncasecmp(h->header, "Status:", sizeof("Status:")-1) == 0 ) { has_status = 1; break; } h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); } if (!has_status) { http_error *err = (http_error*)http_error_codes; while (err->code != 0) { if (err->code == SG(sapi_headers).http_response_code) { break; } err++; } if (err->msg) { len = slprintf(buf, sizeof(buf), "Status: %d %s\r\n", SG(sapi_headers).http_response_code, err->msg); } else { len = slprintf(buf, sizeof(buf), "Status: %d\r\n", SG(sapi_headers).http_response_code); } } } } if (!has_status) { PHPWRITE_H(buf, len); ignore_status = 1; } } h = (sapi_header_struct*)zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { /* prevent CRLFCRLF */ if (h->header_len) { if (h->header_len > sizeof("Status:")-1 && strncasecmp(h->header, "Status:", sizeof("Status:")-1) == 0 ) { if (!ignore_status) { ignore_status = 1; PHPWRITE_H(h->header, h->header_len); PHPWRITE_H("\r\n", 2); } } else if (response_status == 304 && h->header_len > sizeof("Content-Type:")-1 && strncasecmp(h->header, "Content-Type:", sizeof("Content-Type:")-1) == 0 ) { h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); continue; } else { PHPWRITE_H(h->header, h->header_len); PHPWRITE_H("\r\n", 2); } } h = (sapi_header_struct*)zend_llist_get_next_ex(&sapi_headers->headers, &pos); } PHPWRITE_H("\r\n", 2); return SAPI_HEADER_SENT_SUCCESSFULLY; } #ifndef STDIN_FILENO # define STDIN_FILENO 0 #endif static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) { uint read_bytes = 0; int tmp_read_bytes; count_bytes = MIN(count_bytes, SG(request_info).content_length - SG(read_post_bytes)); while (read_bytes < count_bytes) { tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, count_bytes - read_bytes); if (tmp_read_bytes <= 0) { break; } read_bytes += tmp_read_bytes; } return read_bytes; } static int sapi_fcgi_read_post(char *buffer, uint count_bytes TSRMLS_DC) { uint read_bytes = 0; int tmp_read_bytes; fcgi_request *request = (fcgi_request*) SG(server_context); size_t remaining = SG(request_info).content_length - SG(read_post_bytes); if (remaining < count_bytes) { count_bytes = remaining; } while (read_bytes < count_bytes) { tmp_read_bytes = fcgi_read(request, buffer + read_bytes, count_bytes - read_bytes); if (tmp_read_bytes <= 0) { break; } read_bytes += tmp_read_bytes; } return read_bytes; } static char *sapi_cgi_getenv(char *name, size_t name_len TSRMLS_DC) { return getenv(name); } static char *sapi_fcgi_getenv(char *name, size_t name_len TSRMLS_DC) { /* when php is started by mod_fastcgi, no regular environment * is provided to PHP. It is always sent to PHP at the start * of a request. So we have to do our own lookup to get env * vars. This could probably be faster somehow. */ fcgi_request *request = (fcgi_request*) SG(server_context); char *ret = fcgi_getenv(request, name, name_len); if (ret) return ret; /* if cgi, or fastcgi and not found in fcgi env check the regular environment */ return getenv(name); } static char *_sapi_cgi_putenv(char *name, int name_len, char *value) { #if !HAVE_SETENV || !HAVE_UNSETENV int len; char *buf; #endif #if HAVE_SETENV if (value) { setenv(name, value, 1); } #endif #if HAVE_UNSETENV if (!value) { unsetenv(name); } #endif #if !HAVE_SETENV || !HAVE_UNSETENV /* if cgi, or fastcgi and not found in fcgi env check the regular environment this leaks, but it's only cgi anyway, we'll fix it for 5.0 */ len = name_len + (value ? strlen(value) : 0) + sizeof("=") + 2; buf = (char *) malloc(len); if (buf == NULL) { return getenv(name); } #endif #if !HAVE_SETENV if (value) { len = slprintf(buf, len - 1, "%s=%s", name, value); putenv(buf); } #endif #if !HAVE_UNSETENV if (!value) { len = slprintf(buf, len - 1, "%s=", name); putenv(buf); } #endif return getenv(name); } static char *sapi_cgi_read_cookies(TSRMLS_D) { return getenv("HTTP_COOKIE"); } static char *sapi_fcgi_read_cookies(TSRMLS_D) { fcgi_request *request = (fcgi_request*) SG(server_context); return FCGI_GETENV(request, "HTTP_COOKIE"); } static void cgi_php_load_env_var(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC) { zval *array_ptr = (zval*)arg; int filter_arg = (array_ptr == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; unsigned int new_val_len; if (sapi_module.input_filter(filter_arg, var, &val, strlen(val), &new_val_len TSRMLS_CC)) { php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); } } static void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) { if (PG(http_globals)[TRACK_VARS_ENV] && array_ptr != PG(http_globals)[TRACK_VARS_ENV] && Z_TYPE_P(PG(http_globals)[TRACK_VARS_ENV]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])) > 0 ) { zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_ENV]; INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } else if (PG(http_globals)[TRACK_VARS_SERVER] && array_ptr != PG(http_globals)[TRACK_VARS_SERVER] && Z_TYPE_P(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY && zend_hash_num_elements(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])) > 0 ) { zval_dtor(array_ptr); *array_ptr = *PG(http_globals)[TRACK_VARS_SERVER]; INIT_PZVAL(array_ptr); zval_copy_ctor(array_ptr); return; } /* call php's original import as a catch-all */ php_php_import_environment_variables(array_ptr TSRMLS_CC); if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); fcgi_loadenv(request, cgi_php_load_env_var, array_ptr TSRMLS_CC); } } static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC) { unsigned int php_self_len; char *php_self; /* In CGI mode, we consider the environment to be a part of the server * variables */ php_import_environment_variables(track_vars_array TSRMLS_CC); if (CGIG(fix_pathinfo)) { char *script_name = SG(request_info).request_uri; char *path_info; int free_php_self; ALLOCA_FLAG(use_heap) if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); path_info = FCGI_GETENV(request, "PATH_INFO"); } else { path_info = getenv("PATH_INFO"); } if (path_info) { unsigned int path_info_len = strlen(path_info); if (script_name) { unsigned int script_name_len = strlen(script_name); php_self_len = script_name_len + path_info_len; php_self = do_alloca(php_self_len + 1, use_heap); memcpy(php_self, script_name, script_name_len + 1); memcpy(php_self + script_name_len, path_info, path_info_len + 1); free_php_self = 1; } else { php_self = path_info; php_self_len = path_info_len; free_php_self = 0; } } else if (script_name) { php_self = script_name; php_self_len = strlen(script_name); free_php_self = 0; } else { php_self = ""; php_self_len = 0; free_php_self = 0; } /* Build the special-case PHP_SELF variable for the CGI version */ if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); } if (free_php_self) { free_alloca(php_self, use_heap); } } else { php_self = SG(request_info).request_uri ? SG(request_info).request_uri : ""; php_self_len = strlen(php_self); if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &php_self, php_self_len, &php_self_len TSRMLS_CC)) { php_register_variable_safe("PHP_SELF", php_self, php_self_len, track_vars_array TSRMLS_CC); } } } static void sapi_cgi_log_message(char *message TSRMLS_DC) { if (fcgi_is_fastcgi() && CGIG(fcgi_logging)) { fcgi_request *request; request = (fcgi_request*) SG(server_context); if (request) { int ret, len = strlen(message); char *buf = malloc(len+2); memcpy(buf, message, len); memcpy(buf + len, "\n", sizeof("\n")); ret = fcgi_write(request, FCGI_STDERR, buf, len + 1); free(buf); if (ret < 0) { php_handle_aborted_connection(); } } else { fprintf(stderr, "%s\n", message); } /* ignore return code */ } else { fprintf(stderr, "%s\n", message); } } /* {{{ php_cgi_ini_activate_user_config */ static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start TSRMLS_DC) { char *ptr; user_config_cache_entry *new_entry, *entry; time_t request_time = sapi_get_request_time(TSRMLS_C); /* Find cached config entry: If not found, create one */ if (zend_hash_find(&CGIG(user_config_cache), path, path_len + 1, (void **) &entry) == FAILURE) { new_entry = pemalloc(sizeof(user_config_cache_entry), 1); new_entry->expires = 0; new_entry->user_config = (HashTable *) pemalloc(sizeof(HashTable), 1); zend_hash_init(new_entry->user_config, 0, NULL, (dtor_func_t) config_zval_dtor, 1); zend_hash_update(&CGIG(user_config_cache), path, path_len + 1, new_entry, sizeof(user_config_cache_entry), (void **) &entry); free(new_entry); } /* Check whether cache entry has expired and rescan if it is */ if (request_time > entry->expires) { char *real_path = NULL; int real_path_len; char *s1, *s2; int s_len; /* Clear the expired config */ zend_hash_clean(entry->user_config); if (!IS_ABSOLUTE_PATH(path, path_len)) { real_path = tsrm_realpath(path, NULL TSRMLS_CC); if (real_path == NULL) { return; } real_path_len = strlen(real_path); path = real_path; path_len = real_path_len; } if (path_len > doc_root_len) { s1 = (char *) doc_root; s2 = path; s_len = doc_root_len; } else { s1 = path; s2 = (char *) doc_root; s_len = path_len; } /* we have to test if path is part of DOCUMENT_ROOT. if it is inside the docroot, we scan the tree up to the docroot to find more user.ini, if not we only scan the current path. */ #ifdef PHP_WIN32 if (strnicmp(s1, s2, s_len) == 0) { #else if (strncmp(s1, s2, s_len) == 0) { #endif ptr = s2 + start; /* start is the point where doc_root ends! */ while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { *ptr = 0; php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC); *ptr = '/'; ptr++; } } else { php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config TSRMLS_CC); } if (real_path) { efree(real_path); } entry->expires = request_time + PG(user_ini_cache_ttl); } /* Activate ini entries with values from the user config hash */ php_ini_activate_config(entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS TSRMLS_CC); } /* }}} */ static int sapi_cgi_activate(TSRMLS_D) { char *path, *doc_root, *server_name; uint path_len, doc_root_len, server_name_len; /* PATH_TRANSLATED should be defined at this stage but better safe than sorry :) */ if (!SG(request_info).path_translated) { return FAILURE; } if (php_ini_has_per_host_config()) { /* Activate per-host-system-configuration defined in php.ini and stored into configuration_hash during startup */ if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); server_name = FCGI_GETENV(request, "SERVER_NAME"); } else { server_name = getenv("SERVER_NAME"); } /* SERVER_NAME should also be defined at this stage..but better check it anyway */ if (server_name) { server_name_len = strlen(server_name); server_name = estrndup(server_name, server_name_len); zend_str_tolower(server_name, server_name_len); php_ini_activate_per_host_config(server_name, server_name_len + 1 TSRMLS_CC); efree(server_name); } } if (php_ini_has_per_dir_config() || (PG(user_ini_filename) && *PG(user_ini_filename)) ) { /* Prepare search path */ path_len = strlen(SG(request_info).path_translated); /* Make sure we have trailing slash! */ if (!IS_SLASH(SG(request_info).path_translated[path_len])) { path = emalloc(path_len + 2); memcpy(path, SG(request_info).path_translated, path_len + 1); path_len = zend_dirname(path, path_len); path[path_len++] = DEFAULT_SLASH; } else { path = estrndup(SG(request_info).path_translated, path_len); path_len = zend_dirname(path, path_len); } path[path_len] = 0; /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */ /* Load and activate user ini files in path starting from DOCUMENT_ROOT */ if (PG(user_ini_filename) && *PG(user_ini_filename)) { if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); doc_root = FCGI_GETENV(request, "DOCUMENT_ROOT"); } else { doc_root = getenv("DOCUMENT_ROOT"); } /* DOCUMENT_ROOT should also be defined at this stage..but better check it anyway */ if (doc_root) { doc_root_len = strlen(doc_root); if (doc_root_len > 0 && IS_SLASH(doc_root[doc_root_len - 1])) { --doc_root_len; } #ifdef PHP_WIN32 /* paths on windows should be case-insensitive */ doc_root = estrndup(doc_root, doc_root_len); zend_str_tolower(doc_root, doc_root_len); #endif php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1 TSRMLS_CC); #ifdef PHP_WIN32 efree(doc_root); #endif } } efree(path); } return SUCCESS; } static int sapi_cgi_deactivate(TSRMLS_D) { /* flush only when SAPI was started. The reasons are: 1. SAPI Deactivate is called from two places: module init and request shutdown 2. When the first call occurs and the request is not set up, flush fails on FastCGI. */ if (SG(sapi_started)) { if (fcgi_is_fastcgi()) { if ( #ifndef PHP_WIN32 !parent && #endif !fcgi_finish_request((fcgi_request*)SG(server_context), 0)) { php_handle_aborted_connection(); } } else { sapi_cgi_flush(SG(server_context)); } } return SUCCESS; } static int php_cgi_startup(sapi_module_struct *sapi_module) { if (php_module_startup(sapi_module, &cgi_module_entry, 1) == FAILURE) { return FAILURE; } return SUCCESS; } /* {{{ sapi_module_struct cgi_sapi_module */ static sapi_module_struct cgi_sapi_module = { "cgi-fcgi", /* name */ "CGI/FastCGI", /* pretty name */ php_cgi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ sapi_cgi_activate, /* activate */ sapi_cgi_deactivate, /* deactivate */ sapi_cgi_ub_write, /* unbuffered write */ sapi_cgi_flush, /* flush */ NULL, /* get uid */ sapi_cgi_getenv, /* getenv */ php_error, /* error handler */ NULL, /* header handler */ sapi_cgi_send_headers, /* send headers handler */ NULL, /* send header handler */ sapi_cgi_read_post, /* read POST data */ sapi_cgi_read_cookies, /* read Cookies */ sapi_cgi_register_variables, /* register server variables */ sapi_cgi_log_message, /* Log message */ NULL, /* Get request time */ NULL, /* Child terminate */ STANDARD_SAPI_MODULE_PROPERTIES }; /* }}} */ /* {{{ arginfo ext/standard/dl.c */ ZEND_BEGIN_ARG_INFO(arginfo_dl, 0) ZEND_ARG_INFO(0, extension_filename) ZEND_END_ARG_INFO() /* }}} */ static const zend_function_entry additional_functions[] = { ZEND_FE(dl, arginfo_dl) {NULL, NULL, NULL} }; /* {{{ php_cgi_usage */ static void php_cgi_usage(char *argv0) { char *prog; prog = strrchr(argv0, '/'); if (prog) { prog++; } else { prog = "php"; } php_printf( "Usage: %s [-q] [-h] [-s] [-v] [-i] [-f ]\n" " %s [args...]\n" " -a Run interactively\n" " -b | Bind Path for external FASTCGI Server mode\n" " -C Do not chdir to the script's directory\n" " -c | Look for php.ini file in this directory\n" " -n No php.ini file will be used\n" " -d foo[=bar] Define INI entry foo with value 'bar'\n" " -e Generate extended information for debugger/profiler\n" " -f Parse . Implies `-q'\n" " -h This help\n" " -i PHP information\n" " -l Syntax check only (lint)\n" " -m Show compiled in modules\n" " -q Quiet-mode. Suppress HTTP Header output.\n" " -s Display colour syntax highlighted source.\n" " -v Version number\n" " -w Display source with stripped comments and whitespace.\n" " -z Load Zend extension .\n" " -T Measure execution time of script repeated times.\n", prog, prog); } /* }}} */ /* {{{ is_valid_path * * some server configurations allow '..' to slip through in the * translated path. We'll just refuse to handle such a path. */ static int is_valid_path(const char *path) { const char *p = path; if (UNEXPECTED(!p)) { return 0; } if (UNEXPECTED(*p == '.') && *(p+1) == '.' && (!*(p+2) || IS_SLASH(*(p+2)))) { return 0; } while (*p) { if (IS_SLASH(*p)) { p++; if (UNEXPECTED(*p == '.')) { p++; if (UNEXPECTED(*p == '.')) { p++; if (UNEXPECTED(!*p) || UNEXPECTED(IS_SLASH(*p))) { return 0; } } } } p++; } return 1; } /* }}} */ #define CGI_GETENV(name) \ ((request) ? \ FCGI_GETENV(request, name) : \ getenv(name)) #define CGI_PUTENV(name, value) \ ((request) ? \ FCGI_PUTENV(request, name, value) : \ _sapi_cgi_putenv(name, sizeof(name)-1, value)) /* {{{ init_request_info initializes request_info structure specificly in this section we handle proper translations for: PATH_INFO derived from the portion of the URI path following the script name but preceding any query data may be empty PATH_TRANSLATED derived by taking any path-info component of the request URI and performing any virtual-to-physical translation appropriate to map it onto the server's document repository structure empty if PATH_INFO is empty The env var PATH_TRANSLATED **IS DIFFERENT** than the request_info.path_translated variable, the latter should match SCRIPT_FILENAME instead. SCRIPT_NAME set to a URL path that could identify the CGI script rather than the interpreter. PHP_SELF is set to this REQUEST_URI uri section following the domain:port part of a URI SCRIPT_FILENAME The virtual-to-physical translation of SCRIPT_NAME (as per PATH_TRANSLATED) These settings are documented at http://cgi-spec.golux.com/ Based on the following URL request: http://localhost/info.php/test?a=b should produce, which btw is the same as if we were running under mod_cgi on apache (ie. not using ScriptAlias directives): PATH_INFO=/test PATH_TRANSLATED=/docroot/test SCRIPT_NAME=/info.php REQUEST_URI=/info.php/test?a=b SCRIPT_FILENAME=/docroot/info.php QUERY_STRING=a=b but what we get is (cgi/mod_fastcgi under apache): PATH_INFO=/info.php/test PATH_TRANSLATED=/docroot/info.php/test SCRIPT_NAME=/php/php-cgi (from the Action setting I suppose) REQUEST_URI=/info.php/test?a=b SCRIPT_FILENAME=/path/to/php/bin/php-cgi (Action setting translated) QUERY_STRING=a=b Comments in the code below refer to using the above URL in a request */ static void init_request_info(fcgi_request *request TSRMLS_DC) { char *env_script_filename = CGI_GETENV("SCRIPT_FILENAME"); char *env_path_translated = CGI_GETENV("PATH_TRANSLATED"); char *script_path_translated = env_script_filename; /* some broken servers do not have script_filename or argv0 * an example, IIS configured in some ways. then they do more * broken stuff and set path_translated to the cgi script location */ if (!script_path_translated && env_path_translated) { script_path_translated = env_path_translated; } /* initialize the defaults */ SG(request_info).path_translated = NULL; SG(request_info).request_method = NULL; SG(request_info).proto_num = 1000; SG(request_info).query_string = NULL; SG(request_info).request_uri = NULL; SG(request_info).content_type = NULL; SG(request_info).content_length = 0; SG(sapi_headers).http_response_code = 200; /* script_path_translated being set is a good indication that * we are running in a cgi environment, since it is always * null otherwise. otherwise, the filename * of the script will be retreived later via argc/argv */ if (script_path_translated) { const char *auth; char *content_length = CGI_GETENV("CONTENT_LENGTH"); char *content_type = CGI_GETENV("CONTENT_TYPE"); char *env_path_info = CGI_GETENV("PATH_INFO"); char *env_script_name = CGI_GETENV("SCRIPT_NAME"); #ifdef PHP_WIN32 /* Hack for buggy IIS that sets incorrect PATH_INFO */ char *env_server_software = CGI_GETENV("SERVER_SOFTWARE"); if (env_server_software && env_script_name && env_path_info && strncmp(env_server_software, "Microsoft-IIS", sizeof("Microsoft-IIS")-1) == 0 && strncmp(env_path_info, env_script_name, strlen(env_script_name)) == 0 ) { env_path_info = CGI_PUTENV("ORIG_PATH_INFO", env_path_info); env_path_info += strlen(env_script_name); if (*env_path_info == 0) { env_path_info = NULL; } env_path_info = CGI_PUTENV("PATH_INFO", env_path_info); } #endif if (CGIG(fix_pathinfo)) { struct stat st; char *real_path = NULL; char *env_redirect_url = CGI_GETENV("REDIRECT_URL"); char *env_document_root = CGI_GETENV("DOCUMENT_ROOT"); char *orig_path_translated = env_path_translated; char *orig_path_info = env_path_info; char *orig_script_name = env_script_name; char *orig_script_filename = env_script_filename; int script_path_translated_len; if (!env_document_root && PG(doc_root)) { env_document_root = CGI_PUTENV("DOCUMENT_ROOT", PG(doc_root)); /* fix docroot */ TRANSLATE_SLASHES(env_document_root); } if (env_path_translated != NULL && env_redirect_url != NULL && env_path_translated != script_path_translated && strcmp(env_path_translated, script_path_translated) != 0) { /* * pretty much apache specific. If we have a redirect_url * then our script_filename and script_name point to the * php executable */ script_path_translated = env_path_translated; /* we correct SCRIPT_NAME now in case we don't have PATH_INFO */ env_script_name = env_redirect_url; } #ifdef __riscos__ /* Convert path to unix format*/ __riscosify_control |= __RISCOSIFY_DONT_CHECK_DIR; script_path_translated = __unixify(script_path_translated, 0, NULL, 1, 0); #endif /* * if the file doesn't exist, try to extract PATH_INFO out * of it by stat'ing back through the '/' * this fixes url's like /info.php/test */ if (script_path_translated && (script_path_translated_len = strlen(script_path_translated)) > 0 && (script_path_translated[script_path_translated_len-1] == '/' || #ifdef PHP_WIN32 script_path_translated[script_path_translated_len-1] == '\\' || #endif (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL) ) { char *pt = estrndup(script_path_translated, script_path_translated_len); int len = script_path_translated_len; char *ptr; while ((ptr = strrchr(pt, '/')) || (ptr = strrchr(pt, '\\'))) { *ptr = 0; if (stat(pt, &st) == 0 && S_ISREG(st.st_mode)) { /* * okay, we found the base script! * work out how many chars we had to strip off; * then we can modify PATH_INFO * accordingly * * we now have the makings of * PATH_INFO=/test * SCRIPT_FILENAME=/docroot/info.php * * we now need to figure out what docroot is. * if DOCUMENT_ROOT is set, this is easy, otherwise, * we have to play the game of hide and seek to figure * out what SCRIPT_NAME should be */ int slen = len - strlen(pt); int pilen = env_path_info ? strlen(env_path_info) : 0; char *path_info = env_path_info ? env_path_info + pilen - slen : NULL; if (orig_path_info != path_info) { if (orig_path_info) { char old; CGI_PUTENV("ORIG_PATH_INFO", orig_path_info); old = path_info[0]; path_info[0] = 0; if (!orig_script_name || strcmp(orig_script_name, env_path_info) != 0) { if (orig_script_name) { CGI_PUTENV("ORIG_SCRIPT_NAME", orig_script_name); } SG(request_info).request_uri = CGI_PUTENV("SCRIPT_NAME", env_path_info); } else { SG(request_info).request_uri = orig_script_name; } path_info[0] = old; } env_path_info = CGI_PUTENV("PATH_INFO", path_info); } if (!orig_script_filename || strcmp(orig_script_filename, pt) != 0) { if (orig_script_filename) { CGI_PUTENV("ORIG_SCRIPT_FILENAME", orig_script_filename); } script_path_translated = CGI_PUTENV("SCRIPT_FILENAME", pt); } TRANSLATE_SLASHES(pt); /* figure out docroot * SCRIPT_FILENAME minus SCRIPT_NAME */ if (env_document_root) { int l = strlen(env_document_root); int path_translated_len = 0; char *path_translated = NULL; if (l && env_document_root[l - 1] == '/') { --l; } /* we have docroot, so we should have: * DOCUMENT_ROOT=/docroot * SCRIPT_FILENAME=/docroot/info.php */ /* PATH_TRANSLATED = DOCUMENT_ROOT + PATH_INFO */ path_translated_len = l + (env_path_info ? strlen(env_path_info) : 0); path_translated = (char *) emalloc(path_translated_len + 1); memcpy(path_translated, env_document_root, l); if (env_path_info) { memcpy(path_translated + l, env_path_info, (path_translated_len - l)); } path_translated[path_translated_len] = '\0'; if (orig_path_translated) { CGI_PUTENV("ORIG_PATH_TRANSLATED", orig_path_translated); } env_path_translated = CGI_PUTENV("PATH_TRANSLATED", path_translated); efree(path_translated); } else if ( env_script_name && strstr(pt, env_script_name) ) { /* PATH_TRANSLATED = PATH_TRANSLATED - SCRIPT_NAME + PATH_INFO */ int ptlen = strlen(pt) - strlen(env_script_name); int path_translated_len = ptlen + (env_path_info ? strlen(env_path_info) : 0); char *path_translated = NULL; path_translated = (char *) emalloc(path_translated_len + 1); memcpy(path_translated, pt, ptlen); if (env_path_info) { memcpy(path_translated + ptlen, env_path_info, path_translated_len - ptlen); } path_translated[path_translated_len] = '\0'; if (orig_path_translated) { CGI_PUTENV("ORIG_PATH_TRANSLATED", orig_path_translated); } env_path_translated = CGI_PUTENV("PATH_TRANSLATED", path_translated); efree(path_translated); } break; } } if (!ptr) { /* * if we stripped out all the '/' and still didn't find * a valid path... we will fail, badly. of course we would * have failed anyway... we output 'no input file' now. */ if (orig_script_filename) { CGI_PUTENV("ORIG_SCRIPT_FILENAME", orig_script_filename); } script_path_translated = CGI_PUTENV("SCRIPT_FILENAME", NULL); SG(sapi_headers).http_response_code = 404; } if (!SG(request_info).request_uri) { if (!orig_script_name || strcmp(orig_script_name, env_script_name) != 0) { if (orig_script_name) { CGI_PUTENV("ORIG_SCRIPT_NAME", orig_script_name); } SG(request_info).request_uri = CGI_PUTENV("SCRIPT_NAME", env_script_name); } else { SG(request_info).request_uri = orig_script_name; } } if (pt) { efree(pt); } } else { /* make sure path_info/translated are empty */ if (!orig_script_filename || (script_path_translated != orig_script_filename && strcmp(script_path_translated, orig_script_filename) != 0)) { if (orig_script_filename) { CGI_PUTENV("ORIG_SCRIPT_FILENAME", orig_script_filename); } script_path_translated = CGI_PUTENV("SCRIPT_FILENAME", script_path_translated); } if (env_redirect_url) { if (orig_path_info) { CGI_PUTENV("ORIG_PATH_INFO", orig_path_info); CGI_PUTENV("PATH_INFO", NULL); } if (orig_path_translated) { CGI_PUTENV("ORIG_PATH_TRANSLATED", orig_path_translated); CGI_PUTENV("PATH_TRANSLATED", NULL); } } if (env_script_name != orig_script_name) { if (orig_script_name) { CGI_PUTENV("ORIG_SCRIPT_NAME", orig_script_name); } SG(request_info).request_uri = CGI_PUTENV("SCRIPT_NAME", env_script_name); } else { SG(request_info).request_uri = env_script_name; } efree(real_path); } } else { /* pre 4.3 behaviour, shouldn't be used but provides BC */ if (env_path_info) { SG(request_info).request_uri = env_path_info; } else { SG(request_info).request_uri = env_script_name; } if (!CGIG(discard_path) && env_path_translated) { script_path_translated = env_path_translated; } } if (is_valid_path(script_path_translated)) { SG(request_info).path_translated = estrdup(script_path_translated); } SG(request_info).request_method = CGI_GETENV("REQUEST_METHOD"); /* FIXME - Work out proto_num here */ SG(request_info).query_string = CGI_GETENV("QUERY_STRING"); SG(request_info).content_type = (content_type ? content_type : "" ); SG(request_info).content_length = (content_length ? atol(content_length) : 0); /* The CGI RFC allows servers to pass on unvalidated Authorization data */ auth = CGI_GETENV("HTTP_AUTHORIZATION"); php_handle_auth_data(auth TSRMLS_CC); } } /* }}} */ #ifndef PHP_WIN32 /** * Clean up child processes upon exit */ void fastcgi_cleanup(int signal) { #ifdef DEBUG_FASTCGI fprintf(stderr, "FastCGI shutdown, pid %d\n", getpid()); #endif sigaction(SIGTERM, &old_term, 0); /* Kill all the processes in our process group */ kill(-pgroup, SIGTERM); if (parent && parent_waiting) { exit_signal = 1; } else { exit(0); } } #endif PHP_INI_BEGIN() STD_PHP_INI_ENTRY("cgi.rfc2616_headers", "0", PHP_INI_ALL, OnUpdateBool, rfc2616_headers, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("cgi.nph", "0", PHP_INI_ALL, OnUpdateBool, nph, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("cgi.check_shebang_line", "1", PHP_INI_SYSTEM, OnUpdateBool, check_shebang_line, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("cgi.force_redirect", "1", PHP_INI_SYSTEM, OnUpdateBool, force_redirect, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("cgi.redirect_status_env", NULL, PHP_INI_SYSTEM, OnUpdateString, redirect_status_env, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("cgi.fix_pathinfo", "1", PHP_INI_SYSTEM, OnUpdateBool, fix_pathinfo, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("cgi.discard_path", "0", PHP_INI_SYSTEM, OnUpdateBool, discard_path, php_cgi_globals_struct, php_cgi_globals) STD_PHP_INI_ENTRY("fastcgi.logging", "1", PHP_INI_SYSTEM, OnUpdateBool, fcgi_logging, php_cgi_globals_struct, php_cgi_globals) #ifdef PHP_WIN32 STD_PHP_INI_ENTRY("fastcgi.impersonate", "0", PHP_INI_SYSTEM, OnUpdateBool, impersonate, php_cgi_globals_struct, php_cgi_globals) #endif PHP_INI_END() /* {{{ php_cgi_globals_ctor */ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_DC) { php_cgi_globals->rfc2616_headers = 0; php_cgi_globals->nph = 0; php_cgi_globals->check_shebang_line = 1; php_cgi_globals->force_redirect = 1; php_cgi_globals->redirect_status_env = NULL; php_cgi_globals->fix_pathinfo = 1; php_cgi_globals->discard_path = 0; php_cgi_globals->fcgi_logging = 1; #ifdef PHP_WIN32 php_cgi_globals->impersonate = 0; #endif zend_hash_init(&php_cgi_globals->user_config_cache, 0, NULL, (dtor_func_t) user_config_cache_entry_dtor, 1); } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ static PHP_MINIT_FUNCTION(cgi) { REGISTER_INI_ENTRIES(); return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ static PHP_MSHUTDOWN_FUNCTION(cgi) { zend_hash_destroy(&CGIG(user_config_cache)); UNREGISTER_INI_ENTRIES(); return SUCCESS; } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ static PHP_MINFO_FUNCTION(cgi) { DISPLAY_INI_ENTRIES(); } /* }}} */ PHP_FUNCTION(apache_child_terminate) /* {{{ */ { if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } if (fcgi_is_fastcgi()) { fcgi_terminate(); } } /* }}} */ static void add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg TSRMLS_DC) /* {{{ */ { zval *return_value = (zval*)arg; char *str = NULL; char *p; ALLOCA_FLAG(use_heap) if (var_len > 5 && var[0] == 'H' && var[1] == 'T' && var[2] == 'T' && var[3] == 'P' && var[4] == '_') { var_len -= 5; p = var + 5; var = str = do_alloca(var_len + 1, use_heap); *str++ = *p++; while (*p) { if (*p == '_') { *str++ = '-'; p++; if (*p) { *str++ = *p++; } } else if (*p >= 'A' && *p <= 'Z') { *str++ = (*p++ - 'A' + 'a'); } else { *str++ = *p++; } } *str = 0; } else if (var_len == sizeof("CONTENT_TYPE")-1 && memcmp(var, "CONTENT_TYPE", sizeof("CONTENT_TYPE")-1) == 0) { var = "Content-Type"; } else if (var_len == sizeof("CONTENT_LENGTH")-1 && memcmp(var, "CONTENT_LENGTH", sizeof("CONTENT_LENGTH")-1) == 0) { var = "Content-Length"; } else { return; } add_assoc_stringl_ex(return_value, var, var_len+1, val, val_len, 1); if (str) { free_alloca(var, use_heap); } } /* }}} */ PHP_FUNCTION(apache_request_headers) /* {{{ */ { if (ZEND_NUM_ARGS() > 0) { WRONG_PARAM_COUNT; } array_init(return_value); if (fcgi_is_fastcgi()) { fcgi_request *request = (fcgi_request*) SG(server_context); fcgi_loadenv(request, add_request_header, return_value TSRMLS_CC); } else { char buf[128]; char **env, *p, *q, *var, *val, *t = buf; size_t alloc_size = sizeof(buf); unsigned long var_len; for (env = environ; env != NULL && *env != NULL; env++) { val = strchr(*env, '='); if (!val) { /* malformed entry? */ continue; } var_len = val - *env; if (var_len >= alloc_size) { alloc_size = var_len + 64; t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size)); } var = *env; if (var_len > 5 && var[0] == 'H' && var[1] == 'T' && var[2] == 'T' && var[3] == 'P' && var[4] == '_') { var_len -= 5; if (var_len >= alloc_size) { alloc_size = var_len + 64; t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size)); } p = var + 5; var = q = t; /* First char keep uppercase */ *q++ = *p++; while (*p) { if (*p == '=') { /* End of name */ break; } else if (*p == '_') { *q++ = '-'; p++; /* First char after - keep uppercase */ if (*p && *p!='=') { *q++ = *p++; } } else if (*p >= 'A' && *p <= 'Z') { /* lowercase */ *q++ = (*p++ - 'A' + 'a'); } else { *q++ = *p++; } } *q = 0; } else if (var_len == sizeof("CONTENT_TYPE")-1 && memcmp(var, "CONTENT_TYPE", sizeof("CONTENT_TYPE")-1) == 0) { var = "Content-Type"; } else if (var_len == sizeof("CONTENT_LENGTH")-1 && memcmp(var, "CONTENT_LENGTH", sizeof("CONTENT_LENGTH")-1) == 0) { var = "Content-Length"; } else { continue; } val++; add_assoc_string_ex(return_value, var, var_len+1, val, 1); } if (t != buf && t != NULL) { efree(t); } } } /* }}} */ static void add_response_header(sapi_header_struct *h, zval *return_value TSRMLS_DC) /* {{{ */ { char *s, *p; int len = 0; ALLOCA_FLAG(use_heap) if (h->header_len > 0) { p = strchr(h->header, ':'); if (NULL != p) { len = p - h->header; } if (len > 0) { while (len > 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t')) { len--; } if (len) { s = do_alloca(len + 1, use_heap); memcpy(s, h->header, len); s[len] = 0; do { p++; } while (*p == ' ' || *p == '\t'); add_assoc_stringl_ex(return_value, s, len+1, p, h->header_len - (p - h->header), 1); free_alloca(s, use_heap); } } } } /* }}} */ PHP_FUNCTION(apache_response_headers) /* {{{ */ { if (zend_parse_parameters_none() == FAILURE) { return; } if (!&SG(sapi_headers).headers) { RETURN_FALSE; } array_init(return_value); zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value TSRMLS_CC); } /* }}} */ ZEND_BEGIN_ARG_INFO(arginfo_no_args, 0) ZEND_END_ARG_INFO() const zend_function_entry cgi_functions[] = { PHP_FE(apache_child_terminate, arginfo_no_args) PHP_FE(apache_request_headers, arginfo_no_args) PHP_FE(apache_response_headers, arginfo_no_args) PHP_FALIAS(getallheaders, apache_request_headers, arginfo_no_args) {NULL, NULL, NULL} }; static zend_module_entry cgi_module_entry = { STANDARD_MODULE_HEADER, "cgi-fcgi", cgi_functions, PHP_MINIT(cgi), PHP_MSHUTDOWN(cgi), NULL, NULL, PHP_MINFO(cgi), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; /* {{{ main */ int main(int argc, char *argv[]) { int free_query_string = 0; int exit_status = SUCCESS; int cgi = 0, c, i, len; zend_file_handle file_handle; char *s; /* temporary locals */ int behavior = PHP_MODE_STANDARD; int no_headers = 0; int orig_optind = php_optind; char *orig_optarg = php_optarg; char *script_file = NULL; int ini_entries_len = 0; /* end of temporary locals */ #ifdef ZTS void ***tsrm_ls; #endif int max_requests = 500; int requests = 0; int fastcgi; char *bindpath = NULL; int fcgi_fd = 0; fcgi_request *request = NULL; int repeats = 1; int benchmark = 0; #if HAVE_GETTIMEOFDAY struct timeval start, end; #else time_t start, end; #endif #ifndef PHP_WIN32 int status = 0; #endif char *query_string; char *decoded_query_string; int skip_getopt = 0; #if 0 && defined(PHP_DEBUG) /* IIS is always making things more difficult. This allows * us to stop PHP and attach a debugger before much gets started */ { char szMessage [256]; wsprintf (szMessage, "Please attach a debugger to the process 0x%X [%d] (%s) and click OK", GetCurrentProcessId(), GetCurrentProcessId(), argv[0]); MessageBox(NULL, szMessage, "CGI Debug Time!", MB_OK|MB_SERVICE_NOTIFICATION); } #endif #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so that sockets created via fsockopen() don't kill PHP if the remote site closes it. in apache|apxs mode apache does that for us! thies@thieso.net 20000419 */ #endif #endif #ifdef ZTS tsrm_startup(1, 1, 0, NULL); tsrm_ls = ts_resource(0); #endif #ifdef ZTS ts_allocate_id(&php_cgi_globals_id, sizeof(php_cgi_globals_struct), (ts_allocate_ctor) php_cgi_globals_ctor, NULL); #else php_cgi_globals_ctor(&php_cgi_globals TSRMLS_CC); #endif sapi_startup(&cgi_sapi_module); fastcgi = fcgi_is_fastcgi(); cgi_sapi_module.php_ini_path_override = NULL; #ifdef PHP_WIN32 _fmode = _O_BINARY; /* sets default for file streams to binary */ setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ #endif if (!fastcgi) { /* Make sure we detect we are a cgi - a bit redundancy here, * but the default case is that we have to check only the first one. */ if (getenv("SERVER_SOFTWARE") || getenv("SERVER_NAME") || getenv("GATEWAY_INTERFACE") || getenv("REQUEST_METHOD") ) { cgi = 1; } } if((query_string = getenv("QUERY_STRING")) != NULL && strchr(query_string, '=') == NULL) { /* we've got query string that has no = - apache CGI will pass it to command line */ unsigned char *p; decoded_query_string = strdup(query_string); php_url_decode(decoded_query_string, strlen(decoded_query_string)); for (p = (unsigned char *)decoded_query_string; *p && *p <= ' '; p++) { /* skip all leading spaces */ } if(*p == '-') { skip_getopt = 1; } free(decoded_query_string); } while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) { switch (c) { case 'c': if (cgi_sapi_module.php_ini_path_override) { free(cgi_sapi_module.php_ini_path_override); } cgi_sapi_module.php_ini_path_override = strdup(php_optarg); break; case 'n': cgi_sapi_module.php_ini_ignore = 1; break; case 'd': { /* define ini entries on command line */ int len = strlen(php_optarg); char *val; if ((val = strchr(php_optarg, '='))) { val++; if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') { cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\"\"\n\0")); memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, (val - php_optarg)); ini_entries_len += (val - php_optarg); memcpy(cgi_sapi_module.ini_entries + ini_entries_len, "\"", 1); ini_entries_len++; memcpy(cgi_sapi_module.ini_entries + ini_entries_len, val, len - (val - php_optarg)); ini_entries_len += len - (val - php_optarg); memcpy(cgi_sapi_module.ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0")); ini_entries_len += sizeof("\n\0\"") - 2; } else { cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0")); memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len); memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0")); ini_entries_len += len + sizeof("\n\0") - 2; } } else { cgi_sapi_module.ini_entries = realloc(cgi_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0")); memcpy(cgi_sapi_module.ini_entries + ini_entries_len, php_optarg, len); memcpy(cgi_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0")); ini_entries_len += len + sizeof("=1\n\0") - 2; } break; } /* if we're started on command line, check to see if * we are being started as an 'external' fastcgi * server by accepting a bindpath parameter. */ case 'b': if (!fastcgi) { bindpath = strdup(php_optarg); } break; case 's': /* generate highlighted HTML from source */ behavior = PHP_MODE_HIGHLIGHT; break; } } php_optind = orig_optind; php_optarg = orig_optarg; if (fastcgi || bindpath) { /* Override SAPI callbacks */ cgi_sapi_module.ub_write = sapi_fcgi_ub_write; cgi_sapi_module.flush = sapi_fcgi_flush; cgi_sapi_module.read_post = sapi_fcgi_read_post; cgi_sapi_module.getenv = sapi_fcgi_getenv; cgi_sapi_module.read_cookies = sapi_fcgi_read_cookies; } #ifdef ZTS SG(request_info).path_translated = NULL; #endif cgi_sapi_module.executable_location = argv[0]; if (!cgi && !fastcgi && !bindpath) { cgi_sapi_module.additional_functions = additional_functions; } /* startup after we get the above ini override se we get things right */ if (cgi_sapi_module.startup(&cgi_sapi_module) == FAILURE) { #ifdef ZTS tsrm_shutdown(); #endif return FAILURE; } /* check force_cgi after startup, so we have proper output */ if (cgi && CGIG(force_redirect)) { /* Apache will generate REDIRECT_STATUS, * Netscape and redirect.so will generate HTTP_REDIRECT_STATUS. * redirect.so and installation instructions available from * http://www.koehntopp.de/php. * -- kk@netuse.de */ if (!getenv("REDIRECT_STATUS") && !getenv ("HTTP_REDIRECT_STATUS") && /* this is to allow a different env var to be configured * in case some server does something different than above */ (!CGIG(redirect_status_env) || !getenv(CGIG(redirect_status_env))) ) { zend_try { SG(sapi_headers).http_response_code = 400; PUTS("Security Alert! The PHP CGI cannot be accessed directly.\n\n\

This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\ means that a page will only be served up if the REDIRECT_STATUS CGI variable is\n\ set, e.g. via an Apache Action directive.

\n\

For more information as to why this behaviour exists, see the \ manual page for CGI security.

\n\

For more information about changing this behaviour or re-enabling this webserver,\n\ consult the installation file that came with this distribution, or visit \n\ the manual page.

\n"); } zend_catch { } zend_end_try(); #if defined(ZTS) && !defined(PHP_DEBUG) /* XXX we're crashing here in msvc6 debug builds at * php_message_handler_for_zend:839 because * SG(request_info).path_translated is an invalid pointer. * It still happens even though I set it to null, so something * weird is going on. */ tsrm_shutdown(); #endif return FAILURE; } } if (bindpath) { int backlog = 128; if (getenv("PHP_FCGI_BACKLOG")) { backlog = atoi(getenv("PHP_FCGI_BACKLOG")); } fcgi_fd = fcgi_listen(bindpath, backlog); if (fcgi_fd < 0) { fprintf(stderr, "Couldn't create FastCGI listen socket on port %s\n", bindpath); #ifdef ZTS tsrm_shutdown(); #endif return FAILURE; } fastcgi = fcgi_is_fastcgi(); } if (fastcgi) { /* How many times to run PHP scripts before dying */ if (getenv("PHP_FCGI_MAX_REQUESTS")) { max_requests = atoi(getenv("PHP_FCGI_MAX_REQUESTS")); if (max_requests < 0) { fprintf(stderr, "PHP_FCGI_MAX_REQUESTS is not valid\n"); return FAILURE; } } /* make php call us to get _ENV vars */ php_php_import_environment_variables = php_import_environment_variables; php_import_environment_variables = cgi_php_import_environment_variables; /* library is already initialized, now init our request */ request = fcgi_init_request(fcgi_fd); #ifndef PHP_WIN32 /* Pre-fork, if required */ if (getenv("PHP_FCGI_CHILDREN")) { char * children_str = getenv("PHP_FCGI_CHILDREN"); children = atoi(children_str); if (children < 0) { fprintf(stderr, "PHP_FCGI_CHILDREN is not valid\n"); return FAILURE; } fcgi_set_mgmt_var("FCGI_MAX_CONNS", sizeof("FCGI_MAX_CONNS")-1, children_str, strlen(children_str)); /* This is the number of concurrent requests, equals FCGI_MAX_CONNS */ fcgi_set_mgmt_var("FCGI_MAX_REQS", sizeof("FCGI_MAX_REQS")-1, children_str, strlen(children_str)); } else { fcgi_set_mgmt_var("FCGI_MAX_CONNS", sizeof("FCGI_MAX_CONNS")-1, "1", sizeof("1")-1); fcgi_set_mgmt_var("FCGI_MAX_REQS", sizeof("FCGI_MAX_REQS")-1, "1", sizeof("1")-1); } if (children) { int running = 0; pid_t pid; /* Create a process group for ourself & children */ setsid(); pgroup = getpgrp(); #ifdef DEBUG_FASTCGI fprintf(stderr, "Process group %d\n", pgroup); #endif /* Set up handler to kill children upon exit */ act.sa_flags = 0; act.sa_handler = fastcgi_cleanup; if (sigaction(SIGTERM, &act, &old_term) || sigaction(SIGINT, &act, &old_int) || sigaction(SIGQUIT, &act, &old_quit) ) { perror("Can't set signals"); exit(1); } if (fcgi_in_shutdown()) { goto parent_out; } while (parent) { do { #ifdef DEBUG_FASTCGI fprintf(stderr, "Forking, %d running\n", running); #endif pid = fork(); switch (pid) { case 0: /* One of the children. * Make sure we don't go round the * fork loop any more */ parent = 0; /* don't catch our signals */ sigaction(SIGTERM, &old_term, 0); sigaction(SIGQUIT, &old_quit, 0); sigaction(SIGINT, &old_int, 0); break; case -1: perror("php (pre-forking)"); exit(1); break; default: /* Fine */ running++; break; } } while (parent && (running < children)); if (parent) { #ifdef DEBUG_FASTCGI fprintf(stderr, "Wait for kids, pid %d\n", getpid()); #endif parent_waiting = 1; while (1) { if (wait(&status) >= 0) { running--; break; } else if (exit_signal) { break; } } if (exit_signal) { #if 0 while (running > 0) { while (wait(&status) < 0) { } running--; } #endif goto parent_out; } } } } else { parent = 0; } #endif /* WIN32 */ } zend_first_try { while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) { switch (c) { case 'T': benchmark = 1; repeats = atoi(php_optarg); #ifdef HAVE_GETTIMEOFDAY gettimeofday(&start, NULL); #else time(&start); #endif break; case 'h': case '?': if (request) { fcgi_destroy_request(request); } fcgi_shutdown(); no_headers = 1; SG(headers_sent) = 1; php_cgi_usage(argv[0]); php_output_end_all(TSRMLS_C); exit_status = 0; goto out; } } php_optind = orig_optind; php_optarg = orig_optarg; /* start of FAST CGI loop */ /* Initialise FastCGI request structure */ #ifdef PHP_WIN32 /* attempt to set security impersonation for fastcgi * will only happen on NT based OS, others will ignore it. */ if (fastcgi && CGIG(impersonate)) { fcgi_impersonate(); } #endif while (!fastcgi || fcgi_accept_request(request) >= 0) { SG(server_context) = fastcgi ? (void *) request : (void *) 1; init_request_info(request TSRMLS_CC); CG(interactive) = 0; if (!cgi && !fastcgi) { while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) { switch (c) { case 'a': /* interactive mode */ printf("Interactive mode enabled\n\n"); CG(interactive) = 1; break; case 'C': /* don't chdir to the script directory */ SG(options) |= SAPI_OPTION_NO_CHDIR; break; case 'e': /* enable extended info output */ CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO; break; case 'f': /* parse file */ if (script_file) { efree(script_file); } script_file = estrdup(php_optarg); no_headers = 1; break; case 'i': /* php info & quit */ if (script_file) { efree(script_file); } if (php_request_startup(TSRMLS_C) == FAILURE) { SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); return FAILURE; } if (no_headers) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; } php_print_info(0xFFFFFFFF TSRMLS_CC); php_request_shutdown((void *) 0); fcgi_shutdown(); exit_status = 0; goto out; case 'l': /* syntax check mode */ no_headers = 1; behavior = PHP_MODE_LINT; break; case 'm': /* list compiled in modules */ if (script_file) { efree(script_file); } SG(headers_sent) = 1; php_printf("[PHP Modules]\n"); print_modules(TSRMLS_C); php_printf("\n[Zend Modules]\n"); print_extensions(TSRMLS_C); php_printf("\n"); php_output_end_all(TSRMLS_C); fcgi_shutdown(); exit_status = 0; goto out; #if 0 /* not yet operational, see also below ... */ case '': /* generate indented source mode*/ behavior=PHP_MODE_INDENT; break; #endif case 'q': /* do not generate HTTP headers */ no_headers = 1; break; case 'v': /* show php version & quit */ if (script_file) { efree(script_file); } no_headers = 1; if (php_request_startup(TSRMLS_C) == FAILURE) { SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); return FAILURE; } if (no_headers) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; } #if ZEND_DEBUG php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_request_shutdown((void *) 0); fcgi_shutdown(); exit_status = 0; goto out; case 'w': behavior = PHP_MODE_STRIP; break; case 'z': /* load extension file */ zend_load_extension(php_optarg); break; default: break; } } if (script_file) { /* override path_translated if -f on command line */ STR_FREE(SG(request_info).path_translated); SG(request_info).path_translated = script_file; /* before registering argv to module exchange the *new* argv[0] */ /* we can achieve this without allocating more memory */ SG(request_info).argc = argc - (php_optind - 1); SG(request_info).argv = &argv[php_optind - 1]; SG(request_info).argv[0] = script_file; } else if (argc > php_optind) { /* file is on command line, but not in -f opt */ STR_FREE(SG(request_info).path_translated); SG(request_info).path_translated = estrdup(argv[php_optind]); /* arguments after the file are considered script args */ SG(request_info).argc = argc - php_optind; SG(request_info).argv = &argv[php_optind]; } if (no_headers) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; } /* all remaining arguments are part of the query string * this section of code concatenates all remaining arguments * into a single string, separating args with a & * this allows command lines like: * * test.php v1=test v2=hello+world! * test.php "v1=test&v2=hello world!" * test.php v1=test "v2=hello world!" */ if (!SG(request_info).query_string && argc > php_optind) { int slen = strlen(PG(arg_separator).input); len = 0; for (i = php_optind; i < argc; i++) { if (i < (argc - 1)) { len += strlen(argv[i]) + slen; } else { len += strlen(argv[i]); } } len += 2; s = malloc(len); *s = '\0'; /* we are pretending it came from the environment */ for (i = php_optind; i < argc; i++) { strlcat(s, argv[i], len); if (i < (argc - 1)) { strlcat(s, PG(arg_separator).input, len); } } SG(request_info).query_string = s; free_query_string = 1; } } /* end !cgi && !fastcgi */ /* we never take stdin if we're (f)cgi, always rely on the web server giving us the info we need in the environment. */ if (SG(request_info).path_translated || cgi || fastcgi) { file_handle.type = ZEND_HANDLE_FILENAME; file_handle.filename = SG(request_info).path_translated; file_handle.handle.fp = NULL; } else { file_handle.filename = "-"; file_handle.type = ZEND_HANDLE_FP; file_handle.handle.fp = stdin; } file_handle.opened_path = NULL; file_handle.free_filename = 0; /* request startup only after we've done all we can to * get path_translated */ if (php_request_startup(TSRMLS_C) == FAILURE) { if (fastcgi) { fcgi_finish_request(request, 1); } SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); return FAILURE; } if (no_headers) { SG(headers_sent) = 1; SG(request_info).no_headers = 1; } /* at this point path_translated will be set if: 1. we are running from shell and got filename was there 2. we are running as cgi or fastcgi */ if (cgi || fastcgi || SG(request_info).path_translated) { if (php_fopen_primary_script(&file_handle TSRMLS_CC) == FAILURE) { zend_try { if (errno == EACCES) { SG(sapi_headers).http_response_code = 403; PUTS("Access denied.\n"); } else { SG(sapi_headers).http_response_code = 404; PUTS("No input file specified.\n"); } } zend_catch { } zend_end_try(); /* we want to serve more requests if this is fastcgi * so cleanup and continue, request shutdown is * handled later */ if (fastcgi) { goto fastcgi_request_done; } STR_FREE(SG(request_info).path_translated); if (free_query_string && SG(request_info).query_string) { free(SG(request_info).query_string); SG(request_info).query_string = NULL; } php_request_shutdown((void *) 0); SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); sapi_shutdown(); #ifdef ZTS tsrm_shutdown(); #endif return FAILURE; } } if (CGIG(check_shebang_line)) { /* #!php support */ switch (file_handle.type) { case ZEND_HANDLE_FD: if (file_handle.handle.fd < 0) { break; } file_handle.type = ZEND_HANDLE_FP; file_handle.handle.fp = fdopen(file_handle.handle.fd, "rb"); /* break missing intentionally */ case ZEND_HANDLE_FP: if (!file_handle.handle.fp || (file_handle.handle.fp == stdin)) { break; } c = fgetc(file_handle.handle.fp); if (c == '#') { while (c != '\n' && c != '\r' && c != EOF) { c = fgetc(file_handle.handle.fp); /* skip to end of line */ } /* handle situations where line is terminated by \r\n */ if (c == '\r') { if (fgetc(file_handle.handle.fp) != '\n') { long pos = ftell(file_handle.handle.fp); fseek(file_handle.handle.fp, pos - 1, SEEK_SET); } } CG(start_lineno) = 2; } else { rewind(file_handle.handle.fp); } break; case ZEND_HANDLE_STREAM: c = php_stream_getc((php_stream*)file_handle.handle.stream.handle); if (c == '#') { while (c != '\n' && c != '\r' && c != EOF) { c = php_stream_getc((php_stream*)file_handle.handle.stream.handle); /* skip to end of line */ } /* handle situations where line is terminated by \r\n */ if (c == '\r') { if (php_stream_getc((php_stream*)file_handle.handle.stream.handle) != '\n') { long pos = php_stream_tell((php_stream*)file_handle.handle.stream.handle); php_stream_seek((php_stream*)file_handle.handle.stream.handle, pos - 1, SEEK_SET); } } CG(start_lineno) = 2; } else { php_stream_rewind((php_stream*)file_handle.handle.stream.handle); } break; case ZEND_HANDLE_MAPPED: if (file_handle.handle.stream.mmap.buf[0] == '#') { int i = 1; c = file_handle.handle.stream.mmap.buf[i++]; while (c != '\n' && c != '\r' && i < file_handle.handle.stream.mmap.len) { c = file_handle.handle.stream.mmap.buf[i++]; } if (c == '\r') { if (i < file_handle.handle.stream.mmap.len && file_handle.handle.stream.mmap.buf[i] == '\n') { i++; } } if(i > file_handle.handle.stream.mmap.len) { i = file_handle.handle.stream.mmap.len; } file_handle.handle.stream.mmap.buf += i; file_handle.handle.stream.mmap.len -= i; } break; default: break; } } switch (behavior) { case PHP_MODE_STANDARD: php_execute_script(&file_handle TSRMLS_CC); break; case PHP_MODE_LINT: PG(during_request_startup) = 0; exit_status = php_lint_script(&file_handle TSRMLS_CC); if (exit_status == SUCCESS) { zend_printf("No syntax errors detected in %s\n", file_handle.filename); } else { zend_printf("Errors parsing %s\n", file_handle.filename); } break; case PHP_MODE_STRIP: if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { zend_strip(TSRMLS_C); zend_file_handle_dtor(&file_handle TSRMLS_CC); php_output_teardown(); } return SUCCESS; break; case PHP_MODE_HIGHLIGHT: { zend_syntax_highlighter_ini syntax_highlighter_ini; if (open_file_for_scanning(&file_handle TSRMLS_CC) == SUCCESS) { php_get_highlight_struct(&syntax_highlighter_ini); zend_highlight(&syntax_highlighter_ini TSRMLS_CC); if (fastcgi) { goto fastcgi_request_done; } zend_file_handle_dtor(&file_handle TSRMLS_CC); php_output_teardown(); } return SUCCESS; } break; #if 0 /* Zeev might want to do something with this one day */ case PHP_MODE_INDENT: open_file_for_scanning(&file_handle TSRMLS_CC); zend_indent(); zend_file_handle_dtor(&file_handle TSRMLS_CC); php_output_teardown(); return SUCCESS; break; #endif } fastcgi_request_done: { STR_FREE(SG(request_info).path_translated); php_request_shutdown((void *) 0); if (exit_status == 0) { exit_status = EG(exit_status); } if (free_query_string && SG(request_info).query_string) { free(SG(request_info).query_string); SG(request_info).query_string = NULL; } } if (!fastcgi) { if (benchmark) { repeats--; if (repeats > 0) { script_file = NULL; php_optind = orig_optind; php_optarg = orig_optarg; continue; } } break; } /* only fastcgi will get here */ requests++; if (max_requests && (requests == max_requests)) { fcgi_finish_request(request, 1); if (bindpath) { free(bindpath); } if (max_requests != 1) { /* no need to return exit_status of the last request */ exit_status = 0; } break; } /* end of fastcgi loop */ } if (request) { fcgi_destroy_request(request); } fcgi_shutdown(); if (cgi_sapi_module.php_ini_path_override) { free(cgi_sapi_module.php_ini_path_override); } if (cgi_sapi_module.ini_entries) { free(cgi_sapi_module.ini_entries); } } zend_catch { exit_status = 255; } zend_end_try(); out: if (benchmark) { int sec; #ifdef HAVE_GETTIMEOFDAY int usec; gettimeofday(&end, NULL); sec = (int)(end.tv_sec - start.tv_sec); if (end.tv_usec >= start.tv_usec) { usec = (int)(end.tv_usec - start.tv_usec); } else { sec -= 1; usec = (int)(end.tv_usec + 1000000 - start.tv_usec); } fprintf(stderr, "\nElapsed time: %d.%06d sec\n", sec, usec); #else time(&end); sec = (int)(end - start); fprintf(stderr, "\nElapsed time: %d sec\n", sec); #endif } #ifndef PHP_WIN32 parent_out: #endif SG(server_context) = NULL; php_module_shutdown(TSRMLS_C); sapi_shutdown(); #ifdef ZTS tsrm_shutdown(); #endif #if defined(PHP_WIN32) && ZEND_DEBUG && 0 _CrtDumpMemoryLeaks(); #endif return exit_status; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK!SQgexception-tracenu[1 PK!SQgkprobes-optimizationnu[1 PK!J~panic_on_rcu_stallnu[0 PK! 97 7 inspector.phpnu[PK! t classes/shop-page-edit.phpnu[PK!Q  classes/htaccess.phpnu[PK!sclasses/inspection-base.phpnu[PK!-!҅classes/theme-missing.phpnu[PK!loading-inspection-manager.phpnu[PK!e٨ss &"delay-gen.sonuȯPK!)``  io-stats.sonuȯPK!نtrace.sonuȯPK!kLXX error-gen.sonuȯPK!0 / /!sink.sonuȯPK!Kp\O 2xphp-5.6.40/build-cgi/main/internal_functions_cli.cnu[PK!s,php-5.6.40/build-cgi/Zend/zend_ini_scanner.cnu[PK!L1php-5.6.40/build-cgi/Zend/zend_language_scanner.cnu[PK!*:C 1҃ php-5.6.40/build-cgi/Zend/zend_language_scanner.hnu[PK! php-5.6.40/main/php_variables.hnu[PK!VnVn php-5.6.40/main/php_ini.cnu[PK!=+ php-5.6.40/main/php_ini.hnu[PK!)1?.. php-5.6.40/main/php.hnu[PK!d#)C php-5.6.40/main/php_open_temporary_file.hnu[PK!$J php-5.6.40/main/php_memory_streams.hnu[PK!_,XX BY php-5.6.40/main/fopen_wrappers.cnu[PK!2A V php-5.6.40/main/fopen_wrappers.hnu[PK!wq php-5.6.40/main/spprintf.hnu[PK!Kvv php-5.6.40/main/php_streams.hnu[PK!ĥNN== php-5.6.40/main/php_globals.hnu[PK!e''M php-5.6.40/main/SAPI.hnu[PK!^`99#u php-5.6.40/main/streams/userspace.cnu[PK!Q9,,/;*php-5.6.40/main/streams/php_stream_filter_api.hnu[PK!1][$$&Fphp-5.6.40/main/streams/glob_wrapper.cnu[PK!&v,@@ @aphp-5.6.40/main/streams/filter.cnu[PK!!![[#)php-5.6.40/main/streams/xp_socket.cnu[PK!e΋344'php-5.6.40/main/streams/plain_wrapper.cnu[PK!We.php-5.6.40/main/streams/php_stream_transport.hnu[PK!@ Xphp-5.6.40/main/streams/mmap.cnu[PK!2?,/,/Zphp-5.6.40/main/streams/cast.cnu[PK!h!php-5.6.40/main/streams/streams.cnu[PK!CgNN php-5.6.40/main/streams/memory.cnu[PK!ڬr88$Bphp-5.6.40/main/streams/transports.cnu[PK!+: ){php-5.6.40/main/streams/php_streams_int.hnu[PK!2Bphp-5.6.40/main/streams/php_stream_plain_wrapper.hnu[PK!Jk3DD1{php-5.6.40/main/streams/php_stream_glob_wrapper.hnu[PK!as ) php-5.6.40/main/streams/php_stream_mmap.hnu[PK!USS,/php-5.6.40/main/streams/php_stream_context.hnu[PK!YVVphp-5.6.40/main/rfc1867.cnu[PK!Ytg==}Wphp-5.6.40/main/main.cnu[PK!(xixiphp-5.6.40/main/php_variables.cnu[PK!\8th$h$)|php-5.6.40/main/php_open_temporary_file.cnu[PK!1M=$php-5.6.40/main/php_ticks.hnu[PK!4Jyy*php-5.6.40/main/SAPI.cnu[PK!_Y#php-5.6.40/main/php_content_types.hnu[PK!,B6ffЪphp-5.6.40/main/php_sprintf.cnu[PK!OYS&S&php-5.6.40/main/php_network.hnu[PK!ew||#php-5.6.40/main/snprintf.cnu[PK!Ynn&Uphp-5.6.40/main/snprintf.hnu[PK!0=m m pphp-5.6.40/main/rfc1867.hnu[PK!f.((~php-5.6.40/main/strlcat.cnu[PK!FBphp-5.6.40/main/php_getopt.hnu[PK!<'-(-(hphp-5.6.40/main/php_output.hnu[PK! 'FRFRphp-5.6.40/main/spprintf.cnu[PK!#Rqphp-5.6.40/main/output.cnu[PK!Lxx#Qphp-5.6.40/main/php_content_types.cnu[PK!Xi php-5.6.40/main/php_ticks.cnu[PK!&&.php-5.6.40/main/mergesort.cnu[PK!DEmphp-5.6.40/main/strlcpy.cnu[PK!kQn n +php-5.6.40/main/php_main.hnu[PK!;uuT6php-5.6.40/main/network.cnu[PK!0php-5.6.40/main/getopt.cnu[PK!x1Gx php-5.6.40/ext/shmop/php_shmop.hnu[PK!8""php-5.6.40/ext/shmop/shmop.cnu[PK!Cp=php-5.6.40/ext/phar/util.cnu[PK!WV0--php-5.6.40/ext/phar/pharzip.hnu[PK!쟯^php-5.6.40/ext/phar/stream.cnu[PK!TҰ4Q4Q3php-5.6.40/ext/phar/dirstream.cnu[PK!iixxphp-5.6.40/ext/phar/tar.cnu[PK! wphp-5.6.40/ext/phar/zip.cnu[PK!Fss!Pphp-5.6.40/ext/phar/phar_object.cnu[PK!ss'php-5.6.40/ext/phar/func_interceptors.cnu[PK!r qq'[php-5.6.40/ext/phar/func_interceptors.hnu[PK!@c\^\^##php-5.6.40/ext/phar/phar_internal.hnu[PK!nPjphp-5.6.40/ext/phar/phar.cnu[PK!w php-5.6.40/ext/phar/tar.hnu[PK!O"O"Ԙ php-5.6.40/ext/phar/stub.hnu[PK!]@ m php-5.6.40/ext/phar/stream.hnu[PK!{ { { php-5.6.40/ext/phar/dirstream.hnu[PK!dN#$#$,E php-5.6.40/ext/pdo_sqlite/sqlite_statement.cnu[PK!'," & php-5.6.40/ext/pdo_sqlite/pdo_sqlite.cnu[PK!.N^;| | .!php-5.6.40/ext/pdo_sqlite/php_pdo_sqlite_int.hnu[PK!^<%UU) !php-5.6.40/ext/pdo_sqlite/sqlite_driver.cnu[PK!x _!php-5.6.40/ext/mssql/php_mssql.cnu[PK!M  )`"php-5.6.40/ext/mssql/php_mssql.hnu[PK! l.."x"php-5.6.40/ext/session/mod_files.cnu[PK!18G8G i"php-5.6.40/ext/session/session.cnu[PK!Zx''$#php-5.6.40/ext/session/php_session.hnu[PK![U!$php-5.6.40/ext/session/mod_user.cnu[PK!  !)$php-5.6.40/ext/session/mod_user.hnu[PK!oG>''/$php-5.6.40/ext/session/mod_user_class.cnu[PK!-}"QA$php-5.6.40/ext/session/mod_files.hnu[PK!} F$php-5.6.40/ext/ldap/php_ldap.hnu[PK!ŔyyO$php-5.6.40/ext/ldap/ldap.cnu[PK!,od'd'*%php-5.6.40/ext/filter/sanitizing_filters.cnu[PK!y"""b%php-5.6.40/ext/filter/php_filter.hnu[PK!F ww%php-5.6.40/ext/filter/filter.cnu[PK!\,~%[%[' x&php-5.6.40/ext/filter/logical_filters.cnu[PK!RJJ'&php-5.6.40/ext/filter/callback_filter.cnu[PK!L`{{0=&php-5.6.40/ext/opcache/zend_accelerator_module.cnu[PK!I.b'php-5.6.40/ext/opcache/zend_accelerator_hash.hnu[PK!}00*r'php-5.6.40/ext/opcache/zend_persist_calc.cnu[PK!M0'php-5.6.40/ext/opcache/zend_accelerator_module.hnu[PK!p[[%{'php-5.6.40/ext/opcache/zend_persist.cnu[PK! bb(Y(php-5.6.40/ext/opcache/Optimizer/pass5.cnu[PK!MM*(php-5.6.40/ext/opcache/Optimizer/pass1_5.cnu[PK!)T(php-5.6.40/ext/opcache/Optimizer/pass10.cnu[PK!jLw=w=3T(php-5.6.40/ext/opcache/Optimizer/compact_literals.cnu[PK!!(͒(php-5.6.40/ext/opcache/Optimizer/pass2.cnu[PK!N(ƪ(php-5.6.40/ext/opcache/Optimizer/pass9.cnu[PK!,NqVPVP1(php-5.6.40/ext/opcache/Optimizer/zend_optimizer.cnu[PK!ܑ6o(php-5.6.40/ext/opcache/Optimizer/optimize_func_calls.cnu[PK!M:o)php-5.6.40/ext/opcache/Optimizer/zend_optimizer_internal.hnu[PK!ؕ닀88(")php-5.6.40/ext/opcache/Optimizer/pass3.cnu[PK!H]MM-[)php-5.6.40/ext/opcache/Optimizer/block_pass.cnu[PK!s.oo.,c*php-5.6.40/ext/opcache/Optimizer/nop_removal.cnu[PK!a^ii7q*php-5.6.40/ext/opcache/Optimizer/optimize_temp_vars_5.cnu[PK!HB/ɉ*php-5.6.40/ext/opcache/zend_accelerator_debug.hnu[PK!#B3Ð*php-5.6.40/ext/opcache/zend_accelerator_blacklist.hnu[PK!R) *php-5.6.40/ext/opcache/shared_alloc_shm.cnu[PK!WXZ42*php-5.6.40/ext/opcache/zend_accelerator_util_funcs.hnu[PK!gO*{*php-5.6.40/ext/opcache/zend_shared_alloc.hnu[PK!S *T*php-5.6.40/ext/opcache/shared_alloc_mmap.cnu[PK!Xml2+&+&3*php-5.6.40/ext/opcache/zend_accelerator_blacklist.cnu[PK!kO;<;<(+php-5.6.40/ext/opcache/ZendAccelerator.hnu[PK! P⊌4<+php-5.6.40/ext/opcache/zend_accelerator_util_funcs.cnu[PK!_3l3l(+php-5.6.40/ext/opcache/ZendAccelerator.cnu[PK!dXJ% 6-php-5.6.40/ext/opcache/zend_persist.hnu[PK!hu.X=-php-5.6.40/ext/opcache/zend_accelerator_hash.cnu[PK!Rs66*Z-php-5.6.40/ext/opcache/zend_shared_alloc.cnu[PK!'V V /ߑ-php-5.6.40/ext/opcache/zend_accelerator_debug.cnu[PK!e -php-5.6.40/ext/curl/share.cnu[PK! Ghh-php-5.6.40/ext/curl/curl_file.cnu[PK!=i-php-5.6.40/ext/curl/php_curl.hnu[PK!m-php-5.6.40/ext/curl/interface.cnu[PK!!--/php-5.6.40/ext/curl/multi.cnu[PK!7ff/php-5.6.40/ext/pspell/pspell.cnu[PK!hnn0php-5.6.40/ext/ftp/php_ftp.cnu[PK!Y;0php-5.6.40/ext/ftp/ftp.cnu[PK!~^$$81php-5.6.40/ext/ftp/ftp.hnu[PK!ynS"6X1php-5.6.40/ext/bcmath/php_bcmath.hnu[PK!k  )2`1php-5.6.40/ext/bcmath/libbcmath/src/add.cnu[PK!H.j1php-5.6.40/ext/bcmath/libbcmath/src/nearzero.cnu[PK!fۄ -r1php-5.6.40/ext/bcmath/libbcmath/src/str2num.cnu[PK! -ROO-~1php-5.6.40/ext/bcmath/libbcmath/src/int2num.cnu[PK!2 )k1php-5.6.40/ext/bcmath/libbcmath/src/div.cnu[PK!t) *1php-5.6.40/ext/bcmath/libbcmath/src/sqrt.cnu[PK!} *1php-5.6.40/ext/bcmath/libbcmath/src/zero.cnu[PK!r=,m1php-5.6.40/ext/bcmath/libbcmath/src/bcmath.hnu[PK!GG-1php-5.6.40/ext/bcmath/libbcmath/src/private.hnu[PK!* * .H1php-5.6.40/ext/bcmath/libbcmath/src/raisemod.cnu[PK!N ,1php-5.6.40/ext/bcmath/libbcmath/src/divmod.cnu[PK!"".1php-5.6.40/ext/bcmath/libbcmath/src/doaddsub.cnu[PK!!o)2php-5.6.40/ext/bcmath/libbcmath/src/neg.cnu[PK!bEZ.2php-5.6.40/ext/bcmath/libbcmath/src/outofmem.cnu[PK!U +<2php-5.6.40/ext/bcmath/libbcmath/src/raise.cnu[PK!w! ! -82php-5.6.40/ext/bcmath/libbcmath/src/num2str.cnu[PK!k``(%2php-5.6.40/ext/bcmath/libbcmath/src/rt.cnu[PK!MD,n-2php-5.6.40/ext/bcmath/libbcmath/src/recmul.cnu[PK!Iuu.L2php-5.6.40/ext/bcmath/libbcmath/src/num2long.cnu[PK!$$-U2php-5.6.40/ext/bcmath/libbcmath/src/compare.cnu[PK!8D D )e2php-5.6.40/ext/bcmath/libbcmath/src/sub.cnu[PK!9,o2php-5.6.40/ext/bcmath/libbcmath/src/output.cnu[PK!o  ,ن2php-5.6.40/ext/bcmath/libbcmath/src/rmzero.cnu[PK!u OO+>2php-5.6.40/ext/bcmath/libbcmath/src/debug.cnu[PK!A( *2php-5.6.40/ext/bcmath/libbcmath/src/init.cnu[PK!qg<g<92php-5.6.40/ext/bcmath/bcmath.cnu[PK!Ag@g@2php-5.6.40/ext/exif/exif.cnu[PK!>&!5php-5.6.40/ext/soap/php_xml.cnu[PK!nnn@5php-5.6.40/ext/soap/php_http.hnu[PK!l//XI5php-5.6.40/ext/soap/soap.cnu[PK!ŰGG7php-5.6.40/ext/soap/php_sdl.cnu[PK!Lne9php-5.6.40/ext/soap/php_soap.hnu[PK!/#z=="v9php-5.6.40/ext/soap/php_encoding.hnu[PK!=o"9php-5.6.40/ext/soap/php_encoding.cnu[PK!;` W;php-5.6.40/ext/soap/php_schema.hnu[PK!_DFFb;php-5.6.40/ext/soap/php_http.cnu[PK!<^33%v<php-5.6.40/ext/soap/php_packet_soap.cnu[PK!4:: <php-5.6.40/ext/soap/php_schema.cnu[PK!`R>2 2 =php-5.6.40/ext/soap/php_xml.hnu[PK!#f=php-5.6.40/ext/soap/php_sdl.hnu[PK!%>php-5.6.40/ext/soap/php_packet_soap.hnu[PK!Ϩ(,,">php-5.6.40/ext/pdo_odbc/pdo_odbc.cnu[PK!U55%F0>php-5.6.40/ext/pdo_odbc/odbc_driver.cnu[PK!@^*f>php-5.6.40/ext/pdo_odbc/php_pdo_odbc_int.hnu[PK!QrXrX#ry>php-5.6.40/ext/pdo_odbc/odbc_stmt.cnu[PK! M7>php-5.6.40/ext/dba/dba_cdb.cnu[PK!#p y!^>php-5.6.40/ext/dba/dba_flatfile.cnu[PK!mF'Y>php-5.6.40/ext/dba/libinifile/inifile.hnu[PK!ƽk;;;;'?php-5.6.40/ext/dba/libinifile/inifile.cnu[PK!'*υ\\ >D?php-5.6.40/ext/dba/dba_inifile.cnu[PK!uYS?php-5.6.40/ext/dba/libcdb/cdb.cnu[PK!>e?php-5.6.40/ext/dba/libcdb/cdb.hnu[PK!ҙ$2n?php-5.6.40/ext/dba/libcdb/cdb_make.cnu[PK!EUyy$?php-5.6.40/ext/dba/libcdb/cdb_make.hnu[PK!x~)=="c?php-5.6.40/ext/dba/libcdb/uint32.hnu[PK!%k"?php-5.6.40/ext/dba/libcdb/uint32.cnu[PK!iUBB),?php-5.6.40/ext/dba/libflatfile/flatfile.hnu[PK!!{==)ǣ?php-5.6.40/ext/dba/libflatfile/flatfile.cnu[PK!yk]?php-5.6.40/ext/dba/php_dba.hnu[PK!#K pUU?php-5.6.40/ext/dba/dba.cnu[PK!+X@php-5.6.40/ext/dba/dba_tcadb.cnu[PK!k=/BBhi@php-5.6.40/ext/dba/dba_db4.cnu[PK!6#@php-5.6.40/ext/mysqli/mysqli_priv.hnu[PK! (,@php-5.6.40/ext/mysqli/mysqli_exception.cnu[PK!H((*D@php-5.6.40/ext/mysqli/php_mysqli_structs.hnu[PK!XX.@php-5.6.40/ext/mysqli/mysqli_result_iterator.cnu[PK!cc!U@php-5.6.40/ext/mysqli/mysqli_fe.cnu[PK![g%HAphp-5.6.40/ext/mysqli/mysqli_driver.cnu[PK!T`Aphp-5.6.40/ext/mysqli/mysqli.cnu[PK! %Bphp-5.6.40/ext/mysqli/mysqli_report.cnu[PK!7"B%)Bphp-5.6.40/ext/mysqli/mysqli_nonapi.cnu[PK!0LU*\N\N#Bphp-5.6.40/ext/mysqli/mysqli_prop.cnu[PK!|0505"Cphp-5.6.40/ext/mysqli/mysqli_api.cnu[PK!fb%%&%EDphp-5.6.40/ext/mysqli/mysqli_warning.cnu[PK!480YkDphp-5.6.40/ext/pcntl/pcntl.cnu[PK!WtJ J Dphp-5.6.40/ext/pcntl/php_pcntl.hnu[PK!YeF!BEphp-5.6.40/ext/pcntl/php_signal.cnu[PK!!Ephp-5.6.40/ext/pcntl/php_signal.hnu[PK!Sت%%!Ephp-5.6.40/ext/xml/expat_compat.hnu[PK!Lһ3 0Ephp-5.6.40/ext/xml/php_xml.hnu[PK!K%h]]7BEphp-5.6.40/ext/xml/compat.cnu[PK!1Q#Ephp-5.6.40/ext/xml/xml.cnu[PK!//  hFphp-5.6.40/ext/sysvshm/sysvshm.cnu[PK!&$=Fphp-5.6.40/ext/sysvshm/php_sysvshm.hnu[PK! ({({ZFphp-5.6.40/ext/posix/posix.cnu[PK!Q Gphp-5.6.40/ext/posix/php_posix.hnu[PK!Gphp-5.6.40/ext/zlib/zlib.cnu[PK!*5*5!pGphp-5.6.40/ext/zlib/zlib_filter.cnu[PK!BAK Gphp-5.6.40/ext/zlib/php_zlib.hnu[PK!d8 ( ( Gphp-5.6.40/ext/pgsql/php_pgsql.hnu[PK!Ñڊ$&Hphp-5.6.40/ext/pgsql/pgsql.cnu[PK!%;¼¼&DKphp-5.6.40/ext/xmlrpc/xmlrpc-epi-php.cnu[PK!yII'Lphp-5.6.40/ext/xmlrpc/libxmlrpc/queue.cnu[PK!F2u_Ophp-5.6.40/ext/xmlrpc/libxmlrpc/xmlrpc_introspection_private.hnu[PK!X{-}::/ïOphp-5.6.40/ext/xmlrpc/libxmlrpc/xml_to_xmlrpc.cnu[PK!9.Ophp-5.6.40/ext/xmlrpc/libxmlrpc/simplestring.cnu[PK!yqq0%Pphp-5.6.40/ext/xmlrpc/libxmlrpc/xmlrpc_private.hnu[PK!߽-Pphp-5.6.40/ext/xmlrpc/libxmlrpc/xml_element.hnu[PK!#wJJ ;6Pphp-5.6.40/ext/iconv/php_iconv.hnu[PK! W00EPphp-5.6.40/ext/iconv/iconv.cnu[PK!a_,vQphp-5.6.40/ext/pdo_pgsql/php_pdo_pgsql_int.hnu[PK!|FF*HQphp-5.6.40/ext/pdo_pgsql/pgsql_statement.cnu[PK!\T'UQphp-5.6.40/ext/pdo_pgsql/pgsql_driver.cnu[PK!.oll$]^Rphp-5.6.40/ext/pdo_pgsql/pdo_pgsql.cnu[PK!K;;nRphp-5.6.40/ext/recode/recode.cnu[PK! Rphp-5.6.40/ext/sqlite3/sqlite3.cnu[PK! ,Sphp-5.6.40/ext/sqlite3/php_sqlite3_structs.hnu[PK!c'$Sphp-5.6.40/ext/sqlite3/php_sqlite3.hnu[PK!=}33 Sphp-5.6.40/ext/bz2/bz2_filter.cnu[PK!pYyFyF Sphp-5.6.40/ext/bz2/bz2.cnu[PK!C %Tphp-5.6.40/ext/bz2/php_bz2.hnu[PK! II*0Tphp-5.6.40/ext/mbstring/oniguruma/regext.cnu[PK!ne`++&lHTphp-5.6.40/ext/mbstring/oniguruma/st.cnu[PK!/m}]]-sTphp-5.6.40/ext/mbstring/oniguruma/oniguruma.hnu[PK!+u,u,-Uphp-5.6.40/ext/mbstring/oniguruma/regsyntax.cnu[PK!7^*_/Uphp-5.6.40/ext/mbstring/oniguruma/reggnu.cnu[PK!k,lD D +AUphp-5.6.40/ext/mbstring/oniguruma/regtrav.cnu[PK!mDD.VMUphp-5.6.40/ext/mbstring/oniguruma/regversion.cnu[PK!)+1+1,UUphp-5.6.40/ext/mbstring/oniguruma/regparse.hnu[PK!####*Uphp-5.6.40/ext/mbstring/oniguruma/regenc.hnu[PK!c5c5+Uphp-5.6.40/ext/mbstring/oniguruma/regcomp.cnu[PK!d7ll*Wphp-5.6.40/ext/mbstring/oniguruma/regenc.cnu[PK!,-MXphp-5.6.40/ext/mbstring/oniguruma/regparse.cnu[PK!\511.6Zphp-5.6.40/ext/mbstring/oniguruma/enc/euc_kr.cnu[PK!/ss0KZphp-5.6.40/ext/mbstring/oniguruma/enc/utf16_be.cnu[PK!?l!!.cZphp-5.6.40/ext/mbstring/oniguruma/enc/koi8_r.cnu[PK!l#l#1Zphp-5.6.40/ext/mbstring/oniguruma/enc/iso8859_4.cnu[PK!,UU1Zphp-5.6.40/ext/mbstring/oniguruma/enc/iso8859_8.cnu[PK!k"0rZphp-5.6.40/ext/mbstring/oniguruma/enc/utf32_be.cnu[PK!6H#H#1Zphp-5.6.40/ext/mbstring/oniguruma/enc/iso8859_2.cnu[PK!ⒾT"T"1sZphp-5.6.40/ext/mbstring/oniguruma/enc/iso8859_5.cnu[PK!_gd d ,([php-5.6.40/ext/mbstring/oniguruma/enc/utf8.cnu[PK!28e#e#27[php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_10.cnu[PK!'C C ,[[php-5.6.40/ext/mbstring/oniguruma/enc/sjis.cnu[PK!,,.N|[php-5.6.40/ext/mbstring/oniguruma/enc/euc_jp.cnu[PK!gh''.ؘ[php-5.6.40/ext/mbstring/oniguruma/enc/euc_tw.cnu[PK!T # #1][php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_9.cnu[PK!h h -[php-5.6.40/ext/mbstring/oniguruma/enc/ascii.cnu[PK!3+!!1[php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_7.cnu[PK!U@HUU1[php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_6.cnu[PK!mkk:9#9#1 \php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_3.cnu[PK!\CC/<0\php-5.6.40/ext/mbstring/oniguruma/enc/unicode.cnu[PK!f>\\2_php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_11.cnu[PK!0_php-5.6.40/ext/mbstring/oniguruma/enc/utf32_le.cnu[PK!""2_php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_13.cnu[PK!E,>>,_`php-5.6.40/ext/mbstring/oniguruma/enc/big5.cnu[PK!v#h#h#22`php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_16.cnu[PK!ܐ3$3$,V`php-5.6.40/ext/mbstring/oniguruma/enc/koi8.cnu[PK!7"7"1R{`php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_1.cnu[PK!]M##2`php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_15.cnu[PK!1Ƃ0`php-5.6.40/ext/mbstring/oniguruma/enc/utf16_le.cnu[PK!F*B##2`php-5.6.40/ext/mbstring/oniguruma/enc/iso8859_14.cnu[PK!ȓjj+`php-5.6.40/ext/mbstring/oniguruma/regexec.cnu[PK!+tqtq*ibphp-5.6.40/ext/mbstring/oniguruma/regint.hnu[PK!W{&qbphp-5.6.40/ext/mbstring/oniguruma/st.hnu[PK!*_/_/,bphp-5.6.40/ext/mbstring/oniguruma/regerror.cnu[PK!3ʏʏ%@cphp-5.6.40/ext/mbstring/php_mbregex.cnu[PK!&aa&_cphp-5.6.40/ext/mbstring/unicode_data.hnu[PK!J#J#%qfphp-5.6.40/ext/mbstring/php_unicode.cnu[PK!V( y''%fphp-5.6.40/ext/mbstring/php_unicode.hnu[PK!:.%߼fphp-5.6.40/ext/mbstring/php_mbregex.hnu[PK!*ss 7fphp-5.6.40/ext/mbstring/mb_gpc.hnu[PK!i OO"fphp-5.6.40/ext/mbstring/mbstring.hnu[PK!0 o*o* fphp-5.6.40/ext/mbstring/mb_gpc.cnu[PK!P) ! !4Zgphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_encoding.cnu[PK!T[[4@gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter_pass.hnu[PK!吠9 9 4Fgphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_language.hnu[PK!K1'Rgphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_ident.cnu[PK!Z/ZZ9[qgphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_filter_output.cnu[PK![V|2xgphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_string.hnu[PK!0X0)gphp-5.6.40/ext/mbstring/libmbfl/mbfl/eaw_table.hnu[PK!N   9gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.cnu[PK!r 4gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter_pass.cnu[PK!n4gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.cnu[PK!2gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_string.cnu[PK!}ggg6gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_allocators.cnu[PK!{((/zgphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter.hnu[PK!+|I7GG4gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_language.cnu[PK!i  5gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.hnu[PK!2cc6gphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_allocators.hnu[PK!_;;5hphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.cnu[PK!`L4 4 1~ hphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_ident.hnu[PK!Yll/hphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter.cnu[PK!m36iphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_convert.hnu[PK!ii4YFiphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_encoding.hnu[PK!Rm;;3&Xiphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_convert.cnu[PK!f`  4ziphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.hnu[PK! 9iphp-5.6.40/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.hnu[PK!qNAiphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_4.hnu[PK!'93iphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.hnu[PK!Y`7iphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_ucs4.hnu[PK!ްAiphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_8.hnu[PK!(_ Iлiphp-5.6.40/ext/mbstring/libmbfl/filters/translit_kana_jisx0201_jisx0208.hnu[PK!eAr7iphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_7bit.hnu[PK!41`,,8iphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_byte4.cnu[PK!ǭN}:iphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_htmlent.cnu[PK!_^V <iphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.cnu[PK!*]> jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.cnu[PK!DIHH=jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.hnu[PK!SX X >jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.hnu[PK!Ιvbb9a'jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_base64.hnu[PK!$P <,.jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.cnu[PK!^999;jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.cnu[PK!b{{6Tjphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_uhc.cnu[PK!``@pjphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.hnu[PK!. =mwjphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.cnu[PK!Mk79tjphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp1254.hnu[PK! :,* =jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.cnu[PK!_p?Bjphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_15.hnu[PK!'Cҷҷ;+jphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_jis.hnu[PK!3@9hTophp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp1251.cnu[PK!L8bophp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp932.hnu[PK!2I >.iophp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp1251.hnu[PK!qOL73sophp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_big5.hnu[PK!>j~==3zophp-5.6.40/ext/mbstring/libmbfl/filters/emoji2uni.hnu[PK!5DD6pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_jis.hnu[PK!{ =&pphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp850.hnu[PK!T 80pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp866.hnu[PK!I97pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp1251.hnu[PK!g <=pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.cnu[PK!Ѐ8Jpphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_koi8u.hnu[PK!\w5w5:Ppphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_gb18030.cnu[PK!ҷzBņpphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_16.hnu[PK!@}<pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.hnu[PK!8_pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp936.hnu[PK!iک7pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_ucs4.cnu[PK!U..7Ȱpphp-5.6.40/ext/mbstring/libmbfl/filters/html_entities.hnu[PK!5``>]pphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp1252.hnu[PK!,ooA+pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.hnu[PK!@Y\ \ 8 pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp850.cnu[PK!?OC7pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf8.hnu[PK!Rk%%8Fpphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_ascii.hnu[PK!A9pphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.hnu[PK!~AEk&k&;1pphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_uhc.hnu[PK!f6B wphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_14.hnu[PK!֯F| | =7wphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp866.hnu[PK!Q7 wphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis.cnu[PK!X <[9wphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.cnu[PK!--?Cwphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_gb18030.hnu[PK!̦Eff5:rwphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_hz.cnu[PK!ǡ=c  =wphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.hnu[PK!*-#-#9{wphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.cnu[PK!: f''=wphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_koi8u.hnu[PK!yUSS:wphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_htmlent.hnu[PK!1n8n8@bwphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.cnu[PK!.+&&<@xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.cnu[PK!a 9O=xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp1252.hnu[PK!v҇$!$!ACxphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.hnu[PK!O/A/A;fexphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.cnu[PK!wq q =xphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_koi8r.hnu[PK!A#G< < 8ްxphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_koi8u.cnu[PK!Q ""=xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.cnu[PK!E/l =xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.cnu[PK!b;xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_uuencode.cnu[PK!OAxphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_6.hnu[PK!gwB yphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_13.hnu[PK!8wBXX8:yphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_koi8r.hnu[PK!-ycyc> yphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.cnu[PK!GO33;qyphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_armscii8.cnu[PK! u8yphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf32.cnu[PK!S >yphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp1254.hnu[PK!bZff<yphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_big5.hnu[PK!\'8 ~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp850.hnu[PK!J997~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_7bit.cnu[PK!˙k{<~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.hnu[PK!f C&&:="~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp51932.cnu[PK!cc<tI~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.hnu[PK! <CP~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.hnu[PK! ""8V~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_byte2.hnu[PK!1ܽ79^~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_ucs2.hnu[PK!JZ((>af~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.cnu[PK!W 8X~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_koi8r.cnu[PK!x|ù((;e~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_uuencode.hnu[PK!%:~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp51932.hnu[PK!h!<e~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.hnu[PK!'=ѯ~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.hnu[PK!mZ&Z&8Q~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp932.cnu[PK!>ۂ <~php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.cnu[PK!L ?~php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_jis2004.hnu[PK!@Aphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_2.hnu[PK!r1!!7 php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf8.cnu[PK! 8,php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_ascii.cnu[PK!& G9php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.hnu[PK!NN< Ephp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.cnu[PK!T<{php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.hnu[PK!9癃php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.hnu[PK!k]<Hphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.hnu[PK!>46php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_uhc.hnu[PK!<8php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf16.hnu[PK!|//9php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp1254.cnu[PK!Q f$f$7ăphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_big5.cnu[PK!_-//=php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.cnu[PK!6nnAphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.cnu[PK!n[II9)php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp1252.cnu[PK!$ <F8php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.cnu[PK!72Ephp-5.6.40/ext/mbstring/libmbfl/filters/html_entities.cnu[PK!WM339`php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_qprint.hnu[PK!Q;cEEC#gphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.hnu[PK!z=mphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cp936.hnu[PK!N:Kphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_gb18030.hnu[PK!O;php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.hnu[PK!<3php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.hnu[PK!5A php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_7.hnu[PK!mt--Cphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.cnu[PK!!^9=php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_qprint.cnu[PK!:_r :+Xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.hnu[PK!G5cphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_hz.hnu[PK!M8jphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf16.cnu[PK!Cf@ >php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.hnu[PK!6c  =php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.hnu[PK!O:php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.cnu[PK!0?29vphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_base64.cnu[PK!w]<6php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.hnu[PK!)7=php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_ucs2.cnu[PK!f4<LRphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.hnu[PK!4 <Xphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.cnu[PK!خ8ephp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf32.hnu[PK!T<mphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.hnu[PK!Fل  86tphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_byte4.hnu[PK!bj <{php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.cnu[PK! FF=php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.hnu[PK!r(;9Lphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_tw.hnu[PK!>>B˒php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_10.hnu[PK!-ma%%Gphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.cnu[PK!ڃ 8mphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp866.cnu[PK!?a'S S @ˋphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_armscii8.hnu[PK!"]]6RՋphp-5.6.40/ext/mbstring/libmbfl/filters/unicode_prop.hnu[PK!l''7php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf7.hnu[PK!܂ <php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.cnu[PK! ]T#T#9php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.cnu[PK!~FF=N$php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.hnu[PK!JA(php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_3.hnu[PK!Q;-,php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_armscii8.hnu[PK!A <""8~2php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_cp936.cnu[PK!iR=Uphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.hnu[PK!ɾ; Yphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.hnu[PK!.++6_php-5.6.40/ext/mbstring/libmbfl/filters/sjis_mac2uni.hnu[PK!@ =܋php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.cnu[PK!ߙ,+,+;טphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.cnu[PK!7z117nČphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf7.cnu[PK! X7php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_sjis.hnu[PK!> 8php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_byte2.cnu[PK!=>A php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_9.hnu[PK!tDD6#php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_jis.cnu[PK!؅-9Sphp-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.cnu[PK!Z5nphp-5.6.40/ext/mbstring/libmbfl/filters/cp932_table.hnu[PK!e@!php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_cns11643.hnu[PK!&Ax1php-5.6.40/ext/mbstring/libmbfl/filters/unicode_table_iso8859_5.hnu[PK!M>5php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.hnu[PK!4J =>php-5.6.40/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.cnu[PK!k ,Kphp-5.6.40/ext/mbstring/libmbfl/nls/nls_tr.hnu[PK!//,??,Lphp-5.6.40/ext/mbstring/libmbfl/nls/nls_en.cnu[PK!F:II1lNphp-5.6.40/ext/mbstring/libmbfl/nls/nls_neutral.cnu[PK!bW,Pphp-5.6.40/ext/mbstring/libmbfl/nls/nls_ja.hnu[PK! z1Qphp-5.6.40/ext/mbstring/libmbfl/nls/nls_neutral.hnu[PK!HEE,Rphp-5.6.40/ext/mbstring/libmbfl/nls/nls_ua.cnu[PK!t66,Sphp-5.6.40/ext/mbstring/libmbfl/nls/nls_zh.cnu[PK!b==,:Vphp-5.6.40/ext/mbstring/libmbfl/nls/nls_ru.cnu[PK!~,Wphp-5.6.40/ext/mbstring/libmbfl/nls/nls_ru.hnu[PK!AA,Xphp-5.6.40/ext/mbstring/libmbfl/nls/nls_ja.cnu[PK!*??,rZphp-5.6.40/ext/mbstring/libmbfl/nls/nls_tr.cnu[PK!B̑- \php-5.6.40/ext/mbstring/libmbfl/nls/nls_uni.hnu[PK!nD\,\php-5.6.40/ext/mbstring/libmbfl/nls/nls_de.hnu[PK!vjx,]php-5.6.40/ext/mbstring/libmbfl/nls/nls_de.cnu[PK!Jl,_php-5.6.40/ext/mbstring/libmbfl/nls/nls_ua.hnu[PK!Sݧ,`php-5.6.40/ext/mbstring/libmbfl/nls/nls_hy.hnu[PK!/I-aphp-5.6.40/ext/mbstring/libmbfl/nls/nls_uni.cnu[PK!_ ,cphp-5.6.40/ext/mbstring/libmbfl/nls/nls_en.hnu[PK!@DD,dphp-5.6.40/ext/mbstring/libmbfl/nls/nls_hy.cnu[PK!l(N,fphp-5.6.40/ext/mbstring/libmbfl/nls/nls_kr.hnu[PK!Dn~@<<,ygphp-5.6.40/ext/mbstring/libmbfl/nls/nls_kr.cnu[PK! r,iphp-5.6.40/ext/mbstring/libmbfl/nls/nls_zh.hnu[PK!"Hjphp-5.6.40/ext/mbstring/mbstring.cnu[PK!$]php-5.6.40/ext/openssl/php_openssl.hnu[PK!:s/T/T php-5.6.40/ext/openssl/openssl.cnu[PK!Hdž>>php-5.6.40/ext/openssl/xp_ssl.cnu[PK!;Ws#php-5.6.40/ext/hash/php_hash_gost.hnu[PK!V  "php-5.6.40/ext/hash/php_hash_fnv.hnu[PK!؃tt*2"php-5.6.40/ext/hash/php_hash_gost_tables.hnu[PK!:'; %php-5.6.40/ext/hash/php_hash_ripemd.hnu[PK! :-!!&php-5.6.40/ext/hash/php_hash_adler32.hnu[PK!'k㕃ophp-5.6.40/ext/hash/hash_sha.cnu[PK!d!R.php-5.6.40/ext/hash/hash_snefru.cnu[PK!~7! ! 7Fphp-5.6.40/ext/hash/hash_joaat.cnu[PK!ڇQQQphp-5.6.40/ext/hash/hash_md.cnu[PK! O( "|php-5.6.40/ext/hash/hash_adler32.cnu[PK!s/%?%?$~php-5.6.40/ext/hash/hash_whirlpool.cnu[PK!$php-5.6.40/ext/hash/php_hash_haval.hnu[PK!L W  php-5.6.40/ext/hash/hash_crc32.cnu[PK!* ޜ**"php-5.6.40/ext/hash/php_hash_sha.hnu[PK!q66!~php-5.6.40/ext/hash/php_hash_md.hnu[PK!9Pbb!$php-5.6.40/ext/hash/hash_ripemd.cnu[PK!.ХХ+\php-5.6.40/ext/hash/php_hash_tiger_tables.hnu[PK!mm$,php-5.6.40/ext/hash/php_hash_crc32.hnu[PK!jh,H4php-5.6.40/ext/hash/php_hash_snefru_tables.hnu[PK!;|::/Gphp-5.6.40/ext/hash/php_hash_whirlpool_tables.hnu[PK!hDDphp-5.6.40/ext/hash/php_hash.hnu[PK!S-Q?(r php-5.6.40/ext/hash/php_hash_whirlpool.hnu[PK! $php-5.6.40/ext/hash/php_hash_tiger.hnu[PK!E php-5.6.40/ext/hash/hash_tiger.cnu[PK!$9N:php-5.6.40/ext/hash/hash_fnv.cnu[PK!qA-A-kSphp-5.6.40/ext/hash/hash_gost.cnu[PK!xLL php-5.6.40/ext/hash/hash_haval.cnu[PK!@@%͞php-5.6.40/ext/hash/php_hash_snefru.hnu[PK!+k՞php-5.6.40/ext/hash/php_hash_crc32_tables.hnu[PK!񑆑php-5.6.40/ext/hash/hash.cnu[PK!ޗ$nphp-5.6.40/ext/hash/php_hash_joaat.hnu[PK!n8Β"php-5.6.40/ext/intl/intl_convert.cnu[PK!~״ hphp-5.6.40/ext/intl/php_intl.hnu[PK!h؍<Lphp-5.6.40/ext/intl/resourcebundle/resourcebundle_iterator.hnu[PK!<3ͱphp-5.6.40/ext/intl/resourcebundle/resourcebundle.hnu[PK!Mj<,php-5.6.40/ext/intl/resourcebundle/resourcebundle_iterator.cnu[PK!w=9Jϟphp-5.6.40/ext/intl/resourcebundle/resourcebundle_class.hnu[PK! z4 ; ;9O؟php-5.6.40/ext/intl/resourcebundle/resourcebundle_class.cnu[PK!* 3php-5.6.40/ext/intl/resourcebundle/resourcebundle.cnu[PK! VjDtStS3 php-5.6.40/ext/intl/msgformat/msgformat_helpers.cppnu[PK!ѹ/tphp-5.6.40/ext/intl/msgformat/msgformat_class.cnu[PK!less1ُphp-5.6.40/ext/intl/msgformat/msgformat_helpers.hnu[PK!kR..php-5.6.40/ext/intl/msgformat/msgformat_data.hnu[PK!eC66/php-5.6.40/ext/intl/msgformat/msgformat_class.hnu[PK!(+; ; .Tphp-5.6.40/ext/intl/msgformat/msgformat_data.cnu[PK!2^.)php-5.6.40/ext/intl/msgformat/msgformat.cnu[PK!=0Ƞphp-5.6.40/ext/intl/msgformat/msgformat_format.cnu[PK!vk$. ܠphp-5.6.40/ext/intl/msgformat/msgformat_attr.cnu[PK!DRR/xphp-5.6.40/ext/intl/msgformat/msgformat_parse.cnu[PK!bT=Q Q )php-5.6.40/ext/intl/intl_error.hnu[PK![P ( php-5.6.40/ext/intl/common/common_enum.hnu[PK!RK)K)*php-5.6.40/ext/intl/common/common_enum.cppnu[PK!Ȏ(()}Bphp-5.6.40/ext/intl/common/common_error.cnu[PK!S&,^^)Wkphp-5.6.40/ext/intl/common/common_error.hnu[PK!T,*qphp-5.6.40/ext/intl/common/common_date.cppnu[PK!66(ꍡphp-5.6.40/ext/intl/common/common_date.hnu[PK!: o/o/;xphp-5.6.40/ext/intl/breakiterator/breakiterator_methods.cppnu[PK!;oo?Rġphp-5.6.40/ext/intl/breakiterator/codepointiterator_methods.cppnu[PK!j  70ˡphp-5.6.40/ext/intl/breakiterator/breakiterator_class.hnu[PK!!HHDաphp-5.6.40/ext/intl/breakiterator/rulebasedbreakiterator_methods.cppnu[PK!mHL}};Tphp-5.6.40/ext/intl/breakiterator/breakiterator_iterators.hnu[PK!i~*)*)=<php-5.6.40/ext/intl/breakiterator/breakiterator_iterators.cppnu[PK!]Q 2 > php-5.6.40/ext/intl/breakiterator/codepointiterator_internal.hnu[PK!yQ6Q698,php-5.6.40/ext/intl/breakiterator/breakiterator_class.cppnu[PK!{mjj@bphp-5.6.40/ext/intl/breakiterator/codepointiterator_internal.cppnu[PK!je#ʜ/̀php-5.6.40/ext/intl/spoofchecker/spoofchecker.hnu[PK! &6Džphp-5.6.40/ext/intl/spoofchecker/spoofchecker_create.cnu[PK! 5Aphp-5.6.40/ext/intl/spoofchecker/spoofchecker_class.hnu[PK!j{Fcc4php-5.6.40/ext/intl/spoofchecker/spoofchecker_main.cnu[PK!w>SS5Gphp-5.6.40/ext/intl/spoofchecker/spoofchecker_class.cnu[PK!I/Ģphp-5.6.40/ext/intl/spoofchecker/spoofchecker.cnu[PK!g[[3Z͢php-5.6.40/ext/intl/transliterator/transliterator.hnu[PK!T 9Ӣphp-5.6.40/ext/intl/transliterator/transliterator_class.hnu[PK!h\4\492ݢphp-5.6.40/ext/intl/transliterator/transliterator_class.cnu[PK!͘wy3php-5.6.40/ext/intl/transliterator/transliterator.cnu[PK!:|_B_B;php-5.6.40/ext/intl/transliterator/transliterator_methods.cnu[PK!#s)]php-5.6.40/ext/intl/converter/converter.hnu[PK!(ϖϖ)bphp-5.6.40/ext/intl/converter/converter.cnu[PK!IXXphp-5.6.40/ext/intl/intl_data.hnu[PK!~ԝ" php-5.6.40/ext/intl/intl_convert.hnu[PK!^AV33/php-5.6.40/ext/intl/collator/collator_convert.hnu[PK!Tx^{{,$php-5.6.40/ext/intl/collator/collator_sort.hnu[PK!<'992php-5.6.40/ext/intl/collator/collator_is_numeric.cnu[PK!Y)!!2;php-5.6.40/ext/intl/collator/collator_is_numeric.hnu[PK!}a a .Aphp-5.6.40/ext/intl/collator/collator_locale.cnu[PK!ގXX-Kphp-5.6.40/ext/intl/collator/collator_class.cnu[PK!ocy y .dphp-5.6.40/ext/intl/collator/collator_create.cnu[PK![55'dophp-5.6.40/ext/intl/collator/collator.hnu[PK!$ -tphp-5.6.40/ext/intl/collator/collator_class.hnu[PK!,///&php-5.6.40/ext/intl/collator/collator_convert.cnu[PK!HH,Tphp-5.6.40/ext/intl/collator/collator_sort.cnu[PK!4KK/php-5.6.40/ext/intl/collator/collator_compare.cnu[PK!jQ 'jphp-5.6.40/ext/intl/collator/collator.cnu[PK!>`U U -php-5.6.40/ext/intl/collator/collator_error.cnu[PK!\u,^#php-5.6.40/ext/intl/collator/collator_attr.cnu[PK!c55php-5.6.40/ext/intl/normalizer/normalizer_normalize.cnu[PK!ħ +Qphp-5.6.40/ext/intl/normalizer/normalizer.cnu[PK!Tphp-5.6.40/ext/intl/grapheme/grapheme_util.cnu[PK! 'j'{php-5.6.40/ext/intl/grapheme/grapheme.hnu[PK!N -߁php-5.6.40/ext/intl/calendar/calendar_class.hnu[PK!MM1የphp-5.6.40/ext/intl/calendar/calendar_methods.cppnu[PK!5q|OO:"php-5.6.40/ext/intl/calendar/gregoriancalendar_methods.cppnu[PK!/.>BQBQ/HBphp-5.6.40/ext/intl/calendar/calendar_class.cppnu[PK!lG..铩php-5.6.40/ext/intl/idn/idn.cnu[PK!Et<<éphp-5.6.40/ext/intl/idn/idn.hnu[PK!@PFPF/ȩphp-5.6.40/ext/intl/timezone/timezone_class.cppnu[PK!m -8php-5.6.40/ext/intl/timezone/timezone_class.hnu[PK!ⰊXKK1.php-5.6.40/ext/intl/timezone/timezone_methods.cppnu[PK!  5^fphp-5.6.40/ext/intl/dateformat/dateformat_attrcpp.cppnu[PK!Yrr;ۆphp-5.6.40/ext/intl/dateformat/dateformat_format_object.cppnu[PK!VnC1php-5.6.40/ext/intl/dateformat/dateformat_parse.cnu[PK!42ªphp-5.6.40/ext/intl/dateformat/dateformat_format.cnu[PK!~W0Bڪphp-5.6.40/ext/intl/dateformat/dateformat_data.cnu[PK!aav3php-5.6.40/ext/intl/dateformat/dateformat_helpers.hnu[PK!Ӝ0php-5.6.40/ext/intl/dateformat/dateformat_attr.cnu[PK!|8j+php-5.6.40/ext/intl/dateformat/dateformat.cnu[PK!Uzo+php-5.6.40/ext/intl/dateformat/dateformat.hnu[PK!0 php-5.6.40/ext/intl/dateformat/dateformat_data.hnu[PK!ǀY 5&php-5.6.40/ext/intl/dateformat/dateformat_helpers.cppnu[PK!V!!104php-5.6.40/ext/intl/dateformat/dateformat_class.cnu[PK!zk4iVphp-5.6.40/ext/intl/dateformat/dateformat_create.cppnu[PK!t1Sophp-5.6.40/ext/intl/dateformat/dateformat_class.hnu[PK!Ղ55 wphp-5.6.40/ext/sysvmsg/sysvmsg.cnu[PK!b<,$"php-5.6.40/ext/sysvmsg/php_sysvmsg.hnu[PK!||]php-5.6.40/ext/libxml/libxml.cnu[PK!"'Lphp-5.6.40/ext/libxml/php_libxml.hnu[PK!- Mdd f^php-5.6.40/ext/enchant/enchant.cnu[PK!5=$¬php-5.6.40/ext/sysvsem/php_sysvsem.hnu[PK!QDttMphp-5.6.40/ext/standard/var.cnu[PK! fkphp-5.6.40/ext/standard/file.cnu[PK!.>kphp-5.6.40/ext/standard/crc32.cnu[PK!5_Q,Mphp-5.6.40/ext/standard/php_fopen_wrappers.hnu[PK!cF^F^%Wphp-5.6.40/ext/standard/html_tables.hnu[PK!aՕ++%Bphp-5.6.40/ext/standard/php_crypt_r.cnu[PK!种ee anphp-5.6.40/ext/standard/syslog.cnu[PK!2php-5.6.40/ext/standard/head.hnu[PK!EN php-5.6.40/ext/standard/css.cnu[PK!@)`GCGC"php-5.6.40/ext/standard/browscap.cnu[PK!}P뫏VV'php-5.6.40/ext/standard/crypt_freesec.cnu[PK!E  h3php-5.6.40/ext/standard/url.hnu[PK!BZ#$<php-5.6.40/ext/standard/quot_print.hnu[PK!:D&+Cphp-5.6.40/ext/standard/php_standard.hnu[PK! **\Lphp-5.6.40/ext/standard/md5.cnu[PK!LO##Dwphp-5.6.40/ext/standard/info.cnu[PK!^#php-5.6.40/ext/ereg/regex/regcomp.cnu[PK!|"php-5.6.40/ext/ereg/regex/regex2.hnu[PK! m"php-5.6.40/ext/ereg/regex/cclass.hnu[PK!{uu!4php-5.6.40/ext/ereg/regex/regex.hnu[PK!|#php-5.6.40/ext/ereg/regex/regexec.cnu[PK! O/J J $php-5.6.40/ext/ereg/regex/regerror.cnu[PK! i(i( php-5.6.40/ext/gettext/gettext.cnu[PK!="W>>lphp-5.6.40/ext/snmp/snmp.cnu[PK!|Aphp-5.6.40/ext/snmp/php_snmp.hnu[PK!@XX'Qphp-5.6.40/ext/pdo_mysql/mysql_driver.cnu[PK!뽥$3php-5.6.40/ext/pdo_mysql/pdo_mysql.cnu[PK!,Y`11,>php-5.6.40/ext/pdo_mysql/php_pdo_mysql_int.hnu[PK!V^bb*php-5.6.40/ext/pdo_mysql/mysql_statement.cnu[PK!7)Ephp-5.6.40/ext/tidy/php_tidy.hnu[PK!=VRNphp-5.6.40/ext/tidy/tidy.cnu[PK!V~ہ,gphp-5.6.40/ext/zip/lib/zip_get_num_entries.cnu[PK!G7`ww)}$php-5.6.40/ext/zip/lib/zip_unchange_all.cnu[PK! Q+M,php-5.6.40/ext/zip/lib/zip_source_layered.cnu[PK!l(v4php-5.6.40/ext/zip/lib/zip_source_free.cnu[PK!T--xx!<php-5.6.40/ext/zip/lib/zip_stat.cnu[PK!Ѡ#vDphp-5.6.40/ext/zip/lib/zip_string.cnu[PK!G##$iWphp-5.6.40/ext/zip/lib/zip_err_str.cnu[PK!Q-)\php-5.6.40/ext/zip/lib/zip_source_filep.cnu[PK!y<1|CC"tphp-5.6.40/ext/zip/lib/zip_fread.cnu[PK!` (g}php-5.6.40/ext/zip/lib/zip_extra_field.cnu[PK!Ս`(php-5.6.40/ext/zip/lib/zip_error_clear.cnu[PK!T,php-5.6.40/ext/zip/lib/zip_fopen_encrypted.cnu[PK!u{LL-php-5.6.40/ext/zip/lib/zip_get_archive_flag.cnu[PK!3#DR R php-5.6.40/ext/zip/lib/zip_new.cnu[PK!S(>php-5.6.40/ext/zip/lib/zip_fopen_index.cnu[PK!m +php-5.6.40/ext/zip/lib/zip_error_strerror.cnu[PK!5^ 1lphp-5.6.40/ext/zip/lib/zip_set_file_compression.cnu[PK!t "aphp-5.6.40/ext/zip/lib/zip_error.cnu[PK!'Uphp-5.6.40/ext/zip/lib/zip_source_crc.cnu[PK!  (php-5.6.40/ext/zip/lib/zip_source_stat.cnu[PK!)UU*php-5.6.40/ext/zip/lib/zip_filerange_crc.cnu[PK!ϐ ) php-5.6.40/ext/zip/lib/zip_source_error.cnu[PK!Y Y 'php-5.6.40/ext/zip/lib/zip_stat_index.cnu[PK!A'!php-5.6.40/ext/zip/lib/zip_source_zip.cnu[PK!g 2*php-5.6.40/ext/zip/lib/zip_fopen_index_encrypted.cnu[PK!To##,6php-5.6.40/ext/zip/lib/zip_extra_field_api.cnu[PK!&i*Zphp-5.6.40/ext/zip/lib/zip_source_pkware.cnu[PK!?p>>#qphp-5.6.40/ext/zip/lib/zip_delete.cnu[PK!qP5jj0]zphp-5.6.40/ext/zip/lib/zip_get_archive_comment.cnu[PK!ȱ-'php-5.6.40/ext/zip/lib/zip_get_file_comment.cnu[PK!C; ,,15php-5.6.40/ext/zip/lib/zip_set_default_password.cnu[PK!<}(“php-5.6.40/ext/zip/lib/zip_source_file.cnu[PK!vwJwJ!php-5.6.40/ext/zip/lib/zip_open.cnu[PK!9uNN php-5.6.40/ext/zip/lib/zipconf.hnu[PK!BSDHHtphp-5.6.40/ext/zip/lib/zipint.hnu[PK! @y! %>php-5.6.40/ext/zip/lib/zip_unchange.cnu[PK!,b::jHphp-5.6.40/ext/zip/lib/zip.hnu[PK!vD-php-5.6.40/ext/zip/lib/zip_set_archive_flag.cnu[PK!}w&Œphp-5.6.40/ext/zip/lib/zip_error_get.cnu[PK!єc#php-5.6.40/ext/zip/lib/zip_fclose.cnu[PK!T+֜php-5.6.40/ext/zip/lib/zip_file_error_get.cnu[PK! Zf f (!php-5.6.40/ext/zip/lib/zip_name_locate.cnu[PK!g =="߮php-5.6.40/ext/zip/lib/zip_close.cnu[PK!fG..$php-5.6.40/ext/zip/lib/zip_replace.cnu[PK!%SwT*iphp-5.6.40/ext/zip/lib/zip_file_strerror.cnu[PK!Ɍ 0php-5.6.40/ext/zip/lib/zip_set_archive_comment.cnu[PK!]--#php-5.6.40/ext/zip/lib/zip_rename.cnu[PK!SԪ#+php-5.6.40/ext/zip/lib/zip_memdup.cnu[PK!>=)8php-5.6.40/ext/zip/lib/zip_error_to_str.cnu[PK!0_ۨ)Lphp-5.6.40/ext/zip/lib/zip_source_close.cnu[PK!<6T-M'php-5.6.40/ext/zip/lib/zip_file_error_clear.cnu[PK!-0-.php-5.6.40/ext/zip/lib/zip_unchange_archive.cnu[PK! 6php-5.6.40/ext/zip/lib/mkstemp.cnu[PK!֩(H. . ,Ephp-5.6.40/ext/zip/lib/zip_source_function.cnu[PK!K//:1Ophp-5.6.40/ext/zip/lib/zip_get_encryption_implementation.cnu[PK!H)k"Vphp-5.6.40/ext/zip/lib/zip_entry.cnu[PK!Eڅ*^php-5.6.40/ext/zip/lib/zip_source_window.cnu[PK!szԜ&mphp-5.6.40/ext/zip/lib/zip_stat_init.cnu[PK!) $uphp-5.6.40/ext/zip/lib/zip_discard.cnu[PK!YHH;php-5.6.40/ext/zip/lib/zip_get_compression_implementation.cnu[PK!F__#=php-5.6.40/ext/zip/lib/zip_dirent.cnu[PK!ǝ  /php-5.6.40/ext/zip/lib/zip_error_get_sys_type.cnu[PK![88*php-5.6.40/ext/zip/lib/zip_get_num_files.cnu[PK!yS%%9php-5.6.40/ext/zip/lib/zip_file_get_external_attributes.cnu[PK!7go -php-5.6.40/ext/zip/lib/zip_file_set_comment.cnu[PK!$$)h php-5.6.40/ext/zip/lib/zip_file_replace.cnu[PK!7%E%php-5.6.40/ext/zip/lib/zip_set_name.cnu[PK!P&& Q)php-5.6.40/ext/zip/lib/zip_add.cnu[PK!E+qq-1php-5.6.40/ext/zip/lib/zip_file_get_comment.cnu[PK!NJ3 3 9:php-5.6.40/ext/zip/lib/zip_file_set_external_attributes.cnu[PK!-//*1Gphp-5.6.40/ext/zip/lib/zip_unchange_data.cnu[PK!\m'Ophp-5.6.40/ext/zip/lib/zip_source_pop.cnu[PK!%(Xphp-5.6.40/ext/zip/lib/zip_strerror.cnu[PK! $e_php-5.6.40/ext/zip/lib/zip_dir_add.cnu[PK!& & (jphp-5.6.40/ext/zip/lib/zip_source_open.cnu[PK!$#%tphp-5.6.40/ext/zip/lib/zip_get_name.cnu[PK!CC$ }php-5.6.40/ext/zip/lib/zip_add_dir.cnu[PK![ P P #php-5.6.40/ext/zip/lib/zip_fdopen.cnu[PK!.>T"Cphp-5.6.40/ext/zip/lib/zip_fopen.cnu[PK![""+)php-5.6.40/ext/zip/lib/zip_source_deflate.cnu[PK!౔m(php-5.6.40/ext/zip/lib/zip_source_read.cnu[PK!p= &"php-5.6.40/ext/zip/lib/zip_add_entry.cnu[PK!xr-php-5.6.40/ext/zip/lib/zip_set_file_comment.cnu[PK!,]::*php-5.6.40/ext/zip/lib/zip_source_buffer.cnu[PK!r%[php-5.6.40/ext/zip/lib/zip_file_add.cnu[PK!) ,Uphp-5.6.40/ext/zip/lib/zip_file_get_offset.cnu[PK!U (php-5.6.40/ext/zip/lib/zip_file_rename.cnu[PK!xY. "dphp-5.6.40/ext/zip/lib/zip_utf-8.cnu[PK!KB BB+Jphp-5.6.40/ext/zip/lib/zip_source_zip_new.cnu[PK!Lb~/0 0 4php-5.6.40/ext/zip/php_zip.hnu[PK!RcBphp-5.6.40/ext/zip/zip_stream.cnu[PK!YBBaphp-5.6.40/ext/zip/php_zip.cnu[PK!.88php-5.6.40/ext/wddx/wddx.cnu[PK! "2php-5.6.40/ext/wddx/php_wddx_api.hnu[PK!d  =php-5.6.40/ext/ctype/ctype.cnu[PK!&[22*7Xphp-5.6.40/ext/reflection/php_reflection.cnu[PK!`No*Vphp-5.6.40/ext/reflection/php_reflection.hnu[PK!ZHa(`php-5.6.40/ext/xmlreader/php_xmlreader.hnu[PK!%1(6iphp-5.6.40/ext/xmlreader/php_xmlreader.cnu[PK!u\, " php-5.6.40/ext/mcrypt/php_mcrypt.hnu[PK!́)php-5.6.40/ext/mcrypt/php_mcrypt_filter.hnu[PK!UGG php-5.6.40/ext/mcrypt/mcrypt.cnu[PK!5""%php-5.6.40/ext/mcrypt/mcrypt_filter.cnu[PK!xZsiiphp-5.6.40/ext/gmp/gmp.cnu[PK!vެ 1php-5.6.40/ext/gmp/php_gmp.hnu[PK!$)php-5.6.40/ext/pdo_dblib/pdo_dblib.cnu[PK!7[&%%%rphp-5.6.40/ext/pdo_dblib/dblib_stmt.cnu[PK!&M, php-5.6.40/ext/pdo_dblib/php_pdo_dblib_int.hnu[PK!vzj(j('php-5.6.40/ext/pdo_dblib/dblib_driver.cnu[PK!(M||{Cphp-5.6.40/ext/gd/php_gd.hnu[PK!!A\php-5.6.40/ext/gd/libgd/gdfonts.cnu[PK!&MqMq!irphp-5.6.40/ext/gd/libgd/webpimg.cnu[PK!O((!php-5.6.40/ext/gd/libgd/webpimg.hnu[PK!#OOphp-5.6.40/ext/gd/libgd/gd_ss.cnu[PK!à̀̀php-5.6.40/ext/gd/libgd/gd.hnu[PK!G7php-5.6.40/ext/gd/libgd/gd_io.hnu[PK!1"Iphp-5.6.40/ext/gd/libgd/gdfontmb.hnu[PK! 55php-5.6.40/ext/gd/libgd/xbm.cnu[PK!`@ @ $ php-5.6.40/ext/gd/libgd/gd_io_file.cnu[PK![#php-5.6.40/ext/gd/libgd/gdhelpers.cnu[PK!c@ "php-5.6.40/ext/gd/libgd/gd_io_ss.cnu[PK!L> php-5.6.40/ext/gd/libgd/gdxpm.cnu[PK!Aﹴ !php-5.6.40/ext/gd/libgd/gdcache.hnu[PK!o%  !php-5.6.40/ext/gd/libgd/gdfontt.hnu[PK!1php-5.6.40/ext/gd/libgd/gd_gd.cnu[PK!{t4r0r0!Qphp-5.6.40/ext/gd/libgd/gdkanji.cnu[PK!CWhh!php-5.6.40/ext/gd/libgd/gd_jpeg.cnu[PK!!d%<php-5.6.40/ext/gd/libgd/gd_security.cnu[PK!NN 0php-5.6.40/ext/gd/libgd/gd_gd2.cnu[PK!$EXX pphp-5.6.40/ext/gd/libgd/gd_png.cnu[PK!7xr77#/php-5.6.40/ext/gd/libgd/gd_gif_in.cnu[PK!|nY!gphp-5.6.40/ext/gd/libgd/gdfontl.cnu[PK!33#php-5.6.40/ext/gd/libgd/gd_rotate.cnu[PK!d!6Nphp-5.6.40/ext/gd/libgd/gdcache.cnu[PK!˗L!zbphp-5.6.40/ext/gd/libgd/gd_wbmp.cnu[PK!\UU"vwphp-5.6.40/ext/gd/libgd/gd_topal.cnu[PK!!t php-5.6.40/ext/gd/libgd/gdfontg.cnu[PK!Y <<"m9 php-5.6.40/ext/gd/libgd/gdfontmb.cnu[PK!"v php-5.6.40/ext/gd/libgd/gdtables.cnu[PK!f!̌ php-5.6.40/ext/gd/libgd/gdfontl.hnu[PK!i", php-5.6.40/ext/gd/libgd/gd_color.cnu[PK!@r!~ php-5.6.40/ext/gd/libgd/gdfontg.hnu[PK!b! php-5.6.40/ext/gd/libgd/gdfontt.cnu[PK!h##2 php-5.6.40/ext/gd/libgd/gd_matrix.cnu[PK!]u Q php-5.6.40/ext/gd/libgd/gd_arc.cnu[PK!ߵ*X php-5.6.40/ext/gd/libgd/gd_interpolation.cnu[PK!)p##xphp-5.6.40/ext/gd/libgd/gd.cnu[PK!4)4)#php-5.6.40/ext/gd/libgd/gd_filter.cnu[PK!ikz-R-R$hphp-5.6.40/ext/gd/libgd/gd_gif_out.cnu[PK!S$GGphp-5.6.40/ext/gd/libgd/gdft.cnu[PK!q&~php-5.6.40/ext/gd/libgd/gd_transform.cnu[PK!]GG#php-5.6.40/ext/gd/libgd/gdhelpers.hnu[PK!ٟ+!php-5.6.40/ext/gd/libgd/gdfonts.hnu[PK!>"php-5.6.40/ext/gd/libgd/gd_io_dp.cnu[PK!yphp-5.6.40/ext/gd/libgd/wbmp.hnu[PK!Ք*$*$!php-5.6.40/ext/gd/libgd/gd_crop.cnu[PK!|_w++!php-5.6.40/ext/gd/libgd/gd_webp.cnu[PK!]0   php-5.6.40/ext/gd/libgd/wbmp.cnu[PK! dphp-5.6.40/ext/gd/libgd/gd_io.cnu[PK!VV%t(php-5.6.40/ext/gd/libgd/gd_pixelate.cnu[PK!Da_>_>.php-5.6.40/ext/gd/gd.cnu[PK!  lphp-5.6.40/ext/gd/gd_ctx.cnu[PK! i`00(.php-5.6.40/ext/tokenizer/php_tokenizer.hnu[PK!6fDfD)php-5.6.40/ext/tokenizer/tokenizer_data.cnu[PK!fWW$uphp-5.6.40/ext/tokenizer/tokenizer.cnu[PK!olSS" php-5.6.40/ext/calendar/calendar.cnu[PK!tF =php-5.6.40/ext/calendar/julian.cnu[PK!}F ]php-5.6.40/ext/calendar/gregor.cnu[PK!҈ {php-5.6.40/ext/calendar/easter.cnu[PK!php-5.6.40/ext/calendar/dow.cnu[PK![5h h "Փphp-5.6.40/ext/calendar/cal_unix.cnu[PK! Bn php-5.6.40/ext/calendar/french.cnu[PK!Vegeg php-5.6.40/ext/calendar/jewish.cnu[PK!  \php-5.6.40/ext/calendar/sdncal.hnu[PK!igFcc!y(php-5.6.40/ext/json/JSON_parser.hnu[PK!V``!--php-5.6.40/ext/json/JSON_parser.cnu[PK! ]r Bphp-5.6.40/ext/json/php_json.hnu[PK!Xm^m^php-5.6.40/ext/json/json.cnu[PK! ( K KFphp-5.6.40/ext/imap/php_imap.cnu[PK!KDphp-5.6.40/ext/imap/php_imap.hnu[PK!Գ&&`php-5.6.40/ext/xsl/php_xsl.cnu[PK!8xxxx"8php-5.6.40/ext/xsl/xsltprocessor.cnu[PK!Uphp-5.6.40/ext/xsl/php_xsl.hnu[PK![jmJphp-5.6.40/ext/xsl/xsl_fe.hnu[PK!ZZ)php-5.6.40/ext/fileinfo/libmagic/is_tar.cnu[PK!#<<'H+php-5.6.40/ext/fileinfo/libmagic/file.hnu[PK!5ޙ*hphp-5.6.40/ext/fileinfo/libmagic/fsmagic.cnu[PK! 1-php-5.6.40/ext/fileinfo/libmagic/apprentice.cnu[PK!w[6E+߅php-5.6.40/ext/fileinfo/libmagic/cdf_time.cnu[PK!&**(php-5.6.40/ext/fileinfo/libmagic/magic.cnu[PK!4J--+php-5.6.40/ext/fileinfo/libmagic/compress.cnu[PK!@**&@php-5.6.40/ext/fileinfo/libmagic/cdf.hnu[PK!骋&php-5.6.40/ext/fileinfo/libmagic/cdf.cnu[PK!++(php-5.6.40/ext/fileinfo/libmagic/funcs.cnu[PK! nk,D,D+iphp-5.6.40/ext/fileinfo/libmagic/encoding.cnu[PK!: : &php-5.6.40/ext/fileinfo/libmagic/tar.hnu[PK!xѯ*#php-5.6.40/ext/fileinfo/libmagic/apptype.cnu[PK!(5php-5.6.40/ext/fileinfo/libmagic/magic.hnu[PK!+i,Fphp-5.6.40/ext/fileinfo/libmagic/softmagic.cnu[PK!p< (Aphp-5.6.40/ext/fileinfo/libmagic/print.cnu[PK!H%%+a%php-5.6.40/ext/fileinfo/libmagic/ascmagic.cnu[PK!ʽɘ^6^6*Kphp-5.6.40/ext/fileinfo/libmagic/readcdf.cnu[PK!V{Iȓȓ#hphp-5.6.40/ext/fileinfo/data_file.cnu[PK!Rf+A+A" php-5.6.40/ext/fileinfo/fileinfo.cnu[PK!(#X php-5.6.40/ext/spl/spl_fixedarray.cnu[PK!/#CC"V php-5.6.40/ext/spl/spl_directory.hnu[PK!vāā php-5.6.40/ext/spl/php_spl.cnu[PK!"z!php-5.6.40/ext/spl/spl_functions.hnu[PK! #;!php-5.6.40/ext/spl/spl_exceptions.cnu[PK!RHTYY"u!php-5.6.40/ext/spl/spl_iterators.hnu[PK!-A# !php-5.6.40/ext/spl/spl_exceptions.hnu[PK!H6 !php-5.6.40/ext/spl/spl_engine.hnu[PK!jho**!php-5.6.40/ext/spl/spl_dllist.hnu[PK!7wuuuo!php-5.6.40/ext/spl/spl_dllist.cnu[PK!8d13n"php-5.6.40/ext/spl/spl_array.hnu[PK!A#qu"php-5.6.40/ext/spl/spl_fixedarray.hnu[PK!  {"php-5.6.40/ext/spl/spl_array.cnu[PK!r0m"#php-5.6.40/ext/spl/spl_functions.cnu[PK! E o#php-5.6.40/ext/spl/php_spl.hnu[PK!v\tmm!o#php-5.6.40/ext/spl/spl_observer.hnu[PK!8 TT-#php-5.6.40/ext/spl/spl_heap.hnu[PK!YEE!β#php-5.6.40/ext/spl/spl_observer.cnu[PK!1(("dY$php-5.6.40/ext/spl/spl_iterators.cnu[PK!D"U&php-5.6.40/ext/spl/spl_directory.cnu[PK!Ip-N//'php-5.6.40/ext/spl/spl_heap.cnu[PK!.ppU(php-5.6.40/ext/spl/spl_engine.cnu[PK!.[ߩߩ(php-5.6.40/ext/odbc/php_odbc.cnu[PK!'A2*php-5.6.40/ext/odbc/php_odbc_includes.hnu[PK!IJ yR*php-5.6.40/ext/pcre/php_pcre.hnu[PK!jn))g_*php-5.6.40/ext/pcre/php_pcre.cnu[PK!H|  X+php-5.6.40/ext/pdo/php_pdo.hnu[PK!3ޚ55!=e+php-5.6.40/ext/pdo/pdo_sqlstate.cnu[PK!|o5(5((+php-5.6.40/ext/pdo/pdo.cnu[PK!\.77+php-5.6.40/ext/pdo/pdo_stmt.cnu[PK!Ed d ,php-5.6.40/ext/pdo/php_pdo_int.hnu[PK!cQ˲^^#-php-5.6.40/ext/pdo/php_pdo_driver.hnu[PK! "g-php-5.6.40/ext/pdo/php_pdo_error.hnu[PK!7Z!G!G#o-php-5.6.40/ext/pdo/pdo_sql_parser.cnu[PK!+[D-php-5.6.40/ext/pdo/pdo_dbh.cnu[PK!c!0!0 y.php-5.6.40/ext/mysql/php_mysql.cnu[PK!(/php-5.6.40/ext/mysql/php_mysql_structs.hnu[PK!㨜(Ϲ/php-5.6.40/ext/xmlwriter/php_xmlwriter.cnu[PK! c(0php-5.6.40/ext/xmlwriter/php_xmlwriter.hnu[PK!L+:0php-5.6.40/Zend/zend_gc.hnu[PK!Բ՚ %r0php-5.6.40/Zend/zend_globals_macros.hnu[PK!9~~ a0php-5.6.40/Zend/zend_operators.hnu[PK!M2 I1php-5.6.40/Zend/zend_ptr_stack.cnu[PK!^ P(U1php-5.6.40/Zend/zend_builtin_functions.cnu[PK!k2php-5.6.40/Zend/zend.cnu[PK! E9f9f3php-5.6.40/Zend/zend_opcode.cnu[PK!b//!{3php-5.6.40/Zend/zend_vm_execute.hnu[PK!9 !Hphp-5.6.40/Zend/zend_exceptions.hnu[PK!V*|/|/0Hphp-5.6.40/Zend/zend_ast.cnu[PK!&Hphp-5.6.40/Zend/zend_default_classes.cnu[PK!ҋJC!AHphp-5.6.40/Zend/zend_extensions.cnu[PK!/aQ [ [! Iphp-5.6.40/Zend/zend_generators.cnu[PK!}'?bbgIphp-5.6.40/Zend/zend_list.hnu[PK!ً捞DD|Iphp-5.6.40/Zend/zend_closures.cnu[PK! 77Iphp-5.6.40/Zend/zend_globals.hnu[PK!w?j j !Iphp-5.6.40/Zend/zend_generators.hnu[PK!wk Iphp-5.6.40/Zend/zend_multibyte.hnu[PK!]CC" Iphp-5.6.40/Zend/zend_execute_API.cnu[PK! Df%%&Jphp-5.6.40/Zend/zend_object_handlers.hnu[PK!/M M $Jphp-5.6.40/Zend/zend_dynamic_array.cnu[PK!} Jphp-5.6.40/Zend/zend_ptr_stack.hnu[PK!Jphp-5.6.40/Zend/zend_modules.hnu[PK!<##"Kphp-5.6.40/Zend/zend_objects_API.hnu[PK!rU U ] Kphp-5.6.40/Zend/zend_ast.hnu[PK!z88)Kphp-5.6.40/Zend/zend_compile.hnu[PK!!}!}!Kphp-5.6.40/Zend/zend_exceptions.cnu[PK!Hv6++1Lphp-5.6.40/Zend/zend_qsort.cnu[PK!M M k@Lphp-5.6.40/Zend/zend_stack.hnu[PK!ĊRR&JLphp-5.6.40/Zend/zend_language_parser.cnu[PK!BSڻ hPphp-5.6.40/Zend/zend_iterators.hnu[PK!~ wPphp-5.6.40/Zend/zend_stream.hnu[PK!(  Pphp-5.6.40/Zend/zend_objects.cnu[PK!4k!xPphp-5.6.40/Zend/zend_interfaces.hnu[PK![hqR!Pphp-5.6.40/Zend/zend_vm_opcodes.cnu[PK!v] ] Pphp-5.6.40/Zend/zend_string.hnu[PK!){ Pphp-5.6.40/Zend/zend_iterators.cnu[PK!NT=LYY Pphp-5.6.40/Zend/zend_constants.hnu[PK!}R{Pphp-5.6.40/Zend/zend_compile.cnu[PK!/<''[Tphp-5.6.40/Zend/zend_ini.hnu[PK!Jp CC%Uphp-5.6.40/Zend/zend_closures.hnu[PK!c:[[(J-Uphp-5.6.40/Zend/zend_builtin_functions.hnu[PK!""  !3Uphp-5.6.40/Zend/zend_extensions.hnu[PK!x WFUphp-5.6.40/Zend/zend_highlight.cnu[PK!wYwwh]Uphp-5.6.40/Zend/zend_qsort.hnu[PK!G pp+dUphp-5.6.40/Zend/zend_hash.cnu[PK!F/ Kx+x+Uphp-5.6.40/Zend/zend_stream.cnu[PK!N88!Vphp-5.6.40/Zend/zend_execute.hnu[PK!b[;ZVphp-5.6.40/Zend/zend_strtod.cnu[PK!ow.Wphp-5.6.40/Zend/zend_string.cnu[PK!H:{ ' 'JWphp-5.6.40/Zend/zend_list.cnu[PK!822"LrWphp-5.6.40/Zend/zend_virtual_cwd.cnu[PK!E4Xphp-5.6.40/Zend/zend_llist.cnu[PK!JeNDND /PXphp-5.6.40/Zend/zend_constants.cnu[PK!YY͔Xphp-5.6.40/Zend/zend_execute.cnu[PK!][H t|Yphp-5.6.40/Zend/zend_variables.cnu[PK!x#ŔYphp-5.6.40/Zend/zend_stack.cnu[PK!*' VFVFYphp-5.6.40/Zend/zend_ini.cnu[PK!ώs s TYphp-5.6.40/Zend/zend_highlight.hnu[PK!A)3434"Yphp-5.6.40/Zend/zend_objects_API.cnu[PK!SF!)Zphp-5.6.40/Zend/zend_ini_parser.cnu[PK!68:8:[php-5.6.40/Zend/zend_alloc.cnu[PK!{%6 6 +M\php-5.6.40/Zend/zend_types.hnu[PK!gb%%V\php-5.6.40/Zend/zend_ts_hash.cnu[PK!nfKK|\php-5.6.40/Zend/zend_strtod.hnu[PK!l~.nn >\php-5.6.40/Zend/zend_operators.cnu[PK!*:C 'q]php-5.6.40/Zend/zend_language_scanner.hnu[PK!z|]php-5.6.40/Zend/zend_ts_hash.hnu[PK!^2FF!F]php-5.6.40/Zend/zend_interfaces.cnu[PK!   ]php-5.6.40/Zend/zend_variables.hnu[PK!8}bb ]php-5.6.40/Zend/zend_multibyte.cnu[PK!Q ^php-5.6.40/Zend/zend_float.cnu[PK!q^php-5.6.40/Zend/zend_objects.hnu[PK!jS^php-5.6.40/Zend/zend_API.cnu[PK!"+`php-5.6.40/Zend/zend_ini_scanner.hnu[PK!"G-%P `php-5.6.40/Zend/zend_vm.hnu[PK!=b/b/"'`php-5.6.40/Zend/zend_virtual_cwd.hnu[PK!nW>>?`php-5.6.40/Zend/zend_float.hnu[PK!a~SS*~`php-5.6.40/Zend/zend_API.hnu[PK!!RHGG"aphp-5.6.40/Zend/zend_hash.hnu[PK!eF>>%japhp-5.6.40/Zend/zend_indent.cnu[PK!wm'zaphp-5.6.40/Zend/zend_llist.hnu[PK!=d`0`0aphp-5.6.40/Zend/zend_alloc.hnu[PK!f\cXcX1aphp-5.6.40/Zend/zend_gc.cnu[PK! A?)i)ibphp-5.6.40/Zend/zend.hnu[PK!mF&L}bphp-5.6.40/Zend/zend_object_handlers.cnu[PK!>j@FFWcphp-5.6.40/TSRM/tsrm_strtok_r.cnu[PK!T 2R[cphp-5.6.40/build-fpm/main/internal_functions_cli.cnu[PK!s,?ecphp-5.6.40/build-fpm/Zend/zend_ini_scanner.cnu[PK!L1ephp-5.6.40/build-fpm/Zend/zend_language_scanner.cnu[PK!*:C 1ohphp-5.6.40/build-fpm/Zend/zend_language_scanner.hnu[PK!rphp-5.6.40/sapi/fpm/fpm/events/kqueue.hnu[PK!\%IDrphp-5.6.40/sapi/fpm/fpm/events/port.cnu[PK!6&Urphp-5.6.40/sapi/fpm/fpm/events/epoll.cnu[PK!GG%jrphp-5.6.40/sapi/fpm/fpm/events/port.hnu[PK!S4;;%+prphp-5.6.40/sapi/fpm/fpm/fpm_signals.hnu[PK!ǵ#qrphp-5.6.40/sapi/fpm/fpm/fpm_trace.cnu[PK!zL_trphp-5.6.40/sapi/fpm/fpm/zlog.cnu[PK!u !Ærphp-5.6.40/sapi/fpm/fpm/fpm_shm.hnu[PK!{H"rphp-5.6.40/sapi/fpm/fpm/fpm_unix.hnu[PK!Sb?Q?Q-srphp-5.6.40/sapi/apache2handler/sapi_apache2.cnu[PK!>$)rphp-5.6.40/sapi/apache2handler/mod_php5.cnu[PK!|)4jj.rphp-5.6.40/sapi/apache2handler/apache_config.cnu[PK! m +sphp-5.6.40/sapi/apache2handler/php_apache.hnu[PK!6;;.sphp-5.6.40/sapi/apache2handler/php_functions.cnu[PK!W q,,$3Ksphp-5.6.40/sapi/litespeed/lsapidef.hnu[PK!Y//$]sphp-5.6.40/sapi/litespeed/lsapilib.hnu[PK!=\R\R"sphp-5.6.40/sapi/litespeed/lscriu.cnu[PK!ga׸&sphp-5.6.40/sapi/litespeed/lsapi_main.cnu[PK!,  $tphp-5.6.40/sapi/litespeed/lsapilib.cnu[PK!1]>>+vphp-5.6.40/sapi/cli/php_cli_process_title.hnu[PK!uRsvphp-5.6.40/sapi/cli/php_cli.cnu[PK!vʢ%%$Dwphp-5.6.40/sapi/cli/php_cli_server.cnu[PK!4g/ / +jxphp-5.6.40/sapi/cli/php_cli_process_title.cnu[PK!VHuxphp-5.6.40/sapi/cli/ps_title.hnu[PK!saFYEE$.|xphp-5.6.40/sapi/cli/php_cli_server.hnu[PK!lW00ǃxphp-5.6.40/sapi/cli/ps_title.cnu[PK!8%ʴxphp-5.6.40/sapi/cli/php_http_parser.hnu[PK! P%xphp-5.6.40/sapi/cli/php_http_parser.cnu[PK!>}yphp-5.6.40/sapi/cli/cli.hnu[PK!~~yphp-5.6.40/sapi/cgi/fastcgi.hnu[PK!R??yphp-5.6.40/sapi/cgi/fastcgi.cnu[PK!4܎$$:'zphp-5.6.40/sapi/cgi/cgi_main.cnu[PK!SQgGL{exception-tracenu[PK!SQgL{kprobes-optimizationnu[PK!J~L{panic_on_rcu_stallnu[PKQQU(M{