Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Pagekit\User; use Pagekit\Application as App; use Pagekit\Module\Module;..
Decoded Output download
<?php
namespace Pagekit\User;
use Pagekit\Application as App;
use Pagekit\Module\Module;
use Pagekit\User\Model\Role;
use Pagekit\User\Model\User;
class UserModule extends Module
{
protected $perms = [];
/**
* {@inheritdoc}
*/
public function main(App $app)
{
$app['user'] = function ($app) {
if (!$user = $app['auth']->getUser()) {
$user = User::create(['roles' => [Role::ROLE_ANONYMOUS]]);
}
return $user;
};
}
/**
* @return array
*/
public function getPermissions()
{
if (!$this->perms) {
foreach (App::module() as $module) {
if ($perms = $module->get('permissions')) {
$this->registerPermissions($module->get('name'), $perms);
}
}
App::trigger('user.permission', [$this]);
}
return $this->perms;
}
/**
* Register permissions.
*
* @param string $extension
* @param array $permissions
*/
public function registerPermissions($extension, array $permissions = [])
{
$this->perms[$extension] = $permissions;
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Pagekit\User;
use Pagekit\Application as App;
use Pagekit\Module\Module;
use Pagekit\User\Model\Role;
use Pagekit\User\Model\User;
class UserModule extends Module
{
protected $perms = [];
/**
* {@inheritdoc}
*/
public function main(App $app)
{
$app['user'] = function ($app) {
if (!$user = $app['auth']->getUser()) {
$user = User::create(['roles' => [Role::ROLE_ANONYMOUS]]);
}
return $user;
};
}
/**
* @return array
*/
public function getPermissions()
{
if (!$this->perms) {
foreach (App::module() as $module) {
if ($perms = $module->get('permissions')) {
$this->registerPermissions($module->get('name'), $perms);
}
}
App::trigger('user.permission', [$this]);
}
return $this->perms;
}
/**
* Register permissions.
*
* @param string $extension
* @param array $permissions
*/
public function registerPermissions($extension, array $permissions = [])
{
$this->perms[$extension] = $permissions;
}
}
Function Calls
None |
Stats
MD5 | 9862c16de199cb5a5e76b9e56bc57a13 |
Eval Count | 0 |
Decode Time | 87 ms |