Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #!/bin/sh
  2. echo "project name:"
  3. read PROJECT_NAME
  4. echo "port to use:"
  5. read PORT
  6. mkdir ~/${PROJECT_NAME}
  7. cd ~/${PROJECT_NAME}
  8. mkdir app web src views
  9. echo vendor/ > .gitignore
  10. echo "<?php \n\t\$website = require_once __DIR__.'/../app/app.php'; \n\t\$website->run(); ?>" > web/index.php
  11. echo "<?php \n\n\trequire_once __DIR__.'/../vendor/autoload.php'; \n\n\t\$app = new Silex\Application(); \n\n\t\$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__.'/../views')); \n\n\t\$app->get('/', function(){return 'Hello, World!';}); \n\n\treturn \$app; \n\n?>" > app/app.php
  12. composer require --prefer-source --no-interaction silex/silex:~1.1 twig/twig:~1.0
  13. atom ~/${PROJECT_NAME}
  14. cd web
  15. php -S localhost:${PORT}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement