php

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. [read more at http://en.wikipedia.org/wiki/PHP]


  • Since I am facing performance problem due to the load of visitors and a badly configured server, I decide today to document my findings in this new series of articles.

    As soon as PHP run as FastCGI and no more inside an Apache module (mod_php4.so is not multi threaded), You should be able to switch the default MPM setting of Apache from MPM prefork to MPM worker.

    So, what's the difference between prefork and worker?

    Quoting from the Apache MPM Prefork page: http://httpd.apache.org/docs/2.0/mod/prefork.html
    MPM Prefork implements a non-threaded, pre-forking web server that handles requests in a manner similar to Apache 1.3.

    And for the Apache MPM Worker says: http://httpd.apache.org/docs/2.0/mod/worker.html
    MPM Worker implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server.


    Server: Strato (www.strato.de)
    Operating system: SuSE / openSuSE
    Requirements: root access and basic Unix knowledge

    1 Edit the file  
    # vi /etc/sysconfig/apache2

    and change the key:

    APACHE_MPM=" "


    to

    APACHE_MPM="worker"


    2 You can now tune also  default parameters in file /etc/apache2/server-tuning.conf
    Here are my settings, these are still the default setting of Apache

    vi/etc/apache2/server-tuning.conf

    # worker MPM

    <IfModule worker.c>
        ServerLimit 16
        # initial number of server processes to start
        StartServers         2
        # minimum number of worker threads which are kept spare
        MinSpareThreads     25
        # maximum number of worker threads which are kept spare
        MaxSpareThreads     75
        # maximum number of simultaneous client connections
        MaxClients       150
        # constant number of worker threads in each server process
        ThreadsPerChild     25
        # maximum number of requests a server process serves
        MaxRequestsPerChild  6000
    </IfModule>




    3 start
    # apache2-reconfigure-mpm
    this recreate the file  /etc/apache2/sysconfig.d/loadmodule.conf
    and restart apache automatically. Test Your site to ensure everything still work as expected.


  • joomla_cms

    Since my server is still suffering, Ive decide today to take some actions.

    user: changes can be done on shared hosting with limited user rights.
    root. changes require a full access to the server (root access with secure shell ssh)

    I have currently per months, 160.000 visitors and 2 Millions Hits.or per day 8000 visitors and 24000 pages view.
    Server has only 1GB RAM.

    UPDATE: I found one/THE reason why my host is slowing down...SPAMMERS!

    click read more

    user: Joomla! settings
    • I switch enable gzip compression OFF. Since this is meant to reduce the usage of bandwidth, not the load on my  server. The server has to encode all the files in order to send them, which only puts additional load on your page.
    • I switch Joomla!! statistics off, as AWSTATS is providing a much better job.
    user: MySQL maintenance

    I Optimize (repair, refresh statistics) MySQL tables through MySQL admin, but It can be done through PLESK
    user: Tune Joomla!! cache

    I Increase Joomla! cache lifetime from 900seconds to 24 hours as it better reflect the way I update my site (daily)
    user: keep pages small

    • Reduce size of banner, using GIMP so they are using a web palette, most of them were shrink from 40kb to 7kb
    • I remove all un-needed space from the main templates file (index.php), an action which will help first users visitors only.
    • Attention, it is a never ending task...
    user: Hunting software bugs
    By switching the site to debug mode, I notice some nasty queries (select count(*) from), all created by my statistics module ( Content Statistics on right side), In fact Joomla!! module do not inherit from Joomla!! cache automatically. I fix value in this module since I do not want to program cache support in it right now.
    root One morecache

    I decide to install a PHP accelerator: PHPA from  http://www.php-accelerator.co.uk/
    " The ionCube PHP Accelerator is an easily installed PHP Zend engine extension that provides a PHP cache, and is capable of delivering a substantial acceleration of PHP scripts without requiring any script changes, loss of dynamic content, or other application compromises."

    Install is straightforward: just copy library into /usr/local/lib/php_accelerator_1.3.3r2.so
    and add these lines to /etc/php.ini

    ; PHP Accelerator extension
    zend_extension="/usr/local/lib/php_accelerator_1.3.3r2.so"
    phpa = on
    phpa.c0_size = 64
    phpa.cache_dir = /tmp
    phpa.c0_logging = on


    ;The shm_stats_check_period is the minimum interval between checks of the
    ;cache for expired scripts. The first server request after the interval has
    ;elapsed will trigger a scan of the cache for expired scripts, and remove
    ;any entries that it finds.
    phpa.c0_stats_check_period = 5m

    ;The shm_ttl value is the value used to set the
    ;time-to-expiry value when a script is accessed. Put another way, the shm_ttl
    ;value is the period after which an unaccessed script expires.
    phpa.c0_ttl = 12h

    ;phpa.ignore_files = ""
    ;phpa.ignore_dirs = ""

    I use that tool: HTTP Viewer to check if my page now contains a headerX-Accelerated-By:·PHPA/1.3.3r2

    Reduce surface of attack: I found my components that were not used by Joomla! (very old code and uused components . So go through all directories with FTp/SCP and remove any un-needed code....


    Review table data directly in the database...
    This is how I found 27 000 spams in my gallery (Zoom gallery)
    solution:
    • I remove all entries
    • Disallow comments operations (in Zoom gallery admin panel),
    but spammers were still able to insert comments, so I edit the file components/com_zoom/lib/image.class.php
    //add because of spammers
    header("HTTP/1.0 403 Forbidden");
    //$database->setQuery("INSERT INTO __zoom_comments (imgid,cmtname,cmtcontent,cmtdate) VALUES ('".mysql_escape_str

    Note: I  recommend You to use also mod_evasive and mod_security  (root access needed), see aprevious article on my site



    Some links, where I borrow some ideas:


    http://www.primakoala.com/tutorials/guides/speeding_up_joomla.html
    http://forum.joomla.org/index.php/topic,50278.0.html
    http://forum.joomla.org/index.php/topic,54175.0.html
  • This small plugin for Joomla! add a message inviting iPhone/iPad users to add the web application to the home screen.

    The code is compatible with iPhone/iPod touch, iPhone4 and iPad. On older devices the “add” icon is a “+” while on iOS 4.2 it has been replaced with . The script detects the OS version and displays the appropriate icon.

    The message appears after 2 seconds (customizable) from page load, and is destroyed after 20 seconds (also customizable). The balloon enters and exits the screen with a quick configurable animation: drop from top, bubble from bottom or fade in/out. Additionally it also let you choose a custom icon for your blog when a visitor adds your website to start screen.

    What’s new

    • New version for Joomla 2.5 / 1.5
    • New javascript engine&160; in version 2.0,
    • New CSS,
    • Add support for returningVisitor: show the message to returning visitors only. Set this to true and the message won’t be shown the first time an user visits your site. Default: false,
    • Add support for autostart: should the balloon be automatically initiated? Default: true.
    • BUG: avoid duplicate javascript insertion now using onAfterDispatch() instead of onAfterInitialise
    • BUG: now touchIcon is properly inserted in message
    • Add support for custom iconMessage,
    • add support status-bar styling:
      Sets the style of the status bar for a web application.
      This meta tag has no effect unless you first specify full-screen mode as described in “apple-mobile-web-app-capable.”
      If content is set to default, the status bar appears normal. If set to black, the status bar has a black background. If set to black-translucent, the status bar is black and translucent. If set to default or black, the web content is displayed below the status bar. If set to black-translucent, the web content is displayed on the entire screen, partially obscured by the status bar. The default value is default.

    Full list of changes available in GIT commit e1e375cc44d594236db2a84702bad6f426ce99b6

    &160;

    add2Home_ipod_iphone_ipad_joomla_001 add2Home_ipod_iphone_ipad_joomla_002

    This plugin is based on the project add2Home (MIT license) and all credits goes to the author Matteo Spinelli

    You can see a demo of it at http://vimeo.com/19090508 and it is currently active on this blog.

    You can create your own Apple icon using free online service like http://wizardtoolkit.com/shooter/iPhone-Icon-Generator

  • This small plugin for Joomla! add a message inviting iPhone/iPad users to add the web application to the home screen.

    Add2Home has been updated to version 1.6.4 correct 2 bugs and contains an important new feature for both Joomla 1.7 and Joomla 2.5. For existing users the update will display in the Extensions Manager under Updates. If you do not have this currently installed, you can click the link below and install as normal via the Extensions Manager.

    New ideas/features/bugs are always welcomed either through forums or&160; by using feedback

    Some early report show that on add2Home work on iPhone/iPad/iPod running iOS 5.01 The close button doesn´t work on IOS 5.1. It seems to have something to do with iOS versions. I am on it

    What’s new?

  • NEW: Add new setting “webapp-links" Using this will rewrite all your internal Joomla links and make your entire site appear to be working outside of safari as a web application!.
  • NEW: Installation branding,
  • BUG: new update site in installer
  • BUG:duplicate initialization of javascript
  • NEW: Frequently Asked Questions started in wiki

    Full list of changes available in GIT commit 329d0a3765d5b86af49377dfbb04a0317b94fcc7 and 2131a2e3e6a51b4d6f54e790dc7a961650cce7b5

  • MediaWiki-logo I search and search on how to add a Google analytics to MediaWiki, seems pretty damn simple as long as you know which templates you are using as default.

    The current skins is configured in LocalSettings.php

    ## Default skin: you can change the default skin. Use the internal symbolic
    ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook':
    $wgDefaultSkin = 'monobook';

    Head to {mediawiki_root}/skins and edit&160; the right skins, for me it is MonoBook.php

    Just add your analytics scripts before the </body>. Now MediaWiki will add the marker in every page

    Before

    <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
    <?php $this->html('reporttime') ?>
    <?php if ( $this->data['debug'] ): ?>
    <!-- Debug output:
    <?php $this->text( 'debug' ); ?>
    -->
    <?php endif; ?>
    </body></html>

    After

    <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
    <?php $this->html('reporttime') ?>
    <?php if ( $this->data['debug'] ): ?>
    <!-- Debug output:
    <?php $this->text( 'debug' ); ?>
    -->
    <?php endif; ?>
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost
    + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-88600-7"); pageTracker._trackPageview(); } catch(err) {}</script>
    </body></html>
  • I took the time to work 3 hours on OpenComment, and I made some impressive progress...
    • I am able to understand xajax development and error messages faster now
    • Nearly all basic functions are AJAX enable: rating, admin function, publishing, sorting, filtering etc...
    • I have start to refactore the code and clean out dead and bad code,
    • I am able to use some basic Joomla library (while not being in a Joomla session).
    And in order to thank You all for Your patience, I have create a FLASH movie with WINK

    Wink is a Tutorial and Presentation creation software, primarily aimed at creating tutorials on how to use software (like a tutor for MS-Word/Excel etc). Using Wink you can capture screenshots, add explanations boxes, buttons, titles etc and generate a highly effective tutorial for your users.

    Carbon Viewlet being too expensive: 200$ right now for my usage but if someone has a licence to offer me ;-)

    The video is  here GO for OpenComment video  (a little bit rough for 300kB, but the WOW effect should be here)

    • All operation are done WITHOUT reloading the whole page,
    • This thing is lightning fast
    • The AJAX library has reduce the code of at least 30% (no more form, no submit, no code to compute redirect url etc...)
    BUT
    • Dont ask for a release date, it will be ready when it is ready!
    • Adding security and reviewing code has to be done, I dont want to let hackers missuse the system.
    • The PHP code is commited to Joomla forge,
    • The PHP code is right now still joomla 1.0.9 compatible, I think I need less than a day to migrate code to Joomla 1.5 API
    • No installer or complete admin panel (70%) right now, will be done at the end.
    • Contact me if You want to help.
    more news soon....ENJOY
  • When Eclipse meet Joomla!...from 0 to Joomla! in 3 minutes

    &160;

    The easiest way to develop component, modules, plugin for Joomla! using best of the breed open source software.&160;
    In order to speed up development of Joomla software, I did develop a developer package "start and ready to work". So basically nothing special for any experienced developer, just a gain of time. Less experienced developer will enjoy the package!&160; Just unpack the big ZIP file on any drive, start 2 program and you have a running Eclipse and Joomla! environment for developing

    Read more in the WIKI

    To be release in a few hours from now


    Content of package

    eclipse logo
    Eclipse 3.4
    www.eclipse.org
    Eclipse is an open source community whose projects are focused on providing a vendor-neutral open development platform and application frameworks for building software. The Eclipse Foundation is a not-for-profit corporation formed to advance the creation, evolution, promotion, and support of the Eclipse Platform and to cultivate both an open source community and an ecosystem of complementary products, capabilities, and services.
    PDT 2.0 The PDT project provides a PHP Development Tools framework for the Eclipse platform. This project encompasses all development components necessary to develop PHP and facilitate extensibility. It leverages the existing Web Tools Platform (WTP) and Dynamic Languages Toolkit (DLTK) in providing developers with PHP capabilities.
    xampp.logo&160;
    XAMPP 1.7.0
    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.
    apache http server
    • Apache HTTPD 2.2.11 + Openssl 0.9.8i

    The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.

    Apache has been the most popular web server on the Internet since April 1996.
    with mod_rewrite
    php logo
    • phpMyAdmin 3.1.1
    • FileZilla FTP Server 0.9.29
    • Mercury Mail Transport System 4.52
    PHP is a popular open-source programming language used primarily for developing server-side applications and dynamic web content, and more recently, other software. The name is a recursive acronym for "PHP: Hypertext Preprocessor".

    with PHPdg debugger support
    with GD2 image manipulation library
    phpadmin
    PphpMyAdmin 3.1.1
    phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. Currently it can create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields.

    Accessible through:
    http://localhost/mysql/
    joomla logo
    Joomla 1.0.15
    www.joomla.org
    Joomla! is one of the most powerful Open Source Content Management Systems on the planet. It is used all over the world for everything from simple websites to complex corporate applications. Joomla! is easy to install, simple to manage, and reliable.

    configured to access mysql dev10x database
    admin panel login: admin
    admin panel pwd: admin
    joomla logo
    Joomla 1.5.9
    www.joomla.org
    configured to access mysql dev15x database
    admin panel login: admin
    admin panel pwd: admin
    mysql logo
    MySQL 5.1.30&160;
    root login: root
    root password: empty
    Eclipse Launcher Version 2.0.2 A tool for java developers using eclipse IDE. The eclipse launcher provides developers to manage multiple workspaces and to start those. The program is shown in system tray from which it is possible to edit or start the workspace definition in an easy way.
    java
    Sun
    KDK 1.6u11
    Java Development Kit from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets. Needed to run Eclipse.


    &160; MySQL Administrator is a powerful visual administration tool that makes it easy to administer and monitor your MySQL environment and gain significantly better visibility into how your databases are operating. MySQL Administrator now integrates database management and maintenance into a single, seamless environment, with a clear and intuitive graphical user interface.

    MySQL Query Browser is the easiest visual tool for creating, executing, and optimizing SQL queries for your MySQL Database Server. The MySQL Query Browser gives you a complete set of drag-and-drop tools to visually build, analyze and manage your queries.

    The MySQL Migration Toolkit is a powerful framework that enables you to quickly migrate your proprietary databases to MySQL. Using a Wizard-driven interface, the MySQL Migration Toolkit implements a proven methodology and walks you through the necessary steps to successfully complete a database migration project.

    Some figures

    • Distribution is available as zip
    • You will have to accept and Read all licenses in directory SolarJoomla\licenses\
    • start one program to enjoy a running a Joomla developer environment in no time!
  • apache

    The acronym LAMP refers to a solution stack of software, usually free and open source software, used to run dynamic Web sites or servers. It stand for:

    • Linux, for the operating system;
    • Apache, the Web server;
    • MySQL, the database management system (or database server);
    • Perl, Python, and PHP, the programming languages.

    &160;ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
    Apache-utils package contains utility programs for webservers and some add-on programs useful for any webserver. These include:

    • ab (Apache benchmark tool)
    • Logresolve (Resolve IP addresses to hostname in logfiles)
    • htpasswd (Manipulate basic authentication files)
    • htdigest (Manipulate digest authentication files)
    • dbmmanage (Manipulate basic authentication files in DBM format, using perl)
    • htdbm (Manipulate basic authentication files in DBM format, using APR)
    • rotatelogs (Periodically stop writing to a logfile and open a new one)
    • split-logfile (Split a single log including multiple vhosts)
    • checkgid (Checks whether the caller can setgid to the specified group)
    • check_forensic (Extract mod_log_forensic output from apache log files)

    This package Apache-Utils can be install through apt or YaST depending if you are using a Debian base distro or OpenSuse

    Prerequistes

    • Define realistic objectives, do not create too much virtual clients if you do not have usually that kind of user traffic..
    • For example an objective could be: number of users served, or percentage of the requests served within a certain time
    • This tool ab do not simulate realistic user behavior, it just hit a page without being able to simulate a complex workflow (like login, navigate and do things users usually do)
    • Try to monitor at the same time the CPU/Memory consumed in order not to make false assumption on apache settings (use top d 1)

    Attention

    It is an iterative process!

    1. Benchmark,
    2. Change settings and
    3. Restart benchmark.

    It is very important to only change a setting a time in order to better identify what is really bringing something! By changing only one settings at a time, you can:

    • Better see the influence on CPU, memory (you must look also at resources, a server swapping to disk is never good)
    • There is not so much universal settings bringing a speed kick (except DNSlookup off, keep alive small), some settings are depending on your Linux kernel version, CPU class, disk speed, network latency

    Other components

    mysql While tuning apache, you will see that most of the time is used in PHP/MySQL, for MySQL recommend to run at the same time tuning-primer.sh, read more here


    Usage

    ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [http://]hostname[:port]/path

    Options

    -A auth-username:password
    Supply BASIC Authentication credentials to the server. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the server needs it (i.e., has sent an 401 authentication needed).
    -c concurrency
    Number of multiple requests to perform at a time. Default is one request at a time.
    -C cookie-name=value
    Add a Cookie: line to the request. The argument is typically in the form of a name=value pair. This field is repeatable.
    -d
    Do not display the "percentage served within XX [ms] table". (legacy support).
    -e csv-file
    Write a Comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests. This is usually more useful than the 'gnuplot' file; as the results are already 'binned'.
    -g gnuplot-file
    Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.
    -h
    Display usage information.
    -H custom-header
    Append extra headers to the request. The argument is typically in the form of a valid header line, containing a colon-separated field-value pair (i.e., "Accept-Encoding: zip/zop;8bit").
    -i
    Do HEAD requests instead of GET.
    -k
    Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
    -n requests
    Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.
    -p POST-file
    File containing data to POST.
    -P proxy-auth-username:password
    Supply BASIC Authentication credentials to a proxy en-route. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the proxy needs it (i.e., has sent an 407 proxy authentication needed).
    -q
    When processing more than 150 requests, ab outputs a progress count on stderr every 10% or 100 requests or so. The -q flag will suppress these messages.
    -s
    When compiled in (ab -h will show you) use the SSL protected https rather than the http protocol. This feature is experimental and very rudimentary. You probably do not want to use it.
    -S
    Do not display the median and standard deviation values, nor display the warning/error messages when the average and median are more than one or two times the standard deviation apart. And default to the min/avg/max values. (legacy support).
    -t timelimit
    Maximum number of seconds to spend for benchmarking. This implies a -n 50000 internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit.
    -T content-type
    Content-type header to use for POST data.
    -v verbosity
    Set verbosity level - 4 and above prints information on headers, 3 and above prints response codes (404, 200, etc.), 2 and above prints warnings and info.
    -V
    Display version number and exit.
    -w
    Print out results in HTML tables. Default table is two columns wide, with a white background.
    -x <table>-attributes
    String to use as attributes for <table>. Attributes are inserted <table here >.
    -X proxy[:port]
    Use a proxy server for the requests.
    -y <tr>-attributes
    String to use as attributes for <tr>.
    -z <td>-attributes
    String to use as attributes for <td>.


    Some real examples

    time /usr/sbin/ab2 -n 500 -c 30 http://www.waltercedric.com
    This will make 500 requests on them and hammering localhost for 30 seconds

    After tuning Before tuning
    Benchmarking www.waltercedric.comCompleted 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests
    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160; www.waltercedric.com
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80
    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532 bytes
    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 38.576375 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19&160;
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106 bytes
    HTML transferred:&160;&160;&160;&160;&160;&160; 22762106 bytes
    Requests per second:&160;&160;&160; 12.96 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 2314.582 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 77.153 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 582.25 [Kbytes/sec] received
    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160;&160;&160; 8&160; 36.9&160;&160;&160;&160;&160; 0&160;&160;&160;&160; 207
    Processing:&160;&160; 394 2239 345.3&160;&160; 2237&160;&160;&160; 6223
    Waiting:&160;&160;&160;&160;&160; 379 2197 340.9&160;&160; 2190&160;&160;&160; 6173
    Total:&160;&160;&160;&160;&160;&160;&160; 397 2247 344.2&160;&160; 2239&160;&160;&160; 6223
    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 2239
    &160; 66%&160;&160; 2294
    &160; 75%&160;&160; 2327
    &160; 80%&160;&160; 2357
    &160; 90%&160;&160; 2457
    &160; 95%&160;&160; 2560
    &160; 98%&160;&160; 2973
    &160; 99%&160;&160; 3341
    100%&160;&160; 6223 (longest request)
    real&160;&160;&160; 0m38.617s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.240s

    Benchmarking www.waltercedric.com
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests

    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160; www.waltercedric.com
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80

    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532bytes

    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 108.897481 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106bytes
    HTML transferred:&160;&160;&160;&160; 23000106bytes
    Requests per second:&160;&160;&160; 4.59 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 6533.849 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 217.795 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 178.41 [Kbytes/sec] received

    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160; 114 478.9&160;&160;&160;&160;&160; 0&160;&160;&160; 2276
    Processing:&160;&160; 336 6186 1665.2&160;&160; 6108&160;&160; 16189
    Waiting:&160;&160;&160; -5148 5982 1982.8&160;&160; 6066&160;&160; 16009
    Total:&160;&160;&160;&160;&160;&160;&160; 391 6301 1580.2&160;&160; 6120&160;&160; 17093

    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 6120
    &160; 66%&160;&160; 6453
    &160; 75%&160;&160; 6778
    &160; 80%&160;&160; 7046
    &160; 90%&160;&160; 7861
    &160; 95%&160;&160; 8516
    &160; 98%&160; 10110
    &160; 99%&160; 12418
    100%&160; 17093 (longest request)

    real&160;&160;&160; 1m48.905s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.152s

    &160;

    time /usr/sbin/ab2 -kc 10 -t 30 http://www.waltercedric.com
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds


    Same tests but without mod_security

    • Mod_security is a module for Apache which act like a software firewall
    • Depending on the number of rules, can greatly affect through output speed


    time /usr/sbin/ab2 -kc 10 -t 30 http://www.waltercedric.com
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds

    real&160;&160;&160; 0m39.040s
    user&160;&160;&160; 0m0.020s
    sys&160;&160;&160;&160; 0m0.208s

    Nearly one second more with mod_security gotroot rules, worth the added security!

    If you want to know more options and how to use apache ab check the apache ab/ab2 man page click here for this man page

    How to optimize Apache/Joomla/PHP

    I forward You to some of my previous articles:

    And more ideas here Secure, Safe, Fast Linux Hosting

  • cedTag

    CedTag&160; has been updated to version 2.5.3 and correct a lot of bugs and contains some nice features.

    CedTag is the continuation of the GPL component Joomla Tags (www.joomlatags.org), Most of the codehas been rewritten according to the new standard of Joomla 2.5, the component has been greatly extended and most bugs have been removed. I will continue removing, refactoring existing codebase, in order to be able to add new features faster.

    What’s new

    NEW: Auto completion of tags in frontend and backend using jQuery. You can add new tags, search and remove tags without fearing creating duplicates!
    NEW: Joomla ACL support,
    NEW: Add basic support for themes, still need some css correction for optimal results
    NEW:Use confirmation popup windows for all delete/clear operations,
    NEW: New option to switch off tags title in front page,
    NEW: No white background in simple.css for people loving their black background as default,
    NEW: cedTag is now having no warnings/errors in PHP error level E_STRICT
    BUG:&160; I cant disable cedTag on front page when i disable it any thing not change...i want show tags only on full article view...
    BUG:&160; Working update manager: starting at version 2.5.3 you can update with one click in the update manager.
    BUG: Did remove a hack of me for testing -> it was not possible to switch off the add tags button in frontend since i fixcoded to true :-(
    BUG: Correct issue in editor xtd plugin blocking users to edit/view articles in frontend

    Code cleaning

    • Rewrite 90% of all query string to use the $query object api of joomla
    • Did clean the content plugin a lot,

    CedTag is used on this site with more than 5000 tags in 2200 articles.

    Your ideas are important, feel free to contact me and ask for new features!

  • cedTag4

    CedTag&160; has been updated to version 2.5.5 and correct a lot of bugs and contains some nice new features.

    CedTag is the continuation of the GPL component Joomla Tags (www.joomlatags.org), Most of the code if not allhas been now rewritten according to the new standard of Joomla 2.5, the component has been greatly extended and most bugs have been removed. I will continue removing, refactoring existing codebase, in order to be able to add new features faster.

    What’s new

    NEW: Wikipedia auto-completion of tag descriptions with Wikipedia&160; OpenSearch API!

    Support more than 40 localized Wikipedia servers (all Wikipedia with more than 100’000 articles)

    العربيةБългарскиCatalàČeskyDanskDeutschEnglishEspañolEsperantoEuskaraفارسیFrançais한국어हिन्दीHrvatskiBahasa IndonesiaItalianoעבריתLietuviųMagyarBahasa MelayuNederlands日本語Norsk (bokmål)PolskiPortuguêsҚазақша / Qazaqşa / قازاقشاRomânăРусскийSlovenčinaSlovenščinaСрпски / SrpskiSuomiSvenskaTürkçeУкраїнськаTiếng ViệtVolapükWinaray中文

    For all termscedtag_wikipediaautofill1

    cedtag_wikipediaautofill2

    or while editing a term

    cedtag_wikipediaautofill3
    NEW:diagnostic page

    cedTag_newDiagnostic
    NEW: tags can also now be automatically inserted when new article is entered from the backend,
    NEW: new configuration settings “Force Existing articles get their tags updated always from article meta keywords at save time” under Tab Tags (default is No)


    NEW: Supporting tags containing many words separated by space: There are normally 5 ways to insert a tag after inputting some text: space, comma, enter, selecting an autocomplete option, or defocusing the widget. Now space now longer save the tag: You can enter tags with space as a result!
    NEW: inline documentation when adding tag in frontend

    cedTag_supportTagsWithSpace

    &160;

    BUG: Code cleaning, according to Joomla standard: my dream is to have this extension accepted in Joomla core! Still a lot of PHP Unit test to be written before submitting this to the mailing list of Joomla developers. Now I use Joomla CodeSniffer&160; and PSR-1 CodeSniffer rules in my day to day development.
    BUG:&160; after click on Template Manager it show this err Fatal error: Class 'UsersHelper' not found in /home/assafir/public_html/administrator/components/com_cedtag/views/css/view.html.php on line 41
    BUG: tags were not inserted automatically from new content article in frontend,
    BUG: it was not possible to use html descriptions
    BUG: missing some http://jqueryui.com images resources

    Your ideas are important, feel free to contact me and ask for new features!

  • Warning

    IT IS MANDATORAY TO COMPLETELY REMOVE ALL VERSION < 2.6.0 BEFORE INSTALLING THIS NEW ONE!
    Go to the Extension Manager under the tab Manage, enter in filter "tag", select all and click Actions – Uninstall
    Reason: I did change a lot of folder name and file casing casing to be more Joomla compliant
    Don’t be scared you will not loose any Tags or data from your database! uninstalling do not remove currently any tables!

    &160;

    Your ideas are important, feel free to contact me and ask for new features!

    New & Noteworthy

    Security

    SECURITY: all Ajax operations+Admin operation are now protected with a Joomla token to avoid CSRF

    SECURITY: All SQL statement have been migrated to use Joomla Query Object so the code should be portable now under SQL Server, Postgress

    Code review and refactoring is a recurring task for me!

    Performances

    PERF: Faster escaping in modules if there is no tags matching any criteria,

    Features

    NEW:&160;More themes are available.

    joomla_cedtag_moreThemes

    NEW: In “article Manager”, multi-tag filtering it is now possible to simply select multiple tags and/or searching for one tag and then another within the previous results.

    joomla_cedtag_multitagFiltering

    NEW: In “article Manager”, tab index is supported, enter tags hit tab to go to next articles,

    NEW:Full rewriting of Tag List layout, now table less.

    NEW:Full rewriting of blog layout: having as much if not all features of the internal Joomla category blog feature.

    • Table less layout,
    • Category display,
    • Articles Metadata: publish, created, hits,
    • Articles operations like print, email,
    • As it reuse the setting of Joomla, you’ll have to go to Joomla configuration to make changes or better it will inherit the same setting as Joomla content blog layout.

    joomla_cedtag_newBlogLayout

    NEW: full internationalization of all 5 modules:

    • Custom Tags Cloud (en-GB.mod_cedtagcustom.ini),
    • Latest Tags Cloud (en-GB.mod_cedtaglatest.ini),
    • Most Popular Tags Cloud (en-GB.mod_cedtagmostpopular.ini),
    • Most Read Tags Cloud (en-GB.mod_cedtagmostread.ini),
    • Random Tags Cloud (en-GB.mod_cedtagrandom.ini).

    NEW: Add “Save” button for “Template manager” and “Stop words”

    NEW: It is now possible to change the title of tags by changing the value of the key COM_CEDTAG_ITEMS_TITLE in&160; /plugins/content/cedtag/language/en-GB/en-GB.plg_content_cedtags.ini

    ; %1$s = frequency,
    ; %2$s = name,
    ; %3$s = created,
    ; %4$s = hits
    COM_CEDTAG_ITEMS_TITLE="%1$s items tagged with %2$s | created %3$s | Hits: %4$s"

    joomla_cedtag_ titleofTags

    &160;

    NEW: More Options for Menu Entry “All Tags” Count, Page Title, Meta Description, Meta Keywords, Reverse display and tags ordering. Some default are provided.

    joomla_cedtag_ alltagsMenuEntry

    NEW/BUG Wordlenow working on Linux, was always working on windows due to a path issue to the true type font I did introduced, I took the time to add a lot more settings so you can fully customized the images created!

    joomla_cedtag_wordlejoomla_cedtag_ wordleOptions

    NEW: Rockettheme Installer removed to use standard Joomla installation packages. To remove now all CedTag components, just remove the main component. No risk of incomplete removal.

    joomla_cedtag_newInstallerjoomla_cedtag_newUninstall
    NEW: menu entries for administration backend

    joomla_cedtag_MenuEntriesForAdministrationBackend

    NEW: 5 Modules are now created as default but not published nor assigned to any page.

    joomla_cedtag_5ModulesAreNowCreatedAsDefault


    NEW: option so front page tagging to be just available in front page edit before , it was too long, and breaks the browsing experience for any logged author browsing the site, sometimes appearing even twice. (Request)

    NEW:scripts to switch off all subsystem of cedTag if you get no access to your site (happen only when you remove some part and not all of cedTag)

    Known Issues

    • CSV export of all tags is currently broken

    &160;

    Bugs

    BUG:Error 500 Some people encounter while using URL rewriting.
    Found also that RokComment is crashing when used with cedTag. I did solve the issue by patching RokComment (I think the error is there and not in my component). YOu can ask me for the custom build of RokComment.

    BUG: correct handling of trash item in frontend
    BUG: correct handling of Joomla ACL using authorized access levels for the user
    BUG: Can add tag but cannot delete tag, request http://forums.waltercedric.com/index.php?topic=1401.0
    BUG
    : Content plugin don’t get executed in blog layout,
    BUG: wordle links were not supporting SEF
    BUG: advertisement code was not allowing html,
    BUG: Custom tag cloud module: the SQL query was broken,
    BUG: Custom tag cloud font size and title overlay was not defined ,
    BUG: All tags layout was not taking “count” into account for limiting the size of the cloud.
    BUG: default file css restore was not depending on user selection of theme, as a result restore was always using simple.default.css
    BUG: installer now create default modules instances without publishing them.
    BUG: metadata of menu entry “All tags” was not reading parameters, now you can set count, sorting, metadata descriptions and keywords
    BUG: paging at the limits (where ?limitstart= is in the url) lead to a tag not found.
    BUG: “:” was always filtered from tag name even when removed from “Strip Characters”
    BUG: Solved “Warning: Missing argument 4 for plgContentCedTags::onContentBeforeDisplay() in plugins/content/cedTags/cedTags.php on line 41"

  • &160;

    cedTag provide a useful way to group related posts together and to quickly tell readers what a post is about. Tags also make it easier for people to find your content. Tags are similar to, but more specific than, Joomla categories.

    Warning

    IT IS MANDATORAY TO COMPLETELY REMOVE ALL VERSION < 2.6.0 BEFORE INSTALLING THIS NEW ONE!
    Go to the Extension Manager under the tab Manage, enter in filter "tag", select all and click Actions – Uninstall
    Reason: I did change a lot of folder name and file casing casing to be more Joomla compliant
    Don’t be scared you will not loose any Tags or data from your database! uninstalling do not remove currently any tables!

    New & Noteworthy

    cedThumbnails support in cedTag!

    • cedThumbnails show Related Stories Under Each Post, it is a small widget that appears under each post, linking to related stories from your blog archive,
    • cedThumbnails links to stories that are relevant and interesting to readers of a particular post, keeping them engaged with your blog, and increasing your traffic!

    You can now use Tags from cedTag to display related articles in Joomla. You can choose either

    • CedThumbnails&160; (require extension CedThumbnails)
    • Joomla - using Meta-Keywords

    cedtag_2-6-1_relatedarticles

    Maintenance Page

    This new page will let you perform basic maintenance operations. Feel Free to ask for more operations using the support channel (Forums or Feedback (UserVoice))

    Replace Tag xxxx with Tag yyyy in all articles with Tag xxxx

    cedtag_2-6-1_maintenance-replace-tags

    Add Tag yyyy to all articles which have also Tag xxxx

    cedtag_2-6-1_maintenance-add-tags

    Remove Tag xxxx to all articles which have also Tag yyyy.

    cedtag_2-6-1_maintenance-remove-tags

    NEW:change position of tag in category view, blog view that you can set tags to appear after intro text (show after text before readmore button)

    NEW:version of extension is now displayed in administrator backend panel.

    NEW:Adding a&160; “Clear All” button in&160;&160; “TERM MANAGER” to remove all Tags and all

    &160;

    Bug Fixing

    fix 500 error

    This error is now solved for good, was in cedtag component SEF (Thanks to Signature Ltd)

    BUG: missing CSS style on ads top

    Miscellaneous

    The whole code has been validated using PHP code guidelines PSR-0/PSR-1/PSR-2

    &160;

    &160;

    Your ideas are important, feel free to contact me and ask for new features!

    You can download the latest version and just upgrade without any loss of data by reinstalling the package

    &160;

  • cedTag provide a useful way to group related posts together and to quickly tell readers what a post is about. Tags also make it easier for people to find your content. Tags are similar to, but more specific than, Joomla categories.

    What’s NEW

    NEW: Adding a debug switch in administrator configuration area, this will write a file at logs/cedtag.php that contains some debug information that may be useful to spot difficult bugs,

    NEW:a new css file (/media/com_cedtag/css/blog.css) is added to the blog layout to give you more control on the rendering of top and bottom publicity,

    BUG cedtag was adding ul no matter if tags were available for the current article.

    BUG title of html page was not translated correctly and was displayed wrongly like this

    <title>%1$s items tagged with %2$s | created %3$s | Hits: %4$sjoomla | test</title>

    BUG solve cedtag: Warning: Missing argument 8 for plgContentCedTag::execute(), called in /htdocs/public/www/plugins/content/cedtag/cedtag.php on line 72 and
    defined in /htdocs/public/www/plugins/content/cedtag/cedtag.php on line 136 Fatal error: Call to a member function get()
    on a non-object in /htdocs/public/www/plugins/content/pagenavigation/pagenavigation.php on line 30

    &160;

    Features

    what are the features of cedtag? get an overview by reading http://cedtag.waltercedric.com

    Your ideas are important, feel free to contact me and ask for new features!

  • cedTags_for_joomla

    cedTag&160; has been released and it is still beta, it has been made available to gather feedback. Don’t use it in production or at your own risk. I plan to use it before the end of months on my site. I would love to hear what is missing, what you don’t like, how it can be better.

    A real free tag system for Joomla!

    Front end features

    • Show tags at the bottom of each article.
    • Tag list view
    • Tag blog view
    • Most popular tags.
    • Most hits tags.
    • Latest tags.
    • SEF support, compatible with sh404SEF,ARTIO JoomSEF,AceSEF
    • XMap Plugin
    • Language file support
    • Add/Edit tags
    • Compatible with JoomlFish
    • Search plugin.

    Back end features

    • Import Tags from Meta keywords
    • Import tags from 3rd party system
    • Term editable.
    • Batch term add.
    • Batch tag management.
    • Auto extractable tag.
    • Language file support
    • Template edit online.
    • Tags filter by section and category.
    • One click installation.

    User of Joomla Tags, just install this all in one package and select Import – Souce – Joomla Tags and click import to copy your data in the new table.

    cedTag a new Tag system for Joomla 2.5 (based on Joomla tags) is now deployed on my showcase

    http://demo-joomla-2.5.waltercedric.com/

    &160;

  • CedThumbnails has been updated to version 2.5.5 and contains 1 new features for both Joomla 1.7 and Joomla 2.5. For existing users the update will display in the Extensions Manager under Updates. If you do not have this currently installed, you can click the link below and install as normal via the Extensions Manager.

    What’s new?

    • Video Thumbnail Feature: Google Youtube video are now supported as thumbnails!
    • Administrator panel
    • Update server simplified

    Full list of changes available in GIT commit aa32de404c928f3bd0fc67d7b9302e236893fd48

  • CedThumbnails has been updated to version 2.6.0 and contains 4 new features and correct 1 bug for Joomla 2.5. For existing users the update will display in the Extensions Managerunder Updates. If you do not have this currently installed, you can click the link below and install like you are use to via the Extensions Manager.

  • apache_maven

    Doxygen phpDocumentator phpunit-logo teamcity512 maven4php

    Maven for PHP uses the power of Maven for building, reporting on and creating documentations of PHP projects. It adapts the Maven build lifecycle to the PHP world while fully supporting PHP 4 and PHP 5. PHP for Maven uses PHPUnitfor unit testing and doxygenfor creating the api documentation.
    Use a PHP library project to create a library that can be used by other PHP libraries or PHP web projects. Use a PHP web project to create a standalone web project.

    So I quickly describe what I did install on my root server (OpenSuse 11.X)

    My Objectives: being able to build all my Joomla! component using best agile development practices

    “Specific tools and techniques such as continuous integration, automated or xUnit test, pair programming, test driven development, design patterns, domain-driven design, code refactoring and other techniques are often used to improve quality and enhance project agility.”

    Maven

    While not needed as TeamCity has an integrated Maven engine, I would like to use an external MAVEN version, in order to have the latest version and living dangerously on the edge!

    So I download

    # wgethttp://apache.mirror.testserver.li/maven/binaries/apache-maven-2.1.0-bin.tar.gz

    And unpack

    # tar xvf apache-maven-2.1.0-bin.tar.gz

    Since I would like to avoid having a version number in my configuration build path, I create a symlink

    # ln -s apache-maven-2.1.0 maven

    I just now tell TeamCity to use my own Maven version, by specifying the Maven Home Path

    teamcity.maven4php 

    phpDocumentor

    phpDocumentor is an open source documentation generator written in PHP. It automatically parses PHP source code and produces readable API and source code documentation in a variety of formats. phpDocumentor generates documentation based on PHPDoc-formatted comments and the structure of the source code itself. It supports documentation of both object-oriented and procedural code. phpDocumentor can create documentation in HTML, PDF, CHM or Docbook formats.

    Can be installed using PEAR, simply run

    # pear upgrade PhpDocumentor
    downloading PhpDocumentor-1.4.2.tgz...
    Starting to download PhpDocumentor-1.4.2.tgz (2,421,028 bytes)
    ..............................................................................done: 2,421,028 bytes
    upgrade ok: channel://pear.php.net/PhpDocumentor-1.4.2

    PHPUnit

    PHPUnit is a unit testing framework for the PHP programming language. Created by Sebastian Bergmann, PHPUnit is one of the xUnit family of frameworks that originated with Kent Beck's SUnit.

    Can be installed using PEAR, simply run

    # pear upgrade PHPunit

    DOxygen

    Doxygen is a documentation generator for C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors), Fortran, VHDL, PHP, C#, and to some extent D. It runs on most Unix-like systems, including Mac OS X, as well as on Windows. The first version of Doxygen borrowed some code of an old version of DOC++; later, the Doxygen code was rewritten by Dimitri van Heesch. from www.doxygen.org

    # zypper se doxy
    Lese installierte Pakete...

    S | Name       | Zusammenfassung                                    | Typ 
    --+------------+----------------------------------------------------+------
      | doxygen    | Automated C, C++, and Java Documentation Generator | Paket
      | doxywizard | Graphical User Interface for Doxygen               | Paket

    # zypper in doxygen

    Herunterladen von Paket doxygen-1.5.5-17.1.x86_64 (1/1), 2,3 M (6,2 M installiert)
    Lade herunter: doxygen-1.5.5-17.1.x86_64.rpm [fertig] 
    Installiere: doxygen-1.5.5-17.1 [fertig]

    Artifactory

    Prepare Artifactory by adding new Maven for PHP repositories

    At http://maven.waltercedric.com/artifactory/webapp/repositoryconfig.html

    As Admin user (you cant go to that links without being an admin!), add 2 new repositories

    teamcity.maven4php.artifactory

    In Maven settings.xml

    In order to use Artifactory at his best (proxy and caching of remote repositories), I have a Maven settings.xml that contains ONLY

    # vi /home/teamcity/.m2/settings.xml

    <activeProfiles>
      <activeProfile>cedric-profile</activeProfile>
    </activeProfiles>

    <profiles>
       <profile>
            <id>cedric-profile</id>
            <activation>
            <activeByDefault>true</activeByDefault>
            </activation>
    <repositories>
        <repository>
            <id>central</id>
            <url>http://maven.waltercedric.com/artifactory/repo/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>snapshots</id>
            <url>http://maven.waltercedric.com/artifactory/repo/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>http://maven.waltercedric.com/artifactory/plugins-releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>snapshots</id>
            <url>http://maven.waltercedric.com/artifactory/plugins-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
        </profile>
      </profiles>
    </settings>

    Attention: Artifactory WIKI tell to use http://maven.waltercedric.com/artifactory/plugins-releases and not http://maven.waltercedric.com/artifactory/plugins-releases/ on my HOST with mod_proxy it made an error 404 If I do not add a slash at the end. Try with your host before, you will gain a lot of time by checking if the URL is valid!

    Note that http://url:port/artifactory/repo/ is a virtual repositories that proxy all external repositories

     

    Eclipse

    Use SolarJoomla (hopefully to be distributed this week) to have a running Eclipse, PDT, Maven 4 PHP environment, Mylyn, TeamCity in no time

    Lets build!

    First I create a new Maven Project with Archetype “Maven for PHP” “PHP5 libraries”

    In TeamCity I did create a new project “Joomla 15 components plugins and modules” and a new Build “MyGuestbook”.

    teamcity.maven4php.myguestbook

    The first build failed with

    [INFO] PHP Warning: require_once(PHPUnit/TextUI/TestRunner.php): failed to open stream: Operation not permitted

    This is because of my PHP security restrictions, I only allow file to be opened from /home/teamcity/

    So I just add

    /home/teamcity/TeamCity/buildAgent/ to my open_basedirin my php.ini

    ; open_basedir, if set, limits all file operations to the defined directory
    ; and below.  This directive makes most sense if used in a per-directory
    ; or per-virtualhost web server configuration file. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    open_basedir = /srv/www/vhosts:/tmp:/home/teamcity/TeamCity/buildAgent/

    To be continued

    So long an empty PHP project is building successfully, tomorrow I will try to make a REAL Joomla! component build there!

    As soon as It works, and all my Joomla! components are running in TeamCity, I will try to achieve the same goal in Bamboo, why? because it is simply . . .fun!

    Links

  • css.sprite.generator

    Here is an useful tool for improving performance of your website: The CSS sprite generator takes a number of source images and combines them into a single "sprite" image and supplies CSS to map to each image within the sprite. The technique this tool employs is often used to improve the performance of a web site by reducing the number of HTTP requests that the client's browser needs to make.

    CSS sprites are a way to reduce the number of HTTP requests made for image resources referenced by your site. Images are combined into one larger image at defined X and Y coordinates. Having assigned this generated image to relevant page elements the background-position CSS property can then be used to shift the visible area to the required component image.

    This technique can be very effective for improving site performance, particularly in situations where many small images, such as menu icons, are used. The Yahoo! home page, for example, employs the technique for exactly this.

    I’ve installed a copy of this tool at:

    http://css-sprite-generator.waltercedric.com

    And took time to:

    1. Improve the overall internal security of the tools, by using some technique of Joomla! framework, so most type of attacks (XSS, parameter tampering, path browsing, avoid direct execution of files) should be eliminated,
    2. The tool now extract the ZIP file without being forced to use the dangerous shell_exec php command (I switch it off on my host anyway), the tool support&160; if they are available in that order: ZipArchive(), zip_open() and shell_exec()
    3. Make the code a bit more portable (avoiding .. inclusion for files, use DIRECTORY_SEPARATOR)

    And I did audit the code using Acunetix Web security Scanner, the result can be seen below:

    css.sprite.generator.acunetix&160;

    The source code for CSS Sprite Generator is available for download and is covered by a BSD license. Want to run a local copy, get the source code at https://launchpad.net/css-sprite-generator

    My version will be available soon, link to appear later this week.

    Note about PHP and Zip support

    To install zip PECL package run the following as root:

    # pear installhttp://pecl.php.net/get/zip

    and create a new file at

    # vi /etc/php5/conf.d/zip.ini

    with following content

    extension=zip.so

    Restart apache

  • Debugger are full-featured PHP debugger engine. They are interactive tools that allows
    you to debug PHP scripts locally or remotely, from an IDE or from the console. There is 3
    debugger on the market, XDEBUG (open source) , ZEND (closed source), DBG (commercial
    but source code available) by luck all are free :-)

    I recommend you to develop with Eclipse PDT: The Eclipse Foundation has released the 1.0
    of the Eclipse PHP Development Tools (PDT) project. Eclipse PDT is a set of tools and
    frameworks that enhance the productivity of developers using PHP, a popular, general-purpose
    dynamic language that is especially suited for development of web applications and web services.

    I have prepared a HowTo also for eclipse PDT, but it is still not ready for prime time.

    DBG

    &160;
  • Native debugger.
  • Debug locally or remotely
  • JIT. When enabled it can start debugging Just In Time when an error happens.
  • Supports back-trace, e.g. displays a list of all procedures with their local variables,
  • Step-in, step-out, step-over, run to cursor, change execution point withing current scope...), evaluate any valid php expression(s) or inspect arrays, classes and simple variables, modify their values on the fly and even create any new variables.
  • Supports conditional breakpoints and even global ones
  • Allows to change execution point
  • has embedded profiler,
  • Allows multiple debugger processes running simultaneously.
  • Has open COM interfaces for integration with win32-based 3rd party IDEs.
  • Linux, BSD, SunOs, MacOs and Win32 are supported.
  • &160;

    XDEBUG

    &160;

    Xdebug provides:


    ZEND

    Debugger Extension can be downloaded from Zend Downloads


    Zend debugger in Eclipse also works for MySQL statements!

    Installing ZEND debugger in Eclipse

    The Zend Executable Debugger Eclipse plugin adds PHP debugging capabilities to the Eclipse environment.

    Add the following remote location to the eclipse manager, even if you have eclipse PDT

    http://downloads.zend.com/pdt

    zend.debugger.in.eclipse

    ZEND debugging mysql statement

    You'll have to configured the PHP binary included with the ZEND debugger to be able to debug SQL queries. Search for a PHP.ini in your eclipse/plugins directory, you'll find 2 files.

    Ex:

    • E:\eclipse\bin\PDT\plugins\org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\resources\php4\php.ini
    • E:\eclipse\bin\PDT\plugins\org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\resources\php5\php.ini

    And add these line in one of these files according to your PHP version

    extension_dir = "xampp_path/php/ext"
    extension="xampp_path/php/ext/php_mysql.dll"
    extension="xampp_path/php/ext/php_mysqli.dll"
    include_path =".;xampp_path/php;"

    Installing Zend debugger server in XAMPP

    Please note that the Zend Executable Debugger is not available from the Eclipse PDT update Manager, so download ZEND debugger (Free) from Zend Downloads, you must extract the zip ZendDebugger-5.2.12-cygwin_nt-i386.zip.

    In the zip file, you'll see multiple directories
    zend.debugger.install

    Use the version that match the one in XAMPP (you have note at chapter A, for me 5.2.3 so copy files from 5_2_x_comp) and copy the dll in
    xampp_path\php\extensions\

    zend.debugger.php.5.2.x


    Open the file php.ini located at xampp_path\apache\bin\php.ini
    and add these keys if they do not already exist:


    [XDebug]
    ;; Only Zend OR (!) XDebug
    ;zend_extension_ts="\xampp\php\ext\php_xdebug.dll"
    zend_extension_ts="\xampp\php\extensions\ZendDebugger.dll"
    zend_debugger.allow_hosts=127.0.0.1
    zend_debugger.expose_remotely=always

    ; this is to see output while debugging
    implicit_flush = On

    Switch off all other debugger as it may conflict with Zen

    eaccelerator.enable="0"
    ;extension=dbg.dll
    :extension=xdebug.dll

    Restart apache, check for proper operations by going to http://localhost

    Note
    Apache will crash if you have more than one key in php.ini with the name zend_extension_ts, so uncomment all other entries!

    &160;

    Debugging PHP in Eclipse PDT

    Go to Debug dialog for creating and managing run configurations

    • Choose as Server Debugger: Zend Debugger
      &160;debug.as.zend.eclipse
    • Choose as PHP Server: XAMPP
    • File should point to the root of your Joomla! installation ex: /PROD2/index.php because in XAMPP htdocs directory I have a subdirectory /PROD2 with Joomla! 1.5 inside
    • Remove the option Break at First Line
    • Keep URL to Auto Generate

    As seen in the screen shot below

    zend.debugging.eclipse.joomla&160;

    Now click on button configure

    • Give a Name, not important here, lets keep XAMPP
    • Enter the root URL that points to the document root of this server, for me it is http://localhost/PROD2

    zend.debugging.eclipse.joomla_1

    Go to tab "Path Mapping"

    • As Path on server enter E:\xampp\htdocs\PROD2
    • Choose Path in Workspace /PROD2

    zend.debugging.eclipse.joomla_2&160;

    &160;

    Confirm all windows, and you can now start the debugger by clinking on debug button zend.debugging.eclipse.joomla_3

    You're done, you can now set breakpoint and debug Joomla! or your code easily

    zend.debugging.eclipse.joomla_4

    &160;

    &160;

    &160;

    &160;

    Installing Joomla in Eclipse


    We will now install Joomla 1.0.15 and Joomla 1.5.1 (newest version at time of writing into eclipse)
    Create two new PHP project in your workspace, one name joomla1.0.x the other joomla1.5.x for example

    Attention: the root workspace must be located at xampp_path/htdocs

    &160;

    Setting Zend Debugger in Eclipse PDT for Joomla!

    In the PHP perspective of eclipse, go to the menu debug

  • I use previously Jedit (www.jedit.org) and reach the limit very fast (no versionning, no helper, nothing...)  I recommend to  any serious developer to install:
    1. Eclipse from www.eclipse.org free
    2. PHPEclipse plugin from phpeclipse free
    3. A concurent versionning system: CVS fro windows CVSNT  free
    4. A runnable Mambo environment like EasyPHP free
  • agile.development

     

    Starting from now on, I will deliver all my latest (unstable) extensions versions through  my continuous build server. All request or bugs discovery that are requested in my forums and solved will lead to a new build that you will be able to download a lot faster than before.

    Thanks to Maven for PHP, I can now commit, 60 seconds later, unit test run and  the result is a direct download for my extensions snapshots.

     

     

     

     

     

     

    Here is an example with the module mod_related_thumb_items

    Head to http://teamcity.waltercedric.com/teamcity/guestLogin.html?guest=1

    Locate the module or component you are interested in:

    HowTODownloadLatest

    Click on the latest build, must be  Success

    HowTODownloadLatest.01  

    If this build is a direct answer to a support request in my forums, or solve an issue, You should be able to see in changes the commit description, and even which file have been changed after and before the commit.

    http://teamcity.waltercedric.com/teamcity/viewLog.html?buildId=217&buildTypeId=bt3&tab=buildChangesDiv

    HowTODownloadLatest.05

    But Hey! you want to download this latest build now, go to artifact

    HowTODownloadLatest.02

    Staying  on the edge by using RSS

    You can monitor any build by using the RSS icon in your browser toolbar, or example with this module, it would be

    http://teamcity.waltercedric.com/guestAuth/feed.html?buildTypeId=bt20&itemsType=builds&userKey=guest

    This way of downloading the latest extensions do not replace the page http://www.waltercedric.com/joomla-releases-mainmenu-269.html where there is there only stable versions.

    The next step is to make the maven phase “site” work (I have issue with phpdocumentor not found), this will create automatically a internet site in one of my sub-domains ad hide this complexity.

  • 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).

    Why Watermarking pictures?

    There is a lot of reasons, among others:

    • To limit images stealing, advanced users will still be able to crop/blur your watermark through!
    • To drive more new users/returning visitors to your site, anybody using your images in a forums may want to visit your site if the watermark can be read (don’t use complex logo, except if you have a well known brand)
    • To advertise your online work,

    This article is a follow up of a previous article presenting how to watermark picture offline (definitive watermarking) using ImageMagick bash script. A lot of steps described there still apply

    Features

    • Watermark pictures on the fly as soon as they are bigger than 500 pixels in width (PHP)
    • Watermark all or only pictures that are hot linked from outside your blog, for example in forums, other blogs (.htaccess setting)
    • Don’t watermark pictures hot linked from search images engine: Google images search or other (.htaccess setting)
    • Easily extensible to your needs: support multiple watermark pictures based on original image size.

    Installation

    create a file .htaccess with the following content, I recommend you to save it at the root of Joomla!® directory structure, you can merge this file with the one provided by Joomla!

    # Uncomment next line to avoid that watermark apply on your
    # site, replace yoursite.com with you Joomla! base
    rewritecond %{http_referer} !^
    http://([^.]*[.]*)?yoursite.com/ [nc]

    # Uncomment next line to avoid applying watermark in Google images
    # search, copy as many lines as needed if you would like to also add Bing, Yahoo, etc...
    rewritecond %{http_referer} !^
    http://(www.)?google.com/ [nc]


    RewriteCond %{REQUEST_FILENAME} –f

    # Path to the watermark.php script, and list of supported images
    RewriteRule \.(gif|jpeg|jpg|png)$ /images/watermark.php [QSA,NC]

    watermark.php script

    Save this script into Joomla!® /images directory, under /images/watermark.php

    Decide at which size you want to protect your images, here starting at 500pixels width, I will apply a watermark overlay in the left corner of the image.

    <?php 
    
      $path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']; 
    
      $image = imagecreatefromstring(file_get_contents($path)); 
    
      $w = imagesx($image); 
    
      if ($w > 500) { 
    
        $h = imagesy($image); 
    
        $watermark = imagecreatefrompng('watermark.png'); 
    
        $ww = imagesx($watermark); 
    
        $wh = imagesy($watermark); 
    
        imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh); 
    
      } 
    
      header('Content-type: image/jpeg'); 
    
      imagejpeg($image); 
    
      exit(); 
    
    ?>

    Caveats

    It cost CPU and depending how you set your .htaccess may still allow users to steal images without watermark.

  • 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

 

  • 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 ???

  • 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:&160; 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

    XAMPP, Zend debugger working together

    open the php.ini located at \xampp\apache\bin\php.ini

    and add the following

    [DEBUGGER]
    zend_extension_ts=
    E:\php\bin\eclipse\plugins\org.zend.php.debug.debugger.win32.x86_5.2.15.v20081217\resources\php5\ZendDebugger.dll
    zend_debugger.allow_hosts=127.0.0.1/192.168.1.100
    zend_debugger.expose_remotely=always

    Notes:

    • Only one key zend_extension_ts is allowed per php.ini file, un-comment all other or it wont work,
    • Attention: I did not move ZendDebugger.dll but use the one coming with eclipse Zend plugin, this may cause issues, if you update this plugin and the path change...

    Restart XAMPP apache

    By going to http://localhost/xampp/phpinfo.php check that you have a section Zend Debugger

    zend.debugger.active.in.xampp

    Put now a breakpoint in index.php of any Joomla! installation or deeper in any component you want to debug

    And right click on index.php, debug as PHP Web Page (Alt-Shift-D, W)

    Attention

    While the first page get properly rendered in the internal browser of eclipse PDT, I was getting some strange rendering issues (html code produced look fine), by using an external browser like Chrome, Firefox, the problem has disappear.

    PDT and XDebug

    Installing with PEAR/PECL is as easy as opening a command prompt and typing

    # \xampp\php\pecl install xdebug

    open the php.ini located at \xampp\apache\bin\php.ini

    and un-comment the following

    extension=php_xdebug.dll

    and

    [XDebug]
    ;; Only Zend OR (!) XDebug
    zend_extension_ts="e:\xampp\php\ext\php_xdebug.dll"
    xdebug.remote_enable=1
    xdebug.remote_host=localhost
    xdebug.remote_port=9001
    xdebug.remote_handler=dbgp
    xdebug.profiler_enable=0
    xdebug.profiler_output_dir="\xampp\tmp"

    Caveats:

    1. Modify the correct php.ini file, check the page phpinfo, normally the right php.ini is located at \xampp\apache\bin\php.ini
    2. You need to comment out any other references to &8220;zend_extension_ts&8221; in the php.ini file (the zend optimizer use it already as default)
    3. Restart apache, and check the page http://localhost/xampp/phpinfo.php to make sure XDebug has been successfully installed

    debugging AkoBookPlus:

    debugging.joomla.components

    &160;

    Add subversion plugin

    Install subversive by pointing the update manager to subversive update site

    svn.subversive.install

    You need also to install SVN connectors by adding a new update site:

    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ - [required] Subversive SVN Connectors

    svn.subversive.install.connector&160;

    Eclipse will restart, you should be able to browse www.joomlaCode.org repositories.

    Happy Joomla! development and PHP debugging!