mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
parent
5ddade85a5
commit
537b53859f
@ -19,7 +19,8 @@ class Kernel extends ConsoleKernel
|
|||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function schedule(Schedule $schedule)
|
protected function schedule(Schedule $schedule)
|
||||||
|
@ -29,7 +29,8 @@ class Handler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* Report or log an exception.
|
||||||
*
|
*
|
||||||
* @param \Exception $exception
|
* @param \Exception $exception
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function report(Exception $exception)
|
public function report(Exception $exception)
|
||||||
@ -40,8 +41,9 @@ class Handler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* Render an exception into an HTTP response.
|
* Render an exception into an HTTP response.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Exception $exception
|
* @param \Exception $exception
|
||||||
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function render($request, Exception $exception)
|
public function render($request, Exception $exception)
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Auth;
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
use App\User;
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\User;
|
||||||
|
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
|
||||||
|
|
||||||
class RegisterController extends Controller
|
class RegisterController extends Controller
|
||||||
{
|
{
|
||||||
@ -43,14 +43,15 @@ class RegisterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Get a validator for an incoming registration request.
|
* Get a validator for an incoming registration request.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
*
|
||||||
* @return \Illuminate\Contracts\Validation\Validator
|
* @return \Illuminate\Contracts\Validation\Validator
|
||||||
*/
|
*/
|
||||||
protected function validator(array $data)
|
protected function validator(array $data)
|
||||||
{
|
{
|
||||||
return Validator::make($data, [
|
return Validator::make($data, [
|
||||||
'name' => 'required|string|max:255',
|
'name' => 'required|string|max:255',
|
||||||
'email' => 'required|string|email|max:255|unique:users',
|
'email' => 'required|string|email|max:255|unique:users',
|
||||||
'password' => 'required|string|min:6|confirmed',
|
'password' => 'required|string|min:6|confirmed',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -58,14 +59,15 @@ class RegisterController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create a new user instance after a valid registration.
|
* Create a new user instance after a valid registration.
|
||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
|
*
|
||||||
* @return \App\User
|
* @return \App\User
|
||||||
*/
|
*/
|
||||||
protected function create(array $data)
|
protected function create(array $data)
|
||||||
{
|
{
|
||||||
return User::create([
|
return User::create([
|
||||||
'name' => $data['name'],
|
'name' => $data['name'],
|
||||||
'email' => $data['email'],
|
'email' => $data['email'],
|
||||||
'password' => Hash::make($data['password']),
|
'password' => Hash::make($data['password']),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
|
||||||
use Illuminate\Routing\Controller as BaseController;
|
|
||||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
|
||||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||||
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||||
|
use Illuminate\Routing\Controller as BaseController;
|
||||||
|
|
||||||
class Controller extends BaseController
|
class Controller extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -51,15 +51,15 @@ class Kernel extends HttpKernel
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $routeMiddleware = [
|
protected $routeMiddleware = [
|
||||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,8 @@ class Authenticate extends Middleware
|
|||||||
/**
|
/**
|
||||||
* Get the path the user should be redirected to when they are not authenticated.
|
* Get the path the user should be redirected to when they are not authenticated.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function redirectTo($request)
|
protected function redirectTo($request)
|
||||||
|
@ -10,9 +10,10 @@ class RedirectIfAuthenticated
|
|||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
* @param \Closure $next
|
||||||
* @param string|null $guard
|
* @param string|null $guard
|
||||||
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next, $guard = null)
|
public function handle($request, Closure $next, $guard = null)
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Fideloper\Proxy\TrustProxies as Middleware;
|
use Fideloper\Proxy\TrustProxies as Middleware;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class TrustProxies extends Middleware
|
class TrustProxies extends Middleware
|
||||||
{
|
{
|
||||||
|
@ -3,16 +3,15 @@
|
|||||||
namespace App\Models\Traits;
|
namespace App\Models\Traits;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CalculatesInvoiceTotals
|
* Class CalculatesInvoiceTotals.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class CalculatesInvoiceTotals
|
class CalculatesInvoiceTotals
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $invoice;
|
protected $invoice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* InvoiceTotals constructor.
|
* InvoiceTotals constructor.
|
||||||
|
*
|
||||||
* @param $invoice
|
* @param $invoice
|
||||||
*/
|
*/
|
||||||
public function __construct($invoice)
|
public function __construct($invoice)
|
||||||
@ -20,16 +19,11 @@ class CalculatesInvoiceTotals
|
|||||||
$this->invoice = $invoice;
|
$this->invoice = $invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function calculate()
|
public function calculate()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function sumLineItems()
|
private function sumLineItems()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Gate;
|
|
||||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||||
|
|
||||||
class AuthServiceProvider extends ServiceProvider
|
class AuthServiceProvider extends ServiceProvider
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
use Illuminate\Support\Facades\Broadcast;
|
use Illuminate\Support\Facades\Broadcast;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class BroadcastServiceProvider extends ServiceProvider
|
class BroadcastServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Event;
|
|
||||||
use Illuminate\Auth\Events\Registered;
|
use Illuminate\Auth\Events\Registered;
|
||||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
|
use Illuminate\Support\Facades\Event;
|
||||||
|
|
||||||
class EventServiceProvider extends ServiceProvider
|
class EventServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
|
||||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
class RouteServiceProvider extends ServiceProvider
|
class RouteServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use Illuminate\Notifications\Notifiable;
|
|
||||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
|
@ -3,19 +3,18 @@
|
|||||||
namespace App\Utils;
|
namespace App\Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class NumberHelper
|
* Class NumberHelper.
|
||||||
* @package App\Utils
|
|
||||||
*/
|
*/
|
||||||
class NumberHelper
|
class NumberHelper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param float $value
|
* @param float $value
|
||||||
* @param int $precision
|
* @param int $precision
|
||||||
|
*
|
||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
public static function roundValue(float $value, int $precision = 2) : float
|
public static function roundValue(float $value, int $precision = 2) : float
|
||||||
{
|
{
|
||||||
return round($value, $precision, PHP_ROUND_HALF_UP);
|
return round($value, $precision, PHP_ROUND_HALF_UP);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
118
c3.php
118
c3.php
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// @codingStandardsIgnoreFile
|
// @codingStandardsIgnoreFile
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
/**
|
/**
|
||||||
* C3 - Codeception Code Coverage
|
* C3 - Codeception Code Coverage.
|
||||||
*
|
*
|
||||||
* @author tiger
|
* @author tiger
|
||||||
*/
|
*/
|
||||||
@ -16,7 +17,7 @@ if (isset($_COOKIE['CODECEPTION_CODECOVERAGE'])) {
|
|||||||
}
|
}
|
||||||
if ($cookie) {
|
if ($cookie) {
|
||||||
foreach ($cookie as $key => $value) {
|
foreach ($cookie as $key => $value) {
|
||||||
$_SERVER["HTTP_X_CODECEPTION_" . strtoupper($key)] = $value;
|
$_SERVER['HTTP_X_CODECEPTION_'.strtoupper($key)] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -28,14 +29,14 @@ if (!function_exists('__c3_error')) {
|
|||||||
{
|
{
|
||||||
$errorLogFile = defined('C3_CODECOVERAGE_ERROR_LOG_FILE') ?
|
$errorLogFile = defined('C3_CODECOVERAGE_ERROR_LOG_FILE') ?
|
||||||
C3_CODECOVERAGE_ERROR_LOG_FILE :
|
C3_CODECOVERAGE_ERROR_LOG_FILE :
|
||||||
C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt';
|
C3_CODECOVERAGE_MEDIATE_STORAGE.DIRECTORY_SEPARATOR.'error.txt';
|
||||||
if (is_writable($errorLogFile)) {
|
if (is_writable($errorLogFile)) {
|
||||||
file_put_contents($errorLogFile, $message);
|
file_put_contents($errorLogFile, $message);
|
||||||
} else {
|
} else {
|
||||||
$message = "Could not write error to log file ($errorLogFile), original message: $message";
|
$message = "Could not write error to log file ($errorLogFile), original message: $message";
|
||||||
}
|
}
|
||||||
if (!headers_sent()) {
|
if (!headers_sent()) {
|
||||||
header('X-Codeception-CodeCoverage-Error: ' . str_replace("\n", ' ', $message), true, 500);
|
header('X-Codeception-CodeCoverage-Error: '.str_replace("\n", ' ', $message), true, 500);
|
||||||
}
|
}
|
||||||
setcookie('CODECEPTION_CODECOVERAGE_ERROR', $message);
|
setcookie('CODECEPTION_CODECOVERAGE_ERROR', $message);
|
||||||
}
|
}
|
||||||
@ -57,13 +58,13 @@ if (!class_exists('PHPUnit_Runner_Version') && class_exists('PHPUnit\Runner\Vers
|
|||||||
}
|
}
|
||||||
// Autoload Codeception classes
|
// Autoload Codeception classes
|
||||||
if (!class_exists('\\Codeception\\Codecept')) {
|
if (!class_exists('\\Codeception\\Codecept')) {
|
||||||
if (file_exists(__DIR__ . '/codecept.phar')) {
|
if (file_exists(__DIR__.'/codecept.phar')) {
|
||||||
require_once 'phar://' . __DIR__ . '/codecept.phar/autoload.php';
|
require_once 'phar://'.__DIR__.'/codecept.phar/autoload.php';
|
||||||
} elseif (stream_resolve_include_path(__DIR__ . '/vendor/autoload.php')) {
|
} elseif (stream_resolve_include_path(__DIR__.'/vendor/autoload.php')) {
|
||||||
require_once __DIR__ . '/vendor/autoload.php';
|
require_once __DIR__.'/vendor/autoload.php';
|
||||||
// Required to load some methods only available at codeception/autoload.php
|
// Required to load some methods only available at codeception/autoload.php
|
||||||
if (stream_resolve_include_path(__DIR__ . '/vendor/codeception/codeception/autoload.php')) {
|
if (stream_resolve_include_path(__DIR__.'/vendor/codeception/codeception/autoload.php')) {
|
||||||
require_once __DIR__ . '/vendor/codeception/codeception/autoload.php';
|
require_once __DIR__.'/vendor/codeception/codeception/autoload.php';
|
||||||
}
|
}
|
||||||
} elseif (stream_resolve_include_path('Codeception/autoload.php')) {
|
} elseif (stream_resolve_include_path('Codeception/autoload.php')) {
|
||||||
require_once 'Codeception/autoload.php';
|
require_once 'Codeception/autoload.php';
|
||||||
@ -72,10 +73,10 @@ if (!class_exists('\\Codeception\\Codecept')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Load Codeception Config
|
// Load Codeception Config
|
||||||
$config_dist_file = realpath(__DIR__) . DIRECTORY_SEPARATOR . 'codeception.dist.yml';
|
$config_dist_file = realpath(__DIR__).DIRECTORY_SEPARATOR.'codeception.dist.yml';
|
||||||
$config_file = realpath(__DIR__) . DIRECTORY_SEPARATOR . 'codeception.yml';
|
$config_file = realpath(__DIR__).DIRECTORY_SEPARATOR.'codeception.yml';
|
||||||
if (isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'])) {
|
if (isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'])) {
|
||||||
$config_file = realpath(__DIR__) . DIRECTORY_SEPARATOR . $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'];
|
$config_file = realpath(__DIR__).DIRECTORY_SEPARATOR.$_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG'];
|
||||||
}
|
}
|
||||||
if (file_exists($config_file)) {
|
if (file_exists($config_file)) {
|
||||||
// Use codeception.yml for configuration.
|
// Use codeception.yml for configuration.
|
||||||
@ -85,6 +86,7 @@ if (file_exists($config_file)) {
|
|||||||
} else {
|
} else {
|
||||||
__c3_error(sprintf("Codeception config file '%s' not found", $config_file));
|
__c3_error(sprintf("Codeception config file '%s' not found", $config_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
\Codeception\Configuration::config($config_file);
|
\Codeception\Configuration::config($config_file);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -95,86 +97,92 @@ if (!defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) {
|
|||||||
gc_disable();
|
gc_disable();
|
||||||
$memoryLimit = ini_get('memory_limit');
|
$memoryLimit = ini_get('memory_limit');
|
||||||
$requiredMemory = '384M';
|
$requiredMemory = '384M';
|
||||||
if ((substr($memoryLimit, -1) === 'M' && (int)$memoryLimit < (int)$requiredMemory)
|
if ((substr($memoryLimit, -1) === 'M' && (int) $memoryLimit < (int) $requiredMemory)
|
||||||
|| (substr($memoryLimit, -1) === 'K' && (int)$memoryLimit < (int)$requiredMemory * 1024)
|
|| (substr($memoryLimit, -1) === 'K' && (int) $memoryLimit < (int) $requiredMemory * 1024)
|
||||||
|| (ctype_digit($memoryLimit) && (int)$memoryLimit < (int)$requiredMemory * 1024 * 1024)
|
|| (ctype_digit($memoryLimit) && (int) $memoryLimit < (int) $requiredMemory * 1024 * 1024)
|
||||||
) {
|
) {
|
||||||
ini_set('memory_limit', $requiredMemory);
|
ini_set('memory_limit', $requiredMemory);
|
||||||
}
|
}
|
||||||
define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::logDir() . 'c3tmp');
|
define('C3_CODECOVERAGE_MEDIATE_STORAGE', Codeception\Configuration::logDir().'c3tmp');
|
||||||
define('C3_CODECOVERAGE_PROJECT_ROOT', Codeception\Configuration::projectDir());
|
define('C3_CODECOVERAGE_PROJECT_ROOT', Codeception\Configuration::projectDir());
|
||||||
define('C3_CODECOVERAGE_TESTNAME', $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']);
|
define('C3_CODECOVERAGE_TESTNAME', $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE']);
|
||||||
function __c3_build_html_report(PHP_CodeCoverage $codeCoverage, $path)
|
function __c3_build_html_report(PHP_CodeCoverage $codeCoverage, $path)
|
||||||
{
|
{
|
||||||
$writer = new PHP_CodeCoverage_Report_HTML();
|
$writer = new PHP_CodeCoverage_Report_HTML();
|
||||||
$writer->process($codeCoverage, $path . 'html');
|
$writer->process($codeCoverage, $path.'html');
|
||||||
if (file_exists($path . '.tar')) {
|
if (file_exists($path.'.tar')) {
|
||||||
unlink($path . '.tar');
|
unlink($path.'.tar');
|
||||||
}
|
}
|
||||||
$phar = new PharData($path . '.tar');
|
$phar = new PharData($path.'.tar');
|
||||||
$phar->setSignatureAlgorithm(Phar::SHA1);
|
$phar->setSignatureAlgorithm(Phar::SHA1);
|
||||||
$files = $phar->buildFromDirectory($path . 'html');
|
$files = $phar->buildFromDirectory($path.'html');
|
||||||
array_map('unlink', $files);
|
array_map('unlink', $files);
|
||||||
if (in_array('GZ', Phar::getSupportedCompression())) {
|
if (in_array('GZ', Phar::getSupportedCompression())) {
|
||||||
if (file_exists($path . '.tar.gz')) {
|
if (file_exists($path.'.tar.gz')) {
|
||||||
unlink($path . '.tar.gz');
|
unlink($path.'.tar.gz');
|
||||||
}
|
}
|
||||||
$phar->compress(\Phar::GZ);
|
$phar->compress(\Phar::GZ);
|
||||||
// close the file so that we can rename it
|
// close the file so that we can rename it
|
||||||
unset($phar);
|
unset($phar);
|
||||||
unlink($path . '.tar');
|
unlink($path.'.tar');
|
||||||
rename($path . '.tar.gz', $path . '.tar');
|
rename($path.'.tar.gz', $path.'.tar');
|
||||||
}
|
}
|
||||||
return $path . '.tar';
|
|
||||||
|
return $path.'.tar';
|
||||||
}
|
}
|
||||||
function __c3_build_clover_report(PHP_CodeCoverage $codeCoverage, $path)
|
function __c3_build_clover_report(PHP_CodeCoverage $codeCoverage, $path)
|
||||||
{
|
{
|
||||||
$writer = new PHP_CodeCoverage_Report_Clover();
|
$writer = new PHP_CodeCoverage_Report_Clover();
|
||||||
$writer->process($codeCoverage, $path . '.clover.xml');
|
$writer->process($codeCoverage, $path.'.clover.xml');
|
||||||
return $path . '.clover.xml';
|
|
||||||
|
return $path.'.clover.xml';
|
||||||
}
|
}
|
||||||
function __c3_build_crap4j_report(PHP_CodeCoverage $codeCoverage, $path)
|
function __c3_build_crap4j_report(PHP_CodeCoverage $codeCoverage, $path)
|
||||||
{
|
{
|
||||||
$writer = new PHP_CodeCoverage_Report_Crap4j();
|
$writer = new PHP_CodeCoverage_Report_Crap4j();
|
||||||
$writer->process($codeCoverage, $path . '.crap4j.xml');
|
$writer->process($codeCoverage, $path.'.crap4j.xml');
|
||||||
return $path . '.crap4j.xml';
|
|
||||||
|
return $path.'.crap4j.xml';
|
||||||
}
|
}
|
||||||
function __c3_build_phpunit_report(PHP_CodeCoverage $codeCoverage, $path)
|
function __c3_build_phpunit_report(PHP_CodeCoverage $codeCoverage, $path)
|
||||||
{
|
{
|
||||||
$writer = new PHP_CodeCoverage_Report_XML(\PHPUnit_Runner_Version::id());
|
$writer = new PHP_CodeCoverage_Report_XML(\PHPUnit_Runner_Version::id());
|
||||||
$writer->process($codeCoverage, $path . 'phpunit');
|
$writer->process($codeCoverage, $path.'phpunit');
|
||||||
if (file_exists($path . '.tar')) {
|
if (file_exists($path.'.tar')) {
|
||||||
unlink($path . '.tar');
|
unlink($path.'.tar');
|
||||||
}
|
}
|
||||||
$phar = new PharData($path . '.tar');
|
$phar = new PharData($path.'.tar');
|
||||||
$phar->setSignatureAlgorithm(Phar::SHA1);
|
$phar->setSignatureAlgorithm(Phar::SHA1);
|
||||||
$files = $phar->buildFromDirectory($path . 'phpunit');
|
$files = $phar->buildFromDirectory($path.'phpunit');
|
||||||
array_map('unlink', $files);
|
array_map('unlink', $files);
|
||||||
if (in_array('GZ', Phar::getSupportedCompression())) {
|
if (in_array('GZ', Phar::getSupportedCompression())) {
|
||||||
if (file_exists($path . '.tar.gz')) {
|
if (file_exists($path.'.tar.gz')) {
|
||||||
unlink($path . '.tar.gz');
|
unlink($path.'.tar.gz');
|
||||||
}
|
}
|
||||||
$phar->compress(\Phar::GZ);
|
$phar->compress(\Phar::GZ);
|
||||||
// close the file so that we can rename it
|
// close the file so that we can rename it
|
||||||
unset($phar);
|
unset($phar);
|
||||||
unlink($path . '.tar');
|
unlink($path.'.tar');
|
||||||
rename($path . '.tar.gz', $path . '.tar');
|
rename($path.'.tar.gz', $path.'.tar');
|
||||||
}
|
}
|
||||||
return $path . '.tar';
|
|
||||||
|
return $path.'.tar';
|
||||||
}
|
}
|
||||||
function __c3_send_file($filename)
|
function __c3_send_file($filename)
|
||||||
{
|
{
|
||||||
if (!headers_sent()) {
|
if (!headers_sent()) {
|
||||||
readfile($filename);
|
readfile($filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param $filename
|
* @param $filename
|
||||||
* @param bool $lock Lock the file for writing?
|
* @param bool $lock Lock the file for writing?
|
||||||
|
*
|
||||||
* @return [null|PHP_CodeCoverage|\SebastianBergmann\CodeCoverage\CodeCoverage, resource]
|
* @return [null|PHP_CodeCoverage|\SebastianBergmann\CodeCoverage\CodeCoverage, resource]
|
||||||
*/
|
*/
|
||||||
function __c3_factory($filename, $lock=false)
|
function __c3_factory($filename, $lock = false)
|
||||||
{
|
{
|
||||||
$file = null;
|
$file = null;
|
||||||
if ($filename !== null && is_readable($filename)) {
|
if ($filename !== null && is_readable($filename)) {
|
||||||
@ -189,12 +197,13 @@ if (!defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) {
|
|||||||
$phpCoverage = unserialize(file_get_contents($filename));
|
$phpCoverage = unserialize(file_get_contents($filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
return array($phpCoverage, $file);
|
return [$phpCoverage, $file];
|
||||||
} else {
|
} else {
|
||||||
$phpCoverage = new PHP_CodeCoverage();
|
$phpCoverage = new PHP_CodeCoverage();
|
||||||
}
|
}
|
||||||
if (isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_SUITE'])) {
|
if (isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_SUITE'])) {
|
||||||
$suite = $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_SUITE'];
|
$suite = $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_SUITE'];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$settings = \Codeception\Configuration::suiteSettings($suite, \Codeception\Configuration::config());
|
$settings = \Codeception\Configuration::suiteSettings($suite, \Codeception\Configuration::config());
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@ -203,6 +212,7 @@ if (!defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) {
|
|||||||
} else {
|
} else {
|
||||||
$settings = \Codeception\Configuration::config();
|
$settings = \Codeception\Configuration::config();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
\Codeception\Coverage\Filter::setup($phpCoverage)
|
\Codeception\Coverage\Filter::setup($phpCoverage)
|
||||||
->whiteList($settings)
|
->whiteList($settings)
|
||||||
@ -210,14 +220,14 @@ if (!defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
__c3_error($e->getMessage());
|
__c3_error($e->getMessage());
|
||||||
}
|
}
|
||||||
return array($phpCoverage, $file);
|
|
||||||
|
return [$phpCoverage, $file];
|
||||||
}
|
}
|
||||||
function __c3_exit()
|
function __c3_exit()
|
||||||
{
|
{
|
||||||
if (!isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG'])) {
|
if (!isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG'])) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
function __c3_clear()
|
function __c3_clear()
|
||||||
{
|
{
|
||||||
@ -226,21 +236,22 @@ if (!defined('C3_CODECOVERAGE_MEDIATE_STORAGE')) {
|
|||||||
}
|
}
|
||||||
if (!is_dir(C3_CODECOVERAGE_MEDIATE_STORAGE)) {
|
if (!is_dir(C3_CODECOVERAGE_MEDIATE_STORAGE)) {
|
||||||
if (mkdir(C3_CODECOVERAGE_MEDIATE_STORAGE, 0777, true) === false) {
|
if (mkdir(C3_CODECOVERAGE_MEDIATE_STORAGE, 0777, true) === false) {
|
||||||
__c3_error('Failed to create directory "' . C3_CODECOVERAGE_MEDIATE_STORAGE . '"');
|
__c3_error('Failed to create directory "'.C3_CODECOVERAGE_MEDIATE_STORAGE.'"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// evaluate base path for c3-related files
|
// evaluate base path for c3-related files
|
||||||
$path = realpath(C3_CODECOVERAGE_MEDIATE_STORAGE) . DIRECTORY_SEPARATOR . 'codecoverage';
|
$path = realpath(C3_CODECOVERAGE_MEDIATE_STORAGE).DIRECTORY_SEPARATOR.'codecoverage';
|
||||||
$requested_c3_report = (strpos($_SERVER['REQUEST_URI'], 'c3/report') !== false);
|
$requested_c3_report = (strpos($_SERVER['REQUEST_URI'], 'c3/report') !== false);
|
||||||
$complete_report = $current_report = $path . '.serialized';
|
$complete_report = $current_report = $path.'.serialized';
|
||||||
if ($requested_c3_report) {
|
if ($requested_c3_report) {
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
$route = ltrim(strrchr($_SERVER['REQUEST_URI'], '/'), '/');
|
$route = ltrim(strrchr($_SERVER['REQUEST_URI'], '/'), '/');
|
||||||
if ($route === 'clear') {
|
if ($route === 'clear') {
|
||||||
__c3_clear();
|
__c3_clear();
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
}
|
}
|
||||||
list($codeCoverage, ) = __c3_factory($complete_report);
|
list($codeCoverage) = __c3_factory($complete_report);
|
||||||
switch ($route) {
|
switch ($route) {
|
||||||
case 'html':
|
case 'html':
|
||||||
try {
|
try {
|
||||||
@ -248,6 +259,7 @@ if ($requested_c3_report) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
__c3_error($e->getMessage());
|
__c3_error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
case 'clover':
|
case 'clover':
|
||||||
try {
|
try {
|
||||||
@ -255,6 +267,7 @@ if ($requested_c3_report) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
__c3_error($e->getMessage());
|
__c3_error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
case 'crap4j':
|
case 'crap4j':
|
||||||
try {
|
try {
|
||||||
@ -262,6 +275,7 @@ if ($requested_c3_report) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
__c3_error($e->getMessage());
|
__c3_error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
case 'serialized':
|
case 'serialized':
|
||||||
try {
|
try {
|
||||||
@ -269,6 +283,7 @@ if ($requested_c3_report) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
__c3_error($e->getMessage());
|
__c3_error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
case 'phpunit':
|
case 'phpunit':
|
||||||
try {
|
try {
|
||||||
@ -276,10 +291,11 @@ if ($requested_c3_report) {
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
__c3_error($e->getMessage());
|
__c3_error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return __c3_exit();
|
return __c3_exit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
list($codeCoverage, ) = __c3_factory(null);
|
list($codeCoverage) = __c3_factory(null);
|
||||||
$codeCoverage->start(C3_CODECOVERAGE_TESTNAME);
|
$codeCoverage->start(C3_CODECOVERAGE_TESTNAME);
|
||||||
if (!array_key_exists('HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG', $_SERVER)) {
|
if (!array_key_exists('HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG', $_SERVER)) {
|
||||||
register_shutdown_function(
|
register_shutdown_function(
|
||||||
@ -317,4 +333,4 @@ if ($requested_c3_report) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
@ -188,39 +188,39 @@ return [
|
|||||||
|
|
||||||
'aliases' => [
|
'aliases' => [
|
||||||
|
|
||||||
'App' => Illuminate\Support\Facades\App::class,
|
'App' => Illuminate\Support\Facades\App::class,
|
||||||
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
||||||
'Auth' => Illuminate\Support\Facades\Auth::class,
|
'Auth' => Illuminate\Support\Facades\Auth::class,
|
||||||
'Blade' => Illuminate\Support\Facades\Blade::class,
|
'Blade' => Illuminate\Support\Facades\Blade::class,
|
||||||
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
|
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
|
||||||
'Bus' => Illuminate\Support\Facades\Bus::class,
|
'Bus' => Illuminate\Support\Facades\Bus::class,
|
||||||
'Cache' => Illuminate\Support\Facades\Cache::class,
|
'Cache' => Illuminate\Support\Facades\Cache::class,
|
||||||
'Config' => Illuminate\Support\Facades\Config::class,
|
'Config' => Illuminate\Support\Facades\Config::class,
|
||||||
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
||||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||||
'DB' => Illuminate\Support\Facades\DB::class,
|
'DB' => Illuminate\Support\Facades\DB::class,
|
||||||
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
||||||
'Event' => Illuminate\Support\Facades\Event::class,
|
'Event' => Illuminate\Support\Facades\Event::class,
|
||||||
'File' => Illuminate\Support\Facades\File::class,
|
'File' => Illuminate\Support\Facades\File::class,
|
||||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||||
'Log' => Illuminate\Support\Facades\Log::class,
|
'Log' => Illuminate\Support\Facades\Log::class,
|
||||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||||
'Notification' => Illuminate\Support\Facades\Notification::class,
|
'Notification' => Illuminate\Support\Facades\Notification::class,
|
||||||
'Password' => Illuminate\Support\Facades\Password::class,
|
'Password' => Illuminate\Support\Facades\Password::class,
|
||||||
'Queue' => Illuminate\Support\Facades\Queue::class,
|
'Queue' => Illuminate\Support\Facades\Queue::class,
|
||||||
'Redirect' => Illuminate\Support\Facades\Redirect::class,
|
'Redirect' => Illuminate\Support\Facades\Redirect::class,
|
||||||
'Redis' => Illuminate\Support\Facades\Redis::class,
|
'Redis' => Illuminate\Support\Facades\Redis::class,
|
||||||
'Request' => Illuminate\Support\Facades\Request::class,
|
'Request' => Illuminate\Support\Facades\Request::class,
|
||||||
'Response' => Illuminate\Support\Facades\Response::class,
|
'Response' => Illuminate\Support\Facades\Response::class,
|
||||||
'Route' => Illuminate\Support\Facades\Route::class,
|
'Route' => Illuminate\Support\Facades\Route::class,
|
||||||
'Schema' => Illuminate\Support\Facades\Schema::class,
|
'Schema' => Illuminate\Support\Facades\Schema::class,
|
||||||
'Session' => Illuminate\Support\Facades\Session::class,
|
'Session' => Illuminate\Support\Facades\Session::class,
|
||||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||||
'URL' => Illuminate\Support\Facades\URL::class,
|
'URL' => Illuminate\Support\Facades\URL::class,
|
||||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||||
'View' => Illuminate\Support\Facades\View::class,
|
'View' => Illuminate\Support\Facades\View::class,
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'defaults' => [
|
'defaults' => [
|
||||||
'guard' => 'web',
|
'guard' => 'web',
|
||||||
'passwords' => 'users',
|
'passwords' => 'users',
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -37,12 +37,12 @@ return [
|
|||||||
|
|
||||||
'guards' => [
|
'guards' => [
|
||||||
'web' => [
|
'web' => [
|
||||||
'driver' => 'session',
|
'driver' => 'session',
|
||||||
'provider' => 'users',
|
'provider' => 'users',
|
||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
'driver' => 'token',
|
'driver' => 'token',
|
||||||
'provider' => 'users',
|
'provider' => 'users',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -67,7 +67,7 @@ return [
|
|||||||
'providers' => [
|
'providers' => [
|
||||||
'users' => [
|
'users' => [
|
||||||
'driver' => 'eloquent',
|
'driver' => 'eloquent',
|
||||||
'model' => App\User::class,
|
'model' => App\User::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
// 'users' => [
|
// 'users' => [
|
||||||
@ -94,8 +94,8 @@ return [
|
|||||||
'passwords' => [
|
'passwords' => [
|
||||||
'users' => [
|
'users' => [
|
||||||
'provider' => 'users',
|
'provider' => 'users',
|
||||||
'table' => 'password_resets',
|
'table' => 'password_resets',
|
||||||
'expire' => 60,
|
'expire' => 60,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -31,18 +31,18 @@ return [
|
|||||||
'connections' => [
|
'connections' => [
|
||||||
|
|
||||||
'pusher' => [
|
'pusher' => [
|
||||||
'driver' => 'pusher',
|
'driver' => 'pusher',
|
||||||
'key' => env('PUSHER_APP_KEY'),
|
'key' => env('PUSHER_APP_KEY'),
|
||||||
'secret' => env('PUSHER_APP_SECRET'),
|
'secret' => env('PUSHER_APP_SECRET'),
|
||||||
'app_id' => env('PUSHER_APP_ID'),
|
'app_id' => env('PUSHER_APP_ID'),
|
||||||
'options' => [
|
'options' => [
|
||||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||||
'encrypted' => true,
|
'encrypted' => true,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -41,20 +41,20 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'database' => [
|
'database' => [
|
||||||
'driver' => 'database',
|
'driver' => 'database',
|
||||||
'table' => 'cache',
|
'table' => 'cache',
|
||||||
'connection' => null,
|
'connection' => null,
|
||||||
],
|
],
|
||||||
|
|
||||||
'file' => [
|
'file' => [
|
||||||
'driver' => 'file',
|
'driver' => 'file',
|
||||||
'path' => storage_path('framework/cache/data'),
|
'path' => storage_path('framework/cache/data'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'memcached' => [
|
'memcached' => [
|
||||||
'driver' => 'memcached',
|
'driver' => 'memcached',
|
||||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||||
'sasl' => [
|
'sasl' => [
|
||||||
env('MEMCACHED_USERNAME'),
|
env('MEMCACHED_USERNAME'),
|
||||||
env('MEMCACHED_PASSWORD'),
|
env('MEMCACHED_PASSWORD'),
|
||||||
],
|
],
|
||||||
@ -63,15 +63,15 @@ return [
|
|||||||
],
|
],
|
||||||
'servers' => [
|
'servers' => [
|
||||||
[
|
[
|
||||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||||
'port' => env('MEMCACHED_PORT', 11211),
|
'port' => env('MEMCACHED_PORT', 11211),
|
||||||
'weight' => 100,
|
'weight' => 100,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'cache',
|
'connection' => 'cache',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -34,50 +34,50 @@ return [
|
|||||||
'connections' => [
|
'connections' => [
|
||||||
|
|
||||||
'sqlite' => [
|
'sqlite' => [
|
||||||
'driver' => 'sqlite',
|
'driver' => 'sqlite',
|
||||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
],
|
],
|
||||||
|
|
||||||
'mysql' => [
|
'mysql' => [
|
||||||
'driver' => 'mysql',
|
'driver' => 'mysql',
|
||||||
'host' => env('DB_HOST', '127.0.0.1'),
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
'port' => env('DB_PORT', '3306'),
|
'port' => env('DB_PORT', '3306'),
|
||||||
'database' => env('DB_DATABASE', 'forge'),
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
'password' => env('DB_PASSWORD', ''),
|
'password' => env('DB_PASSWORD', ''),
|
||||||
'unix_socket' => env('DB_SOCKET', ''),
|
'unix_socket' => env('DB_SOCKET', ''),
|
||||||
'charset' => 'utf8mb4',
|
'charset' => 'utf8mb4',
|
||||||
'collation' => 'utf8mb4_unicode_ci',
|
'collation' => 'utf8mb4_unicode_ci',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
'strict' => true,
|
'strict' => true,
|
||||||
'engine' => null,
|
'engine' => null,
|
||||||
],
|
],
|
||||||
|
|
||||||
'pgsql' => [
|
'pgsql' => [
|
||||||
'driver' => 'pgsql',
|
'driver' => 'pgsql',
|
||||||
'host' => env('DB_HOST', '127.0.0.1'),
|
'host' => env('DB_HOST', '127.0.0.1'),
|
||||||
'port' => env('DB_PORT', '5432'),
|
'port' => env('DB_PORT', '5432'),
|
||||||
'database' => env('DB_DATABASE', 'forge'),
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
'password' => env('DB_PASSWORD', ''),
|
'password' => env('DB_PASSWORD', ''),
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
'schema' => 'public',
|
'schema' => 'public',
|
||||||
'sslmode' => 'prefer',
|
'sslmode' => 'prefer',
|
||||||
],
|
],
|
||||||
|
|
||||||
'sqlsrv' => [
|
'sqlsrv' => [
|
||||||
'driver' => 'sqlsrv',
|
'driver' => 'sqlsrv',
|
||||||
'host' => env('DB_HOST', 'localhost'),
|
'host' => env('DB_HOST', 'localhost'),
|
||||||
'port' => env('DB_PORT', '1433'),
|
'port' => env('DB_PORT', '1433'),
|
||||||
'database' => env('DB_DATABASE', 'forge'),
|
'database' => env('DB_DATABASE', 'forge'),
|
||||||
'username' => env('DB_USERNAME', 'forge'),
|
'username' => env('DB_USERNAME', 'forge'),
|
||||||
'password' => env('DB_PASSWORD', ''),
|
'password' => env('DB_PASSWORD', ''),
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
'prefix_indexes' => true,
|
'prefix_indexes' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -112,16 +112,16 @@ return [
|
|||||||
'client' => 'predis',
|
'client' => 'predis',
|
||||||
|
|
||||||
'default' => [
|
'default' => [
|
||||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
'password' => env('REDIS_PASSWORD', null),
|
'password' => env('REDIS_PASSWORD', null),
|
||||||
'port' => env('REDIS_PORT', 6379),
|
'port' => env('REDIS_PORT', 6379),
|
||||||
'database' => env('REDIS_DB', 0),
|
'database' => env('REDIS_DB', 0),
|
||||||
],
|
],
|
||||||
|
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||||
'password' => env('REDIS_PASSWORD', null),
|
'password' => env('REDIS_PASSWORD', null),
|
||||||
'port' => env('REDIS_PORT', 6379),
|
'port' => env('REDIS_PORT', 6379),
|
||||||
'database' => env('REDIS_CACHE_DB', 1),
|
'database' => env('REDIS_CACHE_DB', 1),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -45,23 +45,23 @@ return [
|
|||||||
|
|
||||||
'local' => [
|
'local' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app'),
|
'root' => storage_path('app'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'public' => [
|
'public' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
'root' => storage_path('app/public'),
|
||||||
'url' => env('APP_URL').'/storage',
|
'url' => env('APP_URL').'/storage',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
],
|
],
|
||||||
|
|
||||||
's3' => [
|
's3' => [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||||
'region' => env('AWS_DEFAULT_REGION'),
|
'region' => env('AWS_DEFAULT_REGION'),
|
||||||
'bucket' => env('AWS_BUCKET'),
|
'bucket' => env('AWS_BUCKET'),
|
||||||
'url' => env('AWS_URL'),
|
'url' => env('AWS_URL'),
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
@ -44,9 +44,9 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'argon' => [
|
'argon' => [
|
||||||
'memory' => 1024,
|
'memory' => 1024,
|
||||||
'threads' => 2,
|
'threads' => 2,
|
||||||
'time' => 2,
|
'time' => 2,
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -35,35 +35,35 @@ return [
|
|||||||
|
|
||||||
'channels' => [
|
'channels' => [
|
||||||
'stack' => [
|
'stack' => [
|
||||||
'driver' => 'stack',
|
'driver' => 'stack',
|
||||||
'channels' => ['daily'],
|
'channels' => ['daily'],
|
||||||
],
|
],
|
||||||
|
|
||||||
'single' => [
|
'single' => [
|
||||||
'driver' => 'single',
|
'driver' => 'single',
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
|
|
||||||
'daily' => [
|
'daily' => [
|
||||||
'driver' => 'daily',
|
'driver' => 'daily',
|
||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
'days' => 14,
|
'days' => 14,
|
||||||
],
|
],
|
||||||
|
|
||||||
'slack' => [
|
'slack' => [
|
||||||
'driver' => 'slack',
|
'driver' => 'slack',
|
||||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
'username' => 'Laravel Log',
|
'username' => 'Laravel Log',
|
||||||
'emoji' => ':boom:',
|
'emoji' => ':boom:',
|
||||||
'level' => 'critical',
|
'level' => 'critical',
|
||||||
],
|
],
|
||||||
|
|
||||||
'papertrail' => [
|
'papertrail' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
'handler' => SyslogUdpHandler::class,
|
'handler' => SyslogUdpHandler::class,
|
||||||
'handler_with' => [
|
'handler_with' => [
|
||||||
'host' => env('PAPERTRAIL_URL'),
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
'port' => env('PAPERTRAIL_PORT'),
|
'port' => env('PAPERTRAIL_PORT'),
|
||||||
@ -71,21 +71,21 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'stderr' => [
|
'stderr' => [
|
||||||
'driver' => 'monolog',
|
'driver' => 'monolog',
|
||||||
'handler' => StreamHandler::class,
|
'handler' => StreamHandler::class,
|
||||||
'with' => [
|
'with' => [
|
||||||
'stream' => 'php://stderr',
|
'stream' => 'php://stderr',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'syslog' => [
|
'syslog' => [
|
||||||
'driver' => 'syslog',
|
'driver' => 'syslog',
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
|
|
||||||
'errorlog' => [
|
'errorlog' => [
|
||||||
'driver' => 'errorlog',
|
'driver' => 'errorlog',
|
||||||
'level' => 'debug',
|
'level' => 'debug',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ return [
|
|||||||
|
|
||||||
'from' => [
|
'from' => [
|
||||||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -35,34 +35,34 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'database' => [
|
'database' => [
|
||||||
'driver' => 'database',
|
'driver' => 'database',
|
||||||
'table' => 'jobs',
|
'table' => 'jobs',
|
||||||
'queue' => 'default',
|
'queue' => 'default',
|
||||||
'retry_after' => 90,
|
'retry_after' => 90,
|
||||||
],
|
],
|
||||||
|
|
||||||
'beanstalkd' => [
|
'beanstalkd' => [
|
||||||
'driver' => 'beanstalkd',
|
'driver' => 'beanstalkd',
|
||||||
'host' => 'localhost',
|
'host' => 'localhost',
|
||||||
'queue' => 'default',
|
'queue' => 'default',
|
||||||
'retry_after' => 90,
|
'retry_after' => 90,
|
||||||
],
|
],
|
||||||
|
|
||||||
'sqs' => [
|
'sqs' => [
|
||||||
'driver' => 'sqs',
|
'driver' => 'sqs',
|
||||||
'key' => env('SQS_KEY', 'your-public-key'),
|
'key' => env('SQS_KEY', 'your-public-key'),
|
||||||
'secret' => env('SQS_SECRET', 'your-secret-key'),
|
'secret' => env('SQS_SECRET', 'your-secret-key'),
|
||||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||||
'queue' => env('SQS_QUEUE', 'your-queue-name'),
|
'queue' => env('SQS_QUEUE', 'your-queue-name'),
|
||||||
'region' => env('SQS_REGION', 'us-east-1'),
|
'region' => env('SQS_REGION', 'us-east-1'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'redis' => [
|
'redis' => [
|
||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'queue' => 'default',
|
'queue' => 'default',
|
||||||
'retry_after' => 90,
|
'retry_after' => 90,
|
||||||
'block_for' => null,
|
'block_for' => null,
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
@ -80,7 +80,7 @@ return [
|
|||||||
|
|
||||||
'failed' => [
|
'failed' => [
|
||||||
'database' => env('DB_CONNECTION', 'mysql'),
|
'database' => env('DB_CONNECTION', 'mysql'),
|
||||||
'table' => 'failed_jobs',
|
'table' => 'failed_jobs',
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -19,13 +19,13 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'mailgun' => [
|
'mailgun' => [
|
||||||
'domain' => env('MAILGUN_DOMAIN'),
|
'domain' => env('MAILGUN_DOMAIN'),
|
||||||
'secret' => env('MAILGUN_SECRET'),
|
'secret' => env('MAILGUN_SECRET'),
|
||||||
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'ses' => [
|
'ses' => [
|
||||||
'key' => env('SES_KEY'),
|
'key' => env('SES_KEY'),
|
||||||
'secret' => env('SES_SECRET'),
|
'secret' => env('SES_SECRET'),
|
||||||
'region' => env('SES_REGION', 'us-east-1'),
|
'region' => env('SES_REGION', 'us-east-1'),
|
||||||
],
|
],
|
||||||
@ -35,8 +35,8 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'stripe' => [
|
'stripe' => [
|
||||||
'model' => App\User::class,
|
'model' => App\User::class,
|
||||||
'key' => env('STRIPE_KEY'),
|
'key' => env('STRIPE_KEY'),
|
||||||
'secret' => env('STRIPE_SECRET'),
|
'secret' => env('STRIPE_SECRET'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ use Faker\Generator as Faker;
|
|||||||
|
|
||||||
$factory->define(App\User::class, function (Faker $faker) {
|
$factory->define(App\User::class, function (Faker $faker) {
|
||||||
return [
|
return [
|
||||||
'name' => $faker->name,
|
'name' => $faker->name,
|
||||||
'email' => $faker->unique()->safeEmail,
|
'email' => $faker->unique()->safeEmail,
|
||||||
'email_verified_at' => now(),
|
'email_verified_at' => now(),
|
||||||
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
||||||
'remember_token' => str_random(10),
|
'remember_token' => str_random(10),
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreateUsersTable extends Migration
|
class CreateUsersTable extends Migration
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class CreatePasswordResetsTable extends Migration
|
class CreatePasswordResetsTable extends Migration
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Laravel - A PHP Framework For Web Artisans
|
* Laravel - A PHP Framework For Web Artisans.
|
||||||
*
|
*
|
||||||
* @package Laravel
|
|
||||||
* @author Taylor Otwell <taylor@laravel.com>
|
* @author Taylor Otwell <taylor@laravel.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -13,7 +13,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'failed' => 'These credentials do not match our records.',
|
'failed' => 'These credentials do not match our records.',
|
||||||
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
|
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -14,6 +14,6 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'previous' => '« Previous',
|
'previous' => '« Previous',
|
||||||
'next' => 'Next »',
|
'next' => 'Next »',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -14,9 +14,9 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'password' => 'Passwords must be at least six characters and match the confirmation.',
|
'password' => 'Passwords must be at least six characters and match the confirmation.',
|
||||||
'reset' => 'Your password has been reset!',
|
'reset' => 'Your password has been reset!',
|
||||||
'sent' => 'We have e-mailed your password reset link!',
|
'sent' => 'We have e-mailed your password reset link!',
|
||||||
'token' => 'This password reset token is invalid.',
|
'token' => 'This password reset token is invalid.',
|
||||||
'user' => "We can't find a user with that e-mail address.",
|
'user' => "We can't find a user with that e-mail address.",
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Laravel - A PHP Framework For Web Artisans
|
* Laravel - A PHP Framework For Web Artisans.
|
||||||
*
|
*
|
||||||
* @package Laravel
|
|
||||||
* @author Taylor Otwell <taylor@laravel.com>
|
* @author Taylor Otwell <taylor@laravel.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$uri = urldecode(
|
$uri = urldecode(
|
||||||
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
|
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
|
||||||
);
|
);
|
||||||
|
@ -4,17 +4,14 @@ namespace Tests\Unit;
|
|||||||
|
|
||||||
use App\Utils\NumberHelper;
|
use App\Utils\NumberHelper;
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
|
|
||||||
class NumberTest extends TestCase
|
class NumberTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testRoundingThreeLow()
|
public function testRoundingThreeLow()
|
||||||
{
|
{
|
||||||
$rounded = NumberHelper::roundValue(3.144444444444, 3);
|
$rounded = NumberHelper::roundValue(3.144444444444, 3);
|
||||||
|
|
||||||
$this->assertEquals(3.144, $rounded);
|
$this->assertEquals(3.144, $rounded);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRoundingThreeHigh()
|
public function testRoundingThreeHigh()
|
||||||
@ -22,7 +19,6 @@ class NumberTest extends TestCase
|
|||||||
$rounded = NumberHelper::roundValue(3.144944444444, 3);
|
$rounded = NumberHelper::roundValue(3.144944444444, 3);
|
||||||
|
|
||||||
$this->assertEquals(3.145, $rounded);
|
$this->assertEquals(3.145, $rounded);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRoundingTwoLow()
|
public function testRoundingTwoLow()
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// This is global bootstrap for autoloading
|
// This is global bootstrap for autoloading
|
||||||
use Codeception\Util\Fixtures;
|
use Codeception\Util\Fixtures;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user