Creating a Search in Slim Framework with hooks

My project website numphp.org is based on the PHP micro framework Slim. There is no nead for a cms or blog system. I just need some static pages and a little bit of logic. My posts on numphp.org are just static html files that will be served with the php function file_get_contents. But I would like to make the posts searchable. The easy way would be a slim route for search that is just checking if the searched query is contained in every post of my blog. But in near future I would like to make also the documentation searchable. So I will use the hooks of the Slim Framework. Hooks are the same as events in other frameworks. You can throw them and listen or observe them.

Two weeks ago I could not find events in the Slim Framework so I made a Pull Requests to add a EventManager to the Framework. But before sending the Pull Request I have figured out, events are just called hooks:)

Continue reading ...

Magento Unconference 2015 Summary

From the 7th to the 8th March 2015 was the Magento Unconference 2015 #mageuc15. Unfortunately I have missed the pre-party at Friday, but I heard it was quite funny. I have been arrived at Saturday morning. Every participant had the opportunity to suggest a topic that he is interested in. It was a cool mix, for example Avoiding Burnout, Magento Search or Module testing. Sometimes it was a presentation, sometimes a discussion or a mix of both. It was a real community event.

Continue reading ...

CSS conflict between WordPress Twenty Fifteen and embedded Github Gists

5 minutes ago I have written a post with a Github Gist. You can embed Gists like this in your posts

<script src="https://gist.github.com/GordonLesti/8822532.js"></script>

But the gist has looked like this

before

Continue reading ...

Multidimensional ArrayAccess in PHP is impossible

I'm working on NumPHP again and for the next version I would like to give this library a little bit more syntactic sugar. For example the get and set functions look like this at the moment.

$column = $matrix->get('1:3', 5);
$matrix->set(3, '1:', $vector);
Not bad, but something like this would be better.
$column = $matrix['1:3'][5];
$matrix[3]['1:'] = $vector;
So I have found the interface ArrayAccess, but it has one big problem. It is not for multidimensional objects.

Continue reading ...

Disable clickable links in Wordpress comments

I have noticed more and more links to commercial Magento extensions in the comments of my blog. That is pretty normal, cause my Magento extensions aren't free of conflicts with other extensions and people just want to give me a hint. But sometimes I'm not sure if they just want to ask a stupid question and make their link. SEO isn't my hot topic. Everything I know is, good content and backlinks are important. I always visit the website of an comment and sometimes I remove their link to an commercial Magento extension shop. But I would like to disable the links in the comments. So I have decided to make all links in comments not clickable.

Continue reading ...

Mage Unconference 2015

Since two years I wasn't on any magento confernce. That's mostly because I'm a student and I haven't enough money for big conferences. So today I would like to promote the Mage Unconference 2015 and this post is my contribution. The conference will happen at 7th and 8th March 2015 in Berlin. I have my ticket and it would be pretty cool to meet some people from the magento community, that I only know from there github avatars.

Continue reading ...

Testing the quality of Lesti_Fpc

Lesti_Fpc has changed in the last month. Some of the changes are part of the code quality. Today I would like to present the tools, that I use to raise the quality of my Magento extension.

Continue reading ...

Install Pencil on Debian

Pencil is a pretty nice open-source GUI prototyping tool. The only little problem for Debian user is, Pencil depends on Firefox and not on Iceweasel. If you want to bypass that problem very easy, you can download pencil as Firefox Extension. But if you want to use Pencil as native application you have to download the deb package and will see, that it depends on Firefox. Iceweasel and Firefox are the same things, but have different names.

Here is a Wikipedia articel about Mozilla Corporation software rebranded by the Debian project.
You can run dpkg also with --ignore-depends=firefox, but that isn't a very good solution.

Continue reading ...

Edit cacheTags and Parameters via events in Lesti_Fpc 1.3.2

In Lesti_Fpc 1.3.2 I have added the possibility to edit the cacheTags and Parameters via an event. The idea of the Fpc was very clear and simple, but every day I get requests from developers with problems, that aren't that simple. For example oblomovx wanted to Disable Cleaning of Categories after product save. Maybe 98% of all Fpc users didn't need the possibilty to disable this functionality. Or riznmage wanted to Add AJAX parameter to make a differnce between requests that are made by ajax and normal requests. I can understand the need of such a thing, but on the other site I can't implement every crazy idea or I just think that it is wrong to make a ajax request on a action that isn't normally made for it. To let the Fpc simple, but also give those people the possiblity for there workflow I have made it like Magento. I have dispatched some events to work a little bit more advanced with the behavior of the Fpc.

Continue reading ...

Simulate Mouse Clicks in QUnit on Coordinates

I made a small plugin for jQuery to get the color of an image pixel. It's called broilerjs. I wanted to test the plugin via QUnit, a JavaScript Unit Testing framework. But I could not find a possibility to simulate a mouse click on special x and y coordinates. But in the end it was very easy.

Continue reading ...

Newer Older