Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Devops Support #488

Open
dvalley56 opened this issue Apr 12, 2022 · 0 comments
Open

Azure Devops Support #488

dvalley56 opened this issue Apr 12, 2022 · 0 comments

Comments

@dvalley56
Copy link

dvalley56 commented Apr 12, 2022

For azure devops

Before I start I want to give all credits to the original author
I don't know where to submit this. Hope everything is cool.

I changed/added the following files

-  plugin-update-checker\load-v4p11.php (added a new line)
- plugin-update-checker\Puc\v4p11\Vcs\AzureDevOpsApi.php (added this file)
- plugin-update-checker\Puc\v4p11\Vcs\Api.php (hard coded slug around line 305)

I know we shouldn't had code values, but I was making this for myself.

  • plugin-update-checker\load-v4p11.php (added a new line)
<?php
require dirname(__FILE__) . '/Puc/v4p11/Autoloader.php';
new Puc_v4p11_Autoloader();

require dirname(__FILE__) . '/Puc/v4p11/Factory.php';
require dirname(__FILE__) . '/Puc/v4/Factory.php';

//Register classes defined in this version with the factory.
foreach (
	array(
		'Plugin_UpdateChecker' => 'Puc_v4p11_Plugin_UpdateChecker',
		'Vcs_PluginUpdateChecker' => 'Puc_v4p11_Vcs_PluginUpdateChecker',   //added this line
		'AzureDevOpsApi'    => 'Puc_v4p11_Vcs_AzureDevOpsApi',
	)
	as $pucGeneralClass => $pucVersionedClass
) {
	Puc_v4_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.11');
	//Also add it to the minor-version factory in case the major-version factory
	//was already defined by another, older version of the update checker.
	Puc_v4p11_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.11');
}


  • plugin-update-checker\Puc\v4p11\Vcs\Api.php (hard coded slug around line 305)
                .
                .
                .
		public function setSlug($slug) {
			// $this->slug = $slug;
			/*
				replace below with our slug, it would generally be your plugin file name without the extension
				eg my_plugin.php -> my_plugin (without .php)
			*/
		
			$this->slug = '';
		}
                .
                .
                .
  • plugin-update-checker\Puc\v4p11\Vcs\AzureDevOpsApi.php (added this file)

I am sharing link for the whole file for anyone who wants to refer. You can find the file in that
I have added comments for reference

You can contact me anytime here (I don't know if we can message here ) or at instagram @dvalley56

Complete code
link for the edited code

Note: My root of the repo is a folder which contains file

my_plugin
|
-> plugin-update-checker
-> my_plugin.php

Some asked me in my previous issue to share the code. I dont know how to tag you mate @rolltidehero
rolltidehero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant