To main page | Opera Unite HowTo'sFrom PHP to Opera UniteI highly doubt Opera Unite even plans to support PHP (but that's not a problem for PHP guy - some of the stuff is even simpler). If you are experienced in PHP - see UnitenessRight now you can't run PHP under Opera Unite. Instead of PHP you write "server"-side code in JavaScript. It's actually pretty simple to use JavaScript instead of PHP. See basic howto for example app. I don't think Opera would be planning to use PHP as a language, since their main market is web browser and those use JavaScript. Generally speaking JavaScript is more secure, since it has less ways to deal with files and SQL. You can still use files, see sandbox filesystem. You also have templating system. Besides, using just HTML+JavaScript for both presentation and server-side code is easier than using HTML+JavaScript+PHP+MySQL. "PHP" to "Opera Unite" equality"Apache/Web Server" -> "Opera browser" (it runs small browser inside)"PHP" -> Server-side "JavaScript" "MySQL" -> Not required (see persistence and performance) Currently storing JSON in File has enough raw power (800req/s) to be used for data storage. There are other ideas that I work on and test. "Human readable URLs" -> See URLs "index.php" -> webserver.addEventListener('_index', start_page, false); // see Basic HowTo"print" -> function start_page(r) { var o = r.connection.response; o.write('This is printing'); o.close(); };php_info -> unite_info (find all kinds of available variables here) $_GET/$_POST -> GET POST templating -> Markuper (follows MVC pattern → by design) file_get(put)_contents -> file_wrap.js file_get_contents('http:// -> HTTP connections (but it needs to be async (deferred), I will probably need to elaborate on that) I've simplified a lot of this in Uniteness LoopAnother major difference is that variables are not reset at the end of the page request. So if you define:var counter = 0;then in function that returns the page you do: counter++;Then counter would be incrementing each time someone visits a page, whereas PHP forgets all variables right after page generation is done. Basically, your application never reaches end of script (until user closes Opera or stops the service). In theoryIn theory you can have local Apache/PHP installation and make a service that accesses it via JavaScript (as a proxy) from Opera Unite, but this is really pointless, since the point of Opera Unite is to simplify stuff, not complicate it.SecuritySince you don't have to deal with SQL - you don't have SQL injections.Since you don't have write access to your 'application' mount point - you can't execute malicious code. And even if executes - it can't touch your code (since it's on read-only mount point). Your computer can't be DOSed. XSS is still an annoyance and security concern, but Markuper escapes most of what you insert. | Last updated
|