pickleboxer/bitbucket-update-fetcher

PHP update fetcher from BitBucket

v1.0.0 2023-11-07 13:34 UTC

This package is auto-updated.

Last update: 2024-04-07 14:40:29 UTC


README

The UpdateFetcher class is responsible for fetching updates from Bitbucket. It maintains information about the latest version and updates not yet installed. It also uses caching to optimize update requests and a logger instance for logging purposes. The class uses several dependencies including Composer\Semver\Comparator, Desarrolla2\Cache\CacheInterface, Monolog\Logger, and others.

Installation

  • Install the library via composer pickleboxer/bitbucket-update-fetcher
  • Create an update file/method in your application with your update routine (see example/update/index.php)

Usage

To use the UpdateFetcher class, you need to instantiate it and then call the appropriate methods. Here's a step-by-step guide on how to use the UpdateFetcher class:

  1. Include the necessary files and use the UpdateFetcher class:
require('vendor/autoload.php');
use BitbucketUpdateFetcher\UpdateFetcher;
  1. Instantiate the UpdateFetcher class:
$fetcher = new UpdateFetcher();
  1. Set the current version, workspace, repository slug, and access token:
$fetcher->setCurrentVersion('0.1.1');
$fetcher->setWorkspace('workspace');
$fetcher->setRepoSlug('repoSlug');
$fetcher->setAccessToken('your_access_token');
  1. Update to the latest version:
$result = $fetcher->update();

Development Environment Setup

Follow these steps to open this project in a development container using Visual Studio Code:

  1. Install the Remote - Containers extension in Visual Studio Code.
  2. Clone the project repository to your local machine.
  3. Open the project folder in Visual Studio Code.
  4. Press F1 to open the command palette.
  5. Select Remote-Containers: Reopen in Container from the dropdown.

Once the development container is up and running, you can view the application by navigating to the following URL in your web browser:

localhost:8000/example/

Contributing

Contributions are welcome. Please submit a pull request or create an issue to discuss the changes you want to make.

License

This project is licensed under the MIT License. See the LICENSE file for more details.