Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added a very rough web interface and pagoda deployment process
- Loading branch information
Jason Fox
committed
Feb 28, 2013
1 parent
b241ba5
commit 273c996
Showing
11 changed files
with
199 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
web1: | ||
document_root: web | ||
default_gateway: app.php | ||
index_list: [app.php] | ||
php_version: 5.3.8 | ||
php_extensions: | ||
- apc | ||
- intl | ||
- mbstring | ||
- xsl | ||
- zip | ||
php_short_open_tag: "0" | ||
php_magic_quotes_gpc: "0" | ||
php_register_globals: "0" | ||
php_session_autostart: "0" | ||
|
||
after_build: | ||
- "bash after_build.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
PHP=php | ||
|
||
echo 'Download the composer.phar file, so the vendors can be installed from the distributed composer.json.' | ||
if [ ! -f composer.phar ] | ||
then | ||
curl -s -O http://getcomposer.org/composer.phar | ||
fi | ||
|
||
echo 'Update composer.phar.' | ||
$PHP composer.phar self-update --quiet | ||
|
||
echo 'Install the needed vendors for this application.' | ||
$PHP composer.phar install --quiet | ||
|
||
echo 'Dump the optimized autoloader classmap for performance reasons.' | ||
$PHP composer.phar dump-autoload --optimize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#generator-form.feature | ||
Feature: There is a form that I can enter details about the feature | ||
In order to enter dto parameters | ||
As a user | ||
I want to enter the details in a form | ||
|
||
Scenario: I can see the form on the home page | ||
Given I am on homepage | ||
Then I should see "Build me a DTO named" | ||
And I should see "in the Namespace" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,50 @@ | ||
{% extends 'default.html.twig' %} | ||
{% block content %} | ||
<header> | ||
<div class="row"> | ||
<div class="span6"> | ||
<h1>DTOx</h1> | ||
<p class="lead">DTOx is a program that lets you create DTOs.</p> | ||
</div> | ||
</div> | ||
</header> | ||
|
||
<div ng-controller="DTOCtrl"> | ||
<div class="row" > | ||
<div class="span12"> | ||
<form class="form-inline"> | ||
Build me a DTO named: | ||
<input type="text" name="dto-name-field" placeholder="MyDTO" ng-model="dto.name" ng-change="change()"> | ||
in the Namespace: | ||
<input type="text" name="namespace-field" placeholder="My\App\Namespace" ng-model="dto.namespace" ng-change="change()"> | ||
</form> | ||
</div> | ||
</div> | ||
<form class="vars form-inline"> | ||
<div ng-repeat="var in dto.vars"> | ||
{% verbatim %} | ||
<input type="text" ng-change="change()" ng-pattern="/^[a-z][a-zA-Z0-9]*$/" ng-model="var.name" value="{{var.name}}"/> | ||
<input type="text" class="input" ng-change="change()" ng-model="var.type" value="{{var.type}}"/> | ||
= | ||
<input type="text" class="input" ng-change="change()" ng-model="var.testData" value="{{var.testData}}"/> | ||
{% endverbatim %} | ||
</div> | ||
</form> | ||
<form class="vars form-inline" ng-submit="addVar()"> | ||
<input type="text" ng-pattern="/^[a-z][a-zA-Z0-9]*$/" ng-model="varName" placeholder="myVarName"/> | ||
<input type="text" class="input" ng-model="varType" placeholder="type"/> | ||
<input type="text" class="input" ng-model="varTestData" placeholder="test Value"/> | ||
<input class="btn btn-primary" type="submit" value="add"/> | ||
</form> | ||
<div class="row"> | ||
<div class="span12"> | ||
<h2>{% verbatim %}{{dto.namespace}}\{{dto.name}}{% endverbatim %}</h2> | ||
<textarea ui-codemirror ng-model="code.dto"></textarea> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="span12"> | ||
<h2>{% verbatim %}{{dto.namespace}}\{{dto.name}}Test{% endverbatim %}</h2> | ||
<textarea ui-codemirror ng-model="code.test"></textarea> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_FILENAME} -s [OR] | ||
RewriteCond %{REQUEST_FILENAME} -l [OR] | ||
RewriteCond %{REQUEST_FILENAME} -d | ||
RewriteRule ^.*$ - [NC,L] | ||
RewriteRule ^.*$ app.php [NC,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.CodeMirror { | ||
border: 1px solid #eee; | ||
height: auto; | ||
} | ||
.CodeMirror-scroll { | ||
overflow-y: hidden; | ||
overflow-x: auto; | ||
} | ||
|
||
.vars input[type=text] { | ||
height: 28px; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var DTOx = angular.module('DTOx',['ui']); | ||
|
||
DTOx.value('ui.config', { | ||
codemirror: { | ||
mode: 'text/x-php', | ||
lineNumbers: true, | ||
matchBrackets: true | ||
} | ||
}); | ||
|
||
function DTOCtrl($scope, $timeout, $http){ | ||
$scope.dto = {vars: []}; | ||
|
||
$scope.change = function() { | ||
var prom = 0; | ||
$timeout.cancel(prom); | ||
prom = $timeout(function(){ | ||
$http.post('/dto/', angular.toJson($scope.dto)).success(function(data){ | ||
var returnData = angular.fromJson(data); | ||
$scope.code = {dto: returnData.dto, test: returnData.test}; | ||
}); | ||
}, 1000); | ||
}; | ||
|
||
$scope.addVar = function() { | ||
$scope.dto.vars.push({name: $scope.varName, type: $scope.varType, testData: $scope.varTestData}); | ||
$scope.varName = ''; | ||
$scope.varType = ''; | ||
$scope.vatTestData = ''; | ||
$scope.change(); | ||
}; | ||
} |