mathsgod / puxt-vx
vx framework
Installs: 424
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.0
- endroid/qr-code: ^4.1
- firebase/php-jwt: ^6.3
- gumlet/php-image-resize: ^2.0
- laminas/laminas-authentication: ^2.13
- laminas/laminas-diactoros: ^2.12
- laminas/laminas-hydrator: ^4.3
- laminas/laminas-permissions-rbac: ^3.4
- laminas/laminas-servicemanager: ^3.20
- league/flysystem: ^2.1
- league/glide: ^2.1
- mathsgod/p-query: ^2.4 | ^3.0
- mathsgod/php-util: ^1.3
- mathsgod/r-db: ^4.17
- monolog/monolog: ^2.3
- nesbot/carbon: ^2.49
- phpmailer/phpmailer: ^6.5
- phpoffice/phpspreadsheet: ^1.18
- psr/http-server-middleware: ^1.0
- ramsey/uuid: ^4.4
- symfony/translation: ^6.0
- symfony/yaml: ^5.2
- thecodingmachine/graphqlite: ^6.0
- twig/extra-bundle: ^3.3
Requires (Dev)
- hostlink/hostlink-storage-adapter: ^1.0
- league/flysystem-aws-s3-v3: 3.0
- mathsgod/puxt: dev-main
- web-auth/webauthn-lib: ^3.3
Suggests
- web-auth/webauthn-lib: For WebAuthn
README
setup
index.php
require_once __DIR__ . "/vendor/autoload.php"; // header("Access-Control-Allow-Origin: http://localhost:3000"); header("Access-Control-Allow-Credentials: true"); header("Access-Control-Allow-Headers: Content-Type, Authorization"); header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, PATCH, HEAD, DELETE"); header("Access-Control-Expose-Headers: location, Content-Location"); $app = new PUXT\App(); $app->pipe(VX::class); $app->run();
.env
JWT_SECRET=123456
DATABASE_HOSTNAME=
DATABASE_DATABASE=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_PORT=3306
DATABASE_CHARSET=utf8mb4
.htaccess
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
File Manager
Support local, s3, hostlink-storage to store files.
local
VX_FILE_MANAGER_0=local VX_FILE_MANAGER_0_PATH=/var/www/html/uploads
s3
composer require league/flysystem-aws-s3-v3:^3.0
composer require aws/aws-sdk-php
VX_FILE_MANAGER_0=s3 VX_FILE_MANAGER_0_KEY=your-key VX_FILE_MANAGER_0_SECRET=your-secret VX_FILE_MANAGER_0_REGION=your-region VX_FILE_MANAGER_0_BUCKET=your-bucket VX_FILE_MANAGER_0_PREFIX=your-prefix VX_FILE_MANAGER_0_ENDPOINT=your-endpoint
hostlink-storage
composer require hostlink/hostlink-storage-adapter
VX_FILE_MANAGER_0=hostlink-storage VX_FILE_MANAGER_0_TOKEN=your-token VX_FILE_MANAGER_0_ENDPOINT=your-endpoint
multiple file manager
For multiple file manager, use VX_FILE_MANAGER_1
, VX_FILE_MANAGER_2
, etc.
$fs=$vx->getFileSystem(1); // use file manager 1
Debug mode
To enable debug mode, set VX_DEBUG=1
in .env
file.
VX_DEBUG=1
Language
To enable language, set VX_LANGUAGE_0_NAME
and VX_LANGUAGE_0_LOCALE
in .env
file.
VX_LANGUAGE_0_NAME=English VX_LANGUAGE_0_LOCALE=en VX_LANGUAGE_1_NAME=中文 VX_LANGUAGE_1_LOCALE=zh-hk