z4k
1
Hi everyone
I would like to create a command for my app and I searched in the official developer documentation and I found nothing on this subject Search — Nextcloud latest Developer Manual latest documentation
So, I looked in these repositories :
- groupfolders/FolderCommand.php at master · nextcloud/groupfolders · GitHub
- circles/CirclesRemote.php at stable25 · nextcloud/circles · GitHub
- spreed/ListCommand.php at master · nextcloud/spreed · GitHub
And I saw you use the private API OC\Core\Command\Base
.
As a community developer, I cannot use this API.
How do I create a command with a public API ? Do I have to use this private API ?
Thanks in advance
tcit
2
I’m guessing there’s something extra in OC\Core\Command\Base
that’s not been published to the public API, but that’s definitely not normal.
Here is an example of a command using only the public API:
z4k
3
That’s exactly what I thought…
May be for the community, we have to use Symfony\Component\Console\Command\Command
?
May be I will ask the chat directly
Thanks @tcit for your answer
tcit
4
Yes, there’s not much added value to inherit the Base
class anyway:
1 Like
Do you need any special functions from your command? I found another app that uses only the public API: server/info.xml at 38aaab3fbf68db0b0b5da14fb17a8bf1dfee5f5d · nextcloud/server · GitHub
Does this help you?
1 Like
z4k
6
Hi @tcit and @christianlupus
I’m sorry for the delay in replying
I paused this task because I worked on another one.
I will test on my project later ^^
Thank you for your help