Commit 5eebdbb1 authored by jplang's avatar jplang
Browse files

Change plugins directory through the configuration.yml file (#24007).

Patch by Helder Manuel Torres Vieira.

git-svn-id: https://svn.redmine.org/redmine/trunk@15963 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent bdd27ab1
......@@ -75,6 +75,15 @@ default:
# attachments_storage_path: D:/redmine/files
attachments_storage_path:
# Absolute path to the directory where plugins are stored.
# The default is the 'plugins' directory in your Redmine instance.
# Your Redmine instance needs to have read permission on this
# directory.
# Examples:
# plugins_path: /var/redmine/plugins
# plugins_path: D:/redmine/plugins
plugins_path:
# Configuration of the autologin cookie.
# autologin_cookie_name: the name of the cookie (default: autologin)
# autologin_cookie_path: the cookie path (default: /)
......
......@@ -7,7 +7,12 @@ class RedminePluginGenerator < Rails::Generators::NamedBase
super
@plugin_name = file_name.underscore
@plugin_pretty_name = plugin_name.titleize
@plugin_path = "plugins/#{plugin_name}"
if Redmine::Configuration['plugins_path'].nil?
@plugin_path = File.join(Rails.root, 'plugins', plugin_name)
else
@plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
end
puts @plugin_path
end
def copy_templates
......
......@@ -9,7 +9,11 @@ class RedminePluginControllerGenerator < Rails::Generators::NamedBase
super
@plugin_name = file_name.underscore
@plugin_pretty_name = plugin_name.titleize
@plugin_path = "plugins/#{plugin_name}"
if Redmine::Configuration['plugins_path'].nil?
@plugin_path = File.join(Rails.root, 'plugins', plugin_name)
else
@plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
end
@controller_class = controller.camelize
end
......
......@@ -14,7 +14,11 @@ class RedminePluginModelGenerator < Rails::Generators::NamedBase
super
@plugin_name = file_name.underscore
@plugin_pretty_name = plugin_name.titleize
@plugin_path = "plugins/#{plugin_name}"
if Redmine::Configuration['plugins_path'].nil?
@plugin_path = File.join(Rails.root, 'plugins', plugin_name)
else
@plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
end
@model_class = model.camelize
@table_name = @model_class.tableize
@migration_filename = "create_#{@table_name}"
......
......@@ -44,7 +44,7 @@ module Redmine #:nodoc:
# When rendered, the plugin settings value is available as the local variable +settings+
class Plugin
cattr_accessor :directory
self.directory = File.join(Rails.root, 'plugins')
self.directory = Redmine::Configuration['plugins_path'] || File.join(Rails.root, 'plugins')
cattr_accessor :public_directory
self.public_directory = File.join(Rails.root, 'public', 'plugin_assets')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment