Zend core manual




















If you have values or identifiers that require quoting, you are responsible for doing this. Use the quote , quoteInto , and quoteIdentifier methods of the database adapter. You can delete rows from a database table using the delete method. The second argument can be an array of SQL expressions. Since the table delete method proxies to the database adapter delete method, the second argument can be an array of SQL expressions. You can query the database table for rows matching specific values in the primary key, using the find method.

The first argument of this method is either a single value or an array of values to match against the primary key of the table. If you specify a single value, the method returns at most one row, because a primary key cannot have duplicate values and there is at most one row in the database table matching the value you specify.

If you specify multiple values in an array, the method returns at most as many rows as the number of distinct values you specify. The find method might return fewer rows than the number of values you specify for the primary key, if some of the values don't match any rows in the database table. The method even may return zero rows. If the primary key is a compound key, that is, it consists of multiple columns, you can specify the additional columns as additional arguments to the find method.

You must provide as many arguments as the number of columns in the table's primary key. To find multiple rows from a table with a compound primary key, provide an array for each of the arguments. All of these arrays must have the same number of elements. The values in each array are formed into tuples in order; for example, the first element in all the array arguments define the first compound primary key value, then the second elements of all the arrays define the second compound primary key value, and so on.

The call to find below to match multiple rows can match two rows in the database. You can query for a set of rows using any criteria other than the primary key values, using the fetchAll method of the Table class.

The first argument to this method is an SQL expression that is used in a WHERE clause, like those used in the update and delete methods described earlier. The argument for the WHERE clause may be a string as shown in the previous example, or it may be an array. For each element of the array, if the key is a string, the key of the array element is an SQL expression containing a placeholder, and the value of the array element is a value to be interpolated into the expression in place of the placeholder.

If the array has multiple elements, the elements are combined in the query in AND expressions. Example of finding rows by an expression array with multiple terms.

The third and fourth arguments are the count and offset integer values, used to make the query return a specific subset of rows. All of the arguments above are optional. If you omit these arguments, the result set includes all rows from the table in an unpredictable order. You can query for a single row using any criteria other than the primary key values, using the fetchRow method of the Table class.

Usage of this method is similar to that of the fetchAll method, in that its arguments include the WHERE expression and the sorting criteria. If the search criteria you specified match no rows in the database table, then fetchRow returns PHP's null value. The info method returns an array structure with information about the table, its columns and primary key, and other metadata. The keys of the array returned by the info method are described below:.

This is the information returned by the describeTable method. See Section That is, when a new table object is created, the object's default behavior is to fetch the table metadata from the database using the adapter's describeTable method.

In some circumstances, particularly when many table objects are instantiated against the same database table, querying the database for the table metadata for each instance may be undesirable from a performance standpoint.

In such cases, users may benefit by caching the table metadata retrieved from the database. There are two primary ways in which a user may take advantage of table metadata caching:. In both cases, the cache specification must be either null i. The methods may be used in conjunction when it is desirable to have both a default metadata cache and the ability to change the cache for individual table objects. The following code demonstrates how to set a default metadata cache to be used for all table objects:.

The following code demonstrates how to set a metadata cache for a specific table object instance:. You can specify Row and Rowset classes using the Table constructor's options array, in keys 'rowClass' and 'rowsetClass' respectively. Specify the names of the classes using strings. You can change the classes by specifying them with the setRowClass and setRowsetClass methods. This applies to rows and rowsets created subsequently; it does not change the class of any row or rowset objects you have created previously.

For more information on the Row and Rowset classes, see Section You can override the insert and update methods in your Table class. If PHP is configured with safe mode , no files outside this directory are served. The alternative is to use the cgi. In what directory PHP should look for dynamically loadable extensions. If this is enabled, the PHP CGI binary can safely be placed outside of the web tree and people will not be able to circumvent. A setting of zero causes PHP to behave as before.

It is turned on by default. Left undefined, PHP turns this on by default. You can turn it off at your own risk. If cgi. Setting this variable may cause security issues, know what you are doing first.

This allows IIS to define the security context that the request runs under. Default is zero. Default is to enable logging. Whether or not to allow HTTP file uploads. The temporary directory used for storing files when doing file upload. Must be writable by whatever user PHP is running as. If not specified PHP will use the system's default. If the directory specified here is not writable, PHP falls back to the system default temporary directory.

The maximum number of files allowed to be uploaded simultaneously. Starting with PHP 5. If turned on, database connection functions that specify default values will use those values in place of any user-supplied arguments.

For details on the default values, see the documentation for the relevant connection functions. This directive shows the Windows CRT warnings when enabled. These warnings were displayed by default until PHP 5. PHP 5 Manual php. Edit Report a Bug. Description of core php. Note : The defaults listed here are used when php.

Before PHP 7. Renamed to zend. Here's a short explanation of the configuration directives. Note : Since PHP 5. It takes on a comma-delimited list of class names. When set to 0 , assertion code will be generated but it will be skipped not executed at runtime.

When set to -1 , assertion code will not be generated, making the assertions zero-cost production mode. Note : If a process is started in production mode, zend. When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ , may also be used. Prior to PHP 7. The size required for the cache entry data is system dependent. Removed in PHP 5. This method will retrieve a resources from the container.

This method can be used to run individual bootstraps either defined in the class itself or via resource plugin classes.

A resource defined in the class will be run in preference over a resource plugin in the case of naming conflicts. The method name to call. Array of arguments to use in the method call. It's primary feature are that it registers the Front Controller resource , and that the run method first checks that a default module is defined and then dispatches the front controller.

In most cases, you will want to extend this class for your bootstrapping needs, or simply use this class and provide a list of resource plugins to utilize. You may enable this functionality by providing a namespace to the "appnamespace" configuration option. As an INI example:.

Resource plugins are expected to allow configuration, be bootstrap aware, and implement a strategy pattern for initializing the resource. Options with which to set resource state. The constructor should allow passing options with which to initialize state. Parent bootstrap initializing this resource. Options with which to set state.

Note: this abstract class does not implement the init method; this is left for definition in concrete extensions of the class. When registering plugin resources, one issue that arises is how you should refer to them from the parent bootstrap class. There are three different mechanisms that may be used, depending on how you have configured the bootstrap and its plugin resources.

First, if your plugins are defined within a defined prefix path, you may refer to them simply by their "short name" -- i. You may register them using the full class name or the short name:.

In each case, you can then bootstrap the resource and retrieve it later using the short name:. Second, if no matching plugin path is defined, you may still pass a resource by the full class name. In this case, you can reference it using the resource's full class name:. This brings us to the third option. You can specify an explicit name that a given resource class will register as.

As an example, let's define our own view class:. Using these various naming approaches, you can override existing resources, add your own, mix multiple resources to achieve complex initialization, and more. Available Resource Plugins. Made with by awesome contributors. This website is built using zend-expressive and it runs on PHP 7.

We use cookies to allow you to dismiss dialogs such as the Laminas Project notification. Toggle navigation. Core Functionality. Enabling Application Autoloading. Resource Names.



0コメント

  • 1000 / 1000