Sep
24
Liquid Image Effect in Javascript

Inspired by an old ActionScript effect. This lightweight (1.2kb minified and gzipped) cross browser javascript file is free of any other dependencies. It's 100% javascript too.
it sounds quite simple to achieve, take the end pixel and stretch it the length of a div, and repeat for the whole image.
You can give it a try here and here.
I will be implementing this feature on my site in the near future - I like it that much

posted by
Mark Willis
Sep
21
Symfony Components – Usable Independantly

One feature I like about symfony is the ability to use each component independantly of the entire framework, It's just a case of downloading the library and using straight away.
I have been looking at PHPUnit and symfony's own "lime" unit tester and although PHPUnit is good, I'm prefering the lime as it is easier to read (and even better with the lime extra plugin).
With the component base of symfony you can also use lime in non-symfony based projects. So I can use the same unit testing framework for all my projects.
This is another plus for symfony. Some components are available at symfony components.

posted by
Mark Willis
Sep
18
Sorting MySQL Result by field
After my post about sorting multidimensional array's by an array of values I've now found a better way of keeping a mysql result set in order by using the ORDER BY FIELD() function. For example:
SELECT id,name FROM tbl_name ORDER BY FIELD(id,3,4,2,6,8,1) DESC
Will return the results in the correct order or using ASC instead of DESC will return results in reverse order.
The folks over at MySQL have thought of everything

posted by
Mark Willis
Sep
16
Sort Multidimensional array by order of an array
Although the title of this post may sound confusing - what I achieved was an extremely useful function. Whilst building a website using SphinxSearch for some search resultsĀ - after using MySQL to get the data I needed:
PHP retrieves a set of id's from sphinx (4,5,2,34,1,453,3)
SELECT id,name,url FROM table WHERE id IN (4,5,2,34,1,453,3);
Read the rest of this entry »

posted by
Mark Willis
Sep
14
eAccelerator review
eAccelerator seems to be compared to APC for it's caching + accelerator performance. But eAccelerator has one major advantage to APC and that is file caching. If your server runs low on RAM or your eAccelerator config hits it's own memory limit then the cache can start to store on the disk as well (or choose to store all the cache on disk and leave RAM for other processes).
This is excellent for shared hosting servers / or dedicated servers used for multiple services.
eAccelerator contains a PHP encoder and loader (although the current RC doesn't). You can encode PHP scripts using encoder.php in order to distribute them without sources. Encoded files can then be run on any site which runs PHP with eAccelerator. The sources of encoded scripts can't be restored because they are stored in a compiled form and the encoded version doesn't contain the source. Of course, some internals of the scripts can be restored with different reverse engineering tools (disassemblers, debuggers, etc), but it is not trivial.
eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it, this is a great speed increase as the PHP engine does not have to pre-compile a script before executing
eAccelerator is compatible with Zend Optimizer's loader. Zend Optimizer must be installed after eAccelerator in php.ini. If you don't use scripts encoded with Zend Encoder then we do not recommend you install Zend Optimizer with eAccelerator.

posted by
Mark Willis
Sep
12
jQuery Based Hover Effect
Adrian Pelletier has been playing with jQuery and created a lovely looking hover effect with relection. The jQuery appends the reflection/shadow to each element. Then animates the position and opacity of these elements and the icon links on hover.


posted by
Mark Willis
Sep
09
Symfony or Zend Framework
My initial plan for this review was to install both frameworks and test both against each other. But after spending a few hours trying to get zend framework to install correctly, I gave up with it...
A PHP based framework should install fairly easy - I will give it another try when I get some spare time (it is a bit sparse at the moment with new baby liam)
Symfony however I have fallen for, every part of the setup is brilliant: from url routing to unit testing.
Initially I had a few problems following there tutorial (it defaults to use Propel ORM when Doctrine seems much better)
I'm still working out how to use most of the features, but that is mainly because there is so much of it.
I am using Crawler Catcher as my main project with symfony (as it needs a rewrite already). With the symfony framework and unit testing which is built in. All the old bugs have already been fixed.
More to come in the near future

posted by
Mark Willis
Sep
06
Add symfony code insight to NuSphere PhpED
This is one problem I faced with symfony. Although it's very easy to add "some" code insight to your project:

Just go to project properties - then add your project root (or PEAR install off symfony) and code insight will be added. Thanks to phpleo

posted by
Mark Willis
Sep
01
Symfony MVC outlook
I have been playing with the Zend framework for the past week or so, There will be a post in the next few days reviewing it. I am also looking at the Symfony framework this week and will post a comparison on both frameworks within the next week or two.
Symfony provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to release your applications earlier, host and scale them without problem.

posted by
Mark Willis