本文整理汇总了PHP中OC_Installer::updateApp方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Installer::updateApp方法的具体用法?PHP OC_Installer::updateApp怎么用?PHP OC_Installer::updateApp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Installer
的用法示例。
在下文中一共展示了OC_Installer::updateApp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUpdateApp
public function testUpdateApp()
{
$pathOfOldTestApp = __DIR__;
$pathOfOldTestApp .= '/../data/';
$pathOfOldTestApp .= 'testapp.zip';
$oldTmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
OC_Helper::copyr($pathOfOldTestApp, $oldTmp);
$oldData = array('path' => $oldTmp, 'source' => 'path', 'appdata' => ['id' => 'Bar', 'level' => 100]);
$pathOfNewTestApp = __DIR__;
$pathOfNewTestApp .= '/../data/';
$pathOfNewTestApp .= 'testapp2.zip';
$newTmp = \OC::$server->getTempManager()->getTemporaryFile('.zip');
OC_Helper::copyr($pathOfNewTestApp, $newTmp);
$newData = array('path' => $newTmp, 'source' => 'path', 'appdata' => ['id' => 'Bar', 'level' => 100]);
OC_Installer::installApp($oldData);
$oldVersionNumber = OC_App::getAppVersion(self::$appid);
OC_Installer::updateApp($newData);
$newVersionNumber = OC_App::getAppVersion(self::$appid);
$this->assertNotEquals($oldVersionNumber, $newVersionNumber);
}
示例2: testUpdateApp
public function testUpdateApp()
{
$pathOfOldTestApp = __DIR__;
$pathOfOldTestApp .= '/../data/';
$pathOfOldTestApp .= 'testapp.zip';
$oldTmp = OC_Helper::tmpFile('.zip');
OC_Helper::copyr($pathOfOldTestApp, $oldTmp);
$oldData = array('path' => $oldTmp, 'source' => 'path');
$pathOfNewTestApp = __DIR__;
$pathOfNewTestApp .= '/../data/';
$pathOfNewTestApp .= 'testapp2.zip';
$newTmp = OC_Helper::tmpFile('.zip');
OC_Helper::copyr($pathOfNewTestApp, $newTmp);
$newData = array('path' => $newTmp, 'source' => 'path');
OC_Installer::installApp($oldData);
$oldVersionNumber = OC_App::getAppVersion(self::$appid);
OC_Installer::updateApp($newData);
$newVersionNumber = OC_App::getAppVersion(self::$appid);
$this->assertNotEquals($oldVersionNumber, $newVersionNumber);
}
示例3: array
<?php
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
$appid = $_POST['appid'];
$appid = OC_App::cleanAppId($appid);
$result = OC_Installer::updateApp($appid);
if ($result !== false) {
OC_JSON::success(array('data' => array('appid' => $appid)));
} else {
$l = OC_L10N::get('settings');
OC_JSON::error(array("data" => array("message" => $l->t("Couldn't update app."))));
}