mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-10-31 20:12:29 +01:00
Huge number of updates, too tired to list them all
+ Added a bunch of API handler classes that will use the already created models + Created a new Client class that will connect to new API handler classes + Created new collection classes
This commit is contained in:
39
src/TestRun.php
Normal file
39
src/TestRun.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Gitea;
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use Gitea\Client;
|
||||
|
||||
print("Starting Script... \n");
|
||||
print("Creating Guzzle client \n");
|
||||
$giteaClient = new Client("https://gitea.devserver.localdomain:3000/api/v1/");
|
||||
$giteaClient->setAuthToken('32e609ad39539c1d0e8544800bd49b1025ac6b49');
|
||||
// print("Getting Organization via API \n");
|
||||
// $organization = $giteaClient->organizations()->getByUsername("Sitelease");
|
||||
// if ($organization) {
|
||||
// print("Username: ".$organization->getUsername()."\n");
|
||||
// print("Full Name: ".$organization->getFullName()."\n");
|
||||
// print("Description: ".$organization->getDescription()."\n");
|
||||
// print("Website: ".$organization->getWebsite()."\n");
|
||||
// print("Location: ".$organization->getLocation()."\n");
|
||||
// var_dump(json_encode($organization));
|
||||
// } else {
|
||||
// print("No Data could be retrieved"."\n");
|
||||
// }
|
||||
print("Getting all repos via API \n");
|
||||
$repositories = $giteaClient->repositories()->all();
|
||||
if ($repositories && count($repositories) > 0) {
|
||||
foreach ($repositories as $item) {
|
||||
print("Name: ".$item->getName()."\n");
|
||||
print("Full Name: ".$item->getFullName()."\n");
|
||||
print("Description: ".$item->getDescription()."\n");
|
||||
print("\n\n");
|
||||
}
|
||||
print("Total Items: ".count($repositories)."\n");
|
||||
} else {
|
||||
print("No repos could be retrieved"."\n");
|
||||
}
|
||||
|
||||
print("Exiting script"."\n");
|
||||
Reference in New Issue
Block a user