Skip to content

Commit 7bca30f

Browse files
committed
Merge branch 'kirtangajjar-add-cron' into develop-v4
2 parents 39113a4 + dc5cfee commit 7bca30f

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

php/class-ee-db.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ public static function create() {
8181
FOREIGN KEY (id) REFERENCES sites(id)
8282
);";
8383

84+
$query .= "CREATE TABLE cron (
85+
id INTEGER PRIMARY KEY AUTOINCREMENT,
86+
sitename VARCHAR,
87+
command VARCHAR,
88+
schedule VARCHAR,
89+
);";
90+
8491
self::$db->exec( $query );
8592
}
8693

php/class-ee-docker.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,28 @@ public static function start_container( $container ) {
5959
return default_launch( "docker start $container" );
6060
}
6161

62+
/**
63+
* Function to stop a container
64+
*
65+
* @param String $container Container to be stopped.
66+
*
67+
* @return bool success.
68+
*/
69+
public static function stop_container( $container ) {
70+
return default_launch( "docker stop $container" );
71+
}
72+
73+
/**
74+
* Function to restart a container
75+
*
76+
* @param String $container Container to be restarted.
77+
*
78+
* @return bool success.
79+
*/
80+
public static function restart_container( $container ) {
81+
return default_launch( "docker restart $container" );
82+
}
83+
6284
/**
6385
* Function to create and start the container if it does not exist.
6486
*
@@ -183,7 +205,7 @@ public static function docker_compose_down( $dir ) {
183205
$chdir_return_code = chdir( $dir );
184206
if ( $chdir_return_code ) {
185207

186-
return default_launch( 'docker-compose down' );
208+
return default_launch( 'docker-compose down' );
187209
}
188210

189211
return false;

0 commit comments

Comments
 (0)