developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
55
results
Andrew Fletcher
•
I need to generate a patch and then apply automatically to my Drupal installation.
Current path to the file: web/core/modules/views/src/Plugin/views/argument/
Orignal filename: ArgumentPluginBase.php
Adjusted filename: ArgumentPluginBase-adjusted.php
Create a Patch
A patch is used to create or override changes in another file. The command to create a patch is:
diff -u {original filename} {changed filename} > {patchfile}.patchdiff -u...
Andrew Fletcher
•
Post creating a new branch in the repo, next step was to run the checkout...
Andrew Fletcher
•
How to set the Private file path in Drupal using the following steps:
Create a...
Andrew Fletcher
•
Using Composer to Manage Projects and if required their dependencies
In this...
Andrew Fletcher
•
Goal: I want to download a table list to a txt or csv file.
Initially, as a root...
Andrew Fletcher
•
This issue
I have a folder with about 10,000 files in it. I want to scan through the directories and isolate files that are different from what sits in the database. How do you generate a list of file names of all the files into a single txt file?
Solution
One option is using the list command
ls > filename-list.txtHowever, this option will generate a list of the current directory, listing directories by name only and therefore not including file from each of the directories...
Andrew Fletcher
•
If your Composer project doesn't have Drush listed as a dependency, you can...
Andrew Fletcher
•
Using Homebrew for speed tests...
I'm using Speediest CLI - for more details go...
Andrew Fletcher
•
I'm in an environment where the default branch is staging and I'm attempting to...
Andrew Fletcher
•
How to count the number of files in a directory. At some point you'll have...
Andrew Fletcher
•
I've recently upgraded the server Ubuntu 20.04 updating the PHP version from 7.4 to 8.1. However, when I've attempted to export the MySQL database using the command
drush sql-dump --extra-dump=--no-tablespaces --result-file=../sql/db-2023-02-25.sqlI seeing the following response
> mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need (at least one of) the RELOAD or FLUSH_TABLES privilege(s) for this operation (1227)
In SqlCommands.php line 242:
Unable to dump...
Andrew Fletcher
•
Working through and importing JSON data into a content type.
Drush...
Andrew Fletcher
•
After cloning a site, next you will want to import the config file. Which...
Andrew Fletcher
•
Recently I have been investigating one of my Linux server's speed using the...
Andrew Fletcher
•
This is a relatively quick process, beginning with dropping the database...