Browse Source
* master: (587 commits) fixed typo Fixes #1222: refactored jui/Widget, intorduced jui/Slider and jui/SliderInput Correct Nav.php comments/PHP doc to reflect BS3 dropdown support. Correct Nav.php comments/PHP doc to reflect BS3 dropdown support. Correct Nav.php comments/PHP doc to reflect BS3 dropdown support. Added example for dividers to bootstrap Nav Checkboxlist documentation fix Added "Using controller action to render errors" Fix doc Renamed DetailView attribute type to format encode email in Formatter Added default status code setting. "yii\swiftmailer\Mailer" transport setup has been advanced to support constructor arguments and plugins. fix rbac select statement Comments cleanup. Reverted closeButton Nomenclature and code realignment. better nginx config guide about using bootstrap less files Include Schema in new migrations by default ... Conflicts: framework/composer.json tests/unit/data/config.phptags/2.0.0-beta
Carsten Brandt
11 years ago
847 changed files with 49103 additions and 55950 deletions
@ -1,4 +1,4 @@
|
||||
<?php |
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -1,22 +1,26 @@
|
||||
<?php |
||||
|
||||
Yii::setAlias('common', __DIR__ . '/../'); |
||||
Yii::setAlias('frontend', __DIR__ . '/../../frontend'); |
||||
Yii::setAlias('backend', __DIR__ . '/../../backend'); |
||||
Yii::setAlias('common', realpath(__DIR__ . '/../')); |
||||
Yii::setAlias('frontend', realpath(__DIR__ . '/../../frontend')); |
||||
Yii::setAlias('backend', realpath(__DIR__ . '/../../backend')); |
||||
|
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
'supportEmail' => 'support@example.com', |
||||
|
||||
'components.cache' => array( |
||||
'components.cache' => [ |
||||
'class' => 'yii\caching\FileCache', |
||||
), |
||||
], |
||||
|
||||
'components.db' => array( |
||||
'components.mail' => [ |
||||
'class' => 'yii\swiftmailer\Mailer', |
||||
], |
||||
|
||||
'components.db' => [ |
||||
'class' => 'yii\db\Connection', |
||||
'dsn' => 'mysql:host=localhost;dbname=yii2advanced', |
||||
'username' => 'root', |
||||
'password' => '', |
||||
'charset' => 'utf8', |
||||
), |
||||
); |
||||
], |
||||
]; |
||||
|
@ -1,4 +1,4 @@
|
||||
<?php |
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -1,11 +1,11 @@
|
||||
<?php |
||||
return array( |
||||
'preload' => array( |
||||
return [ |
||||
'preload' => [ |
||||
//'debug', |
||||
), |
||||
'modules' => array( |
||||
// 'debug' => array( |
||||
], |
||||
'modules' => [ |
||||
// 'debug' => [ |
||||
// 'class' => 'yii\debug\Module', |
||||
// ), |
||||
), |
||||
); |
||||
// ], |
||||
], |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,11 +1,11 @@
|
||||
<?php |
||||
return array( |
||||
'preload' => array( |
||||
return [ |
||||
'preload' => [ |
||||
//'debug', |
||||
), |
||||
'modules' => array( |
||||
// 'debug' => array( |
||||
], |
||||
'modules' => [ |
||||
// 'debug' => [ |
||||
// 'class' => 'yii\debug\Module', |
||||
// ), |
||||
), |
||||
); |
||||
// ], |
||||
], |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,3 +1,3 @@
|
||||
<?php |
||||
return array( |
||||
); |
||||
return [ |
||||
]; |
||||
|
@ -1,4 +1,4 @@
|
||||
<?php |
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -1,25 +1,24 @@
|
||||
<?php |
||||
$params = require(__DIR__ . '/params.php'); |
||||
return array( |
||||
'id' => 'bootstrap-console', |
||||
return [ |
||||
'id' => 'basic-console', |
||||
'basePath' => dirname(__DIR__), |
||||
'preload' => array('log'), |
||||
'preload' => ['log'], |
||||
'controllerPath' => dirname(__DIR__) . '/commands', |
||||
'controllerNamespace' => 'app\commands', |
||||
'modules' => array( |
||||
), |
||||
'components' => array( |
||||
'cache' => array( |
||||
'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'), |
||||
'components' => [ |
||||
'cache' => [ |
||||
'class' => 'yii\caching\FileCache', |
||||
), |
||||
'log' => array( |
||||
'targets' => array( |
||||
array( |
||||
], |
||||
'log' => [ |
||||
'targets' => [ |
||||
[ |
||||
'class' => 'yii\log\FileTarget', |
||||
'levels' => array('error', 'warning'), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
'levels' => ['error', 'warning'], |
||||
], |
||||
], |
||||
], |
||||
], |
||||
'params' => $params, |
||||
); |
||||
]; |
||||
|
@ -1,5 +1,5 @@
|
||||
<?php |
||||
|
||||
return array( |
||||
return [ |
||||
'adminEmail' => 'admin@example.com', |
||||
); |
||||
]; |
||||
|
@ -0,0 +1,20 @@
|
||||
This folder contains various tests for the basic application. |
||||
These tests are developed with [Codeception PHP Testing Framework](http://codeception.com/). |
||||
|
||||
To run the tests, follow these steps: |
||||
|
||||
1. [Install Codeception](http://codeception.com/quickstart) if you do not have it yet. |
||||
2. Create test configuration files based on your environment: |
||||
- Copy `acceptance.suite.dist.yml` to `acceptance.suite.yml` and customize it; |
||||
- Copy `functional.suite.dist.yml` to `functional.suite.yml` and customize it; |
||||
- Copy `unit.suite.dist.yml` to `unit.suite.yml` and customize it. |
||||
3. Switch to the parent folder and run tests: |
||||
|
||||
``` |
||||
cd .. |
||||
php codecept.phar build // rebuild test scripts, only need to be run once |
||||
php codecept.phar run // run all available tests |
||||
``` |
||||
|
||||
Please refer to [Codeception tutorial](http://codeception.com/docs/01-Introduction) for |
||||
more details about writing acceptance, functional and unit tests. |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,114 +0,0 @@
|
||||
<?php |
||||
/** |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
|
||||
namespace yii\build\controllers; |
||||
|
||||
use yii\console\Exception; |
||||
use yii\console\Controller; |
||||
|
||||
/** |
||||
* http://www.unicode.org/cldr/charts/supplemental/language_plural_rules.html |
||||
* @author Qiang Xue <qiang.xue@gmail.com> |
||||
* @since 2.0 |
||||
*/ |
||||
class LocaleController extends Controller |
||||
{ |
||||
public $defaultAction = 'plural'; |
||||
|
||||
/** |
||||
* Generates the plural rules data. |
||||
* |
||||
* This command will parse the plural rule XML file from CLDR and convert them |
||||
* into appropriate PHP representation to support Yii message translation feature. |
||||
* @param string $xmlFile the original plural rule XML file (from CLDR). This file may be found in |
||||
* http://www.unicode.org/Public/cldr/latest/core.zip |
||||
* Extract the zip file and locate the file "common/supplemental/plurals.xml". |
||||
* @throws Exception |
||||
*/ |
||||
public function actionPlural($xmlFile) |
||||
{ |
||||
if (!is_file($xmlFile)) { |
||||
throw new Exception("The source plural rule file does not exist: $xmlFile"); |
||||
} |
||||
|
||||
$xml = simplexml_load_file($xmlFile); |
||||
|
||||
$allRules = array(); |
||||
|
||||
$patterns = array( |
||||
'/n in 0..1/' => '(n==0||n==1)', |
||||
'/\s+is\s+not\s+/i' => '!=', //is not |
||||
'/\s+is\s+/i' => '==', //is |
||||
'/n\s+mod\s+(\d+)/i' => 'fmod(n,$1)', //mod (CLDR's "mod" is "fmod()", not "%") |
||||
'/^(.*?)\s+not\s+in\s+(\d+)\.\.(\d+)/i' => '!in_array($1,range($2,$3))', //not in |
||||
'/^(.*?)\s+in\s+(\d+)\.\.(\d+)/i' => 'in_array($1,range($2,$3))', //in |
||||
'/^(.*?)\s+not\s+within\s+(\d+)\.\.(\d+)/i' => '($1<$2||$1>$3)', //not within |
||||
'/^(.*?)\s+within\s+(\d+)\.\.(\d+)/i' => '($1>=$2&&$1<=$3)', //within |
||||
); |
||||
foreach ($xml->plurals->pluralRules as $node) { |
||||
$attributes = $node->attributes(); |
||||
$locales = explode(' ', $attributes['locales']); |
||||
$rules = array(); |
||||
|
||||
if (!empty($node->pluralRule)) { |
||||
foreach ($node->pluralRule as $rule) { |
||||
$expr_or = preg_split('/\s+or\s+/i', $rule); |
||||
foreach ($expr_or as $key_or => $val_or) { |
||||
$expr_and = preg_split('/\s+and\s+/i', $val_or); |
||||
$expr_and = preg_replace(array_keys($patterns), array_values($patterns), $expr_and); |
||||
$expr_or[$key_or] = implode('&&', $expr_and); |
||||
} |
||||
$expr = preg_replace('/\\bn\\b/', '$n', implode('||', $expr_or)); |
||||
$rules[] = preg_replace_callback('/range\((\d+),(\d+)\)/', function ($matches) { |
||||
if ($matches[2] - $matches[1] <= 5) { |
||||
return 'array(' . implode(',', range($matches[1], $matches[2])) . ')'; |
||||
} else { |
||||
return $matches[0]; |
||||
} |
||||
}, $expr); |
||||
|
||||
} |
||||
foreach ($locales as $locale) { |
||||
$allRules[$locale] = $rules; |
||||
} |
||||
} |
||||
} |
||||
// hard fix for "br": the rule is too complex |
||||
$allRules['br'] = array( |
||||
0 => 'fmod($n,10)==1&&!in_array(fmod($n,100),array(11,71,91))', |
||||
1 => 'fmod($n,10)==2&&!in_array(fmod($n,100),array(12,72,92))', |
||||
2 => 'in_array(fmod($n,10),array(3,4,9))&&!in_array(fmod($n,100),array_merge(range(10,19),range(70,79),range(90,99)))', |
||||
3 => 'fmod($n,1000000)==0&&$n!=0', |
||||
); |
||||
if (preg_match('/\d+/', $xml->version['number'], $matches)) { |
||||
$revision = $matches[0]; |
||||
} else { |
||||
$revision = -1; |
||||
} |
||||
|
||||
echo "<?php\n";
|
||||
echo <<<EOD |
||||
/** |
||||
* Plural rules. |
||||
* |
||||
* This file is automatically generated by the "yii locale/plural" command under the "build" folder. |
||||
* Do not modify it directly. |
||||
* |
||||
* The original plural rule data used for generating this file has the following copyright terms: |
||||
* |
||||
* Copyright © 1991-2007 Unicode, Inc. All rights reserved. |
||||
* Distributed under the Terms of Use in http://www.unicode.org/copyright.html. |
||||
* |
||||
* @revision $revision (of the original plural file) |
||||
* @link http://www.yiiframework.com/ |
||||
* @copyright Copyright (c) 2008 Yii Software LLC |
||||
* @license http://www.yiiframework.com/license/ |
||||
*/ |
||||
EOD; |
||||
echo "\nreturn " . var_export($allRules, true) . ';'; |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue