2amigos / yii2-app-template Goto Github PK
View Code? Open in Web Editor NEWYii 2 Basic Application Template with ConfigKit.
Home Page: https://2amigos.us
License: Other
Yii 2 Basic Application Template with ConfigKit.
Home Page: https://2amigos.us
License: Other
Where and how can I manage the params ?
Thanks
i think to remove The following dependencies in composer.json :
"vlucas/phpdotenv": "^2.4",
"league/container": "^2.2",
"symfony/finder": "^3.1",
sidekit/config already has this dependencies in her composer.json file.
isn't it?
Sorry for my english in advanced if you want i can write in spanish in the future issues.
Regards ;)
When I using a command:
php composer.phar create-project --prefer-dist --stability=dev sidekit/yii2-app-basic your-site-name
OR
php composer.phar create-project --prefer-dist --stability=dev sidekit/yii2-app-template your-site-name
I'm getting the error:
[InvalidArgumentException]
Could not find package sidekit/yii2-app-basic with stability dev.
OR
[InvalidArgumentException]
Could not find package sidekit/yii2-app-template with stability dev.
I've never had that problem before and I've been downloading multiple projects via composer before.
What is the problem?
It is assumed that YII_DEBUG and YII_ENV constants are defined in .env file as environment variables. However .env settings are not honoured by Yii. Here's why:
In public/index.php we have:
require __DIR__ . '/../bootstrap/autoload.php';
require __DIR__ . '/../bootstrap/sidekit.php';
In bootstrap/autoload.php:
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
In vendor/yiisoft/yii2/BaseYii.php (which is an ancestor for vendor/yiisoft/yii2/Yii.php):
defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
and finally in bootstrap/sidekit.php:
defined('YII_DEBUG') or define('YII_DEBUG', ConfigKit::env()->get('YII_DEBUG'));
defined('YII_ENV') or define('YII_ENV', ConfigKit::env()->get('YII_ENV'));
Since YII_DEBUG and YII_ENV have been already defined in BaseYii, these settings have no effect.
It is necessary for bootstrap/sidekit.php to load prior to vendor/yiisoft/yii2/Yii.php.
I'm having some drawbacks with fixtures, if i set alias @tests it fix.
How reproduce issue :
1º create migrate post and run
2º create model of post
3º create fixture of post
4º execute yii fixture Post // this raise exception unfound namespace
I think is useful add the following vars in .env :
MAIL_HOST =
MAIL_USERNAME =
MAIL_PASSWORD =
MAIL_PORT = 587
MAIL_ENCRYPTION = tls
And
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => ConfigKit::env()->get('MAIL_HOST'),
'username' => ConfigKit::env()->get('MAIL_USERNAME'),
'password' => ConfigKit::env()->get('MAIL_PASSWORD'),
'port' => ConfigKit::env()->get('MAIL_PORT'),
'encryption' => ConfigKit::env()->get('MAIL_ENCRYPTION'),
],
this config samdark/yii2-cookbook#169 but with sidekit, is it possible?
Gii and Debug should be include in dev enviroment by defualt, imo
On default template installation, alias for bower is missing in test environment.
This results in errors
The file or directory to be published does not exist: path/to/project/vendor/bower/jquery/dist.
Solution is to put same alias that can be found in web conf into test conf.
'aliases' => [
'@bower' => '@vendor/bower-asset',
]
This file has wrong content, right?
https://github.com/sidekit/yii2-app-template/blob/master/config/env/web/prod/.gitkeep
We load src folder with App
, when app
it self already defined in yii2.
I think it will be good if we change App
to src
. It will prevent typo or confusing namespace name.
Also change App/Configuration
to app/configuration
will be good, use lowercase instead ucfirst folder name for standardization.
this change produced fail test :
in the documentation of the usuario module there is an example to use an external events.php file, how and where can it be imported into the entry point?
Thank you
in app/models/User.php
must renamed Object with yii\base\BaseObject for solve
futher more details : yiisoft/yii2#14017
When app template using CofigKit 2.0
I think this package is always useful for developer.
if do you agree accept my pr :)
In your guidelines you tell us to have skinny controllers, lean models and slender views.
Business logic should not be in those.
Understood.
What you haven't done, however, is tell us where to put it. 😄
In components?
Composer script have 300secs timeout by default, i should indicate it in this line :
Once the commands finish simply do the following:
cd your-site-name
composer start-server // here
if you executes composer run start-server --timeout=0
it ignore timeout, further details composer/composer#4918.
Other way we can config yii serve
in controllerMap
property to set docroot
by default.
'controllerMap' => [
'serve' => [
'class' => 'yii\console\controllers\ServeController',
'docroot' => '@web',
]
],
// then
yii serve // it wors!
is root alias is defined ?
for now i set manual root alias with this on bootstrap aliases:
Yii::setAlias('@root', ConfigKit::config()->getRootPath());
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.