Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
6ba23912
Commit
6ba23912
authored
11 years ago
by
Thomas Tanghus
Browse files
Options
Downloads
Patches
Plain Diff
Add getUserFolder/getAppFolder to Server.
parent
415a27c1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/public/iservercontainer.php
+14
-0
14 additions, 0 deletions
lib/public/iservercontainer.php
lib/server.php
+35
-0
35 additions, 0 deletions
lib/server.php
with
49 additions
and
0 deletions
lib/public/iservercontainer.php
+
14
−
0
View file @
6ba23912
...
...
@@ -62,6 +62,20 @@ interface IServerContainer {
*/
function
getRootFolder
();
/**
* Returns a view to ownCloud's files folder
*
* @return \OCP\Files\Folder
*/
function
getUserFolder
();
/**
* Returns an app-specific view in ownClouds data directory
*
* @return \OCP\Files\Folder
*/
function
getAppFolder
();
/**
* Returns the current session
*
...
...
This diff is collapsed.
Click to expand it.
lib/server.php
+
35
−
0
View file @
6ba23912
...
...
@@ -56,6 +56,17 @@ class Server extends SimpleContainer implements IServerContainer {
$view
=
new
View
();
return
new
Root
(
$manager
,
$view
,
$user
);
});
$this
->
registerService
(
'CustomFolder'
,
function
(
$c
)
{
$dir
=
$c
[
'CustomFolderPath'
];
$root
=
$this
->
getRootFolder
();
$folder
=
null
;
if
(
!
$root
->
nodeExists
(
$dir
))
{
$folder
=
$root
->
newFolder
(
$dir
);
}
else
{
$folder
=
$root
->
get
(
$dir
);
}
return
$folder
;
});
}
/**
...
...
@@ -97,6 +108,30 @@ class Server extends SimpleContainer implements IServerContainer {
return
$this
->
query
(
'RootFolder'
);
}
/**
* Returns a view to ownCloud's files folder
*
* @return \OCP\Files\Folder
*/
function
getUserFolder
()
{
$this
->
registerParameter
(
'CustomFolderPath'
,
'/files'
);
return
$this
->
query
(
'CustomFolder'
);
}
/**
* Returns an app-specific view in ownClouds data directory
*
* @return \OCP\Files\Folder
*/
function
getAppFolder
()
{
$this
->
registerParameter
(
'CustomFolderPath'
,
'/'
.
\OC_App
::
getCurrentApp
());
return
$this
->
query
(
'CustomFolder'
);
}
/**
* Returns the current session
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment