Skip to content
Snippets Groups Projects
Select Git revision
  • dc116b994d7749a2c0cb2c3c1f0f5ad8f028a3d0
  • master default protected
2 results

log.php

Blame
  • app.php 21.62 KiB
    <?php
    /**
     * ownCloud
     *
     * @author Frank Karlitschek
     * @author Jakob Sack
     * @copyright 2012 Frank Karlitschek frank@owncloud.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 $activeapp = '';
    	static private $navigation = array();
    	static private $settingsForms = array();
    	static private $adminForms = array();
    	static private $personalForms = array();
    	static private $appInfo = array();
    	static private $appTypes = array();
    	static private $loadedApps = array();
    	static private $checkedApps = array();
    
    	/**
    	 * @brief loads all apps
    	 * @param array $types
    	 * @return bool
    	 *
    	 * 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.
    	 *
    	 * if $types is set, only apps of those types will be loaded
    	 */
    	public static function loadApps($types=null) {
    		// Load the enabled apps here
    		$apps = self::getEnabledApps();
    		// prevent app.php from printing output
    		ob_start();
    		foreach( $apps as $app ) {
    			if((is_null($types) or self::isType($app, $types)) && !in_array($app, self::$loadedApps)) {
    				self::loadApp($app);
    				self::$loadedApps[] = $app;
    			}
    		}
    		ob_end_clean();
    
    		if (!defined('DEBUG') || !DEBUG) {
    			if (is_null($types)
    			    && empty(OC_Util::$core_scripts) 
    			    && empty(OC_Util::$core_styles)) {
    				OC_Util::$core_scripts = OC_Util::$scripts;
    				OC_Util::$scripts = array();
    				OC_Util::$core_styles = OC_Util::$styles;