The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mozilla::ProfilesIni - Manipulation of Mozilla profiles.ini files

SYNOPSIS

  $path = Mozilla::ProfilesIni::_find_profile_path(
    home => $ENV{HOME}, 
    type => "firefox"
  );

  $ini = Mozilla::ProfilesIni->( path => $path );

DESCRIPTION

This module provides routines for parsing and manipulating Mozilla profiles.ini files.

The following methods are implemented:

new
  $ini = Mozilla::ProfilesIni->new( $path );

  $ini = Mozilla::ProfilesIni->new( path => $path, %options );

The following options are supported:

path

Path to where the profiles.ini file is (excluding the actual profiles.ini file). This is a required option.

log

A Log::Dispatch object for receiving log messages.

debug

Sets an internal debug flag. (Not implemented at this time.)

create

Create a new profile.ini file in "path".

create_profile
  $ini->create_profile( name => $name, is_default => $def, path => $path );

  $ini->create_profile( $name, $def, $path );

Creates a profile named $name in $path. If $path is not specified, it creates a relative profile in the Profiles subdirectory below the profiles.ini file.

ini_file
   $path = $ini->ini_file();

Returns the path to the profiles.ini file.

profile_names
  @names = $ini->profile_names($type);

Returns the names of profiles associated with the type.

profile_exists
  if ($ini->profile_exists($name)) { ... }

Returns true if a profile exists.

profile_is_relative
  if ($ini->profile_is_relative($name)) { ... }

Returns the "IsRelative" flag for the profile.

profile_path
  $path = $ini->profile_path($name);

Returns the pathname of the profile.

profile_is_default
  if ($ini->profile_is_default($name)) { ... }

Returns the "Default" flag for the profile.

profile_id
  $section = $ini->profile_id($name);

Returns the "ini_file" identifier of the profile.

profile_is_locked
  if ($ini->profile_is_locked($name)) { ... }

Returns true if there is a lock file in the profile.

_find_profile_path
  $path = _find_profile_path( home => $home, type => $type );

  $path = _find_profile_path( $home, $type );

Looks for a directory corresponding to where profile type of $type should be, generally somewhere in the $home directory, where $home is the platform-specific "home" directory (not necessarily $ENV{HOME}).

Returns undef if no path for that type was found.

In cases where profile paths cannot be found, use the MOZILLA_HOME or appname_HOME environment variable to indicate where it is.

CAVEATS

This module is a prototype. Use at your own risk!

SEE ALSO

Mozilla::Backup

AUTHOR

Robert Rothenberg <rrwo at cpan.org>

LICENSE

Copyright (c) 2005 Robert Rothenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.