Commit f132ef17 authored by Tondon César's avatar Tondon César
Browse files

PAUL j'arrive pas les links de la pagination

parent 183568ec
{
"require":{
"illuminate/database": "5.5.*",
"php": ">=7.3",
"illuminate/database": "7.1.*",
"illuminate/pagination": "7.1.*",
"illuminate/contracts": "7.0",
"illuminate/support": "7.0",
"php": ">=7.2.5",
"slim/slim": "2.*"
},
......@@ -12,4 +15,4 @@
}
}
}
\ No newline at end of file
This diff is collapsed.
driver=mysql
username=root
password=
password=root
host=localhost
database=applibd
\ No newline at end of file
database=gamepedia
\ No newline at end of file
......@@ -2,7 +2,7 @@
require 'vendor/autoload.php';
use seance\modele\Game;
use seance\controller\IndexController;
use seance\controller\IndexController;
use Illuminate\Database\Capsule\Manager as DB;
$file = parse_ini_file('conf.ini');
......@@ -12,9 +12,9 @@ $db->setAsGlobal();
$db->bootEloquent();
$app = new \Slim\Slim();
$app->get('/', function(){
echo "page index";
IndexController::index();
})->name('testIndex');
$app->get('/api/games/:id', function($id){
......
......@@ -5,6 +5,10 @@ namespace seance\controller;
use seance\modele\Game;
use seance\view\VuePartie1;
use seance\view\VuePartie2;
use seance\view\CQuestion2;
use App\Http\Controllers\Controller;
use Illuminate\Database\Capsule\Manager as DB;
use Illuminate\Pagination\Paginator;
class IndexController
{
......@@ -27,23 +31,20 @@ class IndexController
$json = $json . json_encode($value) . ',},"links" :{"self": {"href":"/api/games/'.$value->id.'"}}';
}
$json = $json . ']}';
$cq2 = new CQuestion2($json);
$cq2 = new VuePartie2($json);
$cq2->render();
/*
$game = Game::select('id','name','alias','deck')->where('id','<=','200')->get();
// $game = Game::where('id','=',1)->get();
// $json = json_encode($game,JSON_FORCE_OBJECT);
foreach($game as $key => $value) {
<<<<<<< HEAD
$json = $json . json_encode($value) . ',';
/*$json = $json . '{
"id": ' . $value->id . ',
"name":' . $value->name . ',
"deck":' . $value->deck . ',
},
';*/
if ($value->id == 200) {
$json = $json . json_encode($value);/*
';*//*
$json = $json . '{
"id": ' . $value->id . ',
"name":' . $value->name . ',
......@@ -53,13 +54,12 @@ class IndexController
}
}
$json = $json . ']}';
=======
$value->description = "...";
}
$json = json_encode($game);
>>>>>>> e2c791070c5330916f63fb55c2b639a71a327bcb
$cq2 = new VuePartie2($json);
$cq2->render();*/
}
public static function partie5($id){
......@@ -80,4 +80,19 @@ class IndexController
$vue->render();
}
public static function index() {
$file = parse_ini_file('conf.ini');
$db = new DB();
$db->addConnection($file);
$db->setAsGlobal();
$db->bootEloquent();
$users = $db::table('game')->paginate(200);
$json = '';
foreach($users as $value) {
$json = $json . $value->id . "<br>";
}
$vue = new VuePartie2(json_encode($json));
$vue->render();
}
}
\ No newline at end of file
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit2418a93e3afa2d154375a669cfc71918::getLoader();
return ComposerAutoloaderInit71c0403305ebd7f6d322793c9b46446c::getLoader();
#!/usr/bin/env sh
dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../nesbot/carbon/bin" && pwd)
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
"${dir}/upgrade-carbon" "$@"
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../nesbot/carbon/bin/upgrade-carbon
php "%BIN_TARGET%" %*
......@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
);
......@@ -7,5 +7,6 @@ $baseDir = dirname($vendorDir);
return array(
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php',
);
......@@ -6,6 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'UpdateHelper\\' => array($vendorDir . '/kylekatarnls/update-helper/src'),
'Slim' => array($vendorDir . '/slim/slim'),
);
......@@ -6,16 +6,22 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'voku\\tests\\' => array($vendorDir . '/voku/portable-ascii/tests'),
'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'),
'seance\\' => array($baseDir . '/src'),
'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'),
'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'Illuminate\\Support\\' => array($vendorDir . '/illuminate/support'),
'Illuminate\\Pagination\\' => array($vendorDir . '/illuminate/pagination'),
'Illuminate\\Database\\' => array($vendorDir . '/illuminate/database'),
'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'),
'Illuminate\\Container\\' => array($vendorDir . '/illuminate/container'),
'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'),
'' => array($vendorDir . '/nesbot/carbon/src'),
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
);
......@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit2418a93e3afa2d154375a669cfc71918
class ComposerAutoloaderInit71c0403305ebd7f6d322793c9b46446c
{
private static $loader;
......@@ -19,15 +19,15 @@ class ComposerAutoloaderInit2418a93e3afa2d154375a669cfc71918
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit2418a93e3afa2d154375a669cfc71918', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit71c0403305ebd7f6d322793c9b46446c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit2418a93e3afa2d154375a669cfc71918', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit71c0403305ebd7f6d322793c9b46446c', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit2418a93e3afa2d154375a669cfc71918::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit71c0403305ebd7f6d322793c9b46446c::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
......@@ -48,19 +48,19 @@ class ComposerAutoloaderInit2418a93e3afa2d154375a669cfc71918
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit2418a93e3afa2d154375a669cfc71918::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit71c0403305ebd7f6d322793c9b46446c::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire2418a93e3afa2d154375a669cfc71918($fileIdentifier, $file);
composerRequire71c0403305ebd7f6d322793c9b46446c($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire2418a93e3afa2d154375a669cfc71918($fileIdentifier, $file)
function composerRequire71c0403305ebd7f6d322793c9b46446c($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
......
......@@ -4,23 +4,32 @@
namespace Composer\Autoload;
class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
class ComposerStaticInit71c0403305ebd7f6d322793c9b46446c
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php',
);
public static $prefixLengthsPsr4 = array (
'v' =>
array (
'voku\\tests\\' => 11,
'voku\\' => 5,
),
's' =>
array (
'seance\\' => 7,
),
'S' =>
array (
'Symfony\\Polyfill\\Php73\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Contracts\\Translation\\' => 30,
'Symfony\\Contracts\\Service\\' => 26,
'Symfony\\Component\\Translation\\' => 30,
'Symfony\\Component\\Console\\' => 26,
),
'P' =>
array (
......@@ -30,6 +39,7 @@ class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
'I' =>
array (
'Illuminate\\Support\\' => 19,
'Illuminate\\Pagination\\' => 22,
'Illuminate\\Database\\' => 20,
'Illuminate\\Contracts\\' => 21,
'Illuminate\\Container\\' => 21,
......@@ -38,13 +48,29 @@ class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
array (
'Doctrine\\Common\\Inflector\\' => 26,
),
'C' =>
array (
'Carbon\\' => 7,
),
);
public static $prefixDirsPsr4 = array (
'voku\\tests\\' =>
array (
0 => __DIR__ . '/..' . '/voku/portable-ascii/tests',
),
'voku\\' =>
array (
0 => __DIR__ . '/..' . '/voku/portable-ascii/src/voku',
),
'seance\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
'Symfony\\Polyfill\\Php73\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
......@@ -53,10 +79,18 @@ class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
array (
0 => __DIR__ . '/..' . '/symfony/translation-contracts',
),
'Symfony\\Contracts\\Service\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/service-contracts',
),
'Symfony\\Component\\Translation\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/translation',
),
'Symfony\\Component\\Console\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/console',
),
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
......@@ -69,6 +103,10 @@ class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
array (
0 => __DIR__ . '/..' . '/illuminate/support',
),
'Illuminate\\Pagination\\' =>
array (
0 => __DIR__ . '/..' . '/illuminate/pagination',
),
'Illuminate\\Database\\' =>
array (
0 => __DIR__ . '/..' . '/illuminate/database',
......@@ -85,20 +123,13 @@ class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
array (
0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector',
),
);
public static $fallbackDirsPsr4 = array (
0 => __DIR__ . '/..' . '/nesbot/carbon/src',
'Carbon\\' =>
array (
0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon',
),
);
public static $prefixesPsr0 = array (
'U' =>
array (
'UpdateHelper\\' =>
array (
0 => __DIR__ . '/..' . '/kylekatarnls/update-helper/src',
),
),
'S' =>
array (
'Slim' =>
......@@ -108,13 +139,17 @@ class ComposerStaticInit2418a93e3afa2d154375a669cfc71918
),
);
public static $classMap = array (
'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit2418a93e3afa2d154375a669cfc71918::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit2418a93e3afa2d154375a669cfc71918::$prefixDirsPsr4;
$loader->fallbackDirsPsr4 = ComposerStaticInit2418a93e3afa2d154375a669cfc71918::$fallbackDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit2418a93e3afa2d154375a669cfc71918::$prefixesPsr0;
$loader->prefixLengthsPsr4 = ComposerStaticInit71c0403305ebd7f6d322793c9b46446c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit71c0403305ebd7f6d322793c9b46446c::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInit71c0403305ebd7f6d322793c9b46446c::$prefixesPsr0;
$loader->classMap = ComposerStaticInit71c0403305ebd7f6d322793c9b46446c::$classMap;
}, null, ClassLoader::class);
}
......
......@@ -3,9 +3,9 @@
namespace Illuminate\Container;
use Closure;
use ReflectionMethod;
use ReflectionFunction;
use InvalidArgumentException;
use ReflectionFunction;
use ReflectionMethod;
class BoundMethod
{
......@@ -17,6 +17,9 @@ class BoundMethod
* @param array $parameters
* @param string|null $defaultMethod
* @return mixed
*
* @throws \ReflectionException
* @throws \InvalidArgumentException
*/
public static function call($container, $callback, array $parameters = [], $defaultMethod = null)
{
......@@ -49,7 +52,7 @@ class BoundMethod
// We will assume an @ sign is used to delimit the class name from the method
// name. We will split on this @ sign and then build a callable array that
// we can pass right back into the "call" method for dependency binding.
$method = count($segments) == 2
$method = count($segments) === 2
? $segments[1] : $defaultMethod;
if (is_null($method)) {
......@@ -72,7 +75,7 @@ class BoundMethod
protected static function callBoundMethod($container, $callback, $default)
{
if (! is_array($callback)) {
return $default instanceof Closure ? $default() : $default;
return Util::unwrapIfClosure($default);
}
// Here we need to turn the array callable into a Class@method string we can use to
......@@ -84,7 +87,7 @@ class BoundMethod
return $container->callMethodBinding($method, $callback[0]);
}
return $default instanceof Closure ? $default() : $default;
return Util::unwrapIfClosure($default);
}
/**
......@@ -107,6 +110,8 @@ class BoundMethod
* @param callable|string $callback
* @param array $parameters
* @return array
*
* @throws \ReflectionException
*/
protected static function getMethodDependencies($container, $callback, array $parameters = [])
{
......@@ -124,11 +129,15 @@ class BoundMethod
*
* @param callable|string $callback
* @return \ReflectionFunctionAbstract
*
* @throws \ReflectionException
*/
protected static function getCallReflector($callback)
{
if (is_string($callback) && strpos($callback, '::') !== false) {
$callback = explode('::', $callback);
} elseif (is_object($callback) && ! $callback instanceof Closure) {
$callback = [$callback, '__invoke'];
}
return is_array($callback)
......@@ -143,7 +152,7 @@ class BoundMethod
* @param \ReflectionParameter $parameter
* @param array $parameters
* @param array $dependencies
* @return mixed
* @return void
*/
protected static function addDependencyForCallParameter($container, $parameter,
array &$parameters, &$dependencies)
......@@ -152,6 +161,10 @@ class BoundMethod
$dependencies[] = $parameters[$parameter->name];
unset($parameters[$parameter->name]);
} elseif ($parameter->getClass() && array_key_exists($parameter->getClass()->name, $parameters)) {
$dependencies[] = $parameters[$parameter->getClass()->name];
unset($parameters[$parameter->getClass()->name]);
} elseif ($parameter->getClass()) {
$dependencies[] = $container->make($parameter->getClass()->name);
} elseif ($parameter->isDefaultValueAvailable()) {
......
......@@ -2,13 +2,15 @@
namespace Illuminate\Container;
use Closure;
use ArrayAccess;
use Closure;
use Exception;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Container\Container as ContainerContract;
use LogicException;
use ReflectionClass;
use ReflectionException;
use ReflectionParameter;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Container\Container as ContainerContract;
class Container implements ArrayAccess, ContainerContract
{
......@@ -22,124 +24,130 @@ class Container implements ArrayAccess, ContainerContract
/**
* An array of the types that have been resolved.
*
* @var array
* @var bool[]
*/
protected $resolved = [];
/**
* The container's bindings.
*
* @var array
* @var array[]
*/
protected $bindings = [];
/**
* The container's method bindings.
*
* @var array
* @var \Closure[]
*/
protected $methodBindings = [];
/**
* The container's shared instances.
*
* @var array
* @var object[]
*/
protected $instances = [];
/**
* The registered type aliases.
*
* @var array
* @var string[]
*/
protected $aliases = [];
/**
* The registered aliases keyed by the abstract name.
*
* @var array
* @var array[]
*/
protected $abstractAliases = [];
/**
* The extension closures for services.
*
* @var array
* @var array[]
*/
protected $extenders = [];
/**
* All of the registered tags.
*
* @var array
* @var array[]
*/
protected $tags = [];
/**
* The stack of concretions currently being built.
*
* @var array
* @var array[]
*/
protected $buildStack = [];
/**
* The parameter override stack.
*
* @var array
* @var array[]
*/
protected $with = [];
/**
* The contextual binding map.
*
* @var array
* @var array[]
*/
public $contextual = [];
/**
* All of the registered rebound callbacks.
*
* @var array
* @var array[]
*/
protected $reboundCallbacks = [];