Cannot run the test example of sfPhpExcel - symfony-1.4

I have installed sfPhpExcelPlugin successfully and now I am trying to run an example as per the direction of symfony plugin's website.
I am getting this error, do you guys know how to solve it?
C:\wamp\www\orangehrm-3.01\symfony>php symfony plugins/sfPhpExcelPlugin/examples_1_2/01simple.php
Task "plugins/sfPhpExcelPlugin/examples_1_2/01simple.php" is not defined.

By using php symfony command you are trying to run Symfony task. Your example of sfPhpExcelPlugin is not a Symfony task. Try:
php plugins/sfPhpExcelPlugin/examples_1_2/01simple.php
And to see list of all available Symfony task type:
php symfony

Related

Cannot install symfony with option --webapp

I try to install symfony v5.
Following the documentation, (https://symfony.com/doc/5.4/setup.html#creating-symfony-applications) i have the error "Incorrect usage: flag provided but not defined: --webapp".
Same error with symfony cli and composer.
How can i resolve this problem ? No help in the documentation... Each new version of symfony becomes more complicated. :-(
Thank you for your help.
Here's my configuration:
php: v7.3
symfony (CLI): v4.24.1
composer: v1.10.15
Maybe try to upgrade Your symfony version. For my symfony version (5.3.13) it works correctly

Symfony 6, Can't create a controller

I've installed Php 8 and I try to start coding with Symfony but I can't even create a controller.
I've created my project with:
create-project symfony/website-skeleton covid
The project was created with the version 6.1.99.
Then, in VScode, I used
symfony console make:controller Home
and it give me an error:
Parse error: syntax error, unexpected '?' in D:\Bureau\dev\covid\vendor\autoload_runtime.php on line 15
I don't understand why it's happening. Any idea ?
Edit:
It works fine if I use
php bin/console make:controller home
It seems I just can't use the symfony commands.

PhpUnit Artisan:call explode expects parameter 2 to be string

I'm trying to test a Laravel 5.1 controller with PhpUnit, for that im creating a class inheriting from TestCase, and using DatabaseTransactions and WithoutMiddleware traits.
Within the class im implementing the setUpBeforeClass method which contains:
Artisan::call('migrate:refresh');
When i try to run the test I get the following error:
1) JugadoresControllerTest::test_Index_trae_arreglo_de_jugadores
ErrorException: explode() expects parameter 2 to be string, array given
/home/vagrant/.composer/vendor/illuminate/support/helpers.php:390
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Support/Arr.php:319
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Support/Collection.php:428
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1548
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:53
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:79
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:74
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Container/Container.php:503
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Console/Command.php:150
/home/vagrant/Code/marcadores/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:259
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Console/Command.php:136
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Console/Application.php:62
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:152
/home/vagrant/Code/marcadores/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:210
/home/vagrant/Code/marcadores/tests/unit/JugadoresControllerTest.php:34
/home/vagrant/Code/marcadores/tests/unit/JugadoresControllerTest.php:34
/home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:151
/home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:103
Hope anyone can helpme!
I don't know if you ever figured this out, but I ran into a similar problem when trying to run phpunit tests under laravel 5.1. Apparently I had some out-of-date vendor builds on my global composer install (as reverenced by your error: /home/vagrant/.composer/vendor/illuminate/support/helpers.php:390)
All I did was cd to my composer directory:
cd /home/vagrant/.composer and ran composer update
This updated my global composer and everything worked as expected.

How to install mmoreramerino/GearmanBundle with Symfony 2.1.x?

I am pretty new to Symfony 2 and brand new to Gearman.
I am looking for a bundle to integrate Symfony 2 with Gearman.
mmoreramerino's bundle seems to be the most popular bundle according to packagist. Unfortunately something seems to be broken, the autoloader does not find the bundle.
Fatal error: Class 'Mmoreramerino\GearmanBundle\MmoreramerinoGearmanBundle' not found in ...
I tried switching to "dev-development" as I got from the issues that it was fixed in this branch, but it did not work for me as well.
Question: How can I install this bundle using Symfony 2.1.x?
Question 2: Are there any working & documented alternatives?
Edit In case someone else comes across this question: Here is how I got it up and running!
Install gearman, libgearman, the PECL extension for PHP (use recent versions!)
check that gearman shows up in phpinfo() (both cli and webserver version)
start gearmand in terminal 1 using "gearmand --verbose INFO" (you will see workers & clients connect to gearman - or not ;-))
start in terminal 2 reverse_worker.php from the gearman php extension example directory
start in terminal 3 reverse_client.php from the gearman php extension example directory
If this is working, you are ready for Symfony: install mmoreramerino/GearmanBundle using "dev-development"
copy dev.base.yml from the bundle to app/config/gearman/dev.yml
Now add TestWorker.php to your bundle as outlined in the documentation
enable the testWorker by using the console script "php app/console gearman:job:execute MmoreramerinoGearmanBundleWorkerstestWorker~test"
now you are able to send jobs to the listening testWorker in a Symfony controller (or somewhere else in Symfony). I had to specify the server though I am using the default host/port.
$gearman = $this->get('gearman');
$gearman->setServer('127.0.0.1',4730);
$gearman->doNormalJob('MmoreramerinoGearmanBundleWorkerstestWorker~test');
To install the bundle, you need to add the following line to composer.json
"Mmoreramerino/GearmanBundle": "dev-development"
and run composer update;
Then register it in app/AppKernel.php (it seems you have already done this)
new Mmoreramerino\GearmanBundle\MmoreramerinoGearmanBundle(),

Symfony2 Admin Generator error

I'm getting the following error while try to setup admin from console
php app/console admin:setup
symfony call to undefined method nodeBuilder::append();
#user654127 you must know which version you work with,for symfony 2.0 you use 2.0 branch and for symfony 2.1 you use the master branch,

Resources