yiisoft / app-api Goto Github PK
View Code? Open in Web Editor NEWAPI application project template
License: BSD 3-Clause "New" or "Revised" License
API application project template
License: BSD 3-Clause "New" or "Revised" License
After installation, when you execute psalm, you will find these errors.
It should be success after psalm execution.
ERROR: UndefinedGlobalVariable - config/packages/yiisoft/csrf/web.php:34:28 - Cannot find referenced variable $params in global scope (see https://psalm.dev/127)
'secretKey' => $params['yiisoft/csrf']['hmacToken']['secretKey'],
ERROR: UndefinedGlobalVariable - config/packages/yiisoft/csrf/web.php:35:28 - Cannot find referenced variable $params in global scope (see https://psalm.dev/127)
'algorithm' => $params['yiisoft/csrf']['hmacToken']['algorithm'],
ERROR: UndefinedGlobalVariable - config/packages/yiisoft/csrf/web.php:36:27 - Cannot find referenced variable $params in global scope (see https://psalm.dev/127)
'lifetime' => $params['yiisoft/csrf']['hmacToken']['lifetime'],
ERROR: InvalidScope - config/packages/yiisoft/profiler/common.php:35:13 - Invalid reference to $this in a non-class context (see https://psalm.dev/013)
$this->enable((bool)$params['enabled']);
ERROR: InvalidScope - config/packages/yiisoft/profiler/common.php:49:13 - Invalid reference to $this in a non-class context (see https://psalm.dev/013)
$this->enable((bool)$params['enabled']);
------------------------------
5 errors found
------------------------------
Q | A |
---|---|
Version | yii3 |
PHP version | 7.4 |
Operating system | Debian |
Need to correct generators and schema-provider list.
SyncTables
can be commented
app-api/config/common/params.php
Lines 97 to 112 in 0d43b26
When trying follow to the swagger documentation at the link http://localhost:8080/docs, an error occurs: Invalid path alias: @vendor/swagger-api/swagger-ui/dist
composer create-project yiisoft/app-api --stability=dev myproject
Successful installation
`
Creating a "yiisoft/app-api" project at "./myproject"
Info from https://repo.packagist.org: #StandWithUkraine
Installing yiisoft/app-api (1.0.x-dev c93aab6)
Problem 1
- league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.1.9) does not satisfy that requirement.
- league/flysystem[2.0.0-alpha.1, ..., 2.0.0-RC1] require php ^7.2 -> your php version (8.1.9) does not satisfy that requirement.`
Q | A |
---|---|
Version | 1.0.? |
PHP version | 8.1.9 |
Operating system | Win10 64bit |
Currently annotations are very basic. These should be extended to include details about responses and request parameters.
See yiisoft/app#273
Related to yiisoft/config#121
Now error:
[Yiisoft\Definitions\Exception\InvalidConfigException] Invalid definition: class "Yiisoft\Yii\Middleware\Locale" does not have the public method with name "withEnableSaveLocale". Possible methods to call: "process", "withSupportedLocales", "withDefaultLocale", "withQueryParameterName", "withCookieName", "withDetectLocale", "withIgnoredRequestUrlPatterns", "withSecureCookie", "withCookieDuration"
This is may be useful for CI.
composer create-project yiisoft/app-api --stability=dev project
docker-compose.yml file is exists
docker-compose.yml file is not exist
so i cant follow the readme.md
Q | A |
---|---|
Version | 1.0.x-dev 4c24870 |
PHP version | 8.3 |
Operating system | Ubuntu 20.04 |
This is base API application template and multilangual support is optional, so it's should be removed.
HI!
I´m checking this new app for generate an api. Where is the documentation? The /docs don't exist.
Q | A |
---|---|
Version | 1.0.? |
PHP version | |
Operating system |
install php 8.3-cli php8.3-dom php8.3-curl
composer create-project yiisoft/app-api --stability=dev project
project created, docker-compose.yml exists
Creating a "yiisoft/app-api" project at "./project"
Installing yiisoft/app-api (1.0.x-dev 788abf0)
Problem 1
- Root composer.json requires yiisoft/yii-debug ^3.0@dev, found yiisoft/yii-debug[dev-dependabot/composer/symfony/var-dumper-tw-7.1.1, dev-dependabot/composer/symfony/console-tw-7.1.1, dev-db-collector-cycle, dev-middleware-dispatcher, dev-master, dev-logger, dev-mutex, dev-fix-psalm-errors, dev-dev-server, dev-psalm1, dev-php80] but it does not match the constraint.
Problem 2
- yiisoft/yii-debug-api dev-master requires yiisoft/yii-debug dev-master -> found yiisoft/yii-debug[dev-master] but it conflicts with your root composer.json require (^3.0@dev).
- yiisoft/yii-debug-api 3.0.x-dev is an alias of yiisoft/yii-debug-api dev-master and thus requires it to be installed too.
- Root composer.json requires yiisoft/yii-debug-api ^3.0@dev -> satisfiable by yiisoft/yii-debug-api[3.0.x-dev (alias of dev-master)].
Q | A |
---|---|
Version | 1.0.x-dev 788abf0 |
PHP version | 8.3 |
Operating system | Ubuntu Linux 22.04 |
See yiisoft/app#272
I think for application template PHP CS Fixer, that free for use, will be better.
Clone and install app-api
Clean installation without anything else.
(Not sure about user / auth; ok in my opinion)
A blog in it, which doesn't make sense in my opinion as it is already in the demo-api.
app-api/src/User/UserRepository.php
Line 41 in 428a47c
Currently classes are grouped by type: validation, controller, builder, formatter. I think overall the structure will be better if we'll group these by use-case:
Auth
AuthController.php
AuthRequestErrorHandler.php
AuthRequest.php
Blog
BlogController.php
PostBuilder.php
Post.php
PostStatus.php
PostFormatter.php
PostRepository.php
BlogService.php
EditPostRequest.php
ViewPostRequest.php
Site
SiteController.php
User
UserController.php
User.php
UserFormatter.php
UserRepository.php
UserService.php
Try to execute any cli command with yii
utility. Do not pass env
variable.
As per following line of code in yii
file, It should use production environment.
define('YII_ENV', getenv('env') ?? 'production');
It is using testing environment. Actually getenv('env')
is evaluating to false which is not allowing to return 'production' string in YII_ENV
.
Q | A |
---|---|
Version | yii3 |
PHP version | 7.4 |
Operating system | ubuntu |
Apache is not always used.
Add using ApplicationRunner
in index-test.php
similar to index.php
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.