Simplify CMS_SERVICE initialization, and CMS server (launcher).
Renamed "layout" lib as "app_env" with APPLICATION_ENVIRONMENT interface. applied changed to callers. Added CMS_THEME.has_region (a_name): BOOLEAN to know if a region is declared in a defined theme.
This commit is contained in:
@@ -18,11 +18,11 @@ create
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make (a_layout: CMS_LAYOUT)
|
||||
-- Create a default setup with `a_layout'.
|
||||
make (a_env: CMS_ENVIRONMENT)
|
||||
-- Create a default setup with `a_env'.
|
||||
do
|
||||
layout := a_layout
|
||||
create {INI_CONFIG} configuration.make_from_file (layout.cms_config_ini_path)
|
||||
environment := a_env
|
||||
create {INI_CONFIG} configuration.make_from_file (a_env.cms_config_ini_path)
|
||||
initialize
|
||||
end
|
||||
|
||||
@@ -61,14 +61,14 @@ feature {NONE} -- Initialization
|
||||
if attached text_item ("themes-dir") as s then
|
||||
create themes_location.make_from_string (s)
|
||||
else
|
||||
themes_location := layout.www_path.extended ("themes")
|
||||
themes_location := environment.www_path.extended ("themes")
|
||||
end
|
||||
|
||||
-- Selected theme's name
|
||||
theme_name := text_item_or_default ("theme", "default")
|
||||
|
||||
debug ("refactor_fixme")
|
||||
fixme ("Review export clause for configuration and layout")
|
||||
fixme ("Review export clause for configuration and environment")
|
||||
end
|
||||
|
||||
compute_theme_location
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
note
|
||||
description: "[
|
||||
CMS Layout providing file system locations for
|
||||
CMS Environment providing file system locations for
|
||||
- config
|
||||
- application
|
||||
- logs
|
||||
@@ -11,11 +11,10 @@ note
|
||||
revision: "$Revision: 96797 $"
|
||||
|
||||
class
|
||||
CMS_LAYOUT
|
||||
CMS_ENVIRONMENT
|
||||
|
||||
inherit
|
||||
|
||||
APPLICATION_LAYOUT
|
||||
APPLICATION_ENVIRONMENT
|
||||
|
||||
create
|
||||
make_default,
|
||||
@@ -1,6 +1,6 @@
|
||||
note
|
||||
description: "[
|
||||
Class that enable to set basic configuration, application layout, core modules and themes.
|
||||
Class that enable to set basic configuration, application environment, core modules and themes.
|
||||
]"
|
||||
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
|
||||
revision: "$Revision: 96616 $"
|
||||
@@ -13,8 +13,15 @@ inherit
|
||||
|
||||
feature -- Access
|
||||
|
||||
layout: CMS_LAYOUT
|
||||
-- CMS layout.
|
||||
environment: CMS_ENVIRONMENT
|
||||
-- CMS environment.
|
||||
|
||||
layout: CMS_ENVIRONMENT
|
||||
-- CMS environment.
|
||||
obsolete "use `environment' [april-2015]"
|
||||
do
|
||||
Result := environment
|
||||
end
|
||||
|
||||
enabled_modules: CMS_MODULE_COLLECTION
|
||||
-- List of enabled modules.
|
||||
@@ -122,7 +129,7 @@ feature -- Access: storage
|
||||
if not retried then
|
||||
to_implement ("Refactor database setup")
|
||||
if
|
||||
attached (create {APPLICATION_JSON_CONFIGURATION_HELPER}).new_database_configuration (layout.application_config_path) as l_database_config and then
|
||||
attached (create {APPLICATION_JSON_CONFIGURATION_HELPER}).new_database_configuration (environment.application_config_path) as l_database_config and then
|
||||
attached storage_drivers.item (l_database_config.driver) as l_builder
|
||||
then
|
||||
Result := l_builder.storage (Current)
|
||||
|
||||
Reference in New Issue
Block a user