PHP Classes

Running PHP code with JavaScript and Python VM - Lately in PHP podcast episode 27

Recommend this page to a friend!
  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Running PHP code with...   Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  

Author:

Viewers: 15

Last month viewers: 5

Categories: Lately in PHP Podcast, PHP opinions

PHP applications popularity is so high that developers which prefer using other languages are trying to compile PHP code in languages like JavaScript and Python using new virtual machine projects.

That was one of the main topics discussed by Manuel Lemos and Ernani Joppert in the episode 27 of the Lately in PHP podcast.

They also cover the latest PHP releases and the new features planned for PHP 5.5, as well the new PHP elephant plush toys that were produced by the PHPClasses site to give away to the best contributors of the site.

Listen to the podcast, or watch the podcast video or read the transcript to learn about these and other interesting PHP topics discussed in this episode.




Loaded Article


Contents

Listen or download the podcast, RSS feed and subscribe in iTunes

Watch the podcast video, subscribe to the podcast YouTube channel

Read the podcast transcript


Click on the Play button to listen now.


Download Size: 27MB Listeners: 2937

Introduction music Harbour used with explicit permission from the author Danilo Ercole, from Curitiba, Brazil

View Podcast in iTunes

RSS 2.0 feed compliant with iTunes:

http://www.phpclasses.org/blog/category/podcast/post/latest.rss

In iTunes, use the Subscribe to Podcast... item of the Advanced menu, and then enter the URL above to subscribe to this podcast.

Watch the podcast video

Note that the timestamps below in the transcript may not match the same positions in the video because they were based on the audio timestamps and the audio was compacted to truncate silence periods.

See the Lately in PHP podcast play list on YouTube and Subscribe to this channel there.

Show notes

Introduction (0:20)

PHP releases version 5.4.6 and 5.3.16 (2:20)

A New Breed of Elephants (3:50)

The Finally Exception keyword in PHP 5.5 (6:02)

Running PHP in JavaScript with PHP.js VM (11:34)

Running PHP in Python using Hippy VM (19:10)

Latest JavaScript Objects released in the JSClasses site (34:34)

PHP Programming Innovation Award of June 2012 (42:27)

Conclusion (55:58)

Introduction (0:20)

Manuel Lemos: Hello, welcome to the Lately in PHP podcast, after three hours trying to set up everything, again with the Google Hangouts On Air.

Ernani Joppert: It's kind of 'Finally in PHP'.

Manuel Lemos: Yeah. [Laughter]

Ernani Joppert: It's not 'Lately in PHP'.

Manuel Lemos: Yes. I should rename this podcast to that, or something very similar.

Finally, this is Episode 27, and this time we have back Ernani Joppert as regular co-host.

Ernani Joppert: Hello.

Manuel Lemos: You have been very far and you have returned to your homeland.

Ernani Joppert: Yes.

Manuel Lemos: How are you doing, Ernani?

Ernani Joppert: I'm doing great. Sorry for the folks to be missed out, but hopefully everything will run smoothly and I'll be back regularly.

Manuel Lemos: Yeah. Don't worry, fortunately Michael Kimsal...

Ernani Joppert: Hopefully we will be able to manage this hangout situation because it's not stable yet.

Manuel Lemos: Yes. Google has to fix that.

Anyway, we have several interesting topics to cover in this podcast related to the PHP world. Well, actually, this past month, August, has been kind of slow. Not many things happened in the PHP world, probably because most people, at least in the North hemisphere, are on vacation, and I think they probably will only get back in September or so.

Ernani Joppert: Yep. Back where I was in Sweden, there was mid-Summer and the Summer, so I guess everybody in Europe hangs out on vacation at that period while us here at the South hemisphere party on Christmas and January.

Manuel Lemos: Yeah.

PHP releases version 5.4.6 and 5.3.16 (2:20)

Manuel Lemos: But moving on with the podcast, we are going to start with some, not many, subjects, things that have happened in the PHP world lately, starting with the release of PHP 5.3.16.

Not much to talk about, basically just a few bugs that were fixed, as well, PHP 5.4.6. It's basically the same thing, just a few more bugs that were fixed, about 20, as you may see on the page in PHP.net for this release.

Ernani Joppert: And hopefully not much of bugs introduced as well.

Manuel Lemos: Well, we don't know. I have seen comments about things that were broken, so maybe you should give it some time before you upgrade.

Ernani Joppert: Yeah.

Manuel Lemos: From what I heard, there is nothing really serious that would urge you to operate, so maybe there is no rush, unless you really need something that was fixed this time.

But other than that, there is not much to talk about, so we are going to move this time to another section of the podcast.

A New Breed of Elephants (3:50)

