You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -317,7 +316,7 @@ public function run_now( $args ) {
317
316
*/
318
317
publicfunctiondelete( $args ) {
319
318
320
-
$id = $args[0];
319
+
$id= $args[0];
321
320
$cron = Cron::find( $id );
322
321
323
322
if ( ! $cron ) {
@@ -332,18 +331,26 @@ public function delete( $args ) {
332
331
333
332
334
333
/**
335
-
* Returns php container name of a site
334
+
* Returns php container name of a site.
335
+
*
336
+
* @param string $site Name of the site whose container name is needed.
337
+
*
338
+
* @return string Container name.
336
339
*/
337
340
privatefunctionsite_php_container( $site ) {
341
+
338
342
returnstr_replace( '.', '', $site ) . '_php_1';
339
343
}
340
344
341
345
/**
342
-
* Ensures given command will not create problem with INI syntax
346
+
* Ensures given command will not create problem with INI syntax.
347
+
* Semicolons and Hash(#) in commands do not work for now due to limitation of INI style config ofelia uses.
348
+
* See https://github.com/EasyEngine/cron-command/issues/4.
349
+
*
350
+
* @param string $command Command whose syntax needs to be validated.
343
351
*/
344
352
privatefunctionvalidate_command( $command ) {
345
-
// Semicolons and Hash(#) in commands do not work for now due to limitation of INI style config ofelia uses
346
-
// See https://github.com/EasyEngine/cron-command/issues/4
353
+
347
354
if ( strpos( $command, ';' ) !== false ) {
348
355
EE::error( 'Command chaining using `;` - semi-colon is not supported currently. You can either use `&&` or `||` or creating a second cron job for the chained command.' );
349
356
}
@@ -352,6 +359,13 @@ private function validate_command( $command ) {
352
359
}
353
360
}
354
361
362
+
/**
363
+
* Adds wrapper of `sh -c` to execute composite commands through docker exec properly.
364
+
*
365
+
* @param string $command Passed command.
366
+
*
367
+
* @return string Command with properly added wrapper.
0 commit comments