Bug 644334 - Add hook to Bugzilla::Install::Filesystem to allow extensions to create files/directories/htaccess
r/a=mkanat git-svn-id: svn://10.0.0.236/trunk@262129 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -31,6 +31,7 @@ use Bugzilla::User;
|
||||
use Bugzilla::User::Setting;
|
||||
use Bugzilla::Util qw(diff_arrays html_quote);
|
||||
use Bugzilla::Status qw(is_open_state);
|
||||
use Bugzilla::Install::Filesystem;
|
||||
|
||||
# This is extensions/Example/lib/Util.pm. I can load this here in my
|
||||
# Extension.pm only because I have a Config.pm.
|
||||
@@ -402,6 +403,33 @@ sub install_before_final_checks {
|
||||
# hook/global/setting-descs-settings.none.tmpl .
|
||||
}
|
||||
|
||||
sub install_filesystem {
|
||||
my ($self, $args) = @_;
|
||||
my $create_dirs = $args->{'create_dirs'};
|
||||
my $recurse_dirs = $args->{'recurse_dirs'};
|
||||
my $htaccess = $args->{'htaccess'};
|
||||
|
||||
# Create a new directory in datadir specifically for this extension.
|
||||
# The directory will need to allow files to be created by the extension
|
||||
# code as well as allow the webserver to server content from it.
|
||||
# my $data_path = bz_locations->{'datadir'} . "/" . __PACKAGE__->NAME;
|
||||
# $create_dirs->{$data_path} = Bugzilla::Install::Filesystem::DIR_CGI_WRITE;
|
||||
|
||||
# Update the permissions of any files and directories that currently reside
|
||||
# in the extension's directory.
|
||||
# $recurse_dirs->{$data_path} = {
|
||||
# files => Bugzilla::Install::Filesystem::CGI_READ,
|
||||
# dirs => Bugzilla::Install::Filesystem::DIR_CGI_WRITE
|
||||
# };
|
||||
|
||||
# Create a htaccess file that allows specific content to be served from the
|
||||
# extension's directory.
|
||||
# $htaccess->{"$data_path/.htaccess"} = {
|
||||
# perms => Bugzilla::Install::Filesystem::WS_SERVE,
|
||||
# contents => Bugzilla::Install::Filesystem::HT_DEFAULT_DENY
|
||||
# };
|
||||
}
|
||||
|
||||
#sub install_update_db_fielddefs {
|
||||
# my $dbh = Bugzilla->dbh;
|
||||
# $dbh->bz_add_column('fielddefs', 'example_column',
|
||||
|
||||
Reference in New Issue
Block a user