From b8098c7d1ea0b7d55bff5cecf5b2ed383be11d27 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Mon, 12 Oct 2020 22:26:04 +0530 Subject: [PATCH 01/19] Added od for odia --- app/config/locale/codes.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/config/locale/codes.php b/app/config/locale/codes.php index d477f34bb..02057440e 100644 --- a/app/config/locale/codes.php +++ b/app/config/locale/codes.php @@ -31,11 +31,12 @@ return [ 'ko', // Korean 'lt', // Lithuanian 'ml', // Malayalam - 'mr', //Marathi + 'mr', // Marathi 'ms', // Malay 'nl', // Dutch 'no', // Norwegian - 'np', //Nepali + 'np', // Nepali + 'od', // Odia 'ph', // Filipino 'pl', // Polish 'pt-br', // Portuguese - Brazil From 148026f57a049efd46aceff6585288146c2ebcc1 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Mon, 12 Oct 2020 22:33:47 +0530 Subject: [PATCH 02/19] updated od --- app/init.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/init.php b/app/init.php index 5188abc99..6e924fdec 100644 --- a/app/init.php +++ b/app/init.php @@ -257,6 +257,7 @@ Locale::setLanguage('ms', include __DIR__.'/config/locale/translations/ms.php'); Locale::setLanguage('nl', include __DIR__.'/config/locale/translations/nl.php'); Locale::setLanguage('no', include __DIR__.'/config/locale/translations/no.php'); Locale::setLanguage('np', include __DIR__.'/config/locale/translations/np.php'); +Locale::setLanguage('od', include __DIR__.'/config/locale/translations/od.php'); Locale::setLanguage('ph', include __DIR__.'/config/locale/translations/ph.php'); Locale::setLanguage('pl', include __DIR__.'/config/locale/translations/pl.php'); Locale::setLanguage('pt-br', include __DIR__.'/config/locale/translations/pt-br.php'); From 55544dd950a20d28b834e224b769caaa7ab821b4 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:36:43 +0530 Subject: [PATCH 03/19] Create od.continents.php --- app/config/locale/translations/od.continents.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/config/locale/translations/od.continents.php diff --git a/app/config/locale/translations/od.continents.php b/app/config/locale/translations/od.continents.php new file mode 100644 index 000000000..d89addeef --- /dev/null +++ b/app/config/locale/translations/od.continents.php @@ -0,0 +1,11 @@ + 'ଆଫ୍ରିକା', + 'AN' => 'ଆଣ୍ଟାର୍କଟିକା', + 'AS' => 'ଏସିଆ', + 'EU' => 'ଇଉରୋପ', + 'NA' => 'ନର୍ଥ ଆମେରିକା', + 'OC' => 'ଓସାନିଆ', + 'SA' => 'ସାଉଥ ଆମେରିକା', +]; From 363206077df8674d858f1868a6cdf815beb8305d Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:37:34 +0530 Subject: [PATCH 04/19] Create od.countries.php --- .../locale/translations/od.countries.php | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 app/config/locale/translations/od.countries.php diff --git a/app/config/locale/translations/od.countries.php b/app/config/locale/translations/od.countries.php new file mode 100644 index 000000000..ca24130b4 --- /dev/null +++ b/app/config/locale/translations/od.countries.php @@ -0,0 +1,198 @@ + 'ଅଫଘନିସ୍ତାନ', + 'AO' => 'ଅଙ୍ଗୋଲା', + 'AL' => 'ଆଲବେନିଆ', + 'AD' => 'ଆଣ୍ଡୋରା', + 'AE' => 'ୟୁନାଇଟେଡ୍ ଆରବ ଏମିରେଟେସ୍', + 'AR' => 'ଆର୍ଜେଣ୍ଟିନା', + 'AM' => 'ଆର୍ମେନିଆ', + 'AG' => 'ଆଣ୍ଟିଗୁଆ ଏବଂ ବାରବୁଦା', + 'AU' => 'ଅଷ୍ଟ୍ରେଲିଆ', + 'AT' => 'ଅଷ୍ଟ୍ରିଆ', + 'AZ' => 'ଆଜେରବାଇଜାନ', + 'BI' => 'ବୁରୁଣ୍ଡି', + 'BE' => 'ବେଲଜିୟମ', + 'BJ' => 'ବେନିନ୍', + 'BF' => 'ବୁର୍କିନା ଫାସୋ', + 'BD' => 'ବାଂଲାଦେଶ', + 'BG' => 'ବୁଲଗେରିଆ', + 'BH' => 'ବହାରେନ', + 'BS' => 'ବାହାମା', + 'BA' => 'ବୋସନିଆ ଏବଂ ହେର୍ଜେଗୋଭିନା', + 'BY' => 'ବେଳରୁଷ', + 'BZ' => 'ବେଲିଜ଼ଏ', + 'BO' => 'ବୋଲିଭିଆ', + 'BR' => 'ବ୍ରାଜିଲ୍', + 'BB' => 'ବାରବାଡୋସ୍', + 'BN' => 'ବ୍ରୁନେଇ', + 'BT' => 'ଭୁଟାନ', + 'BW' => 'ବୋତସ୍ୱାନା', + 'CF' => 'କେନ୍ଦ୍ରୀୟ ଆଫ୍ରିକୀୟ ଗଣତନ୍ତ୍ର', + 'CA' => 'କାନାଡା', + 'CH' => 'ସ୍ୱିଜରଲ୍ୟାଣ୍ଡ', + 'CL' => 'ଚିଲି', + 'CN' => 'ଚୀନ୍', + 'CI' => 'ଆଇଭୋରୀ କୋଷ୍ଟ', + 'CM' => 'କାମେରୁନ୍', + 'CD' => 'ଡ଼ ର କଙ୍ଗୋ', + 'CG' => 'କଙ୍ଗୋ ଗଣତନ୍ତ୍ର', + 'CO' => 'କଲମ୍ବିଆ', + 'KM' => 'କୋମୋରସ୍', + 'CV' => 'କେପ୍ ଭର୍ଡେ', + 'CR' => 'କୋଷ୍ଟାରିକା', + 'CU' => 'କ୍ୟୁବା', + 'CY' => 'ସାଇପ୍ରସ୍', + 'CZ' => 'ଚେକିଆ', + 'DE' => 'ଜର୍ମାନୀ', + 'DJ' => 'ଜିବୁଟି', + 'DM' => 'ଡୋମିନିକା', + 'DK' => 'ଡେନମାର୍କ', + 'DO' => 'ଡୋମିନିକାନ୍ ରିପବ୍ଲିକ୍', + 'DZ' => 'ଆଲଜେରିଆ', + 'EC' => 'ଇକ୍ୟୁଏଡର୍', + 'EG' => 'ମିଶର', + 'ER' => 'ଇରିଟ୍ରିଆ', + 'ES' => 'ସ୍ପେନ୍', + 'EE' => 'ଇଷ୍ଟୋନିଆ', + 'ET' => 'ଇଥିଓପିଆ', + 'FI' => 'ଫିନଲ୍ୟାଣ୍ଡ', + 'FJ' => 'ଫିଜି', + 'FR' => 'ଫ୍ରାନ୍ସ', + 'FM' => 'ମାଇକ୍ରୋନେସିଆ', + 'GA' => 'ଗାବନ୍', + 'GB' => 'ୟୁନାଇଟେଡ୍ କିଙ୍ଗଡମ', + 'GE' => 'ଜର୍ଜିଆ', + 'GH' => 'ଘାନା', + 'GN' => 'ଗିନି', + 'GM' => 'ଗାମ୍ବିଆ', + 'GW' => 'ଗିନି-ବିସାଉ', + 'GQ' => 'ଏକ୍ୟୁଟୋରିଆଲ୍ ଗିନି', + 'GR' => 'ଗ୍ରୀସ୍', + 'GD' => 'ଗ୍ରେନାଡା', + 'GT' => 'ଗୁଆଟେମାଲା', + 'GY' => 'ଗୁଇନ୍ଦା', + 'HN' => 'ହୋଣ୍ଡୁରାସ୍', + 'HR' => 'କ୍ରୋଏସିଆ', + 'HT' => 'ହାଇତି', + 'HU' => 'ହଙ୍ଗେରୀ', + 'ID' => 'ଇଣ୍ଡୋନେସିଆ', + 'IN' => 'ଭାରତ', + 'IE' => 'ଆୟର୍ଲାଣ୍ଡ', + 'IR' => 'ଇରାନ', + 'IQ' => 'ଇରାକ', + 'IS' => 'ଆଇସଲ୍ୟାଣ୍ଡ', + 'IL' => 'ଇସ୍ରାଏଲ', + 'IT' => 'ଇଟାଲୀ', + 'JM' => 'ଜାମାଇକା', + 'JO' => 'ଜୋର୍ଡାନ', + 'JP' => 'ଜାପାନ', + 'KZ' => 'କାଜାଖସ୍ତାନ', + 'KE' => 'କେନିଆ', + 'KG' => 'କିର୍ଗିଜସ୍ଥାନ', + 'KH' => 'କାମ୍ବୋଡିଆ', + 'KI' => 'କିରିବାଟି', + 'KN' => 'ସେଣ୍ଟ କିଟ୍ସ ଏବଂ ନେଭିସ୍', + 'KR' => 'ଦକ୍ଷିଣ କୋରିଆ', + 'KW' => 'କୁଏତ', + 'LA' => 'ଲାଓସ୍', + 'LB' => 'ଲିବାନୋନ୍', + 'LR' => 'ଲାଇବେରିଆ', + 'LY' => 'ଲିବିଆ', + 'LC' => 'ସେଣ୍ଟ ଲୁସିଆ', + 'LI' => 'ଲିଚଟେଷ୍ଟାଇନ୍', + 'LK' => 'ଶ୍ରୀ ଲଙ୍କା', + 'LS' => 'ଲେସୋଥୋ', + 'LT' => 'ଲିଥୁଆନିଆ', + 'LU' => 'ଲକ୍ସେମବର୍ଗ', + 'LV' => 'ଲାଟଭିଆ', + 'MA' => 'ମୋରୋକୋ', + 'MC' => 'ମୋନାକୋ', + 'MD' => 'ମଲଡୋଭା', + 'MG' => 'ମାଡାଗାସ୍କର', + 'MV' => 'ମାଲଦ୍ୱୀପ', + 'MX' => 'ମେକ୍ସିକୋ', + 'MH' => 'ମାର୍ଶଲ ଦ୍ୱୀପପୁଞ୍ଜ', + 'MK' => 'ମାକେଡୋନିଆ', + 'ML' => 'ମାଲି', + 'MT' => 'ମାଲ୍ଟା', + 'MM' => 'ମିଆଁମାର', + 'ME' => 'ମୋଣ୍ଟେନେଗ୍ରୋ', + 'MN' => 'ମୋଙ୍ଗୋଲିଆ', + 'MZ' => 'ମୋଜାମ୍ବିକ୍', + 'MR' => 'ମରିସାନିଆ', + 'MU' => 'ମରିସସ୍', + 'MW' => 'ମଲାୱି', + 'MY' => 'ମାଲେସିଆ', + 'NA' => 'ନାମିବିଆ', + 'NE' => 'ନାଇଜର', + 'NG' => 'ନାଇଜେରିଆ', + 'NI' => 'ନିକାରାଗୁଆ', + 'NL' => 'ନେଦରଲ୍ୟାଣ୍ଡ', + 'NO' => 'ନରୱେ', + 'NP' => 'ନେପାଳ', + 'NR' => 'ନାଉରୁ', + 'NZ' => 'ନିଉଜିଲାଣ୍ଡ୍', + 'OM' => 'ଓମାନ', + 'PK' => 'ପାକିସ୍ତାନ', + 'PA' => 'ପାନାମା', + 'PE' => 'ପେରୁ', + 'PH' => 'ଫିଲିପାଇନ୍ସ', + 'PW' => 'ପାଲାଉ', + 'PG' => 'ପାପୁଆ ନ୍ୟୁ ଗିନି', + 'PL' => 'ପୋଲାଣ୍ଡ', + 'KP' => 'ଉତ୍ତର କୋରିଆ', + 'PT' => 'ପର୍ତ୍ତୁଗାଲ୍', + 'PY' => 'ପାରାଗୁଏ', + 'QA' => 'କାତାର', + 'RO' => 'ରୋମାନିଆ', + 'RU' => 'ୠଷ୍ସିଆ', + 'RW' => 'ରୁୱାଣ୍ଡା', + 'SA' => 'ସାଉଦି ଆରବ', + 'SD' => 'ସୁଦାନ', + 'SN' => 'ସେନେଗାଲ୍', + 'SG' => 'ସିଙ୍ଗାପୁର', + 'SB' => 'ଶଲୋମନ ଦ୍ୱୀପପୁ୍ଜ', + 'SL' => 'ସିଇରା ଲେଓନେ', + 'SV' => 'ଏଲ ସାଲଭାଡୋର', + 'SM' => 'ସାନ୍ ମାରିନୋ', + 'SO' => 'ସୋମାଲିଆ', + 'RS' => 'ସର୍ବିଆ', + 'SS' => 'ଦକ୍ଷିଣ ସୁଦାନ', + 'ST' => 'ସାଓ ଟୋମେ ଏବଂ ପ୍ରିନ୍ସିପି', + 'SR' => 'ସୁରିନାମ', + 'SK' => 'ସ୍ଲୋଭାକିଆ', + 'SI' => 'ସ୍ଲୋଭେନିଆ', + 'SE' => 'ସ୍ୱିଡେନ', + 'SZ' => 'ସ୍ୱେଜ଼ୀଲାଣ୍ଡ', + 'SC' => 'ସେଚେଲସ୍', + 'SY' => 'ସିରିଆ', + 'TD' => 'ଚାଡ', + 'TG' => 'ଟୋଗୋ', + 'TH' => 'ଥାଇଲ୍ୟାଣ୍ଡ', + 'TJ' => 'ତାଜିକିସ୍ତାନ', + 'TM' => 'ତୁର୍କମେନିସ୍ତାନ', + 'TL' => 'ତିମୋର-ଲେଷ୍ଟେ', + 'TO' => 'ଟୋଙ୍ଗା', + 'TT' => 'ତ୍ରିନିଦାଦ ଏବଂ ଟୋବାଗୋ', + 'TN' => 'ଟ୍ୟୁନିସିଆ', + 'TR' => 'ତୁର୍କୀ', + 'TV' => 'ତୁଭାଲୁ', + 'TZ' => 'ତାଞ୍ଜାନିଆ', + 'UG' => 'ଉଗାଣ୍ଡା', + 'UA' => 'ୟୁକ୍ରେନ', + 'UY' => 'ଉରୁଗୁଏ', + 'US' => 'ଯୁକ୍ତ ରାଷ୍ଟ୍ର', + 'UZ' => 'ଉଜବେକିସ୍ତାନ', + 'VA' => 'ଭାଟିକାନ୍ ସିଟି', + 'VC' => 'ସେଣ୍ଟ ଭିନ୍ସେଣ୍ଟ ଏବଂ ଗ୍ରେନାଡାଇନ୍ସ', + 'VE' => 'ଭେନେଜୁଏଲା', + 'VN' => 'ଭିଏତନାମ', + 'VU' => 'ଭାନୁୟୁଟୁ', + 'WS' => 'ସାମୋଆ', + 'YE' => 'ୟେମେନ', + 'ZA' => 'ଦକ୍ଷିଣ ଆଫ୍ରିକା', + 'ZM' => 'ଜାମ୍ବିଆ', + 'ZW' => 'ଜିମ୍ବାୱେ', +]; From 0e9ff0754765f8b4e107c0cd90a3654002c1c454 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:38:52 +0530 Subject: [PATCH 05/19] Create od.php --- app/config/locale/translations/od.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app/config/locale/translations/od.php diff --git a/app/config/locale/translations/od.php b/app/config/locale/translations/od.php new file mode 100644 index 000000000..b775bd90c --- /dev/null +++ b/app/config/locale/translations/od.php @@ -0,0 +1,21 @@ + '"ବୁଦ୍ଧିମାନ ହବାର କଲା ଏମିତି ଏକ କଲା ଯାହା ଜଣାଇଥାଏ କୋଉ ଜିନ୍ସ କୁ ଅଣଦେଖା କରିବା ଉଚିତ |"', // This is the line printed in the homepage and console 'view-source' + 'settings.locale' => 'od', + 'settings.direction' => 'ltr', + + // Service - Users + 'account.emails.team' => '%s ଟିମ', + 'account.emails.verification.title' => 'ଏକାଉଣ୍ଟ ଭେରିଫିକେସନ', + 'account.emails.verification.body' => 'en.email.auth.confirm.tpl', + 'account.emails.recovery.title' => 'ପାସୱାର୍ଡ ରିସେଟ', + 'account.emails.recovery.body' => 'en.email.auth.recovery.tpl', + 'account.emails.invitation.title' => 'ଈଂଭିଟେସନ %s ଟିମ at %s', + 'account.emails.invitation.body' => 'en.email.auth.invitation.tpl', + + 'locale.country.unknown' => 'ଅଜ୍ଞାତ', + + 'countries' => include 'od.countries.php', + 'continents' => include 'od.continents.php', +]; From 12f5ca32c20b7f32f16288ccb3417ea8a87ea838 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:39:56 +0530 Subject: [PATCH 06/19] Create od.email.auth.confirm.tpl --- .../templates/od.email.auth.confirm.tpl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/config/locale/translations/templates/od.email.auth.confirm.tpl diff --git a/app/config/locale/translations/templates/od.email.auth.confirm.tpl b/app/config/locale/translations/templates/od.email.auth.confirm.tpl new file mode 100644 index 000000000..9453a2a35 --- /dev/null +++ b/app/config/locale/translations/templates/od.email.auth.confirm.tpl @@ -0,0 +1,16 @@ +

+ + ନମସ୍କାର {{name}}, +

+

+ ଆପଣଙ୍କର ଇମେଲ୍ ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ| +

+{{cta}} +

+ ଯଦି ଆପଣ ଏହି ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ କହି ନାହାଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ| +

+

+ ଧନ୍ୟବାଦ, +
+ {{project}} ଟିମ +

From 63b9bac0353a4ea34241a24a63e1a958531480df Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:41:00 +0530 Subject: [PATCH 07/19] Create od.email.auth.invitation.tpl --- .../templates/od.email.auth.invitation.tpl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/config/locale/translations/templates/od.email.auth.invitation.tpl diff --git a/app/config/locale/translations/templates/od.email.auth.invitation.tpl b/app/config/locale/translations/templates/od.email.auth.invitation.tpl new file mode 100644 index 000000000..ea1bf636c --- /dev/null +++ b/app/config/locale/translations/templates/od.email.auth.invitation.tpl @@ -0,0 +1,14 @@ +

+ ନମସ୍କାର, +

+

+ ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project}} ପାଇଁ {{team}} ଦଳରେ ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରିତ ହେବାକୁ ଚାହୁଁଥିଲେ| +

+{{cta}} +

+ ଯଦି ଆପଣ ଆଗ୍ରହୀ ନୁହଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଅଣଦେଖା କରିପାରିବେ |

+

+ ଧନ୍ୟବାଦ, +
+ {{project}} ଟିମ +

From f9f18aa1646741499a07ef56d8e3234917de6664 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:41:52 +0530 Subject: [PATCH 08/19] Create od.email.auth.recovery.tpl --- .../templates/od.email.auth.recovery.tpl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/config/locale/translations/templates/od.email.auth.recovery.tpl diff --git a/app/config/locale/translations/templates/od.email.auth.recovery.tpl b/app/config/locale/translations/templates/od.email.auth.recovery.tpl new file mode 100644 index 000000000..9a2075120 --- /dev/null +++ b/app/config/locale/translations/templates/od.email.auth.recovery.tpl @@ -0,0 +1,15 @@ +

+ ନମସ୍କାର {{name}}, +

+

+ {{project}} ପାସୱାର୍ଡ ରିସେଟ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଉପରେ କ୍ଲିକ୍ କରନ୍ତୁ | +

+{{cta}} +

+ ଯଦି ଆପଣ ଏହି ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ କହି ନାହାଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ| +

+

+ ଧନ୍ୟବାଦ, +
+ {{project}} ଟିମ +

From 9055993f59f0e467a8a9f519a110a5a6df3987d4 Mon Sep 17 00:00:00 2001 From: Prasannjit Mohapatra Date: Tue, 13 Oct 2020 12:45:27 +0530 Subject: [PATCH 09/19] Update od.php --- app/config/locale/translations/od.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/config/locale/translations/od.php b/app/config/locale/translations/od.php index b775bd90c..6b6973da2 100644 --- a/app/config/locale/translations/od.php +++ b/app/config/locale/translations/od.php @@ -1,18 +1,18 @@ '"ବୁଦ୍ଧିମାନ ହବାର କଲା ଏମିତି ଏକ କଲା ଯାହା ଜଣାଇଥାଏ କୋଉ ଜିନ୍ସ କୁ ଅଣଦେଖା କରିବା ଉଚିତ |"', // This is the line printed in the homepage and console 'view-source' + 'settings.inspire' => '"ଜ୍ଞାନୀ ହେବାର କଳା ହେଉଛି କ’ଣ ଅଣଦେଖା କରାଯିବ ଜାଣିବାର କଳା |"', // This is the line printed in the homepage and console 'view-source' 'settings.locale' => 'od', 'settings.direction' => 'ltr', // Service - Users 'account.emails.team' => '%s ଟିମ', 'account.emails.verification.title' => 'ଏକାଉଣ୍ଟ ଭେରିଫିକେସନ', - 'account.emails.verification.body' => 'en.email.auth.confirm.tpl', + 'account.emails.verification.body' => 'od.email.auth.confirm.tpl', 'account.emails.recovery.title' => 'ପାସୱାର୍ଡ ରିସେଟ', - 'account.emails.recovery.body' => 'en.email.auth.recovery.tpl', + 'account.emails.recovery.body' => 'od.email.auth.recovery.tpl', 'account.emails.invitation.title' => 'ଈଂଭିଟେସନ %s ଟିମ at %s', - 'account.emails.invitation.body' => 'en.email.auth.invitation.tpl', + 'account.emails.invitation.body' => 'od.email.auth.invitation.tpl', 'locale.country.unknown' => 'ଅଜ୍ଞାତ', From f8dc58bb6f06e8a72d32837d2ebd4b0e9daa7444 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 13 Oct 2020 11:51:41 +0300 Subject: [PATCH 10/19] Optimize build --- .travis.yml | 2 ++ Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c909ec433..47c09fbb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ arch: os: linux +language: minimal + notifications: email: - team@appwrite.io diff --git a/Dockerfile b/Dockerfile index 1a2798c45..63862cfbb 100755 --- a/Dockerfile +++ b/Dockerfile @@ -112,7 +112,8 @@ RUN \ && pecl install imagick yaml \ && docker-php-ext-enable imagick yaml \ && docker-php-ext-install sockets opcache pdo_mysql \ - && apk del .deps + && apk del .deps \ + && rm -rf /var/cache/apk/* WORKDIR /usr/src/code From 4547a1e3c6c2f813ddebc0cd7851db57c3150c4e Mon Sep 17 00:00:00 2001 From: Alessio Marinelli Date: Wed, 14 Oct 2020 14:12:50 +0200 Subject: [PATCH 11/19] Update it.countries.php Added missing translation for `Jordan` -> `Giordania` --- app/config/locale/translations/it.countries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/locale/translations/it.countries.php b/app/config/locale/translations/it.countries.php index ce4e56349..dc19dfbff 100644 --- a/app/config/locale/translations/it.countries.php +++ b/app/config/locale/translations/it.countries.php @@ -86,7 +86,7 @@ return [ 'IL' => 'Israele', 'IT' => 'Italia', 'JM' => 'Giamaica', - 'JO' => 'Jordan', + 'JO' => 'Giordania', 'JP' => 'Giappone', 'KZ' => 'Kazakistan', 'KE' => 'Kenya', From b7fe52ad54fe55d14442ff57e67c1f4bb1045a44 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Thu, 15 Oct 2020 00:11:12 +0300 Subject: [PATCH 12/19] Updated tests --- tests/e2e/Client.php | 2 +- tests/e2e/Services/Account/AccountBase.php | 68 ++++++------ .../e2e/Services/Functions/FunctionsBase.php | 2 +- .../Functions/FunctionsCustomServerTest.php | 6 +- .../Projects/ProjectsConsoleClientTest.php | 102 +++++++++--------- tests/e2e/Services/Teams/TeamsBase.php | 2 +- tests/e2e/Services/Teams/TeamsBaseClient.php | 18 ++-- tests/e2e/Services/Teams/TeamsBaseServer.php | 6 +- 8 files changed, 103 insertions(+), 103 deletions(-) diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index 5a84716b5..e9a47c735 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -211,7 +211,7 @@ class Client } $responseBody = curl_exec($ch); - $responseType = (isset($responseHeaders['content-type'])) ? $responseHeaders['content-type'] : ''; + $responseType = $responseHeaders['content-type'] ?? ''; $responseStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); switch (substr($responseType, 0, strpos($responseType, ';'))) { diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 4e95148a6..d070ed3e7 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -65,8 +65,8 @@ trait AccountBase public function testCreateAccountSession($data):array { sleep(10); - $email = (isset($data['email'])) ? $data['email'] : ''; - $password = (isset($data['password'])) ? $data['password'] : ''; + $email = $data['email'] ?? ''; + $password = $data['password'] ?? ''; /** * Test for SUCCESS @@ -132,9 +132,9 @@ trait AccountBase */ public function testGetAccount($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $name = (isset($data['name'])) ? $data['name'] : ''; - $session = (isset($data['session'])) ? $data['session'] : ''; + $email = $data['email'] ?? ''; + $name = $data['name'] ?? ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -183,7 +183,7 @@ trait AccountBase */ public function testGetAccountPrefs($data):array { - $session = (isset($data['session'])) ? $data['session'] : ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -219,8 +219,8 @@ trait AccountBase */ public function testGetAccountSessions($data):array { - $session = (isset($data['session'])) ? $data['session'] : ''; - $sessionId = (isset($data['sessionId'])) ? $data['sessionId'] : ''; + $session = $data['session'] ?? ''; + $sessionId = $data['sessionId'] ?? ''; /** * Test for SUCCESS @@ -281,7 +281,7 @@ trait AccountBase public function testGetAccountLogs($data):array { sleep(10); - $session = (isset($data['session'])) ? $data['session'] : ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -369,8 +369,8 @@ trait AccountBase */ public function testUpdateAccountName($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $session = (isset($data['session'])) ? $data['session'] : ''; + $email = $data['email'] ?? ''; + $session = $data['session'] ?? ''; $newName = 'New Name'; /** @@ -436,9 +436,9 @@ trait AccountBase */ public function testUpdateAccountPassword($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $password = (isset($data['password'])) ? $data['password'] : ''; - $session = (isset($data['session'])) ? $data['session'] : ''; + $email = $data['email'] ?? ''; + $password = $data['password'] ?? ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -505,7 +505,7 @@ trait AccountBase public function testUpdateAccountEmail($data):array { $newEmail = uniqid().'new@localhost.test'; - $session = (isset($data['session'])) ? $data['session'] : ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -561,7 +561,7 @@ trait AccountBase public function testUpdateAccountPrefs($data):array { $newEmail = uniqid().'new@localhost.test'; - $session = (isset($data['session'])) ? $data['session'] : ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -638,9 +638,9 @@ trait AccountBase */ public function testCreateAccountVerification($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $name = (isset($data['name'])) ? $data['name'] : ''; - $session = (isset($data['session'])) ? $data['session'] : ''; + $email = $data['email'] ?? ''; + $name = $data['name'] ?? ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -703,9 +703,9 @@ trait AccountBase */ public function testUpdateAccountVerification($data):array { - $id = (isset($data['id'])) ? $data['id'] : ''; - $session = (isset($data['session'])) ? $data['session'] : ''; - $verification = (isset($data['verification'])) ? $data['verification'] : ''; + $id = $data['id'] ?? ''; + $session = $data['session'] ?? ''; + $verification = $data['verification'] ?? ''; /** * Test for SUCCESS @@ -757,9 +757,9 @@ trait AccountBase */ public function testDeleteAccountSession($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $password = (isset($data['password'])) ? $data['password'] : ''; - $session = (isset($data['session'])) ? $data['session'] : ''; + $email = $data['email'] ?? ''; + $password = $data['password'] ?? ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -825,8 +825,8 @@ trait AccountBase */ public function testDeleteAccountSessionCurrent($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $password = (isset($data['password'])) ? $data['password'] : ''; + $email = $data['email'] ?? ''; + $password = $data['password'] ?? ''; /** * Test for SUCCESS @@ -882,7 +882,7 @@ trait AccountBase */ public function testDeleteAccountSessions($data):array { - $session = (isset($data['session'])) ? $data['session'] : ''; + $session = $data['session'] ?? ''; /** * Test for SUCCESS @@ -910,8 +910,8 @@ trait AccountBase /** * Create new fallback session */ - $email = (isset($data['email'])) ? $data['email'] : ''; - $password = (isset($data['password'])) ? $data['password'] : ''; + $email = $data['email'] ?? ''; + $password = $data['password'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/account/sessions', array_merge([ 'origin' => 'http://localhost', @@ -932,8 +932,8 @@ trait AccountBase */ public function testCreateAccountRecovery($data):array { - $email = (isset($data['email'])) ? $data['email'] : ''; - $name = (isset($data['name'])) ? $data['name'] : ''; + $email = $data['email'] ?? ''; + $name = $data['name'] ?? ''; /** * Test for SUCCESS @@ -1006,8 +1006,8 @@ trait AccountBase */ public function testUpdateAccountRecovery($data):array { - $id = (isset($data['id'])) ? $data['id'] : ''; - $recovery = (isset($data['recovery'])) ? $data['recovery'] : ''; + $id = $data['id'] ?? ''; + $recovery = $data['recovery'] ?? ''; $newPassowrd = 'test-recovery'; /** diff --git a/tests/e2e/Services/Functions/FunctionsBase.php b/tests/e2e/Services/Functions/FunctionsBase.php index 80ee47c72..a167b3763 100644 --- a/tests/e2e/Services/Functions/FunctionsBase.php +++ b/tests/e2e/Services/Functions/FunctionsBase.php @@ -13,7 +13,7 @@ trait FunctionsBase // */ // public function testGetTeam($data):array // { - // $id = (isset($data['teamUid'])) ? $data['teamUid'] : ''; + // $id = $data['teamUid'] ?? ''; // /** // * Test for SUCCESS diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 7f0441a88..9aac86303 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -38,7 +38,7 @@ class FunctionsConsoleServerTest extends Scope 'timeout' => 10, ]); - $functionId = (isset($response1['body']['$id'])) ? $response1['body']['$id'] : ''; + $functionId = $response1['body']['$id'] ?? ''; $this->assertEquals(201, $response1['headers']['status-code']); $this->assertNotEmpty($response1['body']['$id']); @@ -186,7 +186,7 @@ class FunctionsConsoleServerTest extends Scope 'code' => new CURLFile(realpath(__DIR__ . '/../../../resources/functions/php-fx.tar.gz'), 'application/x-gzip', 'php-fx.tar.gz'), ]); - $tagId = (isset($tag['body']['$id'])) ? $tag['body']['$id'] : ''; + $tagId = $tag['body']['$id'] ?? ''; $this->assertEquals(201, $tag['headers']['status-code']); $this->assertNotEmpty($tag['body']['$id']); @@ -296,7 +296,7 @@ class FunctionsConsoleServerTest extends Scope 'async' => 1, ]); - $executionId = (isset($execution['body']['$id'])) ? $execution['body']['$id'] : ''; + $executionId = $execution['body']['$id'] ?? ''; $this->assertEquals(201, $execution['headers']['status-code']); $this->assertNotEmpty($execution['body']['$id']); diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 7e4e6c1e4..ac3ff8724 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -79,7 +79,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testListProject($data):array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; /** * Test for SUCCESS @@ -106,7 +106,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProject($data):array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; /** * Test for SUCCESS @@ -147,7 +147,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProjectUsage($data):array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; /** * Test for SUCCESS @@ -206,7 +206,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProject($data):array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; /** * Test for SUCCESS @@ -249,7 +249,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProjectOAuth($data):array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $providers = require('app/config/providers.php'); /** @@ -307,7 +307,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testCreateProjectWebhook($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/projects/'.$id.'/webhooks', array_merge([ 'content-type' => 'application/json', @@ -358,7 +358,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testListProjectWebhook($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/webhooks', array_merge([ 'content-type' => 'application/json', @@ -380,8 +380,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProjectWebhook($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $webhookId = (isset($data['webhookId'])) ? $data['webhookId'] : ''; + $id = $data['projectId'] ?? ''; + $webhookId = $data['webhookId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/webhooks/'.$webhookId, array_merge([ 'content-type' => 'application/json', @@ -416,8 +416,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProjectWebhook($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $webhookId = (isset($data['webhookId'])) ? $data['webhookId'] : ''; + $id = $data['projectId'] ?? ''; + $webhookId = $data['webhookId'] ?? ''; $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$id.'/webhooks/'.$webhookId, array_merge([ 'content-type' => 'application/json', @@ -503,8 +503,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testDeleteProjectWebhook($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $webhookId = (isset($data['webhookId'])) ? $data['webhookId'] : ''; + $id = $data['projectId'] ?? ''; + $webhookId = $data['webhookId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/webhooks/'.$webhookId, array_merge([ 'content-type' => 'application/json', @@ -541,7 +541,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testCreateProjectKey($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/projects/'.$id.'/keys', array_merge([ 'content-type' => 'application/json', @@ -581,7 +581,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testListProjectKey($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/keys', array_merge([ 'content-type' => 'application/json', @@ -603,8 +603,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProjectKey($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $keyId = (isset($data['keyId'])) ? $data['keyId'] : ''; + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/keys/'.$keyId, array_merge([ 'content-type' => 'application/json', @@ -638,8 +638,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProjectKey($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $keyId = (isset($data['keyId'])) ? $data['keyId'] : ''; + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$id.'/keys/'.$keyId, array_merge([ 'content-type' => 'application/json', @@ -693,8 +693,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testDeleteProjectKey($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $keyId = (isset($data['keyId'])) ? $data['keyId'] : ''; + $id = $data['projectId'] ?? ''; + $keyId = $data['keyId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/keys/'.$keyId, array_merge([ 'content-type' => 'application/json', @@ -731,7 +731,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testCreateProjectTask($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/projects/'.$id.'/tasks', array_merge([ 'content-type' => 'application/json', @@ -859,7 +859,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testListProjectTask($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/tasks', array_merge([ 'content-type' => 'application/json', @@ -881,8 +881,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProjectTask($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $taskId = (isset($data['taskId'])) ? $data['taskId'] : ''; + $id = $data['projectId'] ?? ''; + $taskId = $data['taskId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/tasks/'.$taskId, array_merge([ 'content-type' => 'application/json', @@ -921,8 +921,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProjectTask($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $taskId = (isset($data['taskId'])) ? $data['taskId'] : ''; + $id = $data['projectId'] ?? ''; + $taskId = $data['taskId'] ?? ''; $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$id.'/tasks/'.$taskId, array_merge([ 'content-type' => 'application/json', @@ -1087,8 +1087,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testDeleteProjectTask($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $taskId = (isset($data['taskId'])) ? $data['taskId'] : ''; + $id = $data['projectId'] ?? ''; + $taskId = $data['taskId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/tasks/'.$taskId, array_merge([ 'content-type' => 'application/json', @@ -1125,7 +1125,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testCreateProjectPlatform($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/projects/'.$id.'/platforms', array_merge([ 'content-type' => 'application/json', @@ -1227,7 +1227,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testListProjectPlatform($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/platforms', array_merge([ 'content-type' => 'application/json', @@ -1249,9 +1249,9 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProjectPlatform($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; - $platformWebId = (isset($data['platformWebId'])) ? $data['platformWebId'] : ''; + $platformWebId = $data['platformWebId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/platforms/'.$platformWebId, array_merge([ 'content-type' => 'application/json', @@ -1267,7 +1267,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('', $response['body']['store']); $this->assertEquals('localhost', $response['body']['hostname']); - $platformFultteriOSId = (isset($data['platformFultteriOSId'])) ? $data['platformFultteriOSId'] : ''; + $platformFultteriOSId = $data['platformFultteriOSId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/platforms/'.$platformFultteriOSId, array_merge([ 'content-type' => 'application/json', @@ -1283,7 +1283,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('', $response['body']['store']); $this->assertEquals('', $response['body']['hostname']); - $platformFultterAndroidId = (isset($data['platformFultterAndroidId'])) ? $data['platformFultterAndroidId'] : ''; + $platformFultterAndroidId = $data['platformFultterAndroidId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/platforms/'.$platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', @@ -1317,9 +1317,9 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProjectPlatform($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; - $platformWebId = (isset($data['platformWebId'])) ? $data['platformWebId'] : ''; + $platformWebId = $data['platformWebId'] ?? ''; $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$id.'/platforms/'.$platformWebId, array_merge([ 'content-type' => 'application/json', @@ -1340,7 +1340,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('', $response['body']['store']); $this->assertEquals('localhost-new', $response['body']['hostname']); - $platformFultteriOSId = (isset($data['platformFultteriOSId'])) ? $data['platformFultteriOSId'] : ''; + $platformFultteriOSId = $data['platformFultteriOSId'] ?? ''; $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$id.'/platforms/'.$platformFultteriOSId, array_merge([ 'content-type' => 'application/json', @@ -1361,7 +1361,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals('', $response['body']['store']); $this->assertEquals('', $response['body']['hostname']); - $platformFultterAndroidId = (isset($data['platformFultterAndroidId'])) ? $data['platformFultterAndroidId'] : ''; + $platformFultterAndroidId = $data['platformFultterAndroidId'] ?? ''; $response = $this->client->call(Client::METHOD_PUT, '/projects/'.$id.'/platforms/'.$platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', @@ -1394,9 +1394,9 @@ class ProjectsConsoleClientTest extends Scope */ public function testDeleteProjectPlatform($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; - $platformWebId = (isset($data['platformWebId'])) ? $data['platformWebId'] : ''; + $platformWebId = $data['platformWebId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/platforms/'.$platformWebId, array_merge([ 'content-type' => 'application/json', @@ -1413,7 +1413,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(404, $response['headers']['status-code']); - $platformFultteriOSId = (isset($data['platformFultteriOSId'])) ? $data['platformFultteriOSId'] : ''; + $platformFultteriOSId = $data['platformFultteriOSId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/platforms/'.$platformFultteriOSId, array_merge([ 'content-type' => 'application/json', @@ -1430,7 +1430,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertEquals(404, $response['headers']['status-code']); - $platformFultterAndroidId = (isset($data['platformFultterAndroidId'])) ? $data['platformFultterAndroidId'] : ''; + $platformFultterAndroidId = $data['platformFultterAndroidId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/platforms/'.$platformFultterAndroidId, array_merge([ 'content-type' => 'application/json', @@ -1467,7 +1467,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testCreateProjectDomain($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_POST, '/projects/'.$id.'/domains', array_merge([ 'content-type' => 'application/json', @@ -1506,7 +1506,7 @@ class ProjectsConsoleClientTest extends Scope */ public function testListProjectDomain($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; + $id = $data['projectId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/domains', array_merge([ 'content-type' => 'application/json', @@ -1528,8 +1528,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testGetProjectDomain($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $domainId = (isset($data['domainId'])) ? $data['domainId'] : ''; + $id = $data['projectId'] ?? ''; + $domainId = $data['domainId'] ?? ''; $response = $this->client->call(Client::METHOD_GET, '/projects/'.$id.'/domains/'.$domainId, array_merge([ 'content-type' => 'application/json', @@ -1563,8 +1563,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testUpdateProjectDomain($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $domainId = (isset($data['domainId'])) ? $data['domainId'] : ''; + $id = $data['projectId'] ?? ''; + $domainId = $data['domainId'] ?? ''; $response = $this->client->call(Client::METHOD_PATCH, '/projects/'.$id.'/domains/'.$domainId.'/verification', array_merge([ 'content-type' => 'application/json', @@ -1585,8 +1585,8 @@ class ProjectsConsoleClientTest extends Scope */ public function testDeleteProjectDomain($data): array { - $id = (isset($data['projectId'])) ? $data['projectId'] : ''; - $domainId = (isset($data['domainId'])) ? $data['domainId'] : ''; + $id = $data['projectId'] ?? ''; + $domainId = $data['domainId'] ?? ''; $response = $this->client->call(Client::METHOD_DELETE, '/projects/'.$id.'/domains/'.$domainId, array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index 73bdfe719..a8ac2ac43 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -75,7 +75,7 @@ trait TeamsBase */ public function testGetTeam($data):array { - $id = (isset($data['teamUid'])) ? $data['teamUid'] : ''; + $id = $data['teamUid'] ?? ''; /** * Test for SUCCESS diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index ceb0d86e5..25bbcbdd5 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -11,7 +11,7 @@ trait TeamsBaseClient */ public function testGetTeamMemberships($data):array { - $teamUid = (isset($data['teamUid'])) ? $data['teamUid'] : ''; + $teamUid = $data['teamUid'] ?? ''; /** * Test for SUCCESS @@ -40,8 +40,8 @@ trait TeamsBaseClient */ public function testCreateTeamMembership($data):array { - $teamUid = (isset($data['teamUid'])) ? $data['teamUid'] : ''; - $teamName = (isset($data['teamName'])) ? $data['teamName'] : ''; + $teamUid = $data['teamUid'] ?? ''; + $teamName = $data['teamName'] ?? ''; $email = uniqid().'friend@localhost.test'; /** @@ -127,10 +127,10 @@ trait TeamsBaseClient */ public function testUpdateTeamMembership($data):array { - $teamUid = (isset($data['teamUid'])) ? $data['teamUid'] : ''; - $secret = (isset($data['secret'])) ? $data['secret'] : ''; - $inviteUid = (isset($data['inviteUid'])) ? $data['inviteUid'] : ''; - $userUid = (isset($data['userUid'])) ? $data['userUid'] : ''; + $teamUid = $data['teamUid'] ?? ''; + $secret = $data['secret'] ?? ''; + $inviteUid = $data['inviteUid'] ?? ''; + $userUid = $data['userUid'] ?? ''; /** * Test for SUCCESS @@ -207,8 +207,8 @@ trait TeamsBaseClient */ public function testDeleteTeamMembership($data):array { - $teamUid = (isset($data['teamUid'])) ? $data['teamUid'] : ''; - $inviteUid = (isset($data['inviteUid'])) ? $data['inviteUid'] : ''; + $teamUid = $data['teamUid'] ?? ''; + $inviteUid = $data['inviteUid'] ?? ''; /** * Test for SUCCESS diff --git a/tests/e2e/Services/Teams/TeamsBaseServer.php b/tests/e2e/Services/Teams/TeamsBaseServer.php index 1547a4e28..9869ce590 100644 --- a/tests/e2e/Services/Teams/TeamsBaseServer.php +++ b/tests/e2e/Services/Teams/TeamsBaseServer.php @@ -11,7 +11,7 @@ trait TeamsBaseServer */ public function testGetTeamMemberships($data):array { - $id = (isset($data['teamUid'])) ? $data['teamUid'] : ''; + $id = $data['teamUid'] ?? ''; /** * Test for SUCCESS @@ -37,8 +37,8 @@ trait TeamsBaseServer */ public function testCreateTeamMembership($data):array { - $teamUid = (isset($data['teamUid'])) ? $data['teamUid'] : ''; - $teamName = (isset($data['teamName'])) ? $data['teamName'] : ''; + $teamUid = $data['teamUid'] ?? ''; + $teamName = $data['teamName'] ?? ''; $email = uniqid().'friend@localhost.test'; /** From 95cafb9f1b2791a9ebe5f72160a172f69eb247be Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Thu, 15 Oct 2020 00:34:57 +0300 Subject: [PATCH 13/19] Updated controllers and workers --- app/controllers/api/avatars.php | 6 +- app/controllers/api/database.php | 4 +- app/controllers/api/health.php | 16 +- app/tasks/migrate.php | 2 +- app/views/console/database/collection.phtml | 8 +- app/views/console/database/document.phtml | 36 ++-- app/views/console/database/form.phtml | 12 +- .../console/database/rules/documentId.phtml | 6 +- .../console/database/search/documents.phtml | 10 +- app/views/console/users/index.phtml | 6 +- app/workers/certificates.php | 4 +- app/workers/tasks.php | 6 +- app/workers/webhooks.php | 12 +- composer.lock | 162 +++++++++--------- 14 files changed, 145 insertions(+), 145 deletions(-) diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 093080698..8349cce24 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -283,8 +283,8 @@ App::get('/v1/avatars/favicon') case 'jpeg': $size = \explode('x', \strtolower($sizes)); - $sizeWidth = (isset($size[0])) ? (int) $size[0] : 0; - $sizeHeight = (isset($size[1])) ? (int) $size[1] : 0; + $sizeWidth = (int) $size[0] ?? 0; + $sizeHeight = (int) $size[1] ?? 0; if (($sizeWidth * $sizeHeight) >= $space) { $space = $sizeWidth * $sizeHeight; @@ -423,7 +423,7 @@ App::get('/v1/avatars/initials') $code = 0; foreach ($words as $key => $w) { - $initials .= (isset($w[0])) ? $w[0] : ''; + $initials .= $w[0] ?? ''; $code += (isset($w[0])) ? \ord($w[0]) : 0; if ($key == 1) { diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index 70fdfac4f..bd1993575 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -418,8 +418,8 @@ App::post('/v1/database/collections/:collectionId/documents') * Set default collection values */ foreach ($collection->getAttribute('rules') as $key => $rule) { - $key = (isset($rule['key'])) ? $rule['key'] : ''; - $default = (isset($rule['default'])) ? $rule['default'] : null; + $key = $rule['key'] ?? ''; + $default = $rule['default'] ?? null; if (!isset($data[$key])) { $data[$key] = $default; diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index b8955a198..5ef4f2b9c 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -278,14 +278,14 @@ App::get('/v1/health/stats') // Currently only used internally 'partitionFree' => Storage::human($device->getPartitionFreeSpace()), ], 'cache' => [ - 'uptime' => (isset($cacheStats['uptime_in_seconds'])) ? $cacheStats['uptime_in_seconds'] : 0, - 'clients' => (isset($cacheStats['connected_clients'])) ? $cacheStats['connected_clients'] : 0, - 'hits' => (isset($cacheStats['keyspace_hits'])) ? $cacheStats['keyspace_hits'] : 0, - 'misses' => (isset($cacheStats['keyspace_misses'])) ? $cacheStats['keyspace_misses'] : 0, - 'memory_used' => (isset($cacheStats['used_memory'])) ? $cacheStats['used_memory'] : 0, - 'memory_used_human' => (isset($cacheStats['used_memory_human'])) ? $cacheStats['used_memory_human'] : 0, - 'memory_used_peak' => (isset($cacheStats['used_memory_peak'])) ? $cacheStats['used_memory_peak'] : 0, - 'memory_used_peak_human' => (isset($cacheStats['used_memory_peak_human'])) ? $cacheStats['used_memory_peak_human'] : 0, + 'uptime' => $cacheStats['uptime_in_seconds'] ?? 0, + 'clients' => $cacheStats['connected_clients'] ?? 0, + 'hits' => $cacheStats['keyspace_hits'] ?? 0, + 'misses' => $cacheStats['keyspace_misses'] ?? 0, + 'memory_used' => $cacheStats['used_memory'] ?? 0, + 'memory_used_human' => $cacheStats['used_memory_human'] ?? 0, + 'memory_used_peak' => $cacheStats['used_memory_peak'] ?? 0, + 'memory_used_peak_human' => $cacheStats['used_memory_peak_human'] ?? 0, ], ]); }, ['response', 'register']); diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index efa06e1fe..8f7fc9c7e 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -59,7 +59,7 @@ $callbacks = [ $offset = $offset + $limit; } - $schema = (isset($_SERVER['_APP_DB_SCHEMA'])) ? $_SERVER['_APP_DB_SCHEMA'] : ''; + $schema = $_SERVER['_APP_DB_SCHEMA'] ?? ''; try { $statement = $db->prepare(" diff --git a/app/views/console/database/collection.phtml b/app/views/console/database/collection.phtml index ea864120e..fc9f99351 100644 --- a/app/views/console/database/collection.phtml +++ b/app/views/console/database/collection.phtml @@ -104,10 +104,10 @@ $maxCells = 10; if($i > $maxCells) { break; } - $label = (isset($rule['label'])) ? $rule['label'] : ''; - $key = (isset($rule['key'])) ? $rule['key'] : ''; - $type = (isset($rule['type'])) ? $rule['type'] : ''; - $array = (isset($rule['array'])) ? $rule['array'] : ''; + $label = $rule['label'] ?? ''; + $key = $rule['key'] ?? ''; + $type = $rule['type'] ?? ''; + $array = $rule['array'] ?? ''; ?> diff --git a/app/views/console/database/document.phtml b/app/views/console/database/document.phtml index e8f760f68..5ac9e841e 100644 --- a/app/views/console/database/document.phtml +++ b/app/views/console/database/document.phtml @@ -17,10 +17,10 @@ $collections = []; render(); ?> getId()) { @@ -48,11 +48,11 @@ $collections = []; @@ -126,11 +126,11 @@ $collections = [];