T350: Updated configuration files for Laravel 5.

This commit is contained in:
Peter Deltchev 2015-09-12 14:56:09 -07:00
parent 7147d06ee7
commit e2225e3378
20 changed files with 288 additions and 36 deletions

View file

@ -17,3 +17,8 @@ MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PONI_CLIENT_ID=null
PONI_CLIENT_SECRET=null
PONYFM_DATASTORE=null

View file

@ -211,7 +211,7 @@ class Album extends Model
{
$dir = (string)(floor($this->id / 100) * 100);
return \Config::get('app.files_directory') . '/tracks/' . $dir;
return \Config::get('ponyfm.files_directory') . '/tracks/' . $dir;
}
public function getDates()

View file

@ -17,7 +17,7 @@ use Illuminate\Support\Str;
use Input;
use Symfony\Component\HttpFoundation\File\UploadedFile;
//require_once(app_path() . '/Library/getid3/getid3/getid3.php');
require_once(app_path() . '/Library/getid3/getid3/getid3.php');
class ImportMLPMA extends Command
{
@ -82,8 +82,8 @@ class ImportMLPMA extends Command
{
pcntl_signal(SIGINT, [$this, 'handleInterrupt']);
$mlpmaPath = Config::get('app.files_directory') . 'mlpma';
$tmpPath = Config::get('app.files_directory') . 'tmp';
$mlpmaPath = Config::get('ponyfm.files_directory') . 'mlpma';
$tmpPath = Config::get('ponyfm.files_directory') . 'tmp';
if (!File::exists($tmpPath)) {
File::makeDirectory($tmpPath);

View file

@ -376,7 +376,7 @@ class MigrateOldData extends Command
{
$dir = (string)(floor($id / 100) * 100);
return \Config::get('app.files_directory') . '/' . $type . '/' . $dir;
return \Config::get('ponyfm.files_directory') . '/' . $type . '/' . $dir;
}
}

View file

@ -102,7 +102,7 @@ class Image extends Model
{
$dir = (string)(floor($this->id / 100) * 100);
return Config::get('app.files_directory') . '/images/' . $dir;
return Config::get('ponyfm.files_directory') . '/images/' . $dir;
}
public function ensureDirectoryExists()

22
app/Library/getid3/.gitattributes vendored Executable file
View file

@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

167
app/Library/getid3/.gitignore vendored Executable file
View file

@ -0,0 +1,167 @@
helperapps/sha1sum.exe
helperapps/*.dll
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover
## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish
# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
############
## Windows
############
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
# Mac crap
.DS_Store

View file

@ -483,7 +483,7 @@ class Track extends Model
{
$dir = (string)(floor($this->id / 100) * 100);
return \Config::get('app.files_directory') . '/tracks/' . $dir;
return \Config::get('ponyfm.files_directory') . '/tracks/' . $dir;
}
public function getDates()

View file

@ -94,7 +94,7 @@ class TrackFile extends Model
{
$dir = (string)(floor($this->track_id / 100) * 100);
return \Config::get('app.files_directory') . '/tracks/' . $dir;
return \Config::get('ponyfm.files_directory') . '/tracks/' . $dir;
}
public function getFile()

View file

@ -26,7 +26,7 @@ return [
|
*/
'url' => 'http://pony.fm',
'url' => env('APP_URL', 'https://pony.fm'),
/*
|--------------------------------------------------------------------------
@ -78,9 +78,9 @@ return [
|
*/
'key' => env('APP_KEY', 'AQUSDTDK5xA04yb9eO9iwlm72NpC8e90'),
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
'cipher' => MCRYPT_RIJNDAEL_256,
/*
|--------------------------------------------------------------------------

View file

@ -74,6 +74,6 @@ return [
|
*/
'prefix' => 'laravel',
'prefix' => 'ponyfm',
];

View file

@ -1,11 +1,12 @@
<?php
return [
return [
'version' => 1,
'urls' => [
'api' => '',
'auth' => '',
'token' => ''
'api' => env('PONI_API_URL', 'https://api.poniverse.net/v1/'),
'register' => env('PONI_REGISTER_URL', 'https://poniverse.net/register?site=pony.fm'),
'auth' => env('PONI_AUTH_URL', 'https://poniverse.net/oauth/authorize'),
'token' => env('PONI_TOKEN_URL', 'https://poniverse.net/oauth/access_token')
],
'client_id' => 0,
'secret' => ''
];
'client_id' => env('PONI_CLIENT_ID'),
'secret' => env('PONI_CLIENT_SECRET')
];

31
config/ponyfm.php Normal file
View file

@ -0,0 +1,31 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Filesystem Datastore
|--------------------------------------------------------------------------
|
| Pony.fm stores audio and image files in a directory it has read/write
| access to. This is the path to it.
|
*/
'files_directory' => env('PONYFM_DATASTORE'),
/*
|--------------------------------------------------------------------------
| Use sendfile?
|--------------------------------------------------------------------------
|
| sendfile is a way of letting the web server serve files that aren't
| normally in its document root. If the web server is configured for it,
| use this setting - otherwise, track files and images will be served by
| the PHP process.
|
*/
'sendfile' => env('USE_SENDFILE', true),
];

View file

@ -109,7 +109,7 @@ return [
|
*/
'cookie' => 'laravel_session',
'cookie' => 'IfYouAreReadingThisWeWantToWorkWithYou_PleaseDropAnEmailTo_HelloAtPoniverseDotNet',
/*
|--------------------------------------------------------------------------

View file

@ -98,11 +98,11 @@
@section('scripts')
<script>
window.pfm = {
token: "{{Session::token()}}",
token: "{!! csrf_token() !!}",
auth: {
@if (Auth::check())
isLogged: true,
user: {{Auth::user()->toJson()}}
user: {!! Auth::user()->toJson() !!}
@else
isLogged: false
@endif

24
vagrant/.env.local Normal file
View file

@ -0,0 +1,24 @@
APP_ENV=local
APP_DEBUG=true
APP_KEY=AQUSDTDK5xA04yb9eO9iwlm72NpC8e90
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
PONI_CLIENT_ID=AAopdYDbn6JarV0Wo025gYQNxS1VXcj8GCa0raSC
PONI_CLIENT_SECRET=cxlA1jgGRZEPp8hg4VNB5v2gx7aY6DUtJSwUUHzT
PONYFM_DATASTORE=/vagrant-files

View file

@ -1,3 +1,4 @@
#!/usr/bin/env bash
sudo cp /vagrant/vagrant/pony.fm.nginx.config /etc/nginx/nginx.conf
sudo cp /vagrant/vagrant/pony.fm.nginx.site.config /etc/nginx/sites-enabled/pony.fm

View file

@ -31,7 +31,7 @@ cd /vagrant
/usr/local/bin/composer self-update
composer install
cp -r /vagrant/vagrant/config/* "/vagrant/app/config/local"
cp "/vagrant/vagrant/.env.local" "/vagrant/.env"
php artisan migrate
php artisan db:seed

View file

@ -1,2 +1,3 @@
#!/usr/bin/env bash
cd ../
vagrant ssh -c /vagrant/vagrant/copy-and-restart-configs.sh