Skip to content

Commit 2211391

Browse files
authored
Merge pull request #41 from CodelyTV/legacy_create_video
Legacy create video
2 parents c84a439 + 82f8d39 commit 2211391

File tree

153 files changed

+22295
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+22295
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Legacy create video
2+
3+
Try to add new features to the legacy code
4+
5+
## User story
6+
7+
There is an HTTP API endpoint to create Codely videos.
8+
When creating videos, we want to ensure that:
9+
10+
- The words "frontend", "Frontend" and "front-end" must be
11+
transformed to "Front-end".
12+
- If the title contains any whitespace at the beginning or
13+
the end, it must be removed.
14+
- If the title contains a final dot, it must be removed.
15+
16+
## Exercise
17+
18+
Available languages:
19+
20+
- [PHP Symfony](base/php-symfony/README.md)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/web/bundles/
2+
/app/cache/*
3+
/app/logs/*
4+
/build/
5+
/vendor/
6+
/bin/
7+
/composer.phar
8+
app/config/parameters.yml
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: php
2+
3+
sudo: false
4+
5+
cache:
6+
directories:
7+
- $HOME/.composer/cache
8+
9+
php:
10+
- 5.5
11+
- 5.6
12+
- 7.0
13+
- hhvm
14+
15+
before_install:
16+
- composer self-update
17+
18+
install: composer update $COMPOSER_FLAGS --prefer-dist
19+
20+
after_failure: "cat /home/travis/build/gimler/symfony-rest-edition/app/logs/test.log"
21+
22+
script: phpunit -c app
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2004-2013 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<img src="http://codely.tv/wp-content/uploads/2016/05/cropped-logo-codelyTV.png" align="left" width="192px" height="192px"/>
2+
<img align="left" width="0" height="192px" hspace="10"/>
3+
4+
> Keep it simple :)
5+
6+
[![CodelyTV](https://img.shields.io/badge/code-codely-green.svg?style=flat-square)](codely.tv)
7+
8+
**CodelyTv** is the way to rediscover the programming ;) Trusted by more than 1000 youtube subscribers.
9+
10+
Trust in **Codely**, trust in **you**.
11+
12+
## Quick Start
13+
This is a simple demo of a coupled code.
14+
15+
### 1. Clone this repo
16+
Execute: `git clone https://github.com/CodelyTV/coupled-code-example`
17+
18+
### 2. Install all the dependencies
19+
Composer is used to handle the dependencies. You can download it executing:
20+
`curl -sS https://getcomposer.org/installer | php`
21+
22+
And then you can install all the dependencies executing:
23+
`php composer.phar install`
24+
25+
### 3. Run the tests!
26+
Once you have all the dependencies, in order to execute the tests, run this command:
27+
`bin/phpunit`
28+
29+
## Extra
30+
This code was show in the [From framework coupled code to #microservices through #DDD](http://codely.tv/screencasts/codigo-acoplado-framework-microservicios-ddd) talk.
31+
32+
You have the *CQRS* version of the code [here](https://github.com/CodelyTV/cqrs-ddd-example)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deny from all
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
require_once __DIR__.'/AppKernel.php';
4+
5+
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
6+
7+
class AppCache extends HttpCache
8+
{
9+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
use Symfony\Component\HttpKernel\Kernel;
4+
use Symfony\Component\Config\Loader\LoaderInterface;
5+
6+
class AppKernel extends Kernel
7+
{
8+
public function registerBundles()
9+
{
10+
$bundles = array(
11+
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
12+
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
13+
new Symfony\Bundle\TwigBundle\TwigBundle(),
14+
new Symfony\Bundle\MonologBundle\MonologBundle(),
15+
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
16+
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
17+
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
18+
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
19+
new JMS\SerializerBundle\JMSSerializerBundle(),
20+
new FOS\RestBundle\FOSRestBundle(),
21+
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
22+
new FOS\HttpCacheBundle\FOSHttpCacheBundle(),
23+
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
24+
new Hautelook\TemplatedUriBundle\HautelookTemplatedUriBundle(),
25+
new Bazinga\Bundle\RestExtraBundle\BazingaRestExtraBundle(),
26+
);
27+
28+
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
29+
$bundles[] = new AppBundle\AppBundle();
30+
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
31+
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
32+
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
33+
}
34+
35+
return $bundles;
36+
}
37+
38+
public function registerContainerConfiguration(LoaderInterface $loader)
39+
{
40+
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
41+
}
42+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>{% block title %}Welcome!{% endblock %}</title>
6+
{% block stylesheets %}{% endblock %}
7+
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
8+
</head>
9+
<body>
10+
{% block body %}{% endblock %}
11+
{% block javascripts %}{% endblock %}
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)