Skip to content

Commit 74bdb81

Browse files
authored
Merge pull request #26 from ggoffy/master
fixed declare type
2 parents 7292131 + 10b050d commit 74bdb81

File tree

322 files changed

+20789
-3235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+20789
-3235
lines changed

admin/packages.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
$packagesAll = $packagesHandler->getAllPackages($start, $limit, 'pkg_id', 'DESC');
6363
$GLOBALS['xoopsTpl']->assign('packages_count', $packagesCount);
6464
$GLOBALS['xoopsTpl']->assign('wgtransifex_url', WGTRANSIFEX_URL);
65-
$GLOBALS['xoopsTpl']->assign('wgtransifex_upload_url', WGTRANSIFEX_UPLOAD_URL);
65+
$GLOBALS['xoopsTpl']->assign('wgtransifex_upload_url', \WGTRANSIFEX_UPLOAD_URL);
6666
// Table view packages
6767
if ($packagesCount > 0) {
6868
foreach (\array_keys($packagesAll) as $i) {
@@ -153,13 +153,13 @@
153153
$langFolder = $languagesObj->getVar('lang_folder');
154154

155155
// Make the destination directory if not exist
156-
$pkg_path = WGTRANSIFEX_UPLOAD_TRANS_PATH . '/' . $pkgName;
157-
if (!mkdir($pkg_path) && !is_dir($pkg_path)) {
156+
$pkg_path = \WGTRANSIFEX_UPLOAD_TRANS_PATH . '/' . $pkgName;
157+
if (!\is_dir($pkg_path) && !\mkdir($pkg_path)) {
158158
throw new \RuntimeException(sprintf('Directory "%s" was not created', $pkg_path));
159159
}
160160
$pkg_path .= '/' . $langFolder;
161161
\clearDir($pkg_path);
162-
if (!mkdir($pkg_path) && !is_dir($pkg_path)) {
162+
if (!\is_dir($pkg_path) && !\mkdir($pkg_path)) {
163163
throw new \RuntimeException(sprintf('Directory "%s" was not created', $pkg_path));
164164
}
165165

@@ -190,17 +190,18 @@
190190
if (!mkdir($dst_path) && !is_dir($dst_path)) {
191191
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dst_path));
192192
}
193+
chmod($dst_path, 0777);
193194
}
194195
}
195196
}
196197
} else {
197198
\redirect_header('packages.php?op=list', 5, \_AM_WGTRANSIFEX_PACKAGE_ERROR_NODATA);
198199
}
199200

200-
$zipcreate = WGTRANSIFEX_UPLOAD_TRANS_PATH . '/' . $pkgName . '/' . $pkgName . '_' . $langFolder . '.zip';
201+
$zipcreate = \WGTRANSIFEX_UPLOAD_TRANS_PATH . '/' . $pkgName . '/' . $pkgName . '_' . $langFolder . '.zip';
201202
\unlink($zipcreate);
202203
if (1 == Request::getInt('pkg_zipfile', 0)) {
203-
$pkg_path = WGTRANSIFEX_UPLOAD_TRANS_PATH . '/' . $pkgName . '/' . $langFolder;
204+
$pkg_path = \WGTRANSIFEX_UPLOAD_TRANS_PATH . '/' . $pkgName . '/' . $langFolder;
204205
zipFiles($pkg_path, $zipcreate);
205206
}
206207

@@ -226,7 +227,7 @@
226227
$imgNameDef = Request::getString('pkg_name');
227228
$uploaderErrors = '';
228229
$uploader = new \XoopsMediaUploader(
229-
WGTRANSIFEX_UPLOAD_PATH . '/logos/',
230+
\WGTRANSIFEX_UPLOAD_PATH . '/logos/',
230231
$helper->getConfig('mimetypes_image'),
231232
$helper->getConfig('maxsize_image'),
232233
null,
@@ -246,8 +247,8 @@
246247
if ($maxwidth > 0 && $maxheight > 0) {
247248
// Resize image
248249
$imgHandler = new Common\Resizer();
249-
$imgHandler->sourceFile = WGTRANSIFEX_UPLOAD_PATH . '/logos/' . $savedFilename;
250-
$imgHandler->endFile = WGTRANSIFEX_UPLOAD_PATH . '/logos/' . $savedFilename;
250+
$imgHandler->sourceFile = \WGTRANSIFEX_UPLOAD_PATH . '/logos/' . $savedFilename;
251+
$imgHandler->endFile = \WGTRANSIFEX_UPLOAD_PATH . '/logos/' . $savedFilename;
251252
$imgHandler->imageMimetype = $imgMimetype;
252253
$imgHandler->maxWidth = $maxwidth;
253254
$imgHandler->maxHeight = $maxheight;
@@ -292,7 +293,7 @@
292293
// Event new notification
293294
$notificationHandler->triggerEvent('packages', $newPkgId, 'package_new', $tags);
294295

295-
\redirect_header('packages.php?op=list', 2, _AM_WGTRANSIFEX_FORM_OK);
296+
\redirect_header('packages.php?op=list', 2, \_AM_WGTRANSIFEX_FORM_OK);
296297
}
297298
}
298299
// Get Form
@@ -382,11 +383,11 @@ function zipFiles($source, $destination)
382383
$iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS);
383384
$files = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST);
384385
foreach ($files as $file) {
385-
$file = \realpath($file);
386-
if (\is_dir($file)) {
387-
$zip->addEmptyDir(\str_replace($source . DIRECTORY_SEPARATOR, '', $file . DIRECTORY_SEPARATOR));
388-
} elseif (\is_file($file)) {
389-
$zip->addFile($file, \str_replace($source . DIRECTORY_SEPARATOR, '', $file));
386+
$filepath = \realpath($file->getPathname());
387+
if (\is_dir($filepath)) {
388+
$zip->addEmptyDir(\str_replace($source . DIRECTORY_SEPARATOR, '', $filepath . DIRECTORY_SEPARATOR));
389+
} elseif (\is_file($filepath)) {
390+
$zip->addFile($filepath, \str_replace($source . DIRECTORY_SEPARATOR, '', $filepath));
390391
}
391392
}
392393
} elseif (\is_file($source)) {

class/TransifexLib.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ protected function _get($url, $checkOnly = false)
349349
if ($checkOnly) {
350350
return (false == $error);
351351
}
352+
echo "<br>" . $url;
352353
if ($error) {
353354
//echo $url;
354355
//catch common errors

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change Log for wgTransifex - 2020/07/26 12:35:41 Version 1.04 RC1
55
- added clone feature for projects/resources (goffy)
66
- new preference 'Show Tx Admin Tools' (goffy)
77
- added project type (goffy)
8+
- fixed problem with declare strict_types (goffy)
89

910
===================================================================
1011
Change Log for wgTransifex - 2020/07/26 12:35:41 Version 1.03 RC2
Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
-
2-
pkg_id: '1'
3-
pkg_name: newbb
4-
pkg_desc: 'This is the language package for last version of newbb'
5-
pkg_pro_id: '8'
2+
pkg_id: '2'
3+
pkg_name: 'Xoops 2.5.11'
4+
pkg_desc: ''
5+
pkg_pro_id: '30'
66
pkg_lang_id: '1'
77
pkg_status: '6'
8-
pkg_zip: 'C:/Homepages/wamp/www/wgtransifex/htdocs/uploads/wgtransifex/translations/newbb/newbb_english.zip'
9-
pkg_logo: newbb.png
10-
pkg_date: '1594055580'
8+
pkg_zip: 'C:/Homepages/wamp/www/wgtransifex/htdocs/uploads/wgtransifex/translations/Xoops 2.5.11/Xoops 2.5.11_english.zip'
9+
pkg_logo: xoops.png
10+
pkg_date: '1596562106'
1111
pkg_submitter: '1'
1212
-
13-
pkg_id: '2'
13+
pkg_id: '3'
14+
pkg_name: Publisher
15+
pkg_desc: 'Language package for Publisher, Version 1.07'
16+
pkg_pro_id: '9'
17+
pkg_lang_id: '1'
18+
pkg_status: '6'
19+
pkg_zip: 'C:/Homepages/wamp/www/wgtransifex/htdocs/uploads/wgtransifex/translations/Publisher/Publisher_english.zip'
20+
pkg_logo: publisher.png
21+
pkg_date: '1596562171'
22+
pkg_submitter: '1'
23+
-
24+
pkg_id: '4'
1425
pkg_name: wgGallery
15-
pkg_desc: 'This is the language pack for wgGallery'
26+
pkg_desc: 'Language package for Image Gallery module wgGallery, Version 1.14'
1627
pkg_pro_id: '16'
1728
pkg_lang_id: '1'
1829
pkg_status: '6'
1930
pkg_zip: 'C:/Homepages/wamp/www/wgtransifex/htdocs/uploads/wgtransifex/translations/wgGallery/wgGallery_english.zip'
2031
pkg_logo: wggallery.png
21-
pkg_date: '1594055553'
32+
pkg_date: '1596562339'
2233
pkg_submitter: '1'

0 commit comments

Comments
 (0)