diff --git a/README.md b/README.md index b7f1671..06270a7 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,52 @@ # Boz-MW This is another MediaWiki API handler in PHP. ## Showcase Here some usage examples: fetch( [ 'action' => 'query', 'prop' => 'info', 'titles' => [ 'Pagina principale' ] ] ); print_r( $response ); echo "Simple Italian Wikipedia API query with continuation support:\n"; $members = \wm\WikipediaIt::getInstance()->createQuery( [ 'action' => 'query', 'list' => 'categorymembers', 'cmtitle' => 'Categoria:Software con licenza GNU GPL', ] ); foreach( $members->getGenerator() as $response ) { print_r( $response ); } echo "Simple POST request (every POST do an implicit login):\n"; \mw\API::$DEFAULT_USERNAME = 'My username'; \mw\API::$DEFAULT_PASSWORD = 'My bot password'; $wit = \wm\WikipediaIt::getInstance(); $response = $WIT->post( [ 'action' => 'edit', 'title' => 'Special:Nothing', 'text' => 'My wikitext', 'summary' => 'My edit summary', 'token' => $wit->getToken( 'csrf' ), ] ); print_r( $response ); ## Known usage * [ItalianWikipediaDeletionBot](https://github.com/valerio-bozzolan/ItalianWikipediaDeletionBot) * [wiki-users-leaflet](https://github.com/valerio-bozzolan/wiki-users-leaflet/) hosted at [WMF Labs](https://tools.wmflabs.org/it-wiki-users-leaflet/) diff --git a/autoload.php b/autoload.php index 0926d15..58a888a 100644 --- a/autoload.php +++ b/autoload.php @@ -1,23 +1,23 @@ . +# along with this program. If not, see . spl_autoload_register( function( $name ) { - $path = __DIR__ . DIRECTORY_SEPARATOR . "class-$name.php"; + $path = __DIR__ . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . "class-$name.php"; if( is_file( $path ) ) { require $path; } } ); diff --git "a/class-cli\\Input.php" "b/include/class-cli\\Input.php" similarity index 100% rename from "class-cli\\Input.php" rename to "include/class-cli\\Input.php" diff --git "a/class-cli\\Log.php" "b/include/class-cli\\Log.php" similarity index 100% rename from "class-cli\\Log.php" rename to "include/class-cli\\Log.php" diff --git "a/class-generic\\Singleton.php" "b/include/class-generic\\Singleton.php" similarity index 100% rename from "class-generic\\Singleton.php" rename to "include/class-generic\\Singleton.php" diff --git "a/class-mw\\API.php" "b/include/class-mw\\API.php" similarity index 100% rename from "class-mw\\API.php" rename to "include/class-mw\\API.php" diff --git "a/class-mw\\APIQuery.php" "b/include/class-mw\\APIQuery.php" similarity index 100% rename from "class-mw\\APIQuery.php" rename to "include/class-mw\\APIQuery.php" diff --git "a/class-mw\\API\\BadTokenException.php" "b/include/class-mw\\API\\BadTokenException.php" similarity index 100% rename from "class-mw\\API\\BadTokenException.php" rename to "include/class-mw\\API\\BadTokenException.php" diff --git "a/class-mw\\API\\Exception.php" "b/include/class-mw\\API\\Exception.php" similarity index 100% rename from "class-mw\\API\\Exception.php" rename to "include/class-mw\\API\\Exception.php" diff --git "a/class-mw\\API\\MaxLagException.php" "b/include/class-mw\\API\\MaxLagException.php" similarity index 100% rename from "class-mw\\API\\MaxLagException.php" rename to "include/class-mw\\API\\MaxLagException.php" diff --git "a/class-mw\\API\\PageMatcher.php" "b/include/class-mw\\API\\PageMatcher.php" similarity index 100% rename from "class-mw\\API\\PageMatcher.php" rename to "include/class-mw\\API\\PageMatcher.php" diff --git "a/class-mw\\Ns.php" "b/include/class-mw\\Ns.php" similarity index 100% rename from "class-mw\\Ns.php" rename to "include/class-mw\\Ns.php" diff --git "a/class-mw\\Site.php" "b/include/class-mw\\Site.php" similarity index 100% rename from "class-mw\\Site.php" rename to "include/class-mw\\Site.php" diff --git "a/class-mw\\StaticSite.php" "b/include/class-mw\\StaticSite.php" similarity index 100% rename from "class-mw\\StaticSite.php" rename to "include/class-mw\\StaticSite.php" diff --git "a/class-mw\\Title.php" "b/include/class-mw\\Title.php" similarity index 100% rename from "class-mw\\Title.php" rename to "include/class-mw\\Title.php" diff --git "a/class-mw\\TitlePart.php" "b/include/class-mw\\TitlePart.php" similarity index 100% rename from "class-mw\\TitlePart.php" rename to "include/class-mw\\TitlePart.php" diff --git "a/class-mw\\TitlePartCapitalized.php" "b/include/class-mw\\TitlePartCapitalized.php" similarity index 100% rename from "class-mw\\TitlePartCapitalized.php" rename to "include/class-mw\\TitlePartCapitalized.php" diff --git "a/class-mw\\Tokens.php" "b/include/class-mw\\Tokens.php" similarity index 100% rename from "class-mw\\Tokens.php" rename to "include/class-mw\\Tokens.php" diff --git "a/class-mw\\Wikitext.php" "b/include/class-mw\\Wikitext.php" similarity index 100% rename from "class-mw\\Wikitext.php" rename to "include/class-mw\\Wikitext.php" diff --git "a/class-network\\Exception.php" "b/include/class-network\\Exception.php" similarity index 100% rename from "class-network\\Exception.php" rename to "include/class-network\\Exception.php" diff --git "a/class-network\\HTTPRequest.php" "b/include/class-network\\HTTPRequest.php" similarity index 100% rename from "class-network\\HTTPRequest.php" rename to "include/class-network\\HTTPRequest.php" diff --git "a/class-network\\NotOKException.php" "b/include/class-network\\NotOKException.php" similarity index 100% rename from "class-network\\NotOKException.php" rename to "include/class-network\\NotOKException.php" diff --git "a/class-network\\Status.php" "b/include/class-network\\Status.php" similarity index 100% rename from "class-network\\Status.php" rename to "include/class-network\\Status.php" diff --git "a/class-regex\\Generic.php" "b/include/class-regex\\Generic.php" similarity index 100% rename from "class-regex\\Generic.php" rename to "include/class-regex\\Generic.php" diff --git "a/class-wb\\Claim.php" "b/include/class-wb\\Claim.php" similarity index 100% rename from "class-wb\\Claim.php" rename to "include/class-wb\\Claim.php" diff --git "a/class-wb\\Claims.php" "b/include/class-wb\\Claims.php" similarity index 100% rename from "class-wb\\Claims.php" rename to "include/class-wb\\Claims.php" diff --git "a/class-wb\\DataModel.php" "b/include/class-wb\\DataModel.php" similarity index 100% rename from "class-wb\\DataModel.php" rename to "include/class-wb\\DataModel.php" diff --git "a/class-wb\\DataType.php" "b/include/class-wb\\DataType.php" similarity index 100% rename from "class-wb\\DataType.php" rename to "include/class-wb\\DataType.php" diff --git "a/class-wb\\DataValue.php" "b/include/class-wb\\DataValue.php" similarity index 100% rename from "class-wb\\DataValue.php" rename to "include/class-wb\\DataValue.php" diff --git "a/class-wb\\DataValueCommonsMedia.php" "b/include/class-wb\\DataValueCommonsMedia.php" similarity index 100% rename from "class-wb\\DataValueCommonsMedia.php" rename to "include/class-wb\\DataValueCommonsMedia.php" diff --git "a/class-wb\\DataValueGlobeCoordinate.php" "b/include/class-wb\\DataValueGlobeCoordinate.php" similarity index 100% rename from "class-wb\\DataValueGlobeCoordinate.php" rename to "include/class-wb\\DataValueGlobeCoordinate.php" diff --git "a/class-wb\\DataValueItem.php" "b/include/class-wb\\DataValueItem.php" similarity index 100% rename from "class-wb\\DataValueItem.php" rename to "include/class-wb\\DataValueItem.php" diff --git "a/class-wb\\DataValueQuantity.php" "b/include/class-wb\\DataValueQuantity.php" similarity index 100% rename from "class-wb\\DataValueQuantity.php" rename to "include/class-wb\\DataValueQuantity.php" diff --git "a/class-wb\\DataValueString.php" "b/include/class-wb\\DataValueString.php" similarity index 100% rename from "class-wb\\DataValueString.php" rename to "include/class-wb\\DataValueString.php" diff --git "a/class-wb\\DataValueTime.php" "b/include/class-wb\\DataValueTime.php" similarity index 100% rename from "class-wb\\DataValueTime.php" rename to "include/class-wb\\DataValueTime.php" diff --git "a/class-wb\\Description.php" "b/include/class-wb\\Description.php" similarity index 100% rename from "class-wb\\Description.php" rename to "include/class-wb\\Description.php" diff --git "a/class-wb\\DescriptionAction.php" "b/include/class-wb\\DescriptionAction.php" similarity index 100% rename from "class-wb\\DescriptionAction.php" rename to "include/class-wb\\DescriptionAction.php" diff --git "a/class-wb\\Descriptions.php" "b/include/class-wb\\Descriptions.php" similarity index 100% rename from "class-wb\\Descriptions.php" rename to "include/class-wb\\Descriptions.php" diff --git "a/class-wb\\Item.php" "b/include/class-wb\\Item.php" similarity index 100% rename from "class-wb\\Item.php" rename to "include/class-wb\\Item.php" diff --git "a/class-wb\\Label.php" "b/include/class-wb\\Label.php" similarity index 100% rename from "class-wb\\Label.php" rename to "include/class-wb\\Label.php" diff --git "a/class-wb\\LabelAction.php" "b/include/class-wb\\LabelAction.php" similarity index 100% rename from "class-wb\\LabelAction.php" rename to "include/class-wb\\LabelAction.php" diff --git "a/class-wb\\Labels.php" "b/include/class-wb\\Labels.php" similarity index 100% rename from "class-wb\\Labels.php" rename to "include/class-wb\\Labels.php" diff --git "a/class-wb\\Snak.php" "b/include/class-wb\\Snak.php" similarity index 100% rename from "class-wb\\Snak.php" rename to "include/class-wb\\Snak.php" diff --git "a/class-wb\\SnakCommonsMedia.php" "b/include/class-wb\\SnakCommonsMedia.php" similarity index 100% rename from "class-wb\\SnakCommonsMedia.php" rename to "include/class-wb\\SnakCommonsMedia.php" diff --git "a/class-wb\\SnakGlobeCoordinate.php" "b/include/class-wb\\SnakGlobeCoordinate.php" similarity index 100% rename from "class-wb\\SnakGlobeCoordinate.php" rename to "include/class-wb\\SnakGlobeCoordinate.php" diff --git "a/class-wb\\SnakItem.php" "b/include/class-wb\\SnakItem.php" similarity index 100% rename from "class-wb\\SnakItem.php" rename to "include/class-wb\\SnakItem.php" diff --git "a/class-wb\\SnakQuantity.php" "b/include/class-wb\\SnakQuantity.php" similarity index 100% rename from "class-wb\\SnakQuantity.php" rename to "include/class-wb\\SnakQuantity.php" diff --git "a/class-wb\\SnakString.php" "b/include/class-wb\\SnakString.php" similarity index 100% rename from "class-wb\\SnakString.php" rename to "include/class-wb\\SnakString.php" diff --git "a/class-wb\\SnakTime.php" "b/include/class-wb\\SnakTime.php" similarity index 100% rename from "class-wb\\SnakTime.php" rename to "include/class-wb\\SnakTime.php" diff --git "a/class-wb\\Snaks.php" "b/include/class-wb\\Snaks.php" similarity index 100% rename from "class-wb\\Snaks.php" rename to "include/class-wb\\Snaks.php" diff --git "a/class-wb\\Statement.php" "b/include/class-wb\\Statement.php" similarity index 100% rename from "class-wb\\Statement.php" rename to "include/class-wb\\Statement.php" diff --git "a/class-wb\\StatementCommonsMedia.php" "b/include/class-wb\\StatementCommonsMedia.php" similarity index 100% rename from "class-wb\\StatementCommonsMedia.php" rename to "include/class-wb\\StatementCommonsMedia.php" diff --git "a/class-wb\\StatementGlobeCoordinate.php" "b/include/class-wb\\StatementGlobeCoordinate.php" similarity index 100% rename from "class-wb\\StatementGlobeCoordinate.php" rename to "include/class-wb\\StatementGlobeCoordinate.php" diff --git "a/class-wb\\StatementItem.php" "b/include/class-wb\\StatementItem.php" similarity index 100% rename from "class-wb\\StatementItem.php" rename to "include/class-wb\\StatementItem.php" diff --git "a/class-wb\\StatementQuantity.php" "b/include/class-wb\\StatementQuantity.php" similarity index 100% rename from "class-wb\\StatementQuantity.php" rename to "include/class-wb\\StatementQuantity.php" diff --git "a/class-wb\\StatementString.php" "b/include/class-wb\\StatementString.php" similarity index 100% rename from "class-wb\\StatementString.php" rename to "include/class-wb\\StatementString.php" diff --git "a/class-wb\\StatementTime.php" "b/include/class-wb\\StatementTime.php" similarity index 100% rename from "class-wb\\StatementTime.php" rename to "include/class-wb\\StatementTime.php" diff --git "a/class-wb\\WrongDataException.php" "b/include/class-wb\\WrongDataException.php" similarity index 100% rename from "class-wb\\WrongDataException.php" rename to "include/class-wb\\WrongDataException.php" diff --git "a/class-wm\\Commons.php" "b/include/class-wm\\Commons.php" similarity index 100% rename from "class-wm\\Commons.php" rename to "include/class-wm\\Commons.php" diff --git "a/class-wm\\Wikidata.php" "b/include/class-wm\\Wikidata.php" similarity index 100% rename from "class-wm\\Wikidata.php" rename to "include/class-wm\\Wikidata.php" diff --git "a/class-wm\\WikipediaIt.php" "b/include/class-wm\\WikipediaIt.php" similarity index 100% rename from "class-wm\\WikipediaIt.php" rename to "include/class-wm\\WikipediaIt.php"