Subj.
I have 30 separate files with code in a project.
I'd like to have a tool to merge all files in one before encrypting and uploading.
Does anyone have experience in that?
Subj.
I have 30 separate files with code in a project.
I'd like to have a tool to merge all files in one before encrypting and uploading.
Does anyone have experience in that?
You can easily do that in php for example.
$location = "/yourLocation/toFiles/"
$destination = "/yourDestination/"
$krpanoFiles = ["fileA","fileB",...];
foreach ($krpanoFiles as $file) {
$mergedFile = $mergedFile."\n".file_get_contents($location.$file.'.xml');
... do any extra function you need
}
file_put_contents($destination.'yourMergedXML.xml', $mergedFile);
Display More
You can execute that php directly on your computer without a server.
If you would like some custom code or any further feature here, please direct message me
BTW, I have a solution for this :)
It's cumbersome but working
Same, solution is here, but tough thing is to manage includes and relative paths, %SWFPATH%, %FIRSTXML%, etc...
I personally work with simplexml_load_file, with 2 args to replace %SWFPATH% and %FIRSTXML% on the go
$PreLoaded = simplexml_load_file($CurrentXml);
foreach($PreLoaded->include as $include){
$IncludePath = $include['url'];
!isset($FIRSTXML) ? : $IncludePath = str_replace('%FIRSTXML%', $FIRSTXML, $IncludePath);
!isset($SWFPATH) ? : $IncludePath = str_replace('%SWFPATH%', $SWFPATH, $IncludePath);
if (file_exists($IncludePath)) {
...
Display More
quite a pain, but working fine for our specific architecture.
Result is clear :
before : 120 files for a 12 seconds average load time
after : 1 file in < 1sec load time
Code is not really shareable as it really depends on folder structure and wouldn't work anywhere else but on our repositories.
Cheers
Hi, the typical file structure (html5) generated from a krpano droplet is:
folders:
panos
plugins
skin
files:
tour.html
tour.js
tour.xml
Then in this example,
How to merge all above in one file?, for example index.html or index.php
Then any browser would be load it without local server (offline)?
If yes,
How to make it from windows 10?
Which requirements?
Thanks in advanced.
Fdo.
Same, solution is here, but tough thing is to manage includes and relative paths, %SWFPATH%, %FIRSTXML%, etc...
I personally work with simplexml_load_file, with 2 args to replace %SWFPATH% and %FIRSTXML% on the go
Ouch
I use a lot of tricks, including initvars, folder structure, relative paths, js and a bit of php... This also helps to fix path issues.
I never use macro substitutions because they make code less clear and their values can not be obtained
I don't even know where to start, maybe make a repo first
Fernando, we talk a different thing.
Tour can not be 'compressed' to single html/php file. It won't make sense
I thought that you were referring to something like in this link:
link: https://krpano.com/docu/localusage/#embeddingallfilesKlaus explain how to "Embedding all files into the html file" in order to "Local / Offline Usage"
Don’t have an account yet? Register yourself now and be a part of our community!