layout.documentation=Documentation
layout.ask_a_questions=Ask a question
layout.plugins=Plugins
+layout.evaluation=Embedded database should be used for evaluation purpose only
sidebar.project_settings=Configuration
sidebar.security=Security
def setup
begin
- if !DatabaseVersion.upgradable?
+ if !DatabaseVersion.production?
raise "Upgrade is not supported. Please use a production-ready database."
end
if DatabaseVersion.uptodate?
redirect_to home_path
elsif ActiveRecord::Base.connected?
- render :template => (DatabaseVersion.upgradable? ? 'setup/form' : 'setup/not_upgradable'), :layout => 'nonav'
+ render :template => (DatabaseVersion.production? ? 'setup/form' : 'setup/not_upgradable'), :layout => 'nonav'
else
render :template => 'setup/dbdown', :layout => 'nonav'
end
end
def setup_database
- if !DatabaseVersion.upgradable?
+ if !DatabaseVersion.production?
render :text => 'Upgrade is not supported. Please use a production-ready database.', :status => 500
else
# do not forget that this code is also in /api/server/setup (see api/server_controller.rb)
<% end %>
<div id="ftlinks">
<%= message('layout.powered_by') -%> <a href="http://www.sonarsource.com" target="SonarSource" class="external">SonarSource</a> - Open Source <a href="http://www.sonarsource.org/documentation/license/" target="license" class="external">LGPL</a> - v.<%= sonar_version -%> - <a href="http://sonar-plugins.codehaus.org" class="external" target="plugins"><%= message('layout.plugins') -%></a> - <a href="http://sonar.codehaus.org/documentation" class="external" target="sonar_doc" class="external"><%= message('layout.documentation') -%></a> - <a href="http://sonar.codehaus.org/support/" target="support" class="external"><%= message('layout.ask_a_questions') -%></a>
+ <% unless DatabaseVersion.production? %><br/><span class="yellowHighlight" id="evaluation_warning"><%= message('layout.evaluation') -%></span><% end %>
</div>
</div>
<% end %>
end
def self.automatic_setup
+ if !production?
+ puts 'Derby database should be used for evaluation purpose only'
+ end
if current_version<=0
try_restore_structure_dump() if use_structure_dump?
upgrade_and_start()
if uptodate?
load_plugin_webservices()
else
- puts "Server must be upgraded. Please browse /setup"
+ puts 'Server must be upgraded. Please browse /setup'
end
uptodate?
end
::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConfigurationValue('sonar.useStructureDump')!='false'
end
- def self.upgradable?
- dialect()!='derby'
+ def self.production?
+ @@production ||=
+ begin
+ dialect()!='derby'
+ end
end
end
\ No newline at end of file
.diffParam {
font-family: 'Bitstream Vera Sans Mono','Courier',monospace;
}
+.yellowHighlight {
+ background:#FFFBCC;
+}