How can I parse .unity3d file on sever side by php - php

I have my own .unity3d files on my server for downloading by users to update our game. And I try to create a web-interface to add some additional data linked to this .unity3d files. This interface have to be able to show images from assets from .unity3d files. These files conain .png asset and information about sprites. How can i parse .unity3d file to show images from it in my web-interface?

unity3d files are a proprietary package format used for distribution, and thus are not meant to be edited.
If you need to build your web interface it will be easier to do so using the original files.
Having said that, there are tools that decompile .unity3d files See this answer in the Unity official SO

Related

Save a Favicon in ubuntu for PHP page

i want to add a favicon to my PHP page at my Ubuntu server. unfortunately, i don't know how to add an image (favicon.ico) to my server an save it there. I tried to find an answer to that but it seems like i'm eather searching wrong or i just don't understand it properly...
Ubuntu 18.04.5
thanks for any help!
Great question. At the very least you will want a favicon.ico file on every website or web application to identify your company or application's brand.
A "favicon.ico" file is nothing but an image file with your brands icon. But it needs to be in a particular format (ico) for web browsers to read it.
Web browsers use this .ico file whenever you bookmark a webpage to give a visual identification to the resource you are saving.
All that aside, you can convert a graphic to .ico format yourself using image editing software or use many online tools to convert regular images or graphics to this format. If you use an online service (recommended), then you will generally need to follow the guidelines of these services in order to convert your image to the proper format.
Here's an example online service that will create the .ico image you desire. After using the service you will want to place the .ico file in the 'root' directory of your website and/or application. The 'root' directory means the very base directory in which your website files exist. E.g. your index.html or index.php file, etc.
https://www.favicon-generator.org/
In addition, you can explicitly reference your favicon via HTML meta tags. See this W3C URL for additional reference:
https://www.w3.org/2005/10/howto-favicon

How to read .xhprof files?

I have .xhprof files generated from XHProf and UProfiler.
Tried using SugarCrm XHProf Viewer and UProfiler viewer, but both of them doesn't read .xhprof files.
Do I have to do any conversion to read this reports?
I am maintaining XHProf since it is not maintained by Facebook anymore.
As part of the project, there is an xhprof_html sub-directory. If you can reach its index.php directly from a URL (maybe you will have to create a separate VirtualHost and/or putting it somewhere under your document root), then it should show you a list of profiles that have been generated (by default, it is in the temporary directory (/tmp?)).

PHP Large Files Zipping with folders that don't exist in the file-system

I'm creating some kind of file-sharing application. In this application you should be able to up-& download files and structure these files.
I've opted to not keep on manipulating the file-system. But I Upload the files into folders based on timestamps, and store the important information in the database and structure them inside the DB. So there are no REAL subfolders, just relations in the database to structure thes files into folders.
No I want to let users download folders (including subfolders) by zipping it. But I want to recreate this folder-structure(that the user sees in the front-end) inside the zip-archive that will be downloaded. I've managed to do this using the ZipArchive class of PHP: http://php.net/manual/en/class.ziparchive.php
But there's 1 big issue with this. It uses a lot of memory & cpu when compressing big files. And the system must be able to handle large files (>1GB) I can't possibly allow PHP to use >1GB of memory?!
Now I've found a Stackoverflow question to zip large files using less memory in php:
https://stackoverflow.com/a/4357904/383731
This seems to use the Unix Zip command, But is it possible to create folders inside these zips without them existing inside the file-system?
create a folder in your temp directory
add subfolders and links to real files
zip it
send it
kill temp files
The part about the links is important. If you just use links you do not actually have to copy the file contents. All you do is give the zip tool a hint where it can find the contents you want to include in the archive
EDIT:
Both symbolic links and hard links work, The link above explains how to do it with symlinks.

online editors for various file types, doc, dwg, image

I have a media archive with various file types on my server. If a user wants to update that file, he has to download the file to his local machine, edit it with his desktop software (Word, AutoCAD, etc), then reupload the file. It's kind of a pain for my users. Has anybody run into this problem and solved it in the past. I'm aware of using samba, but that's not exactly what i want. Are there any tools out there that can help me edit files that are on a server? I'm thinking kind of like a Google Docs kind of thing, your file actually sits somewhere in Googleland, but you can access and edit it in your browser. The files I would want to edit are:
.doc
.dwg (AutoCAD)
.jpg (is there a good image editing client out there?)
My language of choice is PHP, but I can do anything really if I have to.
The bottom line is I have a doc, for example, on my server in some directory. I want the user to edit the content of that doc and have it be replaced in place with as minimal hassle on the user as possible.
https://www.autocadws.com/ (CAD)
https://chrome.google.com/webstore/detail/dcjeclnkejmbepoibfnamioojinoopln (CAD)
https://docs.google.com (documents)
http://www.aviary.com/ (Images)
Online image editors are the easiest and most plentiful to find. You can roll your own half-baked version or use one of the API's like Aviary.
Google documents is very nice for the business side of things (Excel, Email, Word documents with multiple people working at a time).

converting a given file to PDF

hey all,
is there any way to convert a given file (this could be of any type) in to a pdf file in .net or php?
eg: suppose there is a upload link to upload your file of any type(word,excel,autocad,images..) and once the upload button is clicked the uploaded file should be converted into a pdf.
i checked out fpdf.but according to my knowledge all file types cannot be converted.a module to plugin to the CMS would also be fine.
FPDF does support images. I know because I have used it recently.
If you are wanting a pure PHP solution, you can use the PHP COM functions along with Word or Excel on the server to open up those files then copy the data out.
If I were you though, I would use Google. Load the doc into Google Docs then export it as a new format with the API.
There are a couple of 3rd party solutions available such as this one, which is optimised for use on the server and accessible from any web services capable environment, including .net. Supports loads of file types including MS-Office based documents.
Disclaimer, I worked on this product so consider me biased. Having said that, it works very well.

Categories