Call to undefined method Illuminate\Foundation\Application::withFacades() - laravel-5.6

I am trying to install laravel-auditing
I am following these steps.
but seems it says like Uncaught Error: Call to undefined method Illuminate\Foundation\Application::withFacades()
Pre-Conditions
Laravel version: 5.6.39
owen-it/laravel-auditing: 8.*
My Composer.json file is
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "^1.0",
"laravelista/lumen-vendor-publish": "^2.1",
"owen-it/laravel-auditing": "8.*"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},

Related

Fatal error installing Symfony CMF

I'm trying to install Symfony CMF but I'm getting the following error while creating the database:
Fatal error: Class 'PHPCR\Util\Console\Command\MoveCommand' not found
in
/vendor/doctrine/phpcr-bundle/Doctrine/Bundle/PHPCRBundle/Command/NodeMoveCommand.php
on line 34
My composer.json is as follows:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "2.3.*",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"friendsofsymfony/user-bundle": "*",
"sonata-project/user-bundle": "dev-master",
"sonata-project/admin-bundle": "2.2.*#dev",
"sonata-project/easy-extends-bundle" : "dev-master",
"sonata-project/intl-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "2.2.*#dev",
"sonata-project/cache-bundle": "dev-master",
"knplabs/knp-menu-bundle": "1.1.x-dev",
"sonata-project/block-bundle": "2.2.*#dev",
"jackalope/jackalope-doctrine-dbal": "dev-master",
"doctrine/phpcr-bundle": "1.0.*#dev",
"doctrine/phpcr-odm": "1.0.*#dev"
},
AppKernel:
// App bundles
new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
// Vendor bundles
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Sonata\jQueryBundle\SonatajQueryBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
I have the following line setup in autoload.php
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');
And finally my config.yml relevant section:
doctrine_phpcr:
session:
backend:
type: doctrinedbal
connection: doctrine.dbal.default_connection
workspace: default
username: admin
password: admin
odm:
auto_mapping: true
Can anyone help please?
you may try this
symfony cmf fix
symfony-cmf had a lot trouble to begin with.
but i found a working one with linux and windows.
and you can use other than sqlite.
good luck.

Problem Composer `Memory limit` with Capistrano and Symfony 3.3 in AWS VM

I've a problem with my composer and capistrano when i lauch the command i've got :
Problem 1
- Installation request for symfony/symfony v3.3.17 -> satisfiable by symfony/symfony[v3.3.17].
- don't install symfony/var-dumper v4.0.12|don't install symfony/symfony v3.3.17
- Installation request for symfony/var-dumper v4.0.12 -> satisfiable by symfony/var-dumper[v4.0.12].
Here's my composer.json :
{
"name": "mickaelmonsang/showroom",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"cocur/slugify": "^3.1",
"composer/ca-bundle": "^1.1",
"doctrine/annotations": "^1.6",
"doctrine/cache": "^1.7",
"doctrine/doctrine-bundle": "^1.9",
"doctrine/doctrine-cache-bundle": "^1.3",
"doctrine/doctrine-migrations-bundle": "^1.0",
"doctrine/inflector": "^1.3",
"doctrine/migrations": "^1.8",
"doctrine/orm": "^2.5",
"doctrine/reflection": "^1.0",
"friendsofsymfony/user-bundle": "^2.1",
"gedmo/doctrine-extensions": "^2.4",
"guzzlehttp/guzzle": "^6.3",
"hwi/oauth-bundle": "^0.5.3",
"incenteev/composer-parameter-handler": "^2.1",
"knplabs/gaufrette": "^0.6.0",
"knplabs/knp-components": "^1.3",
"knplabs/knp-gaufrette-bundle": "^0.5.3",
"knplabs/knp-menu": "^2.3",
"knplabs/knp-menu-bundle": "^2.2",
"knplabs/knp-paginator-bundle": "^2.8",
"kriswallsmith/buzz": "0.16.1",
"league/oauth2-client": "^2.3",
"ocramius/package-versions": "^1.3",
"paragonie/random_compat": "2.0.17",
"psr/simple-cache": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "3.0.29",
"sensio/generator-bundle": "^3.1",
"sensiolabs/security-checker": "^4.1",
"sonata-project/admin-bundle": "3.36.0",
"sonata-project/block-bundle": "^3.12",
"sonata-project/cache": "^2.0",
"sonata-project/core-bundle": "^3.11",
"sonata-project/datagrid-bundle": "^2.3",
"sonata-project/doctrine-orm-admin-bundle": "3.6.1",
"sonata-project/exporter": "^1.9",
"stof/doctrine-extensions-bundle": "^1.3",
"swiftmailer/swiftmailer": "5.4.9",
"symfony/assetic-bundle": "^2.8",
"symfony/monolog-bundle": "3.2.0",
"symfony/phpunit-bridge": "^4.1",
"symfony/polyfill-apcu": "^1.8",
"symfony/polyfill-intl-icu": "^1.8",
"symfony/polyfill-mbstring": "^1.8",
"symfony/polyfill-php56": "^1.8",
"symfony/polyfill-php70": "^1.8",
"symfony/polyfill-php72": "^1.8",
"symfony/polyfill-util": "^1.8",
"symfony/security-acl": "3.0.1",
"symfony/swiftmailer-bundle": "2.6.7",
"symfony/symfony": "3.3.17",
"symfony/var-dumper": "4.0.12",
"twig/twig": "^2.5",
"vich/uploader-bundle": "1.7.1",
"zendframework/zend-eventmanager": "^3.2"
},
"require-dev": {
},
"scripts": {
"symfony-scripts": [
"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::prepareDeploymentTarget"
],
"post-install-cmd": [
"#symfony-scripts"
],
"post-update-cmd": [
"#symfony-scripts"
]
},
"config": {
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": null
}
}
and when i want to install any bundle with composer i've got an error :
mmap() failed: [12] Cannot allocate memory
PHP Fatal error: Out of memory (allocated 343932928) (tried to allocate 1560576 bytes)
or I've set the PHP memory_limit to -1 and restart by nothing.
What's wrong so ?
Notice : I'm on PHP7.0
Hope you've got the solution :).
The symfony/symfony package already includes the VarDumper component (which you try to install with the symfony/var-dumper package). This is something Composer wrongly allowed in older versions and was fixed in Composer 1.7.3.
Do you really need the VarDumper component in version 4? If that's the case, you need to remove symfony/symfony first and require all the needed components explicitly if you cannot upgrade all Symfony packages to 4.
There's both a short-term and a long-term solution,
Short-term: Paste in to your php file.
ini_set('memory_limit', '256M');
Long-term: Change the default value in the php.ini file to the below.
memory_limit = 256M
For more information on this issue, take a look at this thread here.

Unknown “profiler_dump” function [duplicate]

I am trying to send emails with Symfony. Everything works perfect locally. But on server I get following errore in prod.log:
assetic.ERROR: The template "SecurityBundle:Collector:security.html.twig" contains an error: Unknown "profiler_dump" function in "SecurityBundle:Collector:security.html.twig" at line 180.
assetic.ERROR: The template "DoctrineBundle:Collector:db.html.twig" contains an error: Unknown "profiler_dump" function in "DoctrineBundle:Collector:db.html.twig" at line 241
These are bundles I have in composer.json
"php": ">=5.5.9",
"symfony/symfony": "3.1.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "3.0.1",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"justinrainbow/json-schema": "~2.0",
"jms/serializer-bundle": "1.1.0",
"lexik/jwt-authentication-bundle": "1.6.0",
"symfony/assetic-bundle": "^2.8",
"stof/doctrine-extensions-bundle": "^1.2",
"guzzlehttp/guzzle": "~6.0",
"knplabs/knp-paginator-bundle": "^2.5",
"mapado/mysql-doctrine-functions": "1.*",
"hampe/zurb-ink-bundle": "^2.2",
This are bundles in AppKernel class
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new AdminBundle\AdminBundle(),
new APIBundle\APIBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new NotificationBundle\NotificationBundle(),
new Hampe\Bundle\ZurbInkBundle\HampeZurbInkBundle(),
];
By default, AsseticBundle will try to handle the templates of all enabled bundles which leads to errors when enabled bundles ship with templates that rely on features not being loaded in the prod environment. You can solve your issue by explicitly listing all bundles that should be handled by Assetic using the assetic.bundles option.
profiler_dump method comes from Symfony's WebProfilerBundle.
This bundle is not applied to Kernel in production mode, and it should not be (WebProfiler toolbar should be enabled only during development). You should remove those calls from twig template.
I've solved this by creating twig extension defining empty function profiler_dump and loading this twig extension only in production.

Undefined class constant 'API_VERSION_2_5_BC'

After creating a new 2.3 project then adding a set of dependencies to composer.json, the following error occurs when the cache:clear command is run at the end of composer update:
Fatal error: Undefined class constant 'API_VERSION_2_5_BC' in
...\vendor\symfony\framework-bundle\Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension.php
on line 758
The dependencies added were taken from a fully functional existing project built on Symfony 2.5. The objective is to experiment with adding Symfony CMF to the project, mostly to see if it adds needed functionality.
A search on API_VERSION_2_5_BC shows it is related to validation. Is there a workaround, or should I abandon this effort?
composer.json (in part)
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.11.1",
"dist": {
"url": "http://code.jquery.com/jquery-1.11.1.js",
"type": "file"
}
}
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"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.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "2.0.*#dev",
"knplabs/knp-menu": "2.0.*#dev",
"knplabs/knp-menu-bundle": "2.0.*#dev",
"pugx/multi-user-bundle": "3.0.*#dev",
"doctrine/doctrine-fixtures-bundle": "2.2.*",
"liip/functional-test-bundle": "1.0.*#dev",
"psliwa/pdf-bundle": "1.0.#dev",
"braincrafted/bootstrap-bundle": "2.1.*",
"oyejorge/less.php": "~1.5",
"twbs/bootstrap": "3.0.*",
"jquery/jquery": "1.11.*",
"egeloen/ckeditor-bundle": "~2.0",
"helios-ag/fm-elfinder-bundle": "~3.0"
},

symfony2 sonata page bundle error

How to install sonata page-bundle?
My composer.json:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-fixtures-bundle": "~2.2",
"doctrine/data-fixtures": "1.0.*#dev",
"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",
"jms/security-extra-bundle": "1.5.*",
"jms/di-extra-bundle": "1.4.*",
"kriswallsmith/assetic": "1.1.0",
"liip/imagine-bundle": "dev-master",
"egeloen/ckeditor-bundle": "2.*",
"symfony-cmf/routing-bundle": "~1.1",
"knplabs/knp-markdown-bundle": "1.2.*#dev",
"sonata-project/easy-extends-bundle": "~2.1",
"sonata-project/seo-bundle": "~1",
"sonata-project/doctrine-extensions": "~1",
"sonata-project/intl-bundle": "~2.1",
"sonata-project/admin-bundle": "~2.2",
"sonata-project/doctrine-orm-admin-bundle": "~2.2",
"sonata-project/notification-bundle": "~2.2",
"sonata-project/block-bundle": "~2.2",
"sonata-project/media-bundle": "~2.2",
"sonata-project/cache-bundle": "~2.1",
"sonata-project/page-bundle": "~2.3",
"sonata-project/formatter-bundle": "~2.3",
"sonata-project/exporter": "~1.3",
"sonata-project/classification-bundle": "~2.2",
"dflydev/markdown": "~1.0",
"simplethings/entity-audit-bundle": "~0.5",
"willdurand/faker-bundle": "~1.0",
"stof/doctrine-extensions-bundle": "~1.1"
},
My AppKernel.php:
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
// DOCTRINE
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
// KNP HELPER BUNDLES
// new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
// MEDIA
new Sonata\MediaBundle\SonataMediaBundle(),
new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
new Liip\ImagineBundle\LiipImagineBundle(),
// SONATA CORE & HELPER BUNDLES
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new Sonata\jQueryBundle\SonatajQueryBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
new Sonata\IntlBundle\SonataIntlBundle(),
new Sonata\FormatterBundle\SonataFormatterBundle(),
new Sonata\CacheBundle\SonataCacheBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\SeoBundle\SonataSeoBundle(),
new Sonata\PageBundle\SonataPageBundle(),
new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
new Sonata\ClassificationBundle\SonataClassificationBundle(),
new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
new Sonata\NotificationBundle\SonataNotificationBundle(),
new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
// CMF Integration
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
And when i create "block" found error:
Catchable Fatal Error: Argument 3 passed to Sonata\DoctrineORMAdminBundle\Block\AuditBlockService::__construct() must be an instance of SimpleThings\EntityAudit\AuditReader, null given, called in /var/www/xxx/app/cache/dev/appDevDebugProjectContainer.php on line 4911 and defined in /var/www/xxx/vendor/sonata-project/doctrine-orm-admin-bundle/Sonata/DoctrineORMAdminBundle/Block/AuditBlockService.php line 40
After then, add "SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle()" to AppKernel, and found:
ContextErrorException: Notice: Uninitialized string offset: 0 in /var/www/xxx/vendor/sonata-project/doctrine-orm-admin-bundle/Sonata/DoctrineORMAdminBundle/DependencyInjection/Compiler/AddAuditEntityCompilerPass.php line 63
What is wrong?
When installing SonataPageBundle, you have a set of dependencies that need to be installed and properly configured, see the list here: http://sonata-project.org/bundles/page/master/doc/reference/installation.html
You need to check out the installation steps of each specified bundle.
For the details:
The SimpleThingsEntityAuditBundle is used by the DoctrineORMAdminBundle to automatically audit the doctrine-managed entities that have an admin interface.
There it seems that you've created an admin class (a service tagged "sonata.admin") without specifying the needed arguments for the admin (or without inheriting the default admin).
If you didn't, try clearing your cache:
rm -rf app/cache/*
You may have an outdated container.
If this doesn't work, check your services tagged "sonata.admin" to see if they have the required arguments.

Resources