RSS
 

Posts Tagged ‘php’

PHP song by Emergent Collective One, and it ROCKS!

04 Aug

Oh, hell yeah, I just found my personal anthem thx to colleague Dimitri.

This is for all you PHP hating dudes! Big thank you goes to the Emergent Collective One!
Lee Fernandes, creator of the song said this:

I like thick beats, and I struggle with lyrics, but can do something nice from time to time. Some of the style I learned in music production translated to application development, a general willingness to try new approaches. And the pragmatism of development cycles came back to my music production workflow, so I bang em out dutifully.

Check for song nr 4, play it and listen to the lyrics, it’s awesome.

The whole album of Emergent Collective One is free to download at http://fracturedvisionmedia.com/FVM005/

Be sure to listen to all other songs on the album too, they really aren’t that bad at all!!!

 

Mysql-bin files ate up all disc space

02 Jun

Since a few weeks I got the problem that my C drive was getting completely filled and I didn’t found where it came from. Well seems like the MySQL-bin log files where eating up all of the space on the C as my Wamp folder is located there.

I have a Wamp running with Apache 2.2.14, PHP 5.2.11 and MySQL 5.1.41 and log files are stored locally in the bin folder.

Over the past few months those bin logs grew to huge files and where taking over 7 GB in space.

It could be good to know what those MySQL-bin log files are:

The binary log contains “events” that describe database changes such as table creation operations or changes to table data. It also contains events for statements that potentially could have made changes (for example, a DELETE which matched no rows). The binary log also contains information about how long each statement took that updated data.

So if I understand this correctly, these files are completely useless in my personal case. Time to remove them, but can you do that without destroying my whole setup?
Well the answer is quite easy: Yes!

How then: well go to your MySQL prompt and run this commando to get an overview of all current bin files.

MySQL > show binary logs;

An overview of binary logs is given.

show binary logs

Then simply remove all files that are changed before a certain date:

MySQL > PURGE MASTER LOGS BEFORE '2010-06-01 00:00:00';

And all magic is been done, logs are removed and you can start all over again filling up all space on your C drive.

To turn off log-bin, edit /etc/mysql/my.cnf and comment out log-bin:
#log-bin = <your-value>

Have fun.

 

Interview: Stefan Koopmanschap

22 Sep

3317597132_6be12c93c7

A few weeks ago I thought it might be cool to get some interesting guys, which are occupied with projects in PHP, interviewed. And guess what, we got on contact with Mr. Stefan Koopmanschap and he was kind enough to answer all our questions.

Stefan Koopmanschap (‘left’) is a PHP developer, consultant and trainer with an eye for best practices. He works at Unet as (symfony) developer and development team leader. He is a community person and is active in the european PHP community as secretary of the phpBenelux Usergroup as well as in the Symfony community by advocating symfony and as the Community Manager.

Stefan has a wide history in Open Source, having been Support Team Leader for phpBB, documentation translator for Zend Framework and community manager, plugin developer and maintainer plus various other things for symfony.

Stefan is also a best practices advocate. He prefers easy and useful explanations of best practices over the academic and theoretical stuff found in most literature.

Hope you enjoy this interview!

Hello Stefan, first of all, thx for taking the time to answer all our questions.

Can you tell us what projects you are currently working on?

At work I am involved in a big project to build an application that will handle all the administration, provisioning and handling of user accounts etc. for the whole VOiP and connectivity of the services we offer. Aside from that, my main projects are being the Community Manager for symfony and also preparing some new talks for the upcoming conferences.

Read the rest of this entry »

 

A few helpful PHP date methods

14 Apr

For a lot of people dates in PHP are an issue, and the PHP functions aren’t sufficient enough to do all converts you need.
Therefore you find a few easy PHP date conversion methods. Feel free to add your own methods or requests in the comments as we know that these methods don’t cover everything. You can see it for yourself when you read the rest of this entry:

  • get start and end date for the next two months in an array
  • get the datetime for a specific user culture in Symfony
  • get all days between a given start and end date and return it in an array
  • get the difference between two dates

Read the rest of this entry »

 

To reinforce our IT team, we are hiring a colleague (M/F)

28 Oct

As we are growing we are in need for a new junior developer to create and maintain websites. If you or someone you know is interested in this job feel free to contact us. The company is Step-@-Site and we are located in Brussels (Vorst/Forest). Our portfolio contains websites/newsletters/intranet sites for small and big companies, for example;

Your profile:

- Bachelor studies in ICT (junior)
- PHP, MySQL, ASP, JavaScript, HTML and CSS
- Thinking in terms of performance, response time and usability of interfaces
- Systematic and dedicated personality

Offer:

We offer an interesting salary and fringe benefits, linked to your personal competencies and your experience.

Feel free to contact me on kennethvr [AT] devexp [DOT] eu

 

The helpful design patterns

15 Sep

The use of patterns in code being a good enhancement isn’t big news. But I discovered them recently and am very positive about it. It can, when understood, hugely increase your readability and is a nice problem solver for complicated and extendible coding.

Before creating a design pattern, you have to create it on paper. Think about what pattern you can use before implementing one. There are different patterns, every one of them has specific needs and specifications.

For example:

* Observer Pattern
* Decorator Pattern
* Factory Pattern
* Command Pattern
* etc…

In our case we needed to build a good nice 5-step wizard that is perfect to use simple pattern structure.

For us, it made the code very easy to understand and realy clean. We created one controller that gets the correct action when initialized , and it initializes the correct class (step) by itself.

$controller = new StepController();
$controller -&amp;gt;getInstance($action);

stepcontroller.class.php

public function getInstance($currentAction = null) {

$stepAction = null;

switch($currentAction) {
case &amp;quot;step1&amp;quot; :
$stepAction = new step1Action();
break;
case &amp;quot;step2&amp;quot; :
$stepAction = new step2Action();
break
}

return $stepAction-&amp;gt;execute();
}

All the action classes have a execute function on their own and implement an interface that contains the execute function.

By using this kind of pattern it is very easy for us to add or remove steps in our little wizard. Every step has its own action and is really easy to maintain.
As you can see (and this is only one little example) the patterns have great advantages, the only challenge is to know what pattern to be used best in your specific situation.

Have fun with it.