Skip to content

coco-gene/pumpkinjob-php-getting-started

Repository files navigation

pumpkinjob-php-getting-started PHP Version PHP CI

PHP PumpkinJob Starter Project Template that Works Out-of-the-Box

PumpkinJob in PHP

Connecting PumpkinJob

Powered by PumpkinJob PHP Version

PumpkinJob

$pumpkinJobClient = new PumpkinJobClient($domain, $appName, $password);

$jobId = 2;
$params = array(
    "id" => $jobId,
    "jobName" => "OpenAPIJob",
    "jobDescription" => "test OpenAPI",
    "jobParams" => "ls -al",
    "timeExpressionType" => TimeExpressionType::$TYPE[TimeExpressionType::$API],
    "executeType" => ExecuteType::$TYPE[ExecuteType::$STANDALONE],
    "processorType" => ProcessorType::$TYPE[ProcessorType::$BUILT_IN],
    "processorInfo" => "com.yunqiic.pumpkinjob.official.processors.impl.script.ShellProcessor",
    "designatedWorkers" => "",
    "minCpuCores" => 1.1,
    "minMemorySpace" => 1.2,
    "minDiskSpace" => 1.3,

);
// if there is no id param it will add a new job otherwise if will modify the job
$result = $pumpkinJobClient->saveJob($params);

$result = $pumpkinJobClient->runJob($jobId);

Usage

Install

# Install make sure php is 7.4+
# curl -sS https://getcomposer.org/installer | php
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer

make install

Run

export DOMAIN=xxx
export APP_NAME=xxx
export PASSWORD=xxx

make job

Copyright & License

  • Code & Docs © 2022 PumpkinJob Contributors https://github.com/coco-gene
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons

About

pumpkinjob-php-getting-started

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published