Browsing the archives for the CakePHP tag

CakeFest #3 – Berlin, July 2009

Category CakeFest, CakePHP

The half-yearly CakePHP Festival will happen this time on Berlin at July 9-12 2009. It is a good chance to meet CakePHP Core Developers and prominent community members, which are full of wisdom to cativate and share experience with us.
I had the chance to went to the CakeFest Argentina ‘08 and I can tell you is really a great event, don’t waste time and money going to cinema, buy now your ticket and fly over Berlin!

http://cakefest.org/themed/berlin09/img/badges/cakefest_berlin_offwhite_huge.png

Unfortunetly I will not be there to enjoy this event, but I’m sure I’ll be on the next CakeFest.

Tickets are now available – I don’t know the ticket price, but you can participate of a contest that is giving one free pass.
Speaker selection in progress – if you live on Berlin or near of Berlin you can proprose a talk.

CommentsNo Comments

Speeding up Requests with Reverse Routing Caching

Category CakePHP
This issue has been discussed by Tim and Matt in recent days and people got some performance changes.
From this I created an improved version of the AppHelper from Matt. My version is based on criteria cache.
For example, you can cache all back-end urls separated from the front-end urls using the criteria ‘prefix’.
Also, different from Matt version, it will use a separated cache config ‘_app_urls_’.
Below the code:
Update¹: I’ve updated the code to cache full urls properly. Thanks to Orcar for this catch.
<?php

class AppHelper extends Helper {
	public $_cache = array();
	public $_key = '';
	public $_criteria = array('prefix');
	public $_extras = array();
	public $_paramFields = array('controller', 'plugin', 'action', 'prefix');

	public function beforeRender() {
		if (is_a($this, 'HtmlHelper')) {
			$keys = array_intersect_key($this->params, array_combine($this->_criteria, $this->_criteria));
			$this->_key = 'url_map_' . implode('_', $keys);

			$this->_cache = Cache::read($this->_key, '_app_urls_');
			$this->_extras = array_intersect_key($this->params, array_combine($this->_paramFields, $this->_paramFields));
		}
	}

	public function afterLayout() {
		if (is_a($this, 'HtmlHelper')) {
			Cache::write($this->_key, $this->_cache, '_app_urls_');
		}
	}

	public function url($url = null, $full = false) {
		$keyUrl = $url;
		if (is_array($keyUrl)) {
			$keyUrl += $this->_extras;
			$keyUrl['full'] = $full;
		}

		$key = md5(serialize($keyUrl));
		if (!empty($this->_cache[$key])) {
			return $this->_cache[$key];
		}

		$url = parent::url($url, $full);
		$this->_cache[$key] = $url;

		return $url;
	}
}
Comments5 Comments

Evento sobre CakePHP em São Paulo

Category CakePHP

Desde que eu trabalho com CakePHP eu não vi nenhum evento totalmente dedicado ao CakePHP. No máximo que eu via era eventos que tinha uma pequena palestra sobre CakePHP, e sempre eram “Introdução ao CakePHP e bla bla bla”.

Na falta de eventos bacanas que realmente nos aderem algum conhecimento eu e alguns amigos, principalmente o Felipe Theodoro, estamos tramando um evento sobre CakePHP em São Paulo.

Ainda não está nada definido (dia, palestrantes, local, etc), tudo que eu sei é que a idéia é ter de 4 a 5 palestras e que o dia da semana vai ser sábado, claro. E depois do evento um bom happy hour para fazer um networking (a melhor parte do evento).

Se você se interessa em participar deixe um comentário para sondar o tamanho que a sala teria que ter. E se quiser palestrar deixe um comentário também.

PS: Claro que o evento não terá fins lucrativos, mas isso não te impede de me pagar uma boa gelada. ;)

Comments29 Comments
« Older Posts
Newer Posts »