Skip to content

Commit

Permalink
Swap implementation since it cause an issue with Orchestra\Widget\Wid…
Browse files Browse the repository at this point in the history
…getManager.
  • Loading branch information
crynobone committed Jun 22, 2013
1 parent 3fc39ce commit df84bc4
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions src/Orchestra/Support/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

abstract class Manager extends \Illuminate\Support\Manager {

/**
* Define blacklisted character in name.
*
* @var
*/
protected $blacklisted = array('.');

/**
* Create a new instance.
*
Expand Down Expand Up @@ -74,12 +81,27 @@ protected function getDriverName($driverName)

list($driver, $name) = explode('.', $driverName, 2);

if (Str::contains($name, '.'))
{
throw new InvalidArgumentException("Invalid character in driver name [{$name}].");
}
$this->checkNameIsNotBlacklisted($name);

return array($driver, $name);
}

/**
* Check if name is not blacklisted.
*
* @access protected
* @return void
* @throws \InvalidArgumentException
*/
protected function checkNameIsNotBlacklisted($name)
{
foreach ($this->blacklisted as $character)
{
if (Str::contains($name, $character))
{
throw new InvalidArgumentException("Invalid character in driver name [{$name}].");
}
}
}

}

0 comments on commit df84bc4

Please sign in to comment.