Picture this. We want to stream live video. In fact don’t need PHP. We only need a flash player (or HTML5) and our live feed. The problem appear when we need to offer some kind of security.
Read more →This paper is intended to try to improve the next version of Cake. I think one of the most important features of a framework is its capacity to be expanded. Plugins achieve that gracefully. But there is a problem; plugins, as read on tempdocs, are meant to be packages. I think they can be much more. This is mainly a software design problem.
Cake creates conventions for everything turning controllers, models and views universal. Same happens to plugins, but because of namespace concerns it is recommended to developers to include plugins name in controllers, models and views names. So a blog plugin would have BlogPost and BlogComment as models, BlogPosts and BlogComments as controllers. That’s fine to me (and recommended) but the Router should be smart so it won’t be necessary URI’s like /blog/blogPosts.
Read more →Hoje vou apresentar uma função que a maior parte da comunidade PHP não conhece. Está englobada dentro das “funções mágicas”, foi íncluida no PHP5, mas é necessário defini-la.
Em projectos com uma escala média, em que contamos com mais do que alguns ficheiros é praticamente certo que vamos utilizar classes, e inclui-las com ficheiros externos.
<br></br><br></br>
Este é um exemplo típico duma aplicação simples/complexa. Incluímos o nosso ficheiro em todos as páginas em que vamos necessitar duma ligação à base-de-dados e em cada uma delas vamos iniciar o nosso objecto.
Read more →This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. These tutorials build on a previously-published 5-part series which has now been updated and extended to embrace PHP 5, making parts of it suitable for those of you who already have worked with PHP 4 in the past.Read more →If you came here to learn about elementary PHP 4 or basic PHP 5, this is for you. Enjoy!
Alguma vez pensou se seria possível executar ficheiros de php na linha de comandos, como se fossem programas de C ou de Pascal?
Além de parecer divertido, provavelmente já precisou mesmo de usar e não sabia como. Imagine um ficheiro em PHP que executaria quando iniciasse o servidor (ou o seu servidor instalado em casa) e que trataria de apagar mensagens de fórum antigas ou actualizasse as estatísticas de um gestor de ficheiros.
Read more →