// obey foreign key
$packageID = ($this->package) ? $this->package->packageID : null;
+ $archive = null;
if ($this->stylePackageImportLocation) {
$archive = $this->stylePackageImportLocation;
}
$action->executeAction();
}
}
+
+ $avatarData = [];
switch ($this->avatarType) {
case 'none':
$avatarData = [
// prepare path
$fileExtension = pathinfo($url, PATHINFO_EXTENSION);
$fileLocation = WCF_DIR.'images/proxy/'.substr($fileName, 0, 2).'/'.$fileName.($fileExtension ? '.'.$fileExtension : '');
+ $imageData = getimagesize($fileLocation);
$dir = dirname($fileLocation);
if (!@file_exists($dir)) {
FileUtil::makePath($dir);
}
// update user
+ $data = [];
switch ($this->avatarType) {
case 'none':
$data = [
'enableGravatar' => 0
];
break;
-
+
case 'custom':
$data = [
'enableGravatar' => 0
];
break;
-
+
case 'gravatar':
$data = [
'avatarID' => null,
}
$queueIDs = [];
+ /** @noinspection PhpUndefinedVariableInspection */
$queueID = $queue->queueID;
while ($queueID) {
$queueIDs[] = $queueID;
throw new SystemException('', 0, '', $e);
}
+ /** @noinspection PhpUndefinedVariableInspection */
$queue = PackageInstallationQueueEditor::create([
'parentQueueID' => $queue->queueID,
'processNo' => $processNo,
$data = $this->getPermissions($objectTypeID, [], null, true);
+ $users = [];
foreach ($values as $type => $optionData) {
if ($type === 'user') {
$users = User::getUsers(array_keys($optionData));
* @inheritDoc
*/
protected function getTemplate() {
+ $userProfiles = [];
if ($this->userIDs !== null) {
$userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($this->userIDs);
}
$installation = new PackageInstallationDispatcher($queue);
+ $progress = 0;
+ $currentAction = '';
switch ($step) {
case 'prepare':
// InstallPackageAction::stepPrepare()
}
$docComment = explode("\n", StringUtil::unifyNewlines($reflection->getDocComment()));
+ $comment = '';
foreach ($docComment as $commentLine) {
if (Regex::compile('[a-z]', Regex::CASE_INSENSITIVE)->match($commentLine)) {
$comment = Regex::compile('^[^a-z]+', Regex::CASE_INSENSITIVE)->replace($commentLine, '');
* @inheritDoc
*/
public function import($oldID, array $data, array $additionalData = []) {
+ $targetUser = null;
+
// whether to perform a merge
$performMerge = false;
public function getLabelGroups(array $groupIDs = [], $validatePermissions = true, $permission = 'canSetLabel') {
$data = [];
+ $optionID = null;
if ($validatePermissions) {
$optionID = $this->getOptionID($permission);
if ($optionID === null) {
return $this->revertLike($like, $likeable, $likeObject, $user);
}
+ // like data
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $cumulativeLikes = 0;
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $newValue = $oldValue = null;
+ $users = [];
+
try {
WCF::getDB()->beginTransaction();
- // like data
- /** @noinspection PhpUnusedLocalVariableInspection */
- $cumulativeLikes = 0;
- /** @noinspection PhpUnusedLocalVariableInspection */
- $newValue = $oldValue = null;
- $users = [];
-
// update existing object
if ($likeObject->likeObjectID) {
$likes = $likeObject->likes;
* @return array
*/
public function revertLike(Like $like, ILikeObject $likeable, LikeObject $likeObject, User $user) {
+ $usersArray = [];
+
try {
WCF::getDB()->beginTransaction();
];
$users = $likeObject->getUsers();
- $usersArray = [];
foreach ($users as $user2) {
$usersArray[$user2->userID] = ['userID' => $user2->userID, 'username' => $user2->username];
}
}
}
+ $comments = [];
if (!empty($commentIDs)) {
$comments = CommentRuntimeCache::getInstance()->getObjects($commentIDs);
}
// sort multiple instances by version number
uasort($installedPackages[$row['package']], [Package::class, 'compareVersion']);
+ $packageID = 0;
foreach ($installedPackages[$row['package']] as $packageID => $packageVersion) {
if (empty($row['minversion']) || Package::compareVersion($row['minversion'], $packageVersion, '<=')) {
continue 2;
* @throws SystemException
*/
public function compileString($identifier, $sourceContent, array $metaData = [], $isolated = false) {
+ $previousData = [];
if ($isolated) {
$previousData = [
'autoloadPlugins' => $this->autoloadPlugins,
$weeks = floor($days / 7);
$hours = $interval->format('%h');
$minutes = $interval->format('%i');
+
+ $direction = '';
switch ($interval->format('%R')) {
case '+':
$direction = 'past';