Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh: minor improvements #71

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Application extends App implements IBootstrap {

public const CC_DEFAULT_REQUEST_TIMEOUT = 60 * 50; // 50 mins
// max size per file + max size of the batch of files to be embedded in a single request
public const CC_MAX_SIZE = 20 * 1024 * 1024; // 20MB
public const CC_MAX_SIZE = 100 * 1024 * 1024; // 100MB
public const CC_MAX_FILES = 100;
public const MIMETYPES = [
'text/plain',
Expand Down
5 changes: 3 additions & 2 deletions lib/Command/ScanFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ protected function configure() {
InputArgument::REQUIRED,
'The user ID to scan the storage of'
)
->addOption('mimetype', 'm', InputOption::VALUE_REQUIRED, 'The mime type filter');
->addOption('mimetype', 'm', InputOption::VALUE_REQUIRED, 'The mime type filter')
->addOption('directory', 'd', InputOption::VALUE_REQUIRED, 'The directory to scan, relative to the user\'s home directory');
}

protected function execute(InputInterface $input, OutputInterface $output) {
Expand All @@ -50,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
}

$userId = $input->getArgument('user_id');
$scan = $this->scanService->scanUserFiles($userId, $mimeTypeFilter);
$scan = $this->scanService->scanUserFiles($userId, $mimeTypeFilter, $input->getOption('directory'));
foreach ($scan as $s) {
$output->writeln('[' . $userId . '] Scanned ' . $s->title);
}
Expand Down
12 changes: 7 additions & 5 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap.php" timeoutForSmallTests="900" timeoutForMediumTests="900" timeoutForLargeTests="900" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap.php" timeoutForSmallTests="900" timeoutForMediumTests="900" timeoutForLargeTests="900" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">../appinfo</directory>
<directory suffix=".php">../lib</directory>
</include>
<report>
<clover outputFile="./clover.xml"/>
</report>
Expand All @@ -16,4 +12,10 @@
<logging>
<!-- and this is where your report will be written -->
</logging>
<source>
<include>
<directory suffix=".php">../appinfo</directory>
<directory suffix=".php">../lib</directory>
</include>
</source>
</phpunit>
Loading