Floating point error: Domain.是什么意思?(在线等待,急)

jimmy4lmx 2003-08-22 07:57:44
怎么解决?
...全文
222 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
jimmy4lmx 2003-08-23
  • 打赏
  • 举报
回复
想了一夜,终于得到改进.
#include <math.h>
#include <stdio.h>
main()
{
float a1[]={31.270,31.227,30.660,30.276,29.134,27.808,26.078,
24.928,22.922,21.188,19.454,18.096,16.016,14.963,
13.513,12.954,11.957,11.578,11.420,11.555,12.162,
12.732,13.963,14.615,16.495,17.972,19.971,21.712,
23.274,24.441,26.647,27.860,28.981,30.202,30.964,
31.105};
float b1[]={34.290,36.554,38.205,39.375,40.928,42.317,43.503,
43.922,44.478,44.713,44.459,44.126,43.195,42.265,
40.770,39.891,38.060,36.186,34.289,32.551,30.919,
29.450,27.973,27.141,25.853,25.318,24.728,24.648,
24.806,25.166,26.181,27.163,28.244,29.937,31.517,
32.743};
float c1[18],d1[18];
float x,y,t,Q;
int i,j,k,m=0,n=0;

for(k=0;k<=17;k++)
{
c1[k]=0.5*(a1[k]+a1[18+k]);
d1[k]=0.5*(b1[k]+b1[18+k]);
}


for(j=1;j<=17;j++)
for(i=0;i<=17-j;i++)
{
if(c1[i]>c1[i+1])
{ t=c1[i];c1[i]=c1[i+1];c1[i+1]=t;}
if(d1[i]>d1[i+1])
{ t=d1[i];d1[i]=d1[i+1];d1[i+1]=t;}
}

for(x=c1[0];x<=c1[17];x+=0.001)
for(y=d1[0];y<=d1[17];y+=0.001)
for(i=0;i<=35;i++)
{
Q=sqrt((x-a1[i])*(x-a1[i])+(y-b1[i])*(y-b1[i]));
if(Q>=9.9 && Q<=10.1)
n++;
if(n==36)
{
printf("\nx=%.3f,y=%.3f\n",x,y);
m++;
}
if(i==35)
n=0;
}

printf("m=%d",m);

}
揭贴
jimmy4lmx 2003-08-22
  • 打赏
  • 举报
回复
这个解不对
jimmy4lmx 2003-08-22
  • 打赏
  • 举报
回复
tc2.0,有什么区别
dama2003 2003-08-22
  • 打赏
  • 举报
回复
你在什么上运行的?
dama2003 2003-08-22
  • 打赏
  • 举报
回复
我照着你的原代码打出来在vc++6.0上运行,得出结果是
x=21.212 y=34.293
是这个结果吗?
jimmy4lmx 2003-08-22
  • 打赏
  • 举报
回复
无人会解???
jimmy4lmx 2003-08-22
  • 打赏
  • 举报
回复
这是一个数学建模中的搜索问题,急,望解答
jimmy4lmx 2003-08-22
  • 打赏
  • 举报
回复
#include <math.h>
main()
{
float a[]={31.270,31.227,30.660,30.276,29.134,27.808,26.078,
24.928,22.922,21.188,19.454,18.096,16.016,14.963,
13.513,12.954,11.957,11.578,11.420,11.555,12.162,
12.732,13.963,14.615,16.495,17.972,19.971,21.712,
23.274,24.441,26.647,27.860,28.981,30.202,30.964,
31.105};
float b[]={34.290,36.554,38.205,39.375,40.928,42.317,43.503,
43.922,44.478,44.713,44.459,44.126,43.195,42.265,
40.770,39.891,38.060,36.186,34.289,32.551,30.919,
29.450,27.973,27.141,25.853,25.318,24.728,24.648,
24.806,25.166,26.181,27.163,28.244,29.937,31.517,
32.743};
float c[18],d[18];
float x,y,t,Q,n=0;
int i,j,k;

for(k=0;k<=17;k++)
{
c[k]=0.5*(a[k]+a[18+k]);
d[k]=0.5*(b[k]+b[18+k]);
}

for(j=0;j<=16;j++)
for(i=0;i<=17-j;i++)
{
if(c[i]>c[i+1])
{ t=c[i];c[i]=c[i+1];c[i+1]=t;}
if(d[i]>d[i+1])
{ t=d[i];d[i]=d[i+1];d[i+1]=t;}
}

for(x=c[0];x<=c[17];x+=0.001)
for(y=d[0];y<=d[17];y+=0.001)
for(i=0;i<=17;i++)
{
Q=sqrt((x-a[i])*(x-a[i])+(y-b[i])*(y-b[i]));
if(Q>=9.9 && Q<=10.1)
n++;
if(n==18)
printf("\nx=%.3f,y=%.3f\n",x,y);
}
}
chengsion 2003-08-22
  • 打赏
  • 举报
回复
是的
请给出源程序
jimmy4lmx 2003-08-22
  • 打赏
  • 举报
回复
没用指针.
bm1408 2003-08-22
  • 打赏
  • 举报
