17 require_once SQ_INCLUDE_PATH.
'/package_manager.inc';
43 $this->_full_path = SQ_PACKAGES_PATH.
'/web_services';
63 'web_folder_web_services',
65 'cron_job_remove_soap_response_files',
79 $root_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'root_folder');
81 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'web_folder_web_services');
83 'asset' => &$root_folder,
84 'link_type' => SQ_LINK_TYPE_1,
89 $web_services_folder->setAttrValue(
'name',
'Web Services Folder');
90 if (!$web_services_folder->create($folder_link)) {
91 trigger_localised_error(
'CORE0001', E_USER_ERROR,
'Web Services Folder');
93 pre_echo(
'Web Services Folder Id : '.$web_services_folder->id);
95 $GLOBALS[
'SQ_SYSTEM']->am->registerSystemAsset(
'web_folder_web_services', $web_services_folder->id);
97 $design_parse_file = $web_services_folder->getDesignParseFile();
98 $design_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'web_folder_designs');
99 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'design');
101 $link_array = Array (
102 'asset' => $design_folder,
104 'link_type' => SQ_LINK_TYPE_1,
111 $design->setAttrValue(
'id_name',
'Soap Server Design');
112 $design->create($link_array);
114 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
116 create_directory($design->data_path);
117 string_to_file($design_parse_file, $design->data_path.
'/parse.txt');
119 $design_edit_fns = $design->getEditFns();
120 if (!$design_edit_fns->parseAndProcessFile($design)) {
121 trigger_error(
'Failed parsing updated parse file');
123 $design->generateDesignFile();
125 $GLOBALS[
'SQ_SYSTEM']->am->createAssetLink($web_services_folder, $design, SQ_LINK_NOTICE,
'design::system::frontend');
126 $web_services_folder->updateLookups();
128 return $web_services_folder;
141 $system_management_folder = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'system_management_folder');
143 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'rest_manager');
144 $rest_manager =
new Rest_Manager();
145 $rest_manager_link = Array(
'asset' => &$system_management_folder,
'link_type' => SQ_LINK_TYPE_1,
'is_exclusive' => 1);
146 if (!$rest_manager->create($rest_manager_link)) {
147 trigger_localised_error(
'CORE0001', E_USER_ERROR,
'REST Manager');
149 pre_echo(
'REST Manager Asset Id : '.$rest_manager->id);
151 $GLOBALS[
'SQ_SYSTEM']->am->registerSystemAsset(
'rest_manager', $rest_manager->id);
152 return $rest_manager;
165 $cron_manager = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'cron_manager');
166 if (is_null($cron_manager)) {
167 trigger_error(
'Couldn\'t get cron manager, couldn\'t create Remove SOAP Response Files cron job', E_USER_WARNING);
172 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'cron_job_remove_soap_response_files');
175 $root_user = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'root_user');
176 if (!$cron_manager->addJob($cron_job, $root_user, SQ_LINK_TYPE_2)) {
177 trigger_error(
'Remove SOAP Response Files Cron Job NOT CREATED', E_USER_ERROR);
179 pre_echo(
'Remove SOAP Response Files Cron Job Id: '.$cron_job->id);
181 $GLOBALS[
'SQ_SYSTEM']->am->registerSystemAsset(
'cron_job_remove_soap_response_files', $cron_job->id);