Skip to content

Commit

Permalink
Zend stack and project sample (#2700)
Browse files Browse the repository at this point in the history
### What does this PR do?

Adds a stack with [Zend Server](http://www.zend.com/en/products/zend_server), based on the [official docker image](https://hub.docker.com/r/_/php-zendserver/). Zend Server is a professional and certified PHP distribution. The docker image includes a free trial Developer license.

Also adds a project sample of the [Astro Splash](https://github.com/kaloyan-raev/AstroSplash) application, which is a demo app based on the [Zend Expressive](https://zendframework.github.io/zend-expressive/) framework.

After creating a workspace with these stack and template the user must:

1. Execute the `configure` command.
2. Execute the `restart zend server` command.
3. Click on the preview link generated by the `restart zend server` command.

### What issues does this PR fix or reference?

- PHP support #2590

### New behavior

- New stack with Zend Server.
- New project sample: Astro Splash demo app, based on Zend Expressive.
  • Loading branch information
kaloyan-raev authored and Stévan Le Meur committed Oct 5, 2016
1 parent 67f78d7 commit 3615479
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 0 deletions.
70 changes: 70 additions & 0 deletions ide/che-core-ide-stacks/src/main/resources/images/type-zend.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions ide/che-core-ide-stacks/src/main/resources/stacks.json
Original file line number Diff line number Diff line change
Expand Up @@ -1928,5 +1928,92 @@
"name": "type-bitnami.svg",
"mediaType": "image/svg+xml"
}
},
{
"id": "zend",
"creator": "ide",
"name": "Zend",
"description": "Zend stack with PHP 7, Zend Server 9 and Z-Ray.",
"scope": "advanced",
"tags": [
"PHP",
"Zend",
"Z-Ray",
"Composer",
"Ubuntu",
"Git"
],
"components": [
{
"name": "PHP",
"version": "7.0.6"
},
{
"name": "Zend Server",
"version": "9.0.0"
},
{
"name": "Composer",
"version": "---"
}
],
"source": {
"type": "image",
"origin": "kaloyanraev/che-zendserver"
},
"workspaceConfig": {
"environments": {
"default": {
"machines": {
"dev-machine": {
"agents": [
"org.eclipse.che.terminal", "org.eclipse.che.ws-agent", "org.eclipse.che.ssh", "org.eclipse.che.ls.php", "org.eclipse.che.ls.json"
],
"servers": {},
"attributes" : {
"memoryLimitBytes": "2147483648"
}
}
},
"recipe": {
"location": "kaloyanraev/che-zendserver",
"type": "dockerimage"
}
}
},
"name": "default",
"defaultEnv": "default",
"description": null,
"commands": [
{
"name": "restart zend server",
"type": "custom",
"commandLine": "sudo sed -i 's#zray.zendserver_ui_url=.*#zray.zendserver_ui_url=http://${server.port.10081}/ZendServer#g' /usr/local/zend/etc/conf.d/zray.ini && sudo /usr/local/zend/bin/zendctl.sh restart",
"attributes": {
"previewUrl": "http://${server.port.80}"
}
},
{
"name": "stop zend server",
"type": "custom",
"commandLine": "sudo /usr/local/zend/bin/zendctl.sh stop",
"attributes": {
"previewUrl": ""
}
},
{
"name": "show admin password",
"type": "custom",
"commandLine": "echo \"Zend Server admin password is `sudo cat /root/zend-password`\"",
"attributes": {
"previewUrl": "http://${server.port.10081}"
}
}
]
},
"stackIcon": {
"name": "type-zend.svg",
"mediaType": "image/svg+xml"
}
}
]
51 changes: 51 additions & 0 deletions ide/che-core-ide-templates/src/main/resources/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -1260,5 +1260,56 @@
"tags": [
"Play"
]
},
{
"name": "astro-splash",
"displayName": "astro-splash",
"path": "/astro-splash",
"description": "An app that uses the Astronomy Picture of the Day API provided by NASA and the Zend Expressive framework.",
"projectType": "php",
"mixins": [],
"attributes": {
"language": [
"php"
]
},
"modules": [],
"problems": [],
"source": {
"type": "git",
"location": "https://github.com/kaloyan-raev/AstroSplash.git",
"parameters": {}
},
"commands": [
{
"name": "configure",
"type": "custom",
"commandLine": "chmod 777 ${current.project.path}/data; echo -e \"<VirtualHost *:80>\n DocumentRoot ${current.project.path}/public\n SetEnv APPLICATION_ENV 'development'\n <Directory ${current.project.path}/public>\n DirectoryIndex index.php\n AllowOverride All\n Require all granted\n </Directory>\n</VirtualHost>\" | sudo tee /etc/apache2/sites-available/000-default.conf; composer --working-dir=${current.project.path} install && cp /usr/local/zend/etc/php.ini /tmp/update-php.ini && grep -q 'extension=pcntl.so' /tmp/update-php.ini || echo -e \"\nextension=pcntl.so\" | sudo tee -a /tmp/update-php.ini && php -c /tmp/update-php.ini ${current.project.path}/bin/update.php && rm /tmp/update-php.ini",
"attributes": {
"previewUrl": ""
}
},
{
"name": "update images",
"type": "custom",
"commandLine": "cp /usr/local/zend/etc/php.ini /tmp/update-php.ini && grep -q 'extension=pcntl.so' /tmp/update-php.ini || echo -e \"\nextension=pcntl.so\" | sudo tee -a /tmp/update-php.ini && php -c /tmp/update-php.ini ${current.project.path}/bin/update.php && rm /tmp/update-php.ini",
"attributes": {
"previewUrl": ""
}
},
{
"name": "clean doctrine cache",
"type": "custom",
"commandLine": "sudo rm -rf ${current.project.path}/data/doctrine-cache",
"attributes": {
"previewUrl": ""
}
}
],
"links": [],
"category": "Samples",
"tags": [
"Zend"
]
}
]

0 comments on commit 3615479

Please sign in to comment.