* @since 2.0
*/
@@ -61,22 +58,6 @@ class FileTarget extends Target
* but read-only for other users.
*/
public $dirMode = 0775;
- /**
- * @var bool Whether to rotate log files by copy and truncate in contrast to rotation by
- * renaming files. Defaults to `true` to be more compatible with log tailers and windows
- * systems which do not play well with rename on open files. Rotation by renaming however is
- * a bit faster.
- *
- * The problem with windows systems where the [rename()](https://www.php.net/manual/en/function.rename.php)
- * function does not work with files that are opened by some process is described in a
- * [comment by Martin Pelletier](https://www.php.net/manual/en/function.rename.php#102274) in
- * the PHP documentation. By setting rotateByCopy to `true` you can work
- * around this.
- * @deprecated since 2.0.46 and setting it to false has no effect anymore
- * since rotating is now always done by copy.
- */
- public $rotateByCopy = true;
-
/**
* Initializes the route.
diff --git a/mail/BaseMailer.php b/mail/BaseMailer.php
index c5f76fb75..e334d74aa 100644
--- a/mail/BaseMailer.php
+++ b/mail/BaseMailer.php
@@ -142,7 +142,7 @@ public function getView()
protected function createView(array $config)
{
if (!array_key_exists('class', $config)) {
- $config['class'] = View::className();
+ $config['class'] = View::class;
}
return Yii::createObject($config);
diff --git a/mutex/DbMutex.php b/mutex/DbMutex.php
index 593cff4e0..a19a1adf8 100644
--- a/mutex/DbMutex.php
+++ b/mutex/DbMutex.php
@@ -37,6 +37,6 @@ abstract class DbMutex extends Mutex
public function init()
{
parent::init();
- $this->db = Instance::ensure($this->db, Connection::className());
+ $this->db = Instance::ensure($this->db, Connection::class);
}
}
diff --git a/package.json b/package.json
new file mode 100644
index 000000000..09a66d2bc
--- /dev/null
+++ b/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "yii2",
+ "description": "a modern PHP framework designed for professional Web development",
+ "dependencies": {
+ "inputmask": "^5.0.8",
+ "jquery-pjax": "^2.0.1",
+ "jquery": "~3.6.4",
+ "punycode": "^1.4.0",
+ "yii2-pjax": "^2.0.8"
+ },
+ "keywords": [
+ "php",
+ "framework"
+ ],
+ "license": "BSD-3-Clause",
+ "bugs": {
+ "url": "https://github.com/yiisoft/yii2/issues"
+ },
+ "homepage": "https://github.com/yiisoft/yii2"
+}
diff --git a/rbac/CheckAccessInterface.php b/rbac/CheckAccessInterface.php
index 38d86ee7a..7f4dce00b 100644
--- a/rbac/CheckAccessInterface.php
+++ b/rbac/CheckAccessInterface.php
@@ -23,7 +23,7 @@ interface CheckAccessInterface
* @param array $params name-value pairs that will be passed to the rules associated
* with the roles and permissions assigned to the user.
* @return bool whether the user has the specified permission.
- * @throws \yii\base\InvalidParamException if $permissionName does not refer to an existing permission
+ * @throws \yii\base\InvalidArgumentException if $permissionName does not refer to an existing permission
*/
public function checkAccess($userId, $permissionName, $params = []);
}
diff --git a/rbac/DbManager.php b/rbac/DbManager.php
index 2685ad5a1..240914838 100644
--- a/rbac/DbManager.php
+++ b/rbac/DbManager.php
@@ -119,7 +119,7 @@ class DbManager extends BaseManager
public function init()
{
parent::init();
- $this->db = Instance::ensure($this->db, Connection::className());
+ $this->db = Instance::ensure($this->db, Connection::class);
if ($this->cache !== null) {
$this->cache = Instance::ensure($this->cache, 'yii\caching\CacheInterface');
}
@@ -449,7 +449,7 @@ protected function getItems($type)
*/
protected function populateItem($row)
{
- $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();
+ $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::class : Role::class;
if (!isset($row['data']) || ($data = @unserialize(is_resource($row['data']) ? stream_get_contents($row['data']) : $row['data'])) === false) {
$data = null;
diff --git a/rbac/ManagerInterface.php b/rbac/ManagerInterface.php
index e4d2c7029..fec06fdc0 100644
--- a/rbac/ManagerInterface.php
+++ b/rbac/ManagerInterface.php
@@ -83,7 +83,7 @@ public function getRolesByUser($userId);
* @param string $roleName name of the role to file child roles for
* @return Role[] Child roles. The array is indexed by the role names.
* First element is an instance of the parent Role itself.
- * @throws \yii\base\InvalidParamException if Role was not found that are getting by $roleName
+ * @throws \yii\base\InvalidArgumentException if Role was not found that are getting by $roleName
* @since 2.0.10
*/
public function getChildRoles($roleName);
diff --git a/rbac/PhpManager.php b/rbac/PhpManager.php
index 291d72976..9411a7f93 100644
--- a/rbac/PhpManager.php
+++ b/rbac/PhpManager.php
@@ -724,7 +724,7 @@ protected function load()
$rules = $this->loadFromFile($this->ruleFile);
foreach ($items as $name => $item) {
- $class = $item['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();
+ $class = $item['type'] == Item::TYPE_PERMISSION ? Permission::class : Role::class;
$this->items[$name] = new $class([
'name' => $name,
diff --git a/rest/Controller.php b/rest/Controller.php
index 9512ee75e..3705417ac 100644
--- a/rest/Controller.php
+++ b/rest/Controller.php
@@ -49,21 +49,21 @@ public function behaviors()
{
return [
'contentNegotiator' => [
- 'class' => ContentNegotiator::className(),
+ 'class' => ContentNegotiator::class,
'formats' => [
'application/json' => Response::FORMAT_JSON,
'application/xml' => Response::FORMAT_XML,
],
],
'verbFilter' => [
- 'class' => VerbFilter::className(),
+ 'class' => VerbFilter::class,
'actions' => $this->verbs(),
],
'authenticator' => [
- 'class' => CompositeAuth::className(),
+ 'class' => CompositeAuth::class,
],
'rateLimiter' => [
- 'class' => RateLimiter::className(),
+ 'class' => RateLimiter::class,
],
];
}
diff --git a/rest/IndexAction.php b/rest/IndexAction.php
index 81b19cab7..ab3e53293 100644
--- a/rest/IndexAction.php
+++ b/rest/IndexAction.php
@@ -183,7 +183,7 @@ protected function prepareDataProvider()
}
return Yii::createObject([
- 'class' => ActiveDataProvider::className(),
+ 'class' => ActiveDataProvider::class,
'query' => $query,
'pagination' => $pagination,
'sort' => $sort,
diff --git a/rest/UrlRule.php b/rest/UrlRule.php
index 48b1bbe79..8f32e32c4 100644
--- a/rest/UrlRule.php
+++ b/rest/UrlRule.php
@@ -233,7 +233,7 @@ public function parseRequest($manager, $request)
Yii::debug([
'rule' => method_exists($rule, '__toString') ? $rule->__toString() : get_class($rule),
'match' => $result !== false,
- 'parent' => self::className(),
+ 'parent' => self::class,
], __METHOD__);
}
if ($result !== false) {
diff --git a/test/DbFixture.php b/test/DbFixture.php
index d5a6322f9..0a9b090e9 100644
--- a/test/DbFixture.php
+++ b/test/DbFixture.php
@@ -38,6 +38,6 @@ abstract class DbFixture extends Fixture
public function init()
{
parent::init();
- $this->db = Instance::ensure($this->db, BaseObject::className());
+ $this->db = Instance::ensure($this->db, BaseObject::class);
}
}
diff --git a/validators/PunycodeAsset.php b/validators/PunycodeAsset.php
index 8d928838c..0e5917a5b 100644
--- a/validators/PunycodeAsset.php
+++ b/validators/PunycodeAsset.php
@@ -17,7 +17,7 @@
*/
class PunycodeAsset extends AssetBundle
{
- public $sourcePath = '@bower/punycode';
+ public $sourcePath = '@npm/punycode';
public $js = [
'punycode.js',
];
diff --git a/validators/UniqueValidator.php b/validators/UniqueValidator.php
index 74edcfd66..dadc8b4ed 100644
--- a/validators/UniqueValidator.php
+++ b/validators/UniqueValidator.php
@@ -189,7 +189,11 @@ private function modelExists($targetClass, $conditions, $model)
/** @var ActiveRecordInterface|\yii\base\BaseObject $targetClass $query */
$query = $this->prepareQuery($targetClass, $conditions);
- if (!$model instanceof ActiveRecordInterface || $model->getIsNewRecord() || $model::className() !== $targetClass::className()) {
+ if (
+ !$model instanceof ActiveRecordInterface ||
+ $model->getIsNewRecord() ||
+ !$model instanceof $targetClass
+ ) {
// if current $model isn't in the database yet, then it's OK just to call exists()
// also there's no need to run check based on primary keys, when $targetClass is not the same as $model's class
$exists = $query->exists();
diff --git a/web/AssetManager.php b/web/AssetManager.php
index 2eceddb4d..c8fe7e4c8 100644
--- a/web/AssetManager.php
+++ b/web/AssetManager.php
@@ -412,10 +412,10 @@ protected function resolveAsset($bundle, $asset)
public function getConverter()
{
if ($this->_converter === null) {
- $this->_converter = Yii::createObject(AssetConverter::className());
+ $this->_converter = Yii::createObject(AssetConverter::class);
} elseif (is_array($this->_converter) || is_string($this->_converter)) {
if (is_array($this->_converter) && !isset($this->_converter['class'])) {
- $this->_converter['class'] = AssetConverter::className();
+ $this->_converter['class'] = AssetConverter::class;
}
$this->_converter = Yii::createObject($this->_converter);
}
diff --git a/web/CompositeUrlRule.php b/web/CompositeUrlRule.php
index 30d08e189..f43cbcbbc 100644
--- a/web/CompositeUrlRule.php
+++ b/web/CompositeUrlRule.php
@@ -60,7 +60,7 @@ public function parseRequest($manager, $request)
Yii::debug([
'rule' => method_exists($rule, '__toString') ? $rule->__toString() : get_class($rule),
'match' => $result !== false,
- 'parent' => self::className(),
+ 'parent' => self::class,
], __METHOD__);
}
if ($result !== false) {
diff --git a/web/DbSession.php b/web/DbSession.php
index 1ef79cb7c..b2e48b9ef 100644
--- a/web/DbSession.php
+++ b/web/DbSession.php
@@ -90,7 +90,7 @@ class DbSession extends MultiFieldSession
public function init()
{
parent::init();
- $this->db = Instance::ensure($this->db, Connection::className());
+ $this->db = Instance::ensure($this->db, Connection::class);
}
/**
diff --git a/web/ErrorHandler.php b/web/ErrorHandler.php
index 570a84b41..201eaef9d 100644
--- a/web/ErrorHandler.php
+++ b/web/ErrorHandler.php
@@ -487,7 +487,7 @@ public function argumentsToString($args)
*/
public function getExceptionName($exception)
{
- if ($exception instanceof \yii\base\Exception || $exception instanceof \yii\base\InvalidCallException || $exception instanceof \yii\base\InvalidParamException || $exception instanceof \yii\base\UnknownMethodException) {
+ if ($exception instanceof \yii\base\Exception || $exception instanceof \yii\base\InvalidCallException || $exception instanceof \yii\base\InvalidArgumentException || $exception instanceof \yii\base\UnknownMethodException) {
return $exception->getName();
}
diff --git a/web/JqueryAsset.php b/web/JqueryAsset.php
index df365d768..e7a534671 100644
--- a/web/JqueryAsset.php
+++ b/web/JqueryAsset.php
@@ -15,7 +15,7 @@
*/
class JqueryAsset extends AssetBundle
{
- public $sourcePath = '@bower/jquery/dist';
+ public $sourcePath = '@npm/jquery/dist';
public $js = [
'jquery.js',
];
diff --git a/web/Request.php b/web/Request.php
index 7b9645d53..c795c6b43 100644
--- a/web/Request.php
+++ b/web/Request.php
@@ -95,11 +95,6 @@ class Request extends \yii\base\Request
* Default name of the HTTP header for sending CSRF token.
*/
const CSRF_HEADER = 'X-CSRF-Token';
- /**
- * The length of the CSRF token mask.
- * @deprecated since 2.0.12. The mask length is now equal to the token length.
- */
- const CSRF_MASK_LENGTH = 8;
/**
* @var bool whether to enable CSRF (Cross-Site Request Forgery) validation. Defaults to true.
diff --git a/web/UrlManager.php b/web/UrlManager.php
index 71c38f85d..1244a6cbb 100644
--- a/web/UrlManager.php
+++ b/web/UrlManager.php
@@ -178,7 +178,7 @@ public function init()
if ($this->normalizer !== false) {
$this->normalizer = Yii::createObject($this->normalizer);
if (!$this->normalizer instanceof UrlNormalizer) {
- throw new InvalidConfigException('`' . get_class($this) . '::normalizer` should be an instance of `' . UrlNormalizer::className() . '` or its DI compatible configuration.');
+ throw new InvalidConfigException('`' . get_class($this) . '::normalizer` should be an instance of `' . UrlNormalizer::class . '` or its DI compatible configuration.');
}
}
diff --git a/web/UrlRule.php b/web/UrlRule.php
index fbbf6ffe1..170a2f24c 100644
--- a/web/UrlRule.php
+++ b/web/UrlRule.php
@@ -195,7 +195,7 @@ public function init()
throw new InvalidConfigException('UrlRule::route must be set.');
}
if (is_array($this->normalizer)) {
- $normalizerConfig = array_merge(['class' => UrlNormalizer::className()], $this->normalizer);
+ $normalizerConfig = array_merge(['class' => UrlNormalizer::class], $this->normalizer);
$this->normalizer = Yii::createObject($normalizerConfig);
}
if ($this->normalizer !== null && $this->normalizer !== false && !$this->normalizer instanceof UrlNormalizer) {
diff --git a/web/User.php b/web/User.php
index 7b075ed49..0488014a8 100644
--- a/web/User.php
+++ b/web/User.php
@@ -789,20 +789,6 @@ public function checkRedirectAcceptable()
return false;
}
- /**
- * Returns auth manager associated with the user component.
- *
- * By default this is the `authManager` application component.
- * You may override this method to return a different auth manager instance if needed.
- * @return \yii\rbac\ManagerInterface
- * @since 2.0.6
- * @deprecated since version 2.0.9, to be removed in 2.1. Use [[getAccessChecker()]] instead.
- */
- protected function getAuthManager()
- {
- return Yii::$app->getAuthManager();
- }
-
/**
* Returns the access checker used for checking access.
* @return CheckAccessInterface
@@ -810,6 +796,6 @@ protected function getAuthManager()
*/
protected function getAccessChecker()
{
- return $this->accessChecker !== null ? $this->accessChecker : $this->getAuthManager();
+ return $this->accessChecker !== null ? $this->accessChecker : Yii::$app->getAuthManager();
}
}
diff --git a/web/View.php b/web/View.php
index bd730475d..a1c09ea68 100644
--- a/web/View.php
+++ b/web/View.php
@@ -558,7 +558,7 @@ private function registerFile($type, $url, $options = [], $key = null)
}
} else {
$this->getAssetManager()->bundles[$key] = Yii::createObject([
- 'class' => AssetBundle::className(),
+ 'class' => AssetBundle::class,
'baseUrl' => '',
'basePath' => '@webroot',
(string)$type => [ArrayHelper::merge([!Url::isRelative($url) ? $url : ltrim($url, '/')], $originalOptions)],
diff --git a/widgets/BaseListView.php b/widgets/BaseListView.php
index cee83fcaf..4aa9b7826 100644
--- a/widgets/BaseListView.php
+++ b/widgets/BaseListView.php
@@ -253,7 +253,7 @@ public function renderPager()
}
/* @var $class LinkPager */
$pager = $this->pager;
- $class = ArrayHelper::remove($pager, 'class', LinkPager::className());
+ $class = ArrayHelper::remove($pager, 'class', LinkPager::class);
$pager['pagination'] = $pagination;
$pager['view'] = $this->getView();
@@ -272,7 +272,7 @@ public function renderSorter()
}
/* @var $class LinkSorter */
$sorter = $this->sorter;
- $class = ArrayHelper::remove($sorter, 'class', LinkSorter::className());
+ $class = ArrayHelper::remove($sorter, 'class', LinkSorter::class);
$sorter['sort'] = $sort;
$sorter['view'] = $this->getView();
diff --git a/widgets/MaskedInputAsset.php b/widgets/MaskedInputAsset.php
index 473f4315f..2a0a6a197 100644
--- a/widgets/MaskedInputAsset.php
+++ b/widgets/MaskedInputAsset.php
@@ -19,7 +19,7 @@
*/
class MaskedInputAsset extends AssetBundle
{
- public $sourcePath = '@bower/inputmask/dist';
+ public $sourcePath = '@npm/inputmask/dist';
public $js = [
'jquery.inputmask.js',
];
diff --git a/widgets/PjaxAsset.php b/widgets/PjaxAsset.php
index 47795f683..c084763f9 100644
--- a/widgets/PjaxAsset.php
+++ b/widgets/PjaxAsset.php
@@ -17,7 +17,7 @@
*/
class PjaxAsset extends AssetBundle
{
- public $sourcePath = '@bower/yii2-pjax';
+ public $sourcePath = '@npm/yii2-pjax';
public $js = [
'jquery.pjax.js',
];
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy