background preloader

CakePHP

Facebook Twitter

Apache Benchmark. Doch bevor man anfängt wild “herumzuoptimieren” und diverse Tools auszuprobieren, sollte man sich im ersten Schritt Gedanken machen wie man die Performance eigentlich messen kann. Wieviele Anfragen kann mein Webserver gleichzeitig verarbeiten? Welche Geschwindigkeit hat mein Webserver bei einem Aufruf einer Webseite? Apache liefert bei der Serverinstallation ein tolles Tool mit, welches sich “Apache HTTP server benchmarking tool” (kurz: “ab” oder “ab2″) nennt. Dieses kann verwendet werden um mehrere und vor allem gleichzeitige Anfragen auf Webservern zu simulieren.

Man könnte jetzt viele Worte darüber verlieren was das Programm macht und kann, aber am besten sieht man es an einem Praxisbeispiel. Apache Benchmark (ab) installieren: Der Apache Benchmark wird mit dem Webserver mit installiert. Webseiten Performance messen mit Apache Benchmark Was gibt es zu beachten? 1) Der Server, welcher den Benchmark durchführt, sollte ein anderen sein, als der, der die Webseite hosted. Speeding Up Your CakePHP Website. It seems that whenever I mention CakePHP to the developer community, those who have not used it think of it as a slow framework.

Indeed it isn’t the fastest according to the results of many benchmarks – out of the box that is – but what it might lack in performance it certainly makes up for in Rapid Application Development. By applying a few simple modifications, and even some more complex enhancements, CakePHP can be sped up quite a bit. By the time you work your way through even half of these changes, the performance of your your CakePHP site will be comparable to many other popular PHP frameworks, with the advantage that your development speed will never falter!

There are two types of modifications that I will be describing in the following article. Do not fear though, if you can only follow the first set you will not be disappointed. Upgrade CakePHP Versions The CakePHP Cookbook provides some very detailed migration guides: Disable Debug Mode Don’t laugh! Cache Query Results or: becomes: Compile Percona Server with XtraDB 5.5 for ARM. I had a rough time getting a Percona run in a chrooted, bootstrapped Debian running beside Android on my previous phone, but it’s now done. Get the latest code from Percona sources, for me, it was 5.5.29-rel29.4 therefore I’ll write the docs for this version. cd /usr/src wget extract it tar xzf Percona-Server-5.5.29-rel29.4.tar.gz get the patch wget apply the patch patch -p0 <.. make the project cmake . That's it. Memcache.

PHP Integration. Install SQL Anywhere. QR-Code-Helper. QR-Code Frameworks. PHP Crypto Library. Components. Components are packages of logic that are shared between controllers. CakePHP comes with a fantastic set of core components you can use to aid in various common tasks. You can also create you own components. If you find yourself wanting to copy and paste things between controllers, you should consider creating your own component to contain the functionality. Creating components keeps controller code clean and allows you to reuse code between projects. Each of the core components is detailed in its own chapter. See Components. Configuring Components Many of the core components require configuration. Class PostsController extends AppController { public $components = array( 'Auth' => array( 'authorize' => array('controller'), 'loginAction' => array( 'controller' => 'users', 'action' => 'login' ) ), 'Cookie' => array('name' => 'CookieMonster') ); The previous fragment of code would be an example of configuring a component with the $components array.

Note Using Components Component Callbacks. Security. Improve this Doc class Security The security library handles basic security measures such as providing methods for hashing and encrypting data. static Security::cipher($text, $key) Encrypts/Decrypts a text using the given key.: // Encrypt your text with my_key$secret = Security::cipher('hello world', 'my_key'); // Later decrypt your text$nosecret = Security::cipher($secret, 'my_key'); Warning cipher() uses a weak XOR cipher and should not be used. Static Security::rijndael($text, $key, $mode) Encrypts/Decrypts text using the rijndael-256 cipher. // Encrypt some data. rijndael() can be used to store data you need to decrypt later, like the contents of cookies.

New in version 2.2: Security::rijndael() was added in 2.2. static Security::encrypt($text, $key, $hmacSalt = null) Encrypt $text using AES-256. This method should never be used to store passwords. // Assuming key is stored somewhere it can be re-used for// decryption later. Encrypted values can be decrypted using Security::decrypt().