From 7dc388236c03c69b67a695413f296986b1ad2c50 Mon Sep 17 00:00:00 2001 From: William Vonderscher <william.vonderscher2@etu.univ-lorraine.fr> Date: Tue, 3 Mar 2020 21:47:59 +0100 Subject: [PATCH] ajout de la rpeparation de la seance 2 --- prepseance2/composer.json | 13 + prepseance2/composer.lock | 686 +++++++++++++++++++++++++++ prepseance2/index.php | 21 + prepseance2/src/models/annonce.php | 19 + prepseance2/src/models/categorie.php | 15 + prepseance2/src/models/photo.php | 14 + 6 files changed, 768 insertions(+) create mode 100644 prepseance2/composer.json create mode 100644 prepseance2/composer.lock create mode 100644 prepseance2/index.php create mode 100644 prepseance2/src/models/annonce.php create mode 100644 prepseance2/src/models/categorie.php create mode 100644 prepseance2/src/models/photo.php diff --git a/prepseance2/composer.json b/prepseance2/composer.json new file mode 100644 index 0000000..42be63c --- /dev/null +++ b/prepseance2/composer.json @@ -0,0 +1,13 @@ +{ + "require":{ + "illuminate/database": "5.5.*", + "php": ">=7.0" + + }, + + "autoload":{ + "psr-4": { + "prep\\" : "src/" + } + } +} diff --git a/prepseance2/composer.lock b/prepseance2/composer.lock new file mode 100644 index 0000000..c5c6058 --- /dev/null +++ b/prepseance2/composer.lock @@ -0,0 +1,686 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "f3df5191784ad7db53f1bdc559097748", + "packages": [ + { + "name": "doctrine/inflector", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2019-10-30T19:59:35+00:00" + }, + { + "name": "illuminate/container", + "version": "v5.5.44", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "7917f4c86ecf7f4d0efcfd83248ad3e301e08858" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/7917f4c86ecf7f4d0efcfd83248ad3e301e08858", + "reference": "7917f4c86ecf7f4d0efcfd83248ad3e301e08858", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.5.*", + "php": ">=7.0", + "psr/container": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.5-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "https://laravel.com", + "time": "2018-01-19T17:58:33+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v5.5.44", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "b2a62b4a85485fca9cf5fa61a933ad64006ff528" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/b2a62b4a85485fca9cf5fa61a933ad64006ff528", + "reference": "b2a62b4a85485fca9cf5fa61a933ad64006ff528", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "psr/container": "~1.0", + "psr/simple-cache": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.5-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "time": "2018-03-20T15:34:35+00:00" + }, + { + "name": "illuminate/database", + "version": "v5.5.44", + "source": { + "type": "git", + "url": "https://github.com/illuminate/database.git", + "reference": "f5403b3dd774eb89ff0ef5e633e57458c3dc537d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/database/zipball/f5403b3dd774eb89ff0ef5e633e57458c3dc537d", + "reference": "f5403b3dd774eb89ff0ef5e633e57458c3dc537d", + "shasum": "" + }, + "require": { + "illuminate/container": "5.5.*", + "illuminate/contracts": "5.5.*", + "illuminate/support": "5.5.*", + "php": ">=7.0" + }, + "suggest": { + "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", + "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", + "illuminate/console": "Required to use the database commands (5.5.*).", + "illuminate/events": "Required to use the observers with Eloquent (5.5.*).", + "illuminate/filesystem": "Required to use the migrations (5.5.*).", + "illuminate/pagination": "Required to paginate the result set (5.5.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.5-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Database\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Database package.", + "homepage": "https://laravel.com", + "keywords": [ + "database", + "laravel", + "orm", + "sql" + ], + "time": "2018-09-23T18:58:54+00:00" + }, + { + "name": "illuminate/support", + "version": "v5.5.44", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "5c405512d75dcaf5d37791badce02d86ed8e4bc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/5c405512d75dcaf5d37791badce02d86ed8e4bc4", + "reference": "5c405512d75dcaf5d37791badce02d86ed8e4bc4", + "shasum": "" + }, + "require": { + "doctrine/inflector": "~1.1", + "ext-mbstring": "*", + "illuminate/contracts": "5.5.*", + "nesbot/carbon": "^1.24.1", + "php": ">=7.0" + }, + "replace": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (5.5.*).", + "symfony/process": "Required to use the composer class (~3.3).", + "symfony/var-dumper": "Required to use the dd function (~3.3)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.5-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "time": "2018-08-10T19:40:01+00:00" + }, + { + "name": "kylekatarnls/update-helper", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/kylekatarnls/update-helper.git", + "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e", + "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0.0", + "php": ">=5.3.0" + }, + "require-dev": { + "codeclimate/php-test-reporter": "dev-master", + "composer/composer": "2.0.x-dev || ^2.0.0-dev", + "phpunit/phpunit": ">=4.8.35 <6.0" + }, + "type": "composer-plugin", + "extra": { + "class": "UpdateHelper\\ComposerPlugin" + }, + "autoload": { + "psr-0": { + "UpdateHelper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Update helper", + "time": "2019-07-29T11:03:54+00:00" + }, + { + "name": "nesbot/carbon", + "version": "1.39.1", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4be0c005164249208ce1b5ca633cd57bdd42ff33", + "reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33", + "shasum": "" + }, + "require": { + "kylekatarnls/update-helper": "^1.1", + "php": ">=5.3.9", + "symfony/translation": "~2.6 || ~3.0 || ~4.0" + }, + "require-dev": { + "composer/composer": "^1.2", + "friendsofphp/php-cs-fixer": "~2", + "phpunit/phpunit": "^4.8.35 || ^5.7" + }, + "bin": [ + "bin/upgrade-carbon" + ], + "type": "library", + "extra": { + "update-helper": "Carbon\\Upgrade", + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + } + ], + "description": "A simple API extension for DateTime.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "time": "2019-10-14T05:51:36+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/translation", + "version": "v4.4.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "0a19a77fba20818a969ef03fdaf1602de0546353" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/0a19a77fba20818a969ef03fdaf1602de0546353", + "reference": "0a19a77fba20818a969ef03fdaf1602de0546353", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^1.1.6|^2" + }, + "conflict": { + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<4.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "symfony/translation-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/finder": "~2.8|~3.0|~4.0|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/intl": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "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 Translation Component", + "homepage": "https://symfony.com", + "time": "2020-02-04T09:32:40+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed", + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.0" + }, + "platform-dev": [] +} diff --git a/prepseance2/index.php b/prepseance2/index.php new file mode 100644 index 0000000..ea85a6c --- /dev/null +++ b/prepseance2/index.php @@ -0,0 +1,21 @@ +<?php +require 'vendor/autoload.php'; +use Illuminate\Database\Capsule\Manager as DB; +use prep\models\annonce; +use prep\models\photo; +use prep\models\categorie; +$db = new DB(); + + + +$un = photo::where('ida', '=', 22)->get(); + +$deux = photo::where('ida', '=', 22)->where('taille_octet', '>', 100000)->get(); + +$quatre = annonce::photo()->where('taille_octet', '>', 100000)->get(); + +$ajoutphoto = new photo; +$ajoutphoto->file='test'; +$ajoutphoto->date=date('Y/m/d'); +$ajoutphoto->taille_octet=1000000; +$ajoutphoto->save(); diff --git a/prepseance2/src/models/annonce.php b/prepseance2/src/models/annonce.php new file mode 100644 index 0000000..921095d --- /dev/null +++ b/prepseance2/src/models/annonce.php @@ -0,0 +1,19 @@ +<?php + +namespace prep\models; + +class annonce extends \Illuminate\Database\Eloquent\Model { + protected $table = 'annonce'; + protected $primaryKey = 'id'; + public $timestamps = false; + + public function categorie(){ + $s = 'id_cat'; + return $this->belongsToMany('\mywishlist\models\categorie', $s); + } + + public function photo(){ + $s = 'idannonce'; + return $this->hasmany('\mywishlist\models\photo', $s); + } +} diff --git a/prepseance2/src/models/categorie.php b/prepseance2/src/models/categorie.php new file mode 100644 index 0000000..98d05c4 --- /dev/null +++ b/prepseance2/src/models/categorie.php @@ -0,0 +1,15 @@ +<?php + +namespace prep\models; + +class categorie extends \Illuminate\Database\Eloquent\Model { + protected $table = 'categorie'; + protected $primaryKey = 'id'; + public $timestamps = false; + + public function annonce(){ + $s = 'id_cat'; + return $this->hasmany('\mywishlist\models\photo', $s); + } + +} diff --git a/prepseance2/src/models/photo.php b/prepseance2/src/models/photo.php new file mode 100644 index 0000000..ec66db7 --- /dev/null +++ b/prepseance2/src/models/photo.php @@ -0,0 +1,14 @@ +<?php + +namespace prep\models; + +class photo extends \Illuminate\Database\Eloquent\Model { + protected $table = 'annonce'; + protected $primaryKey = 'id'; + public $timestamps = false; + + public function categorie(){ + $s = 'idannonce'; + return $this->belongsTo('\mywishlist\models\annonce', $s); + } +} -- GitLab