* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
use Symfony\Component\Console\Application;
$RUNTIME_NOAPPS = true;
require_once 'lib/base.php';
// Don't do anything if ownCloud has not been installed yet
if (!OC_Config::getValue('installed', false)) {
echo "Console can only be used once ownCloud has been installed" . PHP_EOL;
exit(0);
}
if (!OC::$CLI) {
echo "This script can be run from the command line only" . PHP_EOL;
exit(0);
}
$defaults = new OC_Defaults;
$application = new Application($defaults->getName(), \OC_Util::getVersionString());
require_once 'core/register_command.php';
foreach(OC_App::getAllApps() as $app) {
$file = OC_App::getAppPath($app).'/appinfo/register_command.php';
if(file_exists($file)) {
require $file;
}
}
$application->run();
lease/v1.10'>release/v1.10
Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD: https://github.com/go-gitea/gitea
// Copyright 2017 The Gitea Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packageutilimport"sort"// Int64Slice attaches the methods of Interface to []int64, sorting in increasing order.typeInt64Slice[]int64func(pInt64Slice)Len()int{returnlen(p)}func(pInt64Slice)Less(i,jint)bool{returnp[i]<p[j]}func(pInt64Slice)Swap(i,jint){p[i],p[j]=p[j],p[i]}// IsSliceInt64Eq returns if the two slice has the same elements but different sequences.funcIsSliceInt64Eq(a,b[]int64)bool{iflen(a)!=len(b){returnfalse}sort.Sort(Int64Slice(a))sort.Sort(Int64Slice(b))fori:=0;i<len(a);i++{ifa[i]!=b[i]{returnfalse}}returntrue}// ExistsInSlice returns true if string exists in slice.funcExistsInSlice(targetstring,slice[]string)bool{i:=sort.Search(len(slice),func(iint)bool{returnslice[i]==target})returni<len(slice)}// IsStringInSlice sequential searches if string exists in slice.funcIsStringInSlice(targetstring,slice[]string)bool{fori:=0;i<len(slice);i++{ifslice[i]==target{returntrue}}returnfalse}// IsEqualSlice returns true if slices are equal.funcIsEqualSlice(target[]string,source[]string)bool{iflen(target)!=len(source){returnfalse}if(target==nil)!=(source==nil){returnfalse}sort.Strings(target)sort.Strings(source)fori,v:=rangetarget{ifv!=source[i]{returnfalse}}returntrue}