}
public function getThemes() {
- return array(
+ return [
[
'id' => 'dark',
'img' => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'),
'enableLabel' => $this->l->t('Enable dark theme'),
'text' => $this->l->t('A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find.')
]
- );
+ ];
}
public function getHighContrast() {
}
public function getFonts() {
- return array(
+ return [
[
'id' => 'fontdyslexic',
'img' => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'),
'enableLabel' => $this->l->t('Enable dyslexia font'),
'text' => $this->l->t('OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia.')
]
- );
+ ];
}
}
}
$themes = $this->accessibilityProvider->getThemes();
- $highcontrast = array($this->accessibilityProvider->getHighContrast());
+ $highcontrast = [$this->accessibilityProvider->getHighContrast()];
$fonts = $this->accessibilityProvider->getFonts();
$availableOptions = array_map(function($option) {
\OCP\Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$uid)
+ ['uid' => &$uid]
);
$this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]);
const APP_ID = 'comments';
- public function __construct (array $urlParams = array()) {
+ public function __construct (array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
$container = $this->getContainer();
$addressBookRoot = new CalendarRoot($principalBackend, $calDavBackend);
$addressBookRoot->disableListing = !$debugging; // Disable listing
-$nodes = array(
+$nodes = [
$principalCollection,
$addressBookRoot,
-);
+];
// Fire up server
$server = new \Sabre\DAV\Server($nodes);
$addressBookRoot = new AddressBookRoot($principalBackend, $cardDavBackend, $pluginManager);
$addressBookRoot->disableListing = !$debugging; // Disable listing
-$nodes = array(
+$nodes = [
$principalCollection,
$addressBookRoot,
-);
+];
// Fire up server
$server = new \Sabre\DAV\Server($nodes);
// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
$previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
- return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
+ return new \OC\Files\Storage\Wrapper\PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]);
});
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
}
}
- $valuesToInsert = array();
+ $valuesToInsert = [];
$query = $this->db->getQueryBuilder();
break;
}
- $data = array(
+ $data = [
'attendee_name' => (string)$meetingAttendeeName ?: $defaultVal,
'invitee_name' => (string)$meetingInviteeName ?: $defaultVal,
'meeting_title' => (string)$meetingTitle ?: $defaultVal,
'meeting_description' => (string)$meetingDescription ?: $defaultVal,
'meeting_url' => (string)$meetingUrl ?: $defaultVal,
- );
+ ];
$fromEMail = \OCP\Util::getDefaultEmailAddress('invitations-noreply');
$fromName = $l10n->t('%1$s via %2$s', [$senderName, $this->defaults->getName()]);
private $sharingBackend;
/** @var array properties to index */
- public static $indexProperties = array(
+ public static $indexProperties = [
'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
- 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD');
+ 'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO', 'CLOUD'];
/**
* @var string[] Map of uid => display name
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped, otherwise they are
* @return array an array of contacts which are arrays of key-value-pairs
*/
- public function search($addressBookId, $pattern, $searchProperties, $options = array()) {
+ public function search($addressBookId, $pattern, $searchProperties, $options = []) {
$query = $this->db->getQueryBuilder();
$query2 = $this->db->getQueryBuilder();
public function initialize(\Sabre\DAV\Server $server) {
$this->server = $server;
- $this->server->on('beforeMethod', array($this, 'checkAppEnabled'), 30);
+ $this->server->on('beforeMethod', [$this, 'checkAppEnabled'], 30);
}
/**
*/
function initialize(\Sabre\DAV\Server $server) {
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
}
/**
throw new Locked();
}
- $nodes = array();
+ $nodes = [];
foreach ($folderContent as $info) {
$node = $this->getChild($info->getName(), $info);
$nodes[] = $node;
} else {
$free = $storageInfo['free'];
}
- $this->quotaInfo = array(
+ $this->quotaInfo = [
$storageInfo['used'],
$free
- );
+ ];
return $this->quotaInfo;
} catch (\OCP\Files\StorageNotAvailableException $e) {
- return array(0, 0);
+ return [0, 0];
}
}
*/
public function initialize(\Sabre\DAV\Server $server) {
- $server->on('exception', array($this, 'logException'), 10);
+ $server->on('exception', [$this, 'logException'], 10);
}
/**
$run = true;
if (!$exists) {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_create, [
\OC\Files\Filesystem::signal_param_path => $hookPath,
\OC\Files\Filesystem::signal_param_run => &$run,
- ));
+ ]);
} else {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_update, [
\OC\Files\Filesystem::signal_param_path => $hookPath,
\OC\Files\Filesystem::signal_param_run => &$run,
- ));
+ ]);
}
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_write, [
\OC\Files\Filesystem::signal_param_path => $hookPath,
\OC\Files\Filesystem::signal_param_run => &$run,
- ));
+ ]);
return $run;
}
}
$hookPath = Filesystem::getView()->getRelativePath($this->fileView->getAbsolutePath($path));
if (!$exists) {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_create, [
\OC\Files\Filesystem::signal_param_path => $hookPath
- ));
+ ]);
} else {
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_update, [
\OC\Files\Filesystem::signal_param_path => $hookPath
- ));
+ ]);
}
- \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, array(
+ \OC_Hook::emit(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, [
\OC\Files\Filesystem::signal_param_path => $hookPath
- ));
+ ]);
}
/**
$server->protectedProperties = array_diff($server->protectedProperties, $allowedProperties);
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
- $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
- $this->server->on('afterBind', array($this, 'sendFileIdHeader'));
- $this->server->on('afterWriteContent', array($this, 'sendFileIdHeader'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
+ $this->server->on('propPatch', [$this, 'handleUpdateProperties']);
+ $this->server->on('afterBind', [$this, 'sendFileIdHeader']);
+ $this->server->on('afterWriteContent', [$this, 'sendFileIdHeader']);
$this->server->on('afterMethod:GET', [$this,'httpGet']);
- $this->server->on('afterMethod:GET', array($this, 'handleDownloadToken'));
+ $this->server->on('afterMethod:GET', [$this, 'handleDownloadToken']);
$this->server->on('afterResponse', function($request, ResponseInterface $response) {
$body = $response->getBody();
if (is_resource($body)) {
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$this->server = $server;
- $this->server->on('report', array($this, 'onReport'));
+ $this->server->on('report', [$this, 'onReport']);
}
/**
*/
public function initialize(\Sabre\DAV\Server $server) {
$this->server = $server;
- $this->server->on('beforeMethod', array($this, 'checkMaintenanceMode'), 1);
+ $this->server->on('beforeMethod', [$this, 'checkMaintenanceMode'], 1);
}
/**
* @return int file id of updated file or -1 on failure
*/
public function setETag($etag) {
- return $this->fileView->putFileInfo($this->path, array('etag' => $etag));
+ return $this->fileView->putFileInfo($this->path, ['etag' => $etag]);
}
public function setCreationTime(int $time) {
- return $this->fileView->putFileInfo($this->path, array('creation_time' => $time));
+ return $this->fileView->putFileInfo($this->path, ['creation_time' => $time]);
}
public function setUploadTime(int $time) {
- return $this->fileView->putFileInfo($this->path, array('upload_time' => $time));
+ return $this->fileView->putFileInfo($this->path, ['upload_time' => $time]);
}
/**
$server->protectedProperties[] = self::SHAREES_PROPERTYNAME;
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
}
private function getShare(\OCP\Files\Node $node): array {
$this->tree = $tree;
$this->tagManager = $tagManager;
$this->tagger = null;
- $this->cachedTags = array();
+ $this->cachedTags = [];
}
/**
$server->xml->elementMap[self::TAGS_PROPERTYNAME] = TagList::class;
$this->server = $server;
- $this->server->on('propFind', array($this, 'handleGetProperties'));
- $this->server->on('propPatch', array($this, 'handleUpdateProperties'));
+ $this->server->on('propFind', [$this, 'handleGetProperties']);
+ $this->server->on('propPatch', [$this, 'handleUpdateProperties']);
}
/**
unset($tags[$favPos]);
}
}
- return array($tags, $isFav);
+ return [$tags, $isFav];
}
/**
if (isset($this->cachedTags[$fileId])) {
return $this->cachedTags[$fileId];
} else {
- $tags = $this->getTagger()->getTagsForObjects(array($fileId));
+ $tags = $this->getTagger()->getTagsForObjects([$fileId]);
if ($tags !== false) {
if (empty($tags)) {
- return array();
+ return [];
}
return current($tags);
}
$tags = $this->getTagger()->getTagsForObjects($fileIds);
if ($tags === false) {
// the tags API returns false on error...
- $tags = array();
+ $tags = [];
}
$this->cachedTags = $this->cachedTags + $tags;
*/
function initialize(Server $server) {
$this->server = $server;
- $server->on('exception', array($this, 'logException'), 1000);
+ $server->on('exception', [$this, 'logException'], 1000);
}
/**
$result = $qb->execute();
- $orphanItems = array();
+ $orphanItems = [];
while ($row = $result->fetch()) {
$orphanItems[] = (int) $row['id'];
}
$server->protectedProperties[] = self::ID_PROPERTYNAME;
- $server->on('propFind', array($this, 'handleGetProperties'));
- $server->on('propPatch', array($this, 'handleUpdateProperties'));
+ $server->on('propFind', [$this, 'handleGetProperties']);
+ $server->on('propPatch', [$this, 'handleUpdateProperties']);
$server->on('method:POST', [$this, 'httpPost']);
$this->server = $server;
$l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function ($text, $parameters = array()) {
+ ->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
});
$this->l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function ($text, $parameters = array()) {
+ ->willReturnCallback(function ($text, $parameters = []) {
return vsprintf($text, $parameters);
});
}
' WHERE `userid` = ?'
);
$deleteStatement->execute(
- array(
+ [
$this->user->getUID(),
- )
+ ]
);
$deleteStatement->closeCursor();
}
private function applyDefaultProps($path = '/dummypath') {
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
'customprop' => 'value1',
'customprop2' => 'value2',
- ));
+ ]);
$this->plugin->propPatch(
$path,
public function testPropFindMissingFileSoftFail() {
$propFind = new \Sabre\DAV\PropFind(
'/dummypath',
- array(
+ [
'customprop',
'customprop2',
'unsetprop',
- ),
+ ],
0
);
$propFind = new \Sabre\DAV\PropFind(
'/dummypath',
- array(
+ [
'customprop',
'customprop2',
'unsetprop',
- ),
+ ],
0
);
$this->assertEquals('value1', $propFind->get('customprop'));
$this->assertEquals('value2', $propFind->get('customprop2'));
- $this->assertEquals(array('unsetprop'), $propFind->get404Properties());
+ $this->assertEquals(['unsetprop'], $propFind->get404Properties());
}
/**
$this->applyDefaultProps('/dummypath');
$this->applyDefaultProps('/dummypath/test.txt');
- $propNames = array(
+ $propNames = [
'customprop',
'customprop2',
'unsetprop',
- );
+ ];
$propFindRoot = new \Sabre\DAV\PropFind(
'/dummypath',
$this->assertEquals('value1', $propFindRoot->get('customprop'));
$this->assertEquals('value2', $propFindRoot->get('customprop2'));
- $this->assertEquals(array('unsetprop'), $propFindRoot->get404Properties());
+ $this->assertEquals(['unsetprop'], $propFindRoot->get404Properties());
$this->assertEquals('value1', $propFindSub->get('customprop'));
$this->assertEquals('value2', $propFindSub->get('customprop2'));
- $this->assertEquals(array('unsetprop'), $propFindSub->get404Properties());
+ $this->assertEquals(['unsetprop'], $propFindSub->get404Properties());
}
/**
public function testDeleteProperty() {
$this->applyDefaultProps();
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
'customprop' => null,
- ));
+ ]);
$this->plugin->propPatch(
'/dummypath',
$this->view->expects($this->once())
->method('getDirectoryContent')
->with('')
- ->willReturn(array($info1, $info2));
+ ->willReturn([$info1, $info2]);
$this->view->expects($this->any())
->method('getRelativePath')
->method('getRelativePath')
->willReturnArgument(0);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
}
public static function cancellingHook($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_post_create,
'params' => $params
- );
+ ];
}
/**
$_SERVER['CONTENT_LENGTH'] = 123456;
$_SERVER['REQUEST_METHOD'] = 'PUT';
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
// simulate situation where the target file is locked
$view->lockFile('/test.txt', ILockingProvider::LOCK_EXCLUSIVE);
- $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
->method('getRelativePath')
->willReturnArgument(0);
- $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
// action
->method('getRelativePath')
->willReturnArgument(0);
- $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/*', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
$file->setName('/super*star.txt');
}
$_SERVER['CONTENT_LENGTH'] = 12345;
$_SERVER['REQUEST_METHOD'] = 'PUT';
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
->method('unlink')
->willReturn(true);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
$view = $this->getMockBuilder(View::class)
->getMock();
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => 0
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
->method('unlink')
->willReturn(false);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
->method('unlink')
->willThrowException(new ForbiddenException('', true));
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
->method('fopen')
->willReturn(false);
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
->method('fopen')
->willThrowException(new ForbiddenException('', true));
- $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, array(
+ $info = new \OC\Files\FileInfo('/test.txt', $this->getMockStorage(), null, [
'permissions' => \OCP\Constants::PERMISSION_ALL
- ), null);
+ ], null);
$file = new \OCA\DAV\Connector\Sabre\File($view, $info);
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::GETETAG_PROPERTYNAME,
self::FILEID_PROPERTYNAME,
self::INTERNAL_FILEID_PROPERTYNAME,
self::OWNER_ID_PROPERTYNAME,
self::OWNER_DISPLAY_NAME_PROPERTYNAME,
self::DATA_FINGERPRINT_PROPERTYNAME,
- ),
+ ],
0
);
$node->expects($this->once())
->method('getDirectDownload')
- ->willReturn(array('url' => 'http://example.com/'));
+ ->willReturn(['url' => 'http://example.com/']);
$node->expects($this->exactly(2))
->method('getOwner')
->willReturn($user);
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::DOWNLOADURL_PROPERTYNAME,
- ),
+ ],
0
);
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::GETETAG_PROPERTYNAME,
self::FILEID_PROPERTYNAME,
self::SIZE_PROPERTYNAME,
self::PERMISSIONS_PROPERTYNAME,
self::DOWNLOADURL_PROPERTYNAME,
self::DATA_FINGERPRINT_PROPERTYNAME,
- ),
+ ],
0
);
->willReturn(true);
// properties to set
- $propPatch = new PropPatch(array(
+ $propPatch = new PropPatch([
self::GETETAG_PROPERTYNAME => 'newetag',
self::LASTMODIFIED_PROPERTYNAME => $testDate
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
}
public function testUpdatePropsForbidden() {
- $propPatch = new PropPatch(array(
+ $propPatch = new PropPatch([
self::OWNER_ID_PROPERTYNAME => 'user2',
self::OWNER_DISPLAY_NAME_PROPERTYNAME => 'User Two',
self::FILEID_PROPERTYNAME => 12345,
self::PERMISSIONS_PROPERTYNAME => 'C',
self::SIZE_PROPERTYNAME => 123,
self::DOWNLOADURL_PROPERTYNAME => 'http://example.com/',
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
$propFind = new PropFind(
'/dummyPath',
- array(
+ [
self::HAS_PREVIEW_PROPERTYNAME
- ),
+ ],
0
);
*/
class NodeTest extends \Test\TestCase {
public function davPermissionsProvider() {
- return array(
- array(\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RGDNVCK'),
- array(\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RGD'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RGNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RGDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'file', false, false, 'RDNVW'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RGDNV'),
- array(\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'dir', false, false, 'RDNVCK'),
- );
+ return [
+ [\OCP\Constants::PERMISSION_ALL, 'file', false, false, 'RGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL, 'dir', false, false, 'RGDNVCK'],
+ [\OCP\Constants::PERMISSION_ALL, 'file', true, false, 'SRGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL, 'file', true, true, 'SRMGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_SHARE, 'file', true, false, 'SGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_UPDATE, 'file', false, false, 'RGD'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_DELETE, 'file', false, false, 'RGNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'file', false, false, 'RGDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'file', false, false, 'RDNVW'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, 'dir', false, false, 'RGDNV'],
+ [\OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_READ, 'dir', false, false, 'RDNVCK'],
+ ];
}
/**
public function testDavPermissions($permissions, $type, $shared, $mounted, $expected) {
$info = $this->getMockBuilder(FileInfo::class)
->disableOriginalConstructor()
- ->setMethods(array('getPermissions', 'isShared', 'isMounted', 'getType'))
+ ->setMethods(['getPermissions', 'isShared', 'isMounted', 'getType'])
->getMock();
$info->expects($this->any())
->method('getPermissions')
}
function nodeForPathProvider() {
- return array(
+ return [
// regular file
- array(
+ [
'regularfile.txt',
'regularfile.txt',
'regularfile.txt',
'file',
false
- ),
+ ],
// regular directory
- array(
+ [
'regulardir',
'regulardir',
'regulardir',
'dir',
false
- ),
+ ],
// regular file with chunking
- array(
+ [
'regularfile.txt',
'regularfile.txt',
'regularfile.txt',
'file',
true
- ),
+ ],
// regular directory with chunking
- array(
+ [
'regulardir',
'regulardir',
'regulardir',
'dir',
true
- ),
+ ],
// file with chunky file name
- array(
+ [
'regularfile.txt-chunking-123566789-10-1',
'regularfile.txt',
'regularfile.txt',
'file',
true
- ),
+ ],
// regular file in subdir
- array(
+ [
'subdir/regularfile.txt',
'subdir/regularfile.txt',
'regularfile.txt',
'file',
false
- ),
+ ],
// regular directory in subdir
- array(
+ [
'subdir/regulardir',
'subdir/regulardir',
'regulardir',
'dir',
false
- ),
+ ],
// file with chunky file name in subdir
- array(
+ [
'subdir/regularfile.txt-chunking-123566789-10-1',
'subdir/regularfile.txt',
'regularfile.txt',
'file',
true
- ),
- );
+ ],
+ ];
}
}
public function testUpdatePrincipal() {
- $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch(array())));
+ $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch([])));
}
public function testSearchPrincipalsWithEmptySearchProperties() {
}
public function quotaOkayProvider() {
- return array(
- array(1024, array()),
- array(1024, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(1024, array('CONTENT-LENGTH' => '512')),
- array(1024, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-
- array(FileInfo::SPACE_UNKNOWN, array()),
- array(FileInfo::SPACE_UNKNOWN, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(FileInfo::SPACE_UNKNOWN, array('CONTENT-LENGTH' => '512')),
- array(FileInfo::SPACE_UNKNOWN, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
-
- array(FileInfo::SPACE_UNLIMITED, array()),
- array(FileInfo::SPACE_UNLIMITED, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(FileInfo::SPACE_UNLIMITED, array('CONTENT-LENGTH' => '512')),
- array(FileInfo::SPACE_UNLIMITED, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
- );
+ return [
+ [1024, []],
+ [1024, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [1024, ['CONTENT-LENGTH' => '512']],
+ [1024, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+
+ [FileInfo::SPACE_UNKNOWN, []],
+ [FileInfo::SPACE_UNKNOWN, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [FileInfo::SPACE_UNKNOWN, ['CONTENT-LENGTH' => '512']],
+ [FileInfo::SPACE_UNKNOWN, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+
+ [FileInfo::SPACE_UNLIMITED, []],
+ [FileInfo::SPACE_UNLIMITED, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [FileInfo::SPACE_UNLIMITED, ['CONTENT-LENGTH' => '512']],
+ [FileInfo::SPACE_UNLIMITED, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+ ];
}
public function quotaExceededProvider() {
- return array(
- array(1023, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(511, array('CONTENT-LENGTH' => '512')),
- array(2047, array('OC-TOTAL-LENGTH' => '2048', 'CONTENT-LENGTH' => '1024')),
- );
+ return [
+ [1023, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [511, ['CONTENT-LENGTH' => '512']],
+ [2047, ['OC-TOTAL-LENGTH' => '2048', 'CONTENT-LENGTH' => '1024']],
+ ];
}
public function lengthProvider() {
}
public function quotaChunkedOkProvider() {
- return array(
- array(1024, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(1024, 0, array('CONTENT-LENGTH' => '512')),
- array(1024, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
+ return [
+ [1024, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [1024, 0, ['CONTENT-LENGTH' => '512']],
+ [1024, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
// with existing chunks (allowed size = total length - chunk total size)
- array(400, 128, array('X-EXPECTED-ENTITY-LENGTH' => '512')),
- array(400, 128, array('CONTENT-LENGTH' => '512')),
- array(400, 128, array('OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500')),
+ [400, 128, ['X-EXPECTED-ENTITY-LENGTH' => '512']],
+ [400, 128, ['CONTENT-LENGTH' => '512']],
+ [400, 128, ['OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500']],
// \OCP\Files\FileInfo::SPACE-UNKNOWN = -2
- array(-2, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(-2, 0, array('CONTENT-LENGTH' => '512')),
- array(-2, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
- array(-2, 128, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(-2, 128, array('CONTENT-LENGTH' => '512')),
- array(-2, 128, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
- );
+ [-2, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [-2, 0, ['CONTENT-LENGTH' => '512']],
+ [-2, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+ [-2, 128, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [-2, 128, ['CONTENT-LENGTH' => '512']],
+ [-2, 128, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
+ ];
}
/**
}
public function quotaChunkedFailProvider() {
- return array(
- array(400, 0, array('X-EXPECTED-ENTITY-LENGTH' => '1024')),
- array(400, 0, array('CONTENT-LENGTH' => '512')),
- array(400, 0, array('OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512')),
+ return [
+ [400, 0, ['X-EXPECTED-ENTITY-LENGTH' => '1024']],
+ [400, 0, ['CONTENT-LENGTH' => '512']],
+ [400, 0, ['OC-TOTAL-LENGTH' => '1024', 'CONTENT-LENGTH' => '512']],
// with existing chunks (allowed size = total length - chunk total size)
- array(380, 128, array('X-EXPECTED-ENTITY-LENGTH' => '512')),
- array(380, 128, array('CONTENT-LENGTH' => '512')),
- array(380, 128, array('OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500')),
- );
+ [380, 128, ['X-EXPECTED-ENTITY-LENGTH' => '512']],
+ [380, 128, ['CONTENT-LENGTH' => '512']],
+ [380, 128, ['OC-TOTAL-LENGTH' => '512', 'CONTENT-LENGTH' => '500']],
+ ];
}
/**
$this->tagger->expects($this->exactly($expectedCallCount))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123)))
- ->willReturn(array(123 => $tags));
+ ->with($this->equalTo([123]))
+ ->willReturn([123 => $tags]);
$propFind = new \Sabre\DAV\PropFind(
'/dummyPath',
->willReturn(123);
$node->expects($this->exactly($expectedCallCount))
->method('getChildren')
- ->willReturn(array($node1, $node2));
+ ->willReturn([$node1, $node2]);
$this->tagger->expects($this->exactly($expectedCallCount))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123, 111, 222)))
+ ->with($this->equalTo([123, 111, 222]))
->willReturn(
- array(
+ [
111 => $tags,
123 => $tags
- )
+ ]
);
// simulate sabre recursive PROPFIND traversal
}
function tagsGetPropertiesDataProvider() {
- return array(
+ return [
// request both, receive both
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME),
- array(
- 200 => array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')),
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME],
+ [
+ 200 => [
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2']),
self::FAVORITE_PROPERTYNAME => true,
- )
- )
- ),
+ ]
+ ]
+ ],
// request tags alone
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(self::TAGS_PROPERTYNAME),
- array(
- 200 => array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2')),
- )
- )
- ),
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [self::TAGS_PROPERTYNAME],
+ [
+ 200 => [
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2']),
+ ]
+ ]
+ ],
// request fav alone
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(self::FAVORITE_PROPERTYNAME),
- array(
- 200 => array(
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [self::FAVORITE_PROPERTYNAME],
+ [
+ 200 => [
self::FAVORITE_PROPERTYNAME => true,
- )
- )
- ),
+ ]
+ ]
+ ],
// request none
- array(
- array('tag1', 'tag2', self::TAG_FAVORITE),
- array(),
- array(
- 200 => array()
- ),
- ),
+ [
+ ['tag1', 'tag2', self::TAG_FAVORITE],
+ [],
+ [
+ 200 => []
+ ],
+ ],
// request both with none set, receive both
- array(
- array(),
- array(self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME),
- array(
- 200 => array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array()),
+ [
+ [],
+ [self::TAGS_PROPERTYNAME, self::FAVORITE_PROPERTYNAME],
+ [
+ 200 => [
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList([]),
self::FAVORITE_PROPERTYNAME => false,
- )
- )
- ),
- );
+ ]
+ ]
+ ],
+ ];
}
public function testUpdateTags() {
$this->tagger->expects($this->at(0))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123)))
- ->willReturn(array(123 => array('tagkeep', 'tagremove', self::TAG_FAVORITE)));
+ ->with($this->equalTo([123]))
+ ->willReturn([123 => ['tagkeep', 'tagremove', self::TAG_FAVORITE]]);
// then tag as tag1 and tag2
$this->tagger->expects($this->at(1))
->with(123, 'tagremove');
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep'))
- ));
+ $propPatch = new \Sabre\DAV\PropPatch([
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2', 'tagkeep'])
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
$this->tagger->expects($this->at(0))
->method('getTagsForObjects')
- ->with($this->equalTo(array(123)))
- ->willReturn(array());
+ ->with($this->equalTo([123]))
+ ->willReturn([]);
// then tag as tag1 and tag2
$this->tagger->expects($this->at(1))
->with(123, 'tag2');
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
- self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(array('tag1', 'tag2', 'tagkeep'))
- ));
+ $propPatch = new \Sabre\DAV\PropPatch([
+ self::TAGS_PROPERTYNAME => new \OCA\DAV\Connector\Sabre\TagList(['tag1', 'tag2', 'tagkeep'])
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
->with(123, self::TAG_FAVORITE);
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::FAVORITE_PROPERTYNAME => true
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
->with(123, self::TAG_FAVORITE);
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::FAVORITE_PROPERTYNAME => false
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/dummypath',
}
public function testUpdatePrincipal() {
- $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch(array())));
+ $this->assertSame(0, $this->connector->updatePrincipal('foo', new PropPatch([])));
}
public function testSearchPrincipalsWithEmptySearchProperties() {
->with($systemTag, ['group1', 'group2']);
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::DISPLAYNAME_PROPERTYNAME => 'Test changed',
self::USERVISIBLE_PROPERTYNAME => 'false',
self::USERASSIGNABLE_PROPERTYNAME => 'true',
self::GROUPS_PROPERTYNAME => 'group1|group2',
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/systemtag/1',
->method('setTagGroups');
// properties to set
- $propPatch = new \Sabre\DAV\PropPatch(array(
+ $propPatch = new \Sabre\DAV\PropPatch([
self::GROUPS_PROPERTYNAME => 'group1|group2',
- ));
+ ]);
$this->plugin->handleUpdateProperties(
'/systemtag/1',
/**
* @param array $urlParams
*/
- public function __construct($urlParams = array()) {
+ public function __construct($urlParams = []) {
parent::__construct('encryption', $urlParams);
$this->encryptionManager = \OC::$server->getEncryptionManager();
$this->config = \OC::$server->getConfig();
$this->questionHelper = $questionHelper;
$this->secureRandom = $secureRandom;
// store one time passwords for the users
- $this->userPasswords = array();
+ $this->userPasswords = [];
}
/**
protected function encryptUsersFiles($uid, ProgressBar $progress, $userCount) {
$this->setupUserFS($uid);
- $directories = array();
+ $directories = [];
$directories[] = '/' . $uid . '/files';
while($root = array_pop($directories)) {
*/
protected function outputPasswords() {
$table = new Table($this->output);
- $table->setHeaders(array('Username', 'Private key password'));
+ $table->setHeaders(['Username', 'Private key password']);
//create rows
- $newPasswords = array();
- $unchangedPasswords = array();
+ $newPasswords = [];
+ $unchangedPasswords = [];
foreach ($this->userPasswords as $uid => $password) {
if (empty($password)) {
$unchangedPasswords[] = $uid;
$this->output->writeln("\n\nPassword successfully send to all users");
} else {
$table = new Table($this->output);
- $table->setHeaders(array('Username', 'Private key password'));
+ $table->setHeaders(['Username', 'Private key password']);
$this->output->writeln("\n\nCould not send password to following users:\n");
$rows = [];
foreach ($noMail as $uid) {
$this->cipher = $this->crypt->getLegacyCipher();
}
- return array('cipher' => $this->cipher, 'signed' => 'true');
+ return ['cipher' => $this->cipher, 'signed' => 'true'];
}
/**
$result = $this->crypt->symmetricEncryptFileContent($this->writeCache, $this->fileKey, $this->version + 1, $position);
$this->writeCache = '';
}
- $publicKeys = array();
+ $publicKeys = [];
if ($this->useMasterPassword === true) {
$publicKeys[$this->keyManager->getMasterKeyId()] = $this->keyManager->getPublicMasterKey();
} else {
if (!empty($fileKey)) {
- $publicKeys = array();
+ $publicKeys = [];
if ($this->useMasterPassword === true) {
$publicKeys[$this->keyManager->getMasterKeyId()] = $this->keyManager->getPublicMasterKey();
} else {
} else {
$this->logger->debug('no file key found, we assume that the file "{file}" is not encrypted',
- array('file' => $path, 'app' => 'encryption'));
+ ['file' => $path, 'app' => 'encryption']);
return false;
}
$fileKey = $this->keyManager->getFileKey($filePath, $this->user->getUID());
if (!empty($fileKey)) {
$accessList = $this->file->getAccessList($filePath);
- $publicKeys = array();
+ $publicKeys = [];
foreach ($accessList['users'] as $uid) {
$publicKeys[$uid] = $this->keyManager->getPublicKey($uid);
}
if (!empty($fileKey)) {
$accessList = $this->file->getAccessList($path);
- $publicKeys = array();
+ $publicKeys = [];
foreach ($accessList['users'] as $user) {
$publicKeys[$user] = $this->keyManager->getPublicKey($user);
}
/** @var OC_Theme $theme */
/** @var array $_ */
-print_unescaped($l->t("Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n", array($_['password'])));
+print_unescaped($l->t("Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n", [$_['password']]));
if ( isset($_['expiration']) ) {
- print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
+ print_unescaped($l->t("The share will expire on %s.", [$_['expiration']]));
print_unescaped("\n\n");
}
// TRANSLATORS term at the end of a mail
<td width="20px"> </td>
<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
<?php
- print_unescaped($l->t('Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section "basic encryption module" of your personal settings and update your encryption password by entering this password into the "old log-in password" field and your current login-password.<br><br>', array($_['password'])));
+ print_unescaped($l->t('Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section "basic encryption module" of your personal settings and update your encryption password by entering this password into the "old log-in password" field and your current login-password.<br><br>', [$_['password']]));
// TRANSLATORS term at the end of a mail
p($l->t('Cheers!'));
?>
$this->config->expects($this->once())
->method('getSystemValue')
->with($this->equalTo('openssl'), $this->equalTo([]))
- ->willReturn(array());
+ ->willReturn([]);
$result = self::invokePrivate($this->crypt, 'getOpenSSLConfig');
$this->assertSame(1, count($result));
$this->config->expects($this->once())
->method('getSystemValue')
->with($this->equalTo('openssl'), $this->equalTo([]))
- ->willReturn(array('foo' => 'bar', 'private_key_bits' => 1028));
+ ->willReturn(['foo' => 'bar', 'private_key_bits' => 1028]);
$result = self::invokePrivate($this->crypt, 'getOpenSSLConfig');
$this->assertSame(2, count($result));
* @return array
*/
public function dataProviderGetCipher() {
- return array(
- array('AES-128-CFB', 'AES-128-CFB'),
- array('AES-256-CFB', 'AES-256-CFB'),
- array('AES-128-CTR', 'AES-128-CTR'),
- array('AES-256-CTR', 'AES-256-CTR'),
+ return [
+ ['AES-128-CFB', 'AES-128-CFB'],
+ ['AES-256-CFB', 'AES-256-CFB'],
+ ['AES-128-CTR', 'AES-128-CTR'],
+ ['AES-256-CTR', 'AES-256-CTR'],
- array('unknown', 'AES-256-CTR')
- );
+ ['unknown', 'AES-256-CTR']
+ ];
}
/**
$result = self::invokePrivate(
$this->crypt,
'concatIV',
- array('content', 'my_iv'));
+ ['content', 'my_iv']);
$this->assertSame('content00iv00my_iv',
$result
* @dataProvider dataTestSplitMetaData
*/
public function testSplitMetaData($data, $expected) {
- $result = self::invokePrivate($this->crypt, 'splitMetaData', array($data, 'AES-256-CFB'));
+ $result = self::invokePrivate($this->crypt, 'splitMetaData', [$data, 'AES-256-CFB']);
$this->assertTrue(is_array($result));
$this->assertSame(3, count($result));
$this->assertArrayHasKey('encrypted', $result);
*/
public function testHasSignature($data, $expected) {
$this->assertSame($expected,
- $this->invokePrivate($this->crypt, 'hasSignature', array($data, 'AES-256-CFB'))
+ $this->invokePrivate($this->crypt, 'hasSignature', [$data, 'AES-256-CFB'])
);
}
$this->expectException(\OCP\Encryption\Exceptions\GenericEncryptionException::class);
$data = 'encryptedContent00iv001234567890123456xx';
- $this->invokePrivate($this->crypt, 'hasSignature', array($data, $cipher));
+ $this->invokePrivate($this->crypt, 'hasSignature', [$data, $cipher]);
}
public function dataTestHasSignatureFail() {
* test addPadding()
*/
public function testAddPadding() {
- $result = self::invokePrivate($this->crypt, 'addPadding', array('data'));
+ $result = self::invokePrivate($this->crypt, 'addPadding', ['data']);
$this->assertSame('dataxxx', $result);
}
* @param $expected
*/
public function testRemovePadding($data, $expected) {
- $result = self::invokePrivate($this->crypt, 'removePadding', array($data));
+ $result = self::invokePrivate($this->crypt, 'removePadding', [$data]);
$this->assertSame($expected, $result);
}
* @return array
*/
public function dataProviderRemovePadding() {
- return array(
- array('dataxx', 'data'),
- array('data', false)
- );
+ return [
+ ['dataxx', 'data'],
+ ['data', false]
+ ];
}
/**
public function testParseHeader() {
$header= 'HBEGIN:foo:bar:cipher:AES-256-CFB:HEND';
- $result = self::invokePrivate($this->crypt, 'parseHeader', array($header));
+ $result = self::invokePrivate($this->crypt, 'parseHeader', [$header]);
$this->assertTrue(is_array($result));
$this->assertSame(2, count($result));
$this->assertTrue(is_string($iv));
$this->assertSame(16, strlen($iv));
- $result = self::invokePrivate($this->crypt, 'encrypt', array($decrypted, $iv, $password));
+ $result = self::invokePrivate($this->crypt, 'encrypt', [$decrypted, $iv, $password]);
$this->assertTrue(is_string($result));
- return array(
+ return [
'password' => $password,
'iv' => $iv,
'encrypted' => $result,
- 'decrypted' => $decrypted);
+ 'decrypted' => $decrypted];
}
$result = self::invokePrivate(
$this->crypt,
'decrypt',
- array($data['encrypted'], $data['iv'], $data['password']));
+ [$data['encrypted'], $data['iv'], $data['password']]);
$this->assertSame($data['decrypted'], $result);
* test if public key from one of the recipients is missing
*/
public function testEndUser1() {
- $this->instance->begin('/foo/bar', 'user1', 'r', array(), array('users' => array('user1', 'user2', 'user3')));
+ $this->instance->begin('/foo/bar', 'user1', 'r', [], ['users' => ['user1', 'user2', 'user3']]);
$this->endTest();
}
public function testEndUser2() {
$this->expectException(\OCA\Encryption\Exceptions\PublicKeyMissingException::class);
- $this->instance->begin('/foo/bar', 'user2', 'r', array(), array('users' => array('user1', 'user2', 'user3')));
+ $this->instance->begin('/foo/bar', 'user2', 'r', [], ['users' => ['user1', 'user2', 'user3']]);
$this->endTest();
}
*/
public function testGetPathToRealFile($path, $expected) {
$this->assertSame($expected,
- self::invokePrivate($this->instance, 'getPathToRealFile', array($path))
+ self::invokePrivate($this->instance, 'getPathToRealFile', [$path])
);
}
public function dataProviderForTestGetPathToRealFile() {
- return array(
- array('/user/files/foo/bar.txt', '/user/files/foo/bar.txt'),
- array('/user/files/foo.txt', '/user/files/foo.txt'),
- array('/user/files_versions/foo.txt.v543534', '/user/files/foo.txt'),
- array('/user/files_versions/foo/bar.txt.v5454', '/user/files/foo/bar.txt'),
- );
+ return [
+ ['/user/files/foo/bar.txt', '/user/files/foo/bar.txt'],
+ ['/user/files/foo.txt', '/user/files/foo.txt'],
+ ['/user/files_versions/foo.txt.v543534', '/user/files/foo.txt'],
+ ['/user/files_versions/foo/bar.txt.v5454', '/user/files/foo/bar.txt'],
+ ];
}
/**
}
public function dataTestBegin() {
- return array(
- array('w', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'defaultCipher'),
- array('r', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'myCipher'),
- array('w', [], 'legacyCipher', 'defaultCipher', '', 'defaultCipher'),
- array('r', [], 'legacyCipher', 'defaultCipher', 'file_key', 'legacyCipher'),
- );
+ return [
+ ['w', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'defaultCipher'],
+ ['r', ['cipher' => 'myCipher'], 'legacyCipher', 'defaultCipher', 'fileKey', 'myCipher'],
+ ['w', [], 'legacyCipher', 'defaultCipher', '', 'defaultCipher'],
+ ['r', [], 'legacyCipher', 'defaultCipher', 'file_key', 'legacyCipher'],
+ ];
}
}
public function dataTestUpdate() {
- return array(
- array('', false),
- array('fileKey', true)
- );
+ return [
+ ['', false],
+ ['fileKey', true]
+ ];
}
public function testUpdateNoUsers() {
}
public function dataTestShouldEncrypt() {
- return array(
- array('/user1/files/foo.txt', true, true, true),
- array('/user1/files_versions/foo.txt', true, true, true),
- array('/user1/files_trashbin/foo.txt', true, true, true),
- array('/user1/some_folder/foo.txt', true, true, false),
- array('/user1/foo.txt', true, true, false),
- array('/user1/files', true, true, false),
- array('/user1/files_trashbin', true, true, false),
- array('/user1/files_versions', true, true, false),
+ return [
+ ['/user1/files/foo.txt', true, true, true],
+ ['/user1/files_versions/foo.txt', true, true, true],
+ ['/user1/files_trashbin/foo.txt', true, true, true],
+ ['/user1/some_folder/foo.txt', true, true, false],
+ ['/user1/foo.txt', true, true, false],
+ ['/user1/files', true, true, false],
+ ['/user1/files_trashbin', true, true, false],
+ ['/user1/files_versions', true, true, false],
// test if shouldEncryptHomeStorage is set to false
- array('/user1/files/foo.txt', false, true, false),
- array('/user1/files_versions/foo.txt', false, false, true),
- );
+ ['/user1/files/foo.txt', false, true, false],
+ ['/user1/files_versions/foo.txt', false, false, true],
+ ];
}
$this->assertTrue(
$this->instance->setRecoveryKey('pass',
- array('publicKey' => 'publicKey', 'privateKey' => 'privateKey'))
+ ['publicKey' => 'publicKey', 'privateKey' => 'privateKey'])
);
}
* @return array
*/
public function dataTestAddSystemKeys() {
- return array(
- array(['public' => true],[], 'user1', ['publicShareKey', 'recoveryKey']),
- array(['public' => false], [], 'user1', ['recoveryKey']),
- array(['public' => true],[], 'user2', ['publicShareKey']),
- array(['public' => false], [], 'user2', []),
- );
+ return [
+ [['public' => true],[], 'user1', ['publicShareKey', 'recoveryKey']],
+ [['public' => false], [], 'user1', ['recoveryKey']],
+ [['public' => true],[], 'user2', ['publicShareKey']],
+ [['public' => false], [], 'user2', []],
+ ];
}
public function testGetMasterKeyId() {
\OCP\Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$user1)
+ ['uid' => &$user1]
);
\OCP\Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$user2)
+ ['uid' => &$user2]
);
if ($user1 === $user2) {
$alreadySharedGroup = $this->getSharedWith($shareWith, \OCP\Share::SHARE_TYPE_REMOTE_GROUP, $share->getNode(), 1, 0);
if (!empty($alreadyShared) || !empty($alreadySharedGroup)) {
$message = 'Sharing %1$s failed, because this item is already shared with %2$s';
- $message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with %2$s', array($share->getNode()->getName(), $shareWith));
+ $message_t = $this->l->t('Sharing %1$s failed, because this item is already shared with %2$s', [$share->getNode()->getName(), $shareWith]);
$this->logger->debug(sprintf($message, $share->getNode()->getName(), $shareWith), ['app' => 'Federated File Sharing']);
throw new \Exception($message_t);
}
if ($user && $remote) {
$local = $this->addressHandler->generateRemoteURL();
- $fields = array(
+ $fields = [
'shareWith' => $user,
'token' => $token,
'name' => $name,
'sharedByFederatedId' => $sharedByFederatedId,
'remote' => $local,
'shareType' => $shareType
- );
+ ];
$result = $this->tryHttpPostToShareEndpoint($remote, '', $fields);
$status = json_decode($result['result'], true);
*/
public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission, $filename) {
- $fields = array(
+ $fields = [
'shareWith' => $shareWith,
'token' => $token,
'permission' => $permission,
'remoteId' => $shareId,
- );
+ ];
$ocmFields = $fields;
$ocmFields['remoteId'] = $id;
Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$shareWith)
+ ['uid' => &$shareWith]
);
$this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']);
} catch (NotFoundException $e) {
$file = null;
}
- $args = Filesystem::is_dir($file) ? array('dir' => $file) : array('dir' => dirname($file), 'scrollto' => $file);
+ $args = Filesystem::is_dir($file) ? ['dir' => $file] : ['dir' => dirname($file), 'scrollto' => $file];
$link = Util::linkToAbsolute('files', 'index.php', $args);
return [$file, $link];
}
public function dataTestSplitUserRemoteError() {
- return array(
+ return [
// Invalid path
- array('user@'),
+ ['user@'],
// Invalid user
- array('@server'),
- array('us/er@server'),
- array('us:er@server'),
+ ['@server'],
+ ['us/er@server'],
+ ['us:er@server'],
// Invalid splitting
- array('user'),
- array(''),
- array('us/erserver'),
- array('us:erserver'),
- );
+ ['user'],
+ [''],
+ ['us/erserver'],
+ ['us:erserver'],
+ ];
}
/**
$files_list = json_decode($files);
// in case we get only a single file
if (!is_array($files_list)) {
- $files_list = array($files);
+ $files_list = [$files];
}
/**
setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/');
}
-$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' );
+$server_params = [ 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ];
/**
* Http range requests support
exit();
}
- $data = array();
+ $data = [];
$baseUrl = \OC::$server->getURLGenerator()->linkTo('files', 'index.php') . '?dir=';
$permissions = $dirInfo->getPermissions();
$data['files'] = \OCA\Files\Helper::formatFileInfos($files);
$data['permissions'] = $permissions;
- \OC_JSON::success(array('data' => $data));
+ \OC_JSON::success(['data' => $data]);
} catch (\OCP\Files\StorageNotAvailableException $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files']);
\OC_JSON::error([
]);
} catch (\OCP\Files\StorageInvalidException $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files']);
- \OC_JSON::error(array(
- 'data' => array(
+ \OC_JSON::error([
+ 'data' => [
'exception' => StorageInvalidException::class,
'message' => $l->t('Storage invalid')
- )
- ));
+ ]
+ ]);
} catch (\Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files']);
- \OC_JSON::error(array(
- 'data' => array(
+ \OC_JSON::error([
+ 'data' => [
'exception' => \Exception::class,
'message' => $l->t('Unknown error')
- )
- ));
+ ]
+ ]);
}
// t('Files')
$l = \OC::$server->getL10N('files');
-\OC::$server->getSearch()->registerProvider(File::class, array('apps' => array('files')));
+\OC::$server->getSearch()->registerProvider(File::class, ['apps' => ['files']]);
$templateManager = \OC_Helper::getFileTemplateManager();
$templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp');
public const APP_ID = 'files';
- public function __construct(array $urlParams=array()) {
+ public function __construct(array $urlParams=[]) {
parent::__construct(self::APP_ID, $urlParams);
$container = $this->getContainer();
$server = $container->getServer();
if ($inputPath) {
$inputPath = '/' . trim($inputPath, '/');
list (, $user,) = explode('/', $inputPath, 3);
- $users = array($user);
+ $users = [$user];
} else if ($input->getOption('all')) {
$users = $this->userManager->search('');
} else {
$collapseClasses = 'collapsible';
}
- $favoritesSublistArray = Array();
+ $favoritesSublistArray = [];
$navBarPositionPosition = 6;
$currentCount = 0;
$l = \OC::$server->getL10N('files');
$maxUploadFileSize = \OCP\Util::maxUploadFilesize($dir, $storageInfo['free']);
$maxHumanFileSize = \OCP\Util::humanFileSize($maxUploadFileSize);
- $maxHumanFileSize = $l->t('Upload (max. %s)', array($maxHumanFileSize));
+ $maxHumanFileSize = $l->t('Upload (max. %s)', [$maxHumanFileSize]);
return [
'uploadMaxFilesize' => $maxUploadFileSize,
* @return array formatted file info
*/
public static function formatFileInfo(FileInfo $i) {
- $entry = array();
+ $entry = [];
$entry['id'] = $i['fileid'];
$entry['parentId'] = $i['parent'];
* @return array
*/
public static function formatFileInfos($fileInfos) {
- $files = array();
+ $files = [];
foreach ($fileInfos as $i) {
$files[] = self::formatFileInfo($i);
}
} else if ($sortAttribute === 'size') {
$sortFunc = 'compareSize';
}
- usort($files, array(Helper::class, $sortFunc));
+ usort($files, [Helper::class, $sortFunc]);
if ($sortDescending) {
$files = array_reverse($files);
}
public function updateFileTags($path, $tags) {
$fileId = $this->homeFolder->get($path)->getId();
- $currentTags = $this->tagger->getTagsForObjects(array($fileId));
+ $currentTags = $this->tagger->getTagsForObjects([$fileId]);
if (!empty($currentTags)) {
$currentTags = current($currentTags);
<label for="webdavurl"><?php p($l->t('WebDAV')); ?></label>
<input id="webdavurl" type="text" readonly="readonly"
value="<?php p($_['webdav_url']); ?>"/>
- <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em>
+ <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', [link_to_docs('user-webdav')])); ?></em>
</div>
</div>
'/' . $name,
null,
'/',
- array(
+ [
'name' => $name,
'size' => $size,
'mtime' => $mtime,
'type' => $isDir ? 'dir' : 'file',
'mimetype' => $isDir ? 'httpd/unix-directory' : 'application/octet-stream'
- ),
+ ],
null
);
}
* Returns a file list for testing
*/
private function getTestFileList() {
- return array(
+ return [
self::makeFileInfo('a.txt', 4, 2.3 * pow(10, 9)),
self::makeFileInfo('q.txt', 5, 150),
self::makeFileInfo('subdir2', 87, 128, true),
self::makeFileInfo('b.txt', 2.2 * pow(10, 9), 800),
self::makeFileInfo('o.txt', 12, 100),
self::makeFileInfo('subdir', 88, 125, true),
- );
+ ];
}
function sortDataProvider() {
- return array(
- array(
+ return [
+ [
'name',
false,
- array('subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'),
- ),
- array(
+ ['subdir', 'subdir2', 'a.txt', 'b.txt', 'o.txt', 'q.txt'],
+ ],
+ [
'name',
true,
- array('q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'),
- ),
- array(
+ ['q.txt', 'o.txt', 'b.txt', 'a.txt', 'subdir2', 'subdir'],
+ ],
+ [
'size',
false,
- array('a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'),
- ),
- array(
+ ['a.txt', 'q.txt', 'o.txt', 'subdir2', 'subdir', 'b.txt'],
+ ],
+ [
'size',
true,
- array('b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'),
- ),
- array(
+ ['b.txt', 'subdir', 'subdir2', 'o.txt', 'q.txt', 'a.txt'],
+ ],
+ [
'mtime',
false,
- array('o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'),
- ),
- array(
+ ['o.txt', 'subdir', 'subdir2', 'q.txt', 'b.txt', 'a.txt'],
+ ],
+ [
'mtime',
true,
- array('a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'),
- ),
- );
+ ['a.txt', 'b.txt', 'q.txt', 'subdir2', 'subdir', 'o.txt'],
+ ],
+ ];
}
/**
public function testSortByName($sort, $sortDescending, $expectedOrder) {
$files = self::getTestFileList();
$files = \OCA\Files\Helper::sortFiles($files, $sort, $sortDescending);
- $fileNames = array();
+ $fileNames = [];
foreach ($files as $fileInfo) {
$fileNames[] = $fileInfo->getName();
}
$fileId = $testFile->getId();
// set tags
- $this->tagService->updateFileTags('subdir/test.txt', array($tag1, $tag2));
+ $this->tagService->updateFileTags('subdir/test.txt', [$tag1, $tag2]);
- $this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag1));
- $this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag2));
+ $this->assertEquals([$fileId], $this->tagger->getIdsForTag($tag1));
+ $this->assertEquals([$fileId], $this->tagger->getIdsForTag($tag2));
// remove tag
- $this->tagService->updateFileTags('subdir/test.txt', array($tag2));
- $this->assertEquals(array(), $this->tagger->getIdsForTag($tag1));
- $this->assertEquals(array($fileId), $this->tagger->getIdsForTag($tag2));
+ $this->tagService->updateFileTags('subdir/test.txt', [$tag2]);
+ $this->assertEquals([], $this->tagger->getIdsForTag($tag1));
+ $this->assertEquals([$fileId], $this->tagger->getIdsForTag($tag2));
// clear tags
- $this->tagService->updateFileTags('subdir/test.txt', array());
- $this->assertEquals(array(), $this->tagger->getIdsForTag($tag1));
- $this->assertEquals(array(), $this->tagger->getIdsForTag($tag2));
+ $this->tagService->updateFileTags('subdir/test.txt', []);
+ $this->assertEquals([], $this->tagger->getIdsForTag($tag1));
+ $this->assertEquals([], $this->tagger->getIdsForTag($tag2));
// non-existing file
$caught = false;
try {
- $this->tagService->updateFileTags('subdir/unexist.txt', array($tag1));
+ $this->tagService->updateFileTags('subdir/unexist.txt', [$tag1]);
} catch (\OCP\Files\NotFoundException $e) {
$caught = true;
}
$users[$user->getUID()] = $user->getDisplayName();
}
-$results = array('groups' => $groups, 'users' => $users);
+$results = ['groups' => $groups, 'users' => $users];
\OC_JSON::success($results);
public function getSshKeys($keyLength = 1024) {
$key = $this->generateSshKeys($keyLength);
return new JSONResponse(
- array('data' => array(
+ ['data' => [
'private_key' => $key['privatekey'],
'public_key' => $key['publickey']
- ),
+ ],
'status' => 'success'
- ));
+ ]);
}
/**
$permissions |= \OCP\Constants::PERMISSION_DELETE;
}
- $entry = array(
+ $entry = [
'name' => basename($mountPoint),
'path' => $path,
'type' => 'dir',
'permissions' => $permissions,
'id' => $mountConfig['id'],
'class' => $mountConfig['class']
- );
+ ];
return $entry;
}
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
} else {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', [$id])
],
Http::STATUS_FORBIDDEN
);
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
} catch (NotFoundException $e) {
return new DataResponse(
[
- 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id))
+ 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id])
],
Http::STATUS_NOT_FOUND
);
private function headObject($key) {
if (!isset($this->objectCache[$key])) {
try {
- $this->objectCache[$key] = $this->getConnection()->headObject(array(
+ $this->objectCache[$key] = $this->getConnection()->headObject([
'Bucket' => $this->bucket,
'Key' => $key
- ));
+ ]);
} catch (S3Exception $e) {
if ($e->getStatusCode() >= 500) {
throw $e;
$stmt = \OC::$server->getDatabaseConnection()->prepare(
'SELECT `numeric_id`, `id` FROM `*PREFIX*storages` WHERE `id` IN (?, ?)'
);
- $stmt->execute(array($oldId, $this->id));
+ $stmt->execute([$oldId, $this->id]);
while ($row = $stmt->fetch()) {
$storages[$row['id']] = $row['numeric_id'];
}
$stmt = \OC::$server->getDatabaseConnection()->prepare(
'UPDATE `*PREFIX*storages` SET `id` = ? WHERE `id` = ?'
);
- $stmt->execute(array($this->id, $oldId));
+ $stmt->execute([$this->id, $oldId]);
}
// only the bucket based id may exist, do nothing
}
}
try {
- $this->getConnection()->putObject(array(
+ $this->getConnection()->putObject([
'Bucket' => $this->bucket,
'Key' => $path . '/',
'Body' => '',
'ContentType' => 'httpd/unix-directory'
- ));
+ ]);
$this->testTimeout();
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
}
private function batchDelete($path = null) {
- $params = array(
+ $params = [
'Bucket' => $this->bucket
- );
+ ];
if ($path !== null) {
$params['Prefix'] = $path . '/';
}
}
try {
- $files = array();
+ $files = [];
$results = $this->getConnection()->getPaginator('ListObjects', [
'Bucket' => $this->bucket,
'Delimiter' => '/',
public function touch($path, $mtime = null) {
$path = $this->normalizePath($path);
- $metadata = array();
+ $metadata = [];
if (is_null($mtime)) {
$mtime = time();
}
if ($this->is_file($path1)) {
try {
- $this->getConnection()->copyObject(array(
+ $this->getConnection()->copyObject([
'Bucket' => $this->bucket,
'Key' => $this->cleanKey($path2),
'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1)
- ));
+ ]);
$this->testTimeout();
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
$this->remove($path2);
try {
- $this->getConnection()->copyObject(array(
+ $this->getConnection()->copyObject([
'Bucket' => $this->bucket,
'Key' => $path2 . '/',
'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1 . '/')
- ));
+ ]);
$this->testTimeout();
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
case 'a':
case 'ab':
//these are supported by the wrapper
- $context = stream_context_create(array('ftp' => array('overwrite' => true)));
+ $context = stream_context_create(['ftp' => ['overwrite' => true]]);
$handle = fopen($this->constructUrl($path), $mode, false, $context);
return RetryWrapper::wrap($handle);
case 'r+':
if (function_exists('ftp_login')) {
return true;
} else {
- return array('ftp');
+ return ['ftp'];
}
}
try {
$keyPath = $this->hostKeysPath();
if (file_exists($keyPath)) {
- $hosts = array();
- $keys = array();
+ $hosts = [];
+ $keys = [];
$lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines) {
foreach ($lines as $line) {
}
} catch (\Exception $e) {
}
- return array();
+ return [];
}
/**
}
$id = md5('sftp:' . $path);
- $dirStream = array();
+ $dirStream = [];
foreach($list as $file) {
if ($file !== '.' && $file !== '..') {
$dirStream[] = $file;
case 'x+':
case 'c':
case 'c+':
- $context = stream_context_create(array('sftp' => array('session' => $this->getConnection())));
+ $context = stream_context_create(['sftp' => ['session' => $this->getConnection()]]);
$handle = fopen($this->constructUrl($path), $mode, false, $context);
return RetryWrapper::wrap($handle);
}
$mtime = $stat ? $stat['mtime'] : -1;
$size = $stat ? $stat['size'] : 0;
- return array('mtime' => $mtime, 'size' => $size, 'ctime' => -1);
+ return ['mtime' => $mtime, 'size' => $size, 'ctime' => -1];
} catch (\Exception $e) {
return false;
}
}
try {
- $this->statCache = array();
+ $this->statCache = [];
$content = $this->share->dir($this->buildPath($path));
foreach ($content as $file) {
if ($file->isDirectory()) {
$mtime = floor($mtime);
}
- $stat = array();
+ $stat = [];
$stat['size'] = (int)$object->contentLength;
$stat['mtime'] = $mtime;
$stat['atime'] = time();
}
$path = $this->normalizePath($path);
$dh = $this->opendir($path);
- $content = array();
+ $content = [];
while (($file = readdir($dh)) !== false) {
$content[] = $file;
}
* @deprecated 8.2.0 use UserGlobalStoragesService::getStorages() and UserStoragesService::getStorages()
*/
public static function getAbsoluteMountPoints($uid) {
- $mountPoints = array();
+ $mountPoints = [];
$userGlobalStoragesService = self::$app->getContainer()->query(UserGlobalStoragesService::class);
$userStoragesService = self::$app->getContainer()->query(UserStoragesService::class);
return $mountPoints;
}
}
- return array();
+ return [];
}
/**
*/
public static function makeConfigHash($config) {
$data = json_encode(
- array(
+ [
'c' => $config['backend'],
'a' => $config['authMechanism'],
'm' => $config['mountpoint'],
'o' => $config['options'],
'p' => isset($config['priority']) ? $config['priority'] : -1,
'mo' => isset($config['mountOptions']) ? $config['mountOptions'] : [],
- )
+ ]
);
return hash('md5', $data);
}
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
}
function mountPointNamesProvider() {
- return array(
- array(''),
- array('/'),
- array('//'),
- );
+ return [
+ [''],
+ ['/'],
+ ['//'],
+ ];
}
/**
$mountPoint,
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
$mountPoint,
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OC\Files\Storage\InvalidStorage',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OC\Files\Storage\InvalidStorage',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\OCA\Files_External\Lib\Auth\NullMechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\Auth\Mechanism',
- array(),
+ [],
[],
[],
[],
'mount',
'\OCA\Files_External\Lib\Storage\SMB',
'\Auth\Mechanism',
- array(),
+ [],
[],
[],
[],
class OwnCloudFunctionsTest extends \Test\TestCase {
function configUrlProvider() {
- return array(
- array(
- array(
+ return [
+ [
+ [
'host' => 'testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'http://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'testhost',
'root' => 'testroot',
'secure' => true
- ),
+ ],
'https://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'http://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost',
'root' => 'testroot',
'secure' => false
- ),
+ ],
'https://testhost/remote.php/webdav/testroot/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost/testroot',
'root' => '',
'secure' => false
- ),
+ ],
'https://testhost/testroot/remote.php/webdav/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'https://testhost/testroot',
'root' => 'subdir',
'secure' => false
- ),
+ ],
'https://testhost/testroot/remote.php/webdav/subdir/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost/testroot',
'root' => 'subdir',
'secure' => true
- ),
+ ],
'http://testhost/testroot/remote.php/webdav/subdir/',
- ),
- array(
- array(
+ ],
+ [
+ [
'host' => 'http://testhost/testroot/',
'root' => '/subdir',
'secure' => false
- ),
+ ],
'http://testhost/testroot/remote.php/webdav/subdir/',
- ),
- );
+ ],
+ ];
}
/**
protected function setUp(): void {
parent::setUp();
$this->dbConfig = new CleaningDBConfig(\OC::$server->getDatabaseConnection(), \OC::$server->getCrypto());
- self::$hookCalls = array();
+ self::$hookCalls = [];
$config = \OC::$server->getConfig();
$this->dataDir = $config->getSystemValue(
'datadirectory',
protected function tearDown(): void {
\OC_Mount_Config::$skipTest = false;
- self::$hookCalls = array();
+ self::$hookCalls = [];
if ($this->dbConfig) {
$this->dbConfig->clean();
}
}
public static function createHookCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_create_mount,
'params' => $params
- );
+ ];
}
public static function deleteHookCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_delete_mount,
'params' => $params
- );
+ ];
}
/**
}
public function testConstructUrl(){
- $config = array ( 'host' => 'localhost',
+ $config = [ 'host' => 'localhost',
'user' => 'ftp',
'password' => 'ftp',
'root' => '/',
- 'secure' => false );
+ 'secure' => false ];
$instance = new FTP($config);
$this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
public function directoryProvider() {
// doesn't support leading/trailing spaces
- return array(array('folder'));
+ return [['folder']];
}
public function testRenameWithSpaces() {
}
// this is now more a template now for your private configurations
-return array(
- 'ftp'=>array(
+return [
+ 'ftp'=>[
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'password'=>'test',
'root'=>'/test',
- ),
- 'webdav'=>array(
+ ],
+ 'webdav'=>[
'run'=>false,
'host'=>'localhost',
'user'=>'test',
// (only in tests)
// set to higher value for lighttpd webdav
'wait'=> 0
- ),
- 'owncloud'=>array(
+ ],
+ 'owncloud'=>[
'run'=>false,
'host'=>'localhost/owncloud',
'user'=>'test',
'password'=>'test',
'root'=>'',
- ),
- 'swift' => array(
+ ],
+ 'swift' => [
'run' => false,
'user' => 'test',
'bucket' => 'test',
//'service_name' => 'swift', //should be 'swift' for OpenStack Object Storage and 'cloudFiles' for Rackspace Cloud Files (default value)
//'url' => 'https://identity.api.rackspacecloud.com/v2.0/', //to be used with Rackspace Cloud Files and OpenStack Object Storage
//'timeout' => 5 // timeout of HTTP requests in seconds
- ),
- 'smb'=>array(
+ ],
+ 'smb'=>[
'run'=>false,
'user'=>'test',
'password'=>'test',
'host'=>'localhost',
'share'=>'/test',
'root'=>'/test/',
- ),
- 'amazons3'=>array(
+ ],
+ 'amazons3'=>[
'run'=>false,
'key'=>'test',
'secret'=>'test',
//'region' => 'eu-west-1',
//'test'=>'true',
//'timeout'=>20
- ),
- 'sftp' => array (
+ ],
+ 'sftp' => [
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'password'=>'test',
'root'=>'/test'
- ),
- 'sftp_key' => array (
+ ],
+ 'sftp_key' => [
'run'=>false,
'host'=>'localhost',
'user'=>'test',
'public_key'=>'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJPTvz3OLonF2KSGEKP/nd4CPmRYvemG2T4rIiNYjDj0U5y+2sKEWbjiUlQl2bsqYuVoJ+/UNJlGQbbZ08kQirFeo1GoWBzqioaTjUJfbLN6TzVVKXxR9YIVmH7Ajg2iEeGCndGgbmnPfj+kF9TR9IH8vMVvtubQwf7uEwB0ALhw== phpseclib-generated-key',
'private_key'=>'test',
'root'=>'/test'
- ),
-);
+ ],
+];
$this->emitAccessShareHook($share);
- $server_params = array( 'head' => $this->request->getMethod() === 'HEAD' );
+ $server_params = [ 'head' => $this->request->getMethod() === 'HEAD' ];
/**
* Http range requests support
$this->writeShareToDb($remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType);
- $options = array(
+ $options = [
'remote' => $remote,
'token' => $token,
'password' => $password,
'mountpoint' => $mountPoint,
'owner' => $owner
- );
+ ];
return $this->mountShare($options);
}
(`remote`, `share_token`, `password`, `name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`, `accepted`, `remote_id`, `parent`, `share_type`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
');
- return $query->execute(array($remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType));
+ return $query->execute([$remote, $token, $password, $name, $owner, $user, $mountPoint, $hash, $accepted, $remoteId, $parent, $shareType]);
}
/**
SELECT `id`, `remote`, `remote_id`, `share_token`, `name`, `owner`, `user`, `mountpoint`, `accepted`, `parent`, `share_type`, `password`, `mountpoint_hash`
FROM `*PREFIX*share_external`
WHERE `id` = ?');
- $result = $getShare->execute(array($id));
+ $result = $getShare->execute([$id]);
$share = $result ? $getShare->fetch() : [];
`mountpoint` = ?,
`mountpoint_hash` = ?
WHERE `id` = ? AND `user` = ?');
- $userShareAccepted = $acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
+ $userShareAccepted = $acceptShare->execute([1, $mountPoint, $hash, $id, $this->uid]);
} else {
$result = $this->writeShareToDb(
$share['remote'],
if ($share && (int)$share['share_type'] === Share::SHARE_TYPE_USER) {
$removeShare = $this->connection->prepare('
DELETE FROM `*PREFIX*share_external` WHERE `id` = ? AND `user` = ?');
- $removeShare->execute(array($id, $this->uid));
+ $removeShare->execute([$id, $this->uid]);
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
$this->processNotification($id);
$endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
$url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . Share::RESPONSE_FORMAT;
- $fields = array('token' => $token);
+ $fields = ['token' => $token];
$client = $this->clientService->newClient();
WHERE `mountpoint_hash` = ?
AND `user` = ?
');
- $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid));
+ $result = (bool)$query->execute([$target, $targetHash, $sourceHash, $this->uid]);
return $result;
}
SELECT `remote`, `share_token`, `remote_id`, `share_type`, `id`
FROM `*PREFIX*share_external`
WHERE `mountpoint_hash` = ? AND `user` = ?');
- $result = $getShare->execute(array($hash, $this->uid));
+ $result = $getShare->execute([$hash, $this->uid]);
$share = $getShare->fetch();
$getShare->closeCursor();
DELETE FROM `*PREFIX*share_external`
WHERE `id` = ?
');
- $result = (bool)$query->execute(array((int)$share['id']));
+ $result = (bool)$query->execute([(int)$share['id']]);
} else if ($result && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
$query = $this->connection->prepare('
UPDATE `*PREFIX*share_external`
SET `accepted` = ?
WHERE `id` = ?');
- $result = (bool)$query->execute(array(0, (int)$share['id']));
+ $result = (bool)$query->execute([0, (int)$share['id']]);
}
if($result) {
SELECT `remote`, `share_token`, `remote_id`
FROM `*PREFIX*share_external`
WHERE `user` = ?');
- $result = $getShare->execute(array($uid));
+ $result = $getShare->execute([$uid]);
if ($result) {
$shares = $getShare->fetchAll();
DELETE FROM `*PREFIX*share_external`
WHERE `user` = ?
');
- return (bool)$query->execute(array($uid));
+ return (bool)$query->execute([$uid]);
}
/**
$this->mountPoint = $options['mountpoint'];
$this->token = $options['token'];
- parent::__construct(array(
+ parent::__construct([
'secure' => $secure,
'host' => $host,
'root' => $root,
'user' => $options['token'],
'password' => (string)$options['password']
- ));
+ ]);
}
public function getWatcher($path = '', $storage = null) {
}
}
- $excludeList = is_array($exclude) ? $exclude : array();
+ $excludeList = is_array($exclude) ? $exclude : [];
return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
}
if ($format === self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call
$item = array_shift($items);
- return array(
+ return [
'parent' => $item['parent'],
'path' => $item['path'],
'storage' => $item['storage'],
'permissions' => $item['permissions'],
'uid_owner' => $item['uid_owner'],
- );
+ ];
} else if ($format === self::FORMAT_GET_FOLDER_CONTENTS) {
- $files = array();
+ $files = [];
foreach ($items as $item) {
- $file = array();
+ $file = [];
$file['fileid'] = $item['file_source'];
$file['storage'] = $item['storage'];
$file['path'] = $item['file_target'];
}
return $files;
} else if ($format === self::FORMAT_OPENDIR) {
- $files = array();
+ $files = [];
foreach ($items as $item) {
$files[] = basename($item['file_target']);
}
return $files;
} else if ($format === self::FORMAT_GET_ALL) {
- $ids = array();
+ $ids = [];
foreach ($items as $item) {
$ids[] = $item['file_source'];
}
return $ids;
} else if ($format === self::FORMAT_PERMISSIONS) {
- $filePermissions = array();
+ $filePermissions = [];
foreach ($items as $item) {
$filePermissions[$item['file_source']] = $item['permissions'];
}
return $filePermissions;
} else if ($format === self::FORMAT_TARGET_NAMES) {
- $targets = array();
+ $targets = [];
foreach ($items as $item) {
$targets[] = $item['file_target'];
}
return $targets;
}
- return array();
+ return [];
}
/**
* @return array with shares
*/
public function getParents($itemSource, $shareWith = null, $owner = null) {
- $result = array();
+ $result = [];
$parent = $this->getParentId($itemSource);
$userManager = \OC::$server->getUserManager();
}
public function getChildren($itemSource) {
- $children = array();
- $parents = array($itemSource);
+ $children = [];
+ $parents = [$itemSource];
$qb = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$qb->select('id')
$result = $qb->execute();
- $parents = array();
+ $parents = [];
while ($file = $result->fetch()) {
- $children[] = array('source' => $file['fileid'], 'file_path' => $file['name']);
+ $children[] = ['source' => $file['fileid'], 'file_path' => $file['name']];
// If a child folder is found look inside it
if ((int) $file['mimetype'] === $mimetype) {
$parents[] = $file['fileid'];
}
}
}
- $info = array(
+ $info = [
'target' => $this->getMountPoint() . $path,
'source' => $source,
'mode' => $mode,
- );
+ ];
\OCP\Util::emitHook('\OC\Files\Storage\Shared', 'fopen', $info);
return $this->nonMaskedStorage->fopen($this->getUnjailedPath($path), $mode);
}
} else {
http_response_code(307);
}
- header('Location: ' . $urlGenerator->linkToRoute($route, array('token' => $token)));
+ header('Location: ' . $urlGenerator->linkToRoute($route, ['token' => $token]));
} else {
http_response_code(404);
$tmpl = new OCP\Template('', '404', 'guest');
<div class="directDownload">
<a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button">
<span class="icon icon-download"></span>
- <?php p($l->t('Download %s', array($_['filename'])))?> (<?php p($_['fileSize']) ?>)
+ <?php p($l->t('Download %s', [$_['filename']]))?> (<?php p($_['fileSize']) ?>)
</a>
</div>
<?php endif; ?>
$share3->setStatus(IShare::STATUS_ACCEPTED);
$this->shareManager->updateShare($share3);
- $testValues=array(
- array('query' => $this->folder,
- 'expectedResult' => $this->folder . $this->filename),
- array('query' => $this->folder . $this->subfolder,
- 'expectedResult' => $this->folder . $this->subfolder . $this->filename),
- );
+ $testValues=[
+ ['query' => $this->folder,
+ 'expectedResult' => $this->folder . $this->filename],
+ ['query' => $this->folder . $this->subfolder,
+ 'expectedResult' => $this->folder . $this->subfolder . $this->filename],
+ ];
foreach ($testValues as $value) {
$ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER2);
*/
public static function initTestMountPointsHook($data) {
if ($data['user'] === self::TEST_FILES_SHARING_API_USER1) {
- \OC\Files\Filesystem::mount(self::$tempStorage, array(), '/' . self::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME);
+ \OC\Files\Filesystem::mount(self::$tempStorage, [], '/' . self::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME);
}
}
* Tests mounting a folder that is an external storage mount point.
*/
public function testShareStorageMountPoint() {
- $tempStorage = new \OC\Files\Storage\Temporary(array());
+ $tempStorage = new \OC\Files\Storage\Temporary([]);
$tempStorage->file_put_contents('test.txt', 'abcdef');
$tempStorage->getScanner()->scan('');
}
function searchDataProvider() {
- return array(
- array('%another%',
- array(
- array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
- array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
- )
- ),
- array('%Another%',
- array(
- array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
- array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
- )
- ),
- array('%dir%',
- array(
- array('name' => 'emptydir', 'path' => 'emptydir'),
- array('name' => 'subdir', 'path' => 'subdir'),
- array('name' => 'shareddir', 'path' => ''),
- )
- ),
- array('%Dir%',
- array(
- array('name' => 'emptydir', 'path' => 'emptydir'),
- array('name' => 'subdir', 'path' => 'subdir'),
- array('name' => 'shareddir', 'path' => ''),
- )
- ),
- array('%txt%',
- array(
- array('name' => 'bar.txt', 'path' => 'bar.txt'),
- array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
- array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
- )
- ),
- array('%Txt%',
- array(
- array('name' => 'bar.txt', 'path' => 'bar.txt'),
- array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
- array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
- )
- ),
- array('%',
- array(
- array('name' => 'bar.txt', 'path' => 'bar.txt'),
- array('name' => 'emptydir', 'path' => 'emptydir'),
- array('name' => 'subdir', 'path' => 'subdir'),
- array('name' => 'another too.txt', 'path' => 'subdir/another too.txt'),
- array('name' => 'another.txt', 'path' => 'subdir/another.txt'),
- array('name' => 'not a text file.xml', 'path' => 'subdir/not a text file.xml'),
- array('name' => 'shareddir', 'path' => ''),
- )
- ),
- array('%nonexistent%',
- array(
- )
- ),
- );
+ return [
+ ['%another%',
+ [
+ ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+ ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+ ]
+ ],
+ ['%Another%',
+ [
+ ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+ ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+ ]
+ ],
+ ['%dir%',
+ [
+ ['name' => 'emptydir', 'path' => 'emptydir'],
+ ['name' => 'subdir', 'path' => 'subdir'],
+ ['name' => 'shareddir', 'path' => ''],
+ ]
+ ],
+ ['%Dir%',
+ [
+ ['name' => 'emptydir', 'path' => 'emptydir'],
+ ['name' => 'subdir', 'path' => 'subdir'],
+ ['name' => 'shareddir', 'path' => ''],
+ ]
+ ],
+ ['%txt%',
+ [
+ ['name' => 'bar.txt', 'path' => 'bar.txt'],
+ ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+ ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+ ]
+ ],
+ ['%Txt%',
+ [
+ ['name' => 'bar.txt', 'path' => 'bar.txt'],
+ ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+ ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+ ]
+ ],
+ ['%',
+ [
+ ['name' => 'bar.txt', 'path' => 'bar.txt'],
+ ['name' => 'emptydir', 'path' => 'emptydir'],
+ ['name' => 'subdir', 'path' => 'subdir'],
+ ['name' => 'another too.txt', 'path' => 'subdir/another too.txt'],
+ ['name' => 'another.txt', 'path' => 'subdir/another.txt'],
+ ['name' => 'not a text file.xml', 'path' => 'subdir/not a text file.xml'],
+ ['name' => 'shareddir', 'path' => ''],
+ ]
+ ],
+ ['%nonexistent%',
+ [
+ ]
+ ],
+ ];
}
/**
*/
function testSearchByMime() {
$results = $this->sharedStorage->getCache()->searchByMime('text');
- $check = array(
- array(
+ $check = [
+ [
'name' => 'bar.txt',
'path' => 'bar.txt'
- ),
- array(
+ ],
+ [
'name' => 'another too.txt',
'path' => 'subdir/another too.txt'
- ),
- array(
+ ],
+ [
'name' => 'another.txt',
'path' => 'subdir/another.txt'
- ),
- );
+ ],
+ ];
$this->verifyFiles($check, $results);
}
// additional root will always contain the example file "welcome.txt",
// so this will be part of the result
$this->verifyFiles(
- array(
- array(
+ [
+ [
'name' => 'welcome.txt',
'path' => 'files/welcome.txt',
'mimetype' => 'text/plain',
- ),
- array(
+ ],
+ [
'name' => 'shareddir',
'path' => 'files/shareddir',
'mimetype' => 'httpd/unix-directory',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- array(
+ ],
+ [
'name' => 'shared single file.txt',
'path' => 'files/shared single file.txt',
'mimetype' => 'text/plain',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- ),
+ ],
+ ],
$results
);
}
$results = $this->user2View->getDirectoryContent('/shareddir');
$this->verifyFiles(
- array(
- array(
+ [
+ [
'name' => 'bar.txt',
'path' => 'bar.txt',
'mimetype' => 'text/plain',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- array(
+ ],
+ [
'name' => 'emptydir',
'path' => 'emptydir',
'mimetype' => 'httpd/unix-directory',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- array(
+ ],
+ [
'name' => 'subdir',
'path' => 'subdir',
'mimetype' => 'httpd/unix-directory',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- ),
+ ],
+ ],
$results
);
}
$results = $thirdView->getDirectoryContent('/subdir');
$this->verifyFiles(
- array(
- array(
+ [
+ [
'name' => 'another too.txt',
'path' => 'another too.txt',
'mimetype' => 'text/plain',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- array(
+ ],
+ [
'name' => 'another.txt',
'path' => 'another.txt',
'mimetype' => 'text/plain',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- array(
+ ],
+ [
'name' => 'not a text file.xml',
'path' => 'not a text file.xml',
'mimetype' => 'application/xml',
'uid_owner' => self::TEST_FILES_SHARING_API_USER1,
'displayname_owner' => 'User One',
- ),
- ),
+ ],
+ ],
$results
);
}
}
}
- $this->assertEquals(array(), $results);
+ $this->assertEquals([], $results);
}
/**
->willReturn(true);
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
- ->setMethods(array('canAccessShare'))
+ ->setMethods(['canAccessShare'])
->getMock();
$helper->method('canAccessShare')
->with($share, $this->currentUser)
->willReturn(true);
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
- ->setMethods(array('createShare'))
+ ->setMethods(['createShare'])
->getMock();
$helper->method('createShare')
->with(
->willReturn(true);
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
- ->setMethods(array('createShare'))
+ ->setMethods(['createShare'])
->getMock();
$helper->method('createShare')
->with(
->willReturn(true);
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
- ->setMethods(array('formatShare'))
+ ->setMethods(['formatShare'])
->getMock();
$helper->method('formatShare')
->with($share)
});
$response = $this->shareController->showShare();
- $sharedTmplParams = array(
+ $sharedTmplParams = [
'displayName' => 'ownerDisplay',
'owner' => 'ownerUID',
'filename' => 'file1.txt',
'note' => $note,
'hideDownload' => false,
'showgridview' => false
- );
+ ];
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');
});
$response = $this->shareController->showShare();
- $sharedTmplParams = array(
+ $sharedTmplParams = [
'displayName' => 'ownerDisplay',
'owner' => 'ownerUID',
'filename' => 'file1.txt',
'note' => $note,
'hideDownload' => true,
'showgridview' => false
- );
+ ];
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');
unset($responseParams['folder']);
$response->setParams($responseParams);
- $sharedTmplParams = array(
+ $sharedTmplParams = [
'displayName' => 'ownerDisplay',
'owner' => 'ownerUID',
'filename' => '/fileDrop',
'note' => '',
'hideDownload' => false,
'showgridview' => false
- );
+ ];
$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
$csp->addAllowedFrameDomain('\'self\'');
);
$this->cache->put(
'test.txt',
- array(
+ [
'mimetype' => 'text/plain',
'size' => 5,
'mtime' => 123,
- )
+ ]
);
}
public function testGetFolderPopulatesOwner() {
$dirId = $this->cache->put(
'subdir',
- array(
+ [
'mimetype' => 'httpd/unix-directory',
'size' => 5,
'mtime' => 123,
- )
+ ]
);
$this->cache->put(
'subdir/contents.txt',
- array(
+ [
'mimetype' => 'text/plain',
'size' => 5,
'mtime' => 123,
- )
+ ]
);
$results = $this->cache->getFolderContentsById($dirId);
class ExternalStorageTest extends \Test\TestCase {
function optionsProvider() {
- return array(
- array(
+ return [
+ [
'http://remoteserver:8080/owncloud',
'http://remoteserver:8080/owncloud/public.php/webdav/',
- ),
+ ],
// extra slash
- array(
+ [
'http://remoteserver:8080/owncloud/',
'http://remoteserver:8080/owncloud/public.php/webdav/',
- ),
+ ],
// extra path
- array(
+ [
'http://remoteserver:8080/myservices/owncloud/',
'http://remoteserver:8080/myservices/owncloud/public.php/webdav/',
- ),
+ ],
// root path
- array(
+ [
'http://remoteserver:8080/',
'http://remoteserver:8080/public.php/webdav/',
- ),
+ ],
// without port
- array(
+ [
'http://remoteserver/oc.test',
'http://remoteserver/oc.test/public.php/webdav/',
- ),
+ ],
// https
- array(
+ [
'https://remoteserver/',
'https://remoteserver/public.php/webdav/',
- ),
- );
+ ],
+ ];
}
private function getTestStorage($uri) {
->willReturn($client);
return new TestSharingExternalStorage(
- array(
+ [
'cloudId' => new CloudId('testOwner@' . $uri, 'testOwner', $uri),
'remote' => $uri,
'owner' => 'testOwner',
'manager' => null,
'certificateManager' => $certificateManager,
'HttpClientService' => $httpClientService,
- )
+ ]
);
}
$permission5 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE;
$permission6 = \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE;
- return array(
- array($permission1, false),
- array($permission3, true),
- array($permission4, true),
- array($permission5, false),
- array($permission6, false),
- );
+ return [
+ [$permission1, false],
+ [$permission3, true],
+ [$permission4, true],
+ [$permission5, false],
+ [$permission6, false],
+ ];
}
public function testFileOwner() {
}
public function dataProviderTestStripUserFilesPath() {
- return array(
- array('/user/files/foo.txt', '/foo.txt', false),
- array('/user/files/folder/foo.txt', '/folder/foo.txt', false),
- array('/data/user/files/foo.txt', null, true),
- array('/data/user/files/', null, true),
- array('/files/foo.txt', null, true),
- array('/foo.txt', null, true),
- );
+ return [
+ ['/user/files/foo.txt', '/foo.txt', false],
+ ['/user/files/folder/foo.txt', '/folder/foo.txt', false],
+ ['/data/user/files/foo.txt', null, true],
+ ['/data/user/files/', null, true],
+ ['/files/foo.txt', null, true],
+ ['/foo.txt', null, true],
+ ];
}
public function dataPermissionMovedGroupShare() {
$mountConfigManager = \OC::$server->getMountProviderCollection();
$mounts = $mountConfigManager->getMountsForUser(\OC::$server->getUserManager()->get(self::TEST_FILES_SHARING_API_USER3));
- array_walk($mounts, array(\OC\Files\Filesystem::getMountManager(), 'addMount'));
+ array_walk($mounts, [\OC\Files\Filesystem::getMountManager(), 'addMount']);
$this->assertTrue($rootView->file_exists('/' . self::TEST_FILES_SHARING_API_USER3 . '/files/' . $this->filename));
list($sharedStorage,) = $view->resolvePath($this->folder);
$this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
- $sourceStorage = new \OC\Files\Storage\Temporary(array());
+ $sourceStorage = new \OC\Files\Storage\Temporary([]);
$sourceStorage->file_put_contents('foo.txt', 'asd');
$sharedStorage->copyFromStorage($sourceStorage, 'foo.txt', 'bar.txt');
list($sharedStorage,) = $view->resolvePath($this->folder);
$this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
- $sourceStorage = new \OC\Files\Storage\Temporary(array());
+ $sourceStorage = new \OC\Files\Storage\Temporary([]);
$sourceStorage->file_put_contents('foo.txt', 'asd');
$sharedStorage->moveFromStorage($sourceStorage, 'foo.txt', 'bar.txt');
$textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$dataLen = strlen($textData);
- $this->sharedCache->put('bar.txt', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
+ $this->sharedCache->put('bar.txt', ['mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain']);
$this->sharedStorage->file_put_contents('bar.txt', $textData);
- $this->sharedCache->put('', array('mtime' => 10, 'storage_mtime' => 10, 'size' => '-1', 'mimetype' => 'httpd/unix-directory'));
+ $this->sharedCache->put('', ['mtime' => 10, 'storage_mtime' => 10, 'size' => '-1', 'mimetype' => 'httpd/unix-directory']);
// run the propagation code
$this->sharedStorage->getWatcher()->checkUpdate('');
$textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$dataLen = strlen($textData);
- $this->sharedCache->put('subdir/bar.txt', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
+ $this->sharedCache->put('subdir/bar.txt', ['mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain']);
$this->sharedStorage->file_put_contents('subdir/bar.txt', $textData);
- $this->sharedCache->put('subdir', array('mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain'));
+ $this->sharedCache->put('subdir', ['mtime' => 10, 'storage_mtime' => 10, 'size' => $dataLen, 'mimetype' => 'text/plain']);
// run the propagation code
$this->sharedStorage->getWatcher()->checkUpdate('subdir');
* @param string $path
*/
function getOwnerDirSizes($path) {
- $result = array();
+ $result = [];
while ($path != '' && $path != '' && $path != '.') {
$cachedData = $this->ownerCache->get($path);
* @return \OCP\Files\FileInfo[]
*/
public static function getTrashFiles($dir, $user, $sortAttribute = '', $sortDescending = false) {
- $result = array();
+ $result = [];
$timestamp = null;
$view = new \OC\Files\View('/' . $user . '/files_trashbin/files');
}
}
$type = $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file';
- $i = array(
+ $i = [
'name' => $name,
'mtime' => $timestamp,
'mimetype' => $type === 'dir' ? 'httpd/unix-directory' : \OC::$server->getMimeTypeDetector()->detectPath($name),
'etag' => '',
'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE,
'fileid' => $entry->getId(),
- );
+ ];
if ($originalPath) {
if ($originalPath !== '.') {
$i['extraData'] = $originalPath . '/' . $originalName;
* @param \OCP\Files\FileInfo[] $fileInfos file infos
*/
public static function formatFileInfos($fileInfos) {
- $files = array();
+ $files = [];
foreach ($fileInfos as $i) {
$entry = \OCA\Files\Helper::formatFileInfo($i);
$entry['id'] = $i->getId();
public static function getLocations($user) {
$query = \OC_DB::prepare('SELECT `id`, `timestamp`, `location`'
. ' FROM `*PREFIX*files_trash` WHERE `user`=?');
- $result = $query->execute(array($user));
- $array = array();
+ $result = $query->execute([$user]);
+ $array = [];
while ($row = $result->fetchRow()) {
if (isset($array[$row['id']])) {
$array[$row['id']][$row['timestamp']] = $row['location'];
} else {
- $array[$row['id']] = array($row['timestamp'] => $row['location']);
+ $array[$row['id']] = [$row['timestamp'] => $row['location']];
}
}
return $array;
public static function getLocation($user, $filename, $timestamp) {
$query = \OC_DB::prepare('SELECT `location` FROM `*PREFIX*files_trash`'
. ' WHERE `user`=? AND `id`=? AND `timestamp`=?');
- $result = $query->execute(array($user, $filename, $timestamp))->fetchAll();
+ $result = $query->execute([$user, $filename, $timestamp])->fetchAll();
if (isset($result[0]['location'])) {
return $result[0]['location'];
} else {
if ($view->file_exists($target)) {
$query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)");
- $result = $query->execute(array($targetFilename, $timestamp, $targetLocation, $user));
+ $result = $query->execute([$targetFilename, $timestamp, $targetLocation, $user]);
if (!$result) {
\OC::$server->getLogger()->error('trash bin database couldn\'t be updated for the files owner', ['app' => 'files_trashbin']);
}
if ($moveSuccessful) {
$query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)");
- $result = $query->execute(array($filename, $timestamp, $location, $owner));
+ $result = $query->execute([$filename, $timestamp, $location, $owner]);
if (!$result) {
\OC::$server->getLogger()->error('trash bin database couldn\'t be updated', ['app' => 'files_trashbin']);
}
- \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', array('filePath' => Filesystem::normalizePath($file_path),
- 'trashPath' => Filesystem::normalizePath($filename . '.d' . $timestamp)));
+ \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', ['filePath' => Filesystem::normalizePath($file_path),
+ 'trashPath' => Filesystem::normalizePath($filename . '.d' . $timestamp)]);
self::retainVersions($filename, $owner, $ownerPath, $timestamp);
$view->chroot('/' . $user . '/files');
$view->touch('/' . $location . '/' . $uniqueFilename, $mtime);
$view->chroot($fakeRoot);
- \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
- 'trashPath' => Filesystem::normalizePath($file)));
+ \OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', ['filePath' => Filesystem::normalizePath('/' . $location . '/' . $uniqueFilename),
+ 'trashPath' => Filesystem::normalizePath($file)]);
self::restoreVersions($view, $file, $filename, $uniqueFilename, $location, $timestamp);
if ($timestamp) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
- $query->execute(array($user, $filename, $timestamp));
+ $query->execute([$user, $filename, $timestamp]);
}
return true;
}
// Array to store the relative path in (after the file is deleted, the view won't be able to relativise the path anymore)
- $filePaths = array();
+ $filePaths = [];
foreach($fileInfos as $fileInfo){
$filePaths[] = $view->getRelativePath($fileInfo->getPath());
}
unset($fileInfos); // save memory
// Bulk PreDelete-Hook
- \OC_Hook::emit('\OCP\Trashbin', 'preDeleteAll', array('paths' => $filePaths));
+ \OC_Hook::emit('\OCP\Trashbin', 'preDeleteAll', ['paths' => $filePaths]);
// Single-File Hooks
foreach($filePaths as $path){
// actual file deletion
$trash->delete();
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
- $query->execute(array($user));
+ $query->execute([$user]);
// Bulk PostDelete-Hook
- \OC_Hook::emit('\OCP\Trashbin', 'deleteAll', array('paths' => $filePaths));
+ \OC_Hook::emit('\OCP\Trashbin', 'deleteAll', ['paths' => $filePaths]);
// Single-File Hooks
foreach($filePaths as $path){
* @param string $path
*/
protected static function emitTrashbinPreDelete($path){
- \OC_Hook::emit('\OCP\Trashbin', 'preDelete', array('path' => $path));
+ \OC_Hook::emit('\OCP\Trashbin', 'preDelete', ['path' => $path]);
}
/**
* @param string $path
*/
protected static function emitTrashbinPostDelete($path){
- \OC_Hook::emit('\OCP\Trashbin', 'delete', array('path' => $path));
+ \OC_Hook::emit('\OCP\Trashbin', 'delete', ['path' => $path]);
}
/**
if ($timestamp) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
- $query->execute(array($user, $filename, $timestamp));
+ $query->execute([$user, $filename, $timestamp]);
$file = $filename . '.d' . $timestamp;
} else {
$file = $filename;
*/
public static function deleteUser($uid) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
- return $query->execute(array($uid));
+ return $query->execute([$uid]);
}
/**
}
}
- return array($size, $count);
+ return [$size, $count];
}
/**
*/
private static function getVersionsFromTrash($filename, $timestamp, $user) {
$view = new View('/' . $user . '/files_trashbin/versions');
- $versions = array();
+ $versions = [];
//force rescan of versions, local storage may not have updated the cache
if (!self::$scannedVersions) {
* @return string
*/
public static function preview_icon($path) {
- return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_trashbin_preview', array('x' => 32, 'y' => 32, 'file' => $path));
+ return \OC::$server->getURLGenerator()->linkToRoute('core_ajax_trashbin_preview', ['x' => 32, 'y' => 32, 'file' => $path]);
}
}
$query->delete($this->trashTable)->execute();
for ($i = 0; $i < 10; $i++) {
$query->insert($this->trashTable)
- ->values(array(
+ ->values([
'id' => $query->expr()->literal('file'.$i),
'timestamp' => $query->expr()->literal($i),
'location' => $query->expr()->literal('.'),
'user' => $query->expr()->literal('user'.$i%2)
- ))->execute();
+ ])->execute();
}
$getAllQuery = $this->dbConnection->getQueryBuilder();
$result = $getAllQuery->select('id')
}
public function dataTestRemoveDeletedFiles() {
- return array(
- array(true),
- array(false)
- );
+ return [
+ [true],
+ [false]
+ ];
}
/**
* isn't.
*/
public function testCrossStorageDeleteFile() {
- $storage2 = new Temporary(array());
- \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+ $storage2 = new Temporary([]);
+ \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
$this->userView->file_put_contents('substorage/subfile.txt', 'foo');
$storage2->getScanner()->scan('');
* isn't.
*/
public function testCrossStorageDeleteFolder() {
- $storage2 = new Temporary(array());
- \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+ $storage2 = new Temporary([]);
+ \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
$this->userView->mkdir('substorage/folder');
$this->userView->file_put_contents('substorage/folder/subfile.txt', 'bar');
public function testKeepFileAndVersionsWhenMovingFileBetweenStorages() {
\OCA\Files_Versions\Hooks::connectHooks();
- $storage2 = new Temporary(array());
- \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+ $storage2 = new Temporary([]);
+ \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
// trigger a version (multiple would not work because of the expire logic)
$this->userView->file_put_contents('test.txt', 'v1');
public function testKeepFileAndVersionsWhenMovingFolderBetweenStorages() {
\OCA\Files_Versions\Hooks::connectHooks();
- $storage2 = new Temporary(array());
- \OC\Files\Filesystem::mount($storage2, array(), $this->user . '/files/substorage');
+ $storage2 = new Temporary([]);
+ \OC\Files\Filesystem::mount($storage2, [], $this->user . '/files/substorage');
// trigger a version (multiple would not work because of the expire logic)
$this->userView->file_put_contents('folder/inside.txt', 'v1');
$filesInTrashUser2AfterDelete = OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER2);
// user2-1.txt should have been expired
- $this->verifyArray($filesInTrashUser2AfterDelete, array('user2-2.txt', 'user1-4.txt'));
+ $this->verifyArray($filesInTrashUser2AfterDelete, ['user2-2.txt', 'user1-4.txt']);
self::loginHelper(self::TEST_TRASHBIN_USER1);
// user1-1.txt and user1-3.txt should have been expired
$filesInTrashUser1AfterDelete = OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1);
- $this->verifyArray($filesInTrashUser1AfterDelete, array('user1-2.txt', 'user1-4.txt'));
+ $this->verifyArray($filesInTrashUser1AfterDelete, ['user1-2.txt', 'user1-4.txt']);
}
/**
const DELETE_TRIGGER_QUOTA_EXCEEDED = 2;
// files for which we can remove the versions after the delete operation was successful
- private static $deletedFiles = array();
+ private static $deletedFiles = [];
- private static $sourcePathAndUser = array();
+ private static $sourcePathAndUser = [];
- private static $max_versions_per_interval = array(
+ private static $max_versions_per_interval = [
//first 10sec, one version every 2sec
- 1 => array('intervalEndsAfter' => 10, 'step' => 2),
+ 1 => ['intervalEndsAfter' => 10, 'step' => 2],
//next minute, one version every 10sec
- 2 => array('intervalEndsAfter' => 60, 'step' => 10),
+ 2 => ['intervalEndsAfter' => 60, 'step' => 10],
//next hour, one version every minute
- 3 => array('intervalEndsAfter' => 3600, 'step' => 60),
+ 3 => ['intervalEndsAfter' => 3600, 'step' => 60],
//next 24h, one version every hour
- 4 => array('intervalEndsAfter' => 86400, 'step' => 3600),
+ 4 => ['intervalEndsAfter' => 86400, 'step' => 3600],
//next 30days, one version per day
- 5 => array('intervalEndsAfter' => 2592000, 'step' => 86400),
+ 5 => ['intervalEndsAfter' => 2592000, 'step' => 86400],
//until the end one version per week
- 6 => array('intervalEndsAfter' => -1, 'step' => 604800),
- );
+ 6 => ['intervalEndsAfter' => -1, 'step' => 604800],
+ ];
/** @var \OCA\Files_Versions\AppInfo\Application */
private static $application;
*/
public static function setSourcePathAndUser($source) {
list($uid, $path) = self::getUidAndFilename($source);
- self::$sourcePathAndUser[$source] = array('uid' => $uid, 'path' => $path);
+ self::$sourcePathAndUser[$source] = ['uid' => $uid, 'path' => $path];
}
/**
} else {
$uid = $path = false;
}
- return array($uid, $path);
+ return [$uid, $path];
}
/**
*/
public static function markDeletedFile($path) {
list($uid, $filename) = self::getUidAndFilename($path);
- self::$deletedFiles[$path] = array(
+ self::$deletedFiles[$path] = [
'uid' => $uid,
- 'filename' => $filename);
+ 'filename' => $filename];
}
/**
$versions = self::getVersions($uid, $filename);
if (!empty($versions)) {
foreach ($versions as $v) {
- \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED));
+ \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
self::deleteVersion($view, $filename . '.v' . $v['version']);
- \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED));
+ \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path . $v['version'], 'trigger' => self::DELETE_TRIGGER_MASTER_REMOVED]);
}
}
}
$node = $userFolder->get($file);
// TODO: move away from those legacy hooks!
- \OC_Hook::emit('\OCP\Versions', 'rollback', array(
+ \OC_Hook::emit('\OCP\Versions', 'rollback', [
'path' => $filename,
'revision' => $revision,
'node' => $node,
- ));
+ ]);
return true;
} else if ($versionCreated) {
self::deleteVersion($users_view, $version);
* @return array versions newest version first
*/
public static function getVersions($uid, $filename, $userFullPath = '') {
- $versions = array();
+ $versions = [];
if (empty($filename)) {
return $versions;
}
$view = new View('/' . $uid . '/files_versions');
if (!empty($toDelete)) {
foreach ($toDelete as $version) {
- \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT));
+ \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
self::deleteVersion($view, $version['path'] . '.v' . $version['version']);
- \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT));
+ \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
}
}
}
*/
private static function getAllVersions($uid) {
$view = new View('/' . $uid . '/');
- $dirs = array(self::VERSIONS_ROOT);
- $versions = array();
+ $dirs = [self::VERSIONS_ROOT];
+ $versions = [];
while (!empty($dirs)) {
$dir = array_pop($dirs);
$version = substr($filePath, $versionsBegin + 2);
$relpath = substr($filePath, $relPathStart, $versionsBegin - $relPathStart);
$key = $version . '#' . $relpath;
- $versions[$key] = array('path' => $relpath, 'timestamp' => $version);
+ $versions[$key] = ['path' => $relpath, 'timestamp' => $version];
}
}
}
// newest version first
krsort($versions);
- $result = array();
+ $result = [];
foreach ($versions as $key => $value) {
$size = $view->filesize(self::VERSIONS_ROOT.'/'.$value['path'].'.v'.$value['timestamp']);
*/
protected static function getAutoExpireList($time, $versions) {
$size = 0;
- $toDelete = array(); // versions we want to delete
+ $toDelete = []; // versions we want to delete
$interval = 1;
$step = Storage::$max_versions_per_interval[$interval]['step'];
}
}
- return array($toDelete, $size);
+ return [$toDelete, $size];
}
/**
$logger = \OC::$server->getLogger();
foreach($toDelete as $key => $path) {
- \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+ \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
self::deleteVersion($versionsFileview, $path);
- \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+ \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $path, 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
unset($allVersions[$key]); // update array with the versions we keep
$logger->info('Expire: ' . $path, ['app' => 'files_versions']);
}
reset($allVersions);
while ($availableSpace < 0 && $i < $numOfVersions) {
$version = current($allVersions);
- \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+ \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
self::deleteVersion($versionsFileview, $version['path'] . '.v' . $version['version']);
- \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED));
+ \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $version['path'].'.v'.$version['version'], 'trigger' => self::DELETE_TRIGGER_QUOTA_EXCEEDED]);
\OC::$server->getLogger()->info('running out of space! Delete oldest version: ' . $version['path'].'.v'.$version['version'], ['app' => 'files_versions']);
$versionsSize -= $version['size'];
$availableSpace += $version['size'];
}
public function dataTestDeleteVersions() {
- return array(
- array(true),
- array(false)
- );
+ return [
+ [true],
+ [false]
+ ];
}
}
public function versionsProvider() {
- return array(
+ return [
// first set of versions uniformly distributed versions
- array(
- array(
+ [
+ [
// first slice (10sec) keep one version every 2 seconds
- array("version" => 4999999, "path" => "keep", "size" => 1),
- array("version" => 4999998, "path" => "delete", "size" => 1),
- array("version" => 4999997, "path" => "keep", "size" => 1),
- array("version" => 4999995, "path" => "keep", "size" => 1),
- array("version" => 4999994, "path" => "delete", "size" => 1),
+ ["version" => 4999999, "path" => "keep", "size" => 1],
+ ["version" => 4999998, "path" => "delete", "size" => 1],
+ ["version" => 4999997, "path" => "keep", "size" => 1],
+ ["version" => 4999995, "path" => "keep", "size" => 1],
+ ["version" => 4999994, "path" => "delete", "size" => 1],
//next slice (60sec) starts at 4999990 keep one version every 10 secons
- array("version" => 4999988, "path" => "keep", "size" => 1),
- array("version" => 4999978, "path" => "keep", "size" => 1),
- array("version" => 4999975, "path" => "delete", "size" => 1),
- array("version" => 4999972, "path" => "delete", "size" => 1),
- array("version" => 4999967, "path" => "keep", "size" => 1),
- array("version" => 4999958, "path" => "delete", "size" => 1),
- array("version" => 4999957, "path" => "keep", "size" => 1),
+ ["version" => 4999988, "path" => "keep", "size" => 1],
+ ["version" => 4999978, "path" => "keep", "size" => 1],
+ ["version" => 4999975, "path" => "delete", "size" => 1],
+ ["version" => 4999972, "path" => "delete", "size" => 1],
+ ["version" => 4999967, "path" => "keep", "size" => 1],
+ ["version" => 4999958, "path" => "delete", "size" => 1],
+ ["version" => 4999957, "path" => "keep", "size" => 1],
//next slice (3600sec) start at 4999940 keep one version every 60 seconds
- array("version" => 4999900, "path" => "keep", "size" => 1),
- array("version" => 4999841, "path" => "delete", "size" => 1),
- array("version" => 4999840, "path" => "keep", "size" => 1),
- array("version" => 4999780, "path" => "keep", "size" => 1),
- array("version" => 4996401, "path" => "keep", "size" => 1),
+ ["version" => 4999900, "path" => "keep", "size" => 1],
+ ["version" => 4999841, "path" => "delete", "size" => 1],
+ ["version" => 4999840, "path" => "keep", "size" => 1],
+ ["version" => 4999780, "path" => "keep", "size" => 1],
+ ["version" => 4996401, "path" => "keep", "size" => 1],
// next slice (86400sec) start at 4996400 keep one version every 3600 seconds
- array("version" => 4996350, "path" => "delete", "size" => 1),
- array("version" => 4992800, "path" => "keep", "size" => 1),
- array("version" => 4989800, "path" => "delete", "size" => 1),
- array("version" => 4989700, "path" => "delete", "size" => 1),
- array("version" => 4989200, "path" => "keep", "size" => 1),
+ ["version" => 4996350, "path" => "delete", "size" => 1],
+ ["version" => 4992800, "path" => "keep", "size" => 1],
+ ["version" => 4989800, "path" => "delete", "size" => 1],
+ ["version" => 4989700, "path" => "delete", "size" => 1],
+ ["version" => 4989200, "path" => "keep", "size" => 1],
// next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
- array("version" => 4913600, "path" => "keep", "size" => 1),
- array("version" => 4852800, "path" => "delete", "size" => 1),
- array("version" => 4827201, "path" => "delete", "size" => 1),
- array("version" => 4827200, "path" => "keep", "size" => 1),
- array("version" => 4777201, "path" => "delete", "size" => 1),
- array("version" => 4777501, "path" => "delete", "size" => 1),
- array("version" => 4740000, "path" => "keep", "size" => 1),
+ ["version" => 4913600, "path" => "keep", "size" => 1],
+ ["version" => 4852800, "path" => "delete", "size" => 1],
+ ["version" => 4827201, "path" => "delete", "size" => 1],
+ ["version" => 4827200, "path" => "keep", "size" => 1],
+ ["version" => 4777201, "path" => "delete", "size" => 1],
+ ["version" => 4777501, "path" => "delete", "size" => 1],
+ ["version" => 4740000, "path" => "keep", "size" => 1],
// final slice starts at 2408000 keep one version every 604800 secons
- array("version" => 2408000, "path" => "keep", "size" => 1),
- array("version" => 1803201, "path" => "delete", "size" => 1),
- array("version" => 1803200, "path" => "keep", "size" => 1),
- array("version" => 1800199, "path" => "delete", "size" => 1),
- array("version" => 1800100, "path" => "delete", "size" => 1),
- array("version" => 1198300, "path" => "keep", "size" => 1),
- ),
+ ["version" => 2408000, "path" => "keep", "size" => 1],
+ ["version" => 1803201, "path" => "delete", "size" => 1],
+ ["version" => 1803200, "path" => "keep", "size" => 1],
+ ["version" => 1800199, "path" => "delete", "size" => 1],
+ ["version" => 1800100, "path" => "delete", "size" => 1],
+ ["version" => 1198300, "path" => "keep", "size" => 1],
+ ],
16 // size of all deleted files (every file has the size 1)
- ),
+ ],
// second set of versions, here we have only really old versions
- array(
- array(
+ [
+ [
// first slice (10sec) keep one version every 2 seconds
// next slice (60sec) starts at 4999990 keep one version every 10 secons
// next slice (3600sec) start at 4999940 keep one version every 60 seconds
// next slice (86400sec) start at 4996400 keep one version every 3600 seconds
- array("version" => 4996400, "path" => "keep", "size" => 1),
- array("version" => 4996350, "path" => "delete", "size" => 1),
- array("version" => 4996350, "path" => "delete", "size" => 1),
- array("version" => 4992800, "path" => "keep", "size" => 1),
- array("version" => 4989800, "path" => "delete", "size" => 1),
- array("version" => 4989700, "path" => "delete", "size" => 1),
- array("version" => 4989200, "path" => "keep", "size" => 1),
+ ["version" => 4996400, "path" => "keep", "size" => 1],
+ ["version" => 4996350, "path" => "delete", "size" => 1],
+ ["version" => 4996350, "path" => "delete", "size" => 1],
+ ["version" => 4992800, "path" => "keep", "size" => 1],
+ ["version" => 4989800, "path" => "delete", "size" => 1],
+ ["version" => 4989700, "path" => "delete", "size" => 1],
+ ["version" => 4989200, "path" => "keep", "size" => 1],
// next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
- array("version" => 4913600, "path" => "keep", "size" => 1),
- array("version" => 4852800, "path" => "delete", "size" => 1),
- array("version" => 4827201, "path" => "delete", "size" => 1),
- array("version" => 4827200, "path" => "keep", "size" => 1),
- array("version" => 4777201, "path" => "delete", "size" => 1),
- array("version" => 4777501, "path" => "delete", "size" => 1),
- array("version" => 4740000, "path" => "keep", "size" => 1),
+ ["version" => 4913600, "path" => "keep", "size" => 1],
+ ["version" => 4852800, "path" => "delete", "size" => 1],
+ ["version" => 4827201, "path" => "delete", "size" => 1],
+ ["version" => 4827200, "path" => "keep", "size" => 1],
+ ["version" => 4777201, "path" => "delete", "size" => 1],
+ ["version" => 4777501, "path" => "delete", "size" => 1],
+ ["version" => 4740000, "path" => "keep", "size" => 1],
// final slice starts at 2408000 keep one version every 604800 secons
- array("version" => 2408000, "path" => "keep", "size" => 1),
- array("version" => 1803201, "path" => "delete", "size" => 1),
- array("version" => 1803200, "path" => "keep", "size" => 1),
- array("version" => 1800199, "path" => "delete", "size" => 1),
- array("version" => 1800100, "path" => "delete", "size" => 1),
- array("version" => 1198300, "path" => "keep", "size" => 1),
- ),
+ ["version" => 2408000, "path" => "keep", "size" => 1],
+ ["version" => 1803201, "path" => "delete", "size" => 1],
+ ["version" => 1803200, "path" => "keep", "size" => 1],
+ ["version" => 1800199, "path" => "delete", "size" => 1],
+ ["version" => 1800100, "path" => "delete", "size" => 1],
+ ["version" => 1198300, "path" => "keep", "size" => 1],
+ ],
11 // size of all deleted files (every file has the size 1)
- ),
+ ],
// third set of versions, with some gaps between
- array(
- array(
+ [
+ [
// first slice (10sec) keep one version every 2 seconds
- array("version" => 4999999, "path" => "keep", "size" => 1),
- array("version" => 4999998, "path" => "delete", "size" => 1),
- array("version" => 4999997, "path" => "keep", "size" => 1),
- array("version" => 4999995, "path" => "keep", "size" => 1),
- array("version" => 4999994, "path" => "delete", "size" => 1),
+ ["version" => 4999999, "path" => "keep", "size" => 1],
+ ["version" => 4999998, "path" => "delete", "size" => 1],
+ ["version" => 4999997, "path" => "keep", "size" => 1],
+ ["version" => 4999995, "path" => "keep", "size" => 1],
+ ["version" => 4999994, "path" => "delete", "size" => 1],
//next slice (60sec) starts at 4999990 keep one version every 10 secons
- array("version" => 4999988, "path" => "keep", "size" => 1),
- array("version" => 4999978, "path" => "keep", "size" => 1),
+ ["version" => 4999988, "path" => "keep", "size" => 1],
+ ["version" => 4999978, "path" => "keep", "size" => 1],
//next slice (3600sec) start at 4999940 keep one version every 60 seconds
// next slice (86400sec) start at 4996400 keep one version every 3600 seconds
- array("version" => 4989200, "path" => "keep", "size" => 1),
+ ["version" => 4989200, "path" => "keep", "size" => 1],
// next slice (2592000sec) start at 4913600 keep one version every 86400 seconds
- array("version" => 4913600, "path" => "keep", "size" => 1),
- array("version" => 4852800, "path" => "delete", "size" => 1),
- array("version" => 4827201, "path" => "delete", "size" => 1),
- array("version" => 4827200, "path" => "keep", "size" => 1),
- array("version" => 4777201, "path" => "delete", "size" => 1),
- array("version" => 4777501, "path" => "delete", "size" => 1),
- array("version" => 4740000, "path" => "keep", "size" => 1),
+ ["version" => 4913600, "path" => "keep", "size" => 1],
+ ["version" => 4852800, "path" => "delete", "size" => 1],
+ ["version" => 4827201, "path" => "delete", "size" => 1],
+ ["version" => 4827200, "path" => "keep", "size" => 1],
+ ["version" => 4777201, "path" => "delete", "size" => 1],
+ ["version" => 4777501, "path" => "delete", "size" => 1],
+ ["version" => 4740000, "path" => "keep", "size" => 1],
// final slice starts at 2408000 keep one version every 604800 secons
- array("version" => 2408000, "path" => "keep", "size" => 1),
- array("version" => 1803201, "path" => "delete", "size" => 1),
- array("version" => 1803200, "path" => "keep", "size" => 1),
- array("version" => 1800199, "path" => "delete", "size" => 1),
- array("version" => 1800100, "path" => "delete", "size" => 1),
- array("version" => 1198300, "path" => "keep", "size" => 1),
- ),
+ ["version" => 2408000, "path" => "keep", "size" => 1],
+ ["version" => 1803201, "path" => "delete", "size" => 1],
+ ["version" => 1803200, "path" => "keep", "size" => 1],
+ ["version" => 1800199, "path" => "delete", "size" => 1],
+ ["version" => 1800100, "path" => "delete", "size" => 1],
+ ["version" => 1198300, "path" => "keep", "size" => 1],
+ ],
9 // size of all deleted files (every file has the size 1)
- ),
+ ],
- );
+ ];
}
public function testRename() {
}
public function testRestoreCrossStorage() {
- $storage2 = new Temporary(array());
- \OC\Files\Filesystem::mount($storage2, array(), self::TEST_VERSIONS_USER . '/files/sub');
+ $storage2 = new Temporary([]);
+ \OC\Files\Filesystem::mount($storage2, [], self::TEST_VERSIONS_USER . '/files/sub');
$this->doTestRestore();
}
$this->assertEquals('test file', $this->rootView->file_get_contents($filePath));
$info1 = $this->rootView->getFileInfo($filePath);
- $params = array();
+ $params = [];
$this->connectMockHooks('rollback', $params);
$this->assertTrue(\OCA\Files_Versions\Storage::rollback('sub/test.txt', $t2, $this->user1));
- $expectedParams = array(
+ $expectedParams = [
'path' => '/sub/test.txt',
- );
+ ];
$this->assertEquals($expectedParams['path'], $params['path']);
$this->assertTrue(array_key_exists('revision', $params));
use OCP\Util;
class Application extends App {
- public function __construct(array $urlParams = array()) {
+ public function __construct(array $urlParams = []) {
parent::__construct('provisioning_api', $urlParams);
$container = $this->getContainer();
$result = $this->api->getApps('disabled');
$data = $result->getData();
$apps = (new \OC_App)->listAllApps();
- $list = array();
+ $list = [];
foreach($apps as $app) {
$list[] = $app['id'];
}
$result = $this->api->getGroupsDetails($search, $limit, $offset);
$this->assertEquals(['groups' => [
- Array(
+ [
'id' => 'group1',
'displayname' => 'group1-name',
'usercount' => 123,
'disabled' => 11,
'canAdd' => true,
'canRemove' => true
- ),
- Array(
+ ],
+ [
'id' => 'group2',
'displayname' => 'group2-name',
'usercount' => 123,
'canAdd' => true,
'canRemove' => true
- )
+ ]
]], $result->getData());
}
abstract class TestCase extends \Test\TestCase {
/** @var IUser[] */
- protected $users = array();
+ protected $users = [];
/** @var IUserManager */
protected $userManager;
* @return IUser[]|IUser
*/
protected function generateUsers($num = 1) {
- $users = array();
+ $users = [];
for ($i = 0; $i < $num; $i++) {
$user = $this->userManager->createUser($this->getUniqueID(), 'password');
$this->users[] = $user;
$anchor = strtolower($sectionName);
$anchor = str_replace(' ', '-', $anchor);
- return array(
+ return [
'anchor' => $anchor,
'section-name' => $sectionName,
'form' => $form
- );
+ ];
}
- return array(
+ return [
'form' => $form
- );
+ ];
}, $forms);
$out = new Template('settings', 'settings/additional');
}
// fix groups to be an array
- $groups = array();
+ $groups = [];
if (is_string($appData['groups'])) {
$groups = json_decode($appData['groups']);
}
$anchor = strtolower($sectionName);
$anchor = str_replace(' ', '-', $anchor);
- return array(
+ return [
'anchor' => $anchor,
'section-name' => $sectionName,
'form' => $form
- );
+ ];
}
- return array(
+ return [
'form' => $form
- );
+ ];
}, $forms);
$out = new Template('settings', 'settings/additional');
$languages = $this->l10nFactory->getLanguages();
/* FINAL DATA */
- $serverData = array();
+ $serverData = [];
// groups
$serverData['groups'] = array_merge_recursive($adminGroup, [$disabledUsersGroup], $groups);
// Various data
*/
public function afterException($controller, $methodName, \Exception $exception) {
if($exception instanceof NotAdminException) {
- $response = new TemplateResponse('core', '403', array(), 'guest');
+ $response = new TemplateResponse('core', '403', [], 'guest');
$response->setStatus(Http::STATUS_FORBIDDEN);
return $response;
}
}
return array_merge(
- array('activelanguage' => $userLang),
+ ['activelanguage' => $userLang],
$languages
);
}
$this->checker
->expects($this->once())
->method('getResults')
- ->willReturn(array ( 'core' => array ( 'EXTRA_FILE' => array('/testfile' => array()), 'INVALID_HASH' => array ( '/.idea/workspace.xml' => array ( 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ), '/lib/private/integritycheck/checker.php' => array ( 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ), '/settings/controller/checksetupcontroller.php' => array ( 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ), ), ), 'bookmarks' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'dav' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'encryption' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'external' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'federation' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_antivirus' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_drop' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_external' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_pdfviewer' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_sharing' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_trashbin' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_versions' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'files_videoviewer' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'firstrunwizard' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'gitsmart' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'logreader' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ), ), 'password_policy' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'provisioning_api' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'sketch' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'threatblock' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'two_factor_auth' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'user_ldap' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), 'user_shibboleth' => array ( 'EXCEPTION' => array ( 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ), ), ));
+ ->willReturn( [ 'core' => [ 'EXTRA_FILE' => ['/testfile' => []], 'INVALID_HASH' => [ '/.idea/workspace.xml' => [ 'expected' => 'f1c5e2630d784bc9cb02d5a28f55d6f24d06dae2a0fee685f3c2521b050955d9d452769f61454c9ddfa9c308146ade10546cfa829794448eaffbc9a04a29d216', 'current' => 'ce08bf30bcbb879a18b49239a9bec6b8702f52452f88a9d32142cad8d2494d5735e6bfa0d8642b2762c62ca5be49f9bf4ec231d4a230559d4f3e2c471d3ea094', ], '/lib/private/integritycheck/checker.php' => [ 'expected' => 'c5a03bacae8dedf8b239997901ba1fffd2fe51271d13a00cc4b34b09cca5176397a89fc27381cbb1f72855fa18b69b6f87d7d5685c3b45aee373b09be54742ea', 'current' => '88a3a92c11db91dec1ac3be0e1c87f862c95ba6ffaaaa3f2c3b8f682187c66f07af3a3b557a868342ef4a271218fe1c1e300c478e6c156c5955ed53c40d06585', ], '/settings/controller/checksetupcontroller.php' => [ 'expected' => '3e1de26ce93c7bfe0ede7c19cb6c93cadc010340225b375607a7178812e9de163179b0dc33809f451e01f491d93f6f5aaca7929685d21594cccf8bda732327c4', 'current' => '09563164f9904a837f9ca0b5f626db56c838e5098e0ccc1d8b935f68fa03a25c5ec6f6b2d9e44a868e8b85764dafd1605522b4af8db0ae269d73432e9a01e63a', ], ], ], 'bookmarks' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'dav' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'encryption' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'federation' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_antivirus' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_drop' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_external' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_pdfviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_sharing' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_trashbin' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_versions' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'files_videoviewer' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'firstrunwizard' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'gitsmart' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'logreader' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature could not get verified.', ], ], 'password_policy' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'provisioning_api' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'sketch' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'threatblock' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'two_factor_auth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_ldap' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], 'user_shibboleth' => [ 'EXCEPTION' => [ 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', 'message' => 'Signature data not found.', ], ], ]);
$expected = new DataDisplayResponse(
'Technical information
}
public function testAfterNotAdminException() {
- $expectedResponse = new TemplateResponse('core', '403', array(), 'guest');
+ $expectedResponse = new TemplateResponse('core', '403', [], 'guest');
$expectedResponse->setStatus(403);
$this->assertEquals($expectedResponse, $this->subadminMiddleware->afterException($this->controller, 'foo', new NotAdminException('')));
}
public function testAfterRegularException() {
$this->expectException(\Exception::class);
- $expectedResponse = new TemplateResponse('core', '403', array(), 'guest');
+ $expectedResponse = new TemplateResponse('core', '403', [], 'guest');
$expectedResponse->setStatus(403);
$this->subadminMiddleware->afterException($this->controller, 'foo', new \Exception());
}
class Application extends App {
- public function __construct(array $urlParams = array()) {
+ public function __construct(array $urlParams = []) {
parent::__construct('sharebymail', $urlParams);
$settingsManager = \OC::$server->query(Settings\SettingsManager::class);
$alreadyShared = $this->getSharedWith($shareWith, \OCP\Share::SHARE_TYPE_EMAIL, $share->getNode(), 1, 0);
if (!empty($alreadyShared)) {
$message = 'Sharing %1$s failed, this item is already shared with %2$s';
- $message_t = $this->l->t('Sharing %1$s failed, this item is already shared with %2$s', array($share->getNode()->getName(), $shareWith));
+ $message_t = $this->l->t('Sharing %1$s failed, this item is already shared with %2$s', [$share->getNode()->getName(), $shareWith]);
$this->logger->debug(sprintf($message, $share->getNode()->getName(), $shareWith), ['app' => 'Federated File Sharing']);
throw new \Exception($message_t);
}
'shareWith' => $shareWith,
]);
- $emailTemplate->setSubject($this->l->t('%1$s shared »%2$s« with you', array($initiatorDisplayName, $filename)));
+ $emailTemplate->setSubject($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]));
$emailTemplate->addHeader();
$emailTemplate->addHeading($this->l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false);
$text = $this->l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]);
use OCP\AppFramework\App;
class Application extends App {
- public function __construct (array $urlParams = array()) {
+ public function __construct (array $urlParams = []) {
$appName = 'testing';
parent::__construct($appName, $urlParams);
'name' => 'Theming#getManifest',
'url' => '/manifest/{app}',
'verb' => 'GET',
- 'defaults' => array('app' => 'core')
+ 'defaults' => ['app' => 'core']
],
[
'name' => 'Icon#getFavicon',
'url' => '/favicon/{app}',
'verb' => 'GET',
- 'defaults' => array('app' => 'core'),
+ 'defaults' => ['app' => 'core'],
],
[
'name' => 'Icon#getTouchIcon',
'url' => '/icon/{app}',
'verb' => 'GET',
- 'defaults' => array('app' => 'core'),
+ 'defaults' => ['app' => 'core'],
],
[
'name' => 'Icon#getThemedIcon',
'url' => '/img/{app}/{image}',
'verb' => 'GET',
- 'requirements' => array('image' => '.+')
+ 'requirements' => ['image' => '.+']
],
]];
* @return string|ISimpleFile path to app icon / file of logo
*/
public function getAppIcon($app) {
- $app = str_replace(array('\0', '/', '\\', '..'), '', $app);
+ $app = str_replace(['\0', '/', '\\', '..'], '', $app);
try {
$appPath = $this->appManager->getAppPath($app);
$icon = $appPath . '/img/' . $app . '.svg';
* @return string|false absolute path to image
*/
public function getAppImage($app, $image) {
- $app = str_replace(array('\0', '/', '\\', '..'), '', $app);
- $image = str_replace(array('\0', '\\', '..'), '', $image);
+ $app = str_replace(['\0', '/', '\\', '..'], '', $app);
+ $image = str_replace(['\0', '\\', '..'], '', $image);
if ($app === "core") {
$icon = \OC::$SERVERROOT . '/core/img/' . $image;
if (file_exists($icon)) {
}
\OC_JSON::success();
} catch (\Exception $e) {
- \OC_JSON::error(array('message' => $e->getMessage()));
+ \OC_JSON::error(['message' => $e->getMessage()]);
}
\OC_JSON::success();
} else {
$l = \OC::$server->getL10N('user_ldap');
- \OC_JSON::error(array('message' => $l->t('Failed to delete the server configuration')));
+ \OC_JSON::error(['message' => $l->t('Failed to delete the server configuration')]);
}
// hide password
$configuration['ldap_agent_password'] = '**PASSWORD SET**';
}
-\OC_JSON::success(array('configuration' => $configuration));
+\OC_JSON::success(['configuration' => $configuration]);
$ln = (int)str_replace('s', '', $lk);
$nk = 's'.str_pad($ln+1, 2, '0', STR_PAD_LEFT);
-$resultData = array('configPrefix' => $nk);
+$resultData = ['configPrefix' => $nk];
$newConfig = new \OCA\User_LDAP\Configuration($nk, false);
if(isset($_POST['copyConfig'])) {
// Checkboxes are not submitted, when they are unchecked. Set them manually.
// only legacy checkboxes (Advanced and Expert tab) need to be handled here,
// the Wizard-like tabs handle it on their own
-$chkboxes = array('ldap_configuration_active', 'ldap_override_main_server',
- 'ldap_turn_off_cert_check');
+$chkboxes = ['ldap_configuration_active', 'ldap_override_main_server',
+ 'ldap_turn_off_cert_check'];
foreach($chkboxes as $boxid) {
if(!isset($_POST[$boxid])) {
$_POST[$boxid] = 0;
* pass (like e.g. expected syntax error).
*/
try {
- $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', array('dn'));
+ $ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', ['dn']);
} catch (\Exception $e) {
if($e->getCode() === 1) {
- \OC_JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')));
+ \OC_JSON::error(['message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')]);
exit;
}
}
- \OC_JSON::success(array('message'
- => $l->t('Valid configuration, connection established!')));
+ \OC_JSON::success(['message'
+ => $l->t('Valid configuration, connection established!')]);
} else {
- \OC_JSON::error(array('message'
- => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.')));
+ \OC_JSON::error(['message'
+ => $l->t('Valid configuration, but binding failed. Please check the server settings and credentials.')]);
}
} else {
- \OC_JSON::error(array('message'
- => $l->t('Invalid configuration. Please have a look at the logs for further details.')));
+ \OC_JSON::error(['message'
+ => $l->t('Invalid configuration. Please have a look at the logs for further details.')]);
}
} catch (\Exception $e) {
- \OC_JSON::error(array('message' => $e->getMessage()));
+ \OC_JSON::error(['message' => $e->getMessage()]);
}
$l = \OC::$server->getL10N('user_ldap');
if(!isset($_POST['action'])) {
- \OC_JSON::error(array('message' => $l->t('No action specified')));
+ \OC_JSON::error(['message' => $l->t('No action specified')]);
}
$action = (string)$_POST['action'];
if(!isset($_POST['ldap_serverconfig_chooser'])) {
- \OC_JSON::error(array('message' => $l->t('No configuration specified')));
+ \OC_JSON::error(['message' => $l->t('No configuration specified')]);
}
$prefix = (string)$_POST['ldap_serverconfig_chooser'];
exit;
}
} catch (\Exception $e) {
- \OC_JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode()));
+ \OC_JSON::error(['message' => $e->getMessage(), 'code' => $e->getCode()]);
exit;
}
\OC_JSON::error();
exit;
}
} catch (\Exception $e) {
- \OC_JSON::error(array('message' => $e->getMessage()));
+ \OC_JSON::error(['message' => $e->getMessage()]);
exit;
}
\OC_JSON::error();
$key = isset($_POST['cfgkey']) ? $_POST['cfgkey'] : false;
$val = isset($_POST['cfgval']) ? $_POST['cfgval'] : null;
if($key === false || is_null($val)) {
- \OC_JSON::error(array('message' => $l->t('No data specified')));
+ \OC_JSON::error(['message' => $l->t('No data specified')]);
exit;
}
- $cfg = array($key => $val);
- $setParameters = array();
+ $cfg = [$key => $val];
+ $setParameters = [];
$configuration->setConfiguration($cfg, $setParameters);
if(!in_array($key, $setParameters)) {
- \OC_JSON::error(array('message' => $l->t($key.
- ' Could not set configuration %s', $setParameters[0])));
+ \OC_JSON::error(['message' => $l->t($key.
+ ' Could not set configuration %s', $setParameters[0])]);
exit;
}
$configuration->saveConfiguration();
\OC_JSON::success();
break;
default:
- \OC_JSON::error(array('message' => $l->t('Action does not exist')));
+ \OC_JSON::error(['message' => $l->t('Action does not exist')]);
break;
}
/**
* @var string[] $cookies an array of returned Paged Result cookies
*/
- protected $cookies = array();
+ protected $cookies = [];
/**
* @var string $lastCookie the last cookie returned from a Paged Results
* @throws ServerNotAvailableException
*/
public function executeRead($cr, $dn, $attribute, $filter, $maxResults) {
- $this->initPagedSearch($filter, array($dn), array($attribute), $maxResults, 0);
+ $this->initPagedSearch($filter, [$dn], [$attribute], $maxResults, 0);
$dn = $this->helper->DNasBaseParameter($dn);
- $rr = @$this->invokeLDAPMethod('read', $cr, $dn, $filter, array($attribute));
+ $rr = @$this->invokeLDAPMethod('read', $cr, $dn, $filter, [$attribute]);
if (!$this->ldap->isResource($rr)) {
if ($attribute !== '') {
//do not throw this message on userExists check, irritates
* @return boolean if so true, otherwise false
*/
private function resemblesDN($attr) {
- $resemblingAttributes = array(
+ $resemblingAttributes = [
'dn',
'uniquemember',
'member',
// memberOf is an "operational" attribute, without a definition in any RFC
'memberof'
- );
+ ];
return in_array($attr, $resemblingAttributes);
}
//not a valid DN
return '';
}
- $domainParts = array();
+ $domainParts = [];
$dcFound = false;
foreach($allParts as $part) {
if(!$dcFound && strpos($part, 'dc=') === 0) {
*/
private function createAltInternalOwnCloudName($name, $isUser) {
$originalTTL = $this->connection->ldapCacheTTL;
- $this->connection->setConfiguration(array('ldapCacheTTL' => 0));
+ $this->connection->setConfiguration(['ldapCacheTTL' => 0]);
if($isUser) {
$altName = $this->_createAltInternalOwnCloudNameForUsers($name);
} else {
$altName = $this->_createAltInternalOwnCloudNameForGroups($name);
}
- $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL));
+ $this->connection->setConfiguration(['ldapCacheTTL' => $originalTTL]);
return $altName;
}
* @param array $attributes optional, list of attributes to read
* @return array
*/
- public function fetchUsersByLoginName($loginName, $attributes = array('dn')) {
+ public function fetchUsersByLoginName($loginName, $attributes = ['dn']) {
$loginName = $this->escapeFilterPart($loginName);
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter);
return $this->fetchListOfUsers($filter, $attributes);
$attribute = array_keys($item)[0];
$carry[] = $item[$attribute][0];
return $carry;
- }, array());
+ }, []);
return array_unique($list, SORT_LOCALE_STRING);
}
}
//error cause actually, maybe throw an exception in future.
- return array();
+ return [];
}
/**
* @return false|int
* @throws ServerNotAvailableException
*/
- public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) {
+ public function countUsers($filter, $attr = ['dn'], $limit = null, $offset = null) {
$result = false;
foreach($this->connection->ldapBaseUsers as $base) {
$count = $this->count($filter, [$base], $attr, $limit, $offset);
* @return int|bool
* @throws ServerNotAvailableException
*/
- public function countGroups($filter, $attr = array('dn'), $limit = null, $offset = null) {
+ public function countGroups($filter, $attr = ['dn'], $limit = null, $offset = null) {
$result = false;
foreach($this->connection->ldapBaseGroups as $base) {
$count = $this->count($filter, [$base], $attr, $limit, $offset);
if ($command == 'controlPagedResultResponse') {
throw new \InvalidArgumentException('Invoker does not support controlPagedResultResponse, call LDAP Wrapper directly instead.');
} else {
- return call_user_func_array(array($this->ldap, $command), $arguments);
+ return call_user_func_array([$this->ldap, $command], $arguments);
}
};
try {
*/
private function executeSearch($filter, $base, &$attr = null, $limit = null, $offset = null) {
if(!is_null($attr) && !is_array($attr)) {
- $attr = array(mb_strtolower($attr, 'UTF-8'));
+ $attr = [mb_strtolower($attr, 'UTF-8')];
}
// See if we have a resource, in case not cancel with message
//check whether paged search should be attempted
$pagedSearchOK = $this->initPagedSearch($filter, $base, $attr, (int)$limit, $offset);
- $linkResources = array_pad(array(), count($base), $cr);
+ $linkResources = array_pad([], count($base), $cr);
$sr = $this->invokeLDAPMethod('search', $linkResources, $base, $filter, $attr);
// cannot use $cr anymore, might have changed in the previous call!
$error = $this->ldap->errno($this->connection->getConnectionResource());
return false;
}
- return array($sr, $pagedSearchOK);
+ return [$sr, $pagedSearchOK];
}
/**
$this->processPagedSearchStatus($sr, $filter, $base, 1, $limitPerPage,
$offset, $pagedSearchOK,
$skipHandling);
- return array();
+ return [];
}
$iFoundItems = 0;
// if we're here, probably no connection resource is returned.
// to make Nextcloud behave nicely, we simply give back an empty array.
if(is_null($findings)) {
- return array();
+ return [];
}
if(!is_null($attr)) {
$asterisk = '*';
$input = mb_substr($input, 1, null, 'UTF-8');
}
- $search = array('*', '\\', '(', ')');
- $replace = array('\\*', '\\\\', '\\(', '\\)');
+ $search = ['*', '\\', '(', ')'];
+ $replace = ['\\*', '\\\\', '\\(', '\\)'];
return $asterisk . str_replace($search, $replace, $input);
}
throw new \Exception('searchAttributes must be an array with at least two string');
}
$searchWords = explode(' ', trim($search));
- $wordFilters = array();
+ $wordFilters = [];
foreach($searchWords as $word) {
$word = $this->prepareSearchTerm($word);
//every word needs to appear at least once
- $wordMatchOneAttrFilters = array();
+ $wordMatchOneAttrFilters = [];
foreach($searchAttributes as $attr) {
$wordMatchOneAttrFilters[] = $attr . '=' . $word;
}
* @return string the final filter part to use in LDAP searches
*/
private function getFilterPartForSearch($search, $searchAttributes, $fallbackAttribute) {
- $filter = array();
+ $filter = [];
$haveMultiSearchAttributes = (is_array($searchAttributes) && count($searchAttributes) > 0);
if($haveMultiSearchAttributes && strpos(trim($search), ' ') !== false) {
try {
* @return string
*/
public function getFilterForUserCount() {
- $filter = $this->combineFilterWithAnd(array(
+ $filter = $this->combineFilterWithAnd([
$this->connection->ldapUserFilter,
$this->connection->ldapUserDisplayName . '=*'
- ));
+ ]);
return $filter;
}
public function areCredentialsValid($name, $password) {
$name = $this->helper->DNasBaseParameter($name);
$testConnection = clone $this->connection;
- $credentials = array(
+ $credentials = [
'ldapAgentName' => $name,
'ldapAgentPassword' => $password
- );
+ ];
if(!$testConnection->setConfiguration($credentials)) {
return false;
}
// precision (see https://gist.github.com/bantu/886ac680b0aef5812f71)
$iav = number_format(hexdec(bin2hex(substr($sid, 2, 6))), 0, '', '');
- $subIDs = array();
+ $subIDs = [];
for ($i = 0; $i < $numberSubID; $i++) {
$subID = unpack('V', substr($sid, $subIdStart + $subIdLength * $i, $subIdLength));
$subIDs[] = sprintf('%u', $subID[1]);
// to start from 0 to come to the desired page. cookie value
// of '0' is valid, because 389ds
$reOffset = ($offset - $limit) < 0 ? 0 : $offset - $limit;
- $this->search($filter, array($base), $attr, $limit, $reOffset, true);
+ $this->search($filter, [$base], $attr, $limit, $reOffset, true);
$cookie = $this->getPagedResultCookie($base, $filter, $limit, $offset);
//still no cookie? obviously, the server does not like us. Let's skip paging efforts.
// '0' is valid, because 389ds
ksort($configuration);
$table = new Table($output);
- $table->setHeaders(array('Configuration', $id));
- $rows = array();
+ $table->setHeaders(['Configuration', $id]);
+ $rows = [];
foreach($configuration as $key => $value) {
if($key === 'ldapAgentPassword' && !$withPassword) {
$value = '***';
if(is_array($value)) {
$value = implode(';', $value);
}
- $rows[] = array($key, $value);
+ $rows[] = [$key, $value];
}
$table->setRows($rows);
$table->render($output);
//ensure validation is run before we attempt the bind
$connection->getConfiguration();
- if(!$connection->setConfiguration(array(
+ if(!$connection->setConfiguration([
'ldap_configuration_active' => 1,
- ))) {
+ ])) {
return 1;
}
if($connection->bind()) {
protected $unsavedChanges = ['ldapConfigurationActive' => 'ldapConfigurationActive'];
//settings
- protected $config = array(
+ protected $config = [
'ldapHost' => null,
'ldapPort' => null,
'ldapBackupHost' => null,
'ldapDynamicGroupMemberURL' => null,
'ldapDefaultPPolicyDN' => null,
'ldapExtStorageHomeAttribute' => null,
- );
+ ];
/**
* @param string $configPrefix
* @param mixed $value
*/
public function __set($name, $value) {
- $this->setConfiguration(array($name => $value));
+ $this->setConfiguration([$name => $value]);
}
/**
* to config-value entries in the database table
*/
public function getDefaults() {
- return array(
+ return [
'ldap_host' => '',
'ldap_port' => '',
'ldap_backup_host' => '',
'ldap_default_ppolicy_dn' => '',
'ldap_user_avatar_rule' => 'default',
'ldap_ext_storage_home_attribute' => '',
- );
+ ];
}
/**
*/
public function getConfigTranslationArray() {
//TODO: merge them into one representation
- static $array = array(
+ static $array = [
'ldap_host' => 'ldapHost',
'ldap_port' => 'ldapPort',
'ldap_backup_host' => 'ldapBackupHost',
'ldap_default_ppolicy_dn' => 'ldapDefaultPPolicyDN',
'ldap_ext_storage_home_attribute' => 'ldapExtStorageHomeAttribute',
'ldapIgnoreNamingRules' => 'ldapIgnoreNamingRules', // sysconfig
- );
+ ];
return $array;
}
*/
public function setConfiguration($config, &$setParameters = null) {
if(is_null($setParameters)) {
- $setParameters = array();
+ $setParameters = [];
}
$this->doNotValidate = false;
$this->configuration->setConfiguration($config, $setParameters);
$this->readConfiguration();
$config = $this->configuration->getConfiguration();
$cta = $this->configuration->getConfigTranslationArray();
- $result = array();
+ $result = [];
foreach($cta as $dbkey => $configkey) {
switch($configkey) {
case 'homeFolderNamingRule':
private function doSoftValidation() {
//if User or Group Base are not set, take over Base DN setting
- foreach(array('ldapBaseUsers', 'ldapBaseGroups') as $keyBase) {
+ foreach(['ldapBaseUsers', 'ldapBaseGroups'] as $keyBase) {
$val = $this->configuration->$keyBase;
if(empty($val)) {
$this->configuration->$keyBase = $this->configuration->ldapBase;
}
}
- foreach(array('ldapExpertUUIDUserAttr' => 'ldapUuidUserAttribute',
- 'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute')
+ foreach(['ldapExpertUUIDUserAttr' => 'ldapUuidUserAttribute',
+ 'ldapExpertUUIDGroupAttr' => 'ldapUuidGroupAttribute']
as $expertSetting => $effectiveSetting) {
$uuidOverride = $this->configuration->$expertSetting;
if(!empty($uuidOverride)) {
}
//make sure empty search attributes are saved as simple, empty array
- $saKeys = array('ldapAttributesForUserSearch',
- 'ldapAttributesForGroupSearch');
+ $saKeys = ['ldapAttributesForUserSearch',
+ 'ldapAttributesForGroupSearch'];
foreach($saKeys as $key) {
$val = $this->configuration->$key;
if(is_array($val) && count($val) === 1 && empty($val[0])) {
- $this->configuration->$key = array();
+ $this->configuration->$key = [];
}
}
(string)$this->configPrefix .'): ';
//options that shall not be empty
- $options = array('ldapHost', 'ldapPort', 'ldapUserDisplayName',
- 'ldapGroupDisplayName', 'ldapLoginFilter');
+ $options = ['ldapHost', 'ldapPort', 'ldapUserDisplayName',
+ 'ldapGroupDisplayName', 'ldapLoginFilter'];
foreach($options as $key) {
$val = $this->configuration->$key;
if(empty($val)) {
private $respondToActions = 0;
- private $which = array(
+ private $which = [
GroupInterface::CREATE_GROUP => null,
GroupInterface::DELETE_GROUP => null,
GroupInterface::ADD_TO_GROUP => null,
GroupInterface::REMOVE_FROM_GROUP => null,
GroupInterface::COUNT_USERS => null,
GroupInterface::GROUP_DETAILS => null
- );
+ ];
/**
* @return int All implemented actions
//extra work if we don't get back user DNs
if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
- $dns = array();
- $filterParts = array();
+ $dns = [];
+ $filterParts = [];
$bytes = 0;
foreach($members as $mid) {
$filter = str_replace('%uid', $mid, $this->access->connection->ldapLoginFilter);
// to take even the chance to exceed it
$filter = $this->access->combineFilterWithOr($filterParts);
$bytes = 0;
- $filterParts = array();
+ $filterParts = [];
$users = $this->access->fetchListOfUsers($filter, 'dn', count($filterParts));
$dns = array_merge($dns, $users);
}
$dynamicGroupMemberURL = strtolower($this->access->connection->ldapDynamicGroupMemberURL);
if (empty($dynamicGroupMemberURL)) {
- return array();
+ return [];
}
- $dynamicMembers = array();
+ $dynamicMembers = [];
$memberURLs = $this->access->readAttribute(
$dnGroup,
$dynamicGroupMemberURL,
if ($pos !== false) {
$memberUrlFilter = substr($memberURLs[0], $pos);
$foundMembers = $this->access->searchUsers($memberUrlFilter,'dn');
- $dynamicMembers = array();
+ $dynamicMembers = [];
foreach($foundMembers as $value) {
$dynamicMembers[$value['dn'][0]] = 1;
}
'objectClass=posixGroup',
$this->access->connection->ldapGidNumber . '=' . $gid
]);
- $result = $this->access->searchGroups($filter, array('dn'), 1);
+ $result = $this->access->searchGroups($filter, ['dn'], 1);
if(empty($result)) {
return false;
}
}
//we need to get the DN from LDAP
- $filter = $this->access->combineFilterWithAnd(array(
+ $filter = $this->access->combineFilterWithAnd([
$this->access->connection->ldapGroupFilter,
'objectsid=' . $domainObjectSid . '-' . $gid
- ));
- $result = $this->access->searchGroups($filter, array('dn'), 1);
+ ]);
+ $result = $this->access->searchGroups($filter, ['dn'], 1);
if(empty($result)) {
return false;
}
$filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search);
$users = $this->access->fetchListOfUsers(
$filter,
- array($this->access->connection->ldapUserDisplayName, 'dn'),
+ [$this->access->connection->ldapUserDisplayName, 'dn'],
$limit,
$offset
);
return $this->access->nextcloudUserNames($users);
} catch (\Exception $e) {
- return array();
+ return [];
}
}
public function countUsersInPrimaryGroup($groupDN, $search = '', $limit = -1, $offset = 0) {
try {
$filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search);
- $users = $this->access->countUsers($filter, array('dn'), $limit, $offset);
+ $users = $this->access->countUsers($filter, ['dn'], $limit, $offset);
return (int)$users;
} catch (\Exception $e) {
return 0;
*/
public function getUserGroups($uid) {
if(!$this->enabled) {
- return array();
+ return [];
}
$cacheKey = 'getUserGroups'.$uid;
$userGroups = $this->access->connection->getFromCache($cacheKey);
}
$userDN = $this->access->username2dn($uid);
if(!$userDN) {
- $this->access->connection->writeToCache($cacheKey, array());
- return array();
+ $this->access->connection->writeToCache($cacheKey, []);
+ return [];
}
$groups = [];
if (!empty($dynamicGroupMemberURL)) {
// look through dynamic groups to add them to the result array if needed
$groupsToMatch = $this->access->fetchListOfGroups(
- $this->access->connection->ldapGroupFilter,array('dn',$dynamicGroupMemberURL));
+ $this->access->connection->ldapGroupFilter,['dn',$dynamicGroupMemberURL]);
foreach($groupsToMatch as $dynamicGroup) {
if (!array_key_exists($dynamicGroupMemberURL, $dynamicGroup)) {
continue;
*/
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
if(!$this->enabled) {
- return array();
+ return [];
}
if(!$this->groupExists($gid)) {
- return array();
+ return [];
}
$search = $this->access->escapeFilterPart($search, true);
$cacheKey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
$groupDN = $this->access->groupname2dn($gid);
if(!$groupDN) {
// group couldn't be found, return empty resultset
- $this->access->connection->writeToCache($cacheKey, array());
- return array();
+ $this->access->connection->writeToCache($cacheKey, []);
+ return [];
}
$primaryUsers = $this->getUsersInPrimaryGroup($groupDN, $search, $limit, $offset);
return [];
}
- $groupUsers = array();
+ $groupUsers = [];
$isMemberUid = (strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid');
$attrs = $this->access->userManager->getAttributes(true);
foreach($members as $member) {
if($isMemberUid) {
//we got uids, need to get their DNs to 'translate' them to user names
- $filter = $this->access->combineFilterWithAnd(array(
+ $filter = $this->access->combineFilterWithAnd([
str_replace('%uid', trim($member), $this->access->connection->ldapLoginFilter),
$this->access->combineFilterWithAnd([
$this->access->getFilterPartForUserSearch($search),
$this->access->connection->ldapUserFilter
])
- ));
+ ]);
$ldap_users = $this->access->fetchListOfUsers($filter, $attrs, 1);
if(count($ldap_users) < 1) {
continue;
// and let it count.
//For now this is not important, because the only use of this method
//does not supply a search string
- $groupUsers = array();
+ $groupUsers = [];
foreach($members as $member) {
if($isMemberUid) {
//we got uids, need to get their DNs to 'translate' them to user names
- $filter = $this->access->combineFilterWithAnd(array(
+ $filter = $this->access->combineFilterWithAnd([
str_replace('%uid', $member, $this->access->connection->ldapLoginFilter),
$this->access->getFilterPartForUserSearch($search)
- ));
+ ]);
$ldap_users = $this->access->fetchListOfUsers($filter, 'dn', 1);
if(count($ldap_users) < 1) {
continue;
*/
protected function getGroupsChunk($search = '', $limit = -1, $offset = 0) {
if(!$this->enabled) {
- return array();
+ return [];
}
$cacheKey = 'getGroups-'.$search.'-'.$limit.'-'.$offset;
if($limit <= 0) {
$limit = null;
}
- $filter = $this->access->combineFilterWithAnd(array(
+ $filter = $this->access->combineFilterWithAnd([
$this->access->connection->ldapGroupFilter,
$this->access->getFilterPartForGroupSearch($search)
- ));
+ ]);
\OCP\Util::writeLog('user_ldap', 'getGroups Filter '.$filter, ILogger::DEBUG);
$ldap_groups = $this->access->fetchListOfGroups($filter,
- array($this->access->connection->ldapGroupDisplayName, 'dn'),
+ [$this->access->connection->ldapGroupDisplayName, 'dn'],
$limit,
$offset);
$ldap_groups = $this->access->nextcloudGroupNames($ldap_groups);
*/
public function getGroups($search = '', $limit = -1, $offset = 0) {
if(!$this->enabled) {
- return array();
+ return [];
}
$search = $this->access->escapeFilterPart($search, true);
$pagingSize = (int)$this->access->connection->ldapPagingSize;
$overallLimit = $maxGroups;
}
$chunkOffset = $offset;
- $allGroups = array();
+ $allGroups = [];
while ($chunkOffset < $overallLimit) {
$chunkLimit = min($pagingSize, $overallLimit - $chunkOffset);
$ldapGroups = $this->getGroupsChunk($search, $chunkLimit, $chunkOffset);
use OCP\Group\Backend\IGetDisplayNameBackend;
class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP, IGetDisplayNameBackend {
- private $backends = array();
+ private $backends = [];
private $refBackend = null;
/**
protected function walkBackends($gid, $method, $parameters) {
$cacheKey = $this->getGroupCacheKey($gid);
foreach($this->backends as $configPrefix => $backend) {
- if($result = call_user_func_array(array($backend, $method), $parameters)) {
+ if($result = call_user_func_array([$backend, $method], $parameters)) {
$this->writeToCache($cacheKey, $configPrefix);
return $result;
}
//in case the uid has been found in the past, try this stored connection first
if(!is_null($prefix)) {
if(isset($this->backends[$prefix])) {
- $result = call_user_func_array(array($this->backends[$prefix], $method), $parameters);
+ $result = call_user_func_array([$this->backends[$prefix], $method], $parameters);
if($result === $passOnWhen) {
//not found here, reset cache to null if group vanished
//because sometimes methods return false with a reason
$groupExists = call_user_func_array(
- array($this->backends[$prefix], 'groupExists'),
- array($gid)
+ [$this->backends[$prefix], 'groupExists'],
+ [$gid]
);
if(!$groupExists) {
$this->writeToCache($cacheKey, null);
* Checks whether the user is member of a group or not.
*/
public function inGroup($uid, $gid) {
- return $this->handleRequest($gid, 'inGroup', array($uid, $gid));
+ return $this->handleRequest($gid, 'inGroup', [$uid, $gid]);
}
/**
* if the user exists at all.
*/
public function getUserGroups($uid) {
- $groups = array();
+ $groups = [];
foreach($this->backends as $backend) {
$backendGroups = $backend->getUserGroups($uid);
* @return string[] with user ids
*/
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
- $users = array();
+ $users = [];
foreach($this->backends as $backend) {
$backendUsers = $backend->usersInGroup($gid, $search, $limit, $offset);
*/
public function createGroup($gid) {
return $this->handleRequest(
- $gid, 'createGroup', array($gid));
+ $gid, 'createGroup', [$gid]);
}
/**
*/
public function deleteGroup($gid) {
return $this->handleRequest(
- $gid, 'deleteGroup', array($gid));
+ $gid, 'deleteGroup', [$gid]);
}
/**
*/
public function addToGroup($uid, $gid) {
return $this->handleRequest(
- $gid, 'addToGroup', array($uid, $gid));
+ $gid, 'addToGroup', [$uid, $gid]);
}
/**
*/
public function removeFromGroup($uid, $gid) {
return $this->handleRequest(
- $gid, 'removeFromGroup', array($uid, $gid));
+ $gid, 'removeFromGroup', [$uid, $gid]);
}
/**
*/
public function countUsersInGroup($gid, $search = '') {
return $this->handleRequest(
- $gid, 'countUsersInGroup', array($gid, $search));
+ $gid, 'countUsersInGroup', [$gid, $search]);
}
/**
*/
public function getGroupDetails($gid) {
return $this->handleRequest(
- $gid, 'getGroupDetails', array($gid));
+ $gid, 'getGroupDetails', [$gid]);
}
/**
* Returns a list with all groups
*/
public function getGroups($search = '', $limit = -1, $offset = 0) {
- $groups = array();
+ $groups = [];
foreach($this->backends as $backend) {
$backendGroups = $backend->getGroups($search, $limit, $offset);
* @return bool
*/
public function groupExists($gid) {
- return $this->handleRequest($gid, 'groupExists', array($gid));
+ return $this->handleRequest($gid, 'groupExists', [$gid]);
}
/**
* @return resource of the LDAP connection
*/
public function getNewLDAPConnection($gid) {
- return $this->handleRequest($gid, 'getNewLDAPConnection', array($gid));
+ return $this->handleRequest($gid, 'getNewLDAPConnection', [$gid]);
}
public function getDisplayName(string $gid): string {
$keys = $this->getServersConfig($referenceConfigkey);
- $result = array();
+ $result = [];
foreach($keys as $key) {
$len = strlen($key) - strlen($referenceConfigkey);
$prefix = substr($key, 0, $len);
AND `appid` = \'user_ldap\'
AND `configkey` NOT IN (\'enabled\', \'installed_version\', \'types\', \'bgjUpdateGroupsLastRun\')
');
- $delRows = $query->execute(array($prefix.'%'));
+ $delRows = $query->execute([$prefix.'%']);
if($delRows === null) {
return false;
public function sanitizeDN($dn) {
//treating multiple base DNs
if(is_array($dn)) {
- $result = array();
+ $result = [];
foreach($dn as $singleDN) {
$result[] = $this->sanitizeDN($singleDN);
}
//escape DN values according to RFC 2253 – this is already done by ldap_explode_dn
//to use the DN in search filters, \ needs to be escaped to \5c additionally
//to use them in bases, we convert them back to simple backslashes in readAttribute()
- $replacements = array(
+ $replacements = [
'\,' => '\5c2C',
'\=' => '\5c3D',
'\+' => '\5c2B',
'(' => '\28',
')' => '\29',
'*' => '\2A',
- );
+ ];
$dn = str_replace(array_keys($replacements), array_values($replacements), $dn);
return $dn;
$access = $this->accessFactory->get($connection);
$access->setUserMapper($this->mapper);
- $filter = $access->combineFilterWithAnd(array(
+ $filter = $access->combineFilterWithAnd([
$access->connection->ldapUserFilter,
$access->connection->ldapUserDisplayName . '=*',
$access->getFilterPartForUserSearch('')
- ));
+ ]);
$results = $access->fetchListOfUsers(
$filter,
$access->userManager->getAttributes(),
$actualUsers = self::getGroupBE()->usersInGroup($group);
$hasChanged = false;
foreach(array_diff($knownUsers, $actualUsers) as $removedUser) {
- \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', array('uid' => $removedUser, 'gid' => $group));
+ \OCP\Util::emitHook('OC_User', 'post_removeFromGroup', ['uid' => $removedUser, 'gid' => $group]);
\OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" – "'.$removedUser.'" removed from "'.$group.'".',
ILogger::INFO);
$hasChanged = true;
}
foreach(array_diff($actualUsers, $knownUsers) as $addedUser) {
- \OCP\Util::emitHook('OC_User', 'post_addToGroup', array('uid' => $addedUser, 'gid' => $group));
+ \OCP\Util::emitHook('OC_User', 'post_addToGroup', ['uid' => $addedUser, 'gid' => $group]);
\OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" – "'.$addedUser.'" added to "'.$group.'".',
ILogger::INFO);
$hasChanged = true;
}
if($hasChanged) {
- $query->execute(array(serialize($actualUsers), $group));
+ $query->execute([serialize($actualUsers), $group]);
}
}
\OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" – new group "'.$createdGroup.'" found.',
ILogger::INFO);
$users = serialize(self::getGroupBE()->usersInGroup($createdGroup));
- $query->execute(array($createdGroup, $users));
+ $query->execute([$createdGroup, $users]);
}
\OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" – FINISHED dealing with created Groups.',
\OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" – group "'.$removedGroup.'" was removed.',
ILogger::INFO);
- $query->execute(array($removedGroup));
+ $query->execute([$removedGroup]);
}
\OCP\Util::writeLog('user_ldap',
'bgJ "updateGroups" – FINISHED dealing with removed groups.',
FROM `*PREFIX*ldap_group_members`
');
$result = $query->execute()->fetchAll();
- self::$groupsFromDB = array();
+ self::$groupsFromDB = [];
foreach($result as $dataset) {
self::$groupsFromDB[$dataset['owncloudname']] = $dataset;
}
class LDAP implements ILDAPWrapper {
protected $curFunc = '';
- protected $curArgs = array();
+ protected $curArgs = [];
/**
* @param resource $link
*/
public function controlPagedResultResponse($link, $result, &$cookie) {
$this->preFunctionCall('ldap_control_paged_result_response',
- array($link, $result, $cookie));
+ [$link, $result, $cookie]);
$result = ldap_control_paged_result_response($link, $result, $cookie);
$this->postFunctionCall();
* @return bool
*/
public function modReplace($link, $userDN, $password) {
- return $this->invokeLDAPMethod('mod_replace', $link, $userDN, array('userPassword' => $password));
+ return $this->invokeLDAPMethod('mod_replace', $link, $userDN, ['userPassword' => $password]);
}
/**
WHERE `' . $compareCol . '` = ?
');
- $res = $query->execute(array($search));
+ $res = $query->execute([$search]);
if($res !== false) {
return $query->fetchColumn();
}
WHERE `directory_uuid` = ?
');
- return $this->modify($query, array($fdn, $uuid));
+ return $this->modify($query, [$fdn, $uuid]);
}
/**
WHERE `owncloud_name` LIKE ?
');
- $res = $query->execute(array($prefixMatch.$this->dbc->escapeLikeParameter($search).$postfixMatch));
- $names = array();
+ $res = $query->execute([$prefixMatch.$this->dbc->escapeLikeParameter($search).$postfixMatch]);
+ $names = [];
if($res !== false) {
while($row = $query->fetch()) {
$names[] = $row['owncloud_name'];
return false;
}
- $row = array(
+ $row = [
'ldap_dn' => $fdn,
'owncloud_name' => $name,
'directory_uuid' => $uuid
- );
+ ];
try {
$result = $this->dbc->insertIfNotExist($this->getTableName(), $row);
DELETE FROM `'. $this->getTableName() .'`
WHERE `owncloud_name` = ?');
- return $this->modify($query, array($name));
+ return $this->modify($query, [$name]);
}
/**
use OCA\User_LDAP\User\Manager;
abstract class Proxy {
- static private $accesses = array();
+ static private $accesses = [];
private $ldap = null;
/** @var \OCP\ICache|null */
* @return array
*/
public function export() {
- $data = array();
+ $data = [];
$data['ocName'] = $this->getOCName();
$data['dn'] = $this->getDN();
$data['uid'] = $this->getUID();
FROM `*PREFIX*share`
WHERE `uid_owner` = ?
', 1);
- $query->execute(array($this->ocName));
+ $query->execute([$this->ocName]);
$sResult = $query->fetchColumn(0);
if((int)$sResult === 1) {
$this->hasActiveShares = true;
FROM `*PREFIX*share_external`
WHERE `owner` = ?
', 1);
- $query->execute(array($this->ocName));
+ $query->execute([$this->ocName]);
$sResult = $query->fetchColumn(0);
if((int)$sResult === 1) {
$this->hasActiveShares = true;
/**
* @var string[]
*/
- protected $refreshedFeatures = array();
+ protected $refreshedFeatures = [];
/**
* @var string
*/
$uid = $params['uid'];
if (isset($uid) && $uid === $this->getUsername()) {
//retrieve relevant user attributes
- $result = $this->access->search('objectclass=*', array($this->dn), ['pwdpolicysubentry', 'pwdgraceusetime', 'pwdreset', 'pwdchangedtime']);
+ $result = $this->access->search('objectclass=*', [$this->dn], ['pwdpolicysubentry', 'pwdgraceusetime', 'pwdreset', 'pwdchangedtime']);
if (array_key_exists('pwdpolicysubentry', $result[0])) {
$pwdPolicySubentry = $result[0]['pwdpolicysubentry'];
$cacheKey = 'ppolicyAttributes' . $ppolicyDN;
$result = $this->connection->getFromCache($cacheKey);
if(is_null($result)) {
- $result = $this->access->search('objectclass=*', array($ppolicyDN), ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']);
+ $result = $this->access->search('objectclass=*', [$ppolicyDN], ['pwdgraceauthnlimit', 'pwdmaxage', 'pwdexpirewarning']);
$this->connection->writeToCache($cacheKey, $result);
}
&& count($pwdGraceUseTime) < (int)$pwdGraceAuthNLimit[0]) { //at least one more grace login available?
$this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true');
header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
- 'user_ldap.renewPassword.showRenewPasswordForm', array('user' => $uid)));
+ 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid]));
} else { //no more grace login available
header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
- 'user_ldap.renewPassword.showLoginFormInvalidPassword', array('user' => $uid)));
+ 'user_ldap.renewPassword.showLoginFormInvalidPassword', ['user' => $uid]));
}
exit();
}
if (!empty($pwdReset) && $pwdReset[0] === 'TRUE') { //user must change his password
$this->config->setUserValue($uid, 'user_ldap', 'needsPasswordReset', 'true');
header('Location: '.\OC::$server->getURLGenerator()->linkToRouteAbsolute(
- 'user_ldap.renewPassword.showRenewPasswordForm', array('user' => $uid)));
+ 'user_ldap.renewPassword.showRenewPasswordForm', ['user' => $uid]));
exit();
}
//handle password expiry warning
private $respondToActions = 0;
- private $which = array(
+ private $which = [
Backend::CREATE_USER => null,
Backend::SET_PASSWORD => null,
Backend::GET_HOME => null,
Backend::PROVIDE_AVATAR => null,
Backend::COUNT_USERS => null,
'deleteUser' => null
- );
+ ];
/**
* @return int All implemented actions, except for 'deleteUser'
if($limit <= 0) {
$limit = null;
}
- $filter = $this->access->combineFilterWithAnd(array(
+ $filter = $this->access->combineFilterWithAnd([
$this->access->connection->ldapUserFilter,
$this->access->connection->ldapUserDisplayName . '=*',
$this->access->getFilterPartForUserSearch($search)
- ));
+ ]);
Util::writeLog('user_ldap',
'getUsers: Options: search '.$search.' limit '.$limit.' offset '.$offset.' Filter: '.$filter,
return $displayNames;
}
- $displayNames = array();
+ $displayNames = [];
$users = $this->getUsers($search, $limit, $offset);
foreach ($users as $user) {
$displayNames[$user] = $this->getDisplayName($user);
&& method_exists($this->getAccess($configPrefix), $method)) {
$instance = $this->getAccess($configPrefix);
}
- if($result = call_user_func_array(array($instance, $method), $parameters)) {
+ if($result = call_user_func_array([$instance, $method], $parameters)) {
$this->writeToCache($cacheKey, $configPrefix);
return $result;
}
*/
public function getUsers($search = '', $limit = 10, $offset = 0) {
//we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends
- $users = array();
+ $users = [];
foreach($this->backends as $backend) {
$backendUsers = $backend->getUsers($search, $limit, $offset);
if (is_array($backendUsers)) {
*/
public function userExists($uid) {
$existsOnLDAP = false;
- $existsLocally = $this->handleRequest($uid, 'userExists', array($uid));
+ $existsLocally = $this->handleRequest($uid, 'userExists', [$uid]);
if($existsLocally) {
$existsOnLDAP = $this->userExistsOnLDAP($uid);
}
*/
public function userExistsOnLDAP($user) {
$id = ($user instanceof User) ? $user->getUsername() : $user;
- return $this->handleRequest($id, 'userExistsOnLDAP', array($user));
+ return $this->handleRequest($id, 'userExistsOnLDAP', [$user]);
}
/**
* Check if the password is correct without logging in the user
*/
public function checkPassword($uid, $password) {
- return $this->handleRequest($uid, 'checkPassword', array($uid, $password));
+ return $this->handleRequest($uid, 'checkPassword', [$uid, $password]);
}
/**
*/
public function loginName2UserName($loginName) {
$id = 'LOGINNAME,' . $loginName;
- return $this->handleRequest($id, 'loginName2UserName', array($loginName));
+ return $this->handleRequest($id, 'loginName2UserName', [$loginName]);
}
/**
*/
public function dn2UserName($dn) {
$id = 'DN,' . $dn;
- return $this->handleRequest($id, 'dn2UserName', array($dn));
+ return $this->handleRequest($id, 'dn2UserName', [$dn]);
}
/**
* @return boolean
*/
public function getHome($uid) {
- return $this->handleRequest($uid, 'getHome', array($uid));
+ return $this->handleRequest($uid, 'getHome', [$uid]);
}
/**
* @return string display name
*/
public function getDisplayName($uid) {
- return $this->handleRequest($uid, 'getDisplayName', array($uid));
+ return $this->handleRequest($uid, 'getDisplayName', [$uid]);
}
/**
* @return string display name
*/
public function setDisplayName($uid, $displayName) {
- return $this->handleRequest($uid, 'setDisplayName', array($uid, $displayName));
+ return $this->handleRequest($uid, 'setDisplayName', [$uid, $displayName]);
}
/**
*/
public function getDisplayNames($search = '', $limit = null, $offset = null) {
//we do it just as the /OC_User implementation: do not play around with limit and offset but ask all backends
- $users = array();
+ $users = [];
foreach($this->backends as $backend) {
$backendUsers = $backend->getDisplayNames($search, $limit, $offset);
if (is_array($backendUsers)) {
* Deletes a user
*/
public function deleteUser($uid) {
- return $this->handleRequest($uid, 'deleteUser', array($uid));
+ return $this->handleRequest($uid, 'deleteUser', [$uid]);
}
/**
*
*/
public function setPassword($uid, $password) {
- return $this->handleRequest($uid, 'setPassword', array($uid, $password));
+ return $this->handleRequest($uid, 'setPassword', [$uid, $password]);
}
/**
* @return Access instance of Access for LDAP interaction
*/
public function getLDAPAccess($uid) {
- return $this->handleRequest($uid, 'getLDAPAccess', array($uid));
+ return $this->handleRequest($uid, 'getLDAPAccess', [$uid]);
}
/**
* @return resource of the LDAP connection
*/
public function getNewLDAPConnection($uid) {
- return $this->handleRequest($uid, 'getNewLDAPConnection', array($uid));
+ return $this->handleRequest($uid, 'getNewLDAPConnection', [$uid]);
}
/**
* @return bool
*/
public function createUser($username, $password) {
- return $this->handleRequest($username, 'createUser', array($username,$password));
+ return $this->handleRequest($username, 'createUser', [$username,$password]);
}
}
protected $cr;
protected $configuration;
protected $result;
- protected $resultCache = array();
+ protected $resultCache = [];
const LRESULT_PROCESSED_OK = 2;
const LRESULT_PROCESSED_INVALID = 3;
$filter = $this->configuration->ldapGroupFilter;
if(empty($filter)) {
- $output = self::$l->n('%s group found', '%s groups found', 0, array(0));
+ $output = self::$l->n('%s group found', '%s groups found', 0, [0]);
$this->result->addChange('ldap_group_count', $output);
return $this->result;
}
* @return int|bool
*/
public function countUsersWithAttribute($attr, $existsCheck = false) {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapUserFilter',
- ))) {
+ ])) {
return false;
}
- $filter = $this->access->combineFilterWithAnd(array(
+ $filter = $this->access->combineFilterWithAnd([
$this->configuration->ldapUserFilter,
$attr . '=*'
- ));
+ ]);
$limit = ($existsCheck === false) ? null : 1;
- return $this->access->countUsers($filter, array('dn'), $limit);
+ return $this->access->countUsers($filter, ['dn'], $limit);
}
/**
* @throws \Exception
*/
public function detectUserDisplayNameAttribute() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapUserFilter',
- ))) {
+ ])) {
return false;
}
}
// first attribute that has at least one result wins
- $displayNameAttrs = array('displayname', 'cn');
+ $displayNameAttrs = ['displayname', 'cn'];
foreach ($displayNameAttrs as $attr) {
$count = (int)$this->countUsersWithAttribute($attr, true);
* @return WizardResult|bool
*/
public function detectEmailAttribute() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapUserFilter',
- ))) {
+ ])) {
return false;
}
$writeLog = false;
}
- $emailAttributes = array('mail', 'mailPrimaryAddress');
+ $emailAttributes = ['mail', 'mailPrimaryAddress'];
$winner = '';
$maxUsers = 0;
foreach($emailAttributes as $attr) {
* @throws \Exception
*/
public function determineAttributes() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapUserFilter',
- ))) {
+ ])) {
return false;
}
* @throws \Exception
*/
private function getUserAttributes() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapUserFilter',
- ))) {
+ ])) {
return false;
}
$cr = $this->getConnection();
$base = $this->configuration->ldapBase[0];
$filter = $this->configuration->ldapUserFilter;
- $rr = $this->ldap->search($cr, $base, $filter, array(), 1, 1);
+ $rr = $this->ldap->search($cr, $base, $filter, [], 1, 1);
if(!$this->ldap->isResource($rr)) {
return false;
}
$er = $this->ldap->firstEntry($cr, $rr);
$attributes = $this->ldap->getAttributes($cr, $er);
- $pureAttributes = array();
+ $pureAttributes = [];
for($i = 0; $i < $attributes['count']; $i++) {
$pureAttributes[] = $attributes[$i];
}
* @throws \Exception
*/
private function determineGroups($dbKey, $confKey, $testMemberOf = true) {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
- ))) {
+ ])) {
return false;
}
$cr = $this->getConnection();
* @throws \Exception
*/
public function fetchGroups($dbKey, $confKey) {
- $obclasses = array('posixGroup', 'group', 'zimbraDistributionList', 'groupOfNames', 'groupOfUniqueNames');
+ $obclasses = ['posixGroup', 'group', 'zimbraDistributionList', 'groupOfNames', 'groupOfUniqueNames'];
- $filterParts = array();
+ $filterParts = [];
foreach($obclasses as $obclass) {
$filterParts[] = 'objectclass='.$obclass;
}
//- that looks like a group and
//- has the group display name set
$filter = $this->access->combineFilterWithOr($filterParts);
- $filter = $this->access->combineFilterWithAnd(array($filter, 'cn=*'));
+ $filter = $this->access->combineFilterWithAnd([$filter, 'cn=*']);
- $groupNames = array();
- $groupEntries = array();
+ $groupNames = [];
+ $groupEntries = [];
$limit = 400;
$offset = 0;
do {
// we need to request dn additionally here, otherwise memberOf
// detection will fail later
- $result = $this->access->searchGroups($filter, array('cn', 'dn'), $limit, $offset);
+ $result = $this->access->searchGroups($filter, ['cn', 'dn'], $limit, $offset);
foreach($result as $item) {
if(!isset($item['cn']) && !is_array($item['cn']) && !isset($item['cn'][0])) {
// just in case - no issue known
}
public function determineGroupMemberAssoc() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapGroupFilter',
- ))) {
+ ])) {
return false;
}
$attribute = $this->detectGroupMemberAssoc();
if($attribute === false) {
return false;
}
- $this->configuration->setConfiguration(array('ldapGroupMemberAssocAttr' => $attribute));
+ $this->configuration->setConfiguration(['ldapGroupMemberAssocAttr' => $attribute]);
$this->result->addChange('ldap_group_member_assoc_attribute', $attribute);
return $this->result;
* @throws \Exception
*/
public function determineGroupObjectClasses() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
- ))) {
+ ])) {
return false;
}
$cr = $this->getConnection();
throw new \Exception('Could not connect to LDAP');
}
- $obclasses = array('groupOfNames', 'groupOfUniqueNames', 'group', 'posixGroup', '*');
+ $obclasses = ['groupOfNames', 'groupOfUniqueNames', 'group', 'posixGroup', '*'];
$this->determineFeature($obclasses,
'objectclass',
'ldap_groupfilter_objectclass',
* @throws \Exception
*/
public function determineUserObjectClasses() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
- ))) {
+ ])) {
return false;
}
$cr = $this->getConnection();
throw new \Exception('Could not connect to LDAP');
}
- $obclasses = array('inetOrgPerson', 'person', 'organizationalPerson',
- 'user', 'posixAccount', '*');
+ $obclasses = ['inetOrgPerson', 'person', 'organizationalPerson',
+ 'user', 'posixAccount', '*'];
$filter = $this->configuration->ldapUserFilter;
//if filter is empty, it is probably the first time the wizard is called
//then, apply suggestions.
* @throws \Exception
*/
public function getGroupFilter() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
- ))) {
+ ])) {
return false;
}
//make sure the use display name is set
* @throws \Exception
*/
public function getUserListFilter() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
- ))) {
+ ])) {
return false;
}
//make sure the use display name is set
* @throws \Exception
*/
public function getUserLoginFilter() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapUserFilter',
- ))) {
+ ])) {
return false;
}
* @throws \Exception
*/
public function testLoginName($loginName) {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
'ldapBase',
'ldapLoginFilter',
- ))) {
+ ])) {
return false;
}
* @throws \Exception
*/
public function guessPortAndTLS() {
- if(!$this->checkRequirements(array('ldapHost',
- ))) {
+ if(!$this->checkRequirements(['ldapHost',
+ ])) {
return false;
}
$this->checkHost();
}
if ($settingsFound === true) {
- $config = array(
+ $config = [
'ldapPort' => $p,
'ldapTLS' => (int)$t
- );
+ ];
$this->configuration->setConfiguration($config);
\OCP\Util::writeLog('user_ldap', 'Wiz: detected Port ' . $p, ILogger::DEBUG);
$this->result->addChange('ldap_port', $p);
* @return WizardResult|false WizardResult on success, false otherwise
*/
public function guessBaseDN() {
- if(!$this->checkRequirements(array('ldapHost',
+ if(!$this->checkRequirements(['ldapHost',
'ldapPort',
- ))) {
+ ])) {
return false;
}
*/
private function applyFind($key, $value) {
$this->result->addChange($key, $value);
- $this->configuration->setConfiguration(array($key => $value));
+ $this->configuration->setConfiguration([$key => $value]);
}
/**
//base is there, let's validate it. If we search for anything, we should
//get a result set > 0 on a proper base
- $rr = $this->ldap->search($cr, $base, 'objectClass=*', array('dn'), 0, 1);
+ $rr = $this->ldap->search($cr, $base, 'objectClass=*', ['dn'], 0, 1);
if(!$this->ldap->isResource($rr)) {
$errorNo = $this->ldap->errno($cr);
$errorMsg = $this->ldap->error($cr);
if(!$cr) {
throw new \Exception('Could not connect to LDAP');
}
- $result = $this->access->countUsers('memberOf=*', array('memberOf'), 1);
+ $result = $this->access->countUsers('memberOf=*', ['memberOf'], 1);
if(is_int($result) && $result > 0) {
return true;
}
}
$base = $this->configuration->ldapBase[0];
foreach($cns as $cn) {
- $rr = $this->ldap->search($cr, $base, 'cn=' . $cn, array('dn', 'primaryGroupToken'));
+ $rr = $this->ldap->search($cr, $base, 'cn=' . $cn, ['dn', 'primaryGroupToken']);
if(!$this->ldap->isResource($rr)) {
continue;
}
* @return array|false an array with the values on success, false otherwise
*/
public function cumulativeSearchOnAttribute($filters, $attr, $dnReadLimit = 3, &$maxF = null) {
- $dnRead = array();
- $foundItems = array();
+ $dnRead = [];
+ $foundItems = [];
$maxEntries = 0;
if(!is_array($this->configuration->ldapBase)
|| !isset($this->configuration->ldapBase[0])) {
continue;
}
// 20k limit for performance and reason
- $rr = $this->ldap->search($cr, $base, $filter, array($attr), 0, 20000);
+ $rr = $this->ldap->search($cr, $base, $filter, [$attr], 0, 20000);
if(!$this->ldap->isResource($rr)) {
continue;
}
if($dn === false || in_array($dn, $dnRead)) {
continue;
}
- $newItems = array();
+ $newItems = [];
$state = $this->getAttributeValuesFromEntry($attributes,
$attr,
$newItems);
* @return array
*/
private function getDefaultLdapPortSettings() {
- static $settings = array(
- array('port' => 7636, 'tls' => false),
- array('port' => 636, 'tls' => false),
- array('port' => 7389, 'tls' => true),
- array('port' => 389, 'tls' => true),
- array('port' => 7389, 'tls' => false),
- array('port' => 389, 'tls' => false),
- );
+ static $settings = [
+ ['port' => 7636, 'tls' => false],
+ ['port' => 636, 'tls' => false],
+ ['port' => 7389, 'tls' => true],
+ ['port' => 389, 'tls' => true],
+ ['port' => 7389, 'tls' => false],
+ ['port' => 389, 'tls' => false],
+ ];
return $settings;
}
//7xxx ← UCS. need to be checked first, because both ports may be open
$host = $this->configuration->ldapHost;
$port = (int)$this->configuration->ldapPort;
- $portSettings = array();
+ $portSettings = [];
//In case the port is already provided, we will check this first
if($port > 0) {
if(!(is_array($hostInfo)
&& isset($hostInfo['scheme'])
&& stripos($hostInfo['scheme'], 'ldaps') !== false)) {
- $portSettings[] = array('port' => $port, 'tls' => true);
+ $portSettings[] = ['port' => $port, 'tls' => true];
}
- $portSettings[] =array('port' => $port, 'tls' => false);
+ $portSettings[] =['port' => $port, 'tls' => false];
}
//default ports
namespace OCA\User_LDAP;
class WizardResult {
- protected $changes = array();
- protected $options = array();
+ protected $changes = [];
+ protected $options = [];
protected $markedChange = false;
/**
*/
public function addOptions($key, $values) {
if(!is_array($values)) {
- $values = array($values);
+ $values = [$values];
}
$this->options[$key] = $values;
}
* @return array
*/
public function getResultArray() {
- $result = array();
+ $result = [];
$result['changes'] = $this->changes;
if(count($this->options) > 0) {
$result['options'] = $this->options;
$sel = ' selected';
foreach($_['serverConfigurationPrefixes'] as $prefix) {
?>
- <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', array($i++)));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
+ <option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', [$i++]));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
<?php
}
?>
->getMock();
$helper = new Helper(\OC::$server->getConfig());
- return array($lw, $connector, $um, $helper);
+ return [$lw, $connector, $um, $helper];
}
public function testEscapeFilterPartValidChars() {
}
public function convertSID2StrSuccessData() {
- return array(
- array(
- array(
+ return [
+ [
+ [
"\x01",
"\x04",
"\x00\x00\x00\x00\x00\x05",
"\xa6\x81\xe5\x0e",
"\x4d\x6c\x6c\x2b",
"\xca\x32\x05\x5f",
- ),
+ ],
'S-1-5-21-249921958-728525901-1594176202',
- ),
- array(
- array(
+ ],
+ [
+ [
"\x01",
"\x02",
"\xFF\xFF\xFF\xFF\xFF\xFF",
"\xFF\xFF\xFF\xFF",
"\xFF\xFF\xFF\xFF",
- ),
+ ],
'S-1-281474976710655-4294967295-4294967295',
- ),
- );
+ ],
+ ];
}
public function testConvertSID2StrInputError() {
return [[
[
'input' => 'foo=bar,bar=foo,dc=foobar',
- 'interResult' => array(
+ 'interResult' => [
'count' => 3,
0 => 'foo=bar',
1 => 'bar=foo',
2 => 'dc=foobar'
- ),
+ ],
'expectedResult' => true
],
[
public function dNAttributeProvider() {
// corresponds to Access::resemblesDN()
- return array(
- 'dn' => array('dn'),
- 'uniqueMember' => array('uniquemember'),
- 'member' => array('member'),
- 'memberOf' => array('memberof')
- );
+ return [
+ 'dn' => ['dn'],
+ 'uniqueMember' => ['uniquemember'],
+ 'member' => ['member'],
+ 'memberOf' => ['memberof']
+ ];
}
/**
->willReturn(true);
$lw->expects($this->any())
->method('getAttributes')
- ->willReturn(array(
- $attribute => array('count' => 1, $dnFromServer)
- ));
+ ->willReturn([
+ $attribute => ['count' => 1, $dnFromServer]
+ ]);
$access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager);
$values = $access->readAttribute('uid=whoever,dc=example,dc=org', $attribute);
}
public function configurationDataProvider() {
- $inputWithDN = array(
+ $inputWithDN = [
'cn=someUsers,dc=example,dc=org',
' ',
' cn=moreUsers,dc=example,dc=org '
- );
- $expectWithDN = array(
+ ];
+ $expectWithDN = [
'cn=someUsers,dc=example,dc=org',
'cn=moreUsers,dc=example,dc=org'
- );
+ ];
- $inputNames = array(
+ $inputNames = [
' uid ',
'cn ',
' ',
'',
' whats my name',
' '
- );
- $expectedNames = array('uid', 'cn', 'whats my name');
+ ];
+ $expectedNames = ['uid', 'cn', 'whats my name'];
$inputString = ' alea iacta est ';
$expectedString = 'alea iacta est';
- $inputHomeFolder = array(
+ $inputHomeFolder = [
' homeDirectory ',
' attr:homeDirectory ',
' '
- );
+ ];
- $expectedHomeFolder = array(
+ $expectedHomeFolder = [
'attr:homeDirectory', 'attr:homeDirectory', ''
- );
+ ];
$password = ' such a passw0rd ';
- return array(
- 'set general base' => array('ldapBase', $inputWithDN, $expectWithDN),
- 'set user base' => array('ldapBaseUsers', $inputWithDN, $expectWithDN),
- 'set group base' => array('ldapBaseGroups', $inputWithDN, $expectWithDN),
+ return [
+ 'set general base' => ['ldapBase', $inputWithDN, $expectWithDN],
+ 'set user base' => ['ldapBaseUsers', $inputWithDN, $expectWithDN],
+ 'set group base' => ['ldapBaseGroups', $inputWithDN, $expectWithDN],
- 'set search attributes users' => array('ldapAttributesForUserSearch', $inputNames, $expectedNames),
- 'set search attributes groups' => array('ldapAttributesForGroupSearch', $inputNames, $expectedNames),
+ 'set search attributes users' => ['ldapAttributesForUserSearch', $inputNames, $expectedNames],
+ 'set search attributes groups' => ['ldapAttributesForGroupSearch', $inputNames, $expectedNames],
- 'set user filter objectclasses' => array('ldapUserFilterObjectclass', $inputNames, $expectedNames),
- 'set user filter groups' => array('ldapUserFilterGroups', $inputNames, $expectedNames),
- 'set group filter objectclasses' => array('ldapGroupFilterObjectclass', $inputNames, $expectedNames),
- 'set group filter groups' => array('ldapGroupFilterGroups', $inputNames, $expectedNames),
- 'set login filter attributes' => array('ldapLoginFilterAttributes', $inputNames, $expectedNames),
+ 'set user filter objectclasses' => ['ldapUserFilterObjectclass', $inputNames, $expectedNames],
+ 'set user filter groups' => ['ldapUserFilterGroups', $inputNames, $expectedNames],
+ 'set group filter objectclasses' => ['ldapGroupFilterObjectclass', $inputNames, $expectedNames],
+ 'set group filter groups' => ['ldapGroupFilterGroups', $inputNames, $expectedNames],
+ 'set login filter attributes' => ['ldapLoginFilterAttributes', $inputNames, $expectedNames],
- 'set agent password' => array('ldapAgentPassword', $password, $password),
+ 'set agent password' => ['ldapAgentPassword', $password, $password],
- 'set home folder, variant 1' => array('homeFolderNamingRule', $inputHomeFolder[0], $expectedHomeFolder[0]),
- 'set home folder, variant 2' => array('homeFolderNamingRule', $inputHomeFolder[1], $expectedHomeFolder[1]),
- 'set home folder, empty' => array('homeFolderNamingRule', $inputHomeFolder[2], $expectedHomeFolder[2]),
+ 'set home folder, variant 1' => ['homeFolderNamingRule', $inputHomeFolder[0], $expectedHomeFolder[0]],
+ 'set home folder, variant 2' => ['homeFolderNamingRule', $inputHomeFolder[1], $expectedHomeFolder[1]],
+ 'set home folder, empty' => ['homeFolderNamingRule', $inputHomeFolder[2], $expectedHomeFolder[2]],
// default behaviour, one case is enough, special needs must be tested
// individually
- 'set string value' => array('ldapHost', $inputString, $expectedString),
+ 'set string value' => ['ldapHost', $inputString, $expectedString],
'set avatar rule, default' => ['ldapUserAvatarRule', 'default', 'default'],
'set avatar rule, none' => ['ldapUserAvatarRule', 'none', 'none'],
'set avatar rule, data attribute' => ['ldapUserAvatarRule', 'data:jpegPhoto', 'data:jpegPhoto'],
'set external storage home attribute' => ['ldapExtStorageHomeAttribute', 'homePath', 'homePath'],
- );
+ ];
}
/**
$lw = $this->createMock(ILDAPWrapper::class);
$connection = new Connection($lw, '', null);
- $agent = array(
+ $agent = [
'ldapAgentName' => 'agent',
'ldapAgentPassword' => '123456',
- );
+ ];
$connection->setConfiguration($agent);
$testConnection = clone $connection;
- $user = array(
+ $user = [
'ldapAgentName' => 'user',
'ldapAgentPassword' => 'password',
- );
+ ];
$testConnection->setConfiguration($user);
$agentName = $connection->ldapAgentName;
$access->expects($this->once())
->method('searchGroups')
- ->willReturn(array());
+ ->willReturn([]);
$access->expects($this->never())
->method('dn2groupname');
$access->expects($this->once())
->method('readAttribute')
->with($dn, $attr)
- ->willReturn(array('3117'));
+ ->willReturn(['3117']);
$groupBackend = new GroupLDAP($access, $pluginManager);
$access->expects($this->once())
->method('searchGroups')
- ->willReturn(array());
+ ->willReturn([]);
$access->expects($this->never())
->method('dn2groupname');
$access->expects($this->once())
->method('readAttribute')
->with($dn, $attr)
- ->willReturn(array('3117'));
+ ->willReturn(['3117']);
$groupBackend = new GroupLDAP($access, $pluginManager);
$access->expects($this->once())
->method('nextcloudGroupNames')
- ->willReturn(array('group1', 'group2'));
+ ->willReturn(['group1', 'group2']);
$groupBackend = new GroupLDAP($access, $pluginManager);
$groups = $groupBackend->getGroups('', 2, 2);
->method('readAttribute')
->willReturnCallback(function($dn, $attr) {
if($attr === 'primaryGroupToken') {
- return array(1337);
+ return [1337];
} else if($attr === 'gidNumber') {
return [4211];
}
- return array();
+ return [];
});
$access->expects($this->any())
->method('groupname2dn')
->method('readAttribute')
->willReturnCallback(function($dn, $attr) {
if($attr === 'primaryGroupToken') {
- return array(1337);
+ return [1337];
}
- return array();
+ return [];
});
$access->expects($this->any())
->method('groupname2dn')
->willReturn('cn=foobar,dc=foo,dc=bar');
$access->expects($this->once())
->method('nextcloudUserNames')
- ->willReturn(array('lisa', 'bart', 'kira', 'brad'));
+ ->willReturn(['lisa', 'bart', 'kira', 'brad']);
$access->userManager = $this->createMock(Manager::class);
$groupBackend = new GroupLDAP($access, $pluginManager);
->method('readAttribute')
->willReturnCallback(function($dn, $attr) {
if($attr === 'primaryGroupToken') {
- return array(1337);
+ return [1337];
}
- return array();
+ return [];
});
$access->expects($this->any())
//host contains port, 2nd parameter will be ignored
$cr = $this->ldap->connect($this->ldapHost, 0);
$this->ldap->bind($cr, $this->ldapBindDN, $this->ldapBindPwd);
- $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', array('dn'), true, 5);
+ $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', ['dn'], true, 5);
// disable LDAP, will cause lost connection
$this->setProxyState(false);
try {
- $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', array('dn'), true, 5);
+ $this->ldap->search($cr, $this->ldapBase, 'objectClass=*', ['dn'], true, 5);
} catch (ServerNotAvailableException $e) {
print("Test PASSED" . PHP_EOL);
exit(0);
$ch = $this->getCurl();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
+ curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
- 'Content-Length: ' . strlen($postData))
+ 'Content-Length: ' . strlen($postData)]
);
$recvd = curl_exec($ch);
$this->checkCurlResult($ch, $recvd);
class CleanUpTest extends \Test\TestCase {
public function getMocks() {
- $mocks = array();
+ $mocks = [];
$mocks['userBackend'] =
$this->getMockBuilder('\OCA\User_LDAP\User_Proxy')
->disableOriginalConstructor()
->willReturn(true);
$userBackend->expects($this->at(3))
->method('getConfiguration')
- ->willReturn(array('ldap_display_name'=>'displayName'));
+ ->willReturn(['ldap_display_name'=>'displayName']);
$userBackend->expects($this->any())
->method($this->anything())
->willReturnSelf();
->willReturn(true);
$userBackend->expects($this->at(3))
->method('getConfiguration')
- ->willReturn(array('ldap_email_attr'=>'mail'));
+ ->willReturn(['ldap_email_attr'=>'mail']);
$userBackend->expects($this->any())
->method($this->anything())
->willReturnSelf();
->willReturn(true);
$groupBackend->expects($this->any())
->method('getConfiguration')
- ->willReturn(array('ldap_group_member_assoc_attribute'=>'assoc_type'));
+ ->willReturn(['ldap_group_member_assoc_attribute'=>'assoc_type']);
$groupBackend->expects($this->any())
->method($this->anything())
->willReturnSelf();
$this->ldap
->expects($this->once())
->method('invokeLDAPMethod')
- ->with('mod_replace', $link, $userDN, array('userPassword' => $password))
+ ->with('mod_replace', $link, $userDN, ['userPassword' => $password])
->willReturn(true);
$this->assertTrue($this->ldap->modReplace($link, $userDN, $password));
* @return array
*/
protected function getTestData() {
- $data = array(
- array(
+ $data = [
+ [
'dn' => 'uid=foobar,dc=example,dc=org',
'name' => 'Foobar',
'uuid' => '1111-AAAA-1234-CDEF',
- ),
- array(
+ ],
+ [
'dn' => 'uid=barfoo,dc=example,dc=org',
'name' => 'Barfoo',
'uuid' => '2222-BBBB-1234-CDEF',
- ),
- array(
+ ],
+ [
'dn' => 'uid=barabara,dc=example,dc=org',
'name' => 'BaraBara',
'uuid' => '3333-CCCC-1234-CDEF',
- )
- );
+ ]
+ ];
return $data;
}
$mapper->clear();
$this->mapEntries($mapper, $data);
- return array($mapper, $data);
+ return [$mapper, $data];
}
/**
// test that mapping will not happen when it shall not
$tooLongDN = 'uid=joann,ou=Secret Small Specialized Department,ou=Some Tremendously Important Department,ou=Another Very Important Department,ou=Pretty Meaningful Derpartment,ou=Quite Broad And General Department,ou=The Topmost Department,dc=hugelysuccessfulcompany,dc=com';
- $paramKeys = array('', 'dn', 'name', 'uuid', $tooLongDN);
+ $paramKeys = ['', 'dn', 'name', 'uuid', $tooLongDN];
foreach($paramKeys as $key) {
$failEntry = $data[0];
if(!empty($key)) {
->setMethods($requiredMethods)
->getMock();
- $this->connection->setConfiguration(array(
+ $this->connection->setConfiguration([
'homeFolderNamingRule' => 'homeDirectory'
- ));
+ ]);
$this->connection->expects($this->any())
->method('__get')
->willReturnCallback(function($name) {
}
public function emptyHomeFolderAttributeValueProvider() {
- return array(
+ return [
'empty' => [''],
'prefixOnly' => ['attr:'],
- );
+ ];
}
/**
->method('fetchListOfUsers')
->willReturnCallback(function($filter) {
if($filter === 'roland') {
- return array(array('dn' => ['dnOfRoland,dc=test']));
+ return [['dn' => ['dnOfRoland,dc=test']]];
}
- return array();
+ return [];
});
$this->access->expects($this->any())
->method('fetchUsersByLoginName')
->willReturnCallback(function($uid) {
if($uid === 'roland') {
- return array(array('dn' => ['dnOfRoland,dc=test']));
+ return [['dn' => ['dnOfRoland,dc=test']]];
}
- return array();
+ return [];
});
$retVal = 'gunslinger';
$this->access->expects($this->any())
->method('fetchListOfUsers')
->willReturnCallback(function($search, $a, $l, $o) {
- $users = array('gunslinger', 'newyorker', 'ladyofshadows');
+ $users = ['gunslinger', 'newyorker', 'ladyofshadows'];
if(empty($search)) {
$result = $users;
} else {
- $result = array();
+ $result = [];
foreach($users as $user) {
if(stripos($user, $search) !== false) {
$result[] = $user;
->method('readAttribute')
->willReturnCallback(function($dn) {
if($dn === 'dnOfRoland,dc=test') {
- return array();
+ return [];
}
return false;
});
->method('readAttribute')
->willReturnCallback(function($dn) {
if($dn === 'dnOfRoland,dc=test') {
- return array();
+ return [];
}
return false;
});
switch ($dn) {
case 'dnOfRoland,dc=test':
if($attr === 'testAttribute') {
- return array('/tmp/rolandshome/');
+ return ['/tmp/rolandshome/'];
}
- return array();
+ return [];
break;
default:
return false;
switch ($dn) {
case 'dnOfLadyOfShadows,dc=test':
if($attr === 'testAttribute') {
- return array('susannah/');
+ return ['susannah/'];
}
- return array();
+ return [];
break;
default:
return false;
switch ($dn) {
case 'dnOfRoland,dc=test':
if($attr === 'displayname') {
- return array('Roland Deschain');
+ return ['Roland Deschain'];
}
- return array();
+ return [];
break;
default:
->method('fetchListOfUsers')
->willReturnCallback(function($filter) {
if($filter === 'roland') {
- return array(array('dn' => ['dnOfRoland,dc=test']));
+ return [['dn' => ['dnOfRoland,dc=test']]];
}
- return array();
+ return [];
});
$this->access->expects($this->any())
->method('fetchUsersByLoginName')
->willReturnCallback(function($uid) {
if($uid === 'roland') {
- return array(array('dn' => ['dnOfRoland,dc=test']));
+ return [['dn' => ['dnOfRoland,dc=test']]];
}
- return array();
+ return [];
});
$this->access->expects($this->any())
->method('dn2username')
parent::setUp();
//we need to make sure the consts are defined, otherwise tests will fail
//on systems without php5_ldap
- $ldapConsts = array('LDAP_OPT_PROTOCOL_VERSION',
- 'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT');
+ $ldapConsts = ['LDAP_OPT_PROTOCOL_VERSION',
+ 'LDAP_OPT_REFERRALS', 'LDAP_OPT_NETWORK_TIMEOUT'];
foreach($ldapConsts as $const) {
if(!defined($const)) {
define($const, 42);
/** @var Access|\PHPUnit_Framework_MockObject_MockObject $access */
$access = $this->createMock(Access::class);
- return array(new Wizard($conf, $lw, $access), $conf, $lw, $access);
+ return [new Wizard($conf, $lw, $access), $conf, $lw, $access];
}
private function prepareLdapWrapperForConnections(MockObject &$ldap) {
->method('__get')
->willReturnCallback(function($name) {
if($name === 'ldapBase') {
- return array('base');
+ return ['base'];
}
return null;
});
$ldap->expects($this->exactly(10))
->method('getAttributes')
//dummy value, usually invalid
- ->willReturn(array('cn' => array('foo'), 'count' => 1));
+ ->willReturn(['cn' => ['foo'], 'count' => 1]);
global $uidnumber;
$uidnumber = 1;
});
// The following expectations are the real test
- $filters = array('f1', 'f2', '*');
+ $filters = ['f1', 'f2', '*'];
$wizard->cumulativeSearchOnAttribute($filters, 'cn', 5);
unset($uidnumber);
}
->method('__get')
->willReturnCallback(function($name) {
if($name === 'ldapBase') {
- return array('base');
+ return ['base'];
}
return null;
});
$ldap->expects($this->exactly(46))
->method('getAttributes')
//dummy value, usually invalid
- ->willReturn(array('cn' => array('foo'), 'count' => 1));
+ ->willReturn(['cn' => ['foo'], 'count' => 1]);
global $uidnumber;
$uidnumber = 1;
});
// The following expectations are the real test
- $filters = array('f1', 'f2', '*');
+ $filters = ['f1', 'f2', '*'];
$wizard->cumulativeSearchOnAttribute($filters, 'cn', 0);
unset($uidnumber);
}
->method('__get')
->willReturnCallback(function($name) {
if($name === 'ldapBase') {
- return array('base');
+ return ['base'];
}
return null;
});
->method('getAttributes')
//dummy value, usually invalid
->willReturnCallback(function($a, $entry) {
- return array('cn' => array($entry), 'count' => 1);
+ return ['cn' => [$entry], 'count' => 1];
});
$ldap->expects($this->any())
});
// The following expectations are the real test
- $filters = array('f1', 'f2', '*');
+ $filters = ['f1', 'f2', '*'];
$resultArray = $wizard->cumulativeSearchOnAttribute($filters, 'cn', 0);
$this->assertSame(6, count($resultArray));
unset($mark);
*/
private function getFileIdForPath($path) {
$url = $this->baseUrl . '/remote.php/webdav/' . $path;
- $context = stream_context_create(array(
- 'http' => array(
+ $context = stream_context_create([
+ 'http' => [
'method' => 'PROPFIND',
'header' => "Authorization: Basic dXNlcjA6MTIzNDU2\r\nContent-Type: application/x-www-form-urlencoded",
'content' => '<?xml version="1.0"?>
<oc:fileid />
</d:prop>
</d:propfind>'
- )
- ));
+ ]
+ ]);
$response = file_get_contents($url, false, $context);
preg_match_all('/\<oc:fileid\>(.*)\<\/oc:fileid\>/', $response, $matches);
];
$this->response = $client->get($fullUrl, $options);
- $groups = array($group);
+ $groups = [$group];
$respondedArray = $this->getArrayOfGroupsResponded($this->response);
Assert::assertNotEquals($groups, $respondedArray, "", 0.0, 10, true);
Assert::assertEquals(200, $this->response->getStatusCode());
private function getFileIdForPath($path, $user) {
$url = $this->baseUrl . '/remote.php/webdav/' . $path;
$credentials = base64_encode($user . ':' . $this->getPasswordForUser($user));
- $context = stream_context_create(array(
- 'http' => array(
+ $context = stream_context_create([
+ 'http' => [
'method' => 'PROPFIND',
'header' => "Authorization: Basic $credentials\r\nContent-Type: application/x-www-form-urlencoded",
'content' => '<?xml version="1.0"?>
<oc:fileid />
</d:prop>
</d:propfind>'
- )
- ));
+ ]
+ ]);
$response = file_get_contents($url, false, $context);
preg_match_all('/\<oc:fileid\>(.*?)\<\/oc:fileid\>/', $response, $matches);
return (int)$matches[1][0];
* * use RST syntax
*/
-$CONFIG = array(
+$CONFIG = [
/**
* Using TLS certificates where commonName=<IP address> is deprecated
*/
'trusted_domains' =>
- array (
+ [
'demo.example.org',
'otherdomain.example.org',
'10.111.112.113',
'[2001:db8::1]'
- ),
+ ],
/**
* will be passed to underlying Swift mailer implementation.
* Defaults to an empty array.
*/
-'mail_smtpstreamoptions' => array(),
+'mail_smtpstreamoptions' => [],
/**
* Which mode is used for sendmail/qmail: ``smtp`` or ``pipe``.
* - www.eff.org
* - www.edri.org
*/
-'connectivity_check_domains' => array(
+'connectivity_check_domains' => [
'www.nextcloud.com',
'www.startpage.com',
'www.eff.org',
'www.edri.org'
-),
+],
/**
* Allows Nextcloud to verify a working .well-known URL redirects. This is done
* to that folder, starting from the Nextcloud webroot. The key ``writable``
* indicates if a Web server can write files to that folder.
*/
-'apps_paths' => array(
- array(
+'apps_paths' => [
+ [
'path'=> '/var/www/nextcloud/apps',
'url' => '/apps',
'writable' => true,
- ),
-),
+ ],
+],
/**
* @see appcodechecker
* - OC\Preview\TXT
* - OC\Preview\XBitmap
*/
-'enabledPreviewProviders' => array(
+'enabledPreviewProviders' => [
'OC\Preview\PNG',
'OC\Preview\JPEG',
'OC\Preview\GIF',
'OC\Preview\MP3',
'OC\Preview\TXT',
'OC\Preview\MarkDown'
-),
+],
/**
* LDAP
*
* Defaults to an empty array.
*/
-'openssl' => array(
+'openssl' => [
'config' => '/absolute/location/of/openssl.cnf',
-),
+],
/**
* Memory caching backend configuration
/**
* Server details for one or more memcached servers to use for memory caching.
*/
-'memcached_servers' => array(
+'memcached_servers' => [
// hostname, port and optional weight. Also see:
// http://www.php.net/manual/en/memcached.addservers.php
// http://www.php.net/manual/en/memcached.addserver.php
- array('localhost', 11211),
+ ['localhost', 11211],
//array('other.host.local', 11211),
-),
+],
/**
* Connection options for memcached
*/
-'memcached_options' => array(
+'memcached_options' => [
// Set timeouts to 50ms
\Memcached::OPT_CONNECT_TIMEOUT => 50,
\Memcached::OPT_RETRY_TIMEOUT => 50,
// Binary serializer vill be enabled if the igbinary PECL module is available
//\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_IGBINARY,
-),
+],
/**
* Additional driver options for the database connection, eg. to enable SSL
* encryption in MySQL or specify a custom wait timeout on a cheap hoster.
*/
-'dbdriveroptions' => array(
+'dbdriveroptions' => [
PDO::MYSQL_ATTR_SSL_CA => '/file/path/to/ca_cert.pem',
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET wait_timeout = 28800'
-),
+],
/**
* sqlite3 journal mode can be specified using this configuration parameter -
* - mysql (MySQL)
* - pgsql (PostgreSQL)
*/
-'supportedDatabases' => array(
+'supportedDatabases' => [
'sqlite',
'mysql',
'pgsql',
'oci',
-),
+],
/**
* Override where Nextcloud stores temporary files. Useful in situations where
*
* Defaults to ``array('.htaccess')``
*/
-'blacklisted_files' => array('.htaccess'),
+'blacklisted_files' => ['.htaccess'],
/**
* Define a default folder for shared files and folders other than root.
*
* Defaults to an empty array.
*/
-'trusted_proxies' => array('203.0.113.45', '198.51.100.128', '192.168.2.0/24'),
+'trusted_proxies' => ['203.0.113.45', '198.51.100.128', '192.168.2.0/24'],
/**
* Headers that should be trusted as client IP address in combination with
*
* Defaults to ``'HTTP_X_FORWARDED_FOR'``
*/
-'forwarded_for_headers' => array('HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR'),
+'forwarded_for_headers' => ['HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR'],
/**
* max file size for animating gifs on public-sharing-site.
*
* WARNING: only use this if you know what you are doing
*/
-'csrf.optout' => array(
+'csrf.optout' => [
'/^WebDAVFS/', // OS X Finder
'/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive
-),
+],
/**
* By default there is on public pages a link shown that allows users to
*/
'login_form_autocomplete' => true,
-);
+];
$singleAppId = $input->getArgument('app-id');
if ($singleAppId) {
- $apps = array($singleAppId);
+ $apps = [$singleAppId];
try {
$this->manager->getAppPath($singleAppId);
} catch (\OCP\App\AppPathNotFoundException $e) {
$encryptionModules = $this->encryptionManager->getEncryptionModules();
$defaultEncryptionModuleId = $this->encryptionManager->getDefaultEncryptionModuleId();
- $encModules = array();
+ $encModules = [];
foreach ($encryptionModules as $module) {
$encModules[$module['id']]['displayName'] = $module['displayName'];
$encModules[$module['id']]['default'] = $module['id'] === $defaultEncryptionModuleId;
}
private function getAllLanguages($path) {
- $result = array();
+ $result = [];
foreach (new DirectoryIterator("$path/l10n") as $fileInfo) {
if($fileInfo->isDot()) {
continue;
return;
}
$content = "OC.L10N.register(\n \"$app\",\n {\n ";
- $jsTrans = array();
+ $jsTrans = [];
foreach ($translations as $id => $val) {
if (is_array($val)) {
$val = '[ ' . implode(',', $val) . ']';
$output->writeln("File already exists: $jsFile");
return;
}
- $content = array('translations' => $translations, 'pluralForm' => $plurals);
+ $content = ['translations' => $translations, 'pluralForm' => $plurals];
file_put_contents($jsFile, json_encode($content));
$output->writeln("Json translation file generated: $jsFile");
}
private function loadTranslations($path, $lang) {
$phpFile = "$path/l10n/$lang.php";
- $TRANSLATIONS = array();
+ $TRANSLATIONS = [];
$PLURAL_FORMS = '';
if (!file_exists($phpFile)) {
throw new UnexpectedValueException("PHP translation file <$phpFile> does not exist.");
}
require $phpFile;
- return array($TRANSLATIONS, $PLURAL_FORMS);
+ return [$TRANSLATIONS, $PLURAL_FORMS];
}
/**
}
protected function execute(InputInterface $input, OutputInterface $output) {
- $values = array(
+ $values = [
'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
'version' => implode('.', \OCP\Util::getVersion()),
'versionstring' => \OC_Util::getVersionString(),
'edition' => '',
- );
+ ];
$this->writeArrayInOutputFormat($input, $output, $values);
}
* @param OutputInterface $output output interface
*/
protected function postUpgradeCheck(InputInterface $input, OutputInterface $output) {
- $trustedDomains = $this->config->getSystemValue('trusted_domains', array());
+ $trustedDomains = $this->config->getSystemValue('trusted_domains', []);
if (empty($trustedDomains)) {
$output->write(
'<warning>The setting "trusted_domains" could not be ' .
protected function execute(InputInterface $input, OutputInterface $output) {
$table = new Table($output);
- $table->setHeaders(array('User Report', ''));
+ $table->setHeaders(['User Report', '']);
$userCountArray = $this->countUsers();
if(!empty($userCountArray)) {
$total = 0;
- $rows = array();
+ $rows = [];
foreach($userCountArray as $classname => $users) {
$total += $users;
- $rows[] = array($classname, $users);
+ $rows[] = [$classname, $users];
}
- $rows[] = array(' ');
- $rows[] = array('total users', $total);
+ $rows[] = [' '];
+ $rows[] = ['total users', $total];
} else {
- $rows[] = array('No backend enabled that supports user counting', '');
+ $rows[] = ['No backend enabled that supports user counting', ''];
}
$userDirectoryCount = $this->countUserDirectories();
- $rows[] = array(' ');
- $rows[] = array('user directories', $userDirectoryCount);
+ $rows[] = [' '];
+ $rows[] = ['user directories', $userDirectoryCount];
$table->setRows($rows);
$table->render();
} catch (\Exception $e) {
return new TemplateResponse(
'core', 'error', [
- "errors" => array(array("error" => $e->getMessage()))
+ "errors" => [["error" => $e->getMessage()]]
],
'guest'
);
* @param array $additional
* @return array
*/
- private function error($message, array $additional=array()) {
- return array_merge(array('status' => 'error', 'msg' => $message), $additional);
+ private function error($message, array $additional=[]) {
+ return array_merge(['status' => 'error', 'msg' => $message], $additional);
}
/**
$instance = call_user_func($module['callback']);
// this way we can find out whether per-user keys are used or a system wide encryption key
if ($instance->needDetailedAccessList()) {
- return $this->error('', array('encryption' => true));
+ return $this->error('', ['encryption' => true]);
}
}
}
$this->checkPasswordResetToken($token, $userId);
$user = $this->userManager->get($userId);
- \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', array('uid' => $userId, 'password' => $password));
+ \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'pre_passwordReset', ['uid' => $userId, 'password' => $password]);
if (!$user->setPassword($password)) {
throw new \Exception();
}
- \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', array('uid' => $userId, 'password' => $password));
+ \OC_Hook::emit('\OC\Core\LostPassword\Controller\LostController', 'post_passwordReset', ['uid' => $userId, 'password' => $password]);
$this->twoFactorManager->clearTwoFactorPending($userId);
$encryptedValue = $this->crypto->encrypt($tokenValue, $email . $this->config->getSystemValue('secret'));
$this->config->setUserValue($user->getUID(), 'core', 'lostpassword', $encryptedValue);
- $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', array('userId' => $user->getUID(), 'token' => $token));
+ $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $user->getUID(), 'token' => $token]);
$emailTemplate = $this->mailer->createEMailTemplate('core.ResetPassword', [
'link' => $link,
public function getCapabilities() {
$result = [];
list($major, $minor, $micro) = \OCP\Util::getVersion();
- $result['version'] = array(
+ $result['version'] = [
'major' => $major,
'minor' => $minor,
'micro' => $micro,
'string' => \OC_Util::getVersionString(),
'edition' => '',
'extendedSupport' => \OCP\Util::hasExtendedSupport()
- );
+ ];
if($this->userSession->isLoggedIn()) {
$result['capabilities'] = $this->capabilitiesManager->getCapabilities();
if(isset($post['install']) AND $post['install']=='true') {
// We have to launch the installation process :
$e = $this->setupHelper->install($post);
- $errors = array('errors' => $e);
+ $errors = ['errors' => $e];
if(count($e) > 0) {
$options = array_merge($opts, $post, $errors);
}
public function display($post) {
- $defaults = array(
+ $defaults = [
'adminlogin' => '',
'adminpass' => '',
'dbuser' => '',
'dbtablespace' => '',
'dbhost' => 'localhost',
'dbtype' => '',
- );
+ ];
$parameters = array_merge($defaults, $post);
\OC_Util::addScript('setup');
public function loadAutoConfig($post) {
if( file_exists($this->autoConfigFile)) {
\OCP\Util::writeLog('core', 'Autoconfig file found, setting up Nextcloud…', ILogger::INFO);
- $AUTOCONFIG = array();
+ $AUTOCONFIG = [];
include $this->autoConfigFile;
$post = array_merge ($post, $AUTOCONFIG);
}
* @return JSONResponse
*/
public function getDisplayNames($users) {
- $result = array();
+ $result = [];
foreach ($users as $user) {
$userObject = $this->userManager->get($user);
}
}
- $json = array(
+ $json = [
'users' => $result,
'status' => 'success'
- );
+ ];
return new JSONResponse($json);
$eventSource->send('success', (string)$l->t('Checked database schema update for apps'));
});
$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) {
- $eventSource->send('success', (string)$l->t('Updated "%1$s" to %2$s', array($app, $version)));
+ $eventSource->send('success', (string)$l->t('Updated "%1$s" to %2$s', [$app, $version]));
});
$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) {
$incompatibleApps[]= $app;
<h2><?php p($l->t('File not found')); ?></h2>
<p class="infogroup"><?php p($l->t('The document could not be found on the server. Maybe the share was deleted or has expired?')); ?></p>
<p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>">
- <?php p($l->t('Back to %s', array($theme->getName()))); ?>
+ <?php p($l->t('Back to %s', [$theme->getName()])); ?>
</a></p>
</div>
<?php endif; ?>
<?php foreach($_['databases'] as $type => $label): ?>
<?php if(count($_['databases']) === 1): ?>
<p class="info">
- <?php p($l->t( 'Only %s is available.', array($label) )); ?>
+ <?php p($l->t( 'Only %s is available.', [$label] )); ?>
<?php p($l->t( 'Install and activate additional PHP modules to choose other database types.' )); ?><br>
<a href="<?php print_unescaped(link_to_docs('admin-source_install')); ?>" target="_blank" rel="noreferrer noopener">
<?php p($l->t( 'For more details check out the documentation.' )); ?> ↗</a>
<h2 class="title"><?php p($l->t('App update required')); ?></h2>
<?php } else { ?>
<h2 class="title"><?php p($l->t('%1$s will be updated to version %2$s',
- array($_['productName'], $_['version']))); ?></h2>
+ [$_['productName'], $_['version']])); ?></h2>
<?php } ?>
<?php if (!empty($_['appsToUpgrade'])) { ?>
<div class="infogroup">
<?php } ?>
<?php if (!empty($_['oldTheme'])) { ?>
<div class="infogroup">
- <?php p($l->t('The theme %s has been disabled.', array($_['oldTheme']))) ?>
+ <?php p($l->t('The theme %s has been disabled.', [$_['oldTheme']])) ?>
</div>
<?php } ?>
<div class="infogroup bold">
<div class="body-login-container">
<div class="icon-big icon-error-white"></div>
- <h2><?php p($l->t('Maintenance mode', array($theme->getName()))) ?></h2>
- <p><?php p($l->t('This %s instance is currently in maintenance mode, which may take a while.', array($theme->getName()))) ?> <?php p($l->t('This page will refresh itself when the instance is available again.')) ?></p>
+ <h2><?php p($l->t('Maintenance mode', [$theme->getName()])) ?></h2>
+ <p><?php p($l->t('This %s instance is currently in maintenance mode, which may take a while.', [$theme->getName()])) ?> <?php p($l->t('This page will refresh itself when the instance is available again.')) ?></p>
<p><?php p($l->t('Contact your system administrator if this message persists or appeared unexpectedly.')) ?></p>
</div>
if (OC::$CLI) {
echo 'Background Jobs are disabled!' . PHP_EOL;
} else {
- OC_JSON::error(array('data' => array('message' => 'Background jobs disabled!')));
+ OC_JSON::error(['data' => ['message' => 'Background jobs disabled!']]);
}
exit(1);
}
// We call cron.php from some website
if ($appMode === 'cron') {
// Cron is cron :-P
- OC_JSON::error(array('data' => array('message' => 'Backgroundjobs are using system cron!')));
+ OC_JSON::error(['data' => ['message' => 'Backgroundjobs are using system cron!']]);
} else {
// Work and success :-)
$jobList = \OC::$server->getJobList();
OC::handleRequest();
} catch(\OC\ServiceUnavailableException $ex) {
- \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
+ \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
//show the user a detailed error page
OC_Template::printExceptionErrorPage($ex, 503);
OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
} catch (Exception $ex2) {
try {
- \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
- \OC::$server->getLogger()->logException($ex2, array('app' => 'index'));
+ \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
+ \OC::$server->getLogger()->logException($ex2, ['app' => 'index']);
} catch (Throwable $e) {
// no way to log it properly - but to avoid a white page of death we try harder and ignore this one here
}
} catch (\OC\User\LoginException $ex) {
OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403);
} catch (Exception $ex) {
- \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
+ \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
//show the user a detailed error page
OC_Template::printExceptionErrorPage($ex, 500);
} catch (Error $ex) {
try {
- \OC::$server->getLogger()->logException($ex, array('app' => 'index'));
+ \OC::$server->getLogger()->logException($ex, ['app' => 'index']);
} catch (Error $e) {
http_response_code(500);
header('Content-Type: text/plain; charset=utf-8');
if (!is_array($pathsToRequire)) {
// No cache or cache miss
- $pathsToRequire = array();
+ $pathsToRequire = [];
foreach ($this->findClass($class) as $path) {
$fullPath = stream_resolve_include_path($path);
if ($fullPath && $this->isValidPath($fullPath)) {
/**
* Associative array for autoloading. classname => filename
*/
- public static $CLASSPATH = array();
+ public static $CLASSPATH = [];
/**
* The installation path for Nextcloud on the server (e.g. /srv/http/nextcloud)
*/
* The installation path array of the apps folder on the server (e.g. /srv/http/nextcloud) 'path' and
* web path in 'url'
*/
- public static $APPSROOTS = array();
+ public static $APPSROOTS = [];
/**
* @var string
}
// search the apps folder
- $config_paths = self::$config->getValue('apps_paths', array());
+ $config_paths = self::$config->getValue('apps_paths', []);
if (!empty($config_paths)) {
foreach ($config_paths as $paths) {
if (isset($paths['url']) && isset($paths['path'])) {
}
}
} elseif (file_exists(OC::$SERVERROOT . '/apps')) {
- OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true);
+ OC::$APPSROOTS[] = ['path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true];
} elseif (file_exists(OC::$SERVERROOT . '/../apps')) {
- OC::$APPSROOTS[] = array(
+ OC::$APPSROOTS[] = [
'path' => rtrim(dirname(OC::$SERVERROOT), '/') . '/apps',
'url' => '/apps',
'writable' => true
- );
+ ];
}
if (empty(OC::$APPSROOTS)) {
throw new \RuntimeException('apps directory not found! Please put the Nextcloud apps folder in the Nextcloud folder'
. ' or the folder above. You can also configure the location in the config.php file.');
}
- $paths = array();
+ $paths = [];
foreach (OC::$APPSROOTS as $path) {
$paths[] = $path['path'];
if (!is_dir($path['path'])) {
// Allow session apps to create a custom session object
$useCustomSession = false;
$session = self::$server->getSession();
- OC_Hook::emit('OC', 'initSession', array('session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession));
+ OC_Hook::emit('OC', 'initSession', ['session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession]);
if (!$useCustomSession) {
// set the session name to the instance id - which is unique
$session = new \OC\Session\Internal($sessionName);
if (defined('PHPUNIT_RUN')) {
self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
}
- spl_autoload_register(array(self::$loader, 'load'));
+ spl_autoload_register([self::$loader, 'load']);
$loaderEnd = microtime(true);
self::$CLI = (php_sapi_name() == 'cli');
}
\OC::$server->getEventLogger()->start('init_session', 'Initialize session');
- OC_App::loadApps(array('session'));
+ OC_App::loadApps(['session']);
if (!self::$CLI) {
self::initSession();
}
http_response_code(503);
OC_Util::addStyle('guest');
try {
- OC_Template::printGuestPage('', 'error', array('errors' => $errors));
+ OC_Template::printGuestPage('', 'error', ['errors' => $errors]);
exit;
} catch (\Exception $e) {
// In case any error happens when showing the error page, we simply fall back to posting the text.
//make sure temporary files are cleaned up
$tmpManager = \OC::$server->getTempManager();
- register_shutdown_function(array($tmpManager, 'clean'));
+ register_shutdown_function([$tmpManager, 'clean']);
$lockProvider = \OC::$server->getLockingProvider();
- register_shutdown_function(array($lockProvider, 'releaseAll'));
+ register_shutdown_function([$lockProvider, 'releaseAll']);
// Check whether the sample configuration has been copied
if($systemConfig->getValue('copied_sample_config', false)) {
OC_App::loadApps();
} else {
// For guests: Load only filesystem and logging
- OC_App::loadApps(array('filesystem', 'logging'));
+ OC_App::loadApps(['filesystem', 'logging']);
self::handleLogin($request);
}
}
if (!self::$CLI) {
try {
if (!((bool) $systemConfig->getValue('maintenance', false)) && !\OCP\Util::needUpgrade()) {
- OC_App::loadApps(array('filesystem', 'logging'));
+ OC_App::loadApps(['filesystem', 'logging']);
OC_App::loadApps();
}
OC_Util::setupFS();
}
// Extract PHP_AUTH_USER/PHP_AUTH_PW from other headers if necessary.
- $vars = array(
+ $vars = [
'HTTP_AUTHORIZATION', // apache+php-cgi work around
'REDIRECT_HTTP_AUTHORIZATION', // apache+php-cgi alternative
- );
+ ];
foreach ($vars as $var) {
if (isset($_SERVER[$var]) && preg_match('/Basic\s+(.*)$/i', $_SERVER[$var], $matches)) {
$credentials = explode(':', base64_decode($matches[1]), 2);
}
/** @var \Closure[] */
- private $consumersClosures = array();
+ private $consumersClosures = [];
/** @var IConsumer[] */
- private $consumers = array();
+ private $consumers = [];
/**
* @return \OCP\Activity\IConsumer[]
// only add to the cache if we already loaded data for the user
if (isset($this->userCache[$userId])) {
if (!isset($this->userCache[$userId][$appName])) {
- $this->userCache[$userId][$appName] = array();
+ $this->userCache[$userId][$appName] = [];
}
$this->userCache[$userId][$appName][$key] = (string)$value;
}
if (isset($data[$appName])) {
return array_keys($data[$appName]);
} else {
- return array();
+ return [];
}
}
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?';
- $this->connection->executeUpdate($sql, array($userId, $appName, $key));
+ $this->connection->executeUpdate($sql, [$userId, $appName, $key]);
if (isset($this->userCache[$userId]) and isset($this->userCache[$userId][$appName])) {
unset($this->userCache[$userId][$appName][$key]);
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `userid` = ?';
- $this->connection->executeUpdate($sql, array($userId));
+ $this->connection->executeUpdate($sql, [$userId]);
unset($this->userCache[$userId]);
}
$sql = 'DELETE FROM `*PREFIX*preferences` '.
'WHERE `appid` = ?';
- $this->connection->executeUpdate($sql, array($appName));
+ $this->connection->executeUpdate($sql, [$appName]);
foreach ($this->userCache as &$userCache) {
unset($userCache[$appName]);
return $this->userCache[$userId];
}
if ($userId === null || $userId === '') {
- $this->userCache[$userId]=array();
+ $this->userCache[$userId]=[];
return $this->userCache[$userId];
}
// TODO - FIXME
$this->fixDIInit();
- $data = array();
+ $data = [];
$query = 'SELECT `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?';
- $result = $this->connection->executeQuery($query, array($userId));
+ $result = $this->connection->executeQuery($query, [$userId]);
while ($row = $result->fetch()) {
$appId = $row['appid'];
if (!isset($data[$appId])) {
- $data[$appId] = array();
+ $data[$appId] = [];
}
$data[$appId][$row['configkey']] = $row['configvalue'];
}
$this->fixDIInit();
if (empty($userIds) || !is_array($userIds)) {
- return array();
+ return [];
}
$chunkedUsers = array_chunk($userIds, 50, true);
$placeholders50 = implode(',', array_fill(0, 50, '?'));
- $userValues = array();
+ $userValues = [];
foreach ($chunkedUsers as $chunk) {
$queryParams = $chunk;
// create [$app, $key, $chunkedUsers]
$sql .= 'AND `configvalue` = ?';
}
- $result = $this->connection->executeQuery($sql, array($appName, $key, $value));
+ $result = $this->connection->executeQuery($sql, [$appName, $key, $value]);
- $userIDs = array();
+ $userIDs = [];
while ($row = $result->fetch()) {
$userIDs[] = $row['userid'];
}
$sql .= 'AND LOWER(`configvalue`) = LOWER(?)';
}
- $result = $this->connection->executeQuery($sql, array($appName, $key, $value));
+ $result = $this->connection->executeQuery($sql, [$appName, $key, $value]);
- $userIDs = array();
+ $userIDs = [];
while ($row = $result->fetch()) {
$userIDs[] = $row['userid'];
}
*/
public function getIncompatibleApps(string $version): array {
$apps = $this->getInstalledApps();
- $incompatibleApps = array();
+ $incompatibleApps = [];
foreach ($apps as $appId) {
$info = $this->getAppInfo($appId);
if ($info === null) {
return $missing;
}
if (!is_array($supportedDatabases)) {
- $supportedDatabases = array($supportedDatabases);
+ $supportedDatabases = [$supportedDatabases];
}
$supportedDatabases = array_map(function ($db) {
return $this->getValue($db);
$commands = $dependencies['command'];
if (!is_array($commands)) {
- $commands = array($commands);
+ $commands = [$commands];
}
if (isset($commands['@value'])) {
$commands = [$commands];
$libs = $dependencies['lib'];
if (!is_array($libs)) {
- $libs = array($libs);
+ $libs = [$libs];
}
if (isset($libs['@value'])) {
$libs = [$libs];
return $this->getValue($os);
}, $oss);
} else {
- $oss = array($oss);
+ $oss = [$oss];
}
$currentOS = $this->platform->getOS();
if (!in_array($currentOS, $oss)) {
protected function initialize() {
$loadedExtensions = get_loaded_extensions();
- $packages = array();
+ $packages = [];
// Extensions scanning
foreach ($loadedExtensions as $name) {
- if (in_array($name, array('standard', 'Core'))) {
+ if (in_array($name, ['standard', 'Core'])) {
continue;
}
* @param array $urlParams
* @param ServerContainer|null $server
*/
- public function __construct($appName, $urlParams = array(), ServerContainer $server = null){
+ public function __construct($appName, $urlParams = [], ServerContainer $server = null){
parent::__construct();
$this['AppName'] = $appName;
$this['urlParams'] = $urlParams;
$this->server = $server;
$this->protocolVersion = $protocolVersion;
- $this->headers = array(
+ $this->headers = [
self::STATUS_CONTINUE => 'Continue',
self::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols',
self::STATUS_PROCESSING => 'Processing',
self::STATUS_BANDWIDTH_LIMIT_EXCEEDED => 'Bandwidth Limit Exceeded', // non-standard
self::STATUS_NOT_EXTENDED => 'Not extended',
self::STATUS_NETWORK_AUTHENTICATION_REQUIRED => 'Network Authentication Required', // draft-nottingham-http-new-status
- );
+ ];
}
* @param string $source
*/
public function __construct($source) {
- $types = array(null, 'gz', 'bz2');
+ $types = [null, 'gz', 'bz2'];
$this->path = $source;
$this->tar = new \Archive_Tar($source, $types[self::getTarType($source)]);
}
mkdir($folder);
}
}
- $result = $this->tar->addModify(array($tmpBase . $path), '', $tmpBase);
+ $result = $this->tar->addModify([$tmpBase . $path], '', $tmpBase);
rmdir($tmpBase . $path);
$this->fileList = false;
$this->cachedHeaders = false;
rename($tmp . $source, $tmp . $dest);
$this->tar = null;
unlink($this->path);
- $types = array(null, 'gz', 'bz');
+ $types = [null, 'gz', 'bz'];
$this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]);
- $this->tar->createModify(array($tmp), '', $tmp . '/');
+ $this->tar->createModify([$tmp], '', $tmp . '/');
$this->fileList = false;
$this->cachedHeaders = false;
return true;
*/
public function getFolder($path) {
$files = $this->getFiles();
- $folderContent = array();
+ $folderContent = [];
$pathLength = strlen($path);
foreach ($files as $file) {
if ($file[0] == '/') {
if (!$this->cachedHeaders) {
$this->cachedHeaders = $this->tar->listContent();
}
- $files = array();
+ $files = [];
foreach ($this->cachedHeaders as $header) {
$files[] = $header['filename'];
}
return false;
}
if ($this->fileExists('/' . $path)) {
- $success = $this->tar->extractList(array('/' . $path), $tmp);
+ $success = $this->tar->extractList(['/' . $path], $tmp);
} else {
- $success = $this->tar->extractList(array($path), $tmp);
+ $success = $this->tar->extractList([$path], $tmp);
}
if ($success) {
rename($tmp . $path, $dest);
$this->tar = null;
unlink($this->path);
$this->reopen();
- $this->tar->createModify(array($tmp), '', $tmp);
+ $this->tar->createModify([$tmp], '', $tmp);
return true;
}
$this->tar->_close();
$this->tar = null;
}
- $types = array(null, 'gz', 'bz');
+ $types = [null, 'gz', 'bz'];
$this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]);
}
}
*/
public function getFolder($path) {
$files=$this->getFiles();
- $folderContent=array();
+ $folderContent=[];
$pathLength=strlen($path);
foreach($files as $file) {
if(substr($file, 0, $pathLength)==$path and $file!=$path) {
*/
public function getFiles() {
$fileCount=$this->zip->numFiles;
- $files=array();
+ $files=[];
for($i=0;$i<$fileCount;$i++) {
$files[]=$this->zip->getNameIndex($i);
}
$x = intval(($xi - $xr) / 2);
$y = intval(($yi + $yr) / 2);
- return array($x, $y);
+ return [$x, $y];
}
/**
* @return array [r,g,b] steps for each color to go from $steps to $ends
*/
private function stepCalc($steps, $ends) {
- $step = array();
+ $step = [];
$step[0] = ($ends[1]->r - $ends[0]->r) / $steps;
$step[1] = ($ends[1]->g - $ends[0]->g) / $steps;
$step[2] = ($ends[1]->b - $ends[0]->b) / $steps;
* @return int[] between 0 and $maximum
*/
private function mixPalette($steps, $color1, $color2) {
- $palette = array($color1);
+ $palette = [$color1];
$step = $this->stepCalc($steps, [$color1, $color2]);
for ($i = 1; $i < $steps; $i++) {
$r = intval($color1->r + ($step[0] * $i));
*/
private function hashToInt($hash, $maximum) {
$final = 0;
- $result = array();
+ $result = [];
// Splitting evenly the string
for ($i = 0; $i < strlen($hash); $i++) {
$class = $argument['klass'];
$method = $argument['method'];
$parameters = $argument['parameters'];
- if (is_callable(array($class, $method))) {
- call_user_func(array($class, $method), $parameters);
+ if (is_callable([$class, $method])) {
+ call_user_func([$class, $method], $parameters);
}
}
}
}
} catch (\OCP\Lock\LockedException $e) {
// ignore locked chunks
- \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
+ \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', ['app' => 'core']);
} catch (\OCP\Files\ForbiddenException $e) {
- \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', array('app' => 'core'));
+ \OC::$server->getLogger()->debug('Could not cleanup forbidden chunk "' . $file . '"', ['app' => 'core']);
} catch (\OCP\Files\LockNotAcquiredException $e) {
- \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', array('app' => 'core'));
+ \OC::$server->getLogger()->debug('Could not cleanup locked chunk "' . $file . '"', ['app' => 'core']);
}
}
}
class CapabilitiesManager {
/** @var \Closure[] */
- private $capabilities = array();
+ private $capabilities = [];
/** @var ILogger */
private $logger;
const ENV_PREFIX = 'NC_';
/** @var array Associative array ($key => $value) */
- protected $cache = array();
+ protected $cache = [];
/** @var string */
protected $configDir;
/** @var string */
*/
private function readData() {
// Default config should always get loaded
- $configFiles = array($this->configFilePath);
+ $configFiles = [$this->configFilePath];
// Add all files in the config dir ending with the same file name
$extra = glob($this->configDir.'*.'.$this->configFileName);
* - 'escape_like_param' - If set to false wildcards _ and % are not escaped
* @return array an array of contacts which are arrays of key-value-pairs
*/
- public function search($pattern, $searchProperties = array(), $options = array()) {
+ public function search($pattern, $searchProperties = [], $options = []) {
$this->loadAddressBooks();
- $result = array();
+ $result = [];
foreach($this->addressBooks as $addressBook) {
$r = $addressBook->search($pattern, $searchProperties, $options);
- $contacts = array();
+ $contacts = [];
foreach($r as $c){
$c['addressbook-key'] = $addressBook->getKey();
$contacts[] = $c;
*/
public function getAddressBooks() {
$this->loadAddressBooks();
- $result = array();
+ $result = [];
foreach($this->addressBooks as $addressBook) {
$result[$addressBook->getKey()] = $addressBook->getDisplayName();
}
* removes all registered address book instances
*/
public function clear() {
- $this->addressBooks = array();
- $this->addressBookLoaders = array();
+ $this->addressBooks = [];
+ $this->addressBookLoaders = [];
}
/**
* @var \OCP\IAddressBook[] which holds all registered address books
*/
- private $addressBooks = array();
+ private $addressBooks = [];
/**
* @var \Closure[] to call to load/register address books
*/
- private $addressBookLoaders = array();
+ private $addressBookLoaders = [];
/**
* In order to improve lazy loading a closure can be registered which will be called in case
foreach($this->addressBookLoaders as $callable) {
$callable($this);
}
- $this->addressBookLoaders = array();
+ $this->addressBookLoaders = [];
}
}
}
*
* @throws \Doctrine\DBAL\DBALException
*/
- public function executeQuery($query, array $params = array(), $types = array(), QueryCacheProfile $qcp = null)
+ public function executeQuery($query, array $params = [], $types = [], QueryCacheProfile $qcp = null)
{
$query = $this->replaceTablePrefix($query);
$query = $this->adapter->fixupStatement($query);
*
* @throws \Doctrine\DBAL\DBALException
*/
- public function executeUpdate($query, array $params = array(), array $types = array())
+ public function executeUpdate($query, array $params = [], array $types = [])
{
$query = $this->replaceTablePrefix($query);
$query = $this->adapter->fixupStatement($query);
public function dropTable($table) {
$table = $this->tablePrefix . trim($table);
$schema = $this->getSchemaManager();
- if($schema->tablesExist(array($table))) {
+ if($schema->tablesExist([$table])) {
$schema->dropTable($table);
}
}
public function tableExists($table){
$table = $this->tablePrefix . trim($table);
$schema = $this->getSchemaManager();
- return $schema->tablesExist(array($table));
+ return $schema->tablesExist([$table]);
}
// internal use
// \PDO::MYSQL_ATTR_FOUND_ROWS may not be defined, e.g. when the MySQL
// driver is missing. In this case, we won't be able to connect anyway.
if ($normalizedType === 'mysql' && defined('\PDO::MYSQL_ATTR_FOUND_ROWS')) {
- $result['driverOptions'] = array(
+ $result['driverOptions'] = [
\PDO::MYSQL_ATTR_FOUND_ROWS => true,
- );
+ ];
}
return $result;
}
* @throws \DomainException
*/
private function loadField($table, $xml) {
- $options = array( 'notnull' => false );
+ $options = [ 'notnull' => false ];
foreach ($xml->children() as $child) {
/**
* @var \SimpleXMLElement $child
$table->addColumn($name, $type, $options);
if (!empty($options['primary']) && $options['primary']) {
- $table->setPrimaryKey(array($name));
+ $table->setPrimaryKey([$name]);
}
}
}
*/
private function loadIndex($table, $xml) {
$name = null;
- $fields = array();
+ $fields = [];
foreach ($xml->children() as $child) {
/**
* @var \SimpleXMLElement $child
$tmpTable = $this->renameTableSchema($table, $tmpName);
$schemaConfig = new SchemaConfig();
$schemaConfig->setName($this->connection->getDatabase());
- $schema = new Schema(array($tmpTable), array(), $schemaConfig);
+ $schema = new Schema([$tmpTable], [], $schemaConfig);
try {
$this->applySchema($schema);
* @var \Doctrine\DBAL\Schema\Index[] $indexes
*/
$indexes = $table->getIndexes();
- $newIndexes = array();
+ $newIndexes = [];
foreach ($indexes as $index) {
if ($index->isPrimary()) {
// do not rename primary key
}
// foreign keys are not supported so we just set it to an empty array
- return new Table($newName, $table->getColumns(), $newIndexes, array(), 0, $table->getOptions());
+ return new Table($newName, $table->getColumns(), $newIndexes, [], 0, $table->getOptions());
}
public function createSchema() {
/**
* {@inheritDoc}
*/
- public function insert($tableName, array $data, array $types = array()) {
+ public function insert($tableName, array $data, array $types = []) {
if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$tableName = $this->quoteIdentifier($tableName);
}
/**
* {@inheritDoc}
*/
- public function update($tableName, array $data, array $identifier, array $types = array()) {
+ public function update($tableName, array $data, array $identifier, array $types = []) {
if ($tableName[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$tableName = $this->quoteIdentifier($tableName);
}
/**
* {@inheritDoc}
*/
- public function delete($tableExpression, array $identifier, array $types = array()) {
+ public function delete($tableExpression, array $identifier, array $types = []) {
if ($tableExpression[0] !== $this->getDatabasePlatform()->getIdentifierQuoteCharacter()) {
$tableExpression = $this->quoteIdentifier($tableExpression);
}
$table = $this->tablePrefix . trim($table);
$table = $this->quoteIdentifier($table);
$schema = $this->getSchemaManager();
- if($schema->tablesExist(array($table))) {
+ if($schema->tablesExist([$table])) {
$schema->dropTable($table);
}
}
$table = $this->tablePrefix . trim($table);
$table = $this->quoteIdentifier($table);
$schema = $this->getSchemaManager();
- return $schema->tablesExist(array($table));
+ return $schema->tablesExist([$table]);
}
}
$sqlInfo = 'SELECT table_schema, table_name, column_name
FROM information_schema.columns
WHERE column_default = ? AND table_catalog = ?';
- $sequenceInfo = $conn->fetchAssoc($sqlInfo, array(
+ $sequenceInfo = $conn->fetchAssoc($sqlInfo, [
"nextval('$sequenceName'::regclass)",
$databaseName
- ));
+ ]);
$tableName = $sequenceInfo['table_name'];
$columnName = $sequenceInfo['column_name'];
$sqlMaxId = "SELECT MAX($columnName) FROM $tableName";
*
* @return \OCP\DB\QueryBuilder\ICompositeExpression
*/
- public function addMultiple(array $parts = array()) {
+ public function addMultiple(array $parts = []) {
$this->compositeExpression->addMultiple($parts);
return $this;
*
* @return $this This QueryBuilder instance.
*/
- public function setParameters(array $params, array $types = array()) {
+ public function setParameters(array $params, array $types = []) {
$this->queryBuilder->setParameters($params, $types);
return $this;
$tmpFile = $this->buildTempDatabase();
copy($dbFile, $tmpFile);
- $connectionParams = array(
+ $connectionParams = [
'path' => $tmpFile,
'driver' => 'pdo_sqlite',
- );
+ ];
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
try {
$this->applySchema($targetSchema, $conn);
}
public function getSubscribedEvents() {
- return array(Events::postConnect);
+ return [Events::postConnect];
}
}
$timeZone = $this->getTimeZone($timeZone);
$timestamp = $this->getDateTime($timestamp, $timeZone);
- return $l->l($type, $timestamp, array(
+ return $l->l($type, $timestamp, [
'width' => $format,
- ));
+ ]);
}
}
protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
$this->setupUserFS($uid);
- $directories = array();
+ $directories = [];
$directories[] = '/' . $uid . '/files';
while ($root = array_pop($directories)) {
list($owner, $ownerPath) = $this->util->getUidAndFilename($path);
// always add owner to the list of users with access to the file
- $userIds = array($owner);
+ $userIds = [$owner];
if (!$this->util->isFile($owner . '/' . $ownerPath)) {
- return array('users' => $userIds, 'public' => false);
+ return ['users' => $userIds, 'public' => false];
}
$ownerPath = substr($ownerPath, strlen('/files'));
// Remove duplicate UIDs
$uniqueUserIds = array_unique($userIds);
- return array('users' => $uniqueUserIds, 'public' => $public);
+ return ['users' => $uniqueUserIds, 'public' => $public];
}
}
* @param ArrayCache $arrayCache
*/
public function __construct(IConfig $config, ILogger $logger, IL10N $l10n, View $rootView, Util $util, ArrayCache $arrayCache) {
- $this->encryptionModules = array();
+ $this->encryptionModules = [];
$this->config = $config;
$this->logger = $logger;
$this->l = $l10n;
// If encryption is disabled and there are no loaded modules it makes no sense to load the wrapper
if (!empty($this->encryptionModules) || $this->isEnabled()) {
$encryptionWrapper = new EncryptionWrapper($this->arrayCache, $this, $this->logger);
- Filesystem::addStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'), 2);
+ Filesystem::addStorageWrapper('oc_encryption', [$encryptionWrapper, 'wrapStorage'], 2);
}
}
throw new \InvalidArgumentException('No file found for ' . $info->getId());
}
- return array($owner, $path);
+ return [$owner, $path];
}
/**
if ($this->view->is_dir($path)) {
$allFiles = $this->util->getAllFiles($path);
} else {
- $allFiles = array($path);
+ $allFiles = [$path];
}
* @return array with list of files relative to the users files folder
*/
public function getAllFiles($dir) {
- $result = array();
- $dirList = array($dir);
+ $result = [];
+ $dirList = [$dir];
while ($dirList) {
$dir = array_pop($dirList);
$ownerPath = implode('/', array_slice($parts, 2));
- return array($uid, Filesystem::normalizePath($ownerPath));
+ return [$uid, Filesystem::normalizePath($ownerPath)];
}
* @return boolean
*/
private function isMountPointApplicableToUser($mount, $uid) {
- $acceptedUids = array('all', $uid);
+ $acceptedUids = ['all', $uid];
// check if mount point is applicable for the user
$intersection = array_intersect($acceptedUids, $mount['applicable']['users']);
if (!empty($intersection)) {
$sql = 'SELECT SUM(`size`) AS f1 ' .
'FROM `*PREFIX*filecache` ' .
'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0';
- $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
+ $result = \OC_DB::executeAudited($sql, [$id, $this->getNumericStorageId()]);
if ($row = $result->fetchRow()) {
$result->closeCursor();
list($sum) = array_values($row);
$totalSize = 0 + $sum;
$entry['size'] += 0;
if ($entry['size'] !== $totalSize) {
- $this->update($id, array('size' => $totalSize));
+ $this->update($id, ['size' => $totalSize]);
}
}
}
// pre-emit only if it was a file. By that we avoid counting/treating folders as files
if ($data['mimetype'] !== 'httpd/unix-directory') {
- $this->emit('\OC\Files\Cache\Scanner', 'scanFile', array($file, $this->storageId));
- \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', array('path' => $file, 'storage' => $this->storageId));
+ $this->emit('\OC\Files\Cache\Scanner', 'scanFile', [$file, $this->storageId]);
+ \OC_Hook::emit('\OC\Files\Cache\Scanner', 'scan_file', ['path' => $file, 'storage' => $this->storageId]);
}
$parent = dirname($file);
// post-emit only if it was a file. By that we avoid counting/treating folders as files
if ($data['mimetype'] !== 'httpd/unix-directory') {
- $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId));
- \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', array('path' => $file, 'storage' => $this->storageId));
+ $this->emit('\OC\Files\Cache\Scanner', 'postScanFile', [$file, $this->storageId]);
+ \OC_Hook::emit('\OC\Files\Cache\Scanner', 'post_scan_file', ['path' => $file, 'storage' => $this->storageId]);
}
} else {
}
protected function removeFromCache($path) {
- \OC_Hook::emit('Scanner', 'removeFromCache', array('file' => $path));
- $this->emit('\OC\Files\Cache\Scanner', 'removeFromCache', array($path));
+ \OC_Hook::emit('Scanner', 'removeFromCache', ['file' => $path]);
+ $this->emit('\OC\Files\Cache\Scanner', 'removeFromCache', [$path]);
if ($this->cacheActive) {
$this->cache->remove($path);
}
if (isset($data['scan_permissions'])) {
$data['permissions'] = $data['scan_permissions'];
}
- \OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
- $this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
+ \OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]);
+ $this->emit('\OC\Files\Cache\Scanner', 'addToCache', [$path, $this->storageId, $data]);
if ($this->cacheActive) {
if ($fileId !== -1) {
$this->cache->update($fileId, $data);
* @param int $fileId
*/
protected function updateCache($path, $data, $fileId = -1) {
- \OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
- $this->emit('\OC\Files\Cache\Scanner', 'updateCache', array($path, $this->storageId, $data));
+ \OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]);
+ $this->emit('\OC\Files\Cache\Scanner', 'updateCache', [$path, $this->storageId, $data]);
if ($this->cacheActive) {
if ($fileId !== -1) {
$this->cache->update($fileId, $data);
* @return array[]
*/
protected function getExistingChildren($folderId) {
- $existingChildren = array();
+ $existingChildren = [];
$children = $this->cache->getFolderContentsById($folderId);
foreach ($children as $child) {
$existingChildren[$child['name']] = $child;
* @return string[]
*/
protected function getNewChildren($folder) {
- $children = array();
+ $children = [];
if ($dh = $this->storage->opendir($folder)) {
if (is_resource($dh)) {
while (($file = readdir($dh)) !== false) {
if ($reuse === -1) {
$reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
}
- $this->emit('\OC\Files\Cache\Scanner', 'scanFolder', array($path, $this->storageId));
+ $this->emit('\OC\Files\Cache\Scanner', 'scanFolder', [$path, $this->storageId]);
$size = 0;
if (!is_null($folderId)) {
$folderId = $this->cache->getId($path);
}
}
if ($this->cacheActive) {
- $this->cache->update($folderId, array('size' => $size));
+ $this->cache->update($folderId, ['size' => $size]);
}
- $this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', array($path, $this->storageId));
+ $this->emit('\OC\Files\Cache\Scanner', 'postScanFolder', [$path, $this->storageId]);
return $size;
}
private function runBackgroundScanJob(callable $callback, $path) {
try {
$callback();
- \OC_Hook::emit('Scanner', 'correctFolderSize', array('path' => $path));
+ \OC_Hook::emit('Scanner', 'correctFolderSize', ['path' => $path]);
if ($this->cacheActive && $this->cache instanceof Cache) {
$this->cache->correctFolderSize($path, null, true);
}
public static function getStorageId($numericId) {
$sql = 'SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?';
- $result = \OC_DB::executeAudited($sql, array($numericId));
+ $result = \OC_DB::executeAudited($sql, [$numericId]);
if ($row = $result->fetchRow()) {
return $row['id'];
} else {
$storageId = self::adjustStorageId($storageId);
$numericId = self::getNumericStorageId($storageId);
$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
- \OC_DB::executeAudited($sql, array($storageId));
+ \OC_DB::executeAudited($sql, [$storageId]);
if (!is_null($numericId)) {
$sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?';
- \OC_DB::executeAudited($sql, array($numericId));
+ \OC_DB::executeAudited($sql, [$numericId]);
}
}
}
if ($parentId != -1) {
$mtime = $this->storage->filemtime($parent);
if ($mtime !== false) {
- $this->cache->update($parentId, array('storage_mtime' => $mtime));
+ $this->cache->update($parentId, ['storage_mtime' => $mtime]);
}
}
}
protected $watchPolicy = self::CHECK_ONCE;
- protected $checkedPaths = array();
+ protected $checkedPaths = [];
/**
* @var \OC\Files\Storage\Storage $storage
}
private function formatSearchResults($results) {
- $results = array_filter($results, array($this, 'filterCacheEntry'));
+ $results = array_filter($results, [$this, 'filterCacheEntry']);
$results = array_values($results);
- return array_map(array($this, 'formatCacheEntry'), $results);
+ return array_map([$this, 'formatCacheEntry'], $results);
}
/**
*/
public function getAll() {
// not supported
- return array();
+ return [];
}
/**
*/
public function getFolderContentsById($fileId) {
$results = $this->getCache()->getFolderContentsById($fileId);
- return array_map(array($this, 'formatCacheEntry'), $results);
+ return array_map([$this, 'formatCacheEntry'], $results);
}
/**
*/
public function search($pattern) {
$results = $this->getCache()->search($pattern);
- return array_map(array($this, 'formatCacheEntry'), $results);
+ return array_map([$this, 'formatCacheEntry'], $results);
}
/**
*/
public function searchByMime($mimetype) {
$results = $this->getCache()->searchByMime($mimetype);
- return array_map(array($this, 'formatCacheEntry'), $results);
+ return array_map([$this, 'formatCacheEntry'], $results);
}
public function searchQuery(ISearchQuery $query) {
$results = $this->getCache()->searchQuery($query);
- return array_map(array($this, 'formatCacheEntry'), $results);
+ return array_map([$this, 'formatCacheEntry'], $results);
}
/**
/**
* @var \OCP\Files\Config\IMountProvider[]
*/
- private $providers = array();
+ private $providers = [];
/**
* @var \OCP\Files\Storage\IStorageFactory
});
$mounts = array_reduce($mounts, function (array $mounts, array $providerMounts) {
return array_merge($mounts, $providerMounts);
- }, array());
+ }, []);
return $this->filterMounts($user, $mounts);
}
*/
static private $defaultInstance;
- static private $usersSetup = array();
+ static private $usersSetup = [];
static private $normalizedPathCache = null;
if (!self::$mounts) {
\OC_Util::setupFS();
}
- $result = array();
+ $result = [];
$mounts = self::$mounts->findIn($path);
foreach ($mounts as $mount) {
$result[] = $mount->getMountPoint();
}
$mount = self::$mounts->find($path);
if ($mount) {
- return array($mount->getStorage(), rtrim($mount->getInternalPath($path), '/'));
+ return [$mount->getStorage(), rtrim($mount->getInternalPath($path), '/')];
} else {
- return array(null, null);
+ return [null, null];
}
}
'/' . $user . '/files'
));
}
- \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user));
+ \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', ['user' => $user]);
}
/**
$userObject = $userManager->get($user);
if ($userObject) {
$mounts = $provider->getMountsForUser($userObject, Filesystem::getLoader());
- array_walk($mounts, array(self::$mounts, 'addMount'));
+ array_walk($mounts, [self::$mounts, 'addMount']);
}
}
});
*/
public static function clearMounts() {
if (self::$mounts) {
- self::$usersSetup = array();
+ self::$usersSetup = [];
self::$mounts->clear();
}
}
static public function isFileBlacklisted($filename) {
$filename = self::normalizePath($filename);
- $blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', array('.htaccess'));
+ $blacklist = \OC::$server->getConfig()->getSystemValue('blacklisted_files', ['.htaccess']);
$filename = strtolower(basename($filename));
return in_array($filename, $blacklist);
}
*
* @var array
*/
- protected $arguments = array();
+ protected $arguments = [];
protected $mountPoint;
/**
*
* @var array
*/
- protected $mountOptions = array();
+ protected $mountOptions = [];
/**
* @var \OC\Files\Storage\StorageFactory $loader
*/
public function __construct($storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) {
if (is_null($arguments)) {
- $arguments = array();
+ $arguments = [];
}
if (is_null($loader)) {
$this->loader = new StorageFactory();
*/
public function putContent($data) {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
- $this->sendHooks(array('preWrite'));
+ $this->sendHooks(['preWrite']);
if ($this->view->file_put_contents($this->path, $data) === false) {
throw new GenericFileException('file_put_contents failed');
}
$this->fileInfo = null;
- $this->sendHooks(array('postWrite'));
+ $this->sendHooks(['postWrite']);
} else {
throw new NotPermittedException();
}
* @throws LockedException
*/
public function fopen($mode) {
- $preHooks = array();
- $postHooks = array();
+ $preHooks = [];
+ $postHooks = [];
$requiredPermissions = \OCP\Constants::PERMISSION_READ;
switch ($mode) {
case 'r+':
*/
public function delete() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
- $this->sendHooks(array('preDelete'));
+ $this->sendHooks(['preDelete']);
$fileInfo = $this->getFileInfo();
$this->view->unlink($this->path);
$nonExisting = new NonExistingFile($this->root, $this->view, $this->path, $fileInfo);
*/
public function search($query) {
if (is_string($query)) {
- return $this->searchCommon('search', array('%' . $query . '%'));
+ return $this->searchCommon('search', ['%' . $query . '%']);
} else {
- return $this->searchCommon('searchQuery', array($query));
+ return $this->searchCommon('searchQuery', [$query]);
}
}
* @return Node[]
*/
public function searchByMime($mimetype) {
- return $this->searchCommon('searchByMime', array($mimetype));
+ return $this->searchCommon('searchByMime', [$mimetype]);
}
/**
* @return Node[]
*/
public function searchByTag($tag, $userId) {
- return $this->searchCommon('searchByTag', array($tag, $userId));
+ return $this->searchCommon('searchByTag', [$tag, $userId]);
}
/**
throw new \InvalidArgumentException('searching by owner is only allows on the users home folder');
}
- $files = array();
+ $files = [];
$rootLength = strlen($this->path);
$mount = $this->root->getMount($this->path);
$storage = $mount->getStorage();
$cache = $storage->getCache('');
- $results = call_user_func_array(array($cache, $method), $args);
+ $results = call_user_func_array([$cache, $method], $args);
foreach ($results as $result) {
if ($internalRootLength === 0 or substr($result['path'], 0, $internalRootLength) === $internalPath) {
$result['internalPath'] = $result['path'];
public function delete() {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_DELETE)) {
- $this->sendHooks(array('preDelete'));
+ $this->sendHooks(['preDelete']);
$fileInfo = $this->getFileInfo();
$this->view->rmdir($this->path);
$nonExisting = new NonExistingFolder($this->root, $this->view, $this->path, $fileInfo);
/**
* @inheritDoc
*/
- public function emit($scope, $method, $arguments = array()) {
+ public function emit($scope, $method, $arguments = []) {
$this->__call(__FUNCTION__, func_get_args());
}
/**
* @inheritDoc
*/
- public function mount($storage, $mountPoint, $arguments = array()) {
+ public function mount($storage, $mountPoint, $arguments = []) {
$this->__call(__FUNCTION__, func_get_args());
}
*/
public function touch($mtime = null) {
if ($this->checkPermissions(\OCP\Constants::PERMISSION_UPDATE)) {
- $this->sendHooks(array('preTouch'));
+ $this->sendHooks(['preTouch']);
$this->view->touch($this->path, $mtime);
- $this->sendHooks(array('postTouch'));
+ $this->sendHooks(['postTouch']);
if ($this->fileInfo) {
if (is_null($mtime)) {
$mtime = time();
* @param string $method
* @param Node[] $arguments
*/
- public function emit($scope, $method, $arguments = array()) {
+ public function emit($scope, $method, $arguments = []) {
$this->emitter->emit($scope, $method, $arguments);
}
* @param string $mountPoint
* @param array $arguments
*/
- public function mount($storage, $mountPoint, $arguments = array()) {
+ public function mount($storage, $mountPoint, $arguments = []) {
$mount = new MountPoint($storage, $mountPoint, $arguments);
$this->mountManager->addMount($mount);
}
* @return array an array of metadata of the scanned file
*/
public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true) {
- return array();
+ return [];
}
/**
* @return array with the meta data of the scanned file or folder
*/
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
- return array();
+ return [];
}
/**
$path = $this->normalizePath($path);
try {
- $files = array();
+ $files = [];
$folderContents = $this->getCache()->getFolderContents($path);
foreach ($folderContents as $file) {
$files[] = $file['name'];
// work with all object storage implementations
$this->file_put_contents($path, ' ');
$mimeType = \OC::$server->getMimeTypeDetector()->detectPath($path);
- $stat = array(
+ $stat = [
'etag' => $this->getETag($path),
'mimetype' => $mimeType,
'size' => 0,
'mtime' => $mtime,
'storage_mtime' => $mtime,
'permissions' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE,
- );
+ ];
$this->getCache()->put($path, $stat);
} catch (\Exception $ex) {
$this->logger->logException($ex, [
if (!$this->connection->isBucketDnsCompatible($this->bucket)) {
throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: " . $this->bucket);
}
- $this->connection->createBucket(array('Bucket' => $this->bucket));
+ $this->connection->createBucket(['Bucket' => $this->bucket]);
$this->testTimeout();
} catch (S3Exception $e) {
$logger->logException($e, [
* @return array
*/
protected function searchInDir($query, $dir = '') {
- $files = array();
+ $files = [];
$dh = $this->opendir($dir);
if (is_resource($dh)) {
while (($item = readdir($dh)) !== false) {
$path = '/' . $path;
}
- $output = array();
+ $output = [];
foreach (explode('/', $path) as $chunk) {
if ($chunk == '..') {
array_pop($output);
try {
$response = $this->client->propFind(
$this->encodePath($path),
- array(
+ [
'{DAV:}getlastmodified',
'{DAV:}getcontentlength',
'{DAV:}getcontenttype',
'{http://open-collaboration-services.org/ns}share-permissions',
'{DAV:}resourcetype',
'{DAV:}getetag',
- )
+ ]
);
$this->statCache->set($path, $response);
} catch (ClientHttpException $e) {
} catch (\Exception $e) {
$this->convertException($e, $path);
}
- return array();
+ return [];
}
/** {@inheritdoc} */
* @var \SplFileInfo $file
*/
$file = $it->current();
- if (in_array($file->getBasename(), array('.', '..'))) {
+ if (in_array($file->getBasename(), ['.', '..'])) {
$it->next();
continue;
} elseif ($file->isDir()) {
* @return array
*/
protected function searchInDir($query, $dir = '') {
- $files = array();
+ $files = [];
$physicalDir = $this->getSourcePath($dir);
foreach (scandir($physicalDir) as $item) {
if (\OC\Files\Filesystem::isIgnoredDir($item))
*/
class Temporary extends Local{
public function __construct($arguments = null) {
- parent::__construct(array('datadir' => \OC::$server->getTempManager()->getTemporaryFolder()));
+ parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]);
}
public function cleanUp() {
private $mountManager;
/** @var array remember for which path we execute the repair step to avoid recursions */
- private $fixUnencryptedSizeOf = array();
+ private $fixUnencryptedSizeOf = [];
/** @var ArrayCache */
private $arrayCache;
$this->uid = $uid;
$this->fileHelper = $fileHelper;
$this->keyStorage = $keyStorage;
- $this->unencryptedSize = array();
+ $this->unencryptedSize = [];
$this->update = $update;
$this->mountManager = $mountManager;
$this->arrayCache = $arrayCache;
* @return array
*/
protected function parseRawHeader($rawHeader) {
- $result = array();
+ $result = [];
if (substr($rawHeader, 0, strlen(Util::HEADER_START)) === Util::HEADER_START) {
$header = $rawHeader;
$endAt = strpos($header, Util::HEADER_END);
* @return mixed
*/
public function __call($method, $args) {
- return call_user_func_array(array($this->getWrapperStorage(), $method), $args);
+ return call_user_func_array([$this->getWrapperStorage(), $method], $args);
}
/**
protected $fileUpdated;
public function __construct() {
- $this->expectedContextProperties = array(
+ $this->expectedContextProperties = [
'source',
'storage',
'internalPath',
'encryptionStorage',
'headerSize',
'signed'
- );
+ ];
}
$signed,
$wrapper = Encryption::class) {
- $context = stream_context_create(array(
- 'ocencryption' => array(
+ $context = stream_context_create([
+ 'ocencryption' => [
'source' => $source,
'storage' => $storage,
'internalPath' => $internalPath,
'encryptionStorage' => $encStorage,
'headerSize' => $headerSize,
'signed' => $signed
- )
- ));
+ ]
+ ]);
return self::wrapSource($source, $context, 'ocencryption', $wrapper, $mode);
}
* @return resource
*/
static public function wrap($stream, $limit) {
- $context = stream_context_create(array(
- 'quota' => array(
+ $context = stream_context_create([
+ 'quota' => [
'source' => $stream,
'limit' => $limit
- )
- ));
+ ]
+ ]);
return Wrapper::wrapSource($stream, $context, 'quota', self::class);
}
public function registerType(string $extension,
string $mimetype,
?string $secureMimeType = null): void {
- $this->mimetypes[$extension] = array($mimetype, $secureMimeType);
+ $this->mimetypes[$extension] = [$mimetype, $secureMimeType];
$this->secureMimeTypes[$mimetype] = $secureMimeType ?: $mimetype;
}
* @deprecated 18.0.0
*/
class TemplateManager {
- protected $templates = array();
+ protected $templates = [];
public function registerTemplate($mimetype, $path) {
$this->templates[$mimetype] = $path;
protected function attachListener($mount) {
$scanner = $mount->getStorage()->getScanner();
$scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount) {
- $this->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path));
+ $this->emit('\OC\Files\Utils\Scanner', 'scanFile', [$mount->getMountPoint() . $path]);
$this->dispatcher->dispatchTyped(new BeforeFileScannedEvent($mount->getMountPoint() . $path));
});
$scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount) {
- $this->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path));
+ $this->emit('\OC\Files\Utils\Scanner', 'scanFolder', [$mount->getMountPoint() . $path]);
$this->dispatcher->dispatchTyped(new BeforeFolderScannedEvent($mount->getMountPoint() . $path));
});
$scanner->listen('\OC\Files\Cache\Scanner', 'postScanFile', function ($path) use ($mount) {
- $this->emit('\OC\Files\Utils\Scanner', 'postScanFile', array($mount->getMountPoint() . $path));
+ $this->emit('\OC\Files\Utils\Scanner', 'postScanFile', [$mount->getMountPoint() . $path]);
$this->dispatcher->dispatchTyped(new FileScannedEvent($mount->getMountPoint() . $path));
});
$scanner->listen('\OC\Files\Cache\Scanner', 'postScanFolder', function ($path) use ($mount) {
- $this->emit('\OC\Files\Utils\Scanner', 'postScanFolder', array($mount->getMountPoint() . $path));
+ $this->emit('\OC\Files\Utils\Scanner', 'postScanFolder', [$mount->getMountPoint() . $path]);
$this->dispatcher->dispatchTyped(new FolderScannedEvent($mount->getMountPoint() . $path));
});
}
* for \OC\Files\Storage\Storage via basicOperation().
*/
public function mkdir($path) {
- return $this->basicOperation('mkdir', $path, array('create', 'write'));
+ return $this->basicOperation('mkdir', $path, ['create', 'write']);
}
/**
$this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true);
\OC_Hook::emit(
Filesystem::CLASSNAME, "umount",
- array(Filesystem::signal_param_path => $relPath)
+ [Filesystem::signal_param_path => $relPath]
);
$this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true);
$result = $mount->removeMount();
if ($result) {
\OC_Hook::emit(
Filesystem::CLASSNAME, "post_umount",
- array(Filesystem::signal_param_path => $relPath)
+ [Filesystem::signal_param_path => $relPath]
);
}
$this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true);
return $this->removeMount($mount, $absolutePath);
}
if ($this->is_dir($path)) {
- $result = $this->basicOperation('rmdir', $path, array('delete'));
+ $result = $this->basicOperation('rmdir', $path, ['delete']);
} else {
$result = false;
}
* @return resource
*/
public function opendir($path) {
- return $this->basicOperation('opendir', $path, array('read'));
+ return $this->basicOperation('opendir', $path, ['read']);
}
/**
$mtime = strtotime($mtime);
}
- $hooks = array('touch');
+ $hooks = ['touch'];
if (!$this->file_exists($path)) {
$hooks[] = 'create';
$mtime = time();
}
//if native touch fails, we emulate it by changing the mtime in the cache
- $this->putFileInfo($path, array('mtime' => floor($mtime)));
+ $this->putFileInfo($path, ['mtime' => floor($mtime)]);
}
return true;
}
* @throws LockedException
*/
public function file_get_contents($path) {
- return $this->basicOperation('file_get_contents', $path, array('read'));
+ return $this->basicOperation('file_get_contents', $path, ['read']);
}
/**
*/
protected function emit_file_hooks_pre($exists, $path, &$run) {
if (!$exists) {
- \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, array(
+ \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [
Filesystem::signal_param_path => $this->getHookPath($path),
Filesystem::signal_param_run => &$run,
- ));
+ ]);
} else {
- \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, array(
+ \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, [
Filesystem::signal_param_path => $this->getHookPath($path),
Filesystem::signal_param_run => &$run,
- ));
+ ]);
}
- \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_write, array(
+ \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_write, [
Filesystem::signal_param_path => $this->getHookPath($path),
Filesystem::signal_param_run => &$run,
- ));
+ ]);
}
/**
*/
protected function emit_file_hooks_post($exists, $path) {
if (!$exists) {
- \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_create, array(
+ \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_create, [
Filesystem::signal_param_path => $this->getHookPath($path),
- ));
+ ]);
} else {
- \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_update, array(
+ \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_update, [
Filesystem::signal_param_path => $this->getHookPath($path),
- ));
+ ]);
}
- \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_write, array(
+ \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_post_write, [
Filesystem::signal_param_path => $this->getHookPath($path),
- ));
+ ]);
}
/**
return false;
}
} else {
- $hooks = $this->file_exists($path) ? array('update', 'write') : array('create', 'write');
+ $hooks = $this->file_exists($path) ? ['update', 'write'] : ['create', 'write'];
return $this->basicOperation('file_put_contents', $path, $hooks, $data);
}
}
} elseif ($this->shouldEmitHooks($path1)) {
\OC_Hook::emit(
Filesystem::CLASSNAME, Filesystem::signal_rename,
- array(
+ [
Filesystem::signal_param_oldpath => $this->getHookPath($path1),
Filesystem::signal_param_newpath => $this->getHookPath($path2),
Filesystem::signal_param_run => &$run
- )
+ ]
);
}
if ($run) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
- array(
+ [
Filesystem::signal_param_oldpath => $this->getHookPath($path1),
Filesystem::signal_param_newpath => $this->getHookPath($path2)
- )
+ ]
);
}
}
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_copy,
- array(
+ [
Filesystem::signal_param_oldpath => $this->getHookPath($path1),
Filesystem::signal_param_newpath => $this->getHookPath($path2),
Filesystem::signal_param_run => &$run
- )
+ ]
);
$this->emit_file_hooks_pre($exists, $path2, $run);
}
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_copy,
- array(
+ [
Filesystem::signal_param_oldpath => $this->getHookPath($path1),
Filesystem::signal_param_newpath => $this->getHookPath($path2)
- )
+ ]
);
$this->emit_file_hooks_post($exists, $path2);
}
*/
public function fopen($path, $mode) {
$mode = str_replace('b', '', $mode); // the binary flag is a windows only feature which we do not support
- $hooks = array();
+ $hooks = [];
switch ($mode) {
case 'r':
$hooks[] = 'read';
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_read,
- array(Filesystem::signal_param_path => $this->getHookPath($path))
+ [Filesystem::signal_param_path => $this->getHookPath($path)]
);
}
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
\OC_Hook::emit(
Filesystem::CLASSNAME,
$prefix . $hook,
- array(
+ [
Filesystem::signal_param_run => &$run,
Filesystem::signal_param_path => $path
- )
+ ]
);
} elseif (!$post) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
$prefix . $hook,
- array(
+ [
Filesystem::signal_param_path => $path
- )
+ ]
);
}
}
* @return bool
*/
public function hasUpdated($path, $time) {
- return $this->basicOperation('hasUpdated', $path, array(), $time);
+ return $this->basicOperation('hasUpdated', $path, [], $time);
}
/**
* @return FileInfo[]
*/
public function search($query) {
- return $this->searchCommon('search', array('%' . $query . '%'));
+ return $this->searchCommon('search', ['%' . $query . '%']);
}
/**
* @return FileInfo[]
*/
public function searchRaw($query) {
- return $this->searchCommon('search', array($query));
+ return $this->searchCommon('search', [$query]);
}
/**
* @return FileInfo[]
*/
public function searchByMime($mimetype) {
- return $this->searchCommon('searchByMime', array($mimetype));
+ return $this->searchCommon('searchByMime', [$mimetype]);
}
/**
* @return FileInfo[]
*/
public function searchByTag($tag, $userId) {
- return $this->searchCommon('searchByTag', array($tag, $userId));
+ return $this->searchCommon('searchByTag', [$tag, $userId]);
}
/**
* @return FileInfo[]
*/
private function searchCommon($method, $args) {
- $files = array();
+ $files = [];
$rootLength = strlen($this->fakeRoot);
$mount = $this->getMount('');
if ($storage) {
$cache = $storage->getCache('');
- $results = call_user_func_array(array($cache, $method), $args);
+ $results = call_user_func_array([$cache, $method], $args);
foreach ($results as $result) {
if (substr($mountPoint . $result['path'], 0, $rootLength + 1) === $this->fakeRoot . '/') {
$internalPath = $result['path'];
$cache = $storage->getCache('');
$relativeMountPoint = substr($mountPoint, $rootLength);
- $results = call_user_func_array(array($cache, $method), $args);
+ $results = call_user_func_array([$cache, $method], $args);
if ($results) {
foreach ($results as $result) {
$internalPath = $result['path'];
// remove the single file
array_pop($parts);
- $result = array('/');
+ $result = ['/'];
$resultPath = '';
foreach ($parts as $part) {
if ($part) {
* if the user exists at all.
*/
public function getUserGroups($uid) {
- return array();
+ return [];
}
/**
*/
public function getGroups($search = '', $limit = -1, $offset = 0) {
- return array();
+ return [];
}
/**
* @return array an array of user ids
*/
public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
- return array();
+ return [];
}
}
private $gid;
/** @var \OC\User\User[] */
- private $users = array();
+ private $users = [];
/** @var bool */
private $usersLoaded;
return $this->users;
}
- $userIds = array();
+ $userIds = [];
foreach ($this->backends as $backend) {
$diff = array_diff(
$backend->usersInGroup($this->gid),
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\Group', 'preAddUser', array($this, $user));
+ $this->emitter->emit('\OC\Group', 'preAddUser', [$this, $user]);
}
foreach ($this->backends as $backend) {
if ($backend->implementsActions(\OC\Group\Backend::ADD_TO_GROUP)) {
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\Group', 'postAddUser', array($this, $user));
+ $this->emitter->emit('\OC\Group', 'postAddUser', [$this, $user]);
}
return;
}
'user' => $user,
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\Group', 'preRemoveUser', array($this, $user));
+ $this->emitter->emit('\OC\Group', 'preRemoveUser', [$this, $user]);
}
foreach ($this->backends as $backend) {
if ($backend->implementsActions(\OC\Group\Backend::REMOVE_FROM_GOUP) and $backend->inGroup($user->getUID(), $this->gid)) {
'user' => $user,
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\Group', 'postRemoveUser', array($this, $user));
+ $this->emitter->emit('\OC\Group', 'postRemoveUser', [$this, $user]);
}
if ($this->users) {
foreach ($this->users as $index => $groupUser) {
* @return \OC\User\User[]
*/
public function searchUsers($search, $limit = null, $offset = null) {
- $users = array();
+ $users = [];
foreach ($this->backends as $backend) {
$userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset);
$users += $this->getVerifiedUsers($userIds);
* @return \OC\User\User[]
*/
public function searchDisplayName($search, $limit = null, $offset = null) {
- $users = array();
+ $users = [];
foreach ($this->backends as $backend) {
$userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset);
$users = $this->getVerifiedUsers($userIds);
$result = false;
$this->dispatcher->dispatch(IGroup::class . '::preDelete', new GenericEvent($this));
if ($this->emitter) {
- $this->emitter->emit('\OC\Group', 'preDelete', array($this));
+ $this->emitter->emit('\OC\Group', 'preDelete', [$this]);
}
foreach ($this->backends as $backend) {
if ($backend->implementsActions(\OC\Group\Backend::DELETE_GROUP)) {
if ($result) {
$this->dispatcher->dispatch(IGroup::class . '::postDelete', new GenericEvent($this));
if ($this->emitter) {
- $this->emitter->emit('\OC\Group', 'postDelete', array($this));
+ $this->emitter->emit('\OC\Group', 'postDelete', [$this]);
}
}
return $result;
*/
private function getVerifiedUsers($userIds) {
if (!is_array($userIds)) {
- return array();
+ return [];
}
- $users = array();
+ $users = [];
foreach ($userIds as $userId) {
$user = $this->userManager->get($userId);
if (!is_null($user)) {
*/
public function getUserGroupNames(IUser $user) {
return array_map(function ($group) {
- return array('displayName' => $group->getDisplayName());
+ return ['displayName' => $group->getDisplayName()];
}, $this->getUserGroups($user));
}
/** @var bool */
protected $isAdmin;
/** @var array */
- protected $metaData = array();
+ protected $metaData = [];
/** @var IGroupManager */
protected $groupManager;
/** @var bool */
return $this->metaData[$key];
}
- $adminGroups = array();
- $groups = array();
+ $adminGroups = [];
+ $groups = [];
$sortGroupsIndex = 0;
- $sortGroupsKeys = array();
+ $sortGroupsKeys = [];
$sortAdminGroupsIndex = 0;
- $sortAdminGroupsKeys = array();
+ $sortAdminGroupsKeys = [];
foreach($this->getGroups($groupSearch) as $group) {
$groupMetaData = $this->generateGroupMetaData($group, $userSearch);
$this->sort($groups, $sortGroupsKeys);
$this->sort($adminGroups, $sortAdminGroupsKeys);
- $this->metaData[$key] = array($adminGroups, $groups);
+ $this->metaData[$key] = [$adminGroups, $groups];
return $this->metaData[$key];
}
* @return array with the keys 'id', 'name', 'usercount' and 'disabled'
*/
private function generateGroupMetaData(\OCP\IGroup $group, $userSearch) {
- return array(
+ return [
'id' => $group->getGID(),
'name' => $group->getDisplayName(),
'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
'disabled' => $group->countDisabled(),
'canAdd' => $group->canAddUser(),
'canRemove' => $group->canRemoveUser(),
- );
+ ];
}
/**
/**
* @var callable[][] $listeners
*/
- protected $listeners = array();
+ protected $listeners = [];
/**
* @param string $scope
public function listen($scope, $method, callable $callback) {
$eventName = $scope . '::' . $method;
if (!isset($this->listeners[$eventName])) {
- $this->listeners[$eventName] = array();
+ $this->listeners[$eventName] = [];
}
if (array_search($callback, $this->listeners[$eventName], true) === false) {
$this->listeners[$eventName][] = $callback;
* @param callable $callback optional
*/
public function removeListener($scope = null, $method = null, callable $callback = null) {
- $names = array();
+ $names = [];
$allNames = array_keys($this->listeners);
if ($scope and $method) {
$name = $scope . '::' . $method;
unset($this->listeners[$name][$index]);
}
} else {
- $this->listeners[$name] = array();
+ $this->listeners[$name] = [];
}
}
}
* @param string $method
* @param array $arguments optional
*/
- protected function emit($scope, $method, array $arguments = array()) {
+ protected function emit($scope, $method, array $arguments = []) {
$eventName = $scope . '::' . $method;
if (isset($this->listeners[$eventName])) {
foreach ($this->listeners[$eventName] as $callback) {
/**
* @var \OC\Hooks\Emitter[] array
*/
- private $forwardEmitters = array();
+ private $forwardEmitters = [];
/**
* @param string $scope
*
* @suppress PhanAccessMethodProtected
*/
- protected function emit($scope, $method, array $arguments = array()) {
+ protected function emit($scope, $method, array $arguments = []) {
\OC_Hook::emit($scope, $method, $arguments);
parent::emit($scope, $method, $arguments);
}
*
* @suppress PhanAccessMethodProtected
*/
- public function emit($scope, $method, array $arguments = array()) {
+ public function emit($scope, $method, array $arguments = []) {
parent::emit($scope, $method, $arguments);
}
}
$app = \OC_App::cleanAppId($app);
if ($lang !== null) {
- $lang = str_replace(array('\0', '/', '\\', '..'), '', (string)$lang);
+ $lang = str_replace(['\0', '/', '\\', '..'], '', (string)$lang);
}
$forceLang = $this->config->getSystemValue('force_language', false);
$plural = preg_replace( '#[^n0-9:\(\)\?\|\&=!<>+*/\%-]#', '', $matches[2] );
$body = str_replace(
- array( 'plural', 'n', '$n$plurals', ),
- array( '$plural', '$n', '$nplurals', ),
+ [ 'plural', 'n', '$n$plurals', ],
+ [ '$plural', '$n', '$nplurals', ],
'nplurals='. $nplurals . '; plural=' . $plural
);
// TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
$potentialName = (string) $l->t('__language_name__');
if ($l->getLanguageCode() === $lang && $potentialName[0] !== '_') {//first check if the language name is in the translation file
- $ln = array(
+ $ln = [
'code' => $lang,
'name' => $potentialName
- );
+ ];
} else if ($lang === 'en') {
- $ln = array(
+ $ln = [
'code' => $lang,
'name' => 'English (US)'
- );
+ ];
} else {//fallback to language code
- $ln = array(
+ $ln = [
'code' => $lang,
'name' => $lang
- );
+ ];
}
// put appropriate languages into appropriate arrays, to print them sorted
$data = curl_exec($ch);
curl_close($ch);
if ($data !== false) {
- $matches = array();
+ $matches = [];
preg_match('/Content-Length: (\d+)/', $data, $matches);
if (isset($matches[1])) {
return 0 + $matches[1];
$handler = new ErrorHandler();
if ($debug) {
- set_error_handler(array($handler, 'onAll'), E_ALL);
+ set_error_handler([$handler, 'onAll'], E_ALL);
if (\OC::$CLI) {
- set_exception_handler(array('OC_Template', 'printExceptionErrorPage'));
+ set_exception_handler(['OC_Template', 'printExceptionErrorPage']);
}
} else {
- set_error_handler(array($handler, 'onError'));
+ set_error_handler([$handler, 'onError']);
}
- register_shutdown_function(array($handler, 'onShutdown'));
- set_exception_handler(array($handler, 'onException'));
+ register_shutdown_function([$handler, 'onShutdown']);
+ set_exception_handler([$handler, 'onException']);
}
public static function setLogger(ILogger $logger) {
if($error && self::$logger) {
//ob_end_clean();
$msg = $error['message'] . ' at ' . $error['file'] . '#' . $error['line'];
- self::$logger->critical(self::removePassword($msg), array('app' => 'PHP'));
+ self::$logger->critical(self::removePassword($msg), ['app' => 'PHP']);
}
}
return;
}
$msg = $message . ' at ' . $file . '#' . $line;
- self::$logger->error(self::removePassword($msg), array('app' => 'PHP'));
+ self::$logger->error(self::removePassword($msg), ['app' => 'PHP']);
}
//Recoverable handler which catch all errors, warnings and notices
public static function onAll($number, $message, $file, $line) {
$msg = $message . ' at ' . $file . '#' . $line;
- self::$logger->debug(self::removePassword($msg), array('app' => 'PHP'));
+ self::$logger->debug(self::removePassword($msg), ['app' => 'PHP']);
}
*/
public function getEntries(int $limit=50, int $offset=0):array {
$minLevel = $this->config->getValue("loglevel", ILogger::WARN);
- $entries = array();
+ $entries = [];
$handle = @fopen($this->logFile, 'rb');
if ($handle) {
fseek($handle, 0, SEEK_END);
class ArrayCache extends Cache implements IMemcache {
/** @var array Array with the cached data */
- protected $cachedData = array();
+ protected $cachedData = [];
use CADTrait;
self::$cache->flush();
return true;
}
- $keys = array();
+ $keys = [];
$prefixLength = strlen($prefix);
foreach ($allKeys as $key) {
if (substr($key, 0, $prefixLength) === $prefix) {
class NaturalSort {
private static $instance;
private $collator;
- private $cache = array();
+ private $cache = [];
/**
* Instantiate a new \OC\NaturalSort instance.
if (isset($this->cache[$t])) {
return $this->cache[$t];
}
- $tz = array();
+ $tz = [];
$x = 0;
$y = -1;
$n = null;
foreach ($this->closureEntries as $c) {
$this->add($c());
}
- $this->closureEntries = array();
+ $this->closureEntries = [];
$result = $this->entries;
if ($type !== 'all') {
*/
public function __construct($data = null, $code = 100, $message = null, $headers = []) {
if ($data === null) {
- $this->data = array();
+ $this->data = [];
} elseif (!is_array($data)) {
- $this->data = array($this->data);
+ $this->data = [$this->data];
} else {
$this->data = $data;
}
* @return array
*/
public function getMeta() {
- $meta = array();
+ $meta = [];
$meta['status'] = $this->succeeded() ? 'ok' : 'failure';
$meta['statuscode'] = $this->statusCode;
$meta['message'] = $this->message;
*/
public function run() {
if (count($this->repairSteps) === 0) {
- $this->emit('\OC\Repair', 'info', array('No repair steps available'));
+ $this->emit('\OC\Repair', 'info', ['No repair steps available']);
return;
}
public function info($string) {
// for now just emit as we did in the past
- $this->emit('\OC\Repair', 'info', array($string));
+ $this->emit('\OC\Repair', 'info', [$string]);
}
/**
);
$result = $qb->execute();
- $orphanItems = array();
+ $orphanItems = [];
while ($row = $result->fetch()) {
$orphanItems[] = (int) $row[$deleteId];
}
" WHERE TABLE_SCHEMA = ?" .
" AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" .
" AND TABLE_NAME LIKE '*PREFIX*%'",
- array($dbName)
+ [$dbName]
);
$rows = $statement->fetchAll();
$result = [];
private function updateMimetypes($updatedMimetypes) {
if (empty($this->folderMimeTypeId)) {
- $result = \OC_DB::executeAudited(self::getIdStmt(), array('httpd/unix-directory'));
+ $result = \OC_DB::executeAudited(self::getIdStmt(), ['httpd/unix-directory']);
$this->folderMimeTypeId = (int)$result->fetchOne();
}
$count = 0;
foreach ($updatedMimetypes as $extension => $mimetype) {
- $result = \OC_DB::executeAudited(self::existsStmt(), array($mimetype));
+ $result = \OC_DB::executeAudited(self::existsStmt(), [$mimetype]);
$exists = $result->fetchOne();
if (!$exists) {
// insert mimetype
- \OC_DB::executeAudited(self::insertStmt(), array($mimetype));
+ \OC_DB::executeAudited(self::insertStmt(), [$mimetype]);
}
// get target mimetype id
- $result = \OC_DB::executeAudited(self::getIdStmt(), array($mimetype));
+ $result = \OC_DB::executeAudited(self::getIdStmt(), [$mimetype]);
$mimetypeId = $result->fetchOne();
// change mimetype for files with x extension
- $count += \OC_DB::executeAudited(self::updateByNameStmt(), array($mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension));
+ $count += \OC_DB::executeAudited(self::updateByNameStmt(), [$mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension]);
}
return $count;
}
private function introduceImageTypes() {
- $updatedMimetypes = array(
+ $updatedMimetypes = [
'jp2' => 'image/jp2',
'webp' => 'image/webp',
- );
+ ];
return $this->updateMimetypes($updatedMimetypes);
}
private function introduceWindowsProgramTypes() {
- $updatedMimetypes = array(
+ $updatedMimetypes = [
'htaccess' => 'text/plain',
'bat' => 'application/x-msdos-program',
'cmd' => 'application/cmd',
- );
+ ];
return $this->updateMimetypes($updatedMimetypes);
}
* @param bool $absolute
* @return string
*/
- public function generate($name, $parameters = array(), $absolute = false) {
+ public function generate($name, $parameters = [], $absolute = false) {
asort($parameters);
$key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute;
$cachedKey = $this->cache->get($key);
* to the class with $function
*/
public function action($class, $function = null) {
- $action = array($class, $function);
+ $action = [$class, $function];
if (is_null($function)) {
$action = $class;
}
*/
class Search implements ISearch {
- private $providers = array();
- private $registeredProviders = array();
+ private $providers = [];
+ private $registeredProviders = [];
/**
* Search all providers for $query
* @param int $size, 0 = all
* @return array An array of OC\Search\Result's
*/
- public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30) {
+ public function searchPaged($query, array $inApps = [], $page = 1, $size = 30) {
$this->initProviders();
- $results = array();
+ $results = [];
foreach($this->providers as $provider) {
/** @var $provider Provider */
if ( ! $provider->providesResultsFor($inApps) ) {
$results = array_merge($results, $providerResults);
}
} else {
- \OC::$server->getLogger()->warning('Ignoring Unknown search provider', array('provider' => $provider));
+ \OC::$server->getLogger()->warning('Ignoring Unknown search provider', ['provider' => $provider]);
}
}
return $results;
* Remove all registered search providers
*/
public function clearProviders() {
- $this->providers = array();
- $this->registeredProviders = array();
+ $this->providers = [];
+ $this->registeredProviders = [];
}
/**
}
);
// force regeneration of providers on next search
- $this->providers = array();
+ $this->providers = [];
}
/**
* @param string $class class name of a OC\Search\Provider
* @param array $options optional
*/
- public function registerProvider($class, array $options = array()) {
- $this->registeredProviders[] = array('class' => $class, 'options' => $options);
+ public function registerProvider($class, array $options = []) {
+ $this->registeredProviders[] = ['class' => $class, 'options' => $options];
}
/**
*/
public function search($query) {
$files = Filesystem::search($query);
- $results = array();
+ $results = [];
// edit results
foreach ($files as $fileData) {
// skip versions
public function listCertificates() {
if (!$this->config->getSystemValue('installed', false)) {
- return array();
+ return [];
}
$path = $this->getPathToCertificates() . 'uploads/';
if (!$this->view->is_dir($path)) {
- return array();
+ return [];
}
- $result = array();
+ $result = [];
$handle = $this->view->opendir($path);
if (!is_resource($handle)) {
- return array();
+ return [];
}
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
$groupManager = new \OC\Group\Manager($this->getUserManager(), $c->getEventDispatcher(), $this->getLogger());
$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
- \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
+ \OC_Hook::emit('OC_Group', 'pre_createGroup', ['run' => true, 'gid' => $gid]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new BeforeGroupCreatedEvent($gid));
});
$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $group) {
- \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $group->getGID()));
+ \OC_Hook::emit('OC_User', 'post_createGroup', ['gid' => $group->getGID()]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new GroupCreatedEvent($group));
});
$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
- \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
+ \OC_Hook::emit('OC_Group', 'pre_deleteGroup', ['run' => true, 'gid' => $group->getGID()]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new BeforeGroupDeletedEvent($group));
});
$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
- \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
+ \OC_Hook::emit('OC_User', 'post_deleteGroup', ['gid' => $group->getGID()]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new GroupDeletedEvent($group));
});
$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
- \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
+ \OC_Hook::emit('OC_Group', 'pre_addToGroup', ['run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new BeforeUserAddedEvent($group, $user));
});
$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
- \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
+ \OC_Hook::emit('OC_Group', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
- \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
+ \OC_Hook::emit('OC_User', 'post_addToGroup', ['uid' => $user->getUID(), 'gid' => $group->getGID()]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$c->query(IEventDispatcher::class)
);
$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
- \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
+ \OC_Hook::emit('OC_User', 'pre_createUser', ['run' => true, 'uid' => $uid, 'password' => $password]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
+ \OC_Hook::emit('OC_User', 'post_createUser', ['uid' => $user->getUID(), 'password' => $password]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'preDelete', function ($user) use ($legacyDispatcher) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
+ \OC_Hook::emit('OC_User', 'pre_deleteUser', ['run' => true, 'uid' => $user->getUID()]);
$legacyDispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user));
/** @var IEventDispatcher $dispatcher */
});
$userSession->listen('\OC\User', 'postDelete', function ($user) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
+ \OC_Hook::emit('OC_User', 'post_deleteUser', ['uid' => $user->getUID()]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
+ \OC_Hook::emit('OC_User', 'pre_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
+ \OC_Hook::emit('OC_User', 'post_setPassword', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new PasswordUpdatedEvent($user, $password, $recoveryPassword));
});
$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
- \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
+ \OC_Hook::emit('OC_User', 'pre_login', ['run' => true, 'uid' => $uid, 'password' => $password]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'postLogin', function ($user, $password, $isTokenLogin) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin));
+ \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password, 'isTokenLogin' => $isTokenLogin]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
+ \OC_Hook::emit('OC_User', 'post_login', ['run' => true, 'uid' => $user->getUID(), 'password' => $password]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
$dispatcher->dispatchTyped(new UserLoggedInWithCookieEvent($user, $password));
});
$userSession->listen('\OC\User', 'logout', function ($user) {
- \OC_Hook::emit('OC_User', 'logout', array());
+ \OC_Hook::emit('OC_User', 'logout', []);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
});
$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) {
/** @var $user \OC\User\User */
- \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue));
+ \OC_Hook::emit('OC_User', 'changeUser', ['run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue]);
/** @var IEventDispatcher $dispatcher */
$dispatcher = $this->query(IEventDispatcher::class);
throw new Exception('Supported databases are not properly configured.');
}
- $supportedDatabases = array();
+ $supportedDatabases = [];
foreach ($configuredDatabases as $database) {
if (array_key_exists($database, $availableDatabases)) {
];
}
- return array(
+ return [
'hasSQLite' => isset($databases['sqlite']),
'hasMySQL' => isset($databases['mysql']),
'hasPostgreSQL' => isset($databases['pgsql']),
'directory' => $dataDir,
'htaccessWorking' => $htAccessWorking,
'errors' => $errors,
- );
+ ];
}
/**
public function install($options) {
$l = $this->l10n;
- $error = array();
+ $error = [];
$dbType = $options['dbtype'];
if (empty($options['adminlogin'])) {
// validate the data directory
if ((!is_dir($dataDir) && !mkdir($dataDir)) || !is_writable($dataDir)) {
- $error[] = $l->t("Can't create or write into the data directory %s", array($dataDir));
+ $error[] = $l->t("Can't create or write into the data directory %s", [$dataDir]);
}
if (!empty($error)) {
}
public function validate($config) {
- $errors = array();
+ $errors = [];
if(empty($config['dbuser']) && empty($config['dbname'])) {
- $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
} else if(empty($config['dbuser'])) {
- $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
} else if(empty($config['dbname'])) {
- $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
}
if(substr_count($config['dbname'], '.') >= 1) {
- $errors[] = $this->trans->t("%s you may not use dots in the database name", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]);
}
return $errors;
}
* @return \OC\DB\Connection
*/
protected function connect(array $configOverwrite = []) {
- $connectionParams = array(
+ $connectionParams = [
'host' => $this->dbHost,
'user' => $this->dbUser,
'password' => $this->dbPassword,
'tablePrefix' => $this->tablePrefix,
'dbname' => $this->dbName
- );
+ ];
// adding port support through installer
if (!empty($this->dbPort)) {
}
public function validate($config) {
- $errors = array();
+ $errors = [];
if (empty($config['dbuser']) && empty($config['dbname'])) {
- $errors[] = $this->trans->t("%s enter the database username and name.", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
} else if (empty($config['dbuser'])) {
- $errors[] = $this->trans->t("%s enter the database username.", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
} else if (empty($config['dbname'])) {
- $errors[] = $this->trans->t("%s enter the database name.", array($this->dbprettyname));
+ $errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
}
return $errors;
}
} else {
$error = oci_error();
}
- foreach (array('message', 'code') as $key) {
+ foreach (['message', 'code'] as $key) {
if (isset($error[$key])) {
return $error[$key];
}
public $dbprettyname = 'Sqlite';
public function validate($config) {
- return array();
+ return [];
}
public function initialize($config) {
protected static $shareTypeUserAndGroups = -1;
protected static $shareTypeGroupUserUnique = 2;
- protected static $backends = array();
- protected static $backendTypes = array();
+ protected static $backends = [];
+ protected static $backendTypes = [];
protected static $isResharingAllowed;
}
* @param bool $excludeGroupChildren exclude group children elements
*/
public static function delete($parent, $excludeParent = false, $uidOwner = null, $newParent = null, $excludeGroupChildren = false) {
- $ids = array($parent);
- $deletedItems = array();
- $changeParent = array();
- $parents = array($parent);
+ $ids = [$parent];
+ $deletedItems = [];
+ $changeParent = [];
+ $parents = [$parent];
while (!empty($parents)) {
$parents = "'".implode("','", $parents)."'";
// Check the owner on the first search of reshares, useful for
// finding and deleting the reshares by a single user of a group share
- $params = array();
+ $params = [];
if (count($ids) == 1 && isset($uidOwner)) {
// FIXME: don't concat $parents, use Docrine's PARAM_INT_ARRAY approach
$queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' .
$query = \OC_DB::prepare($queryString);
$result = $query->execute($params);
// Reset parents array, only go through loop again if items are found
- $parents = array();
+ $parents = [];
while ($item = $result->fetchRow()) {
- $tmpItem = array(
+ $tmpItem = [
'id' => $item['id'],
'shareWith' => $item['share_with'],
'itemTarget' => $item['item_target'],
'itemType' => $item['item_type'],
'shareType' => (int)$item['share_type'],
- );
+ ];
if (isset($item['file_target'])) {
$tmpItem['fileTarget'] = $item['file_target'];
}
if (!empty($changeParent)) {
$idList = "'".implode("','", $changeParent)."'";
$query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `parent` = ? WHERE `id` IN ('.$idList.')');
- $query->execute(array($newParent));
+ $query->execute([$newParent]);
}
if (!empty($ids)) {
$config = \OC::$server->getConfig();
- $defaultExpireSettings = array('defaultExpireDateSet' => false);
+ $defaultExpireSettings = ['defaultExpireDateSet' => false];
// get default expire settings
$defaultExpireDate = $config->getAppValue('core', 'shareapi_default_expire_date', 'no');
\OCP\Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$user1)
+ ['uid' => &$user1]
);
\OCP\Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$user2)
+ ['uid' => &$user2]
);
if ($user1 === $user2) {
if(!isset($a[$this->key]) || !isset($b[$this->key])) {
if(!is_null($this->log)) {
$this->log->error('Sharing dialogue: cannot sort due to ' .
- 'missing array key', array('app' => 'core'));
+ 'missing array key', ['app' => 'core']);
}
return 0;
}
public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') == 'yes') {
if (!isset(self::$backendTypes[$itemType])) {
- self::$backendTypes[$itemType] = array(
+ self::$backendTypes[$itemType] = [
'class' => $class,
'collectionOf' => $collectionOf,
'supportedFileExtensions' => $supportedFileExtensions
- );
+ ];
return true;
}
\OCP\Util::writeLog('OCP\Share',
* @return array Return list of items with file_target, permissions and expiration
*/
public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null, $shareType = null) {
- $shares = array();
+ $shares = [];
$fileDependent = false;
$where = 'WHERE';
$select = self::createSelectStatement(self::FORMAT_NONE, $fileDependent);
$where .= ' `' . $column . '` = ? AND `item_type` = ? ';
- $arguments = array($itemSource, $itemType);
+ $arguments = [$itemSource, $itemType];
// for link shares $user === null
if ($user !== null) {
$where .= ' AND `share_with` = ? ';
if (!empty($groups)) {
$where = $fileDependentWhere . ' WHERE `' . $column . '` = ? AND `item_type` = ? AND `share_with` in (?)';
- $arguments = array($itemSource, $itemType, $groups);
- $types = array(null, null, IQueryBuilder::PARAM_STR_ARRAY);
+ $arguments = [$itemSource, $itemType, $groups];
+ $types = [null, null, IQueryBuilder::PARAM_STR_ARRAY];
if ($owner !== null) {
$where .= ' AND `uid_owner` = ?';
$items = self::getItemSharedWithUser($itemType, $itemSource, $shareWith, $owner, $shareType);
- $toDelete = array();
+ $toDelete = [];
$newParent = null;
$currentUser = $owner ? $owner : \OC_User::getUser();
foreach ($items as $item) {
}
// Pass all the vars we have for now, they may be useful
- $hookParams = array(
+ $hookParams = [
'id' => $item['id'],
'itemType' => $item['item_type'],
'itemSource' => $item['item_source'],
'shareWith' => $shareWith,
'itemParent' => $item['parent'],
'uidOwner' => $item['uid_owner'],
- );
+ ];
if($item['item_type'] === 'file' || $item['item_type'] === 'folder') {
$hookParams['fileSource'] = $item['file_source'];
$hookParams['fileTarget'] = $item['file_target'];
self::$backends[$itemType] = new $class;
if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) {
$message = 'Sharing backend %s must implement the interface OCP\Share_Backend';
- $message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class));
+ $message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', [$class]);
\OCP\Util::writeLog('OCP\Share', sprintf($message, $class), ILogger::ERROR);
throw new \Exception($message_t);
}
return self::$backends[$itemType];
} else {
$message = 'Sharing backend %s not found';
- $message_t = $l->t('Sharing backend %s not found', array($class));
+ $message_t = $l->t('Sharing backend %s not found', [$class]);
\OCP\Util::writeLog('OCP\Share', sprintf($message, $class), ILogger::ERROR);
throw new \Exception($message_t);
}
}
$message = 'Sharing backend for %s not found';
- $message_t = $l->t('Sharing backend for %s not found', array($itemType));
+ $message_t = $l->t('Sharing backend for %s not found', [$itemType]);
\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemType), ILogger::ERROR);
throw new \Exception($message_t);
}
* @return array
*/
private static function getCollectionItemTypes($itemType) {
- $collectionTypes = array($itemType);
+ $collectionTypes = [$itemType];
foreach (self::$backendTypes as $type => $backend) {
if (in_array($backend['collectionOf'], $collectionTypes)) {
$collectionTypes[] = $type;
public static function getSharedItemsOwners($user, $type, $includeCollections = false, $includeOwner = false) {
// First, we find out if $type is part of a collection (and if that collection is part of
// another one and so on).
- $collectionTypes = array();
+ $collectionTypes = [];
if (!$includeCollections || !$collectionTypes = self::getCollectionItemTypes($type)) {
$collectionTypes[] = $type;
}
// list of the ones for which a sharing backend has been registered.
// FIXME: Ideally, we wouldn't need to nest getItemsSharedWith in this loop but just call it
// with its $includeCollections parameter set to true. Unfortunately, this fails currently.
- $allMaybeSharedItems = array();
+ $allMaybeSharedItems = [];
foreach ($collectionTypes as $collectionType) {
if (isset(self::$backends[$collectionType])) {
$allMaybeSharedItems[$collectionType] = self::getItemsSharedWithUser(
}
}
- $owners = array();
+ $owners = [];
if ($includeOwner) {
$owners[] = $user;
}
$uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1,
$includeCollections = false, $itemShareWithBySource = false, $checkExpireDate = true) {
if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') != 'yes') {
- return array();
+ return [];
}
$backend = self::getBackend($itemType);
$collectionTypes = false;
}
$where .= 'INNER JOIN `*PREFIX*storages` ON `numeric_id` = `*PREFIX*filecache`.`storage` ';
$fileDependent = true;
- $queryArgs = array();
+ $queryArgs = [];
} else {
$fileDependent = false;
$root = '';
if ($includeCollections && !isset($item) && $collectionTypes) {
// If includeCollections is true, find collections of this item type, e.g. a music album contains songs
if (!in_array($itemType, $collectionTypes)) {
- $itemTypes = array_merge(array($itemType), $collectionTypes);
+ $itemTypes = array_merge([$itemType], $collectionTypes);
} else {
$itemTypes = $collectionTypes;
}
$queryArgs = $itemTypes;
} else {
$where = ' WHERE `item_type` = ?';
- $queryArgs = array($itemType);
+ $queryArgs = [$itemType];
}
}
if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
\OC_DB::getErrorMessage() . ', select=' . $select . ' where=',
ILogger::ERROR);
}
- $items = array();
- $targets = array();
- $switchedItems = array();
- $mounts = array();
+ $items = [];
+ $targets = [];
+ $switchedItems = [];
+ $mounts = [];
while ($row = $result->fetchRow()) {
self::transformDBResults($row);
// Filter out duplicate group shares for users with unique targets
if (isset($uidOwner) && isset($row['path'])) {
if (isset($row['parent'])) {
$query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?');
- $parentResult = $query->execute(array($row['parent']));
+ $parentResult = $query->execute([$row['parent']]);
if ($result === false) {
\OCP\Util::writeLog('OCP\Share', 'Can\'t select parent: ' .
\OC_DB::getErrorMessage() . ', select=' . $select . ' where=' . $where,
}
if (!empty($items)) {
- $collectionItems = array();
+ $collectionItems = [];
foreach ($items as &$row) {
// Return only the item instead of a 2-dimensional array
if ($limit == 1 && $row[$column] == $item && ($row['item_type'] == $itemType || $itemType == 'file')) {
if (isset($item) && $row['item_type'] == $itemType && $row[$column] == $item) {
$collectionItems[] = $row;
} else {
- $collection = array();
+ $collection = [];
$collection['item_type'] = $row['item_type'];
if ($row['item_type'] == 'file' || $row['item_type'] == 'folder') {
$collection['path'] = basename($row['path']);
return $childItem;
} else {
// Unset the items array and break out of both loops
- $items = array();
+ $items = [];
$items[] = $childItem;
break 2;
}
// FIXME: Thats a dirty hack to improve file sharing performance,
// see github issue #10588 for more details
// Need to find a solution which works for all back-ends
- $collectionItems = array();
+ $collectionItems = [];
$collectionBackend = self::getBackend('folder');
$sharedParents = $collectionBackend->getParents($item, $shareWith, $uidOwner);
foreach ($sharedParents as $parent) {
return self::formatResult($collectionItems, $column, $backend, $format, $parameters);
}
- return array();
+ return [];
}
/**
$fileSharing = $itemType === 'file' || $itemType === 'folder';
- $result = array();
+ $result = [];
foreach ($items as $item) {
$grouped = false;
private static function put($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
$permissions) {
- $queriesToExecute = array();
+ $queriesToExecute = [];
$suggestedItemTarget = null;
$groupFileTarget = $fileTarget = $suggestedFileTarget = $filePath = '';
$groupItemTarget = $itemTarget = $fileSource = $parent = 0;
}
$isGroupShare = false;
- $users = array($shareWith);
+ $users = [$shareWith];
$itemTarget = Helper::generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
$suggestedItemTarget);
$run = true;
$error = '';
- $preHookData = array(
+ $preHookData = [
'itemType' => $itemType,
'itemSource' => $itemSource,
'shareType' => $shareType,
'token' => null,
'run' => &$run,
'error' => &$error
- );
+ ];
$preHookData['itemTarget'] = $itemTarget;
$preHookData['shareWith'] = $shareWith;
}
}
- $queriesToExecute[] = array(
+ $queriesToExecute[] = [
'itemType' => $itemType,
'itemSource' => $itemSource,
'itemTarget' => $itemTarget,
'token' => null,
'parent' => $parent,
'expiration' => null,
- );
+ ];
}
$id = self::insertShare($shareQuery);
}
- $postHookData = array(
+ $postHookData = [
'itemType' => $itemType,
'itemSource' => $itemSource,
'parent' => $parent,
'id' => $parent,
'token' => null,
'expirationDate' => null,
- );
+ ];
$postHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith;
$postHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget;
private static function checkReshare($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $itemSourceName, $expirationDate) {
$backend = self::getBackend($itemType);
- $result = array();
+ $result = [];
$column = ($itemType === 'file' || $itemType === 'folder') ? 'file_source' : 'item_source';
if ($format === self::FORMAT_NONE) {
return $items;
} else if ($format === self::FORMAT_STATUSES) {
- $statuses = array();
+ $statuses = [];
foreach ($items as $item) {
if ($item['share_type'] === self::SHARE_TYPE_LINK) {
if ($item['uid_initiator'] !== \OC::$server->getUserSession()->getUser()->getUID()) {
*/
private static function sendRemoteUnshare($remote, $id, $token) {
$url = rtrim($remote, '/');
- $fields = array('token' => $token, 'format' => 'json');
+ $fields = ['token' => $token, 'format' => 'json'];
$url = self::removeProtocolFromUrl($url);
$result = self::tryHttpPostToShareEndpoint($url, '/'.$id.'/unshare', $fields);
$status = json_decode($result['result'], true);
$pathSections = explode('/', $data['path'], 2);
// FIXME: would not detect rare md5'd home storage case properly
if ($pathSections[0] !== 'files'
- && in_array(explode(':', $data['storage_string_id'], 2)[0], array('home', 'object'))) {
+ && in_array(explode(':', $data['storage_string_id'], 2)[0], ['home', 'object'])) {
return false;
}
return true;
'shareWith' => $shareWith,
]);
- $emailTemplate->setSubject($l->t('%1$s shared »%2$s« with you', array($initiatorDisplayName, $filename)));
+ $emailTemplate->setSubject($l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]));
$emailTemplate->addHeader();
$emailTemplate->addHeading($l->t('%1$s shared »%2$s« with you', [$initiatorDisplayName, $filename]), false);
$text = $l->t('%1$s shared »%2$s« with you.', [$initiatorDisplayName, $filename]);
} else {
$userFolder = $this->rootFolder->getUserFolder($share->getSharedBy());
}
- \OC_Hook::emit(Share::class, 'post_update_permissions', array(
+ \OC_Hook::emit(Share::class, 'post_update_permissions', [
'itemType' => $share->getNode() instanceof \OCP\Files\File ? 'file' : 'folder',
'itemSource' => $share->getNode()->getId(),
'shareType' => $share->getShareType(),
'uidOwner' => $share->getSharedBy(),
'permissions' => $share->getPermissions(),
'path' => $userFolder->getRelativePath($share->getNode()->getPath()),
- ));
+ ]);
}
return $share;
*/
public function getSubAdminsGroupsName(IUser $user): array {
return array_map(function($group) {
- return array('displayName' => $group->getDisplayName());
+ return ['displayName' => $group->getDisplayName()];
}, $this->getSubAdminsGroups($user));
}
* logged in user
* @return \OCP\ITags
*/
- public function load($type, $defaultTags = array(), $includeShared = false, $userId = null) {
+ public function load($type, $defaultTags = [], $includeShared = false, $userId = null) {
if (is_null($userId)) {
$user = $this->userSession->getUser();
if ($user === null) {
*/
public function loadTags($owners, $type) {
if(!is_array($owners)) {
- $owners = array($owners);
+ $owners = [$owners];
}
$sql = 'SELECT `id`, `uid`, `type`, `category` FROM `' . $this->getTableName() . '` '
. 'WHERE `uid` IN (' . str_repeat('?,', count($owners)-1) . '?) AND `type` = ? ORDER BY `category`';
- return $this->findEntities($sql, array_merge($owners, array($type)));
+ return $this->findEntities($sql, array_merge($owners, [$type]));
}
/**
$sql = 'SELECT `id`, `uid`, `type`, `category` FROM `' . $this->getTableName() . '` '
. 'WHERE `uid` = ? AND `type` = ? AND `category` = ?';
try {
- $this->findEntity($sql, array($tag->getOwner(), $tag->getType(), $tag->getName()));
+ $this->findEntity($sql, [$tag->getOwner(), $tag->getType(), $tag->getName()]);
} catch (DoesNotExistException $e) {
return false;
}
*
* @var array
*/
- private $tags = array();
+ private $tags = [];
/**
* Used for storing objectid/categoryname pairs while rescanning.
*
* @var array
*/
- private static $relations = array();
+ private static $relations = [];
/**
* Type
*
* @var array
*/
- private $owners = array();
+ private $owners = [];
/**
* The Mapper we're using to communicate our Tag objects to the database.
* @param array $defaultTags Tags that should be created at construction.
* @param boolean $includeShared Whether to include tags for items shared with this user by others.
*/
- public function __construct(TagMapper $mapper, $user, $type, $defaultTags = array(), $includeShared = false) {
+ public function __construct(TagMapper $mapper, $user, $type, $defaultTags = [], $includeShared = false) {
$this->mapper = $mapper;
$this->user = $user;
$this->type = $type;
$this->includeShared = $includeShared;
- $this->owners = array($this->user);
+ $this->owners = [$this->user];
if ($this->includeShared) {
$this->owners = array_merge($this->owners, \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true));
$this->backend = \OC\Share\Share::getBackend($this->type);
*/
public function getTags() {
if(!count($this->tags)) {
- return array();
+ return [];
}
usort($this->tags, function($a, $b) {
return strnatcasecmp($a->getName(), $b->getName());
});
- $tagMap = array();
+ $tagMap = [];
foreach($this->tags as $tag) {
if($tag->getName() !== ITags::TAG_FAVORITE) {
* or false if an error occurred
*/
public function getTagsForObjects(array $objIds) {
- $entries = array();
+ $entries = [];
try {
$conn = \OC::$server->getDatabaseConnection();
'SELECT `category`, `categoryid`, `objid` ' .
'FROM `' . self::RELATION_TABLE . '` r, `' . self::TAG_TABLE . '` ' .
'WHERE `categoryid` = `id` AND `uid` = ? AND r.`type` = ? AND `objid` IN (?)',
- array($this->user, $this->type, $chunk),
- array(null, null, IQueryBuilder::PARAM_INT_ARRAY)
+ [$this->user, $this->type, $chunk],
+ [null, null, IQueryBuilder::PARAM_INT_ARRAY]
);
while ($row = $result->fetch()) {
$objId = (int)$row['objid'];
if (!isset($entries[$objId])) {
- $entries[$objId] = array();
+ $entries[$objId] = [];
}
$entries[$objId][] = $row['category'];
}
);
}
- $ids = array();
+ $ids = [];
$sql = 'SELECT `objid` FROM `' . self::RELATION_TABLE
. '` WHERE `categoryid` = ?';
try {
$stmt = \OC_DB::prepare($sql);
- $result = $stmt->execute(array($tagId));
+ $result = $stmt->execute([$tagId]);
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), ILogger::ERROR);
return false;
*/
public function addMultiple($names, $sync=false, $id = null) {
if(!is_array($names)) {
- $names = array($names);
+ $names = [$names];
}
$names = array_map('trim', $names);
array_filter($names);
- $newones = array();
+ $newones = [];
foreach($names as $name) {
if(!$this->hasTag($name) && $name !== '') {
$newones[] = new Tag($this->user, $this->type, $name);
}
if(!is_null($id) ) {
// Insert $objectid, $categoryid pairs if not exist.
- self::$relations[] = array('objid' => $id, 'tag' => $name);
+ self::$relations[] = ['objid' => $id, 'tag' => $name];
}
}
$this->tags = array_merge($this->tags, $newones);
if($tagId) {
try {
$dbConnection->insertIfNotExist(self::RELATION_TABLE,
- array(
+ [
'objid' => $relation['objid'],
'categoryid' => $tagId,
'type' => $this->type,
- ));
+ ]);
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
'message' => __METHOD__,
}
}
}
- self::$relations = array(); // reset
+ self::$relations = []; // reset
} else {
\OCP\Util::writeLog('core', __METHOD__.', $this->tags is not an array! '
. print_r($this->tags, true), ILogger::ERROR);
try {
$stmt = \OC_DB::prepare('SELECT `id` FROM `' . self::TAG_TABLE . '` '
. 'WHERE `uid` = ?');
- $result = $stmt->execute(array($arguments['uid']));
+ $result = $stmt->execute([$arguments['uid']]);
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(), ILogger::ERROR);
}
. 'WHERE `categoryid` = ?');
while( $row = $result->fetchRow()) {
try {
- $stmt->execute(array($row['id']));
+ $stmt->execute([$row['id']]);
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
'message' => __METHOD__,
try {
$stmt = \OC_DB::prepare('DELETE FROM `' . self::TAG_TABLE . '` '
. 'WHERE `uid` = ?');
- $result = $stmt->execute(array($arguments['uid']));
+ $result = $stmt->execute([$arguments['uid']]);
if ($result === null) {
\OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OC::$server->getDatabaseConnection()->getError(), ILogger::ERROR);
}
'level' => ILogger::ERROR,
'app' => 'core',
]);
- return array();
+ return [];
}
}
}
try {
\OC::$server->getDatabaseConnection()->insertIfNotExist(self::RELATION_TABLE,
- array(
+ [
'objid' => $objid,
'categoryid' => $tagId,
'type' => $this->type,
- ));
+ ]);
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
'message' => __METHOD__,
$sql = 'DELETE FROM `' . self::RELATION_TABLE . '` '
. 'WHERE `objid` = ? AND `categoryid` = ? AND `type` = ?';
$stmt = \OC_DB::prepare($sql);
- $stmt->execute(array($objid, $tagId, $this->type));
+ $stmt->execute([$objid, $tagId, $this->type]);
} catch(\Exception $e) {
\OC::$server->getLogger()->logException($e, [
'message' => __METHOD__,
*/
public function delete($names) {
if(!is_array($names)) {
- $names = array($names);
+ $names = [$names];
}
$names = array_map('trim', $names);
$sql = 'DELETE FROM `' . self::RELATION_TABLE . '` '
. 'WHERE `categoryid` = ?';
$stmt = \OC_DB::prepare($sql);
- $result = $stmt->execute(array($id));
+ $result = $stmt->execute([$id]);
if ($result === null) {
\OCP\Util::writeLog('core',
__METHOD__. 'DB error: ' . \OC::$server->getDatabaseConnection()->getError(),
}
return array_search(strtolower($needle), array_map(
function($tag) use($mem) {
- return strtolower(call_user_func(array($tag, $mem)));
+ return strtolower(call_user_func([$tag, $mem]));
}, $haystack)
);
}
* @return array
*/
private function tagMap(Tag $tag) {
- return array(
+ return [
'id' => $tag->getId(),
'name' => $tag->getName(),
'owner' => $tag->getOwner(),
'type' => $tag->getType()
- );
+ ];
}
}
* @param Defaults $theme
*/
public function __construct($template, $requestToken, $l10n, $theme ) {
- $this->vars = array();
+ $this->vars = [];
$this->vars['requesttoken'] = $requestToken;
$this->l10n = $l10n;
$this->template = $template;
$this->vars[$key][] = $value;
}
else{
- $this->vars[$key] = array( $value );
+ $this->vars[$key] = [ $value ];
}
}
}
}
- $this->resources[] = array($webRoot? : \OC::$WEBROOT, $webRoot, $file);
+ $this->resources[] = [$webRoot? : \OC::$WEBROOT, $webRoot, $file];
}
}
}
$fileName = array_pop($tmpfileLoc);
$fileName = str_replace('.json', '.js', $fileName);
- return substr($this->urlGenerator->linkToRoute('core.Js.getJs', array('fileName' => $fileName, 'appName' => $appName)), strlen(\OC::$WEBROOT) + 1);
+ return substr($this->urlGenerator->linkToRoute('core.Js.getJs', ['fileName' => $fileName, 'appName' => $appName]), strlen(\OC::$WEBROOT) + 1);
}
/**
}
// Allow hooks to modify the output values
- \OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array));
+ \OC_Hook::emit('\OCP\Config', 'js', ['array' => &$array]);
$result = '';
protected $thirdpartyroot;
protected $webroot;
- protected $resources = array();
+ protected $resources = [];
/** @var \OCP\ILogger */
protected $logger;
]);
}
}
- $this->resources[] = array($root, $webRoot, $file);
+ $this->resources[] = [$root, $webRoot, $file];
if ($throw && !is_file($root . '/' . $file)) {
throw new ResourceNotFoundException($file, $webRoot);
// Add the js files
$jsFiles = self::findJavascriptFiles(\OC_Util::$scripts);
- $this->assign('jsfiles', array());
+ $this->assign('jsfiles', []);
if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
$jsConfigHelper = new JSConfigHelper(
$cssFiles = self::findStylesheetFiles(\OC_Util::$styles, false);
}
- $this->assign('cssfiles', array());
+ $this->assign('cssfiles', []);
$this->assign('printcssfiles', []);
$this->assign('versionHash', self::$versionHash);
foreach($cssFiles as $info) {
$locator = new \OC\Template\CSSResourceLocator(
\OC::$server->getLogger(),
$theme,
- array( \OC::$SERVERROOT => \OC::$WEBROOT ),
- array( \OC::$SERVERROOT => \OC::$WEBROOT ),
+ [ \OC::$SERVERROOT => \OC::$WEBROOT ],
+ [ \OC::$SERVERROOT => \OC::$WEBROOT ],
$SCSSCacher
);
$locator->find($styles);
$locator = new \OC\Template\JSResourceLocator(
\OC::$server->getLogger(),
$theme,
- array( \OC::$SERVERROOT => \OC::$WEBROOT ),
- array( \OC::$SERVERROOT => \OC::$WEBROOT ),
+ [ \OC::$SERVERROOT => \OC::$WEBROOT ],
+ [ \OC::$SERVERROOT => \OC::$WEBROOT ],
\OC::$server->query(JSCombiner::class)
);
$locator->find($scripts);
*
* Returns a url to the given route.
*/
- public function linkToRoute(string $route, array $parameters = array()): string {
+ public function linkToRoute(string $route, array $parameters = []): string {
// TODO: mock router
return \OC::$server->getRouter()->generate($route, $parameters);
}
*
* Returns an absolute url to the given route.
*/
- public function linkToRouteAbsolute(string $routeName, array $arguments = array()): string {
+ public function linkToRouteAbsolute(string $routeName, array $arguments = []): string {
return $this->getAbsoluteURL($this->linkToRoute($routeName, $arguments));
}
*
* Returns a url to the given app and file.
*/
- public function linkTo(string $app, string $file, array $args = array()): string {
+ public function linkTo(string $app, string $file, array $args = []): string {
$frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
if( $app !== '' ) {
$installedVersion = $this->config->getSystemValue('version', '0.0.0');
$currentVersion = implode('.', \OCP\Util::getVersion());
- $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core'));
+ $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, ['app' => 'core']);
$success = true;
try {
$this->doUpgrade($currentVersion, $installedVersion);
} catch (HintException $exception) {
$this->log->logException($exception, ['app' => 'core']);
- $this->emit('\OC\Updater', 'failure', array($exception->getMessage() . ': ' .$exception->getHint()));
+ $this->emit('\OC\Updater', 'failure', [$exception->getMessage() . ': ' .$exception->getHint()]);
$success = false;
} catch (\Exception $exception) {
$this->log->logException($exception, ['app' => 'core']);
- $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage()));
+ $this->emit('\OC\Updater', 'failure', [get_class($exception) . ': ' .$exception->getMessage()]);
$success = false;
}
- $this->emit('\OC\Updater', 'updateEnd', array($success));
+ $this->emit('\OC\Updater', 'updateEnd', [$success]);
if(!$wasMaintenanceModeEnabled && $success) {
$this->config->setSystemValue('maintenance', false);
$this->includePreUpdate($appId);
}
if (file_exists(\OC_App::getAppPath($appId) . '/appinfo/database.xml')) {
- $this->emit('\OC\Updater', 'appSimulateUpdate', array($appId));
+ $this->emit('\OC\Updater', 'appSimulateUpdate', [$appId]);
\OC_DB::simulateUpdateDbFromStructure(\OC_App::getAppPath($appId) . '/appinfo/database.xml');
}
}
*/
protected function doAppUpgrade() {
$apps = \OC_App::getEnabledApps();
- $priorityTypes = array('authentication', 'filesystem', 'logging');
+ $priorityTypes = ['authentication', 'filesystem', 'logging'];
$pseudoOtherType = 'other';
- $stacks = array($pseudoOtherType => array());
+ $stacks = [$pseudoOtherType => []];
foreach ($apps as $appId) {
$priorityType = false;
foreach ($priorityTypes as $type) {
if(!isset($stacks[$type])) {
- $stacks[$type] = array();
+ $stacks[$type] = [];
}
if (\OC_App::isType($appId, [$type])) {
$stacks[$type][] = $appId;
throw new \UnexpectedValueException('The files of the app "' . $app . '" were not correctly replaced before running the update');
}
\OC::$server->getAppManager()->disableApp($app, true);
- $this->emit('\OC\Updater', 'incompatibleAppDisabled', array($app));
+ $this->emit('\OC\Updater', 'incompatibleAppDisabled', [$app]);
}
// no need to disable any app in case this is a non-core upgrade
if (!$isCoreUpgrade) {
const PROVIDE_AVATAR = 16777216; // 1 << 24
const COUNT_USERS = 268435456; // 1 << 28
- protected $possibleActions = array(
+ protected $possibleActions = [
self::CREATE_USER => 'createUser',
self::SET_PASSWORD => 'setPassword',
self::CHECK_PASSWORD => 'checkPassword',
self::SET_DISPLAYNAME => 'setDisplayName',
self::PROVIDE_AVATAR => 'canChangeAvatar',
self::COUNT_USERS => 'countUsers',
- );
+ ];
/**
* Get all supported actions
* @return string[] an array of all uids
*/
public function getUsers($search = '', $limit = null, $offset = null) {
- return array();
+ return [];
}
/**
* @return array an array of all displayNames (value) and the corresponding uids (key)
*/
public function getDisplayNames($search = '', $limit = null, $offset = null) {
- $displayNames = array();
+ $displayNames = [];
$users = $this->getUsers($search, $limit, $offset);
foreach ( $users as $user) {
$displayNames[$user] = $user;
/**
* @var \OCP\UserInterface[] $backends
*/
- private $backends = array();
+ private $backends = [];
/**
* @var \OC\User\User[] $cachedUsers
*/
- private $cachedUsers = array();
+ private $cachedUsers = [];
/** @var IConfig */
private $config;
* @param \OCP\UserInterface $backend
*/
public function removeBackend($backend) {
- $this->cachedUsers = array();
+ $this->cachedUsers = [];
if (($i = array_search($backend, $this->backends)) !== false) {
unset($this->backends[$i]);
}
* remove all user backends
*/
public function clearBackends() {
- $this->cachedUsers = array();
- $this->backends = array();
+ $this->cachedUsers = [];
+ $this->backends = [];
}
/**
* @return \OC\User\User[]
*/
public function search($pattern, $limit = null, $offset = null) {
- $users = array();
+ $users = [];
foreach ($this->backends as $backend) {
$backendUsers = $backend->getUsers($pattern, $limit, $offset);
if (is_array($backendUsers)) {
* @return \OC\User\User[]
*/
public function searchDisplayName($pattern, $limit = null, $offset = null) {
- $users = array();
+ $users = [];
foreach ($this->backends as $backend) {
$backendUsers = $backend->getDisplayNames($pattern, $limit, $offset);
if (is_array($backendUsers)) {
$currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login');
if ($this->manager instanceof PublicEmitter) {
- $this->manager->emit('\OC\User', 'preLogin', array($user, $password));
+ $this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
}
try {
Util::emitHook(
'\OCA\Files_Sharing\API\Server2Server',
'preLoginNameUsedAsUserName',
- array('uid' => &$username)
+ ['uid' => &$username]
);
$user = $this->manager->get($username);
if (is_null($user)) {
// Ignore and use empty string instead
}
- $this->manager->emit('\OC\User', 'preLogin', array($uid, $password));
+ $this->manager->emit('\OC\User', 'preLogin', [$uid, $password]);
$user = $this->manager->get($uid);
if (is_null($user)) {
*/
public function loginWithCookie($uid, $currentToken, $oldSessionId) {
$this->session->regenerateId();
- $this->manager->emit('\OC\User', 'preRememberedLogin', array($uid));
+ $this->manager->emit('\OC\User', 'preRememberedLogin', [$uid]);
$user = $this->manager->get($uid);
if (is_null($user)) {
// user does not exist
public function delete() {
$this->dispatcher->dispatch(IUser::class . '::preDelete', new GenericEvent($this));
if ($this->emitter) {
- $this->emitter->emit('\OC\User', 'preDelete', array($this));
+ $this->emitter->emit('\OC\User', 'preDelete', [$this]);
}
// get the home now because it won't return it after user deletion
$homePath = $this->getHome();
$this->dispatcher->dispatch(IUser::class . '::postDelete', new GenericEvent($this));
if ($this->emitter) {
- $this->emitter->emit('\OC\User', 'postDelete', array($this));
+ $this->emitter->emit('\OC\User', 'postDelete', [$this]);
}
}
return !($result === false);
'recoveryPassword' => $recoveryPassword,
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\User', 'preSetPassword', array($this, $password, $recoveryPassword));
+ $this->emitter->emit('\OC\User', 'preSetPassword', [$this, $password, $recoveryPassword]);
}
if ($this->backend->implementsActions(Backend::SET_PASSWORD)) {
$result = $this->backend->setPassword($this->uid, $password);
'recoveryPassword' => $recoveryPassword,
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\User', 'postSetPassword', array($this, $password, $recoveryPassword));
+ $this->emitter->emit('\OC\User', 'postSetPassword', [$this, $password, $recoveryPassword]);
}
return !($result === false);
} else {
'oldValue' => $oldValue,
]));
if ($this->emitter) {
- $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value, $oldValue));
+ $this->emitter->emit('\OC\User', 'changeUser', [$this, $feature, $value, $oldValue]);
}
}
}
/**
* api actions
*/
- protected static $actions = array();
+ protected static $actions = [];
/**
* respond to a call
* @return string
*/
public static function requestedFormat() {
- $formats = array('json', 'xml');
+ $formats = ['json', 'xml'];
$format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml';
return $format;
* @return string
*/
public static function renderResult($format, $meta, $data) {
- $response = array(
- 'ocs' => array(
+ $response = [
+ 'ocs' => [
'meta' => $meta,
'data' => $data,
- ),
- );
+ ],
+ ];
if ($format == 'json') {
return OC_JSON::encode($response);
}
* @return string
*/
public static function cleanAppId(string $app): string {
- return str_replace(array('\0', '/', '\\', '..'), '', $app);
+ return str_replace(['\0', '/', '\\', '..'], '', $app);
}
/**
foreach ($possibleApps as $possibleApp) {
$version = self::getAppVersionByPath($possibleApp['path'] . '/' . $appId);
if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) {
- $versionToLoad = array(
+ $versionToLoad = [
'dir' => $possibleApp,
'version' => $version,
- );
+ ];
}
}
$app_dir[$appId] = $versionToLoad['dir'];
. ' pass an array with \'limit\' and \'offset\' instead';
throw new \OC\DatabaseException($message);
}
- $stmt = array('sql' => $stmt, 'limit' => null, 'offset' => null);
+ $stmt = ['sql' => $stmt, 'limit' => null, 'offset' => null];
}
if (is_array($stmt)) {
// convert to prepared statement
*/
private $statement = null;
private $isManipulation = false;
- private $lastArguments = array();
+ private $lastArguments = [];
/**
* @param boolean $isManipulation
* pass all other function directly to the \Doctrine\DBAL\Driver\Statement
*/
public function __call($name,$arguments) {
- return call_user_func_array(array($this->statement,$name), $arguments);
+ return call_user_func_array([$this->statement,$name], $arguments);
}
/**
if (!is_array($files)) {
$filename = $dir . '/' . $files;
if (!$view->is_dir($filename)) {
- self::getSingleFile($view, $dir, $files, is_null($params) ? array() : $params);
+ self::getSingleFile($view, $dir, $files, is_null($params) ? [] : $params);
return;
}
}
/* Calculate filesize and number of files */
if ($getType === self::ZIP_FILES) {
- $fileInfos = array();
+ $fileInfos = [];
$fileSize = 0;
foreach ($files as $file) {
$fileInfo = \OC\Files\Filesystem::getFileInfo($dir . '/' . $file);
} elseif ($getType === self::ZIP_DIR) {
$fileInfo = \OC\Files\Filesystem::getFileInfo($dir . '/' . $files);
$fileSize = $fileInfo->getSize();
- $numberOfFiles = self::getNumberOfFiles(array($fileInfo));
+ $numberOfFiles = self::getNumberOfFiles([$fileInfo]);
}
$streamer = new Streamer(\OC::$server->getRequest(), $fileSize, $numberOfFiles);
$minOffset = 0;
$ind = 0;
- $rangeArray = array();
+ $rangeArray = [];
foreach ($rArray as $value) {
$ranges = explode('-', $value);
if ($ranges[1] >= $fileSize) {
$ranges[1] = $fileSize-1;
}
- $rangeArray[$ind++] = array( 'from' => $ranges[0], 'to' => $ranges[1], 'size' => $fileSize );
+ $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $ranges[1], 'size' => $fileSize ];
$minOffset = $ranges[1] + 1;
if ($minOffset >= $fileSize) {
break;
}
elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) {
// case: x-
- $rangeArray[$ind++] = array( 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize );
+ $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize ];
break;
}
elseif (is_numeric($ranges[1])) {
if ($ranges[1] > $fileSize) {
$ranges[1] = $fileSize;
}
- $rangeArray[$ind++] = array( 'from' => $fileSize-$ranges[1], 'to' => $fileSize-1, 'size' => $fileSize );
+ $rangeArray[$ind++] = [ 'from' => $fileSize-$ranges[1], 'to' => $fileSize-1, 'size' => $fileSize ];
break;
}
}
OC_Util::obEnd();
$view->lockFile($filename, ILockingProvider::LOCK_SHARED);
- $rangeArray = array();
+ $rangeArray = [];
if (isset($params['range']) && substr($params['range'], 0, 6) === 'bytes=') {
$rangeArray = self::parseHttpRangeHeader(substr($params['range'], 6), $fileSize);
header_remove('Accept-Ranges');
header_remove('Content-Range');
http_response_code(200);
- self::sendHeaders($filename, $name, array());
+ self::sendHeaders($filename, $name, []);
$view->readfile($filename);
}
}
return (float)$str;
}
- $bytes_array = array(
+ $bytes_array = [
'b' => 1,
'k' => 1024,
'kb' => 1024,
't' => 1024 * 1024 * 1024 * 1024,
'pb' => 1024 * 1024 * 1024 * 1024 * 1024,
'p' => 1024 * 1024 * 1024 * 1024 * 1024,
- );
+ ];
$bytes = (float)$str;
*/
public static function streamCopy($source, $target) {
if (!$source or !$target) {
- return array(0, false);
+ return [0, false];
}
$bufSize = 8192;
$result = true;
break;
}
}
- return array($count, $result);
+ return [$count, $result];
}
/**
*/
public static function mb_array_change_key_case($input, $case = MB_CASE_LOWER, $encoding = 'UTF-8') {
$case = ($case != MB_CASE_UPPER) ? MB_CASE_LOWER : MB_CASE_UPPER;
- $ret = array();
+ $ret = [];
foreach ($input as $k => $v) {
$ret[mb_convert_case($k, $case, $encoding)] = $v;
}
class OC_Hook {
public static $thrownExceptions = [];
- static private $registered = array();
+ static private $registered = [];
/**
* connects a function to a hook
// If we're trying to connect to an emitting class that isn't
// yet registered, register it
if( !array_key_exists($signalClass, self::$registered )) {
- self::$registered[$signalClass] = array();
+ self::$registered[$signalClass] = [];
}
// If we're trying to connect to an emitting method that isn't
// yet registered, register it with the emitting class
if( !array_key_exists( $signalName, self::$registered[$signalClass] )) {
- self::$registered[$signalClass][$signalName] = array();
+ self::$registered[$signalClass][$signalName] = [];
}
// don't connect hooks twice
}
}
// Connect the hook handler to the requested emitter
- self::$registered[$signalClass][$signalName][] = array(
+ self::$registered[$signalClass][$signalName][] = [
"class" => $slotClass,
"name" => $slotName
- );
+ ];
// No chance for failure ;-)
return true;
// Call all slots
foreach( self::$registered[$signalClass][$signalName] as $i ) {
try {
- call_user_func( array( $i["class"], $i["name"] ), $params );
+ call_user_func( [ $i["class"], $i["name"] ], $params );
} catch (Exception $e){
self::$thrownExceptions[] = $e;
\OC::$server->getLogger()->logException($e);
static public function clear($signalClass='', $signalName='') {
if ($signalClass) {
if ($signalName) {
- self::$registered[$signalClass][$signalName]=array();
+ self::$registered[$signalClass][$signalName]=[];
}else{
- self::$registered[$signalClass]=array();
+ self::$registered[$signalClass]=[];
}
}else{
- self::$registered=array();
+ self::$registered=[];
}
}
*/
public function widthTopLeft() {
$o = $this->getOrientation();
- $this->logger->debug('OC_Image->widthTopLeft() Orientation: ' . $o, array('app' => 'core'));
+ $this->logger->debug('OC_Image->widthTopLeft() Orientation: ' . $o, ['app' => 'core']);
switch ($o) {
case -1:
case 1:
*/
public function heightTopLeft() {
$o = $this->getOrientation();
- $this->logger->debug('OC_Image->heightTopLeft() Orientation: ' . $o, array('app' => 'core'));
+ $this->logger->debug('OC_Image->heightTopLeft() Orientation: ' . $o, ['app' => 'core']);
switch ($o) {
case -1:
case 1:
}
if ($filePath === null) {
if ($this->filePath === null) {
- $this->logger->error(__METHOD__ . '(): called with no path.', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): called with no path.', ['app' => 'core']);
return false;
} else {
$filePath = $this->filePath;
}
$isWritable = is_writable(dirname($filePath));
if (!$isWritable) {
- $this->logger->error(__METHOD__ . '(): Directory \'' . dirname($filePath) . '\' is not writable.', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): Directory \'' . dirname($filePath) . '\' is not writable.', ['app' => 'core']);
return false;
} elseif ($isWritable && file_exists($filePath) && !is_writable($filePath)) {
- $this->logger->error(__METHOD__ . '(): File \'' . $filePath . '\' is not writable.', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): File \'' . $filePath . '\' is not writable.', ['app' => 'core']);
return false;
}
}
break;
default:
$res = imagepng($this->resource);
- $this->logger->info('OC_Image->data. Could not guess mime-type, defaulting to png', array('app' => 'core'));
+ $this->logger->info('OC_Image->data. Could not guess mime-type, defaulting to png', ['app' => 'core']);
break;
}
if (!$res) {
- $this->logger->error('OC_Image->data. Error getting image data.', array('app' => 'core'));
+ $this->logger->error('OC_Image->data. Error getting image data.', ['app' => 'core']);
}
return ob_get_clean();
}
}
if ($this->imageType !== IMAGETYPE_JPEG) {
- $this->logger->debug('OC_Image->fixOrientation() Image is not a JPEG.', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Image is not a JPEG.', ['app' => 'core']);
return -1;
}
if (!is_callable('exif_read_data')) {
- $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', ['app' => 'core']);
return -1;
}
if (!$this->valid()) {
- $this->logger->debug('OC_Image->fixOrientation() No image loaded.', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() No image loaded.', ['app' => 'core']);
return -1;
}
if (is_null($this->filePath) || !is_readable($this->filePath)) {
- $this->logger->debug('OC_Image->fixOrientation() No readable file path set.', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() No readable file path set.', ['app' => 'core']);
return -1;
}
$exif = @exif_read_data($this->filePath, 'IFD0');
public function readExif($data) {
if (!is_callable('exif_read_data')) {
- $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Exif module not enabled.', ['app' => 'core']);
return;
}
if (!$this->valid()) {
- $this->logger->debug('OC_Image->fixOrientation() No image loaded.', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() No image loaded.', ['app' => 'core']);
return;
}
*/
public function fixOrientation() {
$o = $this->getOrientation();
- $this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, ['app' => 'core']);
$rotate = 0;
$flip = false;
switch ($o) {
$this->resource = $res;
return true;
} else {
- $this->logger->debug('OC_Image->fixOrientation() Error during alpha-saving', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Error during alpha-saving', ['app' => 'core']);
return false;
}
} else {
- $this->logger->debug('OC_Image->fixOrientation() Error during alpha-blending', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Error during alpha-blending', ['app' => 'core']);
return false;
}
} else {
- $this->logger->debug('OC_Image->fixOrientation() Error during orientation fixing', array('app' => 'core'));
+ $this->logger->debug('OC_Image->fixOrientation() Error during orientation fixing', ['app' => 'core']);
return false;
}
}
imagealphablending($this->resource, true);
imagesavealpha($this->resource, true);
} else {
- $this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, ['app' => 'core']);
}
break;
case IMAGETYPE_JPEG:
if (getimagesize($imagePath) !== false) {
$this->resource = @imagecreatefromjpeg($imagePath);
} else {
- $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, ['app' => 'core']);
}
} else {
- $this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, ['app' => 'core']);
}
break;
case IMAGETYPE_PNG:
imagealphablending($this->resource, true);
imagesavealpha($this->resource, true);
} else {
- $this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, ['app' => 'core']);
}
break;
case IMAGETYPE_XBM:
if (imagetypes() & IMG_XPM) {
$this->resource = @imagecreatefromxbm($imagePath);
} else {
- $this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagePath, array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagePath, ['app' => 'core']);
}
break;
case IMAGETYPE_WBMP:
if (imagetypes() & IMG_WBMP) {
$this->resource = @imagecreatefromwbmp($imagePath);
} else {
- $this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: ' . $imagePath, array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: ' . $imagePath, ['app' => 'core']);
}
break;
case IMAGETYPE_BMP:
// this is mostly file created from encrypted file
$this->resource = imagecreatefromstring(\OC\Files\Filesystem::file_get_contents(\OC\Files\Filesystem::getLocalPath($imagePath)));
$iType = IMAGETYPE_PNG;
- $this->logger->debug('OC_Image->loadFromFile, Default', array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, Default', ['app' => 'core']);
break;
}
if ($this->valid()) {
}
if (!$this->resource) {
- $this->logger->debug('OC_Image->loadFromFile, could not load', array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromFile, could not load', ['app' => 'core']);
return false;
}
return $this->resource;
$this->mimeType = $this->fileInfo->buffer($data);
}
if (!$this->resource) {
- $this->logger->debug('OC_Image->loadFromBase64, could not load', array('app' => 'core'));
+ $this->logger->debug('OC_Image->loadFromBase64, could not load', ['app' => 'core']);
return false;
}
return $this->resource;
*/
private function imagecreatefrombmp($fileName) {
if (!($fh = fopen($fileName, 'rb'))) {
- $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName, array('app' => 'core'));
+ $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName, ['app' => 'core']);
return false;
}
// read file header
// check for bitmap
if ($meta['type'] != 19778) {
fclose($fh);
- $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName . ' is not a bitmap!', array('app' => 'core'));
+ $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName . ' is not a bitmap!', ['app' => 'core']);
return false;
}
// read image header
$meta['imagesize'] = @filesize($fileName) - $meta['offset'];
if ($meta['imagesize'] < 1) {
fclose($fh);
- $this->logger->warning('imagecreatefrombmp: Can not obtain file size of ' . $fileName . ' is not a bitmap!', array('app' => 'core'));
+ $this->logger->warning('imagecreatefrombmp: Can not obtain file size of ' . $fileName . ' is not a bitmap!', ['app' => 'core']);
return false;
}
}
// calculate colors
$meta['colors'] = !$meta['colors'] ? pow(2, $meta['bits']) : $meta['colors'];
// read color palette
- $palette = array();
+ $palette = [];
if ($meta['bits'] < 16) {
$palette = unpack('l' . $meta['colors'], fread($fh, $meta['colors'] * 4));
// in rare cases the color value is signed
fclose($fh);
$this->logger->warning(
'imagecreatefrombmp: imagecreatetruecolor failed for file "' . $fileName . '" with dimensions ' . $meta['width'] . 'x' . $meta['height'],
- array('app' => 'core'));
+ ['app' => 'core']);
return false;
}
case 32:
case 24:
if (!($part = substr($data, $p, 3))) {
- $this->logger->warning($error, array('app' => 'core'));
+ $this->logger->warning($error, ['app' => 'core']);
return $im;
}
$color = @unpack('V', $part . $vide);
case 16:
if (!($part = substr($data, $p, 2))) {
fclose($fh);
- $this->logger->warning($error, array('app' => 'core'));
+ $this->logger->warning($error, ['app' => 'core']);
return $im;
}
$color = @unpack('v', $part);
break;
default:
fclose($fh);
- $this->logger->warning('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', array('app' => 'core'));
+ $this->logger->warning('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', ['app' => 'core']);
return false;
}
imagesetpixel($im, $x, $y, $color[1]);
*/
public function resize($maxSize) {
if (!$this->valid()) {
- $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
return false;
}
$widthOrig = imagesx($this->resource);
*/
public function preciseResize(int $width, int $height): bool {
if (!$this->valid()) {
- $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
return false;
}
$widthOrig = imagesx($this->resource);
$heightOrig = imagesy($this->resource);
$process = imagecreatetruecolor($width, $height);
if ($process === false) {
- $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): Error creating true color image', ['app' => 'core']);
return false;
}
$res = imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig);
if ($res === false) {
- $this->logger->error(__METHOD__ . '(): Error re-sampling process image', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): Error re-sampling process image', ['app' => 'core']);
imagedestroy($process);
return false;
}
*/
public function centerCrop($size = 0) {
if (!$this->valid()) {
- $this->logger->error('OC_Image->centerCrop, No image loaded', array('app' => 'core'));
+ $this->logger->error('OC_Image->centerCrop, No image loaded', ['app' => 'core']);
return false;
}
$widthOrig = imagesx($this->resource);
}
$process = imagecreatetruecolor($targetWidth, $targetHeight);
if ($process == false) {
- $this->logger->error('OC_Image->centerCrop, Error creating true color image', array('app' => 'core'));
+ $this->logger->error('OC_Image->centerCrop, Error creating true color image', ['app' => 'core']);
imagedestroy($process);
return false;
}
imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
if ($process == false) {
- $this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, array('app' => 'core'));
+ $this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, ['app' => 'core']);
imagedestroy($process);
return false;
}
*/
public function crop(int $x, int $y, int $w, int $h): bool {
if (!$this->valid()) {
- $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
return false;
}
$process = imagecreatetruecolor($w, $h);
if ($process == false) {
- $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): Error creating true color image', ['app' => 'core']);
imagedestroy($process);
return false;
}
imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h);
if ($process == false) {
- $this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, ['app' => 'core']);
imagedestroy($process);
return false;
}
*/
public function fitIn($maxWidth, $maxHeight) {
if (!$this->valid()) {
- $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
return false;
}
$widthOrig = imagesx($this->resource);
*/
public function scaleDownToFit($maxWidth, $maxHeight) {
if (!$this->valid()) {
- $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core'));
+ $this->logger->error(__METHOD__ . '(): No image loaded', ['app' => 'core']);
return false;
}
$widthOrig = imagesx($this->resource);
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function imagebmp($im, $fileName = '', $bit = 24, $compression = 0) {
- if (!in_array($bit, array(1, 4, 8, 16, 24, 32))) {
+ if (!in_array($bit, [1, 4, 8, 16, 24, 32])) {
$bit = 24;
} else if ($bit == 32) {
$bit = 24;
public static function checkAppEnabled($app) {
if( !\OC::$server->getAppManager()->isEnabledForUser($app)) {
$l = \OC::$server->getL10N('lib');
- self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' )));
+ self::error([ 'data' => [ 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' ]]);
exit();
}
}
|| $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) {
$l = \OC::$server->getL10N('lib');
http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED);
- self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' )));
+ self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]);
exit();
}
}
if( !\OC::$server->getRequest()->passesCSRFCheck()) {
$l = \OC::$server->getL10N('lib');
- self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' )));
+ self::error([ 'data' => [ 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' ]]);
exit();
}
}
public static function checkAdminUser() {
if( !OC_User::isAdminUser(OC_User::getUser())) {
$l = \OC::$server->getL10N('lib');
- self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' )));
+ self::error([ 'data' => [ 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ]]);
exit();
}
}
* @deprecated Use a AppFramework JSONResponse instead
* @suppress PhanDeprecatedFunction
*/
- public static function error($data = array()) {
+ public static function error($data = []) {
$data['status'] = 'error';
header( 'Content-Type: application/json; charset=utf-8');
echo self::encode($data);
* @deprecated Use a AppFramework JSONResponse instead
* @suppress PhanDeprecatedFunction
*/
- public static function success($data = array()) {
+ public static function success($data = []) {
$data['status'] = 'success';
header( 'Content-Type: application/json; charset=utf-8');
echo self::encode($data);
*/
public static function encode($data) {
if (is_array($data)) {
- array_walk_recursive($data, array('OC_JSON', 'to_string'));
+ array_walk_recursive($data, ['OC_JSON', 'to_string']);
}
return json_encode($data, JSON_HEX_TAG);
}
private $path; // The path to the template
/** @var array */
- private $headers = array(); //custom headers
+ private $headers = []; //custom headers
/** @var string */
protected $app; // app id
$locator = new \OC\Template\TemplateFileLocator( $dirs );
$template = $locator->find($name);
$path = $locator->getPath();
- return array($path, $template);
+ return [$path, $template];
}
/**
* element will be written as empty element. So use "" to get a closing tag.
*/
public function addHeader($tag, $attributes, $text=null) {
- $this->headers[]= array(
+ $this->headers[]= [
'tag' => $tag,
'attributes' => $attributes,
'text' => $text
- );
+ ];
}
/**
* @param array $parameters Parameters for the template
* @return boolean|null
*/
- public static function printUserPage( $application, $name, $parameters = array() ) {
+ public static function printUserPage( $application, $name, $parameters = [] ) {
$content = new OC_Template( $application, $name, "user" );
foreach( $parameters as $key => $value ) {
$content->assign( $key, $value );
* @param array $parameters Parameters for the template
* @return bool
*/
- public static function printAdminPage( $application, $name, $parameters = array() ) {
+ public static function printAdminPage( $application, $name, $parameters = [] ) {
$content = new OC_Template( $application, $name, "admin" );
foreach( $parameters as $key => $value ) {
$content->assign( $key, $value );
* @param array|string $parameters Parameters for the template
* @return bool
*/
- public static function printGuestPage( $application, $name, $parameters = array() ) {
+ public static function printGuestPage( $application, $name, $parameters = [] ) {
$content = new OC_Template($application, $name, $name === 'error' ? $name : 'guest');
foreach( $parameters as $key => $value ) {
$content->assign( $key, $value );
http_response_code($statusCode);
try {
$content = new \OC_Template( '', 'error', 'error', false );
- $errors = array(array('error' => $error_msg, 'hint' => $hint));
+ $errors = [['error' => $error_msg, 'hint' => $hint]];
$content->assign( 'errors', $errors );
$content->printPage();
} catch (\Exception $e) {
if(is_array($file)) {
foreach($file as $f) {
$url = link_to($app, 'component/' . $f . '.html');
- OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url));
+ OC_Util::addHeader('link', ['rel' => 'import', 'href' => $url]);
}
} else {
$url = link_to($app, 'component/' . $file . '.html');
- OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url));
+ OC_Util::addHeader('link', ['rel' => 'import', 'href' => $url]);
}
}
*
* For further information have a look at \OCP\IURLGenerator::linkTo
*/
-function link_to( $app, $file, $args = array() ) {
+function link_to( $app, $file, $args = [] ) {
return \OC::$server->getURLGenerator()->linkTo($app, $file, $args);
}
return $formatter->formatTimeSpan($timestamp, $fromTime);
}
-function html_select_options($options, $selected, $params=array()) {
+function html_select_options($options, $selected, $params=[]) {
if (!is_array($selected)) {
- $selected=array($selected);
+ $selected=[$selected];
}
if (isset($params['combine']) && $params['combine']) {
$options = array_combine($options, $options);
*/
class OC_User {
- private static $_usedBackends = array();
+ private static $_usedBackends = [];
- private static $_setupedBackends = array();
+ private static $_setupedBackends = [];
// bool, stores if a user want to access a resource anonymously, e.g if they open a public link
private static $incognitoMode = false;
* remove all used backends
*/
public static function clearBackends() {
- self::$_usedBackends = array();
+ self::$_usedBackends = [];
\OC::$server->getUserManager()->clearBackends();
}
$uid = $backend->getCurrentUserId();
$run = true;
- OC_Hook::emit("OC_User", "pre_login", array("run" => &$run, "uid" => $uid, 'backend' => $backend));
+ OC_Hook::emit("OC_User", "pre_login", ["run" => &$run, "uid" => $uid, 'backend' => $backend]);
if ($uid) {
if (self::getUser() !== $uid) {
* @deprecated Use \OC::$server->getUserManager->searchDisplayName($search, $limit, $offset) instead.
*/
public static function getDisplayNames($search = '', $limit = null, $offset = null) {
- $displayNames = array();
+ $displayNames = [];
$users = \OC::$server->getUserManager()->searchDisplayName($search, $limit, $offset);
foreach ($users as $user) {
$displayNames[$user->getUID()] = $user->getDisplayName();
use OCP\IUser;
class OC_Util {
- public static $scripts = array();
- public static $styles = array();
- public static $headers = array();
+ public static $scripts = [];
+ public static $styles = [];
+ public static $headers = [];
private static $rootMounted = false;
private static $fsSetup = false;
//first set up the local "root" storage
\OC\Files\Filesystem::initMountManager();
if (!self::$rootMounted) {
- \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', array('datadir' => $configDataDirectory), '/');
+ \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', ['datadir' => $configDataDirectory], '/');
self::$rootMounted = true;
}
}
\OCP\Util::writeLog('files', 'No class given for objectstore', ILogger::ERROR);
}
if (!isset($config['arguments'])) {
- $config['arguments'] = array();
+ $config['arguments'] = [];
}
// instantiate object store implementation
\OCP\Util::writeLog('files', 'No class given for objectstore', ILogger::ERROR);
}
if (!isset($config['arguments'])) {
- $config['arguments'] = array();
+ $config['arguments'] = [];
}
// instantiate object store implementation
}
// load all filesystem apps before, so no setup-hook gets lost
- OC_App::loadApps(array('filesystem'));
+ OC_App::loadApps(['filesystem']);
// the filesystem will finish when $user is not empty,
// mark fs setup here to avoid doing the setup from loading
$user = $storage->getUser()->getUID();
$quota = OC_Util::getUserQuota($user);
if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
- return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files'));
+ return new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => $quota, 'root' => 'files']);
}
}
}
return $storage;
});
- OC_Hook::emit('OC_Filesystem', 'preSetup', array('user' => $user));
+ OC_Hook::emit('OC_Filesystem', 'preSetup', ['user' => $user]);
\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($prevLogging);
//jail the user into his "home" directory
\OC\Files\Filesystem::init($user, $userDir);
- OC_Hook::emit('OC_Filesystem', 'setup', array('user' => $user, 'user_dir' => $userDir));
+ OC_Hook::emit('OC_Filesystem', 'setup', ['user' => $user, 'user_dir' => $userDir]);
}
\OC::$server->getEventLogger()->end('setup_fs');
return true;
* @param bool $prepend prepend the header to the beginning of the list
*/
public static function addHeader($tag, $attributes, $text = null, $prepend = false) {
- $header = array(
+ $header = [
'tag' => $tag,
'attributes' => $attributes,
'text' => $text
- );
+ ];
if ($prepend === true) {
array_unshift (self::$headers, $header);
*/
public static function checkServer(\OC\SystemConfig $config) {
$l = \OC::$server->getL10N('lib');
- $errors = array();
+ $errors = [];
$CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data');
if (!self::needUpgrade($config) && $config->getValue('installed', false)) {
$availableDatabases = $setup->getSupportedDatabases();
if (empty($availableDatabases)) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('No database drivers (sqlite, mysql, or postgresql) installed.'),
'hint' => '' //TODO: sane hint
- );
+ ];
$webServerRestart = true;
}
// Check if config folder is writable.
if(!OC_Helper::isReadOnlyConfigEnabled()) {
if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('Cannot write into "config" directory'),
'hint' => $l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
[ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. '
. $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s',
[ $urlGenerator->linkToDocs('admin-config') ] )
- );
+ ];
}
}
|| !is_writable(OC_App::getInstallPath())
|| !is_readable(OC_App::getInstallPath())
) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('Cannot write into "apps" directory'),
'hint' => $l->t('This can usually be fixed by giving the webserver write access to the apps directory'
. ' or disabling the appstore in the config file. See %s',
[$urlGenerator->linkToDocs('admin-dir_permissions')])
- );
+ ];
}
}
// Create root dir.
}
if (!OC_Util::isSetLocaleWorking()) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('Setting locale to %s failed',
- array('en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/'
- . 'pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8')),
+ ['en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/'
+ . 'pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8']),
'hint' => $l->t('Please install one of these locales on your system and restart your webserver.')
- );
+ ];
}
// Contains the dependencies that should be checked against
// If the dependency is not found the missing module name is shown to the EndUser
// When adding new checks always verify that they pass on Travis as well
// for ini settings, see https://github.com/owncloud/administration/blob/master/travis-ci/custom.ini
- $dependencies = array(
- 'classes' => array(
+ $dependencies = [
+ 'classes' => [
'ZipArchive' => 'zip',
'DOMDocument' => 'dom',
'XMLWriter' => 'XMLWriter',
'XMLReader' => 'XMLReader',
- ),
+ ],
'functions' => [
'xml_parser_create' => 'libxml',
'mb_strcut' => 'mbstring',
'curl_init' => 'cURL',
'openssl_verify' => 'OpenSSL',
],
- 'defined' => array(
+ 'defined' => [
'PDO::ATTR_DRIVER_NAME' => 'PDO'
- ),
+ ],
'ini' => [
'default_charset' => 'UTF-8',
],
- );
- $missingDependencies = array();
+ ];
+ $missingDependencies = [];
$invalidIniSettings = [];
$moduleHint = $l->t('Please ask your server administrator to install the module.');
}
foreach($missingDependencies as $missingDependency) {
- $errors[] = array(
- 'error' => $l->t('PHP module %s not installed.', array($missingDependency)),
+ $errors[] = [
+ 'error' => $l->t('PHP module %s not installed.', [$missingDependency]),
'hint' => $moduleHint
- );
+ ];
$webServerRestart = true;
}
foreach($invalidIniSettings as $setting) {
*/
if($iniWrapper->getBool('mbstring.func_overload') !== null &&
$iniWrapper->getBool('mbstring.func_overload') === true) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('mbstring.func_overload is set to "%s" instead of the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]),
'hint' => $l->t('To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini')
- );
+ ];
}
if(function_exists('xml_parser_create') &&
$minor = floor($version/100);
$version -= ($minor * 100);
$patch = $version;
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]),
'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.')
- );
+ ];
}
if (!self::isAnnotationsWorking()) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible.'),
'hint' => $l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')
- );
+ ];
}
if (!\OC::$CLI && $webServerRestart) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('PHP modules have been installed, but they are still listed as missing?'),
'hint' => $l->t('Please ask your server administrator to restart the web server.')
- );
+ ];
}
$errors = array_merge($errors, self::checkDatabaseVersion());
*/
public static function checkDatabaseVersion() {
$l = \OC::$server->getL10N('lib');
- $errors = array();
+ $errors = [];
$dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite');
if ($dbType === 'pgsql') {
// check PostgreSQL version
if (isset($data['server_version'])) {
$version = $data['server_version'];
if (version_compare($version, '9.0.0', '<')) {
- $errors[] = array(
+ $errors[] = [
'error' => $l->t('PostgreSQL >= 9 required'),
'hint' => $l->t('Please upgrade your database version')
- );
+ ];
}
}
} catch (\Doctrine\DBAL\DBALException $e) {
$this->request = $request;
// default responders
- $this->responders = array(
+ $this->responders = [
'json' => function ($data) {
if ($data instanceof DataResponse) {
$response = new JSONResponse(
}
return new JSONResponse($data);
}
- );
+ ];
}
public $id;
- private $_updatedFields = array();
- private $_fieldTypes = array('id' => 'integer');
+ private $_updatedFields = [];
+ private $_fieldTypes = ['id' => 'integer'];
/**
* @since 7.0.0
*/
public function resetUpdatedFields(){
- $this->_updatedFields = array();
+ $this->_updatedFields = [];
}
/**
* @param array $headers additional key value based headers
* @since 8.0.0
*/
- public function __construct($data=array(), $statusCode=Http::STATUS_OK,
- array $headers=array()) {
+ public function __construct($data=[], $statusCode=Http::STATUS_OK,
+ array $headers=[]) {
parent::__construct();
$this->data = $data;
* @param int $statusCode the Http status code, defaults to 200
* @since 6.0.0
*/
- public function __construct($data=array(), $statusCode=Http::STATUS_OK) {
+ public function __construct($data=[], $statusCode=Http::STATUS_OK) {
parent::__construct();
$this->data = $data;
* Headers - defaults to ['Cache-Control' => 'no-cache, no-store, must-revalidate']
* @var array
*/
- private $headers = array(
+ private $headers = [
'Cache-Control' => 'no-cache, no-store, must-revalidate'
- );
+ ];
/**
* Cookies that will be need to be constructed as header
* @var array
*/
- private $cookies = array();
+ private $cookies = [];
/**
* @since 8.0.0
*/
public function addCookie($name, $value, \DateTime $expireDate = null) {
- $this->cookies[$name] = array('value' => $value, 'expireDate' => $expireDate);
+ $this->cookies[$name] = ['value' => $value, 'expireDate' => $expireDate];
return $this;
}
* @param array $params
* @since 14.0.0
*/
- public function __construct(string $appName, string $templateName, array $params = array()) {
+ public function __construct(string $appName, string $templateName, array $params = []) {
parent::__construct($appName, $templateName, $params, 'public');
\OC_Util::addScript('core', 'public/publicpage');
}
* @param string $renderAs how the page should be rendered, defaults to user
* @since 6.0.0 - parameters $params and $renderAs were added in 7.0.0
*/
- public function __construct($appName, $templateName, array $params=array(),
+ public function __construct($appName, $templateName, array $params=[],
$renderAs='user') {
parent::__construct();
* @return array an array of contacts which are arrays of key-value-pairs
* @since 6.0.0
*/
- public function search($pattern, $searchProperties = array(), $options = array());
+ public function search($pattern, $searchProperties = [], $options = []);
/**
* This function can be used to delete the contact identified by the given id
* @return ICompositeExpression
* @since 8.2.0
*/
- public function addMultiple(array $parts = array());
+ public function addMultiple(array $parts = []);
/**
* Adds an expression to composite expression.
* @return $this This QueryBuilder instance.
* @since 8.2.0
*/
- public function setParameters(array $params, array $types = array());
+ public function setParameters(array $params, array $types = []);
/**
* Gets all defined query parameters for the query being constructed indexed by parameter index or name.
* @since 7.0.0
*/
public function __construct($path, $lockType, $code = 0, \Exception $previous = null) {
- $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', array($lockType, $path));
+ $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', [$lockType, $path]);
parent::__construct($message, $code, $previous);
}
* @return \Doctrine\DBAL\Driver\Statement The executed statement.
* @since 8.0.0
*/
- public function executeQuery($query, array $params = array(), $types = array());
+ public function executeQuery($query, array $params = [], $types = []);
/**
* Executes an SQL INSERT/UPDATE/DELETE query with the given parameters
* @return integer The number of affected rows.
* @since 8.0.0
*/
- public function executeUpdate($query, array $params = array(), array $types = array());
+ public function executeUpdate($query, array $params = [], array $types = []);
/**
* Used to get the id of the just inserted element
* @return array An array of OCP\Search\Result's
* @since 8.0.0
*/
- public function searchPaged($query, array $inApps = array(), $page = 1, $size = 30);
+ public function searchPaged($query, array $inApps = [], $page = 1, $size = 30);
/**
* Register a new search provider to search with
* @param array $options optional
* @since 7.0.0
*/
- public function registerProvider($class, array $options = array());
+ public function registerProvider($class, array $options = []);
/**
* Remove one existing search provider
* @return \OCP\ITags
* @since 6.0.0 - parameter $includeShared and $userId were added in 8.0.0
*/
- public function load($type, $defaultTags = array(), $includeShared = false, $userId = null);
+ public function load($type, $defaultTags = [], $includeShared = false, $userId = null);
}
* @return string the url
* @since 6.0.0
*/
- public function linkToRoute(string $routeName, array $arguments = array()): string;
+ public function linkToRoute(string $routeName, array $arguments = []): string;
/**
* Returns the absolute URL for a route
* @return string the absolute url
* @since 8.0.0
*/
- public function linkToRouteAbsolute(string $routeName, array $arguments = array()): string;
+ public function linkToRouteAbsolute(string $routeName, array $arguments = []): string;
/**
* @param string $routeName
* @return string the url
* @since 6.0.0
*/
- public function linkTo(string $appName, string $file, array $args = array()): string;
+ public function linkTo(string $appName, string $file, array $args = []): string;
/**
* Returns the link to an image, like linkTo but only with prepending img/
* @since 7.0.0
* @deprecated 9.0.0
*/
- public function create($name, $pattern, array $defaults = array(), array $requirements = array());
+ public function create($name, $pattern, array $defaults = [], array $requirements = []);
/**
* Find the route matching $url.
* @since 7.0.0
* @deprecated 9.0.0
*/
- public function generate($name, $parameters = array(), $absolute = false);
+ public function generate($name, $parameters = [], $absolute = false);
}
* @param array $options as key => value
* @since 7.0.0 - default value for $options was added in 8.0.0
*/
- public function __construct($options = array()) {
+ public function __construct($options = []) {
$this->options = $options;
}
* @return bool
* @since 8.0.0
*/
- public function providesResultsFor(array $apps = array()) {
+ public function providesResultsFor(array $apps = []) {
$forApps = $this->getOption(self::OPTION_APPS);
return empty($apps) || empty($forApps) || array_intersect($forApps, $apps);
}
* @since 8.0.0
* @suppress PhanDeprecatedFunction
*/
- public static function html_select_options($options, $selected, $params=array()) {
+ public static function html_select_options($options, $selected, $params=[]) {
return \html_select_options($options, $selected, $params);
}
}
* @return string the url
* @since 4.0.0 - parameter $args was added in 4.5.0
*/
- public static function linkToAbsolute( $app, $file, $args = array() ) {
+ public static function linkToAbsolute( $app, $file, $args = [] ) {
$urlGenerator = \OC::$server->getURLGenerator();
return $urlGenerator->getAbsoluteURL(
$urlGenerator->linkTo($app, $file, $args)
* TODO: write example
* @since 4.0.0
*/
- static public function emitHook($signalclass, $signalname, $params = array()) {
+ static public function emitHook($signalclass, $signalname, $params = []) {
return \OC_Hook::emit($signalclass, $signalname, $params);
}
// Load all required applications
\OC::$REQUESTEDAPP = $app;
- OC_App::loadApps(array('authentication'));
- OC_App::loadApps(array('filesystem', 'logging'));
+ OC_App::loadApps(['authentication']);
+ OC_App::loadApps(['filesystem', 'logging']);
if (!\OC::$server->getAppManager()->isInstalled($app)) {
http_response_code(404);
// Load all required applications
\OC::$REQUESTEDAPP = $app;
- OC_App::loadApps(array('authentication'));
- OC_App::loadApps(array('filesystem', 'logging'));
+ OC_App::loadApps(['authentication']);
+ OC_App::loadApps(['filesystem', 'logging']);
switch ($app) {
case 'core':
$this->l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function($text, $parameters = array()) {
+ ->willReturnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
});
$this->defaults = $this->createMock(Defaults::class);
$this->l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function($text, $parameters = array()) {
+ ->willReturnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
});
$this->defaults = $this->getMockBuilder('\OCP\Defaults')
$this->urlGenerator
->expects($this->once())
->method('linkToRouteAbsolute')
- ->with('core.lost.setPassword', array('userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword'))
+ ->with('core.lost.setPassword', ['userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword'])
->willReturn('https://example.tld/index.php/lostpassword/');
$this->initialStateService->expects($this->at(0))
$this->userManager
->expects($this->any())
->method('userExists')
- ->willReturnMap(array(
- array(true, $existingUser),
- array(false, $nonExistingUser)
- ));
+ ->willReturnMap([
+ [true, $existingUser],
+ [false, $nonExistingUser]
+ ]);
$this->logger->expects($this->exactly(0))
->method('logException');
$this->urlGenerator
->expects($this->once())
->method('linkToRouteAbsolute')
- ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'))
+ ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'])
->willReturn('https://example.tld/index.php/lostpassword/');
$message = $this->getMockBuilder('\OC\Mail\Message')
->disableOriginalConstructor()->getMock();
$this->urlGenerator
->expects($this->once())
->method('linkToRouteAbsolute')
- ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'))
+ ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'])
->willReturn('https://example.tld/index.php/lostpassword/');
$message = $this->getMockBuilder('\OC\Mail\Message')
->disableOriginalConstructor()->getMock();
$this->urlGenerator
->expects($this->once())
->method('linkToRouteAbsolute')
- ->with('core.lost.resetform', array('userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'))
+ ->with('core.lost.resetform', ['userId' => 'ExistingUser', 'token' => 'ThisIsMaybeANotSoSecretToken!'])
->willReturn('https://example.tld/index.php/lostpassword/');
$message = $this->createMock(Message::class);
$message
)->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword');
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
- $expectedResponse = array('status' => 'error', 'msg' => '');
+ $expectedResponse = ['status' => 'error', 'msg' => ''];
$this->assertSame($expectedResponse, $response);
}
)->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword');
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', true);
- $expectedResponse = array('user' => 'ValidTokenUser', 'status' => 'success');
+ $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
$this->assertSame($expectedResponse, $response);
}
)->willReturn('12345:TheOnlyAndOnlyOneTokenToResetThePassword');
$response = $this->lostController->setPassword('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser', 'NewPassword', false);
- $expectedResponse = array('user' => 'ValidTokenUser', 'status' => 'success');
+ $expectedResponse = ['user' => 'ValidTokenUser', 'status' => 'success'];
$this->assertSame($expectedResponse, $response);
}
list($major, $minor, $micro) = \OCP\Util::getVersion();
$result = [];
- $result['version'] = array(
+ $result['version'] = [
'major' => $major,
'minor' => $minor,
'micro' => $micro,
'string' => \OC_Util::getVersionString(),
'edition' => '',
'extendedSupport' => false
- );
+ ];
$capabilities = [
'foo' => 'bar',
list($major, $minor, $micro) = \OCP\Util::getVersion();
$result = [];
- $result['version'] = array(
+ $result['version'] = [
'major' => $major,
'minor' => $minor,
'micro' => $micro,
'string' => \OC_Util::getVersionString(),
'edition' => '',
'extendedSupport' => false
- );
+ ];
$capabilities = [
'foo' => 'bar',
* @BeforeScenario
*/
public function initializeFileListAncestors() {
- $this->fileListAncestorsByActor = array();
+ $this->fileListAncestorsByActor = [];
$this->fileListAncestor = null;
}
* are used in an "I act as XXX" step.
*/
public function initializeActors() {
- $this->actors = array();
- $this->sharedNotebook = array();
+ $this->actors = [];
+ $this->sharedNotebook = [];
$this->actors["default"] = new Actor("default", $this->getSession(), $this->getMinkParameter("base_url"), $this->sharedNotebook);
$this->actors["default"]->setFindTimeoutMultiplier($this->actorTimeoutMultiplier);
* @return LocatorBuilderSecondStep
*/
public function id($value) {
- return $this->customSelector("named_exact", array("id", $value));
+ return $this->customSelector("named_exact", ["id", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function idOrName($value) {
- return $this->customSelector("named_exact", array("id_or_name", $value));
+ return $this->customSelector("named_exact", ["id_or_name", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function link($value) {
- return $this->customSelector("named_exact", array("link", $value));
+ return $this->customSelector("named_exact", ["link", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function button($value) {
- return $this->customSelector("named_exact", array("button", $value));
+ return $this->customSelector("named_exact", ["button", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function linkOrButton($value) {
- return $this->customSelector("named_exact", array("link_or_button", $value));
+ return $this->customSelector("named_exact", ["link_or_button", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function field($value) {
- return $this->customSelector("named_exact", array("field", $value));
+ return $this->customSelector("named_exact", ["field", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function selectField($value) {
- return $this->customSelector("named_exact", array("select", $value));
+ return $this->customSelector("named_exact", ["select", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function checkbox($value) {
- return $this->customSelector("named_exact", array("checkbox", $value));
+ return $this->customSelector("named_exact", ["checkbox", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function radioButton($value) {
- return $this->customSelector("named_exact", array("radio", $value));
+ return $this->customSelector("named_exact", ["radio", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function fileInput($value) {
- return $this->customSelector("named_exact", array("file", $value));
+ return $this->customSelector("named_exact", ["file", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function optionGroup($value) {
- return $this->customSelector("named_exact", array("optgroup", $value));
+ return $this->customSelector("named_exact", ["optgroup", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function option($value) {
- return $this->customSelector("named_exact", array("option", $value));
+ return $this->customSelector("named_exact", ["option", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function fieldSet($value) {
- return $this->customSelector("named_exact", array("fieldset", $value));
+ return $this->customSelector("named_exact", ["fieldset", $value]);
}
/**
* @return LocatorBuilderSecondStep
*/
public function table($value) {
- return $this->customSelector("named_exact", array("table", $value));
+ return $this->customSelector("named_exact", ["table", $value]);
}
}
$nextcloudTestServerHelperClass = new ReflectionClass($nextcloudTestServerHelper);
if ($nextcloudTestServerHelperParameters === null) {
- $nextcloudTestServerHelperParameters = array();
+ $nextcloudTestServerHelperParameters = [];
}
$this->nextcloudTestServerHelper = $nextcloudTestServerHelperClass->newInstanceArgs($nextcloudTestServerHelperParameters);
}
function getSubclasses($parentClassName) {
- $classes = array();
+ $classes = [];
foreach (get_declared_classes() as $className) {
if (is_subclass_of($className, $parentClassName))
$classes[] = $className;
<?php
-$CONFIG = array(
+$CONFIG = [
'mysql.utf8mb4' => true,
-);
+];
$this->connection->executeUpdate(
'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
'`configkey`, `configvalue`) VALUES (?, ?, ?, ?)',
- array('userDelete', 'appDelete', 'keyDelete', 'valueDelete')
+ ['userDelete', 'appDelete', 'keyDelete', 'valueDelete']
);
$config->deleteUserValue('userDelete', 'appDelete', 'keyDelete');
$result = $this->connection->executeQuery(
'SELECT COUNT(*) AS `count` FROM `*PREFIX*preferences` WHERE `userid` = ?',
- array('userDelete')
+ ['userDelete']
)->fetch();
$actualCount = $result['count'];
$config->setUserValue('userSet', 'appSet', 'keySet', 'valueSet');
- $result = $this->connection->executeQuery($selectAllSQL, array('userSet'))->fetchAll();
+ $result = $this->connection->executeQuery($selectAllSQL, ['userSet'])->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userSet',
'appid' => 'appSet',
'configkey' => 'keySet',
'configvalue' => 'valueSet'
- ), $result[0]);
+ ], $result[0]);
// test if the method overwrites existing database entries
$config->setUserValue('userSet', 'appSet', 'keySet', 'valueSet2');
- $result = $this->connection->executeQuery($selectAllSQL, array('userSet'))->fetchAll();
+ $result = $this->connection->executeQuery($selectAllSQL, ['userSet'])->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userSet',
'appid' => 'appSet',
'configkey' => 'keySet',
'configvalue' => 'valueSet2'
- ), $result[0]);
+ ], $result[0]);
// cleanup - it therefore relies on the successful execution of the previous test
$config->deleteUserValue('userSet', 'appSet', 'keySet');
$config->setUserValue('userPreCond', 'appPreCond', 'keyPreCond', 'valuePreCond');
- $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond'))->fetchAll();
+ $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond'])->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userPreCond',
'appid' => 'appPreCond',
'configkey' => 'keyPreCond',
'configvalue' => 'valuePreCond'
- ), $result[0]);
+ ], $result[0]);
// test if the method overwrites existing database entries with valid precond
$config->setUserValue('userPreCond', 'appPreCond', 'keyPreCond', 'valuePreCond2', 'valuePreCond');
- $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond'))->fetchAll();
+ $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond'])->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userPreCond',
'appid' => 'appPreCond',
'configkey' => 'keyPreCond',
'configvalue' => 'valuePreCond2'
- ), $result[0]);
+ ], $result[0]);
// cleanup
$config->deleteUserValue('userPreCond', 'appPreCond', 'keyPreCond');
$config->setUserValue('userPreCond1', 'appPreCond', 'keyPreCond', 'valuePreCond');
- $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond1'))->fetchAll();
+ $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond1'])->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userPreCond1',
'appid' => 'appPreCond',
'configkey' => 'keyPreCond',
'configvalue' => 'valuePreCond'
- ), $result[0]);
+ ], $result[0]);
// test if the method overwrites existing database entries with valid precond
$config->setUserValue('userPreCond1', 'appPreCond', 'keyPreCond', 'valuePreCond2', 'valuePreCond3');
- $result = $this->connection->executeQuery($selectAllSQL, array('userPreCond1'))->fetchAll();
+ $result = $this->connection->executeQuery($selectAllSQL, ['userPreCond1'])->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userPreCond1',
'appid' => 'appPreCond',
'configkey' => 'keyPreCond',
'configvalue' => 'valuePreCond'
- ), $result[0]);
+ ], $result[0]);
// cleanup
$config->deleteUserValue('userPreCond1', 'appPreCond', 'keyPreCond');
->method('executeQuery')
->with($this->equalTo('SELECT `configvalue` FROM `*PREFIX*preferences` '.
'WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?'),
- $this->equalTo(array('userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged')))
+ $this->equalTo(['userSetUnchanged', 'appSetUnchanged', 'keySetUnchanged']))
->willReturn($resultMock);
$connectionMock->expects($this->never())
->method('executeUpdate');
$result = $this->connection->executeQuery(
'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?',
- array('userGet')
+ ['userGet']
)->fetchAll();
$this->assertEquals(1, count($result));
- $this->assertEquals(array(
+ $this->assertEquals([
'userid' => 'userGet',
'appid' => 'appGet',
'configkey' => 'keyGet',
'configvalue' => 'valueGet'
- ), $result[0]);
+ ], $result[0]);
// drop data from database - but the config option should be cached in the config object
- $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?', array('userGet'));
+ $this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences` WHERE `userid` = ?', ['userGet']);
// testing the caching mechanism
$value = $config->getUserValue('userGet', 'appGet', 'keyGet');
$result = $this->connection->executeQuery(
'SELECT `userid`, `appid`, `configkey`, `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?',
- array('userGet')
+ ['userGet']
)->fetchAll();
$this->assertEquals(0, count($result));
$config = $this->getConfig();
// preparation - add something to the database
- $data = array(
- array('userFetch', 'appFetch1', 'keyFetch1', 'value1'),
- array('userFetch', 'appFetch1', 'keyFetch2', 'value2'),
- array('userFetch', 'appFetch2', 'keyFetch3', 'value3'),
- array('userFetch', 'appFetch1', 'keyFetch4', 'value4'),
- array('userFetch', 'appFetch4', 'keyFetch1', 'value5'),
- array('userFetch', 'appFetch5', 'keyFetch1', 'value6'),
- array('userFetch2', 'appFetch', 'keyFetch1', 'value7')
- );
+ $data = [
+ ['userFetch', 'appFetch1', 'keyFetch1', 'value1'],
+ ['userFetch', 'appFetch1', 'keyFetch2', 'value2'],
+ ['userFetch', 'appFetch2', 'keyFetch3', 'value3'],
+ ['userFetch', 'appFetch1', 'keyFetch4', 'value4'],
+ ['userFetch', 'appFetch4', 'keyFetch1', 'value5'],
+ ['userFetch', 'appFetch5', 'keyFetch1', 'value6'],
+ ['userFetch2', 'appFetch', 'keyFetch1', 'value7']
+ ];
foreach ($data as $entry) {
$this->connection->executeUpdate(
'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
}
$value = $config->getUserKeys('userFetch', 'appFetch1');
- $this->assertEquals(array('keyFetch1', 'keyFetch2', 'keyFetch4'), $value);
+ $this->assertEquals(['keyFetch1', 'keyFetch2', 'keyFetch4'], $value);
$value = $config->getUserKeys('userFetch2', 'appFetch');
- $this->assertEquals(array('keyFetch1'), $value);
+ $this->assertEquals(['keyFetch1'], $value);
// cleanup
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
$config = $this->getConfig();
// preparation - add something to the database
- $data = array(
- array('userFetch1', 'appFetch2', 'keyFetch1', 'value1'),
- array('userFetch2', 'appFetch2', 'keyFetch1', 'value2'),
- array('userFetch3', 'appFetch2', 'keyFetch1', 3),
- array('userFetch4', 'appFetch2', 'keyFetch1', 'value4'),
- array('userFetch5', 'appFetch2', 'keyFetch1', 'value5'),
- array('userFetch6', 'appFetch2', 'keyFetch1', 'value6'),
- array('userFetch7', 'appFetch2', 'keyFetch1', 'value7')
- );
+ $data = [
+ ['userFetch1', 'appFetch2', 'keyFetch1', 'value1'],
+ ['userFetch2', 'appFetch2', 'keyFetch1', 'value2'],
+ ['userFetch3', 'appFetch2', 'keyFetch1', 3],
+ ['userFetch4', 'appFetch2', 'keyFetch1', 'value4'],
+ ['userFetch5', 'appFetch2', 'keyFetch1', 'value5'],
+ ['userFetch6', 'appFetch2', 'keyFetch1', 'value6'],
+ ['userFetch7', 'appFetch2', 'keyFetch1', 'value7']
+ ];
foreach ($data as $entry) {
$this->connection->executeUpdate(
'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
}
$value = $config->getUserValueForUsers('appFetch2', 'keyFetch1',
- array('userFetch1', 'userFetch2', 'userFetch3', 'userFetch5'));
- $this->assertEquals(array(
+ ['userFetch1', 'userFetch2', 'userFetch3', 'userFetch5']);
+ $this->assertEquals([
'userFetch1' => 'value1',
'userFetch2' => 'value2',
'userFetch3' => 3,
'userFetch5' => 'value5'
- ), $value);
+ ], $value);
$value = $config->getUserValueForUsers('appFetch2', 'keyFetch1',
- array('userFetch1', 'userFetch4', 'userFetch9'));
- $this->assertEquals(array(
+ ['userFetch1', 'userFetch4', 'userFetch9']);
+ $this->assertEquals([
'userFetch1' => 'value1',
'userFetch4' => 'value4'
- ), $value, 'userFetch9 is an non-existent user and should not be shown.');
+ ], $value, 'userFetch9 is an non-existent user and should not be shown.');
// cleanup
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
$config = $this->getConfig();
// preparation - add something to the database
- $data = array(
- array('userFetch3', 'appFetch1', 'keyFetch1', 'value1'),
- array('userFetch3', 'appFetch1', 'keyFetch2', 'value2'),
- array('userFetch3', 'appFetch2', 'keyFetch3', 'value3'),
- array('userFetch3', 'appFetch1', 'keyFetch4', 'value4'),
- array('userFetch3', 'appFetch4', 'keyFetch1', 'value5'),
- array('userFetch3', 'appFetch5', 'keyFetch1', 'value6'),
- array('userFetch4', 'appFetch2', 'keyFetch1', 'value7')
- );
+ $data = [
+ ['userFetch3', 'appFetch1', 'keyFetch1', 'value1'],
+ ['userFetch3', 'appFetch1', 'keyFetch2', 'value2'],
+ ['userFetch3', 'appFetch2', 'keyFetch3', 'value3'],
+ ['userFetch3', 'appFetch1', 'keyFetch4', 'value4'],
+ ['userFetch3', 'appFetch4', 'keyFetch1', 'value5'],
+ ['userFetch3', 'appFetch5', 'keyFetch1', 'value6'],
+ ['userFetch4', 'appFetch2', 'keyFetch1', 'value7']
+ ];
foreach ($data as $entry) {
$this->connection->executeUpdate(
'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
$config = $this->getConfig();
// preparation - add something to the database
- $data = array(
- array('userFetch5', 'appFetch1', 'keyFetch1', 'value1'),
- array('userFetch5', 'appFetch1', 'keyFetch2', 'value2'),
- array('userFetch5', 'appFetch2', 'keyFetch3', 'value3'),
- array('userFetch5', 'appFetch1', 'keyFetch4', 'value4'),
- array('userFetch5', 'appFetch4', 'keyFetch1', 'value5'),
- array('userFetch5', 'appFetch5', 'keyFetch1', 'value6'),
- array('userFetch6', 'appFetch2', 'keyFetch1', 'value7')
- );
+ $data = [
+ ['userFetch5', 'appFetch1', 'keyFetch1', 'value1'],
+ ['userFetch5', 'appFetch1', 'keyFetch2', 'value2'],
+ ['userFetch5', 'appFetch2', 'keyFetch3', 'value3'],
+ ['userFetch5', 'appFetch1', 'keyFetch4', 'value4'],
+ ['userFetch5', 'appFetch4', 'keyFetch1', 'value5'],
+ ['userFetch5', 'appFetch5', 'keyFetch1', 'value6'],
+ ['userFetch6', 'appFetch2', 'keyFetch1', 'value7']
+ ];
foreach ($data as $entry) {
$this->connection->executeUpdate(
'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
$config = $this->getConfig($systemConfig);
// preparation - add something to the database
- $data = array(
- array('user1', 'appFetch9', 'keyFetch9', 'value9'),
- array('user2', 'appFetch9', 'keyFetch9', 'value9'),
- array('user3', 'appFetch9', 'keyFetch9', 'value8'),
- array('user4', 'appFetch9', 'keyFetch8', 'value9'),
- array('user5', 'appFetch8', 'keyFetch9', 'value9'),
- array('user6', 'appFetch9', 'keyFetch9', 'value9'),
- );
+ $data = [
+ ['user1', 'appFetch9', 'keyFetch9', 'value9'],
+ ['user2', 'appFetch9', 'keyFetch9', 'value9'],
+ ['user3', 'appFetch9', 'keyFetch9', 'value8'],
+ ['user4', 'appFetch9', 'keyFetch8', 'value9'],
+ ['user5', 'appFetch8', 'keyFetch9', 'value9'],
+ ['user6', 'appFetch9', 'keyFetch9', 'value9'],
+ ];
foreach ($data as $entry) {
$this->connection->executeUpdate(
'INSERT INTO `*PREFIX*preferences` (`userid`, `appid`, ' .
}
$value = $config->getUsersForUserValue('appFetch9', 'keyFetch9', 'value9');
- $this->assertEquals(array('user1', 'user2', 'user6'), $value);
+ $this->assertEquals(['user1', 'user2', 'user6'], $value);
// cleanup
$this->connection->executeUpdate('DELETE FROM `*PREFIX*preferences`');
* @return AppConfig|MockObject
*/
protected function getAppConfig() {
- $appConfig = array();
+ $appConfig = [];
$config = $this->createMock(AppConfig::class);
$config->expects($this->any())
->method('setValue')
->willReturnCallback(function ($app, $key, $value) use (&$appConfig) {
if (!isset($appConfig[$app])) {
- $appConfig[$app] = array();
+ $appConfig[$app] = [];
}
$appConfig[$app][$key] = $value;
});
if ($app) {
return $appConfig[$app];
} else {
- $values = array();
+ $values = [];
foreach ($appConfig as $appid => $appData) {
if (isset($appData[$key])) {
$values[$appid] = $appData[$key];
$this->groupManager->expects($this->once())
->method('getUserGroupIds')
->with($user)
- ->willReturn(array('foo', 'bar'));
+ ->willReturn(['foo', 'bar']);
$this->appConfig->setValue('test', 'enabled', '["foo"]');
$this->assertTrue($this->manager->isEnabledForUser('test', $user));
$this->groupManager->expects($this->once())
->method('getUserGroupIds')
->with($user)
- ->willReturn(array('bar'));
+ ->willReturn(['bar']);
$this->appConfig->setValue('test', 'enabled', '["foo"]');
$this->assertFalse($this->manager->isEnabledForUser('test', $user));
$this->groupManager->expects($this->once())
->method('getUserGroupIds')
->with($user)
- ->willReturn(array('foo', 'bar'));
+ ->willReturn(['foo', 'bar']);
$this->appConfig->setValue('test', 'enabled', '["foo"]');
$this->assertTrue($this->manager->isEnabledForUser('test'));
$this->groupManager->expects($this->any())
->method('getUserGroupIds')
->with($user)
- ->willReturn(array('foo', 'bar'));
+ ->willReturn(['foo', 'bar']);
$this->appConfig->setValue('test1', 'enabled', 'yes');
$this->appConfig->setValue('test2', 'enabled', 'no');
static $responseJson = <<<'EOD'
[{"id":"direct_menu","categories":["customization"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/juliushaertl/direct_menu/issues","website":"","created":"2016-10-01T09:16:06.030994Z","lastModified":"2016-10-06T14:01:05.584192Z","releases":[{"version":"0.9.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/juliushaertl/direct_menu/releases/download/v0.9.2/direct_menu.tar.gz","created":"2016-10-06T14:01:05.578297Z","licenses":["agpl"],"lastModified":"2016-10-06T14:01:05.643813Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"ERBS9G5bZ3vwCizz2Ht5DehsVJmb63bzF3aYcH7xjbDVMPagOFWdUAiLDwTeZR1n\ni4gdZ73J/IjHQQJoOPwtCjgbZgLPFqL5x13CLUO9mb/33dZe/+gqEDc/3AuJ4TlA\nXUdLxHRb1bwIlJOwuSr/E24452VG20WUhLXBoM0Zm7WcMxvJWo2zAWnuqnLX3dy9\ncPB4PX+6JU2lUMINj8OYQmM1QnqvjG8YV0cYHbBbnSicOGwXEnni7mojsC8T0cn7\nYEJ2O2iO9hh3fvFEXUzDcL7tDQ5bZqm63Oa991bsAJxFo/RbzeJRh//DcOrd8Ufn\nu2SqRhwybS8j4YvfjAL9RPdRfPLwf6X2gx/Y6QFrKHH0QMI/9J/ZFyoUQcqKbsHV\n85O+yuWoqVmza71tkp4n9PuMdprCinaVvHbHbNGUf2SIh9BWuEQuVvvnvB+ZW8XY\n+Cl+unzk3WgOgT0iY3uEmsQcrLIo4DSKhcNgD1NS13fR/JTSavvmOqBarUMFZfVC\nbkR1DTBCyDjdpNBidpa3/26675dz5IT5Zedp4BBBREQzX08cIhJx5mgqDdX3CU09\nuWtzoaLi71/1BWTFAN+Y9VyfZ8/Z3Pg3vKedRJ565mztIj0geL3riEsC5YnPS0+C\n+a3B9sDiiOa101EORzX3lrPqL7reEPdCxrIwN+hKFBQ=","translations":{}}],"screenshots":[{"url":"https://bitgrid.net/~jus/direct_menu_nc.png"}],"translations":{"en":{"name":"Direct Menu","summary":"Provide easy access to all apps in the header.","description":"Provide easy access to all apps in the header."}},"isFeatured":false,"authors":[{"name":"Julius Härtl","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEBjCCAu4CAhADMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE0MTI1MDU0WhcNMjYxMjIxMTI1MDU0WjAWMRQwEgYD\r\nVQQDDAtkaXJlY3RfbWVudTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB\r\nAMkzWsAkKP/40ktvJMpnr0IJNVoPOR0hvh24igcDskL1WKiD2eiRUenj5LE0Nvn+\r\nsiGmWsAqRVpdiz+Y8ghQqQMzKi43IrRN0AxlCrHWrSqBZT3wIAUcFz4RzEoFxc1N\r\nUZzWma6ljukGnvt4V1ZyT+H/cjqxUkBhh/y9SS0jUen1a1grND6Rw54X46V2dlCu\r\nFH+pLsfPJJGw+QLeTGHn7dqdv18cYMAlWDCzPixVnNiCXHZcUtKMmstU2xU4R2e6\r\nzimp2rgkE4TNHrafpjH8xGdNi2FG5Dmokob/L5Q2r8jyNaW7UsFfrvLTRj371b3/\r\n2FhhxoGUvDzaG2An02Exwm52LJfdTVMHAMPZub5poHfy5vAEdZGPQ/m02l8ZK/Y2\r\n7yT807GlfPMXfdfjCxR6wNtmv7rvBDdrUZmIRNJfpFSdvlH/+MOTWnabyfQv2K4Q\r\nBIwltX6Elh0lh4ntvt1ZVtvFv+PL1Dc7QLV+w19+/LJA0mnsh7GIFYKFlbA65gA0\r\nc/w+uqDy0+5MxkR9WGPpd79KRA1tKWTis4Ny1lApK5y3zIsVGa3DfBHXcwqkWHbV\r\nwIpyuyyDsFtC1b9LTFONX7iU9cbNk5C5GTM331MdA2kLcD/D5k42GNTBSca7MkPx\r\nFx/ETSn0Ct167el30symf2AxvXjw+mBYPN71rVTMDwe9AgMBAAEwDQYJKoZIhvcN\r\nAQELBQADggEBAC0fJKnbEhXA8M283jA9GxABxLyTBcQyVVNnz2L/bYYNi81Y9iZv\r\n+U0S3qaIfoqNcV9FTKAutbsKvWyolnI7MRRK6feNuFfoP2jKubM1CnawpyT/RF2Q\r\ne/zxnB1EmeI2X5D2xceJDLB7Fy5W0EGrLixRIdFaSUommWFUm9E2hSIaNlziSBdc\r\n1J/mOQeNYO5zg5ouEt1rzQW4Mhh1I2uNQmGe4ip+Jl/2LAv3FZuu4NrSEcoXH3ro\r\nG2dF9Gtu4GiQ5fuaJknaxlgXHovfqeZwZJX9o4M+Ug81AqiY7XjdiaCPdh0Tthcx\r\n2OmWZo7UBREWenjKyFZZ/iKoqH5sdenBtpo=\r\n-----END CERTIFICATE-----"},{"id":"apporder","categories":["customization"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/juliushaertl/apporder/issues","website":"","created":"2016-10-01T09:16:47.111889Z","lastModified":"2016-10-12T19:50:16.038821Z","releases":[{"version":"0.3.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/juliushaertl/apporder/releases/download/0.3.3/apporder.tar.gz","created":"2016-10-12T19:14:10.802359Z","licenses":["agpl"],"lastModified":"2016-10-12T19:50:16.104357Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"nhlT9lhrmBxIsqh/e3RLm2NDw/U8ZvvoMyYQTLMM3H19DQmVcPYPYC9QWVTsowUzXblVaOXVGylbpKma9yOlOAqJtF3qyXecLl4+tA/Awb6BBhKPgHFdcLDAL5yy1K7/uei3SgEojMlJoI9vEK5I1C5YTh43yNH+//Im6MAuNYFUTlMXK426zdOe6ogpCI5GlYdXopqYANxcpT+WXWET6DDSM5Ev+MYwMcSAY4r8+tvARRU4ZAenRgjkBT6R5z6cD76emRax14tbV6vkjjwRcO+dQtM0tFPbd+5fsNInbauv50VzIMgjA6RnKTOI17gRsSdGlsV4vZn2aIxEPWauu6T/UohMvAE9HMn13vtbpPBSFwJAktj6yHASYGzupNQLprA0+OdyALoLZPpQAKNEXA42a4EVISBKu0EmduHJlUPeqhnIGkkGgVNWS8AWqzP2nFoPdXBgUWateiMcBTHxgEKDac5YmNc9lsXpzf1OxBaXHBhGYKuXPwIfyH3jTWb1OdwixJEuRe9dl63T9qOTRre8QWns/bMqKLibGfMtFhVB21ARJayBuX70eVvabG/2N7Y5t1zUlFygIKu51tvo3AVCRDdRrFWDvkAjxzIz5FIdALVZ+DReFYu/r4WF/w3V9rInFuEDSwb/OH4r8sQycs07tSlMyA74Y3FpjKTBxso=","translations":{}},{"version":"0.3.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/juliushaertl/apporder/releases/download/0.3.2/apporder.tar.gz","created":"2016-10-06T14:00:51.532409Z","licenses":["agpl"],"lastModified":"2016-10-06T14:00:51.598455Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"gRVFOtj9414ZNSdRH/qNB2SwVZUQh+gaFnNLFjjXjJ1MdRMCISzvwb+QU1qYuK/y\nuL8K0pn1+fFQf8A3VsC2pb6yaLQ5U9C3Guf886Flf4qtYw1P8UWRA9yOJ+6Md+PH\n6pTEiDIdm4xbmM0KkBhsE5kL8dvLIq4EwwcAh2Qq8fjytzAk1YiP+KrTaYrVwskM\nDmm0lgP4NVnjRBTX9myW6tr6N3w0tq2jJ/+a/vEDJv+5ozKJx8N5gbJNdrtI4k7I\nyaQNWJ7cngtAHmUREeoBggV5uJayDceu83PPQR6N9/WVyNyZjw1Q8/Q6e/NyiXT2\no8mGv5tHl3DBOVuv8v7gBQgDh6ppp12M81aiCZymn2XIgjw50VQ+K15KHnLHuFFw\nwuHZVcoQ7b6oR4K4TURSfPFUeNgGS4R9v6gjg1RUcSm1Pnryc6pYnh10AUY8dk6q\n1CZ6Upt6SScP2ZEGWsFwVjjQhY/ZJmNfnhaGoFOZ5L9CnzyNCkGXFg0rL36i6djb\naqFy/z+Brnklng5ct6XWoP7uDt5BaHznQj1NHSfHn0GUQ0N968zWm9vQvy+dyXyC\nxR7vKeu2ppZ2ydoeQ9CVwfhOEsGs5OvrpapQdh9KbUHcX7b7ql01J7/P6dFuNuHe\n+7/y4ex3sEVg5YBmDtF8iZ6d7zsHd6peL1s1EsLnenQ=","translations":{}}],"screenshots":[{"url":"https://bitgrid.net/~jus/apporder-nc.gif"}],"translations":{"en":{"name":"AppOrder","summary":"Sort apps in the menu with drag and drop","description":"\nEnable sorting for icons inside the app menu. The order will be saved for each\nuser individually. Administrators can define a custom default order.\nAppOrder works with the default owncloud menu as well as with the direct_menu\napp.\n\n## Set a default order for all new users\n\nGo to the Admin settings > Additional settings and drag the icons under App order.\n\n## Use first app as default app\n\nYou can easily let Nextcloud redirect your user to the first app in their\npersonal order by changing the following parameter in your config/config.php:\n\n'defaultapp' => 'apporder',\n\nUsers will now get redirected to the first app of the default order or to the\nfirst app of the user order.\n "}},"isFeatured":false,"authors":[{"name":"Julius Härtl","mail":"jus@bitgrid.net","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhAEMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE0MTI1MjQ4WhcNMjYxMjIxMTI1MjQ4WjATMREwDwYD\r\nVQQDDAhhcHBvcmRlcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKVK\r\nKn5jivCu+eRfe5BECjDOzNaGHlpiegb49Hf4nh0W7DqcoLHip5c1O2BcEYdH6rkw\r\n20WclvjoQpgavG5aFXzXzur6eKTT5TpgY5oZTLoWjbx4e+fKdhyDPTpqNZzs1pxz\r\nsZLDL/ElpbSErE0s+QK/pzP11WNPylAkI9AKSyDMO3Mbllg8I8Bt+bT7LJKYOO/T\r\nLhv9m0anLZ4HrdfimhVIoMiu3RpyRigk8titXZA94+F8Fbf7ZQ9f14Y/v3+rfJFQ\r\nii9cDoox5uUrjplH2LrMr5BodfCfydLu4uVpPWYkdccgvcZ1sugjvNXyCQgdzQDK\r\npOpiwVkkiQFaQJYbGSDblFWPl/cLtA/P/qS7s8tWyTQuc1rYlEpCHG/fG8ZFkSVK\r\n9eCMGxK908VB4IU2DHZHOHi7JvtOz8X/Ak6pIIFdARoW3rfKlrz6DD4T9jEgYq0n\r\nRe7YwCKEIU3liZJ+qG6LCa+rMlp/7sCzAmqBhaaaJyX4nnZCa2Q2cNZpItEAdwVc\r\nqxLYL1FiNFMSeeYhzJJoq5iMC3vp2LScUJJNoXZj9zv+uqTNGHr+bimchR2rHUBo\r\nPzDLFJmat03KdWcMYxcK5mxJNGHpgyqM7gySlbppY/cgAospE8/ygU2FlFWIC9N0\r\neDaY+T8QA1msnzsfMhYuOI8CRYigan1agGOMDgGxAgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBAGsECd+meXHg1rr8Wb6qrkDz/uxkY1J+pa5WxnkVcB6QrF3+HDtLMvYm\r\nTTS02ffLLyATNTOALZFSy4fh4At4SrNzl8dUaapgqk1T8f+y1FhfpZrEBsarrq+2\r\nCSKtBro2jcnxzI3BvHdQcx4RAGo8sUzaqKBmsy+JmAqpCSk8f1zHR94x4Akp7n44\r\n8Ha7u1GcHMPzSeScRMGJX/x06B45cLVGHH5GF2Bu/8JaCSEAsgETCMkc/XFMYrRd\r\nTu+WGOL2Ee5U4k4XFdzeSLODWby08iU+Gx3bXTR6WIvXCYeIVsCPKK/luvfGkiSR\r\nCpW1GUIA1cyulT4uyHf9g6BMdYVOsFQ=\r\n-----END CERTIFICATE-----"},{"id":"twofactor_totp","categories":["tools"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"","website":"","created":"2016-10-08T14:13:54.356716Z","lastModified":"2016-10-12T14:38:56.186269Z","releases":[{"version":"0.4.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0 <7.1.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/ChristophWurst/twofactor_totp/releases/download/0.4.1/twofactor_totp.tar.gz","created":"2016-10-12T14:38:56.174612Z","licenses":["agpl"],"lastModified":"2016-10-12T14:38:56.248223Z","isNightly":false,"rawPhpVersionSpec":">=5.4 <=7.0","rawPlatformVersionSpec":">=10 <=11","signature":"bnwWxmHEn8xkoWbtwhC1kIrJ0dQfAI3PUtU62k+Tru/BHt1G2aVxqO8bCdghojZ7\nzdFMlIJw4kekYFsVfLk8jzjUTZKVbNVKCdkHrVTQ0bUUryMAMLqGQ3PSRI5NX6D5\nFpkvwO1coYwU0XVWF8KAS0meX0ztSkT3Mv96LLrxr8F8SrB/MGmKIE4WTjt1fAIa\nZLAVEUo/3sNFTGLYBtL3wjctrkZvJltP8abeRfls9FkRHu+rN7R3uLFzk42uZn3X\nWpt5BBmlYm5ORbnJ2ApsxEkMNK+rOy8GIePaz5277ozTNrOnO04id1FXnS9mIsKD\n20nRzjekZH+nneQYoCTfnEFg2QXpW+a+zINbqCD5hivEU8utdpDAHFpNjIJdjXcS\n8MiCA/yvtwRnfqJ5Fy9BxJ6Gt05/GPUqT8DS7P1I1N+qxhsvFEdxhrm2yIOhif8o\nh7ro5ls+d3OQ8i3i4vdZm821Ytxdu/DQBHiVoOBarvFWwWAv2zd2VAvpTmk6J5yv\n3y+csRqpEJYd9fcVMPsTu7WBRRrpBsAqdAHJcZEwak2kz1kdOgSf8FIzP1z6Q71d\nMl2RKcPeutMHHSLiGIN/h7fM5aSs49wGgGZmfz28fHVd7/U0HFSMYmkT/GMq5tMP\nIyc+QZAN4qbX8G0k/QSTkK/L4lOT2hQiQqiSqmWItMk=","translations":{}}],"screenshots":[],"translations":{"en":{"name":"Two Factor TOTP Provider","summary":"A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)","description":"A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)"}},"isFeatured":true,"authors":[{"name":"Christoph Wurst","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIECTCCAvECAhASMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYxMDEyMDkzNDMxWhcNMjcwMTE4MDkzNDMxWjAZMRcwFQYD\r\nVQQDDA50d29mYWN0b3JfdG90cDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC\r\nggIBALC1K94104L/nOtmTygx7QNjUcnHs3yrn71mw4pMxTlonXOnMTpwxsfL1Hhu\r\n/5GMSgupTbQPlevSl6J86UMs455/sPShd6ifmAuhb8VFaAsjpizjs0RMaUg1sjmF\r\nuV18PD9FXLourx51V/c4MG5kpavlV+bLUrVMAjbsJY2+k30tCC/XkP5u8jUWmM/T\r\n5REChn7/obPgaeddhuJoILYhKEW3VNrR8Fm9SYiviB3FLhM7URDZ97IBnXYqbvbT\r\nZnvq+E74Zc7HgYwQwrjU/AqQAInhNpAR4ZM6CkWWWWaL96O1q3lCfKJNaxqC0Kg/\r\nkGn/pxYkl9062jtMUz60s9OPDyuisfyl68UyM68Ozyz4SMRLmDVbewOqQAwmAbtz\r\n8p9AQrX3Pr9tXhARR4pDSsQz1z+8ExEd6EKbhMyiTtHtZQ1Vm9qfoR52snpznb5N\r\ne4TcT2qHAkOWV9+a9ESXmQz2bNjgThxEl5edTVY9m4t248lK5aBTGq5ZKGULNHSQ\r\nGGpr/ftMFpII45tSvadexUvzcR/BHt3QwBAlPmA4rWtjmOMuJGDGk+mKw4pUgtT8\r\nKvUMPQpnrbXSjKctxb3V5Ppg0UGntlSG71aVdxY1raLvKSmYeoMxUTnNeS6UYAF6\r\nI3FiuPnrjVFsZa2gwZfG8NmUPVPdv1O/IvLbToXvyieo8MbZAgMBAAEwDQYJKoZI\r\nhvcNAQELBQADggEBAEb6ajdng0bnNRuqL/GbmDC2hyy3exqPoZB/P5u0nZZzDZ18\r\nLFgiWr8DOYvS+9i6kdwWscMwNJsLEUQ2rdrAi+fGr6dlazn3sCCXrskLURKn5qCU\r\nfIFZbr2bGjSg93JGnvNorfsdJkwpFW2Z9gOwMwa9tAzSkR9CsSdOeYrmdtBdodAR\r\ndIu2MkhxAZk9FZfnFkjTaAXcBHafJce7H/IEjHDEoIkFp5KnAQLHsJb4n8JeXmi9\r\nVMgQ6yUWNuzOQMZpMIV7RMOUZHvxiX/ZWUFzXNYX0GYub6p4O2uh3LJE+xXyDf77\r\nRBO7PLY3m4TXCeKesxZlkoGke+lnq7B8tkADdPI=\r\n-----END CERTIFICATE-----"},{"id":"contacts","categories":["office","organization","social"],"userDocs":"https://docs.nextcloud.com/server/11/user_manual/pim/contacts.html","adminDocs":"https://docs.nextcloud.com/server/11/admin_manual/configuration_server/occ_command.html?highlight=occ%20commands#dav-label","developerDocs":"https://github.com/nextcloud/contacts#building-the-app","issueTracker":"https://github.com/nextcloud/contacts/issues","website":"https://github.com/nextcloud/contacts#readme","created":"2016-10-30T14:00:58.922766Z","lastModified":"2016-11-22T22:08:01.904319Z","releases":[{"version":"1.5.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/contacts/releases/download/v1.5.0/contacts.tar.gz","created":"2016-11-22T22:08:01.861942Z","licenses":["agpl"],"lastModified":"2016-11-22T22:08:02.306939Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"ZqqhqtbHcNB+rzGCQ7FDIjjvHjit+dhAE1UhFgiXApkx3tmPP4nJOBAGNjHe+2Ao\nVcTIX2SrWEfieRrA4Gp+0k7pUPWag1Z0T1OVOwO4cmS1AVFyGIOE1bRvDhMfsWTU\n4CI4oXaKBFAY6mtnf7VJ7EeIdNqhImkohyWDQ88NiPRLM1XNkJJk6AvZBcT0fvCv\no145X4dLpbixSXsN99QFNJ/oXvK+9tBGwTd5i/WnNFY90vcNRLia8aRo7SA0YJRx\nLnxnj2HMqwTTDQEKE+1elYKWsqQ2DeqwScP97UIKe5bZXnrwOi9kH9PDmR4abtzd\nlHL8E1Wgw25ePDeHG7APrx0tVOJy1bP+g8vcarpGynWZoizDkBvYZD+xtxizpBXC\nJsDOSzczApptY6dnOtv0Vat8oh/Z/F99gBUahEu4WZ16ZgR1nj40PDK1Snl18Cgk\nMe1EZcde8SLEpTbCWYIfIw/O9Fkp5cWD/dAqoiO6g+gNxSZ/gGp57qoGfFxn7d/x\nH3aH8GljatAFjrwItw1JzR0THt0ukkOK+bw/pfCslk10sjHMitmz/GXa4qMS91DZ\nBKLUd0dSfQUQzkfwcojImbzJRvca4/DYe3mfG7+RCH0tDL6t72dKL9joB++u5R1u\nVZPgkToexlXcKWpiDB8H2/SEShKr4udAOjR5de9CYWM=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Contacts/contacts.png"}],"translations":{"en":{"name":"Contacts","summary":"The new and improved app for your Contacts.","description":"The new and improved app for your Contacts."}},"isFeatured":true,"authors":[{"name":"Alexander Weidinger","mail":"","homepage":""},{"name":"Jan-Christoph Borchardt","mail":"","homepage":""},{"name":"Hendrik Leppelsack","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhATMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYxMDEyMjAzNzIyWhcNMjcwMTE4MjAzNzIyWjATMREwDwYD\r\nVQQDDAhjb250YWN0czCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANzx\r\n/zJF+5/s4lOJLWIlfKQgTy+UpvIpiUXCgrsHsDZTx+hjQAhIWukH88a+7NVAL7Ys\r\nkQNC0Tlm755FJi/T6EdR7edOwIRdo2ZwakOWLZXd209+6cCd2UloHL0bgnbWepTl\r\nR/4YgbLg/G+FVKCfkEiYc3PuDZ3EVrcwQFcg7h74X9ne6CHH0Z1WQLydxJuVEb2n\r\nX9I+nIRpPHcVostkSiUmzHR7C5TjTIo2PzzgnCU6GC0iBa6z6dDYfz24QEp/b8UA\r\nZaLhjkyKghVGMnoF/s9KPgH4NM8pvvtadQN8pxlOPju4wbmKPUrsXo4ujurDXbbc\r\nYkzNt8ojobGwdTXoyDogAsGZLQd2FQksWpRvY+I3zVPokBfPMdUPLllG5VcV0VA5\r\nDRK+h2ms+XmspdBvGonjF+XdbFm9hEmDoFmoi9aU6C6AdofjmG/e9+pw/20dXUWk\r\nmMorWwXQ5yLmIn5LnpRXrOuK7CS28VRhBYuVNMlsyKhzU0rophbsD9OFXxYLjr6s\r\n7UPNwZ5h+kjXZDBKD89QctBSViT8RhLe8nulRIm0iJn1sb9hca/CF63KmsFzENfK\r\nQeM6MO0H34PB84iNyz5AX1OIy+1wHD4Wrzt9O/i2LkWK6tBhL69aZiBqdLXWKffj\r\nARDCxxIfews51EZFyHzwsw65I97y46aBKxY382q7AgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBACLypX0spxAVAwQIS9dlC9bh1X/XdW2nAvSju2taUTBzbp074SnW6niI\r\nbnY4ihYs4yOuGvzXxnp/OlvWH7qhOIchJUq/XPcEFMa7P03XjVpcNnD3k0zQWlZb\r\ntGonX9EUOeLZKdqI4fkrCkMLScfjgJzoHGYQrm8vlIg0IVuRLCKd5+x4bS7KagbG\r\niuPit2pjkw3nWz0JRHneRXz/BNoAWBnJiV7JMF2xwBAHN4ghTM8NSJzrGTurmpMI\r\nGld7yCP47xNPaAZEC66odcClvNtJ2Clgp8739jD6uJJCqcKDejeef0VU1PG7AXId\r\n52bVrGMxJwOuL1393vKxGH0PHDzcB1M=\r\n-----END CERTIFICATE-----"},{"id":"mail","categories":["tools"],"userDocs":"","adminDocs":"https://github.com/nextcloud/mail#readme","developerDocs":"","issueTracker":"","website":"","created":"2016-10-19T19:41:41.710285Z","lastModified":"2016-10-19T19:57:33.689238Z","releases":[{"version":"0.6.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0 <7.1.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/mail/releases/download/v0.6.0/mail.tar.gz","created":"2016-10-19T19:57:33.676730Z","licenses":["agpl"],"lastModified":"2016-10-19T19:57:33.834580Z","isNightly":false,"rawPhpVersionSpec":">=5.4 <=7.0","rawPlatformVersionSpec":">=10 <=11","signature":"VbMsvDpt+gSPeFM8LrZXEK10rk8kkLlgCcblgqNdCSeGZeVpwDAYv3CccVSLa0+l\nlTSqQ0VIoH+OIU6vIQNBKHmSCzTplk7OrY0+L5FajXx8LnBaOh892GfGSlEt1neN\nKyM0i0uOjO/xpCP/NoUlgkz6hnmYY5XEdN6DTsJtJ/XZhDQ45IYuIkMkHE/eFehS\n0JnOagIz+PSipeBY2Ry+tV8YbRa7bC1JAvZzlod0dyI015AHZESeitRUY+MwMWkt\nN/me7g7/Kev0wggIQQZm9aYcw63GMk/1VHUPB7Y0ESW9tx2nR5+KwTDn/Jy4DGf1\nrg8h0t5I+aPhHOBLrpczH0qaZWY2lsVZWq8KWjJI9aR9P0v2f2aXixXzD/Cuz1cK\nhvhKWkOSla4D+/FxeyHGjQvdXMG8gXm0ZmTimKChCoVuCbncDd8pzkdyNoGXcvuk\nsP8OrkQFooL4E7S4BWfdSiN/a8jUITJQkuXp/OVrVGeCupLWJh7qegUw6DvoqyGy\nD4c6b+qYn68kx3CLaPPiz+tFAZQZQdj7+Kx/lohso8yTnVSiGYrMj4IvvCbpsQjg\nWF3WSqF/K/tTnPYTWb9NUPSihTbVNv6AXOfTsPEp/ba2YSS5DjvjVjkr5vhR9eg1\nikQ3Cw6lW3vaA4LVCC+hFkMRnI4N0bo5qQavP3PnZPc=","translations":{"en":{"changelog":"### Added\n- Alias support\n [#1523](https://github.com/owncloud/mail/pull/1523) @tahaalibra\n- New incoming messages are prefetched\n [#1631](https://github.com/owncloud/mail/pull/1631) @ChristophWurst\n- Custom app folder support\n [#1627](https://github.com/owncloud/mail/pull/1627) @juliushaertl\n- Improved search\n [#1609](https://github.com/owncloud/mail/pull/1609) @ChristophWurst\n- Scroll to refresh\n [#1595](https://github.com/owncloud/mail/pull/1593) @ChristophWurst\n- Shortcuts to star and mark messages as unread\n [#1590](https://github.com/owncloud/mail/pull/1590) @ChristophWurst\n- Shortcuts to select previous/next messsage\n [#1557](https://github.com/owncloud/mail/pull/1557) @ChristophWurst\n\n## Changed\n- Minimum server is Nextcloud 10/ownCloud 9.1\n [#84](https://github.com/nextcloud/mail/pull/84) @ChristophWurst\n- Use session storage instead of local storage for client-side cache\n [#1612](https://github.com/owncloud/mail/pull/1612) @ChristophWurst\n- When deleting the current message, the next one is selected immediatelly\n [#1585](https://github.com/owncloud/mail/pull/1585) @ChristophWurst\n\n## Fixed\n- Client error while composing a new message\n [#1609](https://github.com/owncloud/mail/pull/1609) @ChristophWurst\n- Delay app start until page has finished loading\n [#1634](https://github.com/owncloud/mail/pull/1634) @ChristophWurst\n- Auto-redirection of HTML mail links\n [#1603](https://github.com/owncloud/mail/pull/1603) @ChristophWurst\n- Update folder counters when reading/deleting messages\n [#1585](https://github.com/owncloud/mail/pull/1585)"}}}],"screenshots":[],"translations":{"en":{"name":"Mail","summary":"Easy to use email client which connects to your mail server via IMAP and SMTP.","description":"Easy to use email client which connects to your mail server via IMAP and SMTP."}},"isFeatured":false,"authors":[{"name":"Christoph Wurst, Thomas Müller, Jan-Christoph Borchardt, Steffen Lindner & many more …","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIID/zCCAucCAhAVMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDE5MTkzMDM0WhcNMjcwMTI1MTkzMDM0WjAPMQ0wCwYD\nVQQDDARtYWlsMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp++RuliQ\nlBeeiPtP0ecBn00OaU1UCpft/NVI5pnSiT9nU4l2kc5IvKjA8UxDB3gWfYTOeBFh\ntUHQ2P6UKCmHZT9sApHhqLu2n0V+YhlFIViuaxndSID/M414cl56xOYQusV3Pcae\no2dOSeRRzLab3tEaVHlkBSFkGmAwPZItsmTklvV3h1sUysDicYgfXPCkf7K+JgWA\nBP7vsWC8B7MDRhcB3enYv5tTcpsyvtGX7bb1oTIWVypcmKsGYfTX12VNBxKzNBIG\n8pwdb8Xo0o14TytWsWN7mSHf1XbwfwYMjDWOlMqiRc+mcoKMBH41TfM/CXslSivI\nsyvxasEaFdlj8lmKPENdzw1OfYRs43usIf4szwyt4rb8ocXfDipnY3P2hccN6YcZ\nl8y8Vsr69ASluDj2A2Pl5vH6xp6tNybZRnN5G6sghhaYaLNDU/TdMyYzz4AY33Ra\nHSaMypfcXjd76Aj8jZvcwk1BH+ZsvFqNK7ZKCb7WVcMH8KRcU1sxZ4rp9vviM2fL\nL7EVtznm3bSI9jjHXbiwq7RvNRRy+F6YRpAdWGwTU8uUkDabPFi41FikYyzNWauK\nJhlDJXl514XjKyMVBjAZYVr5gZZkO1J7C4XzLFbC5UzYNSzW5Iwx/1j5OeYJRxh6\n5rhiUwR+COT1wdVsl6khMC8MfBR4unSd338CAwEAATANBgkqhkiG9w0BAQsFAAOC\nAQEATBvpqz75PUOFPy7Tsj9bJPaKOlvBSklHH7s43fDDmQbJwswXarZi3gNdKf8D\nyO/ACZvO8ANWAWL/WahkOyQtKOYzffaABGcEIP7636jzBdKtgwSGzW3fMwDghG10\nqBr2dE6ruOEdSpuZxgMgh2EulgknZUXaHAMI2HjjtAMOBScLQVjOgUqiOHmICrXy\nZETmzhx0BXDt5enJYs8R2KMYJNIme1easQRYmWKliXogNY09W7ifT9FHtVW1HX+K\nxRS4JXbapjolkxyGSpP+iYSgItVnYzl6o9KZResR4yDsBv7G/8fpV4GQU9IS3zLD\nPiZOosVHWJdpUKCw9V4P1prGTQ==\n-----END CERTIFICATE-----"},{"id":"audioplayer","categories":["multimedia"],"userDocs":"https://github.com/rello/audioplayer/wiki#user-documentation","adminDocs":"https://github.com/rello/audioplayer/wiki#admin-documentation","developerDocs":"","issueTracker":"https://github.com/rello/audioplayer/issues","website":"https://github.com/rello/audioplayer","created":"2016-09-16T05:44:24.857567Z","lastModified":"2016-11-17T22:34:34.637028Z","releases":[{"version":"1.3.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/Rello/audioplayer/releases/download/1.3.1/audioplayer-1.3.1.tar.gz","created":"2016-11-17T22:34:34.215350Z","licenses":["agpl"],"lastModified":"2016-11-17T22:34:34.867778Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=9 <=11","signature":"p6Zz0IEFrxvw6y/3jHgGWWCxR6qpMzvU2HKfxcIVsK6sJnoRUhWLeAXwZ432fH2a S2llj+IGS9OvW+5VQElrXgPtEjDK1BT00DRJnp5RFCRlUv0LNoedJMzx6B6AHqPP JBufk3cG1O/CO0M0L1ITGSmSOzfKvWTRo3lxVGF792NyBaP/SyZCkH1N1TzBQzUi Ywl3+HiglPcXbHjtJm/arnKorbJWVKoaN93xFuaBapd2ozQSpi0fE0uGRsici+U7 HNa1M5WFE1rzUJoufE0E9246At07rFY1e+TdNEq8IlLgCXg5vGCKkEyuWpWno6aX LfRaIiT9x39UTAwNvuDKS0c+n4uWDYPsGfKhDx9N7CXpUrthfXVEWRzZEXG7as10 6ANvrRPJemSZH8FUSrdJhD7k12qa9R825y7mIG68Li8P71V92EOxFfo9tNXqXwBt VuDGxBqByFVPqSCj5I8hrzJzQl2Xt40g8+8ZcSF96RMg/pM+bwRMTv+mz0V+vQQ4 DWjqnWVPalaJ1PPD5/QFFErtXuNRbyxKZ6BMWxfJlLM9Kz66P75K+8fYaSwz+2KG NxY7I3svzS2K9LGH3fBLUy1t3Hl+c3zGFq/ll1MJrf9NswV4yxt2WmISfM/KDww8 yELkGs2cRzbw2tCvnmYlJJhIqRLkyFAbDzWRH/XdVx4=","translations":{"en":{"changelog":"2016-11-17\n- fix: one-click-play for wav not working\n- fix: wrong sql statement for PostgreSQL [#90](https://github.com/rello/audioplayer/issues/90)"}}},{"version":"1.3.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/Rello/audioplayer/releases/download/1.3.0/audioplayer-1.3.0.tar.gz","created":"2016-11-15T18:11:19.539636Z","licenses":["agpl"],"lastModified":"2016-11-15T18:11:19.592881Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=9 <=11","signature":"lbp7wd3JhMHW5mC8kVnQFvcwzf3aTIhYhq3ak/C/vfDXJDIPFuQ1odVRWtaHXEKQ XmKYIoTobV1TAU5q9G0O0Kds73T/XtHG4ATLxMZE8RsUWNSj5v3H4YDub6A0uoX6 rzyLEYV6SGEtdPFMwLcUjDExKpzAzKpgxcd9uyz2NhcHJEO8FJmirn34bm69//TO vjjiMW4zpL+dho+7LQbOX+L1SmwmdBqwypE9zzeuIuhUWDEQtImHAvjIO6Temajm lX0H5JaowJa8kvP6Jkh3KAvsHQ4sJklvWTPGcv0gboN+o6CmjWNOb+3LeSH0nhe6 BmiPloUDJcPQwq2gQejH2pY+qJEdRcULSKS09/dRbE3gOSlG36FThN0INpv6uNP4 qVIiYs3/SEHMmlS5CHvJDt2S2XN9LT9IX7QPeuS/0CMcuopaG/+cdC4KscVCq4D4 bllgew9asiBqix8iV8C4oerYOiC5vWcgBrZhGShoJT1Qq+NKz+H10dFgjFCAZuPj nVagJkbXmf2NdcvpSC7qsufhyEZyCSp+I7QEYsbo1PW3aUU35Syt47lgeVFX0hVQ jC1wMIhEW5Rm2nCkRSZkRupKDQ+N6uWuB0lykeMV2ShcDvvUZrhN3c49sooWgigB yIqKryzM4fLErjjNHdYgwCq6bbgPDLK3ic9b3B4rF3E=","translations":{"en":{"changelog":"2016-11-15\n- fix: handling of temporary scanner files [#68](https://github.com/rello/audioplayer/issues/68)\n- fix: simpler analysis of incorrect files in scanner [#57](https://github.com/rello/audioplayer/issues/57)\n- fix: album sorted correctly by artist and album [#80](https://github.com/rello/audioplayer/issues/80)\n- fix: neutral cover for unknown album [#16](https://github.com/rello/audioplayer/issues/16)\n- fix: error message from ID3 editor shown in front-end [#77](https://github.com/rello/audioplayer/issues/77)\n- enhancement: occ support for library scan and reset [#72](https://github.com/rello/audioplayer/issues/72)\n- enhancement: select a dedicated folder for scanning in personal settings [#79](https://github.com/rello/audioplayer/issues/79)\n- enhancement: exclude folders from scanning via .noaudio file [#79](https://github.com/rello/audioplayer/issues/79)\n- enhancement: significantly reduce database reads during scanning [#79](https://github.com/rello/audioplayer/issues/79)\n- enhancement: cleanup of classes; move from \\OC\\Files\\View to \\OCP\\Files\\IRootFolder [#72](https://github.com/rello/audioplayer/issues/72)"}}},{"version":"1.2.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/Rello/audioplayer/releases/download/1.2.2/audioplayer-1.2.2.tar.gz","created":"2016-10-06T21:21:05.414691Z","licenses":["agpl"],"lastModified":"2016-10-06T21:21:05.483224Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=9 <=11","signature":"toeS45z50Lm0djgrQokOTN7gA8a113IZtiKKiLsGUKWrCV/6AKJBmEFcSun6rhLH\nbz/RtIdFKwQql6O3E0m1Zch2y1A8aLWHzFTO+5orLCVi7y15SshrJYbb9aI5Pj3i\nSR7+kMHGS8uNx2uIn3B4mO6UYF8AzCfp+ule18DOjnpu86KWvEOGtFXsQkLtgepp\nbJhOGWW/uOVIos/T1xPP4GCmtVmgn7U3b9q0pMYRH7ONXEiNsfQxDrR66EZH3Jfo\nlVyM9UvQmMKoDSdBUlvLlhCEGJGqFOD7hFntLYloI4oXv9uGqcagaJVh3TkEysY2\nMbBZpVhch5zRJ/HGlZOvmEzZ8Inxkk3iap+JmJ5/gZTefwfKUyYHALsILlh820U2\nNA/1B5A015XH5a5uflGE/tnlPtrOeecIN4mg+1njo2RG89HJWJNHM2ZDO4SkXjSR\njgygmAS5aR5+KKifiA/pwjhLozDWPU4lNzsj3Foz3bx3Okopy7eq83LORqieT4Jp\nFvP64q/45LOSRBWIWLitYzRzZp7HYywMsnz12WpxtqxIjO7+7y/ByeWWOBNU1IJC\nK2D+035ZGWZr0CxDJte33WOISwjVoSwrcov++O3BQW8lM5IkcDNcJFyzNPKAXcQU\nPUXmQpYurHoIw6odAYcbrG6iOiSesuNOf2kQWbjV3/c=","translations":{"en":{"changelog":"2016-09-18\n- fix: icon issues with alternative apps folder [#65](https://github.com/rello/audioplayer/issues/65)"}}}],"screenshots":[{"url":"https://github.com/rello/screenshots/raw/master/audioplayer_main.png"},{"url":"https://github.com/rello/screenshots/raw/master/audioplayer_lists.png"},{"url":"https://github.com/rello/screenshots/raw/master/audioplayer_share.png"}],"translations":{"en":{"name":"Audio Player","summary":"Audio Player for ownCloud and Nextcloud","description":"Audio Player for MP3, MP4, Ogg, and Wave with a lot of flexibility for all your needs."}},"isFeatured":false,"authors":[{"name":"Marcel Scherello","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEBjCCAu4CAhAIMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE1MjExMjA4WhcNMjYxMjIyMjExMjA4WjAWMRQwEgYD\r\nVQQDDAthdWRpb3BsYXllcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB\r\nALyC+iLscLs62NeNmUXEBmg+xMuUtDmZKr+xzJWtl6SSNRz+8K1JygvUIXFJ3RIL\r\nCYA3xyq8/wyZH1gNrLKyz5eTeYawG+eT3ges/FT6MWGUbZoRrBrikVcLC94QzxTH\r\nxOl8Dn+SCV/2bhcvPTQdhK+dqtvGilOtjHa40iMrk9gSdlKVys5CK/xdlEp8uiMa\r\nkz1WENn8MVCCJV58bAUbaCupDWXR9CCoSsw8XinNsCenZ2B2XlnmbM44280w0ojs\r\n72rfQRgj3yDG+ZUUyUOuxIuodu8liXYciLf0ph6t/f/qoSmctbBdsR5Fl1Upj1Ac\r\nqeHb5Yf/B3Vi6Mn3XfDx0H2EHk1v9Dhzxay+v9BHUzyIX2iH/q+7TE0/Jzo5AwBW\r\nvFKWXvG7wXaALcHYZf5v/M93IE0iCHsv2EsZKQPBnzXVGmp4DwFSP4po1B7hcog1\r\ngAMaellAzzvUAizgCovN6Qct3qDEANYniPlvtnlcaQGonajW4N019kFQRHLIzPFR\r\njab5iUMMwSnT8FhZO2ZOWuWhJven+gXjxC8mfMVgBfZnAVgydNfx9rN+KzTc88ke\r\nobUdZ0OOeBzA7pIxGEFg9V6KTEEWZ+qH048vxXz4HI9B1I+2wQLBrZl8CvweEZ5U\r\n5ID8XrrE/UaNZ1CvLKtCgB24gj/m1Elkh7wA3gEcEo2JAgMBAAEwDQYJKoZIhvcN\r\nAQELBQADggEBACtgUp+FCmjWIkQUuWSdzKWdO+IH4v9wBIrF9mo0OLIakFyDYyM5\r\nLlkYZXbplGXd4cfn3ruIqJNzlIb4xa5CU0bM4TMbD4oOSlLMKM/EamKPHI3bzr++\r\nzi7mQDFxmAE6FWSMBgKKUb4tqLc5oBap8e12tPEZl/UR6d9iUB2ltvrm3T3vrjjl\r\n2Worm0eYBNqnagXmX5+wS11AQqeJemGqRy5e1yXRlTgB0IJhH0dCsFNwifEigutp\r\nFNvGFVBn4r5qCiChEoq+rCXHRjPi/eCfbW21XeLFDiLxapcZyc85JIcA7znUYoFe\r\nP7Y/ekMscwWhLbF91OaQlcWpRtEMyde/DaI=\r\n-----END CERTIFICATE-----"},{"id":"calendar","categories":["organization"],"userDocs":"https://docs.nextcloud.com/server/10/user_manual/pim/calendar.html","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/nextcloud/calendar/issues","website":"https://github.com/nextcloud/calendar/","created":"2016-10-01T12:40:39.060903Z","lastModified":"2016-11-22T20:31:13.029921Z","releases":[{"version":"1.4.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/calendar/releases/download/v1.4.1/calendar.tar.gz","created":"2016-11-22T20:31:13.020268Z","licenses":["agpl"],"lastModified":"2016-11-22T20:31:13.087340Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"nThwe9CJBCan9nuDLdhfBiQyPhmum6Aa0UcYsIDdhGMw+C2acf81KhEmBJuTTWxo\nWGby6WcrcJJmeuCW+ePU91ju7Pd76RirprhVXIEceIDzSCxin+K0oZCZ1IGVIJjP\nIkVehTsLuCeTBbjvz1b3k5QFyhUhvd32Xt7k5d7VARyI4OqnqYYNBtH9vvgeRrFw\nAxsQr4o4axof6i3iykLg6WfWarYArY4dIuu5DkPuGPWf2bbgjwWEra4sQejhOs7G\nsk1xcsfYv2NpArIbpw/wnATdjiax+Gjz1URMD3NgL5ky0ecuZmNvN25QErg3nlVr\nhh1FBfA5pvCJbkJ6nr5bU4bKaffwDX1nr5h77FS5zzn0Pyd7ZIExmVmNtaeJfnfV\n5vnclapzXMNU+R6t/ATJQd1srvSJhyljQapzsqnrjNMEUojOEvqqygJp0KwNVPqs\n3g9XGSoOnO+WULWBeISW7UVOg8BOF8pwvHIU2++bSzOdpypW0Eq6p2DPWO6qL/H1\neFLKrUg3EvnTjvknbBxMB55h9jNJr0SAlkrmyEVm6+CE3BwRWpKB+cJMBuGiwPwv\nr/ASRiJrkDThbNWAUtX70rUmCqDV6/MujLXViqOc/Q2OHvcXd1oGDccJSQT92/1z\n7nonnedyYQIDqUt7u68WL8JRxp7pFsEqKLVuWSgxW3c=","translations":{}},{"version":"1.4.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/calendar/releases/download/v1.4.0/calendar.tar.gz","created":"2016-10-06T19:58:12.724588Z","licenses":["agpl"],"lastModified":"2016-10-06T19:58:12.790604Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"b//hJbICFMLR0Va1BGMzpLpaPREOo9QhjgfrHvDOfXVpddhvCM8ocz74X1s5hKyy\nGg67EE0pOp0dBf6RyJjduI+Dz1wQX55My7J9G1vXGCN30C/8zAcKSJoA218IWcub\nICavLkz2PkiitIOSZyBCAfEiSAeHPop/JGkq3KxQDC7QwFC78BnE9/adD9tO55c/\nDGLhvP/uTJIeH8RUifikTqVMmPH+aP3uPbZzl+AxhUezRiNCpEtZPA5QGqtQdJU4\nFc6x3d9y4IWbJV4TEIAP8jdfqtLVUQ6szFVnN8Oi1wtN9e8LIylBSYbmIZRj0+qh\nZcgntzEq6U843ZwXcAnL5jNYV0m+KNI+EkXFeWHkjvbwfCdvGPBvgFVbhc0YPzXU\nqHOe4Lvcx9X20ALG/MacV9zX69GzNnWgbBp9RnIHuaSRPFEKrNXUeXl2THuKsTyQ\nF9QtTwS5U5DcMyTO2RAN45NrRxIh8IL4stoIg5rmF7/ZaOm/Jza2gnUquOTarDE/\ntiWnNW5kWUAWyYYHvQgQix/of9qXvc2hhZaw0y623WDNrEwA+rngnjDMLA/vNv3B\nhgwQ6NbCOuHWsRK3S8DcJFpB9Kj/i7CDvDLEuJYnjSTvQ/q1XqawbJPDoRlydX43\n3/L0LvHvKVakYybv2OE5gy6bQ2Dw8e7D27DtZ6XTaBY=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/1.png"},{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/2.png"},{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/3.png"},{"url":"https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/4.png"}],"translations":{"en":{"name":"Calendar","summary":"Calendar GUI for Nextcloud's CalDAV server","description":"The Nextcloud calendar app is a user interface for Nextcloud's CalDAV server.\n\nIt integrates with other apps, allows you to manage calendars and events, display external calendars and invite attendees to your events"}},"isFeatured":true,"authors":[{"name":"Georg Ehrke","mail":"","homepage":"https://georg.coffee"},{"name":"Raghu Nayyar","mail":"","homepage":"http://raghunayyar.com"},{"name":"Thomas Citharel","mail":"","homepage":"https://tcit.fr"}],"ratingRecent":0.944444444444444,"ratingOverall":0.944444444444444,"ratingNumRecent":9,"ratingNumOverall":9,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhARMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYxMDAzMTMyNjQwWhcNMjcwMTA5MTMyNjQwWjATMREwDwYD\r\nVQQDEwhjYWxlbmRhcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMm6\r\nFTeqgzCXprkU83VM4/DrZWn3kqtfaR/edkC4gYT3ug7RHa/Uv1C/S++vr7pvgpnk\r\nYzQoavl/0Qlh5sKEYX+0ud/LQDoiidwBRDckFUQ1bRfVLxAD9UAVvDRHxDqJMOx2\r\ngZArbeQ3ztdSHZp4ThzBFWq2FILsJD86weG7LwHjzhW6SWgLb/YTLbuuW6tRCDVV\r\nbtB0I/a0vCwj2u91Chw3u6pWWjPakc9DQrIDH4HCIBKQ4zVrYDxAmJDRFGDvVVWx\r\nuIAeux8sd8drqSMqAhX+XMcZPRD71NQTWbCupSwWO8kgjmZnBpIiBNpzvMQzJf3A\r\nQloZtjZ2RDXAQG88eTeT8pp8yEOCEoDLpGdraKxJrh/z2Dsk30JP3lOiNYJ9vBaB\r\nC8NJbJ3oAlG7THwUaFF9fsdAKoTwzs5Xms04TI7W/v4Z/GClOzMymnR1T4sR72Oy\r\n3WaMNHv/1QGffvQn2/TtZt23Ou3P083xWx2vn5FgTcac8+x85vRgWsVCA4hq9v6m\r\nAlktB0+UWDEXpDTKD9BdFNWM8Ig9jQf7EJrvTLNnS7FIJZMB4GK8lpvPxyvACWnh\r\nR2hQOe987Zvl3B1JZNO5RvtSeYld9Y9UfMgW1aPRweDNjSuZYAKlugx1ZoyI5HyA\r\nQjfzAwicIMwZsCJDV/P5ZO8FE+23rdWaoJczpBqDAgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBAHQXwvj8q5khWR/ilg3JGYpmMNBYHE9OeDaOcNArkKaGMd478SDPOXeu\r\nyW7hCvNEpiTk5g0h3g3yleZFws0xH8fPsQgZANgvQXb3RCcD61NL77d0cMTr7Xzr\r\nN3Lq/ML1YLc/WwL4uV1XvpMQMwALFL1p63BU2c0ysO31zbLOjMKAJi0hHFDYz5ZQ\r\nD3xxtc17ll3B5IqrMnMHRqmOQ39Sbe56Y7T4agaIz/sUWpseo85D5kt7UAIOR+Mr\r\nQ0Bl/QinETk72afGR46Qvc7tC1t9JjQQD3AUbEGuJdGvXjJJ9GREYu01XoODmPdT\r\njXXOI8XIOK6kxXhPHUc3iWu9b4KqGm0=\r\n-----END CERTIFICATE-----"},{"id":"gpxpod","categories":["multimedia","tools"],"userDocs":"https://gitlab.com/eneiluj/gpxpod-oc/wikis/userdoc","adminDocs":"https://gitlab.com/eneiluj/gpxpod-oc/wikis/admindoc","developerDocs":"https://gitlab.com/eneiluj/gpxpod-oc/wikis/devdoc","issueTracker":"https://gitlab.com/eneiluj/gpxpod-oc/issues","website":"https://gitlab.com/eneiluj/gpxpod-oc","created":"2016-10-31T10:57:44.387319Z","lastModified":"2016-11-23T17:27:37.793159Z","releases":[{"version":"1.0.8","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":">=9.4.0","rawVersionSpec":">=9.4"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":">=5.5.0","rawVersionSpec":">=5.5"}],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/963bbf246412bcbe8979bccadb3b8d03/gpxpod-1.0.8.tar.gz","created":"2016-11-23T17:27:37.783365Z","licenses":["agpl"],"lastModified":"2016-11-23T17:27:37.862469Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"hqhMh1l/mnwbYf4uPzEjjLFtZWHidzgR57X471OuXv2K/s87T5WhIkTSKk+2r8sp\nS7CtrF5+Pc5AgCCHvwzawN3e2+4eO4cK0+HD9CCzygzzHZEbSjufNHMMQucVoSD8\nPqR6MV9azzUpwHa/5d8fp3cFLVAle+aG0o4v5eHky9c7eaKxVJcgfjw3pjDE73N6\ngJVdtw1jf1kOFYk5pZQxDfBKFDrO5BRo5ZfZGuOuP2u/SmTwj42oTZiT7oTVWhqd\nLvJw+2TPv7B8s0Gin+J5e9K1Rs6CEWQ6WBxM+NhS5KgWB5Ig3pwm0QvMgza2cvoh\nlwVobOotfKLUBJzg0+wR7B2YH9Ao+m94h93vg7H0OKPReoTKhlDj2UExoTyeurV8\nhJdQv8sKVAxjC7/xrVaGSjM4YxFdBpzq8Zl8z4zq1o2voH5+u4ko3c62C1loDpsC\n8KrL1t6A7QpMk/XAMrPqwEPmFqlLEdv6FhzpOGyt4IEVnv6vdMTShcYw3tPvU/mD\njPtiVwpo8gWbGVIfpmwBg4wPaTrWK8V3+/1iTahIQHZfu4Lebb5mzht80HLQIcd8\n+oB4cGDEX4Rix1WxnCmE5ZzURY8xQXcvqYN+mTrUDh/3OtxQPSm5yC945SGoFNpr\nBYxfEyQcwulZrOMBdY0Ssj1AB5NOeC9OHwjJrnVe7dQ=","translations":{"en":{"changelog":"### Added\n- save/restore options for logged user\n- option to choose picture style (popup/small/big marker)\n [#25](https://gitlab.com/eneiluj/gpxpod-oc/issues/25) @eneiluj\n- add average speed and average moving speed in comparison table\n\n### Changed\n\n### Fixed\n- bug when python PIL is not available\n- deletion of bad parameter given to getGeoPicsFromFolder() in controller\n [#20](https://gitlab.com/eneiluj/gpxpod-oc/issues/20) @eneiluj\n- bug in file cleaning, bad use of array\\_unique\n [#22](https://gitlab.com/eneiluj/gpxpod-oc/issues/22) @eneiluj\n- python script do not need to be exectuable now\n [#23](https://gitlab.com/eneiluj/gpxpod-oc/issues/23) @eneiluj\n- jquery.colorbox was brought by \"First run wizard\" app, now included\n [#21](https://gitlab.com/eneiluj/gpxpod-oc/issues/21) @eneiluj\n- avoid JS error when failed to get options values by ajax"}}},{"version":"1.0.8","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":">=9.4.0","rawVersionSpec":">=9.4"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":">=5.5.0","rawVersionSpec":">=5.5"}],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-nightly.tar.gz","created":"2016-11-16T14:06:33.937534Z","licenses":["agpl"],"lastModified":"2016-11-16T14:06:33.971502Z","isNightly":true,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"JtUhKRDFGYDx9xtHjdfEUFOb0O4idexUYw6ixlBhKPP8Dn7NfyBfV6KH6MJTIVLU\nQ5Jw6tv/Nr1YDOvVikcWPG0p23mQdn1+7w8DzzIGKmknxCat9/vKr83oJZdWYxS7\nTJ4I7qTvWNlbMfK8OEdl13VJXgc6ftX+1isluLYqLjEm3aBFCS+/awYNMmXO55a1\nyG0NgJRu3pw1CBCMhDaRLsunhpRNDVLsamZj1SPmeT8qy0I/arFaG6hQnAo6JosE\ndi1XkvK6TEt9g16L6eizd+JpGE7xiWFP9ZEmMmmQSOLQYwU5Sk1YWcrW3EX4vtz5\nWnEIC0SENyyAyzBO6YJfu/EP2lLnlbNJiuc4zzKLqRw/zyz3j+imJLcXHIA78ZkQ\nuyUOBkkk3xeyBGeUcYfDuBqYQOQs+F/7+cNMsIBKJhx9ef3OPURBc7X16upk3mxV\n6GsOktbHkgUwWk3WiXRriBIqbAZocvDp0+PN++PAEZVWFEZEJzztd4Fxaeo+QSN5\n5Pz/9yXYRsoSPZv82Tlh7dx5tIPUvYb+UsANh5eGWUGufTSwgYBN0H2KT/iO35D7\nkDzNyh1qNakfBhAgPjrC2p4mBKBJJjlM0D9erDwr5D4GSTW2fp92vlRHeD0X8sqo\n3kBbwGuWnmhdJhbd7zYy0jVM6tVX/zgbhycimNALG0I=","translations":{"en":{"changelog":"### Added\n- save/restore options for logged user\n- option to choose picture style (popup/small/big marker)\n [#25](https://gitlab.com/eneiluj/gpxpod-oc/issues/25) @eneiluj\n\n### Changed\n\n### Fixed\n- bug when python PIL is not available\n- deletion of bad parameter given to getGeoPicsFromFolder() in controller\n [#20](https://gitlab.com/eneiluj/gpxpod-oc/issues/20) @eneiluj\n- bug in file cleaning, bad use of array\\_unique\n [#22](https://gitlab.com/eneiluj/gpxpod-oc/issues/22) @eneiluj\n- python script do not need to be exectuable now\n [#23](https://gitlab.com/eneiluj/gpxpod-oc/issues/23) @eneiluj\n- jquery.colorbox was brought by \"First run wizard\" app, now included\n [#21](https://gitlab.com/eneiluj/gpxpod-oc/issues/21) @eneiluj"}}},{"version":"1.0.7","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":">=9.4.0","rawVersionSpec":">=9.4"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":">=5.5.0","rawVersionSpec":">=5.5"}],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-1.0.7.tar.gz","created":"2016-11-14T00:57:37.521001Z","licenses":["agpl"],"lastModified":"2016-11-14T20:35:45.363487Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"SigBof6QJZ9IMZyFgc+B3LO2+EXaAPvnxUHjJQjIl3jLzomocpDGR6WjO6gtvB81\nzXUHjJ8+huc+P9TvgjUGRTmn9a/29HZ4IKTXnYBKIUY7wSLcJNMbJSp2Zd3OFHAG\nJwRaEdh/cIRk2X6NE1VT6dFCxB+LhTM4BXOEwuNYQvU1lZDVQgTz/r68zFLWBt6R\nqhBCNJHrVp87ecS4+XaGq/CfT4k1ihiOv+f4eX9iaPzUhxBJ71iYKF7wHpDoVmIk\nNrzWFUJH3BLBuW9oiC0PApli6Xu5RXrWUsOV7OAmxXgylRCPuTFwe09hw16JMbiS\nii8WFiUtp4qW53+7eoS7Fllm7CRi/Dg6Jvjtp3msrf1m+OiYM7dLyoKw22/S4P/a\nBIErZpSCHaCfrZ+DBXrAYcas27GWE7HizzG3yXk3aDJMa0Otcsq56bSPo01JDfNx\nm1y9iuwmlon8zKKoxsJCwxaFDnQpqazaLcUO0ATHUk8LdomTA7MCXVvNFPaO86Ea\n16iyw7Cfs0k3GrvN71+SdpvWss359CEEwBMpDwJZqwSFbLRyHtogUgbRWLIJqR4n\n5uVvJqirxWkr/EtXw6UkDWAI3ZoMhMRtjn4H4ekANP5mC8R0yp+UuFs2RkEC5uA0\nKzzh73WmxmpeUl6jcMZ49gXn3PTCC2fJNrdmSYch5Dc=","translations":{"en":{"changelog":"### Added\n- option to choose waypoint style\n- show elevation, lat, lng in waypoint popup\n- ability to display geotagged jpg pictures on the map\n- pictures slideshow with colorbox\n- pictures work in public dir link\n- use NC/OC thumbnails to display pictures on the map\n- options block hidden by default\n\n### Fixed\n- fix bug in geojson generation for waypoint-only files"}}},{"version":"1.0.6","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-1.0.6.tar.gz","created":"2016-11-07T12:11:00.619161Z","licenses":["agpl"],"lastModified":"2016-11-07T12:11:00.699921Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"WBts2fm2rW/7LMHYjcx9a0k0WTXV6PnGRxTl+158cjfV7ruMpNvhK58iTjrox69k\nFWAoIi1wNAlLBu9Xet1j7HKi4TC9q61IEN+lPlnwBCu0uHawiqS2gqB4i8A019Ei\noLsgAPWh8ndy6+gyUtPhVLVduLH76aT6KTwAiHPknV0zPtxsUy1P6nbbNOS5A5rG\nSQBqljy0TbcjOctTudEPp1IqjJIwcd12eZ9MLG4CEIO13n53pMAsuXJf4jnKSCm0\ngimvsFOwFRjBab3ZPwtOqeVw6aIh/lYF3U3/k8YBpaDN74m30nDtkp8teXBgshSY\nVYvX3yOAYe0PIR419IX0eoHb61K0VfZYvPT4FsOqjDr0zlVB8Rjq+6SiK4vMD2+6\neGE0aHbjR9HV5jymUnFYdm/hlhcZGaKrAiQKfBY6Vh0SWKfIv7bdGfQYauePAdZt\njlsV8lIwOy7FGAeP81CcjzWWfDeBgYr+MSzfoDNoTi41MvUaT14iWPIU/s5P1/Qv\nALGxgsbmB19wEgNbdh1UtTUY3xARLpWPYdUqU7yDcsddX9vCoCG2G5wCcbYJRj8o\nC+H7wdgPJoiMY/p4Go/lyWkvmzhfXrOeXytZIFXjb3ERVd1vD9WSt1DSy/7gsFYt\nxzzOPgqMvL3BbeluNuzNv366oT872s3OuFKa1ZOYY7A=","translations":{}},{"version":"1.0.5","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.6.0","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://pluton.cassio.pe/~julien/gpxpod-1.0.5.tar.gz","created":"2016-10-31T11:08:41.017766Z","licenses":["agpl"],"lastModified":"2016-10-31T11:08:41.068782Z","isNightly":false,"rawPhpVersionSpec":">=5.6","rawPlatformVersionSpec":">=9.0","signature":"UXeZVh5f0/WZE+r/dHWc1pu9q4qr/zACX6XraMhhIuKIp7vNCwUESeqJtVc99QZw\nw9kJp0isvib6l0zbQBRS1vI7xwKKBQyeaEhIciEs1JjsaCiato1Gyi26N+fY2N0Z\nFWlTwCsF3DdlwERXTYfeCpsOWCoxLxHKhnJIjUc0PVme/Ste4zxYj+5Su1RpadSw\n4vGnkW8zy/0tzua50NQCrOg+B4jXzH9kMWAP47w3sdP5CYalHSHl8EX0D1RjgGU5\n7vZYX3wF853FvQDbL4JXXCJupj3wZe8py8McWpQIcgz1p3KmE7A7d/rdNWExT+T+\nDxtStJ56qTRMz4aFwoSFxJrrEfgHIsE9Gv+Vo7nshCUYA8gkfHeckiaUtH1EiFTh\nVNeO6mTIqGpRosFvfUrZMKcuF5j74vGQjNM1o+M5N31gtLoPSkU605f/U4v+j2oC\n3/N1rYF2SEDFO0EgAGXaXVhB0ltSDkHJw6vZJ1L8Qz6tooUMDxaMri8vycA6LHvE\nqN+z+S6TXMfLvN/6ATYPGhicrWmkMT/k7v1az/hcnfH+zRyLZyFx94s88JWF7Jf+\nI+tgDbfqTMAIcytJUC+KfdQW1ueXh5F0owrOYM6jgBRvhqj1T8s+Twgw8orGmRPe\n9h8G9Z3wZAooQvmC0KdVhLuOeIkqt/S5krELNFFBRnk=","translations":{}}],"screenshots":[{"url":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/db5af6ba7ae1cd4d22ea81d418f5c762/screen1.jpg"},{"url":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/123588561a8067185572a8d1887ef906/screen2.jpg"},{"url":"https://gitlab.com/eneiluj/gpxpod-oc/uploads/427688b80bf8428dd45bd15d69b19075/screen3.jpg"}],"translations":{"en":{"name":"GpxPod","summary":"Display, analyse, compare and share gpx tracks","description":"\n# GpxPod owncloud/nextcloud application\n\nIf you want to help to translate this app in your language, take the english=>french files in \"l10n\" directory as examples.\n\nThis app's purpose is to display gpx, kml and tcx files collections,\nview elevation profiles and tracks stats, filter tracks,\n color tracks by speed, slope, elevation and compare divergent parts of similar tracks.\n\nIt's compatible with SQLite, MySQL and PostgreSQL databases.\n\nIt works with gpx/kml/tcx files anywhere in your files, files shared with you, files in folders shared with you.\nkml and tcx files will be displayed only if GpsBabel is found on the server system.\nElevations can be corrected for entire folders or specific track if SRTM.py (gpxelevations) is found.\nPersonal map tile servers can be added.\nIt works with encrypted data folder (server side encryption).\nA public link pointing to a specific track/folder can be shared if the corresponding gpx file/folder is already shared by public link.\n!!! GpxPod now uses the owncloud database to store meta-information. If you want to get rid of the .geojson, .geojson.colored and .markers produced by previous gpxpod versions, there are two buttons at the bottom of the \"Settings\" tab in user interface. !!!\nGeolocated pictures can be displayed if python PIL is installed on the server.\n\nGpxPod proudly uses Leaflet with lots of plugins to display the map.\n\nThis app is tested under Owncloud/Nextcloud 9.0/10 with Firefox and Chromium.\nThis app is under development.\n\nLink to Owncloud application website : https://apps.owncloud.com/content/show.php/GpxPod?content=174248\n\n## Install\n\nNo special installation instruction except :\n!! Server needs python2.x or 3.x \"gpxpy\" and \"geojson\" module to work !!\nThey may be installed with pip.\n\nFor example, on Debian-like systems :\n\n```\nsudo apt-get install python-pip\nsudo pip install gpxpy geojson\n```\nor on Redhat-like systems :\n```\nsudo yum install python-pip\nsudo pip install gpxpy geojson\n```\n\nThen put gpxpod directory in the Owncloud/Nextcloud apps to install.\nThere are several ways to do that.\n\n### Clone the git repository\n\n```\ncd /path/to/owncloud/apps\ngit clone https://gitlab.com/eneiluj/gpxpod-oc.git gpxpod\n```\n\n### Download from apps.owncloud.org\n\nExtract gpxpod archive you just downloaded from apps.owncloud.org :\n```\ncd /path/to/owncloud/apps\ntar xvf 174733-gpxpod-1.0.0.tar.gz\n```\n\n### Post install precautions\n\nJust in case, make python scripts executables :\n```\ncd /path/to/owncloud/apps\nchmod +x gpxpod/*.py\n```\n\n## Known issues\n\n* bad management of file names including simple or double quotes\n* _WARNING_, kml conversion will NOT work with recent kml files using the proprietary \"gx:track\" extension tag.\n\nAny feedback will be appreciated.\n\n "}},"isFeatured":false,"authors":[{"name":"Julien Veyssier","mail":"","homepage":""},{"name":"Fritz Kleinschroth","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEATCCAukCAhAaMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDMxMTA1MTI2WhcNMjcwMjA2MTA1MTI2WjARMQ8wDQYD\nVQQDDAZncHhwb2QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCq9p5l\nzNzR98l/xPgrplWrGQBhF6aQSLpnIyCdLAYKk+CmXn47W1pHh5CRYyCCyB8YPBBG\nTwbpP69pP1updfK2vUt+ShYmCXLxOLB3qEdhnwgqFfwpC48Ocev9d6XcacYp7jwu\nRNtv0ocMkm5o0TWWupcutQWkmqzCVq+OkrqM0xrf3mfPymuM6edEREshukoL86Ei\ngTuMMGT0XO99LikszvdceNQYEATix1MHzSVhkE7jHCNBXb95H6nQGr0v7R1MIbrI\nGFlgqxwwNNKwBFNfPMWZVnKwz9hoIwW6WOuu7ntwVcPqwB/gUsRZJTu7EjIW0trX\nnhA6xLlc4X66W1sdUCkJOxsV+Y21akz6wynI0SzIfjALLI2Ls4QWrPM8GOX8nPVM\nm+Y5WXzqLJScdWYoefFJKS7kxwUJRewREB9ykCG5OdDubV+Iu/6jh6HWx3h4p3ih\nqkDypPWoxpfLgA8VZkLD1RRKGkRa858QBGdF/RHbYT3JfLEp9l9gJVKZE/yw7HKk\nwsZ/T6CMpLyorpd1XWtp2wLX8lr3pp9ecVDOdAMSqD2thDMDsZA82JrJ/vITwkCF\nBlqtDZmT0UnpxYNYTfYBam5Cd00jsqCt+Hr+QkODNe8Yae9c/D0zE3h2Vt7g9H+W\n7Ei+rF5nDYTBAApoETxK7+aUZpycBf3THAJOcwIDAQABMA0GCSqGSIb3DQEBCwUA\nA4IBAQBbCGAEwg3M5QJDMnZgu0zNOH2f9bamAS9ksyCZqzLoeQic1W7GYYe9NqAi\n7lO5jXRZpTN4L133IUQPtxCxuDooD2vFmCne92tLxJbc7uqlSVfhL8uMVOlnrA99\nKTAhySTZU5so8/OibrngnBmcdWwbhaWoCQ671M8aXM1wg2FVYDqB2GP3RvbpW11L\nOc+4tfh4mO4TwXygf7KYMOJyJW8mNNY7PZ+XW2Qe3vSXR3DuN8H8fgMh5wppXPJf\nE0+yNs42hwFjSojtI8BCb0s5DTleaakpDo8HQGNzEXP8tBlUYudtjzdP0jxFXbFa\nsT9pcMdeJ0/t5HqJSx1EjUCLYS4y\n-----END CERTIFICATE-----"},{"id":"ownpad","categories":["tools"],"userDocs":"https://github.com/otetard/ownpad/blob/master/README.md#mimetype-detection","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/otetard/ownpad/issues","website":"","created":"2016-09-29T15:58:52.814912Z","lastModified":"2016-11-19T17:37:52.278497Z","releases":[{"version":"0.5.6","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/otetard/ownpad/releases/download/v0.5.6/ownpad.tar.gz","created":"2016-11-19T17:37:52.234684Z","licenses":["agpl"],"lastModified":"2016-11-19T17:37:52.423930Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"dh+Txg1iVfqXr8+cxplNQuBZGErSnXUo0ewGwnybNMJqp8/EjEo72+zPpW3dVnhY\n67YCvhrm2bo+VRdFFymEfymzSJu9nWVFkGJhEwvTxPyIdAtuD5YAVrzmnR6L+H7m\n7Q1nXE63ICPCAQpHkxIfIXLh25OhWeyofBB8AVsjDUNn58FEYJ8fFkr6dCgPriZS\nsM2J+xtZMDYufy+xFMsVf/Q3WopjFuBjMC3qOecW76ZTwtREaswOC2RtpzUku2r1\nsogrfFlFer3Ii9/CWgOktnLfjB1DzbTwdEkM2xNVBRJgdMXt2VLA9FsxFFkjmr5A\nl7x9cNLWA8RLpOIpIMBbaef75u5HgRBvSvq114UsA9GCu/EYbIgD8YxEt7xuKd4t\nenksJB5gJ2IQNdHrPbsil59AsJ/dismDN6ktYgWQEk5dINzvm9EAvucueW0Gt+Jr\nqEC5WBgJucsFxSvkHh52v43M8jgPYBfHWEL/M/+377z3+mbuIh+BcQ+vcDdiqxTF\no3n0+gw3QYIhLEe75sUhxG6ynVUdW25AKKju1kVj3KJnZTBH1R8t8/zy4DnJG8d4\nuRGqyU4BXpZjEC3nVlsC7vCncWWhxl0WZQ/MWKqsfjVAU4I88E518D6NioqMnPEJ\niCZ2x+69UCDEQyfCSKajgAYT17r3OhZei8F9KSCH8Vw=","translations":{}},{"version":"0.5.5","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <11.0.0","minIntSize":32,"download":"https://github.com/otetard/ownpad/releases/download/v0.5.5/ownpad.tar.gz","created":"2016-10-06T07:51:05.278637Z","licenses":["agpl"],"lastModified":"2016-10-06T07:51:05.348825Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=10","signature":"nYsQ9U5r7uXwtcquaWGm2XMJBNYCcA95aUx9gLZ/wEmjCHqId7+MzcCdBnom33+j\nat2XR2a4R96UAUP78bfSC4Yb7nPepFT51Y8CSpV3mDT85/+SgJdq500fXldq+qGY\nffXLneadAztyOfZO9TXljaCLdREYI0LJIGVENsxBQVKM/eyGIuZO7fF70cH5vbfS\ns37+BXB+fxcDTlP2Xuulra8HsNoS81bzjsdVMLM7B7QwwO6rZ1zd5c3UzQ1LmY5g\npQUBNd0KjfHfZ6+Fd64XZO6NGfgucGNmL3lgxdsfUqKiLtikvFxK39dYW5MckV8p\nvLoS2nZ7cgETQmAW9Ahn3ro7gXWcPxzL41oWtZOOHRRC2Yz5zlZ3Bky1o+bF9g5a\nYdDF13zV6utUkhlplZhWbjKaXa04rzOvmut8Iqhx/tmDtZRYtaQXJZWutVJYtPC3\nH86uJJnUHHNFHeoT560mp1Hq0dTeR+G+yWsPacPD1rTYgZOUVEtj3Y+YdbTODR2o\nOdGzeYFl+6CL/OcY4wPGRUCTFwvc31lIUd4DK5SPfN+IGtuuXhAqVhwy6lpkcKRs\ncj8sBoVXbMvEtMnt5uARBvA4tyVffUL4oyoIsUnvXz4u+q4WVt3T17swLm6HjGVC\nNVqU0srHN7EeBRhHlXP1CrKQWGQlS4k9j9Li4Iw+X8s=","translations":{}}],"screenshots":[],"translations":{"en":{"name":"Ownpad","summary":"\n Create and open Etherpad and Ethercalc documents.\n ","description":"\n Ownpad is an ownCloud application that allows to create and open\n Etherpad and Ethercalc documents.\n\n This application requires to have access to an instance of\n Etherpad and/or Ethercalc to work properly.\n "}},"isFeatured":false,"authors":[{"name":"Olivier Tétard","mail":"olivier.tetard@miskin.fr","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEATCCAukCAhAPMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYwOTI5MTU1NDA3WhcNMjcwMTA1MTU1NDA3WjARMQ8wDQYD\nVQQDDAZvd25wYWQwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC6CY7I\nHRJTaqDu376vt+kruX+QOL864joScxRuh3IOVcQktCvxasuA0EtrX7TCAQrV1tBK\nfkqJxU9uOV54RTgyh30yH/ZtnF2bYQwViGM06Snc0riqWydFrN5fxK52dpZWs63o\nUFCNhHxrX4aUGyfXu5nQMISLm4QHoZ3LDLofk1ZsiK62fM/Jz8N2PM8qeHzf1ATo\nSKcAOd3UeaS9C8bv2DuiZM7unkSO/tjrBzkMiq8ds9sIzBBsyk6BRh2HQjHPOtmO\ned+pS9mIZmc2xhssXoHL4IfZwTqwhktpsaTl7v0ROw2dwDATz/QoKMkUpboQ5lkz\nwgLQhoIZw6uAZ1R/Qjze59I3iU8zIo9quDarHBotZNXboYCmg9FRfE4mHtegVaa8\nv1a1JvFQ5gvsWEsKSV6Bzb65GTp4KG4q7YnUrzh6HJyDCGLvLlWm5OWsFj6sNzXX\nwLOv6JLORMbF4ZIo2iybb3x7gdfCu9JxMZ4JtOUC8KSJ6+ub15C1Aia3lN68dNts\nY6KwUF1Ted0o4OQPAulq5pUc+g6dTYmIKsavIiPKhMtl86AbUK50vRTeuGdFsT7X\nav73IanPdFI9bKth+tajgvB6dxcVnvBXbrsLUyEcsxsxtBJvQcMYS4aZ6ZJYLTep\n7AdK0Zt1iMdXB8+4PCps4rcG6bYB/uJeEAVm7QIDAQABMA0GCSqGSIb3DQEBCwUA\nA4IBAQCM10O+sCYhIExnx01vGzKlnRS7MSQNx8ZMmbR5Elfz4AVJAEJ96ytS2DXH\n2c+hcD0wAenXQEFk920AEqFQBT8DP34p0FmF83aMHW08ovzFiu4MdlhcqrLnko0h\ncZTXHVyS/8JZh+o6SVm8R0/BBLF1MQQ5TqRkJehbmk6gL0+MSYxehUDKWTjJITkR\nifneTw/Ba1d0AXBOq0c0HFyGxMPIlWe4qn5LtxH5t0wyVGeSj4jyv4nvd3ZGuAgY\nEUa2uYht/z475k4+vf0YhV98iQH07GnmlfD2TDZgmOCQGKlNfJh1v88OZyLLa3dz\ngRHzGwKbAiJ8T8bbpZ3e2ozXxADr\n-----END CERTIFICATE-----"},{"id":"announcementcenter","categories":["organization"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/nextcloud/announcementcenter/issues","website":"https://github.com/nextcloud/announcementcenter","created":"2016-09-14T10:38:53.939634Z","lastModified":"2016-11-24T11:21:50.324839Z","releases":[{"version":"2.0.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=10.0.0 <11.0.0","minIntSize":32,"download":"https://github.com/nextcloud/announcementcenter/releases/download/v2.0.1/announcementcenter-2.0.1.tar.gz","created":"2016-11-24T11:21:50.317635Z","licenses":["agpl"],"lastModified":"2016-11-24T11:21:50.386203Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=10 <=10","signature":"lmqeE6xBqUJfhuXPbjCfuWiIP0FEB4V/SsF/OvYar6rLpvDpJVf3DJoeIoxXurRP\nE9/xCcNN44P8PreRRDnFLCa0XsKOtwoGa56Lxk7IKvtiQG6xu4J6PKM+q/tIeF9K\nakw0LQXtjZB5InPhnCDDbY5YS9jgGEBylSHsgNgrElipcW+BzOBu1Amw4FECVlQw\ncQ83bio+YPZvsnE5+v3/bAx0m6QNxfyN9Sn6rMEqRkY3jfA3vejXGQH/XkputfV+\n5hOz48KbOVg7cKxg+ieJlSwC0aYjb+RXiopjc3icCoIF1llltOOeSsVYSflOb080\nupociPgQ6qIab/VNNXa2YQ==","translations":{}},{"version":"2.0.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/announcementcenter/releases/download/v2.0.0/announcementcenter-2.0.0.tar.gz","created":"2016-10-06T12:41:56.195206Z","licenses":["agpl"],"lastModified":"2016-10-06T12:41:56.263124Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=10 <=11","signature":"NVWYz73KtuoZ7ti2sluztJO5aFUc7PzhlDcg0VWyAQd1H7sk5wjw7i0bhrjw8O7M\nLsrb+PegnsL9eMlYM2WrRom+RF1PDP482xymZf1T8vh8qcTCm3TK89xSuiSm8yoA\niWUb/Uv/ODj74wVDWqWxAFKaAG/FestCB3InOOZQqQZLzlAV0U9ziYDGNzBjFqof\n9rLNxJ2IOqZOA7hhMIKhSrpA0KkSfNhBsVf8CWClYnVkZQiq0LoYkHkHIlXmXUr3\nOfQFKEjtsx+bNLa6CkAaocHGHJXAofX3GQZ9cjBsjZqiTfbXfcVk0kRfz7pwL92L\nI1McfJYvgMxDQG5bjRpNJw==","translations":{}}],"screenshots":[{"url":"https://github.com/nextcloud/announcementcenter/raw/stable10/docs/AnnouncementCenterFrontpage.png"}],"translations":{"en":{"name":"Announcement Center","summary":"An announcement center for Nextcloud","description":"An announcement center for Nextcloud"}},"isFeatured":true,"authors":[{"name":"Joas Schilling","mail":"","homepage":""}],"ratingRecent":0.75,"ratingOverall":0.75,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIDDTCCAfUCAhABMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwODIzMDkyNTQ0WhcNMjYxMTI5MDkyNTQ0WjAdMRswGQYD\r\nVQQDDBJhbm5vdW5jZW1lbnRjZW50ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\r\nggEKAoIBAQDPx4Hp1HdBo5v7bDEiVcv2UrVjNW+fPPKS/5rwbagtPcE/1v3WDcwX\r\nvFwaXk8qCn2UpPSQ2b1rTuTDm51G1ZmEZhNiio+rBfEe9F+3tLsq9lElqIPKhkAq\r\nEUVI6dcN+jSqvLmLhuwloEoQQSYaLrX75mY3lGqTb83h1l2Pk/brVixuVf4vJW31\r\nTgeieuGKnC+keLzKOrvTHffJakU8ktwB2Nuu1o+jN5a7u1bxKkP3LjEWPjq236hk\r\nAoOcW/wi1dUEyUKUZsZQeJyvTJh1UXdLHKwYywtUu1/VLZ1IUtNyPBfiQ8ukPp3T\r\nTnSSmG3ZnvsfM6DmAvLZ8bBQkMBzEcTLAgMBAAEwDQYJKoZIhvcNAQELBQADggEB\r\nAAB3i2NgiZ4rpNag7cXYdaFxAxdDWnke1+LX2V2R3hzGmx73/W6cKLpo3JBn9+zT\r\n1aEjlqkt0yHu4aAPVYQzOa5zIV8mjP84p3ODSyV9J8lfjFNXT7wdA8+9PVx3lVki\r\n2ONoCNBh1kOxnxI4+BsMlQfF00ZbBSuGcMm3Ep3lTFWXzuUn3MQITzPwkL5LkW6a\r\nsli/yAYQRTVDsXD8A3ACYT7BG31jGxyXtIHzqCci0MhZFdKKayMYkwfjZchIUtGN\r\nJJoU8LQoHwGRtp3wutk0GlFzpEQEvSsn/Lsvvot5IfIe46tnzA6MVj5s64s5G8+Q\r\nphhXFlzXqO/VxquPdbfYjvU=\r\n-----END CERTIFICATE-----"},{"id":"ocsms","categories":["tools"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/nerzhul/ocsms/issues","website":"https://github.com/nerzhul/ocsms","created":"2016-09-19T21:56:04.745481Z","lastModified":"2016-11-11T16:29:55.864273Z","releases":[{"version":"1.10.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0","minIntSize":32,"download":"https://ftp.unix-experience.fr/owncloud-sms/v1.10.1.tar.gz","created":"2016-11-11T16:29:55.856768Z","licenses":["agpl"],"lastModified":"2016-11-11T16:29:55.947926Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9.0","signature":"hVzbkmmtJCtiOkZGe1mkWElqS3IPQ8wLtSzikVvoKmcg+Zq3YLQjpQWzy0t3UVjo\n9I/BfnL0bF+kjtGc9xF6M8IQaFqPrfJmN+lNT8WYIKLI97TTsLmJGg8Q8PAux3nY\n8/NxMjWdByMw9nVBClKo0o9eSW4+EnaUSJ62Gl/XWjq728kbB16WZm+iesk8LjJJ\nqqAgczWGwz6lkZTCN5o9n0a/YoLJTf4iT+OItHZyS609Cqaxx9CAmZPj/Xn5g1fm\n8hqO2ITAXLoBj4rYS/QsZTMcubtGkJ8fq3XYKVSv2UXZfvGsNWbbGV7puKN33uWJ\n5MrdoMlJ8XnJRPDlCBcb00LY+AB+hAMooLnNy765/Ew6ztp4KNLEPWGG+Ut8/Lkk\n0jIULl1RF/FjlW8P26NfwH36K30RCJFY06OFcWnxGBkkQaNFORDIsKcqTAxkl4x5\nnfKBkNdQZppCVfOSKOZj4NkWfWx75Ouq1S0QksmOsMZoOcjy1TbBKR8h6dt9DQub\nWpYBL0QwyQShGp0Vb1qCKkP69ZQAHVUJNzIFPz9LyoguvFyv8iZmAPLYDnFBvlf2\nnSHtA19rnJmZ4H7RJ02r6BdkstxISvEiHU7RLjNQxcb+DptIWX5C03wH87HTNIhr\nvptPorEoSY1KwW9fqUvvLE/c+vfkr5cvIEwZlyVKVXU=","translations":{}}],"screenshots":[],"translations":{"en":{"name":"ownCloud SMS","summary":"A app to sync SMS with your ownCloud","description":"A app to sync SMS with your ownCloud"}},"isFeatured":false,"authors":[{"name":"Loic Blot","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEADCCAugCAhALMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTE5MjE1MzU5WhcNMjYxMjI2MjE1MzU5WjAQMQ4wDAYD\r\nVQQDDAVvY3NtczCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANqZVIzM\r\nwBJuacuvgYKr2KnXuYhjKjZ58nfspSebsaGLr0ifBbo8L+NH5eaynnLCNhpegmu0\r\nO8D+KrbM1LtIkcdg1/eFpN5dTc6G2OAc9H9stmHs9nroF6MNhszgdZCz8Q8xkSoD\r\nGdSm8hdPg5GcfLrH27UilGtzdQlWJ1DralLMt3l+SfGJo152c/dc+e6SuT8+EbY2\r\nCeLdH5ImasXNpUgY+tAoEt2ZvhBrUghykBJTJVOjwL1jGLT37ybMtV4FBKo6hpeg\r\ntq/YzEk1ijBAC4pmoNWixDKCdolpVJVz0fijI9mlda3llurcp8eMhxfYJ9soXLHp\r\njvLX02YY6RfPcyy48uWVk4IEt9BvZWEVAAp7hCGA2yXrVSsR37E6sDbLsBcKav9A\r\n6dkGAgfmGkr2WT6O1/EhK/MakmnYO4WD1B+E7PnxtP/wOa+aQBmntQcd7igDiwzG\r\n6h05NYAWcRhqfZ4KWYsq0t0SezMbuHOhwzzi22q8wijC5YZbmhKSh+b3N8XwYKDi\r\nZaw+fSahPbRWaLyR3wn9zh7vKCwqrG3ugrNo6CtyoACAnmxKZ97ROFJIQTe3ndLL\r\nmv7Wy8iCZLhRYUaW/GKrF11AFwBVec9xmvkgU+PIKq2HSjwi9sCF+pFyhVjmq29C\r\nmZEPKUV7ySIpNHXpsXm8kTJJfqjSdb2ECbLfAgMBAAEwDQYJKoZIhvcNAQELBQAD\r\nggEBABvn97e8Nw8KAscf6FX/nZ99rEX+3IrZxTC8fmBgNwAvlbF2A+QZQcFI4G9/\r\n85nHK117+u7XDuwWl4QG3flWlI0hDE59Ud9Bd4AiTQ12VoXlNdYoTg/mXARxVozb\r\nKYqZ+1xRQclZKb2AqW8YiGo18okIKovn9VVRAFYPYx4O3Ve1FjgfsaMlIZLiXUFm\r\nkk+2qWo6kYsdU9FABLo6izx7RFOMbnYNre5FmDrWP1Dga/U7ErK/Dilh8g9b3HrP\r\nwP8OIZhdtFWw21wDTfyqrb9EhC/tsjPVP9u+bqyognHeiMhjbVYRbSvz5o8T7Mhj\r\nbxalCt4/LnMIfMwVyIvye7Uy2GY=\r\n-----END CERTIFICATE-----"},{"id":"rainloop","categories":["social","tools"],"userDocs":"","adminDocs":"","developerDocs":"","issueTracker":"https://github.com/RainLoop/rainloop-webmail/issues","website":"http://www.rainloop.net/","created":"2016-10-20T04:17:37.217555Z","lastModified":"2016-11-18T11:36:04.309739Z","releases":[{"version":"4.26.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":">=5.4.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/pierre-alain-b/rainloop-nextcloud/releases/download/v4.26.0/rainloop-4.26.0.tar.gz","created":"2016-10-20T04:28:21.491747Z","licenses":["agpl"],"lastModified":"2016-11-18T11:36:04.619927Z","isNightly":false,"rawPhpVersionSpec":">=5.4","rawPlatformVersionSpec":">=10 <=11","signature":"nTYIVSB6mIwKtXIrKoVGsOGFflpLjed8jFem1VLQNtXQj4bztnNrdc4YaPIn0yzM\nyLpMSqRDNzdYNFuOeDiyKLPJPTA++MotLCNjEe7kxUekek+m+qzgnGBdcT7RQT6R\np9xWGecnVx94d6aA55uiRhgQRyHpdDMMLCOz1be+HvpwHy69DRFZ1+SPmGUt6eW0\nu5yS0vHCu1K22cbrVNXFKjxAOlGcIDm61oQuz7ycl3uAujZO4rZbWt55jilgKGak\new559A5gTp9W+j+TWKIcg6LIZ9zLRlGjcQrWJrsc+OBZQcqiYimSFyO6HhfT9TPS\nPof//I+dSsd+H0SRGGeL8DvSnK+NKZL1q5EX5pziqsv6nZFITpCDwmAN+I8AnXXL\nSNkFi53M8RZTOABpD2x7YPYP1cEvwrRweqV/C/oHcYnpfh7D2DjFeWwXsjeAXrHY\nhgFhPrg+7rf7g6UmJFOCp0dC9sBdyQ3KtJkv7bGqPr854r2cdA7xW0QHWQ2in9qQ\nLhIczc32ECi3ZVVgyF8zyT4Y/3MRS05oX3FHvHyt88mjni6bVaO78F7ZRSha8gHh\nNOAkku7AMXPvUCHaZP2iVCCoAViEso8GeR3O8xh2G42Ai61RLYwx8LB1+23EoJTr\nmfFuRYNSg+qAKCokXNnh+lDlwu4AkaQo3vtKGPXvU7A=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/pierre-alain-b/rainloop-nextcloud/master/screenshots/2016.10.20-screenshot.jpg"}],"translations":{"en":{"name":"RainLoop","summary":"RainLoop Webmail","description":"Simple, modern and fast web-based email client."}},"isFeatured":false,"authors":[{"name":"RainLoop Team","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEAzCCAusCAhAXMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDE5MTkzNDEwWhcNMjcwMTI1MTkzNDEwWjATMREwDwYD\nVQQDDAhyYWlubG9vcDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANqB\n5jnF9qZ/qjckt0kRjpHCOMtJumW/KiQoMeNP5nGv4ad0DS3KemOapUef8Zn7qCYb\nMnODhK7HBwPifFzI1j8bnT2hP6E0geFLb0MdN59d2NF0n4CCs1+BnepQPJ1kFbPK\n35wQRi0RDeTf/GQ+/owEVCU9a9W1P/VUXk8Z0vMoQxCXEdRqnB63SgsKl7DB9G/C\n4SYrgGor+OHVGl4ntMZhJujiM996DttrNK3iZRGkQ07L+lfUIwQ52XOhQNRdic4p\nB03lw7PpChwPGMv/EEvdR5HpCJQBJniqJbbu3Jh8bMBKTE/8fCzN3vMXICB2g3Bq\nlKkZW6fnJRGsrZ79fsQnl+WBPNSrWRLOxOfe1fyCFV1ljFB4nTH7uF3pC8ZRgJes\nkHIESHz3GJm28hn4+17ESMGHBCbs7L9FK2GY31cobU0VRntLxpSG+d9njbIAgMG1\nS7U+oKVFQhSVpdXNOaUNqhcQ3HkbQTLEP0k53A/lhLQb2+KPd8nntaELjwNyrmZg\nsVMgHj/zdlvrbguZjZFzUzDBFvkuv/5M58lNT/D1C6ufVp/R6eLsYI+nnk1ojAjz\nl7N6U8X5SXpD+Bm7+Kn1PH+bHl7cViCx8oXJXO2RhP+COXckw7BDZKtjItYHNG7M\npFwgYqWpvCu9LN6IN5a/eLqSI76dOOP3iYbaTH+NAgMBAAEwDQYJKoZIhvcNAQEL\nBQADggEBAGB0Vq0l6ndGTgNbZxSEFyBR3u3tiR3pWK81DYjsui7qBoO6P/BaGmf+\nraSwHPaBOwA9XNS8jcGLh5xdqY2p/m0dTS64xNjVL9nweWsG+FwVnPANo8C4nXdm\n9ajJ4cdg54stQK8qn1uh/xPcd23GKfYJazjYSwYmZ3pXXdzlGN9NxkeYJQxJ6B+5\npzAeVGiABI/e5URpxzz2UayRX7EE+vtpe3B84hzkLqsq0N39ZN6KLfaTyEBGLzqE\niLYeXQTV0XSRs8xVt+iyGlj7nPkv2DR0oCqRpWUFWeSBI//niDG5WxS3qg8kacSW\nfDSYhSN+IjrnIkwNtc8V9t7/GeQB5FE=\n-----END CERTIFICATE-----"},{"id":"richdocuments","categories":["integration","office"],"userDocs":"https://nextcloud.com/collaboraonline/","adminDocs":"https://nextcloud.com/collaboraonline/","developerDocs":"","issueTracker":"https://github.com/owncloud/richdocuments/issues","website":"","created":"2016-10-31T08:55:45.631429Z","lastModified":"2016-11-24T12:13:53.905352Z","releases":[{"version":"1.1.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=8.2.0 <9.3.0","minIntSize":32,"download":"https://github.com/owncloud/richdocuments/releases/download/1.1.3/richdocuments.tar.gz","created":"2016-10-31T09:03:40.389355Z","licenses":["agpl"],"lastModified":"2016-10-31T09:03:40.439510Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=8.2 <=9.2","signature":"s5giQeiU2zwV5X6FmxWXiG9LtNDeKBlFqK+hfvGNbGZ+nic77Y+AnXHodV4lb3Ko\n0C0ThFLuafaZRdp9rBIN2K/acCfCYKJewGuYErb7FlEl+P9J4OQbb9pva0htZJw6\niuG5eyeTufi5MKB4vuj4+jo9zhepOFAtZMa7o+ZCfJkt8vDBuq5AXxomEiZRtW+n\nf9PPUnq0z7DJVwINhHvvBZJlSLjkpJ6VIHAr+/ElWr8O/mDKq5S5ohbvpDcPqR7b\njnsBckFDLFUz1FX9dA0JCJEKMMfkcfGqZcjH17NdjKAxRW2soN5cEKluu5MkOhz9\nFEPKfshzbrfUIm5MaFGv6w==","translations":{}},{"version":"1.1.14","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/owncloud/richdocuments/releases/download/1.1.14/richdocuments.tar.gz","created":"2016-11-24T12:10:13.337165Z","licenses":["agpl"],"lastModified":"2016-11-24T12:13:53.963638Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"prDGlfRPxqT6LP0BsAFPwGww7P4Bngha2N4u5B6+F02N+RVOjGtTcXKqvM1KjZb1\nCo7qJvgJmjpvIvDmB+rup02i8ObfwP2ct6UdsD7ouzOWJG2sJANXK31bHyvOmQ2h\nvKu5eNcOkf+WFyFKYi51TbsfWn2+1Wge3WWujKAVcEvqtcOOz+uMWNtqzBptEupk\nE1aaRnQfTx488YB8Ubul06LIY0PNCHgGCWPgy817tOVT7JA+V0P0FFonl/PXE0dr\nWgtxRJmvGaNiFzYq+kQmdKMfayZTm3kdVgP0W52t5wp878K0i4s2KPg5lANvjTz7\nDCT+VV2IGIE52o4RpMUGyQ==","translations":{}}],"screenshots":[{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-document.png"},{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-app.png"},{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-presentation.png"},{"url":"https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-spreadsheet.png"}],"translations":{"en":{"name":"Collabora Online","summary":"Edit office documents directly in your browser.","description":"Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that."}},"isFeatured":false,"authors":[{"name":"Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIDCDCCAfACAhAZMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYxMDMxMDg1NDExWhcNMjcwMjA2MDg1NDExWjAYMRYwFAYD\nVQQDEw1yaWNoZG9jdW1lbnRzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEA1jk29m6JykcJ2Ld0YEpjPMYh6kwxY6GysNJnfkA/th7tPWL3+vBJ9oTYyVnZ\njwAE1Cqwfa9MyBKMZ2IdfIqtT8PeWzuFP7Ib942EdxUpwwh9F3lykeGsj0h4zQwX\nF9OooiS99PfLX+JpkKm15Ujb00iLB6xQmq0+3NeOT1CTD1ziJ1ueOcxBKMwaFp2a\nPuz3F5ywqCvpmxG/OBuOs0LI3/zStXhBNbUMxBrWblr7zaVNJXl/I2JCKj8Wah/H\nXUEEGbW15fAUP1f+90eQSxpEoCZDBHXOQCTJYzySGv+BjU+qlI9/gS0QbrsiyzUf\nO5lyvi8LvUZBzpBw+yg1U75rqQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQA9jU3m\nZmD0ywO3MUsG/GLigFtcWi/p7zp2BliR+NpuY2qNFYDcsIb8ZUudmUc/cJRRctzy\nAPaLLj/d+h5RFaxjTVvim1PSe6M7urK/IMSvyUVYCeQRYpG8ZJixKTCOVIBaWHMz\nxTfc51tm9EPlpJpK6JtaWrYYoWGE3k9sINdJ4JkvKkE2CBAqVhX6ZGyEQ0bnEhtk\nRu1DXn+LW7TJ4NZ8VtLWvmW/6Kfmi7dQ1V++Kmn0lO5ntRt5altePbStCHC8bhGp\nmyBOrjhrJgLIwvgH26MYZhdiSkFzoE38nMPZdrUmUDxcPCwucWJqgzDPudguFthj\nWCVZ3TTG/2z3+tWM\n-----END CERTIFICATE-----"},{"id":"ocr","categories":["files","tools"],"userDocs":"https://janis91.github.io/ocr/","adminDocs":"https://github.com/janis91/ocr/wiki","developerDocs":"https://github.com/janis91/ocr/wiki","issueTracker":"https://github.com/janis91/ocr/issues","website":"https://janis91.github.io/ocr/","created":"2016-09-19T12:07:49.220376Z","lastModified":"2016-11-21T11:22:21.024501Z","releases":[{"version":"1.0.0","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":"*","rawVersionSpec":"*"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"}],"shellCommands":["ocrmypdf","tesseract"],"phpVersionSpec":">=5.6.0 <8.0.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/janis91/ocr/releases/download/v1.0.0/ocr.tar.gz","created":"2016-10-24T06:50:43.283900Z","licenses":["agpl"],"lastModified":"2016-11-21T11:22:21.269108Z","isNightly":false,"rawPhpVersionSpec":">=5.6 <=7","rawPlatformVersionSpec":">=10 <=11","signature":"CBJkCIiUKyf2NuWfz2zJ3grhf8p7wJes7DPV/OxUzhlxIH0Fh7K54+U5A9JOOi6f\nWPhjXG1ylkyIVY1glr/B8svWNsD4jAclpnUi1/9ZW5UPT8LnRBfTbtF9Uoj0OgNs\ntsGQYbpuREoHnjbJWTRe0kq1OsOfX44xuf8PuX43B+lpQPW4iRSSz3ZIhdPcDGq1\n7pyqQM7gdKhBQ6/tOiwd7Enyt5Hi4V6jhwhUOCYeTNiLD2V3yKL+qA9DzpXUfNNw\nLGTjcaMrifibHQIZBZWbPPMmCfMJZ7GO9oR4gWHwkhWqt0yVWAJXAHJBLd5vXC5I\njtRTXRpHO/k6Dtqem8tZCVoDE5MAC7fDZ/0XzoFiXHciP6MenVasVcXo6xJOJc5y\nGsrecNftUEhP/ngxA6lMBVkLmmdpiexVisvsavPi64i34OUA6qOuxjgNVBDwg56i\n2lOEVvHa3nn0UX7ZZoQ/Nu6Mz7J3Hx/VDlttPuWe42eeJAphyDGubT1M62gW8dVB\nD3tJOF7spnK6I3BhVLviou/zs30AIRVBDTU0Orzx78cbInwy6/vyJib2a1olAaHz\nv05SzlQRnBWM4jYBe0mA/2ds9AO6VrXGrT/iLlHemj6JYoGBM185TGewA7OJyX3a\nHSlSDqaremmi+aS3onx3AKhXykDxTRkMVarePwTzzFs=","translations":{}},{"version":"0.8.8","phpExtensions":[],"databases":[{"id":"pgsql","versionSpec":"*","rawVersionSpec":"*"},{"id":"mysql","versionSpec":"*","rawVersionSpec":"*"},{"id":"sqlite","versionSpec":"*","rawVersionSpec":"*"}],"shellCommands":["ocrmypdf","tesseract"],"phpVersionSpec":">=5.6.0 <8.0.0","platformVersionSpec":">=10.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/janis91/ocr/releases/download/v0.8.8-beta/ocr-0.8.8-beta.tar.gz","created":"2016-10-10T18:01:16.076330Z","licenses":["agpl"],"lastModified":"2016-10-10T18:01:16.169733Z","isNightly":false,"rawPhpVersionSpec":">=5.6 <=7","rawPlatformVersionSpec":">=10 <=11","signature":"uEvhHfQCrzb6z+QuOoO8rYXiMsZFkrFWEqDvTyOTSgFKvo7dVoj3EfDfaApgcKEB\nIM/SqjLSO0lNhrp8F2mST3twbvLDprKsfrDWKFE6eiH0yKl2aNB+cHWE27utARaX\n/QZBD114vbWeDnbaBa4b9OwtBXDqKJrnO1LmqSLFP8guAlVTkU1jSPkRTpmwAcAZ\nJA/aiN/D2LSGfiNp/YdeTuzU+gPINIs9dCb6+PPkyam8PCBaXUSSaW+c0lAQHln+\ntb3EXxZ5YXdjPWrpEyHvFLk1N8s/w615QoMxr5fEs1M8D29aGbcL/wu7LXH4X0Yn\noiWwIFbpfrpJQlrIFumxWZR74JXiNr9J7ijnQ7SjxdHCcrLxMdnZ2cwq4iD6PnYm\nnIojhlhPOqUIzsWYCYutLWDQbUQz9eyWbj/+7XL+5KjetUUr/MnCu6xJ27IqFbAX\nHc8KRCO+9I0/qMQ2/rCZXBMeo39MGhhkgkVl5YAKwC1IEN/jlfyVNXZwYlfcHLKj\n6aNQ4zN6gGOerWWZ8qXtOeNJN+qv0nmXUKrZdnZUAhxOdB4G9Ym+JujxJZ9yNIWV\nsiqAI9J+OIzCwv/dzZhaHadONoo/RTF+Fl6Hy56HyBtMehb8w9p8ksVediqf33yt\nFAE/tzKtNK5NiRd+8MZkq/GbocaFUv3C7Y6pLMpTE1c=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc1.png"},{"url":"https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc2.png"},{"url":"https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc3.png"}],"translations":{"en":{"name":"OCR","summary":"Character recoginition for your images and pdf files.","description":"# Description\n\nNextcloud OCR (optical character recoginition) processing for images and PDF with tesseract-ocr and OCRmyPDF brings OCR capability to your Nextcloud 10.\nThe app uses tesseract-ocr, OCRmyPDF and a php internal message queueing service in order to process images (png, jpeg, tiff) and PDF (currently not all PDF-types are supported, for more information see [here](https://github.com/jbarlow83/OCRmyPDF)) asynchronously and save the output file to the same folder in nextcloud, so you are able to search in it.\nThe source data won't get lost. Instead:\n - in case of a PDF a copy will be saved with an extra layer of the processed text, so that you are able to search in it.\n - in case of a image the result of the OCR processing will be saved in a .txt file next to the image (same folder).\n\n**One big feature is the asynchronous ocr processing brought by the internal php message queueing system (Semaphore functions), which supports workers to handle tasks asynchronous from the rest of nextcloud.**\n\n## Prerequisites, Requirements and Dependencies\nThe OCR app has some prerequisites:\n - **[Nextcloud 10](https://nextcloud.com/)** or higher\n - **Linux** server as environment. (tested with Debian 8, Raspbian and Ubuntu 14.04 (Trusty))\n - **[OCRmyPDF](https://github.com/jbarlow83/OCRmyPDF)** >v2.x (tested with v4.1.3 (v4 is recommended))\n - **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** >v3.02.02 with corresponding language files (e.g. tesseract-ocr-eng)\n\nFor further information see the homepage or the appropriate documentation."},"de":{"name":"OCR","summary":"Schrifterkennung für Bilder (mit Text) und PDF Dateien.","description":"# Beschreibung\n\nOCR (Automatische Texterkennung) für Bilder (mit Text) und PDF Dateien mithilfe von tesseract-ocr und OCRmyPDF ermöglicht Ihnen automatische Schrifterkennung direkt in Ihrer Nextcloud 10.\nDie App nutzt Tesseract-ocr, OCRmyPDF und den internen Message Queueing Service von PHP, um so asynchron (im Hintegrund) Bilder (PNG, JPEG, TIFF) und PDFs (aktuell werden nicht alle Typen unterstützt, näheres [hier](https://github.com/jbarlow83/OCRmyPDF)) zu verarbeiten. Das Ergebnis, welches jetzt durchsuchbar, kopierbar und ähnliches ist, wird anschließend im selben Ordner gespeichert, wie die Ursprungsdatei.\nDie Ursuprungsdatei geht dabei nicht verloren:\n - im Falle einer PDF wird eine Kopie mit einer zusätzlichen Textebene gespeichert, damit sie durchsuchbar und kopierbar wird.\n - im Falle eines Bildes wird das Resultat in einer txt-Datei gespeichert.\n\n**Ein großer Vorteil ist, dass das Ausführen und Verarbeiten asynchron im Hintergrund stattfindet. Dies geschieht mithilfe der PHP internernen Unterstützung einer Message Queue (Semaphore Funktionen). Die Aufgaben werden somit getrennt von der Nextcloud in einem eigenen Arbeits-Prozess (Worker) abgearbeitet.**\n\n## Anforderungen und Abhängigkeiten\nFür die OCR App müssen folgende Anforderungen erfüllt sein:\n - **[Nextcloud 10](https://nextcloud.com/)** oder höher\n - **Linux** server als Betriebssystem. (getestet mit Debian 8, Raspbian und Ubuntu 14.04 (Trusty))\n - **[OCRmyPDF](https://github.com/jbarlow83/OCRmyPDF)** >v2.x (getestet mit v4.1.3 (v4 empfohlen))\n - **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** >v3.02.02 mit den dazugehörigen Übersetzungs- und Sprachdateien (z. B. tesseract-ocr-deu)\n\nFür weiter Informationen besuchen Sie die Homepage oder lesen Sie die zutreffende Dokumentation."}},"isFeatured":false,"authors":[{"name":"Janis Koehr","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIID/jCCAuYCAhAKMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYwOTE5MTEzNTAxWhcNMjYxMjI2MTEzNTAxWjAOMQwwCgYD\nVQQDDANvY3IwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDDpXiwec4f\nXAT//7YBPSb4z6ZsBJSMfBq0VTL/HagjJnQ7BL+WagzWlS69IStNDqlIlenamYRX\n4B40heJIUinzYKjTRbr5UAw6MX29HibZccm/qgrk36o1XTgIsoRhmvSxbXDVIo1k\nbDOJN8gc2Gvswa8X+uOe9pfcDgAdqGxOvFnoKW89GnB01pCNT+xakNErGAFqVLsr\n2AeademAZnbxJ1cB54tQn2Bygb/7DKKY8EmFfIq6/27n9Jbph1FG9HIlWRT4/M2H\nU2pG3cCScWMEBPsW7kpfpnzLk7Q30Oj6k/rEYjJgmNYgg6oVnn0D9uRmhBYBnGyx\nMab1ilsK53lyuzQY0pmU8V5ULqpnNFAK6DVFfofEamDUhBPO+TZXEA5cZmuULRpf\nQQXmGpUQSyV6pS9WirMIqXFp9wmQ4vtjMdhu/6CP7cmtYZdq9uOhWEHbQM0mZUkb\n8hMjeItPx9XITI7Cge1JUOI8ZIwiB3USnQXcMd3v82l++/VgqHB7s5OaKPhygsWI\nM6RCoBcGiuQB5/fEUOg5ACOpGVyJiBda0Mi57AdoxdJmfnr7Bxcf2tAWIJL9Y7T3\nE1+V2BMxJOWwvVz26Cq83F41yXK2hJS+SbfQTqNUR8Cfh50CS9POvgRxNrJK9yvI\nkKle3ITRtGVM1XU0njWjnsdGg3D3O2mmjQIDAQABMA0GCSqGSIb3DQEBCwUAA4IB\nAQAbFddMbgfPI1szT57V1FKZrOrdYqQ7qjewlIQOzshGydbMtqS/9XL5hYocJCMt\nY6w+C/i6iEzO2Jx8D/k4rcZMXoVR6y3ZvO0Ke0gzSRsU+5eYj2FK1VV+cNIQW5Iu\nCYYIVa7pVPVHdeQH2Bba680bLV0HMF6b1fI9IwkfdCAinvCYZLjyEXZlmB7YjyA8\nHR7qPCNz4uG2Va7mlUHE3UYUYnlv8JFOV3YdbVL0nxhWwIdzSri5sxFIhdlabpzY\nyA1z/MCBEyTRo80jxFmL+MpwbsdbUJi7Qxlnd56zb6HHDGrLHXZTh9LXgyVbnhWL\nkxomWjIXQh4aMHQL4QF7U4EK\n-----END CERTIFICATE-----"},{"id":"spreedme","categories":["tools"],"userDocs":"https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md","adminDocs":"https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md","developerDocs":"","issueTracker":"https://github.com/strukturag/nextcloud-spreedme/issues","website":"","created":"2016-09-27T08:43:07.835196Z","lastModified":"2016-11-21T16:51:23.703819Z","releases":[{"version":"0.3.4","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz","created":"2016-11-21T16:51:23.689599Z","licenses":["agpl"],"lastModified":"2016-11-21T16:51:23.826509Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"Mhy3hXeGWlIujx1Op39MMRdqHYOo360BCwr4FPWoTNNggH3aS0gWlh48DAfGYK9W\netNiOqIuRyA0NrVlsqR2vDILgFtODJSbKPyHd3PQn3hcGsjogjQ+dkKciLNLinw7\nOhbv6aDdRFLBeRHpX/7wOnWL5W3ko/gyn0Awvi88M9+nC5aARtqncQqPy2SxDGzH\nKlOZHSNDnEQCGMhA8hNWWKdVwNUJHod/wmBWpW5QVNSJq5DqrKZcNwpGM2UUJoql\nEqUMwDXk5uVH5r5k62Tr9kguDWoUEG1OqQSyeMY24AmA64tq/HSlAdZ+CX32bc4E\nZvm+n8poJBrdSVmWEaa4ZfYaLFdOc6Kcuid1B1Sv9kPhD9WD6T1sicdzjDzcorBK\n/MLReCuSb2E8aPTnFWRoAZ4xCUGs1IXzX5fmxI8VdzwR42R6RhGJ/rqMuZRFenZF\nbOks45K5gE1da4QpkYOUQa3GVMNPqPiT3CqjmJ8tjxq7bGpb6v+YoCLACjjPpPZL\n2Y28qLxwHVaINDFUUxD75WWdrlulRbqHwiSw8jolP9qrpXhDuLAqYam9tRwV5K5R\n8uNawnFwWkicBEYkN/WtBTouWzehOPn38tHXov6SyEyD6lkuxUBZrsGQ2ru+t33U\nk0kKCbV0GFw43I+3Ji5DiB4TUVNZYVoPG1B7Qve+UfA=","translations":{}},{"version":"0.3.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <11.0.0","minIntSize":32,"download":"https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz","created":"2016-10-20T09:09:26.520692Z","licenses":["agpl"],"lastModified":"2016-10-20T09:09:26.666738Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=10","signature":"D62Ck7JUnrYbrfFlX7xXVaYUMZIh2acmykIKapqfemD/tuX5Bvb08GYGTeFG61MA\nQzsqcIylDfGnC1UJbf8yWEX7PbyJD5w/R4WlbFv34njDvM8rBs4HpzSjkqQoykOF\nZpYAjH2ydfKqtZadgoIRm7et5B8X2AeoGg11ec52DId5t1wAEBcDIv824CDBUt8t\n0pVY8Z8n1MUYwU7DCjCbPy23br2+EBODFCHp+cFfMBLg3F0BJI5nY3Q8ku+0tqMR\n0NDxQcscNZ2Ck/wpVDWylfhpS+ICIxSMiyq7urP593mRrK3399SUyaMqDfgl/pxo\nqTzdBxHLaAqcnKZYglbqp+Gxbyj4teqCod8TiSMlp90VaxhC72ACuVQQRWQKuTNI\nZeW3YweWB5d7VErqBNmQR1tGnX5YFFHiKo41fVDQFsrOqHx4zP6AeU3nkl2ol/r/\n3pg553so1MOxMkyLEhGYGMfrdQqVEtajNWHUdj3B73LS+M3jcjBFIdOD+AGXPtDX\njCRymt07c1znhkL+aT8yY5SHMVbKBZj9mExL49hcLjAYYc4U++60uq9MFH5r9g4T\ndph+yT6VVEM/UH2HjvKsHv2wm937sNgG3EXQdh79JU8nCXIz7cVrJ8f5/9r6n1VP\nBbjtfDAPEjmfVCXX2gmgLuZHV+GMhLBS9bTh+61AhhE=","translations":{}},{"version":"0.3.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <11.0.0","minIntSize":32,"download":"https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz","created":"2016-10-06T08:14:05.212553Z","licenses":["agpl"],"lastModified":"2016-10-06T08:14:05.278533Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=10","signature":"X9zXDyMBPoXPMpZ+XXWK3MLufjY2MG8lJ+93LiW3rv0iq9yd8PafK4IvP9czO6o9\nf/vNilq+1mfl6mjTvL6QF5+sySlzbRGbT3uTBwYXyYL07HVYgl1ZLrwe0kxvxqaW\nxTvPem7+HzwClI3VnWc7ylQfzGrcYIaSIg7nNq1GOHocsgZVNyj/nVW/eQx24MjZ\nuLzZs9SJqYoBGq+mo63vRswhqv5OzGebo+G6dHm0hvRSOw9qsWCDWBugiSRU8zU4\nD9PQ0e8WbyrIrQhBoUvvkuijO3zCySx606S1HUyaHmbJzMc4Fbpwz6ggmi6IRBbT\nFBKB1DWJDwN/7mY4fhS4KhircVnAHDqiBVCTu5i3pSfMPrwFymcmbn9OBuFHAFuZ\nd9PZvWQg4v32w+Q/NNvZVW5lRi+l0w5DEqNREaj79hljk2reZMaB65lvtV9NCYw+\nHmwWqsGqZ1SgGZuhYkOzEIkCfJ2fF/VpyavJ4X6bHP9yYdkt1pxnSSoZ2HC8mkG4\nBnPf28mEXRcY8EJv0rEePqKSBIhAt8yfEW+joH/8nupe1qOdfPvP08ifLad5m76s\nt23UzlSljzq9kVO+d16z2uagKomN9USZaNnJcUDVblfjvCPpdiHLfRPEJnRsDZCm\nNffFWEMcz+TWmwBboZgTRO9v0bPDEuwfCCEW0zy8rT0=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/conference.gif"},{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/presentation.png"},{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/import.png"},{"url":"https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/users.png"}],"translations":{"en":{"name":"Spreed.ME","summary":"Audio-, video- and text chat for your Nextcloud","description":"Securely communicate with your friends and family using rich audio-, video- and text chat, and much more right from your Nextcloud – in your browser"}},"isFeatured":false,"authors":[{"name":"struktur AG","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\r\nMIIEAzCCAusCAhANMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\r\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\r\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\r\ndXRob3JpdHkwHhcNMTYwOTI2MTYxNzMzWhcNMjcwMTAyMTYxNzMzWjATMREwDwYD\r\nVQQDEwhzcHJlZWRtZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKLx\r\n2dCPBLIgX948BnOdLij0YyI2+FKD6uZOvzxMaoi3rlxNf8MJgraNMzTBWEXtxT5b\r\n7ZISNp89WEXhaQ1dwwCocodd/xow4Ek63m5nUvTZXsm+YSbMgrFbxzsBhYU7KuIE\r\nT/jhKdzYgemzErwwN/gtwkLMfPo3jkgg6c8NPPohYv6k7V4VnsqtJ0JS0kX19FqM\r\nMiNz9XkcncBHy9x0BSxy4+YnwbFcgIx/MtYKlBL8NkPuuJaB/6C1O+IPYhdEdnpX\r\n+RaIue71nSStOYOqT4YDqHAIw7EmqgA1my09mmK+0Pn92GJVEAEN7JGBSQ+F32RI\r\ndB3ivGAOVtUtVvJlepWdbHxj1xqeP+LCjWzHMLQjm0TyH8VqU4Cg/wxwAEFnBATH\r\naOaWwrggzY2d9KBo1mp0k71NArLbBdlHykFU4bgiSDWrXXMz0fZzLQVwGI0Eqcxc\r\nouf6t0kvrK8oKjrnso+FjBoT7lHV/H6ny4ufxIEDAJ/FEBV/gMizt5fDZ+DvmMw4\r\nq+a088/lXoiI/vWPoGfOa77H5BQOt3y70Pmwv2uVYp46dtU8oat+ZvyW9iMmgP1h\r\nJSEHj1WGGGlp45d10l4OghwfTB0OSuPUYwWR+lZnV8sukGvQzC9iRV1DGl/rREMC\r\ncQ5ajRAtO5NPnThvN5/Zuh4n8JoDc0GK4jEZsIivAgMBAAEwDQYJKoZIhvcNAQEL\r\nBQADggEBAGHMRbPV0WTI9r1w6m2iJRrMbZtbBb+mQr8NtOoXQwvSXWT1lXMP2N8u\r\nLQ1a8U5UaUjeg7TnoUWTEOqU05HpwA8GZtdWZqPPQpe691kMNvfqF64g0le2kzOL\r\nhuMP9kpDGzSD8pEKf1ihxvEWNUBmwewrZTC3+b4gM+MJ3BBCfb5SCzMURLirfFST\r\naxCNzc7veb2M98hS73w5ZE6vO+C/wz0GTsxuK0AoLitApT5naQnjvxSvSsjFPEGD\r\nsUNUEU2Decyp0jxLVnrrpz6Y5UupfBR0V8yAv1t5Od/mCKLc5DxHsDWiKOpsob9U\r\nJN+bdzJil2NNftihD4Dm7Ha7OS3O8W0=\r\n-----END CERTIFICATE-----"},{"id":"nextant","categories":["files","tools"],"userDocs":"","adminDocs":"https://github.com/nextcloud/nextant/wiki","developerDocs":"","issueTracker":"https://github.com/nextcloud/nextant/issues","website":"https://github.com/nextcloud/nextant/wiki","created":"2016-09-14T14:34:35.977699Z","lastModified":"2016-11-22T16:02:57.758477Z","releases":[{"version":"0.6.6","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.6/nextant-0.6.6.tar.gz","created":"2016-11-16T15:11:14.344704Z","licenses":["agpl"],"lastModified":"2016-11-16T20:39:59.030384Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"aOZeEeThyZ0V/vXBcn6c+Z0vyCsZcN6nfSJ8oWEea4zXh4g705Si+MFZESqix3M2\nOPCnA/U8eASwdRTAEwQJrW5ECmu1THXSIsrzQzc9kFycvyOGzCgAWtuu0ayzZD2/\nU5aDWlzpLHC1Czg9QJ5UnfZR0AfChWQ402N1YzGqMShdJv6AHXFrVE+uYnIyxuYI\noPJQBUYbQwthVUjpYwFwSxw50YU17gmx5RZ0Y0OPz3i/EiuEUrxopXtfDVYAuCML\npDw37LOTRQ2JqxSU3teALh8LcrwJbTeOP0n4bTeV+vU3jvtiaEoRrwfVrK41F701\nQymGXy1/EFG0kxPGS2dRNPBAXYLZfeoWlROl3D5BWlbsCcXKU1S+22yn0TEdS7x1\nY44x8jRKnBddDE7qkn+QoQYHNNcxOREsFFLmIoyCUpdNOdDX2PvTFUYkIqdnXaJy\noAKv2GkvWPQ0aiiBtA1i4oXuzvHW/M2wOrK7v7DCpNfILrD/sjxpljxcX082nRCd\n9P3iPd2hQ6yOM9fG21LVN74b6wggI81BzFf/xJPd4ZqYLjfeG/yqd0zaiMOzMm1W\nse+kc/a4iB3BoCNX3E942pBBzew4ya8LkCXdCHUUsuelDf1va1ikTh/G7D84ll9/\n2avNqQnUh3hgOnxFCLI/5VrbqxfSTVdO6O/LTuAmwgw=","translations":{}},{"version":"0.6.5","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.5/nextant-0.6.5.tar.gz","created":"2016-11-09T16:58:06.856332Z","licenses":["agpl"],"lastModified":"2016-11-09T16:58:07.139404Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"DVOIbLEVggiLkNkuPW+pXqu8WYT15unUsMoqHSw81NiU6HF0Nuf3XiwnHJJDDqo5\nyX+QyHADO4ZiQpvXhGigvwD2eS1jVLatAztyxE0tEQv5eBU/7R0jQYxI8YCnC/jE\nZDa0qs+TI58EkDek0LBzueVQqrLubKgGU9P+E9H8gbWi1JHvl/2LdY7CplPqaJ+J\nMRokobPntzgx9m4DZC1RsCoXzSON7o2gp2cmunPJiXVHPhMUfIfolGEbNGJ1/xdp\nra7Y7XkPnDx4po98a38UpUh1x/2m5goOV54em35bWbh4ShNDykiE5ttz6tOywlYN\ngxceSsStTKyqscVaOV2Xu6Ive0pY9CInvrSfRnRktIWBYDyWdbK9sJuqs/s69kqn\nKQ/SjzE2smw0zwOUMnSaz0Jzr1vdPFgNu2xDYAVQO5G03V+wQ5AhxuhBz5Xp5Fll\nLaOhymZLCC7lq0DUqkeTeQ2QCfiG23hvG2VUPsIqW7xFe2YzKHZVXi9JuH//Gwym\nDmJmcyZDMvNwNiObx3ZRKsZNH2XwbldFZ9nTpb9AafyoSR/qbwd473NewaDLRTiY\nLrOP5Wx1xx6DOkRmDF2l2iT1bSJ6eoAoWQU2I0aYRH9NAr2Ugd4f2Um4o61EJaL+\nRHT9cERRySEloU/NdgmZEOi+CG0rEu+9LC5G/jGlHE8=","translations":{}},{"version":"0.6.4","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.4/nextant-0.6.4.tar.gz","created":"2016-11-05T18:17:47.622023Z","licenses":["agpl"],"lastModified":"2016-11-05T18:17:47.678445Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"RdkvnhNjw+kAnT6Or3+N9FzAv9DjJ9BAlmgANMwZZcaqo1gZRFewsGD2Rx1KEb9X\numSC28tl2B5/3r/+dprVJmOnYJny/7+kDmI/d+vigKfnaQJOUZ0ya5+f72pFgow7\nth8fw9rX/3+zIBs2IeEN66cis8ioFq97BJDsnDMBDr7wl7CnFJjYe6eviWuiFTnC\n4sBXlYjHoaIRRu561nwAooV+WXmWsparYPVhj2cXdyP/CnWo5HSF5jA51WCsz7Up\n7a0URXdh85xmxEbZtnjUymTW2BIegdxj9Erbfiuy/m3ApgnP+DiEQRcM13J7pXqg\n4cgFOBSzKDZgim599WBW2uNO1ztnDYOzz47GXDfJhcdvKiZZoQpUF9W4LMRtheMz\nxD9YArO3j3d+VOInSYU2Rpvhugwo1LExhwnRdT4+cOZfEeq0VojiM7yBZLDdEjIb\nGdYUJtNWSU0F6cPab2Au8FgZymLrHL9EpGvxuA1oAwtRxHAgMElJG2O6Jp89gGl9\nh/AptypeTvzNEc9/Kg24ueBKqmSUd5a45pZ3gM2pNATJhUK7fzLb/K6cq/kEzZtj\nOPra1ZfP0/20u8VP32Rgw1cFmIjqt8DFzUmOMpMfyoJkdldtTwQtGk+yIvtN1zp6\nT2zDknAKA2N/rZ/0SJl8KxVVNLhQWtYBJ+rFAdapuxI=","translations":{}},{"version":"0.6.3","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.3/nextant-0.6.3.tar.gz","created":"2016-11-03T21:51:27.654342Z","licenses":["agpl"],"lastModified":"2016-11-04T18:25:35.697130Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"Hf5GB4xd+rVXzWvVpGbbF5tqmnI+DGHlNHdLYPImFLS/Z4K5wKeNp80E5sd/RkAi\nhyuEsdWHlGDVMT6s7oeCmH/ClyWqLNSz9VH4KYqyFgD4+usHZp9PrEeEKbvPDPKv\nD3eB7Ats34cWcpf4E1oR5wsPicgmdgIgb2uMXzc/1G9xUBRWzocwCstzjEEAB/VJ\nvJuHvhDTGG294P4gOb82MxKCQ8LZ4i1QXzOf/mLETOubiUbZtJgTReYvpdAo2Wct\nbdfDFw13LYZkCf71r9jIQ3PSPlIpD+0BwAlE1fi0Br9dP2JjIfiKN6CGVaki6O0v\nKR42jtcE9xXiAop0Ym1FYMWJvQUy5PFLMwYDfEd6CvfEFJl+fi+RjXNDNZcTyw00\nHa48sACoGzxwts2JknWMU57mwvi0Z4uwpE0cFp/PRzBsXmSlCzWHjJhu7+2qambE\nAabdP9nH2NvqJHUJyPsxtDSrSWCBY4CoL3wYu36UrIA4NepyudMPNe9fhKTEU0bg\n8DLclw6hYdj5p9Zj3OUuwOZLz6r85KwnooTsUjOYkBXvdUuHWkgONqqZlPMApS4i\nChRQ7ysHAinPyyzsvr0PR9g6J52CSCO/7qwSJy6yqSzuSWrbZUa4FVTcKIwWJJPu\nJ2XzB4rWVG1wWjzMM6MIvFbO2HY9upzh651OdOwsYvk=","translations":{}},{"version":"0.6.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.2/nextant-0.6.2.tar.gz","created":"2016-11-01T11:24:58.054892Z","licenses":["agpl"],"lastModified":"2016-11-01T11:24:58.151609Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"h8KgwMh2RGGIp7q/II23VSfE5Ibkha7p/C1kvIfG6QIIc2Zu/Mm3Oekynnysh5ZJ\nZuMTaeWbejbBAmlnxW+AwBWa/s2PoMhv7foVvdtg76l9/qr+9jGvUM7D1LbbBvAy\n/XW6JSrhhBZHOohdU7kwV5Xnwsn/NC/zUe0G4eZ+9fc9uSntkob9wnWvUs2daAeD\nY6Mi7Xt/XAIX65OIVTKfC6ah1SlbXgtJ2i2j4G32I9jRhmbkpt/UJEangn90fHnY\nQXNJ85OyV0aNMafNHoMSL3uLscdvjp0Hy8w4iBeavsRlCs0GiUoG1+YdwTwmC9EM\n4CjbMfRJ0DYK7u697TOmS8MQzk8O7f5THtjeokZlrom2YnV9t6gLvjnxl/+gXPdJ\nmgLixnA8P6tPsff9pquHKQZsvxjv6vVa2DVJc8VpcqJRih7yj/3V7rxesEP7MUnP\nznIOcwzTsKXHuAnvujpCwyQj3QtpQK2XJPQ5WkKgwbTdvriVJfnzPironhcHo1vC\nbuUDOdhL59aySChw2cZGD9lCWaxYR7I1BDDzWKNl9Qg0AZ2auyGUGTv8P2vi5qUB\n0CmnkzkZurR5ju6Nb9/2lcZvda7QJdIdMtm2Wnn+Ak/Z3Y4IehB5PPDP5/MMAhQY\nXE8Jqe0mGtiU/O2346L5IThkS58JlRmep4kYv+II9zE=","translations":{}},{"version":"0.6.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.1/nextant-0.6.1.tar.gz","created":"2016-10-27T21:16:47.066097Z","licenses":["agpl"],"lastModified":"2016-10-27T21:16:47.125641Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"axSX4Kz2P4PbKU676DibjPZsxk8hCIG3lLOmeMXoiBhp3ka4wJ8u5tNwTzgY8/MV\n3mjXe5DNttD66SqmiRNSPKbotYHVFFW3wFK+Dgh/++n/KTomGYUeIwt88Z9ecbuG\nNT6U46jFrfZBYzRHWzbgiJ4c7MCoid9cfmoB7HDuQSyw+E0S2vbLL8+jzMcIzF+5\nTh/sJEterXCyrWSciw/9x98F+4svNbskdEIvrOox3+K6UIhpsojqJR2+bQhG3rsM\nPerOb6J+bzHdLV1ZL/4nWEz1F30T7B08QxY/4pHD68JFQcdtzmHMIhXfCoRvWhN2\nVRnizx3IXBALY4F49Ql6bjsnr6BCp+LroM5RSQ3eupDcqejDJLbjPz8xfOMOwlx7\nz84Xd0MUyqaEkxg1ihsWLbPlYACUZ2aoDkSQUIbfZTTiov7eqTM8UBc/UqVID/LU\nyEW4gjFZzQy6kX76XRAGq1vebKFjCU63asCnVyJhF/YQVTu1hPGbFslkRKnYuh8W\ne4MeaNfbdjcSEX+7oTcPJz6V09pOPvukXL0M1m7lS9PhTisI6oGj8c33GPYp/DSK\n6SGk+ukbt1mwFuFKdTvAMxo1lk96D+pKUv4MX/ralaaoIAmwPTGsSQ04RyL454ae\nU6q8PApwrVyPHYwMBPtXGoQMyb2ZV9rylazYbKCQ8I0=","translations":{}},{"version":"0.6.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/v0.6.0/nextant-0.6.0.tar.gz","created":"2016-10-26T01:46:48.419025Z","licenses":["agpl"],"lastModified":"2016-10-26T01:46:48.521063Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"W2TmbX/NbbfPPjIJLalO0kCDhhQF1pEohH/CxO9bY+yR+a5NKiTbpAhG2McqpTSj\nmgC4J8/thmwGlWGC+VW+KlpXzzjc7wCgMGMKViOpGD3pIy8p8U5MXTqVgjjrEb9g\nKgr9uErXzxJ5oDfkx8Uh1bUeBJTsAAivGJqMlhBYFGxw8BSB09sfOZytNxo4wbwZ\nNAcYP1qvkUQ8CVR0nInSTRfLvAp5+e/8xxyYZwJIWrdNgpoP0CxiwzKP/VSjBk/U\nsPU4R72UQnVZB0InRCeh/KNTwu1YiPkUKm+mNmt2hCfN7Fm6bY2rUMH7oa8KTkqn\nh52FhbaYRSAR1OPdC5RnHiQWlPh71gq+4Xqgp19Eawnl/QiVteVifSjNQZ+Ban8M\nRyw/PxHnzIWg/OAjx81Jx9mXjUIHSeUxMTJTKTp+lEqIAzjku0iHeU5UPGCfE+VM\nwmopZfnlfk2nLkUwjQXLCIcnZD1ME1m0h/H4Ad0Q/qXpBScUp47npkxg2b8zPIhk\n3aXUmNPLgwyXPWvAuaBK/WwpNefUnqWFns8t2Alpzg/EpC2PrZqciCNDcRFEycoa\nX+JsFyD7eYA7Dc9iIf09gXZX+tZ+Jinb+iPDwYrl1u/7IIBoBlUGCgo+cF7/dL9S\nc3vYeWw6MCH8Sv+ckgS2g726BfdN5EjB/8cb071b4lE=","translations":{}},{"version":"0.5.1","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/daita/nextant/releases/download/0.5.1/nextant-0.5.1.tar.gz","created":"2016-10-17T15:23:04.515057Z","licenses":["agpl"],"lastModified":"2016-10-17T15:23:04.576640Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"Pp3rC/9RmAYURneGpGit4HZ2t1qH9A9nwsUnGDgRuJ0akIii7CtJC+n8l1b9k73/\nhxMYnp2JOBu2HWKgFp9a3yeo1xphI5hOUdVQ1UZAWxIQyDI1FZVYDr81l7GCdkqm\n2lMxgviFADSYURCgEnAsj9Nt0NZ6LDcJZiJg3iPAjkDI0U+KnEBjtx/XRFqGUnfp\nCUZ/XLHh/hvoEitSHepTBDCMKkTNjbDEwBYfA2rAoz4zbMR5zKLU+1r1DIUgWSRe\nbk2i8TaTDVL4cbb6MhkGKwkujb+Atikvkpi45o7+fyQMs84c6fjjh/TZJaC+dMyG\n1GCikMPwwtEPjXtnLzynERAxJOd5mP4Ee4sD8ZrnzNUehpyFR88pwWU6r+dmiebb\nnsYlGkhIu2aIO2O4HZ4sUTsO5sfjZ9me7jsafhgJl6iG4IBeHa/L1MsSbhsh6mvH\nYsz4Xsluwr0QcFLmSDDQQYynyogKfJZG2xQsadM0GETWgXE44dVeRvMUsILfB4uZ\nmfKgd23SgaOhYC8m4bg5Hxnkl+xHJnyGZ6jhqg7bhuKwsoLymc18Vmjmb7a45HGV\nXbL5CTmw9yaPOBS3v7v91TnlB+0lhlzbKzZ0xIhY55qsTC76uScbTLwndPqNGaF7\n2koxRbJ3jcmf/Z2MLymdRi2BTZbZkPkxgVrSf9plaR0=","translations":{}},{"version":"0.5.0","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/daita/nextant/releases/download/0.5.0/nextant-0.5.0.tar.gz","created":"2016-10-11T11:47:46.191539Z","licenses":["agpl"],"lastModified":"2016-10-11T11:55:40.393000Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"qzQJSLK8nkrQedwwxUdhxL8bq3aXyppAlWJo+n3GqSvqA8uNTzl3Wsci0LsnBV0E\nDvDNW8K0enhl563F/bywQrDhgKl8jTX/CA5KCxqO9P+tvE80zAfMqiRnQayVcWuY\nSWX6RqfI/kqiWyN1SsFp2EDlas6eb+xfIoiJamlfsN0qzHYOFt5W77wmw2Bn9dB5\n9nwHHyC0z60Pf2pPduc/KuZ/971WrDFaIapL7Gm+z9XoaKSwUT575VtS+RNJkOKy\niBrwnHdc8x/62HPFOXsUYjCt2aEmLzPCQN8Ke5pd3596hm5wbAVzTHuxf2H35tb3\nljfGqAZ5AJX2Xd13d4aHXFdSEILwv6IFq2fx0hO3vkvFEoKF5oQ2t3hi++Mw/h8R\n15OKZCOC1bFH3gTwdshmnHSTSr3LxDeTF60aH16wpXcehQuJHagpb/aG8mPD1w+v\n759/mekqa4LYlqT9TLWTqX3UPeQXYIwcPijG84IvW1BDK1M4Mj2Vqsld4jXwG6CP\nORIL8xoQbA52dQI1Y19JXcU9zxIb6GaHYgpV0wejatsZRfhPv2Yd0CBShF4HY7aw\nnfcm88pqzOKNvjnLZjTFQwuJ0AUUSOsWhgZzYt8tATJ2KDZ+lxz+WAMGXJAC/ciY\ntrrglY7YxwJNLbYp+arE0sowZx+IOVaSZBvmUGHiEBY=","translations":{}},{"version":"0.4.2","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/daita/nextant/releases/download/0.4.2/nextant-0.4.2.tar.gz","created":"2016-10-06T10:31:12.482416Z","licenses":["agpl"],"lastModified":"2016-10-06T10:31:12.551117Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"QHJhYcBMi5HyPofshZ7EdcXsOfRrl7o48Y3BBBq8CkmYtFDbekghdJqjFbwwZa5u\n8FtgMVwssql/RSDNP6M2Zc/MpQ3K9gDm+DyxE5KRmtMEpzHB+oD+1DxP7kAoyW8/\nnBr5iiQSdLCelddMcTwbdxskLFUXIs3cFuLGhMvr8pdQOAgfxte5lolrj4/8EsJ0\n0yUImgIYG4NlgmvCygGApdpVaOcK7XVtv4oH+x43JmX9YZ3Ce0DQPYPUbFTCf4ZS\nS075j1vcnPx2cRFGxc+YpKzYVVYoy7ZdB75Hq+kaei/atxrTyV5+gcCrVPnH1RkX\n6G8rgu5l8FoGJYopi8/9dd8LsGLFx53CHMdEVob3tFR0WeK4TJAGJa403zE6S3hM\nxr86WCedmjuti0uOhSQr5AEVAoXZ/JUWQMMsPAUMuKEYVjKfmve6TlcNMC2oM5XT\nXcOf4OP3pcQq4ViN53o4Pj6NGSci6IzD6xLeAxKZUoTX37ArVKH6RHS5Najc193H\nRhYRnfE7D5YOr1u10HaZCFCVJif2MgMP0/uH2759NoRjXFowrh7Z6dW7JQG5lbHN\ne0jjJH1Y8m8H1peGGcmM0YxFiOVZ0ER7P+AxT4Cbau/cVhaS8vnPF2a2a6YFRiFS\nVH4aqazvvXrtifDr3lfvlyPCrP/570nwvOJgZGk+K/Y=","translations":{}},{"version":"0.10.0-alpha","phpExtensions":[],"databases":[],"shellCommands":[],"phpVersionSpec":"*","platformVersionSpec":">=9.0.0 <12.0.0","minIntSize":32,"download":"https://github.com/nextcloud/nextant/releases/download/0.10.0/nextant-master-0.10.0.tar.gz","created":"2016-11-22T16:02:57.740378Z","licenses":["agpl"],"lastModified":"2016-11-22T16:02:57.900805Z","isNightly":false,"rawPhpVersionSpec":"*","rawPlatformVersionSpec":">=9 <=11","signature":"kDO3xbPpoUdl2qo362tXfJIqKeiKE12M8FkMXbdKiRNzuQyvDOehQq3dErALZDOr\nLG47Tpez/Kn9Fsx1y4dQDx0w9SD3pyoqvjj1O6KkTYN6srpitQcj9EzEItCY+MZd\ngRSc7Px9MzxpFpgwtuThGVlSt5kLMd0vjWFLVcv7k07rZfWEsTwXd24INIDtlr1A\nC7hyLB777nEOGa7oAzx8nr+FJcIbmu9opVZk8AL40FOFDNBgfAy2AS9hGZreUmRV\ndV9Zh7UAR+RsEeO51xcU/CKqC8Jb0jL1gkYyUaQy16oe1HF9bRs1PWuNL5mYwsmy\nZNn0ay/a7mb7hxJbza1F3lbgBtodvbgUm7+So/QvaR29CSAqqoUXeQy6FfSBVWhZ\nYlTxdQfKcBcUPFO14BBk/O5p5iQaG8JCLJ/EZGDPDIVDMn7crGQ4oLZJv80eqTeB\n7ueDmWaD3gQ9j2XKsMk1uLSyY4unt9AaTofBylsKD1SjLhyxofGZym4jc2+M1GnQ\nyLcoEMSexnKuextu4nzrA0y5k3z9tvO07R29lwT1GFp6oGAakMLob/6XrGsm3YQY\nRQXgfXKFw8XmXBumqG8ayEIyvQ/O8nO6r4R1H8a7ooj6oWa3PhPsen+gLE0SpJPZ\nz3e2TLliwC4VtZp69H7u3px5Qn1Fc6RMDTh571edCr8=","translations":{}}],"screenshots":[{"url":"https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/displayResult.jpg"},{"url":"https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/admin.jpg"}],"translations":{"en":{"name":"Nextant","summary":"Navigate through your cloud using Solr","description":"\n\t Navigate through your cloud using Solr\n\n\n**Nextant** performs fast and concise _Full-Text Search_ within:\n\n- your own files,\n- shared files,\n- external storage,\n- bookmarks\n\n\n### Recognized file format:\n- plain text,\n- rtf,\n- pdf,\n- html,\n- openoffice,\n- microsoft office,\n- image JPEG and TIFF (will requiert Tesseract installed)\n- pdf with no text layer (will also requiert Tesseract) _[work in progress]_\n\n\n\n## Installation\n\n- [You first need to install a Solr servlet](https://github.com/nextcloud/nextant/wiki)\n- Download the .zip from the appstore, unzip and place this app in **nextcloud/apps/** (or clone the github and build the app yourself)\n- Enable the app in the app list,\n- Edit the settings in the administration page.\n- Extract the current files from your cloud using the **./occ nextant:index** commands\n- Have a look to this [explanation on how Nextant works](https://github.com/nextcloud/nextant/wiki/Extracting,-Live-Update)\n- _(Optional)_ [Installing Tesseract](https://github.com/tesseract-ocr/tesseract/wiki) ([Optical Character Recognition](https://en.wikipedia.org/wiki/Optical_character_recognition) (OCR) Engine) will allow Nextant to extract text from images and pdfs without text layer.\n\n\n\t"}},"isFeatured":false,"authors":[{"name":"Maxence Lange","mail":"","homepage":""}],"ratingRecent":0.5,"ratingOverall":0.5,"ratingNumRecent":0,"ratingNumOverall":0,"certificate":"-----BEGIN CERTIFICATE-----\nMIIEAjCCAuoCAhAFMA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNVBAYTAkRFMRswGQYD\nVQQIDBJCYWRlbi1XdWVydHRlbWJlcmcxFzAVBgNVBAoMDk5leHRjbG91ZCBHbWJI\nMTYwNAYDVQQDDC1OZXh0Y2xvdWQgQ29kZSBTaWduaW5nIEludGVybWVkaWF0ZSBB\ndXRob3JpdHkwHhcNMTYwOTE0MTI1NDQwWhcNMjYxMjIxMTI1NDQwWjASMRAwDgYD\nVQQDDAduZXh0YW50MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsbnQ\n+9acjKHfcrUj4yqBpD++GmQ5z2Sp8C8uOz4ZbLyM9bUXEYHo4a4u3CdC49kGUkb3\np5MkEAEzslTWDi1eh5MZgPWpbPgItsDsXY1o55O3jtxNkzSG5/yYcPQcuKtIOm9S\n7DY0K+UQt3nK+RrXEZfARMNrzFbEzpE3b7w901Yl5n+m/B8rhW4pqg8uSfx3u04J\nwduV1fHwoHUB0Ox5HyWib4Pq1XppNh7xdc2Fg93JxshwuCPJyOOzrFTnxC7s1yzQ\nUvaqkjPW5QeQRunQjZ2XtpYH8f8v01W18bNEiHwqtFwuDEyCVx1rvEMgUDVXdPkP\ngZrlB5TzGmz0U3HzYvf6205WuzfHxz7kPj502wP51PoZBKpniggKzmuXkx6BpsZC\nZX45VpDHdiATLwRj1t2bMs3C01nzpIWO5ZwFtkepH3Y+mvwX5lDh/XDsqJC2Yo8o\nWMmniWNW7dspufYOsBUqqYGP7rkailgVT4oYk6D1j6oFZ5SSpfPF5lsyYedDSM6y\nbIGVkSF+sjLK6R9BenBijKceAKsS//WwRYCBPC+JHlsYpXKW12bL+C47Kj2/N6d4\nrYryzV6ofVSF6pwIq0oEjoyfBfNpYavf3xrRkSSmIIlPSnMY7DT1xkGD5retxSm6\n+WIfkWKRZpv2S6PhMHGLspYc4H5Dj8c48rG5Co8CAwEAATANBgkqhkiG9w0BAQsF\nAAOCAQEAOZUwyPaUi+1BOUgQJMWqYRoTVZUyBshTXSC7jSwa97b7qADV9ooA6TYF\nzgsPcE41k7jRkUbnjcY45RGtL3vqsgZbx5TjPa5fGMxlqJ6eYBOY61Q6VIHEVm3u\nxnPEO9dsMoDBijvo5D7KtE+Ccs907Rq70kCsbrdgPHkyb5tDSnCKogN1LiQrg1EP\nmy7Z1C7jG9/h57vx0+QBMDCYnTmqLsvMKqo27uHskzAiB7VXLEdSZ2FtMGHkLUQO\n0bfhnvTZ2VhMmK83t7ovo71An4ycmsolGD/MA0vNI78VrVISrdI8rRh2WntUnCBU\nEJL3BaQAQaASSsvFrcozYxrQG4VzEg==\n-----END CERTIFICATE-----"}]
EOD;
- static $expectedResponse = array (
+ static $expectedResponse = [
'data' =>
- array (
+ [
0 =>
- array (
+ [
'id' => 'direct_menu',
'categories' =>
- array (
+ [
0 => 'customization',
- ),
+ ],
'userDocs' => '',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-10-01T09:16:06.030994Z',
'lastModified' => '2016-10-06T14:01:05.584192Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.9.2',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/juliushaertl/direct_menu/releases/download/v0.9.2/direct_menu.tar.gz',
'created' => '2016-10-06T14:01:05.578297Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-10-06T14:01:05.643813Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
uWtzoaLi71/1BWTFAN+Y9VyfZ8/Z3Pg3vKedRJ565mztIj0geL3riEsC5YnPS0+C
+a3B9sDiiOa101EORzX3lrPqL7reEPdCxrIwN+hKFBQ=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://bitgrid.net/~jus/direct_menu_nc.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Direct Menu',
'summary' => 'Provide easy access to all apps in the header.',
'description' => 'Provide easy access to all apps in the header.',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Julius Härtl',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
G2dF9Gtu4GiQ5fuaJknaxlgXHovfqeZwZJX9o4M+Ug81AqiY7XjdiaCPdh0Tthcx
2OmWZo7UBREWenjKyFZZ/iKoqH5sdenBtpo=
-----END CERTIFICATE-----',
- ),
+ ],
1 =>
- array (
+ [
'id' => 'apporder',
'categories' =>
- array (
+ [
0 => 'customization',
- ),
+ ],
'userDocs' => '',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-10-01T09:16:47.111889Z',
'lastModified' => '2016-10-12T19:50:16.038821Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.3.3',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/juliushaertl/apporder/releases/download/0.3.3/apporder.tar.gz',
'created' => '2016-10-12T19:14:10.802359Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-10-12T19:50:16.104357Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
'rawPlatformVersionSpec' => '>=9 <=11',
'signature' => 'nhlT9lhrmBxIsqh/e3RLm2NDw/U8ZvvoMyYQTLMM3H19DQmVcPYPYC9QWVTsowUzXblVaOXVGylbpKma9yOlOAqJtF3qyXecLl4+tA/Awb6BBhKPgHFdcLDAL5yy1K7/uei3SgEojMlJoI9vEK5I1C5YTh43yNH+//Im6MAuNYFUTlMXK426zdOe6ogpCI5GlYdXopqYANxcpT+WXWET6DDSM5Ev+MYwMcSAY4r8+tvARRU4ZAenRgjkBT6R5z6cD76emRax14tbV6vkjjwRcO+dQtM0tFPbd+5fsNInbauv50VzIMgjA6RnKTOI17gRsSdGlsV4vZn2aIxEPWauu6T/UohMvAE9HMn13vtbpPBSFwJAktj6yHASYGzupNQLprA0+OdyALoLZPpQAKNEXA42a4EVISBKu0EmduHJlUPeqhnIGkkGgVNWS8AWqzP2nFoPdXBgUWateiMcBTHxgEKDac5YmNc9lsXpzf1OxBaXHBhGYKuXPwIfyH3jTWb1OdwixJEuRe9dl63T9qOTRre8QWns/bMqKLibGfMtFhVB21ARJayBuX70eVvabG/2N7Y5t1zUlFygIKu51tvo3AVCRDdRrFWDvkAjxzIz5FIdALVZ+DReFYu/r4WF/w3V9rInFuEDSwb/OH4r8sQycs07tSlMyA74Y3FpjKTBxso=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://bitgrid.net/~jus/apporder-nc.gif',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'AppOrder',
'summary' => 'Sort apps in the menu with drag and drop',
'description' => '
Users will now get redirected to the first app of the default order or to the
first app of the user order.
',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Julius Härtl',
'mail' => 'jus@bitgrid.net',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
Tu+WGOL2Ee5U4k4XFdzeSLODWby08iU+Gx3bXTR6WIvXCYeIVsCPKK/luvfGkiSR
CpW1GUIA1cyulT4uyHf9g6BMdYVOsFQ=
-----END CERTIFICATE-----',
- ),
+ ],
2 =>
- array (
+ [
'id' => 'twofactor_totp',
'categories' =>
- array (
+ [
0 => 'tools',
- ),
+ ],
'userDocs' => '',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-10-08T14:13:54.356716Z',
'lastModified' => '2016-10-12T14:38:56.186269Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.4.1',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '>=5.4.0 <7.1.0',
'platformVersionSpec' => '>=10.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/ChristophWurst/twofactor_totp/releases/download/0.4.1/twofactor_totp.tar.gz',
'created' => '2016-10-12T14:38:56.174612Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-10-12T14:38:56.248223Z',
'isNightly' => false,
'rawPhpVersionSpec' => '>=5.4 <=7.0',
Ml2RKcPeutMHHSLiGIN/h7fM5aSs49wGgGZmfz28fHVd7/U0HFSMYmkT/GMq5tMP
Iyc+QZAN4qbX8G0k/QSTkK/L4lOT2hQiQqiSqmWItMk=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
- ),
+ [
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Two Factor TOTP Provider',
'summary' => 'A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)',
'description' => 'A Two-Factor-Auth Provider for TOTP (e.g. Google Authenticator)',
- ),
- ),
+ ],
+ ],
'isFeatured' => true,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Christoph Wurst',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
VMgQ6yUWNuzOQMZpMIV7RMOUZHvxiX/ZWUFzXNYX0GYub6p4O2uh3LJE+xXyDf77
RBO7PLY3m4TXCeKesxZlkoGke+lnq7B8tkADdPI=
-----END CERTIFICATE-----',
- ),
+ ],
3 =>
- array (
+ [
'id' => 'contacts',
'categories' =>
- array (
+ [
0 => 'office',
1 => 'organization',
2 => 'social',
- ),
+ ],
'userDocs' => 'https://docs.nextcloud.com/server/11/user_manual/pim/contacts.html',
'adminDocs' => 'https://docs.nextcloud.com/server/11/admin_manual/configuration_server/occ_command.html?highlight=occ%20commands#dav-label',
'developerDocs' => 'https://github.com/nextcloud/contacts#building-the-app',
'created' => '2016-10-30T14:00:58.922766Z',
'lastModified' => '2016-11-22T22:08:01.904319Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '1.5.0',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/nextcloud/contacts/releases/download/v1.5.0/contacts.tar.gz',
'created' => '2016-11-22T22:08:01.861942Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-22T22:08:02.306939Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
BKLUd0dSfQUQzkfwcojImbzJRvca4/DYe3mfG7+RCH0tDL6t72dKL9joB++u5R1u
VZPgkToexlXcKWpiDB8H2/SEShKr4udAOjR5de9CYWM=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Contacts/contacts.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Contacts',
'summary' => 'The new and improved app for your Contacts.',
'description' => 'The new and improved app for your Contacts.',
- ),
- ),
+ ],
+ ],
'isFeatured' => true,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Alexander Weidinger',
'mail' => '',
'homepage' => '',
- ),
+ ],
1 =>
- array (
+ [
'name' => 'Jan-Christoph Borchardt',
'mail' => '',
'homepage' => '',
- ),
+ ],
2 =>
- array (
+ [
'name' => 'Hendrik Leppelsack',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
Gld7yCP47xNPaAZEC66odcClvNtJ2Clgp8739jD6uJJCqcKDejeef0VU1PG7AXId
52bVrGMxJwOuL1393vKxGH0PHDzcB1M=
-----END CERTIFICATE-----',
- ),
+ ],
4 =>
- array (
+ [
'id' => 'mail',
'categories' =>
- array (
+ [
0 => 'tools',
- ),
+ ],
'userDocs' => '',
'adminDocs' => 'https://github.com/nextcloud/mail#readme',
'developerDocs' => '',
'created' => '2016-10-19T19:41:41.710285Z',
'lastModified' => '2016-10-19T19:57:33.689238Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.6.0',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '>=5.4.0 <7.1.0',
'platformVersionSpec' => '>=10.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/nextcloud/mail/releases/download/v0.6.0/mail.tar.gz',
'created' => '2016-10-19T19:57:33.676730Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-10-19T19:57:33.834580Z',
'isNightly' => false,
'rawPhpVersionSpec' => '>=5.4 <=7.0',
WF3WSqF/K/tTnPYTWb9NUPSihTbVNv6AXOfTsPEp/ba2YSS5DjvjVjkr5vhR9eg1
ikQ3Cw6lW3vaA4LVCC+hFkMRnI4N0bo5qQavP3PnZPc=',
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'changelog' => '### Added
- Alias support
[#1523](https://github.com/owncloud/mail/pull/1523) @tahaalibra
[#1603](https://github.com/owncloud/mail/pull/1603) @ChristophWurst
- Update folder counters when reading/deleting messages
[#1585](https://github.com/owncloud/mail/pull/1585)',
- ),
- ),
- ),
- ),
+ ],
+ ],
+ ],
+ ],
'screenshots' =>
- array (
- ),
+ [
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Mail',
'summary' => 'Easy to use email client which connects to your mail server via IMAP and SMTP.',
'description' => 'Easy to use email client which connects to your mail server via IMAP and SMTP.',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Christoph Wurst, Thomas Müller, Jan-Christoph Borchardt, Steffen Lindner & many more …',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
xRS4JXbapjolkxyGSpP+iYSgItVnYzl6o9KZResR4yDsBv7G/8fpV4GQU9IS3zLD
PiZOosVHWJdpUKCw9V4P1prGTQ==
-----END CERTIFICATE-----',
- ),
+ ],
5 =>
- array (
+ [
'id' => 'audioplayer',
'categories' =>
- array (
+ [
0 => 'multimedia',
- ),
+ ],
'userDocs' => 'https://github.com/rello/audioplayer/wiki#user-documentation',
'adminDocs' => 'https://github.com/rello/audioplayer/wiki#admin-documentation',
'developerDocs' => '',
'created' => '2016-09-16T05:44:24.857567Z',
'lastModified' => '2016-11-17T22:34:34.637028Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '1.3.1',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '>=5.4.0',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/Rello/audioplayer/releases/download/1.3.1/audioplayer-1.3.1.tar.gz',
'created' => '2016-11-17T22:34:34.215350Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-17T22:34:34.867778Z',
'isNightly' => false,
'rawPhpVersionSpec' => '>=5.4',
'rawPlatformVersionSpec' => '>=9 <=11',
'signature' => 'p6Zz0IEFrxvw6y/3jHgGWWCxR6qpMzvU2HKfxcIVsK6sJnoRUhWLeAXwZ432fH2a S2llj+IGS9OvW+5VQElrXgPtEjDK1BT00DRJnp5RFCRlUv0LNoedJMzx6B6AHqPP JBufk3cG1O/CO0M0L1ITGSmSOzfKvWTRo3lxVGF792NyBaP/SyZCkH1N1TzBQzUi Ywl3+HiglPcXbHjtJm/arnKorbJWVKoaN93xFuaBapd2ozQSpi0fE0uGRsici+U7 HNa1M5WFE1rzUJoufE0E9246At07rFY1e+TdNEq8IlLgCXg5vGCKkEyuWpWno6aX LfRaIiT9x39UTAwNvuDKS0c+n4uWDYPsGfKhDx9N7CXpUrthfXVEWRzZEXG7as10 6ANvrRPJemSZH8FUSrdJhD7k12qa9R825y7mIG68Li8P71V92EOxFfo9tNXqXwBt VuDGxBqByFVPqSCj5I8hrzJzQl2Xt40g8+8ZcSF96RMg/pM+bwRMTv+mz0V+vQQ4 DWjqnWVPalaJ1PPD5/QFFErtXuNRbyxKZ6BMWxfJlLM9Kz66P75K+8fYaSwz+2KG NxY7I3svzS2K9LGH3fBLUy1t3Hl+c3zGFq/ll1MJrf9NswV4yxt2WmISfM/KDww8 yELkGs2cRzbw2tCvnmYlJJhIqRLkyFAbDzWRH/XdVx4=',
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'changelog' => '2016-11-17
- fix: one-click-play for wav not working
- fix: wrong sql statement for PostgreSQL [#90](https://github.com/rello/audioplayer/issues/90)',
- ),
- ),
- ),
- ),
+ ],
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://github.com/rello/screenshots/raw/master/audioplayer_main.png',
- ),
+ ],
1 =>
- array (
+ [
'url' => 'https://github.com/rello/screenshots/raw/master/audioplayer_lists.png',
- ),
+ ],
2 =>
- array (
+ [
'url' => 'https://github.com/rello/screenshots/raw/master/audioplayer_share.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Audio Player',
'summary' => 'Audio Player for ownCloud and Nextcloud',
'description' => 'Audio Player for MP3, MP4, Ogg, and Wave with a lot of flexibility for all your needs.',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Marcel Scherello',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
FNvGFVBn4r5qCiChEoq+rCXHRjPi/eCfbW21XeLFDiLxapcZyc85JIcA7znUYoFe
P7Y/ekMscwWhLbF91OaQlcWpRtEMyde/DaI=
-----END CERTIFICATE-----',
- ),
+ ],
6 =>
- array (
+ [
'id' => 'calendar',
'categories' =>
- array (
+ [
0 => 'organization',
- ),
+ ],
'userDocs' => 'https://docs.nextcloud.com/server/10/user_manual/pim/calendar.html',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-10-01T12:40:39.060903Z',
'lastModified' => '2016-11-22T20:31:13.029921Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '1.4.1',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/nextcloud/calendar/releases/download/v1.4.1/calendar.tar.gz',
'created' => '2016-11-22T20:31:13.020268Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-22T20:31:13.087340Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
r/ASRiJrkDThbNWAUtX70rUmCqDV6/MujLXViqOc/Q2OHvcXd1oGDccJSQT92/1z
7nonnedyYQIDqUt7u68WL8JRxp7pFsEqKLVuWSgxW3c=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/1.png',
- ),
+ ],
1 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/2.png',
- ),
+ ],
2 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/3.png',
- ),
+ ],
3 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/calendar/master/screenshots/4.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Calendar',
'summary' => 'Calendar GUI for Nextcloud\'s CalDAV server',
'description' => 'The Nextcloud calendar app is a user interface for Nextcloud\'s CalDAV server.
It integrates with other apps, allows you to manage calendars and events, display external calendars and invite attendees to your events',
- ),
- ),
+ ],
+ ],
'isFeatured' => true,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Georg Ehrke',
'mail' => '',
'homepage' => 'https://georg.coffee',
- ),
+ ],
1 =>
- array (
+ [
'name' => 'Raghu Nayyar',
'mail' => '',
'homepage' => 'http://raghunayyar.com',
- ),
+ ],
2 =>
- array (
+ [
'name' => 'Thomas Citharel',
'mail' => '',
'homepage' => 'https://tcit.fr',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.94444444444444398,
'ratingOverall' => 0.94444444444444398,
'ratingNumRecent' => 9,
Q0Bl/QinETk72afGR46Qvc7tC1t9JjQQD3AUbEGuJdGvXjJJ9GREYu01XoODmPdT
jXXOI8XIOK6kxXhPHUc3iWu9b4KqGm0=
-----END CERTIFICATE-----',
- ),
+ ],
8 =>
- array (
+ [
'id' => 'ownpad',
'categories' =>
- array (
+ [
0 => 'tools',
- ),
+ ],
'userDocs' => 'https://github.com/otetard/ownpad/blob/master/README.md#mimetype-detection',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-09-29T15:58:52.814912Z',
'lastModified' => '2016-11-19T17:37:52.278497Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.5.6',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/otetard/ownpad/releases/download/v0.5.6/ownpad.tar.gz',
'created' => '2016-11-19T17:37:52.234684Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-19T17:37:52.423930Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
uRGqyU4BXpZjEC3nVlsC7vCncWWhxl0WZQ/MWKqsfjVAU4I88E518D6NioqMnPEJ
iCZ2x+69UCDEQyfCSKajgAYT17r3OhZei8F9KSCH8Vw=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
- ),
+ [
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Ownpad',
'summary' => '
Create and open Etherpad and Ethercalc documents.
This application requires to have access to an instance of
Etherpad and/or Ethercalc to work properly.
',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Olivier Tétard',
'mail' => 'olivier.tetard@miskin.fr',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
EUa2uYht/z475k4+vf0YhV98iQH07GnmlfD2TDZgmOCQGKlNfJh1v88OZyLLa3dz
gRHzGwKbAiJ8T8bbpZ3e2ozXxADr
-----END CERTIFICATE-----',
- ),
+ ],
9 =>
- array (
+ [
'id' => 'announcementcenter',
'categories' =>
- array (
+ [
0 => 'organization',
- ),
+ ],
'userDocs' => '',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-09-14T10:38:53.939634Z',
'lastModified' => '2016-11-24T11:21:50.324839Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '2.0.0',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=10.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/nextcloud/announcementcenter/releases/download/v2.0.0/announcementcenter-2.0.0.tar.gz',
'created' => '2016-10-06T12:41:56.195206Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-10-06T12:41:56.263124Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
OfQFKEjtsx+bNLa6CkAaocHGHJXAofX3GQZ9cjBsjZqiTfbXfcVk0kRfz7pwL92L
I1McfJYvgMxDQG5bjRpNJw==',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://github.com/nextcloud/announcementcenter/raw/stable10/docs/AnnouncementCenterFrontpage.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Announcement Center',
'summary' => 'An announcement center for Nextcloud',
'description' => 'An announcement center for Nextcloud',
- ),
- ),
+ ],
+ ],
'isFeatured' => true,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Joas Schilling',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.75,
'ratingOverall' => 0.75,
'ratingNumRecent' => 0,
JJoU8LQoHwGRtp3wutk0GlFzpEQEvSsn/Lsvvot5IfIe46tnzA6MVj5s64s5G8+Q
phhXFlzXqO/VxquPdbfYjvU=
-----END CERTIFICATE-----',
- ),
+ ],
11 =>
- array (
+ [
'id' => 'rainloop',
'categories' =>
- array (
+ [
0 => 'social',
1 => 'tools',
- ),
+ ],
'userDocs' => '',
'adminDocs' => '',
'developerDocs' => '',
'created' => '2016-10-20T04:17:37.217555Z',
'lastModified' => '2016-11-18T11:36:04.309739Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '4.26.0',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '>=5.4.0',
'platformVersionSpec' => '>=10.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/pierre-alain-b/rainloop-nextcloud/releases/download/v4.26.0/rainloop-4.26.0.tar.gz',
'created' => '2016-10-20T04:28:21.491747Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-18T11:36:04.619927Z',
'isNightly' => false,
'rawPhpVersionSpec' => '>=5.4',
NOAkku7AMXPvUCHaZP2iVCCoAViEso8GeR3O8xh2G42Ai61RLYwx8LB1+23EoJTr
mfFuRYNSg+qAKCokXNnh+lDlwu4AkaQo3vtKGPXvU7A=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/pierre-alain-b/rainloop-nextcloud/master/screenshots/2016.10.20-screenshot.jpg',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'RainLoop',
'summary' => 'RainLoop Webmail',
'description' => 'Simple, modern and fast web-based email client.',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'RainLoop Team',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
iLYeXQTV0XSRs8xVt+iyGlj7nPkv2DR0oCqRpWUFWeSBI//niDG5WxS3qg8kacSW
fDSYhSN+IjrnIkwNtc8V9t7/GeQB5FE=
-----END CERTIFICATE-----',
- ),
+ ],
12 =>
- array (
+ [
'id' => 'richdocuments',
'categories' =>
- array (
+ [
0 => 'integration',
1 => 'office',
- ),
+ ],
'userDocs' => 'https://nextcloud.com/collaboraonline/',
'adminDocs' => 'https://nextcloud.com/collaboraonline/',
'developerDocs' => '',
'created' => '2016-10-31T08:55:45.631429Z',
'lastModified' => '2016-11-24T12:13:53.905352Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '1.1.14',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/owncloud/richdocuments/releases/download/1.1.14/richdocuments.tar.gz',
'created' => '2016-11-24T12:10:13.337165Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-24T12:13:53.963638Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
WgtxRJmvGaNiFzYq+kQmdKMfayZTm3kdVgP0W52t5wp878K0i4s2KPg5lANvjTz7
DCT+VV2IGIE52o4RpMUGyQ==',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-document.png',
- ),
+ ],
1 =>
- array (
+ [
'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-app.png',
- ),
+ ],
2 =>
- array (
+ [
'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-presentation.png',
- ),
+ ],
3 =>
- array (
+ [
'url' => 'https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-spreadsheet.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Collabora Online',
'summary' => 'Edit office documents directly in your browser.',
'description' => 'Collabora Online allows you to to work with all kinds of office documents directly in your browser. This application requires Collabora Cloudsuite to be installed on one of your servers, please read the documentation to learn more about that.',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Collabora Productivity based on work of Frank Karlitschek, Victor Dubiniuk',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
myBOrjhrJgLIwvgH26MYZhdiSkFzoE38nMPZdrUmUDxcPCwucWJqgzDPudguFthj
WCVZ3TTG/2z3+tWM
-----END CERTIFICATE-----',
- ),
+ ],
13 =>
- array (
+ [
'id' => 'ocr',
'categories' =>
- array (
+ [
0 => 'files',
1 => 'tools',
- ),
+ ],
'userDocs' => 'https://janis91.github.io/ocr/',
'adminDocs' => 'https://github.com/janis91/ocr/wiki',
'developerDocs' => 'https://github.com/janis91/ocr/wiki',
'created' => '2016-09-19T12:07:49.220376Z',
'lastModified' => '2016-11-21T11:22:21.024501Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '1.0.0',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
+ [
0 =>
- array (
+ [
'id' => 'pgsql',
'versionSpec' => '*',
'rawVersionSpec' => '*',
- ),
+ ],
1 =>
- array (
+ [
'id' => 'mysql',
'versionSpec' => '*',
'rawVersionSpec' => '*',
- ),
+ ],
2 =>
- array (
+ [
'id' => 'sqlite',
'versionSpec' => '*',
'rawVersionSpec' => '*',
- ),
- ),
+ ],
+ ],
'shellCommands' =>
- array (
+ [
0 => 'ocrmypdf',
1 => 'tesseract',
- ),
+ ],
'phpVersionSpec' => '>=5.6.0 <8.0.0',
'platformVersionSpec' => '>=10.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/janis91/ocr/releases/download/v1.0.0/ocr.tar.gz',
'created' => '2016-10-24T06:50:43.283900Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-21T11:22:21.269108Z',
'isNightly' => false,
'rawPhpVersionSpec' => '>=5.6 <=7',
v05SzlQRnBWM4jYBe0mA/2ds9AO6VrXGrT/iLlHemj6JYoGBM185TGewA7OJyX3a
HSlSDqaremmi+aS3onx3AKhXykDxTRkMVarePwTzzFs=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc1.png',
- ),
+ ],
1 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc2.png',
- ),
+ ],
2 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/janis91/ocr/master/screenshots/sc3.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'OCR',
'summary' => 'Character recoginition for your images and pdf files.',
'description' => '# Description
- **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** >v3.02.02 with corresponding language files (e.g. tesseract-ocr-eng)
For further information see the homepage or the appropriate documentation.',
- ),
+ ],
'de' =>
- array (
+ [
'name' => 'OCR',
'summary' => 'Schrifterkennung für Bilder (mit Text) und PDF Dateien.',
'description' => '# Beschreibung
- **[tesseract-ocr](https://github.com/tesseract-ocr/tesseract)** >v3.02.02 mit den dazugehörigen Übersetzungs- und Sprachdateien (z. B. tesseract-ocr-deu)
Für weiter Informationen besuchen Sie die Homepage oder lesen Sie die zutreffende Dokumentation.',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Janis Koehr',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
yA1z/MCBEyTRo80jxFmL+MpwbsdbUJi7Qxlnd56zb6HHDGrLHXZTh9LXgyVbnhWL
kxomWjIXQh4aMHQL4QF7U4EK
-----END CERTIFICATE-----',
- ),
+ ],
14 =>
- array (
+ [
'id' => 'spreedme',
'categories' =>
- array (
+ [
0 => 'tools',
- ),
+ ],
'userDocs' => 'https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md',
'adminDocs' => 'https://github.com/strukturag/nextcloud-spreedme/blob/master/README.md',
'developerDocs' => '',
'created' => '2016-09-27T08:43:07.835196Z',
'lastModified' => '2016-11-21T16:51:23.703819Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.3.4',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://apps.owncloud.com/CONTENT/content-files/174436-spreedme.tar.gz',
'created' => '2016-11-21T16:51:23.689599Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-21T16:51:23.826509Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
8uNawnFwWkicBEYkN/WtBTouWzehOPn38tHXov6SyEyD6lkuxUBZrsGQ2ru+t33U
k0kKCbV0GFw43I+3Ji5DiB4TUVNZYVoPG1B7Qve+UfA=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/conference.gif',
- ),
+ ],
1 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/presentation.png',
- ),
+ ],
2 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/import.png',
- ),
+ ],
3 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/strukturag/nextcloud-spreedme/master/screenshots/appstore/users.png',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Spreed.ME',
'summary' => 'Audio-, video- and text chat for your Nextcloud',
'description' => 'Securely communicate with your friends and family using rich audio-, video- and text chat, and much more right from your Nextcloud – in your browser',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'struktur AG',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
sUNUEU2Decyp0jxLVnrrpz6Y5UupfBR0V8yAv1t5Od/mCKLc5DxHsDWiKOpsob9U
JN+bdzJil2NNftihD4Dm7Ha7OS3O8W0=
-----END CERTIFICATE-----',
- ),
+ ],
15 =>
- array (
+ [
'id' => 'nextant',
'categories' =>
- array (
+ [
0 => 'files',
1 => 'tools',
- ),
+ ],
'userDocs' => '',
'adminDocs' => 'https://github.com/nextcloud/nextant/wiki',
'developerDocs' => '',
'created' => '2016-09-14T14:34:35.977699Z',
'lastModified' => '2016-11-22T16:02:57.758477Z',
'releases' =>
- array (
+ [
0 =>
- array (
+ [
'version' => '0.6.6',
'phpExtensions' =>
- array (
- ),
+ [
+ ],
'databases' =>
- array (
- ),
+ [
+ ],
'shellCommands' =>
- array (
- ),
+ [
+ ],
'phpVersionSpec' => '*',
'platformVersionSpec' => '>=9.0.0 <12.0.0',
'minIntSize' => 32,
'download' => 'https://github.com/nextcloud/nextant/releases/download/v0.6.6/nextant-0.6.6.tar.gz',
'created' => '2016-11-16T15:11:14.344704Z',
'licenses' =>
- array (
+ [
0 => 'agpl',
- ),
+ ],
'lastModified' => '2016-11-16T20:39:59.030384Z',
'isNightly' => false,
'rawPhpVersionSpec' => '*',
se+kc/a4iB3BoCNX3E942pBBzew4ya8LkCXdCHUUsuelDf1va1ikTh/G7D84ll9/
2avNqQnUh3hgOnxFCLI/5VrbqxfSTVdO6O/LTuAmwgw=',
'translations' =>
- array (
- ),
- ),
- ),
+ [
+ ],
+ ],
+ ],
'screenshots' =>
- array (
+ [
0 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/displayResult.jpg',
- ),
+ ],
1 =>
- array (
+ [
'url' => 'https://raw.githubusercontent.com/nextcloud/nextant/master/screenshots/admin.jpg',
- ),
- ),
+ ],
+ ],
'translations' =>
- array (
+ [
'en' =>
- array (
+ [
'name' => 'Nextant',
'summary' => 'Navigate through your cloud using Solr',
'description' => '
',
- ),
- ),
+ ],
+ ],
'isFeatured' => false,
'authors' =>
- array (
+ [
0 =>
- array (
+ [
'name' => 'Maxence Lange',
'mail' => '',
'homepage' => '',
- ),
- ),
+ ],
+ ],
'ratingRecent' => 0.5,
'ratingOverall' => 0.5,
'ratingNumRecent' => 0,
0bfhnvTZ2VhMmK83t7ovo71An4ycmsolGD/MA0vNI78VrVISrdI8rRh2WntUnCBU
EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
-----END CERTIFICATE-----',
- ),
- ),
+ ],
+ ],
'timestamp' => 1234,
'ncversion' => '11.0.0.2',
'ETag' => '"myETag"',
- );
+ ];
protected function setUp(): void {
->getMock();
$this->l10nMock->expects($this->any())
->method('t')
- ->willReturnCallback(function($text, $parameters = array()) {
+ ->willReturnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
});
* @param string $intSize
*/
public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize) {
- $app = array(
- 'dependencies' => array(
- 'php' => array()
- )
- );
+ $app = [
+ 'dependencies' => [
+ 'php' => []
+ ]
+ ];
if (!is_null($minVersion)) {
$app['dependencies']['php']['@attributes']['min-version'] = $minVersion;
}
* @param string|null $commands
*/
public function testCommand($expectedMissing, $commands) {
- $app = array(
- 'dependencies' => array(
- )
- );
+ $app = [
+ 'dependencies' => [
+ ]
+ ];
if (!is_null($commands)) {
$app['dependencies']['command'] = $commands;
}
* @param $libs
*/
function testLibs($expectedMissing, $libs) {
- $app = array(
- 'dependencies' => array(
- )
- );
+ $app = [
+ 'dependencies' => [
+ ]
+ ];
if (!is_null($libs)) {
$app['dependencies']['lib'] = $libs;
}
* @param $oss
*/
function testOS($expectedMissing, $oss) {
- $app = array(
- 'dependencies' => array()
- );
+ $app = [
+ 'dependencies' => []
+ ];
if (!is_null($oss)) {
$app['dependencies']['os'] = $oss;
}
* @param $oc
*/
function testOC($expectedMissing, $oc) {
- $app = array(
- 'dependencies' => array()
- );
+ $app = [
+ 'dependencies' => []
+ ];
if (!is_null($oc)) {
$app['dependencies'] = $oc;
}
* @return array
*/
function providesOS() {
- return array(
- array(array(), null),
- array(array(), array()),
- array(array('Following platforms are supported: ANDROID'), 'ANDROID'),
- array(array('Following platforms are supported: WINNT'), array('WINNT'))
- );
+ return [
+ [[], null],
+ [[], []],
+ [['Following platforms are supported: ANDROID'], 'ANDROID'],
+ [['Following platforms are supported: WINNT'], ['WINNT']]
+ ];
}
/**
* @return array
*/
function providesDatabases() {
- return array(
+ return [
// non BC - in case on databases are defined -> all are supported
- array(array(), null),
- array(array(), array()),
- array(array('Following databases are supported: mongodb'), 'mongodb'),
- array(array('Following databases are supported: sqlite, postgres'), array('sqlite', array('@value' => 'postgres'))),
- );
+ [[], null],
+ [[], []],
+ [['Following databases are supported: mongodb'], 'mongodb'],
+ [['Following databases are supported: sqlite, postgres'], ['sqlite', ['@value' => 'postgres']]],
+ ];
}
/**
* @return array
*/
function providesPhpVersion() {
- return array(
- array(array(), null, null, null),
- array(array(), '5.4', null, null),
- array(array(), null, '5.5', null),
- array(array(), '5.4', '5.5', null),
- array(array('PHP 5.4.4 or higher is required.'), '5.4.4', null, null),
- array(array('PHP with a version lower than 5.4.2 is required.'), null, '5.4.2', null),
- array(array('64bit or higher PHP required.'), null, null, 64),
- array(array(), '5.4', '5.4', null),
- );
+ return [
+ [[], null, null, null],
+ [[], '5.4', null, null],
+ [[], null, '5.5', null],
+ [[], '5.4', '5.5', null],
+ [['PHP 5.4.4 or higher is required.'], '5.4.4', null, null],
+ [['PHP with a version lower than 5.4.2 is required.'], null, '5.4.2', null],
+ [['64bit or higher PHP required.'], null, null, 64],
+ [[], '5.4', '5.4', null],
+ ];
}
}
}
public function providesVersions() {
- return array(
- 'none' => array('1.0.0', '1.0.0.0'),
- 'none/2' => array('1.2.3.4', '1.2.3.4'),
- 'parses state' => array('1.0.0RC1dev', '1.0.0.0-RC1-dev'),
- 'CI parsing' => array('1.0.0-rC15-dev', '1.0.0.0-RC15-dev'),
- 'delimiters' => array('1.0.0.RC.15-dev', '1.0.0.0-RC15-dev'),
- 'RC uppercase' => array('1.0.0-rc1', '1.0.0.0-RC1'),
- 'patch replace' => array('1.0.0.pl3-dev', '1.0.0.0-patch3-dev'),
- 'forces w.x.y.z' => array('1.0-dev', '1.0.0.0-dev'),
- 'forces w.x.y.z/2' => array('0', '0.0.0.0'),
- 'parses long' => array('10.4.13-beta', '10.4.13.0-beta'),
- 'parses long/2' => array('10.4.13beta2', '10.4.13.0-beta2'),
- 'parses long/semver' => array('10.4.13beta.2', '10.4.13.0-beta2'),
- 'expand shorthand' => array('10.4.13-b', '10.4.13.0-beta'),
- 'expand shorthand2' => array('10.4.13-b5', '10.4.13.0-beta5'),
- 'strips leading v' => array('v1.0.0', '1.0.0.0'),
- 'strips v/datetime' => array('v20100102', '20100102'),
- 'parses dates y-m' => array('2010.01', '2010-01'),
- 'parses dates w/ .' => array('2010.01.02', '2010-01-02'),
- 'parses dates w/ -' => array('2010-01-02', '2010-01-02'),
- 'parses numbers' => array('2010-01-02.5', '2010-01-02-5'),
- 'parses dates y.m.Y' => array('2010.1.555', '2010.1.555.0'),
- 'parses datetime' => array('20100102-203040', '20100102-203040'),
- 'parses dt+number' => array('20100102203040-10', '20100102203040-10'),
- 'parses dt+patch' => array('20100102-203040-p1', '20100102-203040-patch1'),
- 'parses master' => array('dev-master', '9999999-dev'),
- 'parses trunk' => array('dev-trunk', '9999999-dev'),
+ return [
+ 'none' => ['1.0.0', '1.0.0.0'],
+ 'none/2' => ['1.2.3.4', '1.2.3.4'],
+ 'parses state' => ['1.0.0RC1dev', '1.0.0.0-RC1-dev'],
+ 'CI parsing' => ['1.0.0-rC15-dev', '1.0.0.0-RC15-dev'],
+ 'delimiters' => ['1.0.0.RC.15-dev', '1.0.0.0-RC15-dev'],
+ 'RC uppercase' => ['1.0.0-rc1', '1.0.0.0-RC1'],
+ 'patch replace' => ['1.0.0.pl3-dev', '1.0.0.0-patch3-dev'],
+ 'forces w.x.y.z' => ['1.0-dev', '1.0.0.0-dev'],
+ 'forces w.x.y.z/2' => ['0', '0.0.0.0'],
+ 'parses long' => ['10.4.13-beta', '10.4.13.0-beta'],
+ 'parses long/2' => ['10.4.13beta2', '10.4.13.0-beta2'],
+ 'parses long/semver' => ['10.4.13beta.2', '10.4.13.0-beta2'],
+ 'expand shorthand' => ['10.4.13-b', '10.4.13.0-beta'],
+ 'expand shorthand2' => ['10.4.13-b5', '10.4.13.0-beta5'],
+ 'strips leading v' => ['v1.0.0', '1.0.0.0'],
+ 'strips v/datetime' => ['v20100102', '20100102'],
+ 'parses dates y-m' => ['2010.01', '2010-01'],
+ 'parses dates w/ .' => ['2010.01.02', '2010-01-02'],
+ 'parses dates w/ -' => ['2010-01-02', '2010-01-02'],
+ 'parses numbers' => ['2010-01-02.5', '2010-01-02-5'],
+ 'parses dates y.m.Y' => ['2010.1.555', '2010.1.555.0'],
+ 'parses datetime' => ['20100102-203040', '20100102-203040'],
+ 'parses dt+number' => ['20100102203040-10', '20100102203040-10'],
+ 'parses dt+patch' => ['20100102-203040-p1', '20100102-203040-patch1'],
+ 'parses master' => ['dev-master', '9999999-dev'],
+ 'parses trunk' => ['dev-trunk', '9999999-dev'],
// 'parses branches' => array('1.x-dev', '1.9999999.9999999.9999999-dev'),
- 'parses arbitrary' => array('dev-feature-foo', 'dev-feature-foo'),
- 'parses arbitrary2' => array('DEV-FOOBAR', 'dev-FOOBAR'),
- 'parses arbitrary3' => array('dev-feature/foo', 'dev-feature/foo'),
- 'ignores aliases' => array('dev-master as 1.0.0', '9999999-dev'),
+ 'parses arbitrary' => ['dev-feature-foo', 'dev-feature-foo'],
+ 'parses arbitrary2' => ['DEV-FOOBAR', 'dev-FOOBAR'],
+ 'parses arbitrary3' => ['dev-feature/foo', 'dev-feature/foo'],
+ 'ignores aliases' => ['dev-master as 1.0.0', '9999999-dev'],
// 'semver metadata' => array('dev-master+foo.bar', '9999999-dev'),
// 'semver metadata/2' => array('1.0.0-beta.5+foo', '1.0.0.0-beta5'),
// 'semver metadata/3' => array('1.0.0+foo', '1.0.0.0'),
// 'metadata w/ alias' => array('1.0.0+foo as 2.0', '1.0.0.0'),
- );
+ ];
}}
use OCP\AppFramework\Http\Response;
function rrmdir($directory) {
- $files = array_diff(scandir($directory), array('.','..'));
+ $files = array_diff(scandir($directory), ['.','..']);
foreach ($files as $file) {
if (is_dir($directory . '/' . $file)) {
rrmdir($directory . '/' . $file);
protected function setUp(): void {
parent::setUp();
- $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', array());
+ $this->container = new \OC\AppFramework\DependencyInjection\DIContainer('test', []);
$this->controller = $this->createMock(Controller::class);
$this->dispatcher = $this->createMock(Dispatcher::class);
$this->io = $this->createMock(Http\IOutput::class);
- $this->headers = array('key' => 'value');
+ $this->headers = ['key' => 'value'];
$this->output = 'hi';
$this->controllerName = 'Controller';
$this->controllerMethod = 'method';
$this->container[$this->controllerName] = $this->controller;
$this->container['Dispatcher'] = $this->dispatcher;
$this->container['OCP\\AppFramework\\Http\\IOutput'] = $this->io;
- $this->container['urlParams'] = array();
+ $this->container['urlParams'] = [];
$this->appPath = __DIR__ . '/../../../apps/namespacetestapp';
$infoXmlPath = $this->appPath . '/appinfo/info.xml';
public function custom($in) {
$this->registerResponder('json', function ($response) {
- return new JSONResponse(array(strlen($response)));
+ return new JSONResponse([strlen($response)]);
});
return $in;
public function testFormat() {
- $response = $this->controller->buildResponse(array('hi'), 'json');
+ $response = $this->controller->buildResponse(['hi'], 'json');
- $this->assertEquals(array('hi'), $response->getData());
+ $this->assertEquals(['hi'], $response->getData());
}
'Feature-Policy' => "autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'",
];
- $response = $this->controller->customDataResponse(array('hi'));
+ $response = $this->controller->customDataResponse(['hi']);
$response = $this->controller->buildResponse($response, 'json');
- $this->assertEquals(array('hi'), $response->getData());
+ $this->assertEquals(['hi'], $response->getData());
$this->assertEquals(300, $response->getStatus());
$this->assertEquals($expectedHeaders, $response->getHeaders());
}
$response = $this->controller->custom('hi');
$response = $this->controller->buildResponse($response, 'json');
- $this->assertEquals(array(2), $response->getData());
+ $this->assertEquals([2], $response->getData());
}
$entity->setId(3);
$entity->resetUpdatedFields();
- $this->assertEquals(array(), $entity->getUpdatedFields());
+ $this->assertEquals([], $entity->getUpdatedFields());
}
public function testFromRow(){
- $row = array(
+ $row = [
'pre_name' => 'john',
'email' => 'john@something.com'
- );
+ ];
$this->entity = TestEntity::fromRow($row);
$this->assertEquals($row['pre_name'], $this->entity->getPreName());
public function testFromRowShouldNotAssignEmptyArray(){
- $row = array();
+ $row = [];
$entity2 = new TestEntity();
$this->entity = TestEntity::fromRow($row);
public function testIdGetsConvertedToInt(){
- $row = array('id' => '4');
+ $row = ['id' => '4'];
$this->entity = TestEntity::fromRow($row);
$this->assertSame(4, $this->entity->getId());
public function testSetType(){
- $row = array('testId' => '4');
+ $row = ['testId' => '4'];
$this->entity = TestEntity::fromRow($row);
$this->assertSame(4, $this->entity->getTestId());
public function testFromParams(){
- $params = array(
+ $params = [
'testId' => 4,
'email' => 'john@doe'
- );
+ ];
$entity = TestEntity::fromParams($params);
public function testGetFieldTypes() {
$entity = new TestEntity();
- $this->assertEquals(array(
+ $this->assertEquals([
'id' => 'integer',
'testId' => 'integer',
'trueOrFalse' => 'bool',
'anotherBool' => 'boolean',
- ), $entity->getFieldTypes());
+ ], $entity->getFieldTypes());
}
public function testFindQuery(){
$sql = 'hi';
- $params = array('jo');
- $rows = array(
- array('hi')
- );
+ $params = ['jo'];
+ $rows = [
+ ['hi']
+ ];
$this->setMapperResult($sql, $params, $rows);
$this->mapper->find($sql, $params);
}
public function testFindEntity(){
$sql = 'hi';
- $params = array('jo');
- $rows = array(
- array('pre_name' => 'hi')
- );
+ $params = ['jo'];
+ $rows = [
+ ['pre_name' => 'hi']
+ ];
$this->setMapperResult($sql, $params, $rows, null, null, true);
$this->mapper->findOneEntity($sql, $params);
}
public function testFindNotFound(){
$sql = 'hi';
- $params = array('jo');
- $rows = array();
+ $params = ['jo'];
+ $rows = [];
$this->setMapperResult($sql, $params, $rows);
$this->expectException(DoesNotExistException::class);
$this->mapper->find($sql, $params);
public function testFindEntityNotFound(){
$sql = 'hi';
- $params = array('jo');
- $rows = array();
+ $params = ['jo'];
+ $rows = [];
$this->setMapperResult($sql, $params, $rows, null, null, true);
$this->expectException(DoesNotExistException::class);
$this->mapper->findOneEntity($sql, $params);
public function testFindMultiple(){
$sql = 'hi';
- $params = array('jo');
- $rows = array(
- array('jo'), array('ho')
- );
+ $params = ['jo'];
+ $rows = [
+ ['jo'], ['ho']
+ ];
$this->setMapperResult($sql, $params, $rows, null, null, true);
$this->expectException(MultipleObjectsReturnedException::class);
$this->mapper->find($sql, $params);
public function testFindEntityMultiple(){
$sql = 'hi';
- $params = array('jo');
- $rows = array(
- array('jo'), array('ho')
- );
+ $params = ['jo'];
+ $rows = [
+ ['jo'], ['ho']
+ ];
$this->setMapperResult($sql, $params, $rows, null, null, true);
$this->expectException(MultipleObjectsReturnedException::class);
$this->mapper->findOneEntity($sql, $params);
public function testDelete(){
$sql = 'DELETE FROM `*PREFIX*table` WHERE `id` = ?';
- $params = array(2);
+ $params = [2];
$this->setMapperResult($sql, $params, [], null, null, true);
$entity = new Example();
$sql = 'INSERT INTO `*PREFIX*table`(`pre_name`,`email`) ' .
'VALUES(?,?)';
- $params = array('john', 'my@email');
+ $params = ['john', 'my@email'];
$entity = new Example();
$entity->setPreName($params[0]);
$entity->setEmail($params[1]);
$sql = 'INSERT INTO `*PREFIX*table`(`pre_name`,`email`) ' .
'VALUES(?,?)';
- $params = array('john', 'my@email');
+ $params = ['john', 'my@email'];
$entity = new Example();
$entity->setPreName($params[0]);
$entity->setEmail($params[1]);
'`email` = ? ' .
'WHERE `id` = ?';
- $params = array('john', 'my@email', 1);
+ $params = ['john', 'my@email', 1];
$entity = new Example();
$entity->setPreName($params[0]);
$entity->setEmail($params[1]);
public function testUpdateNoId(){
- $params = array('john', 'my@email');
+ $params = ['john', 'my@email'];
$entity = new Example();
$entity->setPreName($params[0]);
$entity->setEmail($params[1]);
public function testUpdateNothingChangedNoQuery(){
- $params = array('john', 'my@email');
+ $params = ['john', 'my@email'];
$entity = new Example();
$entity->setId(3);
$entity->setEmail($params[1]);
public function testMapRowToEntity(){
- $entity1 = $this->mapper->mapRow(array('pre_name' => 'test1', 'email' => 'test2'));
+ $entity1 = $this->mapper->mapRow(['pre_name' => 'test1', 'email' => 'test2']);
$entity2 = new Example();
$entity2->setPreName('test1');
$entity2->setEmail('test2');
public function testFindEntities(){
$sql = 'hi';
- $rows = array(
- array('pre_name' => 'hi')
- );
+ $rows = [
+ ['pre_name' => 'hi']
+ ];
$entity = new Example();
$entity->setPreName('hi');
$entity->resetUpdatedFields();
- $this->setMapperResult($sql, array(), $rows, null, null, true);
+ $this->setMapperResult($sql, [], $rows, null, null, true);
$result = $this->mapper->findAllEntities($sql);
- $this->assertEquals(array($entity), $result);
+ $this->assertEquals([$entity], $result);
}
public function testFindEntitiesNotFound(){
$sql = 'hi';
- $rows = array();
- $this->setMapperResult($sql, array(), $rows);
+ $rows = [];
+ $this->setMapperResult($sql, [], $rows);
$result = $this->mapper->findAllEntities($sql);
- $this->assertEquals(array(), $result);
+ $this->assertEquals([], $result);
}
public function testFindEntitiesMultiple(){
$sql = 'hi';
- $rows = array(
- array('pre_name' => 'jo'), array('email' => 'ho')
- );
+ $rows = [
+ ['pre_name' => 'jo'], ['email' => 'ho']
+ ];
$entity1 = new Example();
$entity1->setPreName('jo');
$entity1->resetUpdatedFields();
$entity2 = new Example();
$entity2->setEmail('ho');
$entity2->resetUpdatedFields();
- $this->setMapperResult($sql, array(), $rows);
+ $this->setMapperResult($sql, [], $rows);
$result = $this->mapper->findAllEntities($sql);
- $this->assertEquals(array($entity1, $entity2), $result);
+ $this->assertEquals([$entity1, $entity2], $result);
}
}
* of the database query. If not provided, it wont be assumed that fetch
* will be called on the result
*/
- protected function setMapperResult($sql, $arguments=array(), $returnRows=array(),
+ protected function setMapperResult($sql, $arguments=[], $returnRows=[],
$limit=null, $offset=null, $expectClose=false){
if($limit === null && $offset === null) {
$this->db->expects($this->at($this->prepareAt))
public function testSetData() {
- $params = array('hi', 'yo');
+ $params = ['hi', 'yo'];
$this->response->setData($params);
- $this->assertEquals(array('hi', 'yo'), $this->response->getData());
+ $this->assertEquals(['hi', 'yo'], $this->response->getData());
}
public function testConstructorAllowsToSetData() {
- $data = array('hi');
+ $data = ['hi'];
$code = 300;
$response = new DataResponse($data, $code);
public function testConstructorAllowsToSetHeaders() {
- $data = array('hi');
+ $data = ['hi'];
$code = 300;
- $headers = array('test' => 'something');
+ $headers = ['test' => 'something'];
$response = new DataResponse($data, $code, $headers);
$expectedHeaders = [
public function testChainability() {
- $params = array('hi', 'yo');
+ $params = ['hi', 'yo'];
$this->response->setData($params)
->setStatus(Http::STATUS_NOT_FOUND);
$this->assertEquals(Http::STATUS_NOT_FOUND, $this->response->getStatus());
- $this->assertEquals(array('hi', 'yo'), $this->response->getData());
+ $this->assertEquals(['hi', 'yo'], $this->response->getData());
}
*/
public function exec($int, $bool, $test=4, $test2=1) {
$this->registerResponder('text', function($in) {
- return new JSONResponse(array('text' => $in));
+ return new JSONResponse(['text' => $in]);
});
- return array($int, $bool, $test, $test2);
+ return [$int, $bool, $test, $test2];
}
* @return DataResponse
*/
public function execDataResponse($int, $bool, $test=4, $test2=1) {
- return new DataResponse(array(
- 'text' => array($int, $bool, $test, $test2)
- ));
+ return new DataResponse([
+ 'text' => [$int, $bool, $test, $test2]
+ ]);
}
}
* @param string $httpHeaders
*/
private function setMiddlewareExpectations($out=null,
- $httpHeaders=null, $responseHeaders=array(),
+ $httpHeaders=null, $responseHeaders=[],
$ex=false, $catchEx=true) {
if($ex) {
$response = $this->dispatcher->dispatch($this->controller, $this->controllerMethod);
$this->assertNull($response[0]);
- $this->assertEquals(array(), $response[1]);
+ $this->assertEquals([], $response[1]);
$this->assertNull($response[2]);
}
public function testHeadersAndOutputAreReturned(){
$out = 'yo';
$httpHeaders = 'Http';
- $responseHeaders = array('hell' => 'yeah');
+ $responseHeaders = ['hell' => 'yeah'];
$this->setMiddlewareExpectations($out, $httpHeaders, $responseHeaders);
$response = $this->dispatcher->dispatch($this->controller,
public function testExceptionCallsAfterException() {
$out = 'yo';
$httpHeaders = 'Http';
- $responseHeaders = array('hell' => 'yeah');
+ $responseHeaders = ['hell' => 'yeah'];
$this->setMiddlewareExpectations($out, $httpHeaders, $responseHeaders, true);
$response = $this->dispatcher->dispatch($this->controller,
protected function setUp(): void {
parent::setUp();
- $this->server = array();
+ $this->server = [];
$this->http = new Http($this->server);
}
public function testEtagMatchReturnsNotModified() {
- $http = new Http(array('HTTP_IF_NONE_MATCH' => 'hi'));
+ $http = new Http(['HTTP_IF_NONE_MATCH' => 'hi']);
$header = $http->getStatusHeader(Http::STATUS_OK, null, 'hi');
$this->assertEquals('HTTP/1.1 304 Not Modified', $header);
public function testQuotedEtagMatchReturnsNotModified() {
- $http = new Http(array('HTTP_IF_NONE_MATCH' => '"hi"'));
+ $http = new Http(['HTTP_IF_NONE_MATCH' => '"hi"']);
$header = $http->getStatusHeader(Http::STATUS_OK, null, 'hi');
$this->assertEquals('HTTP/1.1 304 Not Modified', $header);
$dateTime->setTimestamp('12');
$http = new Http(
- array(
- 'HTTP_IF_MODIFIED_SINCE' => 'Thu, 01 Jan 1970 00:00:12 +0000')
+ [
+ 'HTTP_IF_MODIFIED_SINCE' => 'Thu, 01 Jan 1970 00:00:12 +0000']
);
$header = $http->getStatusHeader(Http::STATUS_OK, $dateTime);
public function testTempRedirectBecomesFoundInHttp10() {
- $http = new Http(array(), 'HTTP/1.0');
+ $http = new Http([], 'HTTP/1.0');
$header = $http->getStatusHeader(Http::STATUS_TEMPORARY_REDIRECT);
$this->assertEquals('HTTP/1.0 302 Found', $header);
public function testSetData() {
- $params = array('hi', 'yo');
+ $params = ['hi', 'yo'];
$this->json->setData($params);
- $this->assertEquals(array('hi', 'yo'), $this->json->getData());
+ $this->assertEquals(['hi', 'yo'], $this->json->getData());
}
public function testSetRender() {
- $params = array('test' => 'hi');
+ $params = ['test' => 'hi'];
$this->json->setData($params);
$expected = '{"test":"hi"}';
}
public function testConstructorAllowsToSetData() {
- $data = array('hi');
+ $data = ['hi'];
$code = 300;
$response = new JSONResponse($data, $code);
}
public function testChainability() {
- $params = array('hi', 'yo');
+ $params = ['hi', 'yo'];
$this->json->setData($params)
->setStatus(Http::STATUS_NOT_FOUND);
$this->assertEquals(Http::STATUS_NOT_FOUND, $this->json->getStatus());
- $this->assertEquals(array('hi', 'yo'), $this->json->getData());
+ $this->assertEquals(['hi', 'yo'], $this->json->getData());
}
}
public function stream_stat() {
$size = strlen($GLOBALS[$this->varname]);
$time = time();
- $data = array(
+ $data = [
'dev' => 0,
'ino' => 0,
'mode' => 0777,
'ctime' => $time,
'blksize' => -1,
'blocks' => -1,
- );
+ ];
return array_values($data) + $data;
//return false;
}
}
public function testRequestAccessors() {
- $vars = array(
- 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+ $vars = [
+ 'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET',
- );
+ ];
$request = new Request(
$vars,
// urlParams has precedence over POST which has precedence over GET
public function testPrecedence() {
- $vars = array(
- 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
- 'post' => array('name' => 'Jane Doe', 'nickname' => 'Janey'),
- 'urlParams' => array('user' => 'jw', 'name' => 'Johnny Weissmüller'),
+ $vars = [
+ 'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
+ 'post' => ['name' => 'Jane Doe', 'nickname' => 'Janey'],
+ 'urlParams' => ['user' => 'jw', 'name' => 'Johnny Weissmüller'],
'method' => 'GET'
- );
+ ];
$request = new Request(
$vars,
public function testImmutableArrayAccess() {
$this->expectException(\RuntimeException::class);
- $vars = array(
- 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+ $vars = [
+ 'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET'
- );
+ ];
$request = new Request(
$vars,
public function testImmutableMagicAccess() {
$this->expectException(\RuntimeException::class);
- $vars = array(
- 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+ $vars = [
+ 'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET'
- );
+ ];
$request = new Request(
$vars,
public function testGetTheMethodRight() {
$this->expectException(\LogicException::class);
- $vars = array(
- 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+ $vars = [
+ 'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET',
- );
+ ];
$request = new Request(
$vars,
}
public function testTheMethodIsRight() {
- $vars = array(
- 'get' => array('name' => 'John Q. Public', 'nickname' => 'Joey'),
+ $vars = [
+ 'get' => ['name' => 'John Q. Public', 'nickname' => 'Joey'],
'method' => 'GET',
- );
+ ];
$request = new Request(
$vars,
public function testJsonPost() {
global $data;
$data = '{"name": "John Q. Public", "nickname": "Joey"}';
- $vars = array(
+ $vars = [
'method' => 'POST',
- 'server' => array('CONTENT_TYPE' => 'application/json; utf-8')
- );
+ 'server' => ['CONTENT_TYPE' => 'application/json; utf-8']
+ ];
$request = new Request(
$vars,
public function testNotJsonPost() {
global $data;
$data = 'this is not valid json';
- $vars = array(
+ $vars = [
'method' => 'POST',
- 'server' => array('CONTENT_TYPE' => 'application/json; utf-8')
- );
+ 'server' => ['CONTENT_TYPE' => 'application/json; utf-8']
+ ];
$request = new Request(
$vars,
public function testPatch() {
global $data;
- $data = http_build_query(array('name' => 'John Q. Public', 'nickname' => 'Joey'), '', '&');
+ $data = http_build_query(['name' => 'John Q. Public', 'nickname' => 'Joey'], '', '&');
- $vars = array(
+ $vars = [
'method' => 'PATCH',
- 'server' => array('CONTENT_TYPE' => 'application/x-www-form-urlencoded'),
- );
+ 'server' => ['CONTENT_TYPE' => 'application/x-www-form-urlencoded'],
+ ];
$request = new Request(
$vars,
// PUT content
$data = '{"name": "John Q. Public", "nickname": "Joey"}';
- $vars = array(
+ $vars = [
'method' => 'PUT',
- 'server' => array('CONTENT_TYPE' => 'application/json; utf-8'),
- );
+ 'server' => ['CONTENT_TYPE' => 'application/json; utf-8'],
+ ];
$request = new Request(
$vars,
// PATCH content
$data = '{"name": "John Q. Public", "nickname": null}';
- $vars = array(
+ $vars = [
'method' => 'PATCH',
- 'server' => array('CONTENT_TYPE' => 'application/json; utf-8'),
- );
+ 'server' => ['CONTENT_TYPE' => 'application/json; utf-8'],
+ ];
$request = new Request(
$vars,
global $data;
$data = file_get_contents(__DIR__ . '/../../../data/testimage.png');
- $vars = array(
+ $vars = [
'put' => $data,
'method' => 'PUT',
'server' => [
'CONTENT_TYPE' => 'image/png',
'CONTENT_LENGTH' => (string)strlen($data)
],
- );
+ ];
$request = new Request(
$vars,
public function testSetUrlParameters() {
- $vars = array(
- 'post' => array(),
+ $vars = [
+ 'post' => [],
'method' => 'POST',
- 'urlParams' => array('id' => '2'),
- );
+ 'urlParams' => ['id' => '2'],
+ ];
$request = new Request(
$vars,
$this->stream
);
- $newParams = array('id' => '3', 'test' => 'test2');
+ $newParams = ['id' => '3', 'test' => 'test2'];
$request->setUrlParameters($newParams);
$this->assertSame('test2', $request->getParam('test'));
$this->assertEquals('3', $request->getParam('id'));
public function testSetHeaders() {
- $expected = array(
+ $expected = [
'Last-Modified' => 1,
'ETag' => 3,
'Something-Else' => 'hi'
- );
+ ];
$this->childResponse->setHeaders($expected);
$headers = $this->childResponse->getHeaders();
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo', new \DateTime('1970-01-01'));
- $expectedResponse = array(
- 'foo' => array(
+ $expectedResponse = [
+ 'foo' => [
'value' => 'bar',
'expireDate' => null,
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'foo',
'expireDate' => new \DateTime('1970-01-01')
- )
- );
+ ]
+ ];
$this->assertEquals($expectedResponse, $this->childResponse->getCookies());
}
function testSetCookies() {
- $expected = array(
- 'foo' => array(
+ $expected = [
+ 'foo' => [
'value' => 'bar',
'expireDate' => null,
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'foo',
'expireDate' => new \DateTime('1970-01-01')
- )
- );
+ ]
+ ];
$this->childResponse->setCookies($expected);
$cookies = $this->childResponse->getCookies();
function testInvalidateCookie() {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->invalidateCookie('foo');
- $expected = array(
- 'foo' => array(
+ $expected = [
+ 'foo' => [
'value' => 'expired',
'expireDate' => new \DateTime('1971-01-01')
- )
- );
+ ]
+ ];
$cookies = $this->childResponse->getCookies();
function testInvalidateCookies() {
$this->childResponse->addCookie('foo', 'bar');
$this->childResponse->addCookie('bar', 'foo');
- $expected = array(
- 'foo' => array(
+ $expected = [
+ 'foo' => [
'value' => 'bar',
'expireDate' => null
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'foo',
'expireDate' => null
- )
- );
+ ]
+ ];
$cookies = $this->childResponse->getCookies();
$this->assertEquals($expected, $cookies);
- $this->childResponse->invalidateCookies(array('foo', 'bar'));
- $expected = array(
- 'foo' => array(
+ $this->childResponse->invalidateCookies(['foo', 'bar']);
+ $expected = [
+ 'foo' => [
'value' => 'expired',
'expireDate' => new \DateTime('1971-01-01')
- ),
- 'bar' => array(
+ ],
+ 'bar' => [
'value' => 'expired',
'expireDate' => new \DateTime('1971-01-01')
- )
- );
+ ]
+ ];
$cookies = $this->childResponse->getCookies();
$this->assertEquals($expected, $cookies);
public function testSetParamsConstructor(){
- $params = array('hi' => 'yo');
+ $params = ['hi' => 'yo'];
$this->tpl = new TemplateResponse('app', 'home', $params);
- $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams());
+ $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams());
}
public function testSetRenderAsConstructor(){
$renderAs = 'myrender';
- $this->tpl = new TemplateResponse('app', 'home', array(), $renderAs);
+ $this->tpl = new TemplateResponse('app', 'home', [], $renderAs);
$this->assertEquals($renderAs, $this->tpl->getRenderAs());
}
public function testSetParams(){
- $params = array('hi' => 'yo');
+ $params = ['hi' => 'yo'];
$this->tpl->setParams($params);
- $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams());
+ $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams());
}
}
public function testChainability() {
- $params = array('hi' => 'yo');
+ $params = ['hi' => 'yo'];
$this->tpl->setParams($params)
->setStatus(Http::STATUS_NOT_FOUND);
$this->assertEquals(Http::STATUS_NOT_FOUND, $this->tpl->getStatus());
- $this->assertEquals(array('hi' => 'yo'), $this->tpl->getParams());
+ $this->assertEquals(['hi' => 'yo'], $this->tpl->getParams());
}
}
public function testSimpleRoute()
{
- $routes = array('routes' => array(
- array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET')
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'GET']
+ ]];
$this->assertSimpleRoute($routes, 'folders.open', 'GET', '/folders/{folderId}/open', 'FoldersController', 'open');
}
public function testSimpleRouteWithMissingVerb()
{
- $routes = array('routes' => array(
- array('name' => 'folders#open', 'url' => '/folders/{folderId}/open')
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders#open', 'url' => '/folders/{folderId}/open']
+ ]];
$this->assertSimpleRoute($routes, 'folders.open', 'GET', '/folders/{folderId}/open', 'FoldersController', 'open');
}
public function testSimpleRouteWithLowercaseVerb()
{
- $routes = array('routes' => array(
- array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete')
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
+ ]];
$this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open');
}
public function testSimpleRouteWithRequirements()
{
- $routes = array('routes' => array(
- array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'requirements' => array('something'))
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'requirements' => ['something']]
+ ]];
- $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array('something'));
+ $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', ['something']);
}
public function testSimpleOCSRouteWithRequirements() {
public function testSimpleRouteWithDefaults()
{
- $routes = array('routes' => array(
- array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', array(), 'defaults' => array('param' => 'foobar'))
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', [], 'defaults' => ['param' => 'foobar']]
+ ]];
- $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array('param' => 'foobar'));
+ $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', [], ['param' => 'foobar']);
}
public function testSimpleRouteWithPostfix()
{
- $routes = array('routes' => array(
- array('name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something')
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders#open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete', 'postfix' => '_something']
+ ]];
- $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', array(), array(), '_something');
+ $this->assertSimpleRoute($routes, 'folders.open', 'DELETE', '/folders/{folderId}/open', 'FoldersController', 'open', [], [], '_something');
}
public function testSimpleOCSRouteWithPostfix() {
{
$this->expectException(\UnexpectedValueException::class);
- $routes = array('routes' => array(
- array('name' => 'folders_open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete')
- ));
+ $routes = ['routes' => [
+ ['name' => 'folders_open', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
+ ]];
// router mock
$router = $this->getMockBuilder('\OC\Route\Router')
public function testSimpleRouteWithUnderScoreNames()
{
- $routes = array('routes' => array(
- array('name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete')
- ));
+ $routes = ['routes' => [
+ ['name' => 'admin_folders#open_current', 'url' => '/folders/{folderId}/open', 'verb' => 'delete']
+ ]];
$this->assertSimpleRoute($routes, 'admin_folders.open_current', 'DELETE', '/folders/{folderId}/open', 'AdminFoldersController', 'openCurrent');
}
public function testResource()
{
- $routes = array('resources' => array('account' => array('url' => '/accounts')));
+ $routes = ['resources' => ['account' => ['url' => '/accounts']]];
$this->assertResource($routes, 'account', '/accounts', 'AccountController', 'id');
}
public function testResourceWithUnderScoreName()
{
- $routes = array('resources' => array('admin_accounts' => array('url' => '/admin/accounts')));
+ $routes = ['resources' => ['admin_accounts' => ['url' => '/admin/accounts']]];
$this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'id');
}
* @param string $controllerName
* @param string $actionName
*/
- private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=array(), array $defaults=array(), $postfix='')
+ private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName, array $requirements=[], array $defaults=[], $postfix='')
{
if ($postfix) {
$name .= $postfix;
$url,
$controllerName,
$actionName,
- array $requirements=array(),
- array $defaults=array(),
+ array $requirements=[],
+ array $defaults=[],
$postfix='')
{
if ($postfix) {
$verb,
$controllerName,
$actionName,
- array $requirements=array(),
- array $defaults=array()
+ array $requirements=[],
+ array $defaults=[]
) {
$route = $this->getMockBuilder('\OC\Route\Route')
->setMethods(['method', 'action', 'requirements', 'defaults'])
'arguments'
);
- $this->assertEquals(array('arg' => null, 'arg2' => 'hi'), $reader->getParameters());
+ $this->assertEquals(['arg' => null, 'arg2' => 'hi'], $reader->getParameters());
}
'arguments2'
);
- $this->assertEquals(array('arg' => null), $reader->getParameters());
+ $this->assertEquals(['arg' => null], $reader->getParameters());
}
const TEST_GROUP2 = 'group2';
public function appVersionsProvider() {
- return array(
+ return [
// exact match
- array(
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '6.0',
'requiremax' => '6.0',
- ),
+ ],
true
- ),
+ ],
// in-between match
- array(
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '5.0',
'requiremax' => '7.0',
- ),
+ ],
true
- ),
+ ],
// app too old
- array(
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '5.0',
'requiremax' => '5.0',
- ),
+ ],
false
- ),
+ ],
// app too new
- array(
+ [
'5.0.0.0',
- array(
+ [
'requiremin' => '6.0',
'requiremax' => '6.0',
- ),
+ ],
false
- ),
+ ],
// only min specified
- array(
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '6.0',
- ),
+ ],
true
- ),
+ ],
// only min specified fail
- array(
+ [
'5.0.0.0',
- array(
+ [
'requiremin' => '6.0',
- ),
+ ],
false
- ),
+ ],
// only min specified legacy
- array(
+ [
'6.0.0.0',
- array(
+ [
'require' => '6.0',
- ),
+ ],
true
- ),
+ ],
// only min specified legacy fail
- array(
+ [
'4.0.0.0',
- array(
+ [
'require' => '6.0',
- ),
+ ],
false
- ),
+ ],
// only max specified
- array(
+ [
'5.0.0.0',
- array(
+ [
'requiremax' => '6.0',
- ),
+ ],
true
- ),
+ ],
// only max specified fail
- array(
+ [
'7.0.0.0',
- array(
+ [
'requiremax' => '6.0',
- ),
+ ],
false
- ),
+ ],
// variations of versions
// single OC number
- array(
+ [
'4',
- array(
+ [
'require' => '4.0',
- ),
+ ],
true
- ),
+ ],
// multiple OC number
- array(
+ [
'4.3.1',
- array(
+ [
'require' => '4.3',
- ),
+ ],
true
- ),
+ ],
// single app number
- array(
+ [
'4',
- array(
+ [
'require' => '4',
- ),
+ ],
true
- ),
+ ],
// single app number fail
- array(
+ [
'4.3',
- array(
+ [
'require' => '5',
- ),
+ ],
false
- ),
+ ],
// complex
- array(
+ [
'5.0.0',
- array(
+ [
'require' => '4.5.1',
- ),
+ ],
true
- ),
+ ],
// complex fail
- array(
+ [
'4.3.1',
- array(
+ [
'require' => '4.3.2',
- ),
+ ],
false
- ),
+ ],
// two numbers
- array(
+ [
'4.3.1',
- array(
+ [
'require' => '4.4',
- ),
+ ],
false
- ),
+ ],
// one number fail
- array(
+ [
'4.3.1',
- array(
+ [
'require' => '5',
- ),
+ ],
false
- ),
+ ],
// pre-alpha app
- array(
+ [
'5.0.3',
- array(
+ [
'require' => '4.93',
- ),
+ ],
true
- ),
+ ],
// pre-alpha OC
- array(
+ [
'6.90.0.2',
- array(
+ [
'require' => '6.90',
- ),
+ ],
true
- ),
+ ],
// pre-alpha OC max
- array(
+ [
'6.90.0.2',
- array(
+ [
'requiremax' => '7',
- ),
+ ],
true
- ),
+ ],
// expect same major number match
- array(
+ [
'5.0.3',
- array(
+ [
'require' => '5',
- ),
+ ],
true
- ),
+ ],
// expect same major number match
- array(
+ [
'5.0.3',
- array(
+ [
'requiremax' => '5',
- ),
+ ],
true
- ),
+ ],
// dependencies versions before require*
- array(
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '5.0',
'requiremax' => '7.0',
- 'dependencies' => array(
- 'owncloud' => array(
- '@attributes' => array(
+ 'dependencies' => [
+ 'owncloud' => [
+ '@attributes' => [
'min-version' => '7.0',
'max-version' => '7.0',
- ),
- ),
- ),
- ),
+ ],
+ ],
+ ],
+ ],
false
- ),
- array(
+ ],
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '5.0',
'requiremax' => '7.0',
- 'dependencies' => array(
- 'owncloud' => array(
- '@attributes' => array(
+ 'dependencies' => [
+ 'owncloud' => [
+ '@attributes' => [
'min-version' => '5.0',
'max-version' => '5.0',
- ),
- ),
- ),
- ),
+ ],
+ ],
+ ],
+ ],
false
- ),
- array(
+ ],
+ [
'6.0.0.0',
- array(
+ [
'requiremin' => '5.0',
'requiremax' => '5.0',
- 'dependencies' => array(
- 'owncloud' => array(
- '@attributes' => array(
+ 'dependencies' => [
+ 'owncloud' => [
+ '@attributes' => [
'min-version' => '5.0',
'max-version' => '7.0',
- ),
- ),
- ),
- ),
+ ],
+ ],
+ ],
+ ],
true
- ),
+ ],
[
'9.2.0.0',
[
],
true
],
- );
+ ];
}
/**
* Providers for the app config values
*/
public function appConfigValuesProvider() {
- return array(
+ return [
// logged in user1
- array(
+ [
self::TEST_USER1,
- array(
+ [
'files',
'app1',
'app3',
'twofactor_backupcodes',
'viewer',
'workflowengine',
- ),
+ ],
false
- ),
+ ],
// logged in user2
- array(
+ [
self::TEST_USER2,
- array(
+ [
'files',
'app1',
'app3',
'twofactor_backupcodes',
'viewer',
'workflowengine',
- ),
+ ],
false
- ),
+ ],
// logged in user3
- array(
+ [
self::TEST_USER3,
- array(
+ [
'files',
'app1',
'app3',
'twofactor_backupcodes',
'viewer',
'workflowengine',
- ),
+ ],
false
- ),
+ ],
// no user, returns all apps
- array(
+ [
null,
- array(
+ [
'files',
'app1',
'app3',
'twofactor_backupcodes',
'viewer',
'workflowengine',
- ),
+ ],
false,
- ),
+ ],
// user given, but ask for all
- array(
+ [
self::TEST_USER1,
- array(
+ [
'files',
'app1',
'app3',
'twofactor_backupcodes',
'viewer',
'workflowengine',
- ),
+ ],
true,
- ),
- );
+ ],
+ ];
}
/**
$this->setupAppConfigMock()->expects($this->once())
->method('getValues')
->willReturn(
- array(
+ [
'app3' => 'yes',
'app2' => 'no',
'app1' => 'yes',
'appforgroup1' => '["group1"]',
'appforgroup2' => '["group2"]',
'appforgroup12' => '["group2","group1"]',
- )
+ ]
);
$this->setupAppConfigMock()->expects($this->once())
->method('getValues')
->willReturn(
- array(
+ [
'app3' => 'yes',
'app2' => 'no',
- )
+ ]
);
$apps = \OC_App::getEnabledApps();
- $this->assertEquals(array('files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'), $apps);
+ $this->assertEquals(['files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'], $apps);
// mock should not be called again here
$apps = \OC_App::getEnabledApps();
- $this->assertEquals(array('files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'), $apps);
+ $this->assertEquals(['files', 'app3', 'cloud_federation_api', 'dav', 'federatedfilesharing', 'lookup_server_connector', 'oauth2', 'provisioning_api', 'settings', 'twofactor_backupcodes', 'viewer', 'workflowengine'], $apps);
$this->restoreAppConfig();
\OC_User::setUserId(null);
public function testGetFiles() {
$this->instance=$this->getExisting();
$allFiles=$this->instance->getFiles();
- $expected=array('lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt');
+ $expected=['lorem.txt','logo-wide.png','dir/', 'dir/lorem.txt'];
$this->assertEquals(4, count($allFiles), 'only found '.count($allFiles).' out of 4 expected files');
foreach($expected as $file) {
$this->assertContains($file, $allFiles, 'cant find '. $file . ' in archive');
$this->assertFalse($this->instance->fileExists('non/existing/file'));
$rootContent=$this->instance->getFolder('');
- $expected=array('lorem.txt','logo-wide.png', 'dir/');
+ $expected=['lorem.txt','logo-wide.png', 'dir/'];
$this->assertEquals(3, count($rootContent));
foreach($expected as $file) {
$this->assertContains($file, $rootContent, 'cant find '. $file . ' in archive');
}
$dirContent=$this->instance->getFolder('dir/');
- $expected=array('lorem.txt');
+ $expected=['lorem.txt'];
$this->assertEquals(1, count($dirContent));
foreach($expected as $file) {
$this->assertContains($file, $dirContent, 'cant find '. $file . ' in archive');
/**
* @var IJob[]
*/
- private $jobs = array();
+ private $jobs = [];
private $last = 0;
}
public function argumentProvider() {
- return array(
- array(null),
- array(false),
- array('foobar'),
- array(12),
- array(array(
+ return [
+ [null],
+ [false],
+ ['foobar'],
+ [12],
+ [[
'asd' => 5,
'foo' => 'bar'
- ))
- );
+ ]]
+ ];
}
/**
//set up temporary storage
$this->storage = \OC\Files\Filesystem::getStorage('/');
\OC\Files\Filesystem::clearMounts();
- $storage = new \OC\Files\Storage\Temporary(array());
- \OC\Files\Filesystem::mount($storage,array(),'/');
+ $storage = new \OC\Files\Storage\Temporary([]);
+ \OC\Files\Filesystem::mount($storage,[],'/');
$datadir = str_replace('local::', '', $storage->getId());
$config = \OC::$server->getConfig();
$this->datadir = $config->getSystemValue('cachedirectory', \OC::$SERVERROOT.'/data/cache');
// Restore the original mount point
\OC\Files\Filesystem::clearMounts();
- \OC\Files\Filesystem::mount($this->storage, array(), '/');
+ \OC\Files\Filesystem::mount($this->storage, [], '/');
parent::tearDown();
}
->setConstructorArgs([['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]])
->getMock();
- \OC\Files\Filesystem::mount($mockStorage, array(), '/test/cache');
+ \OC\Files\Filesystem::mount($mockStorage, [], '/test/cache');
return $mockStorage;
}
}
public function dataTestSplitUserRemoteError() {
- return array(
+ return [
// Invalid path
- array('user@'),
+ ['user@'],
// Invalid user
- array('@server'),
- array('us/er@server'),
- array('us:er@server'),
+ ['@server'],
+ ['us/er@server'],
+ ['us:er@server'],
// Invalid splitting
- array('user'),
- array(''),
- array('us/erserver'),
- array('us:erserver'),
- );
+ ['user'],
+ [''],
+ ['us/erserver'],
+ ['us:erserver'],
+ ];
}
}
const TESTCONTENT = '<?php $CONFIG=array("foo"=>"bar", "beers" => array("Appenzeller", "Guinness", "Kölsch"), "alcohol_free" => false);';
/** @var array */
- private $initialConfig = array('foo' => 'bar', 'beers' => array('Appenzeller', 'Guinness', 'Kölsch'), 'alcohol_free' => false);
+ private $initialConfig = ['foo' => 'bar', 'beers' => ['Appenzeller', 'Guinness', 'Kölsch'], 'alcohol_free' => false];
/** @var string */
private $configFile;
/** @var \OC\Config */
}
public function testGetKeys() {
- $expectedConfig = array('foo', 'beers', 'alcohol_free');
+ $expectedConfig = ['foo', 'beers', 'alcohol_free'];
$this->assertSame($expectedConfig, $this->config->getKeys());
}
$this->assertSame(null, $this->config->getValue('bar'));
$this->assertSame('moo', $this->config->getValue('bar', 'moo'));
$this->assertSame(false, $this->config->getValue('alcohol_free', 'someBogusValue'));
- $this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers', 'someBogusValue'));
- $this->assertSame(array('Appenzeller', 'Guinness', 'Kölsch'), $this->config->getValue('beers'));
+ $this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $this->config->getValue('beers', 'someBogusValue'));
+ $this->assertSame(['Appenzeller', 'Guinness', 'Kölsch'], $this->config->getValue('beers'));
}
public function testGetValueReturnsEnvironmentValueIfSet() {
$this->assertEquals($expected, $content);
$this->config->setValue('bar', 'red');
- $this->config->setValue('apps', array('files', 'gallery'));
+ $this->config->setValue('apps', ['files', 'gallery']);
$expectedConfig['bar'] = 'red';
- $expectedConfig['apps'] = array('files', 'gallery');
+ $expectedConfig['apps'] = ['files', 'gallery'];
$this->assertAttributeEquals($expectedConfig, 'cache', $this->config);
$content = file_get_contents($this->configFile);
$this->assertEquals(self::TESTCONTENT, file_get_contents($this->configFile));
// Write a new value to the config
- $this->config->setValue('CoolWebsites', array('demo.owncloud.org', 'owncloud.org', 'owncloud.com'));
+ $this->config->setValue('CoolWebsites', ['demo.owncloud.org', 'owncloud.org', 'owncloud.com']);
$expected = "<?php\n\$CONFIG = array (\n 'foo' => 'bar',\n 'beers' => \n array (\n 0 => 'Appenzeller',\n " .
" 1 => 'Guinness',\n 2 => 'Kölsch',\n ),\n 'alcohol_free' => false,\n 'php53' => 'totallyOutdated',\n 'CoolWebsites' => \n array (\n " .
" 0 => 'demo.owncloud.org',\n 1 => 'owncloud.org',\n 2 => 'owncloud.com',\n ),\n);\n";
}
public function searchProvider(){
- $search1 = array(
- 0 => array(
- 'N' => array(0 => '', 1 => 'Jan', 2 => 'Jansen', 3 => '', 4 => '',),
+ $search1 = [
+ 0 => [
+ 'N' => [0 => '', 1 => 'Jan', 2 => 'Jansen', 3 => '', 4 => '',],
'UID' => '04ada7f5-01f9-4309-9c82-6b555b2170ed',
'FN' => 'Jan Jansen',
'id' => '1',
'addressbook-key' => 'simple:1',
- ),
- 0 => array(
- 'N' => array(0 => '', 1 => 'Tom', 2 => 'Peeters', 3 => '', 4 => '',),
+ ],
+ 0 => [
+ 'N' => [0 => '', 1 => 'Tom', 2 => 'Peeters', 3 => '', 4 => '',],
'UID' => '04ada7f5-01f9-4309-9c82-2345-2345--6b555b2170ed',
'FN' => 'Tom Peeters',
'id' => '2',
'addressbook-key' => 'simple:1',
- ),
- );
+ ],
+ ];
- $search2 = array(
- 0 => array(
- 'N' => array(0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',),
+ $search2 = [
+ 0 => [
+ 'N' => [0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',],
'UID' => '04ada234h5jh357f5-01f9-4309-9c82-6b555b2170ed',
'FN' => 'Jan Rompuy',
'id' => '1',
'addressbook-key' => 'simple:2',
- ),
- 0 => array(
- 'N' => array(0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',),
+ ],
+ 0 => [
+ 'N' => [0 => '', 1 => 'fg', 2 => '', 3 => '', 4 => '',],
'UID' => '04ada7f5-01f9-4309-345kj345j9c82-2345-2345--6b555b2170ed',
'FN' => 'Tim Peeters',
'id' => '2',
'addressbook-key' => 'simple:2',
- ),
- );
+ ],
+ ];
$expectedResult = array_merge($search1, $search2);
- return array(
- array(
+ return [
+ [
$search1,
$search2,
$expectedResult
- )
- );
+ ]
+ ];
}
/**
->willReturn('returnMe');
$this->cm->registerAddressBook($addressbook);
- $result = $this->cm->createOrUpdate(array(), $addressbook->getKey());
+ $result = $this->cm->createOrUpdate([], $addressbook->getKey());
$this->assertEquals($result, 'returnMe');
}
->method('createOrUpdate');
$this->cm->registerAddressBook($addressbook);
- $result = $this->cm->createOrUpdate(array(), $addressbook->getKey());
+ $result = $this->cm->createOrUpdate([], $addressbook->getKey());
$this->assertEquals($result, null);
}
->method('createOrUpdate');
$this->cm->registerAddressBook($addressbook);
- $result = $this->cm->createOrUpdate(array(), 'noaddressbook');
+ $result = $this->cm->createOrUpdate([], 'noaddressbook');
$this->assertEquals($result, null);
}
public function testQuotes() {
$query = OC_DB::prepare('SELECT `fullname` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
- $result = $query->execute(array('uri_1'));
+ $result = $query->execute(['uri_1']);
$this->assertTrue((bool)$result);
$row = $result->fetchRow();
$this->assertFalse($row);
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
- $result = $query->execute(array('fullname test', 'uri_1'));
+ $result = $query->execute(['fullname test', 'uri_1']);
$this->assertEquals(1, $result);
$query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
- $result = $query->execute(array('uri_1'));
+ $result = $query->execute(['uri_1']);
$this->assertTrue((bool)$result);
$row = $result->fetchRow();
$this->assertArrayHasKey('fullname', $row);
*/
public function testNOW() {
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (NOW(),?)');
- $result = $query->execute(array('uri_2'));
+ $result = $query->execute(['uri_2']);
$this->assertEquals(1, $result);
$query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
- $result = $query->execute(array('uri_2'));
+ $result = $query->execute(['uri_2']);
$this->assertTrue((bool)$result);
}
public function testUNIX_TIMESTAMP() {
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (UNIX_TIMESTAMP(),?)');
- $result = $query->execute(array('uri_3'));
+ $result = $query->execute(['uri_3']);
$this->assertEquals(1, $result);
$query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
- $result = $query->execute(array('uri_3'));
+ $result = $query->execute(['uri_3']);
$this->assertTrue((bool)$result);
}
public function testLastInsertId() {
$query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
- $result1 = OC_DB::executeAudited($query, array('insertid 1','uri_1'));
+ $result1 = OC_DB::executeAudited($query, ['insertid 1','uri_1']);
$id1 = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*'.$this->table2);
// we don't know the id we should expect, so insert another row
- $result2 = OC_DB::executeAudited($query, array('insertid 2','uri_2'));
+ $result2 = OC_DB::executeAudited($query, ['insertid 2','uri_2']);
$id2 = \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*'.$this->table2);
// now we can check if the two ids are in correct order
$this->assertGreaterThan($id1, $id2);
$expected = "Ћö雙喜\xE2\x80\xA2";
$query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
- $result = $query->execute(array($expected, 'uri_1', 'This is a vCard'));
+ $result = $query->execute([$expected, 'uri_1', 'This is a vCard']);
$this->assertEquals(1, $result);
$actual = OC_DB::prepare("SELECT `fullname` FROM `$table`")->execute()->fetchOne();
$rowname = 'decimaltest';
$query = OC_DB::prepare('INSERT INTO `' . $table . '` (`' . $rowname . '`) VALUES (?)');
- $result = $query->execute(array($insert));
+ $result = $query->execute([$insert]);
$this->assertEquals(1, $result);
$query = OC_DB::prepare('SELECT `' . $rowname . '` FROM `' . $table . '`');
$result = $query->execute();
// updating to. MySQL reports 1 here when the PDO::MYSQL_ATTR_FOUND_ROWS
// flag is not specified.
$query = OC_DB::prepare("UPDATE `*PREFIX*{$this->table2}` SET `uri` = ?");
- $this->assertSame(2, $query->execute(array('uri1')));
+ $this->assertSame(2, $query->execute(['uri1']));
}
protected function insertCardData($fullname, $uri) {
$query = OC_DB::prepare("INSERT INTO `*PREFIX*{$this->table2}` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
- $this->assertSame(1, $query->execute(array($fullname, $uri, $this->getUniqueID())));
+ $this->assertSame(1, $query->execute([$fullname, $uri, $this->getUniqueID()]));
}
protected function updateCardData($fullname, $uri) {
$query = OC_DB::prepare("UPDATE `*PREFIX*{$this->table2}` SET `uri` = ? WHERE `fullname` = ?");
- return $query->execute(array($uri, $fullname));
+ return $query->execute([$uri, $fullname]);
}
public function testILIKE() {
$table = "*PREFIX*{$this->table2}";
$query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
- $query->execute(array('fooBAR', 'foo', 'bar'));
+ $query->execute(['fooBAR', 'foo', 'bar']);
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
- $result = $query->execute(array('foobar'));
+ $result = $query->execute(['foobar']);
$this->assertCount(0, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
- $result = $query->execute(array('foobar'));
+ $result = $query->execute(['foobar']);
$this->assertCount(1, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
- $result = $query->execute(array('foo'));
+ $result = $query->execute(['foo']);
$this->assertCount(0, $result->fetchAll());
}
$table = "*PREFIX*{$this->table2}";
$query = OC_DB::prepare("INSERT INTO `$table` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)");
- $query->execute(array('FooBAR', 'foo', 'bar'));
+ $query->execute(['FooBAR', 'foo', 'bar']);
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
- $result = $query->execute(array('%bar'));
+ $result = $query->execute(['%bar']);
$this->assertCount(0, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
- $result = $query->execute(array('foo%'));
+ $result = $query->execute(['foo%']);
$this->assertCount(0, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` LIKE ?");
- $result = $query->execute(array('%ba%'));
+ $result = $query->execute(['%ba%']);
$this->assertCount(0, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
- $result = $query->execute(array('%bar'));
+ $result = $query->execute(['%bar']);
$this->assertCount(1, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
- $result = $query->execute(array('foo%'));
+ $result = $query->execute(['foo%']);
$this->assertCount(1, $result->fetchAll());
$query = OC_DB::prepare("SELECT * FROM `$table` WHERE `fullname` ILIKE ?");
- $result = $query->execute(array('%ba%'));
+ $result = $query->execute(['%ba%']);
$this->assertCount(1, $result->fetchAll());
}
if ($throwsOnMysqlWithoutUTF8MB4 && $config->getSystemValue('dbtype', 'sqlite') === 'mysql' && $config->getSystemValue('mysql.utf8mb4', false) === false) {
$this->markTestSkipped('MySQL requires UTF8mb4 to store value: ' . $expected);
}
- $result = $query->execute(array($expected));
+ $result = $query->execute([$expected]);
$this->assertEquals(1, $result);
$actual = OC_DB::prepare("SELECT `textfield` FROM `$table`")->execute()->fetchOne();
$manager = new \OC\DB\MDB2SchemaManager($connection);
$manager->createDbFromStructure(__DIR__ . '/ts-autoincrement-before.xml');
- $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('abc'));
- $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('abc'));
- $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('123'));
- $connection->executeUpdate('insert into `*PREFIX*table` values (?)', array('123'));
+ $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['abc']);
+ $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['abc']);
+ $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['123']);
+ $connection->executeUpdate('insert into `*PREFIX*table` values (?)', ['123']);
$manager->updateDbFromStructure(__DIR__ . '/ts-autoincrement-after.xml');
$this->addToAssertionCount(1);
->getMock();
$config->expects($this->any())
->method('getSystemValue')
- ->willReturnMap(array(
- array('dbname', 'owncloud', 'testDB'),
- array('dbtableprefix', 'oc_', 'test_')
- ));
+ ->willReturnMap([
+ ['dbname', 'owncloud', 'testDB'],
+ ['dbtableprefix', 'oc_', 'test_']
+ ]);
return $config;
}
$this->assertEquals(2, $table->getColumn('decimalfield_precision_scale')->getScale());
$this->assertCount(2, $table->getIndexes());
- $this->assertEquals(array('integerfield'), $table->getIndex('primary')->getUnquotedColumns());
+ $this->assertEquals(['integerfield'], $table->getIndex('primary')->getUnquotedColumns());
$this->assertTrue($table->getIndex('primary')->isPrimary());
$this->assertTrue($table->getIndex('primary')->isUnique());
- $this->assertEquals(array('booleanfield'), $table->getIndex('index_boolean')->getUnquotedColumns());
+ $this->assertEquals(['booleanfield'], $table->getIndex('index_boolean')->getUnquotedColumns());
$this->assertFalse($table->getIndex('index_boolean')->isPrimary());
$this->assertFalse($table->getIndex('index_boolean')->isUnique());
}
* @return \Doctrine\DBAL\Schema\Schema[]
*/
private function getDuplicateKeySchemas() {
- $startSchema = new Schema(array(), array(), $this->getSchemaConfig());
+ $startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer');
$table->addColumn('name', 'string');
- $table->addIndex(array('id'), $this->tableName . '_id');
+ $table->addIndex(['id'], $this->tableName . '_id');
- $endSchema = new Schema(array(), array(), $this->getSchemaConfig());
+ $endSchema = new Schema([], [], $this->getSchemaConfig());
$table = $endSchema->createTable($this->tableName);
$table->addColumn('id', 'integer');
$table->addColumn('name', 'string');
- $table->addUniqueIndex(array('id'), $this->tableName . '_id');
+ $table->addUniqueIndex(['id'], $this->tableName . '_id');
- return array($startSchema, $endSchema);
+ return [$startSchema, $endSchema];
}
private function getSchemaConfig() {
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
- $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
- $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
- $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'qwerty'));
+ $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+ $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
+ $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'qwerty']);
$migrator->checkMigrate($endSchema);
$this->fail('checkMigrate should have failed');
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
- $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
- $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
- $this->connection->insert($this->tableName, array('id' => 3, 'name' => 'qwerty'));
+ $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+ $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
+ $this->connection->insert($this->tableName, ['id' => 3, 'name' => 'qwerty']);
$migrator->checkMigrate($endSchema);
$migrator->migrate($endSchema);
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
- $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
- $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
- $this->connection->insert($this->tableName, array('id' => 3, 'name' => 'qwerty'));
+ $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+ $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
+ $this->connection->insert($this->tableName, ['id' => 3, 'name' => 'qwerty']);
$migrator->checkMigrate($endSchema);
$migrator->migrate($endSchema);
$migrator->migrate($endSchema);
- $this->connection->insert($this->tableName, array('id' => 1, 'name' => 'foo'));
- $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'bar'));
+ $this->connection->insert($this->tableName, ['id' => 1, 'name' => 'foo']);
+ $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'bar']);
try {
- $this->connection->insert($this->tableName, array('id' => 2, 'name' => 'qwerty'));
+ $this->connection->insert($this->tableName, ['id' => 2, 'name' => 'qwerty']);
$this->fail('Expected duplicate key insert to fail');
} catch (DBALException $e) {
$this->addToAssertionCount(1);
}
public function testAddingPrimaryKeyWithAutoIncrement() {
- $startSchema = new Schema(array(), array(), $this->getSchemaConfig());
+ $startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', 'integer');
$table->addColumn('name', 'string');
- $endSchema = new Schema(array(), array(), $this->getSchemaConfig());
+ $endSchema = new Schema([], [], $this->getSchemaConfig());
$table = $endSchema->createTable($this->tableName);
- $table->addColumn('id', 'integer', array('autoincrement' => true));
+ $table->addColumn('id', 'integer', ['autoincrement' => true]);
$table->addColumn('name', 'string');
- $table->setPrimaryKey(array('id'));
+ $table->setPrimaryKey(['id']);
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
}
public function testReservedKeywords() {
- $startSchema = new Schema(array(), array(), $this->getSchemaConfig());
+ $startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
- $table->addColumn('id', 'integer', array('autoincrement' => true));
- $table->addColumn('user', 'string', array('length' => 255));
- $table->setPrimaryKey(array('id'));
+ $table->addColumn('id', 'integer', ['autoincrement' => true]);
+ $table->addColumn('user', 'string', ['length' => 255]);
+ $table->setPrimaryKey(['id']);
- $endSchema = new Schema(array(), array(), $this->getSchemaConfig());
+ $endSchema = new Schema([], [], $this->getSchemaConfig());
$table = $endSchema->createTable($this->tableName);
- $table->addColumn('id', 'integer', array('autoincrement' => true));
- $table->addColumn('user', 'string', array('length' => 64));
- $table->setPrimaryKey(array('id'));
+ $table->addColumn('id', 'integer', ['autoincrement' => true]);
+ $table->addColumn('user', 'string', ['length' => 64]);
+ $table->setPrimaryKey(['id']);
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
$tableFk = $startSchema->createTable($this->tableNameTmp);
$tableFk->addColumn('fk_id', 'integer');
$tableFk->addColumn('name', 'string');
- $tableFk->addForeignKeyConstraint($this->tableName, array('fk_id'), array('id'), array(), $fkName);
+ $tableFk->addForeignKeyConstraint($this->tableName, ['fk_id'], ['id'], [], $fkName);
$migrator = $this->manager->getMigrator();
$migrator->migrate($startSchema);
public function formatTimeSpanData() {
$time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo
$deL10N = \OC::$server->getL10N('lib', 'de');
- return array(
- array('seconds ago', $time, $time),
- array('in a few seconds', $time + 5 , $time),
- array('1 minute ago', $this->getTimestampAgo($time, 30, 1), $time),
- array('15 minutes ago', $this->getTimestampAgo($time, 30, 15), $time),
- array('in 15 minutes', $time, $this->getTimestampAgo($time, 30, 15)),
- array('1 hour ago', $this->getTimestampAgo($time, 30, 15, 1), $time),
- array('3 hours ago', $this->getTimestampAgo($time, 30, 15, 3), $time),
- array('in 3 hours', $time, $this->getTimestampAgo($time, 30, 15, 3)),
- array('4 days ago', $this->getTimestampAgo($time, 30, 15, 3, 4), $time),
-
- array('seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('1 minute ago', new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('3 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('59 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('1 hour ago', new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('3 hours ago', new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('yesterday', new \DateTime('Tue, 01 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('2 days ago', new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
-
- array($deL10N->t('seconds ago'), new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
- array($deL10N->n('%n minute ago', '%n minutes ago', 1), new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
- array($deL10N->n('%n minute ago', '%n minutes ago', 3), new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
- array($deL10N->n('%n hour ago', '%n hours ago', 1), new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
- array($deL10N->n('%n hour ago', '%n hours ago', 3), new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
- array($deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
-
- );
+ return [
+ ['seconds ago', $time, $time],
+ ['in a few seconds', $time + 5 , $time],
+ ['1 minute ago', $this->getTimestampAgo($time, 30, 1), $time],
+ ['15 minutes ago', $this->getTimestampAgo($time, 30, 15), $time],
+ ['in 15 minutes', $time, $this->getTimestampAgo($time, 30, 15)],
+ ['1 hour ago', $this->getTimestampAgo($time, 30, 15, 1), $time],
+ ['3 hours ago', $this->getTimestampAgo($time, 30, 15, 3), $time],
+ ['in 3 hours', $time, $this->getTimestampAgo($time, 30, 15, 3)],
+ ['4 days ago', $this->getTimestampAgo($time, 30, 15, 3, 4), $time],
+
+ ['seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['1 minute ago', new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['3 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['59 minutes ago', new \DateTime('Wed, 02 Oct 2013 23:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['1 hour ago', new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['3 hours ago', new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['yesterday', new \DateTime('Tue, 01 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['2 days ago', new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+
+ [$deL10N->t('seconds ago'), new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+ [$deL10N->n('%n minute ago', '%n minutes ago', 1), new \DateTime('Wed, 02 Oct 2013 23:58:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+ [$deL10N->n('%n minute ago', '%n minutes ago', 3), new \DateTime('Wed, 02 Oct 2013 23:56:30 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+ [$deL10N->n('%n hour ago', '%n hours ago', 1), new \DateTime('Wed, 02 Oct 2013 22:59:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+ [$deL10N->n('%n hour ago', '%n hours ago', 3), new \DateTime('Wed, 02 Oct 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+ [$deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 20:39:59 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+
+ ];
}
/**
public function formatDateSpanData() {
$time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo
$deL10N = \OC::$server->getL10N('lib', 'de');
- return array(
+ return [
// Normal testing
- array('today', $this->getTimestampAgo($time, 30, 15), $time),
- array('yesterday', $this->getTimestampAgo($time, 0, 0, 0, 1), $time),
- array('tomorrow', $time, $this->getTimestampAgo($time, 0, 0, 0, 1)),
- array('4 days ago', $this->getTimestampAgo($time, 0, 0, 0, 4), $time),
- array('in 4 days', $time, $this->getTimestampAgo($time, 0, 0, 0, 4)),
- array('5 months ago', $this->getTimestampAgo($time, 0, 0, 0, 155), $time),
- array('next month', $time, $this->getTimestampAgo($time, 0, 0, 0, 32)),
- array('in 5 months', $time, $this->getTimestampAgo($time, 0, 0, 0, 155)),
- array('2 years ago', $this->getTimestampAgo($time, 0, 0, 0, 0, 2), $time),
- array('next year', $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
- array('in 2 years', $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 2)),
+ ['today', $this->getTimestampAgo($time, 30, 15), $time],
+ ['yesterday', $this->getTimestampAgo($time, 0, 0, 0, 1), $time],
+ ['tomorrow', $time, $this->getTimestampAgo($time, 0, 0, 0, 1)],
+ ['4 days ago', $this->getTimestampAgo($time, 0, 0, 0, 4), $time],
+ ['in 4 days', $time, $this->getTimestampAgo($time, 0, 0, 0, 4)],
+ ['5 months ago', $this->getTimestampAgo($time, 0, 0, 0, 155), $time],
+ ['next month', $time, $this->getTimestampAgo($time, 0, 0, 0, 32)],
+ ['in 5 months', $time, $this->getTimestampAgo($time, 0, 0, 0, 155)],
+ ['2 years ago', $this->getTimestampAgo($time, 0, 0, 0, 0, 2), $time],
+ ['next year', $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+ ['in 2 years', $time, $this->getTimestampAgo($time, 0, 0, 0, 0, 2)],
// Test with compare timestamp
- array('today', $this->getTimestampAgo($time, 0, 0, 0, 0, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
- array('yesterday', $this->getTimestampAgo($time, 30, 15, 3, 1, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
- array('4 days ago', $this->getTimestampAgo($time, 30, 15, 3, 4, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
- array('5 months ago', $this->getTimestampAgo($time, 30, 15, 3, 155, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
- array('2 years ago', $this->getTimestampAgo($time, 30, 15, 3, 35, 3), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)),
+ ['today', $this->getTimestampAgo($time, 0, 0, 0, 0, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+ ['yesterday', $this->getTimestampAgo($time, 30, 15, 3, 1, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+ ['4 days ago', $this->getTimestampAgo($time, 30, 15, 3, 4, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+ ['5 months ago', $this->getTimestampAgo($time, 30, 15, 3, 155, 1), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
+ ['2 years ago', $this->getTimestampAgo($time, 30, 15, 3, 35, 3), $this->getTimestampAgo($time, 0, 0, 0, 0, 1)],
// Test translations
- array($deL10N->t('today'), new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N),
- array($deL10N->t('yesterday'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N),
- array($deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N),
- array($deL10N->n('%n month ago', '%n months ago', 9), new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N),
- array($deL10N->n('%n year ago', '%n years ago', 2), new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N),
+ [$deL10N->t('today'), new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N],
+ [$deL10N->t('yesterday'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N],
+ [$deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N],
+ [$deL10N->n('%n month ago', '%n months ago', 9), new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N],
+ [$deL10N->n('%n year ago', '%n years ago', 2), new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N],
// Test time
- array('today', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('today', new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('today', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
+ ['today', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['today', new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['today', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
// Test some special yesterdays
- array('yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')),
- array('yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')),
- array('yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')),
- array('yesterday', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')),
- array('yesterday', new \DateTime('Mon, 31 Dec 2012 00:00:00 +0000'), new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000')),
+ ['yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')],
+ ['yesterday', new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')],
+ ['yesterday', new \DateTime('Tue, 01 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')],
+ ['yesterday', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')],
+ ['yesterday', new \DateTime('Mon, 31 Dec 2012 00:00:00 +0000'), new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000')],
// Test last month
- array('2 days ago', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')),
- array('last month', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 31 Oct 2013 00:00:00 +0000')),
- array('last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')),
- array('last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Thu, 31 Oct 2013 00:00:00 +0000')),
+ ['2 days ago', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000')],
+ ['last month', new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 31 Oct 2013 00:00:00 +0000')],
+ ['last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000')],
+ ['last month', new \DateTime('Sun, 01 Sep 2013 00:00:00 +0000'), new \DateTime('Thu, 31 Oct 2013 00:00:00 +0000')],
// Test last year
- array('9 months ago', new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
- array('11 months ago', new \DateTime('Thu, 03 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
- array('last year', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
- array('last year', new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
- array('2 years ago', new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')),
- );
+ ['9 months ago', new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+ ['11 months ago', new \DateTime('Thu, 03 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+ ['last year', new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+ ['last year', new \DateTime('Tue, 01 Jan 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+ ['2 years ago', new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000')],
+ ];
}
/**
}
public function formatDateData() {
- return array(
- array(1102831200, 'December 12, 2004'),
- );
+ return [
+ [1102831200, 'December 12, 2004'],
+ ];
}
/**
}
public function formatDateTimeData() {
- return array(
- array(1350129205, null, 'October 13, 2012 at 11:53:25 AM GMT+0'),
- array(1350129205, new \DateTimeZone('Europe/Berlin'), 'October 13, 2012 at 1:53:25 PM GMT+2'),
- );
+ return [
+ [1350129205, null, 'October 13, 2012 at 11:53:25 AM GMT+0'],
+ [1350129205, new \DateTimeZone('Europe/Berlin'), 'October 13, 2012 at 1:53:25 PM GMT+2'],
+ ];
}
/**
public function testSetFileKey() {
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturn(array('user1', '/files/foo.txt'));
+ ->willReturn(['user1', '/files/foo.txt']);
$this->util->expects($this->any())
->method('stripPartialFileExtension')
->willReturnArgument(0);
public function testSetFileKeySystemWide() {
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturn(array('user1', '/files/foo.txt'));
+ ->willReturn(['user1', '/files/foo.txt']);
$this->util->expects($this->any())
->method('isSystemWideMountPoint')
->willReturn(true);
public function testGetFileKeySystemWide() {
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturn(array('user1', '/files/foo.txt'));
+ ->willReturn(['user1', '/files/foo.txt']);
$this->util->expects($this->any())
->method('stripPartialFileExtension')
->willReturnArgument(0);
public function testDeleteFileKeySystemWide() {
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturn(array('user1', '/files/foo.txt'));
+ ->willReturn(['user1', '/files/foo.txt']);
$this->util->expects($this->any())
->method('stripPartialFileExtension')
->willReturnArgument(0);
public function testDeleteFileKey() {
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturn(array('user1', '/files/foo.txt'));
+ ->willReturn(['user1', '/files/foo.txt']);
$this->util->expects($this->any())
->method('stripPartialFileExtension')
->willReturnArgument(0);
->willReturn(true);
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturnCallback(array($this, 'getUidAndFilenameCallback'));
+ ->willReturnCallback([$this, 'getUidAndFilenameCallback']);
$this->util->expects($this->any())
->method('isSystemWideMountPoint')
->willReturnCallback(function($path, $owner) use ($systemWideMountSource, $systemWideMountTarget) {
->willReturn(true);
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturnCallback(array($this, 'getUidAndFilenameCallback'));
+ ->willReturnCallback([$this, 'getUidAndFilenameCallback']);
$this->util->expects($this->any())
->method('isSystemWideMountPoint')
->willReturnCallback(function($path, $owner) use ($systemWideMountSource, $systemWideMountTarget) {
$path = $args[0];
$parts = explode('/', $path);
- return array($parts[1], '/' . implode('/', array_slice($parts, 2)));
+ return [$parts[1], '/' . implode('/', array_slice($parts, 2))];
}
public function dataProviderCopyRename() {
- return array(
- array('/user1/files/source.txt', '/user1/files/target.txt', false, false,
- '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
- array('/user1/files/foo/source.txt', '/user1/files/target.txt', false, false,
- '/user1/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
- array('/user1/files/source.txt', '/user1/files/foo/target.txt', false, false,
- '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'),
- array('/user1/files/source.txt', '/user1/files/foo/target.txt', true, true,
- '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'),
- array('/user1/files/source.txt', '/user1/files/target.txt', false, true,
- '/user1/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'),
- array('/user1/files/source.txt', '/user1/files/target.txt', true, false,
- '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
-
- array('/user2/files/source.txt', '/user1/files/target.txt', false, false,
- '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
- array('/user2/files/foo/source.txt', '/user1/files/target.txt', false, false,
- '/user2/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
- array('/user2/files/source.txt', '/user1/files/foo/target.txt', false, false,
- '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'),
- array('/user2/files/source.txt', '/user1/files/foo/target.txt', true, true,
- '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'),
- array('/user2/files/source.txt', '/user1/files/target.txt', false, true,
- '/user2/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'),
- array('/user2/files/source.txt', '/user1/files/target.txt', true, false,
- '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'),
- );
+ return [
+ ['/user1/files/source.txt', '/user1/files/target.txt', false, false,
+ '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+ ['/user1/files/foo/source.txt', '/user1/files/target.txt', false, false,
+ '/user1/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+ ['/user1/files/source.txt', '/user1/files/foo/target.txt', false, false,
+ '/user1/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'],
+ ['/user1/files/source.txt', '/user1/files/foo/target.txt', true, true,
+ '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'],
+ ['/user1/files/source.txt', '/user1/files/target.txt', false, true,
+ '/user1/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'],
+ ['/user1/files/source.txt', '/user1/files/target.txt', true, false,
+ '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+
+ ['/user2/files/source.txt', '/user1/files/target.txt', false, false,
+ '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+ ['/user2/files/foo/source.txt', '/user1/files/target.txt', false, false,
+ '/user2/files_encryption/keys/files/foo/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+ ['/user2/files/source.txt', '/user1/files/foo/target.txt', false, false,
+ '/user2/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/foo/target.txt/'],
+ ['/user2/files/source.txt', '/user1/files/foo/target.txt', true, true,
+ '/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/foo/target.txt/'],
+ ['/user2/files/source.txt', '/user1/files/target.txt', false, true,
+ '/user2/files_encryption/keys/files/source.txt/', '/files_encryption/keys/files/target.txt/'],
+ ['/user2/files/source.txt', '/user1/files/target.txt', true, false,
+ '/files_encryption/keys/files/source.txt/', '/user1/files_encryption/keys/files/target.txt/'],
+ ];
}
/**
$this->util->expects($this->any())
->method('getUidAndFilename')
- ->willReturnCallback(array($this, 'getUidAndFilenameCallback'));
+ ->willReturnCallback([$this, 'getUidAndFilenameCallback']);
$this->util->expects($this->any())
->method('isSystemWideMountPoint')
->willReturn($systemWideMountPoint);
->willReturn(false);
$this->view->expects($this->any())
->method('mkdir')
- ->willReturnCallback(array($this, 'mkdirCallback'));
+ ->willReturnCallback([$this, 'mkdirCallback']);
- $this->mkdirStack = array(
+ $this->mkdirStack = [
'/user1/files_encryption/keys/foo',
'/user1/files_encryption/keys',
'/user1/files_encryption',
- '/user1');
+ '/user1'];
- self::invokePrivate($this->storage, 'keySetPreparation', array('/user1/files_encryption/keys/foo'));
+ self::invokePrivate($this->storage, 'keySetPreparation', ['/user1/files_encryption/keys/foo']);
}
public function mkdirCallback() {
* @return array
*/
public function dataTestUpdate() {
- return array(
- array('/user/files/foo', true, ['/user/files/foo/file1.txt', '/user/files/foo/file1.txt'], 2),
- array('/user/files/test.txt', false, [], 1),
- );
+ return [
+ ['/user/files/foo', true, ['/user/files/foo/file1.txt', '/user/files/foo/file1.txt'], 2],
+ ['/user/files/test.txt', false, [], 1],
+ ];
}
/**
* @return array
*/
public function dataTestPostRename() {
- return array(
- array('/test.txt', '/testNew.txt', true),
- array('/test.txt', '/testNew.txt', false),
- array('/folder/test.txt', '/testNew.txt', true),
- array('/folder/test.txt', '/testNew.txt', false),
- array('/folder/test.txt', '/testNew.txt', true),
- array('/test.txt', '/folder/testNew.txt', false),
- );
+ return [
+ ['/test.txt', '/testNew.txt', true],
+ ['/test.txt', '/testNew.txt', false],
+ ['/folder/test.txt', '/testNew.txt', true],
+ ['/folder/test.txt', '/testNew.txt', false],
+ ['/folder/test.txt', '/testNew.txt', true],
+ ['/test.txt', '/folder/testNew.txt', false],
+ ];
}
* @return array
*/
public function dataTestPostRestore() {
- return array(
- array(true),
- array(false),
- );
+ return [
+ [true],
+ [false],
+ ];
}
/**
$this->expectException(\OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException::class);
- $header = array('header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo');
+ $header = ['header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo'];
$em = $this->createMock(IEncryptionModule::class);
$em->expects($this->any())->method('getId')->willReturn('moduleId');
$this->userManager
->expects($this->any())
->method('userExists')
- ->willReturnCallback(array($this, 'isExcludedCallback'));
+ ->willReturnCallback([$this, 'isExcludedCallback']);
$this->assertSame($expected,
$this->util->isExcluded($path)
}
public function providePathsForTestIsExcluded() {
- return array(
- array('/files_encryption', '', true),
- array('files_encryption/foo.txt', '', true),
- array('test/foo.txt', '', false),
- array('/user1/files_encryption/foo.txt', '', true),
- array('/user1/files/foo.txt', '', false),
- array('/keyStorage/user1/files/foo.txt', 'keyStorage', true),
- array('/keyStorage/files_encryption', '/keyStorage', true),
- array('keyStorage/user1/files_encryption', '/keyStorage/', true),
+ return [
+ ['/files_encryption', '', true],
+ ['files_encryption/foo.txt', '', true],
+ ['test/foo.txt', '', false],
+ ['/user1/files_encryption/foo.txt', '', true],
+ ['/user1/files/foo.txt', '', false],
+ ['/keyStorage/user1/files/foo.txt', 'keyStorage', true],
+ ['/keyStorage/files_encryption', '/keyStorage', true],
+ ['keyStorage/user1/files_encryption', '/keyStorage/', true],
- );
+ ];
}
public function isExcludedCallback() {
}
public function dataTestIsFile() {
- return array(
- array('/user/files/test.txt', true),
- array('/user/files', true),
- array('/user/files_versions/test.txt', false),
- array('/user/foo/files/test.txt', false),
- array('/files/foo/files/test.txt', false),
- array('/user', false),
- array('/user/test.txt', false),
- );
+ return [
+ ['/user/files/test.txt', true],
+ ['/user/files', true],
+ ['/user/files_versions/test.txt', false],
+ ['/user/foo/files/test.txt', false],
+ ['/files/foo/files/test.txt', false],
+ ['/user', false],
+ ['/user/test.txt', false],
+ ];
}
/**
}
public function dataTestStripPartialFileExtension() {
- return array(
- array('/foo/test.txt', '/foo/test.txt'),
- array('/foo/test.txt.part', '/foo/test.txt'),
- array('/foo/test.txt.ocTransferId7567846853.part', '/foo/test.txt'),
- array('/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'),
- );
+ return [
+ ['/foo/test.txt', '/foo/test.txt'],
+ ['/foo/test.txt.part', '/foo/test.txt'],
+ ['/foo/test.txt.ocTransferId7567846853.part', '/foo/test.txt'],
+ ['/foo/test.txt.ocTransferId7567.part', '/foo/test.txt'],
+ ];
}
}
* @return array
*/
function passwordProvider() {
- return array(
- array('user', 'password'),
- array('user@owncloud.org', 'password'),
- array('user', 'pass@word'),
- array('us:er', 'password'),
- array('user', 'pass:word'),
- );
+ return [
+ ['user', 'password'],
+ ['user@owncloud.org', 'password'],
+ ['user', 'pass@word'],
+ ['us:er', 'password'],
+ ['user', 'pass:word'],
+ ];
}
public function testSimple() {
$file1 = 'foo';
$file2 = 'foo/bar';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
- $data2 = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+ $data2 = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
$this->assertFalse($this->cache->inCache($file1));
$this->assertEquals($this->cache->get($file1), null);
$this->assertEquals($id1, $this->cache->getParentId($file2));
$newSize = 1050;
- $newId2 = $this->cache->put($file2, array('size' => $newSize));
+ $newId2 = $this->cache->put($file2, ['size' => $newSize]);
$cacheData2 = $this->cache->get($file2);
$this->assertEquals($newId2, $id2);
$this->assertEquals($cacheData2['size'], $newSize);
public function testPartial() {
$file1 = 'foo';
- $this->cache->put($file1, array('size' => 10));
- $this->assertEquals(array('size' => 10), $this->cache->get($file1));
+ $this->cache->put($file1, ['size' => 10]);
+ $this->assertEquals(['size' => 10], $this->cache->get($file1));
- $this->cache->put($file1, array('mtime' => 15));
- $this->assertEquals(array('size' => 10, 'mtime' => 15), $this->cache->get($file1));
+ $this->cache->put($file1, ['mtime' => 15]);
+ $this->assertEquals(['size' => 10, 'mtime' => 15], $this->cache->get($file1));
- $this->cache->put($file1, array('size' => 12));
- $this->assertEquals(array('size' => 12, 'mtime' => 15), $this->cache->get($file1));
+ $this->cache->put($file1, ['size' => 12]);
+ $this->assertEquals(['size' => 12, 'mtime' => 15], $this->cache->get($file1));
}
/**
}
$file2 = $folder . '/bar';
$file3 = $folder . '/foo';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
- $fileData = array();
- $fileData['bar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
- $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
+ $fileData = [];
+ $fileData['bar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+ $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($folder, $data1);
$this->cache->put($file2, $fileData['bar']);
}
$file4 = $folder . '/unkownSize';
- $fileData['unkownSize'] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $fileData['unkownSize'] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file4, $fileData['unkownSize']);
$this->assertEquals(-1, $this->cache->calculateFolderSize($folder));
- $fileData['unkownSize'] = array('size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $fileData['unkownSize'] = ['size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file4, $fileData['unkownSize']);
$this->assertEquals(1025, $this->cache->calculateFolderSize($folder));
}
public function testRemoveRecursive() {
- $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
- $fileData = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain');
+ $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
+ $fileData = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'text/plain'];
$folders = ['folder', 'folder/subfolder', 'folder/sub2', 'folder/sub2/sub3'];
$files = ['folder/foo.txt', 'folder/bar.txt', 'folder/subfolder/asd.txt', 'folder/sub2/qwerty.txt', 'folder/sub2/sub3/foo.txt'];
public function folderDataProvider() {
- return array(
- array('folder'),
+ return [
+ ['folder'],
// that was too easy, try something harder
- array('☺, WHITE SMILING FACE, UTF-8 hex E298BA'),
+ ['☺, WHITE SMILING FACE, UTF-8 hex E298BA'],
// what about 4 byte utf-8
- array('😐, NEUTRAL_FACE, UTF-8 hex F09F9890'),
+ ['😐, NEUTRAL_FACE, UTF-8 hex F09F9890'],
// now the crazy stuff
- array(', UNASSIGNED PRIVATE USE, UTF-8 hex EF9890'),
+ [', UNASSIGNED PRIVATE USE, UTF-8 hex EF9890'],
// and my favorite
- array('w͢͢͝h͡o͢͡ ̸͢k̵͟n̴͘ǫw̸̛s͘ ̀́w͘͢ḩ̵a҉̡͢t ̧̕h́o̵r͏̵rors̡ ̶͡͠lį̶e͟͟ ̶͝in͢ ͏t̕h̷̡͟e ͟͟d̛a͜r̕͡k̢̨ ͡h̴e͏a̷̢̡rt́͏ ̴̷͠ò̵̶f̸ u̧͘ní̛͜c͢͏o̷͏d̸͢e̡͝')
- );
+ ['w͢͢͝h͡o͢͡ ̸͢k̵͟n̴͘ǫw̸̛s͘ ̀́w͘͢ḩ̵a҉̡͢t ̧̕h́o̵r͏̵rors̡ ̶͡͠lį̶e͟͟ ̶͝in͢ ͏t̕h̷̡͟e ͟͟d̛a͜r̕͡k̢̨ ͡h̴e͏a̷̢̡rt́͏ ̴̷͠ò̵̶f̸ u̧͘ní̛͜c͢͏o̷͏d̸͢e̡͝']
+ ];
}
public function testEncryptedFolder() {
$file1 = 'folder';
$file2 = 'folder/bar';
$file3 = 'folder/foo';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
- $fileData = array();
- $fileData['bar'] = array('size' => 1000, 'encrypted' => 1, 'mtime' => 20, 'mimetype' => 'foo/file');
- $fileData['foo'] = array('size' => 20, 'encrypted' => 1, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
+ $fileData = [];
+ $fileData['bar'] = ['size' => 1000, 'encrypted' => 1, 'mtime' => 20, 'mimetype' => 'foo/file'];
+ $fileData['foo'] = ['size' => 20, 'encrypted' => 1, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file1, $data1);
$this->cache->put($file2, $fileData['bar']);
}
$file4 = 'folder/unkownSize';
- $fileData['unkownSize'] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $fileData['unkownSize'] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file4, $fileData['unkownSize']);
$this->assertEquals(-1, $this->cache->calculateFolderSize($file1));
- $fileData['unkownSize'] = array('size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $fileData['unkownSize'] = ['size' => 5, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file4, $fileData['unkownSize']);
$this->assertEquals(1025, $this->cache->calculateFolderSize($file1));
public function testRootFolderSizeForNonHomeStorage() {
$dir1 = 'knownsize';
$dir2 = 'unknownsize';
- $fileData = array();
- $fileData[''] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData[$dir2] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory');
+ $fileData = [];
+ $fileData[''] = ['size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData[$dir1] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData[$dir2] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory'];
$this->cache->put('', $fileData['']);
$this->cache->put($dir1, $fileData[$dir1]);
function testStatus() {
$this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->getStatus('foo'));
- $this->cache->put('foo', array('size' => -1));
+ $this->cache->put('foo', ['size' => -1]);
$this->assertEquals(\OC\Files\Cache\Cache::PARTIAL, $this->cache->getStatus('foo'));
- $this->cache->put('foo', array('size' => -1, 'mtime' => 20, 'mimetype' => 'foo/file'));
+ $this->cache->put('foo', ['size' => -1, 'mtime' => 20, 'mimetype' => 'foo/file']);
$this->assertEquals(\OC\Files\Cache\Cache::SHALLOW, $this->cache->getStatus('foo'));
- $this->cache->put('foo', array('size' => 10));
+ $this->cache->put('foo', ['size' => 10]);
$this->assertEquals(\OC\Files\Cache\Cache::COMPLETE, $this->cache->getStatus('foo'));
}
public function testPutWithAllKindOfQuotes($fileName) {
$this->assertEquals(\OC\Files\Cache\Cache::NOT_FOUND, $this->cache->get($fileName));
- $this->cache->put($fileName, array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName));
+ $this->cache->put($fileName, ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file', 'etag' => $fileName]);
$cacheEntry = $this->cache->get($fileName);
$this->assertEquals($fileName, $cacheEntry['etag']);
$file1 = 'folder';
$file2 = 'folder/foobar';
$file3 = 'folder/foo';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
- $fileData = array();
- $fileData['foobar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
- $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+ $fileData = [];
+ $fileData['foobar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+ $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file1, $data1);
$this->cache->put($file2, $fileData['foobar']);
$file3 = 'folder/foo';
$file4 = 'folder/foo2';
$file5 = 'folder/foo3';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
- $fileData = array();
- $fileData['foobar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
- $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
- $fileData['foo2'] = array('size' => 25, 'mtime' => 28, 'mimetype' => 'foo/file');
- $fileData['foo3'] = array('size' => 88, 'mtime' => 34, 'mimetype' => 'foo/file');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+ $fileData = [];
+ $fileData['foobar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+ $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
+ $fileData['foo2'] = ['size' => 25, 'mtime' => 28, 'mimetype' => 'foo/file'];
+ $fileData['foo3'] = ['size' => 88, 'mtime' => 34, 'mimetype' => 'foo/file'];
$id1 = $this->cache->put($file1, $data1);
$id2 = $this->cache->put($file2, $fileData['foobar']);
$file1 = 'folder';
$file2 = 'folder/foobar';
$file3 = 'folder/foo';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
- $fileData = array();
- $fileData['foobar'] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
- $fileData['foo'] = array('size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
+ $fileData = [];
+ $fileData['foobar'] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
+ $fileData['foo'] = ['size' => 20, 'mtime' => 25, 'mimetype' => 'foo/file'];
$this->cache->put($file1, $data1);
$this->cache->put($file2, $fileData['foobar']);
* @dataProvider movePathProvider
*/
function testMove($sourceFolder, $targetFolder, $children) {
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar');
- $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/bar'];
+ $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
// create folders
foreach ([$sourceFolder, $targetFolder] as $current) {
$file2 = 'folder2';
$file3 = 'folder3';
$file4 = 'folder4';
- $data = array('size' => 10, 'mtime' => 50, 'mimetype' => 'foo/bar');
+ $data = ['size' => 10, 'mtime' => 50, 'mimetype' => 'foo/bar'];
$this->cache->put($file1, $data);
$data['size'] = -1;
function testNonExisting() {
$this->assertFalse($this->cache->get('foo.txt'));
$this->assertFalse($this->cache->get(-1));
- $this->assertEquals(array(), $this->cache->getFolderContents('foo'));
+ $this->assertEquals([], $this->cache->getFolderContents('foo'));
}
function testGetById() {
$storageId = $this->storage->getId();
- $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+ $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
$id = $this->cache->put('foo', $data);
if (strlen($storageId) > 64) {
$storageId = md5($storageId);
}
- $this->assertEquals(array($storageId, 'foo'), \OC\Files\Cache\Cache::getById($id));
+ $this->assertEquals([$storageId, 'foo'], \OC\Files\Cache\Cache::getById($id));
}
function testStorageMTime() {
- $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+ $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
$this->cache->put('foo', $data);
$cachedData = $this->cache->get('foo');
$this->assertEquals($data['mtime'], $cachedData['storage_mtime']); //if no storage_mtime is saved, mtime should be used
- $this->cache->put('foo', array('storage_mtime' => 30)); //when setting storage_mtime, mtime is also set
+ $this->cache->put('foo', ['storage_mtime' => 30]); //when setting storage_mtime, mtime is also set
$cachedData = $this->cache->get('foo');
$this->assertEquals(30, $cachedData['storage_mtime']);
$this->assertEquals(30, $cachedData['mtime']);
- $this->cache->put('foo', array('mtime' => 25)); //setting mtime does not change storage_mtime
+ $this->cache->put('foo', ['mtime' => 25]); //setting mtime does not change storage_mtime
$cachedData = $this->cache->get('foo');
$this->assertEquals(30, $cachedData['storage_mtime']);
$this->assertEquals(25, $cachedData['mtime']);
}
function testLongId() {
- $storage = new LongId(array());
+ $storage = new LongId([]);
$cache = $storage->getCache();
$storageId = $storage->getId();
- $data = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file');
+ $data = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'foo/file'];
$id = $cache->put('foo', $data);
- $this->assertEquals(array(md5($storageId), 'foo'), \OC\Files\Cache\Cache::getById($id));
+ $this->assertEquals([md5($storageId), 'foo'], \OC\Files\Cache\Cache::getById($id));
}
/**
->method('normalize')
->willReturnArgument(0);
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
// put root folder
$this->assertFalse($cacheMock->get('folder'));
// folder name "Schön" with U+0308 (un-normalized)
$folderWith0308 = "\x53\x63\x68\x6f\xcc\x88\x6e";
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
// put root folder
$this->assertFalse($this->cache->get('folder'));
}
function bogusPathNamesProvider() {
- return array(
- array('/bogus.txt', 'bogus.txt'),
- array('//bogus.txt', 'bogus.txt'),
- array('bogus/', 'bogus'),
- array('bogus//', 'bogus'),
- );
+ return [
+ ['/bogus.txt', 'bogus.txt'],
+ ['//bogus.txt', 'bogus.txt'],
+ ['bogus/', 'bogus'],
+ ['bogus//', 'bogus'],
+ ];
}
/**
* @dataProvider bogusPathNamesProvider
*/
public function testBogusPaths($bogusPath, $fixedBogusPath) {
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
// put root folder
$this->assertFalse($this->cache->get(''));
}
public function testNoReuseOfFileId() {
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'];
$this->cache->put('somefile.txt', $data1);
$info = $this->cache->get('somefile.txt');
$fileId = $info['fileid'];
$this->cache->remove('somefile.txt');
- $data2 = array('size' => 200, 'mtime' => 100, 'mimetype' => 'text/plain');
+ $data2 = ['size' => 200, 'mtime' => 100, 'mimetype' => 'text/plain'];
$this->cache->put('anotherfile.txt', $data2);
$info2 = $this->cache->get('anotherfile.txt');
$fileId2 = $info2['fileid'];
* @dataProvider escapingProvider
*/
public function testEscaping($name) {
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain');
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'];
$this->cache->put($name, $data);
$this->assertTrue($this->cache->inCache($name));
$retrievedData = $this->cache->get($name);
$this->assertTrue($this->cache->inCache($name . 'asd'));
$this->cache->remove($name . 'asd');
$this->assertFalse($this->cache->inCache($name . 'asd'));
- $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->cache->put($name, $folderData);
$this->cache->put('other', $folderData);
$childs = ['asd', 'bar', 'foo', 'sub/folder'];
protected function setUp(): void {
parent::setUp();
- $this->storage = new \OC\Files\Storage\Temporary(array());
- $this->storage2 = new \OC\Files\Storage\Temporary(array());
+ $this->storage = new \OC\Files\Storage\Temporary([]);
+ $this->storage2 = new \OC\Files\Storage\Temporary([]);
$this->cache = new \OC\Files\Cache\Cache($this->storage);
$this->cache2 = new \OC\Files\Cache\Cache($this->storage2);
}
parent::setUp();
$this->user = new DummyUser('foo', \OC::$server->getTempManager()->getTemporaryFolder());
- $this->storage = new \OC\Files\Storage\Home(array('user' => $this->user));
+ $this->storage = new \OC\Files\Storage\Home(['user' => $this->user]);
$this->cache = $this->storage->getCache();
}
public function testRootFolderSizeIgnoresUnknownUpdate() {
$dir1 = 'files/knownsize';
$dir2 = 'files/unknownsize';
- $fileData = array();
- $fileData[''] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData['files'] = array('size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData[$dir2] = array('size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory');
+ $fileData = [];
+ $fileData[''] = ['size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData['files'] = ['size' => -1, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData[$dir1] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData[$dir2] = ['size' => -1, 'mtime' => 25, 'mimetype' => 'httpd/unix-directory'];
$this->cache->put('', $fileData['']);
$this->cache->put('files', $fileData['files']);
public function testRootFolderSizeIsFilesSize() {
$dir1 = 'files';
$afile = 'test.txt';
- $fileData = array();
- $fileData[''] = array('size' => 1500, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData[$dir1] = array('size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory');
- $fileData[$afile] = array('size' => 500, 'mtime' => 20);
+ $fileData = [];
+ $fileData[''] = ['size' => 1500, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData[$dir1] = ['size' => 1000, 'mtime' => 20, 'mimetype' => 'httpd/unix-directory'];
+ $fileData[$afile] = ['size' => 500, 'mtime' => 20];
$this->cache->put('', $fileData['']);
$this->cache->put($dir1, $fileData[$dir1]);
protected function setUp(): void {
parent::setUp();
- $this->storage = new \OC\Files\Storage\Temporary(array());
- $this->storage2 = new \OC\Files\Storage\Temporary(array());
+ $this->storage = new \OC\Files\Storage\Temporary([]);
+ $this->storage2 = new \OC\Files\Storage\Temporary([]);
$this->cache = new FallBackCrossCacheMoveCache($this->storage);
$this->cache2 = new FallBackCrossCacheMoveCache($this->storage2);
}
protected function setUp(): void {
parent::setUp();
- $this->storage = new \OC\Files\Storage\Temporary(array());
+ $this->storage = new \OC\Files\Storage\Temporary([]);
$this->scanner = new \OC\Files\Cache\Scanner($this->storage);
$this->cache = new \OC\Files\Cache\Cache($this->storage);
}
$this->scanner->scan('');
$oldData = $this->cache->get('');
$this->storage->unlink('folder/bar.txt');
- $this->cache->put('folder', array('mtime' => $this->storage->filemtime('folder'), 'storage_mtime' => $this->storage->filemtime('folder')));
+ $this->cache->put('folder', ['mtime' => $this->storage->filemtime('folder'), 'storage_mtime' => $this->storage->filemtime('folder')]);
$this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_SIZE);
$newData = $this->cache->get('');
$this->assertIsString($oldData['etag']);
// delete the folder without removing the childs
$sql = 'DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ?';
- \OC_DB::executeAudited($sql, array($oldFolderId));
+ \OC_DB::executeAudited($sql, [$oldFolderId]);
$cachedData = $this->cache->get('folder/bar.txt');
$this->assertEquals($oldFolderId, $cachedData['parent']);
// delete the folder without removing the childs
$sql = 'DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ?';
- \OC_DB::executeAudited($sql, array($oldFolderId));
+ \OC_DB::executeAudited($sql, [$oldFolderId]);
$cachedData = $this->cache->get('folder/bar.txt');
$this->assertEquals($oldFolderId, $cachedData['parent']);
protected function setUp(): void {
parent::setUp();
- $this->storage = new \OC\Files\Storage\Temporary(array());
+ $this->storage = new \OC\Files\Storage\Temporary([]);
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->storage->mkdir('folder');
Filesystem::init(self::$user, '/' . self::$user . '/files');
Filesystem::clearMounts();
- Filesystem::mount($this->storage, array(), '/' . self::$user . '/files');
+ Filesystem::mount($this->storage, [], '/' . self::$user . '/files');
\OC_Hook::clear('OC_Filesystem');
}
public function testWrite() {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
- $this->cache->put('foo.txt', array('mtime' => 100, 'storage_mtime' => 150));
+ $this->cache->put('foo.txt', ['mtime' => 100, 'storage_mtime' => 150]);
$rootCachedData = $this->cache->get('');
$this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
}
public function testWriteWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
+ $storage2 = new \OC\Files\Storage\Temporary([]);
$storage2->getScanner()->scan(''); //initialize etags
$cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
$view = new View('/' . self::$user . '/files');
$folderCachedData = $view->getFileInfo('folder');
$substorageCachedData = $cache2->get('');
}
public function testDeleteWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
+ $storage2 = new \OC\Files\Storage\Temporary([]);
$cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
$view = new View('/' . self::$user . '/files');
$this->assertTrue($cache2->inCache('foo.txt'));
}
public function testRenameWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
+ $storage2 = new \OC\Files\Storage\Temporary([]);
$cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ Filesystem::mount($storage2, [], '/' . self::$user . '/files/folder/substorage');
Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
$view = new View('/' . self::$user . '/files');
$this->assertTrue($cache2->inCache('foo.txt'));
$this->loginAsUser();
- $this->storage = new Temporary(array());
+ $this->storage = new Temporary([]);
$this->updater = $this->storage->getUpdater();
$this->cache = $this->storage->getCache();
}
}
public function testMoveCrossStorage() {
- $storage2 = new Temporary(array());
+ $storage2 = new Temporary([]);
$cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/bar');
+ Filesystem::mount($storage2, [], '/bar');
$this->storage->file_put_contents('foo.txt', 'qwerty');
$this->updater->update('foo.txt');
}
public function testMoveFolderCrossStorage() {
- $storage2 = new Temporary(array());
+ $storage2 = new Temporary([]);
$cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/bar');
+ Filesystem::mount($storage2, [], '/bar');
$this->storage->mkdir('foo');
$this->storage->mkdir('foo/bar');
$this->storage->file_put_contents('foo/foo.txt', 'qwerty');
/**
* @var \OC\Files\Storage\Storage[] $storages
*/
- private $storages = array();
+ private $storages = [];
protected function setUp(): void {
parent::setUp();
$updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
//set the mtime to the past so it can detect an mtime change
- $cache->put('', array('storage_mtime' => 10));
+ $cache->put('', ['storage_mtime' => 10]);
$this->assertTrue($cache->inCache('folder/bar.txt'));
$this->assertTrue($cache->inCache('folder/bar2.txt'));
$cachedData = $cache->get('bar.test');
$this->assertEquals(3, $cachedData['size']);
- $cache->put('bar.test', array('storage_mtime' => 10));
+ $cache->put('bar.test', ['storage_mtime' => 10]);
$storage->file_put_contents('bar.test', 'test data');
// make sure that PHP can read the new size correctly
$cachedData = $cache->get('bar.test');
$this->assertEquals(9, $cachedData['size']);
- $cache->put('folder', array('storage_mtime' => 10));
+ $cache->put('folder', ['storage_mtime' => 10]);
$storage->unlink('folder/bar2.txt');
$updater->checkUpdate('folder');
$updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
//set the mtime to the past so it can detect an mtime change
- $cache->put('', array('storage_mtime' => 10));
+ $cache->put('', ['storage_mtime' => 10]);
$storage->unlink('foo.txt');
$storage->rename('folder', 'foo.txt');
$updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
//set the mtime to the past so it can detect an mtime change
- $cache->put('foo.txt', array('storage_mtime' => 10));
+ $cache->put('foo.txt', ['storage_mtime' => 10]);
$storage->unlink('foo.txt');
$storage->rename('folder', 'foo.txt');
$updater = $storage->getWatcher();
//set the mtime to the past so it can detect an mtime change
- $cache->put('foo.txt', array('storage_mtime' => 10));
+ $cache->put('foo.txt', ['storage_mtime' => 10]);
$updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_NEVER);
$storage->file_put_contents('foo.txt', 'q');
$this->assertFalse($updater->checkUpdate('foo.txt'));
- $cache->put('foo.txt', array('storage_mtime' => 20));
+ $cache->put('foo.txt', ['storage_mtime' => 20]);
$storage->file_put_contents('foo.txt', 'w');
$this->assertFalse($updater->checkUpdate('foo.txt'));
}
$updater = $storage->getWatcher();
//set the mtime to the past so it can detect an mtime change
- $cache->put('foo.txt', array('storage_mtime' => 10));
+ $cache->put('foo.txt', ['storage_mtime' => 10]);
$updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ONCE);
$storage->file_put_contents('foo.txt', 'q');
$this->assertTrue($updater->checkUpdate('foo.txt'));
- $cache->put('foo.txt', array('storage_mtime' => 20));
+ $cache->put('foo.txt', ['storage_mtime' => 20]);
$storage->file_put_contents('foo.txt', 'w');
$this->assertFalse($updater->checkUpdate('foo.txt'));
}
$updater = $storage->getWatcher();
//set the mtime to the past so it can detect an mtime change
- $cache->put('foo.txt', array('storage_mtime' => 10));
+ $cache->put('foo.txt', ['storage_mtime' => 10]);
$updater->setPolicy(\OC\Files\Cache\Watcher::CHECK_ALWAYS);
$storage->file_put_contents('foo.txt', 'q');
$this->assertTrue($updater->checkUpdate('foo.txt'));
- $cache->put('foo.txt', array('storage_mtime' => 20));
+ $cache->put('foo.txt', ['storage_mtime' => 20]);
$storage->file_put_contents('foo.txt', 'w');
$this->assertTrue($updater->checkUpdate('foo.txt'));
}
* @return \OC\Files\Storage\Storage
*/
private function getTestStorage($scan = true) {
- $storage = new \OC\Files\Storage\Temporary(array());
+ $storage = new \OC\Files\Storage\Temporary([]);
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$storage->mkdir('folder');
function testSearchOutsideJail() {
$file1 = 'foo/foobar';
$file2 = 'folder/foobar';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/folder'];
$this->sourceCache->put($file1, $data1);
$this->sourceCache->put($file2, $data1);
$file1 = 'foo/foobar';
$file2 = 'foo/foobar/asd';
$file3 = 'folder/foobar';
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('foo', $data1);
$this->sourceCache->put($file1, $data1);
}
function testGetById() {
- $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$id = $this->sourceCache->put('foo/bar', $data1);
// path from jailed foo of foo/bar is bar
}
function testMoveFromJail() {
- $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('source', $folderData);
$this->sourceCache->put('source/foo', $folderData);
}
function testMoveToJail() {
- $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('source', $folderData);
$this->sourceCache->put('source/foo', $folderData);
}
function testMoveBetweenJail() {
- $folderData = array('size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory');
+ $folderData = ['size' => 100, 'mtime' => 50, 'mimetype' => 'httpd/unix-directory'];
$this->sourceCache->put('source', $folderData);
$this->sourceCache->put('source/foo', $folderData);
}
public function maskProvider() {
- return array(
- array(Constants::PERMISSION_ALL),
- array(Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE),
- array(Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE),
- array(Constants::PERMISSION_READ)
- );
+ return [
+ [Constants::PERMISSION_ALL],
+ [Constants::PERMISSION_ALL - Constants::PERMISSION_SHARE],
+ [Constants::PERMISSION_ALL - Constants::PERMISSION_UPDATE],
+ [Constants::PERMISSION_READ]
+ ];
}
/**
*/
public function testGetMasked($mask) {
$cache = $this->getMaskedCached($mask);
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL);
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL];
$this->sourceCache->put('foo', $data);
$result = $cache->get('foo');
$this->assertEquals($mask, $result['permissions']);
- $data = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE);
+ $data = ['size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain', 'permissions' => Constants::PERMISSION_ALL - Constants::PERMISSION_DELETE];
$this->sourceCache->put('bar', $data);
$result = $cache->get('bar');
$this->assertEquals($mask & ~Constants::PERMISSION_DELETE, $result['permissions']);
Filesystem::file_put_contents('/folder/bar.txt', 'fgh');
Filesystem::file_put_contents('/folder/subfolder/qwerty.txt', 'jkl');
- $files = array('/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt');
+ $files = ['/foo.txt', '/folder/bar.txt', '/folder/subfolder', '/folder/subfolder/qwerty.txt'];
$originalEtags = $this->getEtags($files);
$scanner = new \OC\Files\Utils\Scanner($user1, \OC::$server->getDatabaseConnection(), \OC::$server->query(IEventDispatcher::class), \OC::$server->getLogger());
* @param string[] $files
*/
private function getEtags($files) {
- $etags = array();
+ $etags = [];
foreach ($files as $file) {
$info = Filesystem::getFileInfo($file);
$etags[$file] = $info['etag'];
/**
* @var array tmpDirs
*/
- private $tmpDirs = array();
+ private $tmpDirs = [];
/**
* @return array
private function getStorageData() {
$dir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->tmpDirs[] = $dir;
- return array('datadir' => $dir);
+ return ['datadir' => $dir];
}
protected function setUp(): void {
}
public function isValidPathData() {
- return array(
- array('/', true),
- array('/path', true),
- array('/foo/bar', true),
- array('/foo//bar/', true),
- array('/foo////bar', true),
- array('/foo//\///bar', true),
- array('/foo/bar/.', true),
- array('/foo/bar/./', true),
- array('/foo/bar/./.', true),
- array('/foo/bar/././', true),
- array('/foo/bar/././..bar', true),
- array('/foo/bar/././..bar/a', true),
- array('/foo/bar/././..', false),
- array('/foo/bar/././../', false),
- array('/foo/bar/.././', false),
- array('/foo/bar/../../', false),
- array('/foo/bar/../..\\', false),
- array('..', false),
- array('../', false),
- array('../foo/bar', false),
- array('..\foo/bar', false),
- );
+ return [
+ ['/', true],
+ ['/path', true],
+ ['/foo/bar', true],
+ ['/foo//bar/', true],
+ ['/foo////bar', true],
+ ['/foo//\///bar', true],
+ ['/foo/bar/.', true],
+ ['/foo/bar/./', true],
+ ['/foo/bar/./.', true],
+ ['/foo/bar/././', true],
+ ['/foo/bar/././..bar', true],
+ ['/foo/bar/././..bar/a', true],
+ ['/foo/bar/././..', false],
+ ['/foo/bar/././../', false],
+ ['/foo/bar/.././', false],
+ ['/foo/bar/../../', false],
+ ['/foo/bar/../..\\', false],
+ ['..', false],
+ ['../', false],
+ ['../foo/bar', false],
+ ['..\foo/bar', false],
+ ];
}
/**
}
public function isFileBlacklistedData() {
- return array(
- array('/etc/foo/bar/foo.txt', false),
- array('\etc\foo/bar\foo.txt', false),
- array('.htaccess', true),
- array('.htaccess/', true),
- array('.htaccess\\', true),
- array('/etc/foo\bar/.htaccess\\', true),
- array('/etc/foo\bar/.htaccess/', true),
- array('/etc/foo\bar/.htaccess/foo', false),
- array('//foo//bar/\.htaccess/', true),
- array('\foo\bar\.HTAccess', true),
- );
+ return [
+ ['/etc/foo/bar/foo.txt', false],
+ ['\etc\foo/bar\foo.txt', false],
+ ['.htaccess', true],
+ ['.htaccess/', true],
+ ['.htaccess\\', true],
+ ['/etc/foo\bar/.htaccess\\', true],
+ ['/etc/foo\bar/.htaccess/', true],
+ ['/etc/foo\bar/.htaccess/foo', false],
+ ['//foo//bar/\.htaccess/', true],
+ ['\foo\bar\.HTAccess', true],
+ ];
}
/**
\OC_Hook::clear('OC_Filesystem');
\OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook');
- \OC\Files\Filesystem::mount('OC\Files\Storage\Temporary', array(), '/');
+ \OC\Files\Filesystem::mount('OC\Files\Storage\Temporary', [], '/');
$rootView = new \OC\Files\View('');
$rootView->mkdir('/' . $user);
public function testFind() {
$this->assertNull($this->manager->find('/'));
- $rootMount = new \OC\Files\Mount\MountPoint(new Temporary(array()), '/');
+ $rootMount = new \OC\Files\Mount\MountPoint(new Temporary([]), '/');
$this->manager->addMount($rootMount);
$this->assertEquals($rootMount, $this->manager->find('/'));
$this->assertEquals($rootMount, $this->manager->find('/foo/bar'));
- $storage = new Temporary(array());
+ $storage = new Temporary([]);
$mount1 = new \OC\Files\Mount\MountPoint($storage, '/foo');
$this->manager->addMount($mount1);
$this->assertEquals($rootMount, $this->manager->find('/'));
$this->assertEquals($mount1, $this->manager->find('/foo/bar'));
$this->assertEquals(1, count($this->manager->findIn('/')));
- $mount2 = new \OC\Files\Mount\MountPoint(new Temporary(array()), '/bar');
+ $mount2 = new \OC\Files\Mount\MountPoint(new Temporary([]), '/bar');
$this->manager->addMount($mount2);
$this->assertEquals(2, count($this->manager->findIn('/')));
$id = $mount1->getStorageId();
- $this->assertEquals(array($mount1), $this->manager->findByStorageId($id));
+ $this->assertEquals([$mount1], $this->manager->findByStorageId($id));
$mount3 = new \OC\Files\Mount\MountPoint($storage, '/foo/bar');
$this->manager->addMount($mount3);
- $this->assertEquals(array($mount1, $mount3), $this->manager->findByStorageId($id));
+ $this->assertEquals([$mount1, $mount3], $this->manager->findByStorageId($id));
}
public function testLong() {
- $storage = new LongId(array());
+ $storage = new LongId([]);
$mount = new \OC\Files\Mount\MountPoint($storage, '/foo');
$this->manager->addMount($mount);
$id = $mount->getStorageId();
$storageId = $storage->getId();
- $this->assertEquals(array($mount), $this->manager->findByStorageId($id));
- $this->assertEquals(array($mount), $this->manager->findByStorageId($storageId));
- $this->assertEquals(array($mount), $this->manager->findByStorageId(md5($storageId)));
+ $this->assertEquals([$mount], $this->manager->findByStorageId($id));
+ $this->assertEquals([$mount], $this->manager->findByStorageId($storageId));
+ $this->assertEquals([$mount], $this->manager->findByStorageId(md5($storageId)));
}
}
$wrapper = function ($mountPoint, $storage) use (&$test) {
$test->assertEquals('/foo/', $mountPoint);
$test->assertInstanceOf('\OC\Files\Storage\Storage', $storage);
- return new Wrapper(array('storage' => $storage));
+ return new Wrapper(['storage' => $storage]);
};
$loader = new StorageFactory();
$storage = $this->getMockBuilder('\OC\Files\Storage\Temporary')
->disableOriginalConstructor()
->getMock();
- $mount = new \OC\Files\Mount\MountPoint($storage, '/foo', array(), $loader);
+ $mount = new \OC\Files\Mount\MountPoint($storage, '/foo', [], $loader);
$this->assertInstanceOf('\OC\Files\Storage\Wrapper\Wrapper', $mount->getStorage());
}
}
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$this->assertEquals('bar', $node->getContent());
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => 0)));
+ ->willReturn($this->getFileInfo(['permissions' => 0]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$node->getContent();
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$this->view->expects($this->once())
->method('file_put_contents')
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$node->putContent('bar');
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('mimetype' => 'text/plain')));
+ ->willReturn($this->getFileInfo(['mimetype' => 'text/plain']));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$this->assertEquals('text/plain', $node->getMimeType());
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$fh = $node->fopen('r');
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$fh = $node->fopen('w');
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => 0)));
+ ->willReturn($this->getFileInfo(['permissions' => 0]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$node->fopen('r');
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_UPDATE)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_UPDATE]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$node->fopen('w');
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
$node = new \OC\Files\Node\File($root, $this->view, '/bar/foo');
$node->fopen('w');
$view->expects($this->any())
->method('getDirectoryContent')
->with('/bar/foo')
- ->willReturn(array(
+ ->willReturn([
new FileInfo('/bar/foo/asd', null, 'foo/asd', ['fileid' => 2, 'path' => '/bar/foo/asd', 'name' => 'asd', 'size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain'], null),
new FileInfo('/bar/foo/qwerty', null, 'foo/qwerty', ['fileid' => 3, 'path' => '/bar/foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'httpd/unix-directory'], null)
- ));
+ ]);
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
$children = $node->getDirectoryListing();
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$view->expects($this->once())
->method('mkdir')
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
$node->newFolder('asd');
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$view->expects($this->once())
->method('touch')
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
$node = new \OC\Files\Node\Folder($root, $view, '/bar/foo');
$node->newFile('asd');
$cache->expects($this->once())
->method('search')
->with('%qw%')
- ->willReturn(array(
- array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
- ));
+ ->willReturn([
+ ['fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+ ]);
$root->expects($this->once())
->method('getMountsIn')
->with('/bar/foo')
- ->willReturn(array());
+ ->willReturn([]);
$root->expects($this->once())
->method('getMount')
$cache->expects($this->once())
->method('search')
->with('%qw%')
- ->willReturn(array(
- array('fileid' => 3, 'path' => 'files/foo', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'),
- array('fileid' => 3, 'path' => 'files_trashbin/foo2.d12345', 'name' => 'foo2.d12345', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'),
- ));
+ ->willReturn([
+ ['fileid' => 3, 'path' => 'files/foo', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'],
+ ['fileid' => 3, 'path' => 'files_trashbin/foo2.d12345', 'name' => 'foo2.d12345', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain'],
+ ]);
$root->expects($this->once())
->method('getMountsIn')
->with('')
- ->willReturn(array());
+ ->willReturn([]);
$root->expects($this->once())
->method('getMount')
$cache->expects($this->once())
->method('search')
->with('%qw%')
- ->willReturn(array(
- array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
- ));
+ ->willReturn([
+ ['fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+ ]);
$root->expects($this->once())
->method('getMountsIn')
->with('/bar')
- ->willReturn(array());
+ ->willReturn([]);
$root->expects($this->once())
->method('getMount')
$cache->expects($this->once())
->method('search')
->with('%qw%')
- ->willReturn(array(
- array('fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
- ));
+ ->willReturn([
+ ['fileid' => 3, 'path' => 'foo/qwerty', 'name' => 'qwerty', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+ ]);
$subCache->expects($this->once())
->method('search')
->with('%qw%')
- ->willReturn(array(
- array('fileid' => 4, 'path' => 'asd/qweasd', 'name' => 'qweasd', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain')
- ));
+ ->willReturn([
+ ['fileid' => 4, 'path' => 'asd/qweasd', 'name' => 'qweasd', 'size' => 200, 'mtime' => 55, 'mimetype' => 'text/plain']
+ ]);
$root->expects($this->once())
->method('getMountsIn')
->with('/bar/foo')
- ->willReturn(array($subMount));
+ ->willReturn([$subMount]);
$root->expects($this->once())
->method('getMount')
$root->expects($this->once())
->method('getMountsIn')
->with('/bar/foo')
- ->willReturn(array());
+ ->willReturn([]);
$root->expects($this->once())
->method('getMount')
$root->expects($this->once())
->method('getMountsIn')
->with('/bar/foo')
- ->willReturn(array());
+ ->willReturn([]);
$root->expects($this->once())
->method('getMount')
$root->expects($this->any())
->method('getMountsIn')
->with('/bar/foo')
- ->willReturn(array($mount2));
+ ->willReturn([$mount2]);
$root->expects($this->once())
->method('getMount')
$this->createMock(ILogger::class),
$this->createMock(IUserManager::class)
);
- $storage = new Temporary(array());
- $subStorage = new Temporary(array());
+ $storage = new Temporary([]);
+ $subStorage = new Temporary([]);
$this->storages[] = $storage;
$this->storages[] = $subStorage;
$this->root->mount($storage, '/');
->method('getUser')
->willReturn($this->user);
- $stat = array(
+ $stat = [
'fileid' => 1,
'size' => 100,
'etag' => 'qwerty',
'mtime' => 50,
'permissions' => 0
- );
+ ];
$this->view->expects($this->once())
->method('stat')
->method('getUser')
->willReturn($this->user);
- $stat = $this->getFileInfo(array(
+ $stat = $this->getFileInfo([
'fileid' => 1,
'size' => 100,
'etag' => 'qwerty',
'mtime' => 50
- ));
+ ]);
$this->view->expects($this->once())
->method('getFileInfo')
->willReturn($this->user);
- $stat = $this->getFileInfo(array(
+ $stat = $this->getFileInfo([
'fileid' => 1,
'size' => 100,
'etag' => 'qwerty',
'mtime' => 50
- ));
+ ]);
$this->view->expects($this->once())
->method('getFileInfo')
->method('getUser')
->willReturn($this->user);
- $stat = $this->getFileInfo(array(
+ $stat = $this->getFileInfo([
'fileid' => 1,
'size' => 100,
'etag' => 'qwerty',
'mtime' => 50
- ));
+ ]);
$this->view->expects($this->once())
->method('getFileInfo')
->method('getUser')
->willReturn($this->user);
- $stat = $this->getFileInfo(array(
+ $stat = $this->getFileInfo([
'fileid' => 1,
'size' => 100,
'etag' => 'qwerty',
'mtime' => 50
- ));
+ ]);
$this->view->expects($this->once())
->method('getFileInfo')
$this->view->expects($this->once())
->method('resolvePath')
->with('/bar/foo')
- ->willReturn(array($storage, 'foo'));
+ ->willReturn([$storage, 'foo']);
$node = $this->createTestNode($this->root, $this->view, '/bar/foo');
$this->view->expects($this->once())
->method('resolvePath')
->with('/bar/foo')
- ->willReturn(array($storage, 'foo'));
+ ->willReturn([$storage, 'foo']);
$node = $this->createTestNode($this->root, $this->view, '/bar/foo');
$this->view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$node = $this->createTestNode($this->root, $this->view, '/bar/foo');
$node->touch(100);
$this->view->expects($this->any())
->method('resolvePath')
->with('/bar/foo')
- ->willReturn(array(null, 'foo'));
+ ->willReturn([null, 'foo']);
$this->view->expects($this->any())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_ALL)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_ALL]));
$node = $this->createTestNode($root, $this->view, '/bar/foo');
$node->touch(100);
$this->view->expects($this->any())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('permissions' => \OCP\Constants::PERMISSION_READ)));
+ ->willReturn($this->getFileInfo(['permissions' => \OCP\Constants::PERMISSION_READ]));
$node = $this->createTestNode($this->root, $this->view, '/bar/foo');
$node->touch(100);
$view->expects($this->once())
->method('getFileInfo')
->with('/bar/foo')
- ->willReturn($this->getFileInfo(array('fileid' => 10, 'path' => 'bar/foo', 'name', 'mimetype' => 'text/plain')));
+ ->willReturn($this->getFileInfo(['fileid' => 10, 'path' => 'bar/foo', 'name', 'mimetype' => 'text/plain']));
$root->mount($storage, '');
$node = $root->get('/bar/foo');
protected function setUp(): void {
parent::setUp();
- $this->storage = new \OC\Files\Storage\Temporary(array());
+ $this->storage = new \OC\Files\Storage\Temporary([]);
$this->scanner = new \OC\Files\ObjectStore\NoopScanner($this->storage);
}
class NonSeekableStream extends Wrapper {
public static function wrap($source) {
- $context = stream_context_create(array(
- 'nonseek' => array(
+ $context = stream_context_create([
+ 'nonseek' => [
'source' => $source
- )
- ));
+ ]
+ ]);
return Wrapper::wrapSource($source, $context, 'nonseek', self::class);
}
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
$this->userId = $this->getUniqueID('user_');
$this->user = new DummyUser($this->userId, $this->tmpDir);
- $this->instance = new \OC\Files\Storage\Home(array('user' => $this->user));
+ $this->instance = new \OC\Files\Storage\Home(['user' => $this->user]);
}
protected function tearDown(): void {
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
- $this->instance = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
+ $this->instance = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
}
protected function tearDown(): void {
$this->assertTrue($this->instance->isUpdatable('/' . $directory));
$dh = $this->instance->opendir('/');
- $content = array();
+ $content = [];
while ($file = readdir($dh)) {
if ($file != '.' and $file != '..') {
$content[] = $file;
}
}
- $this->assertEquals(array($directory), $content);
+ $this->assertEquals([$directory], $content);
$this->assertFalse($this->instance->mkdir('/' . $directory)); //can't create existing folders
$this->assertTrue($this->instance->rmdir('/' . $directory));
$this->assertFalse($this->instance->rmdir('/' . $directory)); //can't remove non existing folders
$dh = $this->instance->opendir('/');
- $content = array();
+ $content = [];
while ($file = readdir($dh)) {
if ($file != '.' and $file != '..') {
$content[] = $file;
}
}
- $this->assertEquals(array(), $content);
+ $this->assertEquals([], $content);
}
public function fileNameProvider() {
function loremFileProvider() {
$root = \OC::$SERVERROOT . '/tests/data/';
- return array(
+ return [
// small file
- array($root . 'lorem.txt'),
+ [$root . 'lorem.txt'],
// bigger file (> 8 KB which is the standard PHP block size)
- array($root . 'lorem-big.txt')
- );
+ [$root . 'lorem-big.txt']
+ ];
}
/**
}
public function hashProvider() {
- return array(
- array('Foobar', 'md5'),
- array('Foobar', 'sha1'),
- array('Foobar', 'sha256'),
- );
+ return [
+ ['Foobar', 'md5'],
+ ['Foobar', 'sha1'],
+ ['Foobar', 'sha256'],
+ ];
}
/**
$this->assertEquals('data', $this->instance->file_get_contents('#foo/test.txt'));
$dh = $this->instance->opendir('#foo');
- $content = array();
+ $content = [];
while ($file = readdir($dh)) {
if ($file != '.' and $file != '..') {
$content[] = $file;
}
}
- $this->assertEquals(array('test.txt'), $content);
+ $this->assertEquals(['test.txt'], $content);
}
public function testCopyOverWriteFile() {
$this->logger = $this->createMock(Log::class);
- $this->sourceStorage = new Temporary(array());
+ $this->sourceStorage = new Temporary([]);
$this->keyStore = $this->getMockBuilder('\OC\Encryption\Keys\Storage')
->disableOriginalConstructor()->getMock();
* @return array
*/
public function dataTestCopyAndRename() {
- return array(
- array('source', 'target', true, false, false),
- array('source', 'target', true, true, false),
- array('source', '/subFolder/target', true, false, false),
- array('source', '/subFolder/target', true, true, true),
- array('source', '/subFolder/target', false, true, false),
- );
+ return [
+ ['source', 'target', true, false, false],
+ ['source', 'target', true, true, false],
+ ['source', '/subFolder/target', true, false, false],
+ ['source', '/subFolder/target', true, true, true],
+ ['source', '/subFolder/target', false, true, false],
+ ];
}
public function testIsLocal() {
}
public function dataTestRmdir() {
- return array(
- array('/file.txt', true, true, true),
- array('/file.txt', false, true, true),
- array('/file.txt', true, false, true),
- array('/file.txt', false, false, true),
- array('/file.txt', true, true, false),
- array('/file.txt', false, true, false),
- array('/file.txt', true, false, false),
- array('/file.txt', false, false, false),
- );
+ return [
+ ['/file.txt', true, true, true],
+ ['/file.txt', false, true, true],
+ ['/file.txt', true, false, true],
+ ['/file.txt', false, false, true],
+ ['/file.txt', true, true, false],
+ ['/file.txt', false, true, false],
+ ['/file.txt', true, false, false],
+ ['/file.txt', false, false, false],
+ ];
}
/**
}
public function dataTestCopyKeys() {
- return array(
- array(true, false),
- array(false, true),
- );
+ return [
+ [true, false],
+ [false, true],
+ ];
}
/**
}
public function dataTestGetHeader() {
- return array(
- array('/foo/bar.txt', false, '/foo/bar.txt'),
- array('/foo/bar.txt.part', false, '/foo/bar.txt'),
- array('/foo/bar.txt.ocTransferId7437493.part', false, '/foo/bar.txt'),
- array('/foo/bar.txt.part', true, '/foo/bar.txt'),
- array('/foo/bar.txt.ocTransferId7437493.part', true, '/foo/bar.txt'),
- );
+ return [
+ ['/foo/bar.txt', false, '/foo/bar.txt'],
+ ['/foo/bar.txt.part', false, '/foo/bar.txt'],
+ ['/foo/bar.txt.ocTransferId7437493.part', false, '/foo/bar.txt'],
+ ['/foo/bar.txt.part', true, '/foo/bar.txt'],
+ ['/foo/bar.txt.ocTransferId7437493.part', true, '/foo/bar.txt'],
+ ];
}
/**
protected function setUp(): void {
parent::setUp();
- $this->sourceStorage = new \OC\Files\Storage\Temporary(array());
+ $this->sourceStorage = new \OC\Files\Storage\Temporary([]);
$this->sourceStorage->mkdir('foo');
- $this->instance = new \OC\Files\Storage\Wrapper\Jail(array(
+ $this->instance = new \OC\Files\Storage\Wrapper\Jail([
'storage' => $this->sourceStorage,
'root' => 'foo'
- ));
+ ]);
}
protected function tearDown(): void {
// test that nothing outside our jail is touched
- $contents = array();
+ $contents = [];
$dh = $this->sourceStorage->opendir('');
while ($file = readdir($dh)) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
$contents[] = $file;
}
}
- $this->assertEquals(array('foo'), $contents);
+ $this->assertEquals(['foo'], $contents);
$this->sourceStorage->cleanUp();
parent::tearDown();
}
protected function setUp(): void {
parent::setUp();
- $this->sourceStorage = new \OC\Files\Storage\Temporary(array());
+ $this->sourceStorage = new \OC\Files\Storage\Temporary([]);
$this->instance = $this->getMaskedStorage(Constants::PERMISSION_ALL);
}
}
protected function getMaskedStorage($mask) {
- return new \OC\Files\Storage\Wrapper\PermissionsMask(array(
+ return new \OC\Files\Storage\Wrapper\PermissionsMask([
'storage' => $this->sourceStorage,
'mask' => $mask
- ));
+ ]);
}
public function testMkdirNoCreate() {
public function testScanNewFilesNested() {
$storage = $this->getMaskedStorage(Constants::PERMISSION_READ + Constants::PERMISSION_CREATE + Constants::PERMISSION_UPDATE);
- $nestedStorage = new \OC\Files\Storage\Wrapper\PermissionsMask(array(
+ $nestedStorage = new \OC\Files\Storage\Wrapper\PermissionsMask([
'storage' => $storage,
'mask' => Constants::PERMISSION_READ + Constants::PERMISSION_CREATE
- ));
+ ]);
$wrappedStorage = new Wrapper(['storage' => $nestedStorage]);
$wrappedStorage->file_put_contents('foo', 'bar');
$wrappedStorage->getScanner()->scan('');
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
- $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
- $this->instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 10000000));
+ $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
+ $this->instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 10000000]);
}
protected function tearDown(): void {
* @param integer $limit
*/
protected function getLimitedStorage($limit) {
- $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
+ $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
$storage->mkdir('files');
$storage->getScanner()->scan('');
- return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $limit));
+ return new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => $limit]);
}
public function testFilePutContentsNotEnoughSpace() {
public function testFreeSpaceWithUsedSpace() {
$instance = $this->getLimitedStorage(9);
$instance->getCache()->put(
- '', array('size' => 3)
+ '', ['size' => 3]
);
$this->assertEquals(6, $instance->free_space(''));
}
->willReturn(-2);
$storage->getScanner()->scan('');
- $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 9));
+ $instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 9]);
$instance->getCache()->put(
- '', array('size' => 3)
+ '', ['size' => 3]
);
$this->assertEquals(6, $instance->free_space(''));
}
public function testFreeSpaceWithUsedSpaceAndEncryption() {
$instance = $this->getLimitedStorage(9);
$instance->getCache()->put(
- '', array('size' => 7)
+ '', ['size' => 7]
);
$this->assertEquals(2, $instance->free_space(''));
}
->method('fopen')
->willReturn(false);
- $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $failStorage, 'quota' => 1000));
+ $instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $failStorage, 'quota' => 1000]);
$this->assertFalse($instance->fopen('failedfopen', 'r'));
}
->with('files')
->willReturn(new CacheEntry(['size' => 50]));
- $instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 1024, 'root' => 'files'));
+ $instance = new \OC\Files\Storage\Wrapper\Quota(['storage' => $storage, 'quota' => 1024, 'root' => 'files']);
$this->assertEquals(1024 - 50, $instance->free_space(''));
}
parent::setUp();
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
- $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
- $this->instance = new \OC\Files\Storage\Wrapper\Wrapper(array('storage' => $storage));
+ $storage = new \OC\Files\Storage\Local(['datadir' => $this->tmpDir]);
+ $this->instance = new \OC\Files\Storage\Wrapper\Wrapper(['storage' => $storage]);
}
protected function tearDown(): void {
$fileMock->expects($this->once())->method('getAccessList')
->willReturnCallback(function ($sharePath) use ($expectedSharePath) {
$this->assertSame($expectedSharePath, $sharePath);
- return array();
+ return [];
});
}
$utilMock = $this->getMockBuilder('\OC\Encryption\Util')
$fullPathP->setAccessible(false);
$header = $stream->getProperty('header');
$header->setAccessible(true);
- $header->setValue($streamWrapper, array());
+ $header->setValue($streamWrapper, []);
$header->setAccessible(false);
$this->invokePrivate($streamWrapper, 'signed', [true]);
/**
* @var \OC\Files\Mount\MountPoint[] $mounts
*/
- private $mounts = array();
+ private $mounts = [];
/**
* @param \OC\Files\Mount\MountPoint $mount
}
public function testReuseExistingRoot() {
- $storage = new Temporary(array());
+ $storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
}
public function testReuseExistingFile() {
- $storage = new Temporary(array());
+ $storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
$mountProvider = $this->createMock(IMountProvider::class);
- $storage = new Temporary(array());
+ $storage = new Temporary([]);
$mount = new MountPoint($storage, '/' . $uid . '/files/foo');
$mountProvider->expects($this->any())
}
public function testPropagateEtag() {
- $storage = new Temporary(array());
+ $storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
}
public function testShallow() {
- $storage = new Temporary(array());
+ $storage = new Temporary([]);
$mount = new MountPoint($storage, '');
Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
$this->assertFalse($this->backend->addToGroup($user1, $group1));
- $this->assertEquals(array($user1), $this->backend->usersInGroup($group1));
- $this->assertEquals(array(), $this->backend->usersInGroup($group2));
+ $this->assertEquals([$user1], $this->backend->usersInGroup($group1));
+ $this->assertEquals([], $this->backend->usersInGroup($group2));
- $this->assertEquals(array($group1), $this->backend->getUserGroups($user1));
- $this->assertEquals(array(), $this->backend->getUserGroups($user2));
+ $this->assertEquals([$group1], $this->backend->getUserGroups($user1));
+ $this->assertEquals([], $this->backend->getUserGroups($user2));
$this->backend->deleteGroup($group1);
- $this->assertEquals(array(), $this->backend->getUserGroups($user1));
- $this->assertEquals(array(), $this->backend->usersInGroup($group1));
+ $this->assertEquals([], $this->backend->getUserGroups($user1));
+ $this->assertEquals([], $this->backend->usersInGroup($group1));
$this->assertFalse($this->backend->inGroup($user1, $group1));
}
* @group DB
*/
class DatabaseTest extends Backend {
- private $groups = array();
+ private $groups = [];
/**
* get a new unique group name
$user3 = $this->newUser('user3', $backend);
$userManager->expects($this->any())
->method('get')
- ->willReturnMap(array(
- array('user1', $user1),
- array('user2', $user2),
- array('user3', $user3)
- ));
+ ->willReturnMap([
+ ['user1', $user1],
+ ['user2', $user2],
+ ['user3', $user3]
+ ]);
return $userManager;
}
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('usersInGroup')
->with('group1')
- ->willReturn(array('user1', 'user2'));
+ ->willReturn(['user1', 'user2']);
$users = $group->getUsers();
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('usersInGroup')
->with('group1')
- ->willReturn(array('user1', 'user2'));
+ ->willReturn(['user1', 'user2']);
$backend2->expects($this->once())
->method('usersInGroup')
->with('group1')
- ->willReturn(array('user2', 'user3'));
+ ->willReturn(['user2', 'user3']);
$users = $group->getUsers();
$userBackend = $this->getMockBuilder('\OC\User\Backend')
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('inGroup')
$userBackend = $this->getMockBuilder(\OC\User\Backend::class)
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('inGroup')
$userBackend = $this->getMockBuilder('\OC\User\Backend')
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('inGroup')
$userBackend = $this->getMockBuilder('\OC\User\Backend')
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('inGroup')
$userBackend = $this->getMockBuilder('\OC\User\Backend')
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('inGroup')
$userBackend = $this->getMockBuilder(\OC\User\Backend::class)
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('inGroup')
$userBackend = $this->getMockBuilder('\OC\User\Backend')
->disableOriginalConstructor()
->getMock();
- $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('inGroup')
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('usersInGroup')
->with('group1', '2')
- ->willReturn(array('user2'));
+ ->willReturn(['user2']);
$users = $group->searchUsers('2');
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('usersInGroup')
->with('group1', '2')
- ->willReturn(array('user2'));
+ ->willReturn(['user2']);
$backend2->expects($this->once())
->method('usersInGroup')
->with('group1', '2')
- ->willReturn(array('user2'));
+ ->willReturn(['user2']);
$users = $group->searchUsers('2');
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('usersInGroup')
->with('group1', 'user', 1, 1)
- ->willReturn(array('user2'));
+ ->willReturn(['user2']);
$users = $group->searchUsers('user', 1, 1);
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('usersInGroup')
->with('group1', 'user', 2, 1)
- ->willReturn(array('user2'));
+ ->willReturn(['user2']);
$backend2->expects($this->once())
->method('usersInGroup')
->with('group1', 'user', 2, 1)
- ->willReturn(array('user1'));
+ ->willReturn(['user1']);
$users = $group->searchUsers('user', 2, 1);
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend1), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('countUsersInGroup')
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend1, $backend2), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1, $backend2], $this->dispatcher, $userManager);
$backend1->expects($this->once())
->method('countUsersInGroup')
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend1), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend1], $this->dispatcher, $userManager);
$backend1->expects($this->never())
->method('countUsersInGroup');
->disableOriginalConstructor()
->getMock();
$userManager = $this->getUserManager();
- $group = new \OC\Group\Group('group1', array($backend), $this->dispatcher, $userManager);
+ $group = new \OC\Group\Group('group1', [$backend], $this->dispatcher, $userManager);
$backend->expects($this->once())
->method('deleteGroup')
$backend->expects($this->once())
->method('getGroups')
->with('1')
- ->willReturn(array('group1'));
+ ->willReturn(['group1']);
$backend->expects($this->once())
->method('groupExists')
->with('group1')
$backend1->expects($this->once())
->method('getGroups')
->with('1')
- ->willReturn(array('group1'));
+ ->willReturn(['group1']);
$backend1->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend2->expects($this->once())
->method('getGroups')
->with('1')
- ->willReturn(array('group12', 'group1'));
+ ->willReturn(['group12', 'group1']);
$backend2->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend1->expects($this->once())
->method('getGroups')
->with('1', 2, 1)
- ->willReturn(array('group1'));
+ ->willReturn(['group1']);
$backend1->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend2->expects($this->once())
->method('getGroups')
->with('1', 2, 1)
- ->willReturn(array('group12'));
+ ->willReturn(['group12']);
$backend2->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1'));
+ ->willReturn(['group1']);
$backend->expects($this->any())
->method('groupExists')
->with('group1')
$backend->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1'));
+ ->willReturn(['group1']);
$backend->expects($this->any())
->method('groupExists')
->with('group1')
$backend->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1', 'admin', 'group2'));
+ ->willReturn(['group1', 'admin', 'group2']);
$backend->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1', 'admin', 'group2'));
+ ->willReturn(['group1', 'admin', 'group2']);
$backend->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1', 'group2'));
+ ->willReturn(['group1', 'group2']);
$backend->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend1->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1'));
+ ->willReturn(['group1']);
$backend1->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend2->expects($this->once())
->method('getUserGroups')
->with('user1')
- ->willReturn(array('group1', 'group2'));
+ ->willReturn(['group1', 'group2']);
$backend1->expects($this->any())
->method('groupExists')
->willReturn(true);
$backend->expects($this->once())
->method('usersInGroup')
->with('testgroup', '', -1, 0)
- ->willReturn(array('user2', 'user33'));
+ ->willReturn(['user2', 'user33']);
$this->userManager->expects($this->any())
->method('get')
$backend->expects($this->once())
->method('usersInGroup')
->with('testgroup', '', 1, 0)
- ->willReturn(array('user2'));
+ ->willReturn(['user2']);
$this->userManager->expects($this->any())
->method('get')
$backend->expects($this->once())
->method('usersInGroup')
->with('testgroup', '', 1, 1)
- ->willReturn(array('user33'));
+ ->willReturn(['user33']);
$this->userManager->expects($this->any())
->method('get')
// prime cache
$user1 = $this->getTestUser('user1');
$groups = $manager->getUserGroups($user1);
- $this->assertEquals(array(), $groups);
+ $this->assertEquals([], $groups);
// add user
$group = $manager->get('group1');
// remove user
$group = $manager->get('group1');
$group->removeUser($user1);
- $expectedGroups = array();
+ $expectedGroups = [];
// check result
$groups = $manager->getUserGroups($user1);
$this->storageMock = null;
}
\OC\Files\Filesystem::tearDown();
- \OC\Files\Filesystem::mount($this->storage, array(), '/');
+ \OC\Files\Filesystem::mount($this->storage, [], '/');
\OC_User::setUserId('');
$user = \OC::$server->getUserManager()->get($this->user);
*/
function testGetStorageInfo() {
$homeStorage = $this->getStorageMock(12);
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
$storageInfo = \OC_Helper::getStorageInfo('');
*/
function testGetStorageInfoExcludingExtStorage() {
$homeStorage = $this->getStorageMock(12);
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
- $extStorage = new \OC\Files\Storage\Temporary(array());
+ $extStorage = new \OC\Files\Storage\Temporary([]);
$extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
$extStorage->getScanner()->scan(''); // update root size
- \OC\Files\Filesystem::mount($extStorage, array(), '/' . $this->user . '/files/ext');
+ \OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
$storageInfo = \OC_Helper::getStorageInfo('');
$this->assertEquals(12, $storageInfo['free']);
* Test getting the storage info, including extra mount points
*/
function testGetStorageInfoIncludingExtStorage() {
- $homeStorage = new \OC\Files\Storage\Temporary(array());
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ $homeStorage = new \OC\Files\Storage\Temporary([]);
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
- $extStorage = new \OC\Files\Storage\Temporary(array());
+ $extStorage = new \OC\Files\Storage\Temporary([]);
$extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
$extStorage->getScanner()->scan(''); // update root size
- \OC\Files\Filesystem::mount($extStorage, array(), '/' . $this->user . '/files/ext');
+ \OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
$config = \OC::$server->getConfig();
$oldConfig = $config->getSystemValue('quota_include_external_storage', false);
*/
function testGetStorageInfoIncludingExtStorageWithNoUserQuota() {
$homeStorage = $this->getStorageMock(12);
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$homeStorage->file_put_contents('test.txt', '01234');
- $extStorage = new \OC\Files\Storage\Temporary(array());
+ $extStorage = new \OC\Files\Storage\Temporary([]);
$extStorage->file_put_contents('extfile.txt', 'abcdefghijklmnopq');
$extStorage->getScanner()->scan(''); // update root size
- \OC\Files\Filesystem::mount($extStorage, array(), '/' . $this->user . '/files/ext');
+ \OC\Files\Filesystem::mount($extStorage, [], '/' . $this->user . '/files/ext');
$config = \OC::$server->getConfig();
$oldConfig = $config->getSystemValue('quota_include_external_storage', false);
$homeStorage = $this->getStorageMock(12);
$homeStorage->file_put_contents('test.txt', '01234');
$homeStorage = new \OC\Files\Storage\Wrapper\Quota(
- array(
+ [
'storage' => $homeStorage,
'quota' => 7
- )
+ ]
);
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$storageInfo = \OC_Helper::getStorageInfo('');
$this->assertEquals(2, $storageInfo['free']);
$homeStorage = $this->getStorageMock(12);
$homeStorage->file_put_contents('test.txt', '0123456789');
$homeStorage = new \OC\Files\Storage\Wrapper\Quota(
- array(
+ [
'storage' => $homeStorage,
'quota' => 7
- )
+ ]
);
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$storageInfo = \OC_Helper::getStorageInfo('');
$this->assertEquals(0, $storageInfo['free']);
$homeStorage = $this->getStorageMock(12);
$homeStorage->file_put_contents('test.txt', '01234');
$homeStorage = new \OC\Files\Storage\Wrapper\Quota(
- array(
+ [
'storage' => $homeStorage,
'quota' => 18
- )
+ ]
);
- \OC\Files\Filesystem::mount($homeStorage, array(), '/' . $this->user . '/files');
+ \OC\Files\Filesystem::mount($homeStorage, [], '/' . $this->user . '/files');
$storageInfo = \OC_Helper::getStorageInfo('');
$this->assertEquals(12, $storageInfo['free']);
}
public static function createCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_create,
'params' => $params
- );
+ ];
}
public static function updateCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_update,
'params' => $params
- );
+ ];
}
public static function writeCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_write,
'params' => $params
- );
+ ];
}
public static function postCreateCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_post_create,
'params' => $params
- );
+ ];
}
public static function postUpdateCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_post_update,
'params' => $params
- );
+ ];
}
public static function postWriteCallback($params) {
- self::$hookCalls[] = array(
+ self::$hookCalls[] = [
'signal' => Filesystem::signal_post_write,
'params' => $params
- );
+ ];
}
/**
* @package Test\Hooks
*/
class DummyEmitter extends \OC\Hooks\BasicEmitter {
- public function emitEvent($scope, $method, $arguments = array()) {
+ public function emitEvent($scope, $method, $arguments = []) {
$this->emit($scope, $method, $arguments);
}
}
public function testStaticCallback() {
$this->expectException(\Test\Hooks\EmittedException::class);
- $this->emitter->listen('Test', 'test', array('\Test\Hooks\BasicEmitterTest', 'staticCallBack'));
+ $this->emitter->listen('Test', 'test', ['\Test\Hooks\BasicEmitterTest', 'staticCallBack']);
$this->emitter->emitEvent('Test', 'test');
}
public function testNonStaticCallback() {
$this->expectException(\Test\Hooks\EmittedException::class);
- $this->emitter->listen('Test', 'test', array($this, 'nonStaticCallBack'));
+ $this->emitter->listen('Test', 'test', [$this, 'nonStaticCallBack']);
$this->emitter->emitEvent('Test', 'test');
}
throw new EmittedException;
}
});
- $this->emitter->emitEvent('Test', 'test', array('foo', 'bar'));
+ $this->emitter->emitEvent('Test', 'test', ['foo', 'bar']);
}
throw new EmittedException;
}
});
- $this->emitter->emitEvent('Test', 'test', array('foo' => 'foo', 'bar' => 'bar'));
+ $this->emitter->emitEvent('Test', 'test', ['foo' => 'foo', 'bar' => 'bar']);
}
public function testRemoveAllSpecified() {
use OC\Hooks\PublicEmitter;
class DummyForwardingEmitter extends \OC\Hooks\ForwardingEmitter {
- public function emitEvent($scope, $method, $arguments = array()) {
+ public function emitEvent($scope, $method, $arguments = []) {
$this->emit($scope, $method, $arguments);
}
* @package Test\Hooks
*/
class DummyLegacyEmitter extends \OC\Hooks\LegacyEmitter {
- public function emitEvent($scope, $method, $arguments = array()) {
+ public function emitEvent($scope, $method, $arguments = []) {
$this->emit($scope, $method, $arguments);
}
}
public function testLegacyArguments() {
\OC_Hook::connect('Test', 'test', '\Test\Hooks\LegacyEmitterTest', 'staticLegacyArgumentsCallBack');
- $this->emitter->emitEvent('Test', 'test', array('foo' => 'foo', 'bar' => 'bar'));
+ $this->emitter->emitEvent('Test', 'test', ['foo' => 'foo', 'bar' => 'bar']);
$this->assertEquals(true, self::$emitted);
}
}
}
function convertDataProvider() {
- return array(
- array( 'image/gif'),
- array( 'image/jpeg'),
- array( 'image/png'),
- );
+ return [
+ [ 'image/gif'],
+ [ 'image/jpeg'],
+ [ 'image/png'],
+ ];
}
/**
->expects($this->once())
->method('getOnlyDefaultAliases')
->willReturn(
- array (
+ [
'_comment' => 'Array of mimetype aliases.',
'_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
'_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
'text/x-shellscript' => 'text/code',
'web' => 'text/code',
'application/internet-shortcut' => 'link',
- ));
+ ]);
$this->mimeTypeDetector
->expects($this->once())
->method('getAllAliases')
->willReturn(
- array (
+ [
'_comment' => 'Array of mimetype aliases.',
'_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
'_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
'text/x-shellscript' => 'text/code',
'web' => 'text/code',
'application/internet-shortcut' => 'link',
- ));
+ ]);
$this->environmentHelper
->expects($this->any())
}
public function localizationData() {
- return array(
+ return [
// timestamp as string
- array('February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', '1234567890'),
- array('13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', '1234567890'),
- array('February 13, 2009', 'en', 'en_US', 'date', '1234567890'),
- array('13. Februar 2009', 'de', 'de_DE', 'date', '1234567890'),
- array('11:31:30 PM GMT+0', 'en', 'en_US', 'time', '1234567890'),
- array('23:31:30 GMT+0', 'de', 'de_DE', 'time', '1234567890'),
+ ['February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', '1234567890'],
+ ['13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', '1234567890'],
+ ['February 13, 2009', 'en', 'en_US', 'date', '1234567890'],
+ ['13. Februar 2009', 'de', 'de_DE', 'date', '1234567890'],
+ ['11:31:30 PM GMT+0', 'en', 'en_US', 'time', '1234567890'],
+ ['23:31:30 GMT+0', 'de', 'de_DE', 'time', '1234567890'],
// timestamp as int
- array('February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', 1234567890),
- array('13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', 1234567890),
- array('February 13, 2009', 'en', 'en_US', 'date', 1234567890),
- array('13. Februar 2009', 'de', 'de_DE', 'date', 1234567890),
- array('11:31:30 PM GMT+0', 'en', 'en_US', 'time', 1234567890),
- array('23:31:30 GMT+0', 'de', 'de_DE', 'time', 1234567890),
+ ['February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', 1234567890],
+ ['13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', 1234567890],
+ ['February 13, 2009', 'en', 'en_US', 'date', 1234567890],
+ ['13. Februar 2009', 'de', 'de_DE', 'date', 1234567890],
+ ['11:31:30 PM GMT+0', 'en', 'en_US', 'time', 1234567890],
+ ['23:31:30 GMT+0', 'de', 'de_DE', 'time', 1234567890],
// DateTime object
- array('February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', new DateTime('@1234567890')),
- array('13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', new DateTime('@1234567890')),
- array('February 13, 2009', 'en', 'en_US', 'date', new DateTime('@1234567890')),
- array('13. Februar 2009', 'de', 'de_DE', 'date', new DateTime('@1234567890')),
- array('11:31:30 PM GMT+0', 'en', 'en_US', 'time', new DateTime('@1234567890')),
- array('23:31:30 GMT+0', 'de', 'de_DE', 'time', new DateTime('@1234567890')),
+ ['February 13, 2009 at 11:31:30 PM GMT+0', 'en', 'en_US', 'datetime', new DateTime('@1234567890')],
+ ['13. Februar 2009 um 23:31:30 GMT+0', 'de', 'de_DE', 'datetime', new DateTime('@1234567890')],
+ ['February 13, 2009', 'en', 'en_US', 'date', new DateTime('@1234567890')],
+ ['13. Februar 2009', 'de', 'de_DE', 'date', new DateTime('@1234567890')],
+ ['11:31:30 PM GMT+0', 'en', 'en_US', 'time', new DateTime('@1234567890')],
+ ['23:31:30 GMT+0', 'de', 'de_DE', 'time', new DateTime('@1234567890')],
// en_GB
- array('13 February 2009 at 23:31:30 GMT+0', 'en_GB', 'en_GB', 'datetime', new DateTime('@1234567890')),
- array('13 February 2009', 'en_GB', 'en_GB', 'date', new DateTime('@1234567890')),
- array('23:31:30 GMT+0', 'en_GB', 'en_GB', 'time', new DateTime('@1234567890')),
- array('13 February 2009 at 23:31:30 GMT+0', 'en-GB', 'en_GB', 'datetime', new DateTime('@1234567890')),
- array('13 February 2009', 'en-GB', 'en_GB', 'date', new DateTime('@1234567890')),
- array('23:31:30 GMT+0', 'en-GB', 'en_GB', 'time', new DateTime('@1234567890')),
- );
+ ['13 February 2009 at 23:31:30 GMT+0', 'en_GB', 'en_GB', 'datetime', new DateTime('@1234567890')],
+ ['13 February 2009', 'en_GB', 'en_GB', 'date', new DateTime('@1234567890')],
+ ['23:31:30 GMT+0', 'en_GB', 'en_GB', 'time', new DateTime('@1234567890')],
+ ['13 February 2009 at 23:31:30 GMT+0', 'en-GB', 'en_GB', 'datetime', new DateTime('@1234567890')],
+ ['13 February 2009', 'en-GB', 'en_GB', 'date', new DateTime('@1234567890')],
+ ['23:31:30 GMT+0', 'en-GB', 'en_GB', 'time', new DateTime('@1234567890')],
+ ];
}
/**
}
public function firstDayData() {
- return array(
- array(1, 'de', 'de_DE'),
- array(0, 'en', 'en_US'),
- );
+ return [
+ [1, 'de', 'de_DE'],
+ [0, 'en', 'en_US'],
+ ];
}
/**
}
public function jsDateData() {
- return array(
- array('dd.MM.yy', 'de', 'de_DE'),
- array('M/d/yy', 'en', 'en_US'),
- );
+ return [
+ ['dd.MM.yy', 'de', 'de_DE'],
+ ['M/d/yy', 'en', 'en_US'],
+ ];
}
/**
public function humanFileSizeProvider()
{
- return array(
- array('0 B', 0),
- array('1 KB', 1024),
- array('9.5 MB', 10000000),
- array('1.3 GB', 1395864371),
- array('465.7 GB', 500000000000),
- array('454.7 TB', 500000000000000),
- array('444.1 PB', 500000000000000000),
- );
+ return [
+ ['0 B', 0],
+ ['1 KB', 1024],
+ ['9.5 MB', 10000000],
+ ['1.3 GB', 1395864371],
+ ['465.7 GB', 500000000000],
+ ['454.7 TB', 500000000000000],
+ ['444.1 PB', 500000000000000000],
+ ];
}
/**
}
function testMb_array_change_key_case() {
- $arrayStart = array(
+ $arrayStart = [
"Foo" => "bar",
"Bar" => "foo",
- );
- $arrayResult = array(
+ ];
+ $arrayResult = [
"foo" => "bar",
"bar" => "foo",
- );
+ ];
$result = OC_Helper::mb_array_change_key_case($arrayStart);
$expected = $arrayResult;
$this->assertEquals($result, $expected);
- $arrayStart = array(
+ $arrayStart = [
"foo" => "bar",
"bar" => "foo",
- );
- $arrayResult = array(
+ ];
+ $arrayResult = [
"FOO" => "bar",
"BAR" => "foo",
- );
+ ];
$result = OC_Helper::mb_array_change_key_case($arrayStart, MB_CASE_UPPER);
$expected = $arrayResult;
$this->assertEquals($result, $expected);
}
function testRecursiveArraySearch() {
- $haystack = array(
+ $haystack = [
"Foo" => "own",
"Bar" => "Cloud",
- );
+ ];
$result = OC_Helper::recursiveArraySearch($haystack, "own");
$expected = "Foo";
function streamCopyDataProvider() {
- return array(
- array(0, false, false, false),
- array(0, false, \OC::$SERVERROOT . '/tests/data/lorem.txt', false),
- array(filesize(\OC::$SERVERROOT . '/tests/data/lorem.txt'), true, \OC::$SERVERROOT . '/tests/data/lorem.txt', \OC::$SERVERROOT . '/tests/data/lorem-copy.txt'),
- array(3670, true, \OC::$SERVERROOT . '/tests/data/testimage.png', \OC::$SERVERROOT . '/tests/data/testimage-copy.png'),
- );
+ return [
+ [0, false, false, false],
+ [0, false, \OC::$SERVERROOT . '/tests/data/lorem.txt', false],
+ [filesize(\OC::$SERVERROOT . '/tests/data/lorem.txt'), true, \OC::$SERVERROOT . '/tests/data/lorem.txt', \OC::$SERVERROOT . '/tests/data/lorem-copy.txt'],
+ [3670, true, \OC::$SERVERROOT . '/tests/data/testimage.png', \OC::$SERVERROOT . '/tests/data/testimage-copy.png'],
+ ];
}
/**
* @return mixed
* @deprecated Please extend \Test\TestCase and use self::invokePrivate() then
*/
- public static function invokePrivate($object, $methodName, array $parameters = array()) {
+ public static function invokePrivate($object, $methodName, array $parameters = []) {
return parent::invokePrivate($object, $methodName, $parameters);
}
}
public function testInterpolation() {
$logger = $this->logger;
- $logger->warning('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
+ $logger->warning('{Message {nothing} {user} {foo.bar} a}', ['user' => 'Bob', 'foo.bar' => 'Bar']);
- $expected = array('2 {Message {nothing} Bob Bar a}');
+ $expected = ['2 {Message {nothing} Bob Bar a}'];
$this->assertEquals($expected, $this->getLogs());
}
* @return array
*/
public function mailAddressProvider() {
- return array(
- array(array('lukas@owncloud.com' => 'Lukas Reschke'), array('lukas@owncloud.com' => 'Lukas Reschke')),
- array(array('lukas@owncloud.com' => 'Lukas Reschke', 'lukas@öwnclöüd.com', 'lukäs@owncloud.örg' => 'Lükäs Réschke'),
- array('lukas@owncloud.com' => 'Lukas Reschke', 'lukas@xn--wncld-iuae2c.com', 'lukäs@owncloud.xn--rg-eka' => 'Lükäs Réschke')),
- array(array('lukas@öwnclöüd.com'), array('lukas@xn--wncld-iuae2c.com')),
- );
+ return [
+ [['lukas@owncloud.com' => 'Lukas Reschke'], ['lukas@owncloud.com' => 'Lukas Reschke']],
+ [['lukas@owncloud.com' => 'Lukas Reschke', 'lukas@öwnclöüd.com', 'lukäs@owncloud.örg' => 'Lükäs Réschke'],
+ ['lukas@owncloud.com' => 'Lukas Reschke', 'lukas@xn--wncld-iuae2c.com', 'lukäs@owncloud.xn--rg-eka' => 'Lükäs Réschke']],
+ [['lukas@öwnclöüd.com'], ['lukas@xn--wncld-iuae2c.com']],
+ ];
}
/**
* @return array
*/
public function getMailAddressProvider() {
- return array(
- array(null, array()),
- array(array('lukas@owncloud.com' => 'Lukas Reschke'), array('lukas@owncloud.com' => 'Lukas Reschke')),
- );
+ return [
+ [null, []],
+ [['lukas@owncloud.com' => 'Lukas Reschke'], ['lukas@owncloud.com' => 'Lukas Reschke']],
+ ];
}
protected function setUp(): void {
* @param string $expected
*/
public function testConvertAddresses($unconverted, $expected) {
- $this->assertSame($expected, self::invokePrivate($this->message, 'convertAddresses', array($unconverted)));
+ $this->assertSame($expected, self::invokePrivate($this->message, 'convertAddresses', [$unconverted]));
}
public function testSetFrom() {
$this->swiftMessage
->expects($this->once())
->method('setFrom')
- ->with(array('lukas@owncloud.com'));
- $this->message->setFrom(array('lukas@owncloud.com'));
+ ->with(['lukas@owncloud.com']);
+ $this->message->setFrom(['lukas@owncloud.com']);
}
$this->swiftMessage
->expects($this->once())
->method('setTo')
- ->with(array('lukas@owncloud.com'));
- $this->message->setTo(array('lukas@owncloud.com'));
+ ->with(['lukas@owncloud.com']);
+ $this->message->setTo(['lukas@owncloud.com']);
}
/**
$this->swiftMessage
->expects($this->once())
->method('setCc')
- ->with(array('lukas@owncloud.com'));
- $this->message->setCc(array('lukas@owncloud.com'));
+ ->with(['lukas@owncloud.com']);
+ $this->message->setCc(['lukas@owncloud.com']);
}
/**
$this->swiftMessage
->expects($this->once())
->method('setBcc')
- ->with(array('lukas@owncloud.com'));
- $this->message->setBcc(array('lukas@owncloud.com'));
+ ->with(['lukas@owncloud.com']);
+ $this->message->setBcc(['lukas@owncloud.com']);
}
/**
return;
}
$comparator = \OC\NaturalSort::getInstance();
- usort($array, array($comparator, 'compare'));
+ usort($array, [$comparator, 'compare']);
$this->assertEquals($sorted, $array);
}
public function testDefaultCollatorCompare($array, $sorted)
{
$comparator = new \OC\NaturalSort(new \OC\NaturalSort_DefaultCollator());
- usort($array, array($comparator, 'compare'));
+ usort($array, [$comparator, 'compare']);
$this->assertEquals($sorted, $array);
}
*/
public function naturalSortDataProvider()
{
- return array(
+ return [
// different casing
- array(
+ [
// unsorted
- array(
+ [
'aaa',
'bbb',
'BBB',
'AAA'
- ),
+ ],
// sorted
- array(
+ [
'aaa',
'AAA',
'bbb',
'BBB'
- )
- ),
+ ]
+ ],
// numbers
- array(
+ [
// unsorted
- array(
+ [
'124.txt',
'abc1',
'123.txt',
'zz',
'15.txt',
'15b.txt',
- ),
+ ],
// sorted
- array(
+ [
'15.txt',
'15b.txt',
'123.txt',
'z',
'za',
'zz',
- )
- ),
+ ]
+ ],
// chinese characters
- array(
+ [
// unsorted
- array(
+ [
'十.txt',
'一.txt',
'二.txt',
'莫.txt',
'啊.txt',
'123.txt',
- ),
+ ],
// sorted
- array(
+ [
'123.txt',
'abc.txt',
'一.txt',
'波.txt',
'破.txt',
'莫.txt',
- )
- ),
+ ]
+ ],
// with umlauts
- array(
+ [
// unsorted
- array(
+ [
'öh.txt',
'Äh.txt',
'oh.txt',
'uh.txt',
'üh.txt',
'äh.txt',
- ),
+ ],
// sorted
- array(
+ [
'ah.txt',
'äh.txt',
'Äh.txt',
'üh.txt',
'Üh.txt',
'Üh 2.txt',
- )
- ),
- );
+ ]
+ ],
+ ];
}
/**
*/
public function defaultCollatorDataProvider()
{
- return array(
+ return [
// different casing
- array(
+ [
// unsorted
- array(
+ [
'aaa',
'bbb',
'BBB',
'AAA'
- ),
+ ],
// sorted
- array(
+ [
'aaa',
'AAA',
'bbb',
'BBB'
- )
- ),
+ ]
+ ],
// numbers
- array(
+ [
// unsorted
- array(
+ [
'124.txt',
'abc1',
'123.txt',
'zz',
'15.txt',
'15b.txt',
- ),
+ ],
// sorted
- array(
+ [
'15.txt',
'15b.txt',
'123.txt',
'z',
'za',
'zz',
- )
- ),
- );
+ ]
+ ],
+ ];
}
}
protected function checkAutoincrement() {
$this->connection->executeUpdate('INSERT INTO ' . $this->tableName . ' ("text") VALUES ("test")');
$insertId = $this->connection->lastInsertId();
- $this->connection->executeUpdate('DELETE FROM ' . $this->tableName . ' WHERE "someid" = ?', array($insertId));
+ $this->connection->executeUpdate('DELETE FROM ' . $this->tableName . ' WHERE "someid" = ?', [$insertId]);
// insert again
$this->connection->executeUpdate('INSERT INTO ' . $this->tableName . ' ("text") VALUES ("test2")');
$this->repair->run();
$this->assertEquals(
- array(
+ [
'step: Test Name',
'info: Simulated info',
- ),
+ ],
$this->outputArray
);
}
$this->repair->run();
$this->assertEquals(
- array(
+ [
'step: Test Name',
'warning: Simulated warning',
- ),
+ ],
$this->outputArray
);
}
$this->assertTrue($thrown);
// jump out after exception
$this->assertEquals(
- array(
+ [
'step: Exception Test',
- ),
+ ],
$this->outputArray
);
}
$this->repair->run();
$this->assertEquals(
- array(
+ [
'step: Test Name',
'warning: Simulated warning',
'step: Test Name',
'info: Simulated info',
- ),
+ ],
$this->outputArray
);
}
function testListCertificates() {
// Test empty certificate bundle
- $this->assertSame(array(), $this->certificateManager->listCertificates());
+ $this->assertSame([], $this->certificateManager->listCertificates());
// Add some certificates
$this->certificateManager->addCertificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate');
- $certificateStore = array();
+ $certificateStore = [];
$certificateStore[] = new \OC\Security\Certificate(file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'), 'GoodCertificate');
$this->assertEqualsArrays($certificateStore, $this->certificateManager->listCertificates());
public function defaultEncryptionProvider()
{
- return array(
- array('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'),
- array(''),
- array('我看这本书。 我看這本書')
- );
+ return [
+ ['Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'],
+ [''],
+ ['我看这本书。 我看這本書']
+ ];
}
/** @var Crypto */
class SecureRandomTest extends \Test\TestCase {
public function stringGenerationProvider() {
- return array(
- array(0, 0),
- array(1, 1),
- array(128, 128),
- array(256, 256),
- array(1024, 1024),
- array(2048, 2048),
- array(64000, 64000),
- );
+ return [
+ [0, 0],
+ [1, 1],
+ [128, 128],
+ [256, 256],
+ [1024, 1024],
+ [2048, 2048],
+ [64000, 64000],
+ ];
}
public static function charCombinations() {
- return array(
- array('CHAR_LOWER', '[a-z]'),
- array('CHAR_UPPER', '[A-Z]'),
- array('CHAR_DIGITS', '[0-9]'),
- );
+ return [
+ ['CHAR_LOWER', '[a-z]'],
+ ['CHAR_UPPER', '[A-Z]'],
+ ['CHAR_DIGITS', '[0-9]'],
+ ];
}
/** @var SecureRandom */
$shares = \OC\Share\Share::getItemsSharedWithUser('test', $shareWith);
- $knownTargets = array();
+ $knownTargets = [];
foreach ($shares as $share) {
$knownTargets[] = $share['item_target'];
}
}
public function formatItems($items, $format, $parameters = null) {
- $testItems = array();
+ $testItems = [];
foreach ($items as $item) {
if ($format === self::FORMAT_SOURCE) {
$testItems[] = $item['item_source'];
class HelperTest extends \Test\TestCase {
public function expireDateProvider() {
- return array(
+ return [
// no default expire date, we take the users expire date
- array(array('defaultExpireDateSet' => false), 2000000000, 2000010000, 2000010000),
+ [['defaultExpireDateSet' => false], 2000000000, 2000010000, 2000010000],
// no default expire date and no user defined expire date, return false
- array(array('defaultExpireDateSet' => false), 2000000000, null, false),
+ [['defaultExpireDateSet' => false], 2000000000, null, false],
// unenforced expire data and no user defined expire date, return false (because the default is not enforced)
- array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false), 2000000000, null, false),
+ [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false], 2000000000, null, false],
// enforced expire date and no user defined expire date, take default expire date
- array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true), 2000000000, null, 2000086400),
+ [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true], 2000000000, null, 2000086400],
// unenforced expire date and user defined date > default expire date, take users expire date
- array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false), 2000000000, 2000100000, 2000100000),
+ [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false], 2000000000, 2000100000, 2000100000],
// unenforced expire date and user expire date < default expire date, take users expire date
- array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false), 2000000000, 2000010000, 2000010000),
+ [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => false], 2000000000, 2000010000, 2000010000],
// enforced expire date and user expire date < default expire date, take users expire date
- array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true), 2000000000, 2000010000, 2000010000),
+ [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true], 2000000000, 2000010000, 2000010000],
// enforced expire date and users expire date > default expire date, take default expire date
- array(array('defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true), 2000000000, 2000100000, 2000086400),
- );
+ [['defaultExpireDateSet' => true, 'expireAfterDays' => 1, 'enforceExpireDate' => true], 2000000000, 2000100000, 2000086400],
+ ];
}
/**
}
public function dataTestSplitUserRemoteError() {
- return array(
+ return [
// Invalid path
- array('user@'),
+ ['user@'],
// Invalid user
- array('@server'),
- array('us/er@server'),
- array('us:er@server'),
+ ['@server'],
+ ['us/er@server'],
+ ['us:er@server'],
// Invalid splitting
- array('user'),
- array(''),
- array('us/erserver'),
- array('us:erserver'),
- );
+ ['user'],
+ [''],
+ ['us/erserver'],
+ ['us:erserver'],
+ ];
}
/**
$search = 'lin';
$sorter = new \OC\Share\SearchResultSorter($search, 'foobar');
- $result = array(
- array('foobar' => 'woot'),
- array('foobar' => 'linux'),
- array('foobar' => 'Linus'),
- array('foobar' => 'Bicyclerepairwoman'),
- );
+ $result = [
+ ['foobar' => 'woot'],
+ ['foobar' => 'linux'],
+ ['foobar' => 'Linus'],
+ ['foobar' => 'Bicyclerepairwoman'],
+ ];
- usort($result, array($sorter, 'sort'));
+ usort($result, [$sorter, 'sort']);
$this->assertTrue($result[0]['foobar'] === 'Linus');
$this->assertTrue($result[1]['foobar'] === 'linux');
$this->assertTrue($result[2]['foobar'] === 'Bicyclerepairwoman');
protected function tearDown(): void {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `item_type` = ?');
- $query->execute(array('test'));
+ $query->execute(['test']);
\OC::$server->getConfig()->setAppValue('core', 'shareapi_allow_resharing', $this->resharing);
$this->user1->delete();
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` ('
.' `item_type`, `item_source`, `item_target`, `share_type`,'
.' `share_with`, `uid_owner`) VALUES (?,?,?,?,?,?)');
- $args = array('test', 99, 'target1', \OCP\Share::SHARE_TYPE_USER, $this->user2->getUID(), $this->user1->getUID());
+ $args = ['test', 99, 'target1', \OCP\Share::SHARE_TYPE_USER, $this->user2->getUID(), $this->user1->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target2', \OCP\Share::SHARE_TYPE_USER, $this->user4->getUID(), $this->user1->getUID());
+ $args = ['test', 99, 'target2', \OCP\Share::SHARE_TYPE_USER, $this->user4->getUID(), $this->user1->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target3', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user2->getUID());
+ $args = ['test', 99, 'target3', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user2->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user4->getUID());
+ $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user3->getUID(), $this->user4->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user6->getUID(), $this->user4->getUID());
+ $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_USER, $this->user6->getUID(), $this->user4->getUID()];
$query->execute($args);
$result1 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user2->getUID(), $this->user1->getUID());
$this->assertSame(1, count($result1));
- $this->verifyResult($result1, array('target1'));
+ $this->verifyResult($result1, ['target1']);
$result2 = \OCP\Share::getItemSharedWithUser('test', 99, null, $this->user1->getUID());
$this->assertSame(2, count($result2));
- $this->verifyResult($result2, array('target1', 'target2'));
+ $this->verifyResult($result2, ['target1', 'target2']);
$result3 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user3->getUID());
$this->assertSame(2, count($result3));
- $this->verifyResult($result3, array('target3', 'target4'));
+ $this->verifyResult($result3, ['target3', 'target4']);
$result4 = \OCP\Share::getItemSharedWithUser('test', 99, null, null);
$this->assertSame(5, count($result4)); // 5 because target4 appears twice
- $this->verifyResult($result4, array('target1', 'target2', 'target3', 'target4'));
+ $this->verifyResult($result4, ['target1', 'target2', 'target3', 'target4']);
$result6 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user6->getUID(), null);
$this->assertSame(1, count($result6));
- $this->verifyResult($result6, array('target4'));
+ $this->verifyResult($result6, ['target4']);
}
public function testGetItemSharedWithUserFromGroupShare() {
$query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` ('
.' `item_type`, `item_source`, `item_target`, `share_type`,'
.' `share_with`, `uid_owner`) VALUES (?,?,?,?,?,?)');
- $args = array('test', 99, 'target1', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user1->getUID());
+ $args = ['test', 99, 'target1', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user1->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target2', \OCP\Share::SHARE_TYPE_GROUP, $this->group2->getGID(), $this->user1->getUID());
+ $args = ['test', 99, 'target2', \OCP\Share::SHARE_TYPE_GROUP, $this->group2->getGID(), $this->user1->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target3', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user2->getUID());
+ $args = ['test', 99, 'target3', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user2->getUID()];
$query->execute($args);
- $args = array('test', 99, 'target4', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user4->getUID());
+ $args = ['test', 99, 'target4', \OCP\Share::SHARE_TYPE_GROUP, $this->group1->getGID(), $this->user4->getUID()];
$query->execute($args);
// user2 is in group1 and group2
$result1 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user2->getUID(), $this->user1->getUID());
$this->assertSame(2, count($result1));
- $this->verifyResult($result1, array('target1', 'target2'));
+ $this->verifyResult($result1, ['target1', 'target2']);
$result2 = \OCP\Share::getItemSharedWithUser('test', 99, null, $this->user1->getUID());
$this->assertSame(2, count($result2));
- $this->verifyResult($result2, array('target1', 'target2'));
+ $this->verifyResult($result2, ['target1', 'target2']);
// user3 is in group1 and group2
$result3 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user3->getUID());
$this->assertSame(3, count($result3));
- $this->verifyResult($result3, array('target1', 'target3', 'target4'));
+ $this->verifyResult($result3, ['target1', 'target3', 'target4']);
$result4 = \OCP\Share::getItemSharedWithUser('test', 99, null, null);
$this->assertSame(4, count($result4));
- $this->verifyResult($result4, array('target1', 'target2', 'target3', 'target4'));
+ $this->verifyResult($result4, ['target1', 'target2', 'target3', 'target4']);
$result6 = \OCP\Share::getItemSharedWithUser('test', 99, $this->user6->getUID(), null);
$this->assertSame(0, count($result6));
*/
function testRemoveProtocolFromUrl($url, $expectedResult) {
$share = new \OC\Share\Share();
- $result = self::invokePrivate($share, 'removeProtocolFromUrl', array($url));
+ $result = self::invokePrivate($share, 'removeProtocolFromUrl', [$url]);
$this->assertSame($expectedResult, $result);
}
function urls() {
- return array(
- array('http://owncloud.org', 'owncloud.org'),
- array('https://owncloud.org', 'owncloud.org'),
- array('owncloud.org', 'owncloud.org'),
- );
+ return [
+ ['http://owncloud.org', 'owncloud.org'],
+ ['https://owncloud.org', 'owncloud.org'],
+ ['owncloud.org', 'owncloud.org'],
+ ];
}
/**
}
function dataProviderTestGroupItems() {
- return array(
+ return [
// one array with one share
- array(
- array( // input
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1')),
- array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1'))),
+ [
+ [ // input
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1']],
+ [ // expected result
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_ALL, 'item_target' => 't1']]],
// two shares both point to the same source
- array(
- array( // input
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
- ),
- array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
- 'grouped' => array(
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
- )
- ),
- )
- ),
+ [
+ [ // input
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+ ],
+ [ // expected result
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
+ 'grouped' => [
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+ ]
+ ],
+ ]
+ ],
// two shares both point to the same source but with different targets
- array(
- array( // input
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'),
- ),
- array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'),
- )
- ),
+ [
+ [ // input
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'],
+ ],
+ [ // expected result
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't2'],
+ ]
+ ],
// three shares two point to the same source
- array(
- array( // input
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'),
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
- ),
- array( // expected result
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
- 'grouped' => array(
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'),
- array('item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'),
- )
- ),
- array('item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'),
- )
- ),
- );
+ [
+ [ // input
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+ ['item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'],
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+ ],
+ [ // expected result
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1',
+ 'grouped' => [
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_READ, 'item_target' => 't1'],
+ ['item_source' => 1, 'permissions' => \OCP\Constants::PERMISSION_UPDATE, 'item_target' => 't1'],
+ ]
+ ],
+ ['item_source' => 2, 'permissions' => \OCP\Constants::PERMISSION_CREATE, 'item_target' => 't2'],
+ ]
+ ],
+ ];
}
}
}
public function testInstantiateWithDefaults() {
- $defaultTags = array('Friends', 'Family', 'Work', 'Other');
+ $defaultTags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
}
public function testAddTags() {
- $tags = array('Friends', 'Family', 'Work', 'Other');
+ $tags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType);
}
public function testAddMultiple() {
- $tags = array('Friends', 'Family', 'Work', 'Other');
+ $tags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType);
}
public function testGetTagsForObjects() {
- $defaultTags = array('Friends', 'Family', 'Work', 'Other');
+ $defaultTags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
$tagger->tagAs(1, 'Friends');
$tagger->tagAs(1, 'Other');
$tagger->tagAs(2, 'Family');
- $tags = $tagger->getTagsForObjects(array(1));
+ $tags = $tagger->getTagsForObjects([1]);
$this->assertEquals(1, count($tags));
$tags = current($tags);
sort($tags);
- $this->assertSame(array('Friends', 'Other'), $tags);
+ $this->assertSame(['Friends', 'Other'], $tags);
- $tags = $tagger->getTagsForObjects(array(1, 2));
+ $tags = $tagger->getTagsForObjects([1, 2]);
$this->assertEquals(2, count($tags));
$tags1 = $tags[1];
sort($tags1);
- $this->assertSame(array('Friends', 'Other'), $tags1);
- $this->assertSame(array('Family'), $tags[2]);
+ $this->assertSame(['Friends', 'Other'], $tags1);
+ $this->assertSame(['Family'], $tags[2]);
$this->assertEquals(
- array(),
- $tagger->getTagsForObjects(array(4))
+ [],
+ $tagger->getTagsForObjects([4])
);
$this->assertEquals(
- array(),
- $tagger->getTagsForObjects(array(4, 5))
+ [],
+ $tagger->getTagsForObjects([4, 5])
);
}
public function testGetTagsForObjectsMassiveResults() {
- $defaultTags = array('tag1');
+ $defaultTags = ['tag1'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
$tagData = $tagger->getTags();
$tagId = $tagData[0]['id'];
);
// insert lots of entries
- $idsArray = array();
+ $idsArray = [];
for($i = 1; $i <= 1500; $i++) {
- $statement->execute(array($i, $tagId, $tagType));
+ $statement->execute([$i, $tagId, $tagType]);
$idsArray[] = $i;
}
}
public function testDeleteTags() {
- $defaultTags = array('Friends', 'Family', 'Work', 'Other');
+ $defaultTags = ['Friends', 'Family', 'Work', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
$this->assertEquals(4, count($tagger->getTags()));
$tagger->delete('family');
$this->assertEquals(3, count($tagger->getTags()));
- $tagger->delete(array('Friends', 'Work', 'Other'));
+ $tagger->delete(['Friends', 'Work', 'Other']);
$this->assertEquals(0, count($tagger->getTags()));
}
public function testRenameTag() {
- $defaultTags = array('Friends', 'Family', 'Wrok', 'Other');
+ $defaultTags = ['Friends', 'Family', 'Wrok', 'Other'];
$tagger = $this->tagMgr->load($this->objectType, $defaultTags);
$this->assertTrue($tagger->rename('Wrok', 'Work'));
}
public function testTagAs() {
- $objids = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ $objids = [1, 2, 3, 4, 5, 6, 7, 8, 9];
$tagger = $this->tagMgr->load($this->objectType);
* @depends testTagAs
*/
public function testUnTag() {
- $objIds = array(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ $objIds = [1, 2, 3, 4, 5, 6, 7, 8, 9];
// Is this "legal"?
$this->testTagAs();
public function testFavorite() {
$tagger = $this->tagMgr->load($this->objectType);
$this->assertTrue($tagger->addToFavorites(1));
- $this->assertEquals(array(1), $tagger->getFavorites());
+ $this->assertEquals([1], $tagger->getFavorites());
$this->assertTrue($tagger->removeFromFavorites(1));
- $this->assertEquals(array(), $tagger->getFavorites());
+ $this->assertEquals([], $tagger->getFavorites());
}
public function testShareTags() {
\OC\Share\Share::shareItem('test', 1, \OCP\Share::SHARE_TYPE_USER, $otherUserId, \OCP\Constants::PERMISSION_READ);
\OC_User::setUserId($otherUserId);
- $otherTagger = $otherTagMgr->load('test', array(), true); // Update tags, load shared ones.
+ $otherTagger = $otherTagMgr->load('test', [], true); // Update tags, load shared ones.
$this->assertTrue($otherTagger->hasTag($testTag));
$this->assertContains(1, $otherTagger->getIdsForTag($testTag));
}
//disable original constructor
}
- public function log(int $level, string $message, array $context = array()) {
+ public function log(int $level, string $message, array $context = []) {
//noop
}
}
return new CSSResourceLocator(
$this->logger,
'theme',
- array('core'=>'map'),
- array('3rd'=>'party'),
+ ['core'=>'map'],
+ ['3rd'=>'party'],
$scssCacher
);
}
private function rrmdir($directory) {
- $files = array_diff(scandir($directory), array('.','..'));
+ $files = array_diff(scandir($directory), ['.','..']);
foreach ($files as $file) {
if (is_dir($directory . '/' . $file)) {
$this->rrmdir($directory . '/' . $file);
$locator = $this->cssResourceLocator();
$this->assertAttributeEquals('theme', 'theme', $locator);
$this->assertAttributeEquals('core', 'serverroot', $locator);
- $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
+ $this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
$this->assertAttributeEquals('map', 'webroot', $locator);
- $this->assertAttributeEquals(array(), 'resources', $locator);
+ $this->assertAttributeEquals([], 'resources', $locator);
}
public function testFindWithAppPathSymlink() {
];
$locator = $this->cssResourceLocator();
- $locator->find(array('test-css-app/test-file'));
+ $locator->find(['test-css-app/test-file']);
$resources = $locator->getResources();
$this->assertCount(1, $resources);
}
";
$actual = self::invokePrivate($this->iconsCacher, 'getIconsFromCss', [$css]);
- $expected = array(
+ $expected = [
'icon-test' => '/svg/core/actions/add/000?v=1'
- );
+ ];
$this->assertEquals($expected, $actual);
}
return new JSResourceLocator(
$this->logger,
'theme',
- array('core'=>'map'),
- array('3rd'=>'party'),
+ ['core'=>'map'],
+ ['3rd'=>'party'],
$jsCombiner
);
}
private function rrmdir($directory) {
- $files = array_diff(scandir($directory), array('.','..'));
+ $files = array_diff(scandir($directory), ['.','..']);
foreach ($files as $file) {
if (is_dir($directory . '/' . $file)) {
$this->rrmdir($directory . '/' . $file);
$locator = $this->jsResourceLocator();
$this->assertAttributeEquals('theme', 'theme', $locator);
$this->assertAttributeEquals('core', 'serverroot', $locator);
- $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
+ $this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
$this->assertAttributeEquals('map', 'webroot', $locator);
- $this->assertAttributeEquals(array(), 'resources', $locator);
+ $this->assertAttributeEquals([], 'resources', $locator);
}
public function testFindWithAppPathSymlink() {
];
$locator = $this->jsResourceLocator();
- $locator->find(array('test-js-app/test-file'));
+ $locator->find(['test-js-app/test-file']);
$resources = $locator->getResources();
$this->assertCount(1, $resources);
*/
public function getResourceLocator($theme, $core_map, $party_map, $appsRoots) {
return $this->getMockForAbstractClass('OC\Template\ResourceLocator',
- array($this->logger, $theme, $core_map, $party_map, $appsRoots ),
- '', true, true, true, array());
+ [$this->logger, $theme, $core_map, $party_map, $appsRoots ],
+ '', true, true, true, []);
}
public function testConstructor() {
$locator = $this->getResourceLocator('theme',
- array('core'=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
+ ['core'=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
$this->assertAttributeEquals('theme', 'theme', $locator);
$this->assertAttributeEquals('core', 'serverroot', $locator);
- $this->assertAttributeEquals(array('core'=>'map','3rd'=>'party'), 'mapping', $locator);
+ $this->assertAttributeEquals(['core'=>'map','3rd'=>'party'], 'mapping', $locator);
$this->assertAttributeEquals('3rd', 'thirdpartyroot', $locator);
$this->assertAttributeEquals('map', 'webroot', $locator);
- $this->assertAttributeEquals(array(), 'resources', $locator);
+ $this->assertAttributeEquals([], 'resources', $locator);
}
public function testFind() {
$locator = $this->getResourceLocator('theme',
- array('core' => 'map'), array('3rd' => 'party'), array('foo' => 'bar'));
+ ['core' => 'map'], ['3rd' => 'party'], ['foo' => 'bar']);
$locator->expects($this->once())
->method('doFind')
->with('foo');
->method('doFindTheme')
->with('foo');
/** @var \OC\Template\ResourceLocator $locator */
- $locator->find(array('foo'));
+ $locator->find(['foo']);
}
public function testFindNotFound() {
$locator = $this->getResourceLocator('theme',
- array('core'=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
+ ['core'=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
$locator->expects($this->once())
->method('doFind')
->with('foo')
->method('debug')
->with($this->stringContains('map/foo'));
/** @var \OC\Template\ResourceLocator $locator */
- $locator->find(array('foo'));
+ $locator->find(['foo']);
}
public function testAppendIfExist() {
$locator = $this->getResourceLocator('theme',
- array(__DIR__=>'map'), array('3rd'=>'party'), array('foo'=>'bar'));
+ [__DIR__=>'map'], ['3rd'=>'party'], ['foo'=>'bar']);
/** @var \OC\Template\ResourceLocator $locator */
$method = new \ReflectionMethod($locator, 'appendIfExist');
$method->setAccessible(true);
$method->invoke($locator, __DIR__, basename(__FILE__), 'webroot');
- $resource1 = array(__DIR__, 'webroot', basename(__FILE__));
- $this->assertEquals(array($resource1), $locator->getResources());
+ $resource1 = [__DIR__, 'webroot', basename(__FILE__)];
+ $this->assertEquals([$resource1], $locator->getResources());
$method->invoke($locator, __DIR__, basename(__FILE__));
- $resource2 = array(__DIR__, 'map', basename(__FILE__));
- $this->assertEquals(array($resource1, $resource2), $locator->getResources());
+ $resource2 = [__DIR__, 'map', basename(__FILE__)];
+ $this->assertEquals([$resource1, $resource2], $locator->getResources());
$method->invoke($locator, __DIR__, 'does-not-exist');
- $this->assertEquals(array($resource1, $resource2), $locator->getResources());
+ $this->assertEquals([$resource1, $resource2], $locator->getResources());
}
}
}
private function rrmdir($directory) {
- $files = array_diff(scandir($directory), array('.','..'));
+ $files = array_diff(scandir($directory), ['.','..']);
foreach ($files as $file) {
if (is_dir($directory . '/' . $file)) {
$this->rrmdir($directory . '/' . $file);
* @param array $parameters
* @return mixed
*/
- protected static function invokePrivate($object, $methodName, array $parameters = array()) {
+ protected static function invokePrivate($object, $methodName, array $parameters = []) {
if (is_string($object)) {
$className = $object;
} else {
* @param string $dataDir
*/
static protected function tearDownAfterClassCleanStrayDataFiles($dataDir) {
- $knownEntries = array(
+ $knownEntries = [
'nextcloud.log' => true,
'audit.log' => true,
'owncloud.db' => true,
'.ocdata' => true,
'..' => true,
'.' => true,
- );
+ ];
if ($dh = opendir($dataDir)) {
while (($file = readdir($dh)) !== false) {
$l10n
->expects($this->any())
->method('t')
- ->willReturnCallback(function($text, $parameters = array()) {
+ ->willReturnCallback(function($text, $parameters = []) {
return vsprintf($text, $parameters);
});
\OC::$server->getLogger()
);
- $this->registerStorageWrapper('oc_encryption', array($encryptionWrapper, 'wrapStorage'));
+ $this->registerStorageWrapper('oc_encryption', [$encryptionWrapper, 'wrapStorage']);
}
protected function setUpEncryptionTrait() {
$backend->expects($this->once())
->method('getUsers')
->with($this->equalTo('fo'))
- ->willReturn(array('foo', 'afoo', 'Afoo1', 'Bfoo'));
+ ->willReturn(['foo', 'afoo', 'Afoo1', 'Bfoo']);
$backend->expects($this->never())
->method('loginName2UserName');
$backend1->expects($this->once())
->method('getUsers')
->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
- ->willReturn(array('foo1', 'foo2'));
+ ->willReturn(['foo1', 'foo2']);
$backend1->expects($this->never())
->method('loginName2UserName');
$backend2->expects($this->once())
->method('getUsers')
->with($this->equalTo('fo'), $this->equalTo(3), $this->equalTo(1))
- ->willReturn(array('foo3'));
+ ->willReturn(['foo3']);
$backend2->expects($this->never())
->method('loginName2UserName');
}
public function testActiveUserAfterSetSession() {
- $users = array(
+ $users = [
'foo' => new User('foo', null, $this->createMock(EventDispatcherInterface::class)),
'bar' => new User('bar', null, $this->createMock(EventDispatcherInterface::class))
- );
+ ];
$manager = $this->getMockBuilder('\OC\User\Manager')
->disableOriginalConstructor()
* dummy group backend, does not keep state, only for testing use
*/
class Dummy extends Backend {
- private $groups=array();
+ private $groups=[];
/**
* Try to create a new group
* @param string $gid The name of the group to create
*/
public function createGroup($gid) {
if(!isset($this->groups[$gid])) {
- $this->groups[$gid]=array();
+ $this->groups[$gid]=[];
return true;
}else{
return false;
* if the user exists at all.
*/
public function getUserGroups($uid) {
- $groups=array();
+ $groups=[];
$allGroups=array_keys($this->groups);
foreach($allGroups as $group) {
if($this->inGroup($uid, $group)) {
if(empty($search)) {
return array_keys($this->groups);
}
- $result = array();
+ $result = [];
foreach(array_keys($this->groups) as $group) {
if(stripos($group, $search) !== false) {
$result[] = $group;
$length = $limit < 0 ? null : $limit;
return array_slice($this->groups[$gid], $offset, $length);
}
- $result = array();
+ $result = [];
foreach($this->groups[$gid] as $user) {
if(stripos($user, $search) !== false) {
$result[] = $user;
}
return $result;
}else{
- return array();
+ return [];
}
}
* dummy user backend, does not keep state, only for testing use
*/
class Dummy extends Backend implements \OCP\IUserBackend {
- private $users = array();
- private $displayNames = array();
+ private $users = [];
+ private $displayNames = [];
/**
* Create a new user
if (empty($search)) {
return array_keys($this->users);
}
- $result = array();
+ $result = [];
foreach (array_keys($this->users) as $user) {
if (stripos($user, $search) !== false) {
$result[] = $user;
* Test that checkServer() returns no errors in the regular case.
*/
public function testCheckServer() {
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => true
- )));
+ ]));
$this->assertEmpty($result);
}
// even though ".ocdata" is missing, the error isn't
// triggered to allow setup to run
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => false
- )));
+ ]));
$this->assertEmpty($result);
}
$oldCurrentVersion = $session->get('OC_Version');
// upgrade condition to simulate needUpgrade() === true
- $session->set('OC_Version', array(6, 0, 0, 2));
+ $session->set('OC_Version', [6, 0, 0, 2]);
// even though ".ocdata" is missing, the error isn't
// triggered to allow for upgrade
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => true,
'version' => '6.0.0.1'
- )));
+ ]));
$this->assertEmpty($result);
// restore versions
$result = \OC_Util::checkDataDirectoryValidity($this->datadir);
$this->assertEquals(1, count($result));
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => true,
'version' => implode('.', \OCP\Util::getVersion())
- )));
+ ]));
$this->assertCount(1, $result);
}
* Tests that no error is given when the datadir is writable
*/
public function testDataDirWritable() {
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => true,
'version' => implode('.', \OCP\Util::getVersion())
- )));
+ ]));
$this->assertEmpty($result);
}
$this->markTestSkipped('TODO: Disable because fails on drone');
chmod($this->datadir, 0300);
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => true,
'version' => implode('.', \OCP\Util::getVersion())
- )));
+ ]));
$this->assertCount(1, $result);
}
*/
public function testDataDirNotWritableSetup() {
chmod($this->datadir, 0300);
- $result = \OC_Util::checkServer($this->getConfig(array(
+ $result = \OC_Util::checkServer($this->getConfig([
'installed' => false,
'version' => implode('.', \OCP\Util::getVersion())
- )));
+ ]));
chmod($this->datadir, 0700); //needed for cleanup
$this->assertEmpty($result);
}
}
public function dataProviderForTestIsSharingDisabledForUser() {
- return array(
+ return [
// existing groups, groups the user belong to, groups excluded from sharing, expected result
- array(array('g1', 'g2', 'g3'), array(), array('g1'), false),
- array(array('g1', 'g2', 'g3'), array(), array(), false),
- array(array('g1', 'g2', 'g3'), array('g2'), array('g1'), false),
- array(array('g1', 'g2', 'g3'), array('g2'), array(), false),
- array(array('g1', 'g2', 'g3'), array('g1', 'g2'), array('g1'), false),
- array(array('g1', 'g2', 'g3'), array('g1', 'g2'), array('g1', 'g2'), true),
- array(array('g1', 'g2', 'g3'), array('g1', 'g2'), array('g1', 'g2', 'g3'), true),
- );
+ [['g1', 'g2', 'g3'], [], ['g1'], false],
+ [['g1', 'g2', 'g3'], [], [], false],
+ [['g1', 'g2', 'g3'], ['g2'], ['g1'], false],
+ [['g1', 'g2', 'g3'], ['g2'], [], false],
+ [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1'], false],
+ [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1', 'g2'], true],
+ [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1', 'g2', 'g3'], true],
+ ];
}
/**
}
function defaultAppsProvider() {
- return array(
+ return [
// none specified, default to files
- array(
+ [
'',
'index.php/apps/files/',
- array('files'),
- ),
+ ['files'],
+ ],
// unexisting or inaccessible app specified, default to files
- array(
+ [
'unexist',
'index.php/apps/files/',
- array('files'),
- ),
+ ['files'],
+ ],
// non-standard app
- array(
+ [
'calendar',
'index.php/apps/calendar/',
- array('files', 'calendar'),
- ),
+ ['files', 'calendar'],
+ ],
// non-standard app with fallback
- array(
+ [
'contacts,calendar',
'index.php/apps/calendar/',
- array('files', 'calendar'),
- ),
- );
+ ['files', 'calendar'],
+ ],
+ ];
}
public function testGetDefaultPageUrlWithRedirectUrlWithoutFrontController() {
$this->assertFalse(\OCP\Util::needUpgrade());
$config->setSystemValue('version', '7.0.0.0');
- \OC::$server->getSession()->set('OC_Version', array(7, 0, 0, 1));
- self::invokePrivate(new \OCP\Util, 'needUpgradeCache', array(null));
+ \OC::$server->getSession()->set('OC_Version', [7, 0, 0, 1]);
+ self::invokePrivate(new \OCP\Util, 'needUpgradeCache', [null]);
$this->assertTrue(\OCP\Util::needUpgrade());
$config->setSystemValue('version', $oldConfigVersion);
\OC::$server->getSession()->set('OC_Version', $oldSessionVersion);
- self::invokePrivate(new \OCP\Util, 'needUpgradeCache', array(null));
+ self::invokePrivate(new \OCP\Util, 'needUpgradeCache', [null]);
$this->assertFalse(\OCP\Util::needUpgrade());
}
if (getenv('OBJECT_STORE') === 's3') {
$CONFIG['objectstore'] = [
'class' => 'OC\\Files\\ObjectStore\\S3',
- 'arguments' => array(
+ 'arguments' => [
'bucket' => 'nextcloud',
'autocreate' => true,
'key' => 'dummy',
'use_ssl' => false,
// required for some non amazon s3 implementations
'use_path_style' => true
- )
+ ]
];
}
if (getenv('OBJECT_STORE') === 'swift') {
if (getenv('SWIFT-AUTH') === 'v2.0') {
$CONFIG['objectstore'] = [
'class' => 'OC\\Files\\ObjectStore\\Swift',
- 'arguments' => array(
+ 'arguments' => [
'autocreate' => true,
'username' => 'swift',
'tenantName' => 'service',
'region' => 'regionOne',
'url' => "http://$swiftHost:5000/v2.0",
'bucket' => 'nextcloud'
- )
+ ]
];
} else {
$CONFIG['objectstore'] = [
'class' => 'OC\\Files\\ObjectStore\\Swift',
- 'arguments' => array(
+ 'arguments' => [
'autocreate' => true,
'user' => [
'name' => 'swift',
'region' => 'regionOne',
'url' => "http://$swiftHost:5000/v3",
'bucket' => 'nextcloud'
- )
+ ]
];
}
}
if (getenv('OBJECT_STORE') === 'azure') {
$CONFIG['objectstore'] = [
'class' => 'OC\\Files\\ObjectStore\\Azure',
- 'arguments' => array(
+ 'arguments' => [
'container' => 'test',
'account_name' => 'devstoreaccount1',
'account_key' => 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==',
'endpoint' => 'http://' . (getenv('DRONE') === 'true' ? 'azurite' : 'localhost') . ':10000/devstoreaccount1',
'autocreate' => true
- )
+ ]
];
}
// between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel
// when updating major/minor version number.
-$OC_Version = array(19, 0, 0, 0);
+$OC_Version = [19, 0, 0, 0];
// The human readable string
$OC_VersionString = '19.0.0 alpha';