Commit Graph

76 Commits

Author SHA1 Message Date
Lukas Reschke c353d51810 Remove Scrutinizer Auto Fixer 2016-03-01 17:48:23 +01:00
Lukas Reschke 933f60e314 Update author information
Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
2016-03-01 17:25:15 +01:00
Roeland Jago Douma 7abb8693a1 getRootFolder should not setup the FS for any user
Fixes #22467

This can go wrong when an app (take the ldap app) DIs something that
needs the rootFolder. This break if we use cookie auth since then we
know the user at that point and thus try to setup the fs for that user.

However if there are then incomming shares from an ldap user they will
fails since the user manager can't find them yet.

Now getRootFolder does not setup the fs for any user.
2016-02-18 13:55:54 +01:00
Robin Appelman 99415a9f7f multiple minor fies 2016-01-20 16:32:52 +01:00
Robin Appelman fd37e72ee9 use getmountmanager 2016-01-20 16:30:22 +01:00
Robin Appelman cf6ee1c866 cache mountpoints in the db 2016-01-20 16:30:22 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Scrutinizer Auto-Fixer 453e1bf66e Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 15:43:36 +00:00
Morris Jobke baecfc4080 Reduce OC_Config usage in lib/
* replaced by proper public interfaces
2015-12-02 14:49:40 +01:00
Lukas Reschke 13e817e901 Throw exception on `getPath` if file does not exist
Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.

This is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.

While one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.

I also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.
2015-10-25 17:58:21 +01:00
Robin Appelman faf642c31d expose the mount manager in the public api 2015-07-01 15:57:04 +02:00
Morris Jobke f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
Morris Jobke 5f59393b30 Merge pull request #17110 from owncloud/share-error-handling
[sharing] handle shares of users that aren't available anymore
2015-06-24 17:38:34 +02:00
Morris Jobke 4f2f8a6f28 [sharing] handle shares of users that aren't available anymore
* properly handle the case where an abandoned share is left and
  simply skip it
2015-06-23 18:22:36 +02:00
Morris Jobke fdd01cf15c Added error message on initMountpoints exception 2015-06-23 09:54:03 +02:00
Robin Appelman 8926bca0c7 phpdoc, strict and type hints 2015-06-02 14:07:55 +02:00
Robin Appelman 6f47a547d8 only use mount provider if we have a valid user 2015-06-02 14:07:54 +02:00
Robin Appelman 24131586d7 call mount providers that are registered after the filesystem is setup 2015-06-02 14:07:54 +02:00
Jörn Friedrich Dreyer b069f33a72 throw exception when backends don't provide a user instead of creating legacy local storages 2015-04-10 09:12:37 +02:00
Robin Appelman f585994c4b setup mount manager before wrappers 2015-04-02 13:28:36 +02:00
Robin Appelman cb9ead7dde add priority to storage wrappers 2015-03-26 21:26:38 +01:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Morris Jobke 82254ad5ef Merge pull request #13893 from owncloud/create-cachedir-on-user
Only make sure the cache directory exists when we use it
2015-03-11 16:49:24 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Lukas Reschke 9904b30070 Ensure that passed argument is always a string
Some code paths called the `normalizePath` functionality with types other than a string which resulted in unexpected behaviour.

Thus the function is now manually casting the type to a string and I corrected the usage in list.php as well.
2015-02-13 12:49:34 +01:00
Lukas Reschke 4d91fa4c93 Normalize before processing 2015-02-06 15:03:29 +01:00
Robin Appelman 4a9c64e96b Only make sure the cache directory exists when we use it 2015-02-04 16:52:50 +01:00
Robin Appelman ddee63fa00 Fix resolving paths for views rooted in a file 2015-01-29 12:47:11 +01:00
Robin Appelman 960ff4f136 Apply wrappers to existing mounts before registering it 2015-01-23 13:48:35 +01:00
Vincent Petry 5fb8a4715d removeStorageWrapper to unregister a storage wrapper 2015-01-23 12:20:54 +01:00
Vincent Petry 6fb553e92c Do not call wrapStorage if storate with same name added twice 2015-01-22 16:24:24 +01:00
Lukas Reschke f0ac8a278a Use json_encode on string
It's better to encode the string to prevent possible (yet unknown) bugs in combination with PHP's type juggling.

