Skip to content
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
2 parents fdcdd41 + bc9c6c1 commit 9a9fa75361ec954f011a581fc3c9782d9ef95c96 @samdark samdark committed
Showing with 13 additions and 3 deletions.
  1. +2 −0 CHANGELOG
  2. +5 −0 framework/YiiBase.php
  3. +6 −3 framework/console/CConsoleCommand.php
View
2 CHANGELOG
@@ -29,7 +29,9 @@ Version 1.1.11 work in progress
- Enh #414: Added sort parameter to yiic message command that sorts messages by key when merging (ranvis)
- Enh #455: Added support for default value in CConsoleCommand::prompt (eagleoneraptor)
- Enh #568: CHtml::getIdByName() will now convert spaces to underscore to get proper ID for HTML elements (mdomba)
+- Enh #599: Added case sensitivity check when autoloading classes (qiangxue)
- Enh #601: added the method loginRequired() to the IWebUser interface (mdomba)
+- Enh: Added default value to CConsoleCommand::confirm (musterknabe)
- Enh: Added getIsFlashRequest(), proper handling of Flash/Flex request when using CWebLogRoute with FireBug (resurtm)
- Enh: Added CBreadcrumbs::$activeLinkTemplate and CBreadcrumbs::$inactiveLinkTemplate properties which allows to change each item's template (resurtm)
- Enh: Added full-featured behaviors and events CConsoleCommand::onBeforeAction & CConsoleCommand::onAfterAction (Yiivgeny)
View
5 framework/YiiBase.php
@@ -410,6 +410,11 @@ public static function autoload($className)
if(is_file($classFile))
{
include($classFile);
+ if(YII_DEBUG && basename(realpath($classFile))!==$className.'.php')
+ throw new CException(Yii::t('yii','Class name "{class}" does not match class file "{file}".', array(
+ '{class}'=>$className,
+ '{file}'=>$classFile,
+ )));
break;
}
}
View
9 framework/console/CConsoleCommand.php
@@ -542,14 +542,17 @@ public function prompt($message,$default=null)
* Asks user to confirm by typing y or n.
*
* @param string $message to echo out before waiting for user input
+ * @param bool $default this value is returned if no selection is made. This parameter has been available since version 1.1.11.
* @return bool if user confirmed
*
* @since 1.1.9
*/
- public function confirm($message)
+ public function confirm($message, $default = false)
{
- echo $message.' [yes|no] ';
- return !strncasecmp(trim(fgets(STDIN)),'y',1);
+ echo $message.' (yes|no) [' . ($default ? 'yes' : 'no') . ']:';
+
+ $input = trim(fgets(STDIN));
+ return empty($input) ? $default : !strncasecmp($input,'y',1);
}
/**

0 comments on commit 9a9fa75

Please sign in to comment.
Something went wrong with that request. Please try again.