-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the jetpack_package_versions filter and the Package_Version_Track…
…er class. Add the new Package_Version_Tracker class, which will obtain the package versions using the package versions using the jetpack_package_versions filter.
- Loading branch information
Showing
10 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* The Package_Version class. | ||
* | ||
* @package automattic/jetpack-backup | ||
*/ | ||
|
||
namespace Automattic\Jetpack\Backup; | ||
|
||
/** | ||
* The Package_Version class. | ||
*/ | ||
class Package_Version { | ||
|
||
const PACKAGE_VERSION = '1.1.1-alpha'; | ||
|
||
const PACKAGE_SLUG = 'backup'; | ||
|
||
/** | ||
* Adds the package slug and version to the package version tracker's data. | ||
* | ||
* @param array $package_versions The package version array. | ||
* | ||
* @return array The packge version array. | ||
*/ | ||
public static function send_package_version_to_tracker( $package_versions ) { | ||
$package_versions[ self::PACKAGE_SLUG ] = self::PACKAGE_VERSION; | ||
return $package_versions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
projects/packages/connection/src/class-package-version-tracker.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* The Package_Version_Tracker class. | ||
* | ||
* @package automattic/jetpack-connection | ||
*/ | ||
|
||
namespace Automattic\Jetpack\Connection; | ||
|
||
/** | ||
* The Package_Version_Tracker class. | ||
*/ | ||
class Package_Version_Tracker { | ||
|
||
/** | ||
* Uses the jetpack_package_versions filter to obtain the package versions from packages that need | ||
* version tracking. | ||
*/ | ||
public static function get_package_versions() { | ||
/** | ||
* Obtains the package versions. | ||
* | ||
* @since x.x.x | ||
* | ||
* @param array An associative array containing the package versions with the package slugs as the keys. | ||
*/ | ||
$package_versions = apply_filters( 'jetpack_package_versions', array() ); | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
projects/packages/connection/src/class-package-version.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* The Package_Version class. | ||
* | ||
* @package automattic/jetpack-connection | ||
*/ | ||
|
||
namespace Automattic\Jetpack\Connection; | ||
|
||
/** | ||
* The Package_Version class. | ||
*/ | ||
class Package_Version { | ||
|
||
const PACKAGE_VERSION = '1.30.1-alpha'; | ||
|
||
const PACKAGE_SLUG = 'connection'; | ||
|
||
/** | ||
* Adds the package slug and version to the package version tracker's data. | ||
* | ||
* @param array $package_versions The package version array. | ||
* | ||
* @return array The packge version array. | ||
*/ | ||
public static function send_package_version_to_tracker( $package_versions ) { | ||
$package_versions[ self::PACKAGE_SLUG ] = self::PACKAGE_VERSION; | ||
return $package_versions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* The Package_Version class. | ||
* | ||
* @package automattic/jetpack-sync | ||
*/ | ||
|
||
namespace Automattic\Jetpack\Sync; | ||
|
||
/** | ||
* The Package_Version class. | ||
*/ | ||
class Package_Version { | ||
|
||
const PACKAGE_VERSION = '1.24.0-alpha'; | ||
|
||
const PACKAGE_SLUG = 'sync'; | ||
|
||
/** | ||
* Adds the package slug and version to the package version tracker's data. | ||
* | ||
* @param array $package_versions The package version array. | ||
* | ||
* @return array The packge version array. | ||
*/ | ||
public static function send_package_version_to_tracker( $package_versions ) { | ||
$package_versions[ self::PACKAGE_SLUG ] = self::PACKAGE_VERSION; | ||
return $package_versions; | ||
} | ||
} |