diff --git a/.gitignore b/.gitignore index 6ab4777..3f96fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,7 @@ /fuel/app/config/crypt.php /fuel/app/config/lock.php +/packages +/vendor /.idea composer.lock diff --git a/composer.json b/composer.json index 4e11b3d..3424f80 100755 --- a/composer.json +++ b/composer.json @@ -7,16 +7,16 @@ "require": { "php": ">=5.6.33", "composer/installers": "~1.0", - "fuel/core": "1.8.*", + "fuel/core": "dev-1.9/develop", "fuel/auth": "1.8.*", "fuel/email": "1.8.*", "fuel/oil": "1.8.*", "fuel/orm": "1.8.*", "fuel/parser": "1.8.*", "fuelphp/upload": "2.0.6", - "monolog/monolog": "1.5.*", + "monolog/monolog": "^1.18", "phpseclib/phpseclib": "2.0.0", - "michelf/php-markdown": "1.4.0" + "michelf/php-markdown": "1.7.0" }, "require-dev": { "fuel/docs": "1.8.*" diff --git a/composer.lock b/composer.lock index 3393c20..d5d614d 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "85fd9d3cc030402a776db7f7553ced3f", + "content-hash": "713a477574f3f25e70b70b9ca0973c72", "packages": [ { "name": "composer/installers", @@ -162,20 +162,24 @@ }, { "name": "fuel/core", - "version": "1.8.0.3", + "version": "dev-1.9/develop", "source": { "type": "git", "url": "https://github.com/fuel/core.git", - "reference": "c8e190b22cb9fc1a9acfdde4ed7487e04051bbe7" + "reference": "639d766486ed90bcb6fd1e737a9374ee7345daa9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fuel/core/zipball/c8e190b22cb9fc1a9acfdde4ed7487e04051bbe7", - "reference": "c8e190b22cb9fc1a9acfdde4ed7487e04051bbe7", + "url": "https://api.github.com/repos/fuel/core/zipball/639d766486ed90bcb6fd1e737a9374ee7345daa9", + "reference": "639d766486ed90bcb6fd1e737a9374ee7345daa9", "shasum": "" }, "require": { - "composer/installers": "~1.0" + "composer/installers": "~1.0", + "michelf/php-markdown": "1.7.0", + "monolog/monolog": "^1.18", + "paragonie/sodium_compat": "^1.6", + "phpseclib/phpseclib": "^2.0.0" }, "type": "fuel-package", "notification-url": "https://packagist.org/downloads/", @@ -190,7 +194,7 @@ ], "description": "FuelPHP 1.x Core", "homepage": "https://github.com/fuel/core", - "time": "2016-07-21T08:45:05+00:00" + "time": "2019-08-29T21:10:06+00:00" }, { "name": "fuel/email", @@ -372,16 +376,16 @@ }, { "name": "michelf/php-markdown", - "version": "1.4.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/michelf/php-markdown.git", - "reference": "96d8150406f67e683ef4acc09fef91785fef1266" + "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/96d8150406f67e683ef4acc09fef91785fef1266", - "reference": "96d8150406f67e683ef4acc09fef91785fef1266", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/1f51cc520948f66cd2af8cbc45a5ee175e774220", + "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220", "shasum": "" }, "require": { @@ -405,61 +409,78 @@ "authors": [ { "name": "Michel Fortin", + "role": "Developer", "email": "michel.fortin@michelf.ca", - "homepage": "http://michelf.ca/", - "role": "Developer" + "homepage": "https://michelf.ca/" }, { "name": "John Gruber", - "homepage": "http://daringfireball.net/" + "homepage": "https://daringfireball.net/" } ], "description": "PHP Markdown", - "homepage": "http://michelf.ca/projects/php-markdown/", + "homepage": "https://michelf.ca/projects/php-markdown/", "keywords": [ "markdown" ], - "time": "2013-11-29T17:09:24+00:00" + "time": "2016-10-29T18:58:20+00:00" }, { "name": "monolog/monolog", - "version": "1.5.0", + "version": "1.24.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "583618d5cd2115a52101694aca87afb182b3e567" + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/583618d5cd2115a52101694aca87afb182b3e567", - "reference": "583618d5cd2115a52101694aca87afb182b3e567", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", "shasum": "" }, "require": { "php": ">=5.3.0", "psr/log": "~1.0" }, + "provide": { + "psr/log-implementation": "1.0.0" + }, "require-dev": { - "doctrine/couchdb": "dev-master", - "mlehner/gelf-php": "1.0.*", - "raven/raven": "0.3.*" + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "graylog2/gelf-php": "~1.0", + "jakub-onderka/php-parallel-lint": "0.9", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpunit/phpunit": "~4.5", + "phpunit/phpunit-mock-objects": "2.3.0", + "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", + "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", "doctrine/couchdb": "Allow sending log messages to a CouchDB server", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", "ext-mongo": "Allow sending log messages to a MongoDB server", - "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server", - "raven/raven": "Allow sending log messages to a Sentry server" + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-0": { - "Monolog": "src/" + "psr-4": { + "Monolog\\": "src/Monolog" } }, "notification-url": "https://packagist.org/downloads/", @@ -470,8 +491,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" + "homepage": "http://seld.be" } ], "description": "Sends your logs to files, sockets, inboxes, databases and various web services", @@ -481,7 +501,134 @@ "logging", "psr-3" ], - "time": "2013-04-23T10:09:48+00:00" + "time": "2018-11-05T09:00:11+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, + { + "name": "paragonie/sodium_compat", + "version": "v1.10.1", + "source": { + "type": "git", + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "5115fa44886d1c2785d2f135ef4626db868eac4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/5115fa44886d1c2785d2f135ef4626db868eac4b", + "reference": "5115fa44886d1c2785d2f135ef4626db868eac4b", + "shasum": "" + }, + "require": { + "paragonie/random_compat": ">=1", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" + ], + "time": "2019-07-12T16:36:59+00:00" }, { "name": "phpseclib/phpseclib", @@ -529,23 +676,23 @@ "authors": [ { "name": "Jim Wigginton", - "email": "terrafrost@php.net", - "role": "Lead Developer" + "role": "Lead Developer", + "email": "terrafrost@php.net" }, { "name": "Patrick Monnerat", - "email": "pm@datasphere.ch", - "role": "Developer" + "role": "Developer", + "email": "pm@datasphere.ch" }, { "name": "Andreas Fischer", - "email": "bantu@phpbb.com", - "role": "Developer" + "role": "Developer", + "email": "bantu@phpbb.com" }, { "name": "Hans-Jürgen Petrich", - "email": "petrich@tronic-media.com", - "role": "Developer" + "role": "Developer", + "email": "petrich@tronic-media.com" } ], "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", @@ -655,7 +802,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "fuel/core": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/composer.phar b/composer.phar index 96fa2df..863dc9a 100755 Binary files a/composer.phar and b/composer.phar differ diff --git a/fuel/app/classes/controller/index.php b/fuel/app/classes/controller/index.php deleted file mode 100644 index 7a0a570..0000000 --- a/fuel/app/classes/controller/index.php +++ /dev/null @@ -1,23 +0,0 @@ - isset($MenuServer) ? $MenuServer : null, 'js_bottom' => isset($js_bottom) ? $js_bottom : null, ]); ?> - \ No newline at end of file + diff --git a/public/index.php b/public/index.php index 3dc3887..3e79a5a 100755 --- a/public/index.php +++ b/public/index.php @@ -1,127 +1,226 @@ translation : Config::get('routes.'.$route); - - if ($route instanceof Closure) - { - $response = $route(); - - if( ! $response instanceof Response) - { - $response = Response::forge($response); - } - } - elseif ($e === false) - { - $response = Request::forge()->execute()->response(); - } - elseif ($route) - { - $response = Request::forge($route, false)->execute(array($e))->response(); - } - else - { - throw $e; - } - - return $response; + Request::reset_request(true); + + $route = array_key_exists($request, Router::$routes) ? Router::$routes[$request]->translation : Config::get('routes.'.$request); + + if ($route instanceof Closure) + { + $response = $route(); + + if( ! $response instanceof Response) + { + $response = Response::forge($response); + } + } + elseif ($e === false) + { + $response = Request::forge()->execute()->response(); + } + elseif ($route) + { + $response = Request::forge($route, false)->execute(array($e))->response(); + } + elseif ($request) + { + $response = Request::forge($request)->execute(array($e))->response(); + } + else + { + throw $e; + } + + return $response; }; -// Generate the request, execute it and send the output. +/** + * ----------------------------------------------------------------------------- + * Starting the Application + * ----------------------------------------------------------------------------- + */ + +/** + * ----------------------------------------------------------------------------- + * Start the engine + * ----------------------------------------------------------------------------- + * + * Generate the request, execute it and send the output + * + */ + try { - // Boot the app... - require APPPATH.'bootstrap.php'; + // Boot the app... + require APPPATH.'bootstrap.php'; - // ... and execute the main request - $response = $routerequest(); + // ... and execute the main request + $response = $routerequest(); } catch (HttpBadRequestException $e) { - $response = $routerequest('_400_', $e); + $response = $routerequest('_400_', $e); } catch (HttpNoAccessException $e) { - $response = $routerequest('_403_', $e); + $response = $routerequest('_403_', $e); } catch (HttpNotFoundException $e) { - $response = $routerequest('_404_', $e); + $response = $routerequest('_404_', $e); } catch (HttpServerErrorException $e) { - $response = $routerequest('_500_', $e); + $response = $routerequest('_500_', $e); } -// This will add the execution time and memory usage to the output. -// Comment this out if you don't use it. $response->body((string) $response); + +/** + * ----------------------------------------------------------------------------- + * Start profiling + * ----------------------------------------------------------------------------- + * + * This will add the execution time and memory usage to the output. + * + * Comment these out if you don't use it. + * + */ + if (strpos($response->body(), '{exec_time}') !== false or strpos($response->body(), '{mem_usage}') !== false) { - $bm = Profiler::app_total(); - $response->body( - str_replace( - array('{exec_time}', '{mem_usage}'), - array(round($bm[0], 4), round($bm[1] / pow(1024, 2), 3)), - $response->body() - ) - ); + $bm = Profiler::app_total(); + + $response->body( + str_replace( + array('{exec_time}', '{mem_usage}'), + array(round($bm[0], 4), round($bm[1] / pow(1024, 2), 3)), + $response->body() + ) + ); } -// Send the output to the client -$response->send(true); +/** + * ----------------------------------------------------------------------------- + * Show the web page + * ----------------------------------------------------------------------------- + * + * Send the output to the client + * + */ + +$response->send(true); \ No newline at end of file