diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/app/appmanager.php | 18 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 8 | ||||
-rw-r--r-- | lib/private/server.php | 3 | ||||
-rw-r--r-- | lib/private/setup/abstractdatabase.php | 3 | ||||
-rw-r--r-- | lib/private/setup/mysql.php | 2 | ||||
-rw-r--r-- | lib/private/share/helper.php | 4 | ||||
-rw-r--r-- | lib/private/share/share.php | 10 | ||||
-rw-r--r-- | lib/private/template.php | 23 | ||||
-rw-r--r-- | lib/private/updater.php | 2 | ||||
-rw-r--r-- | lib/private/user.php | 2 |
10 files changed, 54 insertions, 21 deletions
diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php index bf07a2ef548..eeb2216d5a8 100644 --- a/lib/private/app/appmanager.php +++ b/lib/private/app/appmanager.php @@ -27,11 +27,13 @@ namespace OC\App; use OCP\App\IAppManager; +use OCP\App\ManagerEvent; use OCP\IAppConfig; use OCP\ICacheFactory; use OCP\IGroupManager; use OCP\IUser; use OCP\IUserSession; +use Symfony\Component\EventDispatcher\EventDispatcherInterface; class AppManager implements IAppManager { @@ -68,6 +70,9 @@ class AppManager implements IAppManager { /** @var string[] */ private $alwaysEnabled; + /** @var EventDispatcherInterface */ + private $dispatcher; + /** * @param \OCP\IUserSession $userSession * @param \OCP\IAppConfig $appConfig @@ -77,11 +82,13 @@ class AppManager implements IAppManager { public function __construct(IUserSession $userSession, IAppConfig $appConfig, IGroupManager $groupManager, - ICacheFactory $memCacheFactory) { + ICacheFactory $memCacheFactory, + EventDispatcherInterface $dispatcher) { $this->userSession = $userSession; $this->appConfig = $appConfig; $this->groupManager = $groupManager; $this->memCacheFactory = $memCacheFactory; + $this->dispatcher = $dispatcher; } /** @@ -201,6 +208,9 @@ class AppManager implements IAppManager { public function enableApp($appId) { $this->installedAppsCache[$appId] = 'yes'; $this->appConfig->setValue($appId, 'enabled', 'yes'); + $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent( + ManagerEvent::EVENT_APP_ENABLE, $appId + )); $this->clearAppsCache(); } @@ -226,6 +236,9 @@ class AppManager implements IAppManager { }, $groups); $this->installedAppsCache[$appId] = json_encode($groupIds); $this->appConfig->setValue($appId, 'enabled', json_encode($groupIds)); + $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE_FOR_GROUPS, new ManagerEvent( + ManagerEvent::EVENT_APP_ENABLE_FOR_GROUPS, $appId, $groups + )); $this->clearAppsCache(); } @@ -241,6 +254,9 @@ class AppManager implements IAppManager { } unset($this->installedAppsCache[$appId]); $this->appConfig->setValue($appId, 'enabled', 'no'); + $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent( + ManagerEvent::EVENT_APP_DISABLE, $appId + )); $this->clearAppsCache(); } diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 69438ef0c7c..f358bd59239 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -129,9 +129,15 @@ class Encryption extends Wrapper { if (isset($this->unencryptedSize[$fullPath])) { $size = $this->unencryptedSize[$fullPath]; // update file cache + if ($info) { + $info = $info->getData(); + } else { + $info = []; + } + $info['encrypted'] = true; $info['size'] = $size; - $this->getCache()->put($path, $info->getData()); + $this->getCache()->put($path, $info); return $size; } diff --git a/lib/private/server.php b/lib/private/server.php index 55ac64a0c2d..0d1bed4e7d2 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -413,7 +413,8 @@ class Server extends ServerContainer implements IServerContainer { $c->getUserSession(), $c->getAppConfig(), $c->getGroupManager(), - $c->getMemCacheFactory() + $c->getMemCacheFactory(), + $c->getEventDispatcher() ); }); $this->registerService('DateTimeZone', function (Server $c) { diff --git a/lib/private/setup/abstractdatabase.php b/lib/private/setup/abstractdatabase.php index c97302ab252..0c1e5904e08 100644 --- a/lib/private/setup/abstractdatabase.php +++ b/lib/private/setup/abstractdatabase.php @@ -91,5 +91,8 @@ abstract class AbstractDatabase { $this->tablePrefix = $dbTablePrefix; } + /** + * @param string $userName + */ abstract public function setupDatabase($userName); } diff --git a/lib/private/setup/mysql.php b/lib/private/setup/mysql.php index e6afad6033a..de2466676c1 100644 --- a/lib/private/setup/mysql.php +++ b/lib/private/setup/mysql.php @@ -71,7 +71,7 @@ class MySQL extends AbstractDatabase { } /** - * @param IDbConnection $connection + * @param IDBConnection $connection * @throws \OC\DatabaseSetupException */ private function createDBUser($connection) { diff --git a/lib/private/share/helper.php b/lib/private/share/helper.php index 1645e4451ab..f9581e48e62 100644 --- a/lib/private/share/helper.php +++ b/lib/private/share/helper.php @@ -227,7 +227,7 @@ class Helper extends \OC\Share\Constants { * * all return: http://localhost * - * @param string $shareWith + * @param string $remote * @return string */ protected static function fixRemoteURL($remote) { @@ -244,7 +244,7 @@ class Helper extends \OC\Share\Constants { * split user and remote from federated cloud id * * @param string $id - * @return array + * @return string[] * @throws HintException */ public static function splitUserRemote($id) { diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 96b920fe994..b09adf1aa99 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -2297,6 +2297,16 @@ class Share extends Constants { return $id ? $id : false; } + /** + * @param string $itemType + * @param string $itemSource + * @param int $shareType + * @param string $shareWith + * @param string $uidOwner + * @param int $permissions + * @param string|null $itemSourceName + * @param null|\DateTime $expirationDate + */ private static function checkReshare($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $itemSourceName, $expirationDate) { $backend = self::getBackend($itemType); diff --git a/lib/private/template.php b/lib/private/template.php index ae3e857a798..bc706e29344 100644 --- a/lib/private/template.php +++ b/lib/private/template.php @@ -53,23 +53,19 @@ class OC_Template extends \OC\Template\Base { /** @var string */ protected $app; // app id + protected static $initTemplateEngineFirstRun = true; + /** * Constructor + * * @param string $app app providing the template * @param string $name of the template file (without suffix) - * @param string $renderAs = ""; produce a full page + * @param string $renderAs If $renderAs is set, OC_Template will try to + * produce a full page in the according layout. For + * now, $renderAs can be set to "guest", "user" or + * "admin". * @param bool $registerCall = true - * @return OC_Template object - * - * This function creates an OC_Template object. - * - * If $renderAs is set, OC_Template will try to produce a full page in the - * according layout. For now, $renderAs can be set to "guest", "user" or - * "admin". */ - - protected static $initTemplateEngineFirstRun = true; - public function __construct( $app, $name, $renderAs = "", $registerCall = true ) { // Read the selected theme from the config file self::initTemplateEngine($renderAs); @@ -92,6 +88,9 @@ class OC_Template extends \OC\Template\Base { parent::__construct($template, $requestToken, $l10n, $themeDefaults); } + /** + * @param string $renderAs + */ public static function initTemplateEngine($renderAs) { if (self::$initTemplateEngineFirstRun){ @@ -182,7 +181,7 @@ class OC_Template extends \OC\Template\Base { * Checking all the possible locations. * @param string $theme * @param string $app - * @return array + * @return string[] */ protected function findTemplate($theme, $app, $name) { // Check if it is a app template or not. diff --git a/lib/private/updater.php b/lib/private/updater.php index 32264484ee3..78457ba3a80 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -35,7 +35,6 @@ namespace OC; use OC\Hooks\BasicEmitter; use OC\IntegrityCheck\Checker; -use OC\IntegrityCheck\Storage; use OC_App; use OC_Installer; use OC_Util; @@ -287,7 +286,6 @@ class Updater extends BasicEmitter { * @param string $installedVersion previous version from which to upgrade from * * @throws \Exception - * @return bool true if the operation succeeded, false otherwise */ private function doUpgrade($currentVersion, $installedVersion) { // Stop update if the update is over several major versions diff --git a/lib/private/user.php b/lib/private/user.php index ae98bb9b01a..21971fc3d1d 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -253,7 +253,7 @@ class OC_User { * Sets user display name for session * * @param string $uid - * @param null $displayName + * @param string $displayName * @return bool Whether the display name could get set */ public static function setDisplayName($uid, $displayName = null) { |