Skip to content

Commit

Permalink
Move from Silex to Symfony (#54)
Browse files Browse the repository at this point in the history
Remove node 8, PHP 7.1, 7.2 and hhvm from Travis build matrix
  • Loading branch information
DavidePastore committed May 29, 2021
1 parent d79ecd7 commit 9b33ca5
Show file tree
Hide file tree
Showing 64 changed files with 21,340 additions and 1,855 deletions.
23 changes: 23 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=c9673746bd36a7069dee22a48cf4928a
###< symfony/framework-bundle ###

###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
###< nelmio/cors-bundle ###
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='DavidePastore\CodiceFiscaleRest\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
33 changes: 30 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

composer.phar
vendor/
/node_modules
/semantic
/public/semantic/
8 changes: 0 additions & 8 deletions .htaccess

This file was deleted.

18 changes: 4 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
language: php
# also test against HHVM, but require "trusty" and ignore errors
jobs:
include:
# Use a YAML alias to prevent redundancy.
# https://github.com/travis-ci/travis-ci/issues/8295#issuecomment-454167006
- &phpbuild
stage: php-build
language: php
php: 7.1
php: 7.3
before_script:
- composer self-update
- composer update --prefer-source
Expand All @@ -19,28 +18,19 @@ jobs:
- &nodebuild
stage: node-build
language: node_js
node_js: 8
install: skip
node_js: 10
script:
- npm install
- <<: *phpbuild
php: 7.2
- <<: *phpbuild
php: 7.3
- npm run dev
- <<: *phpbuild
php: 7.4
- <<: *phpbuild
php: hhvm
dist: trusty
- <<: *nodebuild
node_js: 10
- <<: *nodebuild
node_js: 11
- <<: *nodebuild
node_js: 12
- <<: *nodebuild
node_js: 13
allow_failures:
- php: hhvm

cache:
npm: false
81 changes: 0 additions & 81 deletions app.php

This file was deleted.

43 changes: 43 additions & 0 deletions assets/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)

// Semantic CSS
import '../public/semantic/dist/components/reset.css';
import '../public/semantic/dist/components/site.css';
import '../public/semantic/dist/components/container.css';
import '../public/semantic/dist/components/grid.css';
import '../public/semantic/dist/components/header.css';
import '../public/semantic/dist/components/image.css';
import '../public/semantic/dist/components/menu.css';
import '../public/semantic/dist/components/divider.css';
import '../public/semantic/dist/components/dropdown.css';
import '../public/semantic/dist/components/segment.css';
import '../public/semantic/dist/components/button.css';
import '../public/semantic/dist/components/form.css';
import '../public/semantic/dist/components/list.css';
import '../public/semantic/dist/components/icon.css';
import '../public/semantic/dist/components/sidebar.css';
import '../public/semantic/dist/components/table.css';
import '../public/semantic/dist/components/transition.css';

// Custom style
import './styles/app.css';

// Semantic JS
import '../public/semantic/dist/components/visibility.js';
import '../public/semantic/dist/components/sidebar.js';
import '../public/semantic/dist/components/transition.js';
import '../public/semantic/dist/components/dropdown.js';

// Custom JS
import './fix-menu.js';


// start the Stimulus application
// import './bootstrap';
2 changes: 2 additions & 0 deletions assets/documentazione.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//Highlight code
hljs.initHighlighting();
25 changes: 25 additions & 0 deletions assets/fix-menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import $ from 'jquery';

$(document)
.ready(function() {

// fix menu when passed
$('.masthead')
.visibility({
once: false,
onBottomPassed: function() {
$('.fixed.menu').transition('fade in');
},
onBottomPassedReverse: function() {
$('.fixed.menu').transition('fade out');
}
})
;

// create sidebar and attach to menu open
$('.ui.sidebar')
.sidebar('attach events', '.toc.item')
;

})
;
36 changes: 36 additions & 0 deletions assets/prova.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import $ from 'jquery';

$('.ui.dropdown')
.dropdown()
;

/**
* Show or hide different fields based on the type.
*/
$("#type").change(function(){
var type = $(this).val();
$(".field").hide();
$(".field." + type).show();
}).change();


$("#sendRequest").click(function(){
var url = $("#type option:selected").data("url");
console.log("url:", url);
var field = $("#form .field." + $("#type").val());
var dataToSend = {};
$("input, select", field).each(function(index, element){
var $element = $(element);
var name = $element.attr("name");
var value = $element.val();
dataToSend[name] = value;
});

$.get(url, dataToSend, function(data){
var response = $("#response");
var jsonResponse = JSON.stringify(data, null, ' ');
response.text(jsonResponse);
hljs.highlightBlock(response.get(0));
});
});
hljs.initHighlighting();
Loading

0 comments on commit 9b33ca5

Please sign in to comment.