Skip to content

Commit

Permalink
Moved honeypot service out of the app Services file to the system Ser…
Browse files Browse the repository at this point in the history
…vices where it belongs.
  • Loading branch information
lonnieezell committed Dec 17, 2018
1 parent 6724e67 commit 614216d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
16 changes: 0 additions & 16 deletions app/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,4 @@ class Services extends CoreServices
//
// return new \CodeIgniter\Example();
// }

public static function honeypot(BaseConfig $config = null, $getShared = true)
{
if ($getShared)
{
return static::getSharedInstance('honeypot', $config);
}

if (is_null($config))
{
$config = new \Config\Honeypot();
}

return new \CodeIgniter\Honeypot\Honeypot($config);
}

}
26 changes: 26 additions & 0 deletions system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,32 @@ public static function filters($config = null, bool $getShared = true)

//--------------------------------------------------------------------

/**
* The Honeypot provides a secret input on forms that bots should NOT
* fill in, providing an additional safeguard when accepting user input.
*
* @param \CodeIgniter\Config\BaseConfig|null $config
* @param boolean $getShared
*
* @return \CodeIgniter\Honeypot\Honeypot|mixed
*/
public static function honeypot(BaseConfig $config = null, $getShared = true)
{
if ($getShared)
{
return static::getSharedInstance('honeypot', $config);
}

if (is_null($config))
{
$config = new \Config\Honeypot();
}

return new \CodeIgniter\Honeypot\Honeypot($config);
}

//--------------------------------------------------------------------

/**
* Acts as a factory for ImageHandler classes and returns an instance
* of the handler. Used like Services::image()->withFile($path)->rotate(90)->save();
Expand Down

0 comments on commit 614216d

Please sign in to comment.