updateisbn13.php

Summary

Imports the latest ISBN ranges to the database.

Location

./bin/php/updateisbn13.php

Parameters

colors
db-database
db-driver
db-host
db-password
db-user
debug
file
help
logfiles
no-colors
no-logfiles
quiet
siteaccess

-c, --colors

Use ANSI colors when generating debug output (default).

--db-database=<database_name>

The name of the database to update. If omitted, the database name specified in the "Database" configuration directive will be used.

--db-driver=<database_type>

The type of the database, for example "ezmysql". If omitted, the type specified in the "DatabaseImplementation" configuration directive will be used.

--db-host=<database_host>

The hostname or the IP address of the server running the database engine, for example "localhost". If omitted, the value specified in the "Server" configuration directive will be used.

--db-password=<password>

The password that belongs to the database user. If omitted, the password specified in the "Password" configuration directive will be used.

--db-user=<database_user>

The username that will be used to access the database. If omitted, the name specified in the "User" configuration directive will be used.

-d[<option>[,<option2>...]], --debug[=<option>[,<option2>...]]

Output debug information. The following options can be used to control what the debug output should include: "all" (everything), "accumulator" (accumulators), "include" (included files), "timing" (timing points), "error" (errors), "warning" (warnings), "notice" (notices).

--file=<path_to_file>

The path to the file that contains the list of ranges (relative to the root directory of eZ Publish). This parameter is required.

-h, --help

Output information about the script and supported parameters.

--logfiles

Generate log files. This parameter must be used together with the debug parameter ("-d" or "--debug"). The log files (for example "warning.log") will be stored in the "var/log" directory of the eZ Publish installation.

--no-colors

Do not use ANSI colors when generating debug output.

--no-logfiles

Do not generate log files (default).

-q, --quiet

Run the script in "quiet" mode. No output will be generated.

-s <siteaccess>, --siteaccess=<siteaccess>

The siteaccess to run the script for. If omitted, the default siteaccess will be used.

Description

This script makes it possible to import the latest ISBN ranges to the database. Without this information, the system may not be able to handle ISBN-13 codes properly (refer to the documentation of the ISBN datatype for more information). Since the calculation rules for ISBN codes can be changed on a monthly basis, you may need to run the script regularly in order to keep the range information in the database up to date.

Before running the script, download the "ranges.js" file that contains information about the different ranges from http://www.isbn-international.org/converter/ranges.js and copy it to your eZ Publish installation. When running the script, use the "--file" parameter to tell the script where to look for the downloaded file. By default, the database configuration of the default siteaccess will be used. You can use the optional "--siteaccess" parameter to make the script import ranges to the database that is used by a particular siteaccess. In addition, the optional "--db-database", "--db-driver", "--db-host", "--db-user" and "--db-password" parameters make it possible to combine custom database options with the database configuration of the specified (or default) siteaccess.

In eZ Publish 3.10.0, the script contains an important bug (refer to http://issues.ez.no/12755 for more information). The updated version of the script can be downloaded from http://pubsvn.ez.no and will be included in the upcoming 3.10.1 release.

Examples

Example 1

php bin/php/updateisbn13.php --file=var/ranges.js

Import data from the "ranges.js" file to the database that is used by the default siteaccess. The script will look for "ranges.js" in the "var" directory of the eZ Publish installation.

Example 2

php bin/php/updateisbn13.php --file=ranges.js --siteaccess=example

Import data from the "ranges.js" file to the database that is used by the "example" siteaccess. The script will look for "ranges.js" in the root directory of the eZ Publish installation.

Example 3

php bin/php/updateisbn13.php --file=ranges.js --siteaccess=example --db-database=test

Import data from the "ranges.js" file located in the root directory of the eZ Publish installation. The script will use the database configuration of the "example" siteaccess but ignore the value of the "Database" directive and use the specified custom database name instead. If the "example" siteaccess makes use of a database called "foo" on localhost, the script will import ISBN ranges to the "test" database on localhost.

Example 4

php bin/php/updateisbn13.php --file=ranges.js --db-database=test –db-user=root –db-password=secret

Import data from the "ranges.js" file located in the root directory of the eZ Publish installation. The script will use the specified custom database name, user name and password, while the type of the database and the hostname will still be fetched from the database configuration of the default siteaccess.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.