回复
指针有误!
最好贴出原码!
Python参考手册,官方正式版参考手册,chm版。以下摘取部分内容:Navigation index modules | next | Python » 3.6.5 Documentation » Python Documentation contents What’s New in Python What’s New In Python 3.6 Summary – Release highlights New Features PEP 498: Formatted string literals PEP 526: Syntax for variable annotations PEP 515: Underscores in Numeric Literals PEP 525: Asynchronous Generators PEP 530: Asynchronous Comprehensions PEP 487: Simpler customization of class creation PEP 487: Descriptor Protocol Enhancements PEP 519: Adding a file system path protocol PEP 495: Local Time Disambiguation PEP 529: Change Windows filesystem encoding to UTF-8 PEP 528: Change Windows console encoding to UTF-8 PEP 520: Preserving Class Attribute Definition Order PEP 468: Preserving Keyword Argument Order New dict implementation PEP 523: Adding a frame evaluation API to CPython PYTHONMALLOC environment variable DTrace and SystemTap probing support Other Language Changes New Modules secrets Improved Modules array ast asyncio binascii cmath collections concurrent.futures contextlib datetime decimal distutils email encodings enum faulthandler fileinput hashlib http.client idlelib and IDLE importlib inspect json logging math multiprocessing os pathlib pdb pickle pickletools pydoc random re readline rlcompleter shlex site sqlite3 socket socketserver ssl statistics struct subprocess sys telnetlib time timeit tkinter traceback tracemalloc typing unicodedata unittest.mock urllib.request urllib.robotparser venv warnings winreg winsound xmlrpc.client zipfile zlib Optimizations Build and C API Changes Other Improvements Deprecated New Keywords Deprecated Python behavior Deprecated Python modules, functions and methods asynchat asyncore dbm distutils grp importlib os re ssl tkinter venv Deprecated functions and types of the C API Deprecated Build Options Removed API and Feature Removals Porting to Python 3.6 Changes in ‘python’ Command Behavior Changes in the Python API Changes in the C API CPython bytecode changes Notable changes in Python 3.6.2 New make regen-all build target Removal of make touch build target Notable changes in Python 3.6.5 What’s New In Python 3.5 Summary – Release highlights New Features PEP 492 - Coroutines with async and await syntax PEP 465 - A dedicated infix operator for matrix multiplication PEP 448 - Additional Unpacking Generalizations PEP 461 - percent formatting support for bytes and bytearray PEP 484 - Type Hints PEP 471 - os.scandir() function – a better and faster directory iterator PEP 475: Retry system calls failing with EINTR PEP 479: Change StopIteration handling inside generators PEP 485: A function for testing approximate equality PEP 486: Make the Python Launcher aware of virtual environments PEP 488: Elimination of PYO files PEP 489: Multi-phase extension module initialization Other Language Changes New Modules typing zipapp Improved Modules argparse asyncio bz2 cgi cmath code collections collections.abc compileall concurrent.futures configparser contextlib csv curses dbm difflib distutils doctest email enum faulthandler functools glob gzip heapq http http.client idlelib and IDLE imaplib imghdr importlib inspect io ipaddress json linecache locale logging lzma math multiprocessing operator os pathlib pickle poplib re readline selectors shutil signal smtpd smtplib sndhdr socket ssl Memory BIO Support Application-Layer Protocol Negotiation Support Other Changes sqlite3 subprocess sys sysconfig tarfile threading time timeit tkinter traceback types unicodedata unittest unittest.mock urllib wsgiref xmlrpc xml.sax zipfile Other module-level changes Optimizations Build and C API Changes Deprecated New Keywords Deprecated Python Behavior Unsupported Operating Systems Deprecated Python modules, functions and methods Removed API and Feature Removals Porting to Python 3.5 Changes in Python behavior Changes in the Python API Changes in the C API What’s New In Python 3.4 Summary – Release Highlights New Features PEP 453: Explicit Bootstrapping of PIP in Python Installations Bootstrapping pip By Default Documentation Changes PEP 446: Newly Created File Descriptors Are Non-Inheritable Improvements to Codec Handling PEP 451: A ModuleSpec Type for the Import System Other Language Changes New Modules asyncio ensurepip enum pathlib selectors statistics tracemalloc Improved Modules abc aifc argparse audioop base64 collections colorsys contextlib dbm dis doctest email filecmp functools gc glob hashlib hmac html http idlelib and IDLE importlib inspect ipaddress logging marshal mmap multiprocessing operator os pdb pickle plistlib poplib pprint pty pydoc re resource select shelve shutil smtpd smtplib socket sqlite3 ssl stat struct subprocess sunau sys tarfile textwrap threading traceback types urllib unittest venv wave weakref xml.etree zipfile CPython Implementation Changes PEP 445: Customization of CPython Memory Allocators PEP 442: Safe Object Finalization PEP 456: Secure and Interchangeable Hash Algorithm PEP 436: Argument Clinic Other Build and C API Changes Other Improvements Significant Optimizations Deprecated Deprecations in the Python API Deprecated Features Removed Operating Systems No Longer Supported API and Feature Removals Code Cleanups Porting to Python 3.4 Changes in ‘python’ Command Behavior Changes in the Python API Changes in the C API Changed in 3.4.3 PEP 476: Enabling certificate verification by default for stdlib http clients What’s New In Python 3.3 Summary – Release highlights PEP 405: Virtual Environments PEP 420: Implicit Namespace Packages PEP 3118: New memoryview implementation and buffer protocol documentation Features API changes PEP 393: Flexible String Representation Functionality Performance and resource usage PEP 397: Python Launcher for Windows PEP 3151: Reworking the OS and IO exception hierarchy PEP 380: Syntax for Delegating to a Subgenerator PEP 409: Suppressing exception context PEP 414: Explicit Unicode literals PEP 3155: Qualified name for classes and functions PEP 412: Key-Sharing Dictionary PEP 362: Function Signature Object PEP 421: Adding sys.implementation SimpleNamespace Using importlib as the Implementation of Import New APIs Visible Changes Other Language Changes A Finer-Grained Import Lock Builtin functions and types New Modules faulthandler ipaddress lzma Improved Modules abc array base64 binascii bz2 codecs collections contextlib crypt curses datetime decimal Features API changes email Policy Framework Provisional Policy with New Header API Other API Changes ftplib functools gc hmac http html imaplib inspect io itertools logging math mmap multiprocessing nntplib os pdb pickle pydoc re sched select shlex shutil signal smtpd smtplib socket socketserver sqlite3 ssl stat struct subprocess sys tarfile tempfile textwrap threading time types unittest urllib webbrowser xml.etree.ElementTree zlib Optimizations Build and C API Changes Deprecated Unsupported Operating Systems Deprecated Python modules, functions and methods Deprecated functions and types of the C API Deprecated features Porting to Python 3.3 Porting Python code Porting C code Building C extensions Command Line Switch Changes What’s New In Python 3.2 PEP 384: Defining a Stable ABI PEP 389: Argparse Command Line Parsing Module PEP 391: Dictionary Based Configuration for Logging PEP 3148: The concurrent.futures module PEP 3147: PYC Repository Directories PEP 3149: ABI Version Tagged .so Files PEP 3333: Python Web Server Gateway Interface v1.0.1 Other Language Changes New, Improved, and Deprecated Modules email elementtree functools itertools collections threading datetime and time math abc io reprlib logging csv contextlib decimal and fractions ftp popen select gzip and zipfile tarfile hashlib ast os shutil sqlite3 html socket ssl nntp certificates imaplib http.client unittest random poplib asyncore tempfile inspect pydoc dis dbm ctypes site sysconfig pdb configparser urllib.parse mailbox turtledemo Multi-threading Optimizations Unicode Codecs Documentation IDLE Code Repository Build and C API Changes Porting to Python 3.2 What’s New In Python 3.1 PEP 372: Ordered Dictionaries PEP 378: Format Specifier for Thousands Separator Other Language Changes New, Improved, and Deprecated Modules Optimizations IDLE Build and C API Changes Porting to Python 3.1 What’s New In Python 3.0 Common Stumbling Blocks Print Is A Function Views And Iterators Instead Of Lists Ordering Comparisons Integers Text Vs. Data Instead Of Unicode Vs. 8-bit Overview Of Syntax Changes New Syntax Changed Syntax Removed Syntax Changes Already Present In Python 2.6 Library Changes PEP 3101: A New Approach To String Formatting Changes To Exceptions Miscellaneous Other Changes Operators And Special Methods Builtins Build and C API Changes Performance Porting To Python 3.0 What’s New in Python 2.7 The Future for Python 2.x Changes to the Handling of Deprecation Warnings Python 3.1 Features PEP 372: Adding an Ordered Dictionary to collections PEP 378: Format Specifier for Thousands Separator PEP 389: The argparse Module for Parsing Command Lines PEP 391: Dictionary-Based Configuration For Logging PEP 3106: Dictionary Views PEP 3137: The memoryview Object Other Language Changes Interpreter Changes Optimizations New and Improved Modules New module: importlib New module: sysconfig ttk: Themed Widgets for Tk Updated module: unittest Updated module: ElementTree 1.3 Build and C API Changes Capsules Port-Specific Changes: Windows Port-Specific Changes: Mac OS X Port-Specific Changes: FreeBSD Other Changes and Fixes Porting to Python 2.7 New Features Added to Python 2.7 Maintenance Releases PEP 434: IDLE Enhancement Exception for All Branches PEP 466: Network Security Enhancements for Python 2.7 Acknowledgements What’s New in Python 2.6 Python 3.0 Changes to the Development Process New Issue Tracker: Roundup New Documentation Format: reStructuredText Using Sphinx PEP 343: The ‘with’ statement Writing Context Managers The contextlib module PEP 366: Explicit Relative Imports From a Main Module PEP 370: Per-user site-packages Directory PEP 371: The multiprocessing Package PEP 3101: Advanced String Formatting PEP 3105: print As a Function PEP 3110: Exception-Handling Changes PEP 3112: Byte Literals PEP 3116: New I/O Library PEP 3118: Revised Buffer Protocol PEP 3119: Abstract Base Classes PEP 3127: Integer Literal Support and Syntax PEP 3129: Class Decorators PEP 3141: A Type Hierarchy for Numbers The fractions Module Other Language Changes Optimizations Interpreter Changes New and Improved Modules The ast module The future_builtins module The json module: JavaScript Object Notation The plistlib module: A Property-List Parser ctypes Enhancements Improved SSL Support Deprecations and Removals Build and C API Changes Port-Specific Changes: Windows Port-Specific Changes: Mac OS X Port-Specific Changes: IRIX Porting to Python 2.6 Acknowledgements What’s New in Python 2.5 PEP 308: Conditional Expressions PEP 309: Partial Function Application PEP 314: Metadata for Python Software Packages v1.1 PEP 328: Absolute and Relative Imports PEP 338: Executing Modules as Scripts PEP 341: Unified try/except/finally PEP 342: New Generator Features PEP 343: The ‘with’ statement Writing Context Managers The contextlib module PEP 352: Exceptions as New-Style Classes PEP 353: Using ssize_t as the index type PEP 357: The ‘__index__’ method Other Language Changes Interactive Interpreter Changes Optimizations New, Improved, and Removed Modules The ctypes package The ElementTree package The hashlib package The sqlite3 package The wsgiref package Build and C API Changes Port-Specific Changes Porting to Python 2.5 Acknowledgements What’s New in Python 2.4 PEP 218: Built-In Set Objects PEP 237: Unifying Long Integers and Integers PEP 289: Generator Expressions PEP 292: Simpler String Substitutions PEP 318: Decorators for Functions and Methods PEP 322: Reverse Iteration PEP 324: New subprocess Module PEP 327: Decimal Data Type Why is Decimal needed? The Decimal type The Context type PEP 328: Multi-line Imports PEP 331: Locale-Independent Float/String Conversions Other Language Changes Optimizations New, Improved, and Deprecated Modules cookielib doctest Build and C API Changes Port-Specific Changes Porting to Python 2.4 Acknowledgements What’s New in Python 2.3 PEP 218: A Standard Set Datatype PEP 255: Simple Generators PEP 263: Source Code Encodings PEP 273: Importing Modules from ZIP Archives PEP 277: Unicode file name support for Windows NT PEP 278: Universal Newline Support PEP 279: enumerate() PEP 282: The logging Package PEP 285: A Boolean Type PEP 293: Codec Error Handling Callbacks PEP 301: Package Index and Metadata for Distutils PEP 302: New Import Hooks PEP 305: Comma-separated Files PEP 307: Pickle Enhancements Extended Slices Other Language Changes String Changes Optimizations New, Improved, and Deprecated Modules Date/Time Type The optparse Module Pymalloc: A Specialized Object Allocator Build and C API Changes Port-Specific Changes Other Changes and Fixes Porting to Python 2.3 Acknowledgements What’s New in Python 2.2 Introduction PEPs 252 and 253: Type and Class Changes Old and New Classes Descriptors Multiple Inheritance: The Diamond Rule Attribute Access Related Links PEP 234: Iterators PEP 255: Simple Generators PEP 237: Unifying Long Integers and Integers PEP 238: Changing the Division Operator Unicode Changes PEP 227: Nested Scopes New and Improved Modules Interpreter Changes and Fixes Other Changes and Fixes Acknowledgements What’s New in Python 2.1 Introduction PEP 227: Nested Scopes PEP 236: __future__ Directives PEP 207: Rich Comparisons PEP 230: Warning Framework PEP 229: New Build System PEP 205: Weak References PEP 232: Function Attributes PEP 235: Importing Modules on Case-Insensitive Platforms PEP 217: Interactive Display Hook PEP 208: New Coercion Model PEP 241: Metadata in Python Packages New and Improved Modules Other Changes and Fixes Acknowledgements What’s New in Python 2.0 Introduction What About Python 1.6? New Development Process Unicode List Comprehensions Augmented Assignment String Methods Garbage Collection of Cycles Other Core Changes Minor Language Changes Changes to Built-in Functions Porting to 2.0 Extending/Embedding Changes Distutils: Making Modules Easy to Install XML Modules SAX2 Support DOM Support Relationship to PyXML Module changes New modules IDLE Improvements Deleted and Deprecated Modules Acknowledgements Changelog Python 3.6.5 final? Tests Build Python 3.6.5 release candidate 1? Security Core and Builtins Library Documentation Tests Build Windows macOS IDLE Tools/Demos C API Python 3.6.4 final? Python 3.6.4 release candidate 1? Core and Builtins Library Documentation Tests Build Windows macOS IDLE Tools/Demos C API Python 3.6.3 final? Library Build Python 3.6.3 release candidate 1? Security Core and Builtins Library Documentation Tests Build Windows IDLE Tools/Demos Python 3.6.2 final? Python 3.6.2 release candidate 2? Security Python 3.6.2 release candidate 1? Core and Builtins Library Security Library IDLE C API Build Documentation Tools/Demos Tests Windows Python 3.6.1 final? Core and Builtins Build Python 3.6.1 release candidate 1? Core and Builtins Library IDLE Windows C API Documentation Tests Build Python 3.6.0 final? Python 3.6.0 release candidate 2? Core and Builtins Tools/Demos Windows Build Python 3.6.0 release candidate 1? Core and Builtins Library C API Documentation Tools/Demos Python 3.6.0 beta 4? Core and Builtins Library Documentation Tests Build Python 3.6.0 beta 3? Core and Builtins Library Windows Build Tests Python 3.6.0 beta 2? Core and Builtins Library Windows C API Build Tests Python 3.6.0 beta 1? Core and Builtins Library IDLE C API Tests Build Tools/Demos Windows Python 3.6.0 alpha 4? Core and Builtins Library IDLE Tests Windows Build Python 3.6.0 alpha 3? Core and Builtins Library Security Library Security Library IDLE C API Build Tools/Demos Documentation Tests Python 3.6.0 alpha 2? Core and Builtins Library Security Library Security Library IDLE Documentation Tests Windows Build Windows C API Tools/Demos Python 3.6.0 alpha 1? Core and Builtins Library Security Library Security Library Security Library IDLE Documentation Tests Build Windows Tools/Demos C API Python 3.5.3 final? Python 3.5.3 release candidate 1? Core and Builtins Library Security Library Security Library IDLE C API Documentation Tests Tools/Demos Windows Build Python 3.5.2 final? Core and Builtins Tests IDLE Python 3.5.2 release candidate 1? Core and Builtins Security Library Security Library Security Library Security Library Security Library IDLE Documentation Tests Build Windows Tools/Demos Windows Python 3.5.1 final? Core and Builtins Windows Python 3.5.1 release candidate 1? Core and Builtins Library IDLE Documentation Tests Build Windows Tools/Demos Python 3.5.0 final? Build Python 3.5.0 release candidate 4? Library Build Python 3.5.0 release candidate 3? Core and Builtins Library Python 3.5.0 release candidate 2? Core and Builtins Library Python 3.5.0 release candidate 1? Core and Builtins Library IDLE Documentation Tests Python 3.5.0 beta 4? Core and Builtins Library Build Python 3.5.0 beta 3? Core and Builtins Library Tests Documentation Build Python 3.5.0 beta 2? Core and Builtins Library Python 3.5.0 beta 1? Core and Builtins Library IDLE Tests Documentation Tools/Demos Python 3.5.0 alpha 4? Core and Builtins Library Build Tests Tools/Demos C API Python 3.5.0 alpha 3? Core and Builtins Library Build Tests Tools/Demos Python 3.5.0 alpha 2? Core and Builtins Library Build C API Windows Python 3.5.0 alpha 1? Core and Builtins Library IDLE Build C API Documentation Tests Tools/Demos Windows The Python Tutorial 1. Whetting Your Appetite 2. Using the Python Interpreter 2.1. Invoking the Interpreter 2.1.1. Argument Passing 2.1.2. Interactive Mode 2.2. The Interpreter and Its Environment 2.2.1. Source Code Encoding 3. An Informal Introduction to Python 3.1. Using Python as a Calculator 3.1.1. Numbers 3.1.2. Strings 3.1.3. Lists 3.2. First Steps Towards Programming 4. More Control Flow Tools 4.1. if Statements 4.2. for Statements 4.3. The range() Function 4.4. break and continue Statements, and else Clauses on Loops 4.5. pass Statements 4.6. Defining Functions 4.7. More on Defining Functions 4.7.1. Default Argument Values 4.7.2. Keyword Arguments 4.7.3. Arbitrary Argument Lists 4.7.4. Unpacking Argument Lists 4.7.5. Lambda Expressions 4.7.6. Documentation Strings 4.7.7. Function Annotations 4.8. Intermezzo: Coding Style 5. Data Structures 5.1. More on Lists 5.1.1. Using Lists as Stacks 5.1.2. Using Lists as Queues 5.1.3. List Comprehensions 5.1.4. Nested List Comprehensions 5.2. The del statement 5.3. Tuples and Sequences 5.4. Sets 5.5. Dictionaries 5.6. Looping Techniques 5.7. More on Conditions 5.8. Comparing Sequences and Other Types 6. Modules 6.1. More on Modules 6.1.1. Executing modules as scripts 6.1.2. The Module Search Path 6.1.3. “Compiled” Python files 6.2. Standard Modules 6.3. The dir() Function 6.4. Packages 6.4.1. Importing * From a Package 6.4.2. Intra-package References 6.4.3. Packages in Multiple Directories 7. Input and Output 7.1. Fancier Output Formatting 7.1.1. Old string formatting 7.2. Reading and Writing Files 7.2.1. Methods of File Objects 7.2.2. Saving structured data with json 8. Errors and Exceptions 8.1. Syntax Errors 8.2. Exceptions 8.3. Handling Exceptions 8.4. Raising Exceptions 8.5. User-defined Exceptions 8.6. Defining Clean-up Actions 8.7. Predefined Clean-up Actions 9. Classes 9.1. A Word About Names and Objects 9.2. Python Scopes and Namespaces 9.2.1. Scopes and Namespaces Example 9.3. A First Look at Classes 9.3.1. Class Definition Syntax 9.3.2. Class Objects 9.3.3. Instance Objects 9.3.4. Method Objects 9.3.5. Class and Instance Variables 9.4. Random Remarks 9.5. Inheritance 9.5.1. Multiple Inheritance 9.6. Private Variables 9.7. Odds and Ends 9.8. Iterators 9.9. Generators 9.10. Generator Expressions 10. Brief Tour of the Standard Library 10.1. Operating System Interface 10.2. File Wildcards 10.3. Command Line Arguments 10.4. Error Output Redirection and Program Termination 10.5. String Pattern Matching 10.6. Mathematics 10.7. Internet Access 10.8. Dates and Times 10.9. Data Compression 10.10. Performance Measurement 10.11. Quality Control 10.12. Batteries Included 11. Brief Tour of the Standard Library — Part II 11.1. Output Formatting 11.2. Templating 11.3. Working with Binary Data Record Layouts 11.4. Multi-threading 11.5. Logging 11.6. Weak References 11.7. Tools for Working with Lists 11.8. Decimal Floating Point Arithmetic 12. Virtual Environments and Packages 12.1. Introduction 12.2. Creating Virtual Environments 12.3. Managing Packages with pip 13. What Now? 14. Interactive Input Editing and History Substitution 14.1. Tab Completion and History Editing 14.2. Alternatives to the Interactive Interpreter 15. Floating Point Arithmetic: Issues and Limitations 15.1. Representation Error 16. Appendix 16.1. Interactive Mode 16.1.1. Error Handling 16.1.2. Executable Python Scripts 16.1.3. The Interactive Startup File 16.1.4. The Customization Modules Python Setup and Usage 1. Command line and environment 1.1. Command line 1.1.1. Interface options 1.1.2. Generic options 1.1.3. Miscellaneous options 1.1.4. Options you shouldn’t use 1.2. Environment variables 1.2.1. Debug-mode variables 2. Using Python on Unix platforms 2.1. Getting and installing the latest version of Python 2.1.1. On Linux 2.1.2. On FreeBSD and OpenBSD 2.1.3. On OpenSolaris 2.2. Building Python 2.3. Python-related paths and files 2.4. Miscellaneous 2.5. Editors and IDEs 3. Using Python on Windows 3.1. Installing Python 3.1.1. Supported Versions 3.1.2. Installation Steps 3.1.3. Removing the MAX_PATH Limitation 3.1.4. Installing Without UI 3.1.5. Installing Without Downloading 3.1.6. Modifying an install 3.1.7. Other Platforms 3.2. Alternative bundles 3.3. Configuring Python 3.3.1. Excursus: Setting environment variables 3.3.2. Finding the Python executable 3.4. Python Launcher for Windows 3.4.1. Getting started 3.4.1.1. From the command-line 3.4.1.2. Virtual environments 3.4.1.3. From a script 3.4.1.4. From file associations 3.4.2. Shebang Lines 3.4.3. Arguments in shebang lines 3.4.4. Customization 3.4.4.1. Customization via INI files 3.4.4.2. Customizing default Python versions 3.4.5. Diagnostics 3.5. Finding modules 3.6. Additional modules 3.6.1. PyWin32 3.6.2. cx_Freeze 3.6.3. WConio 3.7. Compiling Python on Windows 3.8. Embedded Distribution 3.8.1. Python Application 3.8.2. Embedding Python 3.9. Other resources 4. Using Python on a Macintosh 4.1. Getting and Installing MacPython 4.1.1. How to run a Python script 4.1.2. Running scripts with a GUI 4.1.3. Configuration 4.2. The IDE 4.3. Installing Additional Python Packages 4.4. GUI Programming on the Mac 4.5. Distributing Python Applications on the Mac 4.6. Other Resources The Python Language Reference 1. Introduction 1.1. Alternate Implementations 1.2. Notation 2. Lexical analysis 2.1. Line structure 2.1.1. Logical lines 2.1.2. Physical lines 2.1.3. Comments 2.1.4. Encoding declarations 2.1.5. Explicit line joining 2.1.6. Implicit line joining 2.1.7. Blank lines 2.1.8. Indentation 2.1.9. Whitespace between tokens 2.2. Other tokens 2.3. Identifiers and keywords 2.3.1. Keywords 2.3.2. Reserved classes of identifiers 2.4. Literals 2.4.1. String and Bytes literals 2.4.2. String literal concatenation 2.4.3. Formatted string literals 2.4.4. Numeric literals 2.4.5. Integer literals 2.4.6. Floating point literals 2.4.7. Imaginary literals 2.5. Operators 2.6. Delimiters 3. Data model 3.1. Objects, values and types 3.2. The standard type hierarchy 3.3. Special method names 3.3.1. Basic customization 3.3.2. Customizing attribute access 3.3.2.1. Customizing module attribute access 3.3.2.2. Implementing Descriptors 3.3.2.3. Invoking Descriptors 3.3.2.4. __slots__ 3.3.2.4.1. Notes on using __slots__ 3.3.3. Customizing class creation 3.3.3.1. Metaclasses 3.3.3.2. Determining the appropriate metaclass 3.3.3.3. Preparing the class namespace 3.3.3.4. Executing the class body 3.3.3.5. Creating the class object 3.3.3.6. Metaclass example 3.3.4. Customizing instance and subclass checks 3.3.5. Emulating callable objects 3.3.6. Emulating container types 3.3.7. Emulating numeric types 3.3.8. With Statement Context Managers 3.3.9. Special method lookup 3.4. Coroutines 3.4.1. Awaitable Objects 3.4.2. Coroutine Objects 3.4.3. Asynchronous Iterators 3.4.4. Asynchronous Context Managers 4. Execution model 4.1. Structure of a program 4.2. Naming and binding 4.2.1. Binding of names 4.2.2. Resolution of names 4.2.3. Builtins and restricted execution 4.2.4. Interaction with dynamic features 4.3. Exceptions 5. The import system 5.1. importlib 5.2. Packages 5.2.1. Regular packages 5.2.2. Namespace packages 5.3. Searching 5.3.1. The module cache 5.3.2. Finders and loaders 5.3.3. Import hooks 5.3.4. The meta path 5.4. Loading 5.4.1. Loaders 5.4.2. Submodules 5.4.3. Module spec 5.4.4. Import-related module attributes 5.4.5. module.__path__ 5.4.6. Module reprs 5.5. The Path Based Finder 5.5.1. Path entry finders 5.5.2. Path entry finder protocol 5.6. Replacing the standard import system 5.7. Special considerations for __main__ 5.7.1. __main__.__spec__ 5.8. Open issues 5.9. References 6. Expressions 6.1. Arithmetic conversions 6.2. Atoms 6.2.1. Identifiers (Names) 6.2.2. Literals 6.2.3. Parenthesized forms 6.2.4. Displays for lists, sets and dictionaries 6.2.5. List displays 6.2.6. Set displays 6.2.7. Dictionary displays 6.2.8. Generator expressions 6.2.9. Yield expressions 6.2.9.1. Generator-iterator methods 6.2.9.2. Examples 6.2.9.3. Asynchronous generator functions 6.2.9.4. Asynchronous generator-iterator methods 6.3. Primaries 6.3.1. Attribute references 6.3.2. Subscriptions 6.3.3. Slicings 6.3.4. Calls 6.4. Await expression 6.5. The power operator 6.6. Unary arithmetic and bitwise operations 6.7. Binary arithmetic operations 6.8. Shifting operations 6.9. Binary bitwise operations 6.10. Comparisons 6.10.1. Value comparisons 6.10.2. Membership test operations 6.10.3. Identity comparisons 6.11. Boolean operations 6.12. Conditional expressions 6.13. Lambdas 6.14. Expression lists 6.15. Evaluation order 6.16. Operator precedence 7. Simple statements 7.1. Expression statements 7.2. Assignment statements 7.2.1. Augmented assignment statements 7.2.2. Annotated assignment statements 7.3. The assert statement 7.4. The pass statement 7.5. The del statement 7.6. The return statement 7.7. The yield statement 7.8. The raise statement 7.9. The break statement 7.10. The continue statement 7.11. The import statement 7.11.1. Future statements 7.12. The global statement 7.13. The nonlocal statement 8. Compound statements 8.1. The if statement 8.2. The while statement 8.3. The for statement 8.4. The try statement 8.5. The with statement 8.6. Function definitions 8.7. Class definitions 8.8. Coroutines 8.8.1. Coroutine function definition 8.8.2. The async for statement 8.8.3. The async with statement 9. Top-level components 9.1. Complete Python programs 9.2. File input 9.3. Interactive input 9.4. Expression input 10. Full Grammar specification The Python Standard Library 1. Introduction 2. Built-in Functions 3. Built-in Constants 3.1. Constants added by the site module 4. Built-in Types 4.1. Truth Value Testing 4.2. Boolean Operations — and, or, not 4.3. Comparisons 4.4. Numeric Types — int, float, complex 4.4.1. Bitwise Operations on Integer Types 4.4.2. Additional Methods on Integer Types 4.4.3. Additional Methods on Float 4.4.4. Hashing of numeric types 4.5. Iterator Types 4.5.1. Generator Types 4.6. Sequence Types — list, tuple, range 4.6.1. Common Sequence Operations 4.6.2. Immutable Sequence Types 4.6.3. Mutable Sequence Types 4.6.4. Lists 4.6.5. Tuples 4.6.6. Ranges 4.7. Text Sequence Type — str 4.7.1. String Methods 4.7.2. printf-style String Formatting 4.8. Binary Sequence Types — bytes, bytearray, memoryview 4.8.1. Bytes Objects 4.8.2. Bytearray Objects 4.8.3. Bytes and Bytearray Operations 4.8.4. printf-style Bytes Formatting 4.8.5. Memory Views 4.9. Set Types — set, frozenset 4.10. Mapping Types — dict 4.10.1. Dictionary view objects 4.11. Context Manager Types 4.12. Other Built-in Types 4.12.1. Modules 4.12.2. Classes and Class Instances 4.12.3. Functions 4.12.4. Methods 4.12.5. Code Objects 4.12.6. Type Objects 4.12.7. The Null Object 4.12.8. The Ellipsis Object 4.12.9. The NotImplemented Object 4.12.10. Boolean Values 4.12.11. Internal Objects 4.13. Special Attributes 5. Built-in Exceptions 5.1. Base classes 5.2. Concrete exceptions 5.2.1. OS exceptions 5.3. Warnings 5.4. Exception hierarchy 6. Text Processing Services 6.1. string — Common string operations 6.1.1. String constants 6.1.2. Custom String Formatting 6.1.3. Format String Syntax 6.1.3.1. Format Specification Mini-Language 6.1.3.2. Format examples 6.1.4. Template strings 6.1.5. Helper functions 6.2. re — Regular expression operations 6.2.1. Regular Expression Syntax 6.2.2. Module Contents 6.2.3. Regular Expression Objects 6.2.4. Match Objects 6.2.5. Regular Expression Examples 6.2.5.1. Checking for a Pair 6.2.5.2. Simulating scanf() 6.2.5.3. search() vs. match() 6.2.5.4. Making a Phonebook 6.2.5.5. Text Munging 6.2.5.6. Finding all Adverbs 6.2.5.7. Finding all Adverbs and their Positions 6.2.5.8. Raw String Notation 6.2.5.9. Writing a Tokenizer 6.3. difflib — Helpers for computing deltas 6.3.1. SequenceMatcher Objects 6.3.2. SequenceMatcher Examples 6.3.3. Differ Objects 6.3.4. Differ Example 6.3.5. A command-line interface to difflib 6.4. textwrap — Text wrapping and filling 6.5. unicodedata — Unicode Database 6.6. stringprep — Internet String Preparation 6.7. readline — GNU readline interface 6.7.1. Init file 6.7.2. Line buffer 6.7.3. History file 6.7.4. History list 6.7.5. Startup hooks 6.7.6. Completion 6.7.7. Example 6.8. rlcompleter — Completion function for GNU readline 6.8.1. Completer Objects 7. Binary Data Services 7.1. struct — Interpret bytes as packed binary data 7.1.1. Functions and Exceptions 7.1.2. Format Strings 7.1.2.1. Byte Order, Size, and Alignment 7.1.2.2. Format Characters 7.1.2.3. Examples 7.1.3. Classes 7.2. codecs — Codec registry and base classes 7.2.1. Codec Base Classes 7.2.1.1. Error Handlers 7.2.1.2. Stateless Encoding and Decoding 7.2.1.3. Incremental Encoding and Decoding 7.2.1.3.1. IncrementalEncoder Objects 7.2.1.3.2. IncrementalDecoder Objects 7.2.1.4. Stream Encoding and Decoding 7.2.1.4.1. StreamWriter Objects 7.2.1.4.2. StreamReader Objects 7.2.1.4.3. StreamReaderWriter Objects 7.2.1.4.4. StreamRecoder Objects 7.2.2. Encodings and Unicode 7.2.3. Standard Encodings 7.2.4. Python Specific Encodings 7.2.4.1. Text Encodings 7.2.4.2. Binary Transforms 7.2.4.3. Text Transforms 7.2.5. encodings.idna — Internationalized Domain Names in Applications 7.2.6. encodings.mbcs — Windows ANSI codepage 7.2.7. encodings.utf_8_sig — UTF-8 codec with BOM signature 8. Data Types 8.1. datetime — Basic date and time types 8.1.1. Available Types 8.1.2. timedelta Objects 8.1.3. date Objects 8.1.4. datetime Objects 8.1.5. time Objects 8.1.6. tzinfo Objects 8.1.7. timezone Objects 8.1.8. strftime() and strptime() Behavior 8.2. calendar — General calendar-related functions 8.3. collections — Container datatypes 8.3.1. ChainMap objects 8.3.1.1. ChainMap Examples and Recipes 8.3.2. Counter objects 8.3.3. deque objects 8.3.3.1. deque Recipes 8.3.4. defaultdict objects 8.3.4.1. defaultdict Examples 8.3.5. namedtuple() Factory Function for Tuples with Named Fields 8.3.6. OrderedDict objects 8.3.6.1. OrderedDict Examples and Recipes 8.3.7. UserDict objects 8.3.8. UserList objects 8.3.9. UserString objects 8.4. collections.abc — Abstract Base Classes for Containers 8.4.1. Collections Abstract Base Classes 8.5. heapq — Heap queue algorithm 8.5.1. Basic Examples 8.5.2. Priority Queue Implementation Notes 8.5.3. Theory 8.6. bisect — Array bisection algorithm 8.6.1. Searching Sorted Lists 8.6.2. Other Examples 8.7. array — Efficient arrays of numeric values 8.8. weakref — Weak references 8.8.1. Weak Reference Objects 8.8.2. Example 8.8.3. Finalizer Objects 8.8.4. Comparing finalizers with __del__() methods 8.9. types — Dynamic type creation and names for built-in types 8.9.1. Dynamic Type Creation 8.9.2. Standard Interpreter Types 8.9.3. Additional Utility Classes and Functions 8.9.4. Coroutine Utility Functions 8.10. copy — Shallow and deep copy operations 8.11. pprint — Data pretty printer 8.11.1. PrettyPrinter Objects 8.11.2. Example 8.12. reprlib — Alternate repr() implementation 8.12.1. Repr Objects 8.12.2. Subclassing Repr Objects 8.13. enum — Support for enumerations 8.13.1. Module Contents 8.13.2. Creating an Enum 8.13.3. Programmatic access to enumeration members and their attributes 8.13.4. Duplicating enum members and values 8.13.5. Ensuring unique enumeration values 8.13.6. Using automatic values 8.13.7. Iteration 8.13.8. Comparisons 8.13.9. Allowed members and attributes of enumerations 8.13.10. Restricted subclassing of enumerations 8.13.11. Pickling 8.13.12. Functional API 8.13.13. Derived Enumerations 8.13.13.1. IntEnum 8.13.13.2. IntFlag 8.13.13.3. Flag 8.13.13.4. Others 8.13.14. Interesting examples 8.13.14.1. Omitting values 8.13.14.1.1. Using auto 8.13.14.1.2. Using object 8.13.14.1.3. Using a descriptive string 8.13.14.1.4. Using a custom __new__() 8.13.14.2. OrderedEnum 8.13.14.3. DuplicateFreeEnum 8.13.14.4. Planet 8.13.15. How are Enums different? 8.13.15.1. Enum Classes 8.13.15.2. Enum Members (aka instances) 8.13.15.3. Finer Points 8.13.15.3.1. Supported __dunder__ names 8.13.15.3.2. Supported _sunder_ names 8.13.15.3.3. Enum member type 8.13.15.3.4. Boolean value of Enum classes and members 8.13.15.3.5. Enum classes with methods 8.13.15.3.6. Combining members of Flag 9. Numeric and Mathematical Modules 9.1. numbers — Numeric abstract base classes 9.1.1. The numeric tower 9.1.2. Notes for type implementors 9.1.2.1. Adding More Numeric ABCs 9.1.2.2. Implementing the arithmetic operations 9.2. math — Mathematical functions 9.2.1. Number-theoretic and representation functions 9.2.2. Power and logarithmic functions 9.2.3. Trigonometric functions 9.2.4. Angular conversion 9.2.5. Hyperbolic functions 9.2.6. Special functions 9.2.7. Constants 9.3. cmath — Mathematical functions for complex numbers 9.3.1. Conversions to and from polar coordinates 9.3.2. Power and logarithmic functions 9.3.3. Trigonometric functions 9.3.4. Hyperbolic functions 9.3.5. Classification functions 9.3.6. Constants 9.4. decimal — Decimal fixed point and floating point arithmetic 9.4.1. Quick-start Tutorial 9.4.2. Decimal objects 9.4.2.1. Logical operands 9.4.3. Context objects 9.4.4. Constants 9.4.5. Rounding modes 9.4.6. Signals 9.4.7. Floating Point Notes 9.4.7.1. Mitigating round-off error with increased precision 9.4.7.2. Special values 9.4.8. Working with threads 9.4.9. Recipes 9.4.10. Decimal FAQ 9.5. fractions — Rational numbers 9.6. random — Generate pseudo-random numbers 9.6.1. Bookkeeping functions 9.6.2. Functions for integers 9.6.3. Functions for sequences 9.6.4. Real-valued distributions 9.6.5. Alternative Generator 9.6.6. Notes on Reproducibility 9.6.7. Examples and Recipes 9.7. statistics — Mathematical statistics functions 9.7.1. Averages and measures of central location 9.7.2. Measures of spread 9.7.3. Function details 9.7.4. Exceptions 10. Functional Programming Modules 10.1. itertools — Functions creating iterators for efficient looping 10.1.1. Itertool functions 10.1.2. Itertools Recipes 10.2. functools — Higher-order functions and operations on callable objects 10.2.1. partial Objects 10.3. operator — Standard operators as functions 10.3.1. Mapping Operators to Functions 10.3.2. Inplace Operators 11. File and Directory Access 11.1. pathlib — Object-oriented filesystem paths 11.1.1. Basic use 11.1.2. Pure paths 11.1.2.1. General properties 11.1.2.2. Operators 11.1.2.3. Accessing individual parts 11.1.2.4. Methods and properties 11.1.3. Concrete paths 11.1.3.1. Methods 11.2. os.path — Common pathname manipulations 11.3. fileinput — Iterate over lines from multiple input streams 11.4. stat — Interpreting stat() results 11.5. filecmp — File and Directory Comparisons 11.5.1. The dircmp class 11.6. tempfile — Generate temporary files and directories 11.6.1. Examples 11.6.2. Deprecated functions and variables 11.7. glob — Unix style pathname pattern expansion 11.8. fnmatch — Unix filename pattern matching 11.9. linecache — Random access to text lines 11.10. shutil — High-level file operations 11.10.1. Directory and files operations 11.10.1.1. copytree example 11.10.1.2. rmtree example 11.10.2. Archiving operations 11.10.2.1. Archiving example 11.10.3. Querying the size of the output terminal 11.11. macpath — Mac OS 9 path manipulation functions 12. Data Persistence 12.1. pickle — Python object serialization 12.1.1. Relationship to other Python modules 12.1.1.1. Comparison with marshal 12.1.1.2. Comparison with json 12.1.2. Data stream format 12.1.3. Module Interface 12.1.4. What can be pickled and unpickled? 12.1.5. Pickling Class Instances 12.1.5.1. Persistence of External Objects 12.1.5.2. Dispatch Tables 12.1.5.3. Handling Stateful Objects 12.1.6. Restricting Globals 12.1.7. Performance 12.1.8. Examples 12.2. copyreg — Register pickle support functions 12.2.1. Example 12.3. shelve — Python object persistence 12.3.1. Restrictions 12.3.2. Example 12.4. marshal — Internal Python object serialization 12.5. dbm — Interfaces to Unix “databases” 12.5.1. dbm.gnu — GNU’s reinterpretation of dbm 12.5.2. dbm.ndbm — Interface based on ndbm 12.5.3. dbm.dumb — Portable DBM implementation 12.6. sqlite3 — DB-API 2.0 interface for SQLite databases 12.6.1. Module functions and constants 12.6.2. Connection Objects 12.6.3. Cursor Objects 12.6.4. Row Objects 12.6.5. Exceptions 12.6.6. SQLite and Python types 12.6.6.1. Introduction 12.6.6.2. Using adapters to store additional Python types in SQLite databases 12.6.6.2.1. Letting your object adapt itself 12.6.6.2.2. Registering an adapter callable 12.6.6.3. Converting SQLite values to custom Python types 12.6.6.4. Default adapters and converters 12.6.7. Controlling Transactions 12.6.8. Using sqlite3 efficiently 12.6.8.1. Using shortcut methods 12.6.8.2. Accessing columns by name instead of by index 12.6.8.3. Using the connection as a context manager 12.6.9. Common issues 12.6.9.1. Multithreading 13. Data Compression and Archiving 13.1. zlib — Compression compatible with gzip 13.2. gzip — Support for gzip files 13.2.1. Examples of usage 13.3. bz2 — Support for bzip2 compression 13.3.1. (De)compression of files 13.3.2. Incremental (de)compression 13.3.3. One-shot (de)compression 13.4. lzma — Compression using the LZMA algorithm 13.4.1. Reading and writing compressed files 13.4.2. Compressing and decompressing data in memory 13.4.3. Miscellaneous 13.4.4. Specifying custom filter chains 13.4.5. Examples 13.5. zipfile — Work with ZIP archives 13.5.1. ZipFile Objects 13.5.2. PyZipFile Objects 13.5.3. ZipInfo Objects 13.5.4. Command-Line Interface 13.5.4.1. Command-line options 13.6. tarfile — Read and write tar archive files 13.6.1. TarFile Objects 13.6.2. TarInfo Objects 13.6.3. Command-Line Interface 13.6.3.1. Command-line options 13.6.4. Examples 13.6.5. Supported tar formats 13.6.6. Unicode issues 14. File Formats 14.1. csv — CSV File Reading and Writing 14.1.1. Module Contents 14.1.2. Dialects and Formatting Parameters 14.1.3. Reader Objects 14.1.4. Writer Objects 14.1.5. Examples 14.2. configparser — Configuration file parser 14.2.1. Quick Start 14.2.2. Supported Datatypes 14.2.3. Fallback Values 14.2.4. Supported INI File Structure 14.2.5. Interpolation of values 14.2.6. Mapping Protocol Access 14.2.7. Customizing Parser Behaviour 14.2.8. Legacy API Examples 14.2.9. ConfigParser Objects 14.2.10. RawConfigParser Objects 14.2.11. Exceptions 14.3. netrc — netrc file processing 14.3.1. netrc Objects 14.4. xdrlib — Encode and decode XDR data 14.4.1. Packer Objects 14.4.2. Unpacker Objects 14.4.3. Exceptions 14.5. plistlib — Generate and parse Mac OS X .plist files 14.5.1. Examples 15. Cryptographic Services 15.1. hashlib — Secure hashes and message digests 15.1.1. Hash algorithms 15.1.2. SHAKE variable length digests 15.1.3. Key derivation 15.1.4. BLAKE2 15.1.4.1. Creating hash objects 15.1.4.2. Constants 15.1.4.3. Examples 15.1.4.3.1. Simple hashing 15.1.4.3.2. Using different digest sizes 15.1.4.3.3. Keyed hashing 15.1.4.3.4. Randomized hashing 15.1.4.3.5. Personalization 15.1.4.3.6. Tree mode 15.1.4.4. Credits 15.2. hmac — Keyed-Hashing for Message Authentication 15.3. secrets — Generate secure random numbers for managing secrets 15.3.1. Random numbers 15.3.2. Generating tokens 15.3.2.1. How many bytes should tokens use? 15.3.3. Other functions 15.3.4. Recipes and best practices 16. Generic Operating System Services 16.1. os — Miscellaneous operating system interfaces 16.1.1. File Names, Command Line Arguments, and Environment Variables 16.1.2. Process Parameters 16.1.3. File Object Creation 16.1.4. File Descriptor Operations 16.1.4.1. Querying the size of a terminal 16.1.4.2. Inheritance of File Descriptors 16.1.5. Files and Directories 16.1.5.1. Linux extended attributes 16.1.6. Process Management 16.1.7. Interface to the scheduler 16.1.8. Miscellaneous System Information 16.1.9. Random numbers 16.2. io — Core tools for working with streams 16.2.1. Overview 16.2.1.1. Text I/O 16.2.1.2. Binary I/O 16.2.1.3. Raw I/O 16.2.2. High-level Module Interface 16.2.2.1. In-memory streams 16.2.3. Class hierarchy 16.2.3.1. I/O Base Classes 16.2.3.2. Raw File I/O 16.2.3.3. Buffered Streams 16.2.3.4. Text I/O 16.2.4. Performance 16.2.4.1. Binary I/O 16.2.4.2. Text I/O 16.2.4.3. Multi-threading 16.2.4.4. Reentrancy 16.3. time — Time access and conversions 16.3.1. Functions 16.3.2. Clock ID Constants 16.3.3. Timezone Constants 16.4. argparse — Parser for command-line options, arguments and sub-commands 16.4.1. Example 16.4.1.1. Creating a parser 16.4.1.2. Adding arguments 16.4.1.3. Parsing arguments 16.4.2. ArgumentParser objects 16.4.2.1. prog 16.4.2.2. usage 16.4.2.3. description 16.4.2.4. epilog 16.4.2.5. parents 16.4.2.6. formatter_class 16.4.2.7. prefix_chars 16.4.2.8. fromfile_prefix_chars 16.4.2.9. argument_default 16.4.2.10. allow_abbrev 16.4.2.11. conflict_handler 16.4.2.12. add_help 16.4.3. The add_argument() method 16.4.3.1. name or flags 16.4.3.2. action 16.4.3.3. nargs 16.4.3.4. const 16.4.3.5. default 16.4.3.6. type 16.4.3.7. choices 16.4.3.8. required 16.4.3.9. help 16.4.3.10. metavar 16.4.3.11. dest 16.4.3.12. Action classes 16.4.4. The parse_args() method 16.4.4.1. Option value syntax 16.4.4.2. Invalid arguments 16.4.4.3. Arguments containing - 16.4.4.4. Argument abbreviations (prefix matching) 16.4.4.5. Beyond sys.argv 16.4.4.6. The Namespace object 16.4.5. Other utilities 16.4.5.1. Sub-commands 16.4.5.2. FileType objects 16.4.5.3. Argument groups 16.4.5.4. Mutual exclusion 16.4.5.5. Parser defaults 16.4.5.6. Printing help 16.4.5.7. Partial parsing 16.4.5.8. Customizing file parsing 16.4.5.9. Exiting methods 16.4.6. Upgrading optparse code 16.5. getopt — C-style parser for command line options 16.6. logging — Logging facility for Python 16.6.1. Logger Objects 16.6.2. Logging Levels 16.6.3. Handler Objects 16.6.4. Formatter Objects 16.6.5. Filter Objects 16.6.6. LogRecord Objects 16.6.7. LogRecord attributes 16.6.8. LoggerAdapter Objects 16.6.9. Thread Safety 16.6.10. Module-Level Functions 16.6.11. Module-Level Attributes 16.6.12. Integration with the warnings module 16.7. logging.config — Logging configuration 16.7.1. Configuration functions 16.7.2. Configuration dictionary schema 16.7.2.1. Dictionary Schema Details 16.7.2.2. Incremental Configuration 16.7.2.3. Object connections 16.7.2.4. User-defined objects 16.7.2.5. Access to external objects 16.7.2.6. Access to internal objects 16.7.2.7. Import resolution and custom importers 16.7.3. Configuration file format 16.8. logging.handlers — Logging handlers 16.8.1. StreamHandler 16.8.2. FileHandler 16.8.3. NullHandler 16.8.4. WatchedFileHandler 16.8.5. BaseRotatingHandler 16.8.6. RotatingFileHandler 16.8.7. TimedRotatingFileHandler 16.8.8. SocketHandler 16.8.9. DatagramHandler 16.8.10. SysLogHandler 16.8.11. NTEventLogHandler 16.8.12. SMTPHandler 16.8.13. MemoryHandler 16.8.14. HTTPHandler 16.8.15. QueueHandler 16.8.16. QueueListener 16.9. getpass — Portable password input 16.10. curses — Terminal handling for character-cell displays 16.10.1. Functions 16.10.2. Window Objects 16.10.3. Constants 16.11. curses.textpad — Text input widget for curses programs 16.11.1. Textbox objects 16.12. curses.ascii — Utilities for ASCII characters 16.13. curses.panel — A panel stack extension for curses 16.13.1. Functions 16.13.2. Panel Objects 16.14. platform — Access to underlying platform’s identifying data 16.14.1. Cross Platform 16.14.2. Java Platform 16.14.3. Windows Platform 16.14.3.1. Win95/98 specific 16.14.4. Mac OS Platform 16.14.5. Unix Platforms 16.15. errno — Standard errno system symbols 16.16. ctypes — A foreign function library for Python 16.16.1. ctypes tutorial 16.16.1.1. Loading dynamic link libraries 16.16.1.2. Accessing functions from loaded dlls 16.16.1.3. Calling functions 16.16.1.4. Fundamental data types 16.16.1.5. Calling functions, continued 16.16.1.6. Calling functions with your own custom data types 16.16.1.7. Specifying the required argument types (function prototypes) 16.16.1.8. Return types 16.16.1.9. Passing pointers (or: passing parameters by reference) 16.16.1.10. Structures and unions 16.16.1.11. Structure/union alignment and byte order 16.16.1.12. Bit fields in structures and unions 16.16.1.13. Arrays 16.16.1.14. Pointers 16.16.1.15. Type conversions 16.16.1.16. Incomplete Types 16.16.1.17. Callback functions 16.16.1.18. Accessing values exported from dlls 16.16.1.19. Surprises 16.16.1.20. Variable-sized data types 16.16.2. ctypes reference 16.16.2.1. Finding shared libraries 16.16.2.2. Loading shared libraries 16.16.2.3. Foreign functions 16.16.2.4. Function prototypes 16.16.2.5. Utility functions 16.16.2.6. Data types 16.16.2.7. Fundamental data types 16.16.2.8. Structured data types 16.16.2.9. Arrays and pointers 17. Concurrent Execution 17.1. threading — Thread-based parallelism 17.1.1. Thread-Local Data 17.1.2. Thread Objects 17.1.3. Lock Objects 17.1.4. RLock Objects 17.1.5. Condition Objects 17.1.6. Semaphore Objects 17.1.6.1. Semaphore Example 17.1.7. Event Objects 17.1.8. Timer Objects 17.1.9. Barrier Objects 17.1.10. Using locks, conditions, and semaphores in the with statement 17.2. multiprocessing — Process-based parallelism 17.2.1. Introduction 17.2.1.1. The Process class 17.2.1.2. Contexts and start methods 17.2.1.3. Exchanging objects between processes 17.2.1.4. Synchronization between processes 17.2.1.5. Sharing state between processes 17.2.1.6. Using a pool of workers 17.2.2. Reference 17.2.2.1. Process and exceptions 17.2.2.2. Pipes and Queues 17.2.2.3. Miscellaneous 17.2.2.4. Connection Objects 17.2.2.5. Synchronization primitives 17.2.2.6. Shared ctypes Objects 17.2.2.6.1. The multiprocessing.sharedctypes module 17.2.2.7. Managers 17.2.2.7.1. Customized managers 17.2.2.7.2. Using a remote manager 17.2.2.8. Proxy Objects 17.2.2.8.1. Cleanup 17.2.2.9. Process Pools 17.2.2.10. Listeners and Clients 17.2.2.10.1. Address Formats 17.2.2.11. Authentication keys 17.2.2.12. Logging 17.2.2.13. The multiprocessing.dummy module 17.2.3. Programming guidelines 17.2.3.1. All start methods 17.2.3.2. The spawn and forkserver start methods 17.2.4. Examples 17.3. The concurrent package 17.4. concurrent.futures — Launching parallel tasks 17.4.1. Executor Objects 17.4.2. ThreadPoolExecutor 17.4.2.1. ThreadPoolExecutor Example 17.4.3. ProcessPoolExecutor 17.4.3.1. ProcessPoolExecutor Example 17.4.4. Future Objects 17.4.5. Module Functions 17.4.6. Exception classes 17.5. subprocess — Subprocess management 17.5.1. Using the subprocess Module 17.5.1.1. Frequently Used Arguments 17.5.1.2. Popen Constructor 17.5.1.3. Exceptions 17.5.2. Security Considerations 17.5.3. Popen Objects 17.5.4. Windows Popen Helpers 17.5.4.1. Constants 17.5.5. Older high-level API 17.5.6. Replacing Older Functions with the subprocess Module 17.5.6.1. Replacing /bin/sh shell backquote 17.5.6.2. Replacing shell pipeline 17.5.6.3. Replacing os.system() 17.5.6.4. Replacing the os.spawn family 17.5.6.5. Replacing os.popen(), os.popen2(), os.popen3() 17.5.6.6. Replacing functions from the popen2 module 17.5.7. Legacy Shell Invocation Functions 17.5.8. Notes 17.5.8.1. Converting an argument sequence to a string on Windows 17.6. sched — Event scheduler 17.6.1. Scheduler Objects 17.7. queue — A synchronized queue class 17.7.1. Queue Objects 17.8. dummy_threading — Drop-in replacement for the threading module 17.9. _thread — Low-level threading API 17.10. _dummy_thread — Drop-in replacement for the _thread module 18. Interprocess Communication and Networking 18.1. socket — Low-level networking interface 18.1.1. Socket families 18.1.2. Module contents 18.1.2.1. Exceptions 18.1.2.2. Constants 18.1.2.3. Functions 18.1.2.3.1. Creating sockets 18.1.2.3.2. Other functions 18.1.3. Socket Objects 18.1.4. Notes on socket timeouts 18.1.4.1. Timeouts and the connect method 18.1.4.2. Timeouts and the accept method 18.1.5. Example 18.2. ssl — TLS/SSL wrapper for socket objects 18.2.1. Functions, Constants, and Exceptions 18.2.1.1. Socket creation 18.2.1.2. Context creation 18.2.1.3. Random generation 18.2.1.4. Certificate handling 18.2.1.5. Constants 18.2.2. SSL Sockets 18.2.3. SSL Contexts 18.2.4. Certificates 18.2.4.1. Certificate chains 18.2.4.2. CA certificates 18.2.4.3. Combined key and certificate 18.2.4.4. Self-signed certificates 18.2.5. Examples 18.2.5.1. Testing for SSL support 18.2.5.2. Client-side operation 18.2.5.3. Server-side operation 18.2.6. Notes on non-blocking sockets 18.2.7. Memory BIO Support 18.2.8. SSL session 18.2.9. Security considerations 18.2.9.1. Best defaults 18.2.9.2. Manual settings 18.2.9.2.1. Verifying certificates 18.2.9.2.2. Protocol versions 18.2.9.2.3. Cipher selection 18.2.9.3. Multi-processing 18.2.10. LibreSSL support 18.3. select — Waiting for I/O completion 18.3.1. /dev/poll Polling Objects 18.3.2. Edge and Level Trigger Polling (epoll) Objects 18.3.3. Polling Objects 18.3.4. Kqueue Objects 18.3.5. Kevent Objects 18.4. selectors — High-level I/O multiplexing 18.4.1. Introduction 18.4.2. Classes 18.4.3. Examples 18.5. asyncio — Asynchronous I/O, event loop, coroutines and tasks 18.5.1. Base Event Loop 18.5.1.1. Run an event loop 18.5.1.2. Calls 18.5.1.3. Delayed calls 18.5.1.4. Futures 18.5.1.5. Tasks 18.5.1.6. Creating connections 18.5.1.7. Creating listening connections 18.5.1.8. Watch file descriptors 18.5.1.9. Low-level socket operations 18.5.1.10. Resolve host name 18.5.1.11. Connect pipes 18.5.1.12. UNIX signals 18.5.1.13. Executor 18.5.1.14. Error Handling API 18.5.1.15. Debug mode 18.5.1.16. Server 18.5.1.17. Handle 18.5.1.18. Event loop examples 18.5.1.18.1. Hello World with call_soon() 18.5.1.18.2. Display the current date with call_later() 18.5.1.18.3. Watch a file descriptor for read events 18.5.1.18.4. Set signal handlers for SIGINT and SIGTERM 18.5.2. Event loops 18.5.2.1. Event loop functions 18.5.2.2. Available event loops 18.5.2.3. Platform support 18.5.2.3.1. Windows 18.5.2.3.2. Mac OS X 18.5.2.4. Event loop policies and the default policy 18.5.2.5. Event loop policy interface 18.5.2.6. Access to the global loop policy 18.5.2.7. Customizing the event loop policy 18.5.3. Tasks and coroutines 18.5.3.1. Coroutines 18.5.3.1.1. Example: Hello World coroutine 18.5.3.1.2. Example: Coroutine displaying the current date 18.5.3.1.3. Example: Chain coroutines 18.5.3.2. InvalidStateError 18.5.3.3. TimeoutError 18.5.3.4. Future 18.5.3.4.1. Example: Future with run_until_complete() 18.5.3.4.2. Example: Future with run_forever() 18.5.3.5. Task 18.5.3.5.1. Example: Parallel execution of tasks 18.5.3.6. Task functions 18.5.4. Transports and protocols (callback based API) 18.5.4.1. Transports 18.5.4.1.1. BaseTransport 18.5.4.1.2. ReadTransport 18.5.4.1.3. WriteTransport 18.5.4.1.4. DatagramTransport 18.5.4.1.5. BaseSubprocessTransport 18.5.4.2. Protocols 18.5.4.2.1. Protocol classes 18.5.4.2.2. Connection callbacks 18.5.4.2.3. Streaming protocols 18.5.4.2.4. Datagram protocols 18.5.4.2.5. Flow control callbacks 18.5.4.2.6. Coroutines and protocols 18.5.4.3. Protocol examples 18.5.4.3.1. TCP echo client protocol 18.5.4.3.2. TCP echo server protocol 18.5.4.3.3. UDP echo client protocol 18.5.4.3.4. UDP echo server protocol 18.5.4.3.5. Register an open socket to wait for data using a protocol 18.5.5. Streams (coroutine based API) 18.5.5.1. Stream functions 18.5.5.2. StreamReader 18.5.5.3. StreamWriter 18.5.5.4. StreamReaderProtocol 18.5.5.5. IncompleteReadError 18.5.5.6. LimitOverrunError 18.5.5.7. Stream examples 18.5.5.7.1. TCP echo client using streams 18.5.5.7.2. TCP echo server using streams 18.5.5.7.3. Get HTTP headers 18.5.5.7.4. Register an open socket to wait for data using streams 18.5.6. Subprocess 18.5.6.1. Windows event loop 18.5.6.2. Create a subprocess: high-level API using Process 18.5.6.3. Create a subprocess: low-level API using subprocess.Popen 18.5.6.4. Constants 18.5.6.5. Process 18.5.6.6. Subprocess and threads 18.5.6.7. Subprocess examples 18.5.6.7.1. Subprocess using transport and protocol 18.5.6.7.2. Subprocess using streams 18.5.7. Synchronization primitives 18.5.7.1. Locks 18.5.7.1.1. Lock 18.5.7.1.2. Event 18.5.7.1.3. Condition 18.5.7.2. Semaphores 18.5.7.2.1. Semaphore 18.5.7.2.2. BoundedSemaphore 18.5.8. Queues 18.5.8.1. Queue 18.5.8.2. PriorityQueue 18.5.8.3. LifoQueue 18.5.8.3.1. Exceptions 18.5.9. Develop with asyncio 18.5.9.1. Debug mode of asyncio 18.5.9.2. Cancellation 18.5.9.3. Concurrency and multithreading 18.5.9.4. Handle blocking functions correctly 18.5.9.5. Logging 18.5.9.6. Detect coroutine objects never scheduled 18.5.9.7. Detect exceptions never consumed 18.5.9.8. Chain coroutines correctly 18.5.9.9. Pending task destroyed 18.5.9.10. Close transports and event loops 18.6. asyncore — Asynchronous socket handler 18.6.1. asyncore Example basic HTTP client 18.6.2. asyncore Example basic echo server 18.7. asynchat — Asynchronous socket command/response handler 18.7.1. asynchat Example 18.8. signal — Set handlers for asynchronous events 18.8.1. General rules 18.8.1.1. Execution of Python signal handlers 18.8.1.2. Signals and threads 18.8.2. Module contents 18.8.3. Example 18.9. mmap — Memory-mapped file support 19. Internet Data Handling 19.1. email — An email and MIME handling package 19.1.1. email.message: Representing an email message 19.1.2. email.parser: Parsing email messages 19.1.2.1. FeedParser API 19.1.2.2. Parser API 19.1.2.3. Additional notes 19.1.3. email.generator: Generating MIME documents 19.1.4. email.policy: Policy Objects 19.1.5. email.errors: Exception and Defect classes 19.1.6. email.headerregistry: Custom Header Objects 19.1.7. email.contentmanager: Managing MIME Content 19.1.7.1. Content Manager Instances 19.1.8. email: Examples 19.1.9. email.message.Message: Representing an email message using the compat32 API 19.1.10. email.mime: Creating email and MIME objects from scratch 19.1.11. email.header: Internationalized headers 19.1.12. email.charset: Representing character sets 19.1.13. email.encoders: Encoders 19.1.14. email.utils: Miscellaneous utilities 19.1.15. email.iterators: Iterators 19.2. json — JSON encoder and decoder 19.2.1. Basic Usage 19.2.2. Encoders and Decoders 19.2.3. Exceptions 19.2.4. Standard Compliance and Interoperability 19.2.4.1. Character Encodings 19.2.4.2. Infinite and NaN Number Values 19.2.4.3. Repeated Names Within an Object 19.2.4.4. Top-level Non-Object, Non-Array Values 19.2.4.5. Implementation Limitations 19.2.5. Command Line Interface 19.2.5.1. Command line options 19.3. mailcap — Mailcap file handling 19.4. mailbox — Manipulate mailboxes in various formats 19.4.1. Mailbox objects 19.4.1.1. Maildir 19.4.1.2. mbox 19.4.1.3. MH 19.4.1.4. Babyl 19.4.1.5. MMDF 19.4.2. Message objects 19.4.2.1. MaildirMessage 19.4.2.2. mboxMessage 19.4.2.3. MHMessage 19.4.2.4. BabylMessage 19.4.2.5. MMDFMessage 19.4.3. Exceptions 19.4.4. Examples 19.5. mimetypes — Map filenames to MIME types 19.5.1. MimeTypes Objects 19.6. base64 — Base16, Base32, Base64, Base85 Data Encodings 19.7. binhex — Encode and decode binhex4 files 19.7.1. Notes 19.8. binascii — Convert between binary and ASCII 19.9. quopri — Encode and decode MIME quoted-printable data 19.10. uu — Encode and decode uuencode files 20. Structured Markup Processing Tools 20.1. html — HyperText Markup Language support 20.2. html.parser — Simple HTML and XHTML parser 20.2.1. Example HTML Parser Application 20.2.2. HTMLParser Methods 20.2.3. Examples 20.3. html.entities — Definitions of HTML general entities 20.4. XML Processing Modules 20.4.1. XML vulnerabilities 20.4.2. The defusedxml and defusedexpat Packages 20.5. xml.etree.ElementTree — The ElementTree XML API 20.5.1. Tutorial 20.5.1.1. XML tree and elements 20.5.1.2. Parsing XML 20.5.1.3. Pull API for non-blocking parsing 20.5.1.4. Finding interesting elements 20.5.1.5. Modifying an XML File 20.5.1.6. Building XML documents 20.5.1.7. Parsing XML with Namespaces 20.5.1.8. Additional resources 20.5.2. XPath support 20.5.2.1. Example 20.5.2.2. Supported XPath syntax 20.5.3. Reference 20.5.3.1. Functions 20.5.3.2. Element Objects 20.5.3.3. ElementTree Objects 20.5.3.4. QName Objects 20.5.3.5. TreeBuilder Objects 20.5.3.6. XMLParser Objects 20.5.3.7. XMLPullParser Objects 20.5.3.8. Exceptions 20.6. xml.dom — The Document Object Model API 20.6.1. Module Contents 20.6.2. Objects in the DOM 20.6.2.1. DOMImplementation Objects 20.6.2.2. Node Objects 20.6.2.3. NodeList Objects 20.6.2.4. DocumentType Objects 20.6.2.5. Document Objects 20.6.2.6. Element Objects 20.6.2.7. Attr Objects 20.6.2.8. NamedNodeMap Objects 20.6.2.9. Comment Objects 20.6.2.10. Text and CDATASection Objects 20.6.2.11. ProcessingInstruction Objects 20.6.2.12. Exceptions 20.6.3. Conformance 20.6.3.1. Type Mapping 20.6.3.2. Accessor Methods 20.7. xml.dom.minidom — Minimal DOM implementation 20.7.1. DOM Objects 20.7.2. DOM Example 20.7.3. minidom and the DOM standard 20.8. xml.dom.pulldom — Support for building partial DOM trees 20.8.1. DOMEventStream Objects 20.9. xml.sax — Support for SAX2 parsers 20.9.1. SAXException Objects 20.10. xml.sax.handler — Base classes for SAX handlers 20.10.1. ContentHandler Objects 20.10.2. DTDHandler Objects 20.10.3. EntityResolver Objects 20.10.4. ErrorHandler Objects 20.11. xml.sax.saxutils — SAX Utilities 20.12. xml.sax.xmlreader — Interface for XML parsers 20.12.1. XMLReader Objects 20.12.2. IncrementalParser Objects 20.12.3. Locator Objects 20.12.4. InputSource Objects 20.12.5. The Attributes Interface 20.12.6. The AttributesNS Interface 20.13. xml.parsers.expat — Fast XML parsing using Expat 20.13.1. XMLParser Objects 20.13.2. ExpatError Exceptions 20.13.3. Example 20.13.4. Content Model Descriptions 20.13.5. Expat error constants 21. Internet Protocols and Support 21.1. webbrowser — Convenient Web-browser controller 21.1.1. Browser Controller Objects 21.2. cgi — Common Gateway Interface support 21.2.1. Introduction 21.2.2. Using the cgi module 21.2.3. Higher Level Interface 21.2.4. Functions 21.2.5. Caring about security 21.2.6. Installing your CGI script on a Unix system 21.2.7. Testing your CGI script 21.2.8. Debugging CGI scripts 21.2.9. Common problems and solutions 21.3. cgitb — Traceback manager for CGI scripts 21.4. wsgiref — WSGI Utilities and Reference Implementation 21.4.1. wsgiref.util – WSGI environment utilities 21.4.2. wsgiref.headers – WSGI response header tools 21.4.3. wsgiref.simple_server – a simple WSGI HTTP server 21.4.4. wsgiref.validate — WSGI conformance checker 21.4.5. wsgiref.handlers – server/gateway base classes 21.4.6. Examples 21.5. urllib — URL handling modules 21.6. urllib.request — Extensible library for opening URLs 21.6.1. Request Objects 21.6.2. OpenerDirector Objects 21.6.3. BaseHandler Objects 21.6.4. HTTPRedirectHandler Objects 21.6.5. HTTPCookieProcessor Objects 21.6.6. ProxyHandler Objects 21.6.7. HTTPPasswordMgr Objects 21.6.8. HTTPPasswordMgrWithPriorAuth Objects 21.6.9. AbstractBasicAuthHandler Objects 21.6.10. HTTPBasicAuthHandler Objects 21.6.11. ProxyBasicAuthHandler Objects 21.6.12. AbstractDigestAuthHandler Objects 21.6.13. HTTPDigestAuthHandler Objects 21.6.14. ProxyDigestAuthHandler Objects 21.6.15. HTTPHandler Objects 21.6.16. HTTPSHandler Objects 21.6.17. FileHandler Objects 21.6.18. DataHandler Objects 21.6.19. FTPHandler Objects 21.6.20. CacheFTPHandler Objects 21.6.21. UnknownHandler Objects 21.6.22. HTTPErrorProcessor Objects 21.6.23. Examples 21.6.24. Legacy interface 21.6.25. urllib.request Restrictions 21.7. urllib.response — Response classes used by urllib 21.8. urllib.parse — Parse URLs into components 21.8.1. URL Parsing 21.8.2. Parsing ASCII Encoded Bytes 21.8.3. Structured Parse Results 21.8.4. URL Quoting 21.9. urllib.error — Exception classes raised by urllib.request 21.10. urllib.robotparser — Parser for robots.txt 21.11. http — HTTP modules 21.11.1. HTTP status codes 21.12. http.client — HTTP protocol client 21.12.1. HTTPConnection Objects 21.12.2. HTTPResponse Objects 21.12.3. Examples 21.12.4. HTTPMessage Objects 21.13. ftplib — FTP protocol client 21.13.1. FTP Objects 21.13.2. FTP_TLS Objects 21.14. poplib — POP3 protocol client 21.14.1. POP3 Objects 21.14.2. POP3 Example 21.15. imaplib — IMAP4 protocol client 21.15.1. IMAP4 Objects 21.15.2. IMAP4 Example 21.16. nntplib — NNTP protocol client 21.16.1. NNTP Objects 21.16.1.1. Attributes 21.16.1.2. Methods 21.16.2. Utility functions 21.17. smtplib — SMTP protocol client 21.17.1. SMTP Objects 21.17.2. SMTP Example 21.18. smtpd — SMTP Server 21.18.1. SMTPServer Objects 21.18.2. DebuggingServer Objects 21.18.3. PureProxy Objects 21.18.4. MailmanProxy Objects 21.18.5. SMTPChannel Objects 21.19. telnetlib — Telnet client 21.19.1. Telnet Objects 21.19.2. Telnet Example 21.20. uuid — UUID objects according to RFC 4122 21.20.1. Example 21.21. socketserver — A framework for network servers 21.21.1. Server Creation Notes 21.21.2. Server Objects 21.21.3. Request Handler Objects 21.21.4. Examples 21.21.4.1. socketserver.TCPServer Example 21.21.4.2. socketserver.UDPServer Example 21.21.4.3. Asynchronous Mixins 21.22. http.server — HTTP servers 21.23. http.cookies — HTTP state management 21.23.1. Cookie Objects 21.23.2. Morsel Objects 21.23.3. Example 21.24. http.cookiejar — Cookie handling for HTTP clients 21.24.1. CookieJar and FileCookieJar Objects 21.24.2. FileCookieJar subclasses and co-operation with web browsers 21.24.3. CookiePolicy Objects 21.24.4. DefaultCookiePolicy Objects 21.24.5. Cookie Objec
Complete Digital Design - A Comprehensive Guide to Digital Electronics and Computer System Architecture PART 1 Digital Fundamentals Chapter 1 Digital Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 1.1 Boolean Logic / 3 1.2 Boolean Manipulation / 7 1.3 The Karnaugh map / 8 1.4 Binary and Hexadecimal Numbering / 10 1.5 Binary Addition / 14 1.6 Subtraction and Negative Numbers / 15 1.7 Multiplication and Division / 17 1.8 Flip-Flops and Latches / 18 1.9 Synchronous Logic / 21 1.10 Synchronous Timing Analysis / 23 1.11 Clock Skew / 25 1.12 Clock Jitter / 27 1.13 Derived Logical Building Blocks / 28 Chapter 2 Integrated Circuits and the 7400 Logic Families. . . . . . . . . . . . . . . . . . . . .33 2.1 The Integrated Circuit / 33 2.2 IC Packaging / 38 2.3 The 7400-Series Discrete Logic Family / 41 2.4 Applying the 7400 Family to Logic Design / 43 2.5 Synchronous Logic Design with the 7400 Family / 45 2.6 Common Variants of the 7400 Family / 50 2.7 Interpreting a Digital IC Data Sheet / 51 Chapter 3 Basic Computer Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 3.1 The Digital Computer / 56 3.2 Microprocessor Internals / 58 3.3 Subroutines and the Stack / 60 3.4 Reset and Interrupts / 62 3.5 Implementation of an Eight-Bit Computer / 63 3.6 Address Banking / 67 3.7 Direct Memory Access / 68 3.8 Extending the Microprocessor Bus / 70 3.9 Assembly Language and Addressing Modes / 72 Chapter 4 Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 4.1 Memory Classifications / 77 4.2 EPROM / 79 4.3 Flash Memory / 81 4.4 EEPROM / 85 4.5 Asynchronous SRAM / 86 4.6 Asynchronous DRAM / 88 4.7 Multiport Memory / 92 4.8 The FIFO / 94 Chapter 5 Serial Communications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 5.1 Serial vs. Parallel Communication / 98 5.2 The UART / 99 5.3 ASCII Data Representation / 102 5.4 RS-232 / 102 5.5 RS-422 / 107 5.6 Modems and Baud Rate / 108 5.7 Network Topologies / 109 5.8 Network Data Formats / 110 5.9 RS-485 / 112 5.10 A Simple RS-485 Network / 114 5.11 Interchip Serial Communications / 117 Chapter 6 Instructive Microprocessors and Microcomputer Elements . . . . . . . . . .121 6.1 Evolution / 121 6.2 Motorola 6800 Eight-bit Microprocessor Family / 122 6.3 Intel 8051 Microcontroller Family / 125 6.4 Microchip PIC® Microcontroller Family / 131 6.5 Intel 8086 16-Bit Microprocessor Family / 134 6.6 Motorola 68000 16/32-Bit Microprocessor Family / 139 PART 2 Advanced Digital Systems Chapter 7 Advanced Microprocessor Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 7.1 RISC and CISC / 145 7.2 Cache Structures / 149 7.3 Caches in Practice / 154 7.4 Virtual Memory and the MMU / 158 7.5 Superpipelined and Superscalar Architectures / 161 7.6 Floating-Point Arithmetic / 165 7.7 Digital Signal Processors / 167 7.8 Performance Metrics / 169 Chapter 8 High-Performance Memory Technologies. . . . . . . . . . . . . . . . . . . . . . . . .173 8.1 Synchronous DRAM / 173 8.2 Double Data Rate SDRAM / 179 8.3 Synchronous SRAM / 182 8.4 DDR and QDR SRAM / 185 8.5 Content Addressable Memory / 188 Chapter 9 Networking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193 9.1 Protocol Layers One and Two / 193 9.2 Protocol Layers Three and Four / 194 9.3 Physical Media / 197 9.4 Channel Coding / 198 9.5 8B10B Coding / 203 9.6 Error Detection / 207 9.7 Checksum / 208 9.8 Cyclic Redundancy Check / 209 9.9 Ethernet / 215 Chapter 10 Logic Design and Finite State Machines . . . . . . . . . . . . . . . . . . . . . . . . .221 10.1 Hardware Description Languages / 221 10.2 CPU Support Logic / 227 10.3 Clock Domain Crossing / 233 10.4 Finite State Machines / 237 10.5 FSM Bus Control / 239 10.6 FSM Optimization / 243 10.7 Pipelining / 245 Chapter 11 Programmable Logic Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249 11.1 Custom and Programmable Logic / 249 11.2 GALs and PALs / 252 11.3 CPLDs / 255 11.4 FPGAs / 257 PART 3 Analog Basics for Digital Systems Chapter 12 Electrical Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 12.1 Basic Circuits / 267 12.2 Loop and Node Analysis / 268 12.3 Resistance Combination / 271 12.4 Capacitors / 272 12.5 Capacitors as AC Elements / 274 12.6 Inductors / 276 12.7 Nonideal RLC Models / 276 12.8 Frequency Domain Analysis / 279 12.9 Lowpass and Highpass Filters / 283 12.10 Transformers / 288 Chapter 13 Diodes and Transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293 13.1 Diodes / 293 13.2 Power Circuits with Diodes / 296 13.3 Diodes in Digital Applications / 298 13.4 Bipolar Junction Transistors / 300 13.5 Digital Amplification with the BJT / 301 13.6 Logic Functions with the BJT / 304 13.7 Field-Effect Transistors / 306 13.8 Power FETs and JFETs / 309 Chapter 14 Operational Amplifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .311 14.1 The Ideal Op-amp / 311 14.2 Characteristics of Real Op-amps / 316 14.3 Bandwidth Limitations / 324 14.4 Input Resistance / 325 14.5 Summation Amplifier Circuits / 328 14.6 Active Filters / 331 14.7 Comparators and Hysteresis / 333 Chapter 15 Analog Interfaces for Digital Systems . . . . . . . . . . . . . . . . . . . . . . . . . . .339 15.1 Conversion between Analog and Digital Domains / 339 15.2 Sampling Rate and Aliasing / 341 15.3 ADC Circuits / 345 15.4 DAC Circuits / 348 15.5 Filters in Data Conversion Systems / 350 PART 4 Digital System Design in Practice Chapter 16 Clock Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .355 16.1 Crystal Oscillators and Ceramic Resonators / 355 16.2 Low-Skew Clock Buffers / 357 16.3 Zero-Delay Buffers: The PLL / 360 16.4 Frequency Synthesis / 364 16.5 Delay-Locked Loops / 366 16.6 Source-Synchronous Clocking / 367 Chapter 17 Voltage Regulation and Power Distribution . . . . . . . . . . . . . . . . . . . . . .371 17.1 Voltage Regulation Basics / 372 17.2 Thermal Analysis / 374 17.3 Zener Diodes and Shunt Regulators / 376 17.4 Transistors and Discrete Series Regulators / 379 17.5 Linear Regulators / 382 17.6 Switching Regulators / 386 17.7 Power Distribution / 389 17.8 Electrical Integrity / 392 Chapter 18 Signal Integrity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397 18.1 Transmission Lines / 398 18.2 Termination / 403 18.3 Crosstalk / 408 18.4 Electromagnetic Interference / 410 18.5 Grounding and Electromagnetic Compatibility / 413 18.6 Electrostatic Discharge / 415 Chapter 19 Designing for Success . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .419 19.1 Practical Technologies / 420 19.2 Printed Circuit Boards / 422 19.3 Manually Wired Circuits / 425 19.4 Microprocessor Reset / 428 19.5 Design for Debug / 429 19.6 Boundary Scan / 431 19.7 Diagnostic Software / 433 19.8 Schematic Capture and Spice / 436 19.9 Test Equipment / 440 Appendix A Further Education. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .443 Index 445
1. Introduction to Zend Framework 1.1. 概述 1.2. 安装 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)来编写条件性的 ACL 规则 3. Zend_Auth 3.1. 简介 3.1.1. 适配器 3.1.2. 结果 3.1.3. 身份的持久(Persistence) 3.1.3.1. 在PHP Session 中的缺省持久(Persistence) 3.1.3.2. 实现订制存储 3.1.4. 使用Zend_Auth 3.2. 数据库表认证 3.2.1. 简介 3.2.2. 高级使用:持久一个 DbTable 结果对象 3.2.3. 高级用法示例 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.4.1. 文件 Resolver 3.4.5. 基本用法 4. Zend_Cache 4.1. 简介 4.2. 缓存原理 4.2.1. Zend_Cache 工厂方法 4.2.2. 标记纪录 4.2.3. 缓存清理 4.3. Zend_Cache前端 4.3.1. Zend_Cache_Core 4.3.1.1. 简介 4.3.1.2. 可用选项 4.3.1.3. 例子 4.3.2. Zend_Cache_Frontend_Output 4.3.2.1. 简介 4.3.2.2. 可用的选项 4.3.2.3. 例子 4.3.3. Zend_Cache_Frontend_Function 4.3.3.1. Introduction 4.3.3.2. A可用的选项 4.3.3.3. 例子 4.3.4. Zend_Cache_Frontend_Class 4.3.4.1. Introduction 4.3.4.2. Available options 4.3.4.3. Examples 4.3.5. Zend_Cache_Frontend_File 4.3.5.1. Introduction 4.3.5.2. Available options 4.3.5.3. Examples 4.3.6. Zend_Cache_Frontend_Page 4.3.6.1. Introduction 4.3.6.2. Available options (for this frontend in Zend_Cache factory) 4.3.6.3. Examples 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. 简介 5.2. 操作理论 5.3. Zend_Config_Ini 5.4. Zend_Config_Xml 6. Zend_Console_Getopt 6.1. Getopt 简介 6.2. 声明 Getopt 规则 6.2.1. 用短语法声明选项 6.2.2. 用长语法声明选项 6.3. 读取(Fetching)选项和参数 6.3.1. 操作 Getopt 异常 6.3.2. 通过名字读取 (Fetching)选项 6.3.3. 报告选项 6.3.4. 读取非选项参数 6.4. 配置 Zend_Console_Getopt 6.4.1. 添加选项规则 6.4.2. 添加帮助信息 6.4.3. 添加选项别名 6.4.4. 添加参数列表 6.4.5. 添加配置 7. Zend_Controller 7.1. Zend_Controller 快速入门 7.1.1. 简介 7.1.2. 入门 7.1.2.1. 文件系统的组织结构 7.1.2.2. 设置文件根目录 7.1.2.3. 创建URL重写规则 7.1.2.4. 创建你的bootstrap文件 7.1.2.5. 创建默认的控制器(Action Controller) 7.1.2.6. 创建你的视图脚本 7.1.2.7. 创建你自己的错误控制器 7.1.2.8. 访问站点! 7.2. Zend_Controller 基础 7.3. 前端控制器 7.3.1. 概述 7.3.2. 主要方法 7.3.2.1. getInstance() 7.3.2.2. setControllerDirectory() 和 addControllerDirectory() 7.3.2.3. dispatch() 7.3.2.4. run() 7.3.3. 环境访问器方法 7.3.4. 前端控制器参数 7.3.5. 继承前端控制器 7.4. 请求对象 7.4.1. 介绍 7.4.2. HTTP 请求 7.4.2.1. 访问请求数据 7.4.2.2. 基地址和子目录 7.4.2.3. 决定请求方式 7.4.2.4. 删除 AJAX 请求 7.4.3. 子类化请求对象 7.5. 标准路由器:Zend_Controller_Router_Rewrite 7.5.1. 简介 7.5.2. 使用路由器 7.5.3. 基本的Rewrite路由器操作 7.5.4. 缺省路由 7.5.5. 基本 URL 和子目录 7.5.6. Route Types 7.5.6.1. Zend_Controller_Router_Route 7.5.6.1.1. 变量缺省 7.5.6.1.2. 变量请求 7.5.6.2. Zend_Controller_Router_Route_Static 7.5.6.3. Zend_Controller_Router_Route_Regex 7.5.7. 使用 Zend_Config with the RewriteRouter 7.5.8. Subclassing the Router 7.6. 分发器 7.6.1. 概述 7.6.2. 子类化分发器 7.7. 动作控制器 7.7.1. 简介 7.7.2. 对象初始化 7.7.3. 派遣前后的钩子 7.7.4. 访问器 7.7.5. 视图集成 7.7.5.1. 视图初始化 7.7.5.2. 解析(Rendering)视图 7.7.6. 实用方法 7.7.7. 继承(Subclassing)动作控制器 7.8. 动作助手 7.8.1. 介绍 7.8.2. 初始化助手 7.8.3. 助手经纪人 7.8.4. 内建的动作助手 7.8.4.1. 动作堆栈(助手) 7.8.4.2. AutoComplete 7.8.4.2.1. AutoCompletion with Dojo 7.8.4.2.2. AutoCompletion with Scriptaculous 7.8.4.3. ContextSwitch and AjaxContext 7.8.4.3.1. 缺省可用的上下文 7.8.4.3.2. 创建定制的上下文 7.8.4.3.3. 为每个动作设置上下文 7.8.4.3.4. 初始化上下文开关 7.8.4.3.5. 另外的功能 7.8.4.3.6. AjaxContext 函数 7.8.4.4. FlashMessenger 7.8.4.4.1. 简介 7.8.4.4.2. Basic Usage Example 7.8.4.5. JSON 7.8.4.6. 转向器(Redirector) 7.8.4.6.1. 介绍 7.8.4.6.2. 基础用例 7.8.4.7. ViewRenderer 7.8.4.7.1. 介绍 7.8.4.7.2. API 7.8.4.7.3. 基础用法示例 7.8.4.7.4. 高级用法示例 7.8.5. 编写自己的助手 7.9. 响应对象 7.9.1. 用法 7.9.2. 处理消息头 7.9.3. 命名片段 7.9.4. 在响应对象中测试异常 7.9.5. 子类化响应对象 7.10. 插件 7.10.1. 简介 7.10.2. 编写插件 7.10.3. 使用插件 7.10.4. 获取和控制插件 7.10.5. 包含在标准发行包中的插件 7.10.5.1. 动作堆栈 7.10.5.2. Zend_Controller_Plugin_ErrorHandler 7.10.5.2.1. 使用 ErrorHandler 作为一个 404 处理器(handler) 7.10.5.2.2. 处理以前呈现的(rendered)输出 7.10.5.2.3. 插件用法示例 7.10.5.2.4. 错误控制器示例 7.11. 使用传统的模块目录结构 7.11.1. 简介 7.11.2. 指定模块控制器目录 7.11.3. Routing to modules 7.11.4. 模块或全局缺省控制器 7.12. MVC 异常 7.12.1. 介绍 7.12.2. 如何处理异常? 7.12.3. 可能遭遇的MVC异常 7.13. 从以前的版本移植 7.13.1. 从 1.0.x 到 1.5.0 或更新的版本的移植 7.13.2. 从 0.9.3 到 1.0.0RC1 或更新的版本的移植 7.13.3. 从 0.9.2 移植到 0.9.3 或更新的版本 7.13.4. 从 0.6.0 移植到 0.8.0 或更新的版本 7.13.5. 从 0.2.0 或以前的版本移植到 0.6.0 8. Zend_Currency 8.1. Zend_Currency 简介 8.1.1. 为什么使用 Zend_Currency ? 8.2. 如何使用货币 8.2.1. 从货币创建输出 8.2.2. 修改货币格式 8.2.3. Zend_Currency 的信息方法 8.2.4. 设置新缺省值 8.2.5. 加速 Zend_Currency 8.3. 从前面的版本迁移 8.3.1. 从 1.0.2 到 1.0.3 或更新的迁移 9. Zend_Date 9.1. Introduction 9.1.1. Always Set a Default Timezone 9.1.2. Why Use Zend_Date? 9.2. 操作理论 9.2.1. 内部(Internals) 9.3. Basic Methods 9.3.1. The current date 9.3.2. Zend_Date by Example 9.3.2.1. Ouput a Date 9.3.2.2. Setting a Date 9.3.2.3. Adding and Subtracting Dates 9.3.2.4. Comparation of dates 9.4. Zend_Date API Overview 9.4.1. Zend_Date Options 9.4.1.1. Selecting the date format type 9.4.1.2. DST and Date Math 9.4.1.3. Month Calculations 9.4.1.4. Speed up date localization and normalization with Zend_Cache 9.4.1.5. Receiving syncronised timestamps with Zend_TimeSync 9.4.2. Working with Date Values 9.4.3. Basic Zend_Date Operations Common to Many Date Parts 9.4.3.1. List of Date Parts 9.4.3.2. List of Date Operations 9.4.4. Comparing Dates 9.4.5. Getting Dates and Date Parts 9.4.6. Working with Fractions of Seconds 9.4.7. Sunrise / Sunset 9.5. Creation of dates 9.5.1. Create the actual date 9.5.2. Create a date from database 9.5.3. Create dates from an array 9.6. Constants for General Date Functions 9.6.1. Using Constants 9.6.2. List of All Constants 9.6.3. Self-Defined OUTPUT Formats with ISO 9.6.4. Self-defined OUTPUT formats using PHP's date() format specifiers 9.7. Working examples 9.7.1. Checking dates 9.7.2. Sunrise and Sunset 9.7.3. Timezones 10. Zend_Db 10.1. Zend_Db_Adapter 10.1.1. 简介 10.1.2. 添加引号防止数据库攻击 10.1.3. 直接查询 10.1.4. 事务处理 10.1.5. 插入数据行 10.1.6. 更新数据行 10.1.7. 删除数据行 10.1.8. 取回查询结果 10.2. Zend_Db_Statement 10.2.1. Creating a Statement 10.2.2. Executing a Statement 10.2.3. Fetching Results from a SELECT Statement 10.2.3.1. Fetching a Single Row from a Result Set 10.2.3.2. Fetching a Complete Result Set 10.2.3.3. Changing the Fetch Mode 10.2.3.4. Fetching a Single Column from a Result Set 10.2.3.5. Fetching a Row as an Object 10.3. Zend_Db_Profiler 10.3.1. Introduction 10.3.2. Using the Profiler 10.3.3. Advanced Profiler Usage 10.3.3.1. Filter by query elapsed time 10.3.3.2. Filter by query type 10.3.3.3. Retrieve profiles by query type 10.4. Zend_Db_Select 10.4.1. 简介 10.4.2. 同一表中查询多列数据 10.4.3. 多表联合查询 10.4.4. WHERE条件 10.4.5. GROUP BY分句 10.4.6. HAVING 条件 10.4.7. ORDER BY 分句 10.4.8. 通过总数和偏移量进行LIMIT限制 10.4.9. 通过页数和总数进行LIMIT限制 10.5. Zend_Db_Table 10.5.1. 简介 10.5.2. 开始 10.5.3. 表名和主键 10.5.4. 插入数据 10.5.5. 更新数据 10.5.6. Deleting Rows 10.5.7. 根据主键查找数据 10.5.8. 取回一条记录 10.5.9. 取回多条记录 10.5.10. Adding Domain Logic 10.6. Zend_Db_Table_Row 10.6.1. 简介 10.6.2. 取回一条记录 10.6.3. 修改数据 10.7. Zend_Db_Table_Rowset 10.7.1. 简介 10.7.2. 取回结果集 10.7.3. 遍历结果集 10.8. Zend_Db_Table Relationships 10.8.1. Introduction 10.8.2. Defining Relationships 10.8.3. Fetching a Dependent Rowset 10.8.4. Fetching a Parent Row 10.8.5. Fetching a Rowset via a Many-to-many Relationship 10.8.6. Cascading Write Operations 10.8.6.1. Notes Regarding Cascading Operations 11. Zend_Debug 11.1. 输出变量的值 (Dumping Variables) 12. Zend_Exception 12.1. 使用“异常” 13. Zend_Feed 13.1. 介绍 13.2. 导入Feeds 13.2.1. 定制 feeds 13.2.1.1. 导入定制的数组 13.2.1.2. 导入定制的数据源 13.2.1.3. Dumping feed 内容 13.3. 从网页上获得Feed 13.4. RSS Feed的使用 13.5. Atom Feed的使用 13.6. 单个Atom条目的处理 13.7. 修改Feed和条目结构 13.8. 自定义Feed和条目类 14. Zend_Filter 14.1. 简介 14.1.1. 什么是过滤器(filter)? 14.1.2. 过滤器的基本用法 14.1.3. 使用静态 get() 方法 14.2. 标准过滤器类 14.2.1. Alnum 14.2.2. Alpha 14.2.3. BaseName 14.2.4. Digits 14.2.5. Dir 14.2.6. HtmlEntities 14.2.7. Int 14.2.8. RealPath 14.2.9. StringToLower 14.2.10. StringToUpper 14.2.11. StringTrim 14.2.12. StripTags 14.3. 过滤器链 14.4. 编写过滤器 14.5. Zend_Filter_Input 14.5.1. Declaring Filter and Validator Rules 14.5.2. Creating the Filter and Validator Processor 14.5.3. Retrieving Validated Fields and other Reports 14.5.3.1. Querying if the input is valid 14.5.3.2. Getting Invalid, Missing, or Unknown Fields 14.5.3.3. Getting Valid Fields 14.5.4. Using Metacommands to Control Filter or Validator Rules 14.5.4.1. The FIELDS metacommand 14.5.4.2. The PRESENCE metacommand 14.5.4.3. The DEFAULT_VALUE metacommand 14.5.4.4. The ALLOW_EMPTY metacommand 14.5.4.5. The BREAK_CHAIN metacommand 14.5.4.6. The MESSAGES metacommand 14.5.4.7. Using options to set metacommands for all rules 14.5.5. Adding Filter Class Namespaces 14.6. Zend_Filter_Inflector 14.6.1. Operation 14.6.2. Setting Paths To Alternate Filters 14.6.3. Setting the Inflector Target 14.6.4. Inflection Rules 14.6.4.1. Static Rules 14.6.4.2. Filter Inflector Rules 14.6.4.3. Setting Many Rules At Once 14.6.5. Utility Methods 14.6.6. Using Zend_Config with Zend_Filter_Inflector 15. Zend_Form 15.1. Zend_Form 15.2. Zend_Form 快速起步 15.2.1. 创建表单对象 15.2.2. 添加表单元素 15.2.3. 解析(Render)表单 15.2.4. 检查表单是否有效 15.2.5. 获得错误状态 15.2.6. 放到一起 15.2.7. 使用 Zend_Config 对象 15.2.8. 结论 15.3. 使用 Zend_Form_Element 生成表单元素 15.3.1. 插件加载器 15.3.2. 过滤器 15.3.3. 校验器 15.3.4. 装饰器 15.3.5. 元数据和属性 15.3.6. 标准元素 15.3.7. Zend_Form_Element 方法 15.3.8. 配置 15.3.9. 定制元素 15.4. 使用 Zend_Form 生成表单 15.4.1. 插件加载器 15.4.2. 元素(Elements) 15.4.2.1. 组装和读取数值 15.4.2.2. 全局操作 15.4.2.3. 和元素交互使用的方法 15.4.3. 显示组(Display Groups) 15.4.3.1. 全局操作 15.4.3.2. 使用定制的显示组类 15.4.3.3. 和显示组交互使用的方法 15.4.3.4. Zend_Form_DisplayGroup 方法 15.4.4. 子表单 15.4.4.1. 全局操作 15.4.4.2. 和子表单交互使用的方法 15.4.5. 元数据(Metadata)和属性(Attributes) 15.4.6. 装饰器 15.4.7. 校验 15.4.8. 方法 15.4.9. 配置 15.4.10. 定制表单 15.5. 使用 Zend_Form_Decorator 生成定制的表单标识(Markup) 15.5.1. 操作 15.5.2. 标准装饰器 15.5.3. 定制装饰器 15.6. Zend Framework 带有的标准表单元素 15.6.1. Zend_Form_Element_Button 15.6.2. Zend_Form_Element_Checkbox 15.6.3. Zend_Form_Element_Hidden 15.6.4. Zend_Form_Element_Hash 15.6.5. Zend_Form_Element_Image 15.6.6. Zend_Form_Element_MultiCheckbox 15.6.7. Zend_Form_Element_Multiselect 15.6.8. Zend_Form_Element_Password 15.6.9. Zend_Form_Element_Radio 15.6.10. Zend_Form_Element_Reset 15.6.11. Zend_Form_Element_Select 15.6.12. Zend_Form_Element_Submit 15.6.13. Zend_Form_Element_Text 15.6.14. Zend_Form_Element_Textarea 15.7. Zend Framework 带有的标准表单装饰器(Decorators) 15.7.1. Zend_Form_Decorator_Callback 15.7.2. Zend_Form_Decorator_Description 15.7.3. Zend_Form_Decorator_DtDdWrapper 15.7.4. Zend_Form_Decorator_Errors 15.7.5. Zend_Form_Decorator_Fieldset 15.7.6. Zend_Form_Decorator_Form 15.7.7. Zend_Form_Decorator_FormElements 15.7.8. Zend_Form_Decorator_HtmlTag 15.7.9. Zend_Form_Decorator_Image 15.7.10. Zend_Form_Decorator_Label 15.7.11. Zend_Form_Decorator_ViewHelper 15.7.12. Zend_Form_Decorator_ViewScript 15.8. Zend_Form 的国际化 15.8.1. 在表单中初始化 I18n 15.8.2. 标准 I18N 目标 15.9. Zend_Form 的高级用法 15.9.1. 数组符号(Notation) 15.9.2. 多页表单 16. Zend_Gdata 16.1. Introduction to Gdata 16.1.1. Structure of Zend_Gdata 16.1.2. Interacting with Google Services 16.1.3. Obtaining instances of Zend_Gdata classes 16.1.4. Google Data Client Authentication 16.1.5. Dependencies 16.1.6. Creating a new Gdata client 16.1.7. Common query parameters 16.1.8. Fetching a feed 16.1.9. Working with multi-page feeds 16.1.10. Working with data in feeds and entries 16.1.11. Updating entries 16.1.12. Posting entries to Google servers 16.1.13. Deleting entries on Google servers 16.2. Authenticating with AuthSub 16.2.1. Creating an AuthSub authenticated Http Client 16.2.2. Revoking AuthSub authentication 16.3. Authenticating with ClientLogin 16.3.1. Creating a ClientLogin authenticated Http Client 16.3.2. Terminating a ClientLogin authenticated Http Client 16.4. Using Google Calendar 16.4.1. Connecting To The Calendar Service 16.4.1.1. Authentication 16.4.1.2. Creating A Service Instance 16.4.2. Retrieving A Calendar List 16.4.3. Retrieving Events 16.4.3.1. Queries 16.4.3.2. Retrieving Events In Order Of Start Time 16.4.3.3. Retrieving Events In A Specified Date Range 16.4.3.4. Retrieving Events By Fulltext Query 16.4.3.5. Retrieving Individual Events 16.4.4. Creating Events 16.4.4.1. Creating Single-Occurrence Events 16.4.4.2. Event Schedules and Reminders 16.4.4.3. Creating Recurring Events 16.4.4.4. Using QuickAdd 16.4.5. Modifying Events 16.4.6. Deleting Events 16.4.7. Accessing Event Comments 16.5. Using Google Documents List Data API 16.5.1. Get a List of Documents 16.5.2. Upload a Document 16.5.3. Searching the documents feed 16.5.3.1. Get a List of Word Processing Documents 16.5.3.2. Get a List of Spreadsheets 16.5.3.3. Performing a text query 16.6. Using Google Spreadsheets 16.6.1. Create a Spreadsheet 16.6.2. Get a List of Spreadsheets 16.6.3. Get a List of Worksheets 16.6.4. Interacting With List-based Feeds 16.6.4.1. Get a List-based Feed 16.6.4.2. Reverse-sort Rows 16.6.4.3. Send a Structured Query 16.6.4.4. Add a Row 16.6.4.5. Edit a Row 16.6.4.6. Delete a Row 16.6.5. Interacting With Cell-based Feeds 16.6.5.1. Get a Cell-based Feed 16.6.5.2. Send a Cell Range Query 16.6.5.3. Change Contents of a Cell 16.7. Using Google Apps Provisioning 16.7.1. Setting the current domain 16.7.1.1. Setting the domain for the service class 16.7.1.2. Setting the domain for query classes 16.7.2. Interacting with users 16.7.2.1. Creating a user account 16.7.2.2. Retrieving a user account 16.7.2.3. Retrieving all users in a domain 16.7.2.4. Updating a user account 16.7.2.4.1. Resetting a user's password 16.7.2.4.2. Forcing a user to change their password 16.7.2.4.3. Suspending a user account 16.7.2.4.4. Granting administrative rights 16.7.2.5. Deleting user accounts 16.7.3. Interacting with nicknames 16.7.3.1. Creating a nickname 16.7.3.2. Retrieving a nickname 16.7.3.3. Retrieving all nicknames for a user 16.7.3.4. Retrieving all nicknames in a domain 16.7.3.5. Deleting a nickname 16.7.4. Interacting with email lists 16.7.4.1. Creating an email list 16.7.4.2. Retrieving all email lists to which a recipient is subscribed 16.7.4.3. Retrieving all email lists in a domain 16.7.4.4. Deleting an email list 16.7.5. Interacting with email list recipients 16.7.5.1. Adding a recipient to an email list 16.7.5.2. Retrieving the list of subscribers to an email list 16.7.5.3. Removing a recipient from an email list 16.7.6. Handling errors 16.8. Using Google Base 16.8.1. Connect To The Base Service 16.8.1.1. Authentication 16.8.1.2. Create A Service Instance 16.8.2. Retrieve Items 16.8.2.1. Send a Structured Query 16.8.2.1.1. Query Customer Items Feed 16.8.2.1.2. Query Snippets Feed 16.8.2.2. Iterate through the Items 16.8.3. Insert, Update, and Delete Customer Items 16.8.3.1. Insert an Item 16.8.3.2. Modify an Item 16.8.3.3. Delete an Item 16.9. Using the YouTube data API 16.9.1. Retrieving video feeds 16.9.1.1. Searching for videos by metadata 16.9.1.2. Searching for videos by categories and tags/keywords 16.9.1.3. Retrieving standard feeds 16.9.1.4. Retrieving videos uploaded by a user 16.9.1.5. Retrieving videos favorited by a user 16.9.1.6. Retrieving video responses for a video 16.9.2. Retrieving video comments 16.9.3. Retrieving playlist feeds 16.9.3.1. Retrieving the playlists of a user 16.9.3.2. Retrieving a specific playlist 16.9.4. Retrieving a list of a user's subscriptions 16.9.5. Retrieving a user's profile 16.10. Using Picasa Web Albums 16.10.1. Connecting To The Service 16.10.1.1. Authentication 16.10.1.2. Creating A Service Instance 16.10.2. Understanding and Constructing Queries 16.10.3. Retrieving Feeds And Entries 16.10.3.1. Retrieving A User 16.10.3.2. Retrieving An Album 16.10.3.3. Retrieving A Photo 16.10.3.4. Retrieving A Comment 16.10.3.5. Retrieving A Tag 16.10.4. Creating Entries 16.10.4.1. Creating An Album 16.10.4.2. Creating A Photo 16.10.4.3. Creating A Comment 16.10.4.4. Creating A Tag 16.10.5. Deleting Entries 16.10.5.1. Deleting An Album 16.10.5.2. Deleting A Photo 16.10.5.3. Deleting A Comment 16.10.5.4. Deleting A Tag 16.10.5.5. Optimistic Concurrency (Notes On Deletion) 16.11. Catching Gdata Exceptions 17. Zend_Http 17.1. Zend_Http_Client 17.1.1. 简介 17.1.2. 带有指定的HTTP头的基本 GET 请求 17.1.3. 发送请求到多个域名 17.1.4. 改变HTTP timeout时间 17.1.5. 动态指定HTTP Header 17.1.6. 构造 HTTP POST, PUT, 和 DELETE 请求 17.2. Zend_Http_Client - Advanced Usage 17.2.1. HTTP Redirections 17.2.2. Adding Cookies and Using Cookie Persistence 17.2.3. Setting Custom Request Headers 17.2.4. File Uploads 17.2.5. Sending Raw POST Data 17.2.6. HTTP Authentication 17.2.7. Sending Multiple Requests With the Same Client 17.3. Zend_Http_Client - Connection Adapters 17.3.1. Overview 17.3.2. The Socket Adapter 17.3.3. The Proxy Adapter 17.3.4. The Test Adapter 17.3.5. Creating your own connection adapters 17.4. Zend_Http_Cookie and Zend_Http_CookieJar 17.4.1. Introduction 17.4.2. Instantiating Zend_Http_Cookie Objects 17.4.3. Zend_Http_Cookie getter methods 17.4.4. Zend_Http_Cookie: Matching against a scenario 17.4.5. The Zend_Http_CookieJar Class: Instantiation 17.4.6. Adding Cookies to a Zend_Http_CookieJar object 17.4.7. Retrieving Cookies From a Zend_Http_CookieJar object 17.5. Zend_Http_Response 17.5.1. 简介 18. Zend_Json 18.1. 简介 18.2. 基本用法 18.3. JSON 对象 18.4. XML 到 JSON 转换 19. Zend_Layout 19.1. 简介 19.2. Zend_Layout 快速入门 19.2.1. 布局脚本 19.2.2. 和Zend Framework MVC一起使用 Zend_Layout 19.2.3. 使用Zend_Layout做为独立的组件 19.2.4. 尝试一下布局 19.3. Zend_Layout 配置选项 19.3.1. 范例 19.4. Zend_Layout 高级用法 19.4.1. 定制视图对象 19.4.2. 定制前端控制器插件 19.4.3. 定制动作助手 19.4.4. 定制布局脚本路径解析(Resolution):使用变形器(Inflector) 20. Zend_Loader 20.1. 动态加载文件和类 20.1.1. 加载文件 20.1.2. 加载类 20.1.3. 判定某个文件是否可读 20.1.4. 使用 Autoloader 20.2. 加载插件 20.2.1. 基本用例 20.2.2. 处理插件路径 20.2.3. 测试插件和获取类的名字 21. Zend_Locale 21.1. Introduction 21.1.1. What is Localization 21.1.2. What is a Locale? 21.1.3. How are Locales Represented? 21.1.4. Selecting the Right Locale 21.1.5. Usage of automatic Locales 21.1.6. Using a default Locale 21.1.7. ZF Locale-Aware Classes 21.1.8. Zend_Locale_Format::setOptions(array $options) 21.1.9. Speed up Zend_Locale and it's subclasses 21.2. Using Zend_Locale 21.2.1. Copying, Cloning, and Serializing Locale Objects 21.2.2. Equality 21.2.3. Default locales 21.2.4. Set a new locale 21.2.5. Getting the language and region 21.2.6. Obtaining localized strings 21.2.7. Obtaining translations for "yes" and "no" 21.2.8. Get a list of all known locales 21.3. Normalization and Localization 21.3.1. Number normalization: getNumber($input, Array $options) 21.3.1.1. Precision and Calculations 21.3.2. Number localization 21.3.3. Number testing 21.3.4. Float value normalization 21.3.5. Floating point value localization 21.3.6. Floating point value testing 21.3.7. Integer value normalization 21.3.8. Integer point value localization 21.3.9. Integer value testing 21.3.10. Numeral System Conversion 21.3.10.1. List of supported numeral systems 21.4. Working with Dates and Times 21.4.1. Normalizing Dates and Times 21.4.2. Testing Dates 21.4.3. Normalizing a Time 21.4.4. Testing Times 21.5. Supported Languages for Locales 21.6. Supported Regions for Locales 22. Zend_Log 22.1. 概述 22.1.1. 创建Log 22.1.2. 日志消息 22.1.3. 销毁Log 22.1.4. 使用内建的消息等级 22.1.5. 添加用户定义的日志等级 22.1.6. 理解日志事件 22.2. Writers 22.2.1. 写入到流(Streams) 22.2.2. 写入到数据库 22.2.3. 踩熄Writer 22.2.4. 测试 Mock 22.2.5. 组合Writers 22.3. Formatters 22.3.1. 简单格式化 22.3.2. 格式化到XML 22.4. 过滤器 22.4.1. 对所有Writer过滤 22.4.2. 过滤一个Writer实例 23. Zend_Mail 23.1. 简介 23.1.1. 起步 23.1.2. 配置缺省的 sendmail 传送器(transport) 23.2. 通过SMTP发送邮件 23.3. 通过一个SMTP连接发送多个邮 23.4. 使用不同的Transport对象 23.5. HTML邮件 23.6. 附件 23.7. 增加收件人 23.8. 控制MIME分界线 23.9. 外加邮件头信息 23.10. 字符集 23.11. 编码 23.12. SMTP 身份验证 23.13. Securing SMTP Transport 23.14. Reading Mail Messages 23.14.1. Simple example using Pop3 23.14.2. Opening a local storage 23.14.3. Opening a remote storage 23.14.4. Fetching messages and simple methods 23.14.5. Working with messages 23.14.6. Checking for flags 23.14.7. Using folders 23.14.8. Advanced Use 23.14.8.1. Using NOOP 23.14.8.2. Caching instances 23.14.8.3. Extending Protocol Classes 23.14.8.4. Using Quota (since 1.5) 24. Zend_Measure 24.1. Introduction 24.2. Creation of Measurements 24.2.1. Creating measurements from integers and floats 24.2.2. Creating measurements from strings 24.2.3. Measurements from localized strings 24.3. Outputting measurements 24.3.1. Automatic output 24.3.2. Outputting values 24.3.3. Output with unit of measurement 24.3.4. Output as localized string 24.4. Manipulating Measurements 24.4.1. Convert 24.4.2. Add and subtract 24.4.3. Compare 24.4.4. Compare 24.4.5. Manually change values 24.4.6. Manually change types 24.5. Types of measurements 24.5.1. Hints for Zend_Measure_Binary 24.5.2. Hints for Zend_Measure_Number 24.5.3. Roman numbers 25. Zend_Memory 25.1. 概述 25.1.1. 简介 25.1.2. 操作原理 25.1.2.1. 内存管理器 25.1.2.2. 内存容器 25.1.2.3. 锁定的内存 25.1.2.4. 可移动内存 25.2. 内存管理器 25.2.1. 创建一个内存管理器 25.2.2. 管理内存对象 25.2.2.1. 创建可移动的对象 25.2.2.2. 创建锁定的对象 25.2.2.3. 销毁对象 25.2.3. 内存管理器设置 25.2.3.1. 内存限制 25.2.3.2. MinSize 25.3. 内存对象 25.3.1. 可移动的 25.3.2. 锁定的 25.3.3. 内存容器 '值' 属性. 25.3.4. 内存容器接口 25.3.4.1. getRef() 方法 25.3.4.2. touch() 方法 25.3.4.3. lock() 方法 25.3.4.4. unlock() 方法 25.3.4.5. isLocked() 方法 26. Zend_Mime 26.1. Zend_Mime 26.1.1. 简介 26.1.2. 静态方法和常量 26.1.3. 实例化Zend_Mime 26.2. Zend_Mime_Message 26.2.1. 简介 26.2.2. 实例化 26.2.3. 增加MIME消息段 26.2.4. 分界线处理 26.2.5. 解析字符串,创建Zend_Mime_Message对象(实验性的) 26.3. Zend_Mime_Part 26.3.1. 简介 26.3.2. 实例化 26.3.3. 解析(rendering)消息段为字符串的方法 27. Zend_Pdf 27.1. 简介 27.2. 生成和加载 PDF 文档 27.3. 保存修改到 PDF 文档 27.4. 文档页面 27.4.1. 页面生成 27.4.2. 页面克隆 27.5. Drawing. 27.5.1. Geometry. 27.5.2. Colors. 27.5.3. Shape Drawing. 27.5.4. Text Drawing. 27.5.5. Using fonts. 27.5.6. Starting in 1.5, Extracting fonts. 27.5.7. Image Drawing. 27.5.8. Line drawing style. 27.5.9. Fill style. 27.5.10. Rotations. 27.5.11. Save/restore graphics state. 27.5.12. Clipping draw area. 27.5.13. Styles. 27.6. Zend_Pdf module usage example. 28. Zend_Registry 28.1. 使用对象注册表(Registry) 28.1.1. 设置Registry中的值 28.1.2. 获取Registry中的值 28.1.3. 创建一个Registry对象 28.1.4. 像访问数组一样访问Registry对象 28.1.5. 对象方式访问Registry 28.1.6. 查询一个索引是否存在 28.1.7. 扩展Registry对象 28.1.8. 删除静态注册表 29. Zend_Rest 29.1. Introduction 29.2. Zend_Rest_Client 29.2.1. Introduction 29.2.2. Responses 29.2.3. Request Arguments 29.3. Zend_Rest_Server 29.3.1. Introduction 29.3.2. REST Server Usage 29.3.3. Calling a Zend_Rest_Server Service 29.3.4. Sending A Custom Status 29.3.5. Returning Custom XML Responses 30. Zend_Search_Lucene 30.1. 概述 30.1.1. 简介 30.1.2. 文档和字段对象 30.1.3. 理解字段类型 30.2. 建立索引 30.2.1. 创建新索引 30.2.2. 更新索引 30.3. 搜索索引 30.3.1. 建立查询 30.3.2. 搜索结果 30.3.3. 结果评分 30.4. Query Language 30.4.1. Terms 30.4.2. Fields 30.4.3. Starting in 1.5, Wildcards 30.4.4. Term Modifiers 30.4.5. Starting in 1.5, Range Searches 30.4.6. Starting in 1.5, Fuzzy Searches 30.4.7. Proximity Searches 30.4.8. Boosting a Term 30.4.9. Boolean Operators 30.4.9.1. AND 30.4.9.2. OR 30.4.9.3. NOT 30.4.9.4. &&, ||, and ! operators 30.4.9.5. + 30.4.9.6. - 30.4.9.7. No Operator 30.4.10. Grouping 30.4.11. Field Grouping 30.4.12. Escaping Special Characters 30.5. 查询类型 30.5.1. 单项查询 30.5.2. 多项查询 30.5.3. 短语查询 30.6. 字符集 30.6.1. UTF-8 和单字节字符集支持 30.7. 扩展性 30.7.1. 文本分析 30.7.2. 评分算法 30.7.3. 存储容器 30.8. 与 Java Lucene 的互操作性 30.8.1. 文件格式 30.8.2. 索引目录 30.8.3. Java 源代码 30.9. Advanced 30.9.1. Using the index as static property 30.10. Best Practices 30.10.1. Field names 30.10.2. Indexing performance 30.10.3. Index during Shut Down 30.10.4. Retrieving documents by unique id 30.10.5. Memory Usage 30.10.6. Encoding 30.10.7. Index maintenance 31. Zend_Server 31.1. 简介 31.2. Zend_Server_Reflection 31.2.1. 简介 31.2.2. 用法 32. Zend_Service 32.1. 简介 32.2. Zend_Service_Akismet 32.2.1. Introduction 32.2.2. Verify an API key 32.2.3. Check for spam 32.2.4. Submitting known spam 32.2.5. Submitting false positives (ham) 32.2.6. Zend-specific Accessor Methods 32.3. Zend_Service_Amazon 32.3.1. Introduction 32.3.2. Country Codes 32.3.3. Looking up a Specific Amazon Item by ASIN 32.3.4. Performing Amazon Item Searches 32.3.5. Using the Alternative Query API 32.3.5.1. Introduction 32.3.6. Zend_Service_Amazon Classes 32.3.6.1. Zend_Service_Amazon_Item 32.3.6.1.1. Zend_Service_Amazon_Item::asXML() 32.3.6.1.2. Properties 32.3.6.2. Zend_Service_Amazon_Image 32.3.6.2.1. Properties 32.3.6.3. Zend_Service_Amazon_ResultSet 32.3.6.3.1. Zend_Service_Amazon_ResultSet::totalResults() 32.3.6.4. Zend_Service_Amazon_OfferSet 32.3.6.4.1. Properties 32.3.6.5. Zend_Service_Amazon_Offer 32.3.6.5.1. Zend_Service_Amazon_Offer Properties 32.3.6.6. Zend_Service_Amazon_SimilarProduct 32.3.6.6.1. Properties 32.3.6.7. Zend_Service_Amazon_Accessories 32.3.6.7.1. Properties 32.3.6.8. Zend_Service_Amazon_CustomerReview 32.3.6.8.1. Properties 32.3.6.9. Zend_Service_Amazon_EditorialReview 32.3.6.9.1. Properties 32.3.6.10. Zend_Service_Amazon_Listmania 32.3.6.10.1. Properties 32.4. Zend_Service_Audioscrobbler 32.4.1. Introduction to Searching Audioscrobbler 32.4.2. Users 32.4.3. Artists 32.4.4. Tracks 32.4.5. Tags 32.4.6. Groups 32.4.7. Forums 32.5. Zend_Service_Delicious 32.5.1. Introduction 32.5.2. Retrieving posts 32.5.3. Zend_Service_Delicious_PostList 32.5.4. Editing posts 32.5.5. Deleting posts 32.5.6. Adding new posts 32.5.7. Tags 32.5.8. Bundles 32.5.9. Public data 32.5.9.1. Public posts 32.5.10. HTTP client 32.6. Zend_Service_Flickr 32.6.1. 对Flickr搜索的介绍 32.6.2. 查找 Flickr 用户 32.6.3. 获得 Flickr 图像详细资料 32.6.4. Zend_Service_Flickr 类 32.6.4.1. Zend_Service_Flickr_ResultSet 32.6.4.1.1. 属性 32.6.4.1.2. Zend_Service_Flickr_ResultSet::totalResults() 32.6.4.2. Zend_Service_Flickr_Result 32.6.4.2.1. 属性 32.6.4.3. Zend_Service_Flickr_Image 32.6.4.3.1. 属性 32.7. Zend_Service_Simpy 32.7.1. Introduction 32.7.2. Links 32.7.3. Tags 32.7.4. Notes 32.7.5. Watchlists 32.8. Zend_Service_StrikeIron 32.8.1. Overview 32.8.2. Registering with StrikeIron 32.8.3. Getting Started 32.8.4. Making Your First Query 32.8.5. Examining Results 32.8.6. Handling Errors 32.8.7. Checking Your Subscription 32.9. Zend_Service_StrikeIron: Bundled Services 32.9.1. ZIP Code Information 32.9.2. U.S. Address Verification 32.9.3. Sales & Use Tax Basic 32.10. Zend_Service_StrikeIron: Advanced Uses 32.10.1. Using Services by WSDL 32.10.2. Viewing SOAP Transactions 32.11. Zend_Service_Yahoo 32.11.1. 简介 32.11.2. 用Yahoo!来搜索网页 32.11.3. 用Yahoo!来查找图片 32.11.4. Finding Local Businesses and Services with Yahoo! 32.11.5. 搜索Yahoo! 新闻 32.11.6. Zend_Service_Yahoo 类 32.11.6.1. Zend_Service_Yahoo_ResultSet 32.11.6.1.1. Zend_Service_Yahoo_ResultSet::totalResults() 32.11.6.1.2. Properties 32.11.6.2. Zend_Service_Yahoo_WebResultSet 32.11.6.3. Zend_Service_Yahoo_ImageResultSet 32.11.6.4. Zend_Service_Yahoo_LocalResultSet 32.11.6.5. Zend_Service_Yahoo_NewsResultSet 32.11.6.6. Zend_Service_Yahoo_Result 32.11.6.6.1. Properties 32.11.6.7. Zend_Service_Yahoo_WebResult 32.11.6.7.1. 属性 32.11.6.8. Zend_Service_Yahoo_ImageResult 32.11.6.8.1. 属性 32.11.6.9. Zend_Service_Yahoo_LocalResult 32.11.6.9.1. 属性 32.11.6.10. Zend_Service_Yahoo_NewsResult 32.11.6.10.1. 属性 32.11.6.11. Zend_Service_Yahoo_Image 32.11.6.11.1. Properties 33. Zend_Session 33.1. 简介 33.2. 基本用法 33.2.1. 实例教程 33.2.2. 迭代会话命名空间 33.2.3. 会话命名空间的访问器 33.3. 高级用法 33.3.1. 开启会话 33.3.2. 锁住会话命名空间 33.3.3. 命名空间过期 33.3.4. 会话封装和控制器 33.3.5. 防止每个命名空间有多重实例 33.3.6. 使用数组 33.3.7. 在对象中使用会话 33.3.8. 在单元测试中使用会话 33.4. 全局会话管理 33.4.1. 配置选项 33.4.2. 错误:Headers Already Sent 33.4.3. 会话标识符 33.4.3.1. 会话劫持和会话固定 33.4.4. rememberMe(integer $seconds) 33.4.5. forgetMe() 33.4.6. sessionExists() 33.4.7. destroy(bool $remove_cookie = true, bool $readonly = true) 33.4.8. stop() 33.4.9. writeClose($readonly = true) 33.4.10. expireSessionCookie() 33.4.11. setSaveHandler(Zend_Session_SaveHandler_Interface $interface) 33.4.12. namespaceIsset($namespace) 33.4.13. namespaceUnset($namespace) 33.4.14. namespaceGet($namespace) 33.4.15. getIterator() 34. Zend_Translate 34.1. 简介 34.1.1. 开始多语言化 34.2. Zend_Translate适配器 34.2.1. 如何判断使用哪种翻译适配器 34.2.1.1. Zend_Translate_Adapter_Array 34.2.1.2. Zend_Translate_Adapter_Csv 34.2.1.3. Zend_Translate_Adapter_Gettext 34.2.1.4. Zend_Translate_Adapter_Tbx 34.2.1.5. Zend_Translate_Adapter_Tmx 34.2.1.6. Zend_Translate_Adapter_Qt 34.2.1.7. Zend_Translate_Adapter_Xliff 34.2.1.8. Zend_Translate_Adapter_XmlTm 34.2.2. 集成编写自己的适配器 34.2.3. 加速所有的适配器 34.3. Using Translation Adapters 34.3.1. Translation Source Structures 34.3.2. Creating array source files 34.3.3. Creating Gettext Source Files 34.3.4. Creating TMX Source Files 34.3.5. Creating CSV Source Files 34.3.6. Options for adapters 34.3.7. Handling languages 34.3.7.1. Automatically handling of languages 34.3.8. Automatic source detection 34.3.8.1. Language through naming directories 34.3.8.2. Language through filenames 34.3.8.2.1. Complete Filename 34.3.8.2.2. Extension of the file 34.3.8.2.3. Filename tokens 34.3.9. Checking for translations 34.3.10. Access to the source data 35. Zend_Uri 35.1. Zend_Uri 35.1.1. 概述 35.1.2. 新建一个URI 35.1.3. 操作现有的URI 35.1.4. URI 验证 35.1.5. 公共实例方法 35.1.5.1. 取得URI的Schema 35.1.5.2. 取得整个URI 35.1.5.3. 验证URI 36. Zend_Validate 36.1. 简介 36.1.1. 什么是校验器(validator)? 36.1.2. 校验器的基本用法 36.1.3. 定制消息 36.1.4. 使用静态 is() 方法 36.2. 标准校验类 36.2.1. Alnum 36.2.2. Alpha 36.2.3. Barcode 36.2.4. Between 36.2.5. Ccnum 36.2.6. 日期 36.2.7. 数字 36.2.8. Email 地址 36.2.9. 浮点数 36.2.10. GreaterThan 36.2.11. 十六进制数 36.2.12. 主机名 36.2.13. InArray 36.2.14. 整数 36.2.15. Ip 36.2.16. LessThan 36.2.17. NotEmpty 36.2.18. Regex 36.2.19. StringLength 36.3. 校验器链 36.4. 编写校验器 37. Zend_Version 37.1. 读取Zend Framework的当前版本 38. Zend_View 38.1. 简介 38.1.1. 控制器脚本 38.1.2. 视图脚本 38.1.3. 选项 38.1.4. 实用访问器 38.2. 控制器脚本 38.2.1. 变量赋值 38.2.2. 调用视图脚本并打印输出 38.2.3. 视图脚本的路径 38.3. 视图脚本 38.3.1. 转义输出(Escaping Output) 38.3.2. 使用模板系统 38.3.2.1. 使用View脚本的模板系统 38.3.2.2. 通过Zend_View_Interface接口使用模板系统 38.4. 视图助手(View Helper) 38.4.1. 基本的助手 38.4.1.1. 动作视图助手 38.4.1.2. 区域助手(Partial Helper) 38.4.1.3. 占位符助手(Placeholder Helper) 38.4.1.3.1. 具体占位符实现 38.4.1.4. 文档类型助手(Doctype Helper) 38.4.1.5. HeadLink 助手 38.4.1.6. HeadMeta 助手 38.4.1.7. HeadScript 助手 38.4.1.8. HeadStyle 助手 38.4.1.9. HeadTitle 助手 38.4.1.10. InlineScript 助手 38.4.1.11. JSON 助手 38.4.1.12. 翻译助手 38.4.2. 助手的路径 38.4.3. 编写自定义的助手类 39. Zend_XmlRpc 39.1. 介绍 39.2. Zend_XmlRpc_Client 39.2.1. 介绍 39.2.2. 带参数 39.2.2.1. 以PHP本地变量的形式传递参数 39.2.2.2. 以Zend_XmlRpc_Value 对象的形式传递参数 39.2.2.3. 将一个XML字符串解析为XML-RPC参数 39.2.3. 参数类型提示 39.2.4. 获取响应 39.3. Zend_XmlRpc_Server 39.3.1. Introduction 39.3.2. Basic Usage 39.3.3. Server Structure 39.3.4. Conventions 39.3.5. Utilizing Namespaces 39.3.6. Custom Request Objects 39.3.7. Custom Responses 39.3.8. Handling Exceptions via Faults 39.3.9. Caching Server Definitions Between Requests 39.3.10. Usage Examples 39.3.10.1. Basic Usage 39.3.10.2. Attaching a class 39.3.10.3. Attaching several classes using namespaces 39.3.10.4. Specifying exceptions to use as valid fault responses 39.3.10.5. Utilizing a custom request object 39.3.10.6. Utilizing a custom response object 39.3.10.7. Cache server definitions between requests A. 系统需求 A.1. PHP 版本需求 A.2. PHP 扩展 A.3. Zend Framework 组件 B. Zend Framework PHP 编码标准 B.1. 绪论 B.1.1. 适用范围 B.1.2. 目标 B.2. PHP File 文件格式 B.2.1. 常规 B.2.2. 缩进 B.2.3. 行的最大长度 B.2.4. 行结束标志 B.3. 命名约定 B.3.1. 类 B.3.2. 接口 B.3.3. 文件名 B.3.4. 函数和方法 B.3.5. 变量 B.3.6. 常量 B.4. 编码风格 B.4.1. PHP 代码划分(Demarcation) B.4.2. 字符串 B.4.2.1. 字符串文字 B.4.2.2. 包含单引号(')的字符串文字 B.4.2.3. 变量替换 B.4.2.4. 字符串连接 B.4.3. 数组 B.4.3.1. 数字索引数组 Numerically Indexed Arrays B.4.3.2. 关联数组 B.4.4. 类 B.4.4.1. 类的声明 B.4.4.2. 类成员变量 B.4.5. 函数和方法 B.4.5.1. 函数和方方声明 B.4.5.2. 函数和方法的用法 B.4.6. 控制语句 B.4.6.1. If / Else / Elseif B.4.6.2. Switch B.4.7. 注释文档 B.4.7.1. 格式 B.4.7.2. 文件 B.4.7.3. 类 B.4.7.4. 函数 C. 版权信息 索引 表格清单 2.1. 一个CMS范例的访问控制 3.1. 配置选项 4.1. 核心前端选项 4.2. 函数前端选项 4.3. Class frontend options 4.4. File frontend options 4.5. Page frontend options 4.6. 文件后端选项 4.7. Sqlite 后端选项 4.8. Memcached 后端选项 5.1. Zend_Config_Ini 构造器参数 8.1. 选择货币描述的常量 8.2. 选择货币位置的常量 9.1. Date Parts 9.2. Basic Operations 9.3. Date Comparison Methods 9.4. Date Output Methods 9.5. Date Output Methods 9.6. Miscellaneous Methods 9.7. Operations involving Zend_Date::HOUR 9.8. Day Constants 9.9. Week Constants 9.10. Month Constants 9.11. Year Constants 9.12. Time Constants 9.13. Timezone Constants 9.14. Date Format Constants (formats include timezone) 9.15. Date and Time Formats (format varies by locale) 9.16. Constants for ISO 8601 date output 9.17. Constants for PHP date output 9.18. Types of supported horizons for sunset and sunrise 17.1. Zend_Http_Client_Adapter_Socket configuration parameters 17.2. Zend_Http_Client configuration parameters 21.1. Details for getTranslationList($type = null, $locale = null, $value = null) 21.2. Details for getTranslation($value = null, $type = null, $locale = null) 21.3. Differences between ZF 1.0 and ZF 1.5 21.4. Format tokens for self generated number formats 21.5. List of supported numeral systems 21.6. Key values for getDate() with option 'fix_date' 21.7. Return values 21.8. Format definition 21.9. Example formats 21.10. List of all supported languages 21.11. List of all supported regions 23.1. Mail Read Feature Overview 23.2. Mail Folder Names 24.1. List of measurement types 30.1. Zend_Search_Lucene_Field 类型 32.1. Zend_Service_Amazon_Item Properties 32.2. Zend_Service_Amazon_Image Properties 32.3. Zend_Service_Amazon_OfferSet Properties 32.4. Properties 32.5. Zend_Service_Amazon_SimilarProduct Properties 32.6. Zend_Service_Amazon_Accessories Properties 32.7. Zend_Service_Amazon_CustomerReview Properties 32.8. Zend_Service_Amazon_EditorialReview Properties 32.9. Zend_Service_Amazon_Listmania Properties 32.10. Methods for retrieving public data 32.11. Methods of the Zend_Service_Delicious_SimplePost class 32.12. Zend_Service_Flickr_ResultSet 属性 32.13. Zend_Service_Flickr_Result 属性 32.14. Zend_Service_Flickr_Image 属性 32.15. Zend_Service_Yahoo_ResultSet 32.16. Zend_Service_Yahoo_LocalResultSet 属性 32.17. Zend_Service_Yahoo_Result Properties 32.18. Zend_Service_Yahoo_WebResult 属性 32.19. Zend_Service_Yahoo_ImageResult 属性 32.20. Zend_Service_Yahoo_LocalResult 属性 32.21. Zend_Service_Yahoo_NewsResult 属性 32.22. Zend_Service_Yahoo_Image Properties 34.1. Zend_Translate适配器 34.2. Options for Translation Adapters 39.1. PHP本地变量类型转化为XML-RPC类型 39.2. Zend_XmlRpc_Value 对象声明的XML-RPC类型 A.1. Zend Framework 使用的 PHP 扩展 A.2. Zend Framework 组件以及其使用到的 PHP 扩展 范例清单 2.1. 角色之间的多重继承 3.1. 修改 Session 名字空间 3.2. 使用定制存储类 3.3. 基本用法 4.1. 调用 Zend_Cache::factory()取得一个前端 4.2. Caching a database query result 4.3. 用Zend_Cache 输出前端缓存输出 5.1. 使用 Zend_Config 本身 5.2. Using Zend_Config with a PHP Configuration File 5.3. 使用 Zend_Config_Ini 5.4. 使用Zend_Config_Xml 6.1. 使用短语法 6.2. 使用长语法 6.3. 捕捉 Getopt 异常 6.4. 使用 getOption() 6.5. 使用 __get() 和 __isset() 魔术方法 6.6. 使用 getRemainingArgs() 6.7. 使用 addRules() 6.8. 使用 setHelp() 6.9. 使用 setAliases() 6.10. 使用 addArguments() 和 setArguments() 6.11. 使用 setOption() 6.12. 使用 setOptions() 7.1. 如何处理不存在的动作 7.2. 用动作、控制器和模块名来添加一个任务 7.3. 使用请求对象添加一个任务 7.4. AutoCompletion with Dojo Using Zend MVC 7.5. 允许动作响应 Ajax 的请求 7.6. 设定选项 7.7. 使用默认设定 7.8. 使用goto()的_forward()API 7.9. 通过gotoRoute()使用路由组装(route assembly) 7.10. 基本用法 7.11. 禁用自动解析 7.12. 选择另外的视图脚本 7.13. 修改注册的视图Modifying the registered view 7.14. 修改路径规则 7.15. 一个动作中解析多个视图脚本 7.16. Standard usage 7.17. Setting a different error handler 7.18. Using accessors 8.1. 从实际地方创建 Zend_Currency 的实例 8.2. 创建 Zend_Currency 实例的其它例子 8.3. 为货币创建输出 8.4. 修改货币的显示格式 8.5. 从货币中获取信息 8.6. 设置新地方 8.7. 缓存货币 9.1. Setting a default timezone 9.2. Creating the current date 9.3. get() - output a date 9.4. set() - set a date 9.5. add() - adding dates 9.6. compare() - compare dates 9.7. equals() - identify a date or date part 9.8. User-specified input date format 9.9. Operating on Parts of Dates 9.10. Date creation by instance 9.11. Static date creation 9.12. Quick creation of dates from database date values 9.13. Convenient creation of dates from database date values 9.14. Date creation by array 9.15. Example usage for self-defined ISO formats 9.16. Example usage for self-defined formats with PHP specifier 9.17. Checking dates 9.18. Getting all available cities 9.19. Getting the location for a city 9.20. Calculating sun informations 9.21. Working with timezones 9.22. Multiple timezones 10.1. Creating a SQL statement object with query() 10.2. Using a SQL statement constructor 10.3. Executing a statement with positional parameters 10.4. Executing a statement with named parameters 10.5. Using fetch() in a loop 10.6. Using fetchAll() 10.7. Setting the fetch mode 10.8. Using fetchColumn() 10.9. Using fetchObject() 10.10. Fetching a Dependent Rowset 10.11. Fetching a Dependent Rowset By a Specific Rule 10.12. Fetching a Dependent Rowset using a Zend_Db_Table_Select 10.13. Fetching Dependent Rowsets using the Magic Method 10.14. Fetching the Parent Row 10.15. Fetching a Parent Row By a Specific Rule 10.16. Fetching the Parent Row using the Magic Method 10.17. Fetching a Rowset with the Many-to-many Method 10.18. Fetching a Rowset with the Many-to-many Method By a Specific Rule 10.19. Fetching Rowsets using the Magic Many-to-many Method 10.20. Example of a Cascading Delete 10.21. Example Declaration of Cascading Operations 11.1. dump()方法使用示例 12.1. 捕捉一个异常的例子 13.1. 用Zend_Feed来处理RSS Feed数据 13.2. Atom Feed的基本用法 13.3. 读取Atom Feed的单个条目 13.4. 用条目对象直接访问Atom Feed的单个条目 13.5. 修改一个已存在的条目 13.6. 用自定义的命名空间创建一个Atom条目元素 13.7. 用自定义的命名空间继承Atom条目类 14.1. Transforming CamelCaseText to another format 14.2. Setting Multiple Rules at Once 14.3. Using Zend_Config with Zend_Filter_Inflector 15.1. 定制标签 15.2. 为所有元素设置前缀路径 15.3. 为所有元素设置装饰器(Decorators) 15.4. 为所有元素设置过滤器 15.5. 为所有的显示组设置装饰器前缀路径 15.6. 为所有显示组设置装饰器 15.7. 注册表单示例 17.1. 执行一个基本的 GET 请求 17.2. 创建一个基本的Zend_Http_Client 17.3. 发送多条header信息 17.4. 发送请求到多个域名 17.5. 用Zend_Http_Client发送POST 数据 17.6. Forcing RFC 2616 Strict Redirections on 301 and 302 Responses 17.7. Setting Cookies Using setCookie() 17.8. Enabling Cookie Stickiness 17.9. Setting A Single Custom Request Header 17.10. Setting Multiple Custom Request Headers 17.11. Using setFileUpload to Upload Files 17.12. Sending Raw POST Data 17.13. Setting HTTP Authentication User and Password 17.14. Performing consecutive requests with one client 17.15. Changing the HTTPS transport layer 17.16. Using Zend_Http_Client behind a proxy server 17.17. Testing Against a Single HTTP Response Stub 17.18. Testing Against Multiple HTTP Response Stubs 17.19. Creating your own connection adapter 17.20. Instantiating a Zend_Http_Cookie object 17.21. Stringifying a Zend_Http_Cookie object 17.22. Using getter methods with Zend_Http_Cookie 17.23. Matching cookies 17.24. 处理HTTP应答 19.1. 传递选项给构造器或startMvc() 19.2. 使用setOption() 和 setConfig() 19.3. 使用访问器 19.4. 使用Zend_Layout访问器来修改变形器(inflector) 19.5. Zend_Layout 变形器的直接修改 19.6. 定制变形器(inflectors) 20.1. loadFile() 方法范例 20.2. Example of loadClass() method 20.3. isReadable()示例: 20.4. 注册 autoloader callback 方法范例 20.5. 从继承类注册 autoload callback 方法范例 21.1. Choosing a specific locale 21.2. Automatically selecting a locale 21.3. Using automatic locales 21.4. Handling locale exceptions 21.5. Setting a default locale 21.6. Dates default to correct locale of web users 21.7. Overriding default locale selection 21.8. Performance optimization when using a default locale 21.9. Dates default to correct locale of web users 21.10. Using STANDARD definitions for setOptions() 21.11. clone 21.12. Check for equal locales 21.13. Get default locales 21.14. setLocale 21.15. getLanguage and getRegion 21.16. getTranslationList 21.17. getTranslationList 21.18. Converting country name in one language to another 21.19. All available translations 21.20. All Languages written in their native language 21.21. getQuestion() 21.22. getLocaleList() 21.23. Number normalization 21.24. Number normalization with precision 21.25. Number localization 21.26. Number localization with precision 21.27. Using a self defined number format 21.28. Number testing 21.29. Floating point value normalization 21.30. Floating point value localization 21.31. Floating point value testing 21.32. Integer value normalization 21.33. Integer value localization 21.34. Integer value testing 21.35. Converting numerals from Eastern Arabic scripts to European/Latin scripts 21.36. Converting numerals from Latin script to Eastern Arabic script 21.37. Getting 4 letter CLDR script code using a native-language name of the script 21.38. Normalizing a date 21.39. Normalizing a date by locale 21.40. Normalizing a date with time 21.41. Normalizing a userdefined date 21.42. Automatic correction of input dates 21.43. Date testing 21.44. Normalize an unknown time 21.45. Testing a time 23.1. 使用Zend_Mail发送简单邮件 23.2. 传递另外的参数给 Zend_Mail_Transport_Sendmail 传送器 23.3. 通过 SMTP 发送邮件 23.4. 通过一个SMTP连接发送多个邮件 23.5. 手工控制传送器连接 23.6. 使用不同的Transport对象 23.7. 发送HTML邮件 23.8. 带附件的邮件 23.9. 更改MIME分界线 23.10. 外加邮件头信息 23.11. 在 Zend_Mail_Transport_Smtp 中使用身份验证 23.12. Enabling a secure connection within Zend_Mail_Transport_Smtp 24.1. Converting measurements 24.2. The meter measurement 24.3. Creation using integer and floating values 24.4. Creation using strings 24.5. Arbitrary text input containing measurements 24.6. Localized string 24.7. Automatic output 24.8. Output a value 24.9. Outputting units 24.10. Convert 24.11. Adding units 24.12. Subtract 24.13. Different measurements 24.14. Identical measurements 24.15. Difference 24.16. Changing a value 24.17. Changing the type 25.1. 使用 Zend_Memory 组件 27.1. 生成新的或加载 PDF 文档 27.2. 请求 PDF 文档的指定版本 27.3. Save PDF document. 27.4. PDF 文档页面管理 27.5. Cloning existing page. 27.6. Draw a string on the page. 27.7. Draw a UTF-8-encoded string on the page. 27.8. Create a standard font. 27.9. Create a TrueType font. 27.10. Create a TrueType font, but do not embed it in the PDF document. 27.11. Do not throw an exception for fonts that cannot be embeded. 27.12. Do not compress an embedded font. 27.13. Combining font embedding options. 27.14. Extracting fonts from a loaded document. 27.15. Extracting font from a loaded document by specifying font name. 27.16. Image drawing. 27.17. Zend_Pdf module usage demo. 28.1. set() 使用示例: 28.2. get() 方法示例: 28.3. 迭代一个registry对象: 28.4. 创建一个registry对象 28.5. Example of initializing the static registry 28.6. array 方式访问示例: 28.7. 对象形式的访问: 28.8. isRegistered() 示例: 28.9. isset() 示例: 28.10. 指定静态注册表的类名: 28.11. _unsetInstance() 示例: 29.1. A basic REST request 29.2. Response Status 29.3. Using Technorati's Rest Service 29.4. Example Technorati Response 29.5. Setting Request Arguments 29.6. Basic Zend_Rest_Server Usage - Classes 29.7. Basic Zend_Rest_Server Usage - Functions 29.8. Returning Custom Status 29.9. Return Custom XML 30.1. 自定义文本分析程序 32.1. isSpam() Usage 32.2. submitSpam() Usage 32.3. submitHam() Usage 32.4. Search Amazon Using the Traditional API 32.5. Search Amazon Using the Query API 32.6. Choosing an Amazon Web Service Country 32.7. Looking up a Specific Amazon Item by ASIN 32.8. Performing Amazon Item Searches 32.9. Using the ResponseGroup Option 32.10. Search Amazon Using the Alternative Query API 32.11. Retrieving User Profile Information 32.12. Retrieving a User's Weekly Artist Chart 32.13. Retrieving Related Artists 32.14. Get all posts 32.15. Accessing post lists 32.16. Filtering a Post List with Specific Tags 32.17. Filtering a Post List by URL 32.18. Post editing 32.19. Method call chaining 32.20. Deleting posts 32.21. Adding a post 32.22. Tags 32.23. Bundles 32.24. Retrieving public data 32.25. Changing the HTTP client of Zend_Rest_Client 32.26. Configuring your HTTP client to keep connections alive 32.27. 简单的 Flickr 照片搜索 32.28. 用email地址来查找Flickr用户 32.29. 获得 Flickr 图像详细资料 32.30. Querying Links 32.31. Modifying Links 32.32. Working With Tags 32.33. Working With Notes 32.34. Retrieving Watchlists 32.35. 用Yahoo!来搜索网页 32.36. 用Yahoo!来查找图片 32.37. 用Yahoo!查找本地商务和服务信息 32.38. 搜索Yahoo! 新闻 33.1. 页面浏览计数 33.2. 新方法: 使用命名空间避免冲突 33.3. 老方法: PHP会话访问 33.4. 会话迭代 33.5. 访问会话数据 33.6. 开启全局会话 33.7. 锁住会话命名空间 33.8. 过期的例子 33.9. 带有生命期的控制器命名空间会话 33.10. 限制命名空间访问单一实例 33.11. 修改带有会话命名空间的数组数据 33.12. 在会话存储之前构造数组 33.13. 方案:重新分配一个被修改的数组 33.14. 方案:存储包括引用的数组 33.15. PHPUnit Testing Code Dependent on Zend_Session 33.16. 使用Zend_Config配置Zend_Session 33.17. 会话固定 34.1. Example of single-language PHP code 34.2. Example of multi-lingual PHP code 34.3. Example TMX file 34.4. Example CSV file 34.5. Example CSV file two 34.6. Using translation options 34.7. Handling languages with adapters 34.8. How automatically language detection works 34.9. Scanning a directory structure for sources 34.10. Directory scanning for languages 34.11. Filename scanning for languages 34.12. Checking if a text is translatable 34.13. Handling languages with adapters 35.1. 使用Zend_Uri::factory()创建一个新的URI 35.2. 使用Zend_Uri::factory()操作一个现有的URI 35.3. 使用Zend_Uri::check()进行URI 验证 35.4. 从Zend_Uri_* 对象取得模式 35.5. 从一个Zend_Uri_* 对象取得整个URI 35.6. 验证一个 Zend_Uri_* 对象 36.1. 创建简单校验类 36.2. 编写有独立条件的校验类 36.3. 带有独立条件、多重失败原因的校验 37.1. compareVersion()方法示例: 38.1. 动作视图助手的基本用法 38.2. Partials 的基本用法 38.3. 使用 PartialLoop 来解析可迭代的(Iterable)的模型 38.4. 在其它模块中解析 Partials 38.5. 占位符的基本用法 38.6. 用占位符来聚合内容 38.7. 使用占位符(Placeholders)来抓取内容 38.8. Doctype 助手的基本用法 38.9. 获取 Doctype 38.10. HeadLink 助手的基本用法 38.11. HeadMeta 助手基本用法 38.12. HeadScript 助手基本用法 38.13. Capturing Scripts Using the HeadScript Helper 38.14. HeadStyle 助手的基本用法 38.15. 用 HeadStyle 助手抓取样式声明 38.16. HeadTitle 助手基本用法 38.17. 已注册的实例 38.18. 在视图里 38.19. 直接用法 38.20. 单个参数 38.21. 参数列表 38.22. 参数数组 38.23. 动态修改地点 (locale) 38.24. 静态修改地点 (locale) 38.25. 获得当前设置的地点 39.1. 一个基本的XML-RPC请求 39.2. 用类型提示来调用一个XML-RPC服务
[PHP] ;;;;;;;;;;;;;;;;;;; ; About php.ini ; ;;;;;;;;;;;;;;;;;;; ; PHP's initialization file, generally called php.ini, is responsible for ; configuring many of the aspects of PHP's behavior. ; PHP attempts to find and load this configuration from a number of locations. ; The following is a summary of its search order: ; 1. SAPI module specific location. ; 2. The PHPRC environment variable. (As of PHP 5.2.0) ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) ; 4. Current working directory (except CLI) ; 5. The web server's directory (for SAPI modules), or directory of PHP ; (otherwise in Windows) ; 6. The directory from the --with-config-file-path compile time option, or the ; Windows directory (C:\windows or C:\winnt) ; See the PHP docs for more specific information. ; http://php.net/configuration.file ; The syntax of the file is extremely simple. Whitespace and lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored, even though ; they might mean something in the future. ; Directives following the section heading [PATH=/www/mysite] only ; apply to PHP files in the /www/mysite directory. Directives ; following the section heading [HOST=www.example.com] only apply to ; PHP files served from www.example.com. Directives set in these ; special sections cannot be overridden by user-defined INI files or ; at runtime. Currently, [PATH=] and [HOST=] sections only work under ; CGI/FastCGI. ; http://php.net/ini.sections ; Directives are specified using the following syntax: ; directive = value ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. ; Directives are variables used to configure PHP or PHP extensions. ; There is no name validation. If PHP can't find an expected ; directive because it is not set or is mistyped, a default value will be used. ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a ; previously set variable or directive (e.g. ${foo}) ; Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; ^ bitwise XOR ; & bitwise AND ; ~ bitwise NOT ; ! boolean NOT ; Boolean flags can be turned on using the values 1, On, True or Yes. ; They can be turned off using the values 0, Off, False or No. ; An empty string can be denoted by simply not writing anything after the equal ; sign, or by using the None keyword: ; foo = ; sets foo to an empty string ; foo = None ; sets foo to an empty string ; foo = "None" ; sets foo to the string 'None' ; If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line that loads the extension. ;;;;;;;;;;;;;;;;;;; ; About this file ; ;;;;;;;;;;;;;;;;;;; ; PHP comes packaged with two INI files. One that is recommended to be used ; in production environments and one that is recommended to be used in ; development environments. ; php.ini-production contains settings which hold security, performance and ; best practices at its core. But please be aware, these settings may break ; compatibility with older or less security conscience applications. We ; recommending using the production ini in production and testing environments. ; php.ini-development is very similar to its production variant, except it's ; much more verbose when it comes to errors. We recommending using the ; development version only in development environments as errors shown to ; application users can inadvertently leak otherwise secure information. ; This is php.ini-development INI file. ;;;;;;;;;;;;;;;;;;; ; Quick Reference ; ;;;;;;;;;;;;;;;;;;; ; The following are all the settings which are different in either the production ; or development versions of the INIs with respect to PHP's default behavior. ; Please see the actual settings later in the document for more details as to why ; we recommend these changes in PHP's behavior. ; display_errors ; Default Value: On ; Development Value: On ; Production Value: Off ; display_startup_errors ; Default Value: Off ; Development Value: On ; Production Value: Off ; error_reporting ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; html_errors ; Default Value: On ; Development Value: On ; Production value: On ; log_errors ; Default Value: Off ; Development Value: On ; Production Value: On ; max_input_time ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; output_buffering ; Default Value: Off ; Development Value: 4096 ; Production Value: 4096 ; register_argc_argv ; Default Value: On ; Development Value: Off ; Production Value: Off ; request_order ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" ; session.gc_divisor ; Default Value: 100 ; Development Value: 1000 ; Production Value: 1000 ; session.hash_bits_per_character ; Default Value: 4 ; Development Value: 5 ; Production Value: 5 ; short_open_tag ; Default Value: On ; Development Value: Off ; Production Value: Off ; track_errors ; Default Value: Off ; Development Value: On ; Production Value: Off ; url_rewriter.tags ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" ; variables_order ; Default Value: "EGPCS" ; Development Value: "GPCS" ; Production Value: "GPCS" ;;;;;;;;;;;;;;;;;;;; ; php.ini Options ; ;;;;;;;;;;;;;;;;;;;; ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" ;user_ini.filename = ".user.ini" ; To disable this feature set this option to empty value ;user_ini.filename = ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) ;user_ini.cache_ttl = 300 ;;;;;;;;;;;;;;;;;;;; ; Language Options ; ;;;;;;;;;;;;;;;;;;;; ; Enable the PHP scripting language engine under Apache. ; http://php.net/engine engine = On ; This directive determines whether or not PHP will recognize code between ; tags as PHP source which should be processed as such. It is ; generally recommended that should be used and that this feature ; should be disabled, as enabling it may result in issues when generating XML ; documents, however this remains supported for backward compatibility reasons. ; Note that this directive does not control the tags. ; http://php.net/asp-tags asp_tags = Off ; The number of significant digits displayed in floating point numbers. ; http://php.net/precision precision = 14 ; Output buffering is a mechanism for controlling how much output data ; (excluding headers and cookies) PHP should keep internally before pushing that ; data to the client. If your application's output exceeds this setting, PHP ; will send that data in chunks of roughly the size you specify. ; Turning on this setting and managing its maximum buffer size can yield some ; interesting side-effects depending on your application and web server. ; You may be able to send headers and cookies after you've already sent output ; through print or echo. You also may see performance benefits if your server is ; emitting less packets due to buffered output versus PHP streaming the output ; as it gets it. On production servers, 4096 bytes is a good setting for performance ; reasons. ; Note: Output buffering can also be controlled via Output Buffering Control ; functions. ; Possible Values: ; On = Enabled and buffer is unlimited. (Use with caution) ; Off = Disabled ; Integer = Enables the buffer and sets its maximum size in bytes. ; Note: This directive is hardcoded to Off for the CLI SAPI ; Default Value: Off ; Development Value: 4096 ; Production Value: 4096 ; http://php.net/output-buffering output_buffering = 4096 ; You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the specified encoding. ; Setting any output handler automatically turns on output buffering. ; Note: People who wrote portable scripts should not depend on this ini ; directive. Instead, explicitly set the output handler using ob_start(). ; Using this ini directive may cause problems unless you know what script ; is doing. ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" ; and you cannot use both "ob_gzhandler" and "zlib.output_compression". ; Note: output_handler must be empty if this is set 'On' !!!! ; Instead you must use zlib.output_handler. ; http://php.net/output-handler ;output_handler = ; Transparent output compression using the zlib library ; Valid values for this option are 'off', 'on', or a specific buffer size ; to be used for compression (default is 4KB) ; Note: Resulting chunk size may vary due to nature of compression. PHP ; outputs chunks that are few hundreds bytes each as a result of ; compression. If you prefer a larger chunk size for better ; performance, enable output_buffering in addition. ; Note: You need to use zlib.output_handler instead of the standard ; output_handler, or otherwise the output will be corrupted. ; http://php.net/zlib.output-compression zlib.output_compression = Off ; http://php.net/zlib.output-compression-level ;zlib.output_compression_level = -1 ; You cannot specify additional output handlers if zlib.output_compression ; is activated here. This setting does the same as output_handler but in ; a different order. ; http://php.net/zlib.output-handler ;zlib.output_handler = ; Implicit flush tells PHP to tell the output layer to flush itself ; automatically after every output block. This is equivalent to calling the ; PHP function flush() after each and every call to print() or echo() and each ; and every HTML block. Turning this option on has serious performance ; implications and is generally recommended for debugging purposes only. ; http://php.net/implicit-flush ; Note: This directive is hardcoded to On for the CLI SAPI implicit_flush = Off ; The unserialize callback function will be called (with the undefined class' ; name as parameter), if the unserializer finds an undefined class ; which should be instantiated. A warning appears if the specified function is ; not defined, or if the function doesn't include/implement the missing class. ; So only set this entry, if you really want to implement such a ; callback-function. unserialize_callback_func = ; When floats & doubles are serialized store serialize_precision significant ; digits after the floating point. The default value ensures that when floats ; are decoded with unserialize, the data will remain the same. serialize_precision = 17 ; open_basedir, if set, limits all file operations to the defined directory ; and below. This directive makes most sense if used in a per-directory ; or per-virtualhost web server configuration file. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/open-basedir ;open_basedir = ; This directive allows you to disable certain functions for security reasons. ; It receives a comma-delimited list of function names. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/disable-functions disable_functions = ; This directive allows you to disable certain classes for security reasons. ; It receives a comma-delimited list of class names. This directive is ; *NOT* affected by whether Safe Mode is turned On or Off. ; http://php.net/disable-classes disable_classes = ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; would work. ; http://php.net/syntax-highlighting ;highlight.string = #DD0000 ;highlight.comment = #FF9900 ;highlight.keyword = #007700 ;highlight.default = #0000BB ;highlight.html = #000000 ; If enabled, the request will be allowed to complete even if the user aborts ; the request. Consider enabling it if executing long requests, which may end up ; being interrupted by the user or a browser timing out. PHP's default behavior ; is to disable this feature. ; http://php.net/ignore-user-abort ;ignore_user_abort = On ; Determines the size of the realpath cache to be used by PHP. This value should ; be increased on systems where PHP opens many files to reflect the quantity of ; the file operations performed. ; http://php.net/realpath-cache-size ;realpath_cache_size = 16k ; Duration of time, in seconds for which to cache realpath information for a given ; file or directory. For systems with rarely changing files, consider increasing this ; value. ; http://php.net/realpath-cache-ttl ;realpath_cache_ttl = 120 ; Enables or disables the circular reference collector. ; http://php.net/zend.enable-gc zend.enable_gc = On ; If enabled, scripts may be written in encodings that are incompatible with ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such ; encodings. To use this feature, mbstring extension must be enabled. ; Default: Off ;zend.multibyte = Off ; Allows to set the default encoding for the scripts. This value will be used ; unless "declare(encoding=...)" directive appears at the top of the script. ; Only affects if zend.multibyte is set. ; Default: "" ;zend.script_encoding = ;;;;;;;;;;;;;;;;; ; Miscellaneous ; ;;;;;;;;;;;;;;;;; ; Decides whether PHP may expose the fact that it is installed on the server ; (e.g. by adding its signature to the Web server header). It is no security ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. ; http://php.net/expose-php expose_php = On ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 30 ; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly ; long running scripts. ; Note: This directive is hardcoded to -1 for the CLI SAPI ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time max_input_time = 60 ; Maximum input variable nesting level ; http://php.net/max-input-nesting-level ;max_input_nesting_level = 64 ; How many GET/POST/COOKIE input variables may be accepted ; max_input_vars = 1000 ; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Error handling and logging ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This directive informs PHP of which errors, warnings and notices you would like ; it to take action for. The recommended way of setting values for this ; directive is through the use of the error level constants and bitwise ; operators. The error level constants are below here for convenience as well as ; some common settings and their meanings. ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT ; those related to E_NOTICE and E_STRICT, which together cover best practices and ; recommended coding standards in PHP. For performance reasons, this is the ; recommend error reporting setting. Your production server shouldn't be wasting ; resources complaining about best practices and coding standards. That's what ; development servers and development settings are for. ; Note: The php.ini-development file has this setting as E_ALL. This ; means it pretty much reports everything which is exactly what you want during ; development and early testing. ; ; Error Level Constants: ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) ; E_ERROR - fatal run-time errors ; E_RECOVERABLE_ERROR - almost fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it's automatically initialized to an ; empty string) ; E_STRICT - run-time notices, enable to have PHP suggest changes ; to your code which will ensure the best interoperability ; and forward compatibility of your code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING - user-generated warning message ; E_USER_NOTICE - user-generated notice message ; E_DEPRECATED - warn about code that will not work in future versions ; of PHP ; E_USER_DEPRECATED - user-generated deprecation warnings ; ; Common Values: ; E_ALL (Show all errors, warnings and notices including coding standards.) ; E_ALL & ~E_NOTICE (Show all errors, except for notices) ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; http://php.net/error-reporting error_reporting = E_ALL ; This directive controls whether or not and where PHP will output errors, ; notices and warnings too. Error output is very useful during development, but ; it could be very dangerous in production environments. Depending on the code ; which is triggering the error, sensitive information could potentially leak ; out of your application such as database usernames and passwords or worse. ; It's recommended that errors be logged on production servers rather than ; having the errors sent to STDOUT. ; Possible Values: ; Off = Do not display any errors ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) ; On or stdout = Display errors to STDOUT ; Default Value: On ; Development Value: On ; Production Value: Off ; http://php.net/display-errors display_errors = On ; The display of errors which occur during PHP's startup sequence are handled ; separately from display_errors. PHP's default behavior is to suppress those ; errors from clients. Turning the display of startup errors on can be useful in ; debugging configuration problems. But, it's strongly recommended that you ; leave this setting off on production servers. ; Default Value: Off ; Development Value: On ; Production Value: Off ; http://php.net/display-startup-errors display_startup_errors = On ; Besides displaying errors, PHP can also log errors to locations such as a ; server-specific log, STDERR, or a location specified by the error_log ; directive found below. While errors should not be displayed on productions ; servers they should still be monitored and logging is a great way to do that. ; Default Value: Off ; Development Value: On ; Production Value: On ; http://php.net/log-errors log_errors = On ; Set maximum length of log_errors. In error_log information about the source is ; added. The default is 1024 and 0 allows to not apply any maximum length at all. ; http://php.net/log-errors-max-len log_errors_max_len = 1024 ; Do not log repeated messages. Repeated errors must occur in same file on same ; line unless ignore_repeated_source is set true. ; http://php.net/ignore-repeated-errors ignore_repeated_errors = Off ; Ignore source of message when ignoring repeated messages. When this setting ; is On you will not log errors with repeated messages from different files or ; source lines. ; http://php.net/ignore-repeated-source ignore_repeated_source = Off ; If this parameter is set to Off, then memory leaks will not be shown (on ; stdout or in the log). This has only effect in a debug compile, and if ; error reporting includes E_WARNING in the allowed list ; http://php.net/report-memleaks report_memleaks = On ; This setting is on by default. ;report_zend_debug = 0 ; Store the last error/warning message in $php_errormsg (boolean). Setting this value ; to On can assist in debugging and is appropriate for development servers. It should ; however be disabled on production servers. ; Default Value: Off ; Development Value: On ; Production Value: Off ; http://php.net/track-errors track_errors = On ; Turn off normal error reporting and emit XML-RPC error XML ; http://php.net/xmlrpc-errors ;xmlrpc_errors = 0 ; An XML-RPC faultCode ;xmlrpc_error_number = 0 ; When PHP displays or logs an error, it has the capability of formatting the ; error message as HTML for easier reading. This directive controls whether ; the error message is formatted as HTML or not. ; Note: This directive is hardcoded to Off for the CLI SAPI ; Default Value: On ; Development Value: On ; Production value: On ; http://php.net/html-errors html_errors = On ; If html_errors is set to On *and* docref_root is not empty, then PHP ; produces clickable error messages that direct to a page describing the error ; or function causing the error in detail. ; You can download a copy of the PHP manual from http://php.net/docs ; and change docref_root to the base URL of your local copy including the ; leading '/'. You must also specify the file extension being used including ; the dot. PHP's default behavior is to leave these settings empty, in which ; case no links to documentation are generated. ; Note: Never use this feature for production boxes. ; http://php.net/docref-root ; Examples ;docref_root = "/phpmanual/" ; http://php.net/docref-ext ;docref_ext = .html ; String to output before an error message. PHP's default behavior is to leave ; this setting blank. ; http://php.net/error-prepend-string ; Example: ;error_prepend_string = "" ; String to output after an error message. PHP's default behavior is to leave ; this setting blank. ; http://php.net/error-append-string ; Example: ;error_append_string = "" ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. ; http://php.net/error-log ; Example: ;error_log = php_errors.log ; Log errors to syslog (Event Log on Windows). ;error_log = syslog ;windows.show_crt_warning ; Default value: 0 ; Development value: 0 ; Production value: 0 ;;;;;;;;;;;;;;;;; ; Data Handling ; ;;;;;;;;;;;;;;;;; ; The separator used in PHP generated URLs to separate arguments. ; PHP's default setting is "&". ; http://php.net/arg-separator.output ; Example: ;arg_separator.output = "&" ; List of separator(s) used by PHP to parse input URLs into variables. ; PHP's default setting is "&". ; NOTE: Every character in this directive is considered as separator! ; http://php.net/arg-separator.input ; Example: ;arg_separator.input = ";&" ; This directive determines which super global arrays are registered when PHP ; starts up. G,P,C,E & S are abbreviations for the following respective super ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty ; paid for the registration of these arrays and because ENV is not as commonly ; used as the others, ENV is not recommended on productions servers. You ; can still get access to the environment variables through getenv() should you ; need to. ; Default Value: "EGPCS" ; Development Value: "GPCS" ; Production Value: "GPCS"; ; http://php.net/variables-order variables_order = "GPCS" ; This directive determines which super global data (G,P,C,E & S) should ; be registered into the super global array REQUEST. If so, it also determines ; the order in which that data is registered. The values for this directive are ; specified in the same manner as the variables_order directive, EXCEPT one. ; Leaving this value empty will cause PHP to use the value set in the ; variables_order directive. It does not mean it will leave the super globals ; array REQUEST empty. ; Default Value: None ; Development Value: "GP" ; Production Value: "GP" ; http://php.net/request-order request_order = "GP" ; This directive determines whether PHP registers $argv & $argc each time it ; runs. $argv contains an array of all the arguments passed to PHP when a script ; is invoked. $argc contains an integer representing the number of arguments ; that were passed when the script was invoked. These arrays are extremely ; useful when running scripts from the command line. When this directive is ; enabled, registering these variables consumes CPU cycles and memory each time ; a script is executed. For performance reasons, this feature should be disabled ; on production servers. ; Note: This directive is hardcoded to On for the CLI SAPI ; Default Value: On ; Development Value: Off ; Production Value: Off ; http://php.net/register-argc-argv register_argc_argv = Off ; When enabled, the ENV, REQUEST and SERVER variables are created when they're ; first used (Just In Time) instead of when the script starts. If these ; variables are not used within a script, having this directive on will result ; in a performance gain. The PHP directive register_argc_argv must be disabled ; for this directive to have any affect. ; http://php.net/auto-globals-jit auto_globals_jit = On ; Whether PHP will read the POST data. ; This option is enabled by default. ; Most likely, you won't want to disable this option globally. It causes $_POST ; and $_FILES to always be empty; the only way you will be able to read the ; POST data will be through the php://input stream wrapper. This can be useful ; to proxy requests or to process the POST data in a memory efficient fashion. ; http://php.net/enable-post-data-reading ;enable_post_data_reading = Off ; Maximum size of POST data that PHP will accept. ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; http://php.net/post-max-size post_max_size = 8M ; Automatically add files before PHP document. ; http://php.net/auto-prepend-file auto_prepend_file = ; Automatically add files after PHP document. ; http://php.net/auto-append-file auto_append_file = ; By default, PHP will output a character encoding using ; the Content-type: header. To disable sending of the charset, simply ; set it to be empty. ; ; PHP's built-in default is text/html ; http://php.net/default-mimetype default_mimetype = "text/html" ; PHP's default character set is set to empty. ; http://php.net/default-charset ;default_charset = "UTF-8" ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is ; to disable this feature. If post reading is disabled through ; enable_post_data_reading, $HTTP_RAW_POST_DATA is *NOT* populated. ; http://php.net/always-populate-raw-post-data ;always_populate_raw_post_data = On ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" ; ; Windows: "\path1;\path2" ;include_path = ".;c:\php\includes" ; ; PHP's default setting for include_path is ".;/path/to/php/pear" ; http://php.net/include-path ; The root of the PHP pages, used only if nonempty. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server (other than IIS) ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below ; http://php.net/doc-root doc_root = ; The directory under which PHP opens the script using /~username used only ; if nonempty. ; http://php.net/user-dir user_dir = ; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir ; extension_dir = "./" ; On windows: ; extension_dir = "ext" ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically ; disabled on them. ; http://php.net/enable-dl enable_dl = Off ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** ; http://php.net/cgi.force-redirect ;cgi.force_redirect = 1 ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with ; every request. PHP's default behavior is to disable this feature. ;cgi.nph = 1 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; http://php.net/cgi.redirect-status-env ;cgi.redirect_status_env = ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. ; http://php.net/cgi.fix-pathinfo ;cgi.fix_pathinfo=1 ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate ; security tokens of the calling client. This allows IIS to define the ; security context that the request runs under. mod_fastcgi under Apache ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. ; http://php.net/fastcgi.impersonate ;fastcgi.impersonate = 1 ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. ;fastcgi.logging = 0 ; cgi.rfc2616_headers configuration option tells PHP what type of headers to ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that ; is supported by Apache. When this option is set to 1 PHP will send ; RFC2616 compliant header. ; Default is zero. ; http://php.net/cgi.rfc2616-headers ;cgi.rfc2616_headers = 0 ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; http://php.net/file-uploads file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; http://php.net/upload-tmp-dir ;upload_tmp_dir = ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 2M ; Maximum number of files that can be uploaded via a single request max_file_uploads = 20 ;;;;;;;;;;;;;;;;;; ; Fopen wrappers ; ;;;;;;;;;;;;;;;;;; ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. ; http://php.net/allow-url-fopen allow_url_fopen = On ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. ; http://php.net/allow-url-include allow_url_include = Off ; Define the anonymous ftp password (your email address). PHP's default setting ; for this is empty. ; http://php.net/from ;from="john@doe.com" ; Define the User-Agent string. PHP's default setting for this is empty. ; http://php.net/user-agent ;user_agent="PHP" ; Default timeout for socket based streams (seconds) ; http://php.net/default-socket-timeout default_socket_timeout = 60 ; If your scripts have to deal with files from Macintosh systems, ; or you are running on a Mac and need to deal with files from ; unix or win32 systems, setting this flag will cause PHP to ; automatically detect the EOL character in those files so that ; fgets() and file() will work regardless of the source of the file. ; http://php.net/auto-detect-line-endings ;auto_detect_line_endings = Off ;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; ; If you wish to have an extension loaded automatically, use the following ; syntax: ; ; extension=modulename.extension ; ; For example, on Windows: ; ; extension=msql.dll ; ; ... or under UNIX: ; ; extension=msql.so ; ; ... or with a path: ; ; extension=/path/to/extension/msql.so ; ; If you only provide the name of the extension, PHP will look for it in its ; default extension directory. ; ; Windows Extensions ; Note that ODBC support is built in, so no dll is needed for it. ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) ; extension folders as well as the separate PECL DLL download (PHP 5). ; Be sure to appropriately set the extension_dir directive. ; ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_fileinfo.dll ;extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_intl.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll ;extension=php_mbstring.dll ;extension=php_exif.dll ; Must be after mbstring as it depends on it ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client ;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client ;extension=php_openssl.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll ;extension=php_pdo_sqlite.dll ;extension=php_pgsql.dll ;extension=php_pspell.dll ;extension=php_shmop.dll ; The MIBS data available in the PHP distribution must be installed. ; See http://www.php.net/manual/en/snmp.installation.php ;extension=php_snmp.dll ;extension=php_soap.dll ;extension=php_sockets.dll ;extension=php_sqlite3.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll ;;;;;;;;;;;;;;;;;;; ; Module Settings ; ;;;;;;;;;;;;;;;;;;; [CLI Server] ; Whether the CLI web server uses ANSI color coding in its terminal output. cli_server.color = On [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone ;date.timezone = ; http://php.net/date.default-latitude ;date.default_latitude = 31.7667 ; http://php.net/date.default-longitude ;date.default_longitude = 35.2333 ; http://php.net/date.sunrise-zenith ;date.sunrise_zenith = 90.583333 ; http://php.net/date.sunset-zenith ;date.sunset_zenith = 90.583333 [filter] ; http://php.net/filter.default ;filter.default = unsafe_raw ; http://php.net/filter.default-flags ;filter.default_flags = [iconv] ;iconv.input_encoding = ISO-8859-1 ;iconv.internal_encoding = ISO-8859-1 ;iconv.output_encoding = ISO-8859-1 [intl] ;intl.default_locale = ; This directive allows you to produce PHP errors when some error ; happens within intl functions. The value is the level of the error produced. ; Default is 0, which does not produce any errors. ;intl.error_level = E_WARNING [sqlite] ; http://php.net/sqlite.assoc-case ;sqlite.assoc_case = 0 [sqlite3] ;sqlite3.extension_dir = [Pcre] ;PCRE library backtracking limit. ; http://php.net/pcre.backtrack-limit ;pcre.backtrack_limit=100000 ;PCRE library recursion limit. ;Please note that if you set this value to a high number you may consume all ;the available process stack and eventually crash PHP (due to reaching the ;stack size limit imposed by the Operating System). ; http://php.net/pcre.recursion-limit ;pcre.recursion_limit=100000 [Pdo] ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" ; http://php.net/pdo-odbc.connection-pooling ;pdo_odbc.connection_pooling=strict ;pdo_odbc.db2_instance_name [Pdo_mysql] ; If mysqlnd is used: Number of cache slots for the internal result set cache ; http://php.net/pdo_mysql.cache_size pdo_mysql.cache_size = 2000 ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. ; http://php.net/pdo_mysql.default-socket pdo_mysql.default_socket= [Phar] ; http://php.net/phar.readonly ;phar.readonly = On ; http://php.net/phar.require-hash ;phar.require_hash = On ;phar.cache_list = [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = On ; The path to a log file that will log all mail() calls. Log entries include ; the full path of the script, line number, To address and headers. ;mail.log = ; Log mail to syslog (Event Log on Windows). ;mail.log = syslog [SQL] ; http://php.net/sql.safe-mode sql.safe_mode = Off [ODBC] ; http://php.net/odbc.default-db ;odbc.default_db = Not yet implemented ; http://php.net/odbc.default-user ;odbc.default_user = Not yet implemented ; http://php.net/odbc.default-pw ;odbc.default_pw = Not yet implemented ; Controls the ODBC cursor model. ; Default: SQL_CURSOR_STATIC (default). ;odbc.default_cursortype ; Allow or prevent persistent links. ; http://php.net/odbc.allow-persistent odbc.allow_persistent = On ; Check that a connection is still valid before reuse. ; http://php.net/odbc.check-persistent odbc.check_persistent = On ; Maximum number of persistent links. -1 means no limit. ; http://php.net/odbc.max-persistent odbc.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ; http://php.net/odbc.max-links odbc.max_links = -1 ; Handling of LONG fields. Returns number of bytes to variables. 0 means ; passthru. ; http://php.net/odbc.defaultlrl odbc.defaultlrl = 4096 ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation ; of odbc.defaultlrl and odbc.defaultbinmode ; http://php.net/odbc.defaultbinmode odbc.defaultbinmode = 1 ;birdstep.max_links = -1 [Interbase] ; Allow or prevent persistent links. ibase.allow_persistent = 1 ; Maximum number of persistent links. -1 means no limit. ibase.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ibase.max_links = -1 ; Default database name for ibase_connect(). ;ibase.default_db = ; Default username for ibase_connect(). ;ibase.default_user = ; Default password for ibase_connect(). ;ibase.default_password = ; Default charset for ibase_connect(). ;ibase.default_charset = ; Default timestamp format. ibase.timestampformat = "%Y-%m-%d %H:%M:%S" ; Default date format. ibase.dateformat = "%Y-%m-%d" ; Default time format. ibase.timeformat = "%H:%M:%S" [MySQL] ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements ; http://php.net/mysql.allow_local_infile mysql.allow_local_infile = On ; Allow or prevent persistent links. ; http://php.net/mysql.allow-persistent mysql.allow_persistent = On ; If mysqlnd is used: Number of cache slots for the internal result set cache ; http://php.net/mysql.cache_size mysql.cache_size = 2000 ; Maximum number of persistent links. -1 means no limit. ; http://php.net/mysql.max-persistent mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ; http://php.net/mysql.max-links mysql.max_links = -1 ; Default port number for mysql_connect(). If unset, mysql_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look ; at MYSQL_PORT. ; http://php.net/mysql.default-port mysql.default_port = ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. ; http://php.net/mysql.default-socket mysql.default_socket = ; Default host for mysql_connect() (doesn't apply in safe mode). ; http://php.net/mysql.default-host mysql.default_host = ; Default user for mysql_connect() (doesn't apply in safe mode). ; http://php.net/mysql.default-user mysql.default_user = ; Default password for mysql_connect() (doesn't apply in safe mode). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") ; and reveal this password! And of course, any users with read access to this ; file will be able to reveal the password as well. ; http://php.net/mysql.default-password mysql.default_password = ; Maximum time (in seconds) for connect timeout. -1 means no limit ; http://php.net/mysql.connect-timeout mysql.connect_timeout = 60 ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and ; SQL-Errors will be displayed. ; http://php.net/mysql.trace-mode mysql.trace_mode = Off [MySQLi] ; Maximum number of persistent links. -1 means no limit. ; http://php.net/mysqli.max-persistent mysqli.max_persistent = -1 ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements ; http://php.net/mysqli.allow_local_infile ;mysqli.allow_local_infile = On ; Allow or prevent persistent links. ; http://php.net/mysqli.allow-persistent mysqli.allow_persistent = On ; Maximum number of links. -1 means no limit. ; http://php.net/mysqli.max-links mysqli.max_links = -1 ; If mysqlnd is used: Number of cache slots for the internal result set cache ; http://php.net/mysqli.cache_size mysqli.cache_size = 2000 ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look ; at MYSQL_PORT. ; http://php.net/mysqli.default-port mysqli.default_port = 3306 ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. ; http://php.net/mysqli.default-socket mysqli.default_socket = ; Default host for mysql_connect() (doesn't apply in safe mode). ; http://php.net/mysqli.default-host mysqli.default_host = ; Default user for mysql_connect() (doesn't apply in safe mode). ; http://php.net/mysqli.default-user mysqli.default_user = ; Default password for mysqli_connect() (doesn't apply in safe mode). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") ; and reveal this password! And of course, any users with read access to this ; file will be able to reveal the password as well. ; http://php.net/mysqli.default-pw mysqli.default_pw = ; Allow or prevent reconnect mysqli.reconnect = Off [mysqlnd] ; Enable / Disable collection of general statistics by mysqlnd which can be ; used to tune and monitor MySQL operations. ; http://php.net/mysqlnd.collect_statistics mysqlnd.collect_statistics = On ; Enable / Disable collection of memory usage statistics by mysqlnd which can be ; used to tune and monitor MySQL operations. ; http://php.net/mysqlnd.collect_memory_statistics mysqlnd.collect_memory_statistics = On ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. ; http://php.net/mysqlnd.net_cmd_buffer_size ;mysqlnd.net_cmd_buffer_size = 2048 ; Size of a pre-allocated buffer used for reading data sent by the server in ; bytes. ; http://php.net/mysqlnd.net_read_buffer_size ;mysqlnd.net_read_buffer_size = 32768 [OCI8] ; Connection: Enables privileged connections using external ; credentials (OCI_SYSOPER, OCI_SYSDBA) ; http://php.net/oci8.privileged-connect ;oci8.privileged_connect = Off ; Connection: The maximum number of persistent OCI8 connections per ; process. Using -1 means no limit. ; http://php.net/oci8.max-persistent ;oci8.max_persistent = -1 ; Connection: The maximum number of seconds a process is allowed to ; maintain an idle persistent connection. Using -1 means idle ; persistent connections will be maintained forever. ; http://php.net/oci8.persistent-timeout ;oci8.persistent_timeout = -1 ; Connection: The number of seconds that must pass before issuing a ; ping during oci_pconnect() to check the connection validity. When ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables ; pings completely. ; http://php.net/oci8.ping-interval ;oci8.ping_interval = 60 ; Connection: Set this to a user chosen connection class to be used ; for all pooled server requests with Oracle 11g Database Resident ; Connection Pooling (DRCP). To use DRCP, this value should be set to ; the same string for all web servers running the same application, ; the database pool must be configured, and the connection string must ; specify to use a pooled server. ;oci8.connection_class = ; High Availability: Using On lets PHP receive Fast Application ; Notification (FAN) events generated when a database node fails. The ; database must also be configured to post FAN events. ;oci8.events = Off ; Tuning: This option enables statement caching, and specifies how ; many statements to cache. Using 0 disables statement caching. ; http://php.net/oci8.statement-cache-size ;oci8.statement_cache_size = 20 ; Tuning: Enables statement prefetching and sets the default number of ; rows that will be fetched automatically after statement execution. ; http://php.net/oci8.default-prefetch ;oci8.default_prefetch = 100 ; Compatibility. Using On means oci_close() will not close ; oci_connect() and oci_new_connect() connections. ; http://php.net/oci8.old-oci-close-semantics ;oci8.old_oci_close_semantics = Off [PostgreSQL] ; Allow or prevent persistent links. ; http://php.net/pgsql.allow-persistent pgsql.allow_persistent = On ; Detect broken persistent links always with pg_pconnect(). ; Auto reset feature requires a little overheads. ; http://php.net/pgsql.auto-reset-persistent pgsql.auto_reset_persistent = Off ; Maximum number of persistent links. -1 means no limit. ; http://php.net/pgsql.max-persistent pgsql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. ; http://php.net/pgsql.max-links pgsql.max_links = -1 ; Ignore PostgreSQL backends Notice message or not. ; Notice message logging require a little overheads. ; http://php.net/pgsql.ignore-notice pgsql.ignore_notice = 0 ; Log PostgreSQL backends Notice message or not. ; Unless pgsql.ignore_notice=0, module cannot log notice message. ; http://php.net/pgsql.log-notice pgsql.log_notice = 0 [Sybase-CT] ; Allow or prevent persistent links. ; http://php.net/sybct.allow-persistent sybct.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. ; http://php.net/sybct.max-persistent sybct.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ; http://php.net/sybct.max-links sybct.max_links = -1 ; Minimum server message severity to display. ; http://php.net/sybct.min-server-severity sybct.min_server_severity = 10 ; Minimum client message severity to display. ; http://php.net/sybct.min-client-severity sybct.min_client_severity = 10 ; Set per-context timeout ; http://php.net/sybct.timeout ;sybct.timeout= ;sybct.packet_size ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. ; Default: one minute ;sybct.login_timeout= ; The name of the host you claim to be connecting from, for display by sp_who. ; Default: none ;sybct.hostname= ; Allows you to define how often deadlocks are to be retried. -1 means "forever". ; Default: 0 ;sybct.deadlock_retry_count= [bcmath] ; Number of decimal digits for all bcmath functions. ; http://php.net/bcmath.scale bcmath.scale = 0 [browscap] ; http://php.net/browscap ;browscap = extra/browscap.ini [Session] ; Handler used to store/retrieve data. ; http://php.net/session.save-handler session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. ; ; The path can be defined as: ; ; session.save_path = "N;/path" ; ; where N is an integer. Instead of storing all the session files in ; /path, what this will do is use subdirectories N-levels deep, and ; store the session data in those directories. This is useful if you ; or your OS have problems with lots of files in one directory, and is ; a more efficient layout for servers that handle lots of sessions. ; ; NOTE 1: PHP will not create this directory structure automatically. ; You can use the script in the ext/session dir for that purpose. ; NOTE 2: See the section on garbage collection below if you choose to ; use subdirectories for session storage ; ; The file storage module creates files using mode 600 by default. ; You can change that by using ; ; session.save_path = "N;MODE;/path" ; ; where MODE is the octal representation of the mode. Note that this ; does not overwrite the process's umask. ; http://php.net/session.save-path ;session.save_path = "/tmp" ; Whether to use cookies. ; http://php.net/session.use-cookies session.use_cookies = 1 ; http://php.net/session.cookie-secure ;session.cookie_secure = ; This option forces PHP to fetch and use a cookie for storing and maintaining ; the session id. We encourage this operation as it's very helpful in combating ; session hijacking when not specifying and managing your own session id. It is ; not the end all be all of session hijacking defense, but it's a good start. ; http://php.net/session.use-only-cookies session.use_only_cookies = 1 ; Name of the session (used as cookie name). ; http://php.net/session.name session.name = PHPSESSID ; Initialize session on request startup. ; http://php.net/session.auto-start session.auto_start = 0 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. ; http://php.net/session.cookie-lifetime session.cookie_lifetime = 0 ; The path for which the cookie is valid. ; http://php.net/session.cookie-path session.cookie_path = / ; The domain for which the cookie is valid. ; http://php.net/session.cookie-domain session.cookie_domain = ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. ; http://php.net/session.cookie-httponly session.cookie_httponly = ; Handler used to serialize data. php is the standard serializer of PHP. ; http://php.net/session.serialize-handler session.serialize_handler = php ; Defines the probability that the 'garbage collection' process is started ; on every session initialization. The probability is calculated by using ; gc_probability/gc_divisor. Where session.gc_probability is the numerator ; and gc_divisor is the denominator in the equation. Setting this value to 1 ; when the session.gc_divisor value is 100 will give you approximately a 1% chance ; the gc will run on any give request. ; Default Value: 1 ; Development Value: 1 ; Production Value: 1 ; http://php.net/session.gc-probability session.gc_probability = 1 ; Defines the probability that the 'garbage collection' process is started on every ; session initialization. The probability is calculated by using the following equation: ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and ; session.gc_divisor is the denominator in the equation. Setting this value to 1 ; when the session.gc_divisor value is 100 will give you approximately a 1% chance ; the gc will run on any give request. Increasing this value to 1000 will give you ; a 0.1% chance the gc will run on any give request. For high volume production servers, ; this is a more efficient approach. ; Default Value: 100 ; Development Value: 1000 ; Production Value: 1000 ; http://php.net/session.gc-divisor session.gc_divisor = 1000 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. ; http://php.net/session.gc-maxlifetime session.gc_maxlifetime = 1440 ; NOTE: If you are using the subdirectory option for storing session files ; (see session.save_path above), then garbage collection does *not* ; happen automatically. You will need to do your own garbage ; collection through a shell script, cron entry, or some other method. ; For example, the following script would is the equivalent of ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): ; find /path/to/sessions -cmin +24 -type f | xargs rm ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. ; http://php.net/session.referer-check session.referer_check = ; How many bytes to read from the file. ; http://php.net/session.entropy-length ;session.entropy_length = 32 ; Specified here to create the session id. ; http://php.net/session.entropy-file ; Defaults to /dev/urandom ; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom ; If neither are found at compile time, the default is no entropy file. ; On windows, setting the entropy_length setting will activate the ; Windows random source (using the CryptoAPI) ;session.entropy_file = /dev/urandom ; Set to {nocache,private,public,} to determine HTTP caching aspects ; or leave this empty to avoid sending anti-caching headers. ; http://php.net/session.cache-limiter session.cache_limiter = nocache ; Document expires after n minutes. ; http://php.net/session.cache-expire session.cache_expire = 180 ; trans sid support is disabled by default. ; Use of trans sid may risk your users security. ; Use this option with caution. ; - User may send URL contains active session ID ; to other person via. email/irc/etc. ; - URL that contains active session ID may be stored ; in publicly accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. ; http://php.net/session.use-trans-sid session.use_trans_sid = 0 ; Select a hash function for use in generating session ids. ; Possible Values ; 0 (MD5 128 bits) ; 1 (SHA-1 160 bits) ; This option may also be set to the name of any hash function supported by ; the hash extension. A list of available hashes is returned by the hash_algos() ; function. ; http://php.net/session.hash-function session.hash_function = 0 ; Define how many bits are stored in each character when converting ; the binary hash data to something readable. ; Possible values: ; 4 (4 bits: 0-9, a-f) ; 5 (5 bits: 0-9, a-v) ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") ; Default Value: 4 ; Development Value: 5 ; Production Value: 5 ; http://php.net/session.hash-bits-per-character session.hash_bits_per_character = 5 ; The URL rewriter will look for URLs in a defined set of HTML tags. ; form/fieldset are special; if you include them here, the rewriter will ; add a hidden field with the info which is otherwise appended ; to URLs. If you want XHTML conformity, remove the form entry. ; Note that all valid entries require a "=", even if no value follows. ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" ; http://php.net/url-rewriter.tags url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" ; Enable upload progress tracking in $_SESSION ; Default Value: On ; Development Value: On ; Production Value: On ; http://php.net/session.upload-progress.enabled ;session.upload_progress.enabled = On ; Cleanup the progress information as soon as all POST data has been read ; (i.e. upload completed). ; Default Value: On ; Development Value: On ; Production Value: On ; http://php.net/session.upload-progress.cleanup ;session.upload_progress.cleanup = On ; A prefix used for the upload progress key in $_SESSION ; Default Value: "upload_progress_" ; Development Value: "upload_progress_" ; Production Value: "upload_progress_" ; http://php.net/session.upload-progress.prefix ;session.upload_progress.prefix = "upload_progress_" ; The index name (concatenated with the prefix) in $_SESSION ; containing the upload progress information ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" ; http://php.net/session.upload-progress.name ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" ; How frequently the upload progress should be updated. ; Given either in percentages (per-file), or in bytes ; Default Value: "1%" ; Development Value: "1%" ; Production Value: "1%" ; http://php.net/session.upload-progress.freq ;session.upload_progress.freq = "1%" ; The minimum delay between updates, in seconds ; Default Value: 1 ; Development Value: 1 ; Production Value: 1 ; http://php.net/session.upload-progress.min-freq ;session.upload_progress.min_freq = "1" [MSSQL] ; Allow or prevent persistent links. mssql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mssql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. mssql.max_links = -1 ; Minimum error severity to display. mssql.min_error_severity = 10 ; Minimum message severity to display. mssql.min_message_severity = 10 ; Compatibility mode with old versions of PHP 3.0. mssql.compatability_mode = Off ; Connect timeout ;mssql.connect_timeout = 5 ; Query timeout ;mssql.timeout = 60 ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textlimit = 4096 ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textsize = 4096 ; Limits the number of records in each batch. 0 = all records in one batch. ;mssql.batchsize = 0 ; Specify how datetime and datetim4 columns are returned ; On => Returns data converted to SQL server settings ; Off => Returns values as YYYY-MM-DD hh:mm:ss ;mssql.datetimeconvert = On ; Use NT authentication when connecting to the server mssql.secure_connection = Off ; Specify max number of processes. -1 = library default ; msdlib defaults to 25 ; FreeTDS defaults to 4096 ;mssql.max_procs = -1 ; Specify client character set. ; If empty or not set the client charset from freetds.conf is used ; This is only used when compiled with FreeTDS ;mssql.charset = "ISO-8859-1" [Assertion] ; Assert(expr); active by default. ; http://php.net/assert.active ;assert.active = On ; Issue a PHP warning for each failed assertion. ; http://php.net/assert.warning ;assert.warning = On ; Don't bail out by default. ; http://php.net/assert.bail ;assert.bail = Off ; User-function to be called if an assertion fails. ; http://php.net/assert.callback ;assert.callback = 0 ; Eval the expression with current error_reporting(). Set to true if you want ; error_reporting(0) around the eval(). ; http://php.net/assert.quiet-eval ;assert.quiet_eval = 0 [COM] ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs ; http://php.net/com.typelib-file ;com.typelib_file = ; allow Distributed-COM calls ; http://php.net/com.allow-dcom ;com.allow_dcom = true ; autoregister constants of a components typlib on com_load() ; http://php.net/com.autoregister-typelib ;com.autoregister_typelib = true ; register constants casesensitive ; http://php.net/com.autoregister-casesensitive ;com.autoregister_casesensitive = false ; show warnings on duplicate constant registrations ; http://php.net/com.autoregister-verbose ;com.autoregister_verbose = true ; The default character set code-page to use when passing strings to and from COM objects. ; Default: system ANSI code page ;com.code_page= [mbstring] ; language for internal character representation. ; http://php.net/mbstring.language ;mbstring.language = Japanese ; internal/script encoding. ; Some encoding cannot work as internal encoding. ; (e.g. SJIS, BIG5, ISO-2022-*) ; http://php.net/mbstring.internal-encoding ;mbstring.internal_encoding = EUC-JP ; http input encoding. ; http://php.net/mbstring.http-input ;mbstring.http_input = auto ; http output encoding. mb_output_handler must be ; registered as output buffer to function ; http://php.net/mbstring.http-output ;mbstring.http_output = SJIS ; enable automatic encoding translation according to ; mbstring.internal_encoding setting. Input chars are ; converted to internal encoding by setting this to On. ; Note: Do _not_ use automatic encoding translation for ; portable libs/applications. ; http://php.net/mbstring.encoding-translation ;mbstring.encoding_translation = Off ; automatic encoding detection order. ; auto means ; http://php.net/mbstring.detect-order ;mbstring.detect_order = auto ; substitute_character used when character cannot be converted ; one from another ; http://php.net/mbstring.substitute-character ;mbstring.substitute_character = none; ; overload(replace) single byte functions by mbstring functions. ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), ; etc. Possible values are 0,1,2,4 or combination of them. ; For example, 7 for overload everything. ; 0: No overload ; 1: Overload mail() function ; 2: Overload str*() functions ; 4: Overload ereg*() functions ; http://php.net/mbstring.func-overload ;mbstring.func_overload = 0 ; enable strict encoding detection. ;mbstring.strict_detection = Off ; This directive specifies the regex pattern of content types for which mb_output_handler() ; is activated. ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) ;mbstring.http_output_conv_mimetype= [gd] ; Tell the jpeg decode to ignore warnings and try to create ; a gd image. The warning will then be displayed as notices ; disabled by default ; http://php.net/gd.jpeg-ignore-warning ;gd.jpeg_ignore_warning = 0 [exif] ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. ; With mbstring support this will automatically be converted into the encoding ; given by corresponding encode setting. When empty mbstring.internal_encoding ; is used. For the decode settings you can distinguish between motorola and ; intel byte order. A decode setting cannot be empty. ; http://php.net/exif.encode-unicode ;exif.encode_unicode = ISO-8859-15 ; http://php.net/exif.decode-unicode-motorola ;exif.decode_unicode_motorola = UCS-2BE ; http://php.net/exif.decode-unicode-intel ;exif.decode_unicode_intel = UCS-2LE ; http://php.net/exif.encode-jis ;exif.encode_jis = ; http://php.net/exif.decode-jis-motorola ;exif.decode_jis_motorola = JIS ; http://php.net/exif.decode-jis-intel ;exif.decode_jis_intel = JIS [Tidy] ; The path to a default tidy configuration file to use when using tidy ; http://php.net/tidy.default-config ;tidy.default_config = /usr/local/lib/php/default.tcfg ; Should tidy clean and repair output automatically? ; WARNING: Do not use this option if you are generating non-html content ; such as dynamic images ; http://php.net/tidy.clean-output tidy.clean_output = Off [soap] ; Enables or disables WSDL caching feature. ; http://php.net/soap.wsdl-cache-enabled soap.wsdl_cache_enabled=1 ; Sets the directory name where SOAP extension will put cache files. ; http://php.net/soap.wsdl-cache-dir soap.wsdl_cache_dir="/tmp" ; (time to live) Sets the number of second while cached file will be used ; instead of original one. ; http://php.net/soap.wsdl-cache-ttl soap.wsdl_cache_ttl=86400 ; Sets the size of the cache limit. (Max. number of WSDL files to cache) soap.wsdl_cache_limit = 5 [sysvshm] ; A default size of the shared memory segment ;sysvshm.init_mem = 10000 [ldap] ; Sets the maximum number of open links or -1 for unlimited. ldap.max_links = -1 [mcrypt] ; For more information about mcrypt settings see http://php.net/mcrypt-module-open ; Directory where to load mcrypt algorithms ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) ;mcrypt.algorithms_dir= ; Directory where to load mcrypt modes ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) ;mcrypt.modes_dir= [dba] ;dba.default_handler= [curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. ;curl.cainfo = ; Local Variables: ; tab-width: 4 ; End:

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