Select Git revision
app.php 12.03 KiB
<?php
/**
* ownCloud
*
* @author Frank Karlitschek
* @author Jakob Sack
* @copyright 2010 Frank Karlitschek karlitschek@kde.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* This class manages the apps. It allows them to register and integrate in the
* owncloud ecosystem. Furthermore, this class is responsible for installing,
* upgrading and removing apps.
*/
class OC_App{
static private $init = false;
static private $apps = array();
static private $activeapp = '';
static private $navigation = array();
static private $settingsForms = array();
static private $adminForms = array();
static private $personalForms = array();
/**
* @brief loads all apps
* @returns true/false
*
* This function walks through the owncloud directory and loads all apps
* it can find. A directory contains an app if the file /appinfo/app.php
* exists.
*/
public static function loadApps(){
// Did we allready load everything?
if( self::$init ){
return true;
}
// Our very own core apps are hardcoded
foreach( array('files', 'settings') as $app ){
require( $app.'/appinfo/app.php' );
}
// The rest comes here
$apps = OC_Appconfig::getApps();
foreach( $apps as $app ){
if( self::isEnabled( $app )){
if(is_file(OC::$SERVERROOT.'/apps/'.$app.'/appinfo/app.php')){
require( 'apps/'.$app.'/appinfo/app.php' );
}
}
}
self::$init = true;
// return
return true;