-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backup: Write helper script to ABSPATH by default, just like we did b…
…efore (#35508) * Write helper script to ABSPATH, just like we did before Writing to "wp-content/" has caused some issues, as some hosts don't allow PHP code from "wp-content/" to be accessed directly. * Bump class namespace version #34739 * changelog * Make the test expect the right order of install locations * Fix up project versions * Add proxy `Package_Version` classes with different namespaces * Revert "Add proxy `Package_Version` classes with different namespaces" This reverts commit abd558f. * Don't use namespace versioning in Package_Version, add <...>\V0001\Package_Version proxy * Use correct path to Package_Version in the test * Fix package name in a test * Move test to Automattic\Jetpack\Backup namespace * Move Package_Version's compatibility class to separate file * Add (possibly) missing import * Apply the same behavior to Automattic\Jetpack\Transport_Helper\Package_Version too * Fix up project/package versions again * Fix transport-helper's actions.php to point to the right Package_Version
- Loading branch information
1 parent
86e24d1
commit feb3521
Showing
35 changed files
with
142 additions
and
76 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...ges/backup-helper-script-manager/changelog/modify-backup-helper-script-prioritize-abspath
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,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Write helper script to ABSPATH by default, just like we did before |
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
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
4 changes: 4 additions & 0 deletions
4
projects/packages/backup/changelog/modify-backup-helper-script-prioritize-abspath
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,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Write helper script to ABSPATH by default, just like we did before |
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
23 changes: 23 additions & 0 deletions
23
projects/packages/backup/src/class-package-version-compat.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,23 @@ | ||
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName | ||
/** | ||
* The Package_Version class's compatibility shim. | ||
* | ||
* @package automattic/jetpack-backup | ||
*/ | ||
|
||
// Do *not* update the "V0001" namespace version on changes. | ||
namespace Automattic\Jetpack\Backup\V0001; | ||
|
||
/** | ||
* Package_Version proxy class to accommodate upgrades from plugin version 2.4. | ||
* | ||
* Backup plugin version 2.4 had a versioned class defined ("Automattic\Jetpack\Backup\V0001\Package_Version"), so | ||
* the "jetpack_package_versions" filter will try to look for the class with this namespace + name in the newer | ||
* plugin's code. | ||
*/ | ||
class Package_Version { | ||
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing | ||
public static function send_package_version_to_tracker( $package_versions ) { | ||
return \Automattic\Jetpack\Backup\Package_Version::send_package_version_to_tracker( $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
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
4 changes: 4 additions & 0 deletions
4
projects/packages/transport-helper/changelog/modify-backup-helper-script-prioritize-abspath
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,4 @@ | ||
Significance: patch | ||
Type: fixed | ||
|
||
Write helper script to ABSPATH by default, just like we did before |
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
25 changes: 25 additions & 0 deletions
25
projects/packages/transport-helper/src/class-package-version-compat.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,25 @@ | ||
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName | ||
/** | ||
* The Package_Version class's compatibility shim. | ||
* | ||
* @package automattic/jetpack-transport-helper | ||
*/ | ||
|
||
// Do *not* update the "V0001" namespace version on changes. | ||
namespace Automattic\Jetpack\Transport_Helper\V0001; | ||
|
||
/** | ||
* Package_Version proxy class to accommodate upgrades from plugin version 2.4. | ||
* | ||
* Backup plugin version 2.4 had a versioned class defined | ||
* ("Automattic\Jetpack\Transport_Helper\V0001\Package_Version"), so the "jetpack_package_versions" filter will try to | ||
* look for the class with this namespace + name in the newer plugin's code. | ||
*/ | ||
class Package_Version { | ||
// phpcs:ignore Squiz.Commenting.FunctionComment.Missing | ||
public static function send_package_version_to_tracker( $package_versions ) { | ||
return \Automattic\Jetpack\Transport_Helper\Package_Version::send_package_version_to_tracker( | ||
$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
Oops, something went wrong.