1

I have set up symfony using composer.

I have added some dependancies in my composer .json file like so:

{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
    "psr-0": { "": "src/" }
},
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "2.0",
    "sonata-project/admin-bundle": "dev-master",
    "sonata-project/doctrine-orm-admin-bundle": "dev-master",
    "sonata-project/intl-bundle": "dev-master",
    "sonata-project/user-bundle": "dev-master"
},
"scripts": {
    "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"
    ],
    "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"
    ]
},
"config": {
    "bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.3-dev"
    }
}
}

When I run composer.phar update I get this message:

Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - Installation request for sonata-project/intl-bundle dev-master -> satisfiable by sonata-project/intl-bundle[dev-master]. - sonata-project/intl-bundle dev-master requires ext-intl * -> the requested PHP extension intl is missing from your system. Problem 2 - sonata-project/intl-bundle dev-master requires ext-intl * -> the requested PHP extension intl is missing from your system. - symfony/framework-standard-edition 2.3.x-dev requires sonata-project/intl-bundle dev-master -> satisfiable by sonata-project/intl-bundle[dev-master]. - Installation request for symfony/framework-standard-edition 2.3.x-dev -> satisfiable by symfony/framework-standard-edition[2.3.x-dev].

So not knowing any better I figure I may need to run composr.phar install which gives me this:

Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them. Your requirements could not be resolved to an installable set of packages.

Problem 1 - Installation request for symfony/framework-standard-edition 2.3.x-dev -> satisfiable by symfony/framework-standard-edition[2.3.x-dev]. - symfony/framework-standard-edition 2.3.x-dev requires sonata-project/admin-bundle dev-master -> no matching package found.

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.

Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

I have followed the instructions from sonata-project.org but am not making any progress.

Is there some sort of really obvious mistake I am making?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
jaget
  • 2,149
  • 6
  • 21
  • 29

1 Answers1

4

Here is a valid composer.json for setting up sonata-admin with symfony 2.3.*

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.3.*",
    "doctrine/orm": ">=2.2.3,<2.4-dev",
    "doctrine/doctrine-bundle": "1.2.*",
    "twig/extensions": "1.0.*",
    "symfony/assetic-bundle": "2.3.*",
    "symfony/swiftmailer-bundle": "2.3.*",
    "symfony/monolog-bundle": "2.3.*",
    "sensio/distribution-bundle": "2.3.*",
    "sensio/framework-extra-bundle": "2.3.*",
    "sensio/generator-bundle": "2.3.*",
    "incenteev/composer-parameter-handler": "~2.0",
    "twig/twig": "1.*",
    "knplabs/knp-menu-bundle" : "1.1.*",
    "sonata-project/block-bundle" : "dev-master",
    "sonata-project/exporter" : "1.1.0",
    "sonata-project/jquery-bundle" : "1.8.*",
    "sonata-project/cache-bundle" : "dev-master",
    "sonata-project/intl-bundle" : "dev-master",
    "sonata-project/admin-bundle" : "dev-master",
    "sonata-project/doctrine-orm-admin-bundle" : "dev-master",
},

Also you have to install INTL extension: http://php.net/manual/en/intl.setup.php

ozahorulia
  • 9,798
  • 8
  • 48
  • 72
  • Thank you for your reply Hast. I put that in the composer.json file and got the same errors. Maybe I am doing something else wrong? – jaget Jun 23 '13 at 16:51
  • Could I safely paste the code from a zip file into the correct place and include the composer.json require section? – jaget Jun 23 '13 at 16:55
  • Nope, do not even past zipped code to vendors directory. Your problem is also that you have to install intl extension: http://php.net/manual/en/intl.setup.php – ozahorulia Jun 23 '13 at 17:01
  • @jaget I've added link about intl installations to the answer. Did it help you? – ozahorulia Jun 23 '13 at 18:21
  • Just trying to set this up on mac / MAMP. I'll update you when I get it installed and tested. – jaget Jun 23 '13 at 18:54