php 5.3 framework / class / functions for php 5.2 - php-5.3

I have a website made for php 5.3 that uses a lot of features included in php 5.3.
My web server (wich is a share host) uses php 5.2 and the company doesn't support php 5.3.
So I want to know if there is a php framework, class, bunch of functions or anything I can use to "simulate" php 5.3 on a php 5.2 server?
If so, what is the best one and where can I find it?

You could probably get 80% there, writing workarounds for some of what is introduced in PHP 5.3. However, there are a lot of things introduced at the language level that simply can't be emulated using PHP 5.2.
If you are really committed to your host, your best chance would be to evaluate exactly which features of PHP 5.3 your existing code is using, and then determine if those things fall within the scope of what you could find workarounds for. Alternatively, you could simply rewrite any code that is using PHP 5.3 features so that the would behave properly under 5.2. Either way, that's probably going to be a lot of work with not a significant amount of benefit (assuming changing hosts is an option).
So two options:
If this is a situation where the code must run on this host (say it was a school project hosted on school servers, or similarly a company project on company servers), I think your best bet is going to be refactoring your code to run on PHP 5.2.
If you can change hosts, I would recommend that as your best option.

I don't think you can. PHP 5.3 adds new options to the language that are not even close to being backwards compatible with PHP 5.2

Related

HipHop for PHP, deploying apps

After Googling, I found a lot of HipHop documentation, but plenty was posted between 2011 and 2013.
Earlier this year was launched a new version of HipHop that even supports Drupal and includes a lot of improvements...
I've always used the Zend Guard to deploy my commercial applications, but now I started to consider seriously the use of HipHop in production, but here comes the question:
We can run an application using only the bytecode HHBC (Without .php source code)?
Follows the reference of my research
https://github.com/facebook/hhvm/wiki/FAQ
The question may seem very obvious, but it is not so easy to find this answer in the project documentation.
Thanks in advance!
Well, yes and no.
HHVM has a so-called RepoAuthoritative mode in which the HHVM will no longer check the existence of the PHP files or how up-to-date they are; instead, it will retrieve the HHBC directly from its cache.
Theoretically, you can follow these steps:
pre-generate the HHBC for all your PHP files and insert that HHBC in HHVM's cache. This is the so-called pre-analysis phase (if you ever see it in HHVM documentation, this is what they mean by it)
turn on RepoAuthoritative mode (it's just 1 line in HHVM's config)
delete your PHP code
This way your PHP applications will run just fine without the source code being present. Doing a server restart won't change this since HHVM's bytecode cache lives on disk (it's implemented as an SQLite database).
However, it will be kind of a headache if you:
want to change something in your code. You would have to copy your code, make the change and repeat the pre-analysis phase.
want to upgrade HHVM to a newer version. HHVM uses its build ID as part of the cache key so, if you upgrade it, the bytecode cache becomes unreachable and, since you'll be running in RepoAuthoritative mode, your application will be reduced to a bunch of HTTP 404 errors. To fix this, you would have to repeat the pre-analysis phase as well.
Bottom line: no upside, big downside. There's just no point in doing it.
PS: I hope I answered your question. It's also possible that I misunderstood what you asked; if that's the case, please let me know in a comment.

Why does many ruby based projects recommend compiling from source?

I was using Veewee, the VirtualBox image generator for Vagrant, and I noticed it advised to compile ruby from source using a version manager.
Now I had a look at RoR and I see the same advice. I've been doing sysadmin work for a couple of years and I've never seen this requirement for Perl or Python.
Does the language has some specific requirements which make hand-compiled installations a need ? How to do people comply with this on servers ?

OpenOffice.org API or LibreOffice API?

Which API should I use? Which one is more promising? My main goal is to generate ODF documents. It's important for me to support ODF 1.2. And I want to use C++ and CLI bingings.
I use OpenOffice API a lot in an application of me. I made some tests with LibreOffice too and there are some (as far as i see undocumented and unwanted!) differences allready! (OO 3.2 against LO 3.4 and 3.5) Not much but here and there teh LO-Api behaves different from the OO-Api even in the same functionality. This is not important if you only deal with one of them, but it is important when you have to be sure that your App runs with OO and LO.
There is nearly no difference between the two APIs ATM. At least before Libreoffice 4.0 ( which is only in planning with no specific date ) there might be some long necessary API clean-ups. All in all they should be even c++ binary compatible.
Right now you should be able to use the same extensions/code to access both Libreoffice and Openoffice. You should only be careful with all interfaces marked as LibO 3.4 or 3.5 from http://api.libreoffice.org/

Starting Lua, what to use?

I'm trying to learn Lua, but I don't really know which binary to download. There's 2 choices:
Lua Binaries
Lua for Windows
The second option Lua for Windows seems to be the recommended option, but the installer weighs in at 26.6Mb, which is pretty hefty for what is supposed to be a v.lightweight language.
I'm thinking of using Lua as a scripting language for games, and perhaps as a fast development language for file processing like how Python or Ruby does it. So it must be something lightweight, not a 26.6Mb file.
Which is the appropriate one to download and start?
Luaforwindows, no doubt. It's simpler, easier and faster.
The installer comes with lots of stuff (Scite editor & several extra libs if I remember well). But the installer asks you before installing all those extra stuff. Just install the minimum and you will be fine.
Lua for Windows includes a handful of other, useful libraries and tools. The actual Lua executable included is still tiny, in the 1-2MB range as expected.
Having the extras there already will only make things easier, and disk space is cheap: go with Lua for Windows.
You may also want to check ZeroBrane Studio, which is only 4M download on Windows and is based on the same editor as SciTE that comes with Lua for Windows. ZBS also comes with 50+ Lua examples and few simple lessons to get started quickly with Lua programming.
Quoting from here.
Installation
The LuaBinaries files are intended for advanced users and programmers who want to incorporate Lua in their applications or distributions and would like to keep compatibility with LuaBinaries, so they also will be compatible with many other modules available on the Internet.
If what you want is a full Lua installation, please check other projects such as the Lua for Windows and LuaRocks.
Seems quite clear to me that you should download Lua for Windows.

How to create an InstantRails clone

I'd like to create a new InstantRails-type app for Rails developers who use Windows. It would be free & open-source of course.
Reasons:
Use nginx over Apache, especially
since the nginx guys are now
releasing original Windows versions.
Use the newest version of Rails.
I haven't developed a Windows app before. Could anyone please provide some general steps that I might look into to get something like this going?
For the most part InstantRails is just an encapsulation of all the software necessary to get things rolling -- Ruby, Rails, MySQL, Apache, and so on. There's no reason you can't package things up the same way; just look at how they do it. The only app you'd need to write is your equivalent of the manager, and if you're going to use a GPL-compatibile license, you could simply modify the InstantRails-Mgr.

Resources