本文整理汇总了PHP中OC_App::setAppTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_App::setAppTypes方法的具体用法?PHP OC_App::setAppTypes怎么用?PHP OC_App::setAppTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_App
的用法示例。
在下文中一共展示了OC_App::setAppTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: installShippedApp
/**
* install an app already placed in the app folder
* @param string $app id of the app to install
* @return integer
*/
public static function installShippedApp($app)
{
//install the database
$appPath = OC_App::getAppPath($app);
if (is_file("{$appPath}/appinfo/database.xml")) {
OC_DB::createDbFromStructure("{$appPath}/appinfo/database.xml");
}
//run appinfo/install.php
\OC::$loader->addValidRoot($appPath);
self::includeAppScript("{$appPath}/appinfo/install.php");
$info = OC_App::getAppInfo($app);
if (is_null($info)) {
return false;
}
$config = \OC::$server->getConfig();
$config->setAppValue($app, 'installed_version', OC_App::getAppVersion($app));
if (array_key_exists('ocsid', $info)) {
$config->setAppValue($app, 'ocsid', $info['ocsid']);
}
//set remote/public handlers
foreach ($info['remote'] as $name => $path) {
$config->setAppValue('core', 'remote_' . $name, $app . '/' . $path);
}
foreach ($info['public'] as $name => $path) {
$config->setAppValue('core', 'public_' . $name, $app . '/' . $path);
}
OC_App::setAppTypes($info['id']);
return $info['id'];
}
示例2: installShippedApp
/**
* install an app already placed in the app folder
* @param string $app id of the app to install
* @return integer
*/
public static function installShippedApp($app)
{
//install the database
if (is_file(OC_App::getAppPath($app) . "/appinfo/database.xml")) {
OC_DB::createDbFromStructure(OC_App::getAppPath($app) . "/appinfo/database.xml");
}
//run appinfo/install.php
if (is_file(OC_App::getAppPath($app) . "/appinfo/install.php")) {
include OC_App::getAppPath($app) . "/appinfo/install.php";
}
$info = OC_App::getAppInfo($app);
if (is_null($info)) {
return false;
}
OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app));
if (array_key_exists('ocsid', $info)) {
OC_Appconfig::setValue($app, 'ocsid', $info['ocsid']);
}
//set remote/public handelers
foreach ($info['remote'] as $name => $path) {
OCP\CONFIG::setAppValue('core', 'remote_' . $name, $app . '/' . $path);
}
foreach ($info['public'] as $name => $path) {
OCP\CONFIG::setAppValue('core', 'public_' . $name, $app . '/' . $path);
}
OC_App::setAppTypes($info['id']);
return $info['id'];
}
示例3: installShippedApp
/**
* install an app already placed in the app folder
* @param string $app id of the app to install
* @returns array see OC_App::getAppInfo
*/
public static function installShippedApp($app)
{
//install the database
if (is_file(OC::$APPSROOT . "/apps/{$app}/appinfo/database.xml")) {
OC_DB::createDbFromStructure(OC::$APPSROOT . "/apps/{$app}/appinfo/database.xml");
}
//run appinfo/install.php
if (is_file(OC::$APPSROOT . "/apps/{$app}/appinfo/install.php")) {
include OC::$APPSROOT . "/apps/{$app}/appinfo/install.php";
}
$info = OC_App::getAppInfo($app);
OC_Appconfig::setValue($app, 'installed_version', OC_App::getAppVersion($app));
//set remote/public handelers
foreach ($info['remote'] as $name => $path) {
OCP\CONFIG::setAppValue('core', 'remote_' . $name, '/apps/' . $app . '/' . $path);
}
foreach ($info['public'] as $name => $path) {
OCP\CONFIG::setAppValue('core', 'public_' . $name, '/apps/' . $app . '/' . $path);
}
OC_App::setAppTypes($info['id']);
return $info;
}