From 3dbfd3ea0eeb3be7485074003bb2a1f7c4ce7d08 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 1 Nov 2013 03:13:40 +0400 Subject: [PATCH] Gii: renamed action "new" to "create" --- framework/yii/gii/CodeFile.php | 6 +++--- framework/yii/gii/Generator.php | 2 +- framework/yii/gii/views/default/view/files.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/yii/gii/CodeFile.php b/framework/yii/gii/CodeFile.php index 2676c38..a5196d9 100644 --- a/framework/yii/gii/CodeFile.php +++ b/framework/yii/gii/CodeFile.php @@ -28,7 +28,7 @@ class CodeFile extends Object /** * The code file is new. */ - const OP_NEW = 'new'; + const OP_CREATE = 'create'; /** * The code file already exists, and the new one may need to overwrite it. */ @@ -68,7 +68,7 @@ class CodeFile extends Object if (is_file($path)) { $this->operation = file_get_contents($path) === $content ? self::OP_SKIP : self::OP_OVERWRITE; } else { - $this->operation = self::OP_NEW; + $this->operation = self::OP_CREATE; } } @@ -79,7 +79,7 @@ class CodeFile extends Object public function save() { $module = Yii::$app->controller->module; - if ($this->operation === self::OP_NEW) { + if ($this->operation === self::OP_CREATE) { $dir = dirname($this->path); if (!is_dir($dir)) { $mask = @umask(0); diff --git a/framework/yii/gii/Generator.php b/framework/yii/gii/Generator.php index 83cdf6e..6f63628 100644 --- a/framework/yii/gii/Generator.php +++ b/framework/yii/gii/Generator.php @@ -250,7 +250,7 @@ abstract class Generator extends Model $hasError = true; $lines[] = "generating $relativePath\n$error"; } else { - $lines[] = $file->operation === CodeFile::OP_NEW ? " generated $relativePath" : " overwrote $relativePath"; + $lines[] = $file->operation === CodeFile::OP_CREATE ? " generated $relativePath" : " overwrote $relativePath"; } } else { $lines[] = " skipped $relativePath"; diff --git a/framework/yii/gii/views/default/view/files.php b/framework/yii/gii/views/default/view/files.php index af61a02..299f12b 100644 --- a/framework/yii/gii/views/default/view/files.php +++ b/framework/yii/gii/views/default/view/files.php @@ -53,7 +53,7 @@ use yii\gii\CodeFile; if ($file->operation === CodeFile::OP_SKIP) { echo ' '; } else { - echo Html::checkBox("answers[{$file->id}]", isset($answers) ? isset($answers[$file->id]) : ($file->operation === CodeFile::OP_NEW)); + echo Html::checkBox("answers[{$file->id}]", isset($answers) ? isset($answers[$file->id]) : ($file->operation === CodeFile::OP_CREATE)); } ?>