Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo "project name:"
- read PROJECT_NAME
- echo "port to use:"
- read PORT
- mkdir ~/${PROJECT_NAME}
- cd ~/${PROJECT_NAME}
- mkdir app web src views
- echo vendor/ > .gitignore
- echo "<?php \n\t\$website = require_once __DIR__.'/../app/app.php'; \n\t\$website->run(); ?>" > web/index.php
- 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
- composer require --prefer-source --no-interaction silex/silex:~1.1 twig/twig:~1.0
- atom ~/${PROJECT_NAME}
- cd web
- php -S localhost:${PORT}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement