1
0
Fork 0
mirror of synced 2024-06-24 01:00:35 +12:00

Merge branch '0.7.x' of github.com:appwrite/appwrite into feat-511-jwt-support

This commit is contained in:
Eldad Fux 2020-10-19 20:27:56 +03:00
commit 58ebcc071e
10 changed files with 80 additions and 172 deletions

View file

@ -13,7 +13,7 @@ return [
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BI' => 'Burundi',
'BE' => 'Belgium',
'BE' => 'Belgia',
'BJ' => 'Benin',
'BF' => 'Burkina Faso',
'BD' => 'Bangladesh',
@ -24,7 +24,7 @@ return [
'BY' => 'Belarus',
'BZ' => 'Belize',
'BO' => 'Bolivia',
'BR' => 'Brazil',
'BR' => 'Brasil',
'BB' => 'Barbados',
'BN' => 'Brunei',
'BT' => 'Bhutan',
@ -36,15 +36,15 @@ return [
'CN' => 'Cina',
'CI' => 'Pantai Gading',
'CM' => 'Kamerun',
'CD' => 'DR Kongo',
'CD' => 'Republik Demokratik Kongo',
'CG' => 'Republik Kongo',
'CO' => 'Kolumbia',
'CO' => 'Kolombia',
'KM' => 'Komoro',
'CV' => 'Tanjung Verde',
'CR' => 'Kosta Rika',
'CU' => 'Kuba',
'CY' => 'Siprus',
'CZ' => 'Czechia',
'CZ' => 'Ceko',
'DE' => 'Jerman',
'DJ' => 'Djibouti',
'DM' => 'Dominika',
@ -86,11 +86,11 @@ return [
'IL' => 'Israel',
'IT' => 'Italia',
'JM' => 'Jamaika',
'JO' => 'Jordan',
'JO' => 'Yordania',
'JP' => 'Jepang',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KG' => 'Kirgistan',
'KG' => 'Kirgizstan',
'KH' => 'Kamboja',
'KI' => 'Kiribati',
'KN' => 'Saint Kitts dan Nevis',
@ -113,7 +113,7 @@ return [
'MG' => 'Madagaskar',
'MV' => 'Maladewa',
'MX' => 'Meksiko',
'MH' => 'Pulau Marshall',
'MH' => 'Kepulauan Marshall',
'MK' => 'Makedonia',
'ML' => 'Mali',
'MT' => 'Malta',
@ -153,7 +153,7 @@ return [
'SD' => 'Sudan',
'SN' => 'Senegal',
'SG' => 'Singapura',
'SB' => 'Pulau Solomon',
'SB' => 'Kepulauan Solomon',
'SL' => 'Sierra Leone',
'SV' => 'El Salvador',
'SM' => 'San Marino',
@ -165,11 +165,11 @@ return [
'SK' => 'Slovakia',
'SI' => 'Slovenia',
'SE' => 'Swedia',
'SZ' => 'Swaziland',
'SZ' => 'Eswatini',
'SC' => 'Seychelles',
'SY' => 'Suriah',
'TD' => 'Chad',
'TG' => 'Untuk pergi',
'TG' => 'Togo',
'TH' => 'Thailand',
'TJ' => 'Tajikistan',
'TM' => 'Turkmenistan',

View file

@ -2,14 +2,14 @@
{{name}} 你好,
</p>
<p>
請點擊下方的鏈接驗證你的電子郵箱地址。
請點擊下方的連結驗證你的電子郵箱地址。
</p>
{{cta}}
<p>
如果你沒有請求驗證本郵箱,請忽略這份郵件。
如果你沒有請求驗證本電子信箱,請忽略這份信件。
</p>
<p>
謝謝。
<br />
來自 {{project}}
</p>
</p>

View file

@ -2,17 +2,17 @@
你好,
</p>
<p>
<b>{{owner}}</b>邀請您加入{{project}}項目的<b>{{team}}</b>小組。
<b>{{owner}}</b>邀請您加入{{project}}專案的<b>{{team}}</b>小組。
</p>
<p>
請點擊下方的鏈接加入{{team}}小組:
</p>
{{cta}}
<p>
如果您沒有加入該小組的計劃,請忽略本件。
如果您沒有加入該小組的計劃,請忽略本件。
</p>
<p>
謝謝。
<br />
來自 {{project}}
</p>
</p>

View file

@ -2,15 +2,14 @@
{{name}} 你好,
</p>
<p>
请点击下方的链接重新设置{{project}}的密码。
Follow this link to reset your {{project}} password.
請點擊下方的連結重設 {{project}} 的密碼。
</p>
{{cta}}
<p>
如果您未曾申请重设密码,请忽略本邮件。
如果你未曾申請重設密碼,請忽略本信件。
</p>
<p>
谢谢
謝謝
<br />
{{project}}
{{project}}
</p>

View file

@ -1,13 +1,13 @@
<?php
return [
'settings.inspire' => '"懂得取,方顯睿智。"', // 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' => 'zh-tw',
'settings.direction' => 'ltr',
// Service - Users
'account.emails.team' => '%s 小組',
'account.emails.verification.title' => '戶確認',
'account.emails.verification.title' => '戶確認',
'account.emails.verification.body' => 'zh-tw.email.auth.confirm.tpl',
'account.emails.recovery.title' => '重設密碼',
'account.emails.recovery.body' => 'zh.email.auth.recovery.tpl',
@ -16,4 +16,4 @@ return [
'locale.country.unknown' => '未知',
'countries' => include 'zh-tw.countries.php',
'continents' => include 'zh-tw.continents.php',
];
];

View file

@ -30,7 +30,6 @@ $http
'open_http2_protocol' => true,
// 'document_root' => __DIR__.'/../public',
// 'enable_static_handler' => true,
'timeout' => 7,
'http_compression' => true,
'http_compression_level' => 6,
'package_max_length' => $payloadSize,
@ -111,4 +110,4 @@ $http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swo
}
});
$http->start();
$http->start();

View file

@ -16,7 +16,7 @@ if (file_exists(__DIR__.'/../vendor/autoload.php')) {
require __DIR__.'/../vendor/autoload.php';
}
use Appwrite\Preloader\Preloader;
use Utopia\Preloader\Preloader;
include __DIR__.'/controllers/general.php';

View file

@ -41,6 +41,7 @@
"utopia-php/config": "0.2.*",
"utopia-php/locale": "0.3.*",
"utopia-php/registry": "0.2.*",
"utopia-php/preloader": "0.2.*",
"utopia-php/domains": "1.1.*",
"resque/php-resque": "1.3.6",

58
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "20586cad26950d57c6fe42295d145904",
"content-hash": "19f7cef86ddc98623cd3ffffa2be2cae",
"packages": [
{
"name": "adhocore/jwt",
@ -1663,6 +1663,54 @@
],
"time": "2020-06-29T20:53:16+00:00"
},
{
"name": "utopia-php/preloader",
"version": "0.2.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/preloader.git",
"reference": "e710e7cf38605dd67c6cc599dd1150735765ad2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/preloader/zipball/e710e7cf38605dd67c6cc599dd1150735765ad2e",
"reference": "e710e7cf38605dd67c6cc599dd1150735765ad2e",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "^7.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Utopia\\Preloader\\": "src/Preloader"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Eldad Fux",
"email": "team@appwrite.io"
}
],
"description": "Utopia Preloader library is simple and lite library for managing PHP preloading configuration",
"keywords": [
"framework",
"php",
"preload",
"preloader",
"preloading",
"upf",
"utopia"
],
"time": "2020-08-14T23:17:55+00:00"
},
{
"name": "utopia-php/registry",
"version": "0.2.3",
@ -2651,12 +2699,12 @@
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4"
"reference": "338bf27b4510498c4b0ab70c7cbc292a591dc0df"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4",
"reference": "b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/338bf27b4510498c4b0ab70c7cbc292a591dc0df",
"reference": "338bf27b4510498c4b0ab70c7cbc292a591dc0df",
"shasum": ""
},
"require": {
@ -2742,7 +2790,7 @@
"type": "github"
}
],
"time": "2020-10-16T07:52:13+00:00"
"time": "2020-10-19T09:25:00+00:00"
},
{
"name": "sebastian/cli-parser",

View file

@ -1,139 +0,0 @@
<?php
namespace Appwrite\Preloader;
class Preloader
{
/**
* @var array
*/
protected $ignores = [];
/**
* @var array
*/
protected $paths = [];
/**
* @var array
*/
protected $included = [];
public function __construct(string ...$paths)
{
$this->paths = $paths;
$classMap = require __DIR__.'/../../../vendor/composer/autoload_classmap.php';
$this->paths = \array_merge(
$this->paths,
\array_values($classMap)
);
}
public function paths(string ...$paths): self
{
$this->paths = \array_merge(
$this->paths,
$paths
);
return $this;
}
public function ignore(string ...$names): self
{
foreach($names as $name) {
if(is_readable($name)) {
$this->ignores[] = $name;
}
else {
echo "[Preloader] Failed to ignore path `{$name}`".PHP_EOL;
}
}
return $this;
}
public function load(): void
{
$this->included = get_included_files();
foreach ($this->paths as $path) {
$this->loadPath(\rtrim($path, '/'));
}
$already = count($this->included);
echo "[Preloader] Preloaded {$already} files.".PHP_EOL;
}
private function loadPath(string $path): void
{
if (\is_dir($path)) {
$this->loadDir($path);
return;
}
$this->loadFile($path);
}
private function loadDir(string $path): void
{
$handle = \opendir($path);
while ($file = \readdir($handle)) {
if (\in_array($file, ['.', '..'])) {
continue;
}
$this->loadPath("{$path}/{$file}");
}
\closedir($handle);
}
private function loadFile(string $path): void
{
if ($this->shouldIgnore($path)) {
return;
}
if(in_array(realpath($path), $this->included)) {
// echo "[Preloader] Skiped `{$path}`".PHP_EOL;
return;
}
// echo "[Preloader] Preloaded `{$path}`".PHP_EOL;
try {
// opcache_compile_file($path);
require $path;
} catch (\Throwable $th) {
echo "[Preloader] Failed to load `{$path}`: ".$th->getMessage().PHP_EOL;
return;
}
$this->included = array_merge(get_included_files(), [realpath($path)]);
}
private function shouldIgnore(?string $path): bool
{
if($path === null) {
return true;
}
if(!\in_array(\pathinfo($path, PATHINFO_EXTENSION), ['php'])) {
return true;
}
foreach ($this->ignores as $ignore) {
if (\strpos($path, $ignore) === 0) {
return true;
}
}
return false;
}
}