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

147 but by adjusting the avirwrapper #157

Closed
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
10 changes: 1 addition & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@
"pathMappings": {
"/var/www/html/": "${workspaceFolder}/nextcloud-server",
"/var/www/html/apps/gdatavaas": "${workspaceFolder}/build/artifacts/gdatavaas",
},
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-dxdebug.client_host=nextcloud-server",
"-dxdebug.client_port=9080",
"-S",
"localhost:0"
],
}
},
{
"name": "Listen for Xdebug",
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.Nextcloud
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN sed -i 's/memory_limit = 128M/memory_limit = -1/g' "$PHP_INI_DIR/php.ini"
RUN echo "error_log = /var/www/html/data/php.log" >> "$PHP_INI_DIR/php.ini"
RUN sed -i 's/#LogLevel info ssl:warn/LogLevel debug/g' /etc/apache2/sites-available/000-default.conf

COPY xdebug.ini /tmp/xdebug.ini
RUN install-php-extensions gd xdebug
RUN mv /tmp/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN install-php-extensions gd xdebug;
COPY xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini


13 changes: 4 additions & 9 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use OCA\GDataVaas\AvirWrapper;
use OCA\GDataVaas\CacheEntryListener;
use OCA\GDataVaas\Db\DbFileMapper;
use OCA\GDataVaas\Listener\CacheEntryInsertedListener;
use OCA\GDataVaas\Service\MailService;
use OCA\GDataVaas\Service\TagService;
use OCA\GDataVaas\Service\VerdictService;
Expand All @@ -21,7 +20,6 @@
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Cache\CacheEntryInsertedEvent;
use OCP\Files\IHomeStorage;
use OCP\Files\Storage\IStorage;
use OCP\IAppConfig;
Expand All @@ -48,17 +46,16 @@ public function __construct() {
$eventDispatcher->addListener(LoadAdditionalScriptsEvent::class, function () {
Util::addScript(self::APP_ID, 'gdatavaas-files-action');
});
//$eventDispatcher->addServiceListener(CacheEntryInsertedEvent::class, CacheEntryInsertedListener::class);
}
}

/**
* Load the composer autoloader if it exists
* @return void
*/
public function register(IRegistrationContext $context): void {
require_once file_exists(__DIR__.'/../../vendor/scoper-autoload.php')
? __DIR__.'/../../vendor/scoper-autoload.php'
: __DIR__.'/../../vendor/autoload.php';
require_once file_exists(__DIR__ . '/../../vendor/scoper-autoload.php')
? __DIR__ . '/../../vendor/scoper-autoload.php'
: __DIR__ . '/../../vendor/autoload.php';

// Manually register TagService so that we can customize the DI used for $silentTagMapper
$context->registerService(TagService::class, function ($c) {
Expand Down Expand Up @@ -99,7 +96,6 @@ function (string $mountPoint, IStorage $storage) {
// $l10n = $container->get(IL10N::class);
$logger = $container->get(LoggerInterface::class);
$activityManager = $container->get(IManager::class);
$eventDispatcher = $container->get(IEventDispatcher::class);
$appManager = $container->get(IAppManager::class);
return new AvirWrapper([
'storage' => $storage,
Expand All @@ -110,7 +106,6 @@ function (string $mountPoint, IStorage $storage) {
'logger' => $logger,
'activityManager' => $activityManager,
'isHomeStorage' => $storage->instanceOfStorage(IHomeStorage::class),
'eventDispatcher' => $eventDispatcher,
'trashEnabled' => $appManager->isEnabledForUser('files_trashbin'),
]);
},
Expand Down
11 changes: 6 additions & 5 deletions lib/AvirWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use OCA\GDataVaas\Service\MailService;
use OCA\GDataVaas\Service\VerdictService;
use OCP\Activity\IManager as ActivityManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\EntityTooLargeException;
use OCP\Files\InvalidContentException;
use OCP\Files\NotFoundException;
Expand All @@ -38,7 +37,7 @@ class AvirWrapper extends Wrapper {
* Modes that are used for writing
* @var array
*/
private $writingModes = ['r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+'];
private $writingModes = ['r', 'r+', 'w', 'w+', 'a', 'a+', 'x', 'x+', 'c', 'c+'];

protected VerdictService $verdictService;
protected MailService $mailService;
Expand Down Expand Up @@ -74,9 +73,6 @@ public function __construct($parameters) {
$this->activityManager = $parameters['activityManager'];
$this->isHomeStorage = $parameters['isHomeStorage'];
$this->trashEnabled = $parameters['trashEnabled'];

/** @var IEventDispatcher $eventDispatcher */
$eventDispatcher = $parameters['eventDispatcher'];
}

/**
Expand Down Expand Up @@ -179,6 +175,11 @@ function () use ($path, $logger) {
}

$owner = $this->getOwner($path);

// this will remove the file from the ui and respond to the sync client that the sync failed
$cache = $this->getCache($path);
$cache->remove($path);

$this->unlink($path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we check during debugging that we do not reach this point at all via the client upload? I can't reproduce that it works like this either. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. But I did debug again and reached that point. I guess, where was still something itchy on your configuration. Let's check that together today.


if ($this->trashEnabled) {
Expand Down
49 changes: 0 additions & 49 deletions lib/Listener/CacheEntryInsertedListener.php

This file was deleted.

1 change: 0 additions & 1 deletion xdebug.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
zend_extension=xdebug.so
xdebug.client_host=nextcloud-server
xdebug.client_port=9080
xdebug.start_with_request=yes
xdebug.log=/tmp/xdebug.log
Expand Down
Loading