Commit c062418e authored by Taylor Otwell's avatar Taylor Otwell

fixing conflicts.

parents 0f5ffdfb 22f99bce
...@@ -5,7 +5,6 @@ use Laravel\Cookie; ...@@ -5,7 +5,6 @@ use Laravel\Cookie;
use Laravel\Config; use Laravel\Config;
use Laravel\Session; use Laravel\Session;
use Laravel\Crypter; use Laravel\Crypter;
use Laravel\Database\Eloquent\Model as Eloquent;
abstract class Driver { abstract class Driver {
......
...@@ -66,6 +66,29 @@ class Eloquent extends Driver { ...@@ -66,6 +66,29 @@ class Eloquent extends Driver {
return false; return false;
} }
/**
* Login the user assigned to the given token.
*
* The token is typically a numeric ID for the user.
*
* @param mixed $token
* @param bool $remember
* @return bool
*/
public function login($token, $remember = false)
{
// if the token is an Eloquent model get the primary key
if ($token instanceof \Eloquent) $token = $token->get_key();
$this->token = $token;
$this->store($token);
if ($remember) $this->remember($token);
return true;
}
/** /**
* Get a fresh model instance. * Get a fresh model instance.
* *
......
...@@ -213,12 +213,12 @@ class Blade { ...@@ -213,12 +213,12 @@ class Blade {
foreach ($matches[0] as $forelse) foreach ($matches[0] as $forelse)
{ {
preg_match('/\$[^\s]*/', $forelse, $variable); preg_match('/\s*\(\s*(\S*)\s/', $forelse, $variable);
// Once we have extracted the variable being looped against, we can add // Once we have extracted the variable being looped against, we can add
// an if statement to the start of the loop that checks if the count // an if statement to the start of the loop that checks if the count
// of the variable being looped against is greater than zero. // of the variable being looped against is greater than zero.
$if = "<?php if (count({$variable[0]}) > 0): ?>"; $if = "<?php if (count({$variable[1]}) > 0): ?>";
$search = '/(\s*)@forelse(\s*\(.*\))/'; $search = '/(\s*)@forelse(\s*\(.*\))/';
......
...@@ -6,36 +6,46 @@ ...@@ -6,36 +6,46 @@
* of the migration resolver and database classes, which are used * of the migration resolver and database classes, which are used
* to perform various support functions for the migrator. * to perform various support functions for the migrator.
*/ */
IoC::register('task: migrate', function() if(! IoC::registered('task: migrate'))
{ {
IoC::register('task: migrate', function()
{
$database = new Tasks\Migrate\Database; $database = new Tasks\Migrate\Database;
$resolver = new Tasks\Migrate\Resolver($database); $resolver = new Tasks\Migrate\Resolver($database);
return new Tasks\Migrate\Migrator($resolver, $database); return new Tasks\Migrate\Migrator($resolver, $database);
}); });
}
/** /**
* The bundle task is responsible for the installation of bundles * The bundle task is responsible for the installation of bundles
* and their dependencies. It utilizes the bundles API to get the * and their dependencies. It utilizes the bundles API to get the
* meta-data for the available bundles. * meta-data for the available bundles.
*/ */
IoC::register('task: bundle', function() if(! IoC::registered('task: bundle'))
{ {
IoC::register('task: bundle', function()
{
$repository = IoC::resolve('bundle.repository'); $repository = IoC::resolve('bundle.repository');
return new Tasks\Bundle\Bundler($repository); return new Tasks\Bundle\Bundler($repository);
}); });
}
/** /**
* The key task is responsible for generating a secure, random * The key task is responsible for generating a secure, random
* key for use by the application when encrypting strings or * key for use by the application when encrypting strings or
* setting the hash values on cookie signatures. * setting the hash values on cookie signatures.
*/ */
IoC::singleton('task: key', function() if(! IoC::registered('task: key'))
{ {
IoC::singleton('task: key', function()
{
return new Tasks\Key; return new Tasks\Key;
}); });
}
/** /**
* The session task is responsible for performing tasks related * The session task is responsible for performing tasks related
...@@ -43,50 +53,65 @@ IoC::singleton('task: key', function() ...@@ -43,50 +53,65 @@ IoC::singleton('task: key', function()
* such as generating the session table or clearing expired * such as generating the session table or clearing expired
* sessions from storage. * sessions from storage.
*/ */
IoC::singleton('task: session', function() if(! IoC::registered('task: session'))
{ {
IoC::singleton('task: session', function()
{
return new Tasks\Session\Manager; return new Tasks\Session\Manager;
}); });
}
/** /**
* The route task is responsible for calling routes within the * The route task is responsible for calling routes within the
* application and dumping the result. This allows for simple * application and dumping the result. This allows for simple
* testing of APIs and JSON based applications. * testing of APIs and JSON based applications.
*/ */
IoC::singleton('task: route', function() if(! IoC::registered('task: route'))
{ {
IoC::singleton('task: route', function()
{
return new Tasks\Route; return new Tasks\Route;
}); });
}
/** /**
* The "test" task is responsible for running the unit tests for * The "test" task is responsible for running the unit tests for
* the application, bundles, and the core framework itself. * the application, bundles, and the core framework itself.
* It provides a nice wrapper around PHPUnit. * It provides a nice wrapper around PHPUnit.
*/ */
IoC::singleton('task: test', function() if(! IoC::registered('task: test'))
{ {
IoC::singleton('task: test', function()
{
return new Tasks\Test\Runner; return new Tasks\Test\Runner;
}); });
}
/** /**
* The bundle repository is responsible for communicating with * The bundle repository is responsible for communicating with
* the Laravel bundle sources to get information regarding any * the Laravel bundle sources to get information regarding any
* bundles that are requested for installation. * bundles that are requested for installation.
*/ */
IoC::singleton('bundle.repository', function() if(! IoC::registered('bundle.repository'))
{ {
IoC::singleton('bundle.repository', function()
{
return new Tasks\Bundle\Repository; return new Tasks\Bundle\Repository;
}); });
}
/** /**
* The bundle publisher is responsible for publishing bundle * The bundle publisher is responsible for publishing bundle
* assets to their correct directories within the install, * assets to their correct directories within the install,
* such as the web accessible directory. * such as the web accessible directory.
*/ */
IoC::singleton('bundle.publisher', function() if(! IoC::registered('bundle.publisher'))
{ {
IoC::singleton('bundle.publisher', function()
{
return new Tasks\Bundle\Publisher; return new Tasks\Bundle\Publisher;
}); });
}
/** /**
* The Github bundle provider installs bundles that live on * The Github bundle provider installs bundles that live on
...@@ -94,7 +119,10 @@ IoC::singleton('bundle.publisher', function() ...@@ -94,7 +119,10 @@ IoC::singleton('bundle.publisher', function()
* and will update the submodule so that the bundle is * and will update the submodule so that the bundle is
* installed into the bundle directory. * installed into the bundle directory.
*/ */
IoC::singleton('bundle.provider: github', function() if(! IoC::registered('bundle.provider: github'))
{ {
IoC::singleton('bundle.provider: github', function()
{
return new Tasks\Bundle\Providers\Github; return new Tasks\Bundle\Providers\Github;
}); });
\ No newline at end of file }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment