Work in progress
This commit is contained in:
parent
a25a827740
commit
91690fcae1
|
@ -161,6 +161,27 @@ To run tests manually, run phpunit from your command line:
|
|||
docker exec appwrite test
|
||||
```
|
||||
|
||||
## Benchmarking
|
||||
|
||||
You can use WRK Docker image to benchmark the server performance. Benchmarking is extremely useful when you want to compare how the server behaves before and after a change has been applied. Replace [APPWRITE_HOSTNAME_OR_IP] with your Appwrite server hostname or IP. Note that localhost is not accessible from inside the WRK container.
|
||||
|
||||
```
|
||||
Options:
|
||||
-c, --connections <N> Connections to keep open
|
||||
-d, --duration <T> Duration of test
|
||||
-t, --threads <N> Number of threads to use
|
||||
|
||||
-s, --script <S> Load Lua script file
|
||||
-H, --header <H> Add header to request
|
||||
--latency Print latency statistics
|
||||
--timeout <T> Socket/request timeout
|
||||
-v, --version Print version details
|
||||
```
|
||||
|
||||
```
|
||||
docker run --rm skandyla/wrk -t5 -c10 -d30 https://[APPWRITE_HOSTNAME_OR_IP]
|
||||
```
|
||||
|
||||
## Tutorials
|
||||
|
||||
From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials:
|
||||
|
|
|
@ -8,7 +8,7 @@ return [
|
|||
APP_PLATFORM_CLIENT => [
|
||||
'key' => APP_PLATFORM_CLIENT,
|
||||
'name' => 'Client',
|
||||
'description' => 'Client libraries for integrating with '.APP_NAME.' to build client-based applications and websites. Read the [getting started for web](/docs/getting-started-for-web) or [getting started for Flutter](/docs/getting-started-for-flutter) tutorials to start building your first application.',
|
||||
'description' => 'Client libraries for integrating with Appwrite to build client-based applications and websites. Read the [getting started for web](/docs/getting-started-for-web) or [getting started for Flutter](/docs/getting-started-for-flutter) tutorials to start building your first application.',
|
||||
'enabled' => true,
|
||||
'beta' => false,
|
||||
'languages' => [ // TODO change key to 'sdks'
|
||||
|
@ -121,7 +121,7 @@ return [
|
|||
APP_PLATFORM_SERVER => [
|
||||
'key' => APP_PLATFORM_SERVER,
|
||||
'name' => 'Server',
|
||||
'description' => 'Libraries for integrating with '.APP_NAME.' to build server side integrations. Read the [getting started for server](/docs/getting-started-for-server) tutorial to start building your first server integration.',
|
||||
'description' => 'Libraries for integrating with Appwrite to build server side integrations. Read the [getting started for server](/docs/getting-started-for-server) tutorial to start building your first server integration.',
|
||||
'enabled' => true,
|
||||
'beta' => false,
|
||||
'languages' => [ // TODO change key to 'sdks'
|
||||
|
|
|
@ -13,18 +13,14 @@
|
|||
// error_reporting(E_ALL);
|
||||
|
||||
if (file_exists(__DIR__.'/../vendor/autoload.php')) {
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
}
|
||||
|
||||
use Appwrite\Preloader\Preloader;
|
||||
|
||||
require_once __DIR__.'/../app/init.php';
|
||||
require_once __DIR__.'/../app/app.php';
|
||||
|
||||
(new Preloader())
|
||||
->paths(realpath(__DIR__ . '/../vendor'))
|
||||
->paths(realpath(__DIR__ . '/../app/config'))
|
||||
->paths(realpath(__DIR__ . '/../app/controllers'))
|
||||
->paths(realpath(__DIR__ . '/../app/views'))
|
||||
->ignore(__DIR__ . '/../vendor/phpmailer/phpmailer/get_oauth_token.php')
|
||||
->paths(realpath(__DIR__ . '/../src'))
|
||||
->ignore(realpath(__DIR__ . '/../vendor/twig/twig'))
|
||||
->ignore(realpath(__DIR__ . '/../vendor/guzzlehttp/guzzle'))
|
||||
->load();
|
|
@ -13,8 +13,6 @@ class Preloader
|
|||
|
||||
private $paths;
|
||||
|
||||
private $fileMap;
|
||||
|
||||
public function __construct(string ...$paths)
|
||||
{
|
||||
$this->paths = $paths;
|
||||
|
@ -23,8 +21,11 @@ class Preloader
|
|||
// to easily find which classes to autoload,
|
||||
// based on their filename
|
||||
$classMap = require __DIR__ . '/../../../vendor/composer/autoload_classmap.php';
|
||||
|
||||
$this->fileMap = array_flip($classMap);
|
||||
|
||||
$this->paths = array_merge(
|
||||
$this->paths,
|
||||
array_values($classMap)
|
||||
);
|
||||
}
|
||||
|
||||
public function paths(string ...$paths): Preloader
|
||||
|
@ -94,14 +95,11 @@ class Preloader
|
|||
|
||||
private function loadFile(string $path): void
|
||||
{
|
||||
// We resolve the classname from composer's autoload mapping
|
||||
$class = $this->fileMap[$path] ?? $path;
|
||||
|
||||
// And use it to make sure the class shouldn't be ignored
|
||||
if ($this->shouldIgnore($class)) {
|
||||
if ($this->shouldIgnore($path)) {
|
||||
return;
|
||||
}
|
||||
echo "[Preloader] Preloaded `{$class}`" . PHP_EOL;
|
||||
echo "[Preloader] Preloaded `{$path}`" . PHP_EOL;
|
||||
// Finally we require the path,
|
||||
// causing all its dependencies to be loaded as well
|
||||
try {
|
||||
|
@ -113,28 +111,25 @@ class Preloader
|
|||
|
||||
ob_end_clean(); //End of build
|
||||
} catch (\Throwable $th) {
|
||||
echo "[Preloader] Failed to load `{$class}`" . PHP_EOL;
|
||||
echo "[Preloader] Failed to load `{$path}`" . PHP_EOL;
|
||||
return;
|
||||
}
|
||||
|
||||
self::$count++;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function shouldIgnore(?string $name): bool
|
||||
private function shouldIgnore(?string $path): bool
|
||||
{
|
||||
if($name === null) {
|
||||
if($path === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!in_array(pathinfo($name, PATHINFO_EXTENSION), ['php'])) {
|
||||
if(!in_array(pathinfo($path, PATHINFO_EXTENSION), ['php'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var_dump($name);
|
||||
foreach ($this->ignores as $ignore) {
|
||||
if (strpos($name, $ignore) === 0) {
|
||||
if (strpos($path, $ignore) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class S3 extends Device
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(string $path):bool
|
||||
public function delete(string $path, bool $recursive = false):bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue