├── bundles ├── .gitignore ├── bootstrapper │ ├── .gitignore │ ├── public │ │ ├── css │ │ │ └── nav-fix.css │ │ └── img │ │ │ ├── glyphicons-halflings.png │ │ │ └── glyphicons-halflings-white.png │ ├── buttontoolbar.php │ ├── typeahead.php │ ├── icons.php │ ├── buttongroup.php │ ├── breadcrumbs.php │ ├── navbar.php │ ├── helpers.php │ ├── readme.md │ └── start.php ├── bob │ ├── templates │ │ ├── config │ │ │ ├── config.tpl │ │ │ └── option.tpl │ │ ├── view │ │ │ └── view.tpl │ │ ├── class │ │ │ ├── method.tpl │ │ │ └── class.tpl │ │ ├── model │ │ │ ├── model.tpl │ │ │ ├── has_many.tpl │ │ │ ├── has_one.tpl │ │ │ ├── belongs_to.tpl │ │ │ └── has_and_belongs_to_many.tpl │ │ ├── test │ │ │ ├── test_case.tpl │ │ │ └── test.tpl │ │ ├── controller │ │ │ ├── controller.tpl │ │ │ ├── action.tpl │ │ │ └── view.tpl │ │ ├── task │ │ │ ├── method.tpl │ │ │ └── task.tpl │ │ └── bundle │ │ │ └── start.php │ ├── start.php │ ├── config │ │ └── options.php │ ├── classes │ │ └── generators │ │ │ ├── alias.php │ │ │ ├── bundle.php │ │ │ ├── view.php │ │ │ ├── config.php │ │ │ └── test.php │ ├── README.md │ └── license.txt └── docs │ ├── views │ ├── page.blade.php │ └── template.blade.php │ └── routes.php ├── public ├── favicon.ico ├── css │ └── .gitignore ├── img │ └── .gitignore ├── js │ └── .gitignore ├── bundles │ ├── .gitignore │ └── bootstrapper │ │ ├── css │ │ └── nav-fix.css │ │ └── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png ├── laravel │ └── img │ │ └── logoback.png ├── .htaccess └── index.php ├── .gitattributes ├── application ├── tasks │ └── .gitignore ├── libraries │ └── .gitignore ├── migrations │ ├── .gitignore │ ├── 2012_07_28_025521_create_posts.php │ └── 2012_07_28_024855_create_users.php ├── models │ ├── .gitignore │ ├── user.php │ └── post.php ├── config │ ├── .gitignore │ ├── production │ │ └── database.php │ ├── error.php │ ├── cache.php │ └── auth.php ├── language │ ├── nl │ │ └── pagination.php │ ├── ru │ │ └── pagination.php │ └── en │ │ └── pagination.php ├── tests │ └── example.test.php ├── controllers │ ├── base.php │ └── home.php ├── views │ ├── login.blade.php │ ├── new.blade.php │ ├── edit.blade.php │ ├── home.blade.php │ └── templates │ │ └── main.blade.php └── bundles.php ├── storage ├── database │ └── .gitignore ├── cache │ └── .gitignore ├── logs │ └── .gitignore ├── views │ └── .gitignore ├── work │ └── .gitignore └── sessions │ └── .gitignore ├── laravel ├── cli │ ├── tasks │ │ ├── task.php │ │ ├── test │ │ │ ├── stub.xml │ │ │ └── phpunit.php │ │ ├── migrate │ │ │ ├── stub.php │ │ │ └── database.php │ │ ├── bundle │ │ │ ├── providers │ │ │ │ ├── github.php │ │ │ │ └── provider.php │ │ │ ├── repository.php │ │ │ └── publisher.php │ │ ├── session │ │ │ └── migration.php │ │ ├── key.php │ │ └── route.php │ └── artisan.php ├── database │ ├── query │ │ ├── grammars │ │ │ ├── mysql.php │ │ │ ├── postgres.php │ │ │ └── sqlite.php │ │ └── join.php │ ├── expression.php │ ├── connectors │ │ ├── sqlite.php │ │ ├── connector.php │ │ ├── sqlserver.php │ │ ├── postgres.php │ │ └── mysql.php │ ├── exception.php │ └── eloquent │ │ ├── pivot.php │ │ └── relationships │ │ ├── has_one.php │ │ └── has_one_or_many.php ├── session │ └── drivers │ │ ├── sweeper.php │ │ ├── memory.php │ │ ├── apc.php │ │ ├── cookie.php │ │ ├── redis.php │ │ ├── memcached.php │ │ ├── file.php │ │ └── driver.php ├── vendor │ └── Symfony │ │ └── Component │ │ ├── HttpFoundation │ │ ├── File │ │ │ ├── Exception │ │ │ │ ├── UploadException.php │ │ │ │ ├── FileException.php │ │ │ │ ├── UnexpectedTypeException.php │ │ │ │ ├── FileNotFoundException.php │ │ │ │ └── AccessDeniedException.php │ │ │ └── MimeType │ │ │ │ ├── ExtensionGuesserInterface.php │ │ │ │ ├── MimeTypeGuesserInterface.php │ │ │ │ └── FileinfoMimeTypeGuesser.php │ │ ├── Session │ │ │ ├── Storage │ │ │ │ ├── Handler │ │ │ │ │ ├── NativeSessionHandler.php │ │ │ │ │ ├── NativeFileSessionHandler.php │ │ │ │ │ ├── NullSessionHandler.php │ │ │ │ │ ├── NativeSqliteSessionHandler.php │ │ │ │ │ ├── NativeMemcacheSessionHandler.php │ │ │ │ │ └── NativeMemcachedSessionHandler.php │ │ │ │ └── Proxy │ │ │ │ │ ├── NativeProxy.php │ │ │ │ │ └── SessionHandlerProxy.php │ │ │ ├── SessionBagInterface.php │ │ │ ├── Attribute │ │ │ │ └── AttributeBagInterface.php │ │ │ └── Flash │ │ │ │ └── FlashBagInterface.php │ │ ├── RequestMatcherInterface.php │ │ ├── composer.json │ │ ├── LICENSE │ │ ├── LaravelRequest.php │ │ ├── ApacheRequest.php │ │ ├── JsonResponse.php │ │ ├── README.md │ │ ├── ServerBag.php │ │ └── RedirectResponse.php │ │ └── Console │ │ ├── composer.json │ │ ├── Output │ │ ├── NullOutput.php │ │ └── ConsoleOutputInterface.php │ │ ├── Helper │ │ ├── Helper.php │ │ └── HelperInterface.php │ │ ├── LICENSE │ │ ├── README.md │ │ └── Formatter │ │ ├── OutputFormatterStyleInterface.php │ │ └── OutputFormatterInterface.php ├── documentation │ ├── config.md │ ├── encryption.md │ ├── database │ │ ├── raw.md │ │ ├── config.md │ │ └── redis.md │ ├── requests.md │ ├── auth │ │ └── config.md │ ├── logging.md │ ├── ioc.md │ ├── session │ │ └── usage.md │ ├── strings.md │ └── files.md ├── hash.php ├── auth │ └── drivers │ │ ├── eloquent.php │ │ └── fluent.php ├── memcached.php ├── cache │ └── drivers │ │ ├── apc.php │ │ ├── redis.php │ │ └── file.php ├── fluent.php ├── auth.php ├── log.php ├── profiling │ ├── template.blade.php │ └── profiler.php └── uri.php ├── .gitignore ├── Boxfile ├── artisan ├── readme.md └── license.txt /bundles/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/css/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/img/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/js/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /application/tasks/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/bundles/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/libraries/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/migrations/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/models/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /application/config/.gitignore: -------------------------------------------------------------------------------- 1 | local/* -------------------------------------------------------------------------------- /storage/database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite -------------------------------------------------------------------------------- /bundles/bootstrapper/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /storage/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/work/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /bundles/bob/templates/config/config.tpl: -------------------------------------------------------------------------------- 1 | #LOWERFULL# 2 | 3 |
This is the '#LOWERFULL#' view.
4 | -------------------------------------------------------------------------------- /bundles/bob/start.php: -------------------------------------------------------------------------------- 1 | has_many('#WORD#'); 4 | } 5 | 6 | -------------------------------------------------------------------------------- /bundles/bob/templates/model/has_one.tpl: -------------------------------------------------------------------------------- 1 | public function #SINGULAR#() 2 | { 3 | return $this->has_one('#WORD#'); 4 | } 5 | 6 | -------------------------------------------------------------------------------- /bundles/bob/templates/model/belongs_to.tpl: -------------------------------------------------------------------------------- 1 | public function #SINGULAR#() 2 | { 3 | return $this->belongs_to('#WORD#'); 4 | } 5 | 6 | -------------------------------------------------------------------------------- /bundles/bob/templates/controller/controller.tpl: -------------------------------------------------------------------------------- 1 | '« Vorige', 6 | 'next' => 'Volgende »', 7 | 8 | ); -------------------------------------------------------------------------------- /bundles/bob/templates/model/has_and_belongs_to_many.tpl: -------------------------------------------------------------------------------- 1 | public function #PLURAL#() 2 | { 3 | return $this->has_and_belongs_to_many('#WORD#'); 4 | } 5 | 6 | -------------------------------------------------------------------------------- /bundles/bootstrapper/public/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/blog/master/bundles/bootstrapper/public/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /public/bundles/bootstrapper/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/blog/master/public/bundles/bootstrapper/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /bundles/bob/templates/controller/action.tpl: -------------------------------------------------------------------------------- 1 | public function #VERB#_#ACTION#() 2 | { 3 | // code here.. 4 | 5 | return View::make('#LOWERFULL#.#ACTION#'); 6 | } 7 | 8 | -------------------------------------------------------------------------------- /bundles/bootstrapper/public/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/blog/master/bundles/bootstrapper/public/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /public/bundles/bootstrapper/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/msurguy/blog/master/public/bundles/bootstrapper/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /bundles/bob/templates/class/class.tpl: -------------------------------------------------------------------------------- 1 | #LOWERFULL#.#ACTION# 2 | 3 |This view has been auto-generated to accompany the #CLASS#_Controller's action_#ACTION#()
4 | -------------------------------------------------------------------------------- /bundles/bob/templates/test/test.tpl: -------------------------------------------------------------------------------- 1 | /** 2 | * Test that a given condition is met. 3 | * 4 | * @return void 5 | */ 6 | public function test#NAME#() 7 | { 8 | $this->assertTrue(true); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /bundles/bob/templates/task/task.tpl: -------------------------------------------------------------------------------- 1 | has_many('Post'); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /laravel/database/query/grammars/mysql.php: -------------------------------------------------------------------------------- 1 | 4 |{{ Form::label('username', 'Username') }}
11 |{{ Form::text('username') }}
12 | 13 |{{ Form::label('password', 'Password') }}
14 |{{ Form::password('password') }}
15 | 16 |{{ Form::submit('Login', array('class' => 'btn-large')) }}
17 | {{ Form::close() }} 18 |{{ Form::label('post_title', 'Post Title') }}
10 | {{ $errors->first('post_title', Alert::error(":message")) }} 11 |{{ Form::text('post_title', Input::old('post_title')) }}
12 | 13 |{{ Form::label('post_body', 'Post Body') }}
14 | {{ $errors->first('post_body', Alert::error(":message")) }} 15 |{{ Form::textarea('post_body', Input::old('post_body')) }}
16 | 17 |{{ Form::submit('Create') }}
18 | {{ Form::close() }} 19 |{{ Form::label('post_title', 'Post Title') }}
10 | {{ $errors->first('post_title', Alert::error(":message")) }} 11 |{{ Form::text('post_title', ( Input::old('post_title') ? Input::old('post_title') : $post->post_title)) }}
12 | 13 |{{ Form::label('post_body', 'Post Body') }}
14 | {{ $errors->first('post_body', Alert::error(":message")) }} 15 |{{ Form::textarea('post_body', ( Input::old('post_body') ? Input::old('post_body') : $post->post_body)) }}
16 | 17 |{{ Form::submit('Save') }}
18 | {{ Form::close() }} 19 |{{ $post->post_body }}
15 | Posted {{$post->updated_at}} 16 | 17 | @if ( !Auth::guest() ) 18 | {{ Form::open('post/'.$post->id, 'DELETE')}} 19 |{{ Form::submit('Delete', array('class' => 'btn-small')) }}
20 | {{ Form::close() }} 21 | @endif 22 |19 |
20 |20 | php artisan migrate:install 21 | php artisan migrate 22 |23 | If everything is alright, you should see that migration tables are created successfully. 24 | 25 | Then in your browser navigate to where your folder is on your server, and in the "public" of that folder (in my case it is localhost/blog/public). You should see an empty blog. 26 | Click Login on the top right, and then login with the following username and password: 27 |
28 | admin 29 | password 30 |31 | 32 | That's it, you should be able to post and delete entries now! 33 | 34 | ## Contributing to This code 35 | 36 | Contributions are encouraged and welcome. Submit pull requests or ask questions if something's not clear 37 | 38 | ## License 39 | 40 | This Blog is open source and is under MIT license. -------------------------------------------------------------------------------- /laravel/vendor/Symfony/Component/Console/README.md: -------------------------------------------------------------------------------- 1 | Console Component 2 | ================= 3 | 4 | Console eases the creation of beautiful and testable command line interfaces. 5 | 6 | The Application object manages the CLI application: 7 | 8 | use Symfony\Component\Console\Application; 9 | 10 | $console = new Application(); 11 | $console->run(); 12 | 13 | The ``run()`` method parses the arguments and options passed on the command 14 | line and executes the right command. 15 | 16 | Registering a new command can easily be done via the ``register()`` method, 17 | which returns a ``Command`` instance: 18 | 19 | use Symfony\Component\Console\Input\InputInterface; 20 | use Symfony\Component\Console\Input\InputArgument; 21 | use Symfony\Component\Console\Input\InputOption; 22 | use Symfony\Component\Console\Output\OutputInterface; 23 | 24 | $console 25 | ->register('ls') 26 | ->setDefinition(array( 27 | new InputArgument('dir', InputArgument::REQUIRED, 'Directory name'), 28 | )) 29 | ->setDescription('Displays the files in the given directory') 30 | ->setCode(function (InputInterface $input, OutputInterface $output) { 31 | $dir = $input->getArgument('dir'); 32 | 33 | $output->writeln(sprintf('Dir listing for
62 | * // Get an item from the Memcache instance
63 | * $name = Memcached::get('name');
64 | *
65 | * // Store data on the Memcache server
66 | * Memcached::set('name', 'Taylor');
67 | *
68 | */
69 | public static function __callStatic($method, $parameters)
70 | {
71 | return call_user_func_array(array(static::instance(), $method), $parameters);
72 | }
73 |
74 | }
--------------------------------------------------------------------------------
/laravel/cache/drivers/apc.php:
--------------------------------------------------------------------------------
1 | key = $key;
21 | }
22 |
23 | /**
24 | * Determine if an item exists in the cache.
25 | *
26 | * @param string $key
27 | * @return bool
28 | */
29 | public function has($key)
30 | {
31 | return ( ! is_null($this->get($key)));
32 | }
33 |
34 | /**
35 | * Retrieve an item from the cache driver.
36 | *
37 | * @param string $key
38 | * @return mixed
39 | */
40 | protected function retrieve($key)
41 | {
42 | if (($cache = apc_fetch($this->key.$key)) !== false)
43 | {
44 | return $cache;
45 | }
46 | }
47 |
48 | /**
49 | * Write an item to the cache for a given number of minutes.
50 | *
51 | *
52 | * // Put an item in the cache for 15 minutes
53 | * Cache::put('name', 'Taylor', 15);
54 | *
55 | *
56 | * @param string $key
57 | * @param mixed $value
58 | * @param int $minutes
59 | * @return void
60 | */
61 | public function put($key, $value, $minutes)
62 | {
63 | apc_store($this->key.$key, $value, $minutes * 60);
64 | }
65 |
66 | /**
67 | * Write an item to the cache that lasts forever.
68 | *
69 | * @param string $key
70 | * @param mixed $value
71 | * @return void
72 | */
73 | public function forever($key, $value)
74 | {
75 | return $this->put($key, $value, 0);
76 | }
77 |
78 | /**
79 | * Delete an item from the cache.
80 | *
81 | * @param string $key
82 | * @return void
83 | */
84 | public function forget($key)
85 | {
86 | apc_delete($this->key.$key);
87 | }
88 |
89 | }
--------------------------------------------------------------------------------
/laravel/documentation/requests.md:
--------------------------------------------------------------------------------
1 | # Examining Requests
2 |
3 | ## Contents
4 |
5 | - [Working With The URI](#working-with-the-uri)
6 | - [Other Request Helpers](#other-request-helpers)
7 |
8 |
9 | ## Working With The URI
10 |
11 | #### Getting the current URI for the request:
12 |
13 | echo URI::current();
14 |
15 | #### Getting a specific segment from the URI:
16 |
17 | echo URI::segment(1);
18 |
19 | #### Returning a default value if the segment doesn't exist:
20 |
21 | echo URI::segment(10, 'Foo');
22 |
23 | #### Getting the full request URI, including query string:
24 |
25 | echo URI::full();
26 |
27 | Sometimes you may need to determine if the current URI is a given string, or begins with a given string. Here's an example of how you can use the is() method to accomplish this:
28 |
29 | #### Determine if the URI is "home":
30 |
31 | if (URI::is('home'))
32 | {
33 | // The current URI is "home"!
34 | }
35 |
36 | #### Determine if the current URI begins with "docs/":
37 |
38 | if URI::is('docs/*'))
39 | {
40 | // The current URI begins with "docs/"!
41 | }
42 |
43 |
44 | ## Other Request Helpers
45 |
46 | #### Getting the current request method:
47 |
48 | echo Request::method();
49 |
50 | #### Accessing the $_SERVER global array:
51 |
52 | echo Request::server('http_referer');
53 |
54 | #### Retrieving the requester's IP address:
55 |
56 | echo Request::ip();
57 |
58 | #### Determining if the current request is using HTTPS:
59 |
60 | if (Request::secure())
61 | {
62 | // This request is over HTTPS!
63 | }
64 |
65 | #### Determing if the current request is an AJAX request:
66 |
67 | if (Request::ajax())
68 | {
69 | // This request is using AJAX!
70 | }
71 |
72 | #### Determining if the current requst is via the Artisan CLI:
73 |
74 | if (Request::cli())
75 | {
76 | // This request came from the CLI!
77 | }
--------------------------------------------------------------------------------
/laravel/documentation/auth/config.md:
--------------------------------------------------------------------------------
1 | # Auth Configuration
2 |
3 | ## Contents
4 |
5 | - [The Basics](#the-basics)
6 | - [The Authentication Driver](#driver)
7 | - [The Default "Username"](#username)
8 | - [Authentication Model](#model)
9 | - [Authentication Table](#table)
10 |
11 |
12 | ## The Basics
13 |
14 | Most interactive applications have the ability for users to login and logout. Laravel provides a simple class to help you validate user credentials and retrieve information about the current user of your application.
15 |
16 | To get started, let's look over the **application/config/auth.php** file. The authentication configuration contains some basic options to help you get started with authentication.
17 |
18 |
19 | ## The Authentication Driver
20 |
21 | Laravel's authentication is driver based, meaning the responsibility for retrieving users during authentication is delegated to various "drivers". Two are included out of the box: Eloquent and Fluent, but you are free to write your own drivers if needed!
22 |
23 | The **Eloquent** driver uses the Eloquent ORM to load the users of your application, and is the default authentication driver. The **Fluent** driver uses the fluent query builder to load your users.
24 |
25 |
26 | ## The Default "Username"
27 |
28 | The second option in the configuration file determines the default "username" of your users. This will typically correspond to a database column in your "users" table, and will usually be "email" or "username".
29 |
30 |
31 | ## Authentication Model
32 |
33 | When using the **Eloquent** authentication driver, this option determines the Eloquent model that should be used when loading users.
34 |
35 |
36 | ## Authentication Table
37 |
38 | When using the **Fluent** authentication drivers, this option determines the database table containing the users of your application.
--------------------------------------------------------------------------------
/laravel/session/drivers/file.php:
--------------------------------------------------------------------------------
1 | path = $path;
21 | }
22 |
23 | /**
24 | * Load a session from storage by a given ID.
25 | *
26 | * If no session is found for the ID, null will be returned.
27 | *
28 | * @param string $id
29 | * @return array
30 | */
31 | public function load($id)
32 | {
33 | if (file_exists($path = $this->path.$id))
34 | {
35 | return unserialize(file_get_contents($path));
36 | }
37 | }
38 |
39 | /**
40 | * Save a given session to storage.
41 | *
42 | * @param array $session
43 | * @param array $config
44 | * @param bool $exists
45 | * @return void
46 | */
47 | public function save($session, $config, $exists)
48 | {
49 | file_put_contents($this->path.$session['id'], serialize($session), LOCK_EX);
50 | }
51 |
52 | /**
53 | * Delete a session from storage by a given ID.
54 | *
55 | * @param string $id
56 | * @return void
57 | */
58 | public function delete($id)
59 | {
60 | if (file_exists($this->path.$id))
61 | {
62 | @unlink($this->path.$id);
63 | }
64 | }
65 |
66 | /**
67 | * Delete all expired sessions from persistant storage.
68 | *
69 | * @param int $expiration
70 | * @return void
71 | */
72 | public function sweep($expiration)
73 | {
74 | $files = glob($this->path.'*');
75 |
76 | if ($files === false) return;
77 |
78 | foreach ($files as $file)
79 | {
80 | if (filetype($file) == 'file' and filemtime($file) < $expiration)
81 | {
82 | @unlink($file);
83 | }
84 | }
85 | }
86 |
87 | }
--------------------------------------------------------------------------------
/laravel/cache/drivers/redis.php:
--------------------------------------------------------------------------------
1 | redis = $redis;
21 | }
22 |
23 | /**
24 | * Determine if an item exists in the cache.
25 | *
26 | * @param string $key
27 | * @return bool
28 | */
29 | public function has($key)
30 | {
31 | return ( ! is_null($this->redis->get($key)));
32 | }
33 |
34 | /**
35 | * Retrieve an item from the cache driver.
36 | *
37 | * @param string $key
38 | * @return mixed
39 | */
40 | protected function retrieve($key)
41 | {
42 | if ( ! is_null($cache = $this->redis->get($key)))
43 | {
44 | return unserialize($cache);
45 | }
46 | }
47 |
48 | /**
49 | * Write an item to the cache for a given number of minutes.
50 | *
51 | *
52 | * // Put an item in the cache for 15 minutes
53 | * Cache::put('name', 'Taylor', 15);
54 | *
55 | *
56 | * @param string $key
57 | * @param mixed $value
58 | * @param int $minutes
59 | * @return void
60 | */
61 | public function put($key, $value, $minutes)
62 | {
63 | $this->forever($key, $value);
64 |
65 | $this->redis->expire($key, $minutes * 60);
66 | }
67 |
68 | /**
69 | * Write an item to the cache that lasts forever.
70 | *
71 | * @param string $key
72 | * @param mixed $value
73 | * @return void
74 | */
75 | public function forever($key, $value)
76 | {
77 | $this->redis->set($key, serialize($value));
78 | }
79 |
80 | /**
81 | * Delete an item from the cache.
82 | *
83 | * @param string $key
84 | * @return void
85 | */
86 | public function forget($key)
87 | {
88 | $this->redis->del($key);
89 | }
90 |
91 | }
--------------------------------------------------------------------------------
/laravel/documentation/logging.md:
--------------------------------------------------------------------------------
1 | # Errors & Logging
2 |
3 | ## Contents
4 |
5 | - [Basic Configuration](#basic-configuration)
6 | - [Logging](#logging)
7 | - [The Logger Class](#the-logger-class)
8 |
9 |
10 | ## Basic Configuration
11 |
12 | All of the configuration options regarding errors and logging live in the **application/config/errors.php** file. Let's jump right in.
13 |
14 | ### Ignored Errors
15 |
16 | The **ignore** option contains an array of error levels that should be ignored by Laravel. By "ignored", we mean that we won't stop execution of the script on these errors. However, they will be logged when logging is enabled.
17 |
18 | ### Error Detail
19 |
20 | The **detail** option indicates if the framework should display the error message and stack trace when an error occurs. For development, you will want this to be **true**. However, in a production environment, set this to **false**. When disabled, the view located in **application/views/error/500.php** will be displayed, which contains a generic error message.
21 |
22 |
23 | ## Logging
24 |
25 | To enable logging, set the **log** option in the error configuration to "true". When enabled, the Closure defined by the **logger** configuration item will be executed when an error occurs. This gives you total flexibility in how the error should be logged. You can even e-mail the errors to your development team!
26 |
27 | By default, logs are stored in the **storage/logs** direcetory, and a new log file is created for each day. This keeps your log files from getting crowded with too many messages.
28 |
29 |
30 | ## The Logger Class
31 |
32 | Sometimes you may wish to use Laravel's **Log** class for debugging, or just to log informational messages. Here's how to use it:
33 |
34 | #### Writing a message to the logs:
35 |
36 | Log::write('info', 'This is just an informational message!');
37 |
38 | #### Using magic methods to specify the log message type:
39 |
40 | Log::info('This is just an informational message!');
--------------------------------------------------------------------------------
/bundles/docs/routes.php:
--------------------------------------------------------------------------------
1 | with('sidebar', document('contents'));
46 | });
47 |
48 | /**
49 | * Handle the documentation homepage.
50 | *
51 | * This page contains the "introduction" to Laravel.
52 | */
53 | Route::get('(:bundle)', function()
54 | {
55 | return View::make('docs::page')->with('content', document('home'));
56 | });
57 |
58 | /**
59 | * Handle documentation routes for sections and pages.
60 | *
61 | * @param string $section
62 | * @param string $page
63 | * @return mixed
64 | */
65 | Route::get('(:bundle)/(:any)/(:any?)', function($section, $page = null)
66 | {
67 | $file = rtrim(implode('/', func_get_args()), '/');
68 |
69 | // If no page was specified, but a "home" page exists for the section,
70 | // we'll set the file to the home page so that the proper page is
71 | // display back out to the client for the requested doc page.
72 | if (is_null($page) and document_exists($file.'/home'))
73 | {
74 | $file .= '/home';
75 | }
76 |
77 | if (document_exists($file))
78 | {
79 | return View::make('docs::page')->with('content', document($file));
80 | }
81 | else
82 | {
83 | return Response::error('404');
84 | }
85 | });
--------------------------------------------------------------------------------
/laravel/session/drivers/driver.php:
--------------------------------------------------------------------------------
1 | $this->id(), 'data' => array(
44 | ':new:' => array(),
45 | ':old:' => array(),
46 | ));
47 | }
48 |
49 | /**
50 | * Get a new session ID that isn't assigned to any current session.
51 | *
52 | * @return string
53 | */
54 | public function id()
55 | {
56 | $session = array();
57 |
58 | // If the driver is an instance of the Cookie driver, we are able to
59 | // just return any string since the Cookie driver has no real idea
60 | // of a server side persisted session with an ID.
61 | if ($this instanceof Cookie)
62 | {
63 | return Str::random(40);
64 | }
65 |
66 | // We'll containue generating random IDs until we find an ID that is
67 | // not currently assigned to a session. This is almost definitely
68 | // going to happen on the first iteration.
69 | do {
70 |
71 | $session = $this->load($id = Str::random(40));
72 |
73 | } while ( ! is_null($session));
74 |
75 | return $id;
76 | }
77 |
78 | }
--------------------------------------------------------------------------------
/laravel/documentation/ioc.md:
--------------------------------------------------------------------------------
1 | # IoC Container
2 |
3 | - [Definition](/docs/ioc#definition)
4 | - [Registering Objects](/docs/ioc#register)
5 | - [Resolving Objects](/docs/ioc#resolve)
6 |
7 |
8 | ## Definition
9 |
10 | An IoC container is simply a way of managing the creation of objects. You can use it to define the creation of complex objects, allowing you to resolve them throughout your application using a single line of code. You may also use it to "inject" dependencies into your classes and controllers.
11 |
12 | IoC containers help make your application more flexible and testable. Since you may register alternate implementations of an interface with the container, you may isolate the code you are testing from external dependencies using [stubs and mocks](http://martinfowler.com/articles/mocksArentStubs.html).
13 |
14 |
15 | ## Registering Objects
16 |
17 | #### Registering a resolver in the IoC container:
18 |
19 | IoC::register('mailer', function()
20 | {
21 | $transport = Swift_MailTransport::newInstance();
22 |
23 | return Swift_Mailer::newInstance($transport);
24 | });
25 |
26 |
27 | Great! Now we have registered a resolver for SwiftMailer in our container. But, what if we don't want the container to create a new mailer instance every time we need one? Maybe we just want the container to return the same instance after the intial instance is created. Just tell the container the object should be a singleton:
28 |
29 | #### Registering a singleton in the container:
30 |
31 | IoC::singleton('mailer', function()
32 | {
33 | //
34 | });
35 |
36 | You may also register an existing object instance as a singleton in the container.
37 |
38 | #### Registering an existing instance in the container:
39 |
40 | IoC::instance('mailer', $instance);
41 |
42 |
43 | ## Resolving Objects
44 |
45 | Now that we have SwiftMailer registered in the container, we can resolve it using the **resolve** method on the **IoC** class:
46 |
47 | $mailer = IoC::resolve('mailer');
48 |
49 | > **Note:** You may also [register controllers in the container](/docs/controllers#dependency-injection).
--------------------------------------------------------------------------------
/laravel/vendor/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace Symfony\Component\HttpFoundation\Session\Flash;
13 |
14 | use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
15 |
16 | /**
17 | * FlashBagInterface.
18 | *
19 | * @author Drak
47 | * // Fluently set the value of a few attributes
48 | * $fluent->name('Taylor')->age(25);
49 | *
50 | * // Set the value of an attribute to true (boolean)
51 | * $fluent->nullable()->name('Taylor');
52 | *
53 | */
54 | public function __call($method, $parameters)
55 | {
56 | $this->$method = (count($parameters) > 0) ? $parameters[0] : true;
57 |
58 | return $this;
59 | }
60 |
61 | /**
62 | * Dynamically retrieve the value of an attribute.
63 | */
64 | public function __get($key)
65 | {
66 | if (array_key_exists($key, $this->attributes))
67 | {
68 | return $this->attributes[$key];
69 | }
70 | }
71 |
72 | /**
73 | * Dynamically set the value of an attribute.
74 | */
75 | public function __set($key, $value)
76 | {
77 | $this->attributes[$key] = $value;
78 | }
79 |
80 | /**
81 | * Dynamically check if an attribute is set.
82 | */
83 | public function __isset($key)
84 | {
85 | return isset($this->attributes[$key]);
86 | }
87 |
88 | /**
89 | * Dynamically unset an attribute.
90 | */
91 | public function __unset($key)
92 | {
93 | unset($this->attributes[$key]);
94 | }
95 |
96 | }
--------------------------------------------------------------------------------
/bundles/bootstrapper/navbar.php:
--------------------------------------------------------------------------------
1 | ';
41 | $html .= '';
74 | return $html;
75 | }
76 | }
--------------------------------------------------------------------------------
/laravel/auth.php:
--------------------------------------------------------------------------------
1 |
81 | * // Call the "user" method on the default auth driver
82 | * $user = Auth::user();
83 | *
84 | * // Call the "check" method on the default auth driver
85 | * Auth::check();
86 | *
87 | */
88 | public static function __callStatic($method, $parameters)
89 | {
90 | return call_user_func_array(array(static::driver(), $method), $parameters);
91 | }
92 |
93 | }
--------------------------------------------------------------------------------
/laravel/vendor/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeMemcacheSessionHandler.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
13 |
14 | /**
15 | * NativeMemcacheSessionHandler.
16 | *
17 | * Driver for the memcache session save hadlers provided by the memcache PHP extension.
18 | *
19 | * @see http://php.net/memcache
20 | *
21 | * @author Drak
31 | * // Write an "error" messge to the log file
32 | * Log::write('error', 'Something went horribly wrong!');
33 | *
34 | * // Write an "error" message using the class' magic method
35 | * Log::error('Something went horribly wrong!');
36 | *
37 | *
38 | * @param string $type
39 | * @param string $message
40 | * @return void
41 | */
42 | public static function write($type, $message)
43 | {
44 | // If there is a listener for the log event, we'll delegate the logging
45 | // to the event and not write to the log files. This allows for quick
46 | // swapping of log implementations for debugging.
47 | if (Event::listeners('laravel.log'))
48 | {
49 | Event::fire('laravel.log', array($type, $message));
50 | }
51 |
52 | // If there aren't listeners on the log event, we'll just write to the
53 | // log files using the default conventions, writing one log file per
54 | // day so they files don't get too crowded.
55 | else
56 | {
57 | $message = static::format($type, $message);
58 |
59 | File::append(path('storage').'logs/'.date('Y-m-d').'.log', $message);
60 | }
61 | }
62 |
63 | /**
64 | * Format a log message for logging.
65 | *
66 | * @param string $type
67 | * @param
68 | */
69 | protected static function format($type, $message)
70 | {
71 | return date('Y-m-d H:i:s').' '.Str::upper($type)." - {$message}".PHP_EOL;
72 | }
73 |
74 | /**
75 | * Dynamically write a log message.
76 | *
77 | *
78 | * // Write an "error" message to the log file
79 | * Log::error('This is an error!');
80 | *
81 | * // Write a "warning" message to the log file
82 | * Log::warning('This is a warning!');
83 | *
84 | */
85 | public static function __callStatic($method, $parameters)
86 | {
87 | static::write($method, $parameters[0]);
88 | }
89 |
90 | }
--------------------------------------------------------------------------------
/laravel/cache/drivers/file.php:
--------------------------------------------------------------------------------
1 | path = $path;
21 | }
22 |
23 | /**
24 | * Determine if an item exists in the cache.
25 | *
26 | * @param string $key
27 | * @return bool
28 | */
29 | public function has($key)
30 | {
31 | return ( ! is_null($this->get($key)));
32 | }
33 |
34 | /**
35 | * Retrieve an item from the cache driver.
36 | *
37 | * @param string $key
38 | * @return mixed
39 | */
40 | protected function retrieve($key)
41 | {
42 | if ( ! file_exists($this->path.$key)) return null;
43 |
44 | // File based caches store have the expiration timestamp stored in
45 | // UNIX format prepended to their contents. We'll compare the
46 | // timestamp to the current time when we read the file.
47 | if (time() >= substr($cache = file_get_contents($this->path.$key), 0, 10))
48 | {
49 | return $this->forget($key);
50 | }
51 |
52 | return unserialize(substr($cache, 10));
53 | }
54 |
55 | /**
56 | * Write an item to the cache for a given number of minutes.
57 | *
58 | *
59 | * // Put an item in the cache for 15 minutes
60 | * Cache::put('name', 'Taylor', 15);
61 | *
62 | *
63 | * @param string $key
64 | * @param mixed $value
65 | * @param int $minutes
66 | * @return void
67 | */
68 | public function put($key, $value, $minutes)
69 | {
70 | if ($minutes <= 0) return;
71 |
72 | $value = $this->expiration($minutes).serialize($value);
73 |
74 | file_put_contents($this->path.$key, $value, LOCK_EX);
75 | }
76 |
77 | /**
78 | * Write an item to the cache for five years.
79 | *
80 | * @param string $key
81 | * @param mixed $value
82 | * @return void
83 | */
84 | public function forever($key, $value)
85 | {
86 | return $this->put($key, $value, 2628000);
87 | }
88 |
89 | /**
90 | * Delete an item from the cache.
91 | *
92 | * @param string $key
93 | * @return void
94 | */
95 | public function forget($key)
96 | {
97 | if (file_exists($this->path.$key)) @unlink($this->path.$key);
98 | }
99 |
100 | }
--------------------------------------------------------------------------------
/bundles/bootstrapper/start.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/alert.php',
15 | 'Bootstrapper\\Badges' => __DIR__.'/badges.php',
16 | 'Bootstrapper\\Breadcrumbs' => __DIR__.'/breadcrumbs.php',
17 | 'Bootstrapper\\ButtonGroup' => __DIR__.'/buttongroup.php',
18 | 'Bootstrapper\\Buttons' => __DIR__.'/buttons.php',
19 | 'Bootstrapper\\ButtonToolbar' => __DIR__.'/buttontoolbar.php',
20 | 'Bootstrapper\\Carousel' => __DIR__.'/carousel.php',
21 | 'Bootstrapper\\DropdownButton' => __DIR__.'/dropdownbutton.php',
22 | 'Bootstrapper\\Form' => __DIR__.'/form.php',
23 | 'Bootstrapper\\Helpers' => __DIR__.'/helpers.php',
24 | 'Bootstrapper\\Icons' => __DIR__.'/icons.php',
25 | 'Bootstrapper\\Labels' => __DIR__.'/labels.php',
26 | 'Bootstrapper\\Navbar' => __DIR__.'/navbar.php',
27 | 'Bootstrapper\\Navigation' => __DIR__.'/navigation.php',
28 | 'Bootstrapper\\Paginator' => __DIR__.'/paginator.php',
29 | 'Bootstrapper\\Progress' => __DIR__.'/progress.php',
30 | 'Bootstrapper\\SplitDropdownButton' => __DIR__.'/splitdropdownbutton.php',
31 | 'Bootstrapper\\Tabbable' => __DIR__.'/tabbable.php',
32 | 'Bootstrapper\\Typeahead' => __DIR__.'/typeahead.php',
33 | ));
34 |
35 | Asset::container('bootstrapper')->bundle('bootstrapper');
36 |
37 | //Asset::container('bootstrapper')->add('jquery', 'js/jquery-1.7.2.js');
38 | Asset::container('bootstrapper')->add('jquery', 'js/jquery-1.7.2.min.js');
39 |
40 | //Asset::container('bootstrapper')->add('bootstrap', 'css/bootstrap.css');
41 | Asset::container('bootstrapper')->add('bootstrap', 'css/bootstrap.min.css');
42 |
43 | //Not Needed if you don't have the top nav bar
44 | Asset::container('bootstrapper')->add('nav-fix', 'css/nav-fix.css');
45 |
46 | //Asset::container('bootstrapper')->add('bootstrap-responsive', 'css/bootstrap-responsive.css');
47 | Asset::container('bootstrapper')->add('bootstrap-responsive', 'css/bootstrap-responsive.min.css');
48 |
49 | //Asset::container('bootstrapper')->add('bootstrap-js', 'js/bootstrap.js');
50 | Asset::container('bootstrapper')->add('bootstrap-js', 'js/bootstrap.min.js');
--------------------------------------------------------------------------------
/application/config/cache.php:
--------------------------------------------------------------------------------
1 | 'file',
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Cache Key
27 | |--------------------------------------------------------------------------
28 | |
29 | | This key will be prepended to item keys stored using Memcached and APC
30 | | to prevent collisions with other applications on the server. Since the
31 | | memory based stores could be shared by other applications, we need to
32 | | be polite and use a prefix to uniquely identifier our items.
33 | |
34 | */
35 |
36 | 'key' => 'laravel',
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Cache Database
41 | |--------------------------------------------------------------------------
42 | |
43 | | When using the database cache driver, this database table will be used
44 | | to store the cached item. You may also add a "connection" option to
45 | | the array to specify which database connection should be used.
46 | |
47 | */
48 |
49 | 'database' => array('table' => 'laravel_cache'),
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Memcached Servers
54 | |--------------------------------------------------------------------------
55 | |
56 | | The Memcached servers used by your application. Memcached is a free and
57 | | open source, high-performance, distributed memory caching system. It is
58 | | generic in nature but intended for use in speeding up web applications
59 | | by alleviating database load.
60 | |
61 | | For more information, check out: http://memcached.org
62 | |
63 | */
64 |
65 | 'memcached' => array(
66 |
67 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
68 |
69 | ),
70 |
71 | );
--------------------------------------------------------------------------------
/laravel/profiling/template.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | | Type | 11 |Message | 12 |
|---|---|
| 16 | {{ $log[0] }} 17 | | 18 |19 | {{ $log[1] }} 20 | | 21 | @endforeach 22 |
| Time | 34 |Query | 35 |
|---|---|
| 39 | {{ $query[1] }}ms 40 | | 41 |
42 | {{ $query[0] }}
43 | |
44 |