It might not be new to you since develCuy.com got migrated to Ophal and deployed to production on January 2th 2014, but I wanted to make it official. Yet it was not a complete migration, there were not route aliases (equivalent to Drupal url aliases) by then, nor a comments module, so decided to make progress yesterday.
The last time I’ve used an interactive debugger was in the school, Visual Basic 6.0 used to have a nice one. That was 8 years ago, then I went to scripting and web development so debugging changed dramatically for me. So in PHP is different process, it was a bit tricky to get used to “print_r” debugging style instead of using breakpoints!
So, in the last few days, while struggling with lua-cgic (my first ever Lua extension yet to be completed), I found an I/O bug that forced me to remember: the use of breakpoints, C programming and learn GDB. All those three in a row!
GDB is an interactive debugger, basically you load a program, set breakpoints, run it and wait for the program to stop at some breakpoint. That is obvious for some people, and awesome for others like me :), just have to clarify that everything happens into a console, if you miss the graphic interface, try the GDB GUI called Insight.
With the purpose of testing Ophal in a real use case, just implemented a proof of concept.
The result is the pre-alpha of: MeQuejo.PE, which seems to be a news aggregator, but it really is a list of search results provided by Google Custom Search API, thanks to a search engine with several custom criteria. Such results are consumed with the help of Lua Spore module.
Con el fin de probar Ophal en un caso de uso real, acabo de implementar una prueba de concepto.
El resultado es el pre-alpha de: MeQuejo.PE, que a simple vista parece un agregador de noticias, pero en realidad es un listado de resultados de búsqueda provistos por Google Custom Search API, gracias a un motor de búsqueda con varios criterios personalizados. Dichos resultados son consumidos con la ayuda del módulo Lua Spore.
I were very frustrated with PHP in my very beginnings doing web development (8 years to date). But 2 years ago discovered my favorite programming language: Lua, and then decided to start the Nutria project. For more than a year I have tried several ways to “port” my web knowledge to Lua, and finally two months ago decided to do use my new Lua skills for real world web development.
And the result is: “Ophal… a highly scalable web platform, easy to maintain and extend. It is not married with a particular technology, just the essence will be kept on any major change needed to achieve its mission”. Let me remark that Ophal has many influences, but the highest comes from Drupal, more will be elaborated about it in the future. Also, I’m giving a lot of credit to Lua, but LuaJIT is the actual compiler used behind scenes.
Estuve muy frustrado con PHP en mis inicios en desarrollo web (8 años a la fecha). Pero 2 años atrás descubrí mi lenguaje de programación favorito: Lua, y entonces decidí dar inicio al proyecto Nutria. Por más de un año intenté varias formas de “portar” mi conocimiento web a Lua, y finalmente hace dos meses decidí usar mis nuevas habilidades en Lua para desarrollo web real.
Y el resultado es: “Ophal… una plataforma web altamente escalable, fácil de mantener y extender. No está casada con una tecnología en particular, solo la esencia se mantendrá en cualquier cambio mayor necesario para alcanzar su misión”. Cabe resaltar que Ophal tiene muchas influencias, pero la mayor viene de Drupal, explicaré más acerca de esto en el futuro. También, estoy dando mucho crédito a Lua, pero LuaJIT es de hecho el compilador tras bambalinas.
Lua was for long time one of the fastest programming languages, and perhaps sounds new to you but it is older than PHP. LuaJIT has emerged as an improved implementation that can make V8 look like a turtle.
Lua is an embeddable scripting language. If you are trying to embed it in PHP follow this instructions that may help you:
$ sudo apt-get install phpize liblua5.1-0-dev
$ git clone git://repo.or.cz/phplua.git src
$ cd src/
At this point you are almost done, BUT please edit the file Makefile and change the line:
LUA_SHARED_LIBADD = -llua
LUA_SHARED_LIBADD = -llua5.1
Then is time to finish cooking:
$ sudo make install
Almost done, do a test:
$ make tests #all will fail, that is fine by now
$ sudo apt-get install apache2-mpm-worker liblua5.1-0-dev
$ sudo apt-get install libfcgi-dev libapache2-mod-fcgid
Download latest version from: http://luarocks.org/releases/, extract it, open a terminal and do a "cd" into its directory, then:
$ ./configure --with-lua-include=/usr/include/lua5.1/
$ sudo make install
$ sudo luarocks install wsapi-fcgi