Results 1 to 2 of 2

Thread: Unable to create a "contao-bundle" under contao 4.2.4

  1. #1
    New user
    Join Date
    10-26-16.
    Posts
    1

    Frage Unable to create a "contao-bundle" under contao 4.2.4

    Hi,

    With a fresh install of Contao 4.2.4 standard-edition the composer autoloader doesn't work.

    My basic structure for my moduletest :
    Code:
    vendor/addictic/
    └── moduletest-bundle
        ├── composer.json
        └── src
            ├── AddicticModuletestBundle.php
            └── Resources
                └── contao
                    ├── classes
                    │   └── Moduletest.php
                    ├── config
                    │   ├── autoload.ini
                    │   ├── autoload.php
                    │   ├── config.php
                    │   └── ide_compat.php
                    ├── dca
                    │   └── tl_car.php
                    ├── languages
                    │   └── fr
                    ├── models
                    ├── modules
                    └── templates
                        ├── modules
                        └── views
    
    14 directories, 8 files
    vendor/addictic/moduletest-bundle/composer.json :
    Code:
    {
        "name": "addictic/moduletest-bundle",
        "type": "contao-bundle",
        "description": "Addictic moduletest bundle",
        "license": "LGPL-3.0+",
        "authors": [
            {
                "name": "Addictic",
                "homepage": "https://www.addictic.fr"
            }
        ],
        "autoload": {
            "psr-4": {
                "Addictic\\ModuletestBundle\\": "src/"
            },
            "classmap": [
                "src/Resources/contao"
            ],
            "exclude-from-classmap": [
                "src/Resources/contao/config",
                "src/Resources/contao/dca",
                "src/Resources/contao/languages",
                "src/Resources/contao/templates"
            ]
        }
    }
    vendor/addictic/moduletest-bundle/src/AddicticModuletestBundle.php :
    PHP Code:
    <?php

    /*
     * This file is part of Contao.
     *
     * Copyright (c) 2016-2017 Addictic
     *
     * @license LGPL-3.0+
     */

    namespace Addictic\ModuletestBundle;

    use 
    Symfony\Component\HttpKernel\Bundle\Bundle;

    /**
     * Configures the Addictic moduletest bundle.
     */
    class AddicticModuletestBundle extends Bundle
    {
    }
    app/appKernel.php add this line:
    [PHP]
    new Addictic\ModuletestBundle\AddicticModuletestBundle (),
    [PHP]

    When i launch
    composer update
    i obtain the following :
    Code:
    > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
    PHP Fatal error:  Class 'Addictic\ModuletestBundle\AddicticModuletestBundle' not found in /ha.0/contaofresh/www/app/AppKernel.php on line 40
    Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
    
    
      [RuntimeException]
      An error occurred when executing the "'cache:clear --no-warmup'" command:
      PHP Fatal error:  Class 'Addictic\ModuletestBundle\AddicticModuletestBundle' not found in /ha.0/contaofresh/www/app/AppKernel.php on line 40
    Same error when i execute app_dev.php :
    PHP Code:
    ClassNotFoundException in AppKernel.php line 40Attempted to load class "AddicticModuletestBundle" from namespace "Addictic\ModuletestBundle".
    Did you forget a "use" statement for another namespace? 
    Any one i've an idea ?

    Best regard

  2. #2
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    See your thread in the german forum: https://community.contao.org/de/show...l=1#post422986

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •