Bearsampp 2026.9.23
Loading...
Searching...
No Matches
Nssm Class Reference

Public Member Functions

 __construct ($name)
 create ()
 delete ()
 getBinPath ()
 getDisplayName ()
 getEnvironmentExtra ()
 getError ()
 getLatestError ()
 getLatestStatus ()
 getName ()
 getParams ()
 getStart ()
 getStderr ()
 getStdout ()
 infos ()
 isInstalled ()
 isPaused ()
 isPending ($status)
 isRunning ()
 isStopped ()
 restart ()
 setBinPath ($binPath)
 setDisplayName ($displayName)
 setEnvironmentExtra ($environmentExtra)
 setName ($name)
 setParams ($params)
 setStart ($start)
 setStderr ($stderr)
 setStdout ($stdout)
 start ()
 status ($timeout=true)
 stop ()

Data Fields

const INFO_APP_DIRECTORY = 'AppDirectory'
const INFO_APP_ENVIRONMENT_EXTRA = 'AppEnvironmentExtra'
const INFO_APP_PARAMETERS = 'AppParameters'
const INFO_APP_STDERR = 'AppStderr'
const INFO_APP_STDOUT = 'AppStdout'
const INFO_APPLICATION = 'Application'
const PENDING_TIMEOUT = 10
const SERVICE_AUTO_START = 'SERVICE_AUTO_START'
const SERVICE_DELAYED_START = 'SERVICE_DELAYED_START'
const SERVICE_DEMAND_START = 'SERVICE_DEMAND_START'
const SERVICE_DISABLED = 'SERVICE_DISABLED'
const SERVICE_INTERACTIVE_PROCESS = 'SERVICE_INTERACTIVE_PROCESS'
const SERVICE_WIN32_OWN_PROCESS = 'SERVICE_WIN32_OWN_PROCESS'
const SLEEP_TIME = 100000
const STATUS_CONTINUE_PENDING = 'SERVICE_CONTINUE_PENDING'
const STATUS_NA = '-1'
const STATUS_NOT_EXIST = 'SERVICE_NOT_EXIST'
const STATUS_PAUSE_PENDING = 'SERVICE_PAUSE_PENDING'
const STATUS_PAUSED = 'SERVICE_PAUSED'
const STATUS_RUNNING = 'SERVICE_RUNNING'
const STATUS_START_PENDING = 'SERVICE_START_PENDING'
const STATUS_STOP_PENDING = 'SERVICE_STOP_PENDING'
const STATUS_STOPPED = 'SERVICE_STOPPED'

Private Member Functions

 exec ($args)
 getServiceStatusDesc ($status)
 writeLog ($log)
 writeLogError ($log)
 writeLogInfo ($log)

Private Attributes

 $binPath
 $displayName
 $environmentExtra
 $latestError
 $latestStatus
 $name
 $params
 $start
 $stderr
 $stdout

Detailed Description

Class Nssm

This class provides methods to manage Windows services using NSSM (Non-Sucking Service Manager). It includes functionalities to create, delete, start, stop, and retrieve the status of services. The class also logs operations and errors.

Definition at line 17 of file class.nssm.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( $name)

Nssm constructor. Initializes the Nssm class and logs the initialization.

Parameters
string$nameThe name of the service.

Definition at line 68 of file class.nssm.php.

69 {
70 Log::initClass($this);
71 $this->name = $name;
72 }
static initClass($classInstance)

References $name, and Log\initClass().

Here is the call graph for this function:

Member Function Documentation

◆ create()

create ( )

Creates a new service.

Returns
bool True if the service was created successfully, false otherwise.

Definition at line 185 of file class.nssm.php.

186 {
187 $this->writeLog('Create service');
188 $this->writeLog('-> service: ' . $this->getName());
189 $this->writeLog('-> display: ' . $this->getDisplayName());
190 $this->writeLog('-> description: ' . $this->getDisplayName());
191 $this->writeLog('-> path: ' . $this->getBinPath());
192 $this->writeLog('-> params: ' . $this->getParams());
193 $this->writeLog('-> stdout: ' . $this->getStdout());
194 $this->writeLog('-> stderr: ' . $this->getStderr());
195 $this->writeLog('-> environment extra: ' . $this->getEnvironmentExtra());
196 $this->writeLog('-> start_type: ' . ($this->getStart() != null ? $this->getStart() : self::SERVICE_DEMAND_START));
197
198 // Install bin
199 $exec = $this->exec('install ' . $this->getName() . ' "' . $this->getBinPath() . '"');
200 if ($exec === false) {
201 return false;
202 }
203
204 // Params
205 $exec = $this->exec('set ' . $this->getName() . ' AppParameters "' . $this->getParams() . '"');
206 if ($exec === false) {
207 return false;
208 }
209
210 // DisplayName
211 $exec = $this->exec('set ' . $this->getName() . ' DisplayName "' . $this->getDisplayName() . '"');
212 if ($exec === false) {
213 return false;
214 }
215
216 // Description
217 $exec = $this->exec('set ' . $this->getName() . ' Description "' . $this->getDisplayName() . '"');
218 if ($exec === false) {
219 return false;
220 }
221
222 // No AppNoConsole to fix nssm problems with Windows 10 Creators update.
223 $exec = $this->exec('set ' . $this->getName() . ' AppNoConsole "1"');
224 if ($exec === false) {
225 return false;
226 }
227
228 // Start
229 $exec = $this->exec('set ' . $this->getName() . ' Start "' . ($this->getStart() != null ? $this->getStart() : self::SERVICE_DEMAND_START) . '"');
230 if ($exec === false) {
231 return false;
232 }
233
234 // Stdout
235 $exec = $this->exec('set ' . $this->getName() . ' AppStdout "' . $this->getStdout() . '"');
236 if ($exec === false) {
237 return false;
238 }
239
240 // Stderr
241 $exec = $this->exec('set ' . $this->getName() . ' AppStderr "' . $this->getStderr() . '"');
242 if ($exec === false) {
243 return false;
244 }
245
246 // Environment Extra
247 $exec = $this->exec('set ' . $this->getName() . ' AppEnvironmentExtra ' . $this->getEnvironmentExtra());
248 if ($exec === false) {
249 return false;
250 }
251
252 if (!$this->isInstalled()) {
253 $this->latestError = null;
254
255 return false;
256 }
257
258 return true;
259 }
getDisplayName()
writeLog($log)
getStdout()
getName()
exec($args)
getStderr()
getStart()
getEnvironmentExtra()
getBinPath()
getParams()
isInstalled()

References exec(), getBinPath(), getDisplayName(), getEnvironmentExtra(), getName(), getParams(), getStart(), getStderr(), getStdout(), isInstalled(), and writeLog().

Here is the call graph for this function:

◆ delete()

delete ( )

Deletes the service.

Returns
bool True if the service was deleted successfully, false otherwise.

Definition at line 266 of file class.nssm.php.

267 {
268 $this->stop();
269
270 $this->writeLog('Delete service ' . $this->getName());
271 $exec = $this->exec('remove ' . $this->getName() . ' confirm');
272 if ($exec === false) {
273 return false;
274 }
275
276 if ($this->isInstalled()) {
277 $this->latestError = null;
278
279 return false;
280 }
281
282 return true;
283 }

References exec(), getName(), isInstalled(), stop(), and writeLog().

Here is the call graph for this function:

◆ exec()

exec ( $args)
private

Executes an NSSM command.

Parameters
string$argsThe arguments for the NSSM command.
Returns
array|false The result of the execution, or false on failure.

Definition at line 114 of file class.nssm.php.

115 {
116 global $bearsamppCore;
117
118 $command = '"' . Path::getNssmExe() . '" ' . $args;
119 $this->writeLogInfo('Cmd: ' . $command);
120
121 $result = Batch::exec('nssm', $command, 10);
122 if (is_array($result)) {
123 $rebuildResult = array();
124 foreach ($result as $row) {
125 $row = trim($row);
126 if (!empty($row)) {
127 $rebuildResult[] = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $row);
128 }
129 }
130 $result = $rebuildResult;
131 if (count($result) > 1) {
132 $this->latestError = implode(' ; ', $result);
133 }
134
135 return $result;
136 }
137
138 return false;
139 }
$result
global $bearsamppCore
static exec($basename, $content, $timeout=true, $catchOutput=true, $standalone=false, $silent=true, $rebuild=true)
writeLogInfo($log)
static getNssmExe($aetrayPath=false)
if( $raw) foreach($opts as $opt) if( $store_system_config) if($store_user_config) $command
Definition pearcmd.php:322

References $bearsamppCore, $command, $result, Batch\exec(), Path\getNssmExe(), and writeLogInfo().

Referenced by create(), delete(), start(), status(), and stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBinPath()

getBinPath ( )

Gets the binary path of the service.

Returns
string The binary path of the service.

Definition at line 540 of file class.nssm.php.

541 {
542 return $this->binPath;
543 }

References $binPath.

Referenced by create().

Here is the caller graph for this function:

◆ getDisplayName()

getDisplayName ( )

Gets the display name of the service.

Returns
string The display name of the service.

Definition at line 520 of file class.nssm.php.

521 {
522 return $this->displayName;
523 }
$displayName

References $displayName.

Referenced by create().

Here is the caller graph for this function:

◆ getEnvironmentExtra()

getEnvironmentExtra ( )

Gets the additional environment variables for the service.

Returns
string The additional environment variables.

Definition at line 640 of file class.nssm.php.

641 {
643 }
$environmentExtra

References $environmentExtra.

Referenced by create().

Here is the caller graph for this function:

◆ getError()

getError ( )

Retrieves the error message or status description of the service.

Returns
string|null The error message or status description, or null if no error or status is available.

Definition at line 680 of file class.nssm.php.

681 {
682 global $bearsamppLang;
683
684 if (!empty($this->latestError)) {
685 return $bearsamppLang->getValue(Lang::ERROR) . ' ' . $this->latestError;
686 } elseif ($this->latestStatus != self::STATUS_NA) {
687 return $bearsamppLang->getValue(Lang::STATUS) . ' ' . $this->latestStatus . ' : ' . $this->getWin32ServiceStatusDesc($this->latestStatus);
688 }
689
690 return null;
691 }
global $bearsamppLang
const ERROR
const STATUS
$latestError

References $bearsamppLang, $latestError, Lang\ERROR, and Lang\STATUS.

◆ getLatestError()

getLatestError ( )

Gets the latest error message related to the service.

Returns
string The latest error message.

Definition at line 670 of file class.nssm.php.

671 {
672 return $this->latestError;
673 }

References $latestError.

◆ getLatestStatus()

getLatestStatus ( )

Gets the latest status of the service.

Returns
string The latest status of the service.

Definition at line 660 of file class.nssm.php.

661 {
662 return $this->latestStatus;
663 }
$latestStatus

References $latestStatus.

◆ getName()

getName ( )

Gets the name of the service.

Returns
string The name of the service.

Definition at line 500 of file class.nssm.php.

501 {
502 return $this->name;
503 }

References $name.

Referenced by create(), delete(), infos(), isInstalled(), isPaused(), isRunning(), isStopped(), start(), status(), and stop().

Here is the caller graph for this function:

◆ getParams()

getParams ( )

Gets the parameters of the service.

Returns
string The parameters of the service.

Definition at line 560 of file class.nssm.php.

561 {
562 return $this->params;
563 }

References $params.

Referenced by create().

Here is the caller graph for this function:

◆ getServiceStatusDesc()

getServiceStatusDesc ( $status)
private

Retrieves the description of the service status.

Parameters
string$statusThe status to describe.
Returns
string|null The description of the status, or null if not recognized.

Definition at line 463 of file class.nssm.php.

464 {
465 switch ($status) {
466 case self::STATUS_CONTINUE_PENDING:
467 return 'The service continue is pending.';
468
469 case self::STATUS_PAUSE_PENDING:
470 return 'The service pause is pending.';
471
472 case self::STATUS_PAUSED:
473 return 'The service is paused.';
474
475 case self::STATUS_RUNNING:
476 return 'The service is running.';
477
478 case self::STATUS_START_PENDING:
479 return 'The service is starting.';
480
481 case self::STATUS_STOP_PENDING:
482 return 'The service is stopping.';
483
484 case self::STATUS_STOPPED:
485 return 'The service is not running.';
486
487 case self::STATUS_NA:
488 return 'Cannot retrieve service status.';
489
490 default:
491 return null;
492 }
493 }

◆ getStart()

getStart ( )

Gets the start type of the service.

Returns
string The start type of the service.

Definition at line 580 of file class.nssm.php.

581 {
582 return $this->start;
583 }

References $start.

Referenced by create().

Here is the caller graph for this function:

◆ getStderr()

getStderr ( )

Gets the stderr path of the service.

Returns
string The stderr path of the service.

Definition at line 620 of file class.nssm.php.

621 {
622 return $this->stderr;
623 }

References $stderr.

Referenced by create().

Here is the caller graph for this function:

◆ getStdout()

getStdout ( )

Gets the stdout path of the service.

Returns
string The stdout path of the service.

Definition at line 600 of file class.nssm.php.

601 {
602 return $this->stdout;
603 }

References $stdout.

Referenced by create().

Here is the caller graph for this function:

◆ infos()

infos ( )

Retrieves information about the service.

Returns
array|false The service information, or false on failure.

Definition at line 350 of file class.nssm.php.

351 {
352 global $bearsamppRegistry;
353
354 $infos = Win32Native::getServiceInfo($this->getName());
355 if ($infos === false) {
356 return false;
357 }
358
359 $infosNssm = array();
360 $infosKeys = array(
361 self::INFO_APPLICATION,
362 self::INFO_APP_PARAMETERS,
363 );
364
365 foreach ($infosKeys as $infoKey) {
366 $value = null;
367 $exists = $bearsamppRegistry->exists(
369 'SYSTEM\CurrentControlSet\Services\\' . $this->getName() . '\Parameters',
370 $infoKey
371 );
372 if ($exists) {
373 $value = $bearsamppRegistry->getValue(
375 'SYSTEM\CurrentControlSet\Services\\' . $this->getName() . '\Parameters',
376 $infoKey
377 );
378 }
379 $infosNssm[$infoKey] = $value;
380 }
381
382 if (!isset($infosNssm[self::INFO_APPLICATION])) {
383 return $infos;
384 }
385
386 $infos[Win32Service::VBS_PATH_NAME] = $infosNssm[Nssm::INFO_APPLICATION] . ' ' . $infosNssm[Nssm::INFO_APP_PARAMETERS];
387
388 return $infos;
389 }
const INFO_APP_PARAMETERS
const INFO_APPLICATION
const HKEY_LOCAL_MACHINE
static getServiceInfo($serviceName, $properties=[])

References getName(), Win32Native\getServiceInfo(), Registry\HKEY_LOCAL_MACHINE, INFO_APP_PARAMETERS, INFO_APPLICATION, and Win32Service\VBS_PATH_NAME.

Here is the call graph for this function:

◆ isInstalled()

isInstalled ( )

Checks if the service is installed.

Returns
bool True if the service is installed, false otherwise.

Definition at line 396 of file class.nssm.php.

397 {
398 $status = $this->status();
399 $this->writeLog('isInstalled ' . $this->getName() . ': ' . ($status != self::STATUS_NA ? 'YES' : 'NO') . ' (status: ' . $status . ')');
400
401 return $status != self::STATUS_NA;
402 }
status($timeout=true)

References getName(), status(), and writeLog().

Referenced by create(), and delete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPaused()

isPaused ( )

Checks if the service is paused.

Returns
bool True if the service is paused, false otherwise.

Definition at line 435 of file class.nssm.php.

436 {
437 $status = $this->status();
438 $this->writeLog('isPaused ' . $this->getName() . ': ' . ($status == self::STATUS_PAUSED ? 'YES' : 'NO') . ' (status: ' . $status . ')');
439
440 return $status == self::STATUS_PAUSED;
441 }

References getName(), status(), and writeLog().

Here is the call graph for this function:

◆ isPending()

isPending ( $status)

Checks if the service status is pending.

Parameters
string$statusThe status to check.
Returns
bool True if the status is pending, false otherwise.

Definition at line 450 of file class.nssm.php.

451 {
452 return $status == self::STATUS_START_PENDING || $status == self::STATUS_STOP_PENDING
453 || $status == self::STATUS_CONTINUE_PENDING || $status == self::STATUS_PAUSE_PENDING;
454 }

Referenced by status().

Here is the caller graph for this function:

◆ isRunning()

isRunning ( )

Checks if the service is running.

Returns
bool True if the service is running, false otherwise.

Definition at line 409 of file class.nssm.php.

410 {
411 $status = $this->status();
412 $this->writeLog('isRunning ' . $this->getName() . ': ' . ($status == self::STATUS_RUNNING ? 'YES' : 'NO') . ' (status: ' . $status . ')');
413
414 return $status == self::STATUS_RUNNING;
415 }

References getName(), status(), and writeLog().

Referenced by start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isStopped()

isStopped ( )

Checks if the service is stopped.

Returns
bool True if the service is stopped, false otherwise.

Definition at line 422 of file class.nssm.php.

423 {
424 $status = $this->status();
425 $this->writeLog('isStopped ' . $this->getName() . ': ' . ($status == self::STATUS_STOPPED ? 'YES' : 'NO') . ' (status: ' . $status . ')');
426
427 return $status == self::STATUS_STOPPED;
428 }

References getName(), status(), and writeLog().

Referenced by stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restart()

restart ( )

Restarts the service.

Returns
bool True if the service was restarted successfully, false otherwise.

Definition at line 336 of file class.nssm.php.

337 {
338 if ($this->stop()) {
339 return $this->start();
340 }
341
342 return false;
343 }

References start(), and stop().

Here is the call graph for this function:

◆ setBinPath()

setBinPath ( $binPath)

Sets the binary path of the service.

Parameters
string$binPathThe binary path to set.

Definition at line 550 of file class.nssm.php.

551 {
552 $this->binPath = str_replace('"', '', Path::formatWindowsPath($binPath));
553 }
static formatWindowsPath($path)

References $binPath, and Path\formatWindowsPath().

Here is the call graph for this function:

◆ setDisplayName()

setDisplayName ( $displayName)

Sets the display name of the service.

Parameters
string$displayNameThe display name to set.

Definition at line 530 of file class.nssm.php.

531 {
532 $this->displayName = $displayName;
533 }

References $displayName.

◆ setEnvironmentExtra()

setEnvironmentExtra ( $environmentExtra)

Sets the additional environment variables for the service.

Parameters
string$environmentExtraThe additional environment variables to set.

Definition at line 650 of file class.nssm.php.

651 {
652 $this->environmentExtra = Path::formatWindowsPath($environmentExtra);
653 }

References $environmentExtra, and Path\formatWindowsPath().

Here is the call graph for this function:

◆ setName()

setName ( $name)

Sets the name of the service.

Parameters
string$nameThe name to set.

Definition at line 510 of file class.nssm.php.

511 {
512 $this->name = $name;
513 }

References $name.

◆ setParams()

setParams ( $params)

Sets the parameters of the service.

Parameters
string$paramsThe parameters to set.

Definition at line 570 of file class.nssm.php.

571 {
572 $this->params = $params;
573 }

References $params.

◆ setStart()

setStart ( $start)

Sets the start type of the service.

Parameters
string$startThe start type to set.

Definition at line 590 of file class.nssm.php.

591 {
592 $this->start = $start;
593 }

References $start, and start().

Here is the call graph for this function:

◆ setStderr()

setStderr ( $stderr)

Sets the stderr path of the service.

Parameters
string$stderrThe stderr path to set.

Definition at line 630 of file class.nssm.php.

631 {
632 $this->stderr = $stderr;
633 }

References $stderr.

◆ setStdout()

setStdout ( $stdout)

Sets the stdout path of the service.

Parameters
string$stdoutThe stdout path to set.

Definition at line 610 of file class.nssm.php.

611 {
612 $this->stdout = $stdout;
613 }

References $stdout.

◆ start()

start ( )

Starts the service.

Returns
bool True if the service was started successfully, false otherwise.

Definition at line 290 of file class.nssm.php.

291 {
292 $this->writeLog('Start service ' . $this->getName());
293
294 $exec = $this->exec('start ' . $this->getName());
295 if ($exec === false) {
296 return false;
297 }
298
299 if (!$this->isRunning()) {
300 $this->latestError = null;
301
302 return false;
303 }
304
305 return true;
306 }
isRunning()

References exec(), getName(), isRunning(), and writeLog().

Referenced by restart(), and setStart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ status()

status ( $timeout = true)

Retrieves the status of the service.

Parameters
bool$timeoutWhether to apply a timeout for the status check.
Returns
string The status of the service.

Definition at line 148 of file class.nssm.php.

149 {
150 $this->latestStatus = self::STATUS_NA;
151 $maxtime = time() + self::PENDING_TIMEOUT;
152
153 while ($this->latestStatus == self::STATUS_NA || $this->isPending($this->latestStatus)) {
154 $exec = $this->exec('status ' . $this->getName());
155 if ($exec !== false) {
156 if (count($exec) > 1) {
157 $this->latestStatus = self::STATUS_NOT_EXIST;
158 } else {
159 $this->latestStatus = $exec[0];
160 }
161 }
162 if ($timeout && $maxtime < time()) {
163 break;
164 }
165
166 // Only sleep if we're going to loop again
167 if ($this->latestStatus == self::STATUS_NA || $this->isPending($this->latestStatus)) {
168 usleep(self::SLEEP_TIME);
169 }
170 }
171
172 if ($this->latestStatus == self::STATUS_NOT_EXIST) {
173 $this->latestError = 'Error 3: The specified service does not exist as an installed service.';
174 $this->latestStatus = self::STATUS_NA;
175 }
176
177 return $this->latestStatus;
178 }
isPending($status)

References $latestStatus, exec(), getName(), and isPending().

Referenced by isInstalled(), isPaused(), isRunning(), and isStopped().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

stop ( )

Stops the service.

Returns
bool True if the service was stopped successfully, false otherwise.

Definition at line 313 of file class.nssm.php.

314 {
315 $this->writeLog('Stop service ' . $this->getName());
316
317 $exec = $this->exec('stop ' . $this->getName());
318 if ($exec === false) {
319 return false;
320 }
321
322 if (!$this->isStopped()) {
323 $this->latestError = null;
324
325 return false;
326 }
327
328 return true;
329 }
isStopped()

References exec(), getName(), isStopped(), and writeLog().

Referenced by delete(), and restart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLog()

writeLog ( $log)
private

Writes a log entry.

Parameters
string$logThe log message to write.

Definition at line 79 of file class.nssm.php.

80 {
81 global $bearsamppRoot;
83 }
global $bearsamppRoot
static debug($data, $file=null)
static getNssmLogFilePath($aetrayPath=false)

References $bearsamppRoot, Log\debug(), and Path\getNssmLogFilePath().

Referenced by create(), delete(), isInstalled(), isPaused(), isRunning(), isStopped(), start(), and stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeLogError()

writeLogError ( $log)
private

Writes an error log entry.

Parameters
string$logThe log message to write.

Definition at line 101 of file class.nssm.php.

102 {
103 global $bearsamppRoot;
105 }
static error($data, $file=null)

References $bearsamppRoot, Log\error(), and Path\getNssmLogFilePath().

Here is the call graph for this function:

◆ writeLogInfo()

writeLogInfo ( $log)
private

Writes an informational log entry.

Parameters
string$logThe log message to write.

Definition at line 90 of file class.nssm.php.

91 {
92 global $bearsamppRoot;
94 }
static info($data, $file=null)

References $bearsamppRoot, Path\getNssmLogFilePath(), and Log\info().

Referenced by exec().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ $binPath

$binPath
private

Definition at line 53 of file class.nssm.php.

Referenced by getBinPath(), and setBinPath().

◆ $displayName

$displayName
private

Definition at line 52 of file class.nssm.php.

Referenced by getDisplayName(), and setDisplayName().

◆ $environmentExtra

$environmentExtra
private

Definition at line 58 of file class.nssm.php.

Referenced by getEnvironmentExtra(), and setEnvironmentExtra().

◆ $latestError

$latestError
private

Definition at line 59 of file class.nssm.php.

Referenced by getError(), and getLatestError().

◆ $latestStatus

$latestStatus
private

Definition at line 60 of file class.nssm.php.

Referenced by getLatestStatus(), and status().

◆ $name

$name
private

Definition at line 51 of file class.nssm.php.

Referenced by __construct(), getName(), and setName().

◆ $params

$params
private

Definition at line 54 of file class.nssm.php.

Referenced by getParams(), and setParams().

◆ $start

$start
private

Definition at line 55 of file class.nssm.php.

Referenced by getStart(), and setStart().

◆ $stderr

$stderr
private

Definition at line 57 of file class.nssm.php.

Referenced by getStderr(), and setStderr().

◆ $stdout

$stdout
private

Definition at line 56 of file class.nssm.php.

Referenced by getStdout(), and setStdout().

◆ INFO_APP_DIRECTORY

const INFO_APP_DIRECTORY = 'AppDirectory'

Definition at line 41 of file class.nssm.php.

◆ INFO_APP_ENVIRONMENT_EXTRA

const INFO_APP_ENVIRONMENT_EXTRA = 'AppEnvironmentExtra'

Definition at line 46 of file class.nssm.php.

◆ INFO_APP_PARAMETERS

const INFO_APP_PARAMETERS = 'AppParameters'

◆ INFO_APP_STDERR

const INFO_APP_STDERR = 'AppStderr'

Definition at line 44 of file class.nssm.php.

◆ INFO_APP_STDOUT

const INFO_APP_STDOUT = 'AppStdout'

Definition at line 45 of file class.nssm.php.

◆ INFO_APPLICATION

const INFO_APPLICATION = 'Application'

Definition at line 42 of file class.nssm.php.

Referenced by infos().

◆ PENDING_TIMEOUT

const PENDING_TIMEOUT = 10

Definition at line 48 of file class.nssm.php.

◆ SERVICE_AUTO_START

const SERVICE_AUTO_START = 'SERVICE_AUTO_START'

Definition at line 20 of file class.nssm.php.

◆ SERVICE_DELAYED_START

const SERVICE_DELAYED_START = 'SERVICE_DELAYED_START'

Definition at line 21 of file class.nssm.php.

◆ SERVICE_DEMAND_START

const SERVICE_DEMAND_START = 'SERVICE_DEMAND_START'

◆ SERVICE_DISABLED

const SERVICE_DISABLED = 'SERVICE_DISABLED'

Definition at line 23 of file class.nssm.php.

◆ SERVICE_INTERACTIVE_PROCESS

const SERVICE_INTERACTIVE_PROCESS = 'SERVICE_INTERACTIVE_PROCESS'

Definition at line 27 of file class.nssm.php.

◆ SERVICE_WIN32_OWN_PROCESS

const SERVICE_WIN32_OWN_PROCESS = 'SERVICE_WIN32_OWN_PROCESS'

Definition at line 26 of file class.nssm.php.

◆ SLEEP_TIME

const SLEEP_TIME = 100000

Definition at line 49 of file class.nssm.php.

◆ STATUS_CONTINUE_PENDING

const STATUS_CONTINUE_PENDING = 'SERVICE_CONTINUE_PENDING'

Definition at line 30 of file class.nssm.php.

◆ STATUS_NA

const STATUS_NA = '-1'

Definition at line 38 of file class.nssm.php.

◆ STATUS_NOT_EXIST

const STATUS_NOT_EXIST = 'SERVICE_NOT_EXIST'

Definition at line 37 of file class.nssm.php.

◆ STATUS_PAUSE_PENDING

const STATUS_PAUSE_PENDING = 'SERVICE_PAUSE_PENDING'

Definition at line 31 of file class.nssm.php.

◆ STATUS_PAUSED

const STATUS_PAUSED = 'SERVICE_PAUSED'

Definition at line 32 of file class.nssm.php.

◆ STATUS_RUNNING

const STATUS_RUNNING = 'SERVICE_RUNNING'

Definition at line 33 of file class.nssm.php.

◆ STATUS_START_PENDING

const STATUS_START_PENDING = 'SERVICE_START_PENDING'

Definition at line 34 of file class.nssm.php.

◆ STATUS_STOP_PENDING

const STATUS_STOP_PENDING = 'SERVICE_STOP_PENDING'

Definition at line 35 of file class.nssm.php.

◆ STATUS_STOPPED

const STATUS_STOPPED = 'SERVICE_STOPPED'

Definition at line 36 of file class.nssm.php.


The documentation for this class was generated from the following file: