knplabs / consoleserviceprovider Goto Github PK
View Code? Open in Web Editor NEWA Console service provider for Silex
License: MIT License
A Console service provider for Silex
License: MIT License
Is it possible to have a tagged version to avoid depending on dev-master
in our composer.json
file?
Thanks a lot
Good Day, I am interested in maintaining this product. Please assist?
You must implements the new ServiceProviderInterface::boot
https://github.com/fabpot/Silex/blob/master/src/Silex/ServiceProviderInterface.php
should use Pimple\ServiceProviderInterface
AFAIK, there are no incompatible API changes related to ConsoleServiceProvider in symfony/console v. 3. So, maybe just change "~2.1"
in composer.json
to ">2.1"
?
I have a script using the ConsoleServiceProvider and I want it to auto run a command when I run it.
$app->register(new ConsoleServiceProvider(),
array('console.name' => 'ScanJobs',
'console.version' => '1.0.0',
'console.project_directory' => __DIR__.'/..'));
$application = $app['console'];
$x = new ScanJobsCommand();
$x->addGeocodeer(new Geocode());
$application->add($x);
$application->run();
When run is called, I want it to execute a specific command. Is there a way to do this? right now I call the script with a parameter and it works fine. I just want to eliminate the parameter.
=C=
I need it for legal stuff...
Those lawyers...
When using silex 2.0 and registering the ConsoleServiceProvider I get the following error: "Interface 'Silex\ServiceProviderInterface' not found in /vagrant/vendor/knplabs/console-service-provider/Knp/Provider/ConsoleServiceProvider.php on line 13"
Upon further investigation it seems the providers are using the Pimple/ServiceProviderInterface and the Silex/ServiceProviderInterface class does not exist.
Is there something I am missing or is this an update that needs to be done due to updates in the silex framework?
ConsoleServiceProvider must be registered last, because it boots silex application providers.
I want to use \Kurl\Silex\Provider\DoctrineMigrationsProvider
for migrations. This provider require Console application, so i add it:
<?php
$app->register(new ConsoleServiceProvider(), array(
'console.name' => 'app',
'console.version' => '1.0.0',
'console.project_directory' => __DIR__
));
// at this moment all previders registered in silex app are booted
$app->register(
new \Kurl\Silex\Provider\DoctrineMigrationsProvider($app['console']),
array(
'migrations.directory' => __DIR__ . '/../migrations',
'migrations.name' => 'app',
'migrations.namespace' => 'App\Migrations',
'migrations.table_name' => 'migrations',
)
);
// at this moment to late to register anything. Application already booted
Right now this project only supports symfony/console 2.1.*
. Would be nice to see it support 2.3.*@
. I'll send it a pull request if I get time.
Cheers.
The console application lacks the call to the terminate() method.
Something like ๐
terminate(Request::createFromGlobals(), Response::create());
the terminate methode trogger the event dispather wich is used by many component like swift mailer (ie to spool mail queue).
Hi,
I use Symfony 3.4 and the pull request #40 solve a bug. I prefer do not have an @dev
in the composer.json
before send new version into production.
Can you release a new minor version? Please.
Thanks in advance and thanks for this good library.
Fatal error: Uncaught Symfony\Component\Console\Exception\LogicException: The command defined in "Knp\Command\Twig\DebugCommand" cannot have an empty name.
Seems this project is unmaintained, you might want to change the description and abbandon it on packagist.org.
I started a new forkoff here https://github.com/ivoba/console-service-provider
Hi,
is there any way to handle "ConsoleExceptionEvent" similar to Symfony commands: http://symfony.com/doc/current/console/logging.html ?
the following is my console code, but when I try to run this code I'm getting the error that $application is non-object. I tried in many other ways but same issue, Tried to dump $application giving me a knp command object. Please tell me whats wrong with my code.
PHP Fatal error: Uncaught Symfony\Component\Console\Exception\LogicException: The command defined in "Knp\Command\Twig\DebugCommand" cannot have an empty name. in /var/www/yourist/vendor/symfony/console/Application.php:450
Stack trace:
#0 /var/www/yourist/vendor/knplabs/console-service-provider/Knp/Provider/ConsoleServiceProvider.php(49): Symfony\Component\Console\Application->add(Object(Knp\Command\Twig\DebugCommand))
#1 /var/www/yourist/vendor/pimple/pimple/src/Pimple/Container.php(118): Knp\Provider\ConsoleServiceProvider->Knp\Provider\{closure}(Object(Silex\Application))
#2 /var/www/yourist/app/bootstrap/bootstrap-cli.php(36): Pimple\Container->offsetGet('console')
#3 /var/www/yourist/bin/run(11): require('/var/www/youris...')
#4 {main}
thrown in /var/www/yourist/vendor/symfony/console/Application.php on line 450
I have such an issue, when i run composer update
Or provide example here and i will send PR to update README.md
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.