Skip to content

Commit

Permalink
Updated README, prep 6.2.11-rc-2
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Feb 11, 2017
1 parent 3a709c6 commit 9772ef8
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 46 deletions.
76 changes: 36 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,63 +83,52 @@ compile 'io.soluble.pjb:php-java-bridge:VERSION'
### Requirements

- Oracle JDK 7,8
- Gradle and Ant installed
- PHP CLI >= 5.3, < 7.0, [see #4](https://github.com/belgattitude/php-java-bridge/issues/4)
- Optionally gradle (gradlew provided) and ant for old Java.inc generation

### Clone the project
### Get the sources

Run the `git clone` command clone in a directory:
You can either clone the project with:

```shell
$ git clone https://github.com/belgattitude/php-java-bridge.git
$ cd php-java-bridge
```

### Build

> Building the project requires a php interpreter (5.3 - 5.6) installed. By default
> it will use the `php` found in system path, but you can specify another location through the `-Dphp_exec=` argument.
```
$ gradle build
```

### Generated files
or download a sip tarball from the github page.

See the `/build/libs` folder :
### Gradle build

| File | Description | Approx. size |
| ------------- | ------------- | ------------ |
| `php-java-bridge-<VERSION>.jar` | JavaBridge library. | +/- 500k |
| `php-java-bridge-<VERSION>-web.war` | Ready to deploy war template file. | +/- 900k |
| `php-java-bridge-<VERSION>-sources.jar` | JavaBridge sources. | +/- 400k |
| `php-java-bridge-<VERSION>-javadoc.jar` | Generated API documentation. | +/- 600k |

## Gradle tasks


Tomcat embedded support
Build the project with the provided gradle wrapper:

```shell
$ gradle tomcatRun
$ # gradle tomcatStop (to stop the server)
$ cd php-java-bridge
$ ./gradlew build
```

For rebuilding the older Java.inc and launchers:
The generated files are available in the `/build/libs` folder:

```shell
$ gradle genClean -Dphp_exec=php5.6
$ gradle genAll -Dphp_exec=php5.6
```
| File | Description |
| ------------- | ------------- |
| `php-java-bridge-<VERSION>.jar` | JavaBridge library (servlet and standalone). |
| `php-java-bridge-<VERSION>-sources.jar` | Source code. |
| `php-java-bridge-<VERSION>-javadoc.jar` | Generated api doc. |

Additionally a generic template file is automatically generated:

| File | Description |
| -------------| ------------- |
| `JavaBridgeTemplate.war` | A ready to deploy war example file. |

## Usage

### Deploy

> Currently only tested on Tomcat 7/8, should be running on any servlet 2.5 compatible container.
#### Deploy on Tomcat8
### Servlet registration

You can have a look to the [web.xml](https://github.com/belgattitude/php-java-bridge/blob/master/src/main/webapp/WEB-INF/web.xml) default configuration
for the servlet configuration settings.

### Deploy

Ensure you have tomcat installed and a php-cgi

Expand All @@ -148,10 +137,10 @@ $ sudo apt-get install tomcat8 tomcat8-admin
$ sudo apt-get install php-cgi
```

And copy the ready to run `JavaBridge-<VERSION>.war` in the tomcat webapps folder:
And copy the ready to run `JavaBridgeTemplate.war` in the tomcat webapps folder:

```shell
$ sudo cp ./build/libs/php-java-bridge-<VERSION>-web.war /var/lib/tomcat8/webapps/JavaBridgeTemplate.war
$ sudo cp ./build/libs/JavaBridgeTemplate.war /var/lib/tomcat8/webapps/JavaBridgeTemplate.war
```

Wait few seconds for deployment and point your browser to [http://localhost:8080/JavaBridgeTemplate](http://localhost:8080/JavaBridgeTemplate).
Expand All @@ -162,6 +151,13 @@ Have a look to the error log if needed:
$ cat /var/log/tomcat8/catalina.out
```

## Develop

For development, the use of the `./gradlew tomcatRun` and `./gradlew tomcatStop` allows testing
without the need of deployment.

Dependencies can be added in the `build.gradle` file.

## FAQ

### OutOfMemory errors under Tomcat
Expand Down
17 changes: 11 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ buildscript {
}


war {
dependsOn jar
classifier 'web'
//baseName "${project.archivesBaseName}-template"
//from 'src/rootContent' // could add a file-set to the root of the archive
}

tomcatRun {
contextPath = '/'
Expand Down Expand Up @@ -94,6 +88,17 @@ jar {
}


war {
dependsOn jar
classifier 'web'
archiveName = "JavaBridgeTemplate.war"
//version = null
//baseName "${project.archivesBaseName}-template"
//from 'src/rootContent' // could add a file-set to the root of the archive
}



jacocoTestReport {
group = 'Reporting'
reports {
Expand Down

0 comments on commit 9772ef8

Please sign in to comment.