pickleboxer / bitbucket-update-fetcher
PHP update fetcher from BitBucket
Requires
- php: >=7.2.0
- ext-curl: *
- ext-json: *
- ext-zip: *
- composer/semver: ^3.0
- desarrolla2/cache: ^3.0
- monolog/monolog: ^2.1
- psr/log: 1.1.4
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:
- Include the necessary files and use the UpdateFetcher class:
require('vendor/autoload.php'); use BitbucketUpdateFetcher\UpdateFetcher;
- Instantiate the UpdateFetcher class:
$fetcher = new UpdateFetcher();
- 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');
- 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:
- Install the Remote - Containers extension in Visual Studio Code.
- Clone the project repository to your local machine.
- Open the project folder in Visual Studio Code.
- Press
F1
to open the command palette. - 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.