Advanced PHP Programming- P14

Chia sẻ: Thanh Cong | Ngày: | Loại File: PDF | Số trang:23

0
49
lượt xem
9
download

Advanced PHP Programming- P14

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Tham khảo tài liệu 'advanced php programming- p14', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả

Chủ đề:
Lưu

Nội dung Text: Advanced PHP Programming- P14

  1. 628 installations Smarty, 109-110 item_struct() method, MetaWeblog API, Spread wrapper, 382 397 instantiation, OOP (object-oriented iterations, 455-456 programming), 38-39 integrated caching, 230 J-L Integrated Mapper pattern, 315-317 JavaScript, cookies, 330 integrating cache Jim Winstead “Hacking the PHP Source” file swaps, 264-265 Web site, 548 home pages, 266 concurrency, 272 K&R brace styling, 16, 24 templatization, 267-273 keys mode_rewrite, 273-277 DBM-based caching, 257 output buffering, 265-266 primary, 300 partial pages, 277-280 keywords query cache, 280-281 global, 21 interfaces parent, 42 defining, 562-564 self, 42 design patterns, 52-54 static, 41 graphical, unit testing, 167-168 implementing, 562-564, 571 language-level tunings registering (streams API), 575 compiler caches, 219-221, 236 runtime error detection, 52 HTTP accelerators, 223-225 SchemaTypeInfo, 411 operating systems, 228-229 ServiceLogger, 143 optimizers, 222-223 write, 571 proxy caches, 229-230, 236-237 intermediate code, 220, 476-479 reverse proxies, 225-228 International Organization for languages, programming, 482-483 Standardization (ISO), 302 Last-Modified HTTP header, 231 interpolation versus concatenation (bench- latency, networks, 223-225 marking), 470-471 layers interpreters, running, 496 abstraction, computational reuse between invalidation layers, 293 caching, 240 applications, 492-496 DBM-based caching, 253-254 layout invariant functions, loops, 440 coding styles ionAccelerator Web site, 236 control flow constructs, 14-19 ionCube Accelerator compiler cache, 220 indentation, 10-12 IOT (Index Organized Table), 301 magic comments, 12 ISO (International Organization for tabs, 11-14 Standardization), 302 lazy initialization, 319-322 is_cached() method, 117 least recently used (LRU) cache removal is_ref flag, 484 policy, 245
  2. mailto function 629 lengths, arrays or strings, 296 long tags, 27 lexers (lexical analyzers), 476 long-lived variables, 21-22 libraries lookup tables, 319-320 access, client-side sessions, 353-354 lookups, DBM-based caching, 255-256 Benchmark, installing, 452 loop() method, ServiceCheckRunner class, DBM, 252 146 licenses, DBM, 252 loops, 14 lifecycles, PHP and Zend Engine break, 18-19 PHP core, 493, 496 continue, 18-19 PHP extension API, 493, 497-498 deeply nested, avoiding, 19 SAPI (Server Abstraction API layer), flow, controlling, 18-19 492-496 for, 16-18 Zend extension API, 493, 498-500 foreach, 16-18 LIMIT syntax, 319 invariant functions, 440 line breaks, 13-14 while, 16-18 line length, code, 13 LRU (last recently used) cache removal listeners, adding unit testing, 166-167 policy, 245 load balancing, 368 clusters, content distribution, 373-374 M session stickiness, 354-355 macro expansions (benchmarking), load generators 464-470 contrived, 422-424 macro substitution routines, 464-468 Daiquiri, 426-427 macros httperf, 424-426 associative arrays, 464 realistic, 422 build system, 507 locking accounts, 329 defining constants, 530 locking files, 247-250 HASH_OF(), 519 log messages, CVS (Concurrent Versioning PS_MOD(), 564 System), 186 return, 515 log outs, authentication, 333 SEPARATE_ZVAL(), 522 log-based generator, 425 SEPARATE_ZVAL_IF_NOT_REF(), 522 logging ZEND_BEGIN_MODULE_GLOBALS, CGI SAPIs, 588 531 errors (error handling), 77-78 ZEND_END_MODULE_GLOBALS, 531 logic ZEND_FETCH_RESOURCE(), 528 caching, factory classes, 292 zval type conversion, 522 templates, 114 zvals, 516 login() function, 69 Z_TYPE_P(), 521 logs magic comments, 12 slow queries, 305 magic_quotes, 103 Web, profiling, 435 mail() function, 80 long options, 129 mailto function, Smarty, 115 How can we make this index more useful? Email us at indexes@samspublishing.com
  3. 630 main() routine (CGI) main() routine (CGI), 588, 591 master C source files, extensions, 505 maintaining state (authentication) master/master replication, 385-386 encrypted cookies, 332 master/slave replication, 386-389 expiration logic, 332-333 matching characters, strings (benchmark- log outs, 333 ing), 463-464 $_SERVER[‘USER_AGENT’] setting, max() function, 452 331 max-age directives, 232 $_SERVER[REMOTE_IP] setting, 331 mcrypt file extension, 332 unencrypted cookies, 332 mcrypt wrappers, 341 user identity information, 333 mean, iterations, 455 versioning information, 333 memory, shared memory caching, 257-258 maliciously altered data, cross-site script- memory-management methods, 511-513 ing attacks, 102 memory-mapped files streams API managing applications example change control, CVS (Concurrent abstract stream data type, 571 Versioning System), 184-188 data, flushing, 572 binary files, 187-188 fsync() interpretation, 572 branches, 186-187, 194-195 interface implementation, 571 development/production environments, interface registration, 575 195-199 mmap_open() method, defining, 577-578 diffs, 189-191 number of bytes written, returning, 572 file versions, 189-191 seek functionality, 573-574 log messages, 186 streams, 574 modifying files, 188-189 wrappers, 576 repositories, 185-186 merging branches, CVS (Concurrent single tree limitations, 195 Versioning System), 195 symbolic tags, 193-194, 199 message nodes, WSDL, 407 updating files, 191-193 messages packaging, 199 receiving, Spread client wrapper, 543-545 Apache, 204-205 sending binaries, 203-204 Spread client wrapper, 545-546 pack(), 200-201 XML-RPC, 395 PHP, 205-206 messaging buses, Spread toolkit, 380-384 pushing code, 201-203 MetaWeblog API managing packaging, 199 implementing, 396-400 Apache, 204-205 blogid() method, 397 binaries, 203-204 callback, 399 pack(), 200-201 entries, posting, 398 PHP, 205-206 item_struct() method, 397 pushing code, 201-203 publish() method, 397 mandatory file locks, 247 RSS, 397 Mapper pattern, 310-315 Unix timestamp, 400 Web site, 415
  4. methods 631 metaWeblog_newPost() method, 398 hexdecode(), 512 method pointers, Zend Engine, 598 hexencode(), 511 methodologies include, Smarty, 114 BSD, 257 init(), 97 System V, 257-258 is_cached(), 117 methods item_struct(), MetaWeblog API, 397 adding to classes, 555-557 loop(), ServiceCheckRunner class, 146 addTestSuite(), 161 mailto, Smarty, 115 add_assoc_zval(), 517 memory-management, 511-513 analyze, 176 metaWeblog_newPost(), 398 apd_execute(), 605 mmap_flush(), 572 apd_execute_internal(), 605 mmap_open(), 575-578 apd_get_active_function_name(), 606 mmap_read(), 572 blogid(), MetaWeblog API, 397 mmap_seek(), 573-574 callback, registering, 396 mmap_write(), 572 calling, speed, 210 mysql_escape_string(), 216 chroot(), 140 naming, 25 clone(), 560 open(), streams, 570 close(), streams, 570 pcntl_fork(), 130 connect(), Spread client wrapper, 539-541 pcntl_wait(), 132 create_object, 560 pcntl_waitpid(), 132 create_table(), 116 pfopen(), resources, 526-527 declaring, 509 php, Smarty, 115 efree(), 512 phpinfo(), 536-537, 583 emalloc(), 511-512 php_info_print_table_row(), 537 erealloc(), 512 PHP_MINFO_FUNCTION(), 536 estrndup(), 512 php_module_shutdown(), 584 explode, 176 php_module_startup(), 583 factory, 562 PHP_RINIT_FUNCTION(), 535 database objects, creating, 55 PHP_RSHUTDOWN_FUNCTION(), 536 singletons, creating, 56-57 php_sapi_name(), 583 Fibonacci Sequence example, 508-510 posix_kill(), 137 fibonacci(), 509 posix_setuid(), 140 flush(), streams, 570 posiz_setgid(), 140 generateProxyCode(), 413 post_run(), 143 getSOAPServiceDescription(), 408 PS_CLOSE_FUNC(), 565 getSOAPServiceName(), 408 PS_DESTROY_FUNC(), 567 getSOAPServiceNamespace(), 408 PS_GC_FUNC(), 568 getThis(), 555 PS_OPEN_FUNC(), 564 getTypeName(), 411 PS_READ_FUNC(), 566 getTypeNamesapce(), 411 PS_WRITE_FUNC(), 566 getWSDLURI(), 408 publish(), MetaWeblog API, 397 How can we make this index more useful? Email us at indexes@samspublishing.com
  5. 632 methods read(), streams, 570 SP_multigroup_multicast() method, 545 refactoring, 41 SP_receive(), 543 registering, 115, 546 stat(), overriding, 585 register_block(), 118 static register_function(), 115 function namespacing, 372 register_modifer, 117 OOP (object-oriented programming), register_outputfilter(), 120 41-42 register_postfilter(), 119 system.listMethods(), 401 register_prefilter(), 119 system.methodHelp(), 401 sapi_cgibin_flush(), 585 system.methodSignature(), 401 sapi_cgibin_getenv(), 586 system_load(), 396 seek(), streams, 570 tearDown(), 165 send_headers(), 586 trace_function_entry(), 606 serendipity_fetchEntry(), 397 trace_function_exit(), 606 serendipity_updertEntry(), 397 urlencode(), 117 session handlers, 360 validate(), 101, 336 files, 361-366 variables, extracting, 510 mm, 361, 366 write(), 570-571 MySession, 366 XML_RPC_decode(), 395 user, 361-362 zend_declare_property(), 556 session_destroy(), 358 zend_hash_get_current_key(), 520 session_start(), 357-358 zend_hash_internal_pointer_reset(), 520 session_write_close(), 358 zend_object_store_get_object(), 561 setUp(), 165 zend_parse_parameters() showConversion(), 254 format strings, 514 sig_alarm(), 137 parameter modifiers, 514-515 simple, 210 variable extraction, 510 Smarty, 114-117 zend_read_property(), 555 special, OOP (object-oriented program- zend_register_list_destructors_ex(), 524 ming), 39, 42-44 zend_update_property(), 555 spread_connect(), Spread client wrapper, zval_copy_ctor(), 523 541 Microsoft Passport, single signon, 339 spread_disconnect(), Spread client microtime() timers, 459 wrapper, 541-542 mm session handler, 361, 366 spread_join(), Spread client wrapper, 542 mmap_flush() method, 572 spread_multicast(), Spread client wrapper, mmap_open() method, 575-578 545-546 mmap_read() method, 572 spread_receive(), Spread client wrapper, mmap_seek() method, 573-574 543-545 mmap_write() method, 572 SP_disconnect(), 542 Model-View-Controller (MVC), 107 sp_join(), Spread client wrapper, 543 models, object, 488-489 SP_multicast(), 545 modifiers, variable, 116-117
  6. network file shares 633 modular code, include files, 212 multitasking support. See child processes module hooks, 529 multiword variable names, 24 module shutdown, 535 must-revalidate directives, 232 module startup/shutdown MVC (Model-View-Controller), 107 constants, defining, 530-531 MySession session handler, 366 globals, 531-532 mysqli extension, 387-388 INI entries, parsing, 532-535 mysql_escape_string() method, 216 phpinfo() registration, 536-537 my_max() function, 452 request startup/shutdown, 535-536 modules N Apache, 327 Nagios, 151 Cache_File, 379 name-munging, function namespacing, 372 initializing, Spread client wrapper, 538 namespaces, 210, 212 registering, Spread client wrapper, 546 functions, clusters, 372-373 shutdown SOAP, 405 module hooks, 535 system resources, 373 Spread client wrapper, 539 naming startup/shutdown classes, 25 constants, defining, 530-531 functions, 20, 24 globals, 531-532 methods, 25 INI entries, parsing, 532-535 schema, variable names, matching to, mod_accel proxy server, 225 26-27 mod_backhand proxy server, 225 variables, 20, 24-27 mod_php5 SAPI (Server Abstraction API naming symbols, 19-20 layer), 494 class names, 25 mod_proxy proxy server, 225-227 consistency, 25 mod_rewrite, cache integration, 273-277 constants, 21-22 monitoring engines, writing, 150 function names, 24 abstract class implementation, 141-143 long-lived variables, 22 architecture, 146 method names, 25 configuration file, 148-149 multiword variable names, 24 options, 149 temporary variables, 23 ServiceCheck object, 143 truly global variables, 21-22 ServiceCheckRunner class, 144-146 variable names, matching, 26-27 ServiceLogger interface, 143 native session handlers, implementing, 366 ServiceLogger process, 147-148 navigation bars signals, 146 cache integration, 277 monolithic packages, 204 cookie-based caching, 258-263 MovableType API Web site, 415 ndbm libraries, 252 multiple databases, development environ- nesting deeply nested loops, avoiding, 19 ments, 197-198 network connections, FIN packets, 229 multiple tests (unit testing), 156-157, network file shares, centralized cache, 378 161-162 How can we make this index more useful? Email us at indexes@samspublishing.com
  7. 634 network latency network latency, 223-225 static methods, 41-42 network partitions, decentralized cache, static properties, 41 381 objects. See also exceptions networked file systems, bandwidth, 385 access handlers (classes), 490 networks, blocking connections, 225 accessing, Adapter patterns, 44-48 Net_Telnet class, 69 allocated, destroying, 560 next_attempt parameter, ServiceCheck allocating, classes, 490 object, 143 AuthorRequest, 412 NFS (Network File System) copying, 43 network file shares, centralized cache, creating, classes, 490 378-380 custom pushing production code, 203 clone method, 560 no-cache directives, 232 create_object() method, 560 nodes, WSDL (Web Services Description creating, 559-562 Language), 407 destructors, 560 nonpersistent connections, 539 object store extraction, 561 nonpersistent resources, 524 database, creating via factory methods, 55 destructing, 42-43 O ServiceCheck, 143 SOAP_Client, 407 object handlers (classes), 489-490 Template, 120 object models, 488-489 XML_RPC_Client, 395 object-oriented programming (OOP) XML_RPC_Message, 395 constructors, 38-39 ob_end_clean(), 243 delegation, 50-52 ob_end_flush(), 243 design patterns ob_get_contents(), 243 Adapter pattern, 44-48 OFB (Output Feedback) mode, 337 Factory pattern, 54-55 OOP (object-oriented programming) interfaces, 52-54 constructors, 38-39 polymorphism, 50-52 delegation, 50-52 Singleton pattern, 56-57 design patterns Template pattern, 49 Adapter pattern, 44-48 type hinting, 52-54 Factory pattern, 54-55 encapsulation, 39-41 interfaces, 52-54 inheritance, 39-40 polymorphism, 50-52 instantiation, 38-39 Singleton pattern, 56-57 overloading, 58-62 Template pattern, 49 __autoload() function, 70-71 type hinting, 52-54 __call() callback, 68-70 encapsulation, 39-41 SPL (Standard PHP Library), 63-68 inheritance, 39-40 overview, 37-40 instantiation, 38-39 polymorphism, 40 overloading, 58-61 special methods, 39, 42-44
  8. patterns 635 __autoload() function, 70-71 packaging management, 199 __call() callback, 68-70 Apache, 204-205 SPL (Standard PHP Library), 63-68 binaries, 203-204 overview, 37-40 pack(), 200-201 polymorphism, 40 PHP, 205-206 special methods, 39, 42-44 pushing code, 201-203 static methods, 41-42 pages static properties, 41 home, caching, 266-273 op (operations) arrays, Zend Engine, concurrency, 272 476-482 templatization, 267-273 opcode dumper, 601, 604-605 Web, partial pages, 277-280 opcodes, Zend Engine, 476-482 parameters open tags, 27 cookie-based session support, 357 open() method, streams, 570 mmap_seek() method, 573 operating systems (OSs), external per- modifiers, strings, 514-515 formance tuning, 228-229 query string session support, 357 operations arrays (op arrays), 476-482 ServiceCheck object, 143 operator precedence, () parentheses, 28 WNOHANG, pcntl_wait()/pcntl_waitpid() operators, equal (==), 485 methods, 132 optimizers, 222-223 WUNTRACED, pcntl_wait()/pcntl_ op_dumper tool, 477 waitpid() methods, 132 OSs (operating systems), external per- parent keyword, 42 formance tuning, 228-229 parentheses (), clarifying code, 28-29 out-of-line unit testing, writing, 157-160 parsing outbound conversion, 104 command-line arguments, 128-130 outbound filtering, 104 INI entries, module initialization, 532-535 output buffering, 99, 242 script execution, compiler caches, 221 cache integration, 265-266 strings, 514-515 HTTP headers, 243-244 partitions Output Feedback (OFB) mode, 337 database scaling, 384, 389-390 output filters, Smarty, 119 network, decentralized cache, 381 overhead, benchmark harnesses, 456-458 Passport (Microsoft), single signon, 339 overloading, 58-61 password generators, 328 __call() callback, 68-70 passwords property accesses, 60 protecting, 327-330 SPL (Standard PHP Library), 63-68 storing, 339 pathnames, 158-159 P patterns Adapter, 44-48 pack(), 200-201 database access patterns, 306 packages Active Record pattern, 307-310 Console_Getopt (PEAR), 128-129 ad hoc queries, 307 monolithic, 204 How can we make this index more useful? Email us at indexes@samspublishing.com
  9. 636 patterns Integrated Mapper pattern, 315-317 operating systems, 228-229 Mapper pattern, 310-315 optimizers, 222-223 design proxy caches, 229-230, 236-237 Adapter pattern, 44-48 reverse proxies, 225-228 Factory pattern, 54-55 Perl Compatible Regular Expressions interfaces, 52-54 (PCREs), 295 polymorphism, 50-52 persistent associative arrays, creating, 61 Singleton pattern, 56-57 persistent connections, 539 Template pattern, 49 persistent hash, creating, 61 type hinting, 52-54 persistent resources, 524 Factory, 54-55 personalized navigation bar Singleton, 56-57 cache integration, 277 Template, 49 cookie-based caching, 258-263 pcntl_fork() method, 130 pfopen() method, resources, finding, pcntl_wait() method, 132 526-527 pcntl_waitpid() method, 132 PHP Extension and Application PCREs (Perl Compatible Regular Repository. See PEAR Expressions), 295 php function, Smarty, 115 pcre_compile() function, 295 php|architect, 151 pcre_exe() function, 295 PHP-GTK, 151 PEAR (PHP Extension and Application phpDocumentor project, 31-35 Repository), 20, 69 phpinfo() method, 536-537, 583 classes, caching, 241-242 php_example.h file, 507 Console_Getopt package, 128-129 php_info_print_table_row() method, 537 installer, APD (Advanced PHP Debugger) PHP_MINFO_FUNCTION() method, 536 profiler, 431 PHP_MINIT_FUNCTION() handler, 525 package format, 203 php_module_shutdown() method, 584 Web site, 122 php_module_startup() method, 583 XML-RPC classes, 395 PHP_RINIT_FUNCTION() method, 535 PEAR benchmarking suite PHP_RSHUTDOWN_FUNCTION() (Benchmark_Iterate), 451-454 method, 536 PEAR Extension Code Library (PECL), php_sapi_name() method, 583 220 pointers PEAR XML-RPC libraries, installing, 382 functions, Zend Engine, 498-500 PECL (PEAR Extension Code Library), method, Zend Engine, 598 220 zval, 555 peephole optimizations, 223 poisoning caches, 240, 383 performance tunings, external polymorphism, 40, 50-52 cache-friendly applications, 231-235 portType nodes, WSDL, 407 content compression, 235-237 POSIX file handles, as resources, 524 language-level tunings posix_kill() method, 137 compiler caches, 219-221, 236 posix_setgid() method, 140 HTTP accelerators, 223-225
  10. public 637 posix_setuid() method, 140 culling, 442-446 postfilters, Smarty, 119 inefficiencies, 440-442 post_reader input filter, 598 installing, 431-433 post_run() method, 143 large applications, 435-440 PPP (public, protected, private), 41 trace files, 431-434 Pragmatic Programmer: From Journeyman DBG profiler, 431 to Master, 124 queries, databases, 305-306 Pragma: no-cache HTTP header, 231 requirements, 430 pre-fetching cache, 240 user information, cookie-based caching, pre-fork architecture, Web servers, 228 258-263 prefilters, Smarty, 119 userspace profilers, 430 preg_match() function, 295 Web logs, 435 preg_replace() function, 295 Xdebug profiler, 431 previous_status parameter, ServiceCheck programming. See also OOP (object- object, 143 oriented programming) primary keys, 300 Extreme Programming, unit testing, 154 printing environment variables, 113 languages, 482-483 private directives, 232 procedural, 37-38 private properties, classes, 554 Python, exceptions, 104 private variables, classes, 559 properties privileges, daemons, 140-141 access, overloading, 60 procedural programming, 37-38 classes, 551-553 processes dynamic instance, 551 child, 130 private, classes, 554 creating, 131 static, OOP (object-oriented program- reaping, 132-134 ming), 41 resources, sharing, 131 protocols, SOAP (Simple Object signals. See signals, child processes Application Project), 280-281 variables, sharing, 132 proxies daemons caches, 229-230, 236-237 exclusivity, 141 code, generating, SOAP, 412-413 privileges, 140-141 reverse, 225-228 working directories, 140 proxy-revalidate directives, 232 writing, 138-139 PS_CLOSE_FUNC() method, 565 ServiceLogger, 147-148 PS_DESTROY_FUNC() method, 567 production code, pushing, 201-203 PS_GC_FUNC() method, 568 production environments, CVS PS_MOD() macro, 564 (Concurrent Versioning System), 195-199 PS_OPEN_FUNC() method, 564 profiling, 419 PS_READ_FUNC() method, 566 APD (Advanced PHP Debugger) PS_WRITE_FUNC() method, 566 caching tables, 446-447 public directives, 232 counters, 432 public, protected, private (PPP), 41 How can we make this index more useful? Email us at indexes@samspublishing.com
  11. 638 publish() method publish() method, MetaWeblog API, 397 Really Simple Syndication (RSS) pushing individual files, 199-200 MetaWeblog API, 397 pushing production code, 201-203 Web site, 415 Python, exceptions, 104 reaping child processes, 132-134 receiving messages, Spread client wrapper, Q-R 543-545 recursive diffs, 191 queries recursive functions ad hoc, 307 computational reuse, 283-289 automatic query dispatching, 387-389 tree, 286 databases, 300-302 Reduced Instruction Set Computer bandwidth, 384 (RISC), 476 introspection, EXPLAIN SQL syntax, redundancy, clusters, 367 303-304 refactoring, 153-154, 312 profiles, 305-306 code slow query logs, 305 coupling, 212-213 troubleshooting, 305 method logic, 208-209 query cache, implementing, 280-281 namespaces, 210-212 query string munging, 325-326, 356-357 simple methods, 210 methods, 41 random data, iterations, 455-456 refcount (reference counter), 484 RCS (Revision Control System), 184 reference counting, variables, 42 RDBMSs (relational database manage- registering ment systems), 299 callback methods, 396 database access patterns, 306 INI entries, 534 Active Record pattern, 307-310 interfaces (streams API), 575 ad hoc queries, 307 methods, 115, 546 Integrated Mapper pattern, 315-317 modules, Spread client wrapper, 546 Mapper pattern, 310-315 phpinfo() method, 536-537 database scaling, 390 resources, 525-526 indexes, 300-302 SOAP services, 409 network file shares, centralized cache, streams (streams API), 574 380 users (authentication), 327-330 queries, 300-302 variable modifiers, 117 introspection, EXPLAIN SQL syntax, wrappers (streams API), 576 303-304 Zend Engine extension callbacks, 608 profiles, 305-306 register_block() method, 118 tables, 300-302 register_function() method, 115 read() method, streams, 570 register_modifier() method, 117 readability indexes, 169 register_outputfilter() method, 120 Real Time counter (wall-clock time), 432 register_postfilter() method, 119 realistic data generator, 425-426 register_prefilter() method, 119 realistic load generators, 422
  12. RPCs (remote procedure calls) 639 relational database management systems return macros, 515 (RDBMSs), 299 RETURN_BOOL() macro, 515 database access patterns, 306 RETURN_DOUBLE() macro, 515 Active Record pattern, 307-310 RETURN_EMPTY_STRING() macro, 515 ad hoc queries, 307 RETURN_FALSE() macro, 515 Integrated Mapper pattern, 315-317 RETURN_LONG() macro, 515 Mapper pattern, 310-315 RETURN_NULL() macro, 515 indexes, 300-302 RETURN_STRING() macro, 515 queries, 300-302 RETURN_STRINGL() macro, 515 introspection, EXPLAIN SQL syntax, RETURN_TRUE() macro, 515 303-304 reverse proxies, 225-228 profiles, 305-306 Revision Control System (RCS), 184 tables, 300-302 RFC (Request for Comment), 236 relative pathnames, 158 RISC (Reduced Instruction Set remote command injection, 214 Computer), 476 remote procedure calls (RPCs). See RPCs routines, macro substitution routines, removal policies, cache, 245 464-468 rename() function, 251 rows RDBMSs (relational database man- replication, database scaling agement systems), 300 master/master, 385-386 RPCs (remote procedure calls), 393 master/slave, 386-389 __call() callback, 68 repositories, CVS (Concurrent Versioning SOAP System), 185-186 Amazon author search example, Request for Comment (RFC), 236 410-412 requests envelopes, 403-404 shutdown, 536 namespaces, 405 startup, 535 proxy code, 412-413 startup/shutdown, 535 registering services, 409 XML-RPC, 396 Schema, 404 resources user-defined types, 410-412 balancing, session stickiness, 355 writing services, 408-410 creating, 524 WSDL, 405-408 finding, 526-528 XML-RPC, compared, 413-414 handling, 524 speed, 394 nonpersistent, 524 XML-RPC, 394 persistent, 524 auto-discovery, 401-403 POSIX file handles as, 524 callback methods registration, 396 registering, 525-526 clients, 395 sharing, child processes, 131 Dave Winer Web site, 414 result buffers, allocating, 511 messages, sending, 395 result sets, databases, 317-319 MetaWeblog API implementation, rethrowing exceptions, 94 396-400 How can we make this index more useful? Email us at indexes@samspublishing.com
  13. 640 RPCs (remote procedure calls) requests, 396 sapi_cgibin_flush() method, 585 SOAP, compared, 413-414 sapi_cgibin_getenv() method, 586 Web site, 414 sapi_module_struct structure, 582-584 RSS (Really Simple Syndication), 397 scaling, 368-369 MetaWeblog API, 397 client-side sessions (scalability), 353 Web site, 415 cookie-based caching (scalability), 263 rsync, pushing production code, 203 databases rules, scoping rules, 21 application servers, 390-391 run() method, 455 partitioning, 384, 389-390 runtime errors, detecting, 52 RDBMS systems, 390 replication, 385-389 S horizontally, 374 schema, 26-27, 404 s-maxage directives, 233 SchemaTypeInfo interface, 411 sandboxing, 492 scope, 21 sanitizing data, 215-216 scripts SAPIs, 581 CLI (command line interface) CGI (command line interface) arguments, 128-130 activation/deactivation, 584 executing, 125 cookies, 587 I/O, handling, 125-128 data writing callback, 584 example.php, 507 deactivation code, 584 monitoring engine, 150 environment variables lookup inter- abstract class implementation, 141-143 face, 585 architecture, 146 flush helper method, 584 configuration file, 148-149 header handlers, 586 options, 149 logging, 588 ServiceCheck object, 143 main() routine, 588, 591 ServiceCheckRunner class, 144-146 method pointers, 583 ServiceLogger, 143, 147-148 POST data, reading, 587 signals, 146 SAPI name, 583 SCSS (Source Code Control System), 184 sapi_module_struct structure, 582-584 security sending headers, 586 attacks, remote command injection, 214 server variables, 588 authentication shell environment variables, 588 dictionary attacks, 327-329 shutdown, 584 exception, 336 stat() override, 585 handlers, 327 stream buffers, flushing, 585 implementing, 334-339 userspace error callback, 586 maintaining state, 331-333 embed, 591-593 passwords, storing, 339 input filters, 593 schemes, 324-327 input_filter, 594-598 single signon, 339-346 post_reader, 598 user registration, 327-330 treat_data, 598
  14. session_start() method 641 defensive coding, 214-215 ServiceCheckRunner class, 144-146 Smarty, 119 ServiceLogger, 143, 147-148 user-submitted data, cleaning, 351 services seek() method, streams, 570 SOAP (Simple Object Access Protocol), SELECT statement, 318 408-410 self keyword, 42 Web, Web site, 415 semaphores, 257 session data, caching, 377 sending messages session handlers Spread client wrapper, 545-546 API hook structures, 564 XML-RPC, 395 closing, 565 send_headers() method, 586 destroying, 567 SEPARATE_ZVAL() macro, 522 garbage collection, 568 SEPARATE_ZVAL_IF_NOT_REF() methods, 360 macro, 522 files, 361-366 separation, zvals, 522 mm, 361, 366 Serendipity software, 435 MySession, 366 Serendipity Web logging system, 397-398 user, 361-362 Serendipity Web logging system Web site, native, implementing, 366 415 opening, 564 serendipity_drawcalendar() function, 439 reading data, 566 serendipity_fetchEntry() method, 397 writing data, 566 serendipity_updertEntry() method, 397 session IDs, 356-357, 360-361 serialization, 295 session simulator, 425 serialize() function, 292-293 session stickiness, 354-355 server variables, CGI SAPI, 588 sessions server-side sessions, 349, 354-355 client-side, 349-350 ending, 358 access libraries, 353-354 garbage collection, 358-359, 364-366 benefits, 352-353 overview, 357-359 implementing via cookies, 351-353 session handler methods limitations, 353 files, 361-366 session data encryption, 351-352 mm, 361, 366 versus server-side, 366 MySession, 366 server-side, 349, 354-355 user, 361-362 ending, 358 session IDs, 356-357, 360-361 garbage collection, 358-359, 364-366 versus client-side, 366 overview, 357-359 servers session handler methods, 360-366 application, database scaling, 390-391 session IDs, 360-361 reverse proxies, 225-228 tracking session IDs, 356-357 Web, architecture, 228 versus client-side, 366 service nodes, WSDL, 407 session_destroy() method, 358 ServiceCheck object, 143 session_start() method, 357-358 How can we make this index more useful? Email us at indexes@samspublishing.com
  15. 642 session_write_close() method session_write_close() method, 358 simple methods, 210 setMaker() method, 454, 459-460 Simple Object Access Protocol. See SOAP setUp() method, 165 Simple Object Application Project set_error_handler() function, 79 (SOAP), 280-281 Shane Caraveo Web services talks Web single signons, 340 site, 414 implementing, 341-346 shared memory caching, 257-258 Microsoft Passport, 339 sharing, child processes, 131-132 Singleton pattern, 56-57 shell environment variables, CGI SAPI, singletons, creating via factory methods, 588 56-57 Shell/Perl-style comments, 29 sites. See Web sites shmop functions, 258 size, cookie-based caching, 263 short options, 129 slaves, master/slave replication, 386-389 short tags, 27 Sleepycat libraries, 252 showConversion() method, 254 slow query logs, 305 shutting down SmartTemplate Web site, 122 clusters, content distribution, 373 Smarty, 108 modules block handling, 118 constants, defining, 530-531 cache handlers, 120 globals, 531-532 caching, 109, 117-118 INI entries, parsing, 532-535 compiled templates, 111 module hooks, 535 custom tags, 120 Spread client wrapper, 539 data, displaying, 112 requests, 535-536 environment variables, printing, 113 SIGALRM signal, 134, 137-138 flow control, 111-114 SIGCHILD signal, 134-137 garbage collection, 118 SIGHUP signal, 134, 138 Hello World! template, 110-111 SIGINT signal, 134 installing, 109-110 SIGKILL signal, 134 logic, 114 signals manual Web site, 117 child processes methods, 114-117 SIGALRM, 134, 137-138 output filters, 119 SIGCHILD, 134-137 postfilters, 119 SIGHUP, 134, 138 prefilters, 119 SIGINT, 134 security, 119 SIGKILL, 134 tables, creating, 111 SIGUSR1, 134 variable modifiers, 116 SIGUSR2, 134 Web site, 109, 121 monitoring engine script, 146 smarty ($ before) variable, 113 SIGUSR1 signal, 134 SOAP (Simple Object Access Protocol) SIGUSR2 signal, 134 Amazon author search example, 410-412 sig_alarm() method, 137 Amazon free interface Web site, 415
  16. staging environments 643 envelopes, 403-404 groups, joining, 542-543 Google free interface Web site, 415 method registration, 546 namespaces, 405 modules proxy code, 412-413 initialization, 538 Schema, 404 registration, 546 services, 408-410 shutdown, 539 user-defined types, 410-412 receiving messages, 543-545 Web sites, 414 sending messages, 545-546 WSDL, 405-408 Spread library, 537 XML-RPC, compared, 413-414 Spread_Logger class, 547 SOAP (Simple Object Application Spread client wrapper extension Web site, Project), 280-281 548 SOAP_Client object, 407 Spread clients, 382 social engineering, 330 Spread toolkit, decentralized cache, sockets extension, 390 380-384 soft tabs, indentation, 11-12 Spread wrapper, installing, 382 software spread_connect() method, Spread client change control, CVS (Concurrent wrapper, 541 Versioning System), 184 spread_disconnect() method, Spread client binary files, 187-188 wrapper, 541-542 branches, 186-187, 194-195 spread_join() method, Spread client development/production environments, wrapper, 542 195-199 Spread_Logger class, 547 diffs, 189-191 spread_multicast() method, Spread client file versions, 189-191 wrapper, 545-546 log messages, 186 spread_receive() method, Spread client modifying files, 188-189 wrapper, 543-545 repositories, 185-186 SP_disconnect() method, 542 single tree limitations, 195 sp_join() method, Spread client wrapper, symbolic tags, 193-194, 199 543 updating files, 191-193 SP_multicast() method, 545 enterprise, 183 SP_multigroup_multicast() method, 545 Serendipity, 435 SP_receive() method, 543 sorting algorithms, 286 SQL (Structured Query Language) Source Code Control System (SCSS), 184 bind SQL, 47 special methods, OOP (object-oriented coding styles, 14 programming), 39, 42-44 EXPLAIN syntax, 303-304 specialized clusters, 374-375 injection attacks, 104 speed, algorithms, 285-286 Squid proxy server, 225 SPL (Standard PHP Library), 63-68 Squid Web site, 236 Spread client wrapper example, 537 SRM project, 391 connecting, 539-541 staging environments, CVS (Concurrent disconnecting, 541-542 Versioning System), 197 How can we make this index more useful? Email us at indexes@samspublishing.com
  17. 644 stale cache stale cache, 240 stream buffers, flushing, 585 Standard PHP Library (SPL), 63-68 streams API, 579 starting C streams-compatible protocols, access- modules ing, 568 constants, defining, 530-531 custom stream implementation, 570 globals, 531-532 I/O operations, 570 INI entries, parsing, 532-535 memory-mapped files requests, 535 abstract stream data type, 571 stat() method, overriding, 585 data flushing, 572 state fsync() interpretation, 572 cookies, 326 interface implementation, 571 maintaining (authentication) interface registration, 575 encrypted cookies, 332 mmap_open() method, defining, expiration logic, 332-333 577-578 log outs, 333 number of bytes written, returning, $_SERVER[‘USER_AGENT’] setting, 572 331 opening streams, 574 $_SERVER[REMOTE_IP] setting, registering streams, 574 331 seek functionality, 573-574 unencrypted cookies, 332 wrappers, 576 user identity information, 333 opening streams, 574 versioning information, 333 registering streams, 574 statement handler callback, Zend Engine, storing, 570 607 streams-compatible protocols, accessing, static extensions, creating, 507 568 static keyword, 41 strings static methods binary data, 296 function namespacing, 372 C, 296 OOP (object-oriented programming), hex-encoding, 511-512 41-42 matching characters (benchmarking), static properties, OOP (object-oriented 463-464 programming), 41 parsing statically typed languages, 482-483 format characters, 514 status_time parameter, ServiceCheck parameter modifiers, 514-515 object, 143 return macros, 515 stderr file handle, 126-127 query string munging, 325-326, 356-357 stdin file handle, 125-126 strlen() function, 296 stdout file handle, 125 strncmp function, 463-464 storage strongly typed languages, 482-483 DBM-based caching, 255-256 structs, 490-492 INI entries, 533 str_replace function, 468-469 passwords, 339 stubs, extensions, 504, 507 streams, 570
  18. F LY templates 645 A M studly caps, word breaks, 24 styles. See coding styles RDBMSs (relational database manage- ment systems), 300-302 T E substr function, 463-464 Subversion versioning system, 185 symbol, 19 tabs, indentation, 11-12 super-linear algorithms, speed, 286 tags swapping files, 250-251, 264-265 long, 27 symbol tables, 19 open, 27 symbolic tags, CVS (Concurrent phpDocumentor, 31 Versioning System), 193-194, 199 Smarty, 120 symbols, naming, 19-20 symbolic, CVS (Concurrent Versioning class names, 25 System), 193-194, 199 consistency, 25 tar, pushing production code, 202 constants, 21-22 TDD (test-driven development) function names, 24 benefits, 168 long-lived variables, 22 bug reports, 177-179 method names, 25 Flesch score calculator, 169 multiword variable names, 24 Word class, 169-177 temporary variables, 23 tearDown() method, 165 truly global variables, 21-22 Template object, 120 variable names, matching, 26-27 Template pattern, 49 symmetric ciphers, 337 templates syntax. See code home pages, caching, 267-273 synthetic benchmarks, 449-450 Smarty, 108 system resource namespacing, 373 block handling, 118 System Time counter, 432 cache handlers, 120 System V interprocess communication caching, 109, 117-118 (IPC), 257-258 compiled templates, 111 system.listMethods() method, 401 custom tags, 120 system.methodHelp() method, 401 data, displaying, 112 system.methodSignature() method, 401 environment variables, printing, 113 system_load() method, 396 flow control, 111-114 garbage collection, 118 T Hello World! template, 110-111 installing, 109-110 tables logic, 114 caching, APD (Advanced PHP Debugger), manual Web site, 117 446-447 methods, 114-117 creating, Smarty, 111 output filters, 119 defined, 299 postfilters, 119 IOT (Index Organized Table), 301 prefilters, 119 lookup, 319-320 security, 119 primary keys, 300 tables, creating, 111 How can we make this index more useful? Email us at indexes@samspublishing.com
  19. 646 templates variable modifiers, 116 timers, custom information, 458-461 Web site, 109, 121 tools, op_dumper, 477 writing, 120-121 top-down culling, 443 TemplateTamer Web site, 122 top-down designs, 208 temporary variables, 21-23 trace files, APD (Advanced PHP test cases, unit testing, 155 Debugger) profiler, 431-434 test-driven development (TDD) trace_function_entry() method, 606 benefits, 168 trace_function_exit() method, 606 bug reports, 177-179 tracking session IDs Flesch score calculator, 169 cookies, 356-357 Word class, 169-177 query string munging, 356-357 TestCase class, 156-157 trash data, 100-102 testing treat_data input filter, 598 code, 153-154 tree recursive function, 286 benefits, 168 trigger_error() function, 74 bug reports, 177-179 troubleshooting. See also design patterns Flesch score calculator, 169 bottlenecks, database organization, 300 unit testing, 153-154, 162-163, 168 deeply nested loops, 19 Word class, 169-182 queries, 305 writing truly global variables, 21-22 conditions, adding, 164-165 try block, 84 Extreme Programming, 154 tunings. See also performance tunings graphical interfaces, 167-168 databases informative error messages, 163-164 lazy initialization, 319-322 inline, 157-159 limiting result sets, 317-319 listeners, adding, 166-167 focused, 471 multiple tests, 156-157, 161-162 two-phase commit, 386 out-of-line, writing, 157-160 type hinting, design patterns, 52-54 overview, 154-155 typed exceptions, example, 88-93 setUp() method, 165 types tearDown() method, 165 adding to arrays, 516-517 test cases, 155 zvals, converting, 521-522 writing, 155-156 typing strategies testing harnesses, benchmarks, 454-455 argument types, functions, 483 tests/001.phpt unit test, 507 data types, union, 484 throwing exceptions, 83-85 dynamically typed, 482-483 threaded process architectures, Web functions, Zend Engine, 487 servers, 228 statically typed, 482-483 time-based diffs, 191 strongly typed, 482-483 timeElapsed() method, 455 variables, Zend Engine, 482-485 timeout parameter, ServiceCheck object, weakly typed, 483 143 zval, 484
  20. variables 647 U user registration (authentication), 327-330 user session handlers, 361-362 underscore (_) User Time counter, 432 class names, 25 user-defined functions (Zend Engine), 486 function names, 24 user-defined types (SOAP), 410-412 word breaks, 24 userspace functions, 452-453 unencrypted cookies, 332 userspace profilers, 430 unified diffs, 189 union data type, 484 V unique identifiers, 327 unique indexes, 300 validate() method, 101, 336 unit testing, 153 validation, data validation, 100-104, 216 automated, writing, 155 variable modifiers, 116-117 conditions, adding, 164-165 variables Extreme Programming, 154 copying, 523 graphical interfaces, 167-168 environment informative error messages, 163-164 looking up, 585 inline, 157-159 printing, 113 listeners, adding, 166-167 shell, 588 multiple tests, 156-157, 161-162 global, 20 out-of-line, writing, 157-160 accessor functions, 22 overview, 154-155 module initialization, 531-532 setUp() method, 165 truly, 21-22 TDD (test-driven development) interpolation, versus concatenation benefits, 168 (benchmarking), 470-471 bug reports, 177-179 long-lived, 21-22 Flesch score calculator, 169 methods, extracting, 510 Word class, 169-177 multiword names, 24 tearDown() method, 165 names, matching to schema names, 26-27 test cases, 155 naming, 20 tests/001.phpt, 507 private, classes, 559 Web, 179-182 reference counting, 42 writing, 155-156 scope, 21 Unix multitasking support. See child server, CGI SAPI, 588 processes sharing, child processes, 132 Unix timestamp, MetaWeblog API, 400 $smarty, 113 updates temporary, 21-23 DBM-based caching, 253-254 Zend Engine files, CVS (Concurrent Versioning typing strategies, 482-485 System), 191-193 zval, 483-485 urlencode() function, 117 zvals, 516 user authentication, Web unit testing, arrays. See arrays 179-182 assignments, 516 How can we make this index more useful? Email us at indexes@samspublishing.com
Đồng bộ tài khoản