PHP Classes

Better Documentation for PHP internals - Lately in PHP podcast episode 35

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

Author:

Viewers: 7

Last month viewers: 3

Categories: Lately in PHP Podcast, PHP opinions

With the inclusion of Zend Optimizer+ extension in PHP 5.5, the need for better documentation of PHP internals became more evident, so PHP contributors can write extensions that take the most of the core PHP features.

That is one of the topics discussed by Manuel Lemos and Ernani Joppert in the episode 35 of the Lately In PHP podcast.

They also talked about having more optimized PHP opcodes, some interesting PHP feature proposals that got rejected, as well the article about the top version control systems used by PHP developers.

Listen to this podcast, or watch the hangout video, or read the transcript to learn more about this and other interesting PHP discussions.




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: 26MB Listeners: 2461

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 5.5 beta 3 and beta 4 releases (1:14)

Documentation about PHP and Zend extensions (3:09)

Additional Optimizations of PHP opcode (11:08)

The proposal for counting class instances (14:53)

Proposal for continuing caught exceptions (20:28)

Top Version Control Systems used by PHP Developers (23:12)

Winners of the JavaScript Innovation Award of February (40:06)

Winners of the PHP Innovation Award of February (49:27)

Conclusion (58:29)

Introduction (0:20)

Manuel Lemos: Hello, welcome to the Lately In PHP podcast. This is episode 35. We are already reaching three years of hangouts, because we record one hangout per month, except for rare months  when it is not possible. I think only one month, I guess.

Ernani Joppert: But the hangout was introduced last year, right? You mean, podcast.

Manuel Lemos: Huh?

Ernani Joppert: Three years of podcast, not of hangout.

Manuel Lemos: Right. You're right. In the beginning it was just audio. That was over Skype.

Well, anyway, hello Ernani. How are you doing?

Ernani Joppert: I'm doing great.

Manuel Lemos: [Laughter]

Ernani Joppert: I got it.

Manuel Lemos: You started talking before I introduced you and...

Ernani Joppert: Yeah, it's all right.

Manuel Lemos: Yeah. Well, anyway, this month, as usual, we have lots of interesting topics related to things that happened in the PHP world. So let's move on with this.

PHP 5.5 beta 3 and beta 4 releases (1:14)

Manuel Lemos: First, I think, there are topics related with the latest PHP 5.5 beta versions.

There is not much to say about this except there were a couple of PHP 5.5 beta. Well, the expectation is that a lot of developers, now that it's in beta, will no longer help testing these versions.

Well, I  confess, personally, I have not helped much because I even have not tried to even compile it. The idea is that people test it more and more so they can fix bugs before releasing it.

Ernani, have you even tried any of these PHP 5 beta versions?

Ernani Joppert: No, I haven't. I've been working on a situation where I will require to test a beta version and I'm running some tests locally. But within this version, I haven't used it yet.

Manuel Lemos: Yeah.

Ernani Joppert: But soon I will be doing some... I have something that will require to tackle compatibility issues.

Manuel Lemos: Yeah.

Ernani Joppert: But I guess that this shouldn't affect anything. It's just an improvement, an overall improvement.

Manuel Lemos: Well, I think there are some backwards incompatible changes.

Ernani Joppert: All right.

Manuel Lemos: At least in PHP 5.4, there were some. Well, but it depends. Maybe it's not something that affects your code.

Ernani Joppert: Yeah, my code does vary itself from PHP 5. So everything that work, and I'm not... any old implementations of PHP with magic quotes and stuff like that so it shouldn't break it.

Documentation about PHP and Zend extensions (3:09)

Manuel Lemos: Right. Now, talking about another topic, there was a discussion here regarding having better documentation for several internal parts of PHP, like the Zend Engine and the PHP API and also the SAPI which is to provide layers for interfacing with different Web servers, and also the CLI and CGI modes.

There's a proposal here from a guy named Joe... I could not figure what was his surname... but anyway, what matters is the proposal itself.

I think it is interesting, but the problem is always the same. Who is going to do it? Who is going to go through all the documentation of the API.

There was a discussion about this and in the end, there is also a challenge that was brought which is the fact that this APIs are also changing over time. So it would be also a great problem not only to write the documentation but maintain it because it would eventually would be outdated for near releases.

Ernani Joppert: It is somewhat expected. I say it's a nice idea, but despite that it's a nice idea, it would be nice to see the authors that provide those APIs, who are responsible to produce the documentation themselves. Because they are more well-versed and it should be easier for them.

Manuel Lemos: Right.

Ernani Joppert: But it's always good, right?

Manuel Lemos: Right. There is also that problem that not everybody, not every contributor, is qualified to document the Internals, because one thing is documenting the PHP functions themselves and another matter is documenting the Internals. So, well, the idea is good but I don't know if you have any people behind it. Well, anyway...

Ernani Joppert: Now, it seems the things in C and C++, you don't benefit from... in comparison to Java, you don't have JavaDoc or an alternative version. In Java, you are taught from the beginning to provide documentation and it's not a common practice.

Manuel Lemos: Well, there is PHPDoc which basically go through documentation comments. It's very similar to...

Ernani Joppert: Yeah.

Manuel Lemos: Yeah. But anyway, I have one more correction. You said that there is no equivalent for C, but the...

Ernani Joppert: Not that I'm aware of...

Manuel Lemos: No, the original idea of using documents and comments on documentation was exactly for C. It was from Donald Knuth. He came with this idea that literate programming on which you use comments to embed documentation remarks.

Ernani Joppert: Right.

Manuel Lemos: So it did not start from JavaDoc.

Ernani Joppert:  Right. What I meant is just that when I start coding Java, it's already there. And when I had been working with a C, there wasn't a default documentation I think that's bundled with the language.

And I notice there is the Doxygen, which has a very good ability to generate documentation from source code, which I've used in several projects myself but it wasn't common practice and bundled with the language. That's the gist.

Manuel Lemos: I think for C, the program is called CTags, something like that.

Ernani Joppert: Oh, I see.

Manuel Lemos:  But well, I remember that from decades ago when I was still programming C.

Ernani Joppert: I see. When you were used to suffering.

Manuel Lemos: When I was young.

Ernani Joppert: Oh, I see.

Manuel Lemos: Well, anyway, now moving on to another topic. I would like to also bring... There's a proposal from I think it was Julien Pauli. He's one of the maintainers of the PHP 5.5.

I'm trying to screen share here. Let me see if I could increase the font.... There is this proposal to basically go along, start this effort of documenting a bit more the integration with what they call Zend extension, which are PHP extensions that are compatible with the caching extension that Zend offer to PHP because the extensions need to be loaded in the right order to be compatible.

And there is this documentation here, and it is getting improved but I think there is still a long way to go

Anyway, this goes along with the idea that Joe presented before which is to start documenting better the way the internals work at the PHP extension and so on. So, despite that it was a hard effort, at least somebody already started doing in part. So I think it is great despite all the objections.

Ernani Joppert: Oh, yeah.

Manuel Lemos: But as usual, we see a lot of people complaining about the idea. The good ideas always get a lot of people complaining.

Ernani Joppert: It's like a public employee. When there is a change in the organization, they all start to be shaky because they are used with the...

Manuel Lemos: Ah, I don't know. Sometimes, it feels that it's just somebody that wants to participate and say something, "Oh, I'm against it because that's a lot of work."

Ernani Joppert: Yeah.

Manuel Lemos: Then, do it. We do it.

Ernani Joppert: [Laughter]

Manuel Lemos: Well, anyway, people... human beings... are very curious. And just watching the PHP Internals List and all the discussions that go on there, I find it amazing.

Ernani Joppert: Yeah. Lot of social warfare there.

Manuel Lemos: I have a recommendation for everybody that wants to submit proposal, because the problem of many proposals that do not pass is not exactly technical. It's a matter of persuasion.

Ernani Joppert: [Laughter]

Manuel Lemos: There is a good book by Robert Cialdini called precisely "Influence" and he talks about six principles of influence. I'm not going to talk about it because this is not a psychology podcast.

But it's just a tip for whoever wants to submit proposals to the PHP Internals. If they follow many of those tips, all those principles of influence, I'm sure they'll increase the chance to succeed with the proposal.

Ernani Joppert: Sort of social engineering, right? Which was...

Manuel Lemos: It's like that, yes.

Ernani Joppert: Yeah.

Manuel Lemos: People persuading people. So, it's called "Influence", the book.

Ernani Joppert: OK.

Manuel Lemos: Well, anyway, enough of psychology, this is a technical podcast. But the idea here is to move on and continue to talk about other interesting topics from the PHP world.

Additional Optimizations of PHP opcode (11:08)

Manuel Lemos: Now, I would like to talk about another...

Ernani Joppert: Topic.

Manuel Lemos: ...proposal here. This time, from Dmitry Stogov. He's a long-time core contributor. And he's a long-time employee of Zend. He used to work on the Turck MMCache and got tired and started working on that extension.

Ernani Joppert: I remember.

Manuel Lemos: So, he has lots of experience about the caching extensions and also of optimization of opcode. So here, he's telling a bit about the way the opcode compiler is working, it's not very easy to perform optimizations of in-line calls. He's showing this a bit here. I don't know if this is readable, but the link will appear in the podcast show notes.

And basically, it tells about that it's possible to do some changes to make it more feasible to do so-called in line optimization which would be for instance, to eliminate certain function calls.

Ernani Joppert: In the end, the opcode is just trying to make the source a little bit more optimized in order to generate a better opcode instead of having to...

Manuel Lemos: Yeah.

Ernani Joppert: ... Do several steps just for one line.