Ernani Joppert: Just so I'm curious here, I see lots of elePHPants behind you. What's going on?

Manuel Lemos: Yeah.

Actually, it is funny here. I have actually a question for you, because on my screen, it is blank. Do you see my picture or just a blank screen?

Ernani Joppert: No, I see your picture. Everything is...

Manuel Lemos: Something is just wrong on my side.

Anyway, back to the matter of the elePHPants. We've talked about that in the last month, and I see that you already got yours.

Ernani Joppert: Oh, yeah.

Manuel Lemos: This is the new batch of the elePHPants that was produced by practically myself, as I mentioned in the past. We used to order some elePHPants from Nexen, a company from France that used to produce them, but since Damien Seguy left the company, it seems that no new batch was produced and they are sort of missing in the market.

Therefore, I decided to produce these elePHPants, and hopefully they will be well-appreciated. They are not for sale.

Ernani Joppert: Oh not for sale?

Manuel Lemos: There are several people who have asked me if they would be for sale, but I only produced a few that would be to give to the top, some of the most prominent contributors of the PHPClasses site.

I produced a very small batch. It was not inexpensive. But I think it will be a nice symbolic gift to everybody, including yourself. You already got yours.

Ernani Joppert: Yes.

Manuel Lemos: Several other people got theirs.

As usual, there will be, actually there will be at least a prize to be given next year, which will include one elePHPant, to the winner of the Innovation Award that we'll be talking a bit more about ahead in this podcast.

The Finally Exception keyword in PHP 5.5 (6:02)

Manuel Lemos: But back to the actual podcast. I'm going to move on to the next topic, which is about some of the new features that are being planned or at least proposed for the upcoming releases of the PHP.

One of them is basically a proposal to support the 'finally' keyword, which is to be used in exceptions.

For those that are not familiar with this proposal, basically what it will allow is to have an additional section of code that you can add to your exception handling.

So besides 'try' and 'catch', you have also 'finally', which defines some code that will be executed regardless whether there is an exception being thrown or not. This is just to allow developers to implement some code that needs to perform some cleanup operation after the actual code that is inside the 'try' block.

Ernani, I have a question here. These 'try-catch' implementations of the exceptions in PHP were basically inspired in the Java implementations. I wonder, does Java also have 'finally'?

Ernani Joppert: Yes. 'Finally' is introduced, I guess, in Java, just because basically exactly what they require here, you don't have to repeat your code when you're done with the statements if you caught an exception or something.

If you have a 'finally' block, the 'try' block will try to execute, and if it falls into any exceptions, it will throw the exception and then execute the 'finally' code no matter what happens. And that's nice to see going on PHP as well because it works in Java, so why shouldn't it work in PHP as well?

Manuel Lemos: Yes. I think this is basic to avoid a work around that some people were doing, like you see on this page, the proposal.

Ernani Joppert: Yeah, and basically you see twice the mysqli_close function being called twice, which is unnecessary. So when you have the 'finally' one, you just have it once at the 'finally' block.

Manuel Lemos: Yeah.

Ernani Joppert: And you can be sure that the connection will be closed no matter what happens.

Manuel Lemos: Yeah. It is not just, it's actually people were just using 'catch' to do the cleanup...

Ernani Joppert: Yeah.

Manuel Lemos: ...and actually throwing the exception again. So it is handled by the upper level of the exceptions that may have been set up to trap any exceptions not handled by this block.

And I confess that I do not use much exceptions. I have gotten so much used to the lack of exception handling before PHP 5 that I never got used to use exceptions. But I think this will be quite useful for people.

This proposal was actually already approved. There is this...oh, I think it is approved. This part, it says here that it's still under discussion. But there is a vote and 25 people voted in favor of it and only five against it, so I think it is approved in practice.

I don't know in what release it will be made available, probably only in PHP 5.5. I don't know yet. Or maybe it will already be in some of the upcoming PHP 5.4. I don't know. But from what I heard, the plan is to make major PHP releases go out faster than before, not have to wait three years for the new versions.

I think this is a good thing. I don't know if it will be a very, very important thing to justify a new major release, but I think it's interesting.

Ernani Joppert: Yeah. It helps to make the code cleaner as well as more understandable instead of confusing. I think it's a good thing. Although it doesn't impact much on the whole thing, it's reasonable to see those things coming through.

Manuel Lemos: Yeah. Other than that, I think what is planned for PHP 5.5 is something that we commented on in the previous podcast, the so-called generators and the 'yield' keyword, which is still a bit confusing to understand. But we commented about it in the previous podcast; it's not necessary to comment about it again.

So from what I heard, the plan is to have some release of PHP 5.5 about December. So that's interesting because it gives a sign of vitality to the PHP not having to wait three years or some years for a new release.

Running PHP in JavaScript with PHP.js VM (11:34)

Manuel Lemos: OK, as I said, there is not much more to talk about in the PHP world, so I have other topics not so much related to PHP to talk about, starting from things that are related to PHP but not in the PHP world, namely some, how do I call it... virtual machines to interpret PHP code in another language, starting here with PHP.js, which is a new virtual machine that compiles it in PHP in JavaScript and executes it.

There was another project also called PHP.js which basically aimed to provide similar functions of PHP in JavaScript, but that's not the same project. This one that we see here is basically that. I don't know what could be an interesting use for these kinds of projects, why would you want to run PHP on...

Ernani Joppert: The browser.

Manuel Lemos: Yeah. Well, on the browser or on the server, because now you can execute JavaScript on the server with Node.js or some other server side implementation.

Ernani, do you have any clue what could be the purpose for these virtual machines to PHP?

Ernani Joppert: Yeah. You might say, if a developer has to deliver some things faster and he has more fluency on PHP, he can benefit from the PHP syntaxes, the functions, et cetera, as well as if merged to the server side, the internode, you can mix both codes of JavaScript and PHP.

But other than that, it's just trying to simplify the amount of languages that you have, which also could be something. But I think that the lack of, I'm not sure if it would perform.

I guess it would have a layer of processing that would probably represent something that may impact the JavaScript performance, and so far I'm not sure if it will be reasonable to put it into production code situations.

Manuel Lemos: Well, I don't know, because if you think, for instance, about Node.js, which runs on top of the V8 virtual machine developed by Google, which is the same that runs inside of Chrome to execute JavaScript on the browser side...

Ernani Joppert: Right.

Manuel Lemos: ...it's quite fast. And since in this case...

Ernani Joppert: Right. But the thing is, adding a PHP interpreter inside of a JavaScript interpreter, then putting everything on top of it, it's like it has to have a layer of understanding the PHP code before executing it or translating it into JavaScript, then to execute the JavaScript block.

So probably it has an added step there to interpret the PHP code. And even that JavaScript isn't yet at most speed; you see some lag sometimes.

Manuel Lemos: I don't know. In this case, it's not really a PHP interpreter. It converts PHP into JavaScript and then executes it.

Ernani Joppert: Yeah.

Manuel Lemos: When they call it a virtual machine, in fact they mean that some run-time libraries are implemented inside JavaScript, the PHP VM, as they call it.

Ernani Joppert: Right.

Manuel Lemos: I did not try it, but I do not expect it to be too slow.

Ernani Joppert: Yeah. I don't want to discredit them or anything. I just say that if you are using JavaScript to understand the PHP and translate it somehow to JavaScript, it has to have a step of processing, which is not the usual JavaScript code. So that's the only concern that I have on the performance side.

But sometimes it may be the case, because imagine, you already have some calculation functions which is very complex and it's already coded in PHP, and what you can do, just include it into a Web page and then benefit from that execution or the functions, then it's a reasonable thing. But I'd say it would start a new system and...

Manuel Lemos: Probably. That could be a good purpose for this project, which would allow to use PHP libraries in JavaScript could be their purpose.

I remember at least in the past, for instance, there were certain components that were only made available in Java, like for instance banking applications. They would only make available libraries in Java, and if you wanted to use them in PHP sites, you would have to use some Java virtual machine to execute that code from PHP, and then it could allow to access whatever was on the banking side like payment systems and things like that.

Well I don't know, it could be a similar situation, but this time it would be to use PHP libraries in JavaScript.

Ernani Joppert: Yeah. But since you are involved with JSClasses and the JavaScript world more than me, today if you use somehow a way of minifying your JavaScript or somehow obfuscate your JavaScript code, I think it's pretty much enough to have a safe application logic on the clients or on the JavaScript side of the client.

I wouldn't see people doing reverse engineering on those things. I mean, they could, especially on a financial institution, but they would require a lot of efforts to do so.

Manuel Lemos: Well, I was talking about Java components, but that was something very a long time in the past when PHP was not taken very seriously, and their idea is to provide some security layer on...

Ernani Joppert: Oh, yeah. I understand having those components in PHP, but my understanding is, would JavaScript's obfuscation and minification be enough for most of the scenarios, or would you think that it is still required to have some specific server components that...

Manuel Lemos: I don't know. In the case of that Java example, I was thinking about purpose to access some payment gateway, but the component would still run on the server side, not on the browser side.

So the idea was not to protect the access to the code, it was probably some cryptographic implementation that they only wanted to implement in Java, not any other language. I don't know. I'm just making a parallel here just to give an example of why would someone provide a component in one language to be run on another language.

Ernani Joppert: Oh, yeah.

Manuel Lemos: Maybe that's the case.

Running PHP in Python using Hippy VM (19:10)

Manuel Lemos: And talking about that, this leads to another project which is somewhat similar but not for JavaScript. It's for Python, which is probably even more odd, but the project does not seem to be so complete yet. It's called Hippy... I'm not sure how to read this because it's an invented name.

Ernani Joppert: Hippy.

Manuel Lemos: Hippy VM. Go and figure.

Ernani Joppert: They could probably rename it to -T VM. It would be somehow a name, because when you have a Python interpreter, you probably have to organize your code into tabs and everything. So it would probably make sense to have as -T VM. I mean...

Manuel Lemos: I don't know what the purpose is, because they show some performance charts here and they sort of claim that there is some improvement on doing certain operations in terms of performance, but it's still pretty much very incomplete. And if the purpose is to improve performance, I don't know if it would be worth doing this.

Ernani Joppert: Yeah.

Manuel Lemos: If you are going to optimize to as much as possible, because I think in the end they convert the Python code into C++.

Ernani Joppert: Yeah.

Manuel Lemos: But that's basically what the HipHop VM the Facebook project does. Well, now it has a dynamic translator for the just-in-time virtual machine, but the initial project was just to do that, convert PHP to C++ and then build a whole Web server application in a single executable that will do the same as the PHP code to handle the Web requests.

In this case, they are showing some performance figures, as it seems to be the motivation for their project. If somebody started this project but maybe they had a reason to do it like they have a specific purpose on which they probably have some PHP code that they wanted to run faster, but I don't know if this is the ideal way.

I also do not have experience with Python to evaluate this, but I don't know, Ernani, do you have any Python experience? Do you know this PyPy project and these libraries that they show here to provide any enhancement? What is your take on this?

Ernani Joppert: I think I've been involved into Python in the past for some situations, but other than that, I'm kind of away from it. And I've been digging into some AppEngine things about Python and Djangoe and those frameworks, but nothing very, very fluently. I mean, no real tools were built with it.

So I'd say, I can't say much about it, given the stage that I've been using Jython as well, which is a Python interpreter done in Java. But nothing major. So I would say, I would prefer to not say anything about it.

Manuel Lemos: Yeah.

Ernani Joppert: You have to edit your code with a -T and with a tab, so I'd say it's kind of another thing in the world of coding and indentation and I'd say...

Manuel Lemos: Well, there are always people in the PHP world that for some reason also deal with Python and might be interested in this project.

Ernani Joppert: Oh, yeah. For sure.

And Python is growing. I mean, it's growing a lot because of the Google ecosystem. Google uses its... I feel that if App Engine would run on PHP as well as Python, we would see that both communities could benefit from it. But, yeah, it's another alternative on the open source world and we should encourage them. I have nothing against it.

Manuel Lemos: Well, it seems that for that circumstance of the App Engine that Google only provides either support for Python or Java. If you want to use App Engine for some reason, you are restricted to that. There is the most requested feature of the App Engine project is...

Ernani Joppert: It used to have PHP.

Manuel Lemos: ...is to have PHP support, but for some reason they've refused to do it. I don't know, but I suspect that it's probably related with the fact that the creator of Python is the leader of the App Engine project. I think leader is the role of the Python creator, Guido van Rossum.

And I understand that being the father of Python, maybe he does not want to have PHP competition.

Ernani Joppert: Yeah.

Manuel Lemos: But which, from the point of view of Google, it does not make much sense because they are wasting the whole PHP market. They could attract much more paying customers to the App Engine platform, and this way they are sort of turning them down.

Ernani Joppert: Yeah.

Manuel Lemos: But we already talked about this in the past.

Ernani Joppert: Yeah.

Manuel Lemos: It's basically a Google problem.

Ernani Joppert: And we will still kind of meet Google about it, because, come on, we are a PHP community and we want PHP to be everywhere.

Because you see, the thing is I've been using PHP Fog for some projects, some concept projects, and I like the way they have it on the cloud and they provide you with a load balance or a proxy, etcetera, and it's very easy to use. I see that the world of PHP having alternatives to those kinds of services, it would...

Manuel Lemos: Yeah. Precisely. PHP is not exactly in need of App Engine, but I think App Engine would be much more similar if they supported PHP.

It's not just supporting PHP, for instance, in those so-called 'platform-as-a-service' hosting companies, not just PHPFog. There are several others. I've never tried it, but from what I understood, we actually had the CEO of the company here...

Ernani Joppert: Yes.

Manuel Lemos: He explained that you just can drop in your regular PHP code there and you do not have to change the code to make it work with its platform because basically they just provide scalability with several stuff on the environment that you do not have to be bothered to configure.

Ernani Joppert: Yeah.

Manuel Lemos: So although it will be probably interesting if AppEngine be available for PHP, the way it works probably is not very convenient because you have to adapt your code to work with their APIs.

Ernani Joppert: Yeah.

Manuel Lemos: It's not something that will work transparently with your...

Ernani Joppert: Yes. And on the Java side of your AppEngine, which I've been digging more about other than Python, you can't spawn any threads. So it's very limited in that sense.

And given most of the J2EE application servers, some libraries are compatible with that, but I've seen some applications that require to spawn threads or to perform other things that Google doesn't allow you to do. So it's...

Manuel Lemos: Too restrictive.

Ernani Joppert: Yeah. I'd say that having PHP with the power that PHP has is something. But kind of let's imagine that way Google would adopt PHP and put it on safe mode, then it wouldn't make any sense.

Manuel Lemos: Yeah.

Ernani Joppert: So that's what I think about it.

But to just give you an example, imagine most of the WordPress blogs hosted on such environment, such a scalable environment as App Engine is, that would bring lots of competition to the market, to the Google businesses as well as to other businesses like e-commerce applications, you have OS commerce, you have...

Manuel Lemos: Yeah, many.

Ernani Joppert: You have tons of other Open Source applications that could rely on those kinds of architecture. Still, we have PHP Fog that can do it. We have other PaaS environments. But Google joining it, it would represent a lot of opportunities for the PHP world, and that's what I would be looking for.

Manuel Lemos: I don't know. From what I understood, Google already had to adapt to the needs of the real world because, in the beginning, they only provided some basic key/value storage-type databases, and then more recently they sort of decided to actually support MySQL.

Ernani Joppert: Yeah.

Manuel Lemos: So because the world revolves around MySQL, although there are all these people that for some reason they are more favorable to NoSQL databases, Google adapts to the needs of the real world.

Let's say somebody wants to run on WordPress on the top of App Engine. Even if Google supported PHP natively, WordPress relies mostly on MySQL. And it's possible to...

Ernani Joppert: MySQL is an awesome piece of software, if I would say. I mean, PHP without MySQL support wouldn't be as big as PHP is, as most of the Web itself. It's sort of a combination. Now, we have Nginx for the HTTP side, we have SQLite for embedded applications, but still, I haven't seen anything compared to MySQL on the database side, and given that it can cluster, it can replicate, and it can perform referential integrity.

And, oh my, imagine if we would have to pay licenses for a vendor such as Oracle or Microsoft or any other database providers, I'd say that the Web wouldn't be as big as it is. And having PHP and MySQL combined would be a huge achievement for Google, in my understanding.

Manuel Lemos: Yes. Precisely. There was a certain fear when MySQL was sold to Oracle, that they somehow killed it.

And recently there are some news that it seems that Oracle might be holding off certain new features or bug fixes of MySQL. I don't know if this is true or it's some sort of conspiration theory.

But I think it would be bad, even for Oracle, because even for MySQL, there are lots of people that would like to pay for support for MySQL.

Ernani Joppert: Yes. Even though Oracle would do it, there are things that can't be... it's like a viral video. When it's on the Web, it's on the Web, and the source code of MySQL was open source before.

Manuel Lemos: Yeah.

Ernani Joppert: So there were some folks which forked it before it was sent to Oracle or bought by Oracle.

Manuel Lemos: Yeah.

Ernani Joppert: And I would say that it would only bring bad reputation to Oracle if they would do any sorts of limitations. If that happens in the future, I'd say the community is ready to address that situation in a good way.

Hopefully they will have the good sense and keep MySQL as it is. One of my key favorite software and, yeah, as well as PHP, is I'd say... If you are going to host a hosting environment, whatever that is, you have to have the ability to give to your customers a MySQL alternative.

Manuel Lemos: Right.

Ernani Joppert: It's good to know that Google at least improved in that sense.

Manuel Lemos: Yes. And regarding MySQL, there are already open source alternatives, not exactly alternatives but at least companies that provide Open Source tools that are alternative to some tools that Oracle only makes available to paying customers.

For instance, Percona DB provides tools for taking live backups of databases that are used InnoDB. And if you really don't want to pay, you don't want to rely on Open Source tool, you have a solution. But obviously, Oracle holding back new developments of MySQL, it's not good.

Ernani Joppert: I think it would draw a huge bad PR for Oracle if they would do it. And they are not very...

Manuel Lemos: Loved.

Ernani Joppert: Yeah, very loved by the community, especially the Java world was kind of concerned about the whole Android thing, and the Java and the Google versus Oracle. Oracle got a huge nudge by the justice, and then Google got a good reputation about it and was proved that Android didn't violate any patents and stuff.

But hopefully we are going to see PHP in such environments soon. Having MySQL support is also a good thing because now to have PHP is another, without MySQL wouldn't be benefiting from the whole PHP sense.

Manuel Lemos: Yeah. For me, the current MySQL versions work fine. I would probably not need much more developments that implement new features, only maybe security fixes, that it's not good to have.

This is already a bit off-topic. We are moving a bit off the PHP topics. But that's it, all that was related to this Python Hippy VM.

Latest JavaScript Objects released in the JSClasses site (34:34)

Manuel Lemos: We are now going to move on to one of our regular sections of our podcast, which today is sort of shorter because there are not many topics to talk about. So we are going to continue with a section on which we comment about the latest classes on the JSClasses site, which is the PHPClasses' brother site.

As I mentioned, this was a slow month. There were not many classes being published on the JSClasses site, probably for the same reason people are on vacation. But there are at least a few to talk about.

Ernani, please go ahead and tell us what JavaScript objects would you like to highlight this month.

Ernani Joppert: Yes. The first one would be regarding the JSClasses, right? And I'd say that Page Transitions is one nice object here from Arturs Sosins. I guess he has been a huge contributor. He's from Latvia. I like the effects that it provides to the users. Arturs has been a huge contributor.

Manuel Lemos: Yeah. I think if you can go to the...there is a link to a demo page. Maybe you could show some effects there.

Ernani Joppert: Yes. I'm trying to see if I open a new tab, I can still get the sharing out of it.

Manuel Lemos: Yes. Sharing is OK.

Ernani Joppert: Yes. There is a tutorial video here which displays...

Manuel Lemos: Yeah. There was actually a live demo, but I think that, I don't know if the tutorial is large enough for us to see.

Ernani Joppert: Yes. Is it going now?

Manuel Lemos: Yeah. It's coming. It's a bit slow, but it's coming.

Ernani Joppert: So you see that there are lots of functionalities here, to scroll page and to get the difference between traditional ways of animating your Web sites and getting huge effects out of these components and display transitions between pages.

At least presents to your user, the visitor of your Web site, the different ways of giving them the contents that you offer them. So I'd say it's a good component.

Manuel Lemos: Yes, it's very interesting. Arturs Sosins, also a big contributor to the PHPClasses site, sent this JavaScript component, as you said, to provide animations between two pages that you are navigating.

So it will sort of animate to the page when you leave and animate the new page when it opens, and it gives a very good effect. So kudos to Arturs for that.

Besides that, which other objects would you like to highlight?

Ernani Joppert: Yes. The other one is the JS Historical Date. It's from, let's try to spell his name correctly, Ihor Khomyn. He's from Ukraine.

It's a very nice component because sometimes you have limitations on the way you present dates, and this is such a common thing to have functions like global functions or some sort of utility classes to display dates and everything, and this package seems to be very useful.

The idea is to present dates in different formats or in different styles of display like Gregorian and other calendars and count years and count minutes and count everything that you try to put a time sense on it.

So kudos to him. I'd say that I'll probably be using this component in my implementations if I go through with those in the future.

Manuel Lemos: Yes. Although it seems a very simple object, what it does is something that go through traditional limitations of date manipulation objects and functions, which are restricted to a certain time range.

I don't know if JavaScript has that limitation, but for instance in PHP you cannot go before 1970, and Ihor implemented a solution that is able to deal with dates that can be in the ranges of billions of years, A.D. or B.C.

Other than that, he also provides, this is actually the JavaScript version of another class that he already published in the PHPClasses site that provides the same functionality but in PHP. So I think it is a great contribution.

And for myself, I'd also like to highlight a couple of components. There are a few more, but we don't have much time to comment on them.

I would like to start with the Matrix Operations by Jon Lawrence. This is again a JavaScript version of another class that he published on the PHPClasses site for the same purpose, to implement operations, to manipulate your matrices.

This can be useful for many purposes. Although he did not provide a specific example, this class is meant to be, can be used for purposes like image transformation when you apply some matrices to implement some filters.

And this can be very interesting for that purpose or any other purpose that I am not envisioning here, but there could be many other purposes. So kudos to Jon Lawrence from the United States for his contribution.

Other than that, I also would like to comment on a framework by José Manuel Carnero from Spain. This framework is very, very similar to jQuery. It allows you to manipulate elements of the DOM of Web pages and their properties. This is somehow similar to jQuery because you can use a sort of selector expressions to point which elements you want to manipulate.

