Aug 25
A little late but I was pleased with the journal of Stephen on the benefits of using object-oriented programming (OOP) with PHP read parent. Since I've learned about Java and PHP in the same time, I was able to compare the advantages of both languages well together. On the one hand, the slight learning curve for PHP. On the other side of Java, with its integrated object orientation.
The learning curve of OOP is for developers who have started with simple procedural programming certainly more difficult and fun OOP makes only a good development environment (like Eclipse). But one has understood the object orientation and once internalized, one would miss them any more. So it goes at least to me. The most important are the concepts of OOP, such as:
- Encapsulation of data
- Heredity
- Overload
- Polymorphism
After that, the syntax is for the OOP programming language, which is in PHP certainly getting used to (just think of __construct () for a constructors), as in Java. But for that there are tutorials. The best deutschsrpachige tutorial is the online edition of the book:
Professional Software Development with PHP 5
Object orientation. Design patterns. Modeling. Advanced Database Programming.
by Sebastian Bergmann.
But nothing helps better than learning by doing . 
A little late but I was pleased with the blog entry by Stephan on the benefits of using object-oriented programming (OOP) with PHP read parent. Since I and PHP at about the same time I learned Java, I was able to compare the advantages of both languages well the. On the one hand, the slight learning curve for PHP. On the other side of Java, with its uniform object-orientation. The learning curve of OOP is for developers who have started programming with procedural certainly more difficult and fun OOP makes only a good development environment (like Eclipse). But one has object orientation once understood and internalized, one would miss them any more. So it goes at least to me. The most important are the concepts of OOP, such as: encapsulation of data inheritance overloading polymorphism Then there is the syntax for OOP of the respective programming language, PHP is getting used to Similar items: posted by gklinkmann \ \ tags: php
November 2008
Next it's off to the series "weekly links". These were my highlights in the past week:
- Linux on the IBM Thinkpad
- Notebooks from IBM or Lenovo's successor are particularly well suited for Linux. Here is a short guide for Kubuntu 9.10, how to persuade the laptop to save power and takes even more special keys in operation.
- Closure Tools - Google Code
- The Google Online Tools to use all Javascript extensively. So it is not surprising that Google now provides its Javascript compiler, a library for DOM manipulation and UI elements and templates for JavaScript and Java under the name Closure tools on Google Code for free use. I'm looking forward to the first comparisons with the Yahoo UI Bilbliothek.
- Technical short documentaries by Torsten Horn
- I'm on technical short documentaries (tutorials), especially if they have the quality as that of Torsten Horn.
- Continuous Integration for PHP with the Hudson
- Testing makes sense only if the tests are conducted regularly. Here is an article on how to integrate PHP tests in Hudson.
- google-maps-icons
- Free icons web developer as you can never have enough. Here is a great choice, as Google may provide.
- PDF creation with the Zend Framework
- The much-used PHP FPDF library to create PDF documents with complex layouts quickly gets to its limits. This article describes an alternative with Zend, which is through the detour of Office templates allow even complex PDF structures.
Next it's off to the series "weekly links". These were my highlights in the last week: Linux on the IBM ThinkPad notebooks from IBM or Lenovo's successor are particularly well suited for Linux. Here is a short guide for Kubuntu 9.10, how to save power persuades and notebook even more special keys in operation increases. Closure Tools - Google Code The Google Online Tools to use all of the Javascript extensively. So it is not surprising that Google now Javascript compiler, a library for DOM manipulation and UI elements and templates for JavaScript and Java under the name Closure tools on Google Code provides for free use his. I'm looking forward to the first comparisons with the Yahoo UI Bilbliothek. Technical short documentaries by Torsten Horn I'm on technical short documentaries (tutorials), especially when the quality to have by Torsten Horn. Continuous Integration for PHP with the H Similar items: posted by gklinkmann \ \ tags: Ajax , hardware , Java , JavaScript , Linux , php , tutorial , Ubuntu
Oct 27
The holiday is over - unfortunately. A little late, but instead more in number, the "weekly get left":
- jQuery Accessible-RIA - (disabled jquery)
- AJAX Frameworks and accessibility are currently two things that are not really compatible. The fact that there is another way, this shows hosted on GitHub project.
- Symfony Components - Standalone libraries for PHP
- Symfony is one of these beautiful new framework for PHP. The project has made available a few components that can be use even without installing the entire framework. I am very curious to the recently announced Request Handler.
- PHPUnit by PTI integrated into Eclipse
- For instructions to link the PHPUnit testing framework in Eclipse.
- SystemRescueCd
- The rescue CD with many useful tools, if the PC should sometimes experience problems.
- Raphaël-JavaScript Library for svg and vml
- A javascript library to create graphs and charts in SVG and VML (Microsoft) format. Very worth seeing.
The holiday is over - unfortunately. A little late, but instead more in number come the weekly "left": jQuery Accessible-RIA - (disabled jquery) AJAX frameworks and accessibility are currently two things that are not quite compatible with each other are like that. The fact that there is another way, this shows hosted on GitHub project. Symfony Components - Standalone libraries for PHP Symfony is one of these beautiful new framework for PHP. The project has made available a few components, is also installing the complete framework can use without the. I'm curious to see the announced request handler. PHPUnit by PTI in Eclipse to embed a guide to PHPUnit Testing Framework in Eclipse to integrate that. SystemRescueCd The rescue CD with many useful tools, if the PC times should experience problems. Raphaël-JavaScript Library for svg and vml A JavaScript library to create Similar items: posted by gklinkmann \ \ tags: Ajax , eclipse , ide , JavaScript , Linux , php , web , windows
Oct 19
While I was in the first part in my little series on HTTP clients have been busy with Pear, I will now in the second Part of my attention to the Zend Framework addressed.
Even here you need two packages to accomplish the task (see Part 1 ). The package Zend_Http is like the Pear Package Http_Request2 to pure HTTP communication suitable.
With Zend_Dom one can divide the received HTML.
One way to solve the task may be:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
| Php
; require_once 'Zend / Http / Client.php';
; require_once 'Zend / Http / Response.php';
; require_once 'Zend / Dom / Query.php';
'http://www.google.de' ; $ Url = 'http://www.google.de';
new Zend_Http_Client ( $url , array ( $ Client = new Zend_Http_Client ($ url, array (
0 , 'Maxredirects' => 0,
30 ) ) ; 'Timeout' => 30));
try (
$client -> request ( 'GET' ) ; $ Response = $ client -> request ('GET');
200 == $response -> getStatus ( ) ) { if (200 == $ response -> getStatus ()) (
new Zend_Dom_Query ( $response -> getBody ( ) ) ; $ Dom = new Zend_Dom_Query ($ response -> getBody ());
$dom -> query ( 'form' ) ; $ Forms = $ dom -> query ('form');
$forms -> current ( ) ; $ Form = $ forms -> current ();
$form -> getAttribute ( 'action' ) ; $ Action = $ form -> getAttribute ('action');
new Zend_Http_Client ( $url . $action , array ( $ Client = new Zend_Http_Client ($ url. $ Action, array (
0 , 'Maxredirects' => 0,
30 ) ) ; 'Timeout' => 30));
setParameterGet ( 'q' , 'http client examples' ) ; $ Client -> setParameterGet ('q', 'http client examples');
$client -> request ( 'GET' ) ; $ Response = $ client -> request ('GET');
new Zend_Dom_Query ( $response -> getBody ( ) ) ; $ Dom = new Zend_Dom_Query ($ response -> getBody ());
$dom -> query ( 'a.l' ) as $link ) { foreach ($ dom -> query ('a.l') as $ link) (
$link -> hasAttribute ( 'href' ) ) { if ($ link -> hasAttribute ('href')) (
$link -> getAttribute ( 'href' ) ; $ Href = $ link -> getAttribute ('href');
$link -> textContent ; $ Link = $ link text - text content>;
$href \" > $linkText </a><br />" ; echo "<a href= \" $href \"> $ link text </ a> <br />";
)
)
{ ) Else (
. $response -> getStatus ( ) . ' echo 'Unexpected HTTP status:'. $ response -> getStatus (). " '.
responseCodeAsText ( ) ; $ Response -> responseCodeAsText ();
)
Zend_Http_Exception $e ) { ) Catch (Zend_Http_Exception $ e) (
. $e -> getMessage ( ) ; echo 'Error:'. $ e -> getMessage ();
)
?> |
The code speaks for itself, so I will not explain it at this point as detailed as in the first part.
The difference is in the parsing of the HTML's. The method query () (lines 18 and 31) provides that is not an array, a special object of class Zend_Dom_Query_Result back. Since this class, the two interface Countable and Iterator implemented, the results of the inquiry with a foreach loop to go through. Every single match is over an object of class DOMElement shown.
Conclusion:
Zend also offers Zend_Http Zend_Dom and a good HTTP client. One uses in his project already have other classes from the Zend Framework this approach is recommended.
View:
In part three, I leave the PHP world and put HttpUnit a very comfortable and feature-rich HTTP client for Java before using.
Series: Part 1 - Pear While I was in the first part of my little series on HTTP clients have engaged in the Pear, I will now in the second Part of my attention to the Zend Framework addressed. Again, you need two packages to accomplish the task (see Part 1). Zend_Http is like the Pear Package Http_Request2 to pure HTTP communication. When combined with the received Zend_Dom can decompose. An HTML way to solve the task could look so The Package: The code speaks for itself, so I'll him this is not so explain in detail how in the first part. The difference is in the parsing of the HTML's. The method query () (lines 18 and 31) provides that is not an array, a special object of class Zend_Dom_Query_Result back. Since this class implements Iterator and Countable interface both those who can produce results within a foreach loop to go through the inquiry. Every single match is over an object of Kla Similar items: posted by gklinkmann \ \ tags: frameworks , php , web