Manuel Lemos: Right. Well, it's basically, the same with all the other bytecode compiler engines, Java and C# and so on, and .NET, I  mean.

Well, as usual, there are always people objecting, "No, the problem of optimizing opcodes is that it takes a lot of time." Well, but since in the end, it will be cached, it probably doesn't matter if it will take a lot of time.

But then, there was a continuation of the argument that there could be several passes and every time the code was loaded, you could do an extra pass to optimize the code further. And so, the eventual overhead would not be noticed.

But I think, it's a bit silly that argument, because as it was mentioned if in the end the compiled opcode would be cached, I think the initial overhead optimizing the opcode in several passes would be hardly noticeable because it will only happen once.

Ernani Joppert: Right.

Manuel Lemos: I don't know. Ernani, you are more familiar with the Java world. In the Java world, do you have any knowledge of how optimization of opcodes, actually bytecodes, happens? Is it seen over several passes or are there any nuances?

Ernani Joppert: I don't  know the details of Java Compiler but it's pretty much standard way. Back in the past, there was a Jikes, the IBM Compiler and it was a faster compiler. But despite of that, I don't know any of the details about it.

But it should be similar to the current compiler. It's just that someone like Oracle right now writes the Java translations and is responsible for the Java port. They're the ones that maintain the bytecode for it.

Manuel Lemos: Right. Well, I supposed it's similar because nobody is reinventing the wheel.

Ernani Joppert: Exactly.

The proposal for counting class instances (14:53)

Manuel Lemos: Well, anyway, moving on to the next topic, I would like also to bring up another proposal which is a bit confusing because by the time it was proposed, at least this time, it was already rejected. I mean, I don't know. Maybe, when I saw it, the vote already happened. But most people that voted rejected it.

Anyway, the proposal is to have somehow a way to provide some statistics of objects that were created for some classes. The idea was to have some additional functions that will tell how many created objects are there in the current script that is running. And I think it could get it by class.

Ernani Joppert: Yeah. I'm not sure why he wanted to have this proposal done. The only idea I do have would be to make sure some optimization on the reference count and try to optimize reference as to...

Manuel Lemos: Or maybe detect some object leaks.

Ernani Joppert: Yeah.

Manuel Lemos: For instance, if you are in a certain position of a script that you supposed that all objects would have been...

Ernani Joppert: Destroyed.

Manuel Lemos: ... destroyed,  with a function like this, you could figure there is some tied instances that for some reason were not destroyed.

Ernani Joppert: Right. In Objective C, normally, you don't allocate object. So in the Internal, you event disptacher, I guess. There's  a proper handling of object. You have the reference counting mechanism, where it de-allocate the object from memory. So you have to retain or release the object.  And currently, at the latest version, you have what we they call autorelease tool which is a proof of objects autoreleased by default.

Manuel Lemos: I think that's because Objective C is more like C++, that you have also to explicitly destroy the objects.

Ernani Joppert: Right.

Manuel Lemos: Then, they realized it is better to do like more modern languages on which ....

Ernani Joppert: I think it made it easier.

Manuel Lemos: Yeah.

Ernani Joppert: Just trying to make things easier for developer. Since the phone, the hardware of the new phones are way better, way more powerful. I guess they can benefit from those situations where we don't have to very, very tight on memory allocation.

Manuel Lemos: Right. Because it's a pain to do it manually. Imagine if you go inside PHP functions, create some objects and you have to terminate the objects explicitly.

Ernani Joppert: Yeah.

Manuel Lemos: At least, in this proposal, the idea would be to help you, because if you create references to objects inside the function, they will not be released automatically, if the references are from objects that will create the outside of the function.

Anyway, this proposal seem to have been practically rejected. There was only one person in favor. I could not figure exactly what were their reasons, but I recall reading something like people "Oh, I don't see any use for this in the future." But, well, the guy explained the purpose. Maybe, he needs to try again.

Ernani Joppert: Yeah.

Manuel Lemos: Or read the "Influence" book to learn how to persuade people.

Ernani Joppert: Sometimes, the cases that you want is featured to be implemented, but you don't want to say why.

Manuel Lemos: Yeah.

Ernani Joppert: But you have your own reason.

Manuel Lemos: You mean, from the proponent?

Ernani Joppert: Yeah.

Manuel Lemos: The proponent or from those that object?

Ernani Joppert: Let's put it this way. This guy is working on a mobile implementation of PHP and he wants to make sure he can count the reference object so he can make a sort of auto-release an engine so it can be optimized for mobile application that runs PHP. But he doesn't want to tell to the PHP group the base of his idea.

Manuel Lemos: That's like a conspiracy theory. This guy is evil.

Ernani Joppert: No, no, no.

Manuel Lemos: He's proposing something that has no use but he has a secret use.

[Laughter]

Ernani Joppert: Ah, yeah. I mean, there are some business that are tied to secrets and you can't just require somebody to tell the reason.

Manuel Lemos: Well, I think there are valid use cases for this proposal.

Ernani Joppert: Yeah, for sure.

Manuel Lemos: Useful, I mean. But it's interesting the reactions of same people, "Ah, I don't have any use." OK, shut up.

Ernani Joppert: [Laughter]

Manuel Lemos: So that... Imagine if we follow all the millions of people that don't have any use for these feature just going there saying, " Ah, I don't have any need."

Ernani Joppert: Imagine if all the Ruby developers or Python developers or Java developers, would say, "Why PHP?"

Manuel Lemos: Right.

Ernani Joppert: So there wouldn't be any PHP at all.

Manuel Lemos: Exactly. PHP must  die.

Ernani Joppert: Yeah.

Manuel Lemos: It's too successful. WordPress must die because everybody's using it.

Ernani Joppert: Yeah, it's reallocate of each function. Everybody's on the Internal scope, on their internal function when your try to internalize it.

Manuel Lemos: Right.

Ernani Joppert: I can't imagine nobody complaining about something.

Manuel Lemos: Well, the recommendation for the proponent is to try again, but this time, first, to read the "Influence" book.

Ernani Joppert: Yeah.

Manuel Lemos: [Laughter]

Proposal for continuing caught exceptions (20:28)

Manuel Lemos: Now, more seriously, moving on to the next topic, again another feature proposal. Well, actually this is not exactly a formal proposal. It was more a discussion about how people take it.

Ernani Joppert: Right.

Manuel Lemos: It is basically a proposal, again by Jean Pauli... Julien Pauli, sorry. I said Jean. Sorry, Julien, I confused your name... As I've said, he's one of the maintainers of PHP 5.5.

And he seems to be quite happy. Not only is he actively managing the release and also sending out proposals. And this time, he has proposed to have an additional feature for exceptions on which to allow to continue an exception that was caught. I don't know this wouldn't be confusing or even hard to implement, anyway.

Ernani Joppert: I think there are some issues with the for loop right? He wants to make that continue available on a catch block. Then, I guess it would conflict with the...

Manuel Lemos: Well, no because you can use a number, when you have nested the code sections, you can use continue 1, continue 2, to refer to which loop you are referring to.

Ernani Joppert: Yeah.

Manuel Lemos: So, that wouldn't be a problem. What I think would be a problem is maybe an implementation factor. Internally, how do you resume an exception that was triggered in a very nested tree of code that was called, functions that call other functions. So I don't know if it was even possible to recover from a catch exception.

Ernani Joppert: Right.

Manuel Lemos: This is one of those tough, tough things that I have no knowledge to even comment about. But, on the other hand, there are... Also, I'm not sure about the use cases of this. Maybe, it has some good use cases but I'm not figuring exactly what they would be.

Anyway, this is not a formal proposal. It was more of a discussion that was started there.

Ernani Joppert: That's right.

Manuel Lemos: And well, anyway, that's all we have to say about this.

Top Version Control Systems used by PHP Developers (23:12)

Manuel Lemos: Now, moving on to another topic which is precisely to tell about an article that I wrote in the PHP Classes blog regarding the use of version control systems.

Well, in the article I tried to explain it in terms that  everybody that is not familiar with version control systems can understand it. Let me try to increase the font here.

So there are several sections in this article. I tried to explain what it is and why it is useful. I give several examples... what types of files can be managed by version control systems? Basically, all the types, but you have to be careful when using binaries because it might...

Ernani Joppert: And it's nice to see on this articles of yours. I'm not sure if I'm going too fast here, it's nice to see that you've raise all those statistic written on your website, PHP Classes.

Manuel Lemos: Yeah, I was going to get there. I was just trying to give an overview of what the article was.

Ernani Joppert: Right.

Manuel Lemos:  But I'll get there.

Anyway, to continue what I was saying, I also mentioned something that was not very well-known which is how you can manage the history, the revision history of database schema using version control systems. Because databases are external but they are tied to applications.

Every application expects to work with certain database schema. I mean, the schema of tables and indexes and whatever. You have one on your database. So if you're on  a new release of your application, you need to add some fields at some tables. How do you do it?

And I just explained that basically a long time ago, I have developed a database abstraction layer in PHP named Metabase. And not only it provides an abstraction for accessing database, but also to control the schema of the tables.

So, you can define the list of tables and fields in a separate archive. And, basically, it can look at the current schema and upgrade it when necessary.

And it's much simpler than that other technique that some people are using called migrations. You have to explicitly write some statements to go up and down between versions. That's  pretty much complicated but since it is embedded in the code, it could also be integrated in the code and the files that are integrated in your project and go through a version control system.

And then, finally, I talked about what you commented which is a chart, the top version control systems used by PHP developer. And let me go through some statistics here.

OK, basically, I mentioned that these statistics are based on the number of packages in PHP Classes site that are imported from version control systems. Currently, only Git, SubVersion and CVS are supported.

And this is related to a feature that was implemented in 2011, which was to allow people to import packages from existing version control systems. So they don't have to upload their files manually.

And this was helpful too as a reminder for authors that submit their packages in the site. Sometimes, I see that some authors go through a lot of work uploading each file of their packages one at a time and that's very painful. It takes a lot of work. And if they have the projects in version control repositories, it would be much faster to import the packages.

Anyway, that was not exactly the point of the article. Just to mention how many packages are used in version control systems and put it in perspective of how many out there are not using version control systems.

And, unfortunately, the current situation is not a very encouraging. It could be much better because much more authors could be using this but only a fraction of those that have uploaded packages to the PHP Classes site had been using version control systems.

I know sometimes some packages are very small and probably people would not have much work to upload the packages because they're just a few files. But what matters is that it seems those authors are not using version control systems.

And for all the reasons I presented in this article, I hope that the developers that have read this article start using more version control systems because they require that you have some knowledge. It's very easy to use this.

And well, I think it may help others to figure that they need to do it and I hope they can feel encouraged from now on to start using version control systems more.

Ernani, you've used a version control system?

Ernani Joppert: I've been using... Oh, I'm again having some mute issues here.

Manuel Lemos: Now, your audio is...

Ernani Joppert: It's telling me that you muted me, unfortunately.

Manuel Lemos: Yeah, because it was sending a lot of noise. But now, you are unmuted.

Ernani Joppert: OK, now, I can talk. So I've been using Visual Source Safe when I used to develop Microsoft solution.

Manuel Lemos: Ooh, boo! Boo!

Ernani Joppert: I've been using CVS.

Manuel Lemos: No, just kidding. I do not have anything against... I think it's common practice, as you were saying.

Ernani Joppert: Yeah, back in the past, that was the only option. There wasn't a good solutions for Windows development and CVSing. Then, it began with that. Then, SubVersion and now Git. And I've been migrating all my projects to Git which benefits a lot.

There are some concepts of Git which still something that I don't use or never require to do so. But the ability to have a distributed repository somewhere else than my computer or into a different computer and do not affect the work of anybody does help a lot.

Manuel Lemos: Yeah, well in reality, all other systems allow you to have different copies of your repository in other places.

Ernani Joppert: Yeah, I know, the benefit here is just the ability to synchronize.

Manuel Lemos: Yeah, it's always a matter of doing a merge of work. But what Git sort of define this the way to... Well, basically, when you commit your changes, you can commit them locally and then only afterwards, you can commit all the changes you need. Maybe, several commits all at once to a remote repository.

And the advantage here is that if you want to do a commit, you don't have to be connected to a remote repository, a central repository, because it's in Git, there's no longer their concept of central repository. Every repository can be considered the center or not.

And it's also useful to do full backups of repositories. It's so easy for people to steal full repositories from private companies, but that is another matter.

Anyway, I hope with this article, more and more people will start using version control system for all the good reasons that were presented in the article.

And as a side comment, I also want to bring in something that I mentioned in the article which is related with a fact, sometimes, I see certain complaints against PHP Classes. People say, "Oh, GitHub is much better than PHP Classes."

And there is certainly a misunderstanding here. I tried to explain in the article that GitHub is awesome. I think it is great. It helps a lot in encouraging people to start using Git and version control systems, in general.

But it is for a different purpose, which is project hosting. PHP Classes is not for that purpose. And what I want to clarify is that, sometimes, people misunderstand the purpose of different things and start comparing and making comparisons.

And it was interesting that sometimes people do not realize that. And for facts that they did not know, they will jump to conclusions.

One interesting thing that happens is that PHP Classes was meant to give greater exposure to PHP class based projects. And the one thing that is done to achieve that is whenever you publish a class or publish an update, the site automatically notifies everybody that has downloaded the project before. You don't have to do any checkouts. The site can track that for you.

And that contribute just to keep your users up to date. You do not even have to use version control systems, I mean, the users of your classes. And other things you can publish are articles, blogs, blog comments, blog articles on the site. And people that have downloaded it are notified.

And there are many other features. I did want to go through all comparisons because there is no competition between sites like PHP Classes and GitHub.

Ernani Joppert: Back in the past, there was SourceForge which were mostly project hosting facilities, mostly open-sourced projects. Although it would probably have a page.

Manuel Lemos: Yeah, SourceForge, it was even started before PHP Classes and it already offers CVS hosting. Now, it offers also Git Hosting. There are many, and now, it's very common to find sites like that, like Gitorious and others that offers...

Ernani Joppert: To me, GitHub is a nice place where you can host your own project and make them publicly available, for employees to show off their participation under the Open Source community as well.

Manuel Lemos: Collaboration in general.

Ernani Joppert: Yeah. But PHP Classes is something else, it's something where you can easily find components tied to your very specific needs.

Manuel Lemos: Right. And for authors, the main service that is offered is getting greater exposure.

