Update laravel usage

This commit is contained in:
DariusIII
2017-07-18 13:02:58 +02:00
parent 1e4a8a57f0
commit 751796a613
20 changed files with 155 additions and 122 deletions
+1
View File
@@ -1,3 +1,4 @@
DB_CONNECTION = nntmux
DB_SYSTEM = mysql
DB_HOST = localhost
DB_PORT = 3306
+1 -1
View File
@@ -14,7 +14,7 @@ test.php
*.orig
/.idea/
/app/libraries/*
/app/Libraries/*
/app/resources/tmp/*
/nntmux/config/settings.php
/nntmux/config/ircscraper_settings.php
+1 -1
View File
@@ -94,6 +94,6 @@ coding_style:
true_false_null: undefined
filter:
excluded_paths: [app/libraries/*, libraries/*, libs/*, resources/*]
excluded_paths: [app/Libraries/*, libraries/*, libs/*, resources/*]
tools:
sensiolabs_security_checker: true
+1 -1
View File
@@ -26,7 +26,7 @@ echo ""
echo "Setting cache directory permissions for you..."
sudo chown -R www-data:www-data /var/lib/php/sessions/
chmod 755 ./
chmod -R 755 app/libraries
chmod -R 755 app/Libraries
chmod -R 777 app/resources
chmod -R 755 libraries
chmod -R 755 resources
+1 -4
View File
@@ -26,10 +26,7 @@ use App\extensions\console\Command;
/**
* Settings - model for settings table.
*
* laravel app completely ignore the 'setting' column and only uses 'section', 'subsection', and 'name'
* for finding values/hints.
*
*@package app\models
*@package App\Models
*/
class Settings extends Model
{
+1 -1
View File
@@ -12,7 +12,7 @@
*/
$app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
dirname(__DIR__) . '/'
);
/*
+9 -1
View File
@@ -2,6 +2,14 @@
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'nntmux' . DIRECTORY_SEPARATOR . 'constants.php';
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'nntmux' . DIRECTORY_SEPARATOR . 'bootstrap.php';
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'nntmux.php';
use Dotenv\Dotenv;
$dotenv = new Dotenv(dirname(__DIR__, 1));
$dotenv->load();
define('NNTMUX_START', microtime(true));
define('NN_APP_PATH', dirname(__DIR__) . DS . 'app');
@@ -9,4 +17,4 @@ if (!defined('NN_ROOT')) {
define('NN_ROOT', dirname(NN_APP_PATH, 2));
}
require_once NN_APP_PATH . DS . 'libraries' . DS . 'autoload.php';
require_once NN_APP_PATH . DS . 'Libraries' . DS . 'autoload.php';
+8 -3
View File
@@ -6,12 +6,14 @@
],
"autoload": {
"files": [
"app/libraries/laravel/framework/src/Illuminate/Support/helpers.php",
"app/Libraries/laravel/framework/src/Illuminate/Support/helpers.php",
"app/Extensions/helper/helpers.php"
],
"psr-4": {
"nntmux\\": "nntmux/",
"App\\": "app/"
"App\\": "app/",
"App\\Http\\Controllers\\": "nntmux/Controllers",
"App\\Http\\Middleware\\": "nntmux/Middleware"
},
"classmap": [
"www/pages/",
@@ -33,7 +35,7 @@
"bower-asset-library": "www/themes/shared/assets"
}
},
"vendor-dir": "app/libraries"
"vendor-dir": "app/Libraries"
},
"description": "A Usenet Indexer",
"extra": {
@@ -144,6 +146,9 @@
},
"scripts": {
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"nntmux\\build\\ComposerScripts::postInstall",
"nntmux\\build\\ComposerScripts::postInstallCmd"
+109 -109
View File
@@ -2,132 +2,132 @@
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'nntmux'),
'default' => env('DB_CONNECTION', 'nntmux'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
],
'nntmux' => [
'driver' => env('DB_SYSTEM', 'mysql'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_NAME', 'nntmux'),
'username' => env('DB_USER', 'root'),
'password' => env('DB_PASSWORD', ''),
'driver' => env('DB_SYSTEM', 'mysql'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_NAME', 'nntmux'),
'username' => env('DB_USER', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'strict' => false
],
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'strict' => false
],
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'redis' => [
'client' => 'predis',
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
],
];
+22
View File
@@ -0,0 +1,22 @@
<?php
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'Libraries' . DIRECTORY_SEPARATOR . 'autoload.php';
use Illuminate\Database\Capsule\Manager as Capsule;
use Dotenv\Dotenv;
$dotenv = new Dotenv(dirname(__DIR__, 1));
$dotenv->load();
$capsule = new Capsule;
// Same as database configuration file of Laravel.
$capsule->addConnection([
'driver' => env('DB_SYSTEM'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_NAME', 'nntmux'),
'username' => env('DB_USER', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'strict' => false
], 'default');
$capsule->bootEloquent();
$capsule->setAsGlobal();
+1 -1
View File
@@ -18,7 +18,7 @@
* @author niel
* @copyright 2016 nZEDb
*/
require_once NN_ROOT . 'app/libraries/autoload.php';
require_once NN_ROOT . 'app/Libraries/autoload.php';
use nntmux\config\Configure;
use nntmux\utility\Utility;