-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternative fix to Composer autoloading issues.
It may be possible to overcome the limitations of the "files" autoloading mechanism by changing the file name in every version.
- Loading branch information
1 parent
66472c5
commit 2a7c818
Showing
5 changed files
with
32 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
if ( !class_exists('Puc_v4_Factory', false) ): | ||
|
||
require __DIR__ . '/../v4p8/Factory.php'; | ||
class Puc_v4_Factory extends Puc_v4p8_Factory { } | ||
|
||
endif; |
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,28 @@ | ||
<?php | ||
require dirname(__FILE__) . '/Puc/v4p8/Autoloader.php'; | ||
new Puc_v4p8_Autoloader(); | ||
|
||
require dirname(__FILE__) . '/Puc/v4p8/Factory.php'; | ||
require dirname(__FILE__) . '/Puc/v4/Factory.php'; | ||
|
||
//Register classes defined in this version with the factory. | ||
foreach ( | ||
array( | ||
'Plugin_UpdateChecker' => 'Puc_v4p8_Plugin_UpdateChecker', | ||
'Theme_UpdateChecker' => 'Puc_v4p8_Theme_UpdateChecker', | ||
|
||
'Vcs_PluginUpdateChecker' => 'Puc_v4p8_Vcs_PluginUpdateChecker', | ||
'Vcs_ThemeUpdateChecker' => 'Puc_v4p8_Vcs_ThemeUpdateChecker', | ||
|
||
'GitHubApi' => 'Puc_v4p8_Vcs_GitHubApi', | ||
'BitBucketApi' => 'Puc_v4p8_Vcs_BitBucketApi', | ||
'GitLabApi' => 'Puc_v4p8_Vcs_GitLabApi', | ||
) | ||
as $pucGeneralClass => $pucVersionedClass | ||
) { | ||
Puc_v4_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.8'); | ||
//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_v4p8_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.8'); | ||
} | ||
|
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