Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added to the basic app, fixed config, added to core commands. #1759

Merged
merged 3 commits into from Jan 3, 2014

Conversation

@Ragazzo
Copy link
Contributor

Ragazzo commented Jan 3, 2014

I added to the basic application console.php config to avoid unnecessary exception with fixtures path is not configured right and added db config (db is needed for apply/clear actions), i also added folder templates where by default will be hosted templates for yii2-faker, so user should not worry how to configure it and everything will be by default for him.
Added fixture to the core commands. Improved some messages and checks.

@Ragazzo
Copy link
Contributor Author

Ragazzo commented Jan 3, 2014

also @qiangxue do we need to have some $this->confirm() for user when he trying to apply/clear actions of fixture controller? i think it would be another useful extra-check for user, and should be implemented. What do you think?

@Ragazzo
Copy link
Contributor Author

Ragazzo commented Jan 3, 2014

Related with #1756

@@ -19,6 +22,17 @@
],
],
],
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yii2basic',

This comment has been minimized.

Copy link
@qiangxue

qiangxue Jan 3, 2014

Member

Please use yii2_basic to be consistent with DB setting in other places.

This comment has been minimized.

Copy link
@Ragazzo

This comment has been minimized.

Copy link
@lucianobaraglia

lucianobaraglia Jan 3, 2014

Contributor

Just one comment...
Maybe it would be cleaner to separate db config in a separated file, just as $params.
That would help sharing (and versioning) the main config file wile each developer has it's own database configuration (ignored by CVS) without problem.

This comment has been minimized.

Copy link
@Ragazzo

Ragazzo Jan 3, 2014

Author Contributor

@qiangxue should it be?

This comment has been minimized.

Copy link
@cebe

cebe Jan 3, 2014

Member

this is not part of this PR in general it is a good idea. Not sure if we should do it in basic app. Discussion should go in a separate issue.

This comment has been minimized.

Copy link
@Ragazzo

Ragazzo Jan 3, 2014

Author Contributor

yep, could you maybe create it?

@qiangxue
Copy link
Member

qiangxue commented Jan 3, 2014

I think we need confirm() for any command that may cause change of the system.

@Ragazzo
Copy link
Contributor Author

Ragazzo commented Jan 3, 2014

I think we need confirm() for any command that may cause change of the system.

ok.

@Ragazzo
Copy link
Contributor Author

Ragazzo commented Jan 3, 2014

Added confirmation. Ready for review. No sure if we for example need to add outputList method to basic console controller, anyway could be helpful, but ofcourse i am against any mess that is out of domain scope.

{
if ($this->getFixtureManager() == null) {

This comment has been minimized.

Copy link
@creocoder

creocoder Jan 3, 2014

Contributor

== => ===

This comment has been minimized.

Copy link
@Ragazzo

Ragazzo Jan 3, 2014

Author Contributor

why?

$this->stdout(realpath(Yii::getAlias($this->fixturePath)) . "\n\n", Console::FG_GREEN);

foreach($fixtures as $index => $fixture) {
$this->stdout($index +1 . ". " . $fixture . "\n", Console::FG_GREEN);

This comment has been minimized.

Copy link
@creocoder

creocoder Jan 3, 2014

Contributor

$this->stdout($index + 1 . ". {$fixture}\n", Console::FG_GREEN);

This comment has been minimized.

Copy link
@Ragazzo

Ragazzo Jan 3, 2014

Author Contributor

does not make sense.

@@ -1,4 +1,7 @@
<?php

Yii::setAlias('tests', __DIR__ . '/../tests');

This comment has been minimized.

Copy link
@creocoder

creocoder Jan 3, 2014

Contributor

Yii::setAlias('tests', realpath(__DIR__ . '/../tests'));

This comment has been minimized.

Copy link
@Ragazzo

Ragazzo Jan 3, 2014

Author Contributor

nope, according to this - https://github.com/yiisoft/yii2/blob/master/apps/basic/tests/_bootstrap.php#L22. Anyway does not matter.

This comment has been minimized.

Copy link
@creocoder

creocoder Jan 3, 2014

Contributor

realpath(__DIR__) === __DIR__ This is why you link did not show anything.

Now see whats really according:
https://github.com/yiisoft/yii2/blob/master/apps/advanced/common/config/params.php#L4

This comment has been minimized.

Copy link
@cebe

cebe Jan 3, 2014

Member

should actually be changed this way:

Yii::setAlias('@tests', dirname(__DIR__) . '/tests');

This comment has been minimized.

Copy link
@Ragazzo

Ragazzo Jan 3, 2014

Author Contributor

@creocoder i think i will be ignoring you. Thanks.
@cebe ok, will change.

@Ragazzo
Copy link
Contributor Author

Ragazzo commented Jan 3, 2014

Done, can be reviewed.

cebe added a commit that referenced this pull request Jan 3, 2014
Added to the basic app, fixed config, added to core commands.
@cebe cebe merged commit 08ee8b1 into yiisoft:master Jan 3, 2014
@cebe
Copy link
Member

cebe commented Jan 3, 2014

Thanks!

@Ragazzo Ragazzo deleted the Ragazzo:fixtures_controller_improvements branch Jan 3, 2014
@Ragazzo
Copy link
Contributor Author

Ragazzo commented Jan 3, 2014

@cebe also change alias to dirname in tests/_bootstrap.php. Thanks.

@cebe
Copy link
Member

cebe commented Jan 3, 2014

tests/_bootstrap.php is already fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.