Author: Manuel Lemos
Viewers: 10
Last month viewers: 3
Categories: Lately in PHP Podcast, PHP opinions
They also discussed the interpretation from VentureBeat that Zend is working on mobile version of PHP, using abstract syntax trees to optimize PHP further, and creating classes that provide APIs that are simpler for the users.
Now listen to the podcast, or watch the podcast video or read the transcript to learn more about these and other interesting topics of the PHP world.
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
Introduction music Harbour used with explicit permission from the author Danilo Ercole, from Curitiba, Brazil
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
- Article from VentureBeat saying PHP coming to mobile according to Zend
- PHP 5.4.7 and PHP 5.3.17 releases
- Better PHP compilation using AST
- Article on Processing XML with a single PHP call
Read the podcast transcript
Contents
Introduction (0:21)
A Mobile version of PHP from Zend? (2:02)
PHP 5.4.7 and PHP 5.3.17 releases (6:48)
PHP 5.5 Release Date and Plans (8:00)
PHP Abstract Syntax Tree (AST) Compilation Step (12:20)
Simpler PHP APIs that require Less Calls (20:30)
Latest JavaScript Objects published in the JSClasses site (37:01)
PHP Programming Innovation Award Winners of July (50:15)
Conclusion (1:03:43)
Introduction (0:21)
Manuel Lemos: Hello and welcome to the Lately In PHP PodCast, this is episode 28. And after a long struggle to schedule the recording of this podcast and facing all the technical challenges that every month we need to deal with Google Hangouts. Finally, I think we're going to make it. I think, I'm not sure.
Ernani Joppert: Oh, yeah. Hopefully.
Manuel Lemos: Yeah. But this time we managed to record it and we're going to start it. So, like to start as usual greeting Ernani for once again making to come back to the podcast.
Ernani Joppert: Yeah.
Manuel Lemos: It's always a difficulty.
Ernani Joppert: Yes.
Manuel Lemos: How are you doing Ernani?
Ernani Joppert: I'm doing great, despite the issues, power outages, Internet lacking. And now a working machine, so hopefully this will be the future.
Manuel Lemos: Yeah. Google Hangouts always requires modern computer with a powerful CPU, probably no less that Core i5 or similar. And if you don't use a powerful enough CPU, the recording starts becoming very blurry. I hope the image is coming OK this time to our listeners. So this month we have several interesting topics to talk about.
A Mobile version of PHP from Zend? (2:02)
Manuel Lemos: Before moving the usual news about the latest developments of PHP, recently I found an article in the VentureBeat site.
Let me see if I can share the screen so you can see that as well. And basically this article is mostly an interview with Andi Gutmans from Zend, and it's a bit curious what they say about it. I don't know -can you see the picture of the?
Ernani Joppert: Yeah, I can see it.
Manuel Lemos: Because on my end it's totally black, but if you can see it, I hope it is coming OK in the recording.
And well, this article as I said it's an interview with Andi Gutman's. There are many topics they cover regarding the apparent loss of popularity of PHP which in reality is not just PHPs, just other language became more popular outside of the usual scope of PHP which is the Web.
I think that is mostly to the growth of the mobile market. We can see that languages like Objective-C that they do not show in the graphics, but have seen it in the Google Trends graphics that Objective-C has become popular because the iOS development also became popular.
Anyway, the thing that I want you to comment about this article is that they seem to be interpreting something that Andi said about the future of PHP which is related with mobile.
Ernani Joppert: Oh, yeah.
Manuel Lemos: And they seemed to be interpreting it as if he is saying that there will be a version of PHP specific for mobile development, and I don't think that is the case, though.
Well, if that is the case, it's totally new to me. Anyway, this seems to be just an interpretation of the reporter because as far as I can read from the interview, nowhere Andi said that there would be a mobile version of PHP, I mean, a version that would be used to run native mobile applications like those that you develop with Objective-C for iOS or Java for Android other platforms.
Ernani, did you read this article? What was your interpretation of what the reporter said?
Ernani Joppert: Yeah. It's kind of fuzzy and waiting the PHP community I haven't heard anything, so I'd say that this is something out of nowhere, and I think somebody is like behaving here.
I can't say anything else other than I don't know what is being put on their food, but hopefully this is not a plot of Monsanto as well.
[Laughter]
Manuel Lemos: Oh, we never know. Anyway, the jokes apart, it seems the reporter was trying to figure something fantastic about what Andi said and interpreted it in a way that was sensationalistic in reality there is nothing sensational about what he said.
Probably what Andi was talking about regarding the mobile support in PHP from Zend is probably some packages and classes in Zend Framework that make it easy to develop Web applications for mobile devices, I think.
Ernani Joppert:Yeah.
Manuel Lemos: But still they are web applications. Well, I don't know if there is anything new specific for in the mobile world in the development of PHP. I think we would know already because most of PHP development is public. There is really nothing secret about PHP development or maybe some Zend product that we don't know yet, but I doubt it that it is the case.
Well anyway, we have to wait and see if there are any surprises there, but I doubt that's the case.
PHP 5.4.7 and PHP 5.3.17 releases (6:48)
Manuel Lemos: And now we're going to move on with another topic. Now actually commenting on the latest developments of PHP, the latest versions. I was trying to screen share here which is always a challenge. OK. I think it's coming now.
Well, nothing unusual, just a few bug fixes that have occurred and they have launched the PHP 5.4.7 and PHP 5.3.17 at the same time.
Basically just a few bug fixes, nothing that should worry you that rushed to an eventual upgrade. It's always good to upgrade to version that is less bug free, but sometimes newer versions have more bugs than previous because sometimes it happens that what was fixed eventually broke something or somewhere else. Anyway, just leave it that information about this newer version of PHP. And let me stop screen sharing here.
PHP 5.5 Release Date and Plans (8:00)
Manuel Lemos: And just to move on with the podcast, and start talking a bit more about newer versions of PHP beyond PHP 5.4 specifically there are plans for PHP 5.5 which basically consist of features that were already proposed.
And as you may see here, I'm trying to increase the font so you can see or reread it, I'm not sure if it is readable in this small screen that Google Hangouts capture. Basically there was message from David Soria Parra which is one of the maintainers of PHP 5.4. And he's talking about the work in PHP 5.4 and the plans for PHP 5.5.
And there are specifically mentioned things that were already proposed and in some cases there were already some working implementations of feature like using the list function, actually I'm not sure if you can call it a function, but the list probably operator with a foreach statement to iterate over multiple parameters that come out of arrays multiple values, and as well the generator feature that we have talked already about.
And when new feature that is regarding having stronger passwords, stronger hashing verification of passwords using the PBKDF2 algorithm, and there is no implementation for that in PHP.
And all that is planned to be made available in PHP 5.5. And according to the plans they intend to make it available... well, this is just a guess on when it will be available. They plan to make a first release about February and March of 2013. Well, this is just a plan, we don't know if the world still exist by that time.
Ernani Joppert: Yeah. For sure.
Manuel Lemos: Well, jokes apart, anyway the proposal is to hand over the release management task to Julien Pauli which his role is to manage all the releases of 5.5 of PHP. And well, I confess that I haven't heard about Julien until now, but if David, sorry is recommending him, it's because he knows that Julien is up to the task.
And I think both David and Stas Malishev which was the other maintainer of PHP 5.4, did a great job. It is not easy to put with all the discussions and plan all the releases. First, it would be a job I would not like to have ever because it's complicated.
Ernani Joppert: Time consuming.
Manuel Lemos: It's not just that, just the discussions among the PHP community, you have to deal with all the disagreements and see what is the best compromise, and make sure that whatever is best represents the sentiment of the most....
Ernani Joppert: Everyone.
Manuel Lemos: Well at least the most influential core developers and try to reach a solution that really takes PHP forward.
Well, I think that they did a great job as mentioned before and congratulations to them, and good luck to Julien for the upcoming versions of PHP namely PHP 5.5. And if the world does not end, hopefully we'll have a bright future.
Ernani Joppert: Yeah. For sure.
PHP Abstract Syntax Tree (AST) Compilation Step (12:20)
Manuel Lemos: Yeah. Well, regarding PHP 5.4 plans, that is mostly all that I have read about and I also like to comment a bit about something that is being proposed specifically by Nikita Popov. I opened the screen already in the page of the proposal that they submitted which is basically...
OK. Let me start screen sharing, and so you can see it as well. It didn't work. It is...
Ernani Joppert: It's showing itself, yeah.
Manuel Lemos: That happens when you miss the window.
Ernani Joppert: Loopholes.
Manuel Lemos: I don't think I missed the window, but well it's like you are seeing it already the correct page, we increase the font, so you can still read it a bit.
Basically it's a proposal to change the compilation process of PHP. Well, this is a bit confusing for some users that are not familiar with the fact that PHP itself is compiled, it's a compiled language. Not compiled in the sense that it will generate an executable program like traditional compiler.
What it means is that first there is a phase that processes PHP source code, and generates a sort of a byte codes similar to Java byte codes, but they stay in memory, it's not like there is an intermediary file that is generated like Java byte codes that results from compilation of Java source code. That process usually results some equivalent to Java byte codes which are called Zend op codes.
And the proposal of Nikita is to have an intermediary step that would split the process first and then parsing the PHP and generating an Abstract Syntax Tree which in short is spelled AST.
And the idea here if I got what this proposal is all about is to have introduced new types of optimization that would result of reprocessing the output of that Abstract Syntax Tree compilation. This is not a trivial topic, probably many users that are listening now, do not quite understand what I'm talking about.
But it seemed to me that it was a good proposal. And since that would allow several things including more and better optimizations of the final code that PHP executed.
Ernani, are you familiar with the compilers and all these technology that when you run PHP code, it is implicit, but it's something that happens and makes PHP run at a reasonable speed?
Ernani Joppert: Yeah. For sure. I know some of the details about compilers, but it's not much in the sense of being able to write it on my own. But yes, I understand that having some approaches on that level would probably bring benefits to the PHP.
Based on my experiences writing C applications, I'd say that despite that C is fast and has lots of power, PHP benefits from it based up on the similarity of the syntax as well as... I'd say that's the calculation of PHP, the process of byte code generation which is the parsing of the source code is where the bottleneck relies. And this is probably... could be crazy, but this is where I believed that most languages lacks performance out of...
Manuel Lemos: Yeah.
Ernani Joppert: And despite that, this is my personal opinion.
Manuel Lemos: Right. Well, usually when you need to take the most of PHP in production environment, what you need to do is use a caching extension like APC, or XCache, or eAccelerator, one of those because they allow to skip the initial compilation step. It would be silly to recompile PHP.
Ernani Joppert: All the time.
Manuel Lemos: Yes, on every execution. And that is something that is over the years that has been complained that PHP does not ship with a caching extension. There is always sort of a struggle when that topic comes in PHP internal's list.
I don't know maybe this is somewhat related with the fact that Zend also as a commercial product that does the same and maybe they fear certain loss of market if an open source version of caching extension comes with PHP out of the box.
Anyway, the extensions exist for some reason you do not want to use a commercial caching extension, you can always compile those open source caching extensions manually.
Personally I do that since for many years, I have just change the beat of the versions. In the beginning I used to use the Turck MMCache originally from Dmitry Stogov. And then they moved on to... actually Dmitry went to work for Zend, he got a job invitation. And somebody else took over the project and renamed it eAccelerator.
But there are others like APC as I mentioned which is under PHP.net umbrella and everybody could use it. And not have this problem of the recompilation.
Anyway, what has been talked about here AST intermediary step, it's an additional step, it does not have to do with the use of the caching extensions or not, it would be an additional step like splitting the compilation phase into parts: first generation of the abstract syntax tree that represents the PHP code that has been compiled, and then the processing of that abstract syntax tree to actually generate the op codes, or byte codes if you prefer to use the Java or nomenclature.
And well, as Nikita proposed the idea is to finally generate even better opcodes to make PHP eventually run a bit faster. I don't know how much faster it could run, but well first let's see if the proposal passes because it is something that is being... there is a call for votes.
Ernani Joppert: Yeah.
Manuel Lemos: I don't think the votes started, it's still under discussion, but OK, let's wait and see what comes out of this discussion. It's not trivial matter, probably most people will not even have the necessary knowledge to participate in the discussion. But OK, that's just a topic and we will have to see what comes out of it maybe in a few months if there is any progress.
Simpler PHP APIs that require Less Calls (20:30)
Manuel Lemos: Well, anyway moving on with the next topic of the podcast. I would like to comment a bit of an article that I wrote in the PHPClasses site. I'm trying to screen share it here.
Well, basically I would like to make comments about this, first this is an article that appeared in PHPClasses blog, but is part of a blog of a package that I have developed namely an XML parser that it's just a generic XML parser, but sometime ago I decided to implement a sort of an enhancement that makes it more straightforward to actually validate and parse XML.
And on that, I'll comment more about that, but the other comment first before that is the fact that in PHPClasses site every package that is published is entitled to have its own blog, and every author can submit articles like this to their own blog.
And there is an option if the author of the package feels that their article is interesting to other people not just those that are interested in his package, can flag that article as featured. And it is submitted for moderation and if it is considered to be useful to other people not just the users of the classes I mentioned, it becomes feature as part of the PHPClasses blog itself, so it gets even more exposure.
And this is an additional way for developers that submit classes to the PHPClasses site to get more exposure. Well, regarding that comment that this is all that I wanted to say.
But now back to the actual article, I would like to make a broader comment to which is regarding the way people develop classes.
When you develop classes for yourself, you know all the code that you have written and the way it works, but when you share that code with others, they have to learn your APIs, what functions and variables that you have used in your classes. And the less they have to learn, the faster they get into the class and start using, taking advantage of it.
And the proposal of this class is to do something... well, it's not exactly in a single step, it's a couple of steps to first parse the XML and second to validate and extract elements... information from the XML document.
The traditional way using APIs like DOM to process XML in general, it's a bit of a pain because you have to find the nodes you want to parse and then see the contents of those nodes traversing those elements.
And doing that for every type of XML document that we may need to process is tedious and requires a lot of code. And certainly that's not the ideal way. So what this class provides as an alterative approach is to have just a single call that you can invoke to parse the XML, and then another call to validate and extract.
That call takes up as argument an array we parameters that tell what is the structure of the document that you expect. So the class just with a single call validates, actually checks if the structure is what you expect, and extracts the information from the nodes the tags, whatever you have there inside.
And the parameters that you pass to that class just define the tags and how many times tags can appear inside of an element. And this is done using an associative array that is eventually a recursive, I mean nested, so you can define all the types of tags and their contents, and how you expect them to be processed including some validation rules that you can define there.
And if the document defined is found to be invalid It just fails, otherwise it returns a structure of data that contains the parsed data and I'm trying to show you the document, all that data that is returned. And it makes it very easy to process by your applications.
Well anyway, the point of this article regarding is mostly about this class, but I would like to make a broader comment which is what I think would be better for developers to write their classes to make them easier to use which will require the least possible knowledge from the users to start using them.
In this case it's just a single function call just to validate and extract, and it will just need to figure the parameters that you need to pass, and all that is documented. And I think if you can do it with just a single call, why would you make the user do the tasks that they are necessary to use the class to use in several calls.
So what I'm trying to propose here is to make simple APIs in the classes to simplify the development from those that want to use your classes. Ernani, I don't know if you have an opinion about this. What are your thoughts?
Ernani Joppert: Yes. You mean regarding the parsing of XML and the functionalities of audit right?
Manuel Lemos: Well, in general the idea making simpler APIs, in this case it was for parsing XML.
Ernani Joppert: Right.
Manuel Lemos: I'm going to write a new article. I didn't want to comment much about that because it is not out, so I have not figured all about I'm going to write, but it's basically about a new class that is meant to process all the interaction with OAuth servers.
It's about a new class that I have released and the API is once again is very simple just a few calls, you don't need to learn all the protocols.
Ernani Joppert: The ins and outs, yes.
Manuel Lemos: Yes.
Ernani Joppert: I think, dealing with XML for an extensive time amount and on my day to day activities I used to, I have to deal with XML, despite the growth of JSON format and mostly all JavaScript frameworks being integrated with JSON.
XML still coexist and for some web servers especially SOAP protocols and Axis which is the latest version of SOAP, the implementation of Apache Axis for Java also outputs the contents in XML.
And yes, having those functionalities such as this class provides makes the life of the developer very easy because first of all you don't have to go and traverse throughout the document to see when the element begins, and when it ends
And having to externalize this inside of utility class or a component or something else and having a way of generically validating or exactly parsing a document makes the life of the developer very easy.
And this is what I like about PHP because you can do so much with there is still too much to go through, and people are always trying to go into new stuff, but as you are doing here within this class you're exploring the needs as it goes. And this proves that it is to require to have better implementations and better functionality of such cases, as XML for instance.
Manuel Lemos: Yeah. You have work and then it still work in your day job so to speak with the Java. First I would like to comment that what I did in PHP it could be done in Java. There is no reason why it could not be done in Java.
However, I like to make the following comment that I'd like you to tell me what you think from your perspective as Java developer. The Java world tends to be more complicated, not because of the language, but because of the people that are involved in the Java world, they have a complicated mentality. What do you think?
Ernani Joppert: Yeah. There is a convention. There is a convention of how to develop stuff and how to name classes and how many lines the method should have, and how you should write your variables. You should try to use CamelCase especially for variable declarations and methods.
Manuel Lemos: Yeah, but that's just style. I mean the methods that they use, they try to complicate things, they try to make things that will work even underwater, on Mars.
Ernani Joppert: Yeah.
Manuel Lemos: And the situation is that they are not realistic, they are very complicated and were really not necessary I think.
Ernani Joppert: Yes. I agree with you, I truly agree that they focus on stuff because the idea of Java is to avoid repetition. So whenever you have two lines of codes where you call function, or you call the exact same code, you should extract it and put it into a specific method.
Manuel Lemos: Right.
Ernani Joppert: So that's the principle of having components such as objects and stuff.
Manuel Lemos: But that should reduce the amount of code that you write, but when you actually see a program written in Java, it's much more lines of course that you have to write to do the same thing in PHP. Where does that complication come from in your opinion?
Ernani Joppert: Yes. I can't say exactly if that statement is indeed true when you have more lines. The thing is of course in Java you have to specify a type in which in PHP you don't, so that's on a declaration of a variable especially.
You would see, if you name your variable the same name of your class, then you're probably having at least a double amount of code as if you would be doing with PHP because you probably are typing an object that begins with an upper case character, and then a variable declaring the object, and the new call which provides a new instance of it.
So, I guess that this is where it comes from because Java is a strongly typed PHPs somehow dynamic because of the zval, which is part of the engine then it makes things a little bit more friendly to the developer compared to Java, but in the end those languages are very similar on the logic of concepts.
And I'd say that yes, as you've said, things could be done that way in Java, but people try to focus on componentizing things and I see that the most challenging effort to learn something in Java is that you have to know all the calls to actually accomplish one thing. And there are tons of different API to parser XML.
So, if you go with this sort of Java consortium, right? Then you have a specifics, then you have an open source implementations out of that, so it makes things a little bit confusing.
Manuel Lemos: Yeah. Well, as I said to what I did in PHP could have been done exactly the same way in Java, maybe it would take just a few more lines because of the variable declaration as you mentioned, but what I see the problem is more in the approach in solving the tasks.
If you just want to parse and validate, actually validate and extract data from an XML document, why would you need two calls if you can do that in one call.
Ernani Joppert: Yeah.
Manuel Lemos: Because you always need to do that.
Ernani Joppert: In the end it's just when you need to get things done, you can get things done in any language. But I think that's when people are writing libraries, they tend to be more holistic and try to accomplish something with a greater scope.
But yes for sure when you need to get things done and to actually do what you need, you can do it way simpler than probably it's done already by somebody else.
Manuel Lemos: Yeah. Actually this is not a complaint or let's say language war. It's not Java versus PHP, it's more being complicated against being simple. And I recall that for instance Ruby on Rails was started mainly because the developer did not like the way things are done in the Java world.
Everything has to be configured with an XML file, well they replaced that with YAML files which are more simpler to type, you have less tags to open and close, to represent the same thing.
Now we have JSON this is better than YAML, because YAML is a syntax that is not obvious to everybody and JSON based on JavaScript everybody knows it. And JSON is even better.
But it's not just that, there are things like convention over configuration. Everything in Java, people say 'Oh, you have to configure this in an XML file or else nothing will work.'
The default will always require you to go through the XML configuration file pain. And that is just an example. For my point of view it's not exactly PHP or Ruby versus Java, it's just what I said being simple against being complicated.
Well, I think about that we would have a lot more to talk about. We could spend whole shows talking about this.
Ernani Joppert: For sure.
Latest JavaScript Objects published in the JSClasses site (37:01)
Manuel Lemos: But we need to move on. And now we're going to move on to one of our regular sections of the podcast. First we usually comment about the latest Javascript objects published in the JSClasses site.
And let me just screen share here, well, the list I hope you can see, maybe I should increase the font. Well, from these latest, which ones would you like to start commenting about, Ernani?
Ernani Joppert: Yes. I'd say normally we'd start to comment about the preferred, right? But I have opened here in my tab, I can begin with the Crazy Uploader.
Manuel Lemos: OK. Can you share it?
Ernani Joppert: Yes. I can do that. Give me one sec.
Manuel Lemos: If it doesn't crash.
Ernani Joppert: No. I don't think it will. I was having a window situation with my Mac. I probably have to kill it and restart it.
[Laughter]
Manuel Lemos: Don't, don't, please don't do that. It's the same thing on Windows, sometimes the shared screen appears blank to me and then I have to ask you if you are seeing it?
Ernani Joppert: Oh, yeah. Let me see if that's the right window.
Manuel Lemos: OK.
Ernani Joppert: I think so.
Manuel Lemos: Can you just increase your font?
Ernani Joppert: For sure..
Manuel Lemos: It's probably Ctrl + key. Yeah, that's fine.
Ernani Joppert: Fine or too big?
Manuel Lemos: No. It's readable. I think you cannot increase it further because it would go out of screen.
Ernani Joppert: Yeah. Yes, so this component is very well described here. It's a plug-in for TinyMCE which sort of... you can tell it's better, but it's sort of a brand already.
Manuel Lemos: Yeah. The editor HTML editor.
Ernani Joppert: So you can upload files and I haven't seen much of it in action, but I could see it from the screen shots, right? I'm opening them as we go through here.
So, you have a list of files you can select number of files and then you upload and once you do that you can see a preview probably of the file, right? You can attach other files and once you have a list of files, you can upload it and see the contents of the file if they are images or something like that.
And they have some documentations as well on how to set it up which is very, very helpful. And I'd say that this kind of material is really, really necessary because people which is learning, this helps a lot for them to understand.
And the author here Sandro is a Brazilian. Sandro Alves Peres did a great job here documenting this. This helps to show people how to probably create a components based it off on JavaScript as well as the PHP site integration.
Manuel Lemos: Yeah. It's the both parts because from JavaScript obviously you cannot manage the files that reach on the server site, so he provided the PHP backhand code as well.
Ernani Joppert: Yes. And it's probably a good example as well of JSON web services, right?
Manuel Lemos: Yeah.
Ernani Joppert: Because he's exchanging data between PHP site and JavaScript. And this is a very nice use case of uploading files which is handling multipart form encoded data which normally is not the usual way you integrate with the server site.
So I'd say, this is a very nice component. Congratulations, Sandro. Thanks for the contribution. So changing now to the next one that I chose to list here. It's also based of on uploading.
Manuel Lemos: OK. Can you please increase the font as well.
Ernani Joppert: Sorry. I was zooming here. It's from Arun Kumar, he's from India. And it's funny to have two components selected as a upload, a file upload component.
Manuel Lemos: Yeah.
Ernani Joppert: But it's really, really nice to see the two aspects of these the same behavior. This is a jQuery based plug-in, right? So you can drag and drop files on the browser instance. It will detect the file and immediately fire an event on JavaScript or probably be ready fire an event on JavaScript which will upload the file.
Manuel Lemos: Yeah.
Ernani Joppert: And it can do multiple files or one file at a time based off on the uploads that you do. And it's very nice to see, it's also exemplifying the PHP files required to do this.
Manuel Lemos: Yes. To receive the files on the server side, but that should be a regular PHP script, nothing special...
Ernani Joppert: Right.
Manuel Lemos: ...to handle the uploads.
Ernani Joppert: Yes which few probably have a upload handler by looking at this file you can probably change on your own to adapt this. And probably this components can be merged together with the other components.
Manuel Lemos: Right.
Ernani Joppert: Without even a richer components which probably offers drag and drop support as well as the TinyMCE rate.
Manuel Lemos: Yeah. Well, basically in the browsers that support drag and drop events, nowadays it's very simple, as long as they are compliant with HTML 5 specification for file APIs to give access to the contents of the file that's being uploaded using these APIs.
So, probably not a big deal, as long as the browser supports it. As for browser that are older and do not support this APIs, nothing can be done about them, they do simply not work.
Ernani Joppert: Right.
Manuel Lemos: Well, anyway on my part, I'll also like to comment on a couple of classes. Let me screen share it here. First; this one from our most frequent contributor Arturs Sosins from Latvia.
As usual he sends very impressive classes, JavaScript objects with things that are often not trivial. In this case what it provides is a means to generate presentation of text or images that have the color components displaced a bit so you can see text or images in 3D. In the case of text it's quite easy because it's the same text needs to be rendered in different positions.
I think in the case that the solution was to present... used CSS 3 shadow effects, so the shadow color is in one color and the main text color is the other, I mean, the separation of the RGB components.
Ernani Joppert: Right.
Manuel Lemos: That's my interpretation because I confess that I am not a specialist. I was trying to see... he usually provide some examples, let's see. Well, I think you can see now that...
Ernani Joppert: Right.
Manuel Lemos: There is some displacement of the red and green, and red and blue here.
Ernani Joppert: Right.
Manuel Lemos: I think you need to have a 3D glasses to see this in 3D.
Ernani Joppert: Yeah. The thing is there is an anaglyph way of seeing 3D, although I can't see 3D because I was born with a..
Manuel Lemos: You have sight problems?
Ernani Joppert: Yeah. I know I was born with it... crossed eyed, but I did an operation and basically when you have crossed-eyes although you have the minimum or the maximum.
Manuel Lemos: Yeah.
Ernani Joppert: Basically when you're young, very, very young, either you get it, the ability to see 3D or you lose it. And I can't see it's very, very much as normal people.
Manuel Lemos: And so that feature is disabled in your eyes.
Ernani Joppert: Yeah. It's not... the thing is it's not in the eye, it's in the brain. The brain process, there is, the only thing, ability to see 3D, your brain processed the image as a single image coming from both eyes. And in my case, I only have one core.
[Laughter]
Manuel Lemos: You cannot see 3D movies.
Ernani Joppert: No. Yeah, I can't, but the sensitivity that I have is not enough for me to become a plane pilot in Brazil. Although within U.S., I could fly, but here in Brazil the laws are very strict and I can't become..
Manuel Lemos: And you wanted to be a pilot and you are sorry?
Ernani Joppert: Yeah, for sure.
Manuel Lemos: Well, anyway back to the topic here, just to show some examples of the image version of the output of the glasses.
You can see there is some displacement of the component. I think he used his canvas to provide this sort of image component, color component displacement. Anyway, as usual congratulations to Arturs for yet another impressive object.
I hope you never get tired of sending more components, interesting components like this and the others. And now moving on to another interesting component...
Ernani Joppert: I would say for him as a personal message to give the ability of non 3D-able person to see 3D, that would be awesome as well.
Manuel Lemos: Now you are asking difficult things.
[Laughter]
Ernani Joppert: No. I'm just joking. Well, yeah.
Manuel Lemos: Well anyway, moving on, now talking about new contribution this time from Karl Holz from Canada. Karl has been a frequent contributor mainly of PHPClasses site, but now he starts to contribute as well to the JSClasses site with also impressive JavaScript components.
In this case it's a component that makes it easier to generate players that process entries from RSS feeds that maybe audio or video entries, usually found in podcast. And I think this process is somehow JavaScript sent by the server with all the information and generates the necessary player code that can be used to play...
Ernani Joppert: I've been seeing this jPlayer component everywhere. Basically most of the Wordpress based blogs use this component.
Manuel Lemos: Actually the object is not jPlayer. jPlayer just an external library that he uses to present the video I think, I'm not sure.
Ernani Joppert: Right. This is what I mean, I've seen this component, the jPlayer component, everywhere. So probably this is very useful to aggregate as the feature for jPlayer and hopefully the jPlayer folks are watching this and can use this as...
Manuel Lemos: Well I don't know if it's because probably... from what I understood this is sort of a complementary part of another class that's written in PHP that Karl provided on PHPClasses site...
Ernani Joppert: Oh, I see.
Manuel Lemos: ... to actually parse the feeds and serve some JavaScript to the browser to process the information generated to podcast user interface without reloading the page when moving to another audio or video in the podcast.
Ernani Joppert: Oh, I see.
Manuel Lemos: Well, that's what I got. I hope I'm not misinterpreting this. So congratulations for Karl also for his contribution.
PHP Programming Innovation Award Winners of July (50:15)
Manuel Lemos: And now finally moving on to one last session on which we comment about the latest nominees to the Innovation Award.
Actually, since we usually record this before the end of the month, but since we're already in the following month, there are already the nominees of the current month, but we need to first talk about the previous.
Ernani, which of the libraries that were nominated in actually released in July, and then voted in August, and were announced the result in September.
Ernani Joppert: Right.
Manuel Lemos: Which I'm showing it here, oh which ones would you like to comment?
Ernani Joppert: I'm sharing my screen again, and..
Manuel Lemos: Yeah. Don't forget to...
Ernani Joppert: Yeah. Increase my fonts, so here, probably another one. So the author is Pavel Kukov he's from Bulgaria which is not a common country here. So very nice to see someone from Bulgaria submitting components to the site. So as described here, this class can store multiple values in a single cookies.
And the values are starting encoded in JSON, so it can be easily sent to browsers and preserving data types which is very nice. And I've seen some tricky things on special cases where things aren't hosted on the same domain, but actually on sub domains.
And for single sign on purposes, if the single sign-on servers doesn't give you the cookies all the time, you could probably use components to store the session ID of the single sign on server and keep it in another cookie, so you could use it later to actually not to break the single sign on functionality of course because that would be not allowed or wouldn't be a good thing to do.
But you could keep logging history of the user and see and track the users login times without having to give this hurdle to the database. And of course there are the local storage APIs as well coming through as a HTML 5 functionality, but it's still in very early adoption, but having those possibilities to keep data types and store as a JSON format is very nice.
Manuel Lemos: Yes. This has two main advantages, this is approached from above all to storing multiple variables in a single cookie, you can share information between the browser and the server...
Ernani Joppert: Right.
Manuel Lemos: ... and all in a single cookie, so don't have to be careful with the names that you use for cookies because it is only one cookie will be used.
Ernani Joppert: Yes.
Manuel Lemos: And the other advantage which is related what I just said is since it can share cookies between the browser and the server, he also actually provided another component in JavaScript to do the same on the browser side, so it's the complimentary part.
So you can use JavaScript to set cookies, so the cookies do not need to be necessarily set on the server side, that can be set on the browser side, and you can exchange those cookies and as long as you use both classes, I'm trying to share the class here, we comment about it in the last month I think if not mistaken.
Ernani Joppert: Right.
Manuel Lemos: And it's basically equivalent class that Pavel uses to do this cookie data sharing and as you said, you can use it for purposes for sites that need to store information of multiple values, and in this case since is all serialized in JSON format, it preserves the original types because when you use regular cookies, you only store text, and in this case this is all serialized and unserialized in JSON format, you can restore the original types. So this is actually a well thought couple of classes, PHP and JavaScript.
Ernani Joppert: Oh, yeah. For sure.
Manuel Lemos: Right. And the other class that you wanted to mention.
Ernani Joppert: Yes. Sorry, that's probably opening another... something not like this, but let me just restore this here and open this one a class from David Barnes and he is from Thailand which is also a country that has low level of submissions.
Manuel Lemos: Yeah.
Ernani Joppert: And it's nice to see somebody from Thailand writing components to the web site.
Manuel Lemos: It's not the first time.
Ernani Joppert: No, no, no.
Manuel Lemos: I mean, first time from the same author.
Ernani Joppert: Right. But it's nice to see that people are getting those classes submitted and actually innovation, right? This is very, very nice.
Manuel Lemos: Oh, yeah.
Ernani Joppert: And I have never heard about this API before, but it's very powerful as far as I can tell.
Manuel Lemos: It's unusual, right?
Ernani Joppert: Yeah. Right. And it's probably tracking bad customers, so you should avoid them.
Manuel Lemos: I think it gets data from complaints from providers, I mean, companies that have bad customers, that caused all sorts of problems like not paying their bills and things like that.
Ernani Joppert: Right.
Manuel Lemos: Well, here in Brazil there is an institution called Serasa...
Ernani Joppert: Right.
Manuel Lemos: ... that tracks the bad customers. I think this is specific to the Unites States, I'm not sure. Anyway, it seems to be for similar purposes.
Ernani Joppert: Yes. And it's nice to see that there is an API for that, I wasn't aware. And actually seeing APIs being submitted API clients and submitted through the PHPClasses is very nice because I don't see much, I mean, there are tons of APIs out there for services, social networks, for everything.
Basically, if you would look at the Web, there are even the API directories where you can find Web site sharing information, and the amount of requirements, imagine if every developer having to integrate with Facebook would write their own API client, then it would be very, very bad. So, it's nice to see that's at least if somebody tries to look into a client that is done through PHP, they can use these components.
Manuel Lemos: Right.
Ernani Joppert: And benefit from it.
Manuel Lemos: Yes. And yes as you said, actually there are many, many classes that access API. Sometimes they're not really APIs, there are some component that scrapes information from a Web site which is not the same thing, but here in the Web services there are over 500 classes to access remote sites to retrieve some information or access some service.
But as you said this is interesting because this is innovative and it really enhances the value of the site when there are authors that provide access to different APIs than those usual that are made available there.
And on my behalf I would like also to comment on a couple of classes. I'm just trying to open, and trying to access them here. OK. I think of this and launch screen sharing, OK, let me see. I think you can see it already.
Ernani Joppert: Yes.
Manuel Lemos: It's already in the largest font size that I can increase.
Well, again this is yet another class from Karl Holz. As I mentioned he's a regular contributor of PHPClasses site. He already submitted seven classes, and this time it's a class that... there are similar classes, but for this purpose of combining multiple CSS files in a single file, but this has a detail that makes it special, otherwise it will not be innovative which is the fact that CSS styles that have images usually they reference the image that is on probably a remote server or in the same server, but this are separate file.
And what he does, he processes those styles that reference images and then replace the URLs of the images with the data URLs. So those data URLs actually contain the data of the image file. So those CSS files do not need... after processing with this class do not need the remote image files anymore because the image data is included in the resulting CSS files.
So this is quite clever class from Karl that submitted now. Actually once again commenting about Karl's contribution from seven classes that he has submitted, six were considered innovative and well that's quite impressive track record. And I hope he continues to focus on submitting innovative classes, because this is what enhances the value of the site as I mentioned before. So kudos for him for these contributions.
Now talking about another class yet another frequent contributor, this time Tom Schaefer from Germany. Tom has even a more impressive track record, he sent 32 classes so far, and nine of which were nominated to the Innovation Award including this one and actually one of them was winner in one of the month, it was not this one.
But anyway, this class, what it does is also related to CSS, but it's not exactly the same purpose, it's quite different. I don't know if everybody is familiar, there is this LESS language which means leaner CSS. Which is basically a language sort of twist of CSS that allows to have variables in the definition of the values of the CSS properties.
So what this class does is to take a specific style sheet that you give it as import and it generates and process of the style sheet in the LESS format. That figures which are the most common constant to property values and replaced them by variables.
And this is a good starting point to migrate your CSS style sheets to the LESS format. So they are processed on the server site and eventually they make it easy for you to for instance adapt your page layouts to different screen widths eventually to different devices for instance if you are developing web application for a mobile device and you know the size of the screen, you can adjust all the properties in this CSS definition according to the size of the screen and make it all adjusted using LESS syntax and the variables to make eventual calculations to adapt with the screen size.
And I think this is quite interesting approach implemented here by Tom. Kudos for him for this yet another great contribution. And well, I think on the part of innovation award we are done with this month. There are several other classes, but unfortunately we do not have much more time to comment about them.
Conclusion (1:03:43)
Manuel Lemos: Just would like to finish this podcast to thank you Ernani again for making this extraordinary effort to record tet another great podcast with the Google Hangouts. And so far it actually did not drop and we are at the end I think it will not drop.
Ernani Joppert: Yeah.
Manuel Lemos: Well, on my part, that's all for now. I don't know if we have any final remarks?
Ernani Joppert: No, no, no. I'm pretty happy that we've had a smooth one. Hopefully this new machine will help us and hopefully I'll be settled in a new address soon, so things can be even better.
Manuel Lemos: OK.
Ernani Joppert: Thanks everyone for the time being. Thanks for the submissions from the contributors. Keep sending good stuff and I hope to be back 100% next time without any hassles.
Manuel Lemos: Yeah. Well, on my part that is all for now. Bye-bye.
Ernani Joppert: Thank you. Bye-bye.
You need to be a registered user or login to post a comment
1,616,413 PHP developers registered to the PHP Classes site.
Be One of Us!
Login Immediately with your account on:
Comments:
1. AST - Olivier Plathey (2012-10-21 10:13)
Meaning of AST... - 1 reply
Read the whole comment and replies