33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2025-01-25 16:18:26 +00:00

allow non cms like structurs

This commit is contained in:
zero-24 2016-07-30 22:09:04 +02:00
parent f7e8fb87ae
commit e72b6501d1
3 changed files with 31 additions and 5 deletions

View File

@ -26,7 +26,13 @@ class PullModel extends \JModelDatabase
* @var array * @var array
* @since 2.0 * @since 2.0
*/ */
protected $nonProductionFolders = array('build', 'docs', 'installation', 'tests', '.github'); protected $nonProductionFolders = array(
'build',
'docs',
'installation',
'tests',
'.github',
);
/** /**
* Array containing non-production files * Array containing non-production files
@ -44,6 +50,14 @@ class PullModel extends \JModelDatabase
'phpunit.xml.dist', 'phpunit.xml.dist',
'robots.txt.dist', 'robots.txt.dist',
'travisci-phpunit.xml', 'travisci-phpunit.xml',
'LICENSE',
'RoboFile.dist.ini',
'RoboFile.php',
'codeception.yml',
'jorobo.dist.ini',
'manifest.xml',
'crowdin.yaml',
'travis-lang-update.sh',
); );
/** /**
@ -80,9 +94,19 @@ class PullModel extends \JModelDatabase
} }
} }
// Remove the `src` here to match the CMS paths if needed
$repofilename = $file->filename;
$filePath = explode('/', $repofilename);
if ($filePath[0] === 'src')
{
$repofilename = str_replace('src/', '', $file->filename);
}
$parsedFiles[] = (object) array( $parsedFiles[] = (object) array(
'action' => $file->status, 'action' => $file->status,
'filename' => $file->filename, 'filename' => $file->filename,
'repofilename' => $repofilename,
'fileurl' => $file->contents_url, 'fileurl' => $file->contents_url,
); );
} }
@ -178,7 +202,7 @@ class PullModel extends \JModelDatabase
try try
{ {
$contentsResponse = $github->getFileContents( $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); $contents = json_decode($contentsResponse->body);

View File

@ -18,6 +18,7 @@
<option value="joomla:joomla-cms">COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_JOOMLA_CMS</option> <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: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: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> <option value="custom">COM_PATCHTESTER_FIELD_REPOSITORY_CUSTOM</option>
</field> </field>

View File

@ -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_JOOMLA_CMS="Joomla! CMS"
COM_PATCHTESTER_FIELD_REPOSITORY_OPTION_PATCHTESTER="Joomla! Patch Tester Component" 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_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_FIELD_REPOSITORY_CUSTOM="Custom"
COM_PATCHTESTER_FIELDSET_REPOSITORIES_DESC="Configuration Values for GitHub Repository" COM_PATCHTESTER_FIELDSET_REPOSITORIES_DESC="Configuration Values for GitHub Repository"
COM_PATCHTESTER_FIELDSET_REPOSITORIES_LABEL="GitHub Repository" COM_PATCHTESTER_FIELDSET_REPOSITORIES_LABEL="GitHub Repository"