Skip to content

Commit 3413486

Browse files
committed
Create basic command line runner
1 parent f9eaa9c commit 3413486

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

blueprint.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
require 'vendor/autoload.php';
4+
5+
use Blueprint\Lexers\Lexer;
6+
use Blueprint\Parsers\Parser;
7+
use Blueprint\Generators\Generator;
8+
9+
$contents = file_get_contents('sample.yaml');
10+
11+
$tokens = Parser::parse($contents);
12+
$registry = Lexer::analyze($tokens);
13+
Generator::generate($registry);
14+

sample.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
models:
2+
Post:
3+
title: string
4+
content: bigtext
5+
published_at: nullable timestamp
6+
7+
8+
controllers:
9+
Post:
10+
index:
11+
query: all posts
12+
render: post.index with posts
13+
14+
store:
15+
validate: title, content
16+
save: post
17+
send: ReviewNotifcation to post.author
18+
queue: SyncMedia
19+
flash: post.title
20+
redirect: post.index
21+
22+
commands:

0 commit comments

Comments
 (0)