Português Português English English

I Encontro PHP-Paraíba

Saturday, November 29, 2008 the 1st PHP-Paraíba Meeting will happen. If you can’t be there (just like me) you can see it through the internet. The streaming broadcast will start at 10am (Brasília time) and url is http://php-pb.net enjoy!

Posted in Uncategorized | No comments

BackTrace 0.2

Before the end of this year, I made a good think to receive a gift on cristhimas.

After hear to André Bacci for months about security problems in BackTrace library I have changed a default value and to create a new constant. This time nobody may feel fear, your code and argument values are keep hide by default.

The new release has came, see more at http://code.google.com/p/backtrace

Posted in Uncategorized | No comments

all you need is love…

follow the song

Posted in Uncategorized | No comments

Ascending and Descending Order and Pagination with LDAP

LDAP hasn’t a good documentation. Users of wonderful database API’s may feel no good when using this technology in PHP.

I had one of these problems when I needed to paginate LDAP entries. The ldap_sort function sorts in ascending order only. Result: I had to do pagination and ordering in two direction using ldap_count_entries, ldap_sort, ldap_first_entry, ldap_next_entry, ldap_get_attributes, array_reverse and a bit of voodoo :-P . The result is in a post left in the ldap_search documentation.

see the solution here

Posted in Development, PHP | No comments

Projects at Google Code

Hello all. Usually I post releases, documentation and everything related of some my libraries in this blog.

I opted to create some projects at GoogleCode because I don’t want to post about it here. I think this will be better for all of us.

I announce too that the WSDLDocument 0.2 was relasead at http://code.google.com/p/wsdldocument. There is a wiki with changelog and usage tips.

The BackTrace library don’t have news, but you can see it at http://code.google.com/p/backtrace.

Posted in Development, PHP | No comments

Buscador de disciplinas UnB 2008/2

O buscador de disciplinas da UnB por horário oferta 02/2008 está no ar. Para acessá-lo clique no link abaixo e boa sorte.

http://www.renandelima.com/buscador/2008/2

Posted in Misc | No comments

WSDL + PHP = WSDLDocument

This post was made to release the WSDLDocument, a WSDL generator in PHP to webservices.

The way how some subjects are saying about TI hides the expert developer that exists inside a lot of professionals from our area. One of these subjects is webservices. It’s easy to do a client in PHP. But to do a server it’s necessary more work because the WSDL generation. Of course there are others things to look at during the development with webservices.

WSDLDocument

Why is to make WSDL in PHP difficult? A variable in PHP change its type during the script running. The webservices needs you declare the returns’ and arguments’ type.

The goal is look out it to generate the WSDL. To do this isn’t easy, but this isn’t as hard as find mustache on Elephant. So dear, the WSDL generation may be made with two steps:

  1. Find out the type of the parameters and returns of the services;
  2. Generate the XML.

The developer who implemented each service must to describe any where the types information. No more magic, ok? We’re not mage, we’re TI professionals. A good place to put it is the method documentation. The notations help us to solve this problem and keep our code well documented. With the types information we can generate the WSDL. The WSDL generation must to follow W3C stardards.

I release today the WSDLDocument!

This library isn’t a new thing. I did it - only - to improve my knowledges and to understand the WSDL structure. Some another libraries:

As someone may see the WSDLDocument extends DOMDocument. You create a instance of this and… go planet! You have a XML in your hand. You may - for example - link a XSLT file to show a bit beautiful on the browser. I didn’t want to be intrusive and oblige you change your framework. This have to be saw as a library to be put inside your application.

Above a sample how to use this library.

<?php

// generating the wsdl
$class "MyWebserviceClass";
$url "http://mydomain.com/?class=" $class;
$wsdl = new WSDLDocument$class$url );

// showing the wsdl
echo $wsdl->saveXml();

<?php

class MyWebserviceClass
{
    
    
/**
     * Transfering complex type.
     *
     * @param Person
     * @return integer
     */
    
public function anyMethodPerson $type )
    {
        
// ...
        
return 100;
    }
    
    
/**
     * Transfering array of complex type.
     *
     * @param integer
     * @return Person[]
     */
    
public function another$quantity )
    {
        
$list = array();
        for ( 
$i 0$i $quantity$i++ )
        {
            
array_push$list, new Person() );
        }
        return 
$list;
    }
    
}

class 
Person
{
    
    
/**
     *
     * @var string
     */
    
public $name "";
    
    
/**
     *
     * @var integer
     */
    
public $children "";
    
}

I will try keep this library updated. I’m busiest this time, because this I don’t know what it’ll happen.

download the WSDLDocument here

Posted in Development, PHP | 5 Comments

“hello world” denovo

I’m very happy to announce I’m going to write some things in English here.

My friends know I’m studying English. But nobody have to read my tries, the posts will still be written in Portuguese too. I would be happy if you want to give me some tips, fell free to do so!

Thank you Vitor Choi for showing me the Babel plugin. The posts have an icon to change the language easily.

News are coming…

Posted in Misc | 5 Comments

Patterns para elementos visuais

Você precisou alguma vez justificar para seu cliente o motivo pelo qual um menu gigantesco ficaria ruim em sua aplicação?

Hélio Miranda, amigo meu, me mostrou o Interaction Design Pattern Library. É um repositório com vários padrões de elementos de interface muito interessante. O site organiza os padrões em categorias. Visualizei várias coisas boas.

Uma delas é a padronização de nomes. Não precisamos mais nos referir ao Parts Selector  como “pra-lá pra-cá” e ter que explicar que diabos é isso. O padrão está lá, e documentado.

Outra coisa coisa é a visão orientada a solução de problemas. Todo bom arquiteto (informação/interface/…) escolhe (ou faz) um pattern para a resolução de problemas. O site indica qual problema está sendo resolvido em cada um dos patterns.

Usem a abusem. See you soon!

Posted in Development | No comments

DBDesigner + PostgreSQL + Linux Kernel 2.6

Há algum tempo utilizo DBDesigner para modelagem de banco de dados. Porém, ele (aparentemente) só trabalhava com MySQL. Cansado de ter que lustrar o sql gerado pelo software busquei algo mais automático. A seguir explico passo-a-passo o que fiz e os problemas que encontrei e como os resolvi. Os créditos para a solução do meu problema é de diversas pessoas que passaram por situações similares e que escreveram alguma coisa na internet.

Existe um fork do projeto DBDesigner e o nome do projeto é DBDesignerFork. A grande diferença (pra mim) é que ele gera script para os bancos: Oracle, MSSQLServer, Firebird, Mysql e meu desejo recente PostgreSQL.

  1. O primeiro passo é fazer o download do DBDesignerFork em http://sourceforge.net/project/showfiles.php?group_id=177293.
  2. Descompacte o arquivo em qualquer lugar que preferir. Eu descompactei em “/home/renan/.DBDesigner”. Esse nome faz o diretório ficar escondido. Alguns preferem colocar no “/opt”, mas ai a escolha é sua.
  3. Vá ao diretório que descompactou a aplicação e copie o arquivo “startdbd_using_kernel2,6″ para “startdbd”.
    1. Existe alguns arquivos iniciados com “startdbd_using*”. Eles estão todos configurados para iniciar o DBDesigner com kernel2.4, mesmo o arquivo com nome “startdbd_using_kernel2.6″. Estranho não?
  4. Altere o arquivo “startdbd” e retire o seguinte conteúdo dele “LD_ASSUME_KERNEL=2.4.1″.
  5. Altere a diretiva “LD_LIBRARY_PATH”  para o caminho real do diretório “Linuxlib” e o executável DBDesignerFork também para o caminho real e não relativo.
    1. Isso irá permitir que quando você quiser executar o arquivo de outro caminho irá funcionar corretamente. Você poderá colocar um item de menu para ele por exemplo ;-)
    2. Os meu arquivo fico assim: “LD_LIBRARY_PATH=/home/renan/.DBDesigner/Linuxlib/ /home/renan/.DBDesigner/DBDesignerFork”
  6. Tenha fé e execute o arquivo “startdbd”.

Bem-vindo ao mundo de geração de script automático para PostgreSQL pelo DBDesigner.

DBDesigner + PostgreSQL

Pra não ter que ficar executando o arquivo “startdbd” na mão toda vez sugiro que crie um item de menu no seu ambiente gráfico. Eu utilizo gnome, veja como está a configuração dele.

Item de menu para DBDesigner

Posted in Linux | 1 Comment
BrasilMato GrossoRondôniaDistrito Federal