Zend Frameworks

 

Embed or link this publication

Popular Pages


p. 1

programmer s reference guide zend framework

[close]

p. 2

programmer s reference guide zend framework published 2008-08-30 copyright © 2005-2008 zend technologies inc http www.zend.com

[close]

p. 3

table of contents 1 introduction to zend framework 1 overview 1 installation 1 2 zend_acl 3 introduction 3 about resources 3 about roles 3 creating the access control list acl 5 registering roles 5 defining access controls 6 querying the acl 7 refining access controls 7 precise access controls 7 removing access controls 9 advanced usage 10 storing acl data for persistence 10 writing conditional acl rules with assertions 11 3 zend_auth 13 introduction 13 adapters 13 results 14 identity persistence 15 using zend_auth 18 database table authentication 20 introduction 20 advanced use persisting a dbtable result object 22 advanced usage by example 23 digest authentication 25 introduction 25 specifics 25 identity 25 http authentication adapter 26 introduction 26 design overview 26 configuration options 27 resolvers 27 basic usage 28 ldap authentication 29 introduction 29 usage 29 the api 31 server options 33 collecting debugging messages 35 common options for specific servers 36 open id authentication 37 introduction 37 specifics 38 4 zend_cache 40 introduction 40 the theory of caching 43 the zend_cache factory method 43 iii

[close]

p. 4

programmer s reference guide tagging records 44 cleaning the cache 44 zend_cache frontends 45 zend_cache_core 45 zend_cache_frontend_output 48 zend_cache_frontend_function 48 zend_cache_frontend_class 49 zend_cache_frontend_file 50 zend_cache_frontend_page 51 zend_cache backends 56 zend_cache_backend_file 56 zend_cache_backend_sqlite 56 zend_cache_backend_memcached 57 zend_cache_backend_apc 57 zend_cache_backend_xcache 58 zend_cache_backend_zendplatform 58 5 zend_captcha 59 introduction 59 captcha operation 59 captcha adapters 60 zend_captcha_word 60 zend_captcha_dumb 61 zend_captcha_figlet 61 zend_captcha_image 61 zend_captcha_recaptcha 62 6 zend_config 63 introduction 63 theory of operation 64 zend_config_ini 65 zend_config_xml 67 7 zend_console_getopt 70 introduction to getopt 70 declaring getopt rules 71 declaring options with the short syntax 71 declaring options with the long syntax 71 fetching options and arguments 72 handling getopt exceptions 72 fetching options by name 73 reporting options 74 fetching non-option arguments 74 configuring zend_console_getopt 74 adding option rules 74 adding help messages 75 adding option aliases 75 adding argument lists 76 adding configuration 76 8 zend_controller 78 zend_controller quick start 78 introduction 78 quick start 78 zend_controller basics 81 the front controller 84 overview 84 primary methods 84 iv

[close]

p. 5

programmer s reference guide environmental accessor methods 86 front controller parameters 88 subclassing the front controller 88 the request object 89 introduction 89 http requests 89 subclassing the request object 92 the standard router 94 introduction 94 using a router 95 basic rewrite router operation 95 default routes 96 base url and subdirectories 98 route types 98 using zend_config with the rewriterouter 106 subclassing the router 107 the dispatcher 107 overview 107 subclassing the dispatcher 108 action controllers 112 introduction 112 object initialization 113 pre and post-dispatch hooks 114 accessors 114 view integration 115 utility methods 117 subclassing the action controller 117 action helpers 119 introduction 119 helper initialization 120 the helper broker 120 built-in action helpers 122 writing your own helpers 156 the response object 157 usage 157 manipulating headers 159 named segments 159 testing for exceptions in the response object 161 subclassing the response object 162 plugins 162 introduction 162 writing plugins 163 using plugins 163 retrieving and manipulating plugins 164 plugins included in the standard distribution 164 using a conventional modular directory structure 169 introduction 169 specifying module controller directories 170 routing to modules 172 module or global default controller 172 mvc exceptions 172 introduction 172 how can you handle exceptions 173 mvc exceptions you may encounter 174 v

[close]

p. 6

programmer s reference guide migrating from previous versions 176 migrating from 1.5.x to 1.6.0 or newer 177 migrating from 1.0.x to 1.5.0 or newer 177 migrating from 0.9.3 to 1.0.0rc1 or newer 178 migrating from 0.9.2 to 0.9.3 or newer 180 migrating from 0.6.0 to 0.8.0 or newer 180 migrating from 0.2.0 or before to 0.6.0 181 9 zend_currency 185 introduction to zend_currency 185 why should zend_currency be used 185 how to work with currencies 185 create output from an currency 187 changing the format of a currency 188 informational methods for zend_currency 190 settings new default values 191 speed up zend_currency 191 migrating from previous versions 192 migrating from 1.0.2 to 1.0.3 or newer 192 10 zend_date 194 introduction 194 always set a default timezone 194 why use zend_date 194 theory of operation 195 internals 195 basic methods 196 the current date 196 zend_date by example 196 zend_date api overview 198 zend_date options 198 working with date values 200 basic zend_date operations common to many date parts 201 comparing dates 205 getting dates and date parts 206 working with fractions of seconds 208 sunrise sunset 208 creation of dates 208 create the actual date 208 create a date from database 209 create dates from an array 210 constants for general date functions 210 using constants 210 list of all constants 211 self-defined output formats with iso 216 self-defined output formats using php s date format specifiers 220 working examples 223 checking dates 223 sunrise and sunset 224 timezones 226 11 zend_db 229 zend_db_adapter 229 connecting to a database using an adapter 229 the example database 234 reading query results 236 vi

[close]

p. 7

programmer s reference guide writing changes to the database 239 quoting values and identifiers 243 controlling database transactions 246 listing and describing tables 247 closing a connection 248 running other database statements 249 notes on specific adapters 249 zend_db_statement 252 creating a statement 252 executing a statement 253 fetching results from a select statement 253 zend_db_profiler 256 introduction 256 using the profiler 258 advanced profiler usage 259 specialized profilers 261 zend_db_select 262 overview of the select object 262 creating a select object 262 building select queries 263 executing select queries 278 other methods 279 zend_db_table 281 introduction to table class 281 defining a table class 281 creating an instance of a table 285 inserting rows to a table 286 updating rows in a table 289 deleting rows from a table 290 finding rows by primary key 290 querying for a set of rows 292 querying for a single row 296 retrieving table metadata information 296 caching table metadata 297 customizing and extending a table class 299 zend_db_table_row 303 introduction 303 fetching a row 303 writing rows to the database 305 serializing and unserializing rows 307 extending the row class 309 zend_db_table_rowset 313 introduction 313 fetching a rowset 313 retrieving rows from a rowset 314 retrieving a rowset as an array 316 serializing and unserializing a rowset 317 extending the rowset class 318 zend_db_table relationships 319 introduction 319 defining relationships 319 fetching a dependent rowset 322 fetching a parent row 324 fetching a rowset via a many-to-many relationship 325 vii

[close]

p. 8

programmer s reference guide cascading write operations 328 12 zend_debug 332 dumping variables 332 13 zend_dojo 333 introduction 333 zend_dojo_data dojo.data envelopes 333 zend_dojo_data usage 333 advanced use cases 335 dojo view helpers 337 dojo view helper 337 dijit-specific view helpers 343 dojo form elements and decorators 355 dijit-specific form decorators 356 dijit-specific form elements 358 dojo form examples 374 14 zend_dom 382 introduction 382 zend_dom_query 382 theory of operation 382 methods available 383 15 zend_exception 385 using exceptions 385 16 zend_feed 386 introduction 386 importing feeds 387 custom feeds 388 retrieving feeds from web pages 391 consuming an rss feed 392 consuming an atom feed 393 consuming a single atom entry 394 modifying feed and entry structures 395 custom feed and entry classes 396 17 zend_file 399 zend_file_transfer 399 validators for zend_file_transfer 400 using validators with zend_file_transfer 401 count validator 403 exists validator 403 extension validator 404 filessize validator 405 imagesize validator 406 mimetype validator 407 notexists validator 408 size validator 408 18 zend_filter 410 introduction 410 what is a filter 410 basic usage of filters 410 using the static get method 410 standard filter classes 411 alnum 411 alpha 411 basename 411 viii

[close]

p. 9

programmer s reference guide digits 411 dir 411 htmlentities 411 int 411 stripnewlines 412 realpath 412 stringtolower 412 stringtoupper 412 stringtrim 412 striptags 412 filter chains 412 writing filters 413 zend_filter_input 413 declaring filter and validator rules 414 creating the filter and validator processor 416 retrieving validated fields and other reports 416 using metacommands to control filter or validator rules 419 adding filter class namespaces 424 zend_filter_inflector 425 operation 426 setting paths to alternate filters 426 setting the inflector target 427 inflection rules 428 utility methods 430 using zend_config with zend_filter_inflector 431 19 zend_form 432 zend_form 432 zend_form quick start 432 create a form object 432 add elements to the form 433 render a form 435 check if a form is valid 437 get error status 437 putting it together 438 using a zend_config object 440 conclusion 440 creating form elements using zend_form_element 441 plugin loaders 441 filters 443 validators 444 decorators 449 metadata and attributes 452 standard elements 453 zend_form_element methods 453 configuration 455 custom elements 456 creating forms using zend_form 458 plugin loaders 458 elements 459 display groups 465 sub forms 469 metadata and attributes 470 decorators 472 validation 474 ix

[close]

p. 10

programmer s reference guide methods 476 configuration 479 custom forms 480 creating custom form markup using zend_form_decorator 482 operation 482 standard decorators 483 custom decorators 483 standard form elements shipped with zend framework 486 zend_form_element_button 486 zend_form_element_captcha 487 zend_form_element_checkbox 488 zend_form_element_file 488 zend_form_element_hidden 489 zend_form_element_hash 489 zend_form_element_image 490 zend_form_element_multicheckbox 490 zend_form_element_multiselect 491 zend_form_element_password 491 zend_form_element_radio 492 zend_form_element_reset 492 zend_form_element_select 492 zend_form_element_submit 493 zend_form_element_text 493 zend_form_element_textarea 493 standard form decorators shipped with zend framework 493 zend_form_decorator_callback 493 zend_form_decorator_captcha 494 zend_form_decorator_description 494 zend_form_decorator_dtddwrapper 494 zend_form_decorator_errors 495 zend_form_decorator_fieldset 495 zend_form_decorator_form 495 zend_form_decorator_formelements 495 zend_form_decorator_htmltag 495 zend_form_decorator_image 495 zend_form_decorator_label 496 zend_form_decorator_viewhelper 496 zend_form_decorator_viewscript 496 internationalization of zend_form 498 initializing i18n in forms 498 standard i18n targets 499 advanced zend_form usage 500 array notation 500 multi-page forms 503 20 zend_gdata 514 introduction to gdata 514 structure of zend_gdata 514 interacting with google services 515 obtaining instances of zend_gdata classes 515 google data client authentication 516 dependencies 516 creating a new gdata client 516 common query parameters 517 fetching a feed 518 x

[close]

p. 11

programmer s reference guide working with multi-page feeds 518 working with data in feeds and entries 519 updating entries 519 posting entries to google servers 520 deleting entries on google servers 520 authenticating with authsub 521 creating an authsub authenticated http client 521 revoking authsub authentication 522 authenticating with clientlogin 523 creating a clientlogin authenticated http client 523 terminating a clientlogin authenticated http client 524 using google calendar 524 connecting to the calendar service 524 retrieving a calendar list 527 retrieving events 528 creating events 531 modifying events 534 deleting events 535 accessing event comments 535 using google documents list data api 536 get a list of documents 536 upload a document 536 searching the documents feed 537 using google spreadsheets 538 create a spreadsheet 538 get a list of spreadsheets 538 get a list of worksheets 539 interacting with list-based feeds 539 interacting with cell-based feeds 542 using google apps provisioning 543 setting the current domain 543 interacting with users 544 interacting with nicknames 548 interacting with email lists 550 interacting with email list recipients 552 handling errors 553 using google base 553 connect to the base service 554 retrieve items 557 insert update and delete customer items 558 using the youtube data api 561 authentication 561 developer keys and client id 561 retrieving public video feeds 561 retrieving video comments 564 retrieving playlist feeds 564 retrieving a list of a user s subscriptions 565 retrieving a user s profile 565 uploading videos to youtube 565 browser-based upload 567 checking upload status 568 other functions 569 using picasa web albums 569 connecting to the service 569 xi

[close]

p. 12

programmer s reference guide understanding and constructing queries 572 retrieving feeds and entries 573 creating entries 577 deleting entries 579 catching gdata exceptions 581 21 zend_http 583 zend_http_client introduction 583 introduction 583 configuration parameters 583 performing basic http requests 584 adding get and post parameters 585 accessing last request and response 586 zend_http_client advanced usage 586 http redirections 586 adding cookies and using cookie persistence 587 setting custom request headers 588 file uploads 589 sending raw post data 590 http authentication 590 sending multiple requests with the same client 591 zend_http_client connection adapters 592 overview 592 the socket adapter 593 the proxy adapter 594 the test adapter 595 creating your own connection adapters 597 zend_http_cookie and zend_http_cookiejar 600 introduction 600 instantiating zend_http_cookie objects 600 zend_http_cookie getter methods 602 zend_http_cookie matching against a scenario 603 the zend_http_cookiejar class instantiation 605 adding cookies to a zend_http_cookiejar object 605 retrieving cookies from a zend_http_cookiejar object 605 zend_http_response 606 introduction 606 boolean tester methods 607 accessor methods 608 static http response parsers 609 22 zend_infocard 611 introduction 611 basic theory of usage 611 using as part of zend_auth 612 using the zend_infocard component standalone 613 working with a claims object 614 attaching information cards to existing accounts 614 creating zend_infocard adapters 615 23 zend_json 617 introduction 617 basic usage 617 json objects 617 xml to json conversion 618 zend_json_server json-rpc server 620 advanced details 623 xii

[close]

p. 13

programmer s reference guide 24 zend_layout 629 introduction 629 zend_layout quick start 629 layout scripts 629 using zend_layout with the zend framework mvc 630 using zend_layout as a standalone component 632 sample layout 632 zend_layout configuration options 633 examples 633 zend_layout advanced usage 635 custom view objects 635 custom front controller plugins 636 custom action helpers 636 custom layout script path resolution using the inflector 637 25 zend_ldap 639 introduction 639 theory of operation 639 26 zend_loader 644 loading files and classes dynamically 644 loading files 644 loading classes 644 testing if a file is readable 645 using the autoloader 645 loading plugins 646 basic use case 647 manipulating plugin paths 648 testing for plugins and retrieving class names 649 27 zend_locale 650 introduction 650 what is localization 650 what is a locale 651 how are locales represented 651 selecting the right locale 652 usage of automatic locales 652 using a default locale 653 zf locale-aware classes 654 application wide locale 655 zend_locale_format setoptionsarray $options 655 speed up zend_locale and its subclasses 656 using zend_locale 656 copying cloning and serializing locale objects 657 equality 657 default locales 657 set a new locale 658 getting the language and region 658 obtaining localized strings 659 obtaining translations for yes and no 669 get a list of all known locales 670 normalization and localization 671 number normalization getnumber input array $options 671 number localization 672 number testing 674 float value normalization 674 floating point value localization 674 xiii

[close]

p. 14

programmer s reference guide floating point value testing 675 integer value normalization 675 integer point value localization 675 integer value testing 676 numeral system conversion 676 working with dates and times 678 normalizing dates and times 678 testing dates 682 normalizing a time 683 testing times 683 supported locales 684 28 zend_log 696 overview 696 creating a log 696 logging messages 696 destroying a log 697 using built-in priorities 697 adding user-defined priorities 698 understanding log events 698 writers 699 writing to streams 699 writing to databases 700 writing to firebug 700 stubbing out the writer 703 testing with the mock 703 compositing writers 703 formatters 704 simple formatting 704 formatting to xml 704 filters 705 filtering for all writers 706 filtering for a writer instance 706 29 zend_mail 707 introduction 707 getting started 707 configuring the default sendmail transport 708 sending via smtp 708 sending multiple mails per smtp connection 709 using different transports 710 html e-mail 711 attachments 711 adding recipients 712 controlling the mime boundary 712 additional headers 713 character sets 713 encoding 713 smtp authentication 713 securing smtp transport 714 reading mail messages 715 simple example using pop3 715 opening a local storage 715 opening a remote storage 716 fetching messages and simple methods 717 working with messages 717 xiv

[close]

p. 15

programmer s reference guide checking for flags 720 using folders 721 advanced use 723 30 zend_measure 727 introduction 727 creation of measurements 727 creating measurements from integers and floats 728 creating measurements from strings 728 measurements from localized strings 729 outputting measurements 730 automatic output 730 outputting values 730 output with unit of measurement 731 output as localized string 731 manipulating measurements 731 convert 731 add and subtract 732 compare 733 compare 734 manually change values 734 manually change types 734 types of measurements 735 hints for zend_measure_binary 737 hints for zend_measure_number 737 roman numbers 738 31 zend_memory 739 overview 739 introduction 739 theory of operation 739 memory manager 741 creating a memory manager 741 managing memory objects 741 memory manager settings 742 memory objects 743 movable 743 locked 743 memory container value property 744 memory container interface 744 32 zend_mime 747 zend_mime 747 introduction 747 static methods and constants 747 instantiating zend_mime 747 zend_mime_message 748 introduction 748 instantiation 748 adding mime parts 748 boundary handling 748 parsing a string to create a zend_mime_message object experimental 748 zend_mime_part 749 introduction 749 instantiation 749 methods for rendering the message part to a string 749 33 zend_openid 750 xv

[close]

Comments

no comments yet

YOUBLISHER
About
What Others Say
Sitemap
Impressum

PUBLISHERS
Login
Signup
Tutorials
FAQ
Support

BUSINESS
Overview
Advertising
Support

DEVELOPERS
API

LEGAL
Report a Copyright Violation
Copyright FAQ
Terms of Use
Privacy Policy