Fatal Error caused from failed upgrade - restore - CS Cart 4.2.4 > 4.3.1 - cs-cart

I have recently upgraded my CS Cart website from 4.2.4 to 4.3.1
We have a custom theme installed so encountered a few issues that we didnt have time to address immediatley - so as per instruction, re ran the restore.
Now we have the following fatal error and I don't really know where to start. I am not much of a dev, but can follow instruction and am quite technically minded.
Thanks for any help in advance.

To fix the assets issue please open the config.local.php file in the root directory and replace:
'custom_files' => array(
'dir' => & $config['dir']['var'],
'prefix' => 'custom_files'
)
with
'custom_files' => array(
'dir' => & $config['dir']['var'],
'prefix' => 'custom_files'
),
'assets' => array(
'dir' => & $config['dir']['cache_misc'],
'prefix' => 'assets',
'cdn' => true
),

This is a very interesting issue. I think the fastest way to resolve it, to contact the official CS-Cart Support Team. If you have a legal license, you have support credits, ask the team to resolve the issue will be free.

Related

A problem with automatically increasing the file size in a project laravel

I have a problem with a file named
storage\logs\laravel.log
From LARAVEL Project Files
The strange thing is that this file is automatically increased in size every day, so I needed to delete it so that the site would not stop working
Do you have a solution to this problem how to stop this file from working automatically
So that the site does not stop because there is no free space
You can change logging driver to daily. This will create new log file daily, with date in file name.
in config/logging.php
'default' => env('LOG_CHANNEL', 'daily'),
'channels' => [
....
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
],
....
Set the number days that you want log files to keep. After that the old log files will be deleted automatically.
For more information Check the Laravel documentation for Logging.

How to use `laravel-backup`-Package with Laravel Vapor

We are using Laravel Vapor to manage our laravel application and planing to use the laravel-backup package to create automated database backups for our production environment.
I testet the implementation and managed to get it worked (with version 7.3.3) on my windows machine.
I set the mail configuration to get notified when an backup runs (successful or not) and set the path to mysqldump like this:
'dump' => [
'dump_binary_path' => 'C:\xampp\mysql\bin',
'use_single_transaction',
'timeout' => 60 * 5,
]
To set this up and running with vapor, I changed the destination.disk-config from local to s3 with s3 as
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
I removed the dump_binary_path, because I didn't know where to point with it in the context of vapor. So I hoped that it is at a default location as it is mentioned in the docs of the laravel-backup package:
mysqldump is used to backup MySQL databases. pg_dump is used to dump PostgreSQL databases. If these binaries are not installed in a default location, you can add a key named dump.dump_binary_path in Laravel's own database.php config file.
I included the backup command in the kernel-file
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run --only-db')->daily()->at('01:30');
and deployed it with vapor.
Unfortunately it isn't working. I didn't recived an email (neither success nor failure) and nothing was created at our s3.
Does someone used laravel-backup with vapor before and knows how to fix this? What am I missing?
Thanks in advance!
The Laravel Vapor support replied this:
"Our native runtime doesn't have mysqldump installed. You will need to run the Docker runtime and install yourself if this is a requirement. It's also worth noting the maximum execution time on Lambda is 15 mins so if your backup is large, you could run into issues."

How to get started using aws_account_utils (ruby)?

After searching around, I found this aws_account_utils which does exactly what I hope to achieve - programmatically create aws account.
Unfortunately as a total ruby noob, I have no idea how to start using it even after reading the README.md.
I suspect I'd need the following steps:
Create create-account.rb
Use the util in the code
Run ruby create-account.rb
How should the content of create-account.rb be like?
Please show me a template.
With that I should be able to start experimenting and hacking.
Any other steps I should do?
Thanks in advance.
Plan below is rough and must be supplemented.
Create Gemfile file. This file is needed to specify project dependencies (libraries)
Put this line into Gemfile
gem 'aws_account_utils'
Run bundle install in your console / terminal
Create create-account.rb file with next code
require 'aws_account_utils'
aws_utils = AwsAccountUtils::AwsAccountUtils.new()
details = { 'fullName' => 'Herman Munster',
'company' => 'The Munsters',
'addressLine1' => '1313 Mockingbird Lane',
'city' => 'Mockingbird Heights',
'state' => 'CA',
'postalCode' => '92000',
'phoneNumber' => '(800) 555-1212',
'guess' => 'Test Account' }
resp = aws_utils.create_account(account_name: 'My Test Account 01',
account_email: 'adfefef#gmail.com',
account_password: 'foobar1212121',
account_details: details)
This code uses aws_account_utils library. Documentation you can find here.
After steps above you can run ruby create-account.rb.

Laravel[PAYPAL] annoying issue with PayPal SDK config fix

I'm trying to create a laravel wrapper for paypal sdk, but could not continue due to the annoying fact that as a developer we should edit this
vendor/paypal/sdk-core-php/lib/../config/sdk_config.ini
Is there anyway in the paypal SDK to easily change the config.ini without compromising the structure.
I'm trying not to touch the /vendor/ folder as much as possible.
Or should i create a filesystem editor in my functions that would create an sdk_config.ini for Paypal SDK?
Any concepts?
Yes with old version like sdk 1.4.0 you can do it by declaring sdk_config path , see paypal documentation
I got same issue too, found some error on code after updating the sdk. post an issue on Paypal-sdk
https://github.com/paypal/SDKs/issues/51
hope it helps
In Composer:
Check composer.json be sure you have:
"paypal/rest-api-sdk-php" : "*"
If you have a different string change it and run composer update.
In your php code:
So now you should be able to inject the configuration in the following way:
$cred = new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']);
$this->_api_context = new ApiContext($cred);
$this->_api_context->setConfig($paypal_conf['settings']);
Where $paypal_conf is:
array:3 [▼
"client_id" => "..."
"secret" => "..."
"settings" => array:5 [▼
"mode" => "sandbox"
"http.ConnectionTimeOut" => 30
"log.LogEnabled" => true
"log.FileName" => "./storage/logs/paypal.log"
"log.LogLevel" => "FINE"
]
]

ci-merchant purchase() not working

Im using the ci-merchant library in my PyroCMS module locally on my development WAMP server. (all working fine)
When I upload to my Linux test server the purchase() function being called does not seem to work.
When it executes it pools for 5 minutes then I get a response "Could not connect to host".
PHP
$params =
array(
'amount' => 20,
'currency' => 'USD',
'return_url' => 'http://someurl.com/return/'
'cancel_url' => 'http://someurl.com/cancel/'
);
$settings = array(
'test_mode' => TRUE,
'username' => 'PAYPAL_TEST_USERNAME'
'password' => 'MY_PAPAL_TEST_PASS'
'signature' => 'MY_PAYPAL_TEST_SIG'
);
$this->load->library('merchant');
$this->merchant->load('paypal_express');
$this->merchant->initialize($settings);
//this is where Im having the issue
$response = $this->merchant->purchase($params);
$message = $response->message();
When I echo $message
echo $message; //Outputs: couldn't connect to host"
CURL - Server Settings
Below is a list of the differences in the CURL settings on the servers. Perhaps this is the issue. I dont think these settings can be changed without having to compile curl but im not sure.
Development Server (WAMP server - status:Working)
AsynchDNS : Yes
CurlInfo : 7.21.7
GSS Neg : Yes
IDN : No
SSPI : Yes
libSSH : libssh2/1.2.7
Test Server (Linuxserver - status:Not working)
AsynchDNS : No
CurlInfo : 7.24.0
GSS Neg : No
IDN : Yes
SSPI : No
libSSH : <<not listed>>
After much trial and error and some advice from friends I found this to be a missing libSSH module.
Since then I have moved my site from a shared hosting company to a more reliable VPS Hosting.
I installed the appropriate libraries and everything is working fine.
I would recommend anyone hosting their sites to moving away from any "shared" hosting companies. I only encountered very delayed support and VPS Hosting wasnt really that much more than what I was paying for VPS.
But you will need to know how to manage a server before you do.

Resources