Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm #2081

Merged
merged 4 commits into from
Apr 21, 2021
Merged

rm #2081

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE
> Check the [UPGRADE document](UPGRADE.md) to read more about breaking changes.

+ [#2068](https://github.com/luyadev/luya/issues/2068) Disabled the automatically register process of CSRF tokens. Since ActiveForms are widely used they register the CSRF token.
+ [#2081](https://github.com/luyadev/luya/pull/2081) Removed deprecated methods and/or added a deprecation error trigger.
+ [#2077](https://github.com/luyadev/luya/pull/2077) Fix issue with caching when using SVG widget and symbol names.

## 1.9.0 (11. February 2021)
Expand Down
1 change: 1 addition & 0 deletions core/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ return $this->render('form', [...]);
```

Read more about CSRF implementation in the [Yii Framework Security Guide](https://www.yiiframework.com/doc/guide/2.0/en/security-best-practices#avoiding-csrf).
+ [#2081](https://github.com/luyadev/luya/pull/2081) Removed deprecated methods and/or added a deprecation error trigger.

## 1.6.0

Expand Down
13 changes: 0 additions & 13 deletions core/base/Boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,6 @@ public function getBaseYiiFile()
return $this->_baseYiiFile;
}

/**
* Whether current request is runing in cli env or not.
*
* This is determined by php_sapi_name().
*
* @return boolean
* @deprecated Depreacted since 1.0.12 use getisCli() instead.
*/
public function isCli()
{
return $this->getIsCli();
}

private $_isCli;

/**
Expand Down
13 changes: 0 additions & 13 deletions core/behaviors/Encode.php

This file was deleted.

14 changes: 0 additions & 14 deletions core/behaviors/Timestamp.php

This file was deleted.

2 changes: 1 addition & 1 deletion core/console/commands/ThemeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private function renderLayout($themeName)
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->composition->language; ?>">
<html lang="<?= Yii::$app->composition->langShortCode; ?>">
<head>
<title><?= $this->title; ?></title>
<meta charset="utf-8">
Expand Down
2 changes: 0 additions & 2 deletions core/web/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ public function run($app)
// @see https://github.com/luyadev/luya/issues/1778
$app->request->csrfParam = '_csrf_admin';

$app->getModule('admin')->assets = $app->getAdminModulesAssets(); // @deprecated in version 2.0 or 4.0 of LUYA Admin Module
$app->getModule('admin')->controllerMap = $this->_apis;
$app->getModule('admin')->moduleMenus = $app->getAdminModulesMenus(); // @deprecated in version 2.0 or 4.0 of LUYA Admin Module
$app->getModule('admin')->setJsTranslations($app->getAdminModulesJsTranslationMessages());

// calculate api defintions
Expand Down
16 changes: 6 additions & 10 deletions core/web/Composition.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ class Composition extends Component implements \ArrayAccess
* @var string The Regular-Expression matching the var finder inside the url parts
*/
const VAR_MATCH_REGEX = '/<(\w+):?([^>]+)?>/';

/**
* @deprecated Deprecated in 1.0.5 remove in 1.1.x
*/
const EVENT_AFTER_SET = 'EVENT_AFTER_SET';

/**
* @var \yii\web\Request Request-Object container from DI
Expand Down Expand Up @@ -461,38 +456,39 @@ public function offsetUnset($offset)
throw new Exception('Deleting keys in Composition is not allowed.');
}

// Deprecated methods

/**
* Wrapper for `getKey('langShortCode')` to load language to set php env settings.
*
* @return string|boolean Get the language value from the langShortCode key, false if not set.
* @deprecated in 1.1.0 use `getLangShortCode()` instead.
* @deprecated in 1.1.0 use `getLangShortCode()` instead, trigger in 2.0, will be removed in 3.0
*/
public function getLanguage()
{
trigger_error('use `getLangShortCode()` instead. Will be removed in version 3.0', E_USER_DEPRECATED);
return $this->getKey(self::VAR_LANG_SHORT_CODE);
}

/**
* Return the whole composition array.
*
* @return array
* @deprecated Remove in 1.1.0 use `getKeys()` instead.
* @deprecated Remove in 1.1.0 use `getKeys()` instead, trigger in 2.0, will be removed in 3.0
*/
public function get()
{
trigger_error('use `getKeys()` instead. Will be removed in version 3.0', E_USER_DEPRECATED);
return $this->_keys;
}

/**
* Return a path like string with all composition with trailing slash e.g. us/e.
*
* @return string
* @deprecated Remove in 1.1.0 use `getPrefixPath()` instead.
* @deprecated Remove in 1.1.0 use `getPrefixPath()` instead, trigger in 2.0, will be removed in 3.0
*/
public function getFull()
{
trigger_error('use `getPrefixPath()` instead. Will be removed in version 3.0', E_USER_DEPRECATED);
return $this->createRouteEnsure();
}
}
23 changes: 0 additions & 23 deletions core/web/CompositionAfterSetEvent.php

This file was deleted.

6 changes: 4 additions & 2 deletions core/web/filters/ResponseCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class ResponseCache extends PageCache
* });
* ```
*
* @deprecated Replaced in favor of {{beforeCacheResponse}} and {{afterRestoreResponse}}. Will be removed in 2.0
* @deprecated Replaced in favor of {{beforeCacheResponse}} and {{afterRestoreResponse}}. Triggers note in 2.0, will be removed in 3.0
*/
public $actionsCallable = [];

/**
* @var array
* @deprecated Use {{$only}} or {{$except}} instead. Will be removed in 2.0
* @deprecated Use {{$only}} or {{$except}} instead. Triggers note in 2.0, will be removed in 3.0
*/
public $actions = [];

Expand All @@ -49,6 +49,7 @@ public function init()

// support deprecated $actions property
if (!empty($this->actions)) {
trigger_error('$actions property will be removed in version 3.0, use {{$only}} or {{$except}} instead', E_USER_DEPRECATED);
$this->only = $this->actions;
}
}
Expand Down Expand Up @@ -79,6 +80,7 @@ public function beforeAction($action)

// support legacy property.
if (!empty($this->actionsCallable)) {
trigger_error('$actionsCallable property will be removed in version 3.0, use {{beforeCacheResponse}} and {{afterRestoreResponse}} instead.', E_USER_DEPRECATED);
$this->callActionCallable($action->id, Yii::$app->response->content);
}

Expand Down
3 changes: 0 additions & 3 deletions docs/guide/app-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,6 @@ If there is a property defined you will get the property object otherwise return

Sometimes your block should also register some css or js files, therefore you can access the global {{\luya\web\View}} Object inside of your PHP view template. It is quite similar to registering other assets with the difference that you are accessing the global scope view instead of the view on `$this`.


> Since LUYA CMS version 1.1 `$appView` is deprecated, use `$this` instead!

Assuming the below code is the PHP View of your Block:

```php
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/app-module-urlrules.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ In order to define the url rules from the urlManager config scope, you can just

> When composition is enabled, it will take the correct route for the current language and prefix the pattern if enable in composition config.
To verify which composition language is used you can dump `Yii::$app->composition->language`. The {{luya\web\Composition}} component is taking care of LUYA multi language websites and is registered by default for all LUYA projects.
To verify which composition language is used you can dump `Yii::$app->composition->langShortCode`. The {{luya\web\Composition}} component is taking care of LUYA multi language websites and is registered by default for all LUYA projects.

## Application Controller Routes

Expand Down
1 change: 0 additions & 1 deletion tests/core/base/BootTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public function testBaseObject()
{
$boot = new Boot();
$this->assertEquals('cli', $boot->getSapiName());
$this->assertTrue($boot->isCli());
}

public function testUnableToFindConfigFile()
Expand Down
13 changes: 1 addition & 12 deletions tests/core/web/CompositionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@
* removed tests to implemented here (if not already).
*
*
$parts = Yii::$app->composition->get();

$this->assertArrayHasKey('langShortCode', $parts);
$this->assertArrayHasKey('foo', $parts);
$this->assertArrayHasKey('bar', $parts);

$this->assertEquals('de', $parts['langShortCode']);
$this->assertEquals('de', Yii::$app->composition->getLanguage());
$this->assertEquals('1234', $parts['foo']);
$this->assertEquals('luya09', $parts['bar']);

*
* @author nadar
*/
Expand Down Expand Up @@ -192,7 +181,7 @@ public function testGetDefaultLanguage()
$this->assertEquals('us', $override);

// as override does not set/change the base value
$this->assertEquals('en', $comp->getLanguage());
$this->assertEquals('en', $comp->getLangShortCode());
$this->assertEquals('en', $comp['langShortCode']);
$this->assertTrue(isset($comp['langShortCode']));
$comp['fooCode'] = 'bar';
Expand Down
2 changes: 1 addition & 1 deletion tests/core/web/UrlManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function testCompositionRuleWithHiddenLanguageButCompositionLangShortCode
$request = new Request();
$request->pathInfo = 'mentions-legales';
$composition = new Composition($request, ['hidden' => true, 'default' => ['langShortCode' => 'fr']]);
$this->assertSame('fr', $composition->language);
$this->assertSame('fr', $composition->langShortCode);
$urlManager = new UrlManager();
$urlManager->composition = $composition;
$urlManager->addRules([
Expand Down
2 changes: 1 addition & 1 deletion tests/core/web/filters/ResponseCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function testInsideActionListButNotInCache()
$controller = new StubController('fooctrl', Yii::$app);
$action = new StubAction('fooaction', $controller);

$filter = new ResponseCache(['actions' => ['fooaction']]);
$filter = new ResponseCache();
$content = $filter->beforeAction($action);
$this->assertTrue($content);
}
Expand Down