Other than that, it comes with some plug-ins to perform AJAX requests and move DOM elements around the page. This can be an interesting replacement for jQuery in case you think jQuery is too large. And since this package is simpler, I think it can be very useful.

And given that, there will be other packages of JavaScript to comment on, but unfortunately we do not have time.

PHP Programming Innovation Award of June 2012 (42:27)

Manuel Lemos: We need to move on to the next section on which we comment on the latest classes nominated to the Innovation Award in the PHPClasses site.

Before that, I just wanted to comment on one thing, which is the fact that, just a reminder. I already mentioned this several times, but this is somehow related with these fellows here, these elePHPants here.

The JSClasses site still did not start the Innovation Award, and as I mentioned before, there is this challenge that the Innovation Award will be starting when it reaches like, I would say, there is this goal of, I fixed it to be, 200 packages. So when the JSClasses reaches this number of 200 packages contributed to the site, the Innovation Award will be started.

But to encourage people to send already their packages is this challenge that will reward the top five contributors of notable JavaScript objects. They will get one of these elePHPants as a symbolic reward for being such good contributors and helping the site to get to this level of amount of contributions.

As you may see here, 85% of this challenge was accomplished, so there are only 29 packages remaining to reach the goal of 200 packages. And I think...

Ernani Joppert: Wow.

Manuel Lemos: ...now that people are returning from vacation, they can start sending more and more objects so we can start the Innovation Award sooner. Because once the Innovation Award is also started in the JSClasses site, there will also be sponsors giving away interesting prizes to the innovative packages. It will be interesting.

Here in this space, there is an estimate of when this challenge will be accomplished. It estimates in about four months. But if people continue to send more and more packages, it will get to that goal sooner.

Ernani Joppert: That's nice. That's nice to see.

Manuel Lemos: Yeah. There is a great adoption at least until before this summer vacation in the North hemisphere, and we hope after the vacation people get back to a greater submission pace. So that is just to remind of this challenge.

So we are going to move on with talking about the PHP Classes Innovation Award challenge. We are going to talk about the...

Ernani Joppert: Winners of June, right?

Manuel Lemos: Yes, right. They submitted their packages in June, and they were nominated in July and in August the results came out. Also probably because they were on vacation, there were not many nominees, just five, so let's talk a bit about them. Ernani, would you like to start?

Ernani Joppert: Yes. I have chosen two packages. One has the ability to run nmap security audit tool through the Web interface, and it was provided by Karl Holz. He's from Canada.

It's a very nice component because at least you don't require to log in to a specific machine to do it. Sometimes you are limited where you are, especially now with the mobility situation where you have limited ways of performing such commands, especially if you are into a telephone, a smartphone, or a tablet device. You can execute those...

Manuel Lemos: Well, anywhere.

Ernani Joppert: Yeah, anywhere but especially on those limited situations where you don't have the access to the shell and you need to perform it. So it has a very nice front end here based of the pictures.

And you can perform SYN stealth or Fast scan by any chance, and ping anything and check if the results have been responded back. So it's a very nice component, and it amazes me to see the ability of users to be so creative.

Manuel Lemos: Yeah. Well, more than just for situations in which you do not have access to the shell and the nmap command, it's also more user-friendly to have a forms-based interface to pick options.

Ernani Joppert: Oh, yes.

Manuel Lemos: Sometimes they are not very obvious when...

Ernani Joppert: Especially for users which are not familiar with the shell script or the binary code.

Manuel Lemos: Right. It's also easier to click on the options on a Web page. They don't have to type the names of the options. Sometimes they're long and not very obvious.

So kudos to Karl for his contribution. He has been sending quite a lot of good contributions. I hope he continues to do so.

OK, other than that, which other classes would you like to mention?

Ernani Joppert: Yes. The other one is the input validator. Although it's a non-trivial Input Validator because it uses XML Schema to validate arrays, it's a very nice way to see abilities of the users to come up with a way to validate information which can be a painful situation sometimes.

And by defining an XML Schema or XSD file makes it easier for users to document requirements. And by documenting those in an XSD, you can benefit from it, so you can validate structures of data, which can be passed as Web services or any other ways.

And having those in arrays can be used for both SOAP, for AMF implementations where you have the Adobe message format. So I see lots of benefits of using this component.

Manuel Lemos: Right. Actually this is to validate data in array, so it could also be to validate the data in forms.

Ernani Joppert: Yeah. And the author is Tom Schaefer from Germany.

Manuel Lemos: Yes. He has contributed quite a lot of very good classes. Many of them have been nominated. And this does actually something more than just what you mentioned.

XSD is not exactly a trivial format that everybody's familiar with, so if you want to start defining rules in XSD, you don't have to actually learn it. What it provides is a way to give an array of sample data that you want to validate. You can build a proposal for an XSD file with the basic definitions for the types of the values that are coming and you can validate them.

You can actually improve that XSD to make more strict validations. But if you don't want to learn how to define that XSD file, it gives you a head start to generate that XSD. And this is quite a good, I would say, a class to implement this goal, which is not very trivial.

So kudos to Tom for his contributions. I'm sure he will keep contributing with even more impressive classes like this.

On my behalf, I would like to talk, well, let's talk about the other three because this month there were not many. We usually comment about four, but since we would leave one out if we just comment on those four this month, let's comment on all.

OK, let me open here the page. Let's start talking about this Click-tale class from Frederik Yssing from Denmark.

Basically, what it does is it implements a way to track clicks that you do on a page, not only the clicks that you do on links but also certain clicks that you do on other elements. It can keep track of the positions of the clicks and then show some graphs with the...

Ernani Joppert: Heat, the heat and the graphics.

Manuel Lemos: Yeah. I was trying to remember what is the name. Heat map of the...well, I don't know if you call it a heat map. Usually you call a heat map when you have certain ranges of colors being used to represent more frequent clicks in this case.

Anyway, this is a very useful component and it can be implemented transparently on a page because it uses AJAX requests to communicate the information about the clicks to the server.

I don't know if users that are concerned with privacy would mind having this information to be tracked, but as long as you are in a page, many things can happen. And maybe probably it would be nice to put a disclaimer for users that maybe do not want to have their clicks tracked.

But, OK, and the purpose that I see for this package is to, for instance, study the usability of the page and see if you put certain parts of the page on one side will work better than on another side. And it can be helpful for that purpose. So kudos to Frederik for this class.

Ernani Joppert: That's very nice.

Manuel Lemos: Yeah.

Moving on, I would like now to talk about Fuzzy Index from Philipp Strazny which was the winner of this month.

Basically what this class allows you is to index some text to perform what is called 'fuzzy search', which allows you to search for words that may not be exactly the way they are represented in a certain text, and what the class returns is a snippet of the section of the text on which those words that you search appear.

This can be very, very useful for search engines, could be for Web pages, but not necessarily just that. It could be, for instance, extracting the text from a PDF document and build some index using this class for searching it. And when you want to present the results, you could use the class to show a snippet of the part of the document where what you search appears.

So this is quite impressive and it gives a lot of flexibility because it allows you to store the index in a SQLite database, which can be very fast, but if you prefer to use some other database, you can extend this class and implement some database access adaptor code to support the other types of databases you may find more convenient.

So, again, kudos to Philipp for this contribution.

And now, finally, I would like to comment on the remaining class I did not comment on, which is Ternary Search Tree by Chi Hoang. He already contributed several classes for somewhat similar purposes, and this one is probably not very obvious what is the purpose for it but it is basically to build trees of text to be searched in a more efficient way using the ternary search algorithm.

I'm not going to enter into much more detail than this because that's not really the purpose here. We probably don't have the time. Anyway, kudos to Chi Hoang for his contribution.

Conclusion (55:58)

Manuel Lemos: And I think with this, we basically conclude this podcast. As I said, it was a slow month, August, and there are not many things to comment about.

And I would like to say goodbye just inviting everybody else to keep contributing and sending their contributions.

Just as an anticipation in September, I plan to make some very interesting releases of new features that will encourage even further the authors of the site, not just the authors but also other kinds of contributors, for instance people that bring more users to the site, using the friends of the site initiative, as well as users that, for instance, rate packages. When they rate packages, they help the other users to find out which are the most appreciated packages in the site.

I'm not going into much detail right now, but I can promise that what is being planned, I'm finishing to implement, is very interesting. And with this, I would like to conclude.

Ernani, any final remarks?

Ernani Joppert: Oh, yes. Thanks, everyone, for being here with us. We've had some issues with Google Hangouts, but hopefully we'll be able to watch it later.

We appreciate any comments, any constructive comments, so please feel free to do so. And stay tuned for latest episodes where we will try to plan ahead and let you guys be aware.

Other than that, thanks a lot and thanks for the contributions, and for the opportunity as well, Manuel.

Manuel Lemos: OK. Well, with it, that's all for now. Bye.

Ernani Joppert: Thank you. Bye-bye.




You need to be a registered user or login to post a comment

Login Immediately with your account on:



Comments:

No comments were submitted yet.



  Blog PHP Classes blog   RSS 1.0 feed RSS 2.0 feed   Blog Running PHP code with...   Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)