described below. The rest of the return values are status code-specific
and are explained in the status code descriptions.
-=over 4
-
=item C<AUTH_OK>
Authentication succeeded. The third variable is the userid of the new
typically come from the C<disabledtext> field in the C<profiles> table.
Note that this argument is a string, not a tag.
-=back
-
=item C<current_verify_class>
This scalar gets populated with the full name (eg.,
The login interface consists of the following methods:
+=over 4
+
=item C<login>, which takes a C<$type> argument, using constants found in
C<Bugzilla::Constants>.
The constants accepted by C<login> include the following:
-=over 4
-
=item C<LOGIN_OPTIONAL>
A login is never required to access this data. Attempting to login is
A login is always required to access this data.
-=back
-
=item C<logout>, which takes a C<Bugzilla::User> argument for the user
being logged out, and an C<$option> argument. Possible values for
C<$option> include:
-=over 4
-
=item C<LOGOUT_CURRENT>
Log out the user and invalidate his currently registered session.
=head1 METHODS
+=over
+
=item C<login>
Passes C<login> calls to each class defined in the param C<user_info_class>
and returns a C<Bugzilla::User> object from the first one that successfully
gathers user login information.
-
+=back
Params: none
Returns: A C<Bugzilla::DB::Schema> object representing the database
as it exists on the disk.
+
=cut
+
sub _bz_real_schema {
my ($self) = @_;
return $self->{private_real_schema} if exists $self->{private_real_schema};
return $self->{private_real_schema};
}
-
=item C<_bz_store_real_schema()>
Description: Stores the _bz_real_schema structures in the database
Precondition: $self->{_bz_real_schema} must exist.
+=back
+
+=end private
+
=cut
+
sub _bz_store_real_schema {
my ($self) = @_;
1;
__END__
-=back
-
-=end private
=head1 NAME
# Execute the query
$sth->execute;
-
+
# Get the results
my @result = $sth->fetchrow_array;
The minimum version of the DBD module that we require for this database.
+=back
+
+
=head1 CONNECTION
A new database handle to the required database can be created using this
=back
+
=head1 ABSTRACT METHODS
Note: Methods which can be implemented generically for all DBs are implemented in
back). False (0) or no param if the operation succeeded.
Returns: none
+=back
+
+
=head1 IMPLEMENTED METHODS
These methods are implemented in Bugzilla::DB, and only need
to be implemented in subclasses if you need to override them for
database-compatibility reasons.
-=over 4
-
=head2 General Information Methods
These methods return information about data in the database.
$column = name of column containing serial data type (scalar)
Returns: Last inserted ID (scalar)
+=back
+
=head2 Schema Modification Methods
Params: none
Returns: List of all the "bug" fields
+=back
+
+
=head2 Transaction Methods
These methods deal with the starting and stopping of transactions
Params: none
Returns: none
+=back
+
+
=head1 SUBCLASS HELPERS
Methods in this class are intended to be used by subclasses to help them
=back
+
=head1 DEPRECATED ROUTINES
Several database routines are deprecated. They should not be used in new code,
=back
+
=head1 SEE ALSO
L<DBI>
=begin private
-=head 1 MYSQL-SPECIFIC DATABASE-READING METHODS
+=head1 MYSQL-SPECIFIC DATABASE-READING METHODS
These methods read information about the database from the disk,
instead of from a Schema object. They are only reliable for MySQL
=back
-=head 1 MYSQL-SPECIFIC "SCHEMA BUILDER"
+=head1 MYSQL-SPECIFIC "SCHEMA BUILDER"
MySQL needs to be able to read in a legacy database (from before
Schema existed) and create a Schema object out of it. That's what
this code does.
+=end private
+
=cut
# This sub itself is actually written generically, but the subroutines
return $schema;
}
1;
-
-__END__
-
-=back
-
-=end private
-
Bugzilla::DB.
=cut
+
#--------------------------------------------------------------------------
# Define the Bugzilla abstract database schema and version as constants.
are considered protected. Subclasses may override these methods, but
other modules should not invoke these methods directly.
-=over 4
-
=cut
#--------------------------------------------------------------------------
sub new {
+=over
+
=item C<new>
Description: Public constructor method used to instantiate objects of this
Returns: An array of SQL statements.
=cut
+
my ($self, $table, $column, $definition, $init_value) = @_;
my @statements;
push(@statements, "ALTER TABLE $table ADD COLUMN $column " .
Returns: An array of SQL statements.
=cut
+
my ($self, $table, $name) = @_;
# Although ANSI SQL-92 doesn't specify a method of dropping an index,
Returns: An array of SQL statements.
=cut
+
sub get_drop_table_ddl {
my ($self, $table) = @_;
return ("DROP TABLE $table");
Returns: nothing
=cut
+
sub delete_table {
my ($self, $name) = @_;
undef.
=cut
+
sub get_indexes_on_column_abstract {
my ($self, $table, $column) = @_;
my %ret_hash;
sub get_index_abstract {
-=item C<get_index_abstract($table, $index)
+=item C<get_index_abstract($table, $index)>
Description: Returns an index definition from the internal abstract schema.
Params: $table - The table the index is on.
Returns: nothing
=cut
+
sub add_table {
my ($self, $name, $definition) = @_;
(die "Table already exists: $name")
Returns: nothing
=cut
+
sub delete_index {
my ($self, $table, $name) = @_;
Params: $col_one, $col_two - The columns to compare. Hash
references, in C<ABSTRACT_SCHEMA> format.
Returns: C<1> if the columns are identical, C<0> if they are not.
+
+=back
+
=cut
my $self = shift;
is either store it somewhere or deserialize it.
=cut
+
sub serialize_abstract {
my ($self) = @_;
# We do this so that any two stored Schemas will have the
However, it will represent the serialized data instead of
ABSTRACT_SCHEMA.
=cut
+
sub deserialize_abstract {
my ($class, $serialized, $version) = @_;
These methods are generally called on the class instead of on a specific
object.
+=over
+
=item C<get_empty_schema()>
Description: Returns a Schema that has no tables. In effect, this
Params: none
Returns: A "empty" Schema object.
+=back
+
=cut
sub get_empty_schema {
}
1;
-__END__
-=back
+__END__
=head1 ABSTRACT DATA TYPES
ThrowUserError("error_tag",
{ foo => 'bar' });
-
+
=head1 DESCRIPTION
Various places throughout the Bugzilla codebase need to report errors to the
basic sets of columns and tables for getting flag types from th
database. B<Used by get, match, sqlify_criteria and perlify_record>
-=back
-
=cut
my @base_columns =
=head1 PUBLIC FUNCTIONS
-=over C<get($id)>
+=over
+
+=item C<get($id)>
Retrieves and returns a flag from the database.
+=back
+
=cut
# !!! Implement a cache for this function!
=over
-=item C<FormToNewFlags($target, $cgi)
+=item C<FormToNewFlags($target, $cgi)>
Checks whether or not there are new flags to create and returns an
array of flag objects. This array is then passed to Flag::create().
=back
+=end private
+
=cut
sub perlify_record {
return $flag;
}
-=end private
-
=head1 SEE ALSO
=over
=back
+
=head1 CONTRIBUTORS
=over
######################################################################
# Public Functions
######################################################################
+
=head1 PUBLIC FUNCTIONS/METHODS
=over
return $type;
}
+1;
+
=end private
=head1 SEE ALSO
=back
=cut
-
-1;
=head1 CONSTANTS
+=over
+
=item C<USER_MATCH_MULTIPLE>
Returned by C<match_field()> when at least one field matched more than
Passed in to match_field to tell match_field to never display a
confirmation screen.
+=back
+
=head1 METHODS
=over 4
=head1 CLASS FUNCTIONS
-=over4
-
These are functions that are not called on a User object, but instead are
called "statically," just like a normal procedural function.
+=over 4
+
=item C<insert_new_user>
Creates a new user in the database.
__END__
=head1 NAME
+
Bugzilla::User::Setting - Object for a user preference setting
=head1 SYNOPSIS
+
Setting.pm creates a setting object, which is a hash containing the user
preference information for a single preference for a single user. These
are usually accessed through the "settings" object of a user, and not
directly.
=head1 DESCRIPTION
+
use Bugzilla::User::Setting;
my $settings;
Returns: nothing
=begin private
+
=item C<_setting_exists>
Description: Determines if a given setting exists in the database.
Params: C<$setting_name> - string - the setting name
Returns: boolean - true if the setting already exists in the DB.
+=back
+
=end private
+
=head1 METHODS
=over 4
Params: C<$value> - string - the new value for this setting for this user.
Returns: nothing
-
+=back
displayed or emailed. Generally, wrapped text should not be stored in the
database.
-=back
-
=item C<find_wrap_point($string, $maxpos)>
Search for a comma, a whitespace or a hyphen to split $string, within the first
Returns a number with 2 digit precision, unless the last digit is a 0. Then it
returns only 1 digit precision.
+=back
+
+
=head2 Files
=over 4