This file contains hidden or 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 | |
class Example | |
{ | |
/** | |
* @return \Psr\Log\LoggerInterface | |
*/ | |
public static function getLogger() | |
{ | |
static $logger; | |
if (!$logger) { |
This file contains hidden or 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 | |
/** | |
Extension url: https://github.com/runkit7/runkit7 | |
*/ | |
runkit_function_copy('curl_exec', 'curl_exec_orig'); | |
function curl_exec_redefined($ch) { | |
if (!is_resource($ch)) { |
This file contains hidden or 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
Here's what I ended up doing - it worked perfectly. Note that I was moving from my old host (Bitbucket) to my new one (Gitlab). My comments are above the commands: | |
# First, shallow-clone the old repo to the depth we want to keep | |
git clone --depth=50 https://[email protected]/....git | |
# Go into the directory of the clone | |
cd clonedrepo | |
# Once in the clone's repo directory, remove the old origin | |
git remote remove origin |
This file contains hidden or 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 | |
host=$1 | |
user=$2 | |
password=$3 | |
dbname=$4 | |
[[ -f /tmp/${dbname}_tables.txt ]] && rm /tmp/${dbname}_tables.txt | |
mysql -N "-h${host}" -u${user} -p${password} -e "show tables like 'sales\_%';" ${dbname} >> /tmp/${dbname}_tables.txt |
This file contains hidden or 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
diff --git a/acinclude.m4 b/acinclude.m4 | |
index 168c465f8d..6c087d152f 100644 | |
--- a/acinclude.m4 | |
+++ b/acinclude.m4 | |
@@ -441,7 +441,11 @@ dnl | |
dnl Adds a path to linkpath/runpath (LDFLAGS) | |
dnl | |
AC_DEFUN([PHP_ADD_LIBPATH],[ | |
- if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then | |
+ case "$1" in |
This file contains hidden or 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 | |
host=$1 | |
user=$2 | |
password=$3 | |
dbname=$4 | |
[[ -f /tmp/${dbname}_tables.txt ]] && rm /tmp/${dbname}_tables.txt | |
mysql -N "-h${host}" -u${user} -p${password} -e "show tables like 'pim_versioning_version';" ${dbname} >> /tmp/${dbname}_tables.txt |
This file contains hidden or 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 | |
if (version_compare(phpversion(), '5.2.0', '<')) { | |
echo 'It looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer'; | |
exit; | |
} | |
$magentoRootDir = getcwd(); | |
$bootstrapFilename = $magentoRootDir . '/app/bootstrap.php'; | |
$mageFilename = $magentoRootDir . '/app/Mage.php'; |
This file contains hidden or 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
sudo strace -p {PID} -s 512 2>&1 | awk '{ print strftime("[\%Y-\%m-\%d \%H:\%M:\%S]"), " --> ", $0 }' | tee -a ~/strace.log |
This file contains hidden or 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
*/5 * * * * /usr/bin/flock -w 10 -x /tmp/magento.cron.lock /bin/bash -c "nice -n 19 ionice -c2 -n7 /usr/bin/php7.0 /var/www/current/bin/magento cron:run 2>&1 | awk '{ print strftime(\"[\%Y-\%m-\%d \%H:\%M:\%S]\"), \$0 }' | tee -a /var/www/current/var/log/magento.cron.log; echo 'Complete' | awk '{ print strftime(\"[\%Y-\%m-\%d \%H:\%M:\%S]\"), \$0 }' | tee -a /var/www/current/var/log/magento.cron.log" |
This file contains hidden or 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 | |
host=$1 | |
user=$2 | |
password=$3 | |
dbname=$4 | |
[[ -f /tmp/${dbname}_tables.txt ]] && rm /tmp/${dbname}_tables.txt | |
mysql -N "-h${host}" -u${user} -p${password} -e "show tables like 'ewave_ai_logs%';" ${dbname} >> /tmp/${dbname}_tables.txt |