File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -206,17 +206,31 @@ public static function delete( $path_to_delete ) {
206206 /**
207207 * Function to reload site's nginx.
208208 *
209- * @param string $site_fs_path Directory containing site's docker-compose.yml.
209+ * @param string $site_fs_path Directory containing site's docker-compose.yml.
210210 */
211211 public static function reload_nginx ( $ site_fs_path ) {
212212
213213 chdir ( $ site_fs_path );
214- $ success = EE ::exec ( "docker-compose exec nginx sh -c 'nginx -t && service openresty reload' " );
214+ $ success = EE ::exec ( "docker-compose exec nginx sh -c 'nginx -t && nginx -s reload' " );
215215 if ( ! $ success ) {
216216 throw new \Exception ( 'Could not reload nginx. Check logs. ' );
217217 }
218218 }
219219
220+ /**
221+ * Function to reload site's php.
222+ *
223+ * @param string $site_fs_path Directory containing site's docker-compose.yml.
224+ */
225+ public static function reload_php ( $ site_fs_path ) {
226+
227+ chdir ( $ site_fs_path );
228+ $ success = EE ::exec ( "docker-compose exec php bash -c 'kill -USR2 1' " );
229+ if ( ! $ success ) {
230+ throw new \Exception ( 'Could not reload php. Check logs. ' );
231+ }
232+ }
233+
220234 /**
221235 * Function to pull site docker-compose images.
222236 *
You can’t perform that action at this time.
0 commit comments