Ernani Joppert: Yeah, also.

Manuel Lemos: If you are an author, you can publish your articles. Even if the project is innovative, you can be nominated to the PHP Programming Innovation Award and get exposure.

But for that to happen, there has to be a moderator that nominates, go through all the codes, analyzes the code and nominates the packages, provide them proper description, because many authors who submit to PHP Classes do not describe their package very well.

And there is a moderator that goes on every month, every day to moderate some classes. And that's a manual work that certainly GitHub does not want to go through.

Ernani Joppert: Yeah, for sure.

Manuel Lemos: And just to prove that many authors already know about that it's good to spread your work in different sites, many of the latest packages published in PHP Classes were imported from Git repositories, precisely from GitHub.

So if GitHub was all in all, it was much better and it was much  better and do everything else that PHP Classes does, why would people be importing repositories to PHP Classes to publish it here?

Ernani Joppert: Yeah.

Manuel Lemos: Well, that is basically what I just want to clarify. Certainly, I'm not in any competition. Actually, I even collaborated with the GitHub people. The latest version of the API had a few bugs.

The OAuth implementation was not working very well. I reported some bugs and helped in testing to see it was fixed. So, sometimes, people imagine there is this deep competition.

Ernani Joppert: Yeah.

Manuel Lemos: It's not the case.

Well, anyway, other than that, Ernani, do you think articles like this are helping the PHP developers that then evolved their processes? Or maybe there will still be a good bunch of authors that do not get it? It's probably too hard. What do you think?

Ernani Joppert: No, I think it helps. Because there is a lot of effort on your part, just like the CVS integration and Subversion.

Manuel Lemos: Yeah, I meant about the article. Articles like this, not exactly the specific topic.

Ernani Joppert: Right. I'm just taking this as an example.

Manuel Lemos: Right.

Ernani Joppert: But, yeah, for sure, every effort  that you do within your web site, they are complex change or complex add-on. So it's really helpful to see to the community as well, to explain them. And some users, they are beginners, they are learning, and the more at used they can be with the standard, it's better for their own career.

Manuel Lemos: Right. Well, now, that you mentioned that, I also remembered something about the effort of developing things like this. Just for the feature of importing packages from repositories, it took a lot of time.

It was not just developing clients to access repositories in CVS, SubVersion and Git, all the code that is necessary to make that integration work well, it took a lot of time.

And there was a lot of effort done to make it work correctly. We're using the protocols of this version control systems. They are very under-documented, especially the Subversion and the Git ones. The documentation is very scarce.

In the case of Git, I even have to analyze the code of the Git program written in C to understand how certain packets are supposed to be interpreted, because the existence of documentation is scarce and not very good.

I don't know if it has improved. Anyway, this was implemented like two years ago. I don't know if it has improved since then but probably it's not the most interesting thing for Git developers to do document their protocols.

Anyway, that feature is done. It took a lot of effort but I think it was something that has accomplished its role very well.

Ernani Joppert: Oh, yeah.

Winners of the JavaScript Innovation Award of February (40:06)

Manuel Lemos: Ok, now, moving on to the next section of this podcast on which we're going to comment on the latest nominees. First, I'm going to talk about the nominees of JS Classes Innovation Award, which is the brother site of the PHP Classes site. And we start this time talking about the nominees for February of 2013.

We always try to promote some packages from that site because it is a site that is still growing and we want to encourage more authors to go there and share JavaScript components and make it the site a great resource as is PHP Classes.

So, as I was saying, we are talking about the nominees of February that got voted in March and then in April, the results came out. Ernani, which of the nominees would you like to highlight this month?

Ernani Joppert: Right. I would begin with an author which I guess is the first author from that country. Mark Rolich, he has provided a package JavaScript Memory Game which is a sort of a game board.

It can generate and display with images and symbol. You click and twist down to find groups of symbols. So, it's a memory game, a simple game. But I guess from this game the same output before where like half for editing the...

Manuel Lemos: Well, I don't know what is happening with audio. Are you hitting the audio cable it's cutting your voice all the time?

Ernani Joppert: No. My computer is new.

Manuel Lemos: It seems you are hitting the audio cable.

Ernani Joppert: No, I'm not.

Manuel Lemos: I don't know. It's sad because it's cutting.

Ernani Joppert: I'm not doing anything.

Manuel Lemos: Yeah, it's high and low, it's cutting.

Well, anyway, just for those that did not get what you said. Basically, you are talking about this memory game object of Mark Rolich from Armenia, right?

Well, that is a board game that is implemented on the Web and it is an interesting game. I think it would be useful for people to study that  game if they want to learn how to implement games in JavaScript on Web pages.

So other than that, what other object would you like to mention?

Ernani Joppert: Right. Better?

Manuel Lemos: Well, more or less, not much better. But try to talk about it and if it is cut high I'll try to...  Yeah. Well, right now, your screen is black. Now, OK, it's showing up.

