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
This is base API application template and multilangual support is optional, so it's should be removed.
Related to yiisoft/config#121
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
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 |
This is may be useful for CI.
Need to correct generators and schema-provider list.
SyncTables
can be commented
app-api/config/common/params.php
Lines 97 to 112 in 0d43b26
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 |
HI!
I´m checking this new app for generate an api. Where is the documentation? The /docs don't exist.
I think for application template PHP CS Fixer, that free for use, will be better.
See yiisoft/app#273
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 |
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"
Currently annotations are very basic. These should be extended to include details about responses and request parameters.
Apache is not always used.
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
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
Add using ApplicationRunner
in index-test.php
similar to index.php
.
See yiisoft/app#272
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.