sopinet / composergeneric
Generic composer
dev-master / 2.3.x-dev
2015-03-11 08:22 UTC
Requires
- php: >=5.3.3
- a2lix/translation-form-bundle: 2.x-dev
- craue/formflow-bundle: dev-master
- doctrine/data-fixtures: dev-master
- doctrine/doctrine-bundle: ~1.2
- doctrine/doctrine-fixtures-bundle: dev-master
- doctrine/orm: >=2.4.0-RC1
- friendsofsymfony/rest-bundle: dev-master
- friendsofsymfony/user-bundle: 1.3.*
- incenteev/composer-parameter-handler: ~2.0
- jms/di-extra-bundle: *
- jms/security-extra-bundle: dev-master
- jms/serializer-bundle: dev-master
- knplabs/doctrine-behaviors: dev-master
- knplabs/knp-components: dev-master
- knplabs/knp-menu-bundle: 1.1.*
- knplabs/knp-paginator-bundle: ~2.3
- kriswallsmith/assetic: 1.2.*
- raulfraile/ladybug-bundle: v0.7
- sensio/distribution-bundle: ~2.3
- sensio/framework-extra-bundle: ~3.0
- sensio/generator-bundle: ~2.3
- sonata-project/admin-bundle: ~2.3
- sonata-project/block-bundle: 2.2.*
- sonata-project/cache-bundle: ~2.2
- sonata-project/core-bundle: ~2.2
- sonata-project/datagrid-bundle: 2.2.x-dev
- sonata-project/doctrine-extensions: 1.*
- sonata-project/doctrine-orm-admin-bundle: 2.2.*
- sonata-project/easy-extends-bundle: 2.1.*
- sonata-project/exporter: ~1.3
- sonata-project/google-authenticator: 1.*
- sonata-project/user-bundle: ~2.2
- sopinet/bootstrap-extend-bundle: dev-master
- stof/doctrine-extensions-bundle: dev-master
- symfony/assetic-bundle: ~2.3
- symfony/monolog-bundle: ~2.4
- symfony/swiftmailer-bundle: ~2.3
- symfony/symfony: 2.4.*
- twbs/bootstrap: 3.0.*
- twig/extensions: ~1.0
- twitter/bootstrap: 2.3.*
This package is not auto-updated.
Last update: 2024-12-30 15:00:10 UTC
README
General composer for Symfony2 use. Install a Symfony2 system easy and quickly.
Installing Symfony 2.4
cd /var/www
curl -sS https://getcomposer.org/installer | php
php composer.phar create-project symfony/framework-standard-edition MyProject "2.4.*"
Modify Composer
You could install Symfony2 with this composer, you can add more libraries if you need it:
{ "name": "Project name", "description": "Project description", "autoload": { "psr-0": { "": "src/" } }, "minimum-stability": "dev", "require": { "sopinet/composergeneric": "dev-master" } }
Now... execute composer.phar update
Add to AppKernel.php
new JMS\AopBundle\JMSAopBundle(), new JMS\DiExtraBundle\JMSDiExtraBundle($this), new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), new FOS\UserBundle\FOSUserBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), new Sonata\AdminBundle\SonataAdminBundle(), new Sonata\CoreBundle\SonataCoreBundle(), new Sonata\BlockBundle\SonataBlockBundle(), new Sonata\CacheBundle\SonataCacheBundle(), new Sonata\jQueryBundle\SonatajQueryBundle(), new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(), new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'), new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(), new Craue\FormFlowBundle\CraueFormFlowBundle(), new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(), new JMS\SerializerBundle\JMSSerializerBundle($this), new FOS\RestBundle\FOSRestBundle(), new Sopinet\Bundle\BootstrapExtendBundle\SopinetBootstrapExtendBundle(), new RaulFraile\Bundle\LadybugBundle\RaulFraileLadybugBundle()
config.yml
Add:
framework: translator: ~ fos_user: db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel' firewall_name: main user_class: Application\Sonata\UserBundle\Entity\User group: group_class: Test\BaseBundle\Entity\Group sonata_block: default_contexts: [cms]
Modify doctrine part:
# Doctrine Configuration doctrine: dbal: driver: "%database_driver%" host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: UTF8 # if using pdo_sqlite as your database driver, add the path in parameters.yml # e.g. database_path: "%kernel.root_dir%/data/data.db3" # path: "%database_path%" types: json: Sonata\Doctrine\Types\JsonType mapping_types: enum: string orm: auto_generate_proxy_classes: "%kernel.debug%" auto_mapping: true stof_doctrine_extensions: default_locale: %locale% translation_fallback: true orm: default: translatable: true uploadable: validate_writable_directory: true
Monolog config for log on files
monolog: handlers: main: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug console: type: console bubble: false # uncomment to get logging in your browser # you may have to allow bigger header sizes in your Web server configuration #firephp: # type: firephp # level: info #chromephp: # type: chromephp # level: info
Monolog config for log on email(params 'from' and 'to' are required)
monolog: handlers: main: type: fingers_crossed action_level: error handler: nested nested: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug console: type: console elao_error_notifier: from: to: handle404: true mailer: mailer handlePHPErrors: true handlePHPWarnings: false ignoredClasses: ~ repeatTimeout: 3600
SonataUser
php app/console sonata:easy-extends:generate SonataUserBundle --dest src
AƱadir a AppKernel:
new Application\Sonata\UserBundle\ApplicationSonataUserBundle()
Security (Optional)
security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] providers: fos_userbundle: id: fos_user.user_provider.username firewalls: main: pattern: ^/ form_login: provider: fos_userbundle login_path: /login check_path: /login_check default_target_path: /panel always_use_default_target_path: true csrf_provider: form.csrf_provider logout: true anonymous: true access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin/, role: ROLE_ADMIN }