Merge branch '0.7.x' of github.com:appwrite/appwrite into feat-511-jwt-support
This commit is contained in:
commit
58ebcc071e
10 changed files with 80 additions and 172 deletions
|
@ -13,7 +13,7 @@ return [
|
||||||
'AT' => 'Austria',
|
'AT' => 'Austria',
|
||||||
'AZ' => 'Azerbaijan',
|
'AZ' => 'Azerbaijan',
|
||||||
'BI' => 'Burundi',
|
'BI' => 'Burundi',
|
||||||
'BE' => 'Belgium',
|
'BE' => 'Belgia',
|
||||||
'BJ' => 'Benin',
|
'BJ' => 'Benin',
|
||||||
'BF' => 'Burkina Faso',
|
'BF' => 'Burkina Faso',
|
||||||
'BD' => 'Bangladesh',
|
'BD' => 'Bangladesh',
|
||||||
|
@ -24,7 +24,7 @@ return [
|
||||||
'BY' => 'Belarus',
|
'BY' => 'Belarus',
|
||||||
'BZ' => 'Belize',
|
'BZ' => 'Belize',
|
||||||
'BO' => 'Bolivia',
|
'BO' => 'Bolivia',
|
||||||
'BR' => 'Brazil',
|
'BR' => 'Brasil',
|
||||||
'BB' => 'Barbados',
|
'BB' => 'Barbados',
|
||||||
'BN' => 'Brunei',
|
'BN' => 'Brunei',
|
||||||
'BT' => 'Bhutan',
|
'BT' => 'Bhutan',
|
||||||
|
@ -36,15 +36,15 @@ return [
|
||||||
'CN' => 'Cina',
|
'CN' => 'Cina',
|
||||||
'CI' => 'Pantai Gading',
|
'CI' => 'Pantai Gading',
|
||||||
'CM' => 'Kamerun',
|
'CM' => 'Kamerun',
|
||||||
'CD' => 'DR Kongo',
|
'CD' => 'Republik Demokratik Kongo',
|
||||||
'CG' => 'Republik Kongo',
|
'CG' => 'Republik Kongo',
|
||||||
'CO' => 'Kolumbia',
|
'CO' => 'Kolombia',
|
||||||
'KM' => 'Komoro',
|
'KM' => 'Komoro',
|
||||||
'CV' => 'Tanjung Verde',
|
'CV' => 'Tanjung Verde',
|
||||||
'CR' => 'Kosta Rika',
|
'CR' => 'Kosta Rika',
|
||||||
'CU' => 'Kuba',
|
'CU' => 'Kuba',
|
||||||
'CY' => 'Siprus',
|
'CY' => 'Siprus',
|
||||||
'CZ' => 'Czechia',
|
'CZ' => 'Ceko',
|
||||||
'DE' => 'Jerman',
|
'DE' => 'Jerman',
|
||||||
'DJ' => 'Djibouti',
|
'DJ' => 'Djibouti',
|
||||||
'DM' => 'Dominika',
|
'DM' => 'Dominika',
|
||||||
|
@ -86,11 +86,11 @@ return [
|
||||||
'IL' => 'Israel',
|
'IL' => 'Israel',
|
||||||
'IT' => 'Italia',
|
'IT' => 'Italia',
|
||||||
'JM' => 'Jamaika',
|
'JM' => 'Jamaika',
|
||||||
'JO' => 'Jordan',
|
'JO' => 'Yordania',
|
||||||
'JP' => 'Jepang',
|
'JP' => 'Jepang',
|
||||||
'KZ' => 'Kazakhstan',
|
'KZ' => 'Kazakhstan',
|
||||||
'KE' => 'Kenya',
|
'KE' => 'Kenya',
|
||||||
'KG' => 'Kirgistan',
|
'KG' => 'Kirgizstan',
|
||||||
'KH' => 'Kamboja',
|
'KH' => 'Kamboja',
|
||||||
'KI' => 'Kiribati',
|
'KI' => 'Kiribati',
|
||||||
'KN' => 'Saint Kitts dan Nevis',
|
'KN' => 'Saint Kitts dan Nevis',
|
||||||
|
@ -113,7 +113,7 @@ return [
|
||||||
'MG' => 'Madagaskar',
|
'MG' => 'Madagaskar',
|
||||||
'MV' => 'Maladewa',
|
'MV' => 'Maladewa',
|
||||||
'MX' => 'Meksiko',
|
'MX' => 'Meksiko',
|
||||||
'MH' => 'Pulau Marshall',
|
'MH' => 'Kepulauan Marshall',
|
||||||
'MK' => 'Makedonia',
|
'MK' => 'Makedonia',
|
||||||
'ML' => 'Mali',
|
'ML' => 'Mali',
|
||||||
'MT' => 'Malta',
|
'MT' => 'Malta',
|
||||||
|
@ -153,7 +153,7 @@ return [
|
||||||
'SD' => 'Sudan',
|
'SD' => 'Sudan',
|
||||||
'SN' => 'Senegal',
|
'SN' => 'Senegal',
|
||||||
'SG' => 'Singapura',
|
'SG' => 'Singapura',
|
||||||
'SB' => 'Pulau Solomon',
|
'SB' => 'Kepulauan Solomon',
|
||||||
'SL' => 'Sierra Leone',
|
'SL' => 'Sierra Leone',
|
||||||
'SV' => 'El Salvador',
|
'SV' => 'El Salvador',
|
||||||
'SM' => 'San Marino',
|
'SM' => 'San Marino',
|
||||||
|
@ -165,11 +165,11 @@ return [
|
||||||
'SK' => 'Slovakia',
|
'SK' => 'Slovakia',
|
||||||
'SI' => 'Slovenia',
|
'SI' => 'Slovenia',
|
||||||
'SE' => 'Swedia',
|
'SE' => 'Swedia',
|
||||||
'SZ' => 'Swaziland',
|
'SZ' => 'Eswatini',
|
||||||
'SC' => 'Seychelles',
|
'SC' => 'Seychelles',
|
||||||
'SY' => 'Suriah',
|
'SY' => 'Suriah',
|
||||||
'TD' => 'Chad',
|
'TD' => 'Chad',
|
||||||
'TG' => 'Untuk pergi',
|
'TG' => 'Togo',
|
||||||
'TH' => 'Thailand',
|
'TH' => 'Thailand',
|
||||||
'TJ' => 'Tajikistan',
|
'TJ' => 'Tajikistan',
|
||||||
'TM' => 'Turkmenistan',
|
'TM' => 'Turkmenistan',
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
{{name}} 你好,
|
{{name}} 你好,
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
請點擊下方的鏈接驗證你的電子郵箱地址。
|
請點擊下方的連結驗證你的電子郵箱地址。
|
||||||
</p>
|
</p>
|
||||||
{{cta}}
|
{{cta}}
|
||||||
<p>
|
<p>
|
||||||
如果你沒有請求驗證本郵箱,請忽略這份郵件。
|
如果你沒有請求驗證本電子信箱,請忽略這份信件。
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
謝謝。
|
謝謝。
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
你好,
|
你好,
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>{{owner}}</b>邀請您加入{{project}}項目的<b>{{team}}</b>小組。
|
<b>{{owner}}</b>邀請您加入{{project}}專案的<b>{{team}}</b>小組。
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
請點擊下方的鏈接加入{{team}}小組:
|
請點擊下方的鏈接加入{{team}}小組:
|
||||||
</p>
|
</p>
|
||||||
{{cta}}
|
{{cta}}
|
||||||
<p>
|
<p>
|
||||||
如果您沒有加入該小組的計劃,請忽略本郵件。
|
如果您沒有加入該小組的計劃,請忽略本信件。
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
謝謝。
|
謝謝。
|
||||||
|
|
|
@ -2,15 +2,14 @@
|
||||||
{{name}} 你好,
|
{{name}} 你好,
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
请点击下方的链接重新设置{{project}}的密码。
|
請點擊下方的連結重設 {{project}} 的密碼。
|
||||||
Follow this link to reset your {{project}} password.
|
|
||||||
</p>
|
</p>
|
||||||
{{cta}}
|
{{cta}}
|
||||||
<p>
|
<p>
|
||||||
如果您未曾申请重设密码,请忽略本邮件。
|
如果你未曾申請重設密碼,請忽略本信件。
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
谢谢。
|
謝謝。
|
||||||
<br />
|
<br />
|
||||||
来自 {{project}}
|
來自 {{project}}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
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.locale' => 'zh-tw',
|
||||||
'settings.direction' => 'ltr',
|
'settings.direction' => 'ltr',
|
||||||
|
|
||||||
// Service - Users
|
// Service - Users
|
||||||
'account.emails.team' => '%s 小組',
|
'account.emails.team' => '%s 小組',
|
||||||
'account.emails.verification.title' => '賬戶確認',
|
'account.emails.verification.title' => '帳戶確認',
|
||||||
'account.emails.verification.body' => 'zh-tw.email.auth.confirm.tpl',
|
'account.emails.verification.body' => 'zh-tw.email.auth.confirm.tpl',
|
||||||
'account.emails.recovery.title' => '重設密碼',
|
'account.emails.recovery.title' => '重設密碼',
|
||||||
'account.emails.recovery.body' => 'zh.email.auth.recovery.tpl',
|
'account.emails.recovery.body' => 'zh.email.auth.recovery.tpl',
|
||||||
|
|
|
@ -30,7 +30,6 @@ $http
|
||||||
'open_http2_protocol' => true,
|
'open_http2_protocol' => true,
|
||||||
// 'document_root' => __DIR__.'/../public',
|
// 'document_root' => __DIR__.'/../public',
|
||||||
// 'enable_static_handler' => true,
|
// 'enable_static_handler' => true,
|
||||||
'timeout' => 7,
|
|
||||||
'http_compression' => true,
|
'http_compression' => true,
|
||||||
'http_compression_level' => 6,
|
'http_compression_level' => 6,
|
||||||
'package_max_length' => $payloadSize,
|
'package_max_length' => $payloadSize,
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (file_exists(__DIR__.'/../vendor/autoload.php')) {
|
||||||
require __DIR__.'/../vendor/autoload.php';
|
require __DIR__.'/../vendor/autoload.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
use Appwrite\Preloader\Preloader;
|
use Utopia\Preloader\Preloader;
|
||||||
|
|
||||||
include __DIR__.'/controllers/general.php';
|
include __DIR__.'/controllers/general.php';
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
"utopia-php/config": "0.2.*",
|
"utopia-php/config": "0.2.*",
|
||||||
"utopia-php/locale": "0.3.*",
|
"utopia-php/locale": "0.3.*",
|
||||||
"utopia-php/registry": "0.2.*",
|
"utopia-php/registry": "0.2.*",
|
||||||
|
"utopia-php/preloader": "0.2.*",
|
||||||
"utopia-php/domains": "1.1.*",
|
"utopia-php/domains": "1.1.*",
|
||||||
|
|
||||||
"resque/php-resque": "1.3.6",
|
"resque/php-resque": "1.3.6",
|
||||||
|
|
58
composer.lock
generated
58
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "20586cad26950d57c6fe42295d145904",
|
"content-hash": "19f7cef86ddc98623cd3ffffa2be2cae",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "adhocore/jwt",
|
"name": "adhocore/jwt",
|
||||||
|
@ -1663,6 +1663,54 @@
|
||||||
],
|
],
|
||||||
"time": "2020-06-29T20:53:16+00:00"
|
"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",
|
"name": "utopia-php/registry",
|
||||||
"version": "0.2.3",
|
"version": "0.2.3",
|
||||||
|
@ -2651,12 +2699,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4"
|
"reference": "338bf27b4510498c4b0ab70c7cbc292a591dc0df"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/338bf27b4510498c4b0ab70c7cbc292a591dc0df",
|
||||||
"reference": "b5c7b8a5d87f4e8947cdaee629a4a9a93e71faf4",
|
"reference": "338bf27b4510498c4b0ab70c7cbc292a591dc0df",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2742,7 +2790,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2020-10-16T07:52:13+00:00"
|
"time": "2020-10-19T09:25:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue