From e0664ce1a01956c5a1e90ed0b2210e4c9f0d8a85 Mon Sep 17 00:00:00 2001 From: Gardel Valentin <valentin.gardel2@etu.univ-lorraine.fr> Date: Mon, 2 Mar 2020 09:10:38 +0100 Subject: [PATCH] ajout debut de php --- .gitignore | 1 + php/.idea/misc.xml | 6 +++ php/.idea/modules.xml | 8 ++++ php/.idea/php.iml | 24 +++++++++++ php/.idea/php.xml | 22 ++++++++++ php/.idea/vcs.xml | 6 +++ php/.idea/workspace.xml | 89 ++++++++++++++++++++++++++++++++++++++++ php/composer.json | 13 ++++++ php/conf.inif.sample.txt | 8 ++++ php/index.php | 19 +++++++++ php/src/Model/Game.php | 9 ++++ 11 files changed, 205 insertions(+) create mode 100644 php/.idea/misc.xml create mode 100644 php/.idea/modules.xml create mode 100644 php/.idea/php.iml create mode 100644 php/.idea/php.xml create mode 100644 php/.idea/vcs.xml create mode 100644 php/.idea/workspace.xml create mode 100644 php/composer.json create mode 100644 php/conf.inif.sample.txt create mode 100644 php/index.php create mode 100644 php/src/Model/Game.php diff --git a/.gitignore b/.gitignore index d26482a..1e51a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ .settings .project .hcaccess +.idea bin/ vendor/ diff --git a/php/.idea/misc.xml b/php/.idea/misc.xml new file mode 100644 index 0000000..28a804d --- /dev/null +++ b/php/.idea/misc.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="JavaScriptSettings"> + <option name="languageLevel" value="ES6" /> + </component> +</project> \ No newline at end of file diff --git a/php/.idea/modules.xml b/php/.idea/modules.xml new file mode 100644 index 0000000..2047c36 --- /dev/null +++ b/php/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/php.iml" filepath="$PROJECT_DIR$/.idea/php.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/php/.idea/php.iml b/php/.idea/php.iml new file mode 100644 index 0000000..13162c2 --- /dev/null +++ b/php/.idea/php.iml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="bddApp\" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/composer" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/container" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/contracts" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/database" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/illuminate/support" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/kylekatarnls/update-helper" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/slim/slim" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" /> + <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/php/.idea/php.xml b/php/.idea/php.xml new file mode 100644 index 0000000..38922fb --- /dev/null +++ b/php/.idea/php.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="PhpIncludePathManager"> + <include_path> + <path value="$PROJECT_DIR$/vendor/psr/container" /> + <path value="$PROJECT_DIR$/vendor/psr/simple-cache" /> + <path value="$PROJECT_DIR$/vendor/slim/slim" /> + <path value="$PROJECT_DIR$/vendor/nesbot/carbon" /> + <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" /> + <path value="$PROJECT_DIR$/vendor/symfony/translation" /> + <path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" /> + <path value="$PROJECT_DIR$/vendor/doctrine/inflector" /> + <path value="$PROJECT_DIR$/vendor/illuminate/container" /> + <path value="$PROJECT_DIR$/vendor/illuminate/contracts" /> + <path value="$PROJECT_DIR$/vendor/illuminate/database" /> + <path value="$PROJECT_DIR$/vendor/illuminate/support" /> + <path value="$PROJECT_DIR$/vendor/kylekatarnls/update-helper" /> + <path value="$PROJECT_DIR$/vendor/composer" /> + </include_path> + </component> + <component name="PhpProjectSharedConfiguration" php_language_level="7.2" /> +</project> \ No newline at end of file diff --git a/php/.idea/vcs.xml b/php/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/php/.idea/vcs.xml @@ -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> \ No newline at end of file diff --git a/php/.idea/workspace.xml b/php/.idea/workspace.xml new file mode 100644 index 0000000..320065c --- /dev/null +++ b/php/.idea/workspace.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ChangeListManager"> + <list default="true" id="05e8131d-805d-4cc6-8fa3-f73a4e3adbe8" name="Default Changelist" comment="" /> + <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> + <option name="SHOW_DIALOG" value="false" /> + <option name="HIGHLIGHT_CONFLICTS" value="true" /> + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> + <option name="LAST_RESOLUTION" value="IGNORE" /> + </component> + <component name="ComposerSettings" synchronizationState="SYNCHRONIZE"> + <pharConfigPath>$PROJECT_DIR$/composer.json</pharConfigPath> + <execution> + <executable /> + </execution> + </component> + <component name="Git.Settings"> + <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." /> + </component> + <component name="PhpWorkspaceProjectConfiguration"> + <include_path> + <path value="$PROJECT_DIR$/vendor/psr/container" /> + <path value="$PROJECT_DIR$/vendor/psr/simple-cache" /> + <path value="$PROJECT_DIR$/vendor/slim/slim" /> + <path value="$PROJECT_DIR$/vendor/nesbot/carbon" /> + <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" /> + <path value="$PROJECT_DIR$/vendor/symfony/translation" /> + <path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" /> + <path value="$PROJECT_DIR$/vendor/doctrine/inflector" /> + <path value="$PROJECT_DIR$/vendor/illuminate/container" /> + <path value="$PROJECT_DIR$/vendor/illuminate/contracts" /> + <path value="$PROJECT_DIR$/vendor/illuminate/database" /> + <path value="$PROJECT_DIR$/vendor/illuminate/support" /> + <path value="$PROJECT_DIR$/vendor/kylekatarnls/update-helper" /> + <path value="$PROJECT_DIR$/vendor/composer" /> + </include_path> + </component> + <component name="ProjectId" id="1YZ2cijbAUUj7bEHMcSppp51gYv" /> + <component name="ProjectLevelVcsManager" settingsEditedManually="true" /> + <component name="PropertiesComponent"> + <property name="WebServerToolWindowFactoryState" value="false" /> + <property name="last_opened_file_path" value="$PROJECT_DIR$" /> + </component> + <component name="RecentsManager"> + <key name="MoveFile.RECENT_KEYS"> + <recent name="C:\xampp\htdocs\s4ai2_game_weber_gardel_gregoire_frantzen\php\src" /> + </key> + </component> + <component name="RunDashboard"> + <option name="ruleStates"> + <list> + <RuleState> + <option name="name" value="ConfigurationTypeDashboardGroupingRule" /> + </RuleState> + <RuleState> + <option name="name" value="StatusDashboardGroupingRule" /> + </RuleState> + </list> + </option> + </component> + <component name="SvnConfiguration"> + <configuration /> + </component> + <component name="TaskManager"> + <task active="true" id="Default" summary="Default task"> + <changelist id="05e8131d-805d-4cc6-8fa3-f73a4e3adbe8" name="Default Changelist" comment="" /> + <created>1583135876716</created> + <option name="number" value="Default" /> + <option name="presentableId" value="Default" /> + <updated>1583135876716</updated> + <workItem from="1583135877969" duration="661000" /> + </task> + <servers /> + </component> + <component name="TypeScriptGeneratedFilesManager"> + <option name="version" value="1" /> + </component> + <component name="Vcs.Log.Tabs.Properties"> + <option name="TAB_STATES"> + <map> + <entry key="MAIN"> + <value> + <State /> + </value> + </entry> + </map> + </option> + </component> +</project> \ No newline at end of file diff --git a/php/composer.json b/php/composer.json new file mode 100644 index 0000000..38128b8 --- /dev/null +++ b/php/composer.json @@ -0,0 +1,13 @@ +{ + "require":{ + "illuminate/database": "5.5.*", + "php": ">=7.2", + "slim/slim": "2.*" + }, + + "autoload":{ + "psr-4": { + "bddApp\\" : "src/" + } + } +} diff --git a/php/conf.inif.sample.txt b/php/conf.inif.sample.txt new file mode 100644 index 0000000..a6306b0 --- /dev/null +++ b/php/conf.inif.sample.txt @@ -0,0 +1,8 @@ +driver=mysql +username=root +password= +host= +database=bddApp +charset=utf8 +collation=utf8_unicode_ci +prefix= \ No newline at end of file diff --git a/php/index.php b/php/index.php new file mode 100644 index 0000000..3c3f434 --- /dev/null +++ b/php/index.php @@ -0,0 +1,19 @@ +<?php +require_once __DIR__ . '/vendor/autoload.php'; + +use Illuminate\Database\Capsule\Manager as DB; +$db = new DB(); +$db->addConnection(parse_ini_file('conf.ini')); +$db->setAsGlobal(); +$db->bootEloquent(); + +/* +$app = new \Slim\Slim; + +$app->get('/', function(){ + $c=new ControllerPlanning(); + $c->getCycle(1); +})->name('home'); + +$app->run(); +*/ \ No newline at end of file diff --git a/php/src/Model/Game.php b/php/src/Model/Game.php new file mode 100644 index 0000000..efd3424 --- /dev/null +++ b/php/src/Model/Game.php @@ -0,0 +1,9 @@ +<?php +namespace bddApp\model; + +class Game extends \Illuminate\Database\Eloquent\Model +{ + protected $table = 'game'; + protected $primaryKey = 'id'; + public $timestamps = false; +} \ No newline at end of file -- GitLab