Zend Framework手册中文版 - Read

excitingwonderlakeInternet και Εφαρμογές Web

13 Δεκ 2013 (πριν από 3 χρόνια και 7 μήνες)

869 εμφανίσεις

Zend Framework ︭
Zend Framework ︭



︋︀

PHPEye.com
ﻄﻇ﯑:
Haohappy

(Team Leader)
RainXAresHzFalconYimin.LiJason QiSeatengCho@ウ
CannotGregryYang.CGdeveloperworks
Zend Frameworkソﮨ﮺
|
ZF﯑ﮨ﮺
| ﯷ︋ス
PDF廓
,ﻍﯷ﮺
Zend Framework ︭
Zend Framework
 © 2005-2007 Zend Technologies Inc. (
http://www.zend.com
)
2007-06-03
u
1. Zend Framework
1.1. ﮀﻋ
2. Zend_Acl
2.1. ﮀﻋ
2.1.1. ﺎ﵄ﺐ(Resource)
2.1.2. ﺎ戮(Role)
2.1.3. ﻺ﮿(ACL)
2.1.4. ﳨ戮(Role)
2.1.5. ﮚ﹉﮿
2.1.6. ﯢ ACL
2.2. ﲾﻆ﮿
2.2.1. ﲾﻆ﮿
2.2.2. ﮿
2.3. 齃ﺧﳕ
2.3.1. ￝ﭘ ACL ￝﹅
2.3.2. ソ(Assert)6ﻶ ACL 龍
3. Zend_Auth
3.1. ﮀﻋ
3.1.1. 
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 1/26 )2007-6-10 21:41:11
Zend Framework ︭
3.1.2. ﻓ
3.1.3. ﺫ﻽﹅(Persistence)
3.1.4. ソZend_Auth
3.2. ﺓﮤ﯁
3.2.1. ﮀﻋ
3.2.2. 齃ﺧソ:﹅︀︪ DbTable ﻓﯹﱡ
3.3. 女/ﮤ﯁
3.3.1. ﮀﻋ
3.3.2. 龍(Specifics)
3.3.3. ﺫ﻽(Identity)
3.4. HTTP ﮤ﯁
3.4.1. ﮀﻋ
3.4.2. ﮾ﮡ
3.4.3. ョ
3.4.4. Resolvers
3.4.5. ﳕ
4. Zend_Cache
4.1. ﮀﻋ
4.2. 3ﭘ
4.2.1.
Zend_Cache
﷥ﳕ
4.2.2. ﮰﺪu
4.2.3. 3ﭘ︅
4.3. Zend_Cache frontends
4.3.1. Zend_Cache_Core
4.3.2. Zend_Cache_Frontend_Output
4.3.3. Zend_Cache_Frontend_Function
4.3.4. Zend_Cache_Frontend_Class
4.3.5. Zend_Cache_Frontend_File
4.3.6. Zend_Cache_Frontend_Page
4.4. Zend_Cache﫯
4.4.1. Zend_Cache_Backend_File
4.4.2. Zend_Cache_Backend_Sqlite
4.4.3. Zend_Cache_Backend_Memcached
4.4.4. Zend_Cache_Backend_APC
4.4.5. Zend_Cache_Backend_ZendPlatform
5. Zend_Config
5.1. Introduction
5.2. Theory of Operation
5.3. Zend_Config_Ini
5.4. Zend_Config_Xml
6. Zend_Console_Getopt
6.1. Introduction to Getopt
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 2/26 )2007-6-10 21:41:11
Zend Framework ︭
6.2. Declaring Getopt Rules
6.2.1. Declaring Options with the Short Syntax
6.2.2. Declaring Options with the Long Syntax
6.3. Fetching Options and Arguments
6.3.1. Handling Getopt Exceptions
6.3.2. Fetching Options by Name
6.3.3. Reporting Options
6.3.4. Fetching Non-option Arguments
6.4. Configuring Zend_Console_Getopt
6.4.1. Adding Option Rules
6.4.2. Adding Help Messages
6.4.3. Adding Option Aliases
6.4.4. Adding Argument Lists
6.4.5. Adding Configuration
7. Zend_Controller
7.1. Zend_Controller →
7.1.1. ﮀﻋ
7.1.2. 
7.2. Zend_Controller Basics
7.3. The Front Controller
7.3.1. Overview
7.3.2. Primary Methods
7.3.3. Environmental Accessor Methods
7.3.4. Front Controller Parameters
7.3.5. Subclassing the Front Controller
7.4. The Request Object
7.4.1. Introduction
7.4.2. HTTP Requests
7.4.3. Subclassing the Request Object
7.5. The Standard Router: Zend_Controller_Router_Rewrite
7.5.1. Introduction
7.5.2. Using a router
7.5.3. Basic Rewrite Router operation
7.5.4. Default routes
7.5.5. Base URL and subdirectories
7.5.6. Route Types
7.5.7. Using Zend_Config with the RewriteRouter
7.5.8. Subclassing the Router
7.6. The Dispatcher
7.6.1. Overview
7.6.2. Subclassing the Dispatcher
7.7. Action Controllers
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 3/26 )2007-6-10 21:41:11
Zend Framework ︭
7.7.1. Introduction
7.7.2. Object initialization
7.7.3. Pre- and Post-Dispatch Hooks
7.7.4. Accessors
7.7.5. View Integration
7.7.6. Utility Methods
7.7.7. Subclassing the Action Controller
7.8. Action Helpers
7.8.1. Introduction
7.8.2. Helper Initialization
7.8.3. The Helper Broker
7.8.4. Built-in Action Helpers
7.8.5. Writing Your Own Helpers
7.9. The Response Object
7.9.1. Usage
7.9.2. Manipulating Headers
7.9.3. Named Segments
7.9.4. Subclassing the Response Object
7.10. ﻶ
7.10.1. ﮀﻋ
7.11. Using a Conventional Modular Directory Structure
7.11.1. Introduction
7.11.2. Specifying Module Controller Directories
7.11.3. Routing to modules
7.11.4. Module or Global Default Controller
7.12. MVC Exceptions
7.12.1. Introduction
7.12.2. How can you handle exceptions?
7.12.3. MVC Exceptions You May Encounter
7.13. Migrating from Previous Versions
7.13.1. Migrating from 0.9.3 to 1.0.0RC1 or newer
7.13.2. Migrating from 0.9.2 to 0.9.3 or newer
7.13.3. Migrating from 0.6.0 to 0.8.0 or newer
7.13.4. Migrating from 0.2.0 or before to 0.6.0
8. Zend_Date
8.1. Introduction
8.1.1. Always Set a Default Timezone
8.1.2. Why Use Zend_Date?
8.2. Theory of Operation
8.2.1. Internals
8.3. Basic Methods
8.3.1. The current date
8.3.2. Zend_Date by Example
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 4/26 )2007-6-10 21:41:11
Zend Framework ︭
8.4. Zend_Date API Overview
8.4.1. Zend_Date Options
8.4.2. Working with Date Values
8.4.3. Basic
Zend_Date
Operations Common to Many Date Parts
8.4.4. Comparing Dates
8.4.5. Getting Dates and Date Parts
8.4.6. Working with Fractions of Seconds
8.4.7. Sunrise / Sunset
8.5. Constants for General Date Functions
8.5.1. Using Constants
8.5.2. List of All Constants
8.5.3. Self-Defined OUTPUT Formats with ISO
8.5.4. Self-defined OUTPUT formats using PHP's date() format specifiers
8.6. Working examples
8.6.1. Checking dates
8.6.2. Sunrise and Sunset
8.6.3. Timezones
9. Zend_Db
9.1. Zend_Db_Adapter
9.1.1. ﮀﻋ
9.1.2. ﷻ5ﭢﺓ
9.1.3. ﯢ
9.1.4. ﺋ滑
9.1.5. 
9.1.6. 
9.1.7. 
9.1.8. ﯢﻓ
9.2. Zend_Db_Statement
9.2.1. Creating a Statement
9.2.2. Executing a Statement
9.2.3. Fetching Results from a
SELECT
Statement
9.3. Zend_Db_Profiler
9.3.1. Introduction
9.3.2. Using the Profiler
9.3.3. Advanced Profiler Usage
9.4. Zend_Db_Select
9.4.1. ﮀﻋ
9.4.2. ︀︭ﯢ駱
9.4.3. 駱ﯢ
9.4.4. WHEREﻶ
9.4.5. GROUP BY
9.4.6. HAVING ﻶ
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 5/26 )2007-6-10 21:41:11
Zend Framework ︭
9.4.7. ORDER BY 
9.4.8. ᅦ炙ᅴLIMIT
9.4.9. ᅦᅴLIMIT
9.5. Zend_Db_Table
9.5.1. ﮀﻋ
9.5.2. ＀溜
9.5.3. ︻
9.5.4. 
9.5.5. 
9.5.6. Deleting Rows
9.5.7. ︻
9.5.8. ︀ﮰu
9.5.9. 駱ﮰu
9.5.10. Adding Domain Logic
9.6. Zend_Db_Table_Row
9.6.1. ﮀﻋ
9.6.2. ︀ﮰu
9.6.3. ○
9.7. Zend_Db_Table_Rowset
9.7.1. ﮀﻋ
9.7.2. ﻓ
9.7.3. ﻓ
9.8. Zend_Db_Table Relationships
9.8.1. Introduction
9.8.2. Defining Relationships
9.8.3. Fetching a Dependent Rowset
9.8.4. Fetching a Parent Row
9.8.5. Fetching a Rowset via a Many-to-many Relationship
9.8.6. Cascading Write Operations
10. Zend_Debug
10.1. Dumping Variables モ
11. Zend_Exception
11.1. ソ“"︸”
12. Zend_Feed
12.1. ﻋﻍ
12.2. Zend_FeedﯼFeed
12.3. ﻎq︊ラFeed
12.4. RSS Feedソ
12.5. Atom Feedソ
12.6. ︪Atom滑
12.7. ○Feedﻓ
12.8. ﮚ﹉Feedﱻ
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 6/26 )2007-6-10 21:41:11
Zend Framework ︭
13. Zend_Filter
13.1. ﮀﻋ
13.2. ᅦﻤ
13.3. 6ᅦﻤ
13.4. Zend_Filter_Input
13.4.1. Declaring Filter and Validator Rules
13.4.2. Creating the Filter and Validator Processor
13.4.3. Retrieving Validated Fields and other Reports
13.4.4. Using Metacommands to Control Filter or Validator Rules
13.4.5. Adding Filter Class Namespaces
14. Zend_Gdata
14.1. Introduction to Gdata
14.1.1. Structure of Zend_Gdata
14.1.2. Interacting with Google Services
14.1.3. Obtaining instances of Zend_Gdata classes
14.1.4. Google Data Client Authentication
14.1.5. Dependencies
14.1.6. Creating a new Gdata client
14.1.7. Common query parameters
14.1.8. Fetching a feed
14.1.9. Working with data in feeds and entries
14.1.10. Updating entries
14.1.11. Posting entries to Google servers
14.1.12. Deleting entries on Google servers
14.2. Authenticating with AuthSub
14.2.1. Creating an AuthSub authenticated Http Client
14.2.2. Revoking AuthSub authentication
14.3. Authenticating with ClientLogin
14.3.1. Creating a ClientLogin authenticated Http Client
14.3.2. Terminating a ClientLogin authenticated Http Client
14.4. Using Google Spreadsheets
14.4.1. Create a Spreadsheet
14.4.2. Get a List of Spreadsheets
14.4.3. Get a List of Worksheets
14.4.4. Interacting With List-based Feeds
14.4.5. Interacting With Cell-based Feeds
14.5. Catching Gdata Exceptions
15. Zend_Http
15.1. Zend_Http_Client
15.1.1. ﮀﻋ
15.1.2. ︦ﮚHTTP老 GET ﯷﱂ
15.1.3. ﯷﱂ駱︪
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 7/26 )2007-6-10 21:41:11
Zend Framework ︭
15.1.4. HTTP timeout
15.1.5. ﮚHTTP Header
15.1.6.  HTTP POST, PUT,  DELETE ﯷﱂ
15.2. Zend_Http_Client - Advanced Usage
15.2.1. HTTP Redirections
15.2.2. Adding Cookies and Using Cookie Persistence
15.2.3. Setting Custom Request Headers
15.2.4. File Uploads
15.2.5. Sending Raw POST Data
15.2.6. HTTP Authentication
15.2.7. Sending Multiple Requests With the Same Client
15.3. Zend_Http_Client - Connection Adapters
15.3.1. Overview
15.3.2. The Socket Adapter
15.3.3. The Proxy Adapter
15.3.4. The Test Adapter
15.3.5. Creating your own connection adapters
15.4. Zend_Http_Cookie and Zend_Http_CookieJar
15.4.1. Introduction
15.4.2. Instantiating Zend_Http_Cookie Objects
15.4.3. Zend_Http_Cookie getter methods
15.4.4. Zend_Http_Cookie: Matching against a scenario
15.4.5. The Zend_Http_CookieJar Class: Instantiation
15.4.6. Adding Cookies to a Zend_Http_CookieJar object
15.4.7. Retrieving Cookies From a Zend_Http_CookieJar object
15.5. Zend_Http_Response
15.5.1. ﮀﻋ
16. Zend_Json
16.1. ﮀﻋ
16.2. ﳕ
16.3. JSON ﯹﱡ
17. Zend_Loader
17.1. スﻶﱻ
17.1.1. スﻶ
17.1.2. スﱻ
17.1.3. ﮚ︪ﻶﯻ
18. Zend_Locale
18.1. Introduction
18.1.1. What is Localization
18.1.2. What is a Locale?
18.1.3. How are Locales Represented?
18.1.4. Selecting the Right Locale
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 8/26 )2007-6-10 21:41:11
Zend Framework ︭
18.1.5. ZF Locale-Aware Classes
18.1.6. Zend_Locale_Format::setOptions(array $options)
18.2. Using Zend_Locale
18.2.1. Copying, Cloning, and Serializing Locale Objects
18.2.2. isEqual() - Equality
18.2.3. Default locales
18.2.4. Set a new locale
18.2.5. Getting the language and region
18.2.6. Obtaining localized strings
18.2.7. Obtaining translations for "yes" and "no"
18.3. Normalization and Localization
18.3.1. Number normalization: getNumber($input, Array $options)
18.3.2. Number localization
18.3.3. Number testing
18.3.4. Float value normalization
18.3.5. Floating point value localization
18.3.6. Floating point value testing
18.3.7. Integer value normalization
18.3.8. Integer point value localization
18.3.9. Integer value testing
18.3.10. Numeral System Conversion
18.4. Working with Dates and Times
18.4.1. Normalizing Dates and Times
18.4.2. Testing Dates
18.4.3. Normalizing a Time
18.4.4. Testing Times
18.5. Supported Languages for Locales
18.6. Supported Regions for Locales
19. Zend_Log
19.1. Overview
19.1.1. Creating a Log
19.1.2. Logging Messages
19.1.3. Destroying a Log
19.1.4. Using Built-in Priorities
19.1.5. Adding User-defined Priorities
19.1.6. Understanding Log Events
19.2. Writers
19.2.1. Writing to Streams
19.2.2. Writing to Databases
19.2.3. Stubbing Out the Writer
19.2.4. Testing with the Mock
19.2.5. Compositing Writers
19.3. Formatters
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 9/26 )2007-6-10 21:41:11
Zend Framework ︭
19.3.1. Simple Formatting
19.3.2. Formatting to XML
19.4. Filters
19.4.1. Filtering for All Writers
19.4.2. Filtering for a Writer Instance
20. Zend_Mail
20.1. ﮀﻋ
20.2. ᅦSMTP®ﻶ
20.3. ᅦ︀︪SMTP￞駱︪®ﻶ
20.4. ソ︍Transportﯹﱡ
20.5. HTML®ﻶ
20.6. ﻶ
20.7. ﻶﺺ
20.8. MIMEﺿ
20.9. 烙®ﻶ老£
20.10. ﭗﬦ
20.11. 6
20.12. SMTP戴﯁
20.13. Securing SMTP Transport
20.14. Reading Mail Messages
20.14.1. Simple example using Pop3
20.14.2. Opening a local storage
20.14.3. Opening a remote storage
20.14.4. Fetching messages and simple methods
20.14.5. Working with messages
20.14.6. Checking for flags
20.14.7. Using folders
20.14.8. Advanced Use
21. Zend_Measure
21.1. Introduction
21.2. Creation of Measurements
21.2.1. Creating measurements from integers and floats
21.2.2. Creating measurements from strings
21.2.3. Measurements from localized strings
21.3. Outputting measurements
21.3.1. Automatic output
21.3.2. Outputting values
21.3.3. Output with unit of measurement
21.3.4. Output as localized string
21.4. Manipulating Measurements
21.4.1. Convert
21.4.2. Add and subtract
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 10/26 )2007-6-10 21:41:11
Zend Framework ︭
21.4.3. Compare
21.4.4. Compare
21.4.5. Manually change values
21.4.6. Manually change types
21.5. Types of measurements
21.5.1. Hints for Zend_Measure_Binary
21.5.2. Hints for Zend_Measure_Number
21.5.3. Roman numbers
22. Zend_Memory
22.1. Overview
22.1.1. Introduction
22.1.2. Theory of Operation
22.2. Memory Manager
22.2.1. Creating a Memory Manager
22.2.2. Managing Memory Objects
22.2.3. Memory Manager Settings
22.3. Memory Objects
22.3.1. Movable
22.3.2. Locked
22.3.3. Memory container 'value' property.
22.3.4. Memory container interface
23. Zend_Mime
23.1. Zend_Mime
23.1.1. ﮀﻋ
23.1.2. ﳕ︸
23.1.3. ﮞヒZend_Mime
23.2. Zend_Mime_Message
23.2.1. ﮀﻋ
23.2.2. ﮞヒ
23.2.3. MIMEﶈ﮵
23.2.4. ﺿ滑
23.2.5. 泥ﭗﬦ︲,ﻺZend_Mime_Messageﯹﱡ(ﮞ戴)
23.3. Zend_Mime_Part
23.3.1. ﮀﻋ
23.3.2. ﮞヒ
23.3.3. ︲ﶈ﮵︺ﭗﬦ︲ﳕ
24. Zend_Pdf
24.1. Introduction.
24.2. Creating and loading PDF documents.
24.3. Save changes to the PDF document.
24.4. Document pages.
24.5. Drawing.
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 11/26 )2007-6-10 21:41:11
Zend Framework ︭
24.5.1. Geometry.
24.5.2. Colors.
24.5.3. Shape Drawing.
24.5.4. Text Drawing.
24.5.5. Using fonts.
24.5.6. Image Drawing.
24.5.7. Line drawing style.
24.5.8. Fill style.
24.5.9. Rotations.
24.5.10. Save/restore graphics state.
24.5.11. Clipping draw area.
24.5.12. Styles.
24.6. Zend_Pdf module usage example.
25. Zend_Registry
25.1. ソﯹﱡﳨ(Registry)
25.1.1. ﮾ョRegistry︭
25.1.2. Registry︭
25.1.3. ﻺ︀︪Registryﯹﱡ
25.1.4. ﮿ﻄ︀﮿Registryﯹﱡ
25.1.5. ﯹﱡ/﮿Registry
25.1.6. ﯢ︀︪ﴢ5ﭘ
25.1.7. ﱕRegistryﯹﱡ
25.1.8. ﳨ
26. Zend_Rest
26.1. Introduction
26.2. Zend_Rest_Client
26.2.1. Introduction
26.2.2. Responses
26.2.3. Request Arguments
26.3. Zend_Rest_Server
26.3.1. Introduction
26.3.2. REST Server Usage
26.3.3. Calling a Zend_Rest_Server Service
26.3.4. Sending A Custom Status
26.3.5. Returning Custom XML Responses
27. Zend_Search_Lucene
27.1. 廬￰
27.1.1. ﮀﻋ
27.1.2. ﭗ﮵ﯹﱡ
27.1.3. 泥ﭗ﮵ﱻ
27.2. ﻺ頋ﴢ5
27.2.1. ﻺﴢ5
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 12/26 )2007-6-10 21:41:11
Zend Framework ︭
27.2.2. ﴢ5
27.3. ﴢﴢ5
27.3.1. ﻺ頋ﯢ
27.3.2. ﴢﻓ
27.3.3. ﻓ﯄
27.4. Query Language
27.4.1. Terms
27.4.2. Fields
27.4.3. Term Modifiers
27.4.4. Proximity Searches
27.4.5. Boosting a Term
27.4.6. Boolean Operators
27.4.7. Grouping
27.4.8. Field Grouping
27.4.9. Escaping Special Characters
27.5. ﯢﱻ
27.5.1. ﯢ
27.5.2. 駱ﯢ
27.5.3. ﯭﯢ
27.6. ﭗﬦ
27.6.1. UTF-8 ﭗﭗﬦ
27.7. ﱕ
27.7.1. 
27.7.2. ﯄ﮗﳕ
27.7.3. ﭘ﮹
27.8. ︎ Java Lucene ﺒ|
27.8.1. ﻶ/
27.8.2. ﴢ5u
27.8.3. Java ﺐﻣ
27.8.4. ソ LuceneIndexCreation.jar
27.9. Advanced
27.9.1. Using index as static property
28. Zend_Server
28.1. Introduction
28.2. Zend_Server_Reflection
28.2.1. Introduction
28.2.2. Usage
29. Zend_Service
29.1. ﮀﻋ
29.2. Zend_Service_Akismet
29.2.1. Introduction
29.2.2. Verify an API key
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 13/26 )2007-6-10 21:41:11
Zend Framework ︭
29.2.3. Check for spam
29.2.4. Submitting known spam
29.2.5. Submitting false positives (ham)
29.2.6. Zend-specific Accessor Methods
29.3. Zend_Service_Amazon
29.3.1. Introduction
29.3.2. ﮶ﻣ
29.3.3. ASINﴢﮚAmazon
29.3.4. ﯹAmazonﴢ
29.3.5. ︀︪ﯢ API
29.3.6. Zend_Service_Amazon ﱻ
29.4. Zend_Service_Audioscrobbler
29.4.1. Introduction to Searching Audioscrobbler
29.4.2. Users
29.4.3. Artists
29.4.4. Tracks
29.4.5. Tags
29.4.6. Groups
29.4.7. Forums
29.5. Zend_Service_Delicious
29.5.1. Introduction
29.5.2. Retrieving posts
29.5.3. Zend_Service_Delicious_PostList
29.5.4. Editing posts
29.5.5. Deleting posts
29.5.6. Adding new posts
29.5.7. Tags
29.5.8. Bundles
29.5.9. Public data
29.5.10. HTTP client
29.6. Zend_Service_Flickr
29.6.1. ﯹFlickrﴢﻋﻍ
29.6.2.  Flickr 
29.6.3. ラ Flickr ﯦﻆ﵄
29.6.4. Zend_Service_Flickr ﱻ
29.7. Zend_Service_Simpy
29.7.1. Introduction
29.7.2. Links
29.7.3. Tags
29.7.4. Notes
29.7.5. Watchlists
29.8. Zend_Service_Yahoo
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 14/26 )2007-6-10 21:41:11
Zend Framework ︭
29.8.1. ﮀﻋ
29.8.2. Yahoo!ﴢq
29.8.3. Yahoo!
29.8.4. Finding Local Businesses and Services with Yahoo!
29.8.5. ﴢYahoo! 
29.8.6. Zend_Service_Yahoo ﱻ
30. Zend_Session
30.1. ﮀﻋ
30.2. ﳕ
30.2.1. 廓ﮞヒ
30.2.2. ■ﻣ:ﯝ喙
30.2.3. :ﯝ喙﮿
30.3. 齃ﺧﳕ
30.3.1. ＀:ﯝ
30.3.2. o:ﯝ喙
30.3.3. :ﯝﰁ
30.3.4. ﯏︪喙Zend_Session_Namespaceﮞヒ
30.3.5. |喙︋ﻄ
30.3.6. ﺫ﻽戴﯁︭ソ:ﯝ
30.3.7. ﵋ﯕ︭ソ:ﯝ
30.4. ﱀ:ﯝﮡ
30.4.1. Zend_Session::setOptions()
30.4.2. 
30.4.3. regenerateId()
30.4.4. rememberMe(integer $seconds)
30.4.5. forgetMe()
30.4.6. sessionExists()
30.4.7. destroy(bool $remove_cookie = true, bool $readonly = true)
30.4.8. stop()
30.4.9. writeClose($readonly = true)
30.4.10. expireSessionCookie()
30.4.11. setSaveHandler(Zend_Session_SaveHandler_Interface $interface)
30.4.12. namespaceIsset($namespace, $name = null)
30.4.13. namespaceUnset($namespace, $name = null)
30.4.14. namespaceGet($namespace, $name = null)
30.4.15. getIterator()
30.5. 
31. Zend_Translate
31.1. Introduction
31.1.1. Starting multi-lingual
31.2. Adapters for Zend_Translate
31.2.1. How to decide which translation adapter to use
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 15/26 )2007-6-10 21:41:12
Zend Framework ︭
31.3. Using Translation Adapters
31.3.1. Translation Source Structures
31.3.2. Creating array source files
31.3.3. Creating Gettext Source Files
31.3.4. Creating TMX Source Files
31.3.5. Creating CSV Source Files
31.3.6. Options for adapters
31.3.7. Checking for translations
32. Zend_Uri
32.1. Zend_Uri
32.1.1. 廬￰
32.1.2. ﻺ︀︪URI
32.1.3. |URI
32.1.4. URI 戴﯁
32.1.5. ﮞヒﳕ
33. Zend_Validate
33.1. ﮀﻋ
33.1.1. ﻀ﹈戴(validator)?
33.1.2. 戴ﳕ
33.1.3. ﮚﶈ
33.1.4. ソ
is()
ﳕ
33.2. 戴
33.3. 戴
33.4. 戴 Email 
33.5. 戴︻
34. Zend_Version
34.1. ﯻZend Frameworks
35. Zend_View
35.1. ﮀﻋ
35.1.1. 
35.1.2. 阮
35.2. 
35.2.1. ﵋
35.2.2. ﰃ阮ﹶモ
35.2.3. 阮﷯ト
35.3. 阮
35.3.1. ャ﹉モ(Escaping Output)
35.3.2. ソ﨡ﳻﻟ
35.4. 阮(View Helper)
35.4.1. 
35.4.2. Helper ﷯ト
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 16/26 )2007-6-10 21:41:12
Zend Framework ︭
35.4.3. 6ﮚ﹉Helperﱻ
36. Zend_XmlRpc
36.1. ﻋﻍ
36.2. Zend_XmlRpc_Client
36.2.1. ﻋﻍ
36.2.2. ︦
36.2.3. ﱻ鷺
36.2.4. ﺔ
36.3. Zend_XmlRpc_Server
36.3.1. Introduction
36.3.2. Basic Usage
36.3.3. Server Structure
36.3.4. Conventions
36.3.5. Utilizing Namespaces
36.3.6. Custom Request Objects
36.3.7. Custom Responses
36.3.8. Handling Exceptions via Faults
36.3.9. Caching Server Definitions Between Requests
36.3.10. Usage Examples
A. Zend Framework PHP Coding Standard
A.1. Overview
A.1.1. Scope
A.1.2. Goals
A.2. PHP File Formatting
A.2.1. General
A.2.2. Indentation
A.2.3. Maximum Line Length
A.2.4. Line Termination
A.3. Naming Conventions
A.3.1. Classes
A.3.2. Interfaces
A.3.3. Filenames
A.3.4. Functions and Methods
A.3.5. Variables
A.3.6. Constants
A.4. Coding Style
A.4.1. PHP Code Demarcation
A.4.2. Strings
A.4.3. Arrays
A.4.4. Classes
A.4.5. Functions and Methods
A.4.6. Control Statements
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 17/26 )2007-6-10 21:41:12
Zend Framework ︭
A.4.7. Inline Documentation
37. System Requirements
37.1. PHP Version Required
37.2. PHP Extensions
B. £
ﴢ5
︅
2.1.
︀︪CMSヒ﮿

3.1.
ョ

4.1.
Available options

4.2.
Available options

4.3.
Available options

4.4.
Available options

4.5.
Available options

4.6.


4.7.


4.8.


5.1.
Zend_Config_Ini Constructor parameters

8.1.
Date Parts

8.2.
Basic Operations

8.3.
Date Comparison Methods

8.4.
Date Output Methods

8.5.
Date Output Methods

8.6.
Miscellaneous Methods

8.7.
Operations involving Zend_Date::HOUR

8.8.
Day Constants

8.9.
Week Constants

8.10.
Month Constants

8.11.
Year Constants

8.12.
Time Constants

8.13.
Timezone Constants

8.14.
Date Format Constants (formats include timezone)

8.15.
Date and Time Formats (format varies by locale)

8.16.
Constants for ISO 8601 date output
8.17.
Constants for PHP date output
8.18.
Types of supported horizons for sunset and sunrise

15.1.
Zend_Http_Client configuration parameters

18.1.
Details for getTranslationList($type = null, $locale = null)

18.2.
Format tokens for self generated number formats
18.3.
List of supported numeral systems

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 18/26 )2007-6-10 21:41:12
Zend Framework ︭
18.4.
Key values for getDate() with option 'fix_date'

18.5.
Return values

18.6.
Format definition

18.7.
Example formats

18.8.
List of all supported languages

18.9.
List of all supported regions

20.1.
Mail Read Feature Overview

20.2.
Mail Folder Names

21.1.
List of measurement types

27.1.
Zend_Search_Lucene_Field ﱻ

29.1.
Zend_Service_Amazon_Item ﱞ

29.2.
Zend_Service_Amazon_Image ﱞ

29.3.
Zend_Service_Amazon_OfferSet ﱞ

29.4.
ﱞ

29.5.
Zend_Service_Amazon_SimilarProduct ﱞ

29.6.
Zend_Service_Amazon_Accessories ﱞ

29.7.
Zend_Service_Amazon_CustomerReview ﱞ

29.8.
Zend_Service_Amazon_EditorialReview ﱞ

29.9.
Zend_Service_Amazon_Listmania ﱞ

29.10.
Methods for retrieving public data

29.11.
Methods of the
Zend_Service_Delicious_SimplePost
class

29.12.
Zend_Service_Flickr_ResultSet ﱞ

29.13.
Zend_Service_Flickr_Result ﱞ

29.14.
Zend_Service_Flickr_Image ﱞ

29.15.
Zend_Service_Yahoo_ResultSet

29.16.
Zend_Service_Yahoo_LocalResultSet ﱞ

29.17.
Zend_Service_Yahoo_Result Properties

29.18.
Zend_Service_Yahoo_WebResult ﱞ

29.19.
Zend_Service_Yahoo_ImageResult ﱞ

29.20.
Zend_Service_Yahoo_LocalResult ﱞ

29.21.
Zend_Service_Yahoo_NewsResult ﱞ

29.22.
Zend_Service_Yahoo_Image Properties

31.1.
Adapters for Zend_Translate

36.1.
PHPﱻャ︺XML-RPCﱻ

36.2.
Zend_XmlRpc_Value
ﯹﱡXML-RPCﱻ

37.1.
PHP Extensions Used in Zend Framework

ヒ︅
2.1.
戮﹋駱ﻧ

3.1.
○ Session ﭗ喙

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 19/26 )2007-6-10 21:41:12
Zend Framework ︭
3.2.
ソﮚﭘﱻ

3.3.
ﳕ

4.1.
ﰃ
Zend_Cache::factory()
ラ︀︪﫯

4.2.

Zend_Cache
モ﫯3ﭘモ

5.1.
Using Zend_Config Per Se

5.2.
Using Zend_Config_Ini

5.3.
Using Zend_Config_Xml

6.1.
Using the Short Syntax

6.2.
Using the Long Syntax

6.3.
Catching Getopt Exceptions

6.4.
Using getOption()

6.5.
Using __get() and __isset() magic methods

6.6.
Using getRemainingArgs()

6.7.
Using addRules()

6.8.
Using setHelp()

6.9.
Using setAliases()

6.10.
Using addArguments() and setArguments()

6.11.
Using setOption()

6.12.
Using setOptions()

7.1.
Setting Options

7.2.
Using Defaults

7.3.
Using goto()'s _forward() API

7.4.
Using route assembly with gotoRout()

7.5.
Basic Usage

7.6.
Disabling autorender

7.7.
Choosing a different view script

7.8.
Modifying the registered view

7.9.
Changing the path specifications

7.10.
Rendering multiple view scripts from a single action

8.1.
Setting a default timezone

8.2.
Creating the current date

8.3.
get() - output a date

8.4.
set() - set a date

8.5.
add() - adding dates

8.6.
compare() - compare dates

8.7.
equals() - identify a date or date part

8.8.
User-specified input date format

8.9.
Operating on Parts of Dates

8.10.
Example usage for self-defined ISO formats

8.11.
Example usage for self-defined formats with PHP specifier

8.12.
Checking dates

8.13.
Getting all avaiable cities

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 20/26 )2007-6-10 21:41:12
Zend Framework ︭
8.14.
Getting the location for a city

8.15.
Calculating sun informations

8.16.
Working with timezones

8.17.
Multiple timezones

9.1.
Creating a SQL statement object with query()

9.2.
Using a SQL statement constructor

9.3.
Executing a statement with positional parameters

9.4.
Executing a statement with named parameters

9.5.
Using fetch() in a loop

9.6.
Using fetchAll()

9.7.
Setting the fetch mode

9.8.
Using fetchColumn()

9.9.
Using fetchObject()

9.10.
Fetching a Dependent Rowset

9.11.
Fetching a Dependent Rowset By a Specific Rule

9.12.
Fetching Dependent Rowsets using the Magic Method

9.13.
Fetching the Parent Row

9.14.
Fetching a Parent Row By a Specific Rule

9.15.
Fetching the Parent Row using the Magic Method

9.16.
Fetching a Rowset with the Many-to-many Method

9.17.
Fetching a Rowset with the Many-to-many Method By a Specific Rule

9.18.
Fetching Rowsets using the Magic Many-to-many Method

9.19.
Example of a Cascading Delete

9.20.
Example Declaration of Cascading Operations

10.1.
dump()ソ鷺ヒ:

11.1.
︀︪"︸:

12.1.
Zend_Feed滑RSS Feed

12.2.
Atom Feedﳕ

12.3.
ﯻAtom Feed︪

12.4.
ﯹﱡ﮿Atom Feed︪

12.5.
○︀︪ﷲﭘ

12.6.
ﮚ﹉喙ﻺ︀︪Atomﴠ

12.7.
ﮚ﹉喙ﻧAtomﱻ

15.1.
︀︪ GET ﯷﱂ

15.2.
ﻺ︀︪Zend_Http_Client

15.3.
駱header£

15.4.
ﯷﱂ駱︪

15.5.
Zend_Http_ClientPOST 

15.6.
Forcing RFC 2616 Strict Redirections on 301 and 302 Responses

15.7.
Setting Cookies Using setCookie()

15.8.
Enabling Cookie Stickiness

15.9.
Setting A Single Custom Request Header

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 21/26 )2007-6-10 21:41:12
Zend Framework ︭
15.10.
Setting Multiple Custom Request Headers

15.11.
Using setFileUpload to Upload Files

15.12.
Sending Raw POST Data

15.13.
Setting HTTP Authentication User and Password

15.14.
Performing consecutive requests with one client

15.15.
Changing the HTTPS transport layer

15.16.
Using Zend_Http_Client behind a proxy server

15.17.
Testing Against a Single HTTP Response Stub

15.18.
Testing Against Multiple HTTP Response Stubs

15.19.
Creating your own connection adapter

15.20.
Instantiating a Zend_Http_Cookie object

15.21.
Stringifying a Zend_Http_Cookie object

15.22.
Using getter methods with Zend_Http_Cookie

15.23.
Matching cookies

15.24.
滑HTTPﺔﭔ

17.1.
Example of loadFile() method

17.2.
loadClass() 鷺ヒ:

17.3.
isReadable()鷺ヒ:

18.1.
Choosing a specific locale

18.2.
Automatically selecting a locale

18.3.
Dates default to correct locale of web users

18.4.
Overriding default locale selection

18.5.
Performance optimization when using a default locale

18.6.
Dates default to correct locale of web users

18.7.
clone

18.8.
Check for equal locales

18.9.
Get default locales

18.10.
setLocale

18.11.
Convenience functions for getTranslation()

18.12.
getTranslationList

18.13.
Converting country name in one language to another

18.14.
All available translations

18.15.
All Languages written in their native language

18.16.
getQuestion()

18.17.
Number normalization

18.18.
Number normalization with precision

18.19.
Number localization

18.20.
Number localization with precision

18.21.
Using a self defined number format

18.22.
Number testing

18.23.
Floating point value normalization

18.24.
Floating point value localization

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 22/26 )2007-6-10 21:41:12
Zend Framework ︭
18.25.
Floating point value testing

18.26.
Integer value normalization

18.27.
Integer value localization

18.28.
Integer value testing

18.29.
Converting numerals from Eastern Arabic scripts to European/Latin scripts

18.30.
Converting numerals from Latin script to Eastern Arabic script

18.31.
Getting 4 letter CLDR script code using a native-language name of the script

18.32.
Normalizing a date

18.33.
Normalizing a date by locale

18.34.
Normalizing a date with time

18.35.
Normalizing a userdefined date

18.36.
Automatic correction of input dates

18.37.
Date testing

18.38.
Normalize an unknown time

18.39.
Testing a time

20.1.
ソZend_Mailﮀ®ﻶ

20.2.
ᅦ SMTP ®ﻶ

20.3.
ᅦ︀︪SMTP￞駱︪®ﻶ

20.4.
ソ︍Transportﯹﱡ

20.5.
HTML®ﻶ

20.6.
︦ﻶ®ﻶ

20.7.
MIMEﺿ

20.8.
烙®ﻶ老£

20.9.
Enabling a secure connection within Zend_Mail_Transport_Smtp

21.1.
Converting measurements

21.2.
The
meter
measurement

21.3.
Creation using integer and floating values

21.4.
Creation using strings

21.5.
Arbitrary text input containing measurements

21.6.
Localized string

21.7.
Automatic output

21.8.
Output a value

21.9.
Outputting units

21.10.
Convert

21.11.
Adding units

21.12.
Subtract

21.13.
Different measurements

21.14.
Identical measurements

21.15.
Difference

21.16.
Changing a value

21.17.
Changing the type

22.1.
Using Zend_Memory component

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 23/26 )2007-6-10 21:41:12
Zend Framework ︭
24.1.
Create new or load existing PDF document.

24.2.
Requesting specified revision of the PDF document.

24.3.
Save PDF document.

24.4.
PDF document pages management.

24.5.
Draw a string on the page.

24.6.
Draw a UTF-8-encoded string on the page.

24.7.
Create a standard font.

24.8.
Create a TrueType font.

24.9.
Create a TrueType font, but do not embed it in the PDF document.

24.10.
Do not throw an exception for fonts that cannot be embeded.

24.11.
Do not compress an embedded font.

24.12.
Combining font embedding options.

24.13.
Image drawing.

24.14.
Zend_Pdf module usage demo.

25.1.
set() ソ鷺ヒ:

25.2.
get() ﳕ鷺ヒ:

25.3.
■ﻣ︀︪registryﯹﱡ:

25.4.
ﻺ︀︪registryﯹﱡ

25.5.
Example of initializing the static registry

25.6.
array /﮿鷺ヒ:

25.7.
ﯹﱡ「/﮿:

25.8.
isRegistered() 鷺ヒ:

25.9.
isset() 鷺ヒ:

25.10.
ﮚﳨﱻ:

25.11.
_unsetInstance() 鷺ヒ:

26.1.
A basic REST request

26.2.
Response Status

26.3.
Using Technorati's Rest Service

26.4.
Example Technorati Response

26.5.
Setting Request Arguments

26.6.
Basic Zend_Rest_Server Usage - Classes

26.7.
Basic Zend_Rest_Server Usage - Functions

26.8.
Returning Custom Status

26.9.
Return Custom XML

27.1.
ﮚ﹉廓ﺏ

29.1.
isSpam() Usage

29.2.
submitSpam() Usage

29.3.
submitHam() Usage

29.4.
@ﻟAPIﴢAmazon

29.5.
ソQuery APIﴢAmazon

29.6.
︀︪ Amazon Web Service ﮶

29.7.
ASINﴢﮚAmazon

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 24/26 )2007-6-10 21:41:12
Zend Framework ︭
29.8.
ﯹAmazonﴢ

29.9.
Search Amazon Using the Alternative Query API

29.10.
Retrieving User Profile Information

29.11.
Retrieving a User's Weekly Artist Chart

29.12.
Retrieving Related Artists

29.13.
Get all posts

29.14.
Accessing post lists

29.15.
Post editing

29.16.
Method call chaining

29.17.
Deleting posts

29.18.
Adding a post

29.19.
Tags

29.20.
Bundles

29.21.
Retrieving public data

29.22.
Changing the HTTP client of
Zend_Rest_Client

29.23.
Configuring your HTTP client to keep connections alive

29.24.
ﮀ Flickr ﴢ

29.25.
emailFlickr

29.26.
ラ Flickr ﯦﻆ﵄

29.27.
Querying Links

29.28.
Modifying Links

29.29.
Working With Tags

29.30.
Working With Notes

29.31.
Retrieving Watchlists

29.32.
Yahoo!ﴢq

29.33.
Yahoo!

29.34.
Yahoo!£

29.35.
ﴢYahoo! 

30.1.
ﮡﮗwebﬡ

30.2.
ﳕ: ソ喙嬨

30.3.
ﳕ: PHP:ﯝ﮿

30.4.
:ﯝ■ﻣ

30.5.
﮿:ﯝ

30.6.
＀ﱀ:ﯝ

30.7.
o:ﯝ喙

30.8.
o阮︭:ﯝ

30.9.
︦喙:ﯝ

30.10.
︺︀ﮞヒ

30.11.
ﷲ喙︋ﻄ

30.12.
Workaround: ,○,ﭘ

30.13.
Workaround: ﭘﻄ5ﻄ

30.14.
ﮀ﮿﯆

file:///C|/Documents and Settings/506//zf/index.html(שּׁ 25/26 )2007-6-10 21:41:12
Zend Framework ︭
30.15.
ソPHPUnit﵋ﯕZend_Session*ﻣ

30.16.
ソZend_ConfigﻄﻶョZend_Sessionﻄﻶ

30.17.
myapp.ini

30.18.
:ﯝ:ﯝﮚ

30.19.
ﳨ喙

31.1.
Example of single-language PHP code

