This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################ | |
# craft-update | |
# Searches and cleans latest craftcms url from craftcms.com | |
# Downloads and replaces existing craft app folder | |
# Also checks you agree to craftcms terms | |
################################################################ | |
set -e | |
# Check that path to craft folder is there |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventCatcher | |
{ | |
/** | |
* @var array | |
*/ | |
protected $classConstants = []; | |
public function __invoke(yii\base\Event $event) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace modules; | |
class NoFields extends \craft\services\Fields | |
{ | |
public function getAllFields($context = null): array | |
{ | |
return []; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace modules; | |
use Craft; | |
use craft\controllers\EntriesController; | |
use craft\controllers\UsersController; | |
use yii\base\ActionEvent; | |
use yii\base\Event; | |
use yii\base\Module; | |
use yii\web\ForbiddenHttpException; |