Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2015-09-10 19:31:09 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
88049476fe496de3a3b767a4305d985f78a96db8
88049476
1 parent
b61c1d8d
Change application namespace to BookStack
Hide whitespace changes
Inline
Side-by-side
Showing
69 changed files
with
195 additions
and
195 deletions
app/Activity.php
app/Book.php
app/Chapter.php
app/Console/Commands/Inspire.php
app/Console/Kernel.php
app/EmailConfirmation.php
app/Entity.php
app/Events/Event.php
app/Exceptions/ConfirmationEmailException.php
app/Exceptions/Handler.php
app/Exceptions/NotifyException.php
app/Exceptions/SocialDriverNotConfigured.php
app/Exceptions/SocialSignInException.php
app/Exceptions/UserRegistrationException.php
app/Http/Controllers/Auth/AuthController.php
app/Http/Controllers/Auth/PasswordController.php
app/Http/Controllers/BookController.php
app/Http/Controllers/ChapterController.php
app/Http/Controllers/Controller.php
app/Http/Controllers/HomeController.php
app/Http/Controllers/ImageController.php
app/Http/Controllers/PageController.php
app/Http/Controllers/SearchController.php
app/Http/Controllers/SettingController.php
app/Http/Controllers/UserController.php
app/Http/Kernel.php
app/Http/Middleware/Authenticate.php
app/Http/Middleware/EncryptCookies.php
app/Http/Middleware/PermissionMiddleware.php
app/Http/Middleware/RedirectIfAuthenticated.php
app/Http/Middleware/VerifyCsrfToken.php
app/Http/Requests/Request.php
app/Image.php
app/Jobs/Job.php
app/Page.php
app/PageRevision.php
app/Permission.php
app/Providers/AppServiceProvider.php
app/Providers/CustomFacadeProvider.php
app/Providers/EventServiceProvider.php
app/Providers/RouteServiceProvider.php
app/Providers/SocialiteServiceProvider.php
app/Repos/BookRepo.php
app/Repos/ChapterRepo.php
app/Repos/PageRepo.php
app/Repos/UserRepo.php
app/Role.php
app/Services/ActivityService.php
app/Services/EmailConfirmationService.php
app/Services/Facades/Activity.php
app/Services/Facades/Setting.php
app/Services/SettingService.php
app/Services/SocialAuthService.php
app/Setting.php
app/SocialAccount.php
app/User.php
bootstrap/app.php
composer.json
config/app.php
config/auth.php
config/services.php
database/factories/ModelFactory.php
database/migrations/2014_10_12_000000_create_users_table.php
database/migrations/2015_08_29_105422_add_roles_and_permissions.php
phpspec.yml
resources/views/settings/index.blade.php
resources/views/users/form.blade.php
tests/EntityTest.php
tests/TestCase.php
app/Activity.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -32,7 +32,7 @@ class Activity extends Model
*/
public
function
user
()
{
return
$this
->
belongsTo
(
'
Oxbow
\User'
);
return
$this
->
belongsTo
(
'
BookStack
\User'
);
}
/**
...
...
app/Book.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
class
Book
extends
Entity
{
...
...
@@ -19,12 +19,12 @@ class Book extends Entity
public
function
pages
()
{
return
$this
->
hasMany
(
'
Oxbow
\Page'
);
return
$this
->
hasMany
(
'
BookStack
\Page'
);
}
public
function
chapters
()
{
return
$this
->
hasMany
(
'
Oxbow
\Chapter'
);
return
$this
->
hasMany
(
'
BookStack
\Chapter'
);
}
public
function
children
()
...
...
app/Chapter.php
View file @
8804947
<?php
namespace
Oxbow
;
<?php
namespace
BookStack
;
class
Chapter
extends
Entity
...
...
@@ -8,12 +8,12 @@ class Chapter extends Entity
public
function
book
()
{
return
$this
->
belongsTo
(
'
Oxbow
\Book'
);
return
$this
->
belongsTo
(
'
BookStack
\Book'
);
}
public
function
pages
()
{
return
$this
->
hasMany
(
'
Oxbow
\Page'
)
->
orderBy
(
'priority'
,
'ASC'
);
return
$this
->
hasMany
(
'
BookStack
\Page'
)
->
orderBy
(
'priority'
,
'ASC'
);
}
public
function
getUrl
()
...
...
app/Console/Commands/Inspire.php
View file @
8804947
<?php
namespace
Oxbow
\Console\Commands
;
namespace
BookStack
\Console\Commands
;
use
Illuminate\Console\Command
;
use
Illuminate\Foundation\Inspiring
;
...
...
app/Console/Kernel.php
View file @
8804947
<?php
namespace
Oxbow
\Console
;
namespace
BookStack
\Console
;
use
Illuminate\Console\Scheduling\Schedule
;
use
Illuminate\Foundation\Console\Kernel
as
ConsoleKernel
;
...
...
@@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected
$commands
=
[
\
Oxbow
\Console\Commands\Inspire
::
class
,
\
BookStack
\Console\Commands\Inspire
::
class
,
];
/**
...
...
app/EmailConfirmation.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -10,6 +10,6 @@ class EmailConfirmation extends Model
public
function
user
()
{
return
$this
->
belongsTo
(
'
Oxbow
\User'
);
return
$this
->
belongsTo
(
'
BookStack
\User'
);
}
}
...
...
app/Entity.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -12,7 +12,7 @@ abstract class Entity extends Model
*/
public
function
createdBy
()
{
return
$this
->
belongsTo
(
'
Oxbow
\User'
,
'created_by'
);
return
$this
->
belongsTo
(
'
BookStack
\User'
,
'created_by'
);
}
/**
...
...
@@ -21,7 +21,7 @@ abstract class Entity extends Model
*/
public
function
updatedBy
()
{
return
$this
->
belongsTo
(
'
Oxbow
\User'
,
'updated_by'
);
return
$this
->
belongsTo
(
'
BookStack
\User'
,
'updated_by'
);
}
/**
...
...
@@ -41,7 +41,7 @@ abstract class Entity extends Model
*/
public
function
activity
()
{
return
$this
->
morphMany
(
'
Oxbow
\Activity'
,
'entity'
)
->
orderBy
(
'created_at'
,
'desc'
);
return
$this
->
morphMany
(
'
BookStack
\Activity'
,
'entity'
)
->
orderBy
(
'created_at'
,
'desc'
);
}
/**
...
...
app/Events/Event.php
View file @
8804947
<?php
namespace
Oxbow
\Events
;
namespace
BookStack
\Events
;
abstract
class
Event
{
...
...
app/Exceptions/ConfirmationEmailException.php
View file @
8804947
<?php
namespace
Oxbow
\Exceptions
;
<?php
namespace
BookStack
\Exceptions
;
class
ConfirmationEmailException
extends
NotifyException
...
...
app/Exceptions/Handler.php
View file @
8804947
<?php
namespace
Oxbow
\Exceptions
;
namespace
BookStack
\Exceptions
;
use
Exception
;
use
Symfony\Component\HttpKernel\Exception\HttpException
;
...
...
app/Exceptions/NotifyException.php
View file @
8804947
<?php
namespace
Oxbow
\Exceptions
;
<?php
namespace
BookStack
\Exceptions
;
class
NotifyException
extends
\Exception
...
...
app/Exceptions/SocialDriverNotConfigured.php
View file @
8804947
<?php
namespace
Oxbow
\Exceptions
;
<?php
namespace
BookStack
\Exceptions
;
class
SocialDriverNotConfigured
extends
\Exception
...
...
app/Exceptions/SocialSignInException.php
View file @
8804947
<?php
namespace
Oxbow
\Exceptions
;
<?php
namespace
BookStack
\Exceptions
;
class
SocialSignInException
extends
NotifyException
...
...
app/Exceptions/UserRegistrationException.php
View file @
8804947
<?php
namespace
Oxbow
\Exceptions
;
<?php
namespace
BookStack
\Exceptions
;
class
UserRegistrationException
extends
NotifyException
...
...
app/Http/Controllers/Auth/AuthController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers\Auth
;
namespace
BookStack
\Http\Controllers\Auth
;
use
Illuminate\Http\Request
;
use
Oxbow
\Exceptions\SocialSignInException
;
use
Oxbow
\Exceptions\UserRegistrationException
;
use
Oxbow
\Repos\UserRepo
;
use
Oxbow
\Services\EmailConfirmationService
;
use
Oxbow
\Services\SocialAuthService
;
use
Oxbow
\SocialAccount
;
use
BookStack
\Exceptions\SocialSignInException
;
use
BookStack
\Exceptions\UserRegistrationException
;
use
BookStack
\Repos\UserRepo
;
use
BookStack
\Services\EmailConfirmationService
;
use
BookStack
\Services\SocialAuthService
;
use
BookStack
\SocialAccount
;
use
Validator
;
use
Oxbow
\Http\Controllers\Controller
;
use
BookStack
\Http\Controllers\Controller
;
use
Illuminate\Foundation\Auth\ThrottlesLogins
;
use
Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers
;
...
...
@@ -131,7 +131,7 @@ class AuthController extends Controller
* @param bool|false|SocialAccount $socialAccount
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws UserRegistrationException
* @throws \
Oxbow
\Exceptions\ConfirmationEmailException
* @throws \
BookStack
\Exceptions\ConfirmationEmailException
*/
protected
function
registerUser
(
array
$userData
,
$socialAccount
=
false
)
{
...
...
app/Http/Controllers/Auth/PasswordController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers\Auth
;
namespace
BookStack
\Http\Controllers\Auth
;
use
Oxbow
\Http\Controllers\Controller
;
use
BookStack
\Http\Controllers\Controller
;
use
Illuminate\Foundation\Auth\ResetsPasswords
;
class
PasswordController
extends
Controller
...
...
app/Http/Controllers/BookController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Activity
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Str
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Repos\BookRepo
;
use
Oxbow
\Repos\ChapterRepo
;
use
Oxbow
\Repos\PageRepo
;
use
BookStack
\Http\Requests
;
use
BookStack
\Repos\BookRepo
;
use
BookStack
\Repos\ChapterRepo
;
use
BookStack
\Repos\PageRepo
;
class
BookController
extends
Controller
{
...
...
app/Http/Controllers/ChapterController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Activity
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Http\Controllers\Controller
;
use
Oxbow
\Repos\BookRepo
;
use
Oxbow
\Repos\ChapterRepo
;
use
BookStack
\Http\Requests
;
use
BookStack
\Http\Controllers\Controller
;
use
BookStack
\Repos\BookRepo
;
use
BookStack
\Repos\ChapterRepo
;
class
ChapterController
extends
Controller
{
...
...
app/Http/Controllers/Controller.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
HttpRequestException
;
use
Illuminate\Foundation\Bus\DispatchesJobs
;
...
...
@@ -9,7 +9,7 @@ use Illuminate\Routing\Controller as BaseController;
use
Illuminate\Foundation\Validation\ValidatesRequests
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\Session
;
use
Oxbow
\User
;
use
BookStack
\User
;
abstract
class
Controller
extends
BaseController
{
...
...
app/Http/Controllers/HomeController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Http\Controllers\Controller
;
use
Oxbow
\Repos\BookRepo
;
use
Oxbow
\Services\ActivityService
;
use
Oxbow
\Services\Facades\Activity
;
use
BookStack
\Http\Requests
;
use
BookStack
\Http\Controllers\Controller
;
use
BookStack
\Repos\BookRepo
;
use
BookStack
\Services\ActivityService
;
use
BookStack
\Services\Facades\Activity
;
class
HomeController
extends
Controller
{
...
...
app/Http/Controllers/ImageController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Illuminate\Filesystem\Filesystem
as
File
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Intervention\Image\Facades\Image
as
ImageTool
;
use
Illuminate\Support\Facades\DB
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Image
;
use
Oxbow
\Repos\PageRepo
;
use
BookStack
\Http\Requests
;
use
BookStack
\Image
;
use
BookStack
\Repos\PageRepo
;
class
ImageController
extends
Controller
{
...
...
app/Http/Controllers/PageController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Activity
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Repos\BookRepo
;
use
Oxbow
\Repos\ChapterRepo
;
use
Oxbow
\Repos\PageRepo
;
use
BookStack
\Http\Requests
;
use
BookStack
\Repos\BookRepo
;
use
BookStack
\Repos\ChapterRepo
;
use
BookStack
\Repos\PageRepo
;
class
PageController
extends
Controller
{
...
...
app/Http/Controllers/SearchController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Http\Controllers\Controller
;
use
Oxbow
\Repos\BookRepo
;
use
Oxbow
\Repos\ChapterRepo
;
use
Oxbow
\Repos\PageRepo
;
use
BookStack
\Http\Requests
;
use
BookStack
\Http\Controllers\Controller
;
use
BookStack
\Repos\BookRepo
;
use
BookStack
\Repos\ChapterRepo
;
use
BookStack
\Repos\PageRepo
;
class
SearchController
extends
Controller
{
...
...
app/Http/Controllers/SettingController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Http\Controllers\Controller
;
use
BookStack
\Http\Requests
;
use
BookStack
\Http\Controllers\Controller
;
use
Setting
;
class
SettingController
extends
Controller
...
...
app/Http/Controllers/UserController.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Controllers
;
namespace
BookStack
\Http\Controllers
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Hash
;
use
Oxbow
\Http\Requests
;
use
Oxbow
\Repos\UserRepo
;
use
Oxbow
\Services\SocialAuthService
;
use
Oxbow
\User
;
use
BookStack
\Http\Requests
;
use
BookStack
\Repos\UserRepo
;
use
BookStack
\Services\SocialAuthService
;
use
BookStack
\User
;
class
UserController
extends
Controller
{
...
...
app/Http/Kernel.php
View file @
8804947
<?php
namespace
Oxbow
\Http
;
namespace
BookStack
\Http
;
use
Illuminate\Foundation\Http\Kernel
as
HttpKernel
;
...
...
@@ -13,11 +13,11 @@ class Kernel extends HttpKernel
*/
protected
$middleware
=
[
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode
::
class
,
\
Oxbow
\Http\Middleware\EncryptCookies
::
class
,
\
BookStack
\Http\Middleware\EncryptCookies
::
class
,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse
::
class
,
\Illuminate\Session\Middleware\StartSession
::
class
,
\Illuminate\View\Middleware\ShareErrorsFromSession
::
class
,
\
Oxbow
\Http\Middleware\VerifyCsrfToken
::
class
,
\
BookStack
\Http\Middleware\VerifyCsrfToken
::
class
,
];
/**
...
...
@@ -26,9 +26,9 @@ class Kernel extends HttpKernel
* @var array
*/
protected
$routeMiddleware
=
[
'auth'
=>
\
Oxbow
\Http\Middleware\Authenticate
::
class
,
'auth'
=>
\
BookStack
\Http\Middleware\Authenticate
::
class
,
'auth.basic'
=>
\Illuminate\Auth\Middleware\AuthenticateWithBasicAuth
::
class
,
'guest'
=>
\
Oxbow
\Http\Middleware\RedirectIfAuthenticated
::
class
,
'perm'
=>
\
Oxbow
\Http\Middleware\PermissionMiddleware
::
class
'guest'
=>
\
BookStack
\Http\Middleware\RedirectIfAuthenticated
::
class
,
'perm'
=>
\
BookStack
\Http\Middleware\PermissionMiddleware
::
class
];
}
...
...
app/Http/Middleware/Authenticate.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Middleware
;
namespace
BookStack
\Http\Middleware
;
use
Closure
;
use
Illuminate\Contracts\Auth\Guard
;
use
Oxbow
\Exceptions\UserRegistrationException
;
use
BookStack
\Exceptions\UserRegistrationException
;
use
Setting
;
class
Authenticate
...
...
app/Http/Middleware/EncryptCookies.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Middleware
;
namespace
BookStack
\Http\Middleware
;
use
Illuminate\Cookie\Middleware\EncryptCookies
as
BaseEncrypter
;
...
...
app/Http/Middleware/PermissionMiddleware.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Middleware
;
namespace
BookStack
\Http\Middleware
;
use
Closure
;
use
Illuminate\Support\Facades\Session
;
...
...
app/Http/Middleware/RedirectIfAuthenticated.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Middleware
;
namespace
BookStack
\Http\Middleware
;
use
Closure
;
use
Illuminate\Contracts\Auth\Guard
;
...
...
app/Http/Middleware/VerifyCsrfToken.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Middleware
;
namespace
BookStack
\Http\Middleware
;
use
Illuminate\Foundation\Http\Middleware\VerifyCsrfToken
as
BaseVerifier
;
...
...
app/Http/Requests/Request.php
View file @
8804947
<?php
namespace
Oxbow
\Http\Requests
;
namespace
BookStack
\Http\Requests
;
use
Illuminate\Foundation\Http\FormRequest
;
...
...
app/Image.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
class
Image
extends
Entity
...
...
app/Jobs/Job.php
View file @
8804947
<?php
namespace
Oxbow
\Jobs
;
namespace
BookStack
\Jobs
;
use
Illuminate\Bus\Queueable
;
...
...
app/Page.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -19,12 +19,12 @@ class Page extends Entity
public
function
book
()
{
return
$this
->
belongsTo
(
'
Oxbow
\Book'
);
return
$this
->
belongsTo
(
'
BookStack
\Book'
);
}
public
function
chapter
()
{
return
$this
->
belongsTo
(
'
Oxbow
\Chapter'
);
return
$this
->
belongsTo
(
'
BookStack
\Chapter'
);
}
public
function
hasChapter
()
...
...
@@ -35,7 +35,7 @@ class Page extends Entity
public
function
revisions
()
{
return
$this
->
hasMany
(
'
Oxbow
\PageRevision'
)
->
orderBy
(
'created_at'
,
'desc'
);
return
$this
->
hasMany
(
'
BookStack
\PageRevision'
)
->
orderBy
(
'created_at'
,
'desc'
);
}
public
function
getUrl
()
...
...
app/PageRevision.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -10,12 +10,12 @@ class PageRevision extends Model
public
function
createdBy
()
{
return
$this
->
belongsTo
(
'
Oxbow
\User'
,
'created_by'
);
return
$this
->
belongsTo
(
'
BookStack
\User'
,
'created_by'
);
}
public
function
page
()
{
return
$this
->
belongsTo
(
'
Oxbow
\Page'
);
return
$this
->
belongsTo
(
'
BookStack
\Page'
);
}
public
function
getUrl
()
...
...
app/Permission.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -11,6 +11,6 @@ class Permission extends Model
*/
public
function
roles
()
{
return
$this
->
belongsToMany
(
'
Oxbow
\Permissions'
);
return
$this
->
belongsToMany
(
'
BookStack
\Permissions'
);
}
}
...
...
app/Providers/AppServiceProvider.php
View file @
8804947
<?php
namespace
Oxbow
\Providers
;
namespace
BookStack
\Providers
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\ServiceProvider
;
use
Oxbow
\User
;
use
BookStack
\User
;
class
AppServiceProvider
extends
ServiceProvider
{
...
...
app/Providers/CustomFacadeProvider.php
View file @
8804947
<?php
namespace
Oxbow
\Providers
;
namespace
BookStack
\Providers
;
use
Illuminate\Support\ServiceProvider
;
use
Oxbow
\Services\ActivityService
;
use
Oxbow
\Services\SettingService
;
use
BookStack
\Services\ActivityService
;
use
BookStack
\Services\SettingService
;
class
CustomFacadeProvider
extends
ServiceProvider
{
...
...
@@ -26,12 +26,12 @@ class CustomFacadeProvider extends ServiceProvider
public
function
register
()
{
$this
->
app
->
bind
(
'activity'
,
function
()
{
return
new
ActivityService
(
$this
->
app
->
make
(
'
Oxbow
\Activity'
));
return
new
ActivityService
(
$this
->
app
->
make
(
'
BookStack
\Activity'
));
});
$this
->
app
->
bind
(
'setting'
,
function
()
{
return
new
SettingService
(
$this
->
app
->
make
(
'
Oxbow
\Setting'
),
$this
->
app
->
make
(
'
BookStack
\Setting'
),
$this
->
app
->
make
(
'Illuminate\Contracts\Cache\Repository'
)
);
});
...
...
app/Providers/EventServiceProvider.php
View file @
8804947
<?php
namespace
Oxbow
\Providers
;
namespace
BookStack
\Providers
;
use
Illuminate\Contracts\Events\Dispatcher
as
DispatcherContract
;
use
Illuminate\Foundation\Support\Providers\EventServiceProvider
as
ServiceProvider
;
...
...
@@ -13,8 +13,8 @@ class EventServiceProvider extends ServiceProvider
* @var array
*/
protected
$listen
=
[
'
Oxbow
\Events\SomeEvent'
=>
[
'
Oxbow
\Listeners\EventListener'
,
'
BookStack
\Events\SomeEvent'
=>
[
'
BookStack
\Listeners\EventListener'
,
],
];
...
...
app/Providers/RouteServiceProvider.php
View file @
8804947
<?php
namespace
Oxbow
\Providers
;
namespace
BookStack
\Providers
;
use
Illuminate\Routing\Router
;
use
Illuminate\Foundation\Support\Providers\RouteServiceProvider
as
ServiceProvider
;
...
...
@@ -14,7 +14,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @var string
*/
protected
$namespace
=
'
Oxbow
\Http\Controllers'
;
protected
$namespace
=
'
BookStack
\Http\Controllers'
;
/**
* Define your route model bindings, pattern filters, etc.
...
...
app/Providers/SocialiteServiceProvider.php
View file @
8804947
<?php
namespace
Oxbow
\Providers
;
<?php
namespace
BookStack
\Providers
;
use
Illuminate\Support\ServiceProvider
;
...
...
app/Repos/BookRepo.php
View file @
8804947
<?php
namespace
Oxbow
\Repos
;
<?php
namespace
BookStack
\Repos
;
use
Illuminate\Support\Str
;
use
Oxbow
\Book
;
use
BookStack
\Book
;
class
BookRepo
{
...
...
app/Repos/ChapterRepo.php
View file @
8804947
<?php
namespace
Oxbow
\Repos
;
<?php
namespace
BookStack
\Repos
;
use
Illuminate\Support\Str
;
use
Oxbow
\Chapter
;
use
BookStack
\Chapter
;
class
ChapterRepo
{
...
...
app/Repos/PageRepo.php
View file @
8804947
<?php
namespace
Oxbow
\Repos
;
<?php
namespace
BookStack
\Repos
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Str
;
use
Oxbow
\Page
;
use
Oxbow
\PageRevision
;
use
BookStack
\Page
;
use
BookStack
\PageRevision
;
class
PageRepo
{
...
...
app/Repos/UserRepo.php
View file @
8804947
<?php
namespace
Oxbow
\Repos
;
<?php
namespace
BookStack
\Repos
;
use
Oxbow
\Role
;
use
Oxbow
\User
;
use
BookStack
\Role
;
use
BookStack
\User
;
class
UserRepo
{
...
...
app/Role.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -17,7 +17,7 @@ class Role extends Model
*/
public
function
users
()
{
return
$this
->
belongsToMany
(
'
Oxbow
\User'
);
return
$this
->
belongsToMany
(
'
BookStack
\User'
);
}
/**
...
...
@@ -25,7 +25,7 @@ class Role extends Model
*/
public
function
permissions
()
{
return
$this
->
belongsToMany
(
'
Oxbow
\Permission'
);
return
$this
->
belongsToMany
(
'
BookStack
\Permission'
);
}
/**
...
...
app/Services/ActivityService.php
View file @
8804947
<?php
namespace
Oxbow
\Services
;
<?php
namespace
BookStack
\Services
;
use
Illuminate\Support\Facades\Auth
;
use
Oxbow
\Activity
;
use
Oxbow
\Entity
;
use
BookStack
\Activity
;
use
BookStack
\Entity
;
use
Session
;
class
ActivityService
...
...
@@ -100,7 +100,7 @@ class ActivityService
*/
function
entityActivity
(
$entity
,
$count
=
20
,
$page
=
0
)
{
$activity
=
$entity
->
hasMany
(
'
Oxbow
\Activity'
)
->
orderBy
(
'created_at'
,
'desc'
)
$activity
=
$entity
->
hasMany
(
'
BookStack
\Activity'
)
->
orderBy
(
'created_at'
,
'desc'
)
->
skip
(
$count
*
$page
)
->
take
(
$count
)
->
get
();
return
$this
->
filterSimilar
(
$activity
);
...
...
app/Services/EmailConfirmationService.php
View file @
8804947
<?php
namespace
Oxbow
\Services
;
<?php
namespace
BookStack
\Services
;
use
Carbon\Carbon
;
use
Illuminate\Contracts\Mail\Mailer
;
use
Illuminate\Mail\Message
;
use
Oxbow
\EmailConfirmation
;
use
Oxbow
\Exceptions\ConfirmationEmailException
;
use
Oxbow
\Exceptions\UserRegistrationException
;
use
Oxbow
\Repos\UserRepo
;
use
Oxbow
\Setting
;
use
Oxbow
\User
;
use
BookStack
\EmailConfirmation
;
use
BookStack
\Exceptions\ConfirmationEmailException
;
use
BookStack
\Exceptions\UserRegistrationException
;
use
BookStack
\Repos\UserRepo
;
use
BookStack
\Setting
;
use
BookStack
\User
;
class
EmailConfirmationService
{
...
...
app/Services/Facades/Activity.php
View file @
8804947
<?php
namespace
Oxbow
\Services\Facades
;
<?php
namespace
BookStack
\Services\Facades
;
use
Illuminate\Support\Facades\Facade
;
...
...
app/Services/Facades/Setting.php
View file @
8804947
<?php
namespace
Oxbow
\Services\Facades
;
<?php
namespace
BookStack
\Services\Facades
;
use
Illuminate\Support\Facades\Facade
;
...
...
app/Services/SettingService.php
View file @
8804947
<?php
namespace
Oxbow
\Services
;
<?php
namespace
BookStack
\Services
;
use
Oxbow
\Setting
;
use
BookStack
\Setting
;
use
Illuminate\Contracts\Cache\Repository
as
Cache
;
/**
...
...
@@ -8,7 +8,7 @@ use Illuminate\Contracts\Cache\Repository as Cache;
*
* The settings are a simple key-value database store.
*
* @package
Oxbow
\Services
* @package
BookStack
\Services
*/
class
SettingService
{
...
...
app/Services/SocialAuthService.php
View file @
8804947
<?php
namespace
Oxbow
\Services
;
<?php
namespace
BookStack
\Services
;
use
GuzzleHttp\Exception\ClientException
;
use
Laravel\Socialite\Contracts\Factory
as
Socialite
;
use
Oxbow
\Exceptions\SocialDriverNotConfigured
;
use
Oxbow
\Exceptions\SocialSignInException
;
use
Oxbow
\Exceptions\UserRegistrationException
;
use
Oxbow
\Http\Controllers\Auth\AuthController
;
use
Oxbow
\Repos\UserRepo
;
use
Oxbow
\SocialAccount
;
use
Oxbow
\User
;
use
BookStack
\Exceptions\SocialDriverNotConfigured
;
use
BookStack
\Exceptions\SocialSignInException
;
use
BookStack
\Exceptions\UserRegistrationException
;
use
BookStack
\Http\Controllers\Auth\AuthController
;
use
BookStack
\Repos\UserRepo
;
use
BookStack
\SocialAccount
;
use
BookStack
\User
;
class
SocialAuthService
{
...
...
app/Setting.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
app/SocialAccount.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -11,6 +11,6 @@ class SocialAccount extends Model
public
function
user
()
{
return
$this
->
belongsTo
(
'
Oxbow
\User'
);
return
$this
->
belongsTo
(
'
BookStack
\User'
);
}
}
...
...
app/User.php
View file @
8804947
<?php
namespace
Oxbow
;
namespace
BookStack
;
use
Illuminate\Auth\Authenticatable
;
use
Illuminate\Database\Eloquent\Model
;
...
...
@@ -53,7 +53,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
public
function
roles
()
{
return
$this
->
belongsToMany
(
'
Oxbow
\Role'
);
return
$this
->
belongsToMany
(
'
BookStack
\Role'
);
}
public
function
getRoleAttribute
()
...
...
@@ -103,7 +103,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
*/
public
function
socialAccounts
()
{
return
$this
->
hasMany
(
'
Oxbow
\SocialAccount'
);
return
$this
->
hasMany
(
'
BookStack
\SocialAccount'
);
}
/**
...
...
bootstrap/app.php
View file @
8804947
...
...
@@ -28,17 +28,17 @@ $app = new Illuminate\Foundation\Application(
$app
->
singleton
(
Illuminate\Contracts\Http\Kernel
::
class
,
Oxbow
\Http\Kernel
::
class
BookStack
\Http\Kernel
::
class
);
$app
->
singleton
(
Illuminate\Contracts\Console\Kernel
::
class
,
Oxbow
\Console\Kernel
::
class
BookStack
\Console\Kernel
::
class
);
$app
->
singleton
(
Illuminate\Contracts\Debug\ExceptionHandler
::
class
,
Oxbow
\Exceptions\Handler
::
class
BookStack
\Exceptions\Handler
::
class
);
/*
...
...
composer.json
View file @
8804947
...
...
@@ -22,7 +22,7 @@
"database"
],
"psr-4"
:
{
"
Oxbow
\\
"
:
"app/"
"
BookStack
\\
"
:
"app/"
}
},
"autoload-dev"
:
{
...
...
config/app.php
View file @
8804947
...
...
@@ -148,10 +148,10 @@ return [
/*
* Application Service Providers...
*/
Oxbow
\Providers\AppServiceProvider
::
class
,
Oxbow
\Providers\EventServiceProvider
::
class
,
Oxbow
\Providers\RouteServiceProvider
::
class
,
Oxbow
\Providers\CustomFacadeProvider
::
class
,
BookStack
\Providers\AppServiceProvider
::
class
,
BookStack
\Providers\EventServiceProvider
::
class
,
BookStack
\Providers\RouteServiceProvider
::
class
,
BookStack
\Providers\CustomFacadeProvider
::
class
,
],
...
...
@@ -212,8 +212,8 @@ return [
* Custom
*/
'Activity'
=>
Oxbow
\Services\Facades\Activity
::
class
,
'Setting'
=>
Oxbow
\Services\Facades\Setting
::
class
,
'Activity'
=>
BookStack
\Services\Facades\Activity
::
class
,
'Setting'
=>
BookStack
\Services\Facades\Setting
::
class
,
],
...
...
config/auth.php
View file @
8804947
...
...
@@ -28,7 +28,7 @@ return [
|
*/
'model'
=>
Oxbow
\User
::
class
,
'model'
=>
BookStack
\User
::
class
,
/*
|--------------------------------------------------------------------------
...
...
config/services.php
View file @
8804947
...
...
@@ -30,7 +30,7 @@ return [
],
'stripe'
=>
[
'model'
=>
Oxbow
\User
::
class
,
'model'
=>
BookStack
\User
::
class
,
'key'
=>
''
,
'secret'
=>
''
,
],
...
...
database/factories/ModelFactory.php
View file @
8804947
...
...
@@ -11,7 +11,7 @@
|
*/
$factory
->
define
(
Oxbow
\User
::
class
,
function
(
$faker
)
{
$factory
->
define
(
BookStack
\User
::
class
,
function
(
$faker
)
{
return
[
'name'
=>
$faker
->
name
,
'email'
=>
$faker
->
email
,
...
...
@@ -20,21 +20,21 @@ $factory->define(Oxbow\User::class, function ($faker) {
];
});
$factory
->
define
(
Oxbow
\Book
::
class
,
function
(
$faker
)
{
$factory
->
define
(
BookStack
\Book
::
class
,
function
(
$faker
)
{
return
[
'name'
=>
$faker
->
sentence
,
'description'
=>
$faker
->
paragraph
];
});
$factory
->
define
(
Oxbow
\Chapter
::
class
,
function
(
$faker
)
{
$factory
->
define
(
BookStack
\Chapter
::
class
,
function
(
$faker
)
{
return
[
'name'
=>
$faker
->
sentence
,
'description'
=>
$faker
->
paragraph
];
});
$factory
->
define
(
Oxbow
\Page
::
class
,
function
(
$faker
)
{
$factory
->
define
(
BookStack
\Page
::
class
,
function
(
$faker
)
{
return
[
'name'
=>
$faker
->
sentence
,
'html'
=>
'<p>'
.
implode
(
'</p>'
,
$faker
->
paragraphs
(
5
))
.
'</p>'
...
...
database/migrations/2014_10_12_000000_create_users_table.php
View file @
8804947
...
...
@@ -21,7 +21,7 @@ class CreateUsersTable extends Migration
$table
->
timestamps
();
});
\
Oxbow
\User
::
create
([
\
BookStack
\User
::
create
([
'name'
=>
'Admin'
,
'email'
=>
'admin@admin.com'
,
'password'
=>
\Illuminate\Support\Facades\Hash
::
make
(
'password'
)
...
...
database/migrations/2015_08_29_105422_add_roles_and_permissions.php
View file @
8804947
...
...
@@ -68,19 +68,19 @@ class AddRolesAndPermissions extends Migration
// Create default roles
$admin
=
new
\
Oxbow
\Role
();
$admin
=
new
\
BookStack
\Role
();
$admin
->
name
=
'admin'
;
$admin
->
display_name
=
'Admin'
;
$admin
->
description
=
'Administrator of the whole application'
;
$admin
->
save
();
$editor
=
new
\
Oxbow
\Role
();
$editor
=
new
\
BookStack
\Role
();
$editor
->
name
=
'editor'
;
$editor
->
display_name
=
'Editor'
;
$editor
->
description
=
'User can edit Books, Chapters & Pages'
;
$editor
->
save
();
$viewer
=
new
\
Oxbow
\Role
();
$viewer
=
new
\
BookStack
\Role
();
$viewer
->
name
=
'viewer'
;
$viewer
->
display_name
=
'Viewer'
;
$viewer
->
description
=
'User can view books & their content behind authentication'
;
...
...
@@ -91,7 +91,7 @@ class AddRolesAndPermissions extends Migration
$ops
=
[
'Create'
,
'Update'
,
'Delete'
];
foreach
(
$entities
as
$entity
)
{
foreach
(
$ops
as
$op
)
{
$newPermission
=
new
\
Oxbow
\Permission
();
$newPermission
=
new
\
BookStack
\Permission
();
$newPermission
->
name
=
strtolower
(
$entity
)
.
'-'
.
strtolower
(
$op
);
$newPermission
->
display_name
=
$op
.
' '
.
$entity
.
's'
;
$newPermission
->
save
();
...
...
@@ -105,7 +105,7 @@ class AddRolesAndPermissions extends Migration
$ops
=
[
'Create'
,
'Update'
,
'Delete'
];
foreach
(
$entities
as
$entity
)
{
foreach
(
$ops
as
$op
)
{
$newPermission
=
new
\
Oxbow
\Permission
();
$newPermission
=
new
\
BookStack
\Permission
();
$newPermission
->
name
=
strtolower
(
$entity
)
.
'-'
.
strtolower
(
$op
);
$newPermission
->
display_name
=
$op
.
' '
.
$entity
;
$newPermission
->
save
();
...
...
@@ -115,7 +115,7 @@ class AddRolesAndPermissions extends Migration
// Set all current users as admins
// (At this point only the initially create user should be an admin)
$users
=
\
Oxbow
\User
::
all
();
$users
=
\
BookStack
\User
::
all
();
foreach
(
$users
as
$user
)
{
$user
->
attachRole
(
$admin
);
}
...
...
phpspec.yml
View file @
8804947
suites
:
main
:
namespace
:
Oxbow
psr4_prefix
:
Oxbow
namespace
:
BookStack
psr4_prefix
:
BookStack
src_path
:
app
\ No newline at end of file
...
...
resources/views/settings/index.blade.php
View file @
8804947
...
...
@@ -35,9 +35,9 @@
<div
class=
"form-group"
>
<label
for=
"setting-registration-role"
>
Default user role after registration
</label>
<select
id=
"setting-registration-role"
name=
"setting-registration-role"
@
if
($
errors-
>
has('setting-registration-role')) class="neg" @endif>
@foreach(\
Oxbow
\Role::all() as $role)
@foreach(\
BookStack
\Role::all() as $role)
<option
value=
"{{$role->id}}"
@
if
(\
Setting::get
('
registration-role
',
\
Oxbow
\
Role::getDefault
()
-
>
id) == $role->id) selected @endif
@
if
(\
Setting::get
('
registration-role
',
\
BookStack
\
Role::getDefault
()
-
>
id) == $role->id) selected @endif
>
{{ $role->display_name }}
</option>
...
...
resources/views/users/form.blade.php
View file @
8804947
...
...
@@ -11,7 +11,7 @@
@if($currentUser->can('user-update'))
<div
class=
"form-group"
>
<label
for=
"role"
>
User Role
</label>
@include('form.role-select', ['name' => 'role', 'options' => \
Oxbow
\Role::all(), 'displayKey' => 'display_name'])
@include('form.role-select', ['name' => 'role', 'options' => \
BookStack
\Role::all(), 'displayKey' => 'display_name'])
</div>
@endif
...
...
tests/EntityTest.php
View file @
8804947
...
...
@@ -18,7 +18,7 @@ class EntityTest extends TestCase
$this
->
bookDelete
(
$book
);
}
public
function
bookDelete
(
\
Oxbow
\Book
$book
)
public
function
bookDelete
(
\
BookStack
\Book
$book
)
{
$this
->
asAdmin
()
->
visit
(
$book
->
getUrl
())
...
...
@@ -32,7 +32,7 @@ class EntityTest extends TestCase
->
notSeeInDatabase
(
'books'
,
[
'id'
=>
$book
->
id
]);
}
public
function
bookUpdate
(
\
Oxbow
\Book
$book
)
public
function
bookUpdate
(
\
BookStack
\Book
$book
)
{
$newName
=
$book
->
name
.
' Updated'
;
$this
->
asAdmin
()
...
...
@@ -46,12 +46,12 @@ class EntityTest extends TestCase
->
seePageIs
(
$book
->
getUrl
()
.
'-updated'
)
->
see
(
$newName
);
return
\
Oxbow
\Book
::
find
(
$book
->
id
);
return
\
BookStack
\Book
::
find
(
$book
->
id
);
}
public
function
pageCreation
(
$chapter
)
{
$page
=
factory
(
\
Oxbow
\Page
::
class
)
->
make
([
$page
=
factory
(
\
BookStack
\Page
::
class
)
->
make
([
'name'
=>
'My First Page'
]);
...
...
@@ -68,13 +68,13 @@ class EntityTest extends TestCase
->
seePageIs
(
$chapter
->
book
->
getUrl
()
.
'/page/my-first-page'
)
->
see
(
$page
->
name
);
$page
=
\
Oxbow
\Page
::
where
(
'slug'
,
'='
,
'my-first-page'
)
->
where
(
'chapter_id'
,
'='
,
$chapter
->
id
)
->
first
();
$page
=
\
BookStack
\Page
::
where
(
'slug'
,
'='
,
'my-first-page'
)
->
where
(
'chapter_id'
,
'='
,
$chapter
->
id
)
->
first
();
return
$page
;
}
public
function
chapterCreation
(
\
Oxbow
\Book
$book
)
public
function
chapterCreation
(
\
BookStack
\Book
$book
)
{
$chapter
=
factory
(
\
Oxbow
\Chapter
::
class
)
->
make
([
$chapter
=
factory
(
\
BookStack
\Chapter
::
class
)
->
make
([
'name'
=>
'My First Chapter'
]);
...
...
@@ -91,13 +91,13 @@ class EntityTest extends TestCase
->
seePageIs
(
$book
->
getUrl
()
.
'/chapter/my-first-chapter'
)
->
see
(
$chapter
->
name
)
->
see
(
$chapter
->
description
);
$chapter
=
\
Oxbow
\Chapter
::
where
(
'slug'
,
'='
,
'my-first-chapter'
)
->
where
(
'book_id'
,
'='
,
$book
->
id
)
->
first
();
$chapter
=
\
BookStack
\Chapter
::
where
(
'slug'
,
'='
,
'my-first-chapter'
)
->
where
(
'book_id'
,
'='
,
$book
->
id
)
->
first
();
return
$chapter
;
}
public
function
bookCreation
()
{
$book
=
factory
(
\
Oxbow
\Book
::
class
)
->
make
([
$book
=
factory
(
\
BookStack
\Book
::
class
)
->
make
([
'name'
=>
'My First Book'
]);
$this
->
asAdmin
()
...
...
@@ -113,7 +113,7 @@ class EntityTest extends TestCase
->
seePageIs
(
'/books/my-first-book'
)
->
see
(
$book
->
name
)
->
see
(
$book
->
description
);
$book
=
\
Oxbow
\Book
::
where
(
'slug'
,
'='
,
'my-first-book'
)
->
first
();
$book
=
\
BookStack
\Book
::
where
(
'slug'
,
'='
,
'my-first-book'
)
->
first
();
return
$book
;
}
...
...
tests/TestCase.php
View file @
8804947
...
...
@@ -32,7 +32,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
public
function
asAdmin
()
{
if
(
$this
->
admin
===
null
)
{
$this
->
admin
=
\
Oxbow
\User
::
find
(
1
);
$this
->
admin
=
\
BookStack
\User
::
find
(
1
);
}
return
$this
->
actingAs
(
$this
->
admin
);
}
...
...
Please
register
or
sign in
to post a comment