зеркало из https://github.com/nextcloud/cookbook.git
Merge pull request #1093 from nextcloud/fix/composer-lock
Add composer lock file to git and fix code styling
This commit is contained in:
Коммит
74b0157978
|
@ -79,6 +79,9 @@ rsync -a /cookbook/ custom_apps/cookbook/ --delete --delete-delay --delete-exclu
|
|||
pushd custom_apps/cookbook
|
||||
|
||||
if [ $INSTALL_COMPOSER_DEPS = 'y' ]; then
|
||||
echo "Checking composer compatibility"
|
||||
composer check-platform-reqs
|
||||
|
||||
echo "Installing/updating composer dependencies"
|
||||
composer install
|
||||
fi
|
||||
|
|
|
@ -37,6 +37,15 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ steps.date.outputs.date }}-
|
||||
${{ runner.os }}-node-
|
||||
- name: Cache composer files
|
||||
uses: actions/cache@v2.1.7
|
||||
with:
|
||||
path: |
|
||||
vendor
|
||||
key: ${{ runner.os }}-composer-${{ steps.date.outputs.date }}-${{ hashFiles('composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-${{ steps.date.outputs.date }}-
|
||||
${{ runner.os }}-composer-
|
||||
- name: Get PHP version
|
||||
shell: bash
|
||||
run: php -v
|
||||
|
@ -108,7 +117,7 @@ jobs:
|
|||
coreVersion:
|
||||
- stable24
|
||||
phpVersion:
|
||||
- "7"
|
||||
- "8.1"
|
||||
httpServer:
|
||||
- "apache"
|
||||
mayFail:
|
||||
|
@ -117,35 +126,40 @@ jobs:
|
|||
# Test different core versions additionally
|
||||
- database: mysql
|
||||
coreVersion: stable19
|
||||
phpVersion: "7"
|
||||
phpVersion: "7.4"
|
||||
httpServer: "apache"
|
||||
mayFail: false
|
||||
- database: mysql
|
||||
coreVersion: stable20
|
||||
phpVersion: "7"
|
||||
phpVersion: "7.4"
|
||||
httpServer: "apache"
|
||||
mayFail: false
|
||||
- database: mysql
|
||||
coreVersion: stable21
|
||||
phpVersion: "7"
|
||||
phpVersion: "8.0"
|
||||
httpServer: "apache"
|
||||
mayFail: false
|
||||
- database: mysql
|
||||
coreVersion: stable22
|
||||
phpVersion: "7"
|
||||
phpVersion: "8.0"
|
||||
httpServer: "apache"
|
||||
mayFail: false
|
||||
- database: mysql
|
||||
coreVersion: stable23
|
||||
phpVersion: "7"
|
||||
phpVersion: "8.0"
|
||||
httpServer: "apache"
|
||||
mayFail: false
|
||||
|
||||
# Test different PHP versions additionally
|
||||
# - database: mysql
|
||||
# # stable24 branch needs PHP 7.4
|
||||
# coreVersion: stable23
|
||||
# phpVersion: "7.3"
|
||||
# httpServer: "apache"
|
||||
# mayFail: false
|
||||
- database: mysql
|
||||
# stable24 branch needs PHP 7.4
|
||||
coreVersion: stable23
|
||||
phpVersion: "7.3"
|
||||
coreVersion: stable24
|
||||
phpVersion: "7.4"
|
||||
httpServer: "apache"
|
||||
mayFail: false
|
||||
- database: mysql
|
||||
|
@ -157,14 +171,14 @@ jobs:
|
|||
# Test different HTTP server
|
||||
- database: mysql
|
||||
coreVersion: stable24
|
||||
phpVersion: "7"
|
||||
phpVersion: "8.1"
|
||||
httpServer: "nginx"
|
||||
mayFail: false
|
||||
|
||||
# Test against master (optionally)
|
||||
- database: mysql
|
||||
coreVersion: master
|
||||
phpVersion: "7"
|
||||
phpVersion: "8.1"
|
||||
httpServer: "apache"
|
||||
mayFail: true
|
||||
|
||||
|
@ -351,6 +365,15 @@ jobs:
|
|||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ steps.date.outputs.date }}-
|
||||
${{ runner.os }}-node-
|
||||
- name: Use cache for Composer
|
||||
uses: actions/cache@v2.1.7
|
||||
with:
|
||||
path: |
|
||||
vendor
|
||||
key: ${{ runner.os }}-composer-${{ steps.date.outputs.date }}-${{ hashFiles('composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-${{ steps.date.outputs.date }}-
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Update NPM
|
||||
shell: bash
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
- Prevent slow loading of recipes due to iteration over all files
|
||||
[#1072](https://github.com/nextcloud/cookbook/pull/1072) @christianlupus
|
||||
|
||||
### Maintenance
|
||||
- Add composer.json to version control to have unique installed dependency versions
|
||||
[#1093](https://github.com/nextcloud/cookbook/pull/1093) @christianlupus
|
||||
|
||||
|
||||
## 0.9.13 - 2022-07-02
|
||||
|
||||
|
|
|
@ -18,5 +18,10 @@
|
|||
"cs:check": "./vendor/bin/php-cs-fixer fix --dry-run --diff",
|
||||
"cs:fix": "./vendor/bin/php-cs-fixer fix",
|
||||
"lint:lint": "find . -name '*.php' -not -path './vendor/*' -not -path './.github/*' -not -path './node_modules/*' -not -path './tests/phpunit/*' -print0 | xargs -0 -n1 php -l"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -50,15 +50,15 @@ class RecipeController extends Controller {
|
|||
private $l;
|
||||
|
||||
public function __construct(
|
||||
$AppName,
|
||||
IRequest $request,
|
||||
IURLGenerator $urlGenerator,
|
||||
RecipeService $recipeService,
|
||||
DbCacheService $dbCacheService,
|
||||
RestParameterParser $restParser,
|
||||
AcceptHeaderParsingHelper $acceptHeaderParser,
|
||||
IL10N $l
|
||||
) {
|
||||
$AppName,
|
||||
IRequest $request,
|
||||
IURLGenerator $urlGenerator,
|
||||
RecipeService $recipeService,
|
||||
DbCacheService $dbCacheService,
|
||||
RestParameterParser $restParser,
|
||||
AcceptHeaderParsingHelper $acceptHeaderParser,
|
||||
IL10N $l
|
||||
) {
|
||||
parent::__construct($AppName, $request);
|
||||
|
||||
$this->service = $recipeService;
|
||||
|
|
|
@ -26,10 +26,10 @@ class RecipeDb {
|
|||
private $l;
|
||||
|
||||
public function __construct(
|
||||
IDBConnection $db,
|
||||
DbTypesPolyfillHelper $polyfillTypes,
|
||||
IL10N $l
|
||||
) {
|
||||
IDBConnection $db,
|
||||
DbTypesPolyfillHelper $polyfillTypes,
|
||||
IL10N $l
|
||||
) {
|
||||
$this->db = $db;
|
||||
$this->types = $polyfillTypes;
|
||||
$this->l = $l;
|
||||
|
@ -216,12 +216,12 @@ class RecipeDb {
|
|||
$qb->expr()->andX(
|
||||
'r.user_id = c.user_id',
|
||||
'r.recipe_id = c.recipe_id'
|
||||
)
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$qb->expr()->eq('r.user_id', $qb->createNamedParameter($user_id, IQueryBuilder::PARAM_STR)),
|
||||
$qb->expr()->isNull('c.name')
|
||||
);
|
||||
);
|
||||
|
||||
$cursor = $qb->execute();
|
||||
$row = $cursor->fetch();
|
||||
|
@ -274,12 +274,12 @@ class RecipeDb {
|
|||
$qb->expr()->andX(
|
||||
'r.user_id = c.user_id',
|
||||
'r.recipe_id = c.recipe_id'
|
||||
)
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$qb->expr()->eq('r.user_id', $qb->createNamedParameter($user_id, IQueryBuilder::PARAM_STR)),
|
||||
$qb->expr()->isNull('c.name')
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
$cursor = $qb->execute();
|
||||
|
@ -462,7 +462,7 @@ class RecipeDb {
|
|||
$qb->expr()->andX(
|
||||
$qb->expr()->eq('recipe_id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)),
|
||||
$qb->expr()->eq("user_id", $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR))
|
||||
));
|
||||
));
|
||||
}
|
||||
|
||||
$qb->execute();
|
||||
|
@ -654,8 +654,8 @@ class RecipeDb {
|
|||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)),
|
||||
$qb->expr()->eq('recipe_id', $qb->createNamedParameter($p['recipeId'], IQueryBuilder::PARAM_INT)),
|
||||
$qb->expr()->eq('name', $qb->createNamedParameter($p['name'], IQueryBuilder::PARAM_STR))
|
||||
)
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$qb->execute();
|
||||
|
|
|
@ -188,7 +188,7 @@ class HtmlToDomParser {
|
|||
case LIBXML_ERR_NONE:
|
||||
break;
|
||||
default:
|
||||
throw new \Exception($this->l->t('Unsupported error level during parsing of XML output.'));
|
||||
throw new \Exception($this->l->t('Unsupported error level during parsing of XML output.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class ImageFileHelper {
|
|||
|
||||
public function __construct(
|
||||
IL10N $l
|
||||
) {
|
||||
) {
|
||||
$this->l = $l;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class ThumbnailFileHelper {
|
|||
ImageGenerationHelper $generationHelper,
|
||||
ImageFileHelper $fileHelper,
|
||||
IL10N $l
|
||||
) {
|
||||
) {
|
||||
$this->generationHelper = $generationHelper;
|
||||
$this->fileHelper = $fileHelper;
|
||||
$this->l = $l;
|
||||
|
|
|
@ -49,7 +49,7 @@ class Version000000Date20210701093123 extends SimpleMigrationStep {
|
|||
->where(
|
||||
'user_id = :user',
|
||||
'recipe_id = :recipe'
|
||||
);
|
||||
);
|
||||
|
||||
$qb2 = $this->db->getQueryBuilder();
|
||||
$qb2->update('preferences')
|
||||
|
@ -58,7 +58,7 @@ class Version000000Date20210701093123 extends SimpleMigrationStep {
|
|||
'userid = :user',
|
||||
'appid = :app',
|
||||
'configkey = :property'
|
||||
);
|
||||
);
|
||||
$qb2->setParameter('app', 'cookbook');
|
||||
$qb2->setParameter('property', 'last_index_update');
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ if (Util::getVersion()[0] >= 20) {
|
|||
IL10n $il10n,
|
||||
IURLGenerator $urlGenerator,
|
||||
RecipeService $recipeService
|
||||
) {
|
||||
) {
|
||||
$this->l = $il10n;
|
||||
$this->urlGenerator = $urlGenerator;
|
||||
$this->recipeService = $recipeService;
|
||||
|
|
|
@ -31,7 +31,7 @@ class ImageService {
|
|||
public function __construct(
|
||||
ImageFileHelper $fileHelper,
|
||||
ThumbnailFileHelper $thumbnailHelper
|
||||
) {
|
||||
) {
|
||||
$this->fileHelper = $fileHelper;
|
||||
$this->thumbnailHelper = $thumbnailHelper;
|
||||
}
|
||||
|
|
|
@ -58,17 +58,17 @@ class RecipeService {
|
|||
private $imageService;
|
||||
|
||||
public function __construct(
|
||||
?string $UserId,
|
||||
IRootFolder $root,
|
||||
RecipeDb $db,
|
||||
UserConfigHelper $userConfigHelper,
|
||||
UserFolderHelper $userFolder,
|
||||
ImageService $imageService,
|
||||
IL10N $il10n,
|
||||
LoggerInterface $logger,
|
||||
HtmlDownloadService $downloadService,
|
||||
RecipeExtractionService $extractionService
|
||||
) {
|
||||
?string $UserId,
|
||||
IRootFolder $root,
|
||||
RecipeDb $db,
|
||||
UserConfigHelper $userConfigHelper,
|
||||
UserFolderHelper $userFolder,
|
||||
ImageService $imageService,
|
||||
IL10N $il10n,
|
||||
LoggerInterface $logger,
|
||||
HtmlDownloadService $downloadService,
|
||||
RecipeExtractionService $extractionService
|
||||
) {
|
||||
$this->user_id = $UserId;
|
||||
$this->root = $root;
|
||||
$this->db = $db;
|
||||
|
@ -758,7 +758,7 @@ class RecipeService {
|
|||
$recipe_folder->move($new_path);
|
||||
}
|
||||
|
||||
// This is a new recipe, create it
|
||||
// This is a new recipe, create it
|
||||
} else {
|
||||
$json['dateCreated'] = $now;
|
||||
|
||||
|
@ -802,7 +802,7 @@ class RecipeService {
|
|||
}
|
||||
}
|
||||
|
||||
// The image field was empty, remove images in the recipe folder
|
||||
// The image field was empty, remove images in the recipe folder
|
||||
} else {
|
||||
$this->imageService->dropImage($recipe_folder);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class Version000000Date20210701093123Test extends AbstractMigrationTestCase {
|
|||
->where(
|
||||
'appid = :appid',
|
||||
'configkey = :property'
|
||||
);
|
||||
);
|
||||
$qb->setParameter('appid', 'cookbook');
|
||||
$qb->setParameter('property', 'last_index_update');
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ class RecipeControllerTest extends TestCase {
|
|||
$this->callback(function ($p) use ($id) {
|
||||
return isset($p['size']) && $p['id'] === $id;
|
||||
})
|
||||
)->willReturn($imageUrl);
|
||||
)->willReturn($imageUrl);
|
||||
$expected = $recipe;
|
||||
$expected['printImage'] = true;
|
||||
$expected['imageUrl'] = $imageUrl;
|
||||
|
|
|
@ -101,9 +101,9 @@ class UserConfigHelperTest extends TestCase {
|
|||
|
||||
$this->config->expects($this->exactly(2))->method('setUserValue')
|
||||
->withConsecutive(
|
||||
[$this->userId, 'cookbook', 'print_image', '1'],
|
||||
[$this->userId, 'cookbook', 'print_image', '0']
|
||||
);
|
||||
[$this->userId, 'cookbook', 'print_image', '1'],
|
||||
[$this->userId, 'cookbook', 'print_image', '0']
|
||||
);
|
||||
|
||||
$this->assertFalse($this->dut->getPrintImage());
|
||||
$this->dut->setPrintImage(true);
|
||||
|
|
|
@ -36,7 +36,7 @@ class ThumbnailServiceTest extends TestCase {
|
|||
->enableOriginalConstructor()
|
||||
->setConstructorArgs([$l])
|
||||
->getMock()
|
||||
;
|
||||
;
|
||||
}
|
||||
|
||||
public function testGetImage() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче