Browse Source

Merge branch 'master' of git.yiisoft.com:yii2

tags/2.0.0-beta
Qiang Xue 13 years ago
parent
commit
41dd1156ce
  1. 32
      framework/console/Command.php
  2. 11
      todo.md
  3. 10
      upgrade.md

32
framework/console/Command.php

@ -304,19 +304,35 @@ abstract class Command extends \yii\base\Component
* Reads input via the readline PHP extension if that's available, or fgets() if readline is not installed. * Reads input via the readline PHP extension if that's available, or fgets() if readline is not installed.
* *
* @param string $message to echo out before waiting for user input * @param string $message to echo out before waiting for user input
* @param string $default the default string to be returned when user does not write anything.
* Defaults to null, means that default string is disabled.
* @return mixed line read as a string, or false if input has been closed * @return mixed line read as a string, or false if input has been closed
*/ */
public function prompt($message) public function prompt($message, $default = null)
{ {
if($default !== null) {
$message .= " [$default] ";
}
else {
$message .= ' ';
}
if(extension_loaded('readline')) if(extension_loaded('readline'))
{ {
$input = readline($message.' '); $input = readline($message);
readline_add_history($input); if($input) {
return $input; readline_add_history($input);
} else }
{ } else {
echo $message.' '; echo $message;
return trim(fgets(STDIN)); $input = fgets(STDIN);
}
if($input === false) {
return false;
}
else {
$input = trim($input);
return ($input==='' && $default!==null) ? $default : $input;
} }
} }

11
todo.md

@ -1,11 +1,11 @@
- logging - logging
* WebTarget * WebTarget
* ProfileTarget * ProfileTarget
* Toolbar ?
- base - base
* error/exception handling * error/exception handling
* Convert all PHP errors into exceptions, remove YII_ENABLE_ERROR_HANDLER and error handler (?) * Convert all PHP errors into exceptions, remove YII_ENABLE_ERROR_HANDLER and error handler (?)
* module * module
- Module should be able to define its own configuration including routes. Application should be able to overwrite it.
* application * application
* http exception * http exception
* security * security
@ -14,7 +14,7 @@
* CompareValidator::clientValidateAttribute(): search for "CHtml::activeId" * CompareValidator::clientValidateAttribute(): search for "CHtml::activeId"
* FileValidator, UniqueValidator, ExistValidator, DateValidator: TBD * FileValidator, UniqueValidator, ExistValidator, DateValidator: TBD
* consider merging UniqueValidator and ExistValidator and using a NOT property. * consider merging UniqueValidator and ExistValidator and using a NOT property.
- console command support - console command support [DONE]
- built-in console commands - built-in console commands
+ api doc builder + api doc builder
* support for markdown syntax * support for markdown syntax
@ -49,6 +49,7 @@
- web: TBD - web: TBD
* get/setFlash() should be moved to session component * get/setFlash() should be moved to session component
* support optional parameter in URL patterns * support optional parameter in URL patterns
* Response object.
- gii - gii
* move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic. * move generation API out of gii, provide yiic commands to use it. Use same templates for gii/yiic.
* i18n variant of templates * i18n variant of templates
@ -59,5 +60,9 @@
* ability to manage scripts order (store these in a vector?) * ability to manage scripts order (store these in a vector?)
* http://ryanbigg.com/guides/asset_pipeline.html, http://guides.rubyonrails.org/asset_pipeline.html, use content hash instead of mtime + directory hash. * http://ryanbigg.com/guides/asset_pipeline.html, http://guides.rubyonrails.org/asset_pipeline.html, use content hash instead of mtime + directory hash.
- Requirement checker - Requirement checker
- Optional configurable input filtering in request
- widgets - widgets
* if we're going to supply default ones, these should generate really unique IDs. This will solve a lot of AJAX-nesting problems. * if we're going to supply default ones, these should generate really unique IDs. This will solve a lot of AJAX-nesting problems.
- Make sure type hinting is used when components are passed to methods
- Decouple controller from application (by passing web application instance to controller and if not passed, using Yii::app())?
- Decouple view renderer from controller so it can be used separately (useful for sending emails from console etc.)

10
upgrade.md

@ -10,14 +10,14 @@ for both A and B.
General upgrade instructions General upgrade instructions
--------------------------- ----------------------------
- Make a backup. - Make a backup.
- Clean up your 'assets' folder. - Clean up your 'assets' folder.
- Replace 'framework' dir with the new one or point SVN to a fresh - Replace 'framework' dir with the new one or point Git to a fresh
release and update. release tag and checkout.
- Check if everything is OK, if not — revert from backup and post - Check if everything is OK, if not — revert to previous stable version and post
issues to Yii issue tracker. issues to [Yii issue tracker](https://github.com/yiisoft/yii/issues).
Upgrading from v1.1.x Upgrading from v1.1.x

Loading…
Cancel
Save