9 Commits

Author SHA1 Message Date
Jean-Baptiste Nahan ea4d608cbb Create FUNDING.yml 2022-09-29 09:18:09 +02:00
macintoshplus ca37fe5249 fix error message 2022-09-08 09:30:20 +02:00
macintoshplus e833f4576f bump max PHP version + enable Symfony 5 2020-06-10 11:14:51 +02:00
macintoshplus 0a83a9ed09 update licence 2019-10-10 06:45:26 +02:00
macintoshplus d6b8080675 update meta informations 2019-10-10 06:32:24 +02:00
Jean-Baptiste Nahan c206c810c2 Ref #6 2019-03-19 08:26:46 +01:00
Jean-Baptiste Nahan c0b919e072 Ref #5 2019-03-19 08:19:50 +01:00
Jean-Baptiste Nahan 6527f09623 Update composer.json 2019-02-22 08:31:45 +01:00
Macintoshplus d88923e423 readme 2019-02-20 22:00:31 +01:00
6 changed files with 18 additions and 22 deletions
+1
View File
@@ -0,0 +1 @@
github: [macintoshplus]
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Win32Service
Copyright (c) 2019 Win32Service, "MacintoshPlus" <macintoshplus@mactronique.fr>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
-8
View File
@@ -47,7 +47,6 @@ win32_service:
reset_period: 86400 # The period before reset the fail count (in minutes)
dependencies: # The list of service depends
- Netman # An example of dependency.
```
# Define the runner
@@ -67,17 +66,14 @@ win32_service:
service_id: "my_service"
displayed_name: "My beautiful service"
#[...]
```
Sub-class:
```php
class MyRunner extends \Win32Service\Model\AbstractServiceRunner
{}
```
Service configuration :
@@ -89,8 +85,6 @@ services:
- { name: win32service.runner, alias: 'my_service'}
```
## Exemple with many thread
Extension configuration:
@@ -189,5 +183,3 @@ For sent the action for one thread of one service (work same if the service has
```bash
php bin\console win32service:action start --service-name=my_service_1
```
+10 -7
View File
@@ -1,11 +1,14 @@
{
"name": "win32service/win32servicebundle",
"type": "symfony-bundle",
"description": "Bundle for integrate the win32service/service-library into a Symfony Project",
"keywords": ["win32service", "service", "windows", "service manager", "symfony", "bundle"],
"homepage": "https://win32service.mactronique.fr/bundle.html",
"license": "MIT",
"authors": [
{
"name": "Jean-Baptiste Nahan",
"email": "jean-baptiste@nahan.fr",
"name": "MacintoshPlus",
"email": "macintoshplus@mactronique.fr",
"homepage": "https://win32service.github.io",
"role": "Lead Dev"
}
@@ -22,12 +25,12 @@
},
"minimum-stability": "beta",
"require": {
"php": "^7.1.0 <7.4.0",
"php": "^7.1.0 <8.0.0",
"win32service/service-library": "^0.1.0",
"symfony/http-kernel": "^4.0",
"symfony/console": "^4.0",
"symfony/config": "^4.0",
"symfony/dependency-injection": "^4.0"
"symfony/http-kernel": "^4.0||^5.0",
"symfony/console": "^4.0||^5.0",
"symfony/config": "^4.0||^5.0",
"symfony/dependency-injection": "^4.0||^5.0"
},
"require-dev": {
"atoum/atoum": "^3.3"
+2 -2
View File
@@ -89,7 +89,7 @@ class ExecuteServiceCommand extends Command
$runner = $this->service->getRunner($infos['service_id']);
if ($runner === null) {
throw new \Exception(sprintf('The runner for service "%1$s" is not found. Add tag "win32service.runner" with alias "%1$s" at the service runner service', $infos['service_id']));
throw new \Exception(sprintf('The runner for service "%1$s" is not found. Call method \'add\' on the RunnerManager with the runner instance and the alias "%1$s".', $infos['service_id']));
}
if ($this->eventDispatcher !== null) {
@@ -101,7 +101,7 @@ class ExecuteServiceCommand extends Command
$runner->defineExitModeAndCode($infos['exit']['graceful'], $infos['exit']['code']);
$runner->doRun($maxRun, $threadNumber);
$runner->doRun(intval($maxRun), $threadNumber);
}
+4 -4
View File
@@ -37,8 +37,8 @@ class Configuration implements ConfigurationInterface
->scalarNode('displayed_name')->isRequired()->cannotBeEmpty()->end()
->scalarNode('script_path')->defaultNull()->end()
->scalarNode('script_params')->defaultValue('')->end()
->integerNode('run_max')->defaultValue(1000)->end()
->integerNode('thread_count')->defaultValue(1)->end()
->integerNode('run_max')->defaultValue(1000)->min(-1)->end()
->integerNode('thread_count')->defaultValue(1)->min(1)->end()
->scalarNode('description')->defaultValue('')->end()
->booleanNode('delayed_start')->defaultFalse()->end()
->arrayNode('exit')
@@ -59,7 +59,7 @@ class Configuration implements ConfigurationInterface
->addDefaultsIfNotSet()
->children()
->booleanNode('enable')->defaultFalse()->end()
->integerNode('delay')->defaultValue(60000)->end()
->integerNode('delay')->defaultValue(60000)->min(100)->end()
->enumNode('action1')
->values([WIN32_SC_ACTION_NONE, WIN32_SC_ACTION_REBOOT, WIN32_SC_ACTION_RESTART, WIN32_SC_ACTION_RUN_COMMAND])
->defaultValue(WIN32_SC_ACTION_NONE)
@@ -74,7 +74,7 @@ class Configuration implements ConfigurationInterface
->end()
->scalarNode('reboot_msg')->defaultValue("")->end()
->scalarNode('command')->defaultValue("")->end()
->integerNode('reset_period')->defaultValue(86400)->end()
->integerNode('reset_period')->defaultValue(86400)->min(1)->end()
->end()
->end()
->arrayNode('dependencies')