没有合适的资源?快使用搜索试试~ 我知道了~
首页Zend Framework程序员指南:访问控制与身份验证
"这是一本程序员的参考指南,专注于Zend Framework,涵盖了该框架的主要组件,如 Zend_Acl 和 Zend_Auth,以及相关的安装、配置和使用方法。"
Zend Framework 是一个广泛使用的开源PHP框架,旨在加速开发高质量的Web应用程序。本指南详细介绍了其核心组件,以下是其中两个关键部分的深入探讨:
1. **Zend_Acl(访问控制列表)**:
- **介绍**:Zend_Acl 提供了一种机制来定义资源和角色之间的访问规则,用于实现细粒度的权限管理。
- **资源**:在 ACL 中,资源是你想要保护的对象,比如网页、数据库表或任何需要访问控制的实体。
- **角色**:角色是能够请求访问资源的实体,可以是用户、用户组或其他系统实体。
- **创建 ACL**:开发者可以通过添加资源和角色,然后定义它们之间的允许和禁止的访问规则来构建 ACL。
- **注册角色**:将角色加入到 ACL 中,以便为它们分配权限。
- **定义访问控制**:设置允许或拒绝角色对特定资源的操作。
- **查询 ACL**:检查特定角色是否对特定资源有访问权限。
- **细化访问控制**:通过更精确的规则来增强权限控制,例如基于资源的属性或操作。
- **持久化 ACL 数据**:为了保持会话间的权限设置,需要将 ACL 数据存储在数据库或其他持久化存储中。
- **断言**:使用断言可以实现条件化的 ACL 规则,提供更复杂的访问决策逻辑。
2. **Zend_Auth(身份验证)**:
- **介绍**:Zend_Auth 是负责处理用户身份验证的模块,它提供了多种认证适配器。
- **适配器**:适配器是 Zend_Auth 的核心,包括数据库表、HTTP 基本身份验证、摘要认证(如MD5或SHA1)以及 LDAP 认证等,它们用于与不同的数据源交互进行身份验证。
- **结果**:认证操作完成后,会产生一个结果对象,包含是否认证成功的信息以及可能的认证凭据。
- **身份持久化**:认证成功后,通常需要将用户的身份信息持久化,以便在后续请求中识别用户。
- **使用 Zend_Auth**:指南展示了如何集成 Zend_Auth 到应用程序中,包括基本用法和高级示例。
- **数据库表认证**:通过数据库查询验证用户身份,指南详细介绍了如何配置和使用这个适配器。
- ** Digest Authentication**:使用 HTTP 摘要认证,提供更安全的认证方式,避免密码在网络中明文传输。
- **HTTP Authentication Adapter**:设计概述、配置选项和使用方法,帮助开发者实现基于 HTTP 基本认证或摘要认证的登录。
- **LDAP Authentication**:对于需要与 LDAP 服务器集成的项目,指南提供了 LDAP 认证的配置和使用指导。
本指南为开发者提供了一个全面的参考资料,无论是在初次接触 Zend Framework 还是在寻求解决特定问题时,都能从中获取有价值的信息。通过深入理解并应用这些组件,开发者可以构建出安全且高效的Web应用程序。
Introduction ............................................................................................................ 750
What is OpenID? .............................................................................................. 750
How Does it Work? ........................................................................................... 750
Zend_OpenId Structure ..................................................................................... 751
Supported Standards ......................................................................................... 751
Zend_OpenId_Consumer Basics ................................................................................. 751
OpenID Authentication ...................................................................................... 751
Combine all Steps in One Page ........................................................................... 753
Realm ............................................................................................................ 754
Immediate Check ............................................................................................. 755
Zend_OpenId_Consumer_Storage ....................................................................... 755
Simple Registration Extension ............................................................................ 759
Integration with Zend_Auth ............................................................................... 761
Integration with Zend_Controller ........................................................................ 763
Zend_OpenId_Provider ............................................................................................. 763
Quick Start ...................................................................................................... 763
Combine all together ......................................................................................... 766
Simple Registration Extension ............................................................................ 767
What Else? ...................................................................................................... 769
34. Zend_Paginator ........................................................................................................... 770
Introduction ............................................................................................................ 770
Usage ..................................................................................................................... 770
Paginating data collections ................................................................................. 770
Rendering pages with view scripts ....................................................................... 771
Configuration .......................................................................................................... 775
Advanced usage ....................................................................................................... 776
Custom data source adapters ............................................................................... 776
Custom scrolling styles ...................................................................................... 776
35. Zend_Pdf ................................................................................................................... 778
Introduction. ............................................................................................................ 778
Creating and loading PDF documents. .......................................................................... 778
Save changes to the PDF document. ............................................................................. 779
Document pages. ...................................................................................................... 780
Page creation. .................................................................................................. 780
Page cloning. ................................................................................................... 781
Drawing ................................................................................................................. 782
Geometry ........................................................................................................ 782
Colors ............................................................................................................ 782
Shape Drawing ................................................................................................ 782
Text Drawing ................................................................................................... 785
Using fonts ..................................................................................................... 786
Starting in 1.5, Extracting fonts. .......................................................................... 789
Image Drawing ................................................................................................ 791
Line drawing style ............................................................................................ 792
Fill style ......................................................................................................... 792
Rotations ........................................................................................................ 793
Save/restore graphics state ................................................................................. 793
Clipping draw area ........................................................................................... 794
Styles ............................................................................................................. 795
Transparency ................................................................................................... 798
Document Info and Metadata. ..................................................................................... 799
Zend_Pdf module usage example ................................................................................ 801
36. Zend_Registry ............................................................................................................ 805
Using the Registry .................................................................................................... 805
xvi
Programmer's Reference Guide
Setting Values in the Registry ............................................................................. 805
Getting Values from the Registry ......................................................................... 805
Constructing a Registry Object ........................................................................... 806
Accessing the Registry as an Array ...................................................................... 806
Accessing the Registry as an Object ..................................................................... 807
Querying if an index exists ................................................................................. 807
Extending the Registry ...................................................................................... 808
Unsetting the Static Registry .............................................................................. 808
37. Zend_Rest ................................................................................................................. 810
Introduction ............................................................................................................ 810
Zend_Rest_Client ..................................................................................................... 810
Introduction .................................................................................................... 810
Responses ....................................................................................................... 811
Request Arguments ........................................................................................... 812
Zend_Rest_Server .................................................................................................... 813
Introduction .................................................................................................... 813
REST Server Usage .......................................................................................... 813
Calling a Zend_Rest_Server Service .................................................................... 814
Sending A Custom Status ................................................................................... 814
Returning Custom XML Responses ..................................................................... 815
38. Zend_Search_Lucene ................................................................................................... 817
Overview ................................................................................................................ 817
Introduction .................................................................................................... 817
Document and Field Objects ............................................................................... 817
Understanding Field Types ................................................................................. 819
HTML documents ............................................................................................ 819
Building Indexes ...................................................................................................... 821
Creating a New Index ........................................................................................ 821
Updating Index ................................................................................................ 821
Updating Documents ........................................................................................ 822
Retrieving Index Size ........................................................................................ 822
Index optimization ............................................................................................ 822
Permissions ..................................................................................................... 824
Limitations ..................................................................................................... 824
Searching an Index ................................................................................................... 825
Building Queries .............................................................................................. 825
Search Results ................................................................................................. 826
Limiting the Result Set ...................................................................................... 827
Results Scoring ................................................................................................ 828
Search Result Sorting ........................................................................................ 828
Search Results Highlighting ............................................................................... 829
Query Language ....................................................................................................... 829
Terms ............................................................................................................. 830
Fields ............................................................................................................. 830
Wildcards ....................................................................................................... 831
Term Modifiers ................................................................................................ 831
Range Searches ................................................................................................ 831
Fuzzy Searches ................................................................................................ 832
Proximity Searches ........................................................................................... 832
Boosting a Term ............................................................................................... 833
Boolean Operators ............................................................................................ 833
Grouping ........................................................................................................ 835
Field Grouping ................................................................................................ 835
Escaping Special Characters ............................................................................... 835
xvii
Programmer's Reference Guide
Query Construction API ............................................................................................ 836
Query Parser Exceptions .................................................................................... 836
Term Query ..................................................................................................... 836
Multi-Term Query ............................................................................................ 837
Boolean Query ................................................................................................. 838
Wildcard Query ............................................................................................... 840
Fuzzy Query .................................................................................................... 841
Phrase Query ................................................................................................... 842
Range Query ................................................................................................... 845
Character Set ........................................................................................................... 846
UTF-8 and single-byte character set support .......................................................... 846
Default text analyzer ......................................................................................... 846
UTF-8 compatible text analyzers ......................................................................... 846
Extensibility ............................................................................................................ 848
Text Analysis ................................................................................................... 848
Tokens Filtering ............................................................................................... 850
Scoring Algorithms ........................................................................................... 851
Storage Containers ........................................................................................... 853
Interoperating with Java Lucene .................................................................................. 855
File Formats .................................................................................................... 855
Index Directory ................................................................................................ 856
Java Source Code ............................................................................................. 856
Advanced ............................................................................................................... 856
Starting from 1.6, handling index format transformations. ........................................ 856
Using the index as static property ........................................................................ 857
Best Practices .......................................................................................................... 858
Field names ..................................................................................................... 858
Indexing performance ....................................................................................... 859
Index during Shut Down .................................................................................... 861
Retrieving documents by unique id ...................................................................... 862
Memory Usage ................................................................................................ 863
Encoding ........................................................................................................ 863
Index maintenance ............................................................................................ 864
39. Zend_Server ............................................................................................................... 866
Introduction ............................................................................................................ 866
Zend_Server_Reflection ............................................................................................ 866
Introduction .................................................................................................... 866
Usage ............................................................................................................. 866
40. Zend_Service ............................................................................................................. 868
Introduction ............................................................................................................ 868
Zend_Service_Akismet ............................................................................................. 868
Introduction .................................................................................................... 868
Verify an API key ............................................................................................. 869
Check for spam ................................................................................................ 869
Submitting known spam .................................................................................... 870
Submitting false positives (ham) .......................................................................... 871
Zend-specific Accessor Methods ......................................................................... 871
Zend_Service_Amazon ............................................................................................. 872
Introduction .................................................................................................... 872
Country Codes ................................................................................................. 873
Looking up a Specific Amazon Item by ASIN ........................................................ 873
Performing Amazon Item Searches ...................................................................... 874
Using the Alternative Query API ......................................................................... 875
Zend_Service_Amazon Classes ........................................................................... 875
xviii
Programmer's Reference Guide
Zend_Service_Audioscrobbler .................................................................................... 881
Introduction to Searching Audioscrobbler ............................................................. 881
Users ............................................................................................................. 881
Artists ............................................................................................................ 883
Tracks ............................................................................................................ 884
Tags ............................................................................................................... 884
Groups ........................................................................................................... 884
Forums ........................................................................................................... 885
Zend_Service_Delicious ............................................................................................ 885
Introduction .................................................................................................... 885
Retrieving posts ............................................................................................... 886
Zend_Service_Delicious_PostList ....................................................................... 886
Editing posts ................................................................................................... 888
Deleting posts .................................................................................................. 888
Adding new posts ............................................................................................. 889
Tags ............................................................................................................... 890
Bundles .......................................................................................................... 890
Public data ...................................................................................................... 890
HTTP client .................................................................................................... 891
Zend_Service_Flickr ................................................................................................. 892
Introduction to Searching Flickr .......................................................................... 892
Finding Flickr Users' Photos and Information ........................................................ 892
Finding photos From a Group Pool ...................................................................... 893
Retrieving Flickr Image Details ........................................................................... 893
Zend_Service_Flickr Result Classes ..................................................................... 894
Zend_Service_Nirvanix ............................................................................................. 896
Introduction .................................................................................................... 896
Registering with Nirvanix .................................................................................. 896
API Documentation .......................................................................................... 896
Features .......................................................................................................... 896
Getting Started ................................................................................................. 897
Understanding the Proxy .................................................................................... 897
Examining Results ............................................................................................ 898
Handling Errors ............................................................................................... 899
Zend_Service_ReCaptcha .......................................................................................... 900
Introduction .................................................................................................... 900
Simplest use .................................................................................................... 900
Zend_Service_Simpy ................................................................................................ 901
Introduction .................................................................................................... 901
Links ............................................................................................................. 901
Tags ............................................................................................................... 903
Notes ............................................................................................................. 904
Watchlists ....................................................................................................... 905
Introduction ............................................................................................................ 906
Getting Started with Zend_Service_SlideShare ........................................... 906
The SlideShow object ....................................................................................... 907
Retrieving a single slide show ............................................................................. 910
Retrieving Groups of Slide Shows ....................................................................... 910
Zend_Service_SlideShare Caching policies ................................................ 911
Changing the behavior of the HTTP Client ............................................................ 912
Zend_Service_StrikeIron ........................................................................................... 912
Overview ........................................................................................................ 912
Registering with StrikeIron ................................................................................ 913
xix
Programmer's Reference Guide
Getting Started ................................................................................................. 913
Making Your First Query ................................................................................... 914
Examining Results ............................................................................................ 914
Handling Errors ............................................................................................... 915
Checking Your Subscription ............................................................................... 916
Zend_Service_StrikeIron: Bundled Services .................................................................. 917
ZIP Code Information ....................................................................................... 917
U.S. Address Verification ................................................................................... 918
Sales & Use Tax Basic ...................................................................................... 918
Zend_Service_StrikeIron: Advanced Uses ..................................................................... 919
Using Services by WSDL .................................................................................. 919
Viewing SOAP Transactions ............................................................................... 920
Zend_Service_Technorati .......................................................................................... 921
Introduction .................................................................................................... 921
Getting Started ................................................................................................. 921
Making Your First Query ................................................................................... 921
Consuming Results ........................................................................................... 922
Handling Errors ............................................................................................... 924
Checking Your API Key Daily Usage ................................................................... 924
Available Technorati Queries .............................................................................. 925
Zend_Service_Technorati Classes ........................................................................ 929
Zend_Service_Yahoo ................................................................................................ 933
Introduction .................................................................................................... 933
Searching the Web with Yahoo! ........................................................................... 933
Finding Images with Yahoo! ............................................................................... 934
Finding videos with Yahoo! ................................................................................ 934
Finding Local Businesses and Services with Yahoo! ................................................ 934
Searching Yahoo! News ..................................................................................... 935
Searching Yahoo! Site Explorer Inbound Links ...................................................... 935
Searching Yahoo! Site Explorer's PageData ........................................................... 935
Zend_Service_Yahoo Classes ............................................................................. 936
41. Zend_Session ............................................................................................................. 942
Introduction ............................................................................................................ 942
Basic Usage ............................................................................................................ 942
Tutorial Examples ............................................................................................ 943
Iterating Over Session Namespaces ...................................................................... 944
Accessors for Session Namespaces ...................................................................... 944
Advanced Usage ...................................................................................................... 945
Starting a Session ............................................................................................. 945
Locking Session Namespaces ............................................................................. 946
Namespace Expiration ....................................................................................... 947
Session Encapsulation and Controllers ................................................................. 947
Preventing Multiple Instances per Namespace ........................................................ 948
Working with Arrays ......................................................................................... 949
Using Sessions with Objects ............................................................................... 951
Using Sessions with Unit Tests ........................................................................... 951
Global Session Management ....................................................................................... 953
Configuration Options ....................................................................................... 953
Error: Headers Already Sent ............................................................................... 956
Session Identifiers ............................................................................................ 956
rememberMe(integer $seconds) ............................................................. 958
forgetMe() ................................................................................................. 958
sessionExists() ....................................................................................... 958
xx
Programmer's Reference Guide
剩余1169页未读,继续阅读
2011-08-22 上传
2009-03-24 上传
2023-09-06 上传
2023-07-31 上传
2023-08-08 上传
2023-12-06 上传
2023-07-26 上传
2023-08-15 上传
chowhongquan
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C++标准程序库:权威指南
- Java解惑:奇数判断误区与改进方法
- C++编程必读:20种设计模式详解与实战
- LM3S8962微控制器数据手册
- 51单片机C语言实战教程:从入门到精通
- Spring3.0权威指南:JavaEE6实战
- Win32多线程程序设计详解
- Lucene2.9.1开发全攻略:从环境配置到索引创建
- 内存虚拟硬盘技术:提升电脑速度的秘密武器
- Java操作数据库:保存与显示图片到数据库及页面
- ISO14001:2004环境管理体系要求详解
- ShopExV4.8二次开发详解
- 企业形象与产品推广一站式网站建设技术方案揭秘
- Shopex二次开发:触发器与控制器重定向技术详解
- FPGA开发实战指南:创新设计与进阶技巧
- ShopExV4.8二次开发入门:解决升级问题与功能扩展
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功