YamlFileLoader
This commit is contained in:
parent
d0e002df44
commit
c97ebacd47
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PublishConfigData" serverName="Symfony" />
|
||||
</project>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -24,7 +24,8 @@
|
|||
"knplabs/knp-snappy": "^0.4.3",
|
||||
"h4cc/wkhtmltopdf-amd64": "0.12.x",
|
||||
"h4cc/wkhtmltoimage-amd64": "0.12.x",
|
||||
"webmozart/json": "^1.2"
|
||||
"webmozart/json": "^1.2",
|
||||
"symfony/yaml": "^3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/asset": "~2.8|^3.0",
|
||||
|
@ -47,12 +48,13 @@
|
|||
"symfony/translation": "~2.8|^3.0",
|
||||
"symfony/twig-bridge": "~2.8|^3.0",
|
||||
"symfony/validator": "~2.8|^3.0",
|
||||
"symfony/var-dumper": "~2.8|^3.0",
|
||||
"symfony/var-dumper": "^3.1",
|
||||
"twig/twig": "~1.8|~2.0",
|
||||
"doctrine/dbal": "~2.2",
|
||||
"swiftmailer/swiftmailer": "~5",
|
||||
"monolog/monolog": "^1.4.1",
|
||||
"symfony/console": "^3.1"
|
||||
"symfony/console": "^3.1",
|
||||
"texthtml/whoops-silex": "^1.0"
|
||||
},
|
||||
"replace": {
|
||||
"silex/api": "v2.0.2",
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "b9e1282f8f9e035b8a9bd6022d47c4aa",
|
||||
"content-hash": "6c34bb3b977c218536d5228013f3ab7e",
|
||||
"hash": "25df9af0b41ac7ef6d45ab96d5d667b7",
|
||||
"content-hash": "03d1d2ef3ffe14233c10db19ae9521f6",
|
||||
"packages": [
|
||||
{
|
||||
"name": "h4cc/wkhtmltoimage-amd64",
|
||||
|
@ -792,6 +792,61 @@
|
|||
],
|
||||
"time": "2016-07-01 08:30:59"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "b69648974b39cc6f76aea9d3aee8212cd0c0d75d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/b69648974b39cc6f76aea9d3aee8212cd0c0d75d",
|
||||
"reference": "b69648974b39cc6f76aea9d3aee8212cd0c0d75d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "~2.8|~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For validating YAML files using the lint command"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Yaml\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-07-01 16:08:10"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "dev-master",
|
||||
|
@ -1408,6 +1463,66 @@
|
|||
],
|
||||
"time": "2014-09-09 13:34:57"
|
||||
},
|
||||
{
|
||||
"name": "filp/whoops",
|
||||
"version": "2.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/filp/whoops.git",
|
||||
"reference": "d13505b240a6f580bc75ba591da30299d6cb0eec"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/filp/whoops/zipball/d13505b240a6f580bc75ba591da30299d6cb0eec",
|
||||
"reference": "d13505b240a6f580bc75ba591da30299d6cb0eec",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.5.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "^4.8 || ^5.0",
|
||||
"symfony/var-dumper": "~3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
|
||||
"whoops/soap": "Formats errors as SOAP responses"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Whoops\\": "src/Whoops/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Filipe Dobreira",
|
||||
"homepage": "https://github.com/filp",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "php error handling for cool kids",
|
||||
"homepage": "https://github.com/filp/whoops",
|
||||
"keywords": [
|
||||
"error",
|
||||
"exception",
|
||||
"handling",
|
||||
"library",
|
||||
"whoops",
|
||||
"zf2"
|
||||
],
|
||||
"time": "2016-04-07 06:16:25"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.x-dev",
|
||||
|
@ -3245,6 +3360,96 @@
|
|||
],
|
||||
"time": "2016-06-29 05:43:32"
|
||||
},
|
||||
{
|
||||
"name": "texthtml/whoops-pimple",
|
||||
"version": "v1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/texthtml/whoops-pimple.git",
|
||||
"reference": "bb31b1ca8f73a0e8e41ccb14e1fe599f0a0fc86b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/texthtml/whoops-pimple/zipball/bb31b1ca8f73a0e8e41ccb14e1fe599f0a0fc86b",
|
||||
"reference": "bb31b1ca8f73a0e8e41ccb14e1fe599f0a0fc86b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"filp/whoops": "^2.0",
|
||||
"pimple/pimple": "^3.0",
|
||||
"symfony/http-kernel": "^2.0|^3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"WhoopsPimple\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"AGPL-3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mathieu Rochette",
|
||||
"email": "mathieu@rochette.cc",
|
||||
"homepage": "https://mathieu.rochette.cc"
|
||||
}
|
||||
],
|
||||
"description": "Integrates the Whoops library into Pimple",
|
||||
"keywords": [
|
||||
"error",
|
||||
"exception",
|
||||
"pimple",
|
||||
"silex",
|
||||
"whoops"
|
||||
],
|
||||
"time": "2016-02-29 12:46:39"
|
||||
},
|
||||
{
|
||||
"name": "texthtml/whoops-silex",
|
||||
"version": "1.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/texthtml/whoops-silex.git",
|
||||
"reference": "bc4797ba761db398c9f1f532dd00d9487aa46dc3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/texthtml/whoops-silex/zipball/bc4797ba761db398c9f1f532dd00d9487aa46dc3",
|
||||
"reference": "bc4797ba761db398c9f1f532dd00d9487aa46dc3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"silex/silex": "~2.0@dev",
|
||||
"texthtml/whoops-pimple": "~1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"WhoopsSilex\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"AGPL-3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Mathieu Rochette",
|
||||
"email": "mathieu@rochette.cc",
|
||||
"homepage": "https://mathieu.rochette.cc"
|
||||
}
|
||||
],
|
||||
"description": "Integrates the Whoops library into Silex",
|
||||
"keywords": [
|
||||
"error",
|
||||
"exception",
|
||||
"silex",
|
||||
"whoops"
|
||||
],
|
||||
"time": "2015-04-09 08:49:20"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "dev-master",
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: eric
|
||||
* Date: 7/2/16
|
||||
* Time: 11:48 AM
|
||||
*/
|
||||
|
||||
namespace Sikofitt\Config;
|
||||
|
||||
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class YamlFileLoader
|
||||
{
|
||||
public function __construct (string $filename)
|
||||
{
|
||||
return Yaml::parse(file_get_contents($filename));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: eric
|
||||
* Date: 7/2/16
|
||||
* Time: 11:22 AM
|
||||
*/
|
||||
|
||||
namespace Sikofitt\Resume;
|
||||
|
||||
|
||||
use Webmozart\Json\Conversion\JsonConverter;
|
||||
|
||||
/**
|
||||
* Class ResumeParser
|
||||
* @package Sikofitt\Resume
|
||||
*/
|
||||
class ResumeParser implements JsonConverter
|
||||
{
|
||||
/**
|
||||
* @param mixed $jsonData
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function fromJson ($jsonData, array $options = array ())
|
||||
{
|
||||
// TODO: Implement fromJson() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function toJson ($data, array $options = array ())
|
||||
{
|
||||
// TODO: Implement toJson() method.
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{{ 'Hello!' }}
|
|
@ -1,11 +1,37 @@
|
|||
<?php
|
||||
|
||||
|
||||
use Silex\Provider\TwigServiceProvider;
|
||||
use Symfony\Component\Validator\Mapping\Loader\YamlFileLoader;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use WhoopsSilex\WhoopsServiceProvider;
|
||||
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
define('APP_ROOT', __DIR__ . '/../');
|
||||
|
||||
$app = new Silex\Application();
|
||||
|
||||
$app->get('/', function () {
|
||||
return 'Hello!';
|
||||
$app->register(new TwigServiceProvider(), [
|
||||
'twig.path' => __DIR__.'/../views',
|
||||
]);
|
||||
$app->register(new WhoopsServiceProvider());
|
||||
|
||||
$app['json.decoder'] = function($app) {
|
||||
return new Webmozart\Json\JsonDecoder();
|
||||
};
|
||||
$app['json.encoder'] = function($app) {
|
||||
return new Webmozart\Json\JsonEncoder();
|
||||
};
|
||||
$app['json.validator'] = function($app) {
|
||||
return new Webmozart\Json\JsonValidator();
|
||||
};
|
||||
|
||||
$app->get('/', function() use($app) {
|
||||
|
||||
$yaml = Yaml::parse(file_get_contents(APP_ROOT . 'yaml.yml'));
|
||||
dump($yaml);
|
||||
return $app['twig']->render('base.html.twig');
|
||||
});
|
||||
|
||||
$app->run();
|
||||
|
|
Loading…
Reference in New Issue