added module support!
This commit is contained in:
1
application/config/.gitignore
vendored
1
application/config/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
local/*
|
||||
@@ -63,6 +63,42 @@ return array(
|
||||
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto-Loaded Packages
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The packages that should be auto-loaded each time Laravel handles
|
||||
| a request. These should generally be packages that you use on almost
|
||||
| every request to your application.
|
||||
|
|
||||
| Each package specified here will be bootstrapped and can be conveniently
|
||||
| used by your application's routes, models, and libraries.
|
||||
|
|
||||
| Note: The package names in this array should correspond to a package
|
||||
| directory in application/packages.
|
||||
|
|
||||
*/
|
||||
|
||||
'packages' => array(),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Active Modules
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Modules are a convenient way to organize your application into logical
|
||||
| components. Each module may have its own libraries, models, routes,
|
||||
| views, language files, and configuration.
|
||||
|
|
||||
| Here you may specify which modules are "active" for your application.
|
||||
| This simply gives Laravel an easy way to know which directories to
|
||||
| check when auto-loading your classes, routes, and views.
|
||||
|
|
||||
*/
|
||||
|
||||
'modules' => array(),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Key
|
||||
|
||||
@@ -50,7 +50,7 @@ return array(
|
||||
|
|
||||
*/
|
||||
|
||||
'logger' => function($severity, $message)
|
||||
'logger' => function($severity, $message, $trace)
|
||||
{
|
||||
File::append(STORAGE_PATH.'log.txt', date('Y-m-d H:i:s').' '.$severity.' - '.$message.PHP_EOL);
|
||||
},
|
||||
|
||||
7
application/config/local/application.php
Normal file
7
application/config/local/application.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
'url' => 'http://localhost/laravel/public'
|
||||
|
||||
);
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto-Loaded Packages
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The packages that should be auto-loaded each time Laravel handles
|
||||
| a request. These should generally be packages that you use on almost
|
||||
| every request to your application.
|
||||
|
|
||||
| Each package specified here will be bootstrapped and can be conveniently
|
||||
| used by your application's routes, models, and libraries.
|
||||
|
|
||||
| Note: The package names in this array should correspond to a package
|
||||
| directory in application/packages.
|
||||
|
|
||||
*/
|
||||
|
||||
'autoload' => array(),
|
||||
|
||||
);
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Named Views
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All of the named views for your application. Once you have defined the
|
||||
| named view, you can create a View instance for that view using the
|
||||
| View::of dynamic method.
|
||||
|
|
||||
| For example, if you define a "layout" named view, you could create an
|
||||
| instance of that View by calling: View::of_layout().
|
||||
|
|
||||
| For more info, check out: http://laravel.com/docs/start/views#named
|
||||
|
|
||||
*/
|
||||
|
||||
'names' => array(
|
||||
|
||||
'home' => 'home/index',
|
||||
|
||||
),
|
||||
|
||||
);
|
||||
@@ -46,13 +46,13 @@ return array(
|
||||
|
||||
'before' => function()
|
||||
{
|
||||
// Do stuff before every request is executed.
|
||||
// Do stuff before every request to your application.
|
||||
},
|
||||
|
||||
|
||||
'after' => function($response)
|
||||
{
|
||||
// Do stuff after every request is executed.
|
||||
// Do stuff after every request to your application.
|
||||
},
|
||||
|
||||
|
||||
|
||||
0
application/libraries/.gitignore
vendored
0
application/libraries/.gitignore
vendored
0
application/models/.gitignore
vendored
0
application/models/.gitignore
vendored
19
application/models/entities/user.php
Normal file
19
application/models/entities/user.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Entities;
|
||||
|
||||
class User extends \Eloquent {
|
||||
|
||||
public function friends()
|
||||
{
|
||||
return $this->has_many('Entities\\Friend');
|
||||
}
|
||||
|
||||
public function roles()
|
||||
{
|
||||
return $this->has_and_belongs_to_many('Role');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Friend extends \Eloquent {}
|
||||
3
application/models/role.php
Normal file
3
application/models/role.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
class Role extends \Eloquent {}
|
||||
0
application/packages/.gitignore
vendored
0
application/packages/.gitignore
vendored
@@ -41,7 +41,7 @@ return array(
|
||||
|
||||
'GET /' => function()
|
||||
{
|
||||
return View::make('home/index');
|
||||
return View::make('home.index');
|
||||
},
|
||||
|
||||
);
|
||||
0
application/storage/cache/.gitignore
vendored
0
application/storage/cache/.gitignore
vendored
1
application/storage/db/.gitignore
vendored
1
application/storage/db/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
*.sqlite
|
||||
0
application/storage/sessions/.gitignore
vendored
0
application/storage/sessions/.gitignore
vendored
@@ -12,8 +12,7 @@ return array(
|
||||
| footer partial each time the view is created.
|
||||
|
|
||||
| The composer will receive an instance of the view being created, and is
|
||||
| free to modify the view however you wish. Be sure to always return the
|
||||
| view instance at the end of your composer.
|
||||
| free to modify the view however you wish.
|
||||
|
|
||||
| For more information, check out: http://laravel.com/docs/start/views#composers
|
||||
|
|
||||
@@ -21,7 +20,7 @@ return array(
|
||||
|
||||
'home/index' => function($view)
|
||||
{
|
||||
return $view;
|
||||
// Do anything you want to the view.
|
||||
},
|
||||
|
||||
);
|
||||
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
|
||||
<div class="wrapper footer">
|
||||
<?php echo System\Benchmark::check('laravel').'ms | '.System\Benchmark::memory(); ?>
|
||||
<?php echo System\Benchmark::check('laravel').'ms | '.System\Benchmark::memory().'mb'; ?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user