Previously the boolean statements evaluated to either an empty string (false) or a not empty one (true, then it was 1). Not it always evaluates to false or true.

This also removes a stray - that was not intended there but shouldn't have produced any bugs. Just to increase readability.

Thanks @nickvergessen for spotting.

Addresses https://github.com/owncloud/core/pull/13235/files#r22852319
2015-01-13 11:08:18 +01:00
Morris Jobke c91d47e5b3 Merge pull request #13224 from owncloud/simplify-is-valid-path-and-add-unit-tests
Simplify isValidPath and add unit tests
2015-01-10 17:35:40 +01:00
Lukas Reschke 7e11ca06f6 Cache results of `normalizePath`
`normalizePath` is a rather expensive operation and called multiple times for a single path for every file related operation.

In my development installation with about 9GB of data and 60k files this leads to a performance boost of 24% - in seconds that are 1.86s (!) - for simple searches. With more files the impact will be even more noticeable. Obviously this affects every operation that has in any regard something to do with using OC\Files\Filesystem.

Part of https://github.com/owncloud/core/issues/13221
2015-01-10 11:10:38 +01:00
Lukas Reschke 05615bfd47 Simplify isValidPath and add unit tests
The check for invalid paths is actually over-complicated and performed twice resulting in a performance penalty. Additionally, I decided to add unit-tests to that function.

Part of https://github.com/owncloud/core/issues/13221
2015-01-10 00:40:21 +01:00
Vincent Petry 15ecb28d50 Make $userId mandatory for searchByTags
$userId is now a mandatory parameter for searchByTags.

Also fixed some places in the code where the argument was missing (Node
API and View)
2014-12-12 11:18:35 +01:00
Vincent Petry 25dde7e93b Added searchByTags to view, storage and cache 2014-12-11 17:38:50 +01:00
Robin Appelman f4701d7721 Add public api for mount configurations 2014-12-04 16:47:27 +01:00
Joas Schilling 0ab973a3a6 Make it possible to cleanPath() absolute Windows paths 2014-11-17 10:48:15 +01:00
Robin Appelman 2974d4d380 Reset the users setup after clearing mounts 2014-10-28 15:13:29 +01:00
Robin Appelman 3f63f4b6b1 Only mount the storages for the user once 2014-10-27 18:50:28 +01:00
Vincent Petry 6585eaa5df Added failing unit tests for mount config hooks 2014-10-08 14:22:17 +02:00
Robin Appelman a9a37b5363 Don't automatically setup the filesystem the moment we load OC\Files\FileSystem 2014-09-02 16:15:42 +02:00
Morris Jobke b3b3354809 move to public namespace 2014-08-19 14:05:08 +02:00
Stephan Peijnik 5d7deefd95 Use tabs for indentation.
Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com>
2014-08-19 13:55:43 +02:00
Stephan Peijnik 2df52e54d7 Fix STORAGE_* constants usage by moving those constants into \OC\Files\Filesystem.
As constants not defined within a class cannot be automatically found by the
autoloader moving those constants into a class makes them accessible to
code which uses them.

Signed-off-by: Stephan Peijnik <speijnik@anexia-it.com>
2014-08-19 13:55:35 +02:00
Jörn Friedrich Dreyer 5cae863408 change architecture from inheritance to composition 2014-06-18 12:53:20 +02:00
Jörn Friedrich Dreyer 4e65889f54 only use one config option 'objectstore' for root and home storage configuration 2014-06-18 12:53:20 +02:00
Jörn Friedrich Dreyer 10de4a7b90 move creation of / and users 'files' from storage constructor to setupFS / mount initialization 2014-06-18 12:53:20 +02:00