mirror of
https://github.com/win32service/Win32ServiceBundle.git
synced 2026-04-29 20:13:09 +02:00
Compare commits
9 Commits
v0.1.0-RC1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ea4d608cbb | |||
| ca37fe5249 | |||
| e833f4576f | |||
| 0a83a9ed09 | |||
| d6b8080675 | |||
| c206c810c2 | |||
| c0b919e072 | |||
| 6527f09623 | |||
| d88923e423 |
@@ -0,0 +1 @@
|
||||
github: [macintoshplus]
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user