yiisoft / yii2-app-basic Goto Github PK
View Code? Open in Web Editor NEWYii 2.0 Basic Application Template
Home Page: http://www.yiiframework.com
License: BSD 3-Clause "New" or "Revised" License
Yii 2.0 Basic Application Template
Home Page: http://www.yiiframework.com
License: BSD 3-Clause "New" or "Revised" License
yii\rbac\migrations
yii\web\migrations
@samdark ### What steps will reproduce the problem?
trying to push to heroku master..
tried everything like
php composer.phar global update fxp/composer-asset-plugin --no-plugins
tried changing the require section of composer.json..
heroku rejects the push due to fxp/composer-asset-plugin......
kindly help.
Install yii. Create htaccess like the one in manual.
In UrlManager: 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => false,
Then open http://yourdomain.com/index.php or any page http://yourdomain.com/index.php/any-page
I guess, to redirect to pages without index.php or throw 404 exception. That's up to debate.
It works and creates page duplicates.
Lastest yii 2.0.11, php 5.6, apache. Same with nginx and default config.
By following currently the only guide for codeception in yii2 I successfully ran the tests with command c:\my\project\location\tests>codecept run
without errors.
But then, I was looking forward to creating a command in IDE I'm using (PhpStorm 8) to run those tests with shortcut and get an output within IDE.
As IDE rans commands relative to application root, I tried to test it from cmd.exe. I ran command similar to this: c:\my\project\location>codecept -c c:\my\project\location\tests
(-c option to command codeception to use codeception.yml that resides in \tests dir) and got an error:
[InvalidArgumentException]
There are no commands defined in the "M" namespace.
Should I run a codecept command from application root in a different way?
I'm running yii2 app on Win7 station through wamp25 package that has php v5.5.x.
Run functional tests:
composer exec codecept run functional
controllers
models
web
└── assets
├── 4e4966d0
├── 562e9843
├── cfeea075
└── .gitignore
@webroot
└── assets
├── 4e4966d0
├── 562e9843
└── cfeea075
controllers
models
web
└── assets
└── .gitignore
Q | A |
---|---|
Yii vesion | dev-master |
PHP version | 5.5.9 |
Operating system | Ubuntu |
Install (create-project) an old version of this app.
Always a working app with locked extensions.
Currently composer runs an update which will resolve the extension constraints to their latest version, which might be an untested combination.
Q | A |
---|---|
Yii vesion | any |
PHP version | any |
Operating system | any |
Committing this file to VC is important because it will cause anyone who sets up the project to use the exact same versions of the dependencies that you are using. Your CI server, production machines, other developers in your team, everything and everyone runs on the same dependencies, which mitigates the potential for bugs affecting only some parts of the deployments. Even if you develop alone, in six months when reinstalling the project you can feel confident the dependencies installed are still working even if your dependencies released many new versions since then. (See note below about using the update command.)
References:
CC: @mikehaertl
Create class TestCase extends yii\codeception\DbTestCase
in ./tests/unit
with namespace tests\unit
Extend any test class from ./tests/unit/models
namespace tests\models;
import tests\unit\TestCase;
class LoginFormTest extends TestCase
Add (or not) in ./tests/_bootstrap.php
Yii::setAlias('@tests', dirname(__DIR__));
Run unit tests
PHP Fatal error: Class 'tests\unit\TestCase' not found in [TestClass.php] on line ...
I tryed namespase app\tests\unit
instead tests\unit
also.
Runned tests.
Q | A |
---|---|
Yii vesion | 2.0.9 |
PHP version | 5.6.23 |
Operating system | Windows 10 x64 |
in api app.
I config user component with enableSession=false
, and use HttpBearerAuth solution。How to retrieve user identity, Yii::$app->user->identity return false, any idea for this solution to retrieve user identity?
I got a error
yii\base\ErrorException: unlink(C:\Users\Evgeniy\Documents\basic\runtime/mail/testing_message.eml): No such file or directory
in this line
when returned false
You need to add @
or the check is_file
.
codecept run
test will pass
The email files generated begin with a datestamp and then .eml extension. testing_message.eml never exists. Test always fails.
private function getMessageFile()
{
return Yii::getAlias(Yii::$app->mailer->fileTransportPath) . '/testing_message.eml';
}
Q | A |
---|---|
Yii vesion | |
PHP version | |
Operating system |
Moved from yiisoft/yii2#13602
Original text:
I suggest to add .env support, like it's done in Laravel. With it it's much easier to make a basic
config of the app/switching between environments, etc.
codeception/bin/yii migrate
Yii Migration Tool (based on Yii v2.0.8)
Creating migration history table "migration"...Done.
Total 7 new migrations to be applied:
m141201_013120_create_status_table
m150128_003709_extend_status_table_for_created_by
m150128_233458_extend_status_table_for_slugs
m150209_200619_extend_status_table_for_updated_by
m150209_204852_create_status_log_table
m150219_235923_create_sample_table
m160316_201654_extend_status_table_for_image
Apply the above migrations? (yes|no) [no]:yes
*** applying m141201_013120_create_status_table
> create table {{%status}} ... done (time: 0.006s)
*** applied m141201_013120_create_status_table (time: 0.023s)
*** applying m150128_003709_extend_status_table_for_created_by
> add column created_by integer NOT NULL to table {{%status}} ... done (time: 0.008s)
> add foreign key fk_status_created_by: {{%status}} (created_by) references {{%user}} (id) ...Exception 'yii\db\Exception' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'yii2_basic_tests.#sql-98f_22' (errno: 150)
The SQL being executed was: ALTER TABLE status
ADD CONSTRAINT fk_status_created_by
FOREIGN KEY (created_by
) REFERENCES user
(id
) ON DELETE CASCADE ON UPDATE CASCADE'
Completed migration
error above
Adding foreign keys for the test fails.
I did a composer self-update and composer-update before re-testing. The db permissions do work, status table is created okay.
Also codeception is installed properly.
Q | A |
---|---|
Yii vesion | |
PHP version | |
Operating system |
$query = $query->leftJoin('DESIGNATIONS AS DESIGNATIONS2', [
'DESIGNATIONS2.DES_ID' => 'ART_DES_ID',
'AND DESIGNATIONS2.DES_LNG_ID' => ':langId'
],
[':langId' => 16]
);
LEFT JOIN
DESIGNATIONS
DESIGNATIONS2 ON (
DESIGNATIONS2.
DES_ID='ART_DES_ID') AND (
AND DESIGNATIONS2.
DES_LNG_ID=16)
LEFT JOIN
DESIGNATIONS
DESIGNATIONS2 ON (
DESIGNATIONS2.
DES_ID='ART_DES_ID') AND (
AND DESIGNATIONS2.
DES_LNG_ID=':langId')
The template that's used in the login view for the "remember Me" checkbox is not applied when the result gets rendered.
I think the problem is that the template is specified for the field rather than the actual checkbox.
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
Standart basic application homepage.
Parse error: syntax error, unexpected '?' in .../basic/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 822
It works when I manually revert phpunit to 5.7.19. Maybe it's bug in phpunit and should I submit it there?
Q | A |
---|---|
Yii vesion 2.0.11 | |
PHP version 5.6.13 | |
Operating system Gentoo |
IMO, is a good if you add config/bootstrap.php
like in advanced template.
HI All,
I am new for the Yii2.
I follow the instruction given in the installment process but unable to execute it.
Can anybody explain how can i install it on my local system?
Thanks in advance.
Hi, when I'm trying select some data from db, it throws me an error, 'Undefined index: CONSTRAINT_TYPE'. What's the problem? help me please
like this sql id int(11) NOT NULL AUTO_INCREMENT
,the AUTO_INCREMENT how to be added
I see some difference between
https://github.com/yiisoft/yii2/blob/master/.gitignore
https://github.com/yiisoft/yii2-app-basic/blob/master/.gitignore
https://github.com/yiisoft/yii2-app-advanced/blob/master/.gitignore
Is it reasonable? Or may we add composer.lock
to .gitignore
?
public function beforeAction($action)
{
return parent::beforeAction($action); // TODO: Change the autogenerated stub
}
There always has this TODO message in my phpstorm. Is it done ?
'assetManager' => [
'basePath' => __DIR__ . '/../web/assets',
],
и почему не работают стандартные настройки?
Спасибо.
This issue has originally been reported by @Morpheus-ro at yiisoft/yii2#11161.
Moved here by @SilverFire.
When I installed Yii2 with composer"
composer create-project yiisoft/yii2-app-basic basic 2.0.7
and I'm viewing the page
http://localhost/web/site/login and enter admin/admin
the next page, the redirected page (home), has the logout not in line with the others links from the menu.
Q | A |
---|---|
Yii version | 2.0.7 |
PHP version | 5.5.9 |
Operating system | Ubuntu 14.04 |
Hello. I've found that view files in basic and advanced apps don't reffer to https://github.com/yiisoft/yii2/blob/master/docs/internals/view-code-style.md
When you run the default tests, you need these two entries under require-dev in composer.json:
"codeception/specify": "*",
"codeception/verify": "*"
When you then run the default tests, you get this deprecated error:
Test codeception/unit/models/ContactFormTest.php:testContact
[PHPUnit_Framework_Warning] PHPUnit_Framework_TestCase::getMock() is deprecated, use PHPUnit_Framework_TestCase::createMock() or PHPUnit_Framework_TestCase::getMockBuilder() instead
While it should work as it works locally,
I get '/app/vendor/bower/jquery/dist' can't publish to the directory error.
Q | A |
---|---|
Yii vesion | |
PHP version | |
Operating system |
codecept run
the test will work
PHPUnit_Framework_TestCase::getMock() is deprecated, use PHPUnit_Framework_TestCase::createMock() or PHPUnit_Framework_TestCase::getMockBuilder()
In tests/unit/contactformtest...
public function testContact()
{
$model = $this->getMock('app\models\ContactForm', ['validate']);
$model->expects($this->once())->method('validate')->will($this->returnValue(true));
replacing with createMock seems to fix it
Q | A |
---|---|
Yii vesion | |
PHP version | |
Operating system |
composer exec codecept run functional
Tests pass.
Tests pass, but directory @webroot/assets
was created, it contains JS, CSS etc., these files are not gitignored.
Q | A |
---|---|
Yii vesion | 2.0.9 |
PHP version | PHP 5.5.9-1ubuntu4.17 |
Operating system | Linux |
Probably reason of this lies here https://github.com/Codeception/Codeception/blob/0e268a10e2e5c7d640a70ddf7dc7d558f2d3b0c1/src/Codeception/Lib/Connector/Yii2.php#L253:L256. I guess need to stub AssetManager in such way to prevent real publishing of assets or use real AssetManager and publish files correctly.
Module and Theme folder not exist. Now how can i add theme and module to my application.
Install basic template as described in the README.md and set real db parameters in config/db.php
Execute: composer exec codecept run
Something; failure, error, warning
Nothing
Q | A |
---|---|
Yii vesion | 2.0.11-dev |
PHP version | 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS ) |
Operating system | Ubuntu 16.04 |
😦
<?= $GLOBALS['params']['adminEmail']; ?> // [email protected]
$config
from index.php
and param
from web.php
are stored in the global scope throughout the life of the application. No sense.
Propose:
(new yii\web\Application(require __DIR__ . '/../config/web.php'))->run();
'params' => require __DIR__ . '/params.php',
On a new basic yii2 project, create a controller and action which return redirect response to external domain.
For example:
class FooController extends Controller {
public function actionRedirect() {
return $this->redirect('http://google.com');
}
}
Next create an acceptance test opening the action url with amOnPage
method.
For example:
$i = new AcceptanceTester($scenario);
$i->amOnPage('index-test.php?r=foo/redirect');
Then run php yii serve
and run the acceptance test codecept run acceptance
.
It should be redirected to http://google.com
, not http://google.com:8080
. I think the 8080
port comes from test_entry_url
on codeception.yml
or PhpBrowser.url
on acceptance.suite.yml
. When i change both of them to 80 and run php yii serve
on port 80, it redirects to http://google.com
.
[GuzzleHttp\Exception\ConnectException] cURL error 7: Failed to connect to google.com port 8080: Timed out
Q | A |
---|---|
Yii vesion | >=2.0.5 |
PHP version | PHP 7.0.4 from Xampp 3.2.2 |
Operating system | Windows 10 |
$ composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic ./mynewproject
A basic app.
Installing yiisoft/yii2-app-basic (2.0.10)
- Installing yiisoft/yii2-app-basic (2.0.10)
Downloading: 100%
Created project in ./mynewproject
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- yiisoft/yii2 2.0.8 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.10 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- Installation request for yiisoft/yii2 ~2.0.5 -> satisfiable by yiisoft/yii2[2.0.10, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9].
Q | A |
---|---|
Yii version | ?? |
PHP version | 5.5.9 |
Operating system | Ubuntu 14.4 LTS |
Tried removing "--stability=dev", same result.
Composer version 1.0-dev (c9501a4cc164b176de48e44b239e619cfd5f14e5) 2015-12-16 18:51:41
fxp/composer-asset-plugin (v1.0.3)
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: /Users/tomjamescn/my_develop_space/php_workspace/test/basic/vendor/bower/jquery/dist
in the dir ./vender/bower has this subdirs:
bower-asset
jquery dir is under bower-asset dir.
One month ago, there is no problem~
I try to create some rest APIs for my app follow the tutorial
http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html
step 1:create a new project based on the basic template by composer
step 2:Creating a Controller
step 3:Configuring URL Rules
step 4:Enabling JSON Input
step 5:Trying it Out
could you provide an example project (or a rest api template)?
Q | A |
---|---|
Yii vesion | 2.0.7 |
PHP version | 7.0.3 |
Operating system | centos 7 x64 |
@tests
alias in codeception/config/config.php
seems not to be working correctly if it loads after main console config file. And this is excatly the way how it loads when you try to start console commands from codeception/bin
folder.
$config = yii\helpers\ArrayHelper::merge(
require(YII_APP_BASE_PATH . '/config/console.php'),
require(__DIR__ . '/../config/config.php')
);
It's happening because of @app/config/console.php
config file, because of this code
Yii::setAlias('@tests', dirname(__DIR__) . '/tests/codeception');
After console command, in codeception/config/config.php file @tests
alias value is 'ProjectFolder/tests/codeception'
, but after that there are lines trying to add additional 'codeception'
folder
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController',
'fixtureDataPath' => '@tests/codeception/fixtures',
'templatePath' => '@tests/codeception/templates',
'namespace' => 'tests\codeception\fixtures',
],
],
So if you're trying generate a fixture for example, the path is not working correctly.
I'm following the official Yii install guide, but composer fails to install dependencies:
$ composer -vvv create-project --prefer-dist yiisoft/yii2-app-basic basic
Downloading https://packagist.org/packages.json
Writing /home/dk/.composer/cache/repo/https---packagist.org/packages.json into cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2015-01.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2015-04.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-app-basic.json from cache
Installing yiisoft/yii2-app-basic (2.0.6)
- Installing yiisoft/yii2-app-basic (2.0.6)
Reading /home/dk/.composer/cache/files/yiisoft/yii2-app-basic/3159d797b754d99c5d8adf8a492ba7522b467ddd.zip from cache
Loading from cache
Extracting archive
Executing command (CWD): unzip 'basic//fb7e30be9dc714613d08a6df78ebac2f' -d '/home/dk/Tmp/vendor/composer/95f46cae' && chmod -R u+w '/home/dk/Tmp/vendor/composer/95f46cae'
Created project in basic
Reading ./composer.json
Loading config file ./composer.json
Failed to initialize global composer: Composer could not find the config file: /home/dk/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/dk/.composer/cache/repo/https---packagist.org/packages.json into cache
Installing dependencies (including require-dev)
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2015-01.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2015-04.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-app-basic.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-bootstrap.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-swiftmailer.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-composer.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-ezyang$htmlpurifier.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-cebe$markdown.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-bower-asset$jquery.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-bower-asset$jquery.inputmask.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-bower-asset$punycode.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-bower-asset$yii2-pjax.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-bower-asset$bootstrap.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-swiftmailer$swiftmailer.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-codeception.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-debug.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-gii.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-phpspec$php-diff.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-yiisoft$yii2-faker.json from cache
Reading /home/dk/.composer/cache/repo/https---packagist.org/provider-fzaninotto$faker.json from cache
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*@stable | 1.11.*@stable -> no matching package found.
- Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
If I don't want to create a token nor use an ssh key, the dependencies should be able to download using https links by default. Currently jquery dependency point to [email protected]:jquery/jquery-dist.git
by default and there's no file to modify and to use https instead for dependencies.
git clone https://github.com/yiisoft/yii2-app-basic.git
cd yii2-app-basic
php composer.phar global require "fxp/composer-asset-plugin:^1.2.0"
php composer.phar create-project --prefer-dist --no-interaction --stability=dev yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (dev-master b3e97d79406ae1b74dc66acbbf76d516fb8d81a2)
- Installing yiisoft/yii2-app-basic (dev-master master) Loading from cache
Created project in basic
Loading composer repositories with package information
Updating dependencies (including require-dev)
Failed to clone the [email protected]:jquery/jquery-dist.git repository, try running in interactive mode so that you can enter your GitHub credentials
[RuntimeException]
Failed to execute git clone --mirror '[email protected]:jquery/jquery-dist.git' '/home/tinkerware/.composer/cache/vcs/git-github.com-jquery-jquery-dist.git/'
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
This happens due to a dependency pointing to an ssh direction ([email protected]:jquery/jquery-dist.git
).
There should be a file to update this route to use https
and/or place the https link by default (https://github.com/jquery/jquery-dist.git
) for the cases when we don't want to use keys nor token.
Q | A |
---|---|
Yii version | 2 |
PHP version | PHP 5.6.29-0+deb8u1 |
Operating system | Debian 8 - Jessie |
I created a new app using the yii2-app-basic template using the following command.
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
However when I visit the new app in web browser, I get the error message
Invalid Parameter – yii\base\InvalidParamException
The file or directory to be published does not exist: basic/vendor/bower/jquery/dist
The directory structure of the app vendor
dir follows
vendor
bower
bower-asset
jquery
dist
The composer.json
{
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.5",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
]
},
"extra": {
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"runtime": "0777",
"web/assets": "0777",
"yii": "0755"
}
],
"generateCookieValidationKey": [
"config/web.php"
]
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
This is a copy of the same issue that was fixed in the advanced app yesterday.
There's a typo in both files:
acceptance/ContactCept line 38
functional/ContactCept line 32
$I->expectTo('see that email adress is wrong');
should be
$I->expectTo('see that email address is wrong');
Working on pull request.
I'm following the official Yii install guide
composer global require "fxp/composer-asset-plugin:~1.1.0" composer create-project --prefer-dist yiisoft/yii2-app-basic basic
After the installation I have try to access the installed application and and there was an error:
Invalid Parameter – yii\base\InvalidParamException The file or directory to be published does not exist: D:\xampp\htdocs\basic\vendor\bower/jquery/dist
When I changed the @bower alias with
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');
to
Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower/bower-asset ');
everything was OK.
composer install
Security code is generated and inserted in web.php
I had to put it manually.
PHP version: 7.0.4
Composer version 1.2-dev (08ef916beded8c738be11acc4f463c450e277d64) 2016-06-06 10:22:06
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mongodb
openssl
pcntl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib
[Zend Modules]
Xdebug
Zend OPcache
I installed latest basic version of Yii2.0 ,i want to remove web folder from my url .. but when i tried to do this ..my yii is not working properly
Yii2 faker extension generate the folowing error
Error: The template path "@tests/unit/templates/fixtures" does not exist"
the console.php configuration:
<?php
Yii::setAlias('@tests', dirname(__DIR__) . '/tests');
$params = require(__DIR__ . '/params.php');
$db = require(__DIR__ . '/db.php');
return [
'id' => 'basic-console',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log', 'gii'],
'controllerNamespace' => 'app\commands',
'controllerMap' => [
'fixture' => [
'class' => 'yii\faker\FixtureController'
],
],
'modules' => [
'gii' => 'yii\gii\Module',
],
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
],
'params' => $params,
];
I want to know that if yii2 team is working or planning to work on the environment mechanism in the yii2 basic application just like one exist in the advance application. I have usually seen people using yii2 basic application for REST APIs. While deployment they face issues like params mis-match etc. So I think we should handle the environment in basic application the same way we handle it in the advance application. If you people are not working on it, do let me know I will create a merge request.
Thanks,
I want the users to import csv files. But if it contains new line within double quotes, it throws undefined offset error. I tried preg_replace to replace new line within double quotes using regular expression. But it still shows same error. Is there any other way to solve this problem.
Runing unit tests examples cause errors Maximum function nesting level
the first test works fine but others dont work
It seems that Codeception\Specify\Config
have setDeepClone
property that can be set to false
and all tests pass after puting that
https://github.com/Codeception/Specify/blob/master/docs/GlobalConfig.md
Hi All,
I am trying to disable the db profiler on my production systems and I constantly get the below profiling information on my logs:
2015-06-25 10:13:54 [172.17.42.1][-][-][info][yii\db\Connection::open] Opening DB connection: mysql:host=172.18.64.142;dbname=live
2015-06-25 10:13:54 [172.17.42.1][-][-][profile begin][yii\db\Connection::open] Opening DB connection: mysql:host=172.18.64.142;dbname=live
2015-06-25 10:13:54 [172.17.42.1][-][-][profile end][yii\db\Connection::open] Opening DB connection: mysql:host=172.18.64.142;dbname=live
2015-06-25 10:13:54 [172.17.42.1][-][-][info][yii\db\Command::query] SELECT * FROM metrics_micro
WHERE metrics_id
='3'
2015-06-25 10:13:54 [172.17.42.1][-][-][profile begin][yii\db\Command::query] SELECT * FROM metrics_micro
WHERE metrics_id
='3'
2015-06-25 10:13:54 [172.17.42.1][-][-][profile end][yii\db\Command::query] SELECT * FROM metrics_micro
WHERE metrics_id
='3'
My logs are :
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'logFile' => '@logs/app.log',
'logVars' => [],
],
[
'class' => 'yii\log\FileTarget',
'logFile' => Yii::getAlias('@logs').'/cron.log',
'logVars' => [],
'categories' => ['cronjobs']
],
],
],
Even if I set YII_DEBUG to FALSE the profiling information still appears.
Is there a way to disable the db profiling?
-S.
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.