Updated cms library with comments, and removed a few JSON obsolete calls.
This commit is contained in:
@@ -6,7 +6,6 @@ note
|
||||
class
|
||||
CMS_JSON_CONFIGURATION
|
||||
|
||||
|
||||
inherit
|
||||
|
||||
JSON_CONFIGURATION
|
||||
@@ -19,29 +18,36 @@ feature -- Access
|
||||
l_parser: JSON_PARSER
|
||||
do
|
||||
if attached json_file_from (a_path) as json_file then
|
||||
l_parser := new_json_parser (json_file)
|
||||
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then
|
||||
attached {JSON_OBJECT} jv.item ("server") as l_server and then
|
||||
attached {JSON_STRING} l_server.item ("mode") as l_mode then
|
||||
Result := l_mode.item.is_case_insensitive_equal_general ("html")
|
||||
end
|
||||
l_parser := new_json_parser (json_file)
|
||||
l_parser.parse_content
|
||||
if
|
||||
l_parser.is_valid and then
|
||||
attached l_parser.parsed_json_object as jo and then l_parser.is_parsed and then
|
||||
attached {JSON_OBJECT} jo.item ("server") as l_server and then
|
||||
attached {JSON_STRING} l_server.item ("mode") as l_mode
|
||||
then
|
||||
Result := l_mode.item.is_case_insensitive_equal_general ("html")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
is_web_mode (a_path: PATH): BOOLEAN
|
||||
-- Is the server running on web mode?
|
||||
local
|
||||
l_parser: JSON_PARSER
|
||||
do
|
||||
if attached json_file_from (a_path) as json_file then
|
||||
l_parser := new_json_parser (json_file)
|
||||
if attached {JSON_OBJECT} l_parser.parse as jv and then l_parser.is_parsed and then
|
||||
attached {JSON_OBJECT} jv.item ("server") as l_server and then
|
||||
attached {JSON_STRING} l_server.item ("mode") as l_mode then
|
||||
Result := l_mode.item.is_case_insensitive_equal_general ("web")
|
||||
end
|
||||
l_parser := new_json_parser (json_file)
|
||||
l_parser.parse_content
|
||||
if
|
||||
l_parser.is_valid and then
|
||||
attached l_parser.parsed_json_object as jo and then l_parser.is_parsed and then
|
||||
attached {JSON_OBJECT} jo.item ("server") as l_server and then
|
||||
attached {JSON_STRING} l_server.item ("mode") as l_mode
|
||||
then
|
||||
Result := l_mode.item.is_case_insensitive_equal_general ("web")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user