In one of my previous blog posts I talked about using APC as an opcode cacher to speed up your site. I thought it was worth mentioning a second time. This greatly improves the performance. You can read more about the different opcode cachers and how to configure them here: http://blog.crazytje.be/php-opcode-caching-why-use-an-opcode-cacher/ Part 4 will talk about optimizing your php code [...]

 

When using php scripts on the command line or in the cron, there are often times that you do not want to allow the same script to run more then once at a the same time. So a single instance application in php. Personally I use php scripts like this allot. My cron is filled with all kind of tasks [...]

 

Ever wanted to set your own session id? Well, I did. I was creating a webservice where authentication would be done with a ‘token’. This token would simply be a random guid given to that user after he logged on with his username/password. Now, this random guid/string would be the session ID. That way, if the user does an action [...]

 

Ever wanted to split off functionality to a base class other then AppController? This is what was needed to prevent typing the same code over and over again in a project of mine. The app controller is great and all, but it’s just one class and you might want some functionality in only a part of your controllers. So lets [...]

 

When working with xml allot, you’ll find that this little ‘trick’ might come in handy. Editing large xml structures is a pain. So why not convert them to a nice array? It’s done like this: The xml: <PipeMsg> <Header> <Task>Logon</Task> <AuthenticationToken>sdfdg4-hkjty45-4544-sdfdsf4</AuthenticationToken> <CreationDstamp>54641215</CreationDstamp> </Header> <Body> <UserName>Crazy</UserName> <Password>cinderella </Password> </Body> </PipeMsg> Now convert to an array: $objXml = ‘the xml in the [...]

© 2012 Crazy's Blog Suffusion theme by Sayontan Sinha