Changeset View
Changeset View
Standalone View
Standalone View
application/modules/backend/controllers/HiveController.php
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 28 | { | |||
---|---|---|---|---|---|
119 | { | 119 | { | ||
120 | $countProjects = null; | 120 | $countProjects = null; | ||
121 | $contentTable = new Default_Model_DbTable_HiveContent(); | 121 | $contentTable = new Default_Model_DbTable_HiveContent(); | ||
122 | try { | 122 | try { | ||
123 | $count = $contentTable->fetchCountProjects(); | 123 | $count = $contentTable->fetchCountProjects(); | ||
124 | $this->view->info = "Erfolgreich geladen aus DB"; | 124 | $this->view->info = "Erfolgreich geladen aus DB"; | ||
125 | $countProjects = $count; | 125 | $countProjects = $count; | ||
126 | } catch (Exception $e) { | 126 | } catch (Exception $e) { | ||
127 | Zend_Registry::get('logger')->info(__METHOD__ . ' - ' . "Fehler bei fetchCountProjects"); | 127 | Zend_Registry::get('logger')->info(__METHOD__ . ' - ' . "Error in fetchCountProjects"); | ||
128 | Zend_Registry::get('logger')->err(__METHOD__ . ' - ' . print_r($e, true)); | 128 | Zend_Registry::get('logger')->err(__METHOD__ . ' - ' . print_r($e, true)); | ||
129 | 129 | | |||
130 | $this->view->info = "Fehler bei laden aus DB:" . $e->getMessage(); | 130 | $this->view->info = "Error while loading from the database:" . $e->getMessage(); | ||
131 | $countProjects = 0; | 131 | $countProjects = 0; | ||
132 | } | 132 | } | ||
133 | 133 | | |||
134 | $this->view->coutAll = $countProjects; | 134 | $this->view->coutAll = $countProjects; | ||
135 | } | 135 | } | ||
136 | 136 | | |||
137 | private function step1() | 137 | private function step1() | ||
138 | { | 138 | { | ||
139 | $catArray = null; | 139 | $catArray = null; | ||
140 | $contentTable = new Default_Model_DbTable_HiveContent(); | 140 | $contentTable = new Default_Model_DbTable_HiveContent(); | ||
141 | try { | 141 | try { | ||
142 | $catArray = $contentTable->fetchHiveCategories(); | 142 | $catArray = $contentTable->fetchHiveCategories(); | ||
143 | $this->view->info = "Erfolgreich geladen aus DB"; | 143 | $this->view->info = "Successfully loaded from the database"; | ||
144 | } catch (Exception $e) { | 144 | } catch (Exception $e) { | ||
145 | $this->view->info = "Fehler bei laden aus DB:" . $e->getMessage(); | 145 | $this->view->info = "Error while loading from the database:" . $e->getMessage(); | ||
tfella: Typo | |||||
146 | $catArray = null; | 146 | $catArray = null; | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | $this->view->categories = $catArray; | 149 | $this->view->categories = $catArray; | ||
150 | } | 150 | } | ||
151 | 151 | | |||
152 | private function step2() | 152 | private function step2() | ||
153 | { | 153 | { | ||
154 | $params = $this->getAllParams(); | 154 | $params = $this->getAllParams(); | ||
155 | $cat_id = $params['cat_id']; | 155 | $cat_id = $params['cat_id']; | ||
156 | $cat = null; | 156 | $cat = null; | ||
157 | $contentTable = new Default_Model_DbTable_HiveContent(); | 157 | $contentTable = new Default_Model_DbTable_HiveContent(); | ||
158 | try { | 158 | try { | ||
159 | $count = $contentTable->fetchCountProjectsForCategory($cat_id); | 159 | $count = $contentTable->fetchCountProjectsForCategory($cat_id); | ||
160 | 160 | | |||
161 | $cat = $contentTable->fetchHiveCategory($cat_id); | 161 | $cat = $contentTable->fetchHiveCategory($cat_id); | ||
162 | $this->view->info = "Erfolgreich geladen aus DB"; | 162 | $this->view->info .= "Successfully loaded from the database"; | ||
163 | } catch (Exception $e) { | 163 | } catch (Exception $e) { | ||
164 | $this->view->info = "Fehler bei laden aus DB:" . $e->getMessage(); | 164 | $this->view->info .= "Error while loading from the database:" . $e->getMessage(); | ||
tfella: ffrom | |||||
165 | $cat = null; | 165 | $cat = null; | ||
166 | $count = 0; | 166 | $count = 0; | ||
167 | } | 167 | } | ||
168 | 168 | | |||
169 | $this->view->cat_id = $cat['id']; | 169 | $this->view->cat_id = $cat['id']; | ||
170 | $this->view->cat_desc = $cat['desc']; | 170 | $this->view->cat_desc = $cat['desc']; | ||
171 | $this->view->count = $count; | 171 | $this->view->count = $count; | ||
172 | 172 | | |||
173 | try { | 173 | try { | ||
174 | $catArray = $contentTable->fetchOcsCategories(); | 174 | $catArray = $contentTable->fetchOcsCategories(); | ||
175 | $this->view->info = "Erfolgreich geladen aus DB"; | 175 | $this->view->info = "Successfully loaded from the database"; | ||
176 | } catch (Exception $e) { | 176 | } catch (Exception $e) { | ||
177 | $this->view->info = "Fehler bei laden aus DB:" . $e->getMessage(); | 177 | $this->view->info = "Error while loading from the database:" . $e->getMessage(); | ||
tfella: ffrom | |||||
178 | $catArray = null; | 178 | $catArray = null; | ||
179 | } | 179 | } | ||
180 | 180 | | |||
181 | $this->view->categories = $catArray; | 181 | $this->view->categories = $catArray; | ||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | private function step3() | 184 | private function step3() | ||
185 | { | 185 | { | ||
186 | $params = $this->getAllParams(); | 186 | $params = $this->getAllParams(); | ||
187 | $cat_id = $params['cat_id']; | 187 | $cat_id = $params['cat_id']; | ||
188 | $ocs_cat_id = $params['ocs_cat_id']; | 188 | $ocs_cat_id = $params['ocs_cat_id']; | ||
189 | $cat = null; | 189 | $cat = null; | ||
190 | $contentTable = new Default_Model_DbTable_HiveContent(); | 190 | $contentTable = new Default_Model_DbTable_HiveContent(); | ||
191 | try { | 191 | try { | ||
192 | $count = $contentTable->fetchCountProjectsForCategory($cat_id); | 192 | $count = $contentTable->fetchCountProjectsForCategory($cat_id); | ||
193 | $cat = $contentTable->fetchHiveCategory($cat_id); | 193 | $cat = $contentTable->fetchHiveCategory($cat_id); | ||
194 | $this->view->info .= "Erfolgreich geladen aus DB"; | 194 | $this->view->info .= "Successfully loaded from the database"; | ||
195 | $this->view->cat_id = $cat['id']; | 195 | $this->view->cat_id = $cat['id']; | ||
196 | $this->view->cat_desc = $cat['desc']; | 196 | $this->view->cat_desc = $cat['desc']; | ||
197 | $this->view->count = $count; | 197 | $this->view->count = $count; | ||
198 | 198 | | |||
199 | $ocs_cat = $contentTable->fetchOcsCategory($ocs_cat_id); | 199 | $ocs_cat = $contentTable->fetchOcsCategory($ocs_cat_id); | ||
200 | $this->view->info .= "Erfolgreich geladen aus DB"; | 200 | $this->view->info .= "Successfully loaded from the database"; | ||
201 | $this->view->ocs_cat_id = $ocs_cat['id']; | 201 | $this->view->ocs_cat_id = $ocs_cat['id']; | ||
202 | $this->view->ocs_cat_desc = $ocs_cat['desc']; | 202 | $this->view->ocs_cat_desc = $ocs_cat['desc']; | ||
203 | } catch (Exception $e) { | 203 | } catch (Exception $e) { | ||
204 | $this->view->info = "Fehler bei laden aus DB:" . $e->getMessage(); | 204 | $this->view->info = "Error while loading from the database:" . $e->getMessage(); | ||
tfella: ffrom | |||||
205 | $cat = null; | 205 | $cat = null; | ||
206 | $count = 0; | 206 | $count = 0; | ||
207 | } | 207 | } | ||
208 | 208 | | |||
209 | try { | 209 | try { | ||
210 | $catArray = $contentTable->fetchOcsCategories(); | 210 | $catArray = $contentTable->fetchOcsCategories(); | ||
211 | $this->view->info .= "Erfolgreich geladen aus DB"; | 211 | $this->view->info .= "Successfully loaded from the database"; | ||
212 | } catch (Exception $e) { | 212 | } catch (Exception $e) { | ||
213 | $this->view->info .= "Fehler bei laden aus DB:" . $e->getMessage(); | 213 | $this->view->info .= "Error while loading from the database:" . $e->getMessage(); | ||
214 | $catArray = null; | 214 | $catArray = null; | ||
215 | } | 215 | } | ||
216 | 216 | | |||
217 | $this->view->categories = $catArray; | 217 | $this->view->categories = $catArray; | ||
218 | } | 218 | } | ||
219 | 219 | | |||
220 | private function step4() | 220 | private function step4() | ||
221 | { | 221 | { | ||
Show All 17 Lines | 238 | { | |||
239 | $catArray = null; | 239 | $catArray = null; | ||
240 | $params = $this->getAllParams(); | 240 | $params = $this->getAllParams(); | ||
241 | $cat_ids = $params['cat_ids']; | 241 | $cat_ids = $params['cat_ids']; | ||
242 | 242 | | |||
243 | $contentTable = new Default_Model_DbTable_HiveContentCategory(); | 243 | $contentTable = new Default_Model_DbTable_HiveContentCategory(); | ||
244 | try { | 244 | try { | ||
245 | if (isset($cat_ids)) { | 245 | if (isset($cat_ids)) { | ||
246 | $catArray = $contentTable->fetchHiveCategories($cat_ids); | 246 | $catArray = $contentTable->fetchHiveCategories($cat_ids); | ||
247 | $this->view->info = "Erfolgreich geladen aus DB"; | 247 | $this->view->info = "Successfully loaded from the database"; | ||
cblack: Successfully | |||||
248 | } else { | 248 | } else { | ||
249 | $this->view->info = "Keine Kategorien anegeben!"; | 249 | $this->view->info = "No category selected!"; | ||
250 | } | 250 | } | ||
251 | } catch (Exception $e) { | 251 | } catch (Exception $e) { | ||
252 | $this->view->info = "Fehler bei laden aus DB:" . $e->getMessage(); | 252 | $this->view->info = "Error while loading from the database:" . $e->getMessage(); | ||
cblack: Typo | |||||
253 | $catArray = null; | 253 | $catArray = null; | ||
254 | } | 254 | } | ||
255 | 255 | | |||
256 | $this->view->categories = $catArray; | 256 | $this->view->categories = $catArray; | ||
257 | $this->view->cat_ids = $cat_ids; | 257 | $this->view->cat_ids = $cat_ids; | ||
258 | } | 258 | } | ||
259 | 259 | | |||
260 | private function step30() | 260 | private function step30() | ||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Line(s) | 337 | try { | |||
453 | } | 453 | } | ||
454 | $result['Message'] = $info; | 454 | $result['Message'] = $info; | ||
455 | $_is_import_done = true; | 455 | $_is_import_done = true; | ||
456 | } catch (Exception $e) { | 456 | } catch (Exception $e) { | ||
457 | $this->view->info = $e->getMessage(); | 457 | $this->view->info = $e->getMessage(); | ||
458 | $_is_import_done = true; | 458 | $_is_import_done = true; | ||
459 | 459 | | |||
460 | $result['Result'] = self::RESULT_ERROR; | 460 | $result['Result'] = self::RESULT_ERROR; | ||
461 | $result['Message'] = "Fehler bei laden aus DB:" . $e->getMessage(); | 461 | $result['Message'] = "Error while loading from database:" . $e->getMessage(); | ||
462 | } | 462 | } | ||
463 | 463 | | |||
464 | $count = $contentTable->fetchCountProjectsForCategory($cat_id); | 464 | $count = $contentTable->fetchCountProjectsForCategory($cat_id); | ||
465 | 465 | | |||
466 | $result['Result'] = self::RESULT_OK; | 466 | $result['Result'] = self::RESULT_OK; | ||
467 | $result['IsImportDone'] = $_is_import_done; | 467 | $result['IsImportDone'] = $_is_import_done; | ||
468 | $result['TotalCounter'] = $count; | 468 | $result['TotalCounter'] = $count; | ||
469 | $result['ImportCounter'] = $_import_counter; | 469 | $result['ImportCounter'] = $_import_counter; | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 526 | if ($fileUrl != null) { | |||
530 | /** | 530 | /** | ||
531 | * //Workaround for gifs: don't use cache on cdn | 531 | * //Workaround for gifs: don't use cache on cdn | ||
532 | * $pos = strrpos($cnFileUrl, ".gif"); | 532 | * $pos = strrpos($cnFileUrl, ".gif"); | ||
533 | * if ($pos>0) { // Beachten sie die drei Gleichheitszeichen | 533 | * if ($pos>0) { // Beachten sie die drei Gleichheitszeichen | ||
534 | * //gefunden ... | 534 | * //gefunden ... | ||
535 | * $cnFileUrl = str_replace('/cache/120x96-2', '', $cnFileUrl); | 535 | * $cnFileUrl = str_replace('/cache/120x96-2', '', $cnFileUrl); | ||
536 | * } | 536 | * } | ||
537 | **/ | 537 | **/ | ||
538 | $info .= "ImageUpload successfull: " . $cnFileUrl; | 538 | $info .= "ImageUpload successful: " . $cnFileUrl; | ||
539 | } else { | 539 | } else { | ||
540 | $path = 'https://cn.opendesktop.org/img/hive/content-pre2/' . $hiveProjectId . '-2.'; | 540 | $path = 'https://cn.opendesktop.org/img/hive/content-pre2/' . $hiveProjectId . '-2.'; | ||
541 | $fileUrl = null; | 541 | $fileUrl = null; | ||
542 | $fileExtention = null; | 542 | $fileExtention = null; | ||
543 | $info = ''; | 543 | $info = ''; | ||
544 | 544 | | |||
545 | if ($this->check_img($path . 'gif')) { | 545 | if ($this->check_img($path . 'gif')) { | ||
546 | $fileUrl = ($path . 'gif'); | 546 | $fileUrl = ($path . 'gif'); | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 586 | if ($fileUrl != null) { | |||
590 | /** | 590 | /** | ||
591 | * //Workaround for gifs: don't use cache on cdn | 591 | * //Workaround for gifs: don't use cache on cdn | ||
592 | * $pos = strrpos($cnFileUrl, ".gif"); | 592 | * $pos = strrpos($cnFileUrl, ".gif"); | ||
593 | * if ($pos>0) { // Beachten sie die drei Gleichheitszeichen | 593 | * if ($pos>0) { // Beachten sie die drei Gleichheitszeichen | ||
594 | * //gefunden ... | 594 | * //gefunden ... | ||
595 | * $cnFileUrl = str_replace('/cache/120x96-2', '', $cnFileUrl); | 595 | * $cnFileUrl = str_replace('/cache/120x96-2', '', $cnFileUrl); | ||
596 | * } | 596 | * } | ||
597 | **/ | 597 | **/ | ||
598 | $info .= "ImageUpload successfull: " . $cnFileUrl; | 598 | $info .= "ImageUpload successful: " . $cnFileUrl; | ||
599 | } else { | 599 | } else { | ||
600 | $path = 'https://cn.opendesktop.org/img/hive/content-pre3/' . $hiveProjectId . '-3.'; | 600 | $path = 'https://cn.opendesktop.org/img/hive/content-pre3/' . $hiveProjectId . '-3.'; | ||
601 | $fileUrl = null; | 601 | $fileUrl = null; | ||
602 | $fileExtention = null; | 602 | $fileExtention = null; | ||
603 | $info = ''; | 603 | $info = ''; | ||
604 | 604 | | |||
605 | if ($this->check_img($path . 'gif')) { | 605 | if ($this->check_img($path . 'gif')) { | ||
606 | $fileUrl = ($path . 'gif'); | 606 | $fileUrl = ($path . 'gif'); | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 646 | if ($fileUrl != null) { | |||
650 | /** | 650 | /** | ||
651 | * //Workaround for gifs: don't use cache on cdn | 651 | * //Workaround for gifs: don't use cache on cdn | ||
652 | * $pos = strrpos($cnFileUrl, ".gif"); | 652 | * $pos = strrpos($cnFileUrl, ".gif"); | ||
653 | * if ($pos>0) { // Beachten sie die drei Gleichheitszeichen | 653 | * if ($pos>0) { // Beachten sie die drei Gleichheitszeichen | ||
654 | * //gefunden ... | 654 | * //gefunden ... | ||
655 | * $cnFileUrl = str_replace('/cache/120x96-2', '', $cnFileUrl); | 655 | * $cnFileUrl = str_replace('/cache/120x96-2', '', $cnFileUrl); | ||
656 | * } | 656 | * } | ||
657 | **/ | 657 | **/ | ||
658 | $info .= "ImageUpload successfull: " . $cnFileUrl; | 658 | $info .= "ImageUpload successful: " . $cnFileUrl; | ||
659 | } else { | 659 | } else { | ||
660 | $info .= "No preview pic"; | 660 | $info .= "No preview pic"; | ||
661 | } | 661 | } | ||
662 | } | 662 | } | ||
663 | } | 663 | } | ||
664 | 664 | | |||
665 | //var_dump($info); | 665 | //var_dump($info); | ||
666 | return $cnFileUrl; | 666 | return $cnFileUrl; | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 783 | try { | |||
795 | $ratingSum = $votingTable->fetchRating($projectId); | 795 | $ratingSum = $votingTable->fetchRating($projectId); | ||
796 | $count_likes = $ratingSum['count_likes']; | 796 | $count_likes = $ratingSum['count_likes']; | ||
797 | $count_dislikes = $ratingSum['count_dislikes']; | 797 | $count_dislikes = $ratingSum['count_dislikes']; | ||
798 | $projectObj['count_likes'] = $count_likes; | 798 | $projectObj['count_likes'] = $count_likes; | ||
799 | $projectObj['count_dislikes'] = $count_dislikes; | 799 | $projectObj['count_dislikes'] = $count_dislikes; | ||
800 | 800 | | |||
801 | //update project | 801 | //update project | ||
802 | $updateCount = $projectTable->update($projectObj, "project_id = " . $projectId); | 802 | $updateCount = $projectTable->update($projectObj, "project_id = " . $projectId); | ||
803 | $info .= "Update Project successfull: Updated rows: " . $updateCount; | 803 | $info .= "Update Project successful: Updated rows: " . $updateCount; | ||
804 | 804 | | |||
805 | //update changelog? | 805 | //update changelog? | ||
806 | if (isset($project['changelog']) && $project['changelog'] != '') { | 806 | if (isset($project['changelog']) && $project['changelog'] != '') { | ||
807 | $projectUpdatesTable = new Default_Model_ProjectUpdates(); | 807 | $projectUpdatesTable = new Default_Model_ProjectUpdates(); | ||
808 | $projectUpdate = | 808 | $projectUpdate = | ||
809 | $projectUpdatesTable->fetchRow('project_id = ' . $projectId . ' AND source_id = 1 AND source_pk = ' | 809 | $projectUpdatesTable->fetchRow('project_id = ' . $projectId . ' AND source_id = 1 AND source_pk = ' | ||
810 | . $project['id']); | 810 | . $project['id']); | ||
811 | if ($projectUpdate) { | 811 | if ($projectUpdate) { | ||
Show All 19 Lines | |||||
831 | } | 831 | } | ||
832 | } catch (Exception $e) { | 832 | } catch (Exception $e) { | ||
833 | throw new Exception(__FUNCTION__ . '::ERROR update project: ' . $e); | 833 | throw new Exception(__FUNCTION__ . '::ERROR update project: ' . $e); | ||
834 | } | 834 | } | ||
835 | } else { | 835 | } else { | ||
836 | try { | 836 | try { | ||
837 | //Create new project | 837 | //Create new project | ||
838 | $newProjectObj = $projectTable->save($projectObj); | 838 | $newProjectObj = $projectTable->save($projectObj); | ||
839 | $info .= "Create Project successfull: " . $newProjectObj['project_id']; | 839 | $info .= "Create Project successful: " . $newProjectObj['project_id']; | ||
840 | $projectId = $newProjectObj['project_id']; | 840 | $projectId = $newProjectObj['project_id']; | ||
841 | 841 | | |||
842 | $votingTable = new Default_Model_DbTable_ProjectRating(); | 842 | $votingTable = new Default_Model_DbTable_ProjectRating(); | ||
843 | 843 | | |||
844 | $votingTable->delete('member_id = 0 AND project_id = ' . $projectId); | 844 | $votingTable->delete('member_id = 0 AND project_id = ' . $projectId); | ||
845 | //insert the old hive votings | 845 | //insert the old hive votings | ||
846 | $votearray = array(); | 846 | $votearray = array(); | ||
847 | $votearray['member_id'] = 0; | 847 | $votearray['member_id'] = 0; | ||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 926 | foreach ($oldFiles->files as $oldFile) { | |||
931 | } | 931 | } | ||
932 | } | 932 | } | ||
933 | } | 933 | } | ||
934 | 934 | | |||
935 | //$uploadFileResult = $this->uploadFileToPpload($projectId, 'http://cp1.hive01.com/CONTENT/content-files/'.$file1); | 935 | //$uploadFileResult = $this->uploadFileToPpload($projectId, 'http://cp1.hive01.com/CONTENT/content-files/'.$file1); | ||
936 | $uploadFileResult = $this->saveFileInPpload($projectId, $project['downloadname1'], $project['licensetype'], | 936 | $uploadFileResult = $this->saveFileInPpload($projectId, $project['downloadname1'], $project['licensetype'], | ||
937 | base64_encode($project['license']), $downloadCounter, | 937 | base64_encode($project['license']), $downloadCounter, | ||
938 | $this->_HIVE_BASE_URL . '/CONTENT/content-files/' . $file1); | 938 | $this->_HIVE_BASE_URL . '/CONTENT/content-files/' . $file1); | ||
939 | $info .= "Upload file successfull: " . $uploadFileResult; | 939 | $info .= "Upload file successful: " . $uploadFileResult; | ||
940 | if ($uploadFileResult == true) { | 940 | if ($uploadFileResult == true) { | ||
941 | $_import_file_counter++; | 941 | $_import_file_counter++; | ||
942 | } else { | 942 | } else { | ||
943 | throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $uploadFileResult); | 943 | throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $uploadFileResult); | ||
944 | } | 944 | } | ||
945 | } catch (Exception $e) { | 945 | } catch (Exception $e) { | ||
946 | throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $e); | 946 | throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $e); | ||
947 | } | 947 | } | ||
948 | } | 948 | } | ||
949 | } else { | 949 | } else { | ||
950 | //a link | 950 | //a link | ||
951 | try { | 951 | try { | ||
952 | $link1 = $project['downloadlink1']; | 952 | $link1 = $project['downloadlink1']; | ||
953 | if ($link1 != 'http://' && !empty($link1)) { | 953 | if ($link1 != 'http://' && !empty($link1)) { | ||
954 | $link1 = urlencode($link1); | 954 | $link1 = urlencode($link1); | ||
955 | $linkName1 = $project['downloadname1']; | 955 | $linkName1 = $project['downloadname1']; | ||
956 | if (empty($linkName1)) { | 956 | if (empty($linkName1)) { | ||
957 | $linkName1 = "link"; | 957 | $linkName1 = "link"; | ||
958 | } | 958 | } | ||
959 | $downloadCounter = 0; | 959 | $downloadCounter = 0; | ||
960 | $uploadFileResult = $this->saveFileInPpload($projectId, $project['downloadname1'], $project['licensetype'], | 960 | $uploadFileResult = $this->saveFileInPpload($projectId, $project['downloadname1'], $project['licensetype'], | ||
961 | base64_encode($project['license']), 0, $this->_HIVE_BASE_URL . '/CONTENT/content-files/link', $link1, | 961 | base64_encode($project['license']), 0, $this->_HIVE_BASE_URL . '/CONTENT/content-files/link', $link1, | ||
962 | $linkName1); | 962 | $linkName1); | ||
963 | $info .= "Upload file successfull: " . $uploadFileResult; | 963 | $info .= "Upload file successful: " . $uploadFileResult; | ||
964 | if ($uploadFileResult == true) { | 964 | if ($uploadFileResult == true) { | ||
965 | $_import_file_counter++; | 965 | $_import_file_counter++; | ||
966 | } | 966 | } | ||
967 | } | 967 | } | ||
968 | } catch (Exception $e) { | 968 | } catch (Exception $e) { | ||
969 | throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $e); | 969 | throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $e); | ||
970 | } | 970 | } | ||
971 | } | 971 | } | ||
972 | 972 | | |||
973 | //Then links... | 973 | //Then links... | ||
974 | for ($i = 2; $i <= 12; $i++) { | 974 | for ($i = 2; $i <= 12; $i++) { | ||
975 | try { | 975 | try { | ||
976 | $link1 = $project['downloadlink' . $i]; | 976 | $link1 = $project['downloadlink' . $i]; | ||
977 | if ($link1 != 'http://' && !empty($link1)) { | 977 | if ($link1 != 'http://' && !empty($link1)) { | ||
978 | $link1 = urlencode($link1); | 978 | $link1 = urlencode($link1); | ||
979 | $linkName1 = $project['downloadname' . $i]; | 979 | $linkName1 = $project['downloadname' . $i]; | ||
980 | if (empty($linkName1)) { | 980 | if (empty($linkName1)) { | ||
981 | $linkName1 = "link"; | 981 | $linkName1 = "link"; | ||
982 | } | 982 | } | ||
983 | $downloadCounter = 0; | 983 | $downloadCounter = 0; | ||
984 | $uploadFileResult = $this->saveFileInPpload($projectId, $project['downloadname' . $i], $project['licensetype'], | 984 | $uploadFileResult = $this->saveFileInPpload($projectId, $project['downloadname' . $i], $project['licensetype'], | ||
985 | base64_encode($project['license']), 0, $this->_HIVE_BASE_URL . '/CONTENT/content-files/link', $link1, | 985 | base64_encode($project['license']), 0, $this->_HIVE_BASE_URL . '/CONTENT/content-files/link', $link1, | ||
986 | $linkName1); | 986 | $linkName1); | ||
987 | $info .= "Upload file successfull: " . $link1; | 987 | $info .= "Upload file successful: " . $link1; | ||
988 | if ($uploadFileResult == true) { | 988 | if ($uploadFileResult == true) { | ||
989 | $_import_file_counter++; | 989 | $_import_file_counter++; | ||
990 | } | 990 | } | ||
991 | } | 991 | } | ||
992 | } catch (Exception $e) { | 992 | } catch (Exception $e) { | ||
993 | //throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $e); | 993 | //throw new Exception(__FUNCTION__ . '::ERROR Upload file: ' . $e); | ||
994 | } | 994 | } | ||
995 | } | 995 | } | ||
▲ Show 20 Lines • Show All 636 Lines • Show Last 20 Lines |
Typo