Download the PHP package ryancwalsh/stack-exchange-backup-laravel without Composer

On this page you can find all versions of the php package ryancwalsh/stack-exchange-backup-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package stack-exchange-backup-laravel

StackExchangeBackupLaravel

Allows you to export JSON files of your most important data (questions, answers, comments, favorites) from each of your Stack Exchange sites (Stack Overflow, Super User, Server Fault, etc).

Installation

  1. I think this project requires PHP 7.3 or later, so be sure that your system complies.
  2. Sign up at https://stackapps.com/apps/oauth/register to receive a Client ID, Client Secret, and Key. (It's free, easy, and fast.)
  3. Create a Laravel project, and make sure that it works: https://laravel.com/docs/6.0/installation (e.g. composer create-project --prefer-dist laravel/laravel stackExchangeBackupDemo)
  4. Add this package into your Laravel project: vagrant@vboxHomestead:~/Code/MyLaravelProject$ composer require ryancwalsh/stack-exchange-backup-laravel:^2.0.6 (but use whatever the latest release tag number is at https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP/releases).
  5. Run php artisan vendor:publish, and if it gives you a choice, choose to publish from this package.
  6. Edit your Laravel project's .env file to have your own StackApps values. A non-working sample is below.
  7. Run php artisan exportStackExchange. There are also these options available:
    1. php artisan exportStackExchange --forgetCache is an available option to clear the cached access code value.
    2. php artisan exportStackExchange --code="YOUR_CODE" is an available option to provide a code that you've already retrieved from StackExchange.
    3. php artisan exportStackExchange --S3=false is an available option to skip uploading to Amazon S3.
  8. Following the instructions in the terminal, you'll use your browser to visit a URL that will provide you with a temporary access token to paste into the terminal.
  9. Finished! The JSON files will appear in your /storage/app/StackExchange folder, and a zip of those files will appear in S3.

If You Use This Package, Let Me Know!

This is the first package that I've ever made, and I'm super curious if anyone will ever use it. If you do try it out, I'd love for you to open an issue to say hi (and of course to tell me any suggestions you have).


If You Want To Get Creative...

Visit https://api.stackexchange.com/docs to read the docs, and you can modify ExportStackExchangeHelper.php to do whatever you want. The Stack Exchange API is great.

Other Resources That Helped Me

Problems for Ryan locally. Workaround / hack.

The easier way to do what is shown in "Older notes"

2024-07-06_135807_ET

  1. In WSL, run cd /mnt/c/code/stackExchangeBackupDemo2 && php artisan exportStackExchange --forgetCache.
  2. Visit https://reqbin.com/post-online and log in.
  3. In the left panel, click Saved > stackoverflow.
  4. change value of "code" to the value from the URL from the first step.
  5. Click send.
  6. From the new URL, copy the access token.
  7. Paste the access token into the "get" function (see FIXNOW) in C:\code\stackExchangeBackupDemo2\vendor\ryancwalsh\stack-exchange-backup-laravel\src\ExportStackExchangeHelper.php.

Older notes (stale?)

https://stackapps.com/questions/10497/suddenly-getting-couldnt-parse-client-id#comment20685_10497 By posting into reqbin.com/post-online in x-www-form-urlencoded mode instead of application/json, I'm able to retrieve an access_token.

url: https://stackoverflow.com/oauth/access_token/json

payload: client_id=(from_laravel.log)__ client_secret=(from_laravel.log)__ code=(from_browser_URL)__ redirect_uri=https://stackexchange.com/oauth/login_success

Get the access_token from the result.

Put a line like return json_encode(['access_token'=> 'Ke4q2tsof5yfPUTf']); as the first line of public function getAccessTokenJson() in C:\code\stackExchangeBackupDemo2\vendor\ryancwalsh\stack-exchange-backup-laravel\src\ExportStackExchangeHelper.php.

In a new VSC window, open C:\code\stack-exchange-backup-laravel\src\ExportStackExchangeHelper.php in its project.

Note that this is NOT symlinked to C:\code\stackExchangeBackupDemo2\vendor\ryancwalsh\stack-exchange-backup-laravel\src\ExportStackExchangeHelper.php


All versions of stack-exchange-backup-laravel with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.0.1
php Version ^7.3
laravel/framework Version 8.12.*
laravel/helpers Version ^1.1
league/flysystem-aws-s3-v3 Version ^1.0
spatie/laravel-backup Version ^6.4
spatie/guzzle-rate-limiter-middleware Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ryancwalsh/stack-exchange-backup-laravel contains the following files

Loading the files please wait ....