The OOP & refactor project weekly report 2

Hello everyone, one week soon come to an end, and here is my weekly report on what did I do in the last week. During last week, I was working on the Template class and try to fix the test problems in the PR 1642.

Files Covered In This Week

  • PMA_SystemDatabase_test.php
  • PMA_DatabaseInterface_test.php
  • Template.class.php

Outcomes In This Week

Introduce trim($string) to Template class
public static function trim($string)
and
public function render($data = array(), $trim = true)

I implemented a trim method for Template class because I found Javascript often reference value of HTML tags. Sometimes there may have some whitespaces in these tag values (Perhaps, for better readability of template codes), then we cannot get correct value of that tag by using $().html() in Javascript.
The trim method is default applied to all templates after it gets rendered. If you don’t want it be trimed, you can simply set the boolean field $trim in render method to false.
The trim method is designed to be static, so it can also be used as an utility for trim spaces in HTML pages.

Fix on PR 1642
Firstly I feel so sorry for taking so long to fix the problem of the pull request. I over estimated my knowledge on the phpunit test framework, eventually I have to spend a lot of more time to learn how to use it again.
Tests involve functions originally in tbl_views.lib.php was moved from PMA_tbl_views_lib_test.php to PMA_SystemDatabase_test.php and PMA_DatabaseInterface_test.php.

What will I Do Next

In next few days I will submit my works on template of the Designer Module. Also, I will post a new blog on dependency calculation on TableSearch.class.php.
The major job in next week will be starting template on table related scripts.

Advertisements
The OOP & refactor project weekly report 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s