Ernani Joppert: This object JavaScript Harlem Shake Dance, so, it's from Arturs Sosins. He's from Latvia. He's one of the top contributors. I guess he's ranked one of all time contributors of the JS Classes site.

Very nice to see, the opportunity here by taking a meme, internet meme. It is interesting to see people adding keyframe animations and see what you can do. So it's really funny. I've laughed a lot and that was my favorite part.

Manuel Lemos: Well, it came out to be cut again. I don't know, it's probably some interference with some advertising that is on that page. Well, anyway, for those that may not have got it, I don't know how it will come up in the recording.

This is an object by Arturs Sosins from Latvia, one of the top contributors of the site. He decided to emulate what they call the Harlem Shake Dance in which there are people that start doing some random dance and then, there are few others that follow. I think he has a video somewhere.

Ernani Joppert: Yeah, it's really funny, the way he put his knowledge to do CSS manipulation.

Manuel Lemos: Yeah, this object use some CSS 3 feature like keyframe animations.

Ernani Joppert: Right.

Manuel Lemos: Actually, I try to already use keyframe animation myself in some objects that I'm trying and it is very interesting that CSS now has support for animation. And he used those animation precisely for presenting these objects.

I'm trying to show the video here. I don't know if you can see it.

Ernani Joppert: Yeah, I can.

[Insert Video]

Ernani Joppert: [Laughter]

Manuel Lemos: There is initial element that starts the dance, the Harlem Shake dance, and then the others follow and they used this as...

Ernani Joppert: And you can see all the related videos there.

Manuel Lemos: [Chuckle]

Manuel Lemos: Which are  totally irrelevant.

[Laughter]

Manuel Lemos: But anyway, well, and this is enough to just to show this object, the idea is just to show it. It has a funny effect that probably the useful part of it is to show how you can implement some animation using CSS 3 keyframes.

And on my part, I also would like to talk about a couple of objects. Let me screenshare them here starting from this one, AJAX Image Uploader by Rafael Lucio dos Anjos from Brazil. He's already been a regular contributor and sent some very interesting objects.

This one can be used to present previews of files being uploaded to a site. If you go on a site and pick an object, I mean a file to upload which is an image, you can show up preview. I was trying to show it but for some reason, the image is not showing.

Anyway, he has a preview here just to show that if you want to make sure that the image file that you want to upload is certain image, you can see a preview before the upload starts, because it uses some file APIs to access the image and render them on canvas that you can present on a page.

So, it is a good use of a modern browsers feature like the latest, I think it's XMLHttpRequest 2 that allows you to have greater control over the files that you are uploading even before you do it.

I'm not sure but I think that is the case.

Ernani Joppert: One question, can we do multiple uploads or it's just one per...

Manuel Lemos: Well, I'm not sure about that, but probably it doesn't make sense to do multiple uploads because it only will preview one image at a time.

Ernani Joppert: Right.

Manuel Lemos: It is not that he could not figure a way to show more images at the time, but I don't know if that was anticipated.

Ernani Joppert: Right.

Manuel Lemos: So without checking... But if it is not implemented, maybe that could be a great feature to suggest to Rafael. Anyway, I think it was a good idea. It address real problem that many applications have, to preview images before uploading.

Another class that I wanted to mention is another game and this time developed by MarPlo from Romania. He's already been submitting several components which are not very simple, which should look like more wall applications.

In this case, it is an object that is like presenting a trivia game with questions and answers that you can present results if the answers that you provide are correct and so on. So it is also an interesting object.

Winners of the PHP Innovation Award of February (49:27)

Manuel Lemos: Now, moving on, right after this to another section which we comment this time are the winners of the PHP Programming Innovation Award organized by PHP Classes site. This time it were also classes nominated in February and were voted in March and then in April, the results came out.

Ernani, which of these classes would you like to mention? I don't know if you are on mute or not.

Ernani Joppert: Oh, I guess you've muted me again, probably. So I pick the classes... My browser is for some reason, so let me... OK, now, I guess you can...

So it is from...

Manuel Lemos: Yeah. Well, your audio is totally being cut. I could not listen to what you are saying.

Ernani Joppert: You're muting me. That's why it's ...

Manuel Lemos: Yeah, because we could not listen to anything you're saying.

Ernani Joppert: Can you hear me now?

Manuel Lemos: Yes.

Ernani Joppert: I wasn't doing anything, I was just trying to...

Manuel Lemos: OK.

Ernani Joppert: There is a little lag, sorry.

Yeah, but the class that I picked out is from gouravmehta, if I say that correctly. The component is tied...  This class can convert Word files to text files. .

Manuel Lemos: Well, I don't know. We cannot listen to anything you are saying. I don't know there's something wrong with your computer. Because it's totally cutting the audio.

Ernani Joppert: When I share my screen, it fails.

Manuel Lemos: Yeah. Let's try, I share the screen and you talk.

[Laughter]

Ernani Joppert: OK, sounds like the plan.

Manuel Lemos: It's the new big from the  Google Hangout.

Ernani Joppert: [Laughter]

Or there is a bug at my processor or something.

Manuel Lemos: I don't know. Well, try explaining now. I'll try to show the...

Ernani Joppert: Yeah. I can't tell the name correctly. It's gouravmehta. He's from India. He or she, I can't tell the gender. But this class can convert Microsoft Word Docx files to text which is the newest from Microsoft. So it can extract some files from Microsoft Word into Docx format. And it can parse the document XML files and the text that it contains.

I'm not sure if this follows the Microsoft standard, which is there was a huge fight between Open Document and there was a standard for that.

Manuel Lemos: Yeah. Well, they're reluctant to move on to use more easy to parse format like the one based on XML. But in the end, they ended up supporting this Docx format.

Ernani Joppert: Right. Yeah, I'm not sure if Docx is the standard but there was a fight before. And it's nice to see that there are solutions here that at least in part the decoding of the Docx files. And if you need to extract data from a Word file, and parse out. I've seen this happening when you're posting a resume to solutions, they would parse out the resume and all the information existing on it.

Manuel Lemos: Right.

Ernani Joppert: It is a valid use for this component which is my idea there.

Manuel Lemos: Right. There are several classes to generate and even to, I mean, parse Docx files but in this case, it not only parses but also extracts the text that is inside of the document. So it may be useful for this purpose, that is why it was nominated.

Other than that, what would be the other class that you wanted to mention, Ernani?

Ernani Joppert: Right. The other class that I see here is Convert Number to Text with Soros. I guess Soros is a technique where you can display the spelling.

Manuel Lemos: A file format, you mean.

Ernani Joppert: Yeah.  That's text in multiple language. So, the author is Pavel Astakhov. Hopefully, I mentioned his name correctly.

Manuel Lemos: No, no. It's totally wrong, but never mind.

[Laughter]

Ernani Joppert: Astakhov.

Manuel Lemos: Yeah, whatever. No, I'm kidding. Go on.

Ernani Joppert: Yeah, yeah. So, it's nice to see that at least you have one component that can print numbers into...

Manuel Lemos: Yeah. Well, you better stop screen sharing because it's cutting the audio again.

Ernani Joppert: Oh, I see. Right. So yeah, it's key to the effort to provide this component which can parse Soros files and extract the definitions to be able convert the given number in words that's part of any language. So it's nice to see that you can view it on top of this component.

Manuel Lemos: Right. Well, that's it. I was not aware that there was a format to define rules to spell numbers in text. Because there are many classes to spell numbers in text in different views in PHP Classes. And there is not a unified solution that would address the problem for all languages. As long as it is a source format, you can actually address this problem.

Ernani Joppert: Indeed.

Manuel Lemos: Yeah. Well, I don't know what happened but your screen is black.

Ernani Joppert: Oh, really?

Manuel Lemos: Yeah.

 Ernani Joppert: It's because I was doing an ugly thing here. So I had to cover.

Manuel Lemos: [Laughter]

You were obscuring your video.

Ernani Joppert: Yeah.

Manuel Lemos: Well, anyway, on my part I would also like to comment on a couple of classes. Let me screenshare them here.

The first I want to comment about is Twitter API Rate Limit by Feyyas from Turkey. And basically, what this does is to deal with the problem with the exceeding the limit of Twitter API calls.

And what happens is that Twitter has a limit of number of API calls you can do. I think it's per day and when you exceed that limit, Twitter will not accept whatever you want to access, maybe post some articles, some statuses. And what this class does is to wait some time and try again.

Ernani Joppert: Oh, I see.

Manuel Lemos: And hopefully, it will have passed that time so you can post more tweets or whatever you are doing with Twitter. And that is one interesting class.

And the other class is this one by Pashkov Denis Igorevich. I'm sorry, I'm not spelling his name right. Anyway, Pashkov has been publishing many interesting classes. He's from Ukraine. And I have noticed there are many talented developers from Ukraine besides Pashkov and it's great to have their contributions here.

In this case, what this class does is not very trivial, but basically it analyzes words and determining the root word of certain word based on endings. For instance, if it is a word that is a plural, it can try to figure the singular of that word.

And this can be used to many purposes like figuring if you are talking about a certain subject, but using the variant of a certain word with different ending. This is useful for clustering text as mentioned here in the description.

Well, with this, it is great to see many interesting classes. Next month, we'll be commenting on about other interesting classes.

Conclusion (58:29)

And as I was saying, with this, we practically end this hangout and I hope it was useful. And on my behalf, that is all for now.

Ernani Joppert: Thanks. Bye.

Manuel Lemos: Bye.

Ernani Joppert: See you next month. Bye-bye.




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

1,614,280 PHP developers registered to the PHP Classes site.
Be One of Us!

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 Better Documentation ...   Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)