Support

Forums

Contact Me

PHP Code Snippet to retrieve Data from WikiPedia

This interesting code snippet is from cedTag and let you retrieve WikiPedia description using OpenSearch API. It use the Client Url Library cURL. Released under GPL v3

/**
 * @param $searchTerm
 * @param string $wikipediaServer
 * @return array|string  [text, description, url]
 */
public function getDefinitionFrom
($searchTerm, $wikipediaServer = 'http://en.wikipedia.org') { $url = $wikipediaServer.
'/w/api.php?action=opensearch&search=' .
urlencode($searchTerm) . '&format=xml&limit=1'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPGET, true); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_NOBODY, false); curl_setopt($ch, CURLOPT_VERBOSE, false); curl_setopt($ch, CURLOPT_REFERER, ""); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_MAXREDIRS, 4); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT,
"Mozilla/5.0"); $page = curl_exec($ch); $xml = simplexml_load_string($page); if ((string)$xml->Section->Item->Description) { return array((string)$xml->Section->Item->Text, (string)$xml->Section->Item->Description, (string)$xml->Section->Item->Url); } return ""; }

XAMPP 1.8.0 Xdebug stop working and make segmentation fault

There's a new version of Xdebug released which fixes a major bug where inspecting static properties caused Xdebug to crash in XAMPP 1.8.0.

Unfortunately, you’ll need to update manually the version of Xdebug shipped with XAMPP to Xdebug 2.2.1 rather than 2.2.0:

Simply download the correct Xdebug binary (VC9 threadsafe PHP 5.4 VC9 TS (64 bit) (MD5: 81cacc87168c99c7f65ba202dc12c4b2)) and copy it in your XAMPP installation at xampp\php\ext\php_xdebug.dll

restart Apache and you can continue debugging!

Eclipse PDT 2.0 is available

The PDT project is working towards providing a PHP Development Environment framework. This project was formerly known as PHP IDE.

Make Eclipse PDT work for Joomla development

Install a PHP debugger

In order to be able to perform debugging using eclipse PDT, you must download one of the following extra packages:  XDEBUG or ZEND debugger. I was not able to get the debugger running with XDEBUG even after reading many tutorials and trial error approach. Both packages are free, and it has work nicely for me with ZEND debugger after 5 minutes...

Unfortunately, XDEBUG/ZEND can not be packaged with PDT due to license restrictions, so both tools are not just running out of the box without few efforts.

PDT and Zend Debugger

Download

PDT + Zend in one package thanks to Zend.com (118MB), highly recommended

OR PDT (105MB) and add Zend debugger through software update later

  • Open Eclipse and go to Help-> Software Updates-> Find and Install
  • Select "Search for new features to install" and click "Next"
  • Create a New Remote Site with the following details:
  • Name: PDT
  • URL: http://downloads.zend.com/pdt
  • Check the PDT box and click "Next" to start the installation

Read more: Eclipse PDT 2.0 is available

Install PHPUnit and PHPDocumentor in XAMPP

phpunit-logoselenium-logoxampp.logo

Open XAMPP Shell (start c:\xampp\xampp-control.exe and click on the button XAMPP-Shell), and run:

pear channel-discover pear.phpunit.de
pear channel-discover components.ez.no
pear channel-discover pear.symfony-project.com
pear install --alldeps phpunit/PHPUnit
pear install phpunit/DbUnit phpunit/PHPUnit_Selenium
pear install phpunit/PHPUnit_SkeletonGenerator
pear install phpunit/PHPUnit_Story phpunit/PHP_CodeCoverage
pear install PhpDocumentor

Read more: Install PHPUnit and PHPDocumentor in XAMPP

Eclipse Foundation, Zend Technologies, and IBM Announce the Approval of the PHP IDE Project

The major news I was waiting for:


Eclipse Foundation, Zend Technologies, and IBM Announce the Approval of the PHP IDE Project
The Eclipse Foundation, an open source community committed to the implementation of a universal software development platform, Zend Technologies and IBM, today announced that the Eclipse PHP IDE project has been approved by the Eclipse Foundation. The technology project was proposed by Zend and IBM on October 21, 2005. It will deliver a PHP Integrated Development Environment framework for the Eclipse Platform and will encompass the development components necessary to develop PHP-based web applications and will leverage the existing Eclipse Web Tools Project.

Read the proposal here, If youre are in the area of Santa Clara, Zend is showing  demo at EclipseCon. Do someone know what wwill happen wwith PHPeclipse.de ???

Donations

Thank You for supporting my work