Composerãããã±ã¼ã¸ã®stabilityã解決ããããã¿
PHPã¨Composerã§å
æ¥composer/composer
ã®dev-master
ã«ä¾åããããã°ã©ã ãä½ã£ã¦ããããcomposer install
ã®ã¨ãã«ä»¥ä¸ã®ãããªã¨ã©ã¼ãã§ã¦ã¤ã³ã¹ãã¼ã«ã§ããªãåé¡ã«ã¶ã¡ãããã¾ããã
Your requirements could not be resolved to an installable set of packages. Problem 1 - kohkimakimoto/altax v3.0.6 requires composer/composer dev-master -> no matching package found. ...
解決æ¹æ³ã¯composer.json
ã«"minimum-stability": "dev"
ã¨"prefer-stable": true
ãæå®ãããã対象ã®ããã±ã¼ã¸ã«"composer/composer": "@dev"
ã®ãããªstabilityãã©ã°ãã¤ããã°OKã§ããã
ãã¦ããã®ä»¶ã«é¢é£ããæ¥æ¬èªæ å ±ããã¾ããªãã£ãã®ã§ããã æ ¹æ¬ã®ä»çµã¿(Composerãããã±ã¼ã¸ã®stabilityãå¤æãã¦ãã¦ã³ãã¼ãããä»çµã¿)ãä¸å¯§ã«æ¸ããããã°ãã¿ã¤ããã®ã§ã以ä¸å訳ãã¦ã¿ã¾ããã
Composerã®ã¹ã¿ããªãã£ãã©ã°
åé¡:Composer Stability Flags
https://igor.io/2013/02/07/composer-stability-flags.html
ä»ã®ã¨ããcomposerã®ãµãã¼ãã«ãã£ã¦ããæãããããåãåããã¯ãã¹ã¿ããªãã£(ããã±ã¼ã¸ã®å®å®æ§ãstability)ãã©ã解決ãããã®ãããããããªãã¨ãããã®ã ã ãããã®ã±ã¼ã¹ã¯ä»¥ä¸ã®ãããªåãåããã«ãªãã
ããã±ã¼ã¸B:dev-masterã«ä¾åããããã±ã¼ã¸A:dev-masterãè¦æ±(require)ããããcomposerãããã±ã¼ã¸Bãè¦ã¤ãããªãã¨ãããã ã
ã«ã¼ãããã±ã¼ã¸
ã«ã¼ãããã±ã¼ã¸ã¯ã¡ã¤ã³ã®composer.json
ãã¡ã¤ã«ã®ãã¨ã ãããã¯composer install
ãå®è¡ããã¨ãã«ãããã£ã¬ã¯ããªã¨åããã£ã¬ã¯ããªå
ã«ããã
å¤ãã®composer.json
ã®ãã£ã¼ã«ãã¯ã«ã¼ããªã³ãªã¼ã§ãããã¯ã«ã¼ãããã±ã¼ã¸å
ã§æå®ãããã¨ãã ãå½±é¿ããã¤ã¨ãããã¨ã ã
ã«ã¼ãããã±ã¼ã¸ã¯ã³ã³ããã¹ãã ã
ããªããèªåã®ããã±ã¼ã¸ã®ãã£ã¬ã¯ããªå
ã§ããã±ã¼ã¸Aã«ä¾åãã¦ããã¨ãã£ãå ´åãããªãã®ããã±ã¼ã¸ãã«ã¼ãããã±ã¼ã¸ã¨ãªãã
ããã±ã¼ã¸Aã®ãã£ã¬ã¯ããªã«cd
ãããAãã«ã¼ãããã±ã¼ã¸ã ã
ã¹ã¿ããªãã£ã¯ã«ã¼ãããã±ã¼ã¸ã§æ±ºå®ããããããã¦ã«ã¼ãããã±ã¼ã¸ã®ã¿ã§æ±ºå®ãããã ãããå¿ããªãããã«ãã¦ãã¡ãã£ã¨èãã¦ã¿ããã
Composerã¯ã¦ã¼ã¶ã®æã«ãããä¾åç©ãã©ã®ãããªã¹ã¿ããªãã£ãå¤æãããã ã¦ã¼ã¶ã¨ãã¦ããªãã¯éçºçããã¼ã¿ãã¾ãã¯å®å®çã®ãªãªã¼ã¹ã使ãããã決ããã
æä½éã®ã¹ã¿ããªãã£(minimum-stability)
ãã®ã¹ã¿ããªãã£ã®å¤æã¯ã«ã¼ãããã±ã¼ã¸ã®minimum-stabilityãã£ã¼ã«ãã«åºã¥ãã¦è¡ããããããã¯ã«ã¼ããªã³ãªã¼ã ãã¹ã¿ããªãã£ãã©ã°ã®ããã©ã«ãå¤ãå®ç¾©ããä¸éã¨ãã¦æ¯ãèãã
ããã¯å¼ãä¸ãããã¨ã®ã§ããã«ã¼ã©ã¼ã§ãããã©ã«ãã¯"stable"ãããã¦ããã ãããå¼ãä¸ããã¨ãããä½ãã¹ã¿ããªãã£ãã©ã°ã示ããã¨ãã§ããã
minimum-stabilityã¯ãã¹ã¦ã®å¶ç´ã®ããã®ããã©ã«ãã®å®å®æ§ãå®ç¾©ããã
ã¹ã¿ããªãã£ã®è§£æ±º
ããã§ã¯ãã¤ãã®ãããªã·ããªãªãèãã¦ã¿ãããã«ã¼ãããã±ã¼ã¸ãA:dev- masterãè¦æ±ãã¦ãã¦ã ãããããã«B:dev-masterãè¦æ±ãã¦ããå ´åã ã
ã«ã¼ãããã±ã¼ã¸ã¯ä»¥ä¸ã®ããã«ãªã
{ "require": { "A": "dev-master" } }
Composerã¯ä»¥ä¸ã®ã¹ããããè¸ã:
minimum-stability
ã決å®:ãã®ã±ã¼ã¹ã§ã¯ãã£ã¼ã«ããå®ç¾©ããã¦ããªãã®ã§ããã©ã«ãå¤ãè¨å®ããããããã¯"stable"ã ã- Aã¯
dev-master
ã¨ãããã¼ã¸ã§ã³å¶ç´ããã£ã¦ãããdev-
ããªãã£ã¯ã¹ãã¤ãã¦ããã®ã§ãããã¯devãã¼ã¸ã§ã³ã§ãããã¨ãããããããã¦devãã¼ã¸ã§ã³ã¯"dev"ã¹ã¿ããªãã£ããã£ã¦ãããã«ã¼ãããã±ã¼ã¸ã§å®ç¾©ããããã®devãã¼ã¸ã§ã³å¶ç´ã®ãããæé»çã«@dev
ã¹ã¿ããªãã£ãã©ã°ãå¾ãã Aã¯å¶ç´
A:dev-master@dev
ããã£ã¦ããã®ã§ããã®ãã¼ã¸ã§ã³ã¯ããããã¦composerã¯ãªã³ã¯ãããAã¯Bã«dev-master
ã¨ããå¶ç´ã¤ãã§ä¾åãã¦ãããããã¯dev-
ããªãã£ã¯ã¹ãæã£ã¦ããããã£ã¦"dev"ã¹ã¿ããªãã£ããã£ã¦ãããã¨ãããããã®å¶ç´ã¯ããã±ã¼ã¸Aã®ä¸ã§å®ç¾©ããã¦ãã¦ããã¤ã«ã¼ãããã±ã¼ã¸ã§ã¯ãªãã®ã§ãæé»çã«
@dev
ã¹ã¿ããªãã£ãã©ã°ãå¾ããã¨ã¯ã§ããªãããã®ä»£ããã«minimum-stability
ãç¶æ¿ãããããã¯"stable"ã ããã£ã¦ã解決ãããå¶ç´ã¯B:dev-master@stable
ã¨ãªãã
ãããé害ã®ãã¤ã³ãã ããªããªãB:dev-master@stable
ã¯ã©ããã£ã¦ã解決ã§ããªãããã ãcomposerã¯ä¸ããããã¹ã¿ããªãã£ã®ç¯å²ã§ããã±ã¼ã¸Bãè¦ã¤ãããªãã¨ããããã®ã ã
ãã®åé¡ã«å¯¾å¦ããæ¹æ³ã®ä¸ã¤ã¯minimum-stability
ã"dev"ã«ä¸ãããã¨ã ã
ãããããã¯é常ã¨ã¦ããããªãã¢ã¤ãã¢ã ãããã¯ãã¹ã¦ã®å¶ç´ã«é©ç¨ããã¦ãã¾ãã
ãã®çµæããã¹ã¦ã®ããã±ã¼ã¸ãä¸å®å®ãªãã¼ã¸ã§ã³ã§åå¾ãã¦ãã¾ãã
ã ãããé¡ãã ããããããªãã§ããã
ã¹ã¿ããªãã£ãã©ã°
代ããã«ã¹ã¿ããªãã£ãã©ã°ã使ããã
ãã©ã°ã¯ãã¼ã¸ã§ã³å¶ç´ã®ä¸é¨ã¨ãã¦å®ç¾©ããããã¹ã¿ããªãã£ã¯ã«ã¼ãããã±ã¼ã¸ã§ã®ã¿ã§æ±ºå®ãããã®ã§ããã©ã°ãã¾ãã«ã¼ããªã³ãªã¼ã ã ä¾åããã±ã¼ã¸å ã§å®ç¾©ããããã©ã°ã¯åç´ã«ç¡è¦ãããã
ãã©ã°ã¯ä¸å®å®çããã±ã¼ã¸ãæå®ãããã¯ã¤ããªã¹ãã¨ãã¦ä½¿ããã¨ãã§ããããã®ã±ã¼ã¹ã«ããã¦ãç§ã¯Bããã¯ã¤ããªã¹ãã«è¿½å ãããããã®ããã«ããï¼
{ "require": { "A": "dev-master", "B": "@dev" } }
注ç®ãã¹ããªã®ã¯ãå®éã®ãã¼ã¸ã§ã³ãã«ã¼ãããã±ã¼ã¸å ã§å®ç¾©ãã¦ããªãç¹ã ã ããã¯ã«ã¼ãããã±ã¼ã¸ã¯ã¤ã³ã¹ãã¼ã«ãããBã®ãã¼ã¸ã§ã³ãæ±ããªãã¨ãããã¨ãæå³ããã ãã¼ã¸ã§ã³ã®æ±ºå®ã¯æå®ããå¶ç´ããã£ã¦ããAã«å§è²ãã¦ããã
ããã«ãã£ã¦ãããAãBã¸ã®ä¾åãdev-master
ãã~1.0
ã¾ãã¯ãã以å¤ã«å¤æ´ããã¨ãã¦ããã«ã¼ãããã±ã¼ã¸ã¯ãªã«ãå¤æ´ããå¿
è¦ããªããªãã
Silexã®ä¾
ãã®åä½ãå®éã«ã©ã®ãããªãã®ããããã¢ã¤ãã¢ãå¾ãããã«ãsilexãä¾ã«è¦ã¦ã¿ããã
ãããæ¸ãã¦ããç¾æç¹ã§ãsilexã¯å®å®ãã¼ã¸ã§ã³ããªã(訳è
注:ä»ã¯1.2ã®å®å®ãã¼ã¸ã§ã³ãããã¾ãã)ãã¤ã³ã¹ãã¼ã«ããããã«@dev
ãã©ã°ã追å ããå¿
è¦ããã:
{ "require": { "silex/silex": "1.0.*@dev" } }
Silexã¯1.0
ã®éçºãã¼ã¸ã§ã³ã§ãã1.0.x-dev
ãã¼ã¸ã§ã³ã®ã¿ãããã
Silexã®ãã¹ã¦ã®ä¾åç©ã¯å®å®ãã¼ã¸ã§ã³ããããããã¯ããã©ã«ãã§v2.1.7
ã®å¤æ°ã®symfonyã³ã³ãã¼ãã³ãã¨v1.0.1
ã®pimpleãå¾ãã¨ãããã¨ã ã
ããæ°æ¥åã«ãªãªã¼ã¹ãããsymfonyã³ã³ãã¼ãã³ãã®v2.2.0-RC1
ãã¼ã¸ã§ã³ã試ããããªã£ãå ´åã
ããã以ä¸ã®ããã«ãã¯ã¤ããªã¹ãã«ãããã¨ãã§ãã:
{ "require": { "silex/silex": "1.0.*@dev", "symfony/event-dispatcher": "@RC", "symfony/http-foundation": "@RC", "symfony/http-kernel": "@RC", "symfony/routing": "@RC" } }
ãã¼ã¸ã§ã³ããã¹ã¦æå®ããã®ã¯é¢åãªã®ã§ãminimum-stability
ãä¸ãããã¨ãã§ããã
ãã®å ´åããã¯OKã ãããªããæã¾ãªãä¸å®å®ãã¼ã¸ã§ã³ãã¤ã³ã¹ãã¼ã«ããããã¨ããªãããã ã
{ "minimum-stability": "RC", "require": { "silex/silex": "1.0.*@dev" } }
prefer-stable
ãã®ãã¹ããæ¸ãã¦ãã°ããããå¾ãcomposerã¯prefer-stable
ã¨ããæ©è½ããªãªã¼ã¹ããã
ãããä¾åç©ã®ã¹ã¿ããªãã£ãææ¡ããããªãå ´åãåã«prefer-stable
ãã£ã¼ã«ããã«ã¼ãããã±ã¼ã¸ã§ä½¿ããã¨ãã§ããã
Composerã¯å¯è½ãªãã®ã§æãå®å®ããä¾åç©ãå°ãã ãã
ããã¯ã¨ã¦ã便å©ã§ã»ã¨ãã©ã®å ´åããã§ååã ãããããç§ã¯ããªããæ¬å½ã«å¿ è¦ã¨ãã¦ããã¹ã¿ããªãã£ãèãããã¨ããå§ããããæ示çã«ãããå®ç¾©ãããã¨ãããããªãã¯ä¾¿å©ãã¨å¶å¾¡ããã¬ã¼ããã¦ããããããªãã
çµè«
composerãã©ã®ããã«ã¹ã¿ããªãã£ã解決ãã¦ããããä¸å®å®ãã¼ã¸ã§ã³ãåå¾ããããã«ã¹ã¿ããªãã£ãã©ã°ã©ã®ããã«ä½¿ããã¨ãã§ãããããã®è¨äºãããªãã®ããããç解ã«å½¹ç«ã¦ã°ã幸ãã ã
ã§ãè¦ãã¦ããã¦ãã:ã¹ã¿ããªãã£ãã©ã°ãå¿ è¦ã¨ãããã£ã¨ãããããçç±ã¯ãããªãã®ä¾åç©ã®ã¡ã³ãããå®å®æ¿ãã¿ã°ä»ãããªãçç±ã«ãããã®ã ãå½¼ãã«ãã©ã³ãã¨ã¤ãªã¢ã¹ã®è¿½å ã¨ã¿ã°ãªãªã¼ã¹ããããããããã£ã¦ãã£ã¦ãããå½¼ãããããè¡ã£ããããã«ãã¹ã¿ããªãã£ãã©ã°ãæ¨ã¦ã¦ãã¾ããããã¼ã«ãªãããã