Skip to content

Instantly share code, notes, and snippets.

@bartv2
Created September 16, 2013 20:30
Show Gist options
  • Save bartv2/6586173 to your computer and use it in GitHub Desktop.
Save bartv2/6586173 to your computer and use it in GitHub Desktop.
owncloud public app interface
<?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.
*/
namespace OCP\App;
/**
* Provide a common interface to all Application functions
*/
interface Info {
/**
* @brief Get the name of the app.
*
* @return string
*/
public function getName();
/**
* @brief Get the last version of the app. Either from appinfo/version or from appinfo/info.xml
*
* @return string for example '1.2.45'
*/
public function getVersion();
/**
* @brief Get the directory for the given app.
* If the app is defined in multiple directories, the first one is taken. (false if not found)
*
* @return string
*/
public function getDirectory();
/**
* @brief Get the web path of the app.
* If the app is defined in multiple directories, the first one is taken. (false if not found)
*
* @return string
*/
public function getWebPath();
}
<?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.
*/
namespace OCP\App;
/**
* Provide a common interface to all Application functions
*/
interface Manager {
/**
* @brief checks whether or not an app is enabled
* @param $app string appid
* @returns bool true when an app is enabled.
*/
public function isEnabled( $app );
/**
* @brief load all enabled apps
*/
public function loadAll();
/**
* @brief Get information about the app
* @param $app string appid
*
* @return \OCP\App\Info
*/
public function getInfo( $app );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment