Monday, January 24, 2022

[FIXED] ProcessOut integration without composer

Issue

I'm trying to integrate processout but they only seem to support composer integration.

https://github.com/ProcessOut/processout-php

How would I integrate this just by uploading the /src/ folder into my project?

<?php
// Load dependencies
require 'vendor/autoload.php';

// Instantiate ProcessOut
$processout = new \ProcessOut\ProcessOut();
$processout->setProjectId('<project-id>');
$processout->setProjectSecret('<project-key>');

// Set this project as the default one for the current request
\ProcessOut\ProcessOut::setDefault($processout);
?>

Solution

You are ignoring that Composer is not an autoloader generator, but first and foremost a dependency manager. If you look at the composer.json file of the ProcessOut package you see:

"require": {
    "php": ">=5.4",
    "ext-curl": "*",
    "ext-mbstring": "*",
    "anlutro/curl": "1.4"
  },

The last line is a package it depends on itself, and that you'll be missing out when not using Composer. You could theoretically load and include all dependencies recursively yourself, but in the end - just get composer and let it do its work.



Answered By - Niels Keurentjes

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.