diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php
old mode 100644
new mode 100755
index f282b103c87d29abc4f4485103937d6674f0128c..72d368a085efa3d7b252b206e80300b2071dac31
--- a/apps/admin_dependencies_chk/appinfo/app.php
+++ b/apps/admin_dependencies_chk/appinfo/app.php
@@ -1,9 +1,9 @@
 <?php
 $l=OC_L10N::get('admin_dependencies_chk');
 
-OC_App::register( array( 
+OCP\App::register( array( 
   'order' => 14,
   'id' => 'admin_dependencies_chk',
   'name' => 'Owncloud Install Info' ));
 
-OC_APP::registerAdmin('admin_dependencies_chk','settings');
+OCP\App::registerAdmin('admin_dependencies_chk','settings');
diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php
old mode 100644
new mode 100755
index 0cebc10198f00f2cec8c20e59333299944ea9e77..f4915c3d2fe7c7871c4d8e047a06723796d638f5
--- a/apps/admin_dependencies_chk/settings.php
+++ b/apps/admin_dependencies_chk/settings.php
@@ -77,7 +77,7 @@ $modules[] =array(
 foreach($modules as $key => $module) {
 	$enabled = false ;
 	foreach($module['modules'] as $app) {
-		if(OC_App::isEnabled($app) || $app=='core'){
+		if(OCP\App::isEnabled($app) || $app=='core'){
 				$enabled = true;
 		}
 	}
diff --git a/apps/admin_migrate/appinfo/app.php b/apps/admin_migrate/appinfo/app.php
index 07672da6dae3e7215813148a57239c8c695fa458..7a12a32856dbdb59f33c379abd6610ab06b134e1 100755
--- a/apps/admin_migrate/appinfo/app.php
+++ b/apps/admin_migrate/appinfo/app.php
@@ -22,7 +22,7 @@
 */
 
 
-OC_APP::registerAdmin('admin_migrate','settings');
+OCP\App::registerAdmin('admin_migrate','settings');
 
 // add settings page to navigation
 $entry = array(
diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php
index 246a0d0ecd769587433b01ca32f2af2ff9abb4ab..8a8f443891c11fb0407d11b746978ec279fab795 100755
--- a/apps/bookmarks/appinfo/app.php
+++ b/apps/bookmarks/appinfo/app.php
@@ -10,12 +10,12 @@
 OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php';
 OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php';
 
-OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
+OCP\App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' ));
 
 $l = new OC_l10n('bookmarks');
-OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks')));
+OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks')));
 
-OC_App::registerPersonal('bookmarks', 'settings');
+OCP\App::registerPersonal('bookmarks', 'settings');
 OCP\Util::addscript('bookmarks','bookmarksearch');
 
 OC_Search::registerProvider('OC_Search_Provider_Bookmarks');
diff --git a/apps/bookmarks/index.php b/apps/bookmarks/index.php
index 7ab74c5f3f31427e48f103ea6b03e02fa3a0bfab..bfac1d29343012220c0ce648e6cb16ec4ed5f0c9 100755
--- a/apps/bookmarks/index.php
+++ b/apps/bookmarks/index.php
@@ -27,7 +27,7 @@
 OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('bookmarks');
 
-OC_App::setActiveNavigationEntry( 'bookmarks_index' );
+OCP\App::setActiveNavigationEntry( 'bookmarks_index' );
 
 OCP\Util::addscript('bookmarks','bookmarks');
 OCP\Util::addStyle('bookmarks', 'bookmarks');
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php
index cf1325fad7ad71e28d653e13325f5e04a79378b2..7b5db834fb5838ca4bd050b8a2510b6fa13edc8a 100755
--- a/apps/calendar/appinfo/app.php
+++ b/apps/calendar/appinfo/app.php
@@ -11,15 +11,15 @@ OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser'
 OCP\Util::addscript('calendar','loader');
 OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min");
 OCP\Util::addStyle("3rdparty", "chosen/chosen");
-OC_App::register( array(
+OCP\App::register( array(
   'order' => 10,
   'id' => 'calendar',
   'name' => 'Calendar' ));
-OC_App::addNavigationEntry( array(
+OCP\App::addNavigationEntry( array(
   'id' => 'calendar_index',
   'order' => 10,
   'href' => OCP\Util::linkTo( 'calendar', 'index.php' ),
   'icon' => OCP\Util::imagePath( 'calendar', 'icon.svg' ),
   'name' => $l->t('Calendar')));
-OC_App::registerPersonal('calendar', 'settings');
+OCP\App::registerPersonal('calendar', 'settings');
 OC_Search::registerProvider('OC_Search_Provider_Calendar');
diff --git a/apps/calendar/index.php b/apps/calendar/index.php
index 77550420b53bada896f35d6bfa845bffab529bb8..0a77bdbf2ba82cbfead6f2d12e650730f19346a6 100755
--- a/apps/calendar/index.php
+++ b/apps/calendar/index.php
@@ -52,7 +52,7 @@ OCP\Util::addscript('', 'jquery.multiselect');
 OCP\Util::addStyle('', 'jquery.multiselect');
 OCP\Util::addscript('contacts','jquery.multi-autocomplete');
 OCP\Util::addscript('','oc-vcategories');
-OC_App::setActiveNavigationEntry('calendar_index');
+OCP\App::setActiveNavigationEntry('calendar_index');
 $tmpl = new OC_Template('calendar', 'calendar', 'user');
 $tmpl->assign('eventSources', $eventSources);
 $tmpl->assign('categories', $categories);
diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php
index fae2da3b0299b99bf2ca81a5595493502bf407cb..3291e505249b1c3437c992255bef428e9de75f1e 100755
--- a/apps/calendar/lib/search.php
+++ b/apps/calendar/lib/search.php
@@ -2,7 +2,7 @@
 class OC_Search_Provider_Calendar extends OC_Search_Provider{
 	function search($query){
 		$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
-		if(count($calendars)==0 || !OC_App::isEnabled('calendar')){
+		if(count($calendars)==0 || !OCP\App::isEnabled('calendar')){
 			//return false;
 		}
 		$results=array();
diff --git a/apps/contacts/ajax/uploadimport.php b/apps/contacts/ajax/uploadimport.php
index e2bc6d7290b47198bf7db9a06224281a7e8f3647..51ae949b68073a81de72a76232d7f517fc850ca0 100755
--- a/apps/contacts/ajax/uploadimport.php
+++ b/apps/contacts/ajax/uploadimport.php
@@ -34,7 +34,7 @@ function debug($msg) {
 	OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::DEBUG);
 }
 
-$view = OC_App::getStorage('contacts');
+$view = OCP\App::getStorage('contacts');
 $tmpfile = md5(rand());
 
 // If it is a Drag'n'Drop transfer it's handled here.
diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php
index 87c369597434a8edccf38be9041040b21f18fb08..4808ea5fa835d872ba44b98d92b418f7bca49dd1 100755
--- a/apps/contacts/appinfo/app.php
+++ b/apps/contacts/appinfo/app.php
@@ -9,12 +9,12 @@ OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser'
 OC_HOOK::connect('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents');
 OC_HOOK::connect('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources');
 
-OC_App::register( array(
+OCP\App::register( array(
   'order' => 10,
   'id' => 'contacts',
   'name' => 'Contacts' ));
 
-OC_App::addNavigationEntry( array(
+OCP\App::addNavigationEntry( array(
   'id' => 'contacts_index',
   'order' => 10,
   'href' => OCP\Util::linkTo( 'contacts', 'index.php' ),
@@ -22,6 +22,6 @@ OC_App::addNavigationEntry( array(
   'name' => OC_L10N::get('contact')->t('Contacts') ));
 
 
-OC_APP::registerPersonal('contacts','settings');
+OCP\App::registerPersonal('contacts','settings');
 OCP\Util::addscript('contacts', 'loader');
 OC_Search::registerProvider('OC_Search_Provider_Contacts');
diff --git a/apps/contacts/import.php b/apps/contacts/import.php
index 95f17a8896f10ff7badb785dd2dbb6d9dd5db223..9355f8b9f70da132f22a369356d5a5a9b432679a 100755
--- a/apps/contacts/import.php
+++ b/apps/contacts/import.php
@@ -19,7 +19,7 @@ if(is_writable('import_tmp/')){
 }
 $view = $file = null;
 if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
-	$view = OC_App::getStorage('contacts');
+	$view = OCP\App::getStorage('contacts');
 	$file = $view->file_get_contents('/' . $_POST['file']);
 } else {
 	$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']);
diff --git a/apps/contacts/index.php b/apps/contacts/index.php
index c018fca764abadba8a689dbb8257764cf8ba9345..8e3c2faf012b74f3a69e134d5848b570aec8f4d9 100755
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -19,7 +19,7 @@ $contacts = OC_Contacts_VCard::all($ids);
 $addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
 
 // Load the files we need
-OC_App::setActiveNavigationEntry( 'contacts_index' );
+OCP\App::setActiveNavigationEntry( 'contacts_index' );
 
 // Load a specific user?
 $id = isset( $_GET['id'] ) ? $_GET['id'] : null;
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php
index 4e840026ce3734066a07dcdc77e2b597a127c065..636b9a84b9d3d9de7fee582dfe7655b4db51b5ed 100755
--- a/apps/contacts/lib/app.php
+++ b/apps/contacts/lib/app.php
@@ -53,7 +53,7 @@ class OC_Contacts_App {
 		$vcard = OC_VObject::parse($card['carddata']);
 		// Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly...
 		if(!is_null($vcard) && !$vcard->__isset('N')) {
-			$appinfo = OC_App::getAppInfo('contacts');
+			$appinfo = OCP\App::getAppInfo('contacts');
 			if($appinfo['version'] >= 5) {
 				OCP\Util::writeLog('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OCP\Util::DEBUG);
 			}
diff --git a/apps/contacts/lib/search.php b/apps/contacts/lib/search.php
index e2aae58189b09281150be36d884cd8574df9755e..144138a7c2c4e44f732f6c3b6f3254cdd50b815b 100755
--- a/apps/contacts/lib/search.php
+++ b/apps/contacts/lib/search.php
@@ -2,7 +2,7 @@
 class OC_Search_Provider_Contacts extends OC_Search_Provider{
 	function search($query){
 		$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser(), 1);
-// 		if(count($calendars)==0 || !OC_App::isEnabled('contacts')){
+// 		if(count($calendars)==0 || !OCP\App::isEnabled('contacts')){
 // 			//return false;
 // 		}
 		// NOTE: Does the following do anything
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 45ce1ac3a2c2a91cafb028fafd5df8e7fca700c0..00c008657b7f3e250f4c0d6f2b6f0b61247975e8 100755
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -245,8 +245,8 @@ class OC_Contacts_VCard{
 		// Add product ID is missing.
 		$prodid = trim($vcard->getAsString('PRODID'));
 		if(!$prodid) {
-			$appinfo = OC_App::getAppInfo('contacts');
-			$appversion = OC_App::getAppVersion('contacts');
+			$appinfo = OCP\App::getAppInfo('contacts');
+			$appversion = OCP\App::getAppVersion('contacts');
 			$prodid = '-//ownCloud//NONSGML '.$appinfo['name'].' '.$appversion.'//EN';
 			$vcard->setString('PRODID', $prodid);
 		}
diff --git a/apps/external/appinfo/app.php b/apps/external/appinfo/app.php
index 66116ac4c6ec7e040c8cef6df34fe9ab92c6b8dc..b569fc305ba00fb02b2bfb879334bb47aa2271b4 100755
--- a/apps/external/appinfo/app.php
+++ b/apps/external/appinfo/app.php
@@ -24,12 +24,12 @@
 OC::$CLASSPATH['OC_External'] = 'apps/external/lib/external.php';
 OCP\Util::addStyle( 'external', 'style');
 
-OC_APP::registerAdmin('external', 'settings');
+OCP\App::registerAdmin('external', 'settings');
 
-OC_App::register(array('order' => 70, 'id' => 'external', 'name' => 'External'));
+OCP\App::register(array('order' => 70, 'id' => 'external', 'name' => 'External'));
 
 $sites = OC_External::getSites();
 for ($i = 0; $i < sizeof($sites); $i++) {
-	OC_App::addNavigationEntry(
+	OCP\App::addNavigationEntry(
 			array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OCP\Util::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OCP\Util::imagePath('external', 'external.png'), 'name' => $sites[$i][0]));
 }
diff --git a/apps/external/index.php b/apps/external/index.php
index 1d4e5cc505117fadfe784e67333a55c28cb14ca8..f1f6cbac3cf2948ca2ef8d42085e2915ad5670a2 100755
--- a/apps/external/index.php
+++ b/apps/external/index.php
@@ -33,7 +33,7 @@ if (isset($_GET['id'])) {
 	$sites = OC_External::getSites();
 	if (sizeof($sites) >= $id) {
 		$url = $sites[$id - 1][1];
-		OC_App::setActiveNavigationEntry('external_index' . $id);
+		OCP\App::setActiveNavigationEntry('external_index' . $id);
 
 		$tmpl = new OC_Template('external', 'frame', 'user');
 		$tmpl->assign('url', $url);
diff --git a/apps/files/admin.php b/apps/files/admin.php
index 120e245fd425c42353da5d978f5a82cefae233e1..c14a97568f00eae60a1670891905ce194aacf999 100755
--- a/apps/files/admin.php
+++ b/apps/files/admin.php
@@ -49,7 +49,7 @@ if($_POST) {
 $maxZipInputSize = OCP\Util::humanFileSize(OC_Config::getValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB')));
 $allowZipDownload = intval(OC_Config::getValue('allowZipDownload', true));
 
-OC_App::setActiveNavigationEntry( "files_administration" );
+OCP\App::setActiveNavigationEntry( "files_administration" );
 
 $tmpl = new OC_Template( 'files', 'admin' );
 $tmpl->assign( 'htaccessWorking', $htaccessWorking );
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index 0e82713fe5c406f48ef4f362fa62b95171d06043..4a05a655957e5008feb1fb5d28a27ca37cff8e54 100755
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -3,8 +3,8 @@
 
 $l=OC_L10N::get('files');
 
-OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
+OCP\App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
 
-OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
+OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
 
 OC_Search::registerProvider('OC_Search_Provider_File');
diff --git a/apps/files/index.php b/apps/files/index.php
index 3f97317fc5f982ee62f8b9c3f080c457ad8cf5ad..86b877115ca75710ce8d09970b845d2036ccbe86 100755
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -34,7 +34,7 @@ OCP\Util::addscript( 'files', 'fileactions' );
 if(!isset($_SESSION['timezone'])){
 	OCP\Util::addscript( 'files', 'timezone' );
 }
-OC_App::setActiveNavigationEntry( "files_index" );
+OCP\App::setActiveNavigationEntry( "files_index" );
 // Load the files
 $dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
 // Redirect if directory does not exist
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index 98ba4847d27c84d5777fa14f37363b0b3fc45495..02fc9dfa2673ad71240d9ab2d5f0d670b758fe79 100755
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -16,4 +16,4 @@ if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()){//force the user to r
 	exit();
 }
 
-OC_App::registerAdmin('files_encryption', 'settings');
+OCP\App::registerAdmin('files_encryption', 'settings');
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index cf7c48d5fb938addf3d2db12d9c5ecc6fa3716a7..15f72ef0895a939f97662fc64c703cc11c69bd6a 100755
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -3,7 +3,7 @@
 require_once('apps/files_sharing/sharedstorage.php');
 
 OC::$CLASSPATH['OC_Share'] = "apps/files_sharing/lib_share.php";
-OC_APP::registerAdmin('files_sharing', 'settings');
+OCP\App::registerAdmin('files_sharing', 'settings');
 OC_Hook::connect("OC_Filesystem", "post_delete", "OC_Share", "deleteItem");
 OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Share", "renameItem");
 OC_Hook::connect("OC_Filesystem", "post_write", "OC_Share", "updateItem");
diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php
index e607348a037b9c374192ad5023fa05575e0713eb..eb1ed8a186f2fb4698a17ad6068eedf0142f0528 100755
--- a/apps/files_sharing/list.php
+++ b/apps/files_sharing/list.php
@@ -26,7 +26,7 @@ require_once('lib_share.php');
 OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('files_sharing');
 
-OC_App::setActiveNavigationEntry("files_sharing_list");
+OCP\App::setActiveNavigationEntry("files_sharing_list");
 
 OCP\Util::addscript("files_sharing", "list");
 
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index 385f2922d9fcce30aede560a27dfd6f8d1681e85..ebaa7ee0e7e70cfb35bfc303d473d8cbfccf8dfc 100755
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -3,12 +3,12 @@
 require_once('apps/files_versions/versions.php');
 
 // Add an entry in the app list
-OC_App::register( array(
+OCP\App::register( array(
   'order' => 10,
   'id' => 'files_versions',
   'name' => 'Versioning' ));
 
-OC_APP::registerAdmin('files_versions', 'settings');
+OCP\App::registerAdmin('files_versions', 'settings');
 OCP\Util::addscript('files_versions', 'versions');
 
 // Listen to write signals
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php
index ad4723c142582b1c8797305db398c95502b21833..e6305a76b75e7392c472ef8d3c18e42989341561 100755
--- a/apps/gallery/appinfo/app.php
+++ b/apps/gallery/appinfo/app.php
@@ -29,12 +29,12 @@ OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'apps/gallery/lib/hooks_handlers.p
 
 $l = OC_L10N::get('gallery');
 
-OC_App::register(array(
+OCP\App::register(array(
   'order' => 20,
   'id' => 'gallery',
   'name' => 'Pictures'));
 
-OC_App::addNavigationEntry( array(
+OCP\App::addNavigationEntry( array(
  'id' => 'gallery_index',
  'order' => 20,
  'href' => OCP\Util::linkTo('gallery', 'index.php'),
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index 1d7fc1aee748847fd9e28229829d8d62016cc3bd..0ae6b15d7639d0b33a5dd938f3972cefb840f89a 100755
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -25,7 +25,7 @@
 
 OCP\User::checkLoggedIn();
 OC_Util::checkAppEnabled('gallery');
-OC_App::setActiveNavigationEntry( 'gallery_index' );
+OCP\App::setActiveNavigationEntry( 'gallery_index' );
 
 if (!file_exists(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery')) {
   mkdir(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery');
diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php
index 5e7a411f67710b379db3d528f365dcc7d98e6690..26cb2045549882e6dd630f2d36390d462950dfd2 100755
--- a/apps/media/appinfo/app.php
+++ b/apps/media/appinfo/app.php
@@ -25,10 +25,10 @@ $l=OC_L10N::get('media');
 require_once('apps/media/lib_media.php');
 
 OCP\Util::addscript('media','loader');
-OC_APP::registerPersonal('media','settings');
+OCP\App::registerPersonal('media','settings');
 
-OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
+OCP\App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
 
-OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
+OCP\App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
 
 OC_Search::registerProvider('OC_MediaSearchProvider');
diff --git a/apps/media/index.php b/apps/media/index.php
index 0d226cb0ca15daf31edda33a650b158b7d1f7d0f..df597c31085578c96bba95ead187d553b1331aae 100755
--- a/apps/media/index.php
+++ b/apps/media/index.php
@@ -39,7 +39,7 @@ OCP\Util::addscript('media','scanner');
 OCP\Util::addscript('media','jquery.jplayer.min');
 OCP\Util::addStyle('media','music');
 
-OC_App::setActiveNavigationEntry( 'media_index' );
+OCP\App::setActiveNavigationEntry( 'media_index' );
 
 $tmpl = new OC_Template( 'media', 'music', 'user' );
 $tmpl->printPage();
diff --git a/apps/remoteStorage/appinfo/app.php b/apps/remoteStorage/appinfo/app.php
old mode 100644
new mode 100755
index a1fbebc42f57c424cb8d241930032d8ccff12e02..14b8a3d11dfdb3fe8660c26c0381e714e615aa88
--- a/apps/remoteStorage/appinfo/app.php
+++ b/apps/remoteStorage/appinfo/app.php
@@ -1,6 +1,6 @@
 <?php
-OC_App::register( array( 
+OCP\App::register( array( 
   'order' => 10,
   'id' => 'remoteStorage',
   'name' => 'remoteStorage compatibility' ));
-OC_APP::registerPersonal('remoteStorage','settings');
+OCP\App::registerPersonal('remoteStorage','settings');
diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php
index 0fec1084848426cf1c58bce12486caa6cbb95212..79675f940bcc7f2da47e3d06da5d4df92916287a 100755
--- a/apps/user_ldap/appinfo/app.php
+++ b/apps/user_ldap/appinfo/app.php
@@ -25,7 +25,7 @@ require_once('apps/user_ldap/lib_ldap.php');
 require_once('apps/user_ldap/user_ldap.php');
 require_once('apps/user_ldap/group_ldap.php');
 
-OC_APP::registerAdmin('user_ldap','settings');
+OCP\App::registerAdmin('user_ldap','settings');
 
 // define LDAP_DEFAULT_PORT
 define('OC_USER_BACKEND_LDAP_DEFAULT_PORT', 389);
@@ -44,4 +44,3 @@ $entry = array(
 	'href' => OCP\Util::linkTo( 'user_ldap', 'settings.php' ),
 	'name' => 'LDAP'
 );
-// OC_App::addNavigationSubEntry( "core_users", $entry);
diff --git a/apps/user_migrate/appinfo/app.php b/apps/user_migrate/appinfo/app.php
index 0e9f69fbed57bb0520115fd58a871b86d8d81211..e57bfc2a9d3693c5ed8b5b2310568c80969e4649 100755
--- a/apps/user_migrate/appinfo/app.php
+++ b/apps/user_migrate/appinfo/app.php
@@ -21,8 +21,8 @@
 *
 */
 
-OC_APP::registerPersonal( 'user_migrate', 'settings' );
-OC_APP::registerAdmin( 'user_migrate', 'admin' );
+OCP\App::registerPersonal( 'user_migrate', 'settings' );
+OCP\App::registerAdmin( 'user_migrate', 'admin' );
 OCP\Util::addscript( 'user_migrate', 'export');
 
 // add settings page to navigation
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php
index b77067758b338a5bce3ea678e363dc786d5f3023..c683254101fde20a054ed98b8bd66e49746b1571 100755
--- a/apps/user_openid/appinfo/app.php
+++ b/apps/user_openid/appinfo/app.php
@@ -17,7 +17,7 @@ if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'='))
 OCP\Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
 OCP\Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName));
 
-OC_APP::registerPersonal('user_openid','settings');
+OCP\App::registerPersonal('user_openid','settings');
 
 require_once 'apps/user_openid/user_openid.php';
 
diff --git a/apps/user_webfinger/appinfo/app.php b/apps/user_webfinger/appinfo/app.php
old mode 100644
new mode 100755
index 8e8f92c96574184a27d64e209f12e5224eb4352a..f7b927df82a92edda0f939475eaf2510120d1bb7
--- a/apps/user_webfinger/appinfo/app.php
+++ b/apps/user_webfinger/appinfo/app.php
@@ -1,5 +1,5 @@
 <?php
-OC_App::register( array( 
+OCP\App::register( array( 
   'order' => 11,
   'id' => 'user_webfinger',
   'name' => 'Webfinger' ));
diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php
old mode 100644
new mode 100755
index 51686111bf77709c5113afca0c45e406a0d71b7b..da35cf29d0e7fb6b5b1113a978a9ac851842510f
--- a/apps/user_webfinger/webfinger.php
+++ b/apps/user_webfinger/webfinger.php
@@ -61,7 +61,7 @@ echo "<";
 <?php
 $apps = OC_Appconfig::getApps();
 foreach($apps as $app) {
-	if(OC_App::isEnabled($app)) {
+	if(OCP\App::isEnabled($app)) {
 		if(is_file(OC::$APPSROOT . '/apps/' . $app . '/appinfo/webfinger.php')) {
 			require($app . '/appinfo/webfinger.php');
 		}
diff --git a/lib/public/app.php b/lib/public/app.php
new file mode 100644
index 0000000000000000000000000000000000000000..70894c3648d97bc7c524549fb8a8bbcff5859b60
--- /dev/null
+++ b/lib/public/app.php
@@ -0,0 +1,156 @@
+<?php
+/**
+* ownCloud
+*
+* @author Frank Karlitschek
+* @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/>.
+*
+*/
+
+/**
+ * Public interface of ownCloud for apps to use.
+ * App Class.
+ *
+ */
+
+// use OCP namespace for all classes that are considered public. 
+// This means that they should be used by apps instead of the internal ownCloud classes
+namespace OCP;
+
+class App {
+
+
+	/**
+	 * @brief get the user id of the user currently logged in.
+	 * @return string uid or false
+	 */
+	public static function getUser(){
+		return \OC_USER::getUser();
+	}
+
+        /**
+         * @brief makes owncloud aware of this app
+         * @param $data array with all information
+         * @returns true/false
+         *
+         * This function registers the application. $data is an associative array.
+         * The following keys are required:
+         *   - id: id of the application, has to be unique ('addressbook')
+         *   - name: Human readable name ('Addressbook')
+         *   - version: array with Version (major, minor, bugfix) ( array(1, 0, 2))
+         *
+         * The following keys are optional:
+         *   - order: integer, that influences the position of your application in
+         *     a list of applications. Lower values come first.
+         *
+         */
+        public static function register( $data ){
+		return \OC_App::register( $data );
+        }
+
+
+
+	/**
+	 * register an admin form to be shown
+	 */
+	public static function registerAdmin($app,$page){
+		return \OC_App::registerAdmin($app,$page);
+	}
+
+
+        /**
+         * @brief adds an entry to the navigation
+         * @param $data array containing the data
+         * @returns true/false
+         *
+         * This function adds a new entry to the navigation visible to users. $data
+         * is an associative array.
+         * The following keys are required:
+         *   - id: unique id for this entry ('addressbook_index')
+         *   - href: link to the page
+         *   - name: Human readable name ('Addressbook')
+         *
+         * The following keys are optional:
+         *   - icon: path to the icon of the app
+         *   - order: integer, that influences the position of your application in
+         *     the navigation. Lower values come first.
+         */
+        public static function addNavigationEntry( $data ){
+		return \OC_App::addNavigationEntry($data);
+	}
+
+        /**
+         * @brief Read app metadata from the info.xml file
+         * @param string $appid id of the app or the path of the info.xml file
+         * @param boolean path (optional)
+         * @returns array
+        */
+        public static function getAppInfo($appid,$path=false){
+		return \OC_App::getAppInfo($appid,$path);
+	}
+
+        /**
+         * register a personal form to be shown
+         */
+        public static function registerPersonal($app,$page){
+		return \OC_App::registerPersonal($app,$page);
+	}
+
+
+        /**
+         * @brief marks a navigation entry as active
+         * @param $id id of the entry
+         * @returns true/false
+         *
+         * This function sets a navigation entry as active and removes the 'active'
+         * property from all other entries. The templates can use this for
+         * highlighting the current position of the user.
+         */
+        public static function setActiveNavigationEntry($id){
+		return \OC_App::setActiveNavigationEntry($id);
+	}
+
+        /**
+         * @brief checks whether or not an app is enabled
+         * @param $app app
+         * @returns true/false
+         *
+         * This function checks whether or not an app is enabled.
+         */
+        public static function isEnabled( $app ){
+		return \OC_App::isEnabled( $app );
+	}
+
+        /**
+         * get the last version of the app, either from appinfo/version or from appinfo/info.xml
+         */
+        public static function getAppVersion($appid){
+		return \OC_App::getAppVersion( $appid );
+	}
+
+        /**
+         * @param string appid
+         * @return OC_FilesystemView
+         */
+        public static function getStorage($appid){
+		return \OC_App::getStorage( $appid );
+	}
+
+
+}
+
+
+?>