简体   繁体   English

Symfony-PHP-国际扩展

[英]Symfony - PHP-Intl Extension

my Problem is the following: 我的问题如下:

I was refacing a clients Website. 我正在重整客户网站。 Before it was not using any Framework. 之前没有使用任何框架。 Now I used Symfony2 for the backend. 现在,我将Symfony2用于后端。 My client has his webspace at strato.de and there is no php-intl extension installed, which is required for Symfony2.3 or later. 我的客户在strato.de上有他的网站空间,并且没有安装php-intl扩展,这对于Symfony2.3或更高版本是必需的。

Is it possible to install symfony without this extension - and if so, how? 不安装此扩展程序就可以安装symfony吗?如果可以,怎么办?

composer.json: composer.json:

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.5.*",
    "symfony/icu": "1.0.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0"
},
"require-dev": {
    "sensio/generator-bundle": "~2.3"
},
"scripts": {
    "post-root-package-install": [
        "SymfonyStandard\\Composer::hookRootPackageInstall"
    ],
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ]
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.5-dev"
    }
}

} }

composer.phar install gives this error: composer.phar install给出此错误:

Problem 1
- The requested package symfony/icu could not be found in any version, there may be a typo in the package name.
Problem 2
- symfony/symfony v2.5.3 requires symfony/icu ~1.0 -> no matching package found.
- symfony/symfony v2.5.3 requires symfony/icu ~1.0 -> no matching package found.
- Installation request for symfony/symfony v2.5.3 -> satisfiable by symfony/symfony[v2.5.3].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

This should help you: 这应该可以帮助您:

http://symfony.com/doc/current/components/intl.html http://symfony.com/doc/current/components/intl.html

"require: {
    "symfony/icu": "1.1.*"
}

Set the version to 将版本设置为

"1.0.*" if the server does not have the intl extension installed;
"1.1.*" if the server is compiled with ICU 4.2 or lower.

EDIT: 编辑:

Based on your require block. 根据您的需求块。

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing jdorn/sql-formatter (v1.2.17)
    Loading from cache

  - Installing psr/log (1.0.0)
    Loading from cache

  - Installing twig/twig (v1.16.0)
    Loading from cache

  - Installing doctrine/lexer (v1.0)
    Loading from cache

  - Installing doctrine/annotations (v1.2.0)
    Loading from cache

  - Installing doctrine/collections (v1.2)
    Loading from cache

  - Installing doctrine/cache (v1.3.0)
    Loading from cache

  - Installing doctrine/inflector (v1.0)
    Loading from cache

  - Installing doctrine/common (v2.4.2)
    Loading from cache

  - Removing symfony/finder (v2.5.3)
  - Installing symfony/symfony (v2.5.3)
    Loading from cache

  - Installing symfony/icu (v1.0.1)
    Downloading: 100%         

  - Installing doctrine/dbal (v2.4.2)
    Loading from cache

  - Installing doctrine/doctrine-bundle (v1.2.0)
    Loading from cache

  - Installing kriswallsmith/assetic (v1.1.2)
    Loading from cache

  - Installing symfony/assetic-bundle (v2.3.0)
    Loading from cache

  - Installing doctrine/orm (v2.4.4)
    Loading from cache

  - Installing twig/extensions (v1.1.0)
    Loading from cache

  - Installing swiftmailer/swiftmailer (v5.2.1)
    Loading from cache

  - Installing symfony/swiftmailer-bundle (v2.3.7)
    Loading from cache

  - Installing monolog/monolog (1.10.0)
    Loading from cache

  - Installing symfony/monolog-bundle (v2.6.1)
    Loading from cache

  - Installing sensiolabs/security-checker (v2.0.0)
    Loading from cache

  - Installing sensio/distribution-bundle (v3.0.4)
    Loading from cache

  - Installing sensio/framework-extra-bundle (v3.0.1)
    Loading from cache

  - Installing incenteev/composer-parameter-handler (v2.1.0)
    Loading from cache

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM