Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/SSpkS/Output/JsonOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ private function packageToJson($pkg, $language)
'maintainer_url' => $this->ifEmpty($pkg, 'maintainer_url', $this->config->packages['maintainer_url']),
'distributor' => $this->ifEmpty($pkg, 'distributor', $this->config->packages['distributor']),
'distributor_url' => $this->ifEmpty($pkg, 'distributor_url', $this->config->packages['distributor_url']),
'support_url' => $this->ifEmpty($pkg, 'support_url', $this->config->packages['support_url']),
'changelog' => $this->ifEmpty($pkg, 'changelog', ''),
'thirdparty' => true,
'category' => 0,
Expand All @@ -129,6 +130,7 @@ private function packageToJson($pkg, $language)
'silent_install' => $this->ifEmpty($pkg, 'silent_install', false),
'silent_uninstall' => $this->ifEmpty($pkg, 'silent_uninstall', false),
'silent_upgrade' => $this->ifEmpty($pkg, 'silent_upgrade', false),
'auto_upgrade_from' => $this->ifEmpty($pkg, 'auto_upgrade_from', ''),
'beta' => $pkg->beta, // beta channel
);
return $packageJSON;
Expand Down
4 changes: 3 additions & 1 deletion lib/SSpkS/Package/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @property string $maintainer_url URL of maintainer's web page
* @property string $distributor Package distributor
* @property string $distributor_url URL of distributor's web page
* @property string $support_url URL of support web page
* @property array $arch List of supported architectures, or 'noarch'
* @property array $thumbnail List of thumbnail files
* @property array $thumbnail_url List of thumbnail URLs
Expand All @@ -28,6 +29,7 @@
* @property bool $silent_upgrade Allow silent upgrade
* @property bool $qinst Allow silent install
* @property bool $qupgrade Allow silent upgrade
* @property bool $auto_upgrade_from allow auto upgrade
* @property bool $qstart Allow automatic start after install
*/
class Package
Expand Down Expand Up @@ -159,7 +161,7 @@ private function collectMetadata()
$this->fixBoolIfExist('silent_uninstall');
$this->fixBoolIfExist('silent_upgrade');

if (isset($this->metadata['beta']) && in_array($this->metadata['beta'], array('true', '1', 'beta'))) {
if (isset($this->metadata['beta']) && in_array($this->metadata['beta'], array('true', 'yes', '1', 1))) {
$this->metadata['beta'] = true;
} else {
$this->metadata['beta'] = false;
Expand Down
4 changes: 2 additions & 2 deletions tests/JsonOutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public function testJsonConversion()
'Hub, allows you to find shared applications from other talented developers.","price":0,"download_count":0,"recent_download_count":0,"link":"http://prefix' . $this->tempPkg .
'","size":' . $pkgSize . ',"md5":"' . $pkgMd5 . '","thumbnail":["http://prefix' . $p->thumbnail[0] . '","http://prefix' . $p->thumbnail[1] . '"],' .
'"snapshot":["http://prefix' . $p->snapshot[0] . '","http://prefix' . $p->snapshot[1] . '"],"qinst":true,"qstart":true,"qupgrade":true,"depsers":null,"deppkgs"' .
':null,"conflictpkgs":null,"start":true,"maintainer":"Synology Inc.","maintainer_url":"http://dummy.org/","distributor":"SSpkS","distributor_url":"http://dummy.org/",' .
'"changelog":"","thirdparty":true,"category":0,"subcategory":0,"type":0,"silent_install":true,"silent_uninstall":true,"silent_upgrade":true,"beta":false}],"keyrings":["test\n12345"]}'
':null,"conflictpkgs":null,"start":true,"maintainer":"Synology Inc.","maintainer_url":"http://dummy.org/","distributor":"SSpkS","distributor_url":"http://dummy.org/","support_url":"",' .
'"changelog":"","thirdparty":true,"category":0,"subcategory":0,"type":0,"silent_install":true,"silent_uninstall":true,"silent_upgrade":true,"auto_upgrade_from":"","beta":false}],"keyrings":["test\n12345"]}'
);
}

Expand Down