Install Third party library in Prestashop - jwt

I am trying to install a JWT Library (i.e https://github.com/web-token/jwt-framework) in Prestashop,
I am not sure how to install & use it.
Do i need to run composer require web-token/jwt-framework in PS root to install it?

Composer is installed by default in prestashop versions 1.7+.
If you are starting a new project you can init your composer project along with the dependency:
composer init --require="web-token/jwt-framework" -n
composer install
Or if you already have an existing project simply add the dependency:
composer require web-token/jwt-framework
Then update your composer.json file to include the class in your autoload nad regenerate it:
composer dump-autoload
(Installing webservice library if u want to see documentation example: LINK)
If u want to use library in your module here is the link to documentation on how to do it: LINK
Although you can go to github repo of this library and download it manually.

Related

composer.json file configuraton to install Shopware 6 plugins in custom/plugins directory

Require shopware 6 plugin via composer
Following up on this question and answer. I wondered what else anyone has added to install a plugin into custom/plugin for Shopware 6? I removed my composer.lock and the vendor and var/cache directories. I and trying to do the same thing, and I have required composer/installers to my plugin composer.json file and added:
"extra": {
"installer-paths": {
"custom/plugins": ["type:shopware-platform-plugin"]
}
}
to the root composer.json but it is still putting my plugin into the vendor directory. Any suggestions would be truly appreciated.
You don't need any installers or other tools for installing plugins via composer.
If you have placed your plugin in custom/plugins (in case you are using the development template) or in custom/static-plugins (in case you are using the production template/zip installation) your plugin will be symlinked to your root vendor directory, if you composer require your plugin.
For Shopware 6 it doesn't matter where your plugin is located.
If you don't like the behaviour, that your plugins are symlinked, you can simply remove the repository configuration from the root composer.json. Above I have linked the positions you need to change.

Install a github repository as a library through a script file

I am trying to remove the libraries folder in an Arduino project I am working on and install them through a script file. The issue with some of the libraries is that they seem to not be officially registered, so you can't use the arduino-cli lib install for them. Most of them are on github, so I am looking for a way to install them in a similar fashion as arduino-cli lib install, so they can all be neatly in one script file. I am slightly new to github and I am not sure if there is a way through which this is achievable.

How do I install QuickSubmit plugin to OJS 3.2.1?

When I go to Plugin Gallery and click on "install quicksubmit plugin", I get a message saying that The loaded plugin file does not contain a folder that matches the plugin name. Where do I save this folder?
I found an explanation on PKP Help that said:
Most plugins should come with a readme file of some sort, and should also list which versions of OJS they are compatible with. To install a plugin, you should simply need to copy the files to the correct plugins subdirectory in your OJS installation. For example, if the plugin you want to install is considered a 'generic' plugin, copy the plugin folder to plugins/generic/; if it is classed as an import plugin, it should go into plugins/importexport; and so on.
But where can I find this plugins/generic/ or plugins/importexport folders?
This error is usually when you trying to direct install latest plugin into previous version of ojs please follow bellow steps to easily install this plugin.
Download the exact released version for your ojs from
https://github.com/pkp/quickSubmit .
Example if you are running ojs 3.2.0 then download the relevant zip
upload this zip file and extract to your ojs/plugins/importexport directory
after extraction login to dashboard and check in tool->import/export plugin will be installed

Manage dependencies of ionic project - Github

I am working on an ionic project which needs to be shared with multiple developers using Github. We are not syncing the following folders to github, so they are part of the .gitignore file
plugins/
www/lib/
How would a new developer (who gets the app from github) would manage the dependencies that are part of these folders.
If I do 'ionic state restore' from the terminal then it fetches all the cordova plugins that are part of package.json. So, this takes care of the 'plugins/' folder.
However, www/lib folder is still empty. What do I need to do to get all the ionic/angular related javascript files that reside in the www/lib folder.
(Assuming the you have both bower and npm installed, if not follow these links to get your setup done: npm, bower)
Ionic uses bower as its library package manager. Run these commands after you clone the project from github:
npm install (refers package.json to install plugins)
bower install (referes bower.json to install libs)
Hope it was helpful, Happy coding. :)

Installing multiple packages with composer?

I am trying to install the latest version of Zend Framework 2 with composer and also install at least one other package at the same time. The other package is another Zend Framework package. The two packages are:
zendframework/zendframework
zendframework/zendservice-twitter
I added zendframework/zendservice-twitter to the require section of that file. It doesn't look like there is any other section to use to install multiple packages in the same directory tree. But when I try to add zendframework/zendservice-twitter to the require section of the composer.json file, it tells me that zendframework/zend-uri is required. But zendframework/zend-uri is installed by the zendframework/zendframework package. It is listed in the replace section of that composer.json file. So apparently the replace section is not the place to add other packages that need to be installed. But you can't have multiple composer.json files in the same directory either, so is it even possible to install Zend Framework 2 and ZendServiceTwitter in the same installation with composer?
When I download a package as a zip file from https://packages.zendframework.com/#composer, I get a composer.json file in the zip file, but it does not have the same repository setting that it says to use at https://packages.zendframework.com. So I am not sure if that composer.json file is intended to be edited in order to upgrade or reinstall.
Isn't there some way to tell composer that this is a circular dependency?
I don't see the circular dependency. The twitter package requires zend-uri, and zend-uri is provided by the main Zend Framework package that you've already installed.
I just tried this out on a fresh checkout of the skeleton app and it worked fine. All I did was add the twitter package to the require section of my composer.json:
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.3.*",
"zendframework/zendservice-twitter": "~2.1.0"
}
(2.1.0 is the latest version of it at the moment.) You don't need to touch the replace section.