Trying to install oAuth package using composer - oauth

I'm trying to install the following using composer:
https://github.com/Lusitanian/PHPoAuthLib
I tried using:
"lusitanian/oauth": "~0.3"
but that didn't work, the version being used now was something I found online that supposedly works.
When I try to run the following composer install commmand I get a message saying that the package couldn't be found. It doesn't appear in the composer.json file (not sure if its meant to). This is the first time I've tried to install this so any tips on getting this working would be much appreciated.
php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package lusitanian/oauth 1.0.0 could not be found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.
Read http://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
{
"name": "lusitanian/oauth",
"description": "PHP 5.3+ oAuth 1/2 Library",
"keywords": ["oauth", "authentication", "authorization", "security"],
"license": "MIT",
"authors": [
{
"name": "David Desberg",
"email": "david#daviddesberg.com"
},
{
"name": "Pieter Hordijk",
"email": "info#pieterhordijk.com"
}
],
"require": {
"php": ">=5.3.0",
"lusitanian/oauth": "0.1.*#dev"
},
"require-dev": {
"symfony/http-foundation": "~2.1",
"predis/predis": "0.8.*#dev",
"phpunit/phpunit": "3.7.*"
},
"suggest": {
"symfony/http-foundation": "Allows using the Symfony Session storage backend.",
"predis/predis": "Allows using the Redis storage backend.",
"ext-openssl": "Allows for usage of secure connections with the stream-based HTTP client."
},
"autoload": {
"psr-0": {
"OAuth": "src",
"OAuth\\Unit": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.1-dev"
}
}
}

Changing this:
"lusitanian/oauth": "0.1.*#dev"
to this:
"lusitanian/oauth": "1.0.*#dev"
Fixed it :)

Related

electron-forge: Get rid of the version number on Windows app folder

I use electron-forge and WIX to build installer on Windows. But I found that if there is a version number specified in package.json, then the installed folder will contain a subfolder with this specific version number appended.
For instance, if the version is "1.2.3+4", then inside the installed folder we get
app-1.2.3+4
This is problematic if we install new versions onto the same folder, which will litter all the old version files/folders in the same parent folder. I'd love new versions to simply overwrite that folder. How to get rid of this version number from the subfolder without affecting the versioning elsewhere?
Here is my wix setup inside package.json
"makers": [
{
"name": "#electron-forge/maker-wix",
"platforms": [
"win32"
],
"config": {
"arch": "x64",
"appUserModelId": "com.company.myapp",
"description": "description of myapp",
"exe": "myapp",
"appIconPath": "C:\\Temp\\myapp.ico",
"language": 1033,
"manufacturer": "mycompany",
"name": "My App",
"programFilesFolderName": "MyApp",
"shortName": "myapp",
"shortcutFolderName": "My App",
"ui": {
"chooseDirectory": true,
"images": {
"background": "C:\\Temp\\background-orange.png",
"banner": "C:\\Temp\\banner-orange.png"
}
},
"version": "1.2.3+4"
}
}
]
}
},

Proper .gitignore file for a Neos Flow project?

I recently created a new project using composer create-project --keep-vcs neos/flow-base-distribution ProjectName and I'm a bit confused by the .gitignore file it produces:
/Build/
/Configuration/
/Data/
/Packages/
/Web/
/bin/
/Readme.rst
/Upgrading.rst
/flow
/flow.bat
It basically throws out almost every file from the VCS, including the entirety of the Packages/Application folder, where I assumed most of my code would go. So what gives? Why is the .gitignore file so broad?
I don't have previous experience in neos-flow but I installed it with the help of composer on two different computers with Ubuntu OS.
My .gitignore file output is same like your output both time.
/Build/
/Configuration/
/Data/
/Packages/
/Web/
/bin/
/Readme.rst
/Upgrading.rst
/flow
/flow.bat
The Original structure of my project is
. .. .editorconfig .git .github .gitignore Build Configuration Data Packages Readme.rst Web bin composer.json composer.lock flow flow.bat
When i remove all folders and files as declared in .gitignore then my project structure is like this
. .. .editorconfig .git .github .gitignore composer.json composer.lock
As you know, The purpose of the .gitignore file is to allow you to ignore files, such as editor backup files, build products or local configuration overrides that you never want to commit into a repository.
I think that neos-flow just need those files that are remaining after applying .gitignore.
Those are composer.json and composer.lock
The purpose of composer.json is that it shows the details about the project like name, description, license information.
And composer.lock shows all packages, and dependencies for the project, their name, detail and url for downloading the package.
The content of composer.json
{
"name": "neos/flow-base-distribution",
"description": "Flow Base Distribution",
"license": "MIT",
"support": {
"email": "hello#neos.io",
"slack": "http://slack.neos.io/",
"forum": "https://discuss.neos.io/",
"wiki": "https://discuss.neos.io/c/the-neos-project/project-documentation",
"issues": "https://github.com/neos/flow-development-collection/issues",
"docs": "https://flowframework.readthedocs.io/",
"source": "https://github.com/neos/flow-base-distribution"
},
"config": {
"vendor-dir": "Packages/Libraries",
"bin-dir": "bin"
},
"require": {
"neos/flow": "~6.0.0",
"neos/welcome": "~6.0.0"
},
"require-dev": {
"neos/kickstarter": "~6.0.0",
"neos/buildessentials": "~6.0.0",
"neos/behat": "dev-master",
"phpunit/phpunit": "~8.1",
"mikey179/vfsstream": "~1.6"
},
"repositories": {
"distributionPackages": {
"type": "path",
"url": "./DistributionPackages/*"
}
},
"replace": {
"typo3/flow-base-distribution": "self.version"
},
"suggest": {
"ext-pdo_sqlite": "For running functional tests out-of-the-box this is required"
},
"scripts": {
"post-update-cmd": "Neos\\Flow\\Composer\\InstallerScripts::postUpdateAndInstall",
"post-install-cmd": "Neos\\Flow\\Composer\\InstallerScripts::postUpdateAndInstall",
"post-package-update": "Neos\\Flow\\Composer\\InstallerScripts::postPackageUpdateAndInstall",
"post-package-install": "Neos\\Flow\\Composer\\InstallerScripts::postPackageUpdateAndInstall"
}
}
First 70 lines of composer.lock
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is #generated automatically"
],
"content-hash": "06d49a77babbafa5a03d726865e61dc3",
"packages": [
{
"name": "composer/ca-bundle",
"version": "1.2.4",
"source": {
"type": "git",
"url": "https://github.com/composer/ca-bundle.git",
"reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527",
"reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"ext-pcre": "*",
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8",
"psr/log": "^1.0",
"symfony/process": "^2.5 || ^3.0 || ^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Composer\\CaBundle\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano#seld.be",
"homepage": "http://seld.be"
}
],
"description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.",
"keywords": [
"cabundle",
"cacert",
"certificate",
"ssl",
"tls"
],
"time": "2019-08-30T08:44:50+00:00"
}]}
The _readme key in composer.lock json shows the purpose of composer.lock
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is #generated automatically"
],
So in short your .gitignore is absolutely fine and accurate. I also install it on both my ubuntu computers and both are same.
There are two models of .gitignore under their repository:
https://github.com/neos/flow/blob/master/Resources/Private/Installer/Distribution/Defaults/.gitignore
/Build/
/Configuration/
/Data/
/Packages/
/Web/
/bin/
/Readme.rst
/Upgrading.rst
/flow
/flow.bat
https://github.com/neos/flow-development-distribution/blob/master/.gitignore
/Build/Behat/*
/Build/BuildEssentials
/Build/Reports
/Build/Resources
/Configuration/
/Data/
/Packages/
/Web/
/bin/
/Readme.txt
/Upgrading.txt
/Readme.rst
/Upgrading.rst
/flow
/flow.bat
As I am an avid Flow user, I can explain why the Packages/ directory is excluded:
As you can see in the composer.json, there is this section:
"repositories": {
"distributionPackages": {
"type": "path",
"url": "./DistributionPackages/*"
}
},
This tells composer to look for your own packages in the DistributionPackages/ directory. This is much cleaner than mixing own packages and dependencies in the Packages/ directory and also helps a bit with dependency management itself (since only the composer.json in your package directory needs to contain the package dependencies - i.e. no need to duplicate them in the root composer.json).
See https://docs.neos.io/cms/manual/dependency-management#the-path-repository-setup and https://www.neos.io/blog/project-repository-best-practice.html for more info about that (this not only applies to Neos site packages, but every project specific package).
As for the other excluded files: Since those get created by composer install, those don't need to be tracked by git.
Exception: You often want to include the Web/ directory (but exclude non-specific contents like Web/_Resources/ or Web/index.php) i.e. for the favicons or other static files needed in the web root.

aurelia-dialog error with the release version and CLI

I'm facing a problem when using the new aurelai release :
I created a new app using : au new myApp
I installed aurelia-dialog via npm
When I import aurelia-dialog and try to run the app using
au run --watch
I get htis error :
[Error: ENOENT: no such file or directory, open 'C:\src\ai-dialog.js']
Any idea ?
The reason this is happening is because the package is a CommonJS package.
See: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli/10
Edit your aurelia_project/aurelia.json file from
"dependencies": [
"aurelia-dialog"
]
to
"dependencies": [
{
"name": "aurelia-dialog",
"path": "../node_modules/aurelia-dialog/dist/amd",
"main": "aurelia-dialog"
}
]
and that should solve your problem.
I got into the same issue. I have installed the aurelia dialog using below npm command
npm install aurelia-dialog --save
then just adding below dependencies to aurelia.json, resolved the issue
{
"name": "aurelia-dialog",
"path": "../node_modules/aurelia-dialog/dist/amd",
"main": "aurelia-dialog"
}
Things have changed a little bit since the release of aurelia-dialog 2.0.0.
The block you need to add in the aurelia.json dependencies definition is now the following one:
"dependencies": [
{
"name": "aurelia-dialog",
"path": "../node_modules/aurelia-dialog/dist/amd",
"main": "aurelia-dialog",
"resources": ["**/*.js"]
}
]

How to install league/OAuth2-client through composer

I am getting an error while trying to install league/oauth2-client through composer on ubuntu with newest curl and openssl libraries combined with newest php release:
$ composer require league/oauth2-client
Using version ^0.12.1 for league/oauth2-client
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for league/oauth2-client 1.0.x-dev -> satisfiable by league/oauth2-client[1.0.x-dev].
- Can only install one of: league/oauth2-client[0.12.1, 1.0.x-dev].
- Installation request for league/oauth2-client ^0.12.1 -> satisfiable by league/oauth2-client[0.12.1].
Installation failed, reverting ./composer.json to its original content.
could not find any hint through searching for answers so far. Thank you in advance for any heop on this!
cotent of composer.json
$ cat composer.json
{
"name": "league/oauth2-client",
"description": "OAuth 2.0 Client Library",
"license": "MIT",
"require": {
"php": ">=5.5.0",
"ext-curl": "*",
"ircmaxell/random-lib": "~1.1",
"guzzlehttp/guzzle": "~6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"mockery/mockery": "~0.9",
"squizlabs/php_codesniffer": "~2.0",
"satooshi/php-coveralls": "0.6.*",
"jakub-onderka/php-parallel-lint": "0.8.*"
},
"keywords": [
"oauth",
"oauth2",
"authorization",
"authentication",
"idp",
"identity",
"sso",
"single sign on"
],
"authors": [
{
"name": "Alex Bilbie",
"email": "hello#alexbilbie.com",
"homepage": "http://www.alexbilbie.com",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"League\\OAuth2\\Client\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"League\\OAuth2\\Client\\Test\\": "test/src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
I think you are using composer wrong. Try running composer install
From the composer documentation:
The require command adds new packages to the composer.json file from
the current directory. If no file exists one will be created on the
fly.
The install command reads the composer.json file from the current
directory, resolves the dependencies, and installs them into vendor.
So if the composer.json is that of league/oauth2-client, just run composer install
If you want league/oauth2-client to be added as a dependency for some other package, run composer require league/oauth2-client
I have fixed this installing knpuniversity/oauth2-client-bundle first. So you need to follow this order:
composer require knpuniversity/oauth2-client-bundle
composer require league/oauth2-client
composer require league/oauth2-facebook
This is my composer.json file after installing:
{
"knpuniversity/oauth2-client-bundle": "^1.9",
"league/oauth2-client": "^2.2",
"league/oauth2-facebook": "^2.0"
}
Hope it helps

Installing SpeckPaypal Module into ZF2

I am having issues with installing this module into ZF2 via composer. I have edited the composer.json file that comes with zend framework 2 but it won't install when I run the command php composer.phar install.
Here is what my composer.json file looks like:
"name": "speckcommerce/speck-paypal",
"description": "A generic module for adding PayPal support to a ZF2 application.",
"type": "library",
"keywords": [
"zf2"
],
"homepage": "http://github.com/speckcommerce/SpeckPaypal",
"authors": [
{
"name": "Stephen Rhoades",
"email": "steve#stephenrhoades.com",
"homepage": "http://www.stephenrhoades.com"
}
],
"require": {
"php": ">=5.4",
"zendframework/zendframework": "2.*"
},
"autoload": {
"psr-0": {
"SpeckPaypal": "src/"
},
"classmap": [
"./"
]
}
The source can be found at: https://github.com/speckcommerce/SpeckPaypal
Thanks!
You are supposed to
composer require speckcommerce/speck-paypal:dev-master
from your project root. The composer.json from the SpeckPaypal Module won't help you there :D
Dunno if you are still struggling with this; but it appears that speck's composer json is not quite correct.
The accepted structure for a ZF2 module leaves module.php outside the scope of the standard psr-0 autoloader; most modules define ./Module.php in their classmap section see https://github.com/zendframework/ZendDeveloperTools/blob/master/composer.json as an example.

Resources