File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -246,6 +246,11 @@ update_configs:
246246 directory : php/symfony
247247 default_labels :
248248 - language:php
249+ - package_manager : php:composer
250+ update_schedule : live
251+ directory : php/spiral
252+ default_labels :
253+ - language:php
249254- package_manager : docker
250255 update_schedule : daily
251256 directory : php/imi
@@ -383,11 +388,11 @@ update_configs:
383388 - docker
384389- package_manager : docker
385390 update_schedule : daily
386- directory : swift/perfect
391+ directory : fsharp/suave
387392 default_labels :
388393 - docker
389394- package_manager : docker
390395 update_schedule : daily
391- directory : fsharp/suave
396+ directory : swift/perfect
392397 default_labels :
393- - docker
398+ - docker
Original file line number Diff line number Diff line change @@ -456,6 +456,11 @@ jobs:
456456 language : crystal
457457 env : FRAMEWORK=spider-gazelle
458458 services : docker
459+ - stage : test
460+ script : bash .ci/test.sh
461+ language : crystal
462+ env : FRAMEWORK=spiral
463+ services : docker
459464 - stage : test
460465 script : bash .ci/test.sh
461466 language : crystal
Original file line number Diff line number Diff line change 1+ http :
2+ address : :3000
3+ workers :
4+ command : " php app.php"
Original file line number Diff line number Diff line change 1+ FROM php:7.3
2+
3+ RUN apt-get -qy update
4+
5+ WORKDIR /usr/src/app
6+
7+ COPY app app
8+ COPY app.php app.php
9+ COPY .rr.yaml .rr.yaml
10+ COPY composer.json composer.json
11+
12+ # install composer
13+ RUN curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
14+
15+ # php/zip extension is required for composer
16+ RUN apt -y update && apt -y install zlib1g-dev libzip-dev
17+ RUN docker-php-ext-install zip
18+
19+ RUN composer install --no-dev --prefer-dist --classmap-authoritative
20+ RUN composer dumpautoload -o
21+
22+ # dumping autoloader require php/opcache
23+ RUN docker-php-ext-install opcache
24+
25+ # install spiral binary file
26+ RUN vendor/bin/spiral get
27+
28+ # configure
29+ RUN php app.php configure
30+
31+ # run roadrunner
32+ CMD php app.php up > /dev/null 2>&1 && ./spiral serve
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Spiral Framework.
4+ *
5+ * @license MIT
6+ * @author Anton Titov (Wolfy-J)
7+ */
8+ declare (strict_types=1 );
9+
10+ mb_internal_encoding ('UTF-8 ' );
11+ error_reporting (E_ALL | E_STRICT );
12+ ini_set ('display_errors ' , 'stderr ' );
13+
14+ //Composer
15+ require __DIR__ . '/vendor/autoload.php ' ;
16+
17+ //Initiating shared container, bindings, directories and etc
18+ $ app = \App \App::init (['root ' => __DIR__ ]);
19+
20+ if ($ app != null ) {
21+ $ app ->serve ();
22+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Spiral Framework.
4+ *
5+ * @license MIT
6+ * @author Anton Titov (Wolfy-J)
7+ */
8+ declare (strict_types=1 );
9+
10+ namespace App ;
11+
12+ use App \Bootloader \RoutesBootloader ;
13+ use Spiral \Bootloader ;
14+ use Spiral \Framework \Kernel ;
15+ use Spiral \Nyholm \Bootloader as Nyholm ;
16+
17+ class App extends Kernel
18+ {
19+ /*
20+ * List of components and extensions to be automatically registered
21+ * within system container on application start.
22+ */
23+ protected const LOAD = [
24+ // HTTP
25+ Nyholm \NyholmBootloader::class,
26+ Bootloader \Http \HttpBootloader::class,
27+ Bootloader \Http \RouterBootloader::class,
28+
29+ // Framework commands
30+ Bootloader \CommandBootloader::class
31+ ];
32+
33+ /*
34+ * Application specific services and extensions.
35+ */
36+ protected const APP = [
37+ RoutesBootloader::class,
38+ ];
39+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Spiral Framework.
4+ *
5+ * @license MIT
6+ * @author Anton Titov (Wolfy-J)
7+ */
8+ declare (strict_types=1 );
9+
10+ namespace App \Bootloader ;
11+
12+ use App \Controller \BenchmarkController ;
13+ use Spiral \Boot \Bootloader \Bootloader ;
14+ use Spiral \Router \Route ;
15+ use Spiral \Router \RouterInterface ;
16+ use Spiral \Router \Target \Action ;
17+
18+ class RoutesBootloader extends Bootloader
19+ {
20+ /**
21+ * @param RouterInterface $router
22+ */
23+ public function boot (RouterInterface $ router )
24+ {
25+ $ router ->addRoute (
26+ 'index ' ,
27+ (new Route ('/ ' , new Action (BenchmarkController::class, 'index ' )))->withVerbs ('GET ' )
28+ );
29+
30+ $ router ->addRoute (
31+ 'benchmark ' ,
32+ new Route ('/user[/<id>] ' , new Action (BenchmarkController::class, 'user ' ))
33+ );
34+ }
35+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Spiral Framework.
4+ *
5+ * @license MIT
6+ * @author Anton Titov (Wolfy-J)
7+ */
8+ declare (strict_types=1 );
9+
10+ namespace App \Controller ;
11+
12+ use Spiral \Core \Container \SingletonInterface ;
13+
14+ class BenchmarkController implements SingletonInterface
15+ {
16+ public function index ()
17+ {
18+ return '' ;
19+ }
20+
21+ public function user ($ id = null )
22+ {
23+ return (string )$ id ;
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ {
2+ "require" : {
3+ "spiral/framework" : " ~2.0.0" ,
4+ "spiral/nyholm-bridge" : " *" ,
5+ "spiral/http" : " *" ,
6+ "spiral/router" : " *" ,
7+ "spiral/console" : " *" ,
8+ "spiral/roadrunner" : " ^1.4"
9+ },
10+ "autoload" : {
11+ "psr-4" : {
12+ "App\\ " : " app/src/"
13+ }
14+ }
15+ }
Original file line number Diff line number Diff line change 1+ framework :
2+ github : spiral/framework
3+ version : 2.0
4+
You can’t perform that action at this time.
0 commit comments