I am trying to use my own package in a new Symfony2 project. I created a project and installed all the necessary packages using the composer.
Here is my composer.json file project
{ "name": "symfony/framework-standard-edition", "license": "MIT", "type": "project", "description": "The \"Symfony Standard Edition\" distribution", "autoload": { "psr-4": { "": "src/", "SymfonyStandard\\": "app/SymfonyStandard/" } }, "require": { "php": ">=5.3.9", "symfony/symfony": "2.7.*", "doctrine/orm": "^2.4.8", "doctrine/doctrine-bundle": "~1.4", "symfony/assetic-bundle": "~2.3", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~4.0", "sensio/framework-extra-bundle": "^3.0.2", "incenteev/composer-parameter-handler": "~2.0", "trancynn/devana-book-app": "dev-master" }, "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", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" ], "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", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" ] }, "config": { "bin-dir": "bin" }, "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", "symfony-assets-install": "relative", "incenteev-parameters": { "file": "app/config/parameters.yml" }, "branch-alias": { "dev-master": "2.7-dev" } } }
After that, I download all the necessary packages in my registerKernel registerBundles method as follows:
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(), new FOS\OAuthServerBundle\FOSOAuthServerBundle(), new FOS\RestBundle\FOSRestBundle(), new Voryx\RESTGeneratorBundle\VoryxRESTGeneratorBundle(), new Nelmio\CorsBundle\NelmioCorsBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Nikola\DevanaBookAppBundle\NikolaDevanaBookAppBundle(),
But now starting the server causes a fatal error:
Fatal error: Class 'Nikola\DevanaBookAppBundle\NikolaDevanaBookAppBundle' not found in C:\Users\Nikola\Desktop\symftest\mytest\app\AppKernel.php on line 25
I really don't understand what happened. If you need it, here is my bundle composer.json
{ "name": "trancynn/devana-book-app", "type": "symfony-bundle", "license": "MIT", "authors": [ { "name": "Nikola Ninkovic", "email": " ninkovicnikola00@gmail.com " } ], "minimum-stability": "dev", "require": { "php": ">=5.3.9", "symfony/symfony": "2.7.*", "doctrine/orm": "^2.4.8", "doctrine/doctrine-bundle": "~1.4", "symfony/assetic-bundle": "~2.3", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~4.0", "sensio/framework-extra-bundle": "^3.0.2", "incenteev/composer-parameter-handler": "~2.0", "jms/serializer-bundle": "@stable", "friendsofsymfony/rest-bundle": "@stable", "friendsofsymfony/oauth-server-bundle": "@stable", "hwi/oauth-bundle": "@stable", "voryx/restgeneratorbundle": "@stable" }, "autoload": { "psr-0": { "Nikola\\DevanaBookAppBundle": "" } }, "target-dir": "Nikola/DevanaBookAppBundle" }