<commit_before><?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\rbac;

use Yii;
use yii\db\Connection;
use yii\db\Query;
use yii\db\Expression;
use yii\base\Exception;
use yii\base\InvalidConfigException;
use yii\base\InvalidCallException;
use yii\base\InvalidParamException;

/**
 * DbManager represents an authorization manager that stores authorization information in database.
 *
 * The database connection is specified by [[db]]. And the database schema
 * should be as described in "framework/rbac/*.sql". You may change the names of
 * the three tables used to store the authorization data by setting [[itemTable]],
 * [[itemChildTable]] and [[assignmentTable]].
 *
 * @property Item[] $items The authorization items of the specific type. This property is read-only.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class DbManager extends Manager
{
	/**
	 * @var Connection|string the DB connection object or the application component ID of the DB connection.
	 * After the DbManager object is created, if you want to change this property, you should only assign it
	 * with a DB connection object.
	 */
	public $db = 'db';
	/**
	 * @var string the name of the table storing authorization items. Defaults to 'tbl_auth_item'.
	 */
	public $itemTable = 'tbl_auth_item';
	/**
	 * @var string the name of the table storing authorization item hierarchy. Defaults to 'tbl_auth_item_child'.
	 */
	public $itemChildTable = 'tbl_auth_item_child';
	/**
	 * @var string the name of the table storing authorization item assignments. Defaults to 'tbl_auth_assignment'.
	 */
	public $assignmentTable = 'tbl_auth_assignment';

	private $_usingSqlite;

	/**
	 * Initializes the application component.
	 * This method overrides the parent implementation by establishing the database connection.
	 */
	public function init()
	{
		if (is_string($this->db)) {
			$this->db = Yii::$app->getComponent($this->db);
		}
		if (!$this->db instanceof Connection) {
			throw new InvalidConfigException("DbManager::db must be either a DB connection instance or the application component ID of a DB connection.");
		}<commit_msg>\yii\rbac\DbManager updated<commit_after><?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace yii\rbac;

use Yii;
use yii\db\Connection;
use yii\db\Query;
use yii\db\Expression;
use yii\base\Exception;
use yii\base\InvalidConfigException;
use yii\base\InvalidCallException;
use yii\base\InvalidParamException;

/**
 * DbManager represents an authorization manager that stores authorization information in database.
 *
 * The database connection is specified by [[db]]. And the database schema
 * should be as described in "framework/rbac/*.sql". You may change the names of
 * the three tables used to store the authorization data by setting [[itemTable]],
 * [[itemChildTable]] and [[assignmentTable]].
 *
 * @property Item[] $items The authorization items of the specific type. This property is read-only.
 *
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 * @since 2.0
 */
class DbManager extends Manager
{
	/**
	 * @var Connection|string the DB connection object or the application component ID of the DB connection.
	 * After the DbManager object is created, if you want to change this property, you should only assign it
	 * with a DB connection object.
	 */
	public $db = 'db';
	/**
	 * @var string the name of the table storing authorization items. Defaults to 'tbl_auth_item'.
	 */
	public $itemTable = '{{%auth_item}}';
	/**
	 * @var string the name of the table storing authorization item hierarchy. Defaults to 'tbl_auth_item_child'.
	 */
	public $itemChildTable = '{{%auth_item_child}';
	/**
	 * @var string the name of the table storing authorization item assignments. Defaults to 'tbl_auth_assignment'.
	 */
	public $assignmentTable = '{{%auth_assignment}}';

	private $_usingSqlite;

	/**
	 * Initializes the application component.
	 * This method overrides the parent implementation by establishing the database connection.
	 */
	public function init()
	{
		if (is_string($this->db)) {
			$this->db = Yii::$app->getComponent($this->db);
		}
		if (!$this->db instanceof Connection) {
			throw new InvalidConfigException("DbManager::db must be either a DB connection instance or the application component ID of a DB connection.");
		}
{'fraction_non_alphanumeric': 0.11177512173528109, 'fraction_numerical': 0.0026560424966799467, 'mean_word_length': 4.2122260668973475, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4974818', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1262, 'n_words': 487}