From f112cc633b329d1028e7cff1d121779eb00a9fe3 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Tue, 21 Jan 2014 17:54:10 +0100 Subject: [PATCH] allow installing jQuery 1.10 for IE support fixes #1905 --- composer.json | 2 +- docs/guide/composer.md | 21 ++++++++++++++++++++- framework/composer.json | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6cd9ded22d2..7aa0df49b88 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,7 @@ "ext-mbstring": "*", "lib-pcre": "*", "yiisoft/yii2-composer": "*", - "yiisoft/jquery": "2.0.*", + "yiisoft/jquery": "~2.0 | ~1.10", "phpspec/php-diff": ">=1.0.2", "ezyang/htmlpurifier": "4.6.*", "michelf/php-markdown": "1.3.*" diff --git a/docs/guide/composer.md b/docs/guide/composer.md index 5c7cd649a92..5dc7f591ad1 100644 --- a/docs/guide/composer.md +++ b/docs/guide/composer.md @@ -24,7 +24,7 @@ Adding more packages to your project The act of [installing a Yii application](installation.md) creates the `composer.json` file in the root directory of your project. In this file you list the packages that your application requires. For Yii sites, the most important part of the file is the `require` section: -``` +```json { "require": { "Michelf/php-markdown": ">=1.3", @@ -63,6 +63,25 @@ In both cases, after some waiting, the required packages will be installed and r No additional configuration of those packages will be required. +Using a specifc version of a package +------------------------------------ + +Yii always comes with the latest version of a required library that it is compatible with but allows you to use an +older version if you need to. +A good example for this is jQuery which has [dropped old IE browser support](http://jquery.com/browser-support/) in version 2.x. +When installing Yii via composer the installed jQuery version will be the latest 2.x release. When you want to use jQuery 1.10 +because of IE browser support you can adjust your composer.json by requiring a specific version of jQuery like this: + +```json +{ + "require": { + ... + "yiisoft/jquery": "1.10.*" + } +} +``` + + FAQ --- diff --git a/framework/composer.json b/framework/composer.json index 6f96e3681b7..9fa3970a06f 100644 --- a/framework/composer.json +++ b/framework/composer.json @@ -53,7 +53,7 @@ "ext-mbstring": "*", "lib-pcre": "*", "yiisoft/yii2-composer": "*", - "yiisoft/jquery": "2.0.*", + "yiisoft/jquery": "~2.0 | ~1.10", "phpspec/php-diff": ">=1.0.2", "ezyang/htmlpurifier": "4.6.*", "michelf/php-markdown": "1.3.*"