2024.8.23
Loading...
Searching...
No Matches
class.action.refreshRepos.php
Go to the documentation of this file.
1<?php
2/*
3 * Copyright (c) 2021-2024 Bearsampp
4 * License: GNU General Public License version 3 or later; see LICENSE.txt
5 * Author: Bear
6 * Website: https://bearsampp.com
7 * Github: https://github.com/Bearsampp
8 */
9
10/**
11 * Class ActionRefreshRepos
12 *
13 * This class is responsible for handling the action of refreshing repositories.
14 */
16{
17 /**
18 * Constant representing the 'git' command.
19 */
20 const GIT = 'git';
21
22 /**
23 * ActionRefreshRepos constructor.
24 *
25 * This constructor initializes the action to refresh repositories based on the provided arguments.
26 *
27 * @param array $args An array of arguments where the first argument can be 'git' to trigger the git repository refresh.
28 */
29 public function __construct($args)
30 {
31 // Global variable for accessing bearsamppTools
32 global $bearsamppTools;
33
34 // Start the loading process
36
37 // Check if the first argument is set and not empty
38 if (isset($args[0]) && !empty($args[0])) {
39 // If the first argument is 'git', trigger the git repository refresh
40 if ($args[0] == self::GIT) {
41 $bearsamppTools->getGit()->findRepos(false);
42 }
43 }
44 }
45}
static startLoading()