Support

Forums

Contact Me

Posts Tagged 'php'

PHP

PHP is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages. [http://en.wikipedia.org/wiki/PHP]

Status of the ContinuousBuild4Joomla framework

I put some effort the last few days in this new framework.

Done:

  • I did document some part of it at http://wiki.waltercedric.com/index.php?title=ContinuousBuildforJoomla
  • TeamCity is installed/configured/documented (windows only)
  • XAMPP is installed/configured/documented (windows only)
  • I also at the same time configured a Puppy Linux VMWare image that will permit to anybody to have a running environment in no time.
  • I am able to unpack all Joomla! versions that are committed in any repository (CVS, SVN, Clearcase)
  • They can be unpacked anywhere on file system (config in setEnv.xml), ideally they are unpacked in the root htdocs of XAMPP
  • Code is committed at Joomla forge in SVN http://joomlacode.org/gf/project/continbuild4j/

Issues

Selenium test suite do not accept a baseurl (or only a part of it) so I have a full path like /Joomla1.5.7/installation/index.php in a selenium test case instead of /installation/index.php in test case and baseurl= http://localhost/Joomla1.5.7)

Architecture

3rd Party

  • I use antelope for some advance ANT operations: substring, indexof, loop
  • I use selenium java server on port 4444 (default)

Cluster

All cluster operations are in cluster.xml these basic functions are

  • cluster.init
    • cluster.remove        remove all instances of Joomla! in checkout directory
    • joomla.unpack.all    unpack all Joomla! versions that are checked in another SVN root
    • joomla.install.all      run the same selenium test case joomla.install.html on all Joomla! instance
    • joomla.remove.all.installation   remove all Joomla! installation directories
    • joomla.check.all     check all Joomla! installations for correctness
  • cluster.start
  • cluster.remove
  • cluster.stop

Joomla!

All Joomla specific operations are in joomla.library.xml

  • Unpack a Joomla! version
  • Remove the installation directory form a version
  • Apply a selenium test suite install.joomla.html that can use the regular Joomla! installer
  • Is also able to do all of the above on all Joomla! versions found (regular expression) in checkout directory

Selenium

  • All selenium operations are in selenium.xml
  • All test suite and test cases are in /selenium/joomla/

PHPUnit

All PHPUnit operation are in phpunit.xml

Settings

Settings are in setEnv.xml, in future I will lazy load a file if it exist as environment variable

 

If you know ANT, the code is quite readable...

Future review of Joomla!® 1.5 Development Cookbook and Build and Manage Applications with Maven, Continuum, and Archiva

apache_maven

Packt publishing has offered me to make a review of two of their new books (Thanks to them). I should receive free samples for review beginning of next week. Since it is two of my favorite subjects (Maven and Joomla!® ), I think it may also interest you. A review will follow in some days.

ApacheMaven2EffectiveImplementation  

Build and Manage Applications with Maven, Continuum, and Archiva

  • Install Apache Maven and follow the sample application to build up your project as quickly as possible
  • Test your applications to ensure maximum stability using Maven's inbuilt tools
  • Use Maven's report and checking tools to ensure the health of your projects
  • Explore Apache Continuum which will help you to ensure the health of your source code
  • Improve your team builds with the powerful combination of Maven, Archiva and Continuum
  • Install and run the repository manager Apache Archiva
  •  

 

Joomla!1.5DevelopmentCookbook

Joomla!® 1.5 Development Cookbook 

  • Make your extensions extensible, add extensions points to allow third parties to customize your extension
  • Create international extensions by enabling multilingual capabilities
  • Build more than just HTML pages - create PDF documents, Atom Feeds, and more!
  • Improve the user experience by adding Ajax
  • Create Atom and RSS feeds to keep users up-to-date
  • Utilize the power of Subversion to maintain your source code
  • Execute database queries and handle returned data in order to access and modify your data
  • Dynamically extend your database tables using JParameter to make your extensions more flexible
  • Keep your gremlins at bay by handling errors the Joomla! way
  • Work with the file system, interrogate existing files and folders and store data in the file system
  • Take control of your workflows by using www.JoomlaCode.org to manage your Joomla! projects

How To Debug PHP scripts with PhpStorm

phpstorm_header

JetBrains PhpStorm is a commercial IDE for PHP built on JetBrains' IntelliJ IDEA platform.

PhpStorm provides intelligent editor for PHP code, HTML and JavaScript with on-the-fly code analysis and automated refactoring for PHP and JavaScript code. Code completion supports PHP 5.3 including namespaces and closures.

Articles tagged

Read more: How To Debug PHP scripts with PhpStorm

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 ""; }
Articles tagged

Ebay architecture scalability

At SD Forum 2006, Randy Shoup and Dan Pritchett, both with eBay, gave a presentation on eBay's architecture. Pritchett subsequently posted his presentation slides in his blog, The eBay Architecture.
Predictably, the presentation contained a few inspiring statistics, such as:
  • 15,000 application instances running in eight data centers
  • 212,000,000 registered users
  • 1 billion page views per day
  • 26 billion SQL queries and updates per day
  • Over 2 petabytes of data
  • $1,590 worth of goods traded per second
  • Over 1 billion photos
  • 7 languages
  • 99.94% uptime

Other stats in the presentation related to development process and features, such as:

  • Over 300 new features released each quarter
  • Over 100,000 lines of code released every two weeks

  • "According to the presentation, the goal of eBay's current architecture is to handle an additional ten-fold increase in traffic, something eBay expects to reach within a few short years. Another architecture objective is to be able to handle peak loads, and for components to gracefully degrade under unusual load or in the case of system failures." read more  HERE

     

    Digital watermarking with PHP and GD2

    joomla_cms

    php.logo  

    Digital watermarking is the process of possibly irreversibly embedding information into a digital signal. The signal may be audio, pictures or video, for example. If the signal is copied, then the information is also carried in the copy. In visible watermarking, the information is visible in the picture or video. Typically, the information is text or a logo which identifies the owner of the media. [Wikipedia]

    If you decide to go with an online watermarking, you can let watermark picture on the fly using php and .htaccess (at the cost of additional CPU server resources).

    Read more: Digital watermarking with PHP and GD2

    How to install the latest PHP version for Ubuntu

    Ubuntu 10.10 (Maverick) is offering as for today a relative old version PHP 5.3.3, if you want to have a better version, you’ll have to trust an unofficial APT repository. Here is How

    Thanks to the NGINX team, you can find nearly the latest version of PHP online at https://launchpad.net/~nginx/+archive/php5

    Create a new file php5-ppa.list

    vi /etc/apt/sources.list.d/php5-ppa.list

    and depending on the version of your ubuntu, you can replace the word maverick with the oldest oneiric, natty, or the latest lucid

    deb http://ppa.launchpad.net/nginx/php5/ubuntu maverick main
    deb-src http://ppa.launchpad.net/nginx/php5/ubuntu maverick main

    run an update, to get the latest PHP version

    # apt-get update
    # apt-get dist-upgrade

    Alternatively you can still compile PHP on your own..

    Install PHP support PDT in Eclipse Indigo

    Developed by Zend and IBM, Eclipse PDT add support for PHP development and allow to focus on the development of complex PHP-driven web applications. There is currently no package ready to download hence this small how to

    How to install PDT

    Wait till download complete and restart Eclipse to enjoy PHP support!

    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!

    Impact of Zend Optimizer on PHP Performance

    Impact of Zend Optimizer on PHP Performance

    The Zend Optimizer FAQ answers the question "Why use the Zend Optimizer?" with this statement: "The standard Zend run-time compiler used by PHP is indeed extremely fast, generating code that is usually 2 to 10 times faster. But an application that uses the Zend Optimizer typically executes another 40% to 100% faster."

    Read the results of the load test HERE.

    Donations

    Thank You for supporting my work