##// END OF EJS Templates
Change plugins directory through the configuration.yml file (#24007)....
Jean-Philippe Lang -
r15581:7a9a22f3dd62
parent child
Show More
@@ -75,6 +75,15 default:
75 75 # attachments_storage_path: D:/redmine/files
76 76 attachments_storage_path:
77 77
78 # Absolute path to the directory where plugins are stored.
79 # The default is the 'plugins' directory in your Redmine instance.
80 # Your Redmine instance needs to have read permission on this
81 # directory.
82 # Examples:
83 # plugins_path: /var/redmine/plugins
84 # plugins_path: D:/redmine/plugins
85 plugins_path:
86
78 87 # Configuration of the autologin cookie.
79 88 # autologin_cookie_name: the name of the cookie (default: autologin)
80 89 # autologin_cookie_path: the cookie path (default: /)
@@ -7,7 +7,12 class RedminePluginGenerator < Rails::Generators::NamedBase
7 7 super
8 8 @plugin_name = file_name.underscore
9 9 @plugin_pretty_name = plugin_name.titleize
10 @plugin_path = "plugins/#{plugin_name}"
10 if Redmine::Configuration['plugins_path'].nil?
11 @plugin_path = File.join(Rails.root, 'plugins', plugin_name)
12 else
13 @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
14 end
15 puts @plugin_path
11 16 end
12 17
13 18 def copy_templates
@@ -9,7 +9,11 class RedminePluginControllerGenerator < Rails::Generators::NamedBase
9 9 super
10 10 @plugin_name = file_name.underscore
11 11 @plugin_pretty_name = plugin_name.titleize
12 @plugin_path = "plugins/#{plugin_name}"
12 if Redmine::Configuration['plugins_path'].nil?
13 @plugin_path = File.join(Rails.root, 'plugins', plugin_name)
14 else
15 @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
16 end
13 17 @controller_class = controller.camelize
14 18 end
15 19
@@ -14,7 +14,11 class RedminePluginModelGenerator < Rails::Generators::NamedBase
14 14 super
15 15 @plugin_name = file_name.underscore
16 16 @plugin_pretty_name = plugin_name.titleize
17 @plugin_path = "plugins/#{plugin_name}"
17 if Redmine::Configuration['plugins_path'].nil?
18 @plugin_path = File.join(Rails.root, 'plugins', plugin_name)
19 else
20 @plugin_path = File.join(Redmine::Configuration['plugins_path'], plugin_name)
21 end
18 22 @model_class = model.camelize
19 23 @table_name = @model_class.tableize
20 24 @migration_filename = "create_#{@table_name}"
@@ -44,7 +44,7 module Redmine #:nodoc:
44 44 # When rendered, the plugin settings value is available as the local variable +settings+
45 45 class Plugin
46 46 cattr_accessor :directory
47 self.directory = File.join(Rails.root, 'plugins')
47 self.directory = Redmine::Configuration['plugins_path'] || File.join(Rails.root, 'plugins')
48 48
49 49 cattr_accessor :public_directory
50 50 self.public_directory = File.join(Rails.root, 'public', 'plugin_assets')
General Comments 0
You need to be logged in to leave comments. Login now