| | |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | require_once('aps_base.inc.php'); |
| | | require_once 'aps_base.inc.php'; |
| | | |
| | | @set_time_limit(0); |
| | | @ignore_user_abort(1); |
| | |
| | | * @param $app the application instance (db handle + log method) |
| | | * @param $interface_mode act in interface (true) or server mode (false) |
| | | */ |
| | | |
| | | |
| | | public function __construct($app, $interface_mode = false) |
| | | { |
| | | parent::__construct($app, 'APS crawler: ', $interface_mode); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Before the cron is executed, make sure all necessary options are set |
| | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | $app->log($this->log_prefix.'Aborting execution because '.$e->getMessage(), LOGLEVEL_ERROR); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Remove a directory recursively |
| | |
| | | return $ret; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Fetch binary data from a given array |
| | | * The data is retrieved in binary mode and |
| | |
| | | curl_multi_close($mh); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * A method to build query URLs out of a list of vendors |
| | | * |
| | |
| | | $array_item = str_replace(' ', '%20', $array_item); |
| | | $array_item = str_replace('http://', '', $array_item); |
| | | $array_item = '/'.$this->aps_version.'.atom?vendor='.$array_item.'&pageSize=100'; |
| | | return($array_item); |
| | | return $array_item; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * The main method which performs the actual crawling |
| | |
| | | ' apps from the repo. Downloaded '.$apps_updated. |
| | | ' updates, '.$apps_downloaded.' new apps'); |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_ERROR); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Read in all possible packages from the interface packages folder and |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_ERROR); |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Add missing package URLs to database |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | catch(Exception $e) |
| | | { |
| | | $app->log($this->log_prefix.$e->getMessage(), LOGLEVEL_ERROR); |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ?> |