# WebSphere sMash

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/WebSphere_sMash
> Markdown URL: https://mediated.wiki/source/WebSphere_sMash.md
> Source: https://en.wikipedia.org/wiki/WebSphere_sMash
> Source revision: 1328909382
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

**WebSphere sMash** was a development and runtime environment from [IBM](/source/IBM) for the creation of dynamic [web applications](/source/Web_applications) using the [scripting languages](/source/Scripting_language) [Apache Groovy](/source/Groovy_(programming_language)) and [PHP](/source/PHP). It contained a PHP [runtime](/source/Run-time_system) written in [Java](/source/Java_(programming_language)). **Project Zero** was the experimental software development community in which new versions of [WebSphere](/source/WebSphere) sMash were incubated. WebSphere sMash was withdrawn from sale in 2012, with support discontinued in 2014.[1]

WebSphere Smash integrated with [Eclipse](/source/Eclipse_(software)) and produced [REST](/source/REST)-style services on top of Groovy or PHP .[2]

## Architecture

There are a number of distinguishing aspects to the architecture of WebSphere sMash.

### Event-driven programming model

WebSphere sMash uses an [event-driven programming](/source/Event-driven_programming) model. Applications are typically composed of a number of small modules which communicate with each other by firing events which are then caught by other handlers that have registered to catch the events. The code firing the event does not have any knowledge of the code that will handle the event. This architecture allows application to be built up from a mixture of code written using [PHP](/source/PHP), [Java](/source/Java_(programming_language)), [Groovy](/source/Groovy_(programming_language)) or the Flow language.

### Global context

Since events are [stateless](/source/Program_state), a mechanism is required to share data between event handlers. This mechanism is the Global Context. The Global context functions basically as a large map of data divided up into various zones with different lifetimes, properties and persistence.

### Repository management system

sMash makes use of the [Ivy](/source/Apache_Ivy) dependency manager. sMash applications are composed of models which can specify dependencies on other modules which may be present in a local Ivy repository or which can be fetched from a remote repository. IBM maintains a repository of useful modules at projectzero.org and dependencies can also be specified on the maven2 repository.

## PHP support

The [PHP](/source/PHP) support in WebSphere sMash is provided by a PHP runtime implemented in Java.[3] PHP scripts are compiled into [Java bytecode](/source/Java_bytecode) which then run on the [Java](/source/Java_(programming_language)) [Virtual Machine](/source/Virtual_Machine) ([JVM](/source/JVM)). This is similar in concept to the approach taken by other projects such as [JRuby](/source/JRuby) and [Jython](/source/Jython), which run the [Ruby](/source/Ruby_(programming_language)) and [Python](/source/Python_(programming_language)) languages, respectively, against the JVM. Running on the JVM allows direct, same process calls between PHP, Java and Groovy code allowing applications to be assembled using a variety of languages.

In contrast to the approach taken by Quercus, the other JVM based PHP implementation, sMash is able to re-use existing PHP extensions from PHP.net attaching them to the Java virtual machine via the Java Native Interface (JNI) and an API layer called XAPI-C.

The runtime has a DBGp debug port allowing debug access from IDEs and debuggers which support the DBGp protocol such as the [Eclipse](/source/Eclipse_(software)) [PDT](/source/PHP_Development_Tools) project.

The PHP runtime does not have an identity outside of sMash so it is simply referred to as the "WebSphere sMash runtime for PHP."

As of October 2008 WebSphere sMash is capable of running several well-known PHP applications on a Java Virtual Machine. These include [SugarCRM](/source/SugarCRM),[4] [phpBB](/source/PhpBB),[5] [WordPress](/source/WordPress)[6] and [MediaWiki](/source/MediaWiki).[7]

The PHP runtime supports close integration with the Java and Groovy languages through its Java/Groovy bridge. This allows PHP scripts to use libraries written in Java and Groovy through a lightweight and extremely fast interop layer[citation needed]. The Groovy bridge allows advanced features from Groovy to be accessed directly from PHP. Examples include [closures](/source/Closure_(computer_science)) and Groovy [metaobjects](/source/Meta-object_protocol).

## See also

- [PHP/Java Bridge](/source/PHP/Java_Bridge)
- [pureQuery](/source/PureQuery)
- [Quercus](/source/Quercus_(software))

## References

1. ["IBM United States Withdrawal Announcement 912-138"](https://www-01.ibm.com/common/ssi/rep_ca/8/897/ENUS912-138/ENUS912-138.PDF). June 12, 2012.

1. ["About Project Zero"](https://web.archive.org/web/20080709040817/http://www.projectzero.org/about/). *Project Zero Site*. Archived from [the original](http://www.projectzero.org/about/) on 2008-07-09. Retrieved 2008-06-23.

1. ["Project Zero PHP page"](https://web.archive.org/web/20090125060455/http://www.projectzero.org/php/). Archived from [the original](http://www.projectzero.org/php) on 2009-01-25. Retrieved 2009-02-02.

1. ["Smash4Sugar project at SugarForge"](http://www.sugarforge.org/projects/sugar4smash). *Smash 4 Sugar*. Retrieved 2008-06-30.

1. ["PhpBB running on Project Zero"](https://web.archive.org/web/20080807010857/http://www.projectzero.org/blog/index.php/2008/01/13/phpbb-running-on-project-zero/). *phpBB on PZ*. Archived from [the original](http://www.projectzero.org/blog/index.php/2008/01/13/phpbb-running-on-project-zero/) on 2008-08-07. Retrieved 2008-06-30.

1. ["Try out PHP Application WordPress on sMash"](https://web.archive.org/web/20081022080223/http://www.projectzero.org/blog/index.php/2008/10/02/try-out-php-application-wordpress-on-smash/). *WordPress on PZ*. Archived from [the original](http://www.projectzero.org/blog/index.php/2008/10/02/try-out-php-application-wordpress-on-smash/) on 2008-10-22. Retrieved 2008-10-09.

1. ["Try out PHP Application MediaWiki on sMash"](https://web.archive.org/web/20081016061816/http://www.projectzero.org/blog/index.php/2008/10/09/try-out-php-application-mediawiki-on-websphere-smash/). *MediaWiki on PZ*. Archived from [the original](http://www.projectzero.org/blog/index.php/2008/10/09/try-out-php-application-mediawiki-on-websphere-smash/) on 2008-10-16. Retrieved 2008-10-19.

## External links

- [OSS Developers: Project Zero Aims for Next-Gen Web Applications](https://web.archive.org/web/20080501115052/http://ostatic.com/160611-blog/oss-developers-project-zero-aims-for-next-gen-web-applications)
- [IBM WebSphere sMash V1.1.0 brings smart application development to businesses](http://www-01.ibm.com/common/ssi/index.wss?DocURL=http://www-01.ibm.com/common/ssi/rep_ca/7/897/ENUS208-417/index.html&InfoType=AN&InfoSubType=CA&InfoDesc=Announcement%20Letters&panelurl=index.wss?&paneltext=Announcement%20letter%20search#h2-descx)
- [sMash data access with pureQuery](https://web.archive.org/web/20110524073941/http://www.projectzero.org/sMash/1.1.x/docs/zero.devguide.doc/zero.data/overview.html)

---
Adapted from the Wikipedia article [WebSphere sMash](https://en.wikipedia.org/wiki/WebSphere_sMash) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/WebSphere_sMash?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
