How could I do a massive install of a PrestaShop module? - ftp

I have a problem, I have to do a massive install of a custom PrestaShop module on 1500 e-commerce, but I don't know if this is possible, I was thinking to include a file called install.php and run through a.sh, this file may contain the next.
For example:
<?php
include "meli.php";
$meli = new Meli();
$meli->install();
?>
I called this file and initially, nothing happened so I check the possible reason and was:
if (!defined('_PS_VERSION_'))
exit;
So I commented this and run it again but this show me this error:
Fatal error: Class 'Module' not found in /home/dev2al5/public_html/modules/meli/meli.php on line 7
Does someone know how I can do this process?

Indeed I would do 3 things in the SH script:
Copy of the modules files in each site in the modules folder
Copy of a sql file containing the instructions to be executed
Calling a URL present in each module that would execute the SQL and then delete the SQL file in question
Regards

Related

Joomla "Fatal error: Cannot redeclare jblogerror() in on line 0"

Here is a weird problem i'm facing; after updating Joomla to the latest version, website failed to up load but, as i've made a backup manually from these folders:
administrator
bin
cli
components
includes
layouts
libraries
modules
plugins
yt-assets
and all the root files, after restoring the backup still the website is not loading and just says
"Fatal error: Cannot redeclare jblogerror() in on line 0" !
Any suggestion? Thank you.
Apparently, the version of jBlog you are using is loading its attempting to load its own classes twice.
Let's assume the jBlog developers already fixed it and you carelessly ignored the warning to ensure all your extensions are compatible before updating.
Are you able to access administrator? Simply go there and upgrade jBlog including any modules.
Else, the issue lies within a plugin. In order to access the administrator and perform the update, you will need to manually disable the offending plugin.
A simple way is to rename its folder: start from plugins/system then plugins/content hopefully you'll have spotted it by then. Look into the subfolders of each and spot any that may be relevant to jBlog (or grep through the folder to locate the specific string)
If you have console access, simply run
# grep -rl jblogerror plugins/system
and you should see all the files that include such string, just rename their main plugin folder. But you could also do all this through ftp and guessing.

SFTP Namespace with phpseclib installed manually

I am trying to connect using SFTP (phpseclib) with a manual installation. That's the very first time I'm using namespaces so I don't know if what I'm doing is the way I have to.
I did download phpseclib from GitHub as ZIP and put it in /home/libs_web/php/class/phpseclib3
After that I used this code (just as example) :
require('/home/libs_web/php/class/phpseclib3/Net/SFTP.php');
use phpseclib3\Net\SFTP;
$sftp = new SFTP('localhost');
$sftp->login('username', 'password');
As mentioned here but with an include on top : https://phpseclib.com/docs/sftp
Here is my error : Fatal error: Uncaught Error: Class 'phpseclib3\Net\SSH2' not found in /home/libs_web/php/class/phpseclib3/Net/SFTP.php:52
It seems like my Namespace doesn't work correctly. I do not use autoloader, composer, and tried to set the working directory to /home/libs_web/php/class/phpseclib3/ & /home/libs_web/php/class/.
Don't know what to do more. If I include the file /Net/SSH2.php I'll have another error about another file. I think this isn't the proper way to work.
Could you please provide some help ?
phpseclib3 is best installed with Composer. eg. on the CLI do composer init; composer require phpseclib/phpseclib:~3.0. You'd also put require __DIR__ . '/vendor/autoload.php'; at the top of your file
If you wanted to do something like make your source code available for people to download and make it work on shared hosts were CLI access might not be available I guess you could do Composer and then upload the vendor/ directory by itself or include it with your zip file or whatever.

is there a way to use the lua command require to load up the luafilesystem?

i've been trying to install the api but it's not working
kept getting this error
stdin:1: module 'Desktop/luafilesystem-master' not found:
no field package.preload['Desktop/luafilesystem-master']
no file '/usr/local/share/lua/5.3/Desktop/luafilesystem-master.lua'
no file '/usr/local/share/lua/5.3/Desktop/luafilesystem-master/init.lua'
no file '/usr/local/lib/lua/5.3/Desktop/luafilesystem-master.lua'
no file '/usr/local/lib/lua/5.3/Desktop/luafilesystem-master/init.lua'
no file './Desktop/luafilesystem-master.lua'
no file './Desktop/luafilesystem-master/init.lua'
no file '/usr/local/lib/lua/5.3/Desktop/luafilesystem-master.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './Desktop/luafilesystem-master.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
also i can't install luarocks for the simple installing i just need it to be a stand alone program so it will temporary , be installed and it can be portable.
You seem to be loading the module as Desktop/luafilesystem-master, but in most cases it should be require "lfs" and you should have lfs.so file available in one of those paths listed in the error message.
If you are compiling from the source, then the result of that compilation will be lfs.so file that you need to place in one of those locations.

candc:could not open model configuration file for reading:models/config

I installed boxer, tool from C&C to convert CCG to DRS, from http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Installation
System - Windows 7 (64 bit)
But then after installing I am getting following error:
C:\Users\abcd\Documents\candc-1.00\bin>candc.exe --models models
candc:could not open model configuration file for reading:models/config
I did check http://svn.ask.it.usyd.edu.au/trac/candc/wiki/FAQ and I have an empty config file in models directory . But still it doesnt work
Please help me to solve the problem
You are accessing models directory from within the bin directory.
Execute the same command from outside bin .
Try
bin\candc.exe --models models
It should work fine now

Perl::WSDL. Generated methods in different directory than script

I am trying to write a script for using with op5/nagios.
What it tries to do is to connect to database an get a value there, and then send a request to a webservice and match the response from the webservice with the value from the database.
Now writing the script wasn't the problem. The problem arrises when trying to run it from OP5.
When including the interface to script I use the following syntax
use MyInterfaces::PortalServicesImplService::PortalServicesImplPort;
This works just fine when I execute the script located on the same level as "MyInterfaces".
The problem is that the script itself is located in the folder /opt/plugins/custom/SOAP where both the script and the folders generated by wsdl2perl.pl is located. However when OP5 executes the script is does so from the folder /opt/monitor.
So I tried to include the "PortalServicesImplPort" using this syntax
use lib "/opt/plugins/custom/SOAP/MyInterfaces/PortalservicesImplServices/PortalServicesImplPort
The code compiles but when trying to run it I get an error message saying
Can't locate object method "new" via package "MyInterfaces::PortalServicesImplService::PortalServicesImplPort" (perhaps you forgot to load "MyInterfaces::PortalServicesImplService::PortalServicesImplPort"?)
Am I doing something wrong when importing methods from another location or doesn't SOAP::WSDL support placing the auto generated files in a different directory from where you are executing the script?
Seems I managed to solve this myself by adding use lib "/opt/plugins/custom/SOAP

Resources