本文整理汇总了PHP中Acl::setup方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::setup方法的具体用法?PHP Acl::setup怎么用?PHP Acl::setup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::setup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getClient
/**
* Get a new HttpKernel client instance.
*
* @param array $server
* @return \Symfony\Component\HttpKernel\Client
*/
public function getClient(array $server = array())
{
if (empty($this->app)) {
$this->setUp();
}
// Setup acl
Acl::setup(Config::get('acl::acl'));
return new TestClient($this->app, $server);
}
示例2: testBasicPackage
/**
* A basic functional package test example
*
* @return void
*/
public function testBasicPackage()
{
// Acl package simple test
Acl::setup(Config::get('acl::acl'));
$this->assertFalse(Acl::isAllowed(array('guest'), 'admin_panel'));
$this->assertFalse(Acl::isAllowed(array('user'), 'admin_panel'));
$this->assertTrue(Acl::isAllowed(array('admin'), 'admin_panel'));
// Here we could test other package facades for its basic functionalities...
}
示例3: php_sapi_name
| build a rotating log file setup which creates a new file each day.
|
*/
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile);
/*
|--------------------------------------------------------------------------
| Application ACL
|--------------------------------------------------------------------------
|
| Here we could specify all Access Control List roles and resources
| so that, it available across different part of the application
| @see config/packages/saas/acl/acl.php
*/
if (!App::runningInConsole()) {
Acl::setup(Config::get('acl::acl'));
}
/*
|--------------------------------------------------------------------------
| Application Logger
|--------------------------------------------------------------------------
|
| Here we tell the main logger component to start listening to logger events
*/
if (!App::runningInConsole()) {
Logger::startListening();
}
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------