public static function pngToIcns($file, $res)
{
if (!file_exists($file)) {
+ die('!!!!');
return;
}
$icns = array(128, 256, 512);
- $png2icns = new cubeCommandLine('png2icns');
+ $png2icns = new CubeIT_CommandLine('png2icns');
$png2icns->setArg(null, $res);
$tmp = array();
}
$png2icns->execute();
+ $png2icns->debug();
foreach ($tmp as $item) {
unlink($tmp);
}
$url = $_GET['url'];
$dir = '/data/extranet/www/cache/youtubedl';
`cd $dir;youtube-dl $url`;
- $fname=trim(`youtube-dl --get-filename $url`);
+ $fname = trim(`youtube-dl --get-filename $url`);
$path = $dir . '/' . $fname;
header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename="'.$fname.'"');
- header('X-SendFile: '.$path);
+ header('Content-Disposition: attachment; filename="' . $fname . '"');
+ header('X-SendFile: ' . $path);
ob_end_clean();
exit;
}
<?php\r
\r
-class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {\r
+class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML\r
+{\r
protected $nwplatform = 'osx64';\r
protected $nwversion = '0.29.0';\r
- protected $node_platform='mac';\r
+ protected $node_platform = 'mac';\r
+ protected $exenameMaxlength = 28;\r
\r
- public function __construct($book_id) {\r
+ public function __construct($book_id)\r
+ {\r
parent::__construct($book_id);\r
$this->version = 'mac-exe-html';\r
+\r
}\r
\r
- public function makePackage($zip) {\r
+ public function makePackage($zip)\r
+ {\r
$this->preparePackage();\r
- $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload'];\r
+ $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload', 'v8_context_snapshot.bin', 'natives_blob.bin'];\r
foreach ($toDelete as $item) {\r
$p = $this->getFinalPackageDir() . '/' . $item;\r
`rm -rf "$p"`;\r
return $res;\r
}\r
\r
- public function getFinalPackageDir() {\r
- return parent::getFinalPackageDir() . $this->nwplatform . '/';\r
+ public function getFinalPackageDir()\r
+ {\r
+ $res = parent::getFinalPackageDir();\r
+ return $res;\r
}\r
\r
- protected function preparePackage() {\r
+ protected function preparePackage()\r
+ {\r
$this->initTempDir();\r
$this->copyFluidbookFiles();\r
$this->makeJSON();\r
$cl->setPath(CONVERTER_PATH);\r
$cl->setArg('p', $this->nwplatform);\r
$cl->setArg('o', $this->buildPath);\r
+ $cl->setArg('v', $this->nwversion);\r
$cl->setArg('winIco', $this->vdir . '/icon.ico');\r
$cl->setArg('macIcns', $this->vdir . '/icon.icns');\r
$cl->setArg(null, $this->vdir);\r
\r
class wsPackagerWinEXEHTML extends wsPackager\r
{\r
-\r
protected $exeName;\r
protected $appName;\r
protected $buildPath;\r
protected $nwplatform = 'windows-x32';\r
- protected $nwversion = '0.29.2';\r
+ protected $nwversion = '0.34.0';\r
protected $appversion = '';\r
protected $node_platform = 'win';\r
+ protected $exenameMaxlength = 30;\r
\r
public function __construct($book_id)\r
{\r
$this->_clean = false;\r
\r
if ($this->book->parametres->offlineTitle == "") {\r
- $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30));\r
+ $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, $this->exenameMaxlength));\r
$this->appName = $this->book->parametres->title;\r
} else {\r
- $this->exeName = cubeText::str2URL($this->book->parametres->offlineTitle);\r
+ $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->offlineTitle, 0, $this->exenameMaxlength));\r
$this->appName = $this->book->parametres->offlineTitle;\r
}\r
}\r
];\r
$pngIcon = $this->vdir . '/icon.png';\r
$winIcon = $this->vdir . '/icon.ico';\r
- if ($this->theme->parametres->favicon == '') {\r
- $png = WS_COMPILE_ASSETS . '/fluidbook.png';\r
- $ico = WS_COMPILE_ASSETS . '/fluidbook.ico';\r
- } else {\r
- $png = $this->vdir . '/data/favicon.png';\r
- $ico = $this->vdir . '/data/favicon.ico';\r
+\r
+ $png = WS_COMPILE_ASSETS . '/fluidbook.png';\r
+ $ico = WS_COMPILE_ASSETS . '/fluidbook.ico';\r
+\r
+ if ($this->theme->parametres->favicon != '') {\r
+ if (file_exists($this->vdir . '/data/favicon.png')) {\r
+ $png = $this->vdir . '/data/favicon.png';\r
+ }\r
+ if (file_exists($this->vdir . '/data/favicon.ico')) {\r
+ $ico = $this->vdir . '/data/favicon.ico';\r
+ }\r
}\r
\r
$icns = $this->vdir . '/icon.icns';\r
$this->copy($png, $pngIcon);\r
$this->copy($ico, $winIcon);\r
+\r
commonTools::pngToIcns($png, $icns);\r
+\r
file_put_contents($this->vdir . '/package.json', json_encode($data));\r
}\r
\r
$cp->setArg(null, $this->vdir);\r
$cp->execute();\r
\r
-\r
$this->copyExtras();\r
$this->copyNodeModules();\r
-\r
}\r
\r
protected function copyExtras()\r