Use appinfo/register_command.php to add commands to the console command
This commit is contained in:
parent
44b3e71ed4
commit
666bbbe060
3 changed files with 25 additions and 2 deletions
9
apps/files/appinfo/register_command.php
Normal file
9
apps/files/appinfo/register_command.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
$application->add(new OCA\Files\Command\Scan(OC_User::getManager()));
|
|
@ -25,6 +25,11 @@ if (!OC::$CLI) {
|
|||
|
||||
$defaults = new OC_Defaults;
|
||||
$application = new Application($defaults->getName(), \OC_Util::getVersionString());
|
||||
$application->add(new OC\Core\Command\Status);
|
||||
$application->add(new OCA\Files\Command\Scan(OC_User::getManager()));
|
||||
require_once 'core/register_command.php';
|
||||
foreach(OC_App::getEnabledApps() as $app) {
|
||||
$file = OC_App::getAppPath($app).'/appinfo/register_command.php';
|
||||
if(file_exists($file)) {
|
||||
require $file;
|
||||
}
|
||||
}
|
||||
$application->run();
|
||||
|
|
9
core/register_command.php
Normal file
9
core/register_command.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
|
||||
$application->add(new OC\Core\Command\Status);
|
Loading…
Reference in a new issue