mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2025-01-10 17:24:39 +00:00
Merge pull request #170 from zero-24/supportnoncmslikestructurs2
Support non CMS like Repo Struktures
This commit is contained in:
commit
2d03b2ecde
@ -26,7 +26,13 @@ class PullModel extends \JModelDatabase
|
||||
* @var array
|
||||
* @since 2.0
|
||||
*/
|
||||
protected $nonProductionFolders = array('build', 'docs', 'installation', 'tests', '.github');
|
||||
protected $nonProductionFolders = array(
|
||||
'build',
|
||||
'docs',
|
||||
'installation',
|
||||
'tests',
|
||||
'.github',
|
||||
);
|
||||
|
||||
/**
|
||||
* Array containing non-production files
|
||||
@ -44,6 +50,14 @@ class PullModel extends \JModelDatabase
|
||||
'phpunit.xml.dist',
|
||||
'robots.txt.dist',
|
||||
'travisci-phpunit.xml',
|
||||
'LICENSE',
|
||||
'RoboFile.dist.ini',
|
||||
'RoboFile.php',
|
||||
'codeception.yml',
|
||||
'jorobo.dist.ini',
|
||||
'manifest.xml',
|
||||
'crowdin.yaml',
|
||||
'travis-lang-update.sh',
|
||||
);
|
||||
|
||||
/**
|
||||
@ -80,10 +94,21 @@ class PullModel extends \JModelDatabase
|
||||
}
|
||||
}
|
||||
|
||||
// Sometimes the repo filename is not the production file name
|
||||
$prodFileName = $file->filename;
|
||||
$filePath = explode('/', $prodFileName);
|
||||
|
||||
// Remove the `src` here to match the CMS paths if needed
|
||||
if ($filePath[0] === 'src')
|
||||
{
|
||||
$prodFileName = str_replace('src/', '', $prodFileName);
|
||||
}
|
||||
|
||||
$parsedFiles[] = (object) array(
|
||||
'action' => $file->status,
|
||||
'filename' => $file->filename,
|
||||
'fileurl' => $file->contents_url,
|
||||
'action' => $file->status,
|
||||
'filename' => $prodFileName,
|
||||
'repofilename' => $file->filename,
|
||||
'fileurl' => $file->contents_url,
|
||||
);
|
||||
}
|
||||
|
||||
@ -178,7 +203,7 @@ class PullModel extends \JModelDatabase
|
||||
try
|
||||
{
|
||||
$contentsResponse = $github->getFileContents(
|
||||
$pull->head->user->login, $this->getState()->get('github_repo'), $file->filename, urlencode($pull->head->ref)
|
||||
$pull->head->user->login, $this->getState()->get('github_repo'), $file->repofilename, urlencode($pull->head->ref)
|
||||
);
|
||||
|
||||
$contents = json_decode($contentsResponse->body);
|
||||
|
@ -18,6 +18,7 @@
|
||||
<option value="joomla:joomla-cms">COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_JOOMLA_CMS</option>
|
||||
<option value="joomla-extensions:patchtester">COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_PATCHTESTER</option>
|
||||
<option value="joomla-extensions:install-from-web-client">COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_INSTALL_FROM_WEB</option>
|
||||
<option value="joomla-extensions:weblinks">COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_WEBLINKS</option>
|
||||
<option value="custom">COM_PATCHTESTER_FIELD_REPOSITORY_CUSTOM</option>
|
||||
</field>
|
||||
|
||||
|
@ -53,6 +53,7 @@ COM_PATCHTESTER_FIELD_REPOSITORY_LABEL="GitHub Repository"
|
||||
COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_JOOMLA_CMS="Joomla! CMS"
|
||||
COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_PATCHTESTER="Joomla! Patch Tester Component"
|
||||
COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_INSTALL_FROM_WEB="Joomla! Install From Web Plugin"
|
||||
COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_WEBLINKS="Joomla! Weblinks Package"
|
||||
COM_PATCHTESTER_FIELD_REPOSITORY_CUSTOM="Custom"
|
||||
COM_PATCHTESTER_FIELDSET_REPOSITORIES_DESC="Configuration Values for GitHub Repository"
|
||||
COM_PATCHTESTER_FIELDSET_REPOSITORIES_LABEL="GitHub Repository"
|
||||
|
Loading…
Reference in New Issue
Block a user