File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments