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
/** | |
* Delete all content inside of given directory. | |
* | |
* @param string $folder | |
* Directory. | |
*/ | |
public function deleteAllFilesInsideDirectory(string $folder): void { | |
$files = new \RecursiveIteratorIterator( | |
new \RecursiveDirectoryIterator($folder, \FilesystemIterator::SKIP_DOTS), | |
\RecursiveIteratorIterator::CHILD_FIRST |
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 | |
# Script for automatic Drupal 8 deployment with checking current site configuration state. | |
# If site has any unexported configuration changes, the deployment is not executed. | |
GIT_DIR="path_to_repo.git" | |
TARGET="path_to_destination_dir" | |
BRANCH="production" | |
while read oldrev newrev ref |
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
// Include this file into setting.php | |
$databases['default']['default'] = array ( | |
'database' => '', | |
'username' => '', | |
'password' => '', | |
'prefix' => '', | |
'host' => 'localhost', | |
'port' => '', | |
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql', |
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 | |
/** | |
* Deletes all files and directories in the specified filepath recursively. | |
* | |
* @param $path | |
* @param bool $deleteDir | |
* TRUE if you need to delete also directory in $path. | |
* FALSE if you need to delete only content of dir and its subdirs. | |
* | |
* @return bool |
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 | |
/** | |
* Inject Views filter and sorting. | |
* We need display something defined (nids) with the same sorting order. | |
* | |
* The product list view display contains dummy filter, which is overridden | |
* in this function. | |
* | |
* Implements hook_views_query_alter(). | |
* |