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
@@ -318,7 +316,7 @@ public function run_now( $args ) {
318
316
*/
319
317
publicfunctiondelete( $args ) {
320
318
321
-
$id = $args[0];
319
+
$id= $args[0];
322
320
$cron = Cron::find( $id );
323
321
324
322
if ( ! $cron ) {
@@ -333,18 +331,26 @@ public function delete( $args ) {
333
331
334
332
335
333
/**
336
-
* 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.
337
339
*/
338
340
privatefunctionsite_php_container( $site ) {
341
+
339
342
returnstr_replace( '.', '', $site ) . '_php_1';
340
343
}
341
344
342
345
/**
343
-
* 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.
344
351
*/
345
352
privatefunctionvalidate_command( $command ) {
346
-
// Semicolons and Hash(#) in commands do not work for now due to limitation of INI style config ofelia uses
347
-
// See https://github.com/EasyEngine/cron-command/issues/4
353
+
348
354
if ( strpos( $command, ';' ) !== false ) {
349
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.' );
350
356
}
@@ -353,6 +359,13 @@ private function validate_command( $command ) {
353
359
}
354
360
}
355
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