[ Team LiB ] Previous Section

Glossary

.htaccess file

A document read by the Apache server that can contain certain server directives. The server administrator can control which available directives (if any) are allowed to be set in a .htaccess file on a directory-by-directory basis. If allowed, directives can affect the current directory and those below it. .htaccess files can contain PHP directives prefixed by php_flag or php_value. The .htaccess file can also be used to set an AddType directive that can change the extension associated by the server with PHP documents.



abstract class

A class that is partially implemented and explicitly declared as such. Unimplemented methods are declared abstract and consist of method signatures only. Classes that extend abstract classes must implement all abstract methods or be declared abstract themselves.



anonymous function

A function that is created on-the-fly during script execution and stored in a variable or passed to other functions.



argument

A value passed to a function or method. Arguments are included within the parentheses of a function call. User-defined functions include comma-separated argument names within the parentheses of the function definition. These arguments then become available to the function as local variables.



array

A list variable. That is, a variable that contains multiple elements indexed by numbers or strings. It enables you to store, order, and access many values under one name. An array is a data type.



associative array

An array indexed by strings.



atom

With reference to regular expressions an atom is a pattern enclosed in parentheses (often referred to as a subpattern). After you have defined an atom, you can treat it as if it were itself a character or character class.



Boolean

A data type. Booleans can contain one of the special values true or false.



bounds

The number of times a character or range of characters should be matched in a regular expression.



break statement

Consists of the keyword break. It forces the immediate end of a for or while loop iteration, and no further iterations of the loop take place.



cast

The process by which one data type is converted to another.



class

A collection of special functions called methods and special variables called properties. You can declare a class with the class keyword. Classes are the templates from which objects are created.



color resource

A special value of the data type resource. It is returned by the imagecolorallocate() function and passed to other image manipulation functions, which can then work with the specified color.



comment

Text in a script that is ignored by the interpreter. Comments can be used to make code more readable or to annotate a script.



comparison operator

In the form ==, this operator compares two operands and tests for equivalence. It resolves to the Boolean true value if the two operands are equivalent and false otherwise. In the form ===, the operator tests two object variables, returning true only if both variables are references to the same object.



constant

Outside of a class, a constant is a value that is set with the define() function and does not change throughout the execution of a script. A constant is global in scope and can be only a number or string. In the context of a class, a constant is a special property declared with the const keyword. A constant property cannot be changed at runtime and is available via the class rather than a class instance.



constructor

A special method that is automatically called when an object is instantiated.



continue statement

Consists of the keyword continue. It forces the immediate end of the current for or while loop iteration. Execution begins again from the test expression (in for loops the modification expression is executed first) and the next loop iteration is begun if the expression resolves to true.



conversion specification

Contained within a format control string, a conversion specification begins with a percent (%) symbol and defines how to treat the corresponding argument to printf() or sprintf(). You can include as many conversion specifications as you want within the format control string, as long as you send an equivalent number of arguments to printf().



cookie

A small amount of data stored by the user's browser in compliance with a request from a server or script.



data type

Different types of data take up different amounts of memory and behave in different ways when operated on. A data type is the named means by which these different kinds of data are distinguished. PHP has eight data types: integer, double, string, Boolean, object, array, resource, and NULL.



DBA

Database abstraction layer. These functions are designed to provide a common interface to a range of file-based database systems.



DBA resource

A special value of the data type resource. It is returned by the dba_open() function and passed to other DBA functions, which can then work with the open database.



DBM

Database manager. DBM and DBM-like systems enable you to store and manipulate name/value pairs on your system.



destructor

A special method automatically invoked just before an object is removed from memory.



document object model (DOM)

A means of accessing an XML document that involves the generation of a tree of nodes organized as parents, children, and siblings.



document type definition (DTD)

A set of rules that determines which XML elements can be used in which order for an XML document. A validating XML parser reads a DTD and enforces the rules it describes.



double

A data type. Also known as a float, a floating-point number, or a real number, a double is defined by The Free On-line Dictionary of Computing as "a number representation consisting of a mantissa [the part after the decimal point], ... an exponent, ... and an (assumed) radix (or "base")." For the purposes of this book, you can think of a double as a number that can contain a fraction of a whole number—that is, a number with a decimal point.



else statement

It can be used only in the context of an if statement. The else statement consists of the keyword else and a statement (or series of statements). These statements are executed only if the test expression of the associated if statement evaluates to false.



entity body

The substance of a document returned by a server to a client. An entity body can also be sent by a client to a server as part of a POST request.



escape

The practice of removing special significance from characters within strings or regular expressions by preceding them with a backslash character (\).



exception

A special object that can be thrown by a method with the throw keyword. An exception object must be of type Exception and includes a message and other error information. Throwing an exception causes a method's execution to end. The calling code is then responsible for handling the exception using the catch keyword.



expression

Any combination of functions, values, and operators that resolves to a value. As a rule of thumb, if you can use it as if it were a value, it is an expression.



field width specifier

Contained within a conversion specification, a field width specifier determines the space within which output should be formatted.



file resource

A special value of the data type resource. It is returned by the fopen() function and passed to other file functions, which can then work with the open file.



float

A data type. It is a synonym for double.



for statement

A loop that can initialize a counter variable (initialization expression), test a counter variable (test expression), and modify a counter variable (modification expression) on a single line. As long as the test expression evaluates to true, the loop statement continues to be executed.



foreach statement

A loop used to iterate through every element in an array. The loop automatically populates temporary variables with the next array key and values for each iteration.



format control string

The first argument to printf() or sprintf(). It contains conversion specifications that determine the way in which additional arguments to these functions are formatted.



Freetype

An open-source library providing functionality for working with TrueType fonts. The two versions are FreeType 1 and FreeType 2. Both libraries can be used by PHP's image functions to render text in images.



function

A block of code that is not immediately executed but can be called by your scripts when needed. Functions can be built-in or user-defined. They can require information to be passed to them and usually return a value.



GET request

A request made to a server by a client in which additional information can be sent appended to the URL.



global

Consists of the keyword global followed by a variable(s). It causes the associated variables to be accessed in global rather than local scope.



header section

Part of an HTTP request or response (it follows the request line or response line). It consists of name/value pairs on separate lines. Names are separated from values by colons.



hint

The name of an object type used to qualify an argument in a method declaration. When the method is invoked, it must be passed an object of the defined type for that argument; otherwise, the script fails.



Hypertext Transfer Protocol (HTTP)

A set of rules that defines the process by which a client sends a request and a server returns a response.



if statement

Consists of a test expression and a statement or series of statements. The statement is executed only if the test expression evaluates to true.



image resource

A special value of the data type resource. It is returned by the imagecreate() function and passed to other image manipulation functions, which can then work with the dynamic image.



inheritance

A term used in the context of object-oriented programming. It is used to describe the process by which one class is set up to include the member variables and methods of another. This is achieved using the extends keyword when the child class is declared.



integer

A data type. Integers include all whole negative and positive numbers and zero.



iteration

A single execution of a statement (or series of statements) associated with a loop. A loop that executes five times has five iterations.



interface

A special class that contains only method signatures. An interface must contain no implementation at all. Classes that implement an interface must implement every method it defines. A class can implement any number of interfaces and takes on the type of any interface it implements.



link resource

A special value of the data type resource. It is returned by the mysql_connect() function and passed to other MySQL functions, which can then work with the open database.



method

A special function, available only in the context of a class or object.



multidimensional array

An array that contains another array as one of its elements.



NULL

A special data type. It consists of the value NULL and represents an uninitialized variable—that is, a variable that holds no value.



object

Existing in memory rather than as code, an object is an instance of a class, meaning it's the working embodiment of the functionality laid down in a class. An object is instantiated with the new statement in conjunction with the name of the class of which it is to be a member. When an object is instantiated, you can access all its properties and all its methods. An object is a data type.



operand

A value used in conjunction with an operator. There are usually two operands to one operator.



operator

A symbol or series of symbols that, when used in conjunction with values, performs an action and usually produces a new value.



padding specifier

Contained within a conversion specification, a padding specifier determines the number of characters that output should occupy and the characters to add otherwise.



pattern modifier

A letter placed after the final delimiter in Perlcompatible regular expressions to refine their behavior.



PEAR

The PHP Extension and Application Repository. A qualitycontrolled library of PHP packages designed to extend the usefulness of PHP.



PEAR::Auth

A PEAR package that provides methods for authenticating visitors using usernames and passwords.



PEAR::Config

A PEAR package for writing to and reading from configuration files.



PEAR::DB

A PEAR package that provides a common interface for talking to many databases.



php.ini

The configuration file that determines the way in which PHP runs. The file contains directives that specify a wide range of rules and behaviors.



phpDocumentor

A package for producing documentation using comments embedded in source code. It's part of PEAR.



POST request

A request made to a server by a client in which additional information can be sent within the request entity body.



precision specifier

Contained within a conversion specification, a precision specifier determines the number of decimal places to which a double should be rounded.



private

This keyword limits the availability of a method or property to the enclosing class only.



property

A special variable, available only in the context of an object or a class.



protected

This keyword limits the availability of a method or property to the enclosing class and to any child classes.



public

This keyword makes a property or method available to any client code.



query string

A set of name/value pairs appended to a URL as part of a GET request. Names are separated from values by equal signs, and pairs are separated from each other by ampersand (&) characters. The query string is separated from the rest of the URL by a question mark (?). Both names and values are encoded so characters with significance to the server are not present.



reference

The means by which multiple variables can point to the same value. By default, nonobject arguments are passed and assignments are made by value in PHP. This means that copies of values are passed around. As of PHP 5, objects are assigned and passed by reference. Therefore, when you pass an object variable to a method, you pass a handle to a single object, as opposed to a copy of the object.



regular expression

A powerful way of examining and modifying text.



request headers

Key value pairs sent to the server by a client providing information about the client itself and the nature of the request.



request line

The first line of a client request to a server. It consists of a request method, typically GET, HEAD, or POST; the address of the document required; and the HTTP version to be used (HTTP/1.0 or HTTP/1.1).



resource

A special data type. Resources represent handles used to work with external entities (databases and files are good examples of this).



response headers

Key value pairs sent to the client in response to a request. They provide information about the server environment and the data that is being served.



scope

The range of code for which a variable holds a particular value. For example, the value of a variable declared inside a function is unavailable outside that function. The variable is said to be local to the scope of the function.



server variables

Predefined elements that PHP makes available for you in conjunction with your server. You can access these elements via the superglobal $_SERVER array. Which elements are made available is server dependent, but they are likely to include common variables such as $_SERVER['HTTP_USER_AGENT'] and $_SERVER['REMOTE_ADDR'].



statement

Represents an instruction to the interpreter. Broadly, it is to PHP what a sentence is to written or spoken English. A sentence should end with a period; a statement should usually end with a semicolon. Exceptions to this include statements that enclose other statements and statements that end a block of code. In most cases, however, failure to end a statement with a semicolon confuses the interpreter and results in an error.



static

Used within the context of a function, the static keyword ensures that an associated variable maintains the same value across function calls. In the context of a class, a static property is available via a class rather than through individual class instances (objects).



status line

The first server response to a client request. The status line consists of the HTTP version the server is using (HTTP/1.0 or HTTP/1.1), a response code, and a text message that clarifies the meaning of the response code.



stream

A flow of data that can be read from and written to. Streams are a new mechanism in PHP that provide a common interface for working with data across a range of contexts.



string

A data type. It is a series of characters.



Structured Query Language (SQL)

A standardized syntax by which different types of database can be queried.



subclass

A class that inherits member variables and methods from another (parent) class.



superclass

A parent class.



superglobal

A variable available in any scope. Superglobals are always built-in and include $_REQUEST, $_GET, $_POST, and $_SERVER, among others.



switch

A statement that compares the result of an operation against any number of different values in turn, executing a particular block of code if a match is found for the test value.



ternary operator

Returns a value derived from one of two expressions separated by a colon. Which expression is used to generate the value returned depends on the result of an initial test expression that precedes the return expressions and is separated from them by a question mark (?).



timestamp

The number of seconds that have elapsed since midnight GMT on January 1, 1970. This number is used in date arithmetic.



type specifier

Contained within a conversion specification, a type specifier determines the data type that should be output.



variable

A holder for a type of data. It can hold numbers, strings of characters, objects, arrays, or booleans. The contents of a variable can be changed at any time.



while statement

A loop that consists of a test expression and a statement (or series of statements). The statements are repeatedly executed as long as the test expression evaluates to true.



XML (Extensible Markup Language)

A set of rules for defining and parsing markup languages. Such languages are often constructed to structure data for sharing, format data for display, or send instructions to an interpreter.



XSLT (Extensible Stylesheet Language Transformations)

A template system for XML documents that makes converting from XML to other formats, such as HTML or WML, easy.



Zend

The scripting engine that lies at the heart of the PHP interpreter. Zend was released with the advent of PHP 4, and Zend 2 was released with the advent of PHP 5.



    [ Team LiB ] Previous Section