31.2.
Example of multi-lingual PHP code

31.3.
Example TMX file

31.4.
Example CSV file

31.5.
Example CSV file two

31.6.
Using translation options

31.7.
Checking if a text is translateable

32.1.
ソ
Zend_Uri::factory()
ﻺ︀︪URI

32.2.
ソ
Zend_Uri::factory()
|︀︪URI

32.3.
ソ
Zend_Uri::check()
ᅴURI 戴﯁

32.4.

Zend_Uri_*
ﯹﱡラ﨡/

32.5.
ﻎ︀︪
Zend_Uri_*
ﯹﱡラ︪URI

32.6.
戴﯁︀︪
Zend_Uri_*
ﯹﱡ

34.1.
compareVersion()ﳕ鷺ヒ:

36.1.
︀︪XML-RPCﯷﱂ

36.2.
ﱻ鷺ﰃ︀︪XML-RPC




︋︀



שּׁ 1 﫠 Zend Framework
file:///C|/Documents and Settings/506//zf/index.html(שּׁ 26/26 )2007-6-10 21:41:12
שּׁ 1 﫠 Zend Framework
שּׁ 1 﫠 Zend Framework
︊︀



︋︀

שּׁ 1 﫠 Zend Framework
u
1.1. ﮀﻋ
1.1. ﮀﻋ
Zendﱻ︪Zend Frameworkﱻ,﹋ﻥ￙︪ﱻ︺ﺆソZend FrameworkᆰDRY
(Don't Repeat Yourself)￙︪ﱻﳕ,￙ﺛﱻﳕZend Framework︭ネ駱ﻄﻶ
女 (Zendﱻ︪ﱻ,ﮃﳕ,﹟ﰱﯴ,︍女ﮞヒﰱﻥﰃ
Zend留ﳕ/ᅲﯴ,Zendﱻsﺎﻬfunctions.inc.php,︔
corefunctions.inc.php,ロﺆᅢ︸ --Haohappyﳨ)
︊︀



︋︀

Zend Framework ︭
ﵷ溜
שּׁ 2 﫠 Zend_Acl
file:///C|/Documents and Settings/506//zf/zend.html2007-6-10 21:41:13
שּׁ 2 﫠 Zend_Acl
שּׁ 2 﫠 Zend_Acl
︊︀



︋︀

שּׁ 2 﫠 Zend_Acl
u
2.1. ﮀﻋ
2.1.1. ﺎ﵄ﺐ(Resource)
2.1.2. ﺎ戮(Role)
2.1.3. ﻺ﮿(ACL)
2.1.4. ﳨ戮(Role)
2.1.5. ﮚ﹉﮿
2.1.6. ﯢ ACL
2.2. ﲾﻆ﮿
2.2.1. ﲾﻆ﮿
2.2.2. ﮿
2.3. 齃ﺧﳕ
2.3.1. ￝ﭘ ACL ￝﹅
2.3.2. ソ(Assert)6ﻶ ACL 龍
2.1. ﮀﻋ
Zend_Acl ロサﹶﴻ﮿ (ACL,access control list) ﮡ︀,ﺔッ
ﻶﻥ￙ﺛﮚﯹﱡ﮿ﮚ￝ﯹﱡ
︭,

Resource (﵄ﺐ)︀︪﮿ﯹﱡ

Role (戮)︀︪ﻥﯷﱂ﮿Resourceﯹﱡ
ﮀﯴﰱ:Roles ﯷﱂ﮿ Resourcesヒ廬,廬︀︪ﺺ女ﱽヲ,￙,￙︪ﺺﰱﯷﱂ
 Role,￙ニﱽヲﰱ Resource,ﻥソ￙ニヲﰱ﹋︭ﺆ
ᅦ龍﮿(ACL)ソ,ﺔッﻶﻥ廬uﻙﯷﱂﯹﱡ(Roles)﮿
￝ﯹﱡ(Resources)
2.1.1. ﺎ﵄ﺐ(Resource)
file:///C|/Documents and Settings/506//zf/zend.acl.html(שּׁ 1/6 )2007-6-10 21:41:15
שּׁ 2 﫠 Zend_Acl
 Zend_Acl ︭,ﻺﻺ︀︪ Resource ︸ﮀZend_Acl ロﺆ
Zend_Acl_Resource_Interface

ソ＀ﻺ Resources ︸﮹︺ﺆソZend_Acl︪ﯹﱡs|︀︪Resource,︀︪ﱻ女ﮞ
￙︪ﺆ︀︪ﳕ
getResourceId()
 烙,
Zend_Acl_Resource
︀︪ Zend_Acl
|︺︀︪ Resource ﮞﱻ,＀ﻥﻻﱕﮃ
Zend_Acl ロﺆ︀︪ﻓ,ﮃﻥﷻ駱︪ Resources (“﮿︋”)︺
Resources ﭘ￙︀︪ﻓ,ﻥﮃﻬﻥﻄﻇﻎ︀()ﮊ()ﺎﮊ
ResourceﯢﰆﻎResourceשּﺧﻓ︭ﴢﻙ稜Resources龍,ﮃ﮸ﮀ龍ﻧ
ヒ廬,女︀︪Z龍ﺔ︀︪︂﯏︪ﻺﭑ,ﰱﮀ￙︪龍ﻙ￙︪︂,︍
龍ﻙ﯏︪ﻺﭑ,ﺛﻺﭑ﹟﮸女ﱂヒ烙龍,Zend_Acl,ネ﮹ᅦ
ヒ烙龍ﻙ﯏︪￙女ﱂﻺﭑﮞ︀︪ Resource ﻥﻎ︀︀︪ Resource ﻧ,￙
︪ Resource ﹟ﮃﷱ Resource,שּשּ
Zend_Acl ﹟ﺎ Resources (ヒ廬:"create", "read", "update", "delete"), ＀
ﻥ Resource アﮊ龍
2.1.2. ﺎ戮(Role)
ﱡ Resources ︀,ﻺ︀︪ Role ﹟︸ﮀ Zend_Acl ロﺆ
Zend_Acl_Role_Interface
ソ＀
ﻺ Roles ︸﮹︺ﺆソZend_Acl︪ﯹﱡs|︀︪ Role,︀︪ﱻ女ﮞ￙︪ﺆ︀
︪ﳕ
getRoleId()
 烙,
Zend_Acl_Role
︀︪Zend_Acl|︺︀︪ Role ﮞ
ﱻ,＀ﻥﻻﱕﮃ
 Zend_Acl, ︀︪ Role ﻥﻎ︀︪駱︪ Role ﻧ,￙ﰱ Role ︭龍ﻧヒ廬,︀︪
 Role,廬 “sally”,ﻥﱞﺎ︀︪駱︪ Role,廬:“editor”“administrator”＀ﻥ
ﻙ“editor”“administrator”龍,“sally”ﰆﻎﮃﻬ←ﻧ龍,︍女ﻙ“sally”龍
ﻎ駱戮ﻧ︸,f駱ﻧ﹟︦ﺆ︀ﮚ廓ﺦ懶︋ヒﭐ鷺ヒﳊ
「Zend_Acl廬u泥ﮃ
ヒ 2.1. 戮﹋駱ﻧ
︋ﻣﮚ﹉ﺆ︉︪戮 - "
guest
", "
member
",  "
admin
" - ﮃ戮ﻥﻎﮃﻬﻧ,
ﻺ︀︪"
someUser
" 戮ﹶﻎﮃ︉︪戮ﻧ
$parents
ﻄ￙ﺛ戮ﺏネ女 ᅤ
女,Zend_Acl ︍fﴢ︺ﯢ戮(￙ "
someUser
")ﮚ﹉﮿龍,︔ﴢ︺ﯢ
戮ﻧ戮(￙ "
guest
", "
member
", and "
admin
")ﮚ﹉﮿龍:
<?php
require_once 'Zend/Acl.php';
$acl = new Zend_Acl();
require_once 'Zend/Acl/Role.php';
$acl->addRole(new Zend_Acl_Role('guest'))
file:///C|/Documents and Settings/506//zf/zend.acl.html(שּׁ 2/6 )2007-6-10 21:41:15
שּׁ 2 﫠 Zend_Acl
->addRole(new Zend_Acl_Role('member'))
->addRole(new Zend_Acl_Role('admin'));
$parents = array('guest', 'member', 'admin');
$acl->addRole(new Zend_Acl_Role('someUser'), $parents);
require_once 'Zend/Acl/Resource.php';
$acl->add(new Zend_Acl_Resource('someResource'));
$acl->deny('guest', 'someResource');
$acl->allow('member', 'someResource');
echo $acl->isAllowed('someUser', 'someResource') ? 'allowed' : 'denied';
︺ﲡ︺ "
someUser
""
someResource
" ﮚ﹉龍,ﻥZend_Acl ᅤﴢ
︺"
someUser
"ﻧ戮ﮚ﹉龍練,"
admin
"戮﮿,ﲡﻙﮃﮚ﹉﮿龍
,"
member
"戮﮿,Zend_Acl︪龍﮸"
member
" ﮿"
someResource
"
廬Zend_Aclﮗﻧﻭ︺戮ﮚ﹉龍,,ﮃﰆ"
guest
" ﻝ﮿
"
someResource
" ￙︦ﺆ﨡︤「, "
someUser
"﮸女ﭢ﮿"
someResource
",
︺ﮃﻎ︍戮ﻧﺆ嬨龍
Zend_Acl 泥ﺆ￙︪﨡︤,sﮃשּׁ︀︪龍,ﰱﮌﺆﯢﯹﺎ￙︪ヒ,
︺"
member
"戮ﺎ"
guest
" 戮,￙︪ヒﭐﰆ"
allowed
"
ﳨ
s︺︀︪戮ﮚ駱(戮),ﯷﮰo,ﯹﺎ︀︪ﯢ
龍,(戮)練ﴢ
2.1.3. ﻺ﮿(ACL)
ACL ﻥ鷺ﻻu︀ﻄﯹﱡ,,|︺鷺,ﻬﰆﻺ︀︪﮹ﮡﳻﻟ ACL,
︀︪ネ﮽駱,ﮃﰆﻴﹲ︪שּﺧﻄ︺ﻺ︀︪ ACL ﯹﱡ,ﻬ︍︦
ﮞヒ￙︪ ACL.
<?php
require_once 'Zend/Acl.php';
$acl = new Zend_Acl();
ﳨ
file:///C|/Documents and Settings/506//zf/zend.acl.html(שּׁ 3/6 )2007-6-10 21:41:15
שּׁ 2 﫠 Zend_Acl
＀︀︪"allow" 龍,Zend_Acl 女ﭢﻻu Role ﯹﻻu
Resource ﻻu﮿
2.1.4. ﳨ戮(Role)
﮹ﮡﳻﻟ︸女︀︪ﺧﳻﻟﮚﮃ|︺鷺,“Guest”ﻄ﮸
﮿,“Staff”蠟駱︸|CMS,“Editor”ﻄﺎ︃懶ﭘ﮹,
“Administrator”ﻄﻻﮃﻄ﮹ﹶ£ﮡョ龜﻽/
ﯼ￙ﻄ﮸ﻥ鷺︺︀︪ Role ﳨ,﮸﯏︪ﻄﻎ“”ﻄﻧ,﹟ﻥ︺︀ﻄロ
￙ﺛ﮸ﻥ鷺廬︋:
 2.1. ︀︪CMSヒ﮿
藺
﮸
ﻎ...ﻧ﮸
Guest
View
N/A
Staff
Edit, Submit, Revise
Guest
Editor
Publish, Archive, Delete
Staff
Administrator
(Granted all access)
N/A
ﯹﺎ￙︪ヒ,
Zend_Acl_Role
ソ,fﻻuﮞ
Zend_Acl_Role_Interface
ﯹﱡ￙
ﺛﻄﻥﷻ Role ﳨ廬︋:
<?php
require_once 'Zend/Acl.php';
$acl = new Zend_Acl();
//  Zend_Acl_Role ﻄﷻ Role ﳨ
require_once 'Zend/Acl/Role.php';
// Guest ︍ﻧ﮿
$roleGuest = new Zend_Acl_Role('guest');
$acl->addRole($roleGuest);
// Staff ﻎ guest ﻧ
$acl->addRole(new Zend_Acl_Role('staff'), $roleGuest);
/* 烙, ︊﹟￙:
$roleGuest = $acl->addRole(new Zend_Acl_Role('staff'), 'guest');
//*/
// Editor ﻎ staff ﻧ
file:///C|/Documents and Settings/506//zf/zend.acl.html(שּׁ 4/6 )2007-6-10 21:41:15
שּׁ 2 﫠 Zend_Acl
$acl->addRole(new Zend_Acl_Role('editor'), 'staff');
// Administrator ︍ﻧ﮿
$acl->addRole(new Zend_Acl_Role('administrator'));
2.1.5. ﮚ﹉﮿
 ACL ﺆ Roles,ﻥﻺ頋龍ﮚ﹉ Roles 廬u﮿ Resources⦆﹟﮸ﳨﻬ
￙︪ヒﲡﮚ﹉ﻻuﮚ Resources, ￙ﮀ鷺￙ﺛ龍ﺎ ResourcesZend_Acl
ロ︀︪ﮞ,ﱍﭤ,龍女ﻎ︀ﮊ,ﰏ龍ﱂ,︺ Resources  Roles ﻧ
ﮃﻬ稜ﮚ﹉龍
ﭤ,ﻬﻥﰑﻣﮚ﹉ﺦ懶龍ﺔ︊ﮚ﹉﮸:
<?php
require_once 'Zend/Acl.php';
$acl = new Zend_Acl();
require_once 'Zend/Acl/Role.php';
$roleGuest = new Zend_Acl_Role('guest');
$acl->addRole($roleGuest);
$acl->addRole(new Zend_Acl_Role('staff'), $roleGuest);
$acl->addRole(new Zend_Acl_Role('editor'), 'staff');
$acl->addRole(new Zend_Acl_Role('administrator'));
// Guest ﻥ﵏杻﮹
$acl->allow($roleGuest, null, 'view');
/* 烙, ︊﹟︺:
$acl->allow('guest', null, 'view');
//*/
// Staff ﻎ guest ﻧ﵏杻,f﹟女烙
$acl->allow('staff', null, array('edit', 'submit', 'revise'));
// Editor ﻎ Staff ﻧ view, edit, submit  revise 
// f﹟女烙
$acl->allow('editor', null, array('publish', 'archive', 'delete'));
// Administrator ︍女ﻧﻻu,ﮃ
$acl->allow('administrator');
︊
allow()
︭ﰃ︭
null
 allow 龍ﺎ Resources
file:///C|/Documents and Settings/506//zf/zend.acl.html(שּׁ 5/6 )2007-6-10 21:41:15
שּׁ 2 﫠 Zend_Acl
2.1.6. ﯢ ACL
ﻬ︀︪ﴻ ACL ﻥﮚﯷﱂ︪ web ﺔ﮸
isAllowed()
ﳕﯢsﮀ:
<?php
echo $acl->isAllowed('guest', null, 'view') ?
"allowed" : "denied"; // ﮸
echo $acl->isAllowed('staff', null, 'publish') ?
"allowed" : "denied"; // 女ﭢ
echo $acl->isAllowed('staff', null, 'revise') ?
"allowed" : "denied"; // ﮸
echo $acl->isAllowed('editor', null, 'view') ?
"allowed" : "denied"; // ﮸,︺ﻎ guest ﻧ
echo $acl->isAllowed('editor', null, 'update') ?
"allowed" : "denied"; // 女ﭢ,︺ﯹﺎ 'update' ﲡ allow 龍
echo $acl->isAllowed('administrator', null, 'view') ?
"allowed" : "denied"; // ﮸,︺ administrator 
echo $acl->isAllowed('administrator') ?
"allowed" : "denied"; // ﮸,︺ administrator 
echo $acl->isAllowed('administrator', null, 'update') ?
"allowed" : "denied"; // ﮸,︺ administrator 
︊︀



︋︀

שּׁ 1 﫠 Zend Framework
ﵷ溜
2.2. ﲾﻆ﮿
file:///C|/Documents and Settings/506//zf/zend.acl.html(שּׁ 6/6 )2007-6-10 21:41:15
2.2. ﲾﻆ﮿
2.2. ﲾﻆ﮿
︊︀

שּׁ 2 﫠 Zend_Acl

︋︀

2.2. ﲾﻆ﮿
2.2.1. ﲾﻆ﮿

︀﫠
︭ﮚ﹉ ACL 鷺廬u︪ ACL ( Resources )﮸留ﮞﷵ︭,﮿
ﶋﺎヒ烙廓ﺦ懶Zend_Acl ﮸⦆ﺆsﹶﴻﮌ￙ﺛﲾﻆ
ﯹﺎCMSヒ,'staff' ﻄ閭ﺆﻝ蠟駱ﱂ,,︀︪ 'marketing' ﻄ女ﱂCMS︭﮿ﺋﮯ
￑￙︪ﻄsﻙﶳﹶ︃rﺋﮯ￑
烙,￘女ﱂ 'staff' ﻄ﮸﵏杻ﺋf︍○ﮢ￑,︍ﮩ﯏︀︪ﺺ(ﳻﻟﮡ)r
ﻻu'announcement' ﺋ,︺ﮃﻬ1-2朗
練ﻬ○ﮢ Role ﳨ￙ﺛﻬﷲﻏﮚ 'marketing' ﻄ 'staff' ﻄ﮸,ﻥﻬ
ﻎ 'staff' ﻄﻧ﮸ﳕﮚ﹉ 'marketing' ﻄ
<?php

//  marketing ﻄﻎ staff ﻄﻧ﮸
$acl->addRole(new Zend_Acl_Role('marketing'), 'staff');
, ﳨ︊﮿ﶉﮚ Resources ( ヒ廬 "newsletter", "latest news", "announcement
news"). ﻬﷻ￙ﺛ Resources:
<?php
// Create Resources for the rules
require_once 'Zend/Acl/Resource.php';
$acl->add(new Zend_Acl_Resource('newsletter')); // newsletter
$acl->add(new Zend_Acl_Resource('news')); // news
$acl->add(new Zend_Acl_Resource('latest'), 'news'); // latest news
$acl->add(new Zend_Acl_Resource('announcement'), 'news'); // announcement news
,￙︪ ACL ﮚ﹉ﮚ龍廬:
<?php
// Marketing must be able to publish and archive newsletters and the latest news
$acl->allow('marketing', array('newsletter', 'latest'), array('publish', 'archive'));
// Staff ( marketing, ᅦﻧ), 女ﭢ○ﮢ latest news
$acl->deny('staff', 'latest', 'revise');
// Everyone ( administrators) 女ﭢr news announcements
$acl->deny(null, 'announcement', 'archive');
file:///C|/Documents and Settings/506//zf/zend.acl.refining.html(שּׁ 1/3 )2007-6-10 21:41:17
2.2. ﲾﻆ﮿
ﻬ蘭ﯢ ACL :
<?php
echo $acl->isAllowed('staff', 'newsletter', 'publish') ?
"allowed" : "denied"; // denied
echo $acl->isAllowed('marketing', 'newsletter', 'publish') ?
"allowed" : "denied"; // allowed
echo $acl->isAllowed('staff', 'latest', 'publish') ?
"allowed" : "denied"; // denied
echo $acl->isAllowed('marketing', 'latest', 'publish') ?
"allowed" : "denied"; // allowed
echo $acl->isAllowed('marketing', 'latest', 'archive') ?
"allowed" : "denied"; // allowed
echo $acl->isAllowed('marketing', 'latest', 'revise') ?
"allowed" : "denied"; // denied
echo $acl->isAllowed('editor', 'announcement', 'archive') ?
"allowed" : "denied"; // denied
echo $acl->isAllowed('administrator', 'announcement', 'archive') ?
"allowed" : "denied"; // denied
2.2.2. ﮿
女ﻎ ACL ︭︀︪駱︪﮿龍,女ﮀ
removeAllow()

removeDeny()
ﳕ廬ロ︀︪
null

ﻙ
allow()

deny()
ﳕ,﮿龍ﰆﺔ戮, ﵄ﺐ/︊
<?php
//  “女ﭢ staff ○ﮢ￑”(marketing, ﺎﻧ) (שּﺎ﮸staff○ﮢ￑ Jasonﳨ)
$acl->removeDeny('staff', 'latest', 'revise');
echo $acl->isAllowed('marketing', 'latest', 'revise') ?
"allowed" : "denied"; // allowed
//  marketing ︃r newsletters ﮸
$acl->removeAllow('marketing', 'newsletter', array('publish', 'archive'));
echo $acl->isAllowed('marketing', 'newsletter', 'publish') ?
"allowed" : "denied"; // denied
echo $acl->isAllowed('marketing', 'newsletter', 'archive') ?
"allowed" : "denied"; // denied
廬︊鷺,ﯹﺎ○,fソ
null
(ﮚ)ﶅﶊﺆﯹ○(ﰓ
○ﻥﯹ Resources ︀︪︀︪ﷻ女ﭢ,廬ﮚ,ソ
null
,ﻥソラ￙
ﺛﭥ瘝ﮀ,︀ﬡﯹ︪Resourceᅴ﮸女ﭢJasonﳨ,Haohappy)
file:///C|/Documents and Settings/506//zf/zend.acl.refining.html(שּׁ 2/3 )2007-6-10 21:41:17
2.2. ﲾﻆ﮿
<?php
// ﮸ marketing ﯹ latest news ﮸
$acl->allow('marketing', 'latest');
echo $acl->isAllowed('marketing', 'latest', 'publish') ?
"allowed" : "denied"; // allowed
echo $acl->isAllowed('marketing', 'latest', 'archive') ?
"allowed" : "denied"; // allowed
echo $acl->isAllowed('marketing', 'latest', 'anything') ?
"allowed" : "denied"; // allowed
︊︀

︊︀ﺧ

︋︀

שּׁ 2 﫠 Zend_Acl
ﵷ溜
2.3. 齃ﺧﳕ
file:///C|/Documents and Settings/506//zf/zend.acl.refining.html(שּׁ 3/3 )2007-6-10 21:41:17
2.3. 齃ﺧﳕ
2.3. 齃ﺧﳕ
︊︀

שּׁ 2 﫠 Zend_Acl

︋︀

2.3. 齃ﺧﳕ
2.3.1. ￝ﭘ ACL ￝﹅
Zend_Acl ﰱ￙﮾ﮡ,ﮃ︍女︺ ACL ﭘ女ﱂﻻu廬ﺓ3ﮃﮌ
 PHP ﮞソラZend_Acl﹋︊ﻺﮚﮡ﷥s﮹ﴻ﮸駱「女︀ﺛ ACL ﺤﺒ/ﻴ,
ﹶ︔ Zend_Acl ロﺆﳕ﮾ﮚﯢﺔッﻶ﮿
︺ﺔヒ駱留ﺔ︍「,ACL ﭘﭤﻙ＀ﮌ︺ Zend_Acl ﺏ
,ﻥ ACL ﯹﱡﻥ PHP ︭
serialize()
ﺏ,ﹶ︔ﻓﻥﭘ＀ﻻu,ヒ
廬ﻶﺓ3ﭘ
2.3.2. ソ(Assert)6ﻶ ACL 龍
﮸女ﭢ︀︪ Role ﮿︀︪ Resource 龍︍ﻝﯹン︍ヒ廬, 8:00am 
5:00pm ﹋,ﮚ﮿﮸烙︀︪女ﭢ﮿ヒﭐ︺︀︪ﯷﱂﺎﮰ︺︍ IP 
Zend_Acl ﯹﺎ﮺＀ﻀ﹈女ﻶ龍ﮞ︪ョ
Zend_Acl 
Zend_Acl_Assert_Interface
ロﻶ龍︺ﺆソ龍,＀ﺆ︀︪ﮞ
︭
assert()
ﳕﱻ
<?php
require_once 'Zend/Acl/Assert/Interface.php';
class CleanIPAssertion implements Zend_Acl_Assert_Interface
{
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null,
Zend_Acl_Resource_Interface $resource = null, $privilege = null)
{
return $this->_isCleanIP($_SERVER['REMOTE_ADDR']);
}
protected function _isCleanIP($ip)
{
// ...
}
}
︀ﱻ,sﻶ龍,＀ᅤロﱻ︀︪ﮞヒﻺ頋龍ﺎsﳕ
ᅯ true
<?php

require_once 'Zend/Acl.php';
file:///C|/Documents and Settings/506//zf/zend.acl.advanced.html(שּׁ 1/2 )2007-6-10 21:41:18
2.3. 齃ﺧﳕ
$acl = new Zend_Acl();
$acl->allow(null, null, null, new CleanIPAssertion());
︊ﻣﻺﺆ︀︪ﻶ allow 龍,ﮃ﮸ﺺﯹ﵄ﺐ﮿,ﯷﱂ IP “ﻑ
”︊廬︀︪ﯷﱂﺎ︀︪︍“︅” IP, ￙︪ allow 龍ﰱ︍ﭤ￙︪龍ﺎ Roles
 Resources ,︀︪“︍︅” IP ﰆﯼ︀︪女ﭢ﮿￙︀︪ヒ,ﯹﺎﮃヒ(ヒ廬,
︀︪ﮚ RoleResourceﮚ龍),︀︪櫓ﴥﰆﯼ龍︍,ﹶ︔ﮃ龍ﰆﺎ
ﮚ﮿﮸女ﭢ
︺ﺆﻙﱻロ︀︪︊︋(Context)ﮚﻶ,Assertﯹﱡ
assert()
ﳕﰆﻥACL Role
Resource ﺎﯢ(ヒ廬
isAllowed()
)|︺
︊︀

︊︀ﺧ

︋︀

2.2. ﲾﻆ﮿
ﵷ溜
שּׁ 3 﫠 Zend_Auth
file:///C|/Documents and Settings/506//zf/zend.acl.advanced.html(שּׁ 2/2 )2007-6-10 21:41:18
שּׁ 3 﫠 Zend_Auth
שּׁ 3 﫠 Zend_Auth
︊︀



︋︀

שּׁ 3 﫠 Zend_Auth
u
3.1. ﮀﻋ
3.1.1. 
3.1.2. ﻓ
3.1.3. ﺫ﻽﹅(Persistence)
3.1.4. ソZend_Auth
3.2. ﺓﮤ﯁
3.2.1. ﮀﻋ
3.2.2. 齃ﺧソ:﹅︀︪ DbTable ﻓﯹﱡ
3.3. 女/ﮤ﯁
3.3.1. ﮀﻋ
3.3.2. 龍(Specifics)
3.3.3. ﺫ﻽(Identity)
3.4. HTTP ﮤ﯁
3.4.1. ﮀﻋ
3.4.2. ﮾ﮡ
3.4.3. ョ
3.4.4. Resolvers
3.4.5. ﳕ
3.1. ﮀﻋ
Zend_Auth ︺ﮤ﯁(authentication)ロﺆ︀︪APIﹶﺆ︀ﺛヒsﮤ﯁
Zend_Auth ﶉ ﮤ﯁︍ﮤ﯁﮽ﮚ﹉︺ﺎ︀ﺛ﯁﹦(credential)ﮚ︀︪ﮞs(ヒ廬,ﺫ﻽)ﮞ
ﮃ藺︀︪ᅦ廓,ﮃﮚ﮸︀︪ﮞsﯹﻖﮞsᅴ﮿|,ﮃﶅﺆZend_Auth駱
ﺎZend Framework ﮿£,療
Zend_Acl
.
ﳨ
Zend_Auth
ﱻᅦﮃ
getInstance()
ﳕﮞ Singleton 﨡/ - ︀︪ﮞヒ￙
ソ
new
|ﬦ
clone
ﭗﰆ︍
Zend_Auth
ﱻ︭﷥|,女ソ
Zend_Auth::
getInstance()
ﻣ
3.1.1. 
Zend_Authンﮚﮤ﯁(ヒ廬LDAPRDBMSﺎﻶﭘ)ﮤ﯁︍︍
︺,fﺛﺋﮤ﯁︭ヒ廬,ﮤ﯁﯁﹦(藺ﺫ﻽)ンﮤ﯁ﯢᅯﻓ
Zend_Auth︭
﯏︪Zend_Authﱻﮞ
Zend_Auth_Adapter_Interface
￙︪ﮚ﹉ﺆ︀︪ﳕ
authenticate()
,ᅤ︺
ﮤ﯁ﯢﮞﮃﰃ
authenticate()
﹋,﯏︪ᅤ龜ﰱﻪ￙龜﮾ョ﯁﹦(ヒ廬,﯆
)ﹶ︺︓ョﮚ﹉︀ﺛ,ヒ廬︺ﺓ￞﮾ョ
file:///C|/Documents and Settings/506//zf/zend.auth.html(שּׁ 1/6 )2007-6-10 21:41:20
שּׁ 3 﫠 Zend_Auth
︋︀︪ﮤ﯁ヒﭐ,ﮃ女ﱂ︺ﮤ﯁﮾ョ﯆︺ﮀ女,ﮃﻆ(廬ﯢﮤ﯁)ﺆ
<?php
require_once 'Zend/Auth/Adapter/Interface.php';
class MyAuthAdapter implements Zend_Auth_Adapter_Interface
{
/**
* Sets username and password for authentication
*
* @return void
*/
public function __construct($username, $password)
{
// ...
}
/**
* Performs an authentication attempt
*
* @throws Zend_Auth_Adapter_Exception If authentication cannot be performed
* @return Zend_Auth_Result
*/
public function authenticate()
{
// ...
}
}
廬︊鷺,
authenticate()
ᅤᅯ︀︪
Zend_Auth_Result
ﮞヒ(ﻎ
Zend_Auth_Result
﴾︀︪ﱻﮞヒ)廬
︺ﺛﮤ﯁ﯢ︍,
authenticate()
ﺔﯥ︀︪
Zend_Auth_Adapter_Exception
ﺧ"︸
3.1.2. ﻓ
︺ﺆ鷺︀︪ﮤ﯁ﰝﯕﻓ,Zend_Authᅯ︀︪︦
authenticate()

Zend_Auth_Result
ﮞヒﺎﻓ
ﻄ
Zend_Auth_Result
ﯹﱡ,︋︉︪ﳕロﺆ︀ﻄ︴Zend_Authﻓ|:

isValid()
- ᅯ true s︔ﻅsﻓ鷺︀︪ﮤ﯁ﰝﯕ

getCode()
- ᅯ︀︪
Zend_Auth_Result
︸﯆ﬦﮚﮤ﯁櫓ﴥﱻﮤ﯁￙︪ﻥﺎ＀︌
ﹲﮤ﯁ﻓﱻ「,ヒ廬,￙﮸＀ﻴﯦﻆﮤ﯁ﻓﻟﮡﰽﮡ＀￙3ロ￙ﯦﻆ
ﻙ,ﻣ﹋ソ︀ﮤ﯁櫓ﴥ£,￙︪ﮃﳕﺎロ︓,ﮚ£
ﻙ駱£,療︋ﳨ

getIdentity()
- ᅯﮤ﯁ﰝﯕﺫ﻽

getMessages()
- ᅯﺎﮤ﯁ﰝﯕ櫓ﴥﻄ
︺ﺆ駱|,＀︌ﺎﮤ﯁ﻓﱻ︀ﺛ＀£|:浪駱︍﯆
ﰝﯕ﹋o︐,浪駱︍ﭘﺫ﻽ﰝﯕﮰIP,ﹶロ︓,ﮚﮤ﯁ﻓ£ﻙ︋ﻓﻣ
:
Zend_Auth_Result::SUCCESS
Zend_Auth_Result::FAILURE
Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND
Zend_Auth_Result::FAILURE_IDENTITY_AMBIGUOUS
Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID
file:///C|/Documents and Settings/506//zf/zend.auth.html(שּׁ 2/6 )2007-6-10 21:41:20
שּׁ 3 﫠 Zend_Auth
Zend_Auth_Result::FAILURE_UNCATEGORIZED
︋ヒﭐ︾ヒﯴ＀廬uﻓﻣ:
<?php
// inside of AuthController / loginAction
$result = $this->_auth->authenticate($adapter);
switch ($result->getCode()) {
case Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND:
/** do stuff for nonexistent identity **/
break;
case Zend_Auth_Result::FAILURE_INVALID_CREDENTIAL:
/** do stuff for invalid credential **/
break;
case Zend_Auth_Result::SUCCESS:
/** do stuff for successful authentication **/
break;
default:
/** do stuff for other failure **/
break;
}
3.1.3. ﺫ﻽﹅(Persistence)
ﮞﴨ︊,ﮤ﯁︀︪ﮤ﯁﯁﹦ﯷﱂネ,fﻴﷲﮤ﯁ﺫ﻽ﹶ﯏ﬡﯷﱂ︍女鷺ﮤ﯁﯁﹦﹟ネ女
HTTP︀︪￞ﮮ,,ﱡcookiesession￙ﷲﻏ＀ソ﫯webﺔﻴ駱ﯷﱂラ﮹

3.1.3.1. PHP Session ︭Z﹅(Persistence)
Z,
Zend_Auth
ﻎソPHP sessionﮤ﯁ﰝﯕ︭ロﺫ﻽﹅ﭘﺎ︀︪ﮤ﯁ﰝﯕ,
Zend_Auth::
authenticate()
ᅦﮤ﯁ﻓ﹅ﭘ︭￝ﭘﺫ﻽ョ,
Zend_Auth
ソ藺︺
Zend_Auth_Storage_Session
ﭘﱻ,￙︪ﱻソ
Zend_Session
ᅦﮞ
Zend_Auth_Storage_Interface

Zend_Auth::
setStorage()
ロ︀︪ﯹﱡ,︀︪ﮚﱻﻥﻣソ
ﳨ
ﯹﺎﮚヒ,廬ﺫ﻽﹅ﭘ︍,＀ﻥ#ソ
Zend_Auth
ﱻ,ﻣ,
ソﱻ
ヒ 3.1. ○ Session ﭗ喙
Zend_Auth_Storage_Session
ソ
'Zend_Auth'
seesionﭗ喙ᅦﻙ
Zend_Auth_Storage_Session
@︍
,￙︪ﭗ喙ﻥ,ﹶ︔￙︪ﻎ@ﻙ
Zend_Session_Namespace
￙ﺔﯥﮤ﯁ﰝﯕ﹋,

Zend_Auth::authenticate()
ﺫ﻽ﭘ
file:///C|/Documents and Settings/506//zf/zend.auth.html(שּׁ 3/6 )2007-6-10 21:41:20
שּׁ 3 﫠 Zend_Auth
<?php
// Save a reference to the Singleton instance of Zend_Auth
require_once 'Zend/Auth.php';
$auth = Zend_Auth::getInstance();
// Use 'someNamespace' instead of 'Zend_Auth'
require_once 'Zend/Auth/Storage/Session.php';
$auth->setStorage(new Zend_Auth_Storage_Session('someNamespace'));
/**
* @todo Set up the auth adapter, $authAdapter
*/
// Authenticate, saving the result, and persisting the identity upon success
$result = $auth->authenticate($authAdapter);
3.1.3.2. ﮞﮢﭘ
＀女ソ︍ﺫ﻽﹅︺,︍
Zend_Auth_Storage_Session
ロﯹﺎ￙ヒ＀ﻥﮀﮞ
Zend_Auth_Storage_Interface
ﹶﻙ
Zend_Auth::setStorage()
ロ︀︪ﱻﮞヒ
ヒ 3.2. ソﮚﭘﱻ
︺ﺆソ︍ﺎ
Zend_Auth_Storage_Session
ﺫ﻽﹋﹅ﭘﱻ,＀ﮞ
Zend_Auth_Storage_Interface

<?php
require_once 'Zend/Auth/Storage/Interface.php';
class MyStorage implements Zend_Auth_Storage_Interface
{
/**
* Returns true if and only if storage is empty
*
* @throws Zend_Auth_Storage_Exception If it is impossible to determine whether storage is empty
* @return boolean
*/
public function isEmpty()
{
/**
* @todo implementation
*/
}
/**
* Returns the contents of storage
*
* Behavior is undefined when storage is empty.
*
* @throws Zend_Auth_Storage_Exception If reading contents from storage is impossible
* @return mixed
*/
public function read()
{
/**
* @todo implementation
*/
}
/**
* Writes $contents to storage
file:///C|/Documents and Settings/506//zf/zend.auth.html(שּׁ 4/6 )2007-6-10 21:41:20
שּׁ 3 﫠 Zend_Auth
*
* @param mixed $contents
* @throws Zend_Auth_Storage_Exception If writing $contents to storage is impossible
* @return void
*/
public function write($contents)
{
/**
* @todo implementation
*/
}
/**
* Clears contents from storage
*
* @throws Zend_Auth_Storage_Exception If clearing contents from storage is impossible
* @return void
*/
public function clear()
{
/**
* @todo implementation
*/
}
}
︺ﺆソ￙︪ﮚﭘﱻ,ﮤ﯁ﯢﰝﯕ,
Zend_Auth::setStorage()
ﰃ:
<?php
// Instruct Zend_Auth to use the custom storage class
Zend_Auth::getInstance()->setStorage(new MyStorage());
/**
* @todo Set up the auth adapter, $authAdapter
*/
// Authenticate, saving the result, and persisting the identity upon success
$result = Zend_Auth::getInstance()->authenticate($authAdapter);
3.1.4. ソZend_Auth
￙ロﺆ︤留ﳕソZend_Auth:
1.
,ᅦ
Zend_Auth::authenticate()

2.
,ᅦ
authenticate()
ﳕ
︋ヒﭐᅦ
Zend_Auth
ﱻ鷺ヒ廬uソZend_Auth:
<?php
// Get a reference to the Singleton instance of Zend_Auth
require_once 'Zend/Auth.php';
$auth = Zend_Auth::getInstance();
// Set up the authentication adapter
$authAdapter = new MyAuthAdapter($username, $password);
file:///C|/Documents and Settings/506//zf/zend.auth.html(שּׁ 5/6 )2007-6-10 21:41:20
שּׁ 3 﫠 Zend_Auth
// Attempt authentication, saving the result
$result = $auth->authenticate($authAdapter);
if (!$result->isValid()) {
// Authentication failed; print the reasons why
foreach ($result->getMessages() as $message) {
echo "$message\n";
}
} else {
// Authentication succeeded; the identity ($username) is stored in the session
// $result->getIdentity() === $auth->getIdentity()
// $result->getIdentity() === $username
}
︀︀︪ﯷﱂﮤ﯁ﰝﯕ,廬︊ヒﭐ,︀︪ﮤ﯁ﺫ﻽ﭘﰱ︀︪ﮀ:
<?php
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
// Identity exists; get it
$identity = $auth->getIdentity();
}
ﻎ﹅ﭘ喙︀︪ﺫ﻽,ﮀソ
clearIdentity()
ﳕ￙ﰆ|“logout”|
<?php
Zend_Auth::getInstance()->clearIdentity();
sソ﹅ﭘ喙ﯹﮚヒ︍,＀ﮀ�
Zend_Auth
ﱻ,ソﱻソﱻ女
ョ龜ﯹﱡﰃﮃ
authenticate()
ﳕ龍ﻆﰆ﯏︪︭ﮨ﮺︋ヒﭐソ
MyAuthAdapter

<?php
// Set up the authentication adapter
$authAdapter = new MyAuthAdapter($username, $password);
// Attempt authentication, saving the result
$result = $authAdapter->authenticate();
if (!$result->isValid()) {
// Authentication failed; print the reasons why
foreach ($result->getMessages() as $message) {
echo "$message\n";
}
} else {
// Authentication succeeded
// $result->getIdentity() === $username
}
︊︀



︋︀

2.3. 齃ﺧﳕ
ﵷ溜
3.2. ﺓﮤ﯁
file:///C|/Documents and Settings/506//zf/zend.auth.html(שּׁ 6/6 )2007-6-10 21:41:20
3.2. ﺓﮤ﯁
3.2. ﺓﮤ﯁
︊︀

שּׁ 3 﫠 Zend_Auth

︋︀

3.2. ﺓﮤ﯁
3.2.1. ﮀﻋ
Zend_Auth_Adapter_DbTable
ロンﭘﺓ︭﯁﹦ﮤ﯁︺
Zend_Auth_Adapter_DbTable
女
Zend_Db_Adapter_Abstract
ﮞヒ@ﻙﮃ,ﻥ﯏︪ﮞヒ女ﮚﺓ￞ﻑﮚﮃョﻥᅦ
ﮞヒﳕ﮾ョ,﯏︪︀︪ョ
ョ:

tableName
: ﮤ﯁﯁﹦ﺓ,ﺓﮤ﯁ﯢ女ン￙︪﯁﹦

identityColumn
: ﺓ藺,鷺ﺫ﻽ﺫ﻽ᅤ︀,ヒ廬e-mail

credentialColumn
: ﺓ藺,鷺﯁﹦︀︪ﮀﺫ﻽﯆ﮤ﯁scheme︋,﯁﹦ﯹﺔ︺﯆
療
credentialTreatment


credentialTreatment
: ﮸駱︋,﯆ﻖ﯆(encrypted, hashed, encoded, obscured 
ᅦﻥ︋ﮗﳕ﷥)ᅦﮚﭗ︲ソ￙︪ﳕ,ヒ廬
'MD5(?)'

'PASSWORD(?)'
,＀
ﻥモ﯁﹦ソﻻSQL︺￙ﺛﯹ︋RDBMS︓, ﯷﺓ￝⦆
ﺓ
ヒ 3.3. ﳕ
ﭣ廬ﮀﻋ︭泥,
Zend_Auth_Adapter_DbTable
女︀︪
Zend_Db_Adapter_Abstract
ﮞヒ,￙︪ﮞヒ
ﺓ￞ﻓ,ﹶ︔ﮤ﯁ﮞヒﻑﮚ￙︪ﺓ￞練,ﺔﯥﻺﺓ￞
︋ﻣ︺in-memoryﺓﻺ︀︪,ﻺ︀︪ﮀschema,ﹶﻬﰆﻥﮤ﯁ﯢ︀(
)￙︪ヒﭐ女PDO SQLite extension
<?php
// ﻺ︀︪ in-memory SQLite ﺓ￞
require_once 'Zend/Db/Adapter/Pdo/Sqlite.php';
$dbAdapter = new Zend_Db_Adapter_Pdo_Sqlite(array('dbname' => ':memory:'));
// ︀︪ﮀﻺﯭ
$sqlCreate = 'CREATE TABLE [users] ( '
. '[id] INTEGER NOT NULL PRIMARY KEY, '
. '[username] VARCHAR(50) UNIQUE NOT NULL, '
. '[password] VARCHAR(32) NULL, '
. '[real_name] VARCHAR(150) NULL)';
// ﻺﮤ﯁﯁﹦
$dbAdapter->query($sqlCreate);
// ︀ﻥﮤ﯁ﯭ
$sqlInsert = 'INSERT INTO users (username, password, real_name) '
. 'VALUES ("my_username", "my_password", "My Real Name")';
// 
$dbAdapter->query($sqlInsert);
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.dbtable.html(שּׁ 1/3 )2007-6-10 21:41:21
3.2. ﺓﮤ﯁
ﺓ￞ﷲﻏ,
Zend_Auth_Adapter_DbTable
ﻥﻺョﻥ@ﻙﻶﮞヒ
ﻥsetterﳕ
<?php
require_once 'Zend/Auth/Adapter/DbTable.php';
// ョﮞヒ...
$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter, 'users', 'username', 'password');
// ... setter ﳕョﮞヒ
$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter);
$authAdapter->setTableName('users')
->setIdentityColumn('username')
->setCredentialColumn('password');
￙︊,ﮤ﯁ﮞヒﷲﻏﻥﮤ﯁ﯢ︺ﺆ︀︪ﮤ﯁ﯢ,ﰃ
authenticate()
ﳕ﹋,モ﯁﹦
女@ﻙ:
<?php
// ﮾ョモ﯁﹦(ヒ廬,ﻎ)
$authAdapter->setIdentity('my_username')
->setCredential('my_password');
// ﮤ﯁ﯢ,ﹶ￝ﭘﻓ
$result = $authAdapter->authenticate();
ﺆﺎﮤ﯁ﻓﯹﱡ
getIdentity()
ﳕ﹋烙,
Zend_Auth_Adapter_DbTable
﹟ﻎﮤ﯁︭ﯻ︀
:
<?php
// モﺫ﻽
echo $result->getIdentity() . "\n\n";
// モﻓ
print_r($identity);
/* Output:
my_username
Array
(
[id] => 1
[username] => my_username
[password] => my_password
[real_name] => My Real Name
)
*/
︺﯁﹦,ᅦﭢ﯆﮿ﮉ￙︪ネ女
3.2.2. 齃ﺧソ:﹅︀︪ DbTable ﻓﯹﱡ
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.dbtable.html(שּׁ 2/3 )2007-6-10 21:41:21
3.2. ﺓﮤ﯁
Z,ﺎﮤ﯁
Zend_Auth_Adapter_DbTable
ᅯロﻙauthﯹﱡﺫ﻽ﻖヒ,＀ﻙ
Zend_Auth

﹅ﭘﭘ︀︪ﻖ£ﺫ﻽ﯹﱡ,ﷲﻏᅦソ
getResultRowObject()
ﳕᅯ︀︪
stdClass
ﯹﱡ泥
ﺆ︋ﻣ﮵︾ヒﯴﮃﳕ:
<?php
// authenticate with Zend_Auth_Adapter_DbTable
$result = $this->_auth->authenticate($adapter);
if ($result->isValid()) {
// store the identity as an object where only the username and real_name have been returned
$this->_auth->getStorage()->write($adapter->getResultRowObject(array('username', 'real_name'));
// store the identity as an object where the password column has been omitted
$this->_auth->getStorage()->write($adapter->getResultRowObject(null, 'password'));
/* ... */
} else {
/* ... */
}
︊︀

︊︀ﺧ

︋︀

שּׁ 3 﫠 Zend_Auth
ﵷ溜
3.3. 女/ﮤ﯁
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.dbtable.html(שּׁ 3/3 )2007-6-10 21:41:21
3.3. 女/ﮤ﯁
3.3. 女/ﮤ﯁
︊︀

שּׁ 3 﫠 Zend_Auth

︋︀

3.3. 女/ﮤ﯁
3.3.1. ﮀﻋ
女/ﮤ﯁
︀︪HTTPﮤ﯁ﳕ,ﮃᅦ︍女ᅦqﻜ@﯆ﳕﯹ
ﮤ﯁
ﻥᅴ
￙︪﮸ンﻶﮤ﯁,ﯥ女/ﮤ﯁ﴠ:

,ヒ廬 "
joe.user
"

,ヒ廬 "
Administrative Area
"

,﯆MD5 hash＀
︋ヒﭐ︭,︊ﴠ＀(﯆"
somePassword
"):
someUser:Some Realm:fde17b91c3a510ecbaf7dbd37f59d4f8
3.3.2. 龍(Specifics)
女/ﮤ﯁
Zend_Auth_Adapter_Digest
女ﹲモ:

ﻶ - ﮤ﯁ﯢﻶ

 - 女/ﮤ﯁

 - 女/ﮤ﯁

﯆ - ﯥ﯆
ﰃ
authenticate()
﹋ᅤ女﮾ﮚ￙ﺛ
3.3.3. ﺫ﻽(Identity)
女/ﮤ﯁ᅯ︀︪
Zend_Auth_Result
ﯹﱡ,ﮃ
realm

username
ﻄﺫ﻽「
authenticate()
ﰃ﹋,﮾ョ￙ﺛﻄ︺ﬦ
<?php
require_once 'Zend/Auth/Adapter/Digest.php';
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.digest.html(שּׁ 1/2 )2007-6-10 21:41:22
3.3. 女/ﮤ﯁
$adapter = new Zend_Auth_Adapter_Digest($filename, $realm, $username, $password);
$result = $adapter->authenticate();
$identity = $result->getIdentity();
print_r($identity);
/*
Array
(
[realm] => Some Realm
[username] => someUser
)
*/
︊︀

︊︀ﺧ

︋︀

3.2. ﺓﮤ﯁
ﵷ溜
3.4. HTTP ﮤ﯁
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.digest.html(שּׁ 2/2 )2007-6-10 21:41:22
3.4. HTTP ﮤ﯁
3.4. HTTP ﮤ﯁
︊︀

שּׁ 3 﫠 Zend_Auth

︋︀

3.4. HTTP ﮤ﯁
3.4.1. ﮀﻋ
Zend_Auth_Adapter_Http
ロ︀︪蠟ﬦ
RFC-2617



ﭗ
HTTP ﮤ﯁ﭗﮤ﯁︀︪ﮤ
﯁ﳕ,ﮃﮤ﯁︊ﺆᅴ,︍女qﻜ︊@モ﯆
︻女:

ﭗﮤ﯁

ﯹ schemes ﯷﱂ,ﻥﮢ﫯ﻥﺔﻻuﮃ scheme

ﻣﮤ﯁

ﻶﮤ﯁ロ︀︪ﮃ﵄ﺐﮤ﯁,ヒ廬ﺓ
￘︀ﺛ RFC-2617 ﲡﮞ:

Nonce ﷟︪,ﮃﰆ "stale" ,Zロﻙ￝

︦ﮌﮤ﯁, "auth-int"

HTTP ﮤ﯁£老
3.4.2. ﮾ﮡ
￙︪︪︤ﭐﻄﻶ,HTTP authenticationﱻﺫﰓ "Resolvers"HTTP authentication
ﱻﰁﺆﮞﭗﮤ﯁ムﮃソResolverﭘ(Zﻶ)︭ﮢﺫ﻽ﹶ
﯁﹦"resolved" ﯁﹦ﮢモﯔテﮚﮤ﯁
3.4.3. ョ
Zend_Auth_Adapter_Http
ﱻ女︀︪ョﻄ@ﻙﮃﹲ︪ョ,︭︀ﺛᅤ
:
 3.1. ョ
藺
ᅤ
￰
accept_schemes

ﮚﻎﮢ﫯︪ﮤ﯁
schemesᅤ
'basic'
/

'digest'
喙
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.http.html(שּׁ 1/4 )2007-6-10 21:41:23
3.4. HTTP ﮤ﯁
realm

﮾ョﮤ﯁;ﻙﮚ
ᅤ︀
digest_domains
,s
'accept_schemes'

'digest'

ﮤ﯁£喙
URIs URIs︍女︀
︪
nonce_timeout
,s
'accept_schemes'

'digest'

﮾ョnonce戮療︋
ﳨ泥
proxy_auth

Z Disabled Enable 
ﻣﮤ﯁︍ﭣ︸ﺐﮤ
﯁
ﳨ
s
nonce_timeout
ﮞ︀ﺛﶣ|￙︪﮾ョﮚﻙﮚ
nonceﯿ,ﮢ﫯ﮤ﯁£駱
,廬ﮃ﮾ョ︺3600(ヒ廬),ﮃﰆﯼ﯏︪ﰏ鷺
ﮢ﫯ロ﯁﹦︀nonce﷟︪staleﮞ,￙ﰆ
︭泥
3.4.4. Resolvers
Resolver|,ﹶᅯ﯁﹦ﮤ﯁﯆Base646
ﭗﮤ﯁,﯆()hashs,︀hashﮗﳕ
MD5
Zend_Auth_Adapter_Http
ンﯹﱡﮞ
Zend_Auth_Adapter_Http_Resolver_Interface
︭
︀︪ﻶresolverﱻ,fﻻuﮃ留ﱻresolverﻥᅦﮞresolverﻺ
3.4.4.1. ﻶ Resolver
ﻶresolver︀︪︸ﮀﱻﮃ︀︪︪ﱞﮚ︀︪ﻶ,ﮃ﹟ﻥ@ﻙﮃ
resolve()
ﳕﻶ,ﴢ︀ﻶ/Apache htpasswd
ﻶﱻ\:
<username>:<realm>:<credentials>\n
﯏︉︪ﭗ﮵ - ,  ﯁﹦ - ﯁﹦ﭗ﮵ﯹﻶresolver︍;ﮃﮀ︍
○ᅯﻙﰃﻥ,￙ﻶ/ﯹﭗﮤ﯁ﯹﮤ﯁,﯁﹦ﭗ﮵ﺔﯥ
Base646﯆ﯹﭗﮤ﯁,ﮃﺔﯥ︊￰MD5 hash
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.http.html(שּׁ 2/4 )2007-6-10 21:41:23
3.4. HTTP ﮤ﯁
︪︤שּﮀﳕﻺﻶ Resolver:
<?php
$path = 'files/passwd.txt';
$resolver = new Zend_Auth_Adapter_Http_Resolver_File($path);

<?php
$path = 'files/passwd.txt';
$resolver = new Zend_Auth_Adapter_Http_Resolver_File();
$resolver->setFile($path);
廬ﻙﮚ﷯ト喙︍ﯻ,ﰆ︀︪"︸
3.4.5. ﳕ
練,ﻺ頋︀︪︦ᅤョラﻄ:
<?php
$config = array(
'accept_schemes' => 'basic digest',
'realm' => 'My Web Site',
'digest_domains' => '/members_only /my_account',
'nonce_timeout' => 3600,
);
￙︪ﻄﰆソﭗﮤ﯁,ﹶﰆﯷﱂﯹ
/members_only

/my_account
﹋︋
ﮤ﯁﮿︸﵏杻︭﯆ﯹﯝ︭鷺
nonce_timeout
,s,:︊￰︺
︋︀ﭥ, ﻺ Zend_Auth_Adapter_Http ﯹﱡ:
<?php
require_once 'Zend/Auth/Adapter/Http.php';
$adapter = new Zend_Auth_Adapter_Http($config);
︺ﻬﯹﭗﮤ﯁,ﻥﻬ女︪︤︍resolverﯹﱡﳨ￙ﻅﻅﮀ︪︤︍
ﱻ:
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.http.html(שּׁ 3/4 )2007-6-10 21:41:23
3.4. HTTP ﮤ﯁
<?php
require_once 'Zend/Auth/Adapter/Http/Resolver/File.php';
$basicResolver = new Zend_Auth_Adapter_Http_Resolver_File();
$basicResolver->setFile('files/basicPasswd.txt');
$digestResolver = new Zend_Auth_Adapter_Http_Resolver_File();
$digestResolver->setFile('files/digestPasswd.txt');
$adapter->setBasicResolver($basicResolver);
$adapter->setDigestResolver($digestResolver);
,ﻬﮤ﯁︺ﺆﮌﮤ﯁,ﯹﯷﱂ(Request)ﺔ(Response)女︀︪
reference:
<?php
assert($request instanceof Zend_Controller_Request_Http);
assert($response instanceof Zend_Controller_Response_Http);
$adapter->setRequest($request);
$adapter->setResponse($response);
$result = $adapter->authenticate();
if (!$result->isValid()) {
// Bad userame/password, or canceled password prompt
}
︊︀

︊︀ﺧ

︋︀

3.3. 女/ﮤ﯁
ﵷ溜
שּׁ 4 﫠 Zend_Cache
file:///C|/Documents and Settings/506//zf/zend.auth.adapter.http.html(שּׁ 4/4 )2007-6-10 21:41:23
שּׁ 4 﫠 Zend_Cache
שּׁ 4 﫠 Zend_Cache
︊︀



︋︀

שּׁ 4 﫠 Zend_Cache
u
4.1. ﮀﻋ
4.2. 3ﭘ
4.2.1.
Zend_Cache
﷥ﳕ
4.2.2. ﮰﺪu
4.2.3. 3ﭘ︅
4.3. Zend_Cache frontends
4.3.1. Zend_Cache_Core
4.3.2. Zend_Cache_Frontend_Output
4.3.3. Zend_Cache_Frontend_Function
4.3.4. Zend_Cache_Frontend_Class
4.3.5. Zend_Cache_Frontend_File
4.3.6. Zend_Cache_Frontend_Page
4.4. Zend_Cache﫯
4.4.1. Zend_Cache_Backend_File
4.4.2. Zend_Cache_Backend_Sqlite
4.4.3. Zend_Cache_Backend_Memcached
4.4.4. Zend_Cache_Backend_APC
4.4.5. Zend_Cache_Backend_ZendPlatform
4.1. ﮀﻋ
Zend_Cache
ロﺆ︀︪3ﭘﻻu︀ﳕ.
Zend Framework︭3ﭘ﫯|,ᅦ﫯(
File
,
Sqlite
,
Memcache
...) ︀︪ﴻ
IDsTagsﳻﻟ(﯆ﬦﮰﳻﻟ)ﭘ3ﭘﺪu.ソﭤﳕ,ﺎﮚﱻﺪu(ヒ廬:"
ﮰ︺tagﺪu")
﨡(
Zend_Cache_Core
) ᅢ,ﴻョ.ﯹﺎﮚ女,︺ﺆ﾿,￙︀ﺛﻧ
Zend_Cache_Core
﫯:
Output
,
File
,
Function

Class
.
ヒ 4.1. ﰃ
Zend_Cache::factory()
ラ︀︪﫯
file:///C|/Documents and Settings/506//zf/zend.cache.html(שּׁ 1/4 )2007-6-10 21:41:25
שּׁ 4 﫠 Zend_Cache
Zend_Cache::factory()
ﮞヒﭣﯹﱡﹶﻖﻬﻑ︀ﵷ. ￙שּׁ︀︪ヒﭐ︭ﻬﰆ
Core
﫯
File
﫯︀ﵷソ.
<?php
require_once 'Zend/Cache.php';
$frontendOptions = array(
'lifeTime' => 7200, // cache lifetime of 2 hours
'automaticSerialization' => true
);
$backendOptions = array(
'cacheDir' => './tmp/' // Directory where to put the cache files
);
// ラ︀︪Zend_Cache_Core ﯹﱡ
$cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
?>
ﺆ︀︪﫯,3ﭘﻻuﱻﺆ(＀ﺆﺏ'serialization').ヒ廬,蘭3ﭘﻎﴵﺓ
ﯢ︭3ﭘ︀︪ﻓ.ﻓ3ﭘ,︍女￞ﺓ;3ﭘ︭ﺏ.
<?php
// $cache ヒﭐ︭ﷲﻏ溜ﺆ
// ︀︪3ﭘﭘ:
if(!$result = $cache->load('myresult')) {
// 3ﭘ︍︭;￞ﺓ

$db = Zend_Db::factory( [...] );

$result = $db->fetchAll('SELECT * FROM huge_table');

$cache->save($result, 'myresult');

} else {
// cache hit! shout so that we know
echo "This one is from cache!\n\n";

}
print_r($result);
?>
file:///C|/Documents and Settings/506//zf/zend.cache.html(שּׁ 2/4 )2007-6-10 21:41:25
שּׁ 4 﫠 Zend_Cache
ヒ 4.2. 
Zend_Cache
モ﫯3ﭘモ
ᅦﻶム,ﻬ'mark up'(ﮰ)ﺛ︌3ﭘモ﮵(sections),
start()

end()
ﳕﰁ
￙ﺛsection(￙ﱻ\שּׁ︀︪ヒﭐ,ﹶ︔3ﭘᅢﭖ).
,タ︸︀モ⦆,s
end()
ﳕ,﹋モ3ﭘ.︋︀ﬡ￐,︪﮵
(end()ﳕﰃﻣ)ﰆﷳᅦ,ﻎCache︭(女3ﭘﺪu).
<?php
$frontendOptions = array(
'lifeTime' => 30, // cache lifetime of half a minute
'automaticSerialization' => false // this is default anyway
);
// ﯑ﮞ戴ﳻﻟ︺Windows,ﯷソWindowsﯻ○cacheDir﷯ト︺ﮞ﷯ト
$backendOptions = array('cacheDir' => './tmp/');
$cache = Zend_Cache::factory('Output', 'File', $frontendOptions, $backendOptions);
// @︀︪︀﯆ﬦﻙstart()ﳕ
if(!$cache->start('mypage')) {
// output as usual:

echo 'Hello world! ';
echo 'This is cached ('.time().') ';

$cache->end(); // the output is saved and sent to the browser
}
echo 'This is never cached ('.time().').';
?>
ﳨﻬ︤ﬡモﺆ
time()
ﻓ;︺4鷺שּׁﺌﬡtime()ﰃ.￐駱ﬡ;⦆:ﳨ
s﵁שּׁ︀︪ﭗﹶﲡ.￙︺שּׁ︀︪ﻄ3ﭘ﮵︭モ,ﭤモ3ﭘ
ﺆ. 30戮(ﻬ﮾ョﺆlifetime︺30戮)ﺎ3ﭘﺪuﶅラﺆ,שּׁ︀︪ﭗﬡ,ﺎשּׁﺌ︪
().⦆ﺔﯥ⦆﵏杻︭ﯕ︀︋.
ﳨ
ソZend_Cache女ﳨCache﯆(@ﻙ
save()

start()

).ﮃᅤﯹﺎ⦆3ﭘ﯏︪﵄ﺐ︀,︍3ﭘﺪuﰱ:ﺒ
閭, ﳟ,ﯼﯯ鷺ﻓ.
file:///C|/Documents and Settings/506//zf/zend.cache.html(שּׁ 3/4 )2007-6-10 21:41:25
שּׁ 4 﫠 Zend_Cache
︊︀



︋︀

3.4. HTTP ﮤ﯁
ﵷ溜
4.2. 3ﭘ
file:///C|/Documents and Settings/506//zf/zend.cache.html(שּׁ 4/4 )2007-6-10 21:41:25
4.2. 3ﭘ
4.2. 3ﭘ
︊︀

שּׁ 4 﫠 Zend_Cache

︋︀

4.2. 3ﭘ
Zend_Cache︭︉︪廬￵.︀ﺎ﯆3ﭘﺪu︀﯆ﬦ(︀︪ﭗﬦ︲).ﺌ
'lifeTime'
ﻤ,ﭣ廬ヒﭐ︭
療, ﮃﮚ﹉ﺆ3ﭘﺪu(ﶅᅦﯥ,3ﭘﺪu﯁).שּׁ︉︪廬￵ﻶ,⦆ﻣﷳᅦ,ﻥ
. 﫯(ヒ廬.
Zend_Cache_Core::get()
)3ﭘ︍︭ᅯfalse,￙ソ滑
if(){ ... }
ﯭ︭ﻶ,
ﻣ︭ﻖﻬ女3ﭘ(ﷳᅦ),ᅤ￝ﭘ￙ﺛ⦆ﻏ(ヒ廬:
Zend_Cache_Core::save()
).
ﳨ
ﺛ﫯
Function
︭︍女ﻶ,ヒ廬,s︪ム﫯ﮞ
.
ﳨ
'3ﭘ︭'︀︪ﯭ,ﮃ鷺s︀︪3ﭘﺪu,ﹶ︔'fresh'(切
﹋,ﰱ￘ﲡᅦ).'Cache miss' 鷺s3ﭘ︭︍女,3ﭘ︍
︭. s︀︪Cache miss,⦆ᅤ⦆,ﹶソﮃ3ﭘ.ﯹﺎ3ﭘ︭,
﫯ﻎCache︭3ﭘﺪu.
4.2.1.
Zend_Cache
﷥ﳕ
︋鷺ヒﻙﺆ︀︪
Zend_Cache
﫯ﮞヒ諒ﳕ:
<?php

# "load" Zend_Cache ﷥
require 'Zend/Cache.php';
# ︀︪﫯(ヒ廬'File''Sqlite'...)
$backendName = '[...]';
# ︀︪﫯(ヒ廬'Core', 'Output', 'Page'...)
$frontendName = '[...]';
# ︺﫯﮾ョ︀︪ﻄ
$frontendOptions = array([...]);
# ︺﫯﮾ョ︀︪ﻄ
$backendOptions = array([...]);
# ﻺﮞヒ(s,︪︤)
$cache = Zend_Cache::factory($frontendName, $backendName, $frontendOptions, $backendOptions);
?>
︋ヒﭐ︭ﻬ﮾
$cache
￝ﭘ︀︪,ﷲﮞヒ﫯,ﹶ︔⦆ﯥ廬uﻙ⦆﫯@.
file:///C|/Documents and Settings/506//zf/zend.cache.theory.html(שּׁ 1/3 )2007-6-10 21:41:26
4.2. 3ﭘ
ﳨ
ᅤソ
Zend_Cache::factory()
ラ﫯ﮞヒ.⦆ﷱ ﮞヒ 﫯﫯
︍﷥|.
4.2.2. ﮰﺪu
ﮰﻙ3ﭘﺪuﱻ︀留ﳕ.s⦆ソ
save()
ﳕ￝ﭘ︀︪3ﭘ,⦆ﻥﻙﯥ3ﭘﺪu﮾ョ︀︪駱︪ﮰ,駱︪
ﮰﻥﻄ「/ﻄﻇ︀ﵷ ﭤ⦆︍女ﯥ3ﭘﺪuソ,⦆ﻥ︅ﮚﮰ3ﭘﺪu.
<?php

$cache->save($huge_data, 'myUniqueID', array('tagA', 'tagB', 'tagC'));

?>
4.2.3. 3ﭘ︅
ﮚidCacheﺪu,ソ
remove()
ﳕ:
<?php

$cache->remove('idToRemove');

?>
︪|︭駱︪Cacheﺪu,ﻥソ
clean()
ﳕ.ヒ廬,3ﭘﺪu:
<?php
// ︅3ﭘﺪu
$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
// ﻅ︅ᅦ
$cache->clean(Zend_Cache::CLEANING_MODE_OLD);

?>
廬⦆ﮰ︺'tagA''tagC'3ﭘ:
<?php

$cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('tagA', 'tagC'));

?>
file:///C|/Documents and Settings/506//zf/zend.cache.theory.html(שּׁ 2/3 )2007-6-10 21:41:26
4.2. 3ﭘ
︅﨡/:
CLEANING_MODE_ALL
,
CLEANING_MODE_OLD
,
CLEANING_MODE_MATCHING_TAG

CLEANING_MODE_NOT_MATCHING_TAG
. ,ﭣ廬ﮃ藺鷺,︅|︭ﻄﺆ︀︪ﮰﻄ,ﯹ︭﯏︪ﴠ
|滑.
︊︀

︊︀ﺧ

︋︀

שּׁ 4 﫠 Zend_Cache
ﵷ溜
4.3. Zend_Cache frontends
file:///C|/Documents and Settings/506//zf/zend.cache.theory.html(שּׁ 3/3 )2007-6-10 21:41:26
4.3. Zend_Cache frontends
4.3. Zend_Cache frontends
︊︀

שּׁ 4 﫠 Zend_Cache

︋︀

4.3. Zend_Cache frontends
4.3.1. Zend_Cache_Core
4.3.1.1. Introduction
Zend_Cache_Core
is a special frontend because it is the core of the module. It is a generic cache frontend and is
extended by other classes.
ﳨ
All frontends inherit from
Zend_Cache_Core
so that its methods and options (described
below) would also be available in other frontends, therefore they won't be
documented there.
4.3.1.2. Available options
These options are passed to the factory method as demonstrated in previous examples.
 4.1. Available options
Option
Data Type
Default Value
Description
caching
boolean
true
enable / disable caching (can be very usefull for the
debug of cached scripts)
lifeTime
int
3600
cache lifetime (in seconds), if set to
null
, the cache
is valid forever.
logging
boolean
false
if set to true, logging through
Zend_Log
is activated
(but the system is slower)
writeControl
boolean
true
Enable / disable write control (the cache is read
just after writing to detect corrupt entries),
enabling writeControl will lightly slow the cache
writing but not the cache reading (it can detect
some corrupt cache files but it's not a perfect
control)
automaticSerialization
boolean
false
Enable / disable automatic serialization, it can be
used to save directly datas which aren't strings (but
it's slower)
automaticCleaningFactor
int
10
Disable / Tune the automatic cleaning process
(garbage collector): 0 means no automatic cache
cleaning, 1 means systematic cache cleaning and x
> 1 means automatic random cleaning 1 times in x
write operations.
4.3.1.3. Examples
An example is given in the manual at the very beginning.
If you store only strings into cache (because with "automaticSerialization" option, it's possible to store some
booleans), you can use a more compact construction like:
file:///C|/Documents and Settings/506//zf/zend.cache.frontends.html(שּׁ 1/8 )2007-6-10 21:41:28
4.3. Zend_Cache frontends
<?php

// we assume you already have $cache
$id = 'myBigLoop'; // cache id of "what we want to cache"
if (!($data = $cache->load($id))) {
// cache miss

$data = '';
for ($i = 0; $i < 10000; $i++) {
$data = $data . $i;
}

$cache->save($data);

}
// [...] do something with $data (echo it, pass it on etc.)

?>
If you want to cache multiple blocks or data instances, the idea is the same:
<?php

// make sure you use unique identifiers:
$id1 = 'foo';
$id2 = 'bar';
// block 1
if (!($data = $cache->load($id1))) {
// cache missed

$data = '';
for ($i=0;$i<10000;$i++) {
$data = $data . $i;
}

$cache->save($data);

}
echo($data);
// this isn't affected by caching
echo('NEVER CACHED! ');
// block 2
if (!($data = $cache->load($id2))) {
// cache missed

$data = '';
for ($i=0;$i<10000;$i++) {
$data = $data . '!';
}

$cache->save($data);

}
echo($data);
?>
file:///C|/Documents and Settings/506//zf/zend.cache.frontends.html(שּׁ 2/8 )2007-6-10 21:41:28
4.3. Zend_Cache frontends
4.3.2. Zend_Cache_Frontend_Output
4.3.2.1. Introduction
Zend_Cache_Frontend_Output
is an output-capturing frontend. It utilizes output buffering in PHP to capture everything
between its
start()
and
end()
methods.
4.3.2.2. Available options
This frontend doesn't have any specific options other than those of
Zend_Cache_Core
.
4.3.2.3. Examples
An example is given in the manual at the very beginning. Here it is with minor changes:
<?php
// if it is a cache miss, output buffering is triggered
if(!$cache->start('mypage')):
// output everything as usual
echo 'Hello world! ';
echo 'This is cached ('.time().') ';
$cache->end(); // output buffering ends
endif;
echo 'This is never cached ('.time().').';
?>
Using this form it is fairly easy to set up output caching in your already working project with little or no code
refactoring.
4.3.3. Zend_Cache_Frontend_Function
4.3.3.1. Introduction
Zend_Cache_Frontend_Function
caches the results of function calls. It has a single main method named
call()
which
takes a function name and parameters for the call in an array.
4.3.3.2. Available options
 4.2. Available options
Option
Data Type
Default Value
Description
cacheByDefault
boolean
true
if true, function calls will be cached by
default
cachedFunctions
array

function names which will always be cached
nonCachedFunctions
array

function names which must never be cached
4.3.3.3. Examples
Using the
call()
function is the same as using
call_user_func_array()
in PHP:
file:///C|/Documents and Settings/506//zf/zend.cache.frontends.html(שּׁ 3/8 )2007-6-10 21:41:28