Posts Tagged ‘symfony’

Helpful debug function in Symfony

September 29th, 2010

When I debug my code I often use echo-like function together with  <pre></pre> to include white spaces in output. Hence, I create d function:

function d($var = 'test') {

    echo '<pre>';
    var_dump($var);
    echo '</pre>'
}

and  place it in the beggining  of ProjectConfiguration.php file. Then I can use it in any place of project – in command line tasks as well. [Earlier I placed it in frontend_dev.php file, but then I could not use it in tasks.]

[Zend_Amf + Symfony + Flex] Server with Logger

July 18th, 2010

After integrating Symfony with Flex through Zend_Amf, I had to debug it and I needed some logs on server side.
Below I present my LoggedAmfServer extending Zend_Amf_Server, which logs all methods called by Flex and its’ responses. You need to pass instance of sfLogger (ie. sfFileLogger) in the constructor.

» Read more: [Zend_Amf + Symfony + Flex] Server with Logger

Overriding setter/getter in Symfony

July 2nd, 2010

Overriding methods should not be a problem, but it can make you confused if you don’t know how magic functions are used in Symfony 1.4 models.

In this short article I will explain why usual overriding does not work in Symfony models and how to override methods handled by magic functions.

» Read more: Overriding setter/getter in Symfony

Symfony i Flex przez Zend_Amf

May 31st, 2010

Szeroki wybór możliwości połączenia PHP i Flexa możemy uważać za coś pozytywnego, ponieważ każdy może sobie odnaleźć swój sposób integracji server-side z client-side. Jednakże na długą metę okazuje się to zmorą, bo człowiek (przynajmniej ja tak mam) zaczyna się zastanawiać, czy to drugie rozwiązanie nie jest lepsze.

Dlatego postanowiłem znaleźć jakiś sposób integracji, który będzie szybki i dobry :). Przeglądając różne stronki o Flexie, odnalazłem prezentację (niestety nie pamiętam adresu), na której ładnie przedstawiony był fakt, że AMF to idealny protokół komunikacji z Flexem. Nic dziwnego, w końcu to twór Adobe.

» Read more: Symfony i Flex przez Zend_Amf

Integracja Symfony + Zend

February 23rd, 2010

Jest to bardzo prosty i krótki wpis mówiący jak dodać biblioteki Zenda do projektu Symfony. Mimo, że to wymaga kilka linijek kodu, to często muszę tego używać i niestety ciągle zapominam :)
» Read more: Integracja Symfony + Zend

Flexmaniaks on Facebook