Version Description
Download this release
Release Info
Developer | |
Plugin | Official Facebook Pixel |
Version | 2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.0 to 2.2.1
- changelog.txt +8 -0
- composer.json +1 -1
- composer.lock +751 -7
- core/FacebookPluginConfig.php +1 -1
- core/FacebookPluginUtils.php +10 -7
- core/FacebookServerSideEvent.php +39 -8
- core/FacebookWordpressPixelInjection.php +17 -0
- core/PixelRenderer.php +11 -4
- core/ServerEventAsyncTask.php +14 -4
- core/ServerEventFactory.php +4 -0
- facebook-for-wordpress.php +1 -1
- integration/FacebookWordpressCalderaForm.php +4 -1
- integration/FacebookWordpressContactForm7.php +4 -2
- integration/FacebookWordpressEasyDigitalDownloads.php +10 -8
- integration/FacebookWordpressFormidableForm.php +2 -2
- integration/FacebookWordpressGravityForms.php +1 -1
- integration/FacebookWordpressMailchimpForWp.php +1 -1
- integration/FacebookWordpressNinjaForms.php +1 -1
- integration/FacebookWordpressWPECommerce.php +3 -3
- integration/FacebookWordpressWPForms.php +2 -2
- integration/FacebookWordpressWooCommerce.php +133 -4
- languages/official-facebook-pixel-ar_AR.po +1 -1
- languages/official-facebook-pixel-cs_CZ.po +1 -1
- languages/official-facebook-pixel-da_DK.po +1 -1
- languages/official-facebook-pixel-de_DE.po +1 -1
- languages/official-facebook-pixel-en_GB.po +1 -1
- languages/official-facebook-pixel-es_ES.po +1 -1
- languages/official-facebook-pixel-es_LA.po +1 -1
- languages/official-facebook-pixel-fi_FI.po +1 -1
- languages/official-facebook-pixel-fr_CA.po +1 -1
- languages/official-facebook-pixel-fr_FR.po +1 -1
- languages/official-facebook-pixel-he_IL.po +1 -1
- languages/official-facebook-pixel-it_IT.po +1 -1
- languages/official-facebook-pixel-ja_JP.po +1 -1
- languages/official-facebook-pixel-ko_KR.po +1 -1
- languages/official-facebook-pixel-nb_NO.po +1 -1
- languages/official-facebook-pixel-nl_NL.po +1 -1
- languages/official-facebook-pixel-pl_PL.po +1 -1
- languages/official-facebook-pixel-pt_BR.po +1 -1
- languages/official-facebook-pixel-pt_PT.po +1 -1
- languages/official-facebook-pixel-ru_RU.po +1 -1
- languages/official-facebook-pixel-sv_SE.po +1 -1
- languages/official-facebook-pixel-th_TH.po +1 -1
- languages/official-facebook-pixel-tr_TR.po +1 -1
- languages/official-facebook-pixel-vi_VN.po +1 -1
- languages/official-facebook-pixel-zh_CN.po +1 -1
- languages/official-facebook-pixel-zh_TW.po +1 -1
- readme.txt +12 -4
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +8 -0
- vendor/composer/autoload_files.php +17 -0
- vendor/composer/autoload_psr4.php +8 -0
- vendor/composer/autoload_real.php +25 -4
- vendor/composer/autoload_static.php +72 -4
- vendor/composer/installed.json +670 -6
- vendor/facebook/php-business-sdk/.gitignore +12 -0
- vendor/facebook/php-business-sdk/CHANGELOG.md +23 -0
- vendor/facebook/php-business-sdk/composer.json +5 -1
- vendor/facebook/php-business-sdk/examples/CustomAudienceUsersPost.php +1 -2
- vendor/facebook/php-business-sdk/examples/CustomAudienceUsersPostCrossPlatform.php +1 -2
- vendor/facebook/php-business-sdk/examples/aggregator_onboarding/api.php +13 -13
- vendor/facebook/php-business-sdk/src/FacebookAds/ApiConfig.php +2 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Http/Exception/RequestException.php +5 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdAccount.php +42 -55
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdAccountAdVolume.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdActivity.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdCreative.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdCreativeInstagramBrandedContent.php +57 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdPlacePageSet.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdStudy.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdStudyObjective.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdVideo.php +26 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{AdsInterest.php → AdoptablePet.php} +6 -6
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdsPixel.php +3 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Application.php +84 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/AtlasCampaign.php +5 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Business.php +94 -217
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessCreative.php +0 -80
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessCreativeFolder.php +0 -262
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessImage.php +0 -245
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessUnit.php +1 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{IterativeSplitTestConfig.php → CPASAdvertiserPartnershipRecommendation.php} +6 -6
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{BusinessCreativeFolderSharingAgreement.php → CPASCollaborationRequest.php} +15 -8
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Campaign.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{ClientTransparencyStatus.php → CatalogSubVerticalList.php} +4 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/CommerceMerchantSettings.php +85 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/CommerceOrder.php +24 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/CommerceOrderTransactionDetail.php +23 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{CreativeAssetTag.php → ConnectionsTargeting.php} +4 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/DACheck.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Event.php +3 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ExtendedCredit.php +25 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ExternalEventSource.php +0 -23
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdAccountAdVolumeFields.php +18 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdAssetFeedSpecFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdCampaignActivityFields.php +0 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{AtlasURLFields.php → AdCreativeInstagramBrandedContentFields.php} +1 -3
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdCreativeInteractiveComponentsSpecFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdPlacePageSetFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdReportSpecFields.php +0 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdgroupPlacementSpecificReviewFeedbackFields.php +8 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{AdsInterestFields.php → AdoptablePetFields.php} +37 -9
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdsInsightsFields.php +8 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AutomotiveModelFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/BusinessCreativeFields.php +0 -67
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/BusinessCreativeFolderFields.php +0 -63
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/BusinessImageFields.php +0 -73
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{BusinessCreativeFolderSharingAgreementFields.php → CPASAdvertiserPartnershipRecommendationFields.php} +15 -5
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{BrandAudienceFields.php → CPASCollaborationRequestFields.php} +17 -17
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CampaignFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CatalogSubVerticalListFields.php +149 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ClientTransparencyStatusFields.php +0 -53
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CommerceMerchantSettingsFields.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CommerceOrderFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{CreativeAssetTagFields.php → ConnectionsTargetingFields.php} +3 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/DestinationFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/EventFields.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/FlightFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/HomeListingFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/HotelFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/IGMediaFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/IterativeSplitTestConfigFields.php +0 -63
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/OracleTransactionFields.php +0 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageAboutStoryFields.php +0 -59
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageAdminNoteFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageFields.php +2 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PagePostFields.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PaymentSubscriptionFields.php +93 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PostFields.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductCatalogFields.php +6 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductFeedFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductItemFields.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductSetFields.php +8 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{MessengerPlatformReferralFields.php → ProductSetMetadataFields.php} +9 -11
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/SecuritySettingsFields.php +0 -2
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/SplitTestConfigFields.php +0 -59
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/TargetingFields.php +5 -3
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{StreamingReactionFields.php → TargetingRelaxationFields.php} +3 -5
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UnifiedThreadFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UserFields.php +0 -12
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UserInfluenceFields.php +0 -51
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UserTaggableFriendFields.php +0 -55
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/VehicleFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/VehicleOfferFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/WhatsAppBusinessAccountFields.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/WhatsAppBusinessProfileFields.php +0 -51
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Group.php +6 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/LifeEvent.php +0 -23
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Link.php +0 -26
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/LiveVideo.php +2 -24
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/MediaFingerprint.php +27 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/MessengerPlatformReferral.php +0 -80
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/NativeOfferView.php +0 -23
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/OracleTransaction.php +0 -24
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Page.php +65 -150
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/PageAboutStory.php +0 -131
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/PageChangeProposal.php +0 -47
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{BrandAudience.php → PaymentSubscription.php} +6 -6
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Photo.php +26 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Post.php +3 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductCatalog.php +20 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductFeed.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductGroup.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductItem.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductSet.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{UserInfluence.php → ProductSetMetadata.php} +4 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Profile.php +3 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProfilePictureSource.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/PublisherBlockList.php +24 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/SavedAudience.php +0 -23
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/AsyncClient.php +53 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/BatchProcessor.php +121 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/CustomData.php +52 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/DeliveryCategory.php +52 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequest.php +165 -5
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequestAsync.php +89 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/HttpMethod.php +34 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/HttpServiceClientConfig.php +48 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/HttpServiceInterface.php +36 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/Normalizer.php +115 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/Singleton.php +44 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/UserData.php +181 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/Util.php +6 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/SplitTestConfig.php +0 -80
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/StreamingReaction.php +0 -59
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/{AtlasURL.php → TargetingRelaxation.php} +4 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/ThirdPartyMeasurementReportDataset.php +0 -24
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/URL.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/User.php +30 -47
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/UserTaggableFriend.php +0 -86
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{StreamingReactionReactionTypeValues.php → AdAccountAdVolumeRecommendationTypeValues.php} +13 -12
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountCurrencyValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountDeliveryEstimateOptimizationGoalValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountPermittedTasksValues.php +0 -3
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountTargetingUnifiedRegulatedCategoriesValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountTasksValues.php +0 -3
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PageDomainActionTypeValues.php → AdActivityDataSourceValues.php} +4 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdActivityEventTypeValues.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAssetFeedSpecCallToActionTypesValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCampaignActivityOptimizationGoalNewValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCampaignActivityOptimizationGoalOldValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCampaignDeliveryEstimateOptimizationGoalValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCreativeCallToActionTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCreativeLinkDataCallToActionTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdNetworkAnalyticsSyncQueryResultBreakdownsValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PagePaymentDevModeActionValues.php → AdPlacePageSetCategoryValues.php} +4 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdPreviewAdFormatValues.php +0 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdSetOptimizationGoalValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdSetTuneForCategoryValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdStudyTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdVideoContainerTypeValues.php +4 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdVideoOriginalProjectionTypeValues.php +0 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdVideoValidationAdPlacementsValues.php +0 -60
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdsPixelAutomaticMatchingFieldsValues.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ApplicationSupportedPlatformsValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessAssetGroupAdaccountTasksValues.php +0 -3
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessAssetGroupPageTasksValues.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessCreativeFolderTasksValues.php +0 -45
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessImageValidationAdPlacementsValues.php +0 -60
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessPagePermittedTasksValues.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessPermittedTasksValues.php +0 -3
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessRoleRequestRoleValues.php +9 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessUserRoleValues.php +9 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CPASCollaborationRequestRequesterAgencyOrBrandValues.php +43 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CampaignSpecialAdCategoriesValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CampaignSpecialAdCategoryCountryValues.php +291 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CampaignSpecialAdCategoryValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CommerceMerchantSettingsCtaValues.php +42 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CustomAudienceDataSourceSubTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/DACheckConnectionMethodValues.php +44 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PageSettingTypeValues.php → EventOnlineEventFormatValues.php} +7 -7
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/EventTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/GroupGroupTypeValues.php +3 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/GroupPurposeValues.php +3 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/LiveVideoBroadcastStatusValues.php +9 -9
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageCallToActionAndroidDestinationTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageCallToActionIphoneDestinationTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageCallToActionTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PagePermittedTasksValues.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PagePickupOptionsValues.php +43 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageSubscribedFieldsValues.php +1 -1
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageTasksValues.php +2 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{BusinessCreativeFolderSharingAgreementRequestStatusValues.php → ProductCatalogItemSubTypeValues.php} +28 -7
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductCatalogPermittedTasksValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductCatalogTasksValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductCatalogVerticalValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductFeedFeedTypeValues.php +1 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{BusinessCreativeFolderPermittedTasksValues.php → ProductFeedItemSubTypeValues.php} +28 -7
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PageThreadStateValues.php → ProfilePictureSourceBreakingChangeValues.php} +3 -4
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/SystemUserRoleValues.php +9 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/WhatsAppBusinessAccountTasksValues.php +45 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/WhatsAppBusinessAccount.php +76 -0
- vendor/facebook/php-business-sdk/src/FacebookAds/Object/WhatsAppBusinessProfile.php +0 -104
- vendor/facebook/php-business-sdk/test/.gitignore +1 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/AsyncClientTest.php +58 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php +166 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/CustomDataTest.php +113 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/EventRequestAsyncTest.php +97 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/EventRequestTest.php +223 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/ServerSideNormalizeTest.php +300 -12
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/ServerSideUtilTest.php +4 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/TestHelpers/AnotherHttpService.php +32 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/TestHelpers/E2ETestHttpService.php +64 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/TestHelpers/FakeHttpService.php +32 -0
- vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/UserDataTest.php +116 -0
- vendor/guzzlehttp/guzzle/.php_cs +23 -0
- vendor/guzzlehttp/guzzle/CHANGELOG.md +1338 -0
- vendor/guzzlehttp/guzzle/Dockerfile +18 -0
- vendor/guzzlehttp/guzzle/LICENSE +19 -0
- vendor/guzzlehttp/guzzle/README.md +90 -0
- vendor/guzzlehttp/guzzle/UPGRADING.md +1203 -0
- vendor/guzzlehttp/guzzle/composer.json +59 -0
- vendor/guzzlehttp/guzzle/src/Client.php +501 -0
- vendor/guzzlehttp/guzzle/src/ClientInterface.php +87 -0
- vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +316 -0
- vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +84 -0
- vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +91 -0
- vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +72 -0
- vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +403 -0
- vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +27 -0
- vendor/guzzlehttp/guzzle/src/Exception/ClientException.php +9 -0
- vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php +37 -0
- vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php +23 -0
- vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php +7 -0
- vendor/guzzlehttp/guzzle/src/Exception/RequestException.php +192 -0
- vendor/guzzlehttp/guzzle/src/Exception/SeekException.php +27 -0
- vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +9 -0
- vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php +6 -0
- vendor/guzzlehttp/guzzle/src/Exception/TransferException.php +6 -0
- vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php +585 -0
- vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +27 -0
- vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php +45 -0
- vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +219 -0
- vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +92 -0
- vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +195 -0
- vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +55 -0
- vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php +545 -0
- vendor/guzzlehttp/guzzle/src/HandlerStack.php +277 -0
- vendor/guzzlehttp/guzzle/src/MessageFormatter.php +185 -0
- vendor/guzzlehttp/guzzle/src/Middleware.php +254 -0
- vendor/guzzlehttp/guzzle/src/Pool.php +134 -0
- vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +111 -0
- vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +255 -0
- vendor/guzzlehttp/guzzle/src/RequestOptions.php +263 -0
- vendor/guzzlehttp/guzzle/src/RetryMiddleware.php +128 -0
- vendor/guzzlehttp/guzzle/src/TransferStats.php +126 -0
- vendor/guzzlehttp/guzzle/src/UriTemplate.php +237 -0
- vendor/guzzlehttp/guzzle/src/Utils.php +92 -0
- vendor/guzzlehttp/guzzle/src/functions.php +334 -0
- vendor/guzzlehttp/guzzle/src/functions_include.php +6 -0
- vendor/guzzlehttp/promises/CHANGELOG.md +65 -0
- vendor/guzzlehttp/promises/LICENSE +19 -0
- vendor/guzzlehttp/promises/Makefile +13 -0
- vendor/guzzlehttp/promises/README.md +504 -0
- vendor/guzzlehttp/promises/composer.json +34 -0
- vendor/guzzlehttp/promises/src/AggregateException.php +16 -0
- vendor/guzzlehttp/promises/src/CancellationException.php +9 -0
- vendor/guzzlehttp/promises/src/Coroutine.php +151 -0
- vendor/guzzlehttp/promises/src/EachPromise.php +229 -0
- vendor/guzzlehttp/promises/src/FulfilledPromise.php +82 -0
- vendor/guzzlehttp/promises/src/Promise.php +280 -0
- vendor/guzzlehttp/promises/src/PromiseInterface.php +93 -0
- vendor/guzzlehttp/promises/src/PromisorInterface.php +15 -0
- vendor/guzzlehttp/promises/src/RejectedPromise.php +87 -0
- vendor/guzzlehttp/promises/src/RejectionException.php +47 -0
- vendor/guzzlehttp/promises/src/TaskQueue.php +66 -0
- vendor/guzzlehttp/promises/src/TaskQueueInterface.php +25 -0
- vendor/guzzlehttp/promises/src/functions.php +457 -0
- vendor/guzzlehttp/promises/src/functions_include.php +6 -0
- vendor/guzzlehttp/psr7/CHANGELOG.md +246 -0
- vendor/guzzlehttp/psr7/LICENSE +19 -0
- vendor/guzzlehttp/psr7/README.md +745 -0
- vendor/guzzlehttp/psr7/composer.json +49 -0
- vendor/guzzlehttp/psr7/src/AppendStream.php +241 -0
- vendor/guzzlehttp/psr7/src/BufferStream.php +137 -0
- vendor/guzzlehttp/psr7/src/CachingStream.php +138 -0
- vendor/guzzlehttp/psr7/src/DroppingStream.php +42 -0
- vendor/guzzlehttp/psr7/src/FnStream.php +158 -0
- vendor/guzzlehttp/psr7/src/InflateStream.php +52 -0
- vendor/guzzlehttp/psr7/src/LazyOpenStream.php +39 -0
- vendor/guzzlehttp/psr7/src/LimitStream.php +155 -0
- vendor/guzzlehttp/psr7/src/MessageTrait.php +213 -0
- vendor/guzzlehttp/psr7/src/MultipartStream.php +153 -0
- vendor/guzzlehttp/psr7/src/NoSeekStream.php +22 -0
changelog.txt
CHANGED
@@ -1,4 +1,12 @@
|
|
1 |
*** Facebook for WordPress Changelog ***
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
2020-08-14 version 2.2.0
|
3 |
* Support for WordPress 5.5
|
4 |
* Improved Conversions API event quality
|
1 |
*** Facebook for WordPress Changelog ***
|
2 |
+
2020-11-04 version 2.2.1
|
3 |
+
* Stop sending events for internal users
|
4 |
+
* Fix Contact Form 7 integration bug, send events only on form submit success
|
5 |
+
* Update Facebook Business SDK to v8.0.2
|
6 |
+
* Requires PHP 5.6 or greater
|
7 |
+
* Sending ViewContent Conversions API event from WooCommerce
|
8 |
+
* Support for WooCommerce through Pixel and Conversions API
|
9 |
+
|
10 |
2020-08-14 version 2.2.0
|
11 |
* Support for WordPress 5.5
|
12 |
* Improved Conversions API event quality
|
composer.json
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
},
|
10 |
"license": "GPL",
|
11 |
"require": {
|
12 |
-
"facebook/php-business-sdk": "
|
13 |
"techcrunch/wp-async-task": "dev-master"
|
14 |
},
|
15 |
"autoload": {
|
9 |
},
|
10 |
"license": "GPL",
|
11 |
"require": {
|
12 |
+
"facebook/php-business-sdk": "8.0.2",
|
13 |
"techcrunch/wp-async-task": "dev-master"
|
14 |
},
|
15 |
"autoload": {
|
composer.lock
CHANGED
@@ -4,23 +4,27 @@
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"content-hash": "
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "facebook/php-business-sdk",
|
11 |
-
"version": "
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/facebook/facebook-php-business-sdk.git",
|
15 |
-
"reference": "
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
-
"url": "https://api.github.com/repos/facebook/facebook-php-business-sdk/zipball/
|
20 |
-
"reference": "
|
21 |
"shasum": ""
|
22 |
},
|
|
|
|
|
|
|
23 |
"require-dev": {
|
|
|
24 |
"phpunit/phpunit": "~8",
|
25 |
"symfony/finder": "~2.6"
|
26 |
},
|
@@ -41,7 +45,647 @@
|
|
41 |
"page",
|
42 |
"sdk"
|
43 |
],
|
44 |
-
"time": "2020-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
},
|
46 |
{
|
47 |
"name": "techcrunch/wp-async-task",
|
@@ -1088,6 +1732,7 @@
|
|
1088 |
"keywords": [
|
1089 |
"tokenizer"
|
1090 |
],
|
|
|
1091 |
"time": "2017-11-27T05:48:46+00:00"
|
1092 |
},
|
1093 |
{
|
@@ -1917,6 +2562,20 @@
|
|
1917 |
],
|
1918 |
"description": "Symfony Console Component",
|
1919 |
"homepage": "https://symfony.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1920 |
"time": "2020-07-06T13:18:39+00:00"
|
1921 |
},
|
1922 |
{
|
@@ -1979,6 +2638,20 @@
|
|
1979 |
"polyfill",
|
1980 |
"portable"
|
1981 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1982 |
"time": "2020-07-14T12:35:20+00:00"
|
1983 |
},
|
1984 |
{
|
@@ -2042,6 +2715,20 @@
|
|
2042 |
"portable",
|
2043 |
"shim"
|
2044 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2045 |
"time": "2020-07-14T12:35:20+00:00"
|
2046 |
},
|
2047 |
{
|
@@ -2104,6 +2791,20 @@
|
|
2104 |
"portable",
|
2105 |
"shim"
|
2106 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2107 |
"time": "2020-07-14T12:35:20+00:00"
|
2108 |
},
|
2109 |
{
|
@@ -2170,6 +2871,20 @@
|
|
2170 |
"portable",
|
2171 |
"shim"
|
2172 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2173 |
"time": "2020-07-14T12:35:20+00:00"
|
2174 |
},
|
2175 |
{
|
@@ -2232,6 +2947,20 @@
|
|
2232 |
"interoperability",
|
2233 |
"standards"
|
2234 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2235 |
"time": "2020-07-06T13:23:11+00:00"
|
2236 |
},
|
2237 |
{
|
@@ -2291,6 +3020,20 @@
|
|
2291 |
],
|
2292 |
"description": "Symfony Yaml Component",
|
2293 |
"homepage": "https://symfony.com",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2294 |
"time": "2020-05-20T08:37:50+00:00"
|
2295 |
},
|
2296 |
{
|
@@ -2392,5 +3135,6 @@
|
|
2392 |
"prefer-stable": false,
|
2393 |
"prefer-lowest": false,
|
2394 |
"platform": [],
|
2395 |
-
"platform-dev": []
|
|
|
2396 |
}
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "a0aad8d1bffd3ae28611c14df87c968a",
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "facebook/php-business-sdk",
|
11 |
+
"version": "8.0.2",
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/facebook/facebook-php-business-sdk.git",
|
15 |
+
"reference": "637fce87380d4a65f6d4c24cc79664fa28c3428d"
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/facebook/facebook-php-business-sdk/zipball/637fce87380d4a65f6d4c24cc79664fa28c3428d",
|
20 |
+
"reference": "637fce87380d4a65f6d4c24cc79664fa28c3428d",
|
21 |
"shasum": ""
|
22 |
},
|
23 |
+
"require": {
|
24 |
+
"guzzlehttp/guzzle": "^6.5"
|
25 |
+
},
|
26 |
"require-dev": {
|
27 |
+
"mockery/mockery": "1.3.3",
|
28 |
"phpunit/phpunit": "~8",
|
29 |
"symfony/finder": "~2.6"
|
30 |
},
|
45 |
"page",
|
46 |
"sdk"
|
47 |
],
|
48 |
+
"time": "2020-09-18T00:34:44+00:00"
|
49 |
+
},
|
50 |
+
{
|
51 |
+
"name": "guzzlehttp/guzzle",
|
52 |
+
"version": "6.5.5",
|
53 |
+
"source": {
|
54 |
+
"type": "git",
|
55 |
+
"url": "https://github.com/guzzle/guzzle.git",
|
56 |
+
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
|
57 |
+
},
|
58 |
+
"dist": {
|
59 |
+
"type": "zip",
|
60 |
+
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
|
61 |
+
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
|
62 |
+
"shasum": ""
|
63 |
+
},
|
64 |
+
"require": {
|
65 |
+
"ext-json": "*",
|
66 |
+
"guzzlehttp/promises": "^1.0",
|
67 |
+
"guzzlehttp/psr7": "^1.6.1",
|
68 |
+
"php": ">=5.5",
|
69 |
+
"symfony/polyfill-intl-idn": "^1.17.0"
|
70 |
+
},
|
71 |
+
"require-dev": {
|
72 |
+
"ext-curl": "*",
|
73 |
+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
74 |
+
"psr/log": "^1.1"
|
75 |
+
},
|
76 |
+
"suggest": {
|
77 |
+
"psr/log": "Required for using the Log middleware"
|
78 |
+
},
|
79 |
+
"type": "library",
|
80 |
+
"extra": {
|
81 |
+
"branch-alias": {
|
82 |
+
"dev-master": "6.5-dev"
|
83 |
+
}
|
84 |
+
},
|
85 |
+
"autoload": {
|
86 |
+
"psr-4": {
|
87 |
+
"GuzzleHttp\\": "src/"
|
88 |
+
},
|
89 |
+
"files": [
|
90 |
+
"src/functions_include.php"
|
91 |
+
]
|
92 |
+
},
|
93 |
+
"notification-url": "https://packagist.org/downloads/",
|
94 |
+
"license": [
|
95 |
+
"MIT"
|
96 |
+
],
|
97 |
+
"authors": [
|
98 |
+
{
|
99 |
+
"name": "Michael Dowling",
|
100 |
+
"email": "mtdowling@gmail.com",
|
101 |
+
"homepage": "https://github.com/mtdowling"
|
102 |
+
}
|
103 |
+
],
|
104 |
+
"description": "Guzzle is a PHP HTTP client library",
|
105 |
+
"homepage": "http://guzzlephp.org/",
|
106 |
+
"keywords": [
|
107 |
+
"client",
|
108 |
+
"curl",
|
109 |
+
"framework",
|
110 |
+
"http",
|
111 |
+
"http client",
|
112 |
+
"rest",
|
113 |
+
"web service"
|
114 |
+
],
|
115 |
+
"time": "2020-06-16T21:01:06+00:00"
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"name": "guzzlehttp/promises",
|
119 |
+
"version": "v1.3.1",
|
120 |
+
"source": {
|
121 |
+
"type": "git",
|
122 |
+
"url": "https://github.com/guzzle/promises.git",
|
123 |
+
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
|
124 |
+
},
|
125 |
+
"dist": {
|
126 |
+
"type": "zip",
|
127 |
+
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
128 |
+
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
129 |
+
"shasum": ""
|
130 |
+
},
|
131 |
+
"require": {
|
132 |
+
"php": ">=5.5.0"
|
133 |
+
},
|
134 |
+
"require-dev": {
|
135 |
+
"phpunit/phpunit": "^4.0"
|
136 |
+
},
|
137 |
+
"type": "library",
|
138 |
+
"extra": {
|
139 |
+
"branch-alias": {
|
140 |
+
"dev-master": "1.4-dev"
|
141 |
+
}
|
142 |
+
},
|
143 |
+
"autoload": {
|
144 |
+
"psr-4": {
|
145 |
+
"GuzzleHttp\\Promise\\": "src/"
|
146 |
+
},
|
147 |
+
"files": [
|
148 |
+
"src/functions_include.php"
|
149 |
+
]
|
150 |
+
},
|
151 |
+
"notification-url": "https://packagist.org/downloads/",
|
152 |
+
"license": [
|
153 |
+
"MIT"
|
154 |
+
],
|
155 |
+
"authors": [
|
156 |
+
{
|
157 |
+
"name": "Michael Dowling",
|
158 |
+
"email": "mtdowling@gmail.com",
|
159 |
+
"homepage": "https://github.com/mtdowling"
|
160 |
+
}
|
161 |
+
],
|
162 |
+
"description": "Guzzle promises library",
|
163 |
+
"keywords": [
|
164 |
+
"promise"
|
165 |
+
],
|
166 |
+
"time": "2016-12-20T10:07:11+00:00"
|
167 |
+
},
|
168 |
+
{
|
169 |
+
"name": "guzzlehttp/psr7",
|
170 |
+
"version": "1.6.1",
|
171 |
+
"source": {
|
172 |
+
"type": "git",
|
173 |
+
"url": "https://github.com/guzzle/psr7.git",
|
174 |
+
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
|
175 |
+
},
|
176 |
+
"dist": {
|
177 |
+
"type": "zip",
|
178 |
+
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
|
179 |
+
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
|
180 |
+
"shasum": ""
|
181 |
+
},
|
182 |
+
"require": {
|
183 |
+
"php": ">=5.4.0",
|
184 |
+
"psr/http-message": "~1.0",
|
185 |
+
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
|
186 |
+
},
|
187 |
+
"provide": {
|
188 |
+
"psr/http-message-implementation": "1.0"
|
189 |
+
},
|
190 |
+
"require-dev": {
|
191 |
+
"ext-zlib": "*",
|
192 |
+
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
193 |
+
},
|
194 |
+
"suggest": {
|
195 |
+
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
|
196 |
+
},
|
197 |
+
"type": "library",
|
198 |
+
"extra": {
|
199 |
+
"branch-alias": {
|
200 |
+
"dev-master": "1.6-dev"
|
201 |
+
}
|
202 |
+
},
|
203 |
+
"autoload": {
|
204 |
+
"psr-4": {
|
205 |
+
"GuzzleHttp\\Psr7\\": "src/"
|
206 |
+
},
|
207 |
+
"files": [
|
208 |
+
"src/functions_include.php"
|
209 |
+
]
|
210 |
+
},
|
211 |
+
"notification-url": "https://packagist.org/downloads/",
|
212 |
+
"license": [
|
213 |
+
"MIT"
|
214 |
+
],
|
215 |
+
"authors": [
|
216 |
+
{
|
217 |
+
"name": "Michael Dowling",
|
218 |
+
"email": "mtdowling@gmail.com",
|
219 |
+
"homepage": "https://github.com/mtdowling"
|
220 |
+
},
|
221 |
+
{
|
222 |
+
"name": "Tobias Schultze",
|
223 |
+
"homepage": "https://github.com/Tobion"
|
224 |
+
}
|
225 |
+
],
|
226 |
+
"description": "PSR-7 message implementation that also provides common utility methods",
|
227 |
+
"keywords": [
|
228 |
+
"http",
|
229 |
+
"message",
|
230 |
+
"psr-7",
|
231 |
+
"request",
|
232 |
+
"response",
|
233 |
+
"stream",
|
234 |
+
"uri",
|
235 |
+
"url"
|
236 |
+
],
|
237 |
+
"time": "2019-07-01T23:21:34+00:00"
|
238 |
+
},
|
239 |
+
{
|
240 |
+
"name": "paragonie/random_compat",
|
241 |
+
"version": "v9.99.99",
|
242 |
+
"source": {
|
243 |
+
"type": "git",
|
244 |
+
"url": "https://github.com/paragonie/random_compat.git",
|
245 |
+
"reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95"
|
246 |
+
},
|
247 |
+
"dist": {
|
248 |
+
"type": "zip",
|
249 |
+
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
|
250 |
+
"reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
|
251 |
+
"shasum": ""
|
252 |
+
},
|
253 |
+
"require": {
|
254 |
+
"php": "^7"
|
255 |
+
},
|
256 |
+
"require-dev": {
|
257 |
+
"phpunit/phpunit": "4.*|5.*",
|
258 |
+
"vimeo/psalm": "^1"
|
259 |
+
},
|
260 |
+
"suggest": {
|
261 |
+
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
262 |
+
},
|
263 |
+
"type": "library",
|
264 |
+
"notification-url": "https://packagist.org/downloads/",
|
265 |
+
"license": [
|
266 |
+
"MIT"
|
267 |
+
],
|
268 |
+
"authors": [
|
269 |
+
{
|
270 |
+
"name": "Paragon Initiative Enterprises",
|
271 |
+
"email": "security@paragonie.com",
|
272 |
+
"homepage": "https://paragonie.com"
|
273 |
+
}
|
274 |
+
],
|
275 |
+
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
276 |
+
"keywords": [
|
277 |
+
"csprng",
|
278 |
+
"polyfill",
|
279 |
+
"pseudorandom",
|
280 |
+
"random"
|
281 |
+
],
|
282 |
+
"time": "2018-07-02T15:55:56+00:00"
|
283 |
+
},
|
284 |
+
{
|
285 |
+
"name": "psr/http-message",
|
286 |
+
"version": "1.0.1",
|
287 |
+
"source": {
|
288 |
+
"type": "git",
|
289 |
+
"url": "https://github.com/php-fig/http-message.git",
|
290 |
+
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
291 |
+
},
|
292 |
+
"dist": {
|
293 |
+
"type": "zip",
|
294 |
+
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
295 |
+
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
296 |
+
"shasum": ""
|
297 |
+
},
|
298 |
+
"require": {
|
299 |
+
"php": ">=5.3.0"
|
300 |
+
},
|
301 |
+
"type": "library",
|
302 |
+
"extra": {
|
303 |
+
"branch-alias": {
|
304 |
+
"dev-master": "1.0.x-dev"
|
305 |
+
}
|
306 |
+
},
|
307 |
+
"autoload": {
|
308 |
+
"psr-4": {
|
309 |
+
"Psr\\Http\\Message\\": "src/"
|
310 |
+
}
|
311 |
+
},
|
312 |
+
"notification-url": "https://packagist.org/downloads/",
|
313 |
+
"license": [
|
314 |
+
"MIT"
|
315 |
+
],
|
316 |
+
"authors": [
|
317 |
+
{
|
318 |
+
"name": "PHP-FIG",
|
319 |
+
"homepage": "http://www.php-fig.org/"
|
320 |
+
}
|
321 |
+
],
|
322 |
+
"description": "Common interface for HTTP messages",
|
323 |
+
"homepage": "https://github.com/php-fig/http-message",
|
324 |
+
"keywords": [
|
325 |
+
"http",
|
326 |
+
"http-message",
|
327 |
+
"psr",
|
328 |
+
"psr-7",
|
329 |
+
"request",
|
330 |
+
"response"
|
331 |
+
],
|
332 |
+
"time": "2016-08-06T14:39:51+00:00"
|
333 |
+
},
|
334 |
+
{
|
335 |
+
"name": "ralouphie/getallheaders",
|
336 |
+
"version": "3.0.3",
|
337 |
+
"source": {
|
338 |
+
"type": "git",
|
339 |
+
"url": "https://github.com/ralouphie/getallheaders.git",
|
340 |
+
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
341 |
+
},
|
342 |
+
"dist": {
|
343 |
+
"type": "zip",
|
344 |
+
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
345 |
+
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
346 |
+
"shasum": ""
|
347 |
+
},
|
348 |
+
"require": {
|
349 |
+
"php": ">=5.6"
|
350 |
+
},
|
351 |
+
"require-dev": {
|
352 |
+
"php-coveralls/php-coveralls": "^2.1",
|
353 |
+
"phpunit/phpunit": "^5 || ^6.5"
|
354 |
+
},
|
355 |
+
"type": "library",
|
356 |
+
"autoload": {
|
357 |
+
"files": [
|
358 |
+
"src/getallheaders.php"
|
359 |
+
]
|
360 |
+
},
|
361 |
+
"notification-url": "https://packagist.org/downloads/",
|
362 |
+
"license": [
|
363 |
+
"MIT"
|
364 |
+
],
|
365 |
+
"authors": [
|
366 |
+
{
|
367 |
+
"name": "Ralph Khattar",
|
368 |
+
"email": "ralph.khattar@gmail.com"
|
369 |
+
}
|
370 |
+
],
|
371 |
+
"description": "A polyfill for getallheaders.",
|
372 |
+
"time": "2019-03-08T08:55:37+00:00"
|
373 |
+
},
|
374 |
+
{
|
375 |
+
"name": "symfony/polyfill-intl-idn",
|
376 |
+
"version": "v1.18.1",
|
377 |
+
"source": {
|
378 |
+
"type": "git",
|
379 |
+
"url": "https://github.com/symfony/polyfill-intl-idn.git",
|
380 |
+
"reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251"
|
381 |
+
},
|
382 |
+
"dist": {
|
383 |
+
"type": "zip",
|
384 |
+
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251",
|
385 |
+
"reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251",
|
386 |
+
"shasum": ""
|
387 |
+
},
|
388 |
+
"require": {
|
389 |
+
"php": ">=5.3.3",
|
390 |
+
"symfony/polyfill-intl-normalizer": "^1.10",
|
391 |
+
"symfony/polyfill-php70": "^1.10",
|
392 |
+
"symfony/polyfill-php72": "^1.10"
|
393 |
+
},
|
394 |
+
"suggest": {
|
395 |
+
"ext-intl": "For best performance"
|
396 |
+
},
|
397 |
+
"type": "library",
|
398 |
+
"extra": {
|
399 |
+
"branch-alias": {
|
400 |
+
"dev-master": "1.18-dev"
|
401 |
+
},
|
402 |
+
"thanks": {
|
403 |
+
"name": "symfony/polyfill",
|
404 |
+
"url": "https://github.com/symfony/polyfill"
|
405 |
+
}
|
406 |
+
},
|
407 |
+
"autoload": {
|
408 |
+
"psr-4": {
|
409 |
+
"Symfony\\Polyfill\\Intl\\Idn\\": ""
|
410 |
+
},
|
411 |
+
"files": [
|
412 |
+
"bootstrap.php"
|
413 |
+
]
|
414 |
+
},
|
415 |
+
"notification-url": "https://packagist.org/downloads/",
|
416 |
+
"license": [
|
417 |
+
"MIT"
|
418 |
+
],
|
419 |
+
"authors": [
|
420 |
+
{
|
421 |
+
"name": "Laurent Bassin",
|
422 |
+
"email": "laurent@bassin.info"
|
423 |
+
},
|
424 |
+
{
|
425 |
+
"name": "Trevor Rowbotham",
|
426 |
+
"email": "trevor.rowbotham@pm.me"
|
427 |
+
},
|
428 |
+
{
|
429 |
+
"name": "Symfony Community",
|
430 |
+
"homepage": "https://symfony.com/contributors"
|
431 |
+
}
|
432 |
+
],
|
433 |
+
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
|
434 |
+
"homepage": "https://symfony.com",
|
435 |
+
"keywords": [
|
436 |
+
"compatibility",
|
437 |
+
"idn",
|
438 |
+
"intl",
|
439 |
+
"polyfill",
|
440 |
+
"portable",
|
441 |
+
"shim"
|
442 |
+
],
|
443 |
+
"funding": [
|
444 |
+
{
|
445 |
+
"url": "https://symfony.com/sponsor",
|
446 |
+
"type": "custom"
|
447 |
+
},
|
448 |
+
{
|
449 |
+
"url": "https://github.com/fabpot",
|
450 |
+
"type": "github"
|
451 |
+
},
|
452 |
+
{
|
453 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
454 |
+
"type": "tidelift"
|
455 |
+
}
|
456 |
+
],
|
457 |
+
"time": "2020-08-04T06:02:08+00:00"
|
458 |
+
},
|
459 |
+
{
|
460 |
+
"name": "symfony/polyfill-intl-normalizer",
|
461 |
+
"version": "v1.18.1",
|
462 |
+
"source": {
|
463 |
+
"type": "git",
|
464 |
+
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
465 |
+
"reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e"
|
466 |
+
},
|
467 |
+
"dist": {
|
468 |
+
"type": "zip",
|
469 |
+
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
|
470 |
+
"reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
|
471 |
+
"shasum": ""
|
472 |
+
},
|
473 |
+
"require": {
|
474 |
+
"php": ">=5.3.3"
|
475 |
+
},
|
476 |
+
"suggest": {
|
477 |
+
"ext-intl": "For best performance"
|
478 |
+
},
|
479 |
+
"type": "library",
|
480 |
+
"extra": {
|
481 |
+
"branch-alias": {
|
482 |
+
"dev-master": "1.18-dev"
|
483 |
+
},
|
484 |
+
"thanks": {
|
485 |
+
"name": "symfony/polyfill",
|
486 |
+
"url": "https://github.com/symfony/polyfill"
|
487 |
+
}
|
488 |
+
},
|
489 |
+
"autoload": {
|
490 |
+
"psr-4": {
|
491 |
+
"Symfony\\Polyfill\\Intl\\Normalizer\\": ""
|
492 |
+
},
|
493 |
+
"files": [
|
494 |
+
"bootstrap.php"
|
495 |
+
],
|
496 |
+
"classmap": [
|
497 |
+
"Resources/stubs"
|
498 |
+
]
|
499 |
+
},
|
500 |
+
"notification-url": "https://packagist.org/downloads/",
|
501 |
+
"license": [
|
502 |
+
"MIT"
|
503 |
+
],
|
504 |
+
"authors": [
|
505 |
+
{
|
506 |
+
"name": "Nicolas Grekas",
|
507 |
+
"email": "p@tchwork.com"
|
508 |
+
},
|
509 |
+
{
|
510 |
+
"name": "Symfony Community",
|
511 |
+
"homepage": "https://symfony.com/contributors"
|
512 |
+
}
|
513 |
+
],
|
514 |
+
"description": "Symfony polyfill for intl's Normalizer class and related functions",
|
515 |
+
"homepage": "https://symfony.com",
|
516 |
+
"keywords": [
|
517 |
+
"compatibility",
|
518 |
+
"intl",
|
519 |
+
"normalizer",
|
520 |
+
"polyfill",
|
521 |
+
"portable",
|
522 |
+
"shim"
|
523 |
+
],
|
524 |
+
"funding": [
|
525 |
+
{
|
526 |
+
"url": "https://symfony.com/sponsor",
|
527 |
+
"type": "custom"
|
528 |
+
},
|
529 |
+
{
|
530 |
+
"url": "https://github.com/fabpot",
|
531 |
+
"type": "github"
|
532 |
+
},
|
533 |
+
{
|
534 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
535 |
+
"type": "tidelift"
|
536 |
+
}
|
537 |
+
],
|
538 |
+
"time": "2020-07-14T12:35:20+00:00"
|
539 |
+
},
|
540 |
+
{
|
541 |
+
"name": "symfony/polyfill-php70",
|
542 |
+
"version": "v1.18.1",
|
543 |
+
"source": {
|
544 |
+
"type": "git",
|
545 |
+
"url": "https://github.com/symfony/polyfill-php70.git",
|
546 |
+
"reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3"
|
547 |
+
},
|
548 |
+
"dist": {
|
549 |
+
"type": "zip",
|
550 |
+
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
|
551 |
+
"reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
|
552 |
+
"shasum": ""
|
553 |
+
},
|
554 |
+
"require": {
|
555 |
+
"paragonie/random_compat": "~1.0|~2.0|~9.99",
|
556 |
+
"php": ">=5.3.3"
|
557 |
+
},
|
558 |
+
"type": "library",
|
559 |
+
"extra": {
|
560 |
+
"branch-alias": {
|
561 |
+
"dev-master": "1.18-dev"
|
562 |
+
},
|
563 |
+
"thanks": {
|
564 |
+
"name": "symfony/polyfill",
|
565 |
+
"url": "https://github.com/symfony/polyfill"
|
566 |
+
}
|
567 |
+
},
|
568 |
+
"autoload": {
|
569 |
+
"psr-4": {
|
570 |
+
"Symfony\\Polyfill\\Php70\\": ""
|
571 |
+
},
|
572 |
+
"files": [
|
573 |
+
"bootstrap.php"
|
574 |
+
],
|
575 |
+
"classmap": [
|
576 |
+
"Resources/stubs"
|
577 |
+
]
|
578 |
+
},
|
579 |
+
"notification-url": "https://packagist.org/downloads/",
|
580 |
+
"license": [
|
581 |
+
"MIT"
|
582 |
+
],
|
583 |
+
"authors": [
|
584 |
+
{
|
585 |
+
"name": "Nicolas Grekas",
|
586 |
+
"email": "p@tchwork.com"
|
587 |
+
},
|
588 |
+
{
|
589 |
+
"name": "Symfony Community",
|
590 |
+
"homepage": "https://symfony.com/contributors"
|
591 |
+
}
|
592 |
+
],
|
593 |
+
"description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
|
594 |
+
"homepage": "https://symfony.com",
|
595 |
+
"keywords": [
|
596 |
+
"compatibility",
|
597 |
+
"polyfill",
|
598 |
+
"portable",
|
599 |
+
"shim"
|
600 |
+
],
|
601 |
+
"funding": [
|
602 |
+
{
|
603 |
+
"url": "https://symfony.com/sponsor",
|
604 |
+
"type": "custom"
|
605 |
+
},
|
606 |
+
{
|
607 |
+
"url": "https://github.com/fabpot",
|
608 |
+
"type": "github"
|
609 |
+
},
|
610 |
+
{
|
611 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
612 |
+
"type": "tidelift"
|
613 |
+
}
|
614 |
+
],
|
615 |
+
"time": "2020-07-14T12:35:20+00:00"
|
616 |
+
},
|
617 |
+
{
|
618 |
+
"name": "symfony/polyfill-php72",
|
619 |
+
"version": "v1.18.1",
|
620 |
+
"source": {
|
621 |
+
"type": "git",
|
622 |
+
"url": "https://github.com/symfony/polyfill-php72.git",
|
623 |
+
"reference": "639447d008615574653fb3bc60d1986d7172eaae"
|
624 |
+
},
|
625 |
+
"dist": {
|
626 |
+
"type": "zip",
|
627 |
+
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
|
628 |
+
"reference": "639447d008615574653fb3bc60d1986d7172eaae",
|
629 |
+
"shasum": ""
|
630 |
+
},
|
631 |
+
"require": {
|
632 |
+
"php": ">=5.3.3"
|
633 |
+
},
|
634 |
+
"type": "library",
|
635 |
+
"extra": {
|
636 |
+
"branch-alias": {
|
637 |
+
"dev-master": "1.18-dev"
|
638 |
+
},
|
639 |
+
"thanks": {
|
640 |
+
"name": "symfony/polyfill",
|
641 |
+
"url": "https://github.com/symfony/polyfill"
|
642 |
+
}
|
643 |
+
},
|
644 |
+
"autoload": {
|
645 |
+
"psr-4": {
|
646 |
+
"Symfony\\Polyfill\\Php72\\": ""
|
647 |
+
},
|
648 |
+
"files": [
|
649 |
+
"bootstrap.php"
|
650 |
+
]
|
651 |
+
},
|
652 |
+
"notification-url": "https://packagist.org/downloads/",
|
653 |
+
"license": [
|
654 |
+
"MIT"
|
655 |
+
],
|
656 |
+
"authors": [
|
657 |
+
{
|
658 |
+
"name": "Nicolas Grekas",
|
659 |
+
"email": "p@tchwork.com"
|
660 |
+
},
|
661 |
+
{
|
662 |
+
"name": "Symfony Community",
|
663 |
+
"homepage": "https://symfony.com/contributors"
|
664 |
+
}
|
665 |
+
],
|
666 |
+
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
|
667 |
+
"homepage": "https://symfony.com",
|
668 |
+
"keywords": [
|
669 |
+
"compatibility",
|
670 |
+
"polyfill",
|
671 |
+
"portable",
|
672 |
+
"shim"
|
673 |
+
],
|
674 |
+
"funding": [
|
675 |
+
{
|
676 |
+
"url": "https://symfony.com/sponsor",
|
677 |
+
"type": "custom"
|
678 |
+
},
|
679 |
+
{
|
680 |
+
"url": "https://github.com/fabpot",
|
681 |
+
"type": "github"
|
682 |
+
},
|
683 |
+
{
|
684 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
685 |
+
"type": "tidelift"
|
686 |
+
}
|
687 |
+
],
|
688 |
+
"time": "2020-07-14T12:35:20+00:00"
|
689 |
},
|
690 |
{
|
691 |
"name": "techcrunch/wp-async-task",
|
1732 |
"keywords": [
|
1733 |
"tokenizer"
|
1734 |
],
|
1735 |
+
"abandoned": true,
|
1736 |
"time": "2017-11-27T05:48:46+00:00"
|
1737 |
},
|
1738 |
{
|
2562 |
],
|
2563 |
"description": "Symfony Console Component",
|
2564 |
"homepage": "https://symfony.com",
|
2565 |
+
"funding": [
|
2566 |
+
{
|
2567 |
+
"url": "https://symfony.com/sponsor",
|
2568 |
+
"type": "custom"
|
2569 |
+
},
|
2570 |
+
{
|
2571 |
+
"url": "https://github.com/fabpot",
|
2572 |
+
"type": "github"
|
2573 |
+
},
|
2574 |
+
{
|
2575 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
2576 |
+
"type": "tidelift"
|
2577 |
+
}
|
2578 |
+
],
|
2579 |
"time": "2020-07-06T13:18:39+00:00"
|
2580 |
},
|
2581 |
{
|
2638 |
"polyfill",
|
2639 |
"portable"
|
2640 |
],
|
2641 |
+
"funding": [
|
2642 |
+
{
|
2643 |
+
"url": "https://symfony.com/sponsor",
|
2644 |
+
"type": "custom"
|
2645 |
+
},
|
2646 |
+
{
|
2647 |
+
"url": "https://github.com/fabpot",
|
2648 |
+
"type": "github"
|
2649 |
+
},
|
2650 |
+
{
|
2651 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
2652 |
+
"type": "tidelift"
|
2653 |
+
}
|
2654 |
+
],
|
2655 |
"time": "2020-07-14T12:35:20+00:00"
|
2656 |
},
|
2657 |
{
|
2715 |
"portable",
|
2716 |
"shim"
|
2717 |
],
|
2718 |
+
"funding": [
|
2719 |
+
{
|
2720 |
+
"url": "https://symfony.com/sponsor",
|
2721 |
+
"type": "custom"
|
2722 |
+
},
|
2723 |
+
{
|
2724 |
+
"url": "https://github.com/fabpot",
|
2725 |
+
"type": "github"
|
2726 |
+
},
|
2727 |
+
{
|
2728 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
2729 |
+
"type": "tidelift"
|
2730 |
+
}
|
2731 |
+
],
|
2732 |
"time": "2020-07-14T12:35:20+00:00"
|
2733 |
},
|
2734 |
{
|
2791 |
"portable",
|
2792 |
"shim"
|
2793 |
],
|
2794 |
+
"funding": [
|
2795 |
+
{
|
2796 |
+
"url": "https://symfony.com/sponsor",
|
2797 |
+
"type": "custom"
|
2798 |
+
},
|
2799 |
+
{
|
2800 |
+
"url": "https://github.com/fabpot",
|
2801 |
+
"type": "github"
|
2802 |
+
},
|
2803 |
+
{
|
2804 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
2805 |
+
"type": "tidelift"
|
2806 |
+
}
|
2807 |
+
],
|
2808 |
"time": "2020-07-14T12:35:20+00:00"
|
2809 |
},
|
2810 |
{
|
2871 |
"portable",
|
2872 |
"shim"
|
2873 |
],
|
2874 |
+
"funding": [
|
2875 |
+
{
|
2876 |
+
"url": "https://symfony.com/sponsor",
|
2877 |
+
"type": "custom"
|
2878 |
+
},
|
2879 |
+
{
|
2880 |
+
"url": "https://github.com/fabpot",
|
2881 |
+
"type": "github"
|
2882 |
+
},
|
2883 |
+
{
|
2884 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
2885 |
+
"type": "tidelift"
|
2886 |
+
}
|
2887 |
+
],
|
2888 |
"time": "2020-07-14T12:35:20+00:00"
|
2889 |
},
|
2890 |
{
|
2947 |
"interoperability",
|
2948 |
"standards"
|
2949 |
],
|
2950 |
+
"funding": [
|
2951 |
+
{
|
2952 |
+
"url": "https://symfony.com/sponsor",
|
2953 |
+
"type": "custom"
|
2954 |
+
},
|
2955 |
+
{
|
2956 |
+
"url": "https://github.com/fabpot",
|
2957 |
+
"type": "github"
|
2958 |
+
},
|
2959 |
+
{
|
2960 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
2961 |
+
"type": "tidelift"
|
2962 |
+
}
|
2963 |
+
],
|
2964 |
"time": "2020-07-06T13:23:11+00:00"
|
2965 |
},
|
2966 |
{
|
3020 |
],
|
3021 |
"description": "Symfony Yaml Component",
|
3022 |
"homepage": "https://symfony.com",
|
3023 |
+
"funding": [
|
3024 |
+
{
|
3025 |
+
"url": "https://symfony.com/sponsor",
|
3026 |
+
"type": "custom"
|
3027 |
+
},
|
3028 |
+
{
|
3029 |
+
"url": "https://github.com/fabpot",
|
3030 |
+
"type": "github"
|
3031 |
+
},
|
3032 |
+
{
|
3033 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
3034 |
+
"type": "tidelift"
|
3035 |
+
}
|
3036 |
+
],
|
3037 |
"time": "2020-05-20T08:37:50+00:00"
|
3038 |
},
|
3039 |
{
|
3135 |
"prefer-stable": false,
|
3136 |
"prefer-lowest": false,
|
3137 |
"platform": [],
|
3138 |
+
"platform-dev": [],
|
3139 |
+
"plugin-api-version": "1.1.0"
|
3140 |
}
|
core/FacebookPluginConfig.php
CHANGED
@@ -20,7 +20,7 @@ namespace FacebookPixelPlugin\Core;
|
|
20 |
defined('ABSPATH') or die('Direct access not allowed');
|
21 |
|
22 |
class FacebookPluginConfig {
|
23 |
-
const PLUGIN_VERSION = '2.2.
|
24 |
const SOURCE = 'wordpress';
|
25 |
const TEXT_DOMAIN = 'official-facebook-pixel';
|
26 |
|
20 |
defined('ABSPATH') or die('Direct access not allowed');
|
21 |
|
22 |
class FacebookPluginConfig {
|
23 |
+
const PLUGIN_VERSION = '2.2.1';
|
24 |
const SOURCE = 'wordpress';
|
25 |
const TEXT_DOMAIN = 'official-facebook-pixel';
|
26 |
|
core/FacebookPluginUtils.php
CHANGED
@@ -34,13 +34,6 @@ class FacebookPluginUtils {
|
|
34 |
return isset($pixel_id) && ctype_digit($pixel_id) && $pixel_id !== '0';
|
35 |
}
|
36 |
|
37 |
-
/**
|
38 |
-
* Whether current user is Administrator.
|
39 |
-
*/
|
40 |
-
public static function isAdmin() {
|
41 |
-
return current_user_can('install_plugins');
|
42 |
-
}
|
43 |
-
|
44 |
public static function getLoggedInUserInfo() {
|
45 |
$current_user = wp_get_current_user();
|
46 |
if (empty($current_user)) {
|
@@ -53,4 +46,14 @@ class FacebookPluginUtils {
|
|
53 |
'last_name' => $current_user->user_lastname,
|
54 |
);
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
34 |
return isset($pixel_id) && ctype_digit($pixel_id) && $pixel_id !== '0';
|
35 |
}
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
public static function getLoggedInUserInfo() {
|
38 |
$current_user = wp_get_current_user();
|
39 |
if (empty($current_user)) {
|
46 |
'last_name' => $current_user->user_lastname,
|
47 |
);
|
48 |
}
|
49 |
+
|
50 |
+
// All standard WordPress user roles are considered internal unless they have
|
51 |
+
// the Subscriber role.
|
52 |
+
// WooCommerce uses the 'read' capability for its customer role.
|
53 |
+
// Also check for the 'upload_files' capability to account for the shop_worker
|
54 |
+
// and shop_vendor roles in Easy Digital Downloads.
|
55 |
+
// https://wordpress.org/support/article/roles-and-capabilities
|
56 |
+
public static function isInternalUser() {
|
57 |
+
return current_user_can('edit_posts') || current_user_can('upload_files');
|
58 |
+
}
|
59 |
}
|
core/FacebookServerSideEvent.php
CHANGED
@@ -26,26 +26,57 @@ defined('ABSPATH') or die('Direct access not allowed');
|
|
26 |
|
27 |
class FacebookServerSideEvent {
|
28 |
private static $instance = null;
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
public static function getInstance() {
|
32 |
if (self::$instance == null) {
|
33 |
self::$instance = new FacebookServerSideEvent();
|
34 |
}
|
35 |
-
|
36 |
return self::$instance;
|
37 |
}
|
38 |
|
39 |
-
public function track($event) {
|
40 |
-
$this->
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
}
|
46 |
|
47 |
public function getTrackedEvents() {
|
48 |
-
return $this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
public static function send($events) {
|
26 |
|
27 |
class FacebookServerSideEvent {
|
28 |
private static $instance = null;
|
29 |
+
// Contains all the events triggered during the request
|
30 |
+
private $trackedEvents = [];
|
31 |
+
// Contains all Conversions API events that have not been sent
|
32 |
+
private $pendingEvents = [];
|
33 |
+
// Maps a callback name with a Conversions API event
|
34 |
+
// that hasn't been rendered as pixel event
|
35 |
+
private $pendingPixelEvents = [];
|
36 |
|
37 |
public static function getInstance() {
|
38 |
if (self::$instance == null) {
|
39 |
self::$instance = new FacebookServerSideEvent();
|
40 |
}
|
|
|
41 |
return self::$instance;
|
42 |
}
|
43 |
|
44 |
+
public function track($event, $sendNow = true) {
|
45 |
+
$this->trackedEvents[] = $event;
|
46 |
+
if( FacebookWordpressOptions::getUseS2S() ){
|
47 |
+
if( $sendNow ){
|
48 |
+
do_action( 'send_server_events',
|
49 |
+
array($event),
|
50 |
+
1
|
51 |
+
);
|
52 |
+
}
|
53 |
+
else{
|
54 |
+
$this->pendingEvents[] = $event;
|
55 |
+
}
|
56 |
}
|
57 |
}
|
58 |
|
59 |
public function getTrackedEvents() {
|
60 |
+
return $this->trackedEvents;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getNumTrackedEvents(){
|
64 |
+
return count( $this->trackedEvents );
|
65 |
+
}
|
66 |
+
|
67 |
+
public function getPendingEvents(){
|
68 |
+
return $this->pendingEvents;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function setPendingPixelEvent($callback_name, $event){
|
72 |
+
$this->pendingPixelEvents[$callback_name] = $event;
|
73 |
+
}
|
74 |
+
|
75 |
+
public function getPendingPixelEvent($callback_name){
|
76 |
+
if(array_key_exists($callback_name, $this->pendingPixelEvents)){
|
77 |
+
return $this->pendingPixelEvents[$callback_name];
|
78 |
+
}
|
79 |
+
return null;
|
80 |
}
|
81 |
|
82 |
public static function send($events) {
|
core/FacebookWordpressPixelInjection.php
CHANGED
@@ -39,6 +39,23 @@ class FacebookWordpressPixelInjection {
|
|
39 |
$class_name = 'FacebookPixelPlugin\\Integration\\'.$value;
|
40 |
$class_name::injectPixelCode();
|
41 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
}
|
44 |
|
39 |
$class_name = 'FacebookPixelPlugin\\Integration\\'.$value;
|
40 |
$class_name::injectPixelCode();
|
41 |
}
|
42 |
+
add_action(
|
43 |
+
'wp_footer',
|
44 |
+
array($this, 'sendPendingEvents'));
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
public function sendPendingEvents(){
|
49 |
+
if(FacebookWordpressOptions::getUseS2S()){
|
50 |
+
$pending_events =
|
51 |
+
FacebookServerSideEvent::getInstance()->getPendingEvents();
|
52 |
+
if(count($pending_events) > 0){
|
53 |
+
do_action(
|
54 |
+
'send_server_events',
|
55 |
+
$pending_events,
|
56 |
+
count($pending_events)
|
57 |
+
);
|
58 |
+
}
|
59 |
}
|
60 |
}
|
61 |
|
core/PixelRenderer.php
CHANGED
@@ -28,16 +28,24 @@ class PixelRenderer {
|
|
28 |
const TRACK_CUSTOM = 'trackCustom';
|
29 |
const FB_INTEGRATION_TRACKING = 'fb_integration_tracking';
|
30 |
const SCRIPT_TAG = "<script type='text/javascript'>%s</script>";
|
31 |
-
const
|
32 |
fbq('%s', '%s', %s, %s);
|
33 |
";
|
|
|
|
|
34 |
|
35 |
public static function render($events, $fb_integration_tracking,
|
36 |
$script_tag = true) {
|
37 |
if (empty($events)) {
|
38 |
return "";
|
39 |
}
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
foreach ($events as $event) {
|
42 |
$code .= self::getPixelTrackCode($event, $fb_integration_tracking);
|
43 |
}
|
@@ -58,9 +66,8 @@ class PixelRenderer {
|
|
58 |
}
|
59 |
|
60 |
$class = new ReflectionClass('FacebookPixelPlugin\Core\FacebookPixel');
|
61 |
-
|
62 |
return sprintf(
|
63 |
-
self::
|
64 |
$class->getConstant(strtoupper($event->getEventName())) !== false
|
65 |
? self::TRACK : self::TRACK_CUSTOM,
|
66 |
$event->getEventName(),
|
28 |
const TRACK_CUSTOM = 'trackCustom';
|
29 |
const FB_INTEGRATION_TRACKING = 'fb_integration_tracking';
|
30 |
const SCRIPT_TAG = "<script type='text/javascript'>%s</script>";
|
31 |
+
const FBQ_EVENT_CODE = "
|
32 |
fbq('%s', '%s', %s, %s);
|
33 |
";
|
34 |
+
const FBQ_AGENT_CODE = "
|
35 |
+
fbq('set', 'agent', '%s', '%s');";
|
36 |
|
37 |
public static function render($events, $fb_integration_tracking,
|
38 |
$script_tag = true) {
|
39 |
if (empty($events)) {
|
40 |
return "";
|
41 |
}
|
42 |
+
// The first line of the injected script will set the agent
|
43 |
+
// for all the events passed in $events
|
44 |
+
$code = sprintf(
|
45 |
+
self::FBQ_AGENT_CODE,
|
46 |
+
FacebookWordpressOptions::getAgentString(),
|
47 |
+
FacebookWordpressOptions::getPixelId()
|
48 |
+
);
|
49 |
foreach ($events as $event) {
|
50 |
$code .= self::getPixelTrackCode($event, $fb_integration_tracking);
|
51 |
}
|
66 |
}
|
67 |
|
68 |
$class = new ReflectionClass('FacebookPixelPlugin\Core\FacebookPixel');
|
|
|
69 |
return sprintf(
|
70 |
+
self::FBQ_EVENT_CODE,
|
71 |
$class->getConstant(strtoupper($event->getEventName())) !== false
|
72 |
? self::TRACK : self::TRACK_CUSTOM,
|
73 |
$event->getEventName(),
|
core/ServerEventAsyncTask.php
CHANGED
@@ -22,12 +22,15 @@ use FacebookPixelPlugin\Core\FacebookServerSideEvent;
|
|
22 |
defined('ABSPATH') or die('Direct access not allowed');
|
23 |
|
24 |
class ServerEventAsyncTask extends \WP_Async_Task {
|
25 |
-
protected $action = '
|
26 |
|
27 |
protected function prepare_data($data) {
|
28 |
try {
|
29 |
if (!empty($data)) {
|
30 |
-
return array(
|
|
|
|
|
|
|
31 |
}
|
32 |
} catch (\Exception $ex) {
|
33 |
error_log($ex);
|
@@ -38,10 +41,17 @@ class ServerEventAsyncTask extends \WP_Async_Task {
|
|
38 |
|
39 |
protected function run_action() {
|
40 |
try {
|
41 |
-
$
|
42 |
-
if
|
43 |
return;
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
FacebookServerSideEvent::send($events);
|
47 |
}
|
22 |
defined('ABSPATH') or die('Direct access not allowed');
|
23 |
|
24 |
class ServerEventAsyncTask extends \WP_Async_Task {
|
25 |
+
protected $action = 'send_server_events';
|
26 |
|
27 |
protected function prepare_data($data) {
|
28 |
try {
|
29 |
if (!empty($data)) {
|
30 |
+
return array(
|
31 |
+
'event_data' => base64_encode(serialize($data[0])),
|
32 |
+
'num_events'=>$data[1]
|
33 |
+
);
|
34 |
}
|
35 |
} catch (\Exception $ex) {
|
36 |
error_log($ex);
|
41 |
|
42 |
protected function run_action() {
|
43 |
try {
|
44 |
+
$num_events = $_POST['num_events'];
|
45 |
+
if( $num_events == 0 ){
|
46 |
return;
|
47 |
}
|
48 |
+
$events = unserialize(base64_decode($_POST['event_data']));
|
49 |
+
// When an array has just one object, the deserialization process
|
50 |
+
// returns just the object
|
51 |
+
// and we want an array
|
52 |
+
if( $num_events == 1 ){
|
53 |
+
$events = array( $events );
|
54 |
+
}
|
55 |
|
56 |
FacebookServerSideEvent::send($events);
|
57 |
}
|
core/ServerEventFactory.php
CHANGED
@@ -215,6 +215,10 @@ class ServerEventFactory {
|
|
215 |
if (!empty($data['content_name'])) {
|
216 |
$custom_data->setContentName($data['content_name']);
|
217 |
}
|
|
|
|
|
|
|
|
|
218 |
} catch (\Exception $e) {
|
219 |
// Need to log
|
220 |
}
|
215 |
if (!empty($data['content_name'])) {
|
216 |
$custom_data->setContentName($data['content_name']);
|
217 |
}
|
218 |
+
|
219 |
+
if (!empty($data['content_category'])){
|
220 |
+
$custom_data->setContentCategory($data['content_category']);
|
221 |
+
}
|
222 |
} catch (\Exception $e) {
|
223 |
// Need to log
|
224 |
}
|
facebook-for-wordpress.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: <strong><em>***ATTENTION: After upgrade the plugin may be deactivated due to a known issue, to workaround please refresh this page and activate plugin.***</em></strong> The Facebook pixel is an analytics tool that helps you measure the effectiveness of your advertising. You can use the Facebook pixel to understand the actions people are taking on your website and reach audiences you care about.
|
6 |
* Author: Facebook
|
7 |
* Author URI: https://www.facebook.com/
|
8 |
-
* Version: 2.2.
|
9 |
* Text Domain: official-facebook-pixel
|
10 |
*/
|
11 |
|
5 |
* Description: <strong><em>***ATTENTION: After upgrade the plugin may be deactivated due to a known issue, to workaround please refresh this page and activate plugin.***</em></strong> The Facebook pixel is an analytics tool that helps you measure the effectiveness of your advertising. You can use the Facebook pixel to understand the actions people are taking on your website and reach audiences you care about.
|
6 |
* Author: Facebook
|
7 |
* Author URI: https://www.facebook.com/
|
8 |
+
* Version: 2.2.1
|
9 |
* Text Domain: official-facebook-pixel
|
10 |
*/
|
11 |
|
integration/FacebookWordpressCalderaForm.php
CHANGED
@@ -39,7 +39,10 @@ class FacebookWordpressCalderaForm extends FacebookWordpressIntegrationBase {
|
|
39 |
}
|
40 |
|
41 |
public static function injectLeadEvent($out, $form) {
|
42 |
-
if (
|
|
|
|
|
|
|
43 |
return $out;
|
44 |
}
|
45 |
|
39 |
}
|
40 |
|
41 |
public static function injectLeadEvent($out, $form) {
|
42 |
+
if (
|
43 |
+
FacebookPluginUtils::isInternalUser() ||
|
44 |
+
$out['status'] !== 'complete'
|
45 |
+
) {
|
46 |
return $out;
|
47 |
}
|
48 |
|
integration/FacebookWordpressContactForm7.php
CHANGED
@@ -39,7 +39,9 @@ class FacebookWordpressContactForm7 extends FacebookWordpressIntegrationBase {
|
|
39 |
}
|
40 |
|
41 |
public static function trackServerEvent($form, $result) {
|
42 |
-
|
|
|
|
|
43 |
return $result;
|
44 |
}
|
45 |
|
@@ -61,7 +63,7 @@ class FacebookWordpressContactForm7 extends FacebookWordpressIntegrationBase {
|
|
61 |
}
|
62 |
|
63 |
public static function injectLeadEvent($response, $result) {
|
64 |
-
if (FacebookPluginUtils::
|
65 |
return $response;
|
66 |
}
|
67 |
|
39 |
}
|
40 |
|
41 |
public static function trackServerEvent($form, $result) {
|
42 |
+
$isInternalUser = FacebookPluginUtils::isInternalUser();
|
43 |
+
$submitFailed = $result['status'] !== 'mail_sent';
|
44 |
+
if ($isInternalUser || $submitFailed) {
|
45 |
return $result;
|
46 |
}
|
47 |
|
63 |
}
|
64 |
|
65 |
public static function injectLeadEvent($response, $result) {
|
66 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
67 |
return $response;
|
68 |
}
|
69 |
|
integration/FacebookWordpressEasyDigitalDownloads.php
CHANGED
@@ -60,7 +60,7 @@ jQuery(document).ready(function ($) {
|
|
60 |
'%s': '%s',
|
61 |
'value': value
|
62 |
};
|
63 |
-
|
64 |
if(event_id){
|
65 |
fbq('track', 'AddToCart', param, {'eventID': event_id});
|
66 |
}
|
@@ -122,7 +122,7 @@ jQuery(document).ready(function ($) {
|
|
122 |
}
|
123 |
|
124 |
public static function injectAddToCartEventId(){
|
125 |
-
if(FacebookPluginUtils::
|
126 |
|| !FacebookWordpressOptions::getUseS2S()){
|
127 |
return;
|
128 |
}
|
@@ -143,7 +143,7 @@ jQuery(document).ready(function ($) {
|
|
143 |
//Getting form data
|
144 |
parse_str( $_POST['post_data'], $post_data );
|
145 |
if(isset($post_data['facebook_event_id'])){
|
146 |
-
//Starting
|
147 |
$event_id = $post_data['facebook_event_id'];
|
148 |
$server_event = ServerEventFactory::safeCreateEvent(
|
149 |
'AddToCart',
|
@@ -158,14 +158,16 @@ jQuery(document).ready(function ($) {
|
|
158 |
}
|
159 |
|
160 |
public static function injectAddToCartListener($download_id) {
|
161 |
-
if (FacebookPluginUtils::
|
162 |
return;
|
163 |
}
|
164 |
|
165 |
$listener_code = sprintf(
|
166 |
self::$addToCartJS,
|
167 |
FacebookPixel::FB_INTEGRATION_TRACKING_KEY,
|
168 |
-
self::TRACKING_NAME
|
|
|
|
|
169 |
);
|
170 |
|
171 |
printf("
|
@@ -179,7 +181,7 @@ jQuery(document).ready(function ($) {
|
|
179 |
}
|
180 |
|
181 |
public static function injectInitiateCheckoutEvent() {
|
182 |
-
if (FacebookPluginUtils::
|
183 |
return;
|
184 |
}
|
185 |
|
@@ -201,7 +203,7 @@ jQuery(document).ready(function ($) {
|
|
201 |
}
|
202 |
|
203 |
public static function trackPurchaseEvent($payment, $edd_receipt_args) {
|
204 |
-
if (FacebookPluginUtils::
|
205 |
return;
|
206 |
}
|
207 |
|
@@ -233,7 +235,7 @@ jQuery(document).ready(function ($) {
|
|
233 |
}
|
234 |
|
235 |
public static function injectViewContentEvent($download_id) {
|
236 |
-
if (FacebookPluginUtils::
|
237 |
return;
|
238 |
}
|
239 |
|
60 |
'%s': '%s',
|
61 |
'value': value
|
62 |
};
|
63 |
+
fbq('set', 'agent', '%s', '%s');
|
64 |
if(event_id){
|
65 |
fbq('track', 'AddToCart', param, {'eventID': event_id});
|
66 |
}
|
122 |
}
|
123 |
|
124 |
public static function injectAddToCartEventId(){
|
125 |
+
if(FacebookPluginUtils::isInternalUser()
|
126 |
|| !FacebookWordpressOptions::getUseS2S()){
|
127 |
return;
|
128 |
}
|
143 |
//Getting form data
|
144 |
parse_str( $_POST['post_data'], $post_data );
|
145 |
if(isset($post_data['facebook_event_id'])){
|
146 |
+
//Starting Conversions API event creation
|
147 |
$event_id = $post_data['facebook_event_id'];
|
148 |
$server_event = ServerEventFactory::safeCreateEvent(
|
149 |
'AddToCart',
|
158 |
}
|
159 |
|
160 |
public static function injectAddToCartListener($download_id) {
|
161 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
162 |
return;
|
163 |
}
|
164 |
|
165 |
$listener_code = sprintf(
|
166 |
self::$addToCartJS,
|
167 |
FacebookPixel::FB_INTEGRATION_TRACKING_KEY,
|
168 |
+
self::TRACKING_NAME,
|
169 |
+
FacebookWordpressOptions::getAgentString(),
|
170 |
+
FacebookWordpressOptions::getPixelId()
|
171 |
);
|
172 |
|
173 |
printf("
|
181 |
}
|
182 |
|
183 |
public static function injectInitiateCheckoutEvent() {
|
184 |
+
if (FacebookPluginUtils::isInternalUser() || !function_exists('EDD')) {
|
185 |
return;
|
186 |
}
|
187 |
|
203 |
}
|
204 |
|
205 |
public static function trackPurchaseEvent($payment, $edd_receipt_args) {
|
206 |
+
if (FacebookPluginUtils::isInternalUser() || empty($payment->ID)) {
|
207 |
return;
|
208 |
}
|
209 |
|
235 |
}
|
236 |
|
237 |
public static function injectViewContentEvent($download_id) {
|
238 |
+
if (FacebookPluginUtils::isInternalUser() || empty($download_id)) {
|
239 |
return;
|
240 |
}
|
241 |
|
integration/FacebookWordpressFormidableForm.php
CHANGED
@@ -42,7 +42,7 @@ class FacebookWordpressFormidableForm extends FacebookWordpressIntegrationBase {
|
|
42 |
}
|
43 |
|
44 |
public static function trackServerEvent($entry_id, $form_id) {
|
45 |
-
if (FacebookPluginUtils::
|
46 |
return;
|
47 |
}
|
48 |
|
@@ -63,7 +63,7 @@ class FacebookWordpressFormidableForm extends FacebookWordpressIntegrationBase {
|
|
63 |
}
|
64 |
|
65 |
public static function injectLeadEvent() {
|
66 |
-
if (FacebookPluginUtils::
|
67 |
return;
|
68 |
}
|
69 |
|
42 |
}
|
43 |
|
44 |
public static function trackServerEvent($entry_id, $form_id) {
|
45 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
46 |
return;
|
47 |
}
|
48 |
|
63 |
}
|
64 |
|
65 |
public static function injectLeadEvent() {
|
66 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
67 |
return;
|
68 |
}
|
69 |
|
integration/FacebookWordpressGravityForms.php
CHANGED
@@ -40,7 +40,7 @@ class FacebookWordpressGravityForms extends FacebookWordpressIntegrationBase {
|
|
40 |
}
|
41 |
|
42 |
public static function injectLeadEvent($confirmation, $form, $entry, $ajax) {
|
43 |
-
if (FacebookPluginUtils::
|
44 |
return $confirmation;
|
45 |
}
|
46 |
|
40 |
}
|
41 |
|
42 |
public static function injectLeadEvent($confirmation, $form, $entry, $ajax) {
|
43 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
44 |
return $confirmation;
|
45 |
}
|
46 |
|
integration/FacebookWordpressMailchimpForWp.php
CHANGED
@@ -37,7 +37,7 @@ class FacebookWordpressMailchimpForWp extends FacebookWordpressIntegrationBase {
|
|
37 |
}
|
38 |
|
39 |
public static function injectLeadEvent() {
|
40 |
-
if (FacebookPluginUtils::
|
41 |
return;
|
42 |
}
|
43 |
|
37 |
}
|
38 |
|
39 |
public static function injectLeadEvent() {
|
40 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
41 |
return;
|
42 |
}
|
43 |
|
integration/FacebookWordpressNinjaForms.php
CHANGED
@@ -40,7 +40,7 @@ class FacebookWordpressNinjaForms extends FacebookWordpressIntegrationBase {
|
|
40 |
}
|
41 |
|
42 |
public static function injectLeadEvent($actions, $form_cache, $form_data) {
|
43 |
-
if (FacebookPluginUtils::
|
44 |
return $actions;
|
45 |
}
|
46 |
|
40 |
}
|
41 |
|
42 |
public static function injectLeadEvent($actions, $form_cache, $form_data) {
|
43 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
44 |
return $actions;
|
45 |
}
|
46 |
|
integration/FacebookWordpressWPECommerce.php
CHANGED
@@ -48,7 +48,7 @@ class FacebookWordpressWPECommerce extends FacebookWordpressIntegrationBase {
|
|
48 |
|
49 |
// Event hook for AddToCart.
|
50 |
public static function injectAddToCartEvent($response) {
|
51 |
-
if (FacebookPluginUtils::
|
52 |
return $response;
|
53 |
}
|
54 |
|
@@ -73,7 +73,7 @@ class FacebookWordpressWPECommerce extends FacebookWordpressIntegrationBase {
|
|
73 |
}
|
74 |
|
75 |
public static function injectInitiateCheckoutEvent() {
|
76 |
-
if (FacebookPluginUtils::
|
77 |
return;
|
78 |
}
|
79 |
|
@@ -99,7 +99,7 @@ class FacebookWordpressWPECommerce extends FacebookWordpressIntegrationBase {
|
|
99 |
$session_id,
|
100 |
$display_to_screen)
|
101 |
{
|
102 |
-
if (FacebookPluginUtils::
|
103 |
return;
|
104 |
}
|
105 |
|
48 |
|
49 |
// Event hook for AddToCart.
|
50 |
public static function injectAddToCartEvent($response) {
|
51 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
52 |
return $response;
|
53 |
}
|
54 |
|
73 |
}
|
74 |
|
75 |
public static function injectInitiateCheckoutEvent() {
|
76 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
77 |
return;
|
78 |
}
|
79 |
|
99 |
$session_id,
|
100 |
$display_to_screen)
|
101 |
{
|
102 |
+
if (FacebookPluginUtils::isInternalUser() || !$display_to_screen) {
|
103 |
return;
|
104 |
}
|
105 |
|
integration/FacebookWordpressWPForms.php
CHANGED
@@ -42,7 +42,7 @@ class FacebookWordpressWPForms extends FacebookWordpressIntegrationBase {
|
|
42 |
}
|
43 |
|
44 |
public static function trackEvent($entry, $form_data) {
|
45 |
-
if (FacebookPluginUtils::
|
46 |
return;
|
47 |
}
|
48 |
|
@@ -63,7 +63,7 @@ class FacebookWordpressWPForms extends FacebookWordpressIntegrationBase {
|
|
63 |
}
|
64 |
|
65 |
public static function injectLeadEvent() {
|
66 |
-
if (FacebookPluginUtils::
|
67 |
return;
|
68 |
}
|
69 |
|
42 |
}
|
43 |
|
44 |
public static function trackEvent($entry, $form_data) {
|
45 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
46 |
return;
|
47 |
}
|
48 |
|
63 |
}
|
64 |
|
65 |
public static function injectLeadEvent() {
|
66 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
67 |
return;
|
68 |
}
|
69 |
|
integration/FacebookWordpressWooCommerce.php
CHANGED
@@ -33,6 +33,8 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
33 |
// Being consistent with the WooCommerce plugin
|
34 |
const FB_ID_PREFIX = 'wc_post_id_';
|
35 |
|
|
|
|
|
36 |
public static function injectPixelCode() {
|
37 |
// Add the hooks only if the WooCommerce plugin is not active
|
38 |
if(!self::isFacebookForWooCommerceActive()) {
|
@@ -51,11 +53,81 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
51 |
add_action( 'woocommerce_payment_complete',
|
52 |
array(__CLASS__, 'trackPurchaseEvent'),
|
53 |
40);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
public static function trackPurchaseEvent($order_id) {
|
58 |
-
if (FacebookPluginUtils::
|
59 |
return;
|
60 |
}
|
61 |
|
@@ -67,6 +139,8 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
67 |
);
|
68 |
|
69 |
FacebookServerSideEvent::getInstance()->track($server_event);
|
|
|
|
|
70 |
}
|
71 |
|
72 |
public static function createPurchaseEvent($order_id) {
|
@@ -108,7 +182,7 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
108 |
|
109 |
public static function trackAddToCartEvent(
|
110 |
$cart_item_key, $product_id, $quantity, $variation_id) {
|
111 |
-
if (FacebookPluginUtils::
|
112 |
return;
|
113 |
}
|
114 |
|
@@ -119,7 +193,42 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
119 |
self::TRACKING_NAME
|
120 |
);
|
121 |
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
|
125 |
public static function createAddToCartEvent(
|
@@ -140,7 +249,7 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
140 |
}
|
141 |
|
142 |
public static function trackInitiateCheckout() {
|
143 |
-
if (FacebookPluginUtils::
|
144 |
return;
|
145 |
}
|
146 |
|
@@ -152,6 +261,8 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
152 |
);
|
153 |
|
154 |
FacebookServerSideEvent::getInstance()->track($server_event);
|
|
|
|
|
155 |
}
|
156 |
|
157 |
public static function createInitiateCheckoutEvent() {
|
@@ -257,4 +368,22 @@ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
|
|
257 |
'facebook-for-woocommerce/facebook-for-woocommerce.php',
|
258 |
get_option('active_plugins'));
|
259 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
}
|
33 |
// Being consistent with the WooCommerce plugin
|
34 |
const FB_ID_PREFIX = 'wc_post_id_';
|
35 |
|
36 |
+
const DIV_ID_FOR_AJAX_PIXEL_EVENTS = 'fb-pxl-ajax-code';
|
37 |
+
|
38 |
public static function injectPixelCode() {
|
39 |
// Add the hooks only if the WooCommerce plugin is not active
|
40 |
if(!self::isFacebookForWooCommerceActive()) {
|
53 |
add_action( 'woocommerce_payment_complete',
|
54 |
array(__CLASS__, 'trackPurchaseEvent'),
|
55 |
40);
|
56 |
+
|
57 |
+
add_action( 'woocommerce_after_single_product',
|
58 |
+
array(__CLASS__, 'trackViewContentEvent'),
|
59 |
+
40);
|
60 |
+
// This div will be used to insert the fbq calls
|
61 |
+
// when an event is triggered by an AJAX request
|
62 |
+
add_action( 'wp_footer',
|
63 |
+
array(__CLASS__, 'addDivForAjaxPixelEvent')
|
64 |
+
);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public static function addDivForAjaxPixelEvent(){
|
69 |
+
echo self::getDivForAjaxPixelEvent();
|
70 |
+
}
|
71 |
+
|
72 |
+
public static function getDivForAjaxPixelEvent($content = ''){
|
73 |
+
return "<div id='".self::DIV_ID_FOR_AJAX_PIXEL_EVENTS."'>"
|
74 |
+
.$content."</div>";
|
75 |
+
}
|
76 |
+
|
77 |
+
public static function trackViewContentEvent(){
|
78 |
+
if(FacebookPluginUtils::isInternalUser()){
|
79 |
+
return;
|
80 |
}
|
81 |
+
|
82 |
+
global $post;
|
83 |
+
if (!isset($post->ID)){
|
84 |
+
return;
|
85 |
+
}
|
86 |
+
|
87 |
+
$product = wc_get_product($post->ID);
|
88 |
+
if(!$product){
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
|
92 |
+
$server_event = ServerEventFactory::safeCreateEvent(
|
93 |
+
'ViewContent',
|
94 |
+
array(__CLASS__, 'createViewContentEvent'),
|
95 |
+
array($product),
|
96 |
+
self::TRACKING_NAME
|
97 |
+
);
|
98 |
+
|
99 |
+
FacebookServerSideEvent::getInstance()->track($server_event, false);
|
100 |
+
|
101 |
+
self::enqueuePixelCode($server_event);
|
102 |
+
}
|
103 |
+
|
104 |
+
public static function createViewContentEvent($product){
|
105 |
+
$event_data = self::getPIIFromSession();
|
106 |
+
|
107 |
+
$product_id = self::getProductId($product);
|
108 |
+
$content_type = $product->is_type('variable') ? 'product_group' : 'product';
|
109 |
+
|
110 |
+
$event_data['content_type'] = $content_type;
|
111 |
+
$event_data['currency'] = \get_woocommerce_currency();
|
112 |
+
$event_data['value'] = $product->get_price();
|
113 |
+
$event_data['content_ids'] = array($product_id);
|
114 |
+
$event_data['content_name'] = $product->get_title();
|
115 |
+
$event_data['content_category'] =
|
116 |
+
self::getProductCategory($product->get_id());
|
117 |
+
|
118 |
+
return array_filter($event_data);
|
119 |
+
}
|
120 |
+
|
121 |
+
private static function getProductCategory($product_id){
|
122 |
+
$categories = get_the_terms(
|
123 |
+
$product_id,
|
124 |
+
'product_cat'
|
125 |
+
);
|
126 |
+
return count($categories) > 0 ? $categories[0]->name : null;
|
127 |
}
|
128 |
|
129 |
public static function trackPurchaseEvent($order_id) {
|
130 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
131 |
return;
|
132 |
}
|
133 |
|
139 |
);
|
140 |
|
141 |
FacebookServerSideEvent::getInstance()->track($server_event);
|
142 |
+
|
143 |
+
self::enqueuePixelCode($server_event);
|
144 |
}
|
145 |
|
146 |
public static function createPurchaseEvent($order_id) {
|
182 |
|
183 |
public static function trackAddToCartEvent(
|
184 |
$cart_item_key, $product_id, $quantity, $variation_id) {
|
185 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
186 |
return;
|
187 |
}
|
188 |
|
193 |
self::TRACKING_NAME
|
194 |
);
|
195 |
|
196 |
+
// When AJAX is used to add an item to the cart
|
197 |
+
// The Conversions API event should be sent inmediately
|
198 |
+
// because the wp_footer action is not executed
|
199 |
+
$is_ajax_request = wp_doing_ajax();
|
200 |
+
|
201 |
+
FacebookServerSideEvent::getInstance()->track($server_event,
|
202 |
+
$is_ajax_request);
|
203 |
+
|
204 |
+
// If it is not an ajax request
|
205 |
+
// We show the pixel call in the footer
|
206 |
+
// Otherwise we add a filter
|
207 |
+
// to modify the ajax response
|
208 |
+
// and show the fbq call in the div #fb-pxl-ajax-code
|
209 |
+
if(!$is_ajax_request){
|
210 |
+
self::enqueuePixelCode($server_event);
|
211 |
+
}
|
212 |
+
else{
|
213 |
+
FacebookServerSideEvent::getInstance()->setPendingPixelEvent(
|
214 |
+
'addPixelCodeToAddToCartFragment',
|
215 |
+
$server_event
|
216 |
+
);
|
217 |
+
add_filter('woocommerce_add_to_cart_fragments',
|
218 |
+
array(__CLASS__, 'addPixelCodeToAddToCartFragment'));
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
public static function addPixelCodeToAddToCartFragment($fragments) {
|
223 |
+
$server_event =
|
224 |
+
FacebookServerSideEvent::getInstance()
|
225 |
+
->getPendingPixelEvent('addPixelCodeToAddToCartFragment');
|
226 |
+
if( !is_null($server_event) ){
|
227 |
+
$pixel_code = self::generatePixelCode($server_event, true);
|
228 |
+
$fragments['#'.self::DIV_ID_FOR_AJAX_PIXEL_EVENTS] =
|
229 |
+
self::getDivForAjaxPixelEvent($pixel_code);
|
230 |
+
}
|
231 |
+
return $fragments;
|
232 |
}
|
233 |
|
234 |
public static function createAddToCartEvent(
|
249 |
}
|
250 |
|
251 |
public static function trackInitiateCheckout() {
|
252 |
+
if (FacebookPluginUtils::isInternalUser()) {
|
253 |
return;
|
254 |
}
|
255 |
|
261 |
);
|
262 |
|
263 |
FacebookServerSideEvent::getInstance()->track($server_event);
|
264 |
+
|
265 |
+
self::enqueuePixelCode($server_event);
|
266 |
}
|
267 |
|
268 |
public static function createInitiateCheckoutEvent() {
|
368 |
'facebook-for-woocommerce/facebook-for-woocommerce.php',
|
369 |
get_option('active_plugins'));
|
370 |
}
|
371 |
+
|
372 |
+
public static function generatePixelCode($server_event, $script_tag = false){
|
373 |
+
$code = PixelRenderer::render(array($server_event), self::TRACKING_NAME,
|
374 |
+
$script_tag);
|
375 |
+
$code = sprintf("
|
376 |
+
<!-- Facebook Pixel Event Code -->
|
377 |
+
%s
|
378 |
+
<!-- End Facebook Pixel Event Code -->
|
379 |
+
",
|
380 |
+
$code);
|
381 |
+
return $code;
|
382 |
+
}
|
383 |
+
|
384 |
+
public static function enqueuePixelCode($server_event){
|
385 |
+
$code = self::generatePixelCode($server_event, false);
|
386 |
+
wc_enqueue_js($code);
|
387 |
+
return $code;
|
388 |
+
}
|
389 |
}
|
languages/official-facebook-pixel-ar_AR.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-cs_CZ.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-da_DK.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-de_DE.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-en_GB.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-es_ES.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-es_LA.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-fi_FI.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-fr_CA.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-fr_FR.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-he_IL.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-it_IT.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-ja_JP.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-ko_KR.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-nb_NO.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-nl_NL.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-pl_PL.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-pt_BR.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-pt_PT.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-ru_RU.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-sv_SE.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-th_TH.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-pixel\n"
|
7 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
8 |
"PO-Revision-Date: 2018-11-28 17:37-0800\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-pixel\n"
|
7 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
8 |
"PO-Revision-Date: 2018-11-28 17:37-0800\n"
|
languages/official-facebook-pixel-tr_TR.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-vi_VN.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-zh_CN.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
languages/official-facebook-pixel-zh_TW.po
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Official Facebook Pixel 2.2.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
2 |
# This file is distributed under the same license as the Facebook Pixel package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Official Facebook Pixel 2.2.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
|
7 |
"pixel\n"
|
8 |
"POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: facebook
|
3 |
Tags: Facebook, Facebook Conversion Pixel, Facebook Pixel, Facebook Pixel Events, facebook retargeting, facebook standard events
|
4 |
Requires at least: 4.4
|
5 |
-
Tested up to:
|
6 |
-
Requires PHP: 5.
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -23,7 +23,7 @@ This plugin also includes built-in support for these other WordPress plugins:
|
|
23 |
* Ninja Forms
|
24 |
* WP eCommerce
|
25 |
* WPForms
|
26 |
-
* WooCommerce
|
27 |
|
28 |
== Installation ==
|
29 |
__To install from your WordPress site__ <br />
|
@@ -50,6 +50,14 @@ If you get stuck, or have any questions, you can ask for help in the [Official F
|
|
50 |
Of course! This plugin is open sourced on the Facebook Incubator GitHub. You can find the code and contribution instructions in the [plugin repository](https://github.com/facebookincubator/Facebook-Pixel-for-WordPress).
|
51 |
|
52 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
= 2020-08-14 version 2.2.0 =
|
54 |
* Support for WordPress 5.5
|
55 |
* Improved Conversions API event quality
|
2 |
Contributors: facebook
|
3 |
Tags: Facebook, Facebook Conversion Pixel, Facebook Pixel, Facebook Pixel Events, facebook retargeting, facebook standard events
|
4 |
Requires at least: 4.4
|
5 |
+
Tested up to: 7.4
|
6 |
+
Requires PHP: 5.6
|
7 |
+
Stable tag: 2.2.0
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
23 |
* Ninja Forms
|
24 |
* WP eCommerce
|
25 |
* WPForms
|
26 |
+
* WooCommerce
|
27 |
|
28 |
== Installation ==
|
29 |
__To install from your WordPress site__ <br />
|
50 |
Of course! This plugin is open sourced on the Facebook Incubator GitHub. You can find the code and contribution instructions in the [plugin repository](https://github.com/facebookincubator/Facebook-Pixel-for-WordPress).
|
51 |
|
52 |
== Changelog ==
|
53 |
+
= 2020-11-04 version 2.2.1 =
|
54 |
+
* Stop sending events for internal users
|
55 |
+
* Fix Contact Form 7 integration bug, send events only on form submit success
|
56 |
+
* Update Facebook Business SDK to v8.0.2
|
57 |
+
* Requires PHP 5.6 or greater
|
58 |
+
* Sending ViewContent Conversions API event from WooCommerce
|
59 |
+
* Support for WooCommerce through Pixel and Conversions API
|
60 |
+
|
61 |
= 2020-08-14 version 2.2.0 =
|
62 |
* Support for WordPress 5.5
|
63 |
* Improved Conversions API event quality
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitb70dda9054913ec540ad699dadb60915::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -6,5 +6,13 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
'WP_Async_Task' => $vendorDir . '/techcrunch/wp-async-task/wp-async-task.php',
|
10 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'ArithmeticError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
|
10 |
+
'AssertionError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
|
11 |
+
'DivisionByZeroError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
|
12 |
+
'Error' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/Error.php',
|
13 |
+
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
14 |
+
'ParseError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
|
15 |
+
'SessionUpdateTimestampHandlerInterface' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
|
16 |
+
'TypeError' => $vendorDir . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
|
17 |
'WP_Async_Task' => $vendorDir . '/techcrunch/wp-async-task/wp-async-task.php',
|
18 |
);
|
vendor/composer/autoload_files.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_files.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
10 |
+
'023d27dca8066ef29e6739335ea73bad' => $vendorDir . '/symfony/polyfill-php70/bootstrap.php',
|
11 |
+
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
12 |
+
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
13 |
+
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
14 |
+
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
|
15 |
+
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
|
16 |
+
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
17 |
+
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,6 +6,14 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
'FacebookPixelPlugin\\Integration\\' => array($baseDir . '/integration'),
|
10 |
'FacebookPixelPlugin\\Core\\' => array($baseDir . '/core'),
|
11 |
'FacebookPixelPlugin\\' => array($baseDir . '/'),
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
|
10 |
+
'Symfony\\Polyfill\\Php70\\' => array($vendorDir . '/symfony/polyfill-php70'),
|
11 |
+
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
|
12 |
+
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
13 |
+
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
|
14 |
+
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
|
15 |
+
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
|
16 |
+
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
|
17 |
'FacebookPixelPlugin\\Integration\\' => array($baseDir . '/integration'),
|
18 |
'FacebookPixelPlugin\\Core\\' => array($baseDir . '/core'),
|
19 |
'FacebookPixelPlugin\\' => array($baseDir . '/'),
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -13,21 +13,24 @@ class ComposerAutoloaderInitd240e549ff778e21e170e5e3e6b60735
|
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
16 |
public static function getLoader()
|
17 |
{
|
18 |
if (null !== self::$loader) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -47,6 +50,24 @@ class ComposerAutoloaderInitd240e549ff778e21e170e5e3e6b60735
|
|
47 |
|
48 |
$loader->register(true);
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
return $loader;
|
51 |
}
|
52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitb70dda9054913ec540ad699dadb60915
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
13 |
}
|
14 |
}
|
15 |
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
public static function getLoader()
|
20 |
{
|
21 |
if (null !== self::$loader) {
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitb70dda9054913ec540ad699dadb60915', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitb70dda9054913ec540ad699dadb60915', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitb70dda9054913ec540ad699dadb60915::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
50 |
|
51 |
$loader->register(true);
|
52 |
|
53 |
+
if ($useStaticLoader) {
|
54 |
+
$includeFiles = Composer\Autoload\ComposerStaticInitb70dda9054913ec540ad699dadb60915::$files;
|
55 |
+
} else {
|
56 |
+
$includeFiles = require __DIR__ . '/autoload_files.php';
|
57 |
+
}
|
58 |
+
foreach ($includeFiles as $fileIdentifier => $file) {
|
59 |
+
composerRequireb70dda9054913ec540ad699dadb60915($fileIdentifier, $file);
|
60 |
+
}
|
61 |
+
|
62 |
return $loader;
|
63 |
}
|
64 |
}
|
65 |
+
|
66 |
+
function composerRequireb70dda9054913ec540ad699dadb60915($fileIdentifier, $file)
|
67 |
+
{
|
68 |
+
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
69 |
+
require $file;
|
70 |
+
|
71 |
+
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
72 |
+
}
|
73 |
+
}
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,9 +4,37 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
public static $prefixLengthsPsr4 = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
'F' =>
|
11 |
array (
|
12 |
'FacebookPixelPlugin\\Integration\\' => 32,
|
@@ -17,6 +45,38 @@ class ComposerStaticInitd240e549ff778e21e170e5e3e6b60735
|
|
17 |
);
|
18 |
|
19 |
public static $prefixDirsPsr4 = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
'FacebookPixelPlugin\\Integration\\' =>
|
21 |
array (
|
22 |
0 => __DIR__ . '/../..' . '/integration',
|
@@ -36,15 +96,23 @@ class ComposerStaticInitd240e549ff778e21e170e5e3e6b60735
|
|
36 |
);
|
37 |
|
38 |
public static $classMap = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
'WP_Async_Task' => __DIR__ . '/..' . '/techcrunch/wp-async-task/wp-async-task.php',
|
40 |
);
|
41 |
|
42 |
public static function getInitializer(ClassLoader $loader)
|
43 |
{
|
44 |
return \Closure::bind(function () use ($loader) {
|
45 |
-
$loader->prefixLengthsPsr4 =
|
46 |
-
$loader->prefixDirsPsr4 =
|
47 |
-
$loader->classMap =
|
48 |
|
49 |
}, null, ClassLoader::class);
|
50 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitb70dda9054913ec540ad699dadb60915
|
8 |
{
|
9 |
+
public static $files = array (
|
10 |
+
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
11 |
+
'023d27dca8066ef29e6739335ea73bad' => __DIR__ . '/..' . '/symfony/polyfill-php70/bootstrap.php',
|
12 |
+
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
13 |
+
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
14 |
+
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
15 |
+
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
|
16 |
+
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
|
17 |
+
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
18 |
+
);
|
19 |
+
|
20 |
public static $prefixLengthsPsr4 = array (
|
21 |
+
'S' =>
|
22 |
+
array (
|
23 |
+
'Symfony\\Polyfill\\Php72\\' => 23,
|
24 |
+
'Symfony\\Polyfill\\Php70\\' => 23,
|
25 |
+
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
|
26 |
+
'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
|
27 |
+
),
|
28 |
+
'P' =>
|
29 |
+
array (
|
30 |
+
'Psr\\Http\\Message\\' => 17,
|
31 |
+
),
|
32 |
+
'G' =>
|
33 |
+
array (
|
34 |
+
'GuzzleHttp\\Psr7\\' => 16,
|
35 |
+
'GuzzleHttp\\Promise\\' => 19,
|
36 |
+
'GuzzleHttp\\' => 11,
|
37 |
+
),
|
38 |
'F' =>
|
39 |
array (
|
40 |
'FacebookPixelPlugin\\Integration\\' => 32,
|
45 |
);
|
46 |
|
47 |
public static $prefixDirsPsr4 = array (
|
48 |
+
'Symfony\\Polyfill\\Php72\\' =>
|
49 |
+
array (
|
50 |
+
0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
|
51 |
+
),
|
52 |
+
'Symfony\\Polyfill\\Php70\\' =>
|
53 |
+
array (
|
54 |
+
0 => __DIR__ . '/..' . '/symfony/polyfill-php70',
|
55 |
+
),
|
56 |
+
'Symfony\\Polyfill\\Intl\\Normalizer\\' =>
|
57 |
+
array (
|
58 |
+
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer',
|
59 |
+
),
|
60 |
+
'Symfony\\Polyfill\\Intl\\Idn\\' =>
|
61 |
+
array (
|
62 |
+
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
|
63 |
+
),
|
64 |
+
'Psr\\Http\\Message\\' =>
|
65 |
+
array (
|
66 |
+
0 => __DIR__ . '/..' . '/psr/http-message/src',
|
67 |
+
),
|
68 |
+
'GuzzleHttp\\Psr7\\' =>
|
69 |
+
array (
|
70 |
+
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
|
71 |
+
),
|
72 |
+
'GuzzleHttp\\Promise\\' =>
|
73 |
+
array (
|
74 |
+
0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
|
75 |
+
),
|
76 |
+
'GuzzleHttp\\' =>
|
77 |
+
array (
|
78 |
+
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
|
79 |
+
),
|
80 |
'FacebookPixelPlugin\\Integration\\' =>
|
81 |
array (
|
82 |
0 => __DIR__ . '/../..' . '/integration',
|
96 |
);
|
97 |
|
98 |
public static $classMap = array (
|
99 |
+
'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php',
|
100 |
+
'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php',
|
101 |
+
'DivisionByZeroError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php',
|
102 |
+
'Error' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/Error.php',
|
103 |
+
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
104 |
+
'ParseError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ParseError.php',
|
105 |
+
'SessionUpdateTimestampHandlerInterface' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php',
|
106 |
+
'TypeError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/TypeError.php',
|
107 |
'WP_Async_Task' => __DIR__ . '/..' . '/techcrunch/wp-async-task/wp-async-task.php',
|
108 |
);
|
109 |
|
110 |
public static function getInitializer(ClassLoader $loader)
|
111 |
{
|
112 |
return \Closure::bind(function () use ($loader) {
|
113 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitb70dda9054913ec540ad699dadb60915::$prefixLengthsPsr4;
|
114 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitb70dda9054913ec540ad699dadb60915::$prefixDirsPsr4;
|
115 |
+
$loader->classMap = ComposerStaticInitb70dda9054913ec540ad699dadb60915::$classMap;
|
116 |
|
117 |
}, null, ClassLoader::class);
|
118 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,24 +1,28 @@
|
|
1 |
[
|
2 |
{
|
3 |
"name": "facebook/php-business-sdk",
|
4 |
-
"version": "
|
5 |
-
"version_normalized": "
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/facebook/facebook-php-business-sdk.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/facebook/facebook-php-business-sdk/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
|
|
|
|
|
|
17 |
"require-dev": {
|
|
|
18 |
"phpunit/phpunit": "~8",
|
19 |
"symfony/finder": "~2.6"
|
20 |
},
|
21 |
-
"time": "2020-
|
22 |
"type": "library",
|
23 |
"installation-source": "dist",
|
24 |
"autoload": {
|
@@ -38,6 +42,666 @@
|
|
38 |
"sdk"
|
39 |
]
|
40 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
{
|
42 |
"name": "techcrunch/wp-async-task",
|
43 |
"version": "dev-master",
|
1 |
[
|
2 |
{
|
3 |
"name": "facebook/php-business-sdk",
|
4 |
+
"version": "8.0.2",
|
5 |
+
"version_normalized": "8.0.2.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/facebook/facebook-php-business-sdk.git",
|
9 |
+
"reference": "637fce87380d4a65f6d4c24cc79664fa28c3428d"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/facebook/facebook-php-business-sdk/zipball/637fce87380d4a65f6d4c24cc79664fa28c3428d",
|
14 |
+
"reference": "637fce87380d4a65f6d4c24cc79664fa28c3428d",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
+
"require": {
|
18 |
+
"guzzlehttp/guzzle": "^6.5"
|
19 |
+
},
|
20 |
"require-dev": {
|
21 |
+
"mockery/mockery": "1.3.3",
|
22 |
"phpunit/phpunit": "~8",
|
23 |
"symfony/finder": "~2.6"
|
24 |
},
|
25 |
+
"time": "2020-09-18T00:34:44+00:00",
|
26 |
"type": "library",
|
27 |
"installation-source": "dist",
|
28 |
"autoload": {
|
42 |
"sdk"
|
43 |
]
|
44 |
},
|
45 |
+
{
|
46 |
+
"name": "guzzlehttp/guzzle",
|
47 |
+
"version": "6.5.5",
|
48 |
+
"version_normalized": "6.5.5.0",
|
49 |
+
"source": {
|
50 |
+
"type": "git",
|
51 |
+
"url": "https://github.com/guzzle/guzzle.git",
|
52 |
+
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e"
|
53 |
+
},
|
54 |
+
"dist": {
|
55 |
+
"type": "zip",
|
56 |
+
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
|
57 |
+
"reference": "9d4290de1cfd701f38099ef7e183b64b4b7b0c5e",
|
58 |
+
"shasum": ""
|
59 |
+
},
|
60 |
+
"require": {
|
61 |
+
"ext-json": "*",
|
62 |
+
"guzzlehttp/promises": "^1.0",
|
63 |
+
"guzzlehttp/psr7": "^1.6.1",
|
64 |
+
"php": ">=5.5",
|
65 |
+
"symfony/polyfill-intl-idn": "^1.17.0"
|
66 |
+
},
|
67 |
+
"require-dev": {
|
68 |
+
"ext-curl": "*",
|
69 |
+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
70 |
+
"psr/log": "^1.1"
|
71 |
+
},
|
72 |
+
"suggest": {
|
73 |
+
"psr/log": "Required for using the Log middleware"
|
74 |
+
},
|
75 |
+
"time": "2020-06-16T21:01:06+00:00",
|
76 |
+
"type": "library",
|
77 |
+
"extra": {
|
78 |
+
"branch-alias": {
|
79 |
+
"dev-master": "6.5-dev"
|
80 |
+
}
|
81 |
+
},
|
82 |
+
"installation-source": "dist",
|
83 |
+
"autoload": {
|
84 |
+
"psr-4": {
|
85 |
+
"GuzzleHttp\\": "src/"
|
86 |
+
},
|
87 |
+
"files": [
|
88 |
+
"src/functions_include.php"
|
89 |
+
]
|
90 |
+
},
|
91 |
+
"notification-url": "https://packagist.org/downloads/",
|
92 |
+
"license": [
|
93 |
+
"MIT"
|
94 |
+
],
|
95 |
+
"authors": [
|
96 |
+
{
|
97 |
+
"name": "Michael Dowling",
|
98 |
+
"email": "mtdowling@gmail.com",
|
99 |
+
"homepage": "https://github.com/mtdowling"
|
100 |
+
}
|
101 |
+
],
|
102 |
+
"description": "Guzzle is a PHP HTTP client library",
|
103 |
+
"homepage": "http://guzzlephp.org/",
|
104 |
+
"keywords": [
|
105 |
+
"client",
|
106 |
+
"curl",
|
107 |
+
"framework",
|
108 |
+
"http",
|
109 |
+
"http client",
|
110 |
+
"rest",
|
111 |
+
"web service"
|
112 |
+
]
|
113 |
+
},
|
114 |
+
{
|
115 |
+
"name": "guzzlehttp/promises",
|
116 |
+
"version": "v1.3.1",
|
117 |
+
"version_normalized": "1.3.1.0",
|
118 |
+
"source": {
|
119 |
+
"type": "git",
|
120 |
+
"url": "https://github.com/guzzle/promises.git",
|
121 |
+
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
|
122 |
+
},
|
123 |
+
"dist": {
|
124 |
+
"type": "zip",
|
125 |
+
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
126 |
+
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
|
127 |
+
"shasum": ""
|
128 |
+
},
|
129 |
+
"require": {
|
130 |
+
"php": ">=5.5.0"
|
131 |
+
},
|
132 |
+
"require-dev": {
|
133 |
+
"phpunit/phpunit": "^4.0"
|
134 |
+
},
|
135 |
+
"time": "2016-12-20T10:07:11+00:00",
|
136 |
+
"type": "library",
|
137 |
+
"extra": {
|
138 |
+
"branch-alias": {
|
139 |
+
"dev-master": "1.4-dev"
|
140 |
+
}
|
141 |
+
},
|
142 |
+
"installation-source": "dist",
|
143 |
+
"autoload": {
|
144 |
+
"psr-4": {
|
145 |
+
"GuzzleHttp\\Promise\\": "src/"
|
146 |
+
},
|
147 |
+
"files": [
|
148 |
+
"src/functions_include.php"
|
149 |
+
]
|
150 |
+
},
|
151 |
+
"notification-url": "https://packagist.org/downloads/",
|
152 |
+
"license": [
|
153 |
+
"MIT"
|
154 |
+
],
|
155 |
+
"authors": [
|
156 |
+
{
|
157 |
+
"name": "Michael Dowling",
|
158 |
+
"email": "mtdowling@gmail.com",
|
159 |
+
"homepage": "https://github.com/mtdowling"
|
160 |
+
}
|
161 |
+
],
|
162 |
+
"description": "Guzzle promises library",
|
163 |
+
"keywords": [
|
164 |
+
"promise"
|
165 |
+
]
|
166 |
+
},
|
167 |
+
{
|
168 |
+
"name": "guzzlehttp/psr7",
|
169 |
+
"version": "1.6.1",
|
170 |
+
"version_normalized": "1.6.1.0",
|
171 |
+
"source": {
|
172 |
+
"type": "git",
|
173 |
+
"url": "https://github.com/guzzle/psr7.git",
|
174 |
+
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
|
175 |
+
},
|
176 |
+
"dist": {
|
177 |
+
"type": "zip",
|
178 |
+
"url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a",
|
179 |
+
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
|
180 |
+
"shasum": ""
|
181 |
+
},
|
182 |
+
"require": {
|
183 |
+
"php": ">=5.4.0",
|
184 |
+
"psr/http-message": "~1.0",
|
185 |
+
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
|
186 |
+
},
|
187 |
+
"provide": {
|
188 |
+
"psr/http-message-implementation": "1.0"
|
189 |
+
},
|
190 |
+
"require-dev": {
|
191 |
+
"ext-zlib": "*",
|
192 |
+
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
193 |
+
},
|
194 |
+
"suggest": {
|
195 |
+
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
|
196 |
+
},
|
197 |
+
"time": "2019-07-01T23:21:34+00:00",
|
198 |
+
"type": "library",
|
199 |
+
"extra": {
|
200 |
+
"branch-alias": {
|
201 |
+
"dev-master": "1.6-dev"
|
202 |
+
}
|
203 |
+
},
|
204 |
+
"installation-source": "dist",
|
205 |
+
"autoload": {
|
206 |
+
"psr-4": {
|
207 |
+
"GuzzleHttp\\Psr7\\": "src/"
|
208 |
+
},
|
209 |
+
"files": [
|
210 |
+
"src/functions_include.php"
|
211 |
+
]
|
212 |
+
},
|
213 |
+
"notification-url": "https://packagist.org/downloads/",
|
214 |
+
"license": [
|
215 |
+
"MIT"
|
216 |
+
],
|
217 |
+
"authors": [
|
218 |
+
{
|
219 |
+
"name": "Michael Dowling",
|
220 |
+
"email": "mtdowling@gmail.com",
|
221 |
+
"homepage": "https://github.com/mtdowling"
|
222 |
+
},
|
223 |
+
{
|
224 |
+
"name": "Tobias Schultze",
|
225 |
+
"homepage": "https://github.com/Tobion"
|
226 |
+
}
|
227 |
+
],
|
228 |
+
"description": "PSR-7 message implementation that also provides common utility methods",
|
229 |
+
"keywords": [
|
230 |
+
"http",
|
231 |
+
"message",
|
232 |
+
"psr-7",
|
233 |
+
"request",
|
234 |
+
"response",
|
235 |
+
"stream",
|
236 |
+
"uri",
|
237 |
+
"url"
|
238 |
+
]
|
239 |
+
},
|
240 |
+
{
|
241 |
+
"name": "paragonie/random_compat",
|
242 |
+
"version": "v9.99.99",
|
243 |
+
"version_normalized": "9.99.99.0",
|
244 |
+
"source": {
|
245 |
+
"type": "git",
|
246 |
+
"url": "https://github.com/paragonie/random_compat.git",
|
247 |
+
"reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95"
|
248 |
+
},
|
249 |
+
"dist": {
|
250 |
+
"type": "zip",
|
251 |
+
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
|
252 |
+
"reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
|
253 |
+
"shasum": ""
|
254 |
+
},
|
255 |
+
"require": {
|
256 |
+
"php": "^7"
|
257 |
+
},
|
258 |
+
"require-dev": {
|
259 |
+
"phpunit/phpunit": "4.*|5.*",
|
260 |
+
"vimeo/psalm": "^1"
|
261 |
+
},
|
262 |
+
"suggest": {
|
263 |
+
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
264 |
+
},
|
265 |
+
"time": "2018-07-02T15:55:56+00:00",
|
266 |
+
"type": "library",
|
267 |
+
"installation-source": "dist",
|
268 |
+
"notification-url": "https://packagist.org/downloads/",
|
269 |
+
"license": [
|
270 |
+
"MIT"
|
271 |
+
],
|
272 |
+
"authors": [
|
273 |
+
{
|
274 |
+
"name": "Paragon Initiative Enterprises",
|
275 |
+
"email": "security@paragonie.com",
|
276 |
+
"homepage": "https://paragonie.com"
|
277 |
+
}
|
278 |
+
],
|
279 |
+
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
280 |
+
"keywords": [
|
281 |
+
"csprng",
|
282 |
+
"polyfill",
|
283 |
+
"pseudorandom",
|
284 |
+
"random"
|
285 |
+
]
|
286 |
+
},
|
287 |
+
{
|
288 |
+
"name": "psr/http-message",
|
289 |
+
"version": "1.0.1",
|
290 |
+
"version_normalized": "1.0.1.0",
|
291 |
+
"source": {
|
292 |
+
"type": "git",
|
293 |
+
"url": "https://github.com/php-fig/http-message.git",
|
294 |
+
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
295 |
+
},
|
296 |
+
"dist": {
|
297 |
+
"type": "zip",
|
298 |
+
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
299 |
+
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
300 |
+
"shasum": ""
|
301 |
+
},
|
302 |
+
"require": {
|
303 |
+
"php": ">=5.3.0"
|
304 |
+
},
|
305 |
+
"time": "2016-08-06T14:39:51+00:00",
|
306 |
+
"type": "library",
|
307 |
+
"extra": {
|
308 |
+
"branch-alias": {
|
309 |
+
"dev-master": "1.0.x-dev"
|
310 |
+
}
|
311 |
+
},
|
312 |
+
"installation-source": "dist",
|
313 |
+
"autoload": {
|
314 |
+
"psr-4": {
|
315 |
+
"Psr\\Http\\Message\\": "src/"
|
316 |
+
}
|
317 |
+
},
|
318 |
+
"notification-url": "https://packagist.org/downloads/",
|
319 |
+
"license": [
|
320 |
+
"MIT"
|
321 |
+
],
|
322 |
+
"authors": [
|
323 |
+
{
|
324 |
+
"name": "PHP-FIG",
|
325 |
+
"homepage": "http://www.php-fig.org/"
|
326 |
+
}
|
327 |
+
],
|
328 |
+
"description": "Common interface for HTTP messages",
|
329 |
+
"homepage": "https://github.com/php-fig/http-message",
|
330 |
+
"keywords": [
|
331 |
+
"http",
|
332 |
+
"http-message",
|
333 |
+
"psr",
|
334 |
+
"psr-7",
|
335 |
+
"request",
|
336 |
+
"response"
|
337 |
+
]
|
338 |
+
},
|
339 |
+
{
|
340 |
+
"name": "ralouphie/getallheaders",
|
341 |
+
"version": "3.0.3",
|
342 |
+
"version_normalized": "3.0.3.0",
|
343 |
+
"source": {
|
344 |
+
"type": "git",
|
345 |
+
"url": "https://github.com/ralouphie/getallheaders.git",
|
346 |
+
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
347 |
+
},
|
348 |
+
"dist": {
|
349 |
+
"type": "zip",
|
350 |
+
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
351 |
+
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
352 |
+
"shasum": ""
|
353 |
+
},
|
354 |
+
"require": {
|
355 |
+
"php": ">=5.6"
|
356 |
+
},
|
357 |
+
"require-dev": {
|
358 |
+
"php-coveralls/php-coveralls": "^2.1",
|
359 |
+
"phpunit/phpunit": "^5 || ^6.5"
|
360 |
+
},
|
361 |
+
"time": "2019-03-08T08:55:37+00:00",
|
362 |
+
"type": "library",
|
363 |
+
"installation-source": "dist",
|
364 |
+
"autoload": {
|
365 |
+
"files": [
|
366 |
+
"src/getallheaders.php"
|
367 |
+
]
|
368 |
+
},
|
369 |
+
"notification-url": "https://packagist.org/downloads/",
|
370 |
+
"license": [
|
371 |
+
"MIT"
|
372 |
+
],
|
373 |
+
"authors": [
|
374 |
+
{
|
375 |
+
"name": "Ralph Khattar",
|
376 |
+
"email": "ralph.khattar@gmail.com"
|
377 |
+
}
|
378 |
+
],
|
379 |
+
"description": "A polyfill for getallheaders."
|
380 |
+
},
|
381 |
+
{
|
382 |
+
"name": "symfony/polyfill-intl-idn",
|
383 |
+
"version": "v1.18.1",
|
384 |
+
"version_normalized": "1.18.1.0",
|
385 |
+
"source": {
|
386 |
+
"type": "git",
|
387 |
+
"url": "https://github.com/symfony/polyfill-intl-idn.git",
|
388 |
+
"reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251"
|
389 |
+
},
|
390 |
+
"dist": {
|
391 |
+
"type": "zip",
|
392 |
+
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251",
|
393 |
+
"reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251",
|
394 |
+
"shasum": ""
|
395 |
+
},
|
396 |
+
"require": {
|
397 |
+
"php": ">=5.3.3",
|
398 |
+
"symfony/polyfill-intl-normalizer": "^1.10",
|
399 |
+
"symfony/polyfill-php70": "^1.10",
|
400 |
+
"symfony/polyfill-php72": "^1.10"
|
401 |
+
},
|
402 |
+
"suggest": {
|
403 |
+
"ext-intl": "For best performance"
|
404 |
+
},
|
405 |
+
"time": "2020-08-04T06:02:08+00:00",
|
406 |
+
"type": "library",
|
407 |
+
"extra": {
|
408 |
+
"branch-alias": {
|
409 |
+
"dev-master": "1.18-dev"
|
410 |
+
},
|
411 |
+
"thanks": {
|
412 |
+
"name": "symfony/polyfill",
|
413 |
+
"url": "https://github.com/symfony/polyfill"
|
414 |
+
}
|
415 |
+
},
|
416 |
+
"installation-source": "dist",
|
417 |
+
"autoload": {
|
418 |
+
"psr-4": {
|
419 |
+
"Symfony\\Polyfill\\Intl\\Idn\\": ""
|
420 |
+
},
|
421 |
+
"files": [
|
422 |
+
"bootstrap.php"
|
423 |
+
]
|
424 |
+
},
|
425 |
+
"notification-url": "https://packagist.org/downloads/",
|
426 |
+
"license": [
|
427 |
+
"MIT"
|
428 |
+
],
|
429 |
+
"authors": [
|
430 |
+
{
|
431 |
+
"name": "Laurent Bassin",
|
432 |
+
"email": "laurent@bassin.info"
|
433 |
+
},
|
434 |
+
{
|
435 |
+
"name": "Trevor Rowbotham",
|
436 |
+
"email": "trevor.rowbotham@pm.me"
|
437 |
+
},
|
438 |
+
{
|
439 |
+
"name": "Symfony Community",
|
440 |
+
"homepage": "https://symfony.com/contributors"
|
441 |
+
}
|
442 |
+
],
|
443 |
+
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
|
444 |
+
"homepage": "https://symfony.com",
|
445 |
+
"keywords": [
|
446 |
+
"compatibility",
|
447 |
+
"idn",
|
448 |
+
"intl",
|
449 |
+
"polyfill",
|
450 |
+
"portable",
|
451 |
+
"shim"
|
452 |
+
],
|
453 |
+
"funding": [
|
454 |
+
{
|
455 |
+
"url": "https://symfony.com/sponsor",
|
456 |
+
"type": "custom"
|
457 |
+
},
|
458 |
+
{
|
459 |
+
"url": "https://github.com/fabpot",
|
460 |
+
"type": "github"
|
461 |
+
},
|
462 |
+
{
|
463 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
464 |
+
"type": "tidelift"
|
465 |
+
}
|
466 |
+
]
|
467 |
+
},
|
468 |
+
{
|
469 |
+
"name": "symfony/polyfill-intl-normalizer",
|
470 |
+
"version": "v1.18.1",
|
471 |
+
"version_normalized": "1.18.1.0",
|
472 |
+
"source": {
|
473 |
+
"type": "git",
|
474 |
+
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
475 |
+
"reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e"
|
476 |
+
},
|
477 |
+
"dist": {
|
478 |
+
"type": "zip",
|
479 |
+
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
|
480 |
+
"reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e",
|
481 |
+
"shasum": ""
|
482 |
+
},
|
483 |
+
"require": {
|
484 |
+
"php": ">=5.3.3"
|
485 |
+
},
|
486 |
+
"suggest": {
|
487 |
+
"ext-intl": "For best performance"
|
488 |
+
},
|
489 |
+
"time": "2020-07-14T12:35:20+00:00",
|
490 |
+
"type": "library",
|
491 |
+
"extra": {
|
492 |
+
"branch-alias": {
|
493 |
+
"dev-master": "1.18-dev"
|
494 |
+
},
|
495 |
+
"thanks": {
|
496 |
+
"name": "symfony/polyfill",
|
497 |
+
"url": "https://github.com/symfony/polyfill"
|
498 |
+
}
|
499 |
+
},
|
500 |
+
"installation-source": "dist",
|
501 |
+
"autoload": {
|
502 |
+
"psr-4": {
|
503 |
+
"Symfony\\Polyfill\\Intl\\Normalizer\\": ""
|
504 |
+
},
|
505 |
+
"files": [
|
506 |
+
"bootstrap.php"
|
507 |
+
],
|
508 |
+
"classmap": [
|
509 |
+
"Resources/stubs"
|
510 |
+
]
|
511 |
+
},
|
512 |
+
"notification-url": "https://packagist.org/downloads/",
|
513 |
+
"license": [
|
514 |
+
"MIT"
|
515 |
+
],
|
516 |
+
"authors": [
|
517 |
+
{
|
518 |
+
"name": "Nicolas Grekas",
|
519 |
+
"email": "p@tchwork.com"
|
520 |
+
},
|
521 |
+
{
|
522 |
+
"name": "Symfony Community",
|
523 |
+
"homepage": "https://symfony.com/contributors"
|
524 |
+
}
|
525 |
+
],
|
526 |
+
"description": "Symfony polyfill for intl's Normalizer class and related functions",
|
527 |
+
"homepage": "https://symfony.com",
|
528 |
+
"keywords": [
|
529 |
+
"compatibility",
|
530 |
+
"intl",
|
531 |
+
"normalizer",
|
532 |
+
"polyfill",
|
533 |
+
"portable",
|
534 |
+
"shim"
|
535 |
+
],
|
536 |
+
"funding": [
|
537 |
+
{
|
538 |
+
"url": "https://symfony.com/sponsor",
|
539 |
+
"type": "custom"
|
540 |
+
},
|
541 |
+
{
|
542 |
+
"url": "https://github.com/fabpot",
|
543 |
+
"type": "github"
|
544 |
+
},
|
545 |
+
{
|
546 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
547 |
+
"type": "tidelift"
|
548 |
+
}
|
549 |
+
]
|
550 |
+
},
|
551 |
+
{
|
552 |
+
"name": "symfony/polyfill-php70",
|
553 |
+
"version": "v1.18.1",
|
554 |
+
"version_normalized": "1.18.1.0",
|
555 |
+
"source": {
|
556 |
+
"type": "git",
|
557 |
+
"url": "https://github.com/symfony/polyfill-php70.git",
|
558 |
+
"reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3"
|
559 |
+
},
|
560 |
+
"dist": {
|
561 |
+
"type": "zip",
|
562 |
+
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
|
563 |
+
"reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3",
|
564 |
+
"shasum": ""
|
565 |
+
},
|
566 |
+
"require": {
|
567 |
+
"paragonie/random_compat": "~1.0|~2.0|~9.99",
|
568 |
+
"php": ">=5.3.3"
|
569 |
+
},
|
570 |
+
"time": "2020-07-14T12:35:20+00:00",
|
571 |
+
"type": "library",
|
572 |
+
"extra": {
|
573 |
+
"branch-alias": {
|
574 |
+
"dev-master": "1.18-dev"
|
575 |
+
},
|
576 |
+
"thanks": {
|
577 |
+
"name": "symfony/polyfill",
|
578 |
+
"url": "https://github.com/symfony/polyfill"
|
579 |
+
}
|
580 |
+
},
|
581 |
+
"installation-source": "dist",
|
582 |
+
"autoload": {
|
583 |
+
"psr-4": {
|
584 |
+
"Symfony\\Polyfill\\Php70\\": ""
|
585 |
+
},
|
586 |
+
"files": [
|
587 |
+
"bootstrap.php"
|
588 |
+
],
|
589 |
+
"classmap": [
|
590 |
+
"Resources/stubs"
|
591 |
+
]
|
592 |
+
},
|
593 |
+
"notification-url": "https://packagist.org/downloads/",
|
594 |
+
"license": [
|
595 |
+
"MIT"
|
596 |
+
],
|
597 |
+
"authors": [
|
598 |
+
{
|
599 |
+
"name": "Nicolas Grekas",
|
600 |
+
"email": "p@tchwork.com"
|
601 |
+
},
|
602 |
+
{
|
603 |
+
"name": "Symfony Community",
|
604 |
+
"homepage": "https://symfony.com/contributors"
|
605 |
+
}
|
606 |
+
],
|
607 |
+
"description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
|
608 |
+
"homepage": "https://symfony.com",
|
609 |
+
"keywords": [
|
610 |
+
"compatibility",
|
611 |
+
"polyfill",
|
612 |
+
"portable",
|
613 |
+
"shim"
|
614 |
+
],
|
615 |
+
"funding": [
|
616 |
+
{
|
617 |
+
"url": "https://symfony.com/sponsor",
|
618 |
+
"type": "custom"
|
619 |
+
},
|
620 |
+
{
|
621 |
+
"url": "https://github.com/fabpot",
|
622 |
+
"type": "github"
|
623 |
+
},
|
624 |
+
{
|
625 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
626 |
+
"type": "tidelift"
|
627 |
+
}
|
628 |
+
]
|
629 |
+
},
|
630 |
+
{
|
631 |
+
"name": "symfony/polyfill-php72",
|
632 |
+
"version": "v1.18.1",
|
633 |
+
"version_normalized": "1.18.1.0",
|
634 |
+
"source": {
|
635 |
+
"type": "git",
|
636 |
+
"url": "https://github.com/symfony/polyfill-php72.git",
|
637 |
+
"reference": "639447d008615574653fb3bc60d1986d7172eaae"
|
638 |
+
},
|
639 |
+
"dist": {
|
640 |
+
"type": "zip",
|
641 |
+
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
|
642 |
+
"reference": "639447d008615574653fb3bc60d1986d7172eaae",
|
643 |
+
"shasum": ""
|
644 |
+
},
|
645 |
+
"require": {
|
646 |
+
"php": ">=5.3.3"
|
647 |
+
},
|
648 |
+
"time": "2020-07-14T12:35:20+00:00",
|
649 |
+
"type": "library",
|
650 |
+
"extra": {
|
651 |
+
"branch-alias": {
|
652 |
+
"dev-master": "1.18-dev"
|
653 |
+
},
|
654 |
+
"thanks": {
|
655 |
+
"name": "symfony/polyfill",
|
656 |
+
"url": "https://github.com/symfony/polyfill"
|
657 |
+
}
|
658 |
+
},
|
659 |
+
"installation-source": "dist",
|
660 |
+
"autoload": {
|
661 |
+
"psr-4": {
|
662 |
+
"Symfony\\Polyfill\\Php72\\": ""
|
663 |
+
},
|
664 |
+
"files": [
|
665 |
+
"bootstrap.php"
|
666 |
+
]
|
667 |
+
},
|
668 |
+
"notification-url": "https://packagist.org/downloads/",
|
669 |
+
"license": [
|
670 |
+
"MIT"
|
671 |
+
],
|
672 |
+
"authors": [
|
673 |
+
{
|
674 |
+
"name": "Nicolas Grekas",
|
675 |
+
"email": "p@tchwork.com"
|
676 |
+
},
|
677 |
+
{
|
678 |
+
"name": "Symfony Community",
|
679 |
+
"homepage": "https://symfony.com/contributors"
|
680 |
+
}
|
681 |
+
],
|
682 |
+
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
|
683 |
+
"homepage": "https://symfony.com",
|
684 |
+
"keywords": [
|
685 |
+
"compatibility",
|
686 |
+
"polyfill",
|
687 |
+
"portable",
|
688 |
+
"shim"
|
689 |
+
],
|
690 |
+
"funding": [
|
691 |
+
{
|
692 |
+
"url": "https://symfony.com/sponsor",
|
693 |
+
"type": "custom"
|
694 |
+
},
|
695 |
+
{
|
696 |
+
"url": "https://github.com/fabpot",
|
697 |
+
"type": "github"
|
698 |
+
},
|
699 |
+
{
|
700 |
+
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
701 |
+
"type": "tidelift"
|
702 |
+
}
|
703 |
+
]
|
704 |
+
},
|
705 |
{
|
706 |
"name": "techcrunch/wp-async-task",
|
707 |
"version": "dev-master",
|
vendor/facebook/php-business-sdk/.gitignore
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/local
|
2 |
+
/vendor
|
3 |
+
/composer.lock
|
4 |
+
/composer.local.*
|
5 |
+
/composer.phar
|
6 |
+
/coverage.clover
|
7 |
+
.DS_Store
|
8 |
+
/.idea
|
9 |
+
/builds
|
10 |
+
# VIM Swap Files #
|
11 |
+
*.swp
|
12 |
+
*.swo
|
vendor/facebook/php-business-sdk/CHANGELOG.md
CHANGED
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
|
|
5 |
|
6 |
## Unreleased
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
## v7.0.2
|
9 |
### Added
|
10 |
- Added support for data processing options in Serverside API. For more details see : https://developers.facebook.com/docs/marketing-apis/data-processing-options
|
@@ -80,3 +102,4 @@ All notable changes to this project will be documented in this file.
|
|
80 |
$async_job = $async_job->getSelf();
|
81 |
}
|
82 |
```
|
|
5 |
|
6 |
## Unreleased
|
7 |
|
8 |
+
## v8.0.2
|
9 |
+
|
10 |
+
### Added
|
11 |
+
- Added batching support to Conversions API. Create batched event requests by using BatchProcessor.
|
12 |
+
|
13 |
+
### Added
|
14 |
+
- `lead_id` field to the Conversions API `user_data` section.
|
15 |
+
- Added HttpServiceInterface to enable the default request object to be overridden by a user-defined HTTP Request Service class. Can be used to create Conversions API event requests.
|
16 |
+
|
17 |
+
## v8.0.1
|
18 |
+
|
19 |
+
### Added
|
20 |
+
- Added async support to Conversions API - Create event request promises by using EventRequestAsync.
|
21 |
+
|
22 |
+
## v8.0.0
|
23 |
+
|
24 |
+
### Changed
|
25 |
+
- Graph API call upgrade to [v8.0](https://developers.facebook.com/docs/graph-api/changelog/version8.0)
|
26 |
+
|
27 |
+
### Added
|
28 |
+
- `delivery_category` field in custom_data section for Conversions API(formerly Serverside API).
|
29 |
+
|
30 |
## v7.0.2
|
31 |
### Added
|
32 |
- Added support for data processing options in Serverside API. For more details see : https://developers.facebook.com/docs/marketing-apis/data-processing-options
|
102 |
$async_job = $async_job->getSelf();
|
103 |
}
|
104 |
```
|
105 |
+
|
vendor/facebook/php-business-sdk/composer.json
CHANGED
@@ -11,9 +11,13 @@
|
|
11 |
"page"
|
12 |
],
|
13 |
"homepage": "https://developers.facebook.com/",
|
|
|
|
|
|
|
14 |
"require-dev": {
|
15 |
"phpunit/phpunit": "~8",
|
16 |
-
"symfony/finder": "~2.6"
|
|
|
17 |
},
|
18 |
"autoload": {
|
19 |
"psr-4": {
|
11 |
"page"
|
12 |
],
|
13 |
"homepage": "https://developers.facebook.com/",
|
14 |
+
"require": {
|
15 |
+
"guzzlehttp/guzzle": "^6.5"
|
16 |
+
},
|
17 |
"require-dev": {
|
18 |
"phpunit/phpunit": "~8",
|
19 |
+
"symfony/finder": "~2.6",
|
20 |
+
"mockery/mockery": "1.3.3"
|
21 |
},
|
22 |
"autoload": {
|
23 |
"psr-4": {
|
vendor/facebook/php-business-sdk/examples/CustomAudienceUsersPost.php
CHANGED
@@ -24,14 +24,13 @@
|
|
24 |
require __DIR__ . '/vendor/autoload.php';
|
25 |
|
26 |
use FacebookAds\Object\CustomAudience;
|
27 |
-
use FacebookAds\Object\User;
|
28 |
use FacebookAds\Api;
|
29 |
use FacebookAds\Logger\CurlLogger;
|
30 |
|
31 |
$access_token = '<ACCESS_TOKEN>';
|
32 |
$app_secret = '<APP_SECRET>';
|
33 |
$app_id = '<APP_ID>';
|
34 |
-
$id = '<
|
35 |
|
36 |
$api = Api::init($app_id, $app_secret, $access_token);
|
37 |
$api->setLogger(new CurlLogger());
|
24 |
require __DIR__ . '/vendor/autoload.php';
|
25 |
|
26 |
use FacebookAds\Object\CustomAudience;
|
|
|
27 |
use FacebookAds\Api;
|
28 |
use FacebookAds\Logger\CurlLogger;
|
29 |
|
30 |
$access_token = '<ACCESS_TOKEN>';
|
31 |
$app_secret = '<APP_SECRET>';
|
32 |
$app_id = '<APP_ID>';
|
33 |
+
$id = '<CUSTOM_AUDIENCE_ID>';
|
34 |
|
35 |
$api = Api::init($app_id, $app_secret, $access_token);
|
36 |
$api->setLogger(new CurlLogger());
|
vendor/facebook/php-business-sdk/examples/CustomAudienceUsersPostCrossPlatform.php
CHANGED
@@ -24,14 +24,13 @@
|
|
24 |
require __DIR__ . '/vendor/autoload.php';
|
25 |
|
26 |
use FacebookAds\Object\CustomAudience;
|
27 |
-
use FacebookAds\Object\User;
|
28 |
use FacebookAds\Api;
|
29 |
use FacebookAds\Logger\CurlLogger;
|
30 |
|
31 |
$access_token = '<ACCESS_TOKEN>';
|
32 |
$app_secret = '<APP_SECRET>';
|
33 |
$app_id = '<APP_ID>';
|
34 |
-
$id = '<
|
35 |
|
36 |
$api = Api::init($app_id, $app_secret, $access_token);
|
37 |
$api->setLogger(new CurlLogger());
|
24 |
require __DIR__ . '/vendor/autoload.php';
|
25 |
|
26 |
use FacebookAds\Object\CustomAudience;
|
|
|
27 |
use FacebookAds\Api;
|
28 |
use FacebookAds\Logger\CurlLogger;
|
29 |
|
30 |
$access_token = '<ACCESS_TOKEN>';
|
31 |
$app_secret = '<APP_SECRET>';
|
32 |
$app_id = '<APP_ID>';
|
33 |
+
$id = '<CUSTOM_AUDIENCE_ID>';
|
34 |
|
35 |
$api = Api::init($app_id, $app_secret, $access_token);
|
36 |
$api->setLogger(new CurlLogger());
|
vendor/facebook/php-business-sdk/examples/aggregator_onboarding/api.php
CHANGED
@@ -130,7 +130,7 @@ function create_client_business($access_token) {
|
|
130 |
array(),
|
131 |
array(
|
132 |
'client_user_id' => $app_scoped_user_id,
|
133 |
-
)
|
134 |
);
|
135 |
|
136 |
if (!is_null($child_business) && !is_null($child_business[0])) {
|
@@ -158,7 +158,7 @@ function create_client_business($access_token) {
|
|
158 |
'shared_page_id' => $page_id,
|
159 |
'page_permitted_roles' => ['ADVERTISER'],
|
160 |
'timezone_id' => 1,
|
161 |
-
)
|
162 |
);
|
163 |
$child_business_id = $child_business->id;
|
164 |
|
@@ -172,7 +172,7 @@ function create_client_business($access_token) {
|
|
172 |
array(
|
173 |
'receiving_business_id' => $child_business_id,
|
174 |
'amount' => 10,
|
175 |
-
)
|
176 |
);
|
177 |
|
178 |
/**
|
@@ -186,7 +186,7 @@ function create_client_business($access_token) {
|
|
186 |
'id' => $child_business_id,
|
187 |
'app_id' => $app_id,
|
188 |
'scope' => 'manage_pages,ads_management,business_management',
|
189 |
-
)
|
190 |
);
|
191 |
$child_bm_system_user_access_token = $child_business_token->access_token;
|
192 |
|
@@ -217,7 +217,7 @@ function create_client_business($access_token) {
|
|
217 |
'media_agency' => 'NONE',
|
218 |
'partner' => 'NONE',
|
219 |
'funding_id' => $child_bm_payment_method_id,
|
220 |
-
)
|
221 |
);
|
222 |
$account_id = $account->id;
|
223 |
|
@@ -240,7 +240,7 @@ function create_client_business($access_token) {
|
|
240 |
'user' => $system_user_id,
|
241 |
'role' => 'ADMIN',
|
242 |
'business' => $child_business_id,
|
243 |
-
)
|
244 |
);
|
245 |
|
246 |
return $child_business_id.','.$account_id;
|
@@ -259,7 +259,7 @@ function create_click_to_messenger_ad(
|
|
259 |
array(
|
260 |
'app_id' => $app_id,
|
261 |
'scope' => 'manage_pages,ads_management,business_management',
|
262 |
-
)
|
263 |
);
|
264 |
$child_bm_system_user_access_token = $child_business_token->access_token;
|
265 |
$api = setAccessToken($child_bm_system_user_access_token);
|
@@ -269,7 +269,7 @@ function create_click_to_messenger_ad(
|
|
269 |
array(
|
270 |
CampaignFields::NAME => 'First test Campaign',
|
271 |
CampaignFields::OBJECTIVE => 'MESSAGES',
|
272 |
-
)
|
273 |
);
|
274 |
|
275 |
/**
|
@@ -287,7 +287,7 @@ function create_click_to_messenger_ad(
|
|
287 |
'distance_unit' => 'mile',
|
288 |
),
|
289 |
),
|
290 |
-
)
|
291 |
));
|
292 |
|
293 |
/**
|
@@ -332,7 +332,7 @@ function create_click_to_messenger_ad(
|
|
332 |
'value' => array(
|
333 |
AdCreativeLinkDataCallToActionValueFields::APP_DESTINATION =>
|
334 |
PageCallToActionWebDestinationTypeValues::MESSENGER,
|
335 |
-
)
|
336 |
),
|
337 |
AdCreativeLinkDataFields::LINK => '<YOUR-LINK>',
|
338 |
AdCreativeLinkDataFields::IMAGE_HASH => $image->hash,
|
@@ -351,7 +351,7 @@ function create_click_to_messenger_ad(
|
|
351 |
array(
|
352 |
AdCreativeFields::NAME => 'Sample Creative',
|
353 |
AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
|
354 |
-
)
|
355 |
);
|
356 |
|
357 |
$ad = $account->createAd(
|
@@ -361,7 +361,7 @@ function create_click_to_messenger_ad(
|
|
361 |
'adset_id' => $ad_set_id,
|
362 |
'name' => 'My Ad',
|
363 |
'creative' => array('creative_id' => $creative->id),
|
364 |
-
)
|
365 |
);
|
366 |
$ad_id = $ad->id;
|
367 |
return 'Ad ID: '.$ad_id;
|
@@ -390,7 +390,7 @@ if (isset($_GET["action"]) && in_array($_GET["action"], $possible_url)) {
|
|
390 |
$_GET["adaccount"],
|
391 |
$_GET["bmid"],
|
392 |
$_GET["ad_message"],
|
393 |
-
$_GET["page_welcome_message"]
|
394 |
);
|
395 |
else
|
396 |
$value = "Missing argument";
|
130 |
array(),
|
131 |
array(
|
132 |
'client_user_id' => $app_scoped_user_id,
|
133 |
+
),
|
134 |
);
|
135 |
|
136 |
if (!is_null($child_business) && !is_null($child_business[0])) {
|
158 |
'shared_page_id' => $page_id,
|
159 |
'page_permitted_roles' => ['ADVERTISER'],
|
160 |
'timezone_id' => 1,
|
161 |
+
),
|
162 |
);
|
163 |
$child_business_id = $child_business->id;
|
164 |
|
172 |
array(
|
173 |
'receiving_business_id' => $child_business_id,
|
174 |
'amount' => 10,
|
175 |
+
),
|
176 |
);
|
177 |
|
178 |
/**
|
186 |
'id' => $child_business_id,
|
187 |
'app_id' => $app_id,
|
188 |
'scope' => 'manage_pages,ads_management,business_management',
|
189 |
+
),
|
190 |
);
|
191 |
$child_bm_system_user_access_token = $child_business_token->access_token;
|
192 |
|
217 |
'media_agency' => 'NONE',
|
218 |
'partner' => 'NONE',
|
219 |
'funding_id' => $child_bm_payment_method_id,
|
220 |
+
),
|
221 |
);
|
222 |
$account_id = $account->id;
|
223 |
|
240 |
'user' => $system_user_id,
|
241 |
'role' => 'ADMIN',
|
242 |
'business' => $child_business_id,
|
243 |
+
),
|
244 |
);
|
245 |
|
246 |
return $child_business_id.','.$account_id;
|
259 |
array(
|
260 |
'app_id' => $app_id,
|
261 |
'scope' => 'manage_pages,ads_management,business_management',
|
262 |
+
),
|
263 |
);
|
264 |
$child_bm_system_user_access_token = $child_business_token->access_token;
|
265 |
$api = setAccessToken($child_bm_system_user_access_token);
|
269 |
array(
|
270 |
CampaignFields::NAME => 'First test Campaign',
|
271 |
CampaignFields::OBJECTIVE => 'MESSAGES',
|
272 |
+
),
|
273 |
);
|
274 |
|
275 |
/**
|
287 |
'distance_unit' => 'mile',
|
288 |
),
|
289 |
),
|
290 |
+
),
|
291 |
));
|
292 |
|
293 |
/**
|
332 |
'value' => array(
|
333 |
AdCreativeLinkDataCallToActionValueFields::APP_DESTINATION =>
|
334 |
PageCallToActionWebDestinationTypeValues::MESSENGER,
|
335 |
+
),
|
336 |
),
|
337 |
AdCreativeLinkDataFields::LINK => '<YOUR-LINK>',
|
338 |
AdCreativeLinkDataFields::IMAGE_HASH => $image->hash,
|
351 |
array(
|
352 |
AdCreativeFields::NAME => 'Sample Creative',
|
353 |
AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
|
354 |
+
),
|
355 |
);
|
356 |
|
357 |
$ad = $account->createAd(
|
361 |
'adset_id' => $ad_set_id,
|
362 |
'name' => 'My Ad',
|
363 |
'creative' => array('creative_id' => $creative->id),
|
364 |
+
),
|
365 |
);
|
366 |
$ad_id = $ad->id;
|
367 |
return 'Ad ID: '.$ad_id;
|
390 |
$_GET["adaccount"],
|
391 |
$_GET["bmid"],
|
392 |
$_GET["ad_message"],
|
393 |
+
$_GET["page_welcome_message"],
|
394 |
);
|
395 |
else
|
396 |
$value = "Missing argument";
|
vendor/facebook/php-business-sdk/src/FacebookAds/ApiConfig.php
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
*/
|
24 |
namespace FacebookAds;
|
25 |
class ApiConfig {
|
26 |
-
const APIVersion = '
|
27 |
-
const SDKVersion = '
|
28 |
const TYPE_CHECKER_STRICT_MODE = false;
|
29 |
}
|
23 |
*/
|
24 |
namespace FacebookAds;
|
25 |
class ApiConfig {
|
26 |
+
const APIVersion = '8.0';
|
27 |
+
const SDKVersion = '8.0.2';
|
28 |
const TYPE_CHECKER_STRICT_MODE = false;
|
29 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Http/Exception/RequestException.php
CHANGED
@@ -113,6 +113,11 @@ class RequestException extends Exception {
|
|
113 |
if (is_string($array)) {
|
114 |
$array = json_decode($array, true);
|
115 |
}
|
|
|
|
|
|
|
|
|
|
|
116 |
return array_key_exists($key, $array)
|
117 |
? $array[$key]
|
118 |
: $default;
|
113 |
if (is_string($array)) {
|
114 |
$array = json_decode($array, true);
|
115 |
}
|
116 |
+
|
117 |
+
if (is_null($array)) {
|
118 |
+
return null;
|
119 |
+
}
|
120 |
+
|
121 |
return array_key_exists($key, $array)
|
122 |
? $array[$key]
|
123 |
: $default;
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdAccount.php
CHANGED
@@ -31,6 +31,7 @@ use FacebookAds\TypeChecker;
|
|
31 |
use FacebookAds\Object\Fields\AdAccountFields;
|
32 |
use FacebookAds\Object\Values\AdAccountAdRulesHistoryActionValues;
|
33 |
use FacebookAds\Object\Values\AdAccountAdRulesHistoryEvaluationTypeValues;
|
|
|
34 |
use FacebookAds\Object\Values\AdAccountClaimObjectiveValues;
|
35 |
use FacebookAds\Object\Values\AdAccountContentTypeValues;
|
36 |
use FacebookAds\Object\Values\AdAccountCurrencyValues;
|
@@ -45,6 +46,7 @@ use FacebookAds\Object\Values\AdAccountTargetingUnifiedRegulatedCategoriesValues
|
|
45 |
use FacebookAds\Object\Values\AdAccountTargetingUnifiedWhitelistedTypesValues;
|
46 |
use FacebookAds\Object\Values\AdAccountTasksValues;
|
47 |
use FacebookAds\Object\Values\AdActivityCategoryValues;
|
|
|
48 |
use FacebookAds\Object\Values\AdAsyncRequestSetNotificationModeValues;
|
49 |
use FacebookAds\Object\Values\AdCreativeApplinkTreatmentValues;
|
50 |
use FacebookAds\Object\Values\AdCreativeAuthorizationCategoryValues;
|
@@ -56,6 +58,7 @@ use FacebookAds\Object\Values\AdCreativeOperatorValues;
|
|
56 |
use FacebookAds\Object\Values\AdDatePresetValues;
|
57 |
use FacebookAds\Object\Values\AdExecutionOptionsValues;
|
58 |
use FacebookAds\Object\Values\AdOperatorValues;
|
|
|
59 |
use FacebookAds\Object\Values\AdPlacePageSetLocationTypesValues;
|
60 |
use FacebookAds\Object\Values\AdPlacePageSetTargetedAreaTypeValues;
|
61 |
use FacebookAds\Object\Values\AdPreviewAdFormatValues;
|
@@ -100,6 +103,7 @@ use FacebookAds\Object\Values\CampaignExecutionOptionsValues;
|
|
100 |
use FacebookAds\Object\Values\CampaignObjectiveValues;
|
101 |
use FacebookAds\Object\Values\CampaignOperatorValues;
|
102 |
use FacebookAds\Object\Values\CampaignSpecialAdCategoriesValues;
|
|
|
103 |
use FacebookAds\Object\Values\CampaignStatusValues;
|
104 |
use FacebookAds\Object\Values\ContentDeliveryReportPlatformValues;
|
105 |
use FacebookAds\Object\Values\ContentDeliveryReportPositionValues;
|
@@ -157,6 +161,7 @@ class AdAccount extends AbstractCrudObject {
|
|
157 |
'after' => 'string',
|
158 |
'business_id' => 'string',
|
159 |
'category' => 'category_enum',
|
|
|
160 |
'extra_oids' => 'list<string>',
|
161 |
'limit' => 'int',
|
162 |
'oid' => 'string',
|
@@ -166,6 +171,7 @@ class AdAccount extends AbstractCrudObject {
|
|
166 |
);
|
167 |
$enums = array(
|
168 |
'category_enum' => AdActivityCategoryValues::getInstance()->getValues(),
|
|
|
169 |
);
|
170 |
|
171 |
$request = new ApiRequest(
|
@@ -210,12 +216,14 @@ class AdAccount extends AbstractCrudObject {
|
|
210 |
$this->assureId();
|
211 |
|
212 |
$param_types = array(
|
|
|
213 |
'location_types' => 'list<location_types_enum>',
|
214 |
'name' => 'string',
|
215 |
'parent_page' => 'string',
|
216 |
'targeted_area_type' => 'targeted_area_type_enum',
|
217 |
);
|
218 |
$enums = array(
|
|
|
219 |
'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(),
|
220 |
'targeted_area_type_enum' => AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues(),
|
221 |
);
|
@@ -239,12 +247,14 @@ class AdAccount extends AbstractCrudObject {
|
|
239 |
$this->assureId();
|
240 |
|
241 |
$param_types = array(
|
|
|
242 |
'location_types' => 'list<location_types_enum>',
|
243 |
'name' => 'string',
|
244 |
'parent_page' => 'string',
|
245 |
'targeted_area_type' => 'targeted_area_type_enum',
|
246 |
);
|
247 |
$enums = array(
|
|
|
248 |
'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(),
|
249 |
'targeted_area_type_enum' => AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues(),
|
250 |
);
|
@@ -264,38 +274,6 @@ class AdAccount extends AbstractCrudObject {
|
|
264 |
return $pending ? $request : $request->execute();
|
265 |
}
|
266 |
|
267 |
-
public function deleteAdSets(array $fields = array(), array $params = array(), $pending = false) {
|
268 |
-
$this->assureId();
|
269 |
-
|
270 |
-
$param_types = array(
|
271 |
-
'before_date' => 'datetime',
|
272 |
-
'delete_offset' => 'unsigned int',
|
273 |
-
'delete_strategy' => 'delete_strategy_enum',
|
274 |
-
'object_count' => 'int',
|
275 |
-
);
|
276 |
-
$enums = array(
|
277 |
-
'delete_strategy_enum' => array(
|
278 |
-
'DELETE_ANY',
|
279 |
-
'DELETE_ARCHIVED_BEFORE',
|
280 |
-
'DELETE_OLDEST',
|
281 |
-
),
|
282 |
-
);
|
283 |
-
|
284 |
-
$request = new ApiRequest(
|
285 |
-
$this->api,
|
286 |
-
$this->data['id'],
|
287 |
-
RequestInterface::METHOD_DELETE,
|
288 |
-
'/ad_sets',
|
289 |
-
new AbstractCrudObject(),
|
290 |
-
'EDGE',
|
291 |
-
array(),
|
292 |
-
new TypeChecker($param_types, $enums)
|
293 |
-
);
|
294 |
-
$request->addParams($params);
|
295 |
-
$request->addFields($fields);
|
296 |
-
return $pending ? $request : $request->execute();
|
297 |
-
}
|
298 |
-
|
299 |
public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {
|
300 |
$this->assureId();
|
301 |
|
@@ -618,29 +596,6 @@ class AdAccount extends AbstractCrudObject {
|
|
618 |
return $pending ? $request : $request->execute();
|
619 |
}
|
620 |
|
621 |
-
public function getAdReportSchedules(array $fields = array(), array $params = array(), $pending = false) {
|
622 |
-
$this->assureId();
|
623 |
-
|
624 |
-
$param_types = array(
|
625 |
-
);
|
626 |
-
$enums = array(
|
627 |
-
);
|
628 |
-
|
629 |
-
$request = new ApiRequest(
|
630 |
-
$this->api,
|
631 |
-
$this->data['id'],
|
632 |
-
RequestInterface::METHOD_GET,
|
633 |
-
'/adreportschedules',
|
634 |
-
new AbstractCrudObject(),
|
635 |
-
'EDGE',
|
636 |
-
array(),
|
637 |
-
new TypeChecker($param_types, $enums)
|
638 |
-
);
|
639 |
-
$request->addParams($params);
|
640 |
-
$request->addFields($fields);
|
641 |
-
return $pending ? $request : $request->execute();
|
642 |
-
}
|
643 |
-
|
644 |
public function getAdRulesHistory(array $fields = array(), array $params = array(), $pending = false) {
|
645 |
$this->assureId();
|
646 |
|
@@ -799,9 +754,11 @@ class AdAccount extends AbstractCrudObject {
|
|
799 |
|
800 |
$param_types = array(
|
801 |
'page_id' => 'int',
|
|
|
802 |
'show_breakdown_by_actor' => 'bool',
|
803 |
);
|
804 |
$enums = array(
|
|
|
805 |
);
|
806 |
|
807 |
$request = new ApiRequest(
|
@@ -1129,6 +1086,7 @@ class AdAccount extends AbstractCrudObject {
|
|
1129 |
'composer_type' => 'string',
|
1130 |
'container_type' => 'container_type_enum',
|
1131 |
'content_category' => 'content_category_enum',
|
|
|
1132 |
'description' => 'string',
|
1133 |
'embeddable' => 'bool',
|
1134 |
'end_offset' => 'unsigned int',
|
@@ -1182,6 +1140,7 @@ class AdAccount extends AbstractCrudObject {
|
|
1182 |
'upload_session_id' => 'string',
|
1183 |
'upload_setting_properties' => 'string',
|
1184 |
'video_file_chunk' => 'file',
|
|
|
1185 |
'video_start_time_ms' => 'unsigned int',
|
1186 |
'waterfall_id' => 'string',
|
1187 |
);
|
@@ -1660,6 +1619,7 @@ class AdAccount extends AbstractCrudObject {
|
|
1660 |
'promoted_object' => 'Object',
|
1661 |
'source_campaign_id' => 'string',
|
1662 |
'special_ad_categories' => 'list<special_ad_categories_enum>',
|
|
|
1663 |
'spend_cap' => 'unsigned int',
|
1664 |
'status' => 'status_enum',
|
1665 |
'topline_id' => 'string',
|
@@ -1670,6 +1630,7 @@ class AdAccount extends AbstractCrudObject {
|
|
1670 |
'execution_options_enum' => CampaignExecutionOptionsValues::getInstance()->getValues(),
|
1671 |
'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(),
|
1672 |
'special_ad_categories_enum' => CampaignSpecialAdCategoriesValues::getInstance()->getValues(),
|
|
|
1673 |
'status_enum' => CampaignStatusValues::getInstance()->getValues(),
|
1674 |
);
|
1675 |
|
@@ -1745,6 +1706,32 @@ class AdAccount extends AbstractCrudObject {
|
|
1745 |
return $pending ? $request : $request->execute();
|
1746 |
}
|
1747 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1748 |
public function getCustomAudiences(array $fields = array(), array $params = array(), $pending = false) {
|
1749 |
$this->assureId();
|
1750 |
|
31 |
use FacebookAds\Object\Fields\AdAccountFields;
|
32 |
use FacebookAds\Object\Values\AdAccountAdRulesHistoryActionValues;
|
33 |
use FacebookAds\Object\Values\AdAccountAdRulesHistoryEvaluationTypeValues;
|
34 |
+
use FacebookAds\Object\Values\AdAccountAdVolumeRecommendationTypeValues;
|
35 |
use FacebookAds\Object\Values\AdAccountClaimObjectiveValues;
|
36 |
use FacebookAds\Object\Values\AdAccountContentTypeValues;
|
37 |
use FacebookAds\Object\Values\AdAccountCurrencyValues;
|
46 |
use FacebookAds\Object\Values\AdAccountTargetingUnifiedWhitelistedTypesValues;
|
47 |
use FacebookAds\Object\Values\AdAccountTasksValues;
|
48 |
use FacebookAds\Object\Values\AdActivityCategoryValues;
|
49 |
+
use FacebookAds\Object\Values\AdActivityDataSourceValues;
|
50 |
use FacebookAds\Object\Values\AdAsyncRequestSetNotificationModeValues;
|
51 |
use FacebookAds\Object\Values\AdCreativeApplinkTreatmentValues;
|
52 |
use FacebookAds\Object\Values\AdCreativeAuthorizationCategoryValues;
|
58 |
use FacebookAds\Object\Values\AdDatePresetValues;
|
59 |
use FacebookAds\Object\Values\AdExecutionOptionsValues;
|
60 |
use FacebookAds\Object\Values\AdOperatorValues;
|
61 |
+
use FacebookAds\Object\Values\AdPlacePageSetCategoryValues;
|
62 |
use FacebookAds\Object\Values\AdPlacePageSetLocationTypesValues;
|
63 |
use FacebookAds\Object\Values\AdPlacePageSetTargetedAreaTypeValues;
|
64 |
use FacebookAds\Object\Values\AdPreviewAdFormatValues;
|
103 |
use FacebookAds\Object\Values\CampaignObjectiveValues;
|
104 |
use FacebookAds\Object\Values\CampaignOperatorValues;
|
105 |
use FacebookAds\Object\Values\CampaignSpecialAdCategoriesValues;
|
106 |
+
use FacebookAds\Object\Values\CampaignSpecialAdCategoryCountryValues;
|
107 |
use FacebookAds\Object\Values\CampaignStatusValues;
|
108 |
use FacebookAds\Object\Values\ContentDeliveryReportPlatformValues;
|
109 |
use FacebookAds\Object\Values\ContentDeliveryReportPositionValues;
|
161 |
'after' => 'string',
|
162 |
'business_id' => 'string',
|
163 |
'category' => 'category_enum',
|
164 |
+
'data_source' => 'data_source_enum',
|
165 |
'extra_oids' => 'list<string>',
|
166 |
'limit' => 'int',
|
167 |
'oid' => 'string',
|
171 |
);
|
172 |
$enums = array(
|
173 |
'category_enum' => AdActivityCategoryValues::getInstance()->getValues(),
|
174 |
+
'data_source_enum' => AdActivityDataSourceValues::getInstance()->getValues(),
|
175 |
);
|
176 |
|
177 |
$request = new ApiRequest(
|
216 |
$this->assureId();
|
217 |
|
218 |
$param_types = array(
|
219 |
+
'category' => 'category_enum',
|
220 |
'location_types' => 'list<location_types_enum>',
|
221 |
'name' => 'string',
|
222 |
'parent_page' => 'string',
|
223 |
'targeted_area_type' => 'targeted_area_type_enum',
|
224 |
);
|
225 |
$enums = array(
|
226 |
+
'category_enum' => AdPlacePageSetCategoryValues::getInstance()->getValues(),
|
227 |
'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(),
|
228 |
'targeted_area_type_enum' => AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues(),
|
229 |
);
|
247 |
$this->assureId();
|
248 |
|
249 |
$param_types = array(
|
250 |
+
'category' => 'category_enum',
|
251 |
'location_types' => 'list<location_types_enum>',
|
252 |
'name' => 'string',
|
253 |
'parent_page' => 'string',
|
254 |
'targeted_area_type' => 'targeted_area_type_enum',
|
255 |
);
|
256 |
$enums = array(
|
257 |
+
'category_enum' => AdPlacePageSetCategoryValues::getInstance()->getValues(),
|
258 |
'location_types_enum' => AdPlacePageSetLocationTypesValues::getInstance()->getValues(),
|
259 |
'targeted_area_type_enum' => AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues(),
|
260 |
);
|
274 |
return $pending ? $request : $request->execute();
|
275 |
}
|
276 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
public function getAdStudies(array $fields = array(), array $params = array(), $pending = false) {
|
278 |
$this->assureId();
|
279 |
|
596 |
return $pending ? $request : $request->execute();
|
597 |
}
|
598 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
public function getAdRulesHistory(array $fields = array(), array $params = array(), $pending = false) {
|
600 |
$this->assureId();
|
601 |
|
754 |
|
755 |
$param_types = array(
|
756 |
'page_id' => 'int',
|
757 |
+
'recommendation_type' => 'recommendation_type_enum',
|
758 |
'show_breakdown_by_actor' => 'bool',
|
759 |
);
|
760 |
$enums = array(
|
761 |
+
'recommendation_type_enum' => AdAccountAdVolumeRecommendationTypeValues::getInstance()->getValues(),
|
762 |
);
|
763 |
|
764 |
$request = new ApiRequest(
|
1086 |
'composer_type' => 'string',
|
1087 |
'container_type' => 'container_type_enum',
|
1088 |
'content_category' => 'content_category_enum',
|
1089 |
+
'creative_tools' => 'string',
|
1090 |
'description' => 'string',
|
1091 |
'embeddable' => 'bool',
|
1092 |
'end_offset' => 'unsigned int',
|
1140 |
'upload_session_id' => 'string',
|
1141 |
'upload_setting_properties' => 'string',
|
1142 |
'video_file_chunk' => 'file',
|
1143 |
+
'video_id_original' => 'string',
|
1144 |
'video_start_time_ms' => 'unsigned int',
|
1145 |
'waterfall_id' => 'string',
|
1146 |
);
|
1619 |
'promoted_object' => 'Object',
|
1620 |
'source_campaign_id' => 'string',
|
1621 |
'special_ad_categories' => 'list<special_ad_categories_enum>',
|
1622 |
+
'special_ad_category_country' => 'list<special_ad_category_country_enum>',
|
1623 |
'spend_cap' => 'unsigned int',
|
1624 |
'status' => 'status_enum',
|
1625 |
'topline_id' => 'string',
|
1630 |
'execution_options_enum' => CampaignExecutionOptionsValues::getInstance()->getValues(),
|
1631 |
'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(),
|
1632 |
'special_ad_categories_enum' => CampaignSpecialAdCategoriesValues::getInstance()->getValues(),
|
1633 |
+
'special_ad_category_country_enum' => CampaignSpecialAdCategoryCountryValues::getInstance()->getValues(),
|
1634 |
'status_enum' => CampaignStatusValues::getInstance()->getValues(),
|
1635 |
);
|
1636 |
|
1706 |
return $pending ? $request : $request->execute();
|
1707 |
}
|
1708 |
|
1709 |
+
public function createCreateAndApplyPublisherBlockList(array $fields = array(), array $params = array(), $pending = false) {
|
1710 |
+
$this->assureId();
|
1711 |
+
|
1712 |
+
$param_types = array(
|
1713 |
+
'is_auto_blocking_on' => 'bool',
|
1714 |
+
'name' => 'string',
|
1715 |
+
'publisher_urls' => 'list<string>',
|
1716 |
+
);
|
1717 |
+
$enums = array(
|
1718 |
+
);
|
1719 |
+
|
1720 |
+
$request = new ApiRequest(
|
1721 |
+
$this->api,
|
1722 |
+
$this->data['id'],
|
1723 |
+
RequestInterface::METHOD_POST,
|
1724 |
+
'/create_and_apply_publisher_block_list',
|
1725 |
+
new AbstractCrudObject(),
|
1726 |
+
'EDGE',
|
1727 |
+
array(),
|
1728 |
+
new TypeChecker($param_types, $enums)
|
1729 |
+
);
|
1730 |
+
$request->addParams($params);
|
1731 |
+
$request->addFields($fields);
|
1732 |
+
return $pending ? $request : $request->execute();
|
1733 |
+
}
|
1734 |
+
|
1735 |
public function getCustomAudiences(array $fields = array(), array $params = array(), $pending = false) {
|
1736 |
$this->assureId();
|
1737 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdAccountAdVolume.php
CHANGED
@@ -29,6 +29,7 @@ use FacebookAds\Cursor;
|
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\AdAccountAdVolumeFields;
|
|
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -50,6 +51,7 @@ class AdAccountAdVolume extends AbstractObject {
|
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
52 |
$ref_enums = array();
|
|
|
53 |
return $ref_enums;
|
54 |
}
|
55 |
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\AdAccountAdVolumeFields;
|
32 |
+
use FacebookAds\Object\Values\AdAccountAdVolumeRecommendationTypeValues;
|
33 |
|
34 |
/**
|
35 |
* This class is auto-generated.
|
51 |
|
52 |
protected static function getReferencedEnums() {
|
53 |
$ref_enums = array();
|
54 |
+
$ref_enums['RecommendationType'] = AdAccountAdVolumeRecommendationTypeValues::getInstance()->getValues();
|
55 |
return $ref_enums;
|
56 |
}
|
57 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdActivity.php
CHANGED
@@ -30,6 +30,7 @@ use FacebookAds\Http\RequestInterface;
|
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\AdActivityFields;
|
32 |
use FacebookAds\Object\Values\AdActivityCategoryValues;
|
|
|
33 |
use FacebookAds\Object\Values\AdActivityEventTypeValues;
|
34 |
|
35 |
/**
|
@@ -54,6 +55,7 @@ class AdActivity extends AbstractObject {
|
|
54 |
$ref_enums = array();
|
55 |
$ref_enums['EventType'] = AdActivityEventTypeValues::getInstance()->getValues();
|
56 |
$ref_enums['Category'] = AdActivityCategoryValues::getInstance()->getValues();
|
|
|
57 |
return $ref_enums;
|
58 |
}
|
59 |
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\AdActivityFields;
|
32 |
use FacebookAds\Object\Values\AdActivityCategoryValues;
|
33 |
+
use FacebookAds\Object\Values\AdActivityDataSourceValues;
|
34 |
use FacebookAds\Object\Values\AdActivityEventTypeValues;
|
35 |
|
36 |
/**
|
55 |
$ref_enums = array();
|
56 |
$ref_enums['EventType'] = AdActivityEventTypeValues::getInstance()->getValues();
|
57 |
$ref_enums['Category'] = AdActivityCategoryValues::getInstance()->getValues();
|
58 |
+
$ref_enums['DataSource'] = AdActivityDataSourceValues::getInstance()->getValues();
|
59 |
return $ref_enums;
|
60 |
}
|
61 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdCreative.php
CHANGED
@@ -210,6 +210,7 @@ class AdCreative extends AbstractCrudObject {
|
|
210 |
$param_types = array(
|
211 |
'thumbnail_height' => 'unsigned int',
|
212 |
'thumbnail_width' => 'unsigned int',
|
|
|
213 |
);
|
214 |
$enums = array(
|
215 |
);
|
210 |
$param_types = array(
|
211 |
'thumbnail_height' => 'unsigned int',
|
212 |
'thumbnail_width' => 'unsigned int',
|
213 |
+
'with_unified_spec' => 'bool',
|
214 |
);
|
215 |
$enums = array(
|
216 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdCreativeInstagramBrandedContent.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object;
|
26 |
+
|
27 |
+
use FacebookAds\ApiRequest;
|
28 |
+
use FacebookAds\Cursor;
|
29 |
+
use FacebookAds\Http\RequestInterface;
|
30 |
+
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\AdCreativeInstagramBrandedContentFields;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* This class is auto-generated.
|
35 |
+
*
|
36 |
+
* For any issues or feature requests related to this class, please let us know
|
37 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
38 |
+
* pull request for this class.
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
|
42 |
+
class AdCreativeInstagramBrandedContent extends AbstractObject {
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @return AdCreativeInstagramBrandedContentFields
|
46 |
+
*/
|
47 |
+
public static function getFieldsEnum() {
|
48 |
+
return AdCreativeInstagramBrandedContentFields::getInstance();
|
49 |
+
}
|
50 |
+
|
51 |
+
protected static function getReferencedEnums() {
|
52 |
+
$ref_enums = array();
|
53 |
+
return $ref_enums;
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdPlacePageSet.php
CHANGED
@@ -29,6 +29,7 @@ use FacebookAds\Cursor;
|
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\AdPlacePageSetFields;
|
|
|
32 |
use FacebookAds\Object\Values\AdPlacePageSetLocationTypesValues;
|
33 |
use FacebookAds\Object\Values\AdPlacePageSetTargetedAreaTypeValues;
|
34 |
|
@@ -59,6 +60,7 @@ class AdPlacePageSet extends AbstractCrudObject {
|
|
59 |
|
60 |
protected static function getReferencedEnums() {
|
61 |
$ref_enums = array();
|
|
|
62 |
$ref_enums['LocationTypes'] = AdPlacePageSetLocationTypesValues::getInstance()->getValues();
|
63 |
$ref_enums['TargetedAreaType'] = AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues();
|
64 |
return $ref_enums;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\AdPlacePageSetFields;
|
32 |
+
use FacebookAds\Object\Values\AdPlacePageSetCategoryValues;
|
33 |
use FacebookAds\Object\Values\AdPlacePageSetLocationTypesValues;
|
34 |
use FacebookAds\Object\Values\AdPlacePageSetTargetedAreaTypeValues;
|
35 |
|
60 |
|
61 |
protected static function getReferencedEnums() {
|
62 |
$ref_enums = array();
|
63 |
+
$ref_enums['Category'] = AdPlacePageSetCategoryValues::getInstance()->getValues();
|
64 |
$ref_enums['LocationTypes'] = AdPlacePageSetLocationTypesValues::getInstance()->getValues();
|
65 |
$ref_enums['TargetedAreaType'] = AdPlacePageSetTargetedAreaTypeValues::getInstance()->getValues();
|
66 |
return $ref_enums;
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdStudy.php
CHANGED
@@ -121,6 +121,7 @@ class AdStudy extends AbstractCrudObject {
|
|
121 |
'name' => 'string',
|
122 |
'offline_conversion_data_sets' => 'list<Object>',
|
123 |
'offsitepixels' => 'list<Object>',
|
|
|
124 |
'product_sets' => 'list<Object>',
|
125 |
'type' => 'type_enum',
|
126 |
);
|
121 |
'name' => 'string',
|
122 |
'offline_conversion_data_sets' => 'list<Object>',
|
123 |
'offsitepixels' => 'list<Object>',
|
124 |
+
'product_catalogs' => 'list<Object>',
|
125 |
'product_sets' => 'list<Object>',
|
126 |
'type' => 'type_enum',
|
127 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdStudyObjective.php
CHANGED
@@ -282,6 +282,7 @@ class AdStudyObjective extends AbstractCrudObject {
|
|
282 |
'name' => 'string',
|
283 |
'offline_conversion_data_sets' => 'list<Object>',
|
284 |
'offsitepixels' => 'list<Object>',
|
|
|
285 |
'product_sets' => 'list<Object>',
|
286 |
'type' => 'type_enum',
|
287 |
);
|
282 |
'name' => 'string',
|
283 |
'offline_conversion_data_sets' => 'list<Object>',
|
284 |
'offsitepixels' => 'list<Object>',
|
285 |
+
'product_catalogs' => 'list<Object>',
|
286 |
'product_sets' => 'list<Object>',
|
287 |
'type' => 'type_enum',
|
288 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdVideo.php
CHANGED
@@ -38,12 +38,12 @@ use FacebookAds\Object\Values\AdVideoSwapModeValues;
|
|
38 |
use FacebookAds\Object\Values\AdVideoTypeValues;
|
39 |
use FacebookAds\Object\Values\AdVideoUnpublishedContentTypeValues;
|
40 |
use FacebookAds\Object\Values\AdVideoUploadPhaseValues;
|
41 |
-
use FacebookAds\Object\Values\AdVideoValidationAdPlacementsValues;
|
42 |
use FacebookAds\Object\Values\CommentCommentPrivacyValueValues;
|
43 |
use FacebookAds\Object\Values\CommentFilterValues;
|
44 |
use FacebookAds\Object\Values\CommentLiveFilterValues;
|
45 |
use FacebookAds\Object\Values\CommentOrderValues;
|
46 |
use FacebookAds\Object\Values\InsightsResultPeriodValues;
|
|
|
47 |
use FacebookAds\Object\Traits\CannotDelete;
|
48 |
use FacebookAds\Object\Traits\CannotUpdate;
|
49 |
use FacebookAds\Object\Traits\FieldValidation;
|
@@ -82,7 +82,6 @@ class AdVideo extends AbstractCrudObject {
|
|
82 |
$ref_enums['SwapMode'] = AdVideoSwapModeValues::getInstance()->getValues();
|
83 |
$ref_enums['UnpublishedContentType'] = AdVideoUnpublishedContentTypeValues::getInstance()->getValues();
|
84 |
$ref_enums['UploadPhase'] = AdVideoUploadPhaseValues::getInstance()->getValues();
|
85 |
-
$ref_enums['ValidationAdPlacements'] = AdVideoValidationAdPlacementsValues::getInstance()->getValues();
|
86 |
$ref_enums['Type'] = AdVideoTypeValues::getInstance()->getValues();
|
87 |
$ref_enums['BackdatedTimeGranularity'] = AdVideoBackdatedTimeGranularityValues::getInstance()->getValues();
|
88 |
return $ref_enums;
|
@@ -354,6 +353,31 @@ class AdVideo extends AbstractCrudObject {
|
|
354 |
return $pending ? $request : $request->execute();
|
355 |
}
|
356 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {
|
358 |
$this->assureId();
|
359 |
|
38 |
use FacebookAds\Object\Values\AdVideoTypeValues;
|
39 |
use FacebookAds\Object\Values\AdVideoUnpublishedContentTypeValues;
|
40 |
use FacebookAds\Object\Values\AdVideoUploadPhaseValues;
|
|
|
41 |
use FacebookAds\Object\Values\CommentCommentPrivacyValueValues;
|
42 |
use FacebookAds\Object\Values\CommentFilterValues;
|
43 |
use FacebookAds\Object\Values\CommentLiveFilterValues;
|
44 |
use FacebookAds\Object\Values\CommentOrderValues;
|
45 |
use FacebookAds\Object\Values\InsightsResultPeriodValues;
|
46 |
+
use FacebookAds\Object\Values\ProfileTypeValues;
|
47 |
use FacebookAds\Object\Traits\CannotDelete;
|
48 |
use FacebookAds\Object\Traits\CannotUpdate;
|
49 |
use FacebookAds\Object\Traits\FieldValidation;
|
82 |
$ref_enums['SwapMode'] = AdVideoSwapModeValues::getInstance()->getValues();
|
83 |
$ref_enums['UnpublishedContentType'] = AdVideoUnpublishedContentTypeValues::getInstance()->getValues();
|
84 |
$ref_enums['UploadPhase'] = AdVideoUploadPhaseValues::getInstance()->getValues();
|
|
|
85 |
$ref_enums['Type'] = AdVideoTypeValues::getInstance()->getValues();
|
86 |
$ref_enums['BackdatedTimeGranularity'] = AdVideoBackdatedTimeGranularityValues::getInstance()->getValues();
|
87 |
return $ref_enums;
|
353 |
return $pending ? $request : $request->execute();
|
354 |
}
|
355 |
|
356 |
+
public function getReactions(array $fields = array(), array $params = array(), $pending = false) {
|
357 |
+
$this->assureId();
|
358 |
+
|
359 |
+
$param_types = array(
|
360 |
+
'type' => 'type_enum',
|
361 |
+
);
|
362 |
+
$enums = array(
|
363 |
+
'type_enum' => ProfileTypeValues::getInstance()->getValues(),
|
364 |
+
);
|
365 |
+
|
366 |
+
$request = new ApiRequest(
|
367 |
+
$this->api,
|
368 |
+
$this->data['id'],
|
369 |
+
RequestInterface::METHOD_GET,
|
370 |
+
'/reactions',
|
371 |
+
new Profile(),
|
372 |
+
'EDGE',
|
373 |
+
Profile::getFieldsEnum()->getValues(),
|
374 |
+
new TypeChecker($param_types, $enums)
|
375 |
+
);
|
376 |
+
$request->addParams($params);
|
377 |
+
$request->addFields($fields);
|
378 |
+
return $pending ? $request : $request->execute();
|
379 |
+
}
|
380 |
+
|
381 |
public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {
|
382 |
$this->assureId();
|
383 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{AdsInterest.php → AdoptablePet.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\AdsInterestFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
@@ -67,9 +67,9 @@ class AdsInterest extends AbstractCrudObject {
|
|
67 |
$this->data['id'],
|
68 |
RequestInterface::METHOD_GET,
|
69 |
'/',
|
70 |
-
new
|
71 |
'NODE',
|
72 |
-
|
73 |
new TypeChecker($param_types, $enums)
|
74 |
);
|
75 |
$request->addParams($params);
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\AdoptablePetFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class AdoptablePet extends AbstractCrudObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return AdoptablePetFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return AdoptablePetFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
67 |
$this->data['id'],
|
68 |
RequestInterface::METHOD_GET,
|
69 |
'/',
|
70 |
+
new AdoptablePet(),
|
71 |
'NODE',
|
72 |
+
AdoptablePet::getFieldsEnum()->getValues(),
|
73 |
new TypeChecker($param_types, $enums)
|
74 |
);
|
75 |
$request->addParams($params);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdsPixel.php
CHANGED
@@ -35,6 +35,7 @@ use FacebookAds\Object\Values\AdsPixelFirstPartyCookieStatusValues;
|
|
35 |
use FacebookAds\Object\Values\AdsPixelSortByValues;
|
36 |
use FacebookAds\Object\Values\AdsPixelStatsResultAggregationValues;
|
37 |
use FacebookAds\Object\Values\AdsPixelTasksValues;
|
|
|
38 |
|
39 |
/**
|
40 |
* This class is auto-generated.
|
@@ -127,8 +128,10 @@ class AdsPixel extends AbstractCrudObject {
|
|
127 |
|
128 |
$param_types = array(
|
129 |
'checks' => 'list<string>',
|
|
|
130 |
);
|
131 |
$enums = array(
|
|
|
132 |
);
|
133 |
|
134 |
$request = new ApiRequest(
|
35 |
use FacebookAds\Object\Values\AdsPixelSortByValues;
|
36 |
use FacebookAds\Object\Values\AdsPixelStatsResultAggregationValues;
|
37 |
use FacebookAds\Object\Values\AdsPixelTasksValues;
|
38 |
+
use FacebookAds\Object\Values\DACheckConnectionMethodValues;
|
39 |
|
40 |
/**
|
41 |
* This class is auto-generated.
|
128 |
|
129 |
$param_types = array(
|
130 |
'checks' => 'list<string>',
|
131 |
+
'connection_method' => 'connection_method_enum',
|
132 |
);
|
133 |
$enums = array(
|
134 |
+
'connection_method_enum' => DACheckConnectionMethodValues::getInstance()->getValues(),
|
135 |
);
|
136 |
|
137 |
$request = new ApiRequest(
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Application.php
CHANGED
@@ -44,7 +44,9 @@ use FacebookAds\Object\Values\ApplicationRequestTypeValues;
|
|
44 |
use FacebookAds\Object\Values\ApplicationScoreTypeValues;
|
45 |
use FacebookAds\Object\Values\ApplicationSortOrderValues;
|
46 |
use FacebookAds\Object\Values\ApplicationSupportedPlatformsValues;
|
|
|
47 |
use FacebookAds\Object\Values\EventTypeValues;
|
|
|
48 |
|
49 |
/**
|
50 |
* This class is auto-generated.
|
@@ -182,15 +184,20 @@ class Application extends AbstractCrudObject {
|
|
182 |
'bundle_id' => 'string',
|
183 |
'bundle_short_version' => 'string',
|
184 |
'bundle_version' => 'string',
|
|
|
185 |
'consider_views' => 'bool',
|
186 |
'custom_events' => 'list<Object>',
|
187 |
'custom_events_file' => 'file',
|
|
|
|
|
|
|
188 |
'device_token' => 'string',
|
189 |
'event' => 'event_enum',
|
190 |
'extinfo' => 'Object',
|
191 |
'include_dwell_data' => 'bool',
|
192 |
'include_video_data' => 'bool',
|
193 |
'install_referrer' => 'string',
|
|
|
194 |
'installer_package' => 'string',
|
195 |
'limited_data_use' => 'bool',
|
196 |
'migration_bundle' => 'string',
|
@@ -350,6 +357,55 @@ class Application extends AbstractCrudObject {
|
|
350 |
return $pending ? $request : $request->execute();
|
351 |
}
|
352 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
public function getAppEventTypes(array $fields = array(), array $params = array(), $pending = false) {
|
354 |
$this->assureId();
|
355 |
|
@@ -748,8 +804,10 @@ class Application extends AbstractCrudObject {
|
|
748 |
|
749 |
$param_types = array(
|
750 |
'checks' => 'list<string>',
|
|
|
751 |
);
|
752 |
$enums = array(
|
|
|
753 |
);
|
754 |
|
755 |
$request = new ApiRequest(
|
@@ -1000,6 +1058,31 @@ class Application extends AbstractCrudObject {
|
|
1000 |
return $pending ? $request : $request->execute();
|
1001 |
}
|
1002 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1003 |
public function createMmpAuditing(array $fields = array(), array $params = array(), $pending = false) {
|
1004 |
$this->assureId();
|
1005 |
|
@@ -1043,6 +1126,7 @@ class Application extends AbstractCrudObject {
|
|
1043 |
$param_types = array(
|
1044 |
'device_id' => 'string',
|
1045 |
'extinfo' => 'Object',
|
|
|
1046 |
'platform' => 'platform_enum',
|
1047 |
'sdk_version' => 'string',
|
1048 |
);
|
@@ -1533,7 +1617,6 @@ class Application extends AbstractCrudObject {
|
|
1533 |
$param_types = array(
|
1534 |
'an_platforms' => 'list<an_platforms_enum>',
|
1535 |
'android_class_name' => 'string',
|
1536 |
-
'android_key_hash' => 'list<string>',
|
1537 |
'android_key_hashes' => 'list<string>',
|
1538 |
'android_package_name' => 'string',
|
1539 |
'android_sso' => 'bool',
|
@@ -1551,12 +1634,9 @@ class Application extends AbstractCrudObject {
|
|
1551 |
'canvas_fluid_height' => 'bool',
|
1552 |
'canvas_fluid_width' => 'bool',
|
1553 |
'canvas_url' => 'string',
|
1554 |
-
'configured_ios_sso' => 'bool',
|
1555 |
'contact_email' => 'string',
|
1556 |
'deauth_callback_url' => 'string',
|
1557 |
'ios_bundle_id' => 'list<string>',
|
1558 |
-
'ipad_app_store_id' => 'string',
|
1559 |
-
'iphone_app_store_id' => 'string',
|
1560 |
'mobile_web_url' => 'string',
|
1561 |
'namespace' => 'string',
|
1562 |
'page_tab_default_name' => 'string',
|
44 |
use FacebookAds\Object\Values\ApplicationScoreTypeValues;
|
45 |
use FacebookAds\Object\Values\ApplicationSortOrderValues;
|
46 |
use FacebookAds\Object\Values\ApplicationSupportedPlatformsValues;
|
47 |
+
use FacebookAds\Object\Values\DACheckConnectionMethodValues;
|
48 |
use FacebookAds\Object\Values\EventTypeValues;
|
49 |
+
use FacebookAds\Object\Values\LiveVideoBroadcastStatusValues;
|
50 |
|
51 |
/**
|
52 |
* This class is auto-generated.
|
184 |
'bundle_id' => 'string',
|
185 |
'bundle_short_version' => 'string',
|
186 |
'bundle_version' => 'string',
|
187 |
+
'click_id' => 'string',
|
188 |
'consider_views' => 'bool',
|
189 |
'custom_events' => 'list<Object>',
|
190 |
'custom_events_file' => 'file',
|
191 |
+
'data_processing_options' => 'list<string>',
|
192 |
+
'data_processing_options_country' => 'unsigned int',
|
193 |
+
'data_processing_options_state' => 'unsigned int',
|
194 |
'device_token' => 'string',
|
195 |
'event' => 'event_enum',
|
196 |
'extinfo' => 'Object',
|
197 |
'include_dwell_data' => 'bool',
|
198 |
'include_video_data' => 'bool',
|
199 |
'install_referrer' => 'string',
|
200 |
+
'install_timestamp' => 'unsigned int',
|
201 |
'installer_package' => 'string',
|
202 |
'limited_data_use' => 'bool',
|
203 |
'migration_bundle' => 'string',
|
357 |
return $pending ? $request : $request->execute();
|
358 |
}
|
359 |
|
360 |
+
public function createAggregateRevenue(array $fields = array(), array $params = array(), $pending = false) {
|
361 |
+
$this->assureId();
|
362 |
+
|
363 |
+
$param_types = array(
|
364 |
+
'ecpms' => 'list<string>',
|
365 |
+
'query_ids' => 'list<string>',
|
366 |
+
'request_id' => 'string',
|
367 |
+
);
|
368 |
+
$enums = array(
|
369 |
+
);
|
370 |
+
|
371 |
+
$request = new ApiRequest(
|
372 |
+
$this->api,
|
373 |
+
$this->data['id'],
|
374 |
+
RequestInterface::METHOD_POST,
|
375 |
+
'/aggregate_revenue',
|
376 |
+
new AbstractCrudObject(),
|
377 |
+
'EDGE',
|
378 |
+
array(),
|
379 |
+
new TypeChecker($param_types, $enums)
|
380 |
+
);
|
381 |
+
$request->addParams($params);
|
382 |
+
$request->addFields($fields);
|
383 |
+
return $pending ? $request : $request->execute();
|
384 |
+
}
|
385 |
+
|
386 |
+
public function getAndroidDialogConfigs(array $fields = array(), array $params = array(), $pending = false) {
|
387 |
+
$this->assureId();
|
388 |
+
|
389 |
+
$param_types = array(
|
390 |
+
);
|
391 |
+
$enums = array(
|
392 |
+
);
|
393 |
+
|
394 |
+
$request = new ApiRequest(
|
395 |
+
$this->api,
|
396 |
+
$this->data['id'],
|
397 |
+
RequestInterface::METHOD_GET,
|
398 |
+
'/android_dialog_configs',
|
399 |
+
new AbstractCrudObject(),
|
400 |
+
'EDGE',
|
401 |
+
array(),
|
402 |
+
new TypeChecker($param_types, $enums)
|
403 |
+
);
|
404 |
+
$request->addParams($params);
|
405 |
+
$request->addFields($fields);
|
406 |
+
return $pending ? $request : $request->execute();
|
407 |
+
}
|
408 |
+
|
409 |
public function getAppEventTypes(array $fields = array(), array $params = array(), $pending = false) {
|
410 |
$this->assureId();
|
411 |
|
804 |
|
805 |
$param_types = array(
|
806 |
'checks' => 'list<string>',
|
807 |
+
'connection_method' => 'connection_method_enum',
|
808 |
);
|
809 |
$enums = array(
|
810 |
+
'connection_method_enum' => DACheckConnectionMethodValues::getInstance()->getValues(),
|
811 |
);
|
812 |
|
813 |
$request = new ApiRequest(
|
1058 |
return $pending ? $request : $request->execute();
|
1059 |
}
|
1060 |
|
1061 |
+
public function getLiveVideos(array $fields = array(), array $params = array(), $pending = false) {
|
1062 |
+
$this->assureId();
|
1063 |
+
|
1064 |
+
$param_types = array(
|
1065 |
+
'broadcast_status' => 'broadcast_status_enum',
|
1066 |
+
);
|
1067 |
+
$enums = array(
|
1068 |
+
'broadcast_status_enum' => LiveVideoBroadcastStatusValues::getInstance()->getValues(),
|
1069 |
+
);
|
1070 |
+
|
1071 |
+
$request = new ApiRequest(
|
1072 |
+
$this->api,
|
1073 |
+
$this->data['id'],
|
1074 |
+
RequestInterface::METHOD_GET,
|
1075 |
+
'/live_videos',
|
1076 |
+
new LiveVideo(),
|
1077 |
+
'EDGE',
|
1078 |
+
LiveVideo::getFieldsEnum()->getValues(),
|
1079 |
+
new TypeChecker($param_types, $enums)
|
1080 |
+
);
|
1081 |
+
$request->addParams($params);
|
1082 |
+
$request->addFields($fields);
|
1083 |
+
return $pending ? $request : $request->execute();
|
1084 |
+
}
|
1085 |
+
|
1086 |
public function createMmpAuditing(array $fields = array(), array $params = array(), $pending = false) {
|
1087 |
$this->assureId();
|
1088 |
|
1126 |
$param_types = array(
|
1127 |
'device_id' => 'string',
|
1128 |
'extinfo' => 'Object',
|
1129 |
+
'os_version' => 'string',
|
1130 |
'platform' => 'platform_enum',
|
1131 |
'sdk_version' => 'string',
|
1132 |
);
|
1617 |
$param_types = array(
|
1618 |
'an_platforms' => 'list<an_platforms_enum>',
|
1619 |
'android_class_name' => 'string',
|
|
|
1620 |
'android_key_hashes' => 'list<string>',
|
1621 |
'android_package_name' => 'string',
|
1622 |
'android_sso' => 'bool',
|
1634 |
'canvas_fluid_height' => 'bool',
|
1635 |
'canvas_fluid_width' => 'bool',
|
1636 |
'canvas_url' => 'string',
|
|
|
1637 |
'contact_email' => 'string',
|
1638 |
'deauth_callback_url' => 'string',
|
1639 |
'ios_bundle_id' => 'list<string>',
|
|
|
|
|
1640 |
'mobile_web_url' => 'string',
|
1641 |
'namespace' => 'string',
|
1642 |
'page_tab_default_name' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/AtlasCampaign.php
CHANGED
@@ -110,10 +110,13 @@ class AtlasCampaign extends AbstractCrudObject {
|
|
110 |
'dimensions' => 'list<dimensions_enum>',
|
111 |
'granularity' => 'granularity_enum',
|
112 |
'metric_scope' => 'map',
|
113 |
-
'order_by' => 'list',
|
114 |
);
|
115 |
$enums = array(
|
116 |
'dimensions_enum' => array(
|
|
|
|
|
|
|
117 |
'DEVICE_TYPE',
|
118 |
'SOURCE_CHANNEL',
|
119 |
),
|
@@ -121,7 +124,7 @@ class AtlasCampaign extends AbstractCrudObject {
|
|
121 |
'DAY',
|
122 |
'HOUR',
|
123 |
'MONTH',
|
124 |
-
'
|
125 |
'YEAR',
|
126 |
),
|
127 |
);
|
110 |
'dimensions' => 'list<dimensions_enum>',
|
111 |
'granularity' => 'granularity_enum',
|
112 |
'metric_scope' => 'map',
|
113 |
+
'order_by' => 'list<map>',
|
114 |
);
|
115 |
$enums = array(
|
116 |
'dimensions_enum' => array(
|
117 |
+
'AD_ID',
|
118 |
+
'AD_SET_ID',
|
119 |
+
'CAMPAIGN_ID',
|
120 |
'DEVICE_TYPE',
|
121 |
'SOURCE_CHANNEL',
|
122 |
),
|
124 |
'DAY',
|
125 |
'HOUR',
|
126 |
'MONTH',
|
127 |
+
'WEEK_SUNDAY',
|
128 |
'YEAR',
|
129 |
),
|
130 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Business.php
CHANGED
@@ -35,25 +35,16 @@ use FacebookAds\Object\Values\AdNetworkAnalyticsSyncQueryResultMetricsValues;
|
|
35 |
use FacebookAds\Object\Values\AdNetworkAnalyticsSyncQueryResultOrderingColumnValues;
|
36 |
use FacebookAds\Object\Values\AdNetworkAnalyticsSyncQueryResultOrderingTypeValues;
|
37 |
use FacebookAds\Object\Values\AdStudyTypeValues;
|
38 |
-
use FacebookAds\Object\Values\AdVideoContainerTypeValues;
|
39 |
-
use FacebookAds\Object\Values\AdVideoContentCategoryValues;
|
40 |
-
use FacebookAds\Object\Values\AdVideoFormattingValues;
|
41 |
-
use FacebookAds\Object\Values\AdVideoOriginalProjectionTypeValues;
|
42 |
-
use FacebookAds\Object\Values\AdVideoSwapModeValues;
|
43 |
-
use FacebookAds\Object\Values\AdVideoUnpublishedContentTypeValues;
|
44 |
-
use FacebookAds\Object\Values\AdVideoUploadPhaseValues;
|
45 |
-
use FacebookAds\Object\Values\AdVideoValidationAdPlacementsValues;
|
46 |
use FacebookAds\Object\Values\AdsPixelSortByValues;
|
47 |
use FacebookAds\Object\Values\BusinessAgreementRequestStatusValues;
|
48 |
use FacebookAds\Object\Values\BusinessAssetSharingAgreementRequestStatusValues;
|
49 |
-
use FacebookAds\Object\Values\BusinessCreativeFolderSharingAgreementRequestStatusValues;
|
50 |
-
use FacebookAds\Object\Values\BusinessImageValidationAdPlacementsValues;
|
51 |
use FacebookAds\Object\Values\BusinessPagePermittedTasksValues;
|
52 |
use FacebookAds\Object\Values\BusinessPermittedTasksValues;
|
53 |
use FacebookAds\Object\Values\BusinessSurveyBusinessTypeValues;
|
54 |
use FacebookAds\Object\Values\BusinessTwoFactorTypeValues;
|
55 |
use FacebookAds\Object\Values\BusinessUserRoleValues;
|
56 |
use FacebookAds\Object\Values\BusinessVerticalValues;
|
|
|
57 |
use FacebookAds\Object\Values\ContentDeliveryReportPlatformValues;
|
58 |
use FacebookAds\Object\Values\ContentDeliveryReportPositionValues;
|
59 |
use FacebookAds\Object\Values\CustomConversionCustomEventTypeValues;
|
@@ -64,6 +55,7 @@ use FacebookAds\Object\Values\MeasurementUploadEventMatchUniverseValues;
|
|
64 |
use FacebookAds\Object\Values\MeasurementUploadEventTimezoneValues;
|
65 |
use FacebookAds\Object\Values\OracleTransactionTypeValues;
|
66 |
use FacebookAds\Object\Values\ProductCatalogVerticalValues;
|
|
|
67 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
68 |
use FacebookAds\Object\Values\SystemUserRoleValues;
|
69 |
|
@@ -101,6 +93,7 @@ class Business extends AbstractCrudObject {
|
|
101 |
|
102 |
$param_types = array(
|
103 |
'app_id' => 'string',
|
|
|
104 |
'scope' => 'list<Permission>',
|
105 |
'system_user_name' => 'string',
|
106 |
);
|
@@ -413,10 +406,13 @@ class Business extends AbstractCrudObject {
|
|
413 |
return $pending ? $request : $request->execute();
|
414 |
}
|
415 |
|
416 |
-
public function
|
417 |
$this->assureId();
|
418 |
|
419 |
$param_types = array(
|
|
|
|
|
|
|
420 |
);
|
421 |
$enums = array(
|
422 |
);
|
@@ -424,11 +420,11 @@ class Business extends AbstractCrudObject {
|
|
424 |
$request = new ApiRequest(
|
425 |
$this->api,
|
426 |
$this->data['id'],
|
427 |
-
RequestInterface::
|
428 |
-
'/
|
429 |
-
new
|
430 |
'EDGE',
|
431 |
-
|
432 |
new TypeChecker($param_types, $enums)
|
433 |
);
|
434 |
$request->addParams($params);
|
@@ -436,25 +432,22 @@ class Business extends AbstractCrudObject {
|
|
436 |
return $pending ? $request : $request->execute();
|
437 |
}
|
438 |
|
439 |
-
public function
|
440 |
$this->assureId();
|
441 |
|
442 |
$param_types = array(
|
443 |
-
'request_status' => 'request_status_enum',
|
444 |
-
'requesting_business_id' => 'string',
|
445 |
);
|
446 |
$enums = array(
|
447 |
-
'request_status_enum' => BusinessCreativeFolderSharingAgreementRequestStatusValues::getInstance()->getValues(),
|
448 |
);
|
449 |
|
450 |
$request = new ApiRequest(
|
451 |
$this->api,
|
452 |
$this->data['id'],
|
453 |
RequestInterface::METHOD_GET,
|
454 |
-
'/
|
455 |
-
new
|
456 |
'EDGE',
|
457 |
-
|
458 |
new TypeChecker($param_types, $enums)
|
459 |
);
|
460 |
$request->addParams($params);
|
@@ -851,6 +844,29 @@ class Business extends AbstractCrudObject {
|
|
851 |
return $pending ? $request : $request->execute();
|
852 |
}
|
853 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
854 |
public function deleteClients(array $fields = array(), array $params = array(), $pending = false) {
|
855 |
$this->assureId();
|
856 |
|
@@ -898,10 +914,11 @@ class Business extends AbstractCrudObject {
|
|
898 |
return $pending ? $request : $request->execute();
|
899 |
}
|
900 |
|
901 |
-
public function
|
902 |
$this->assureId();
|
903 |
|
904 |
$param_types = array(
|
|
|
905 |
);
|
906 |
$enums = array(
|
907 |
);
|
@@ -910,10 +927,10 @@ class Business extends AbstractCrudObject {
|
|
910 |
$this->api,
|
911 |
$this->data['id'],
|
912 |
RequestInterface::METHOD_GET,
|
913 |
-
'/
|
914 |
-
new
|
915 |
'EDGE',
|
916 |
-
|
917 |
new TypeChecker($param_types, $enums)
|
918 |
);
|
919 |
$request->addParams($params);
|
@@ -921,30 +938,31 @@ class Business extends AbstractCrudObject {
|
|
921 |
return $pending ? $request : $request->execute();
|
922 |
}
|
923 |
|
924 |
-
public function
|
925 |
$this->assureId();
|
926 |
|
927 |
$param_types = array(
|
928 |
-
'
|
929 |
-
'
|
930 |
-
'
|
931 |
-
'
|
932 |
-
'
|
933 |
-
'
|
|
|
|
|
934 |
);
|
935 |
$enums = array(
|
936 |
-
'
|
937 |
-
'position_enum' => ContentDeliveryReportPositionValues::getInstance()->getValues(),
|
938 |
);
|
939 |
|
940 |
$request = new ApiRequest(
|
941 |
$this->api,
|
942 |
$this->data['id'],
|
943 |
-
RequestInterface::
|
944 |
-
'/
|
945 |
-
new
|
946 |
'EDGE',
|
947 |
-
|
948 |
new TypeChecker($param_types, $enums)
|
949 |
);
|
950 |
$request->addParams($params);
|
@@ -952,7 +970,7 @@ class Business extends AbstractCrudObject {
|
|
952 |
return $pending ? $request : $request->execute();
|
953 |
}
|
954 |
|
955 |
-
public function
|
956 |
$this->assureId();
|
957 |
|
958 |
$param_types = array(
|
@@ -964,10 +982,10 @@ class Business extends AbstractCrudObject {
|
|
964 |
$this->api,
|
965 |
$this->data['id'],
|
966 |
RequestInterface::METHOD_GET,
|
967 |
-
'/
|
968 |
-
new
|
969 |
'EDGE',
|
970 |
-
|
971 |
new TypeChecker($param_types, $enums)
|
972 |
);
|
973 |
$request->addParams($params);
|
@@ -975,7 +993,7 @@ class Business extends AbstractCrudObject {
|
|
975 |
return $pending ? $request : $request->execute();
|
976 |
}
|
977 |
|
978 |
-
public function
|
979 |
$this->assureId();
|
980 |
|
981 |
$param_types = array(
|
@@ -987,10 +1005,10 @@ class Business extends AbstractCrudObject {
|
|
987 |
$this->api,
|
988 |
$this->data['id'],
|
989 |
RequestInterface::METHOD_GET,
|
990 |
-
'/
|
991 |
-
new
|
992 |
'EDGE',
|
993 |
-
|
994 |
new TypeChecker($param_types, $enums)
|
995 |
);
|
996 |
$request->addParams($params);
|
@@ -998,25 +1016,30 @@ class Business extends AbstractCrudObject {
|
|
998 |
return $pending ? $request : $request->execute();
|
999 |
}
|
1000 |
|
1001 |
-
public function
|
1002 |
$this->assureId();
|
1003 |
|
1004 |
$param_types = array(
|
1005 |
-
'
|
1006 |
-
'
|
1007 |
-
'
|
|
|
|
|
|
|
1008 |
);
|
1009 |
$enums = array(
|
|
|
|
|
1010 |
);
|
1011 |
|
1012 |
$request = new ApiRequest(
|
1013 |
$this->api,
|
1014 |
$this->data['id'],
|
1015 |
-
RequestInterface::
|
1016 |
-
'/
|
1017 |
-
new
|
1018 |
'EDGE',
|
1019 |
-
|
1020 |
new TypeChecker($param_types, $enums)
|
1021 |
);
|
1022 |
$request->addParams($params);
|
@@ -1024,11 +1047,13 @@ class Business extends AbstractCrudObject {
|
|
1024 |
return $pending ? $request : $request->execute();
|
1025 |
}
|
1026 |
|
1027 |
-
public function
|
1028 |
$this->assureId();
|
1029 |
|
1030 |
$param_types = array(
|
1031 |
-
'
|
|
|
|
|
1032 |
);
|
1033 |
$enums = array(
|
1034 |
);
|
@@ -1036,11 +1061,11 @@ class Business extends AbstractCrudObject {
|
|
1036 |
$request = new ApiRequest(
|
1037 |
$this->api,
|
1038 |
$this->data['id'],
|
1039 |
-
RequestInterface::
|
1040 |
-
'/
|
1041 |
-
new
|
1042 |
'EDGE',
|
1043 |
-
|
1044 |
new TypeChecker($param_types, $enums)
|
1045 |
);
|
1046 |
$request->addParams($params);
|
@@ -1151,35 +1176,6 @@ class Business extends AbstractCrudObject {
|
|
1151 |
return $pending ? $request : $request->execute();
|
1152 |
}
|
1153 |
|
1154 |
-
public function createImage(array $fields = array(), array $params = array(), $pending = false) {
|
1155 |
-
$this->assureId();
|
1156 |
-
|
1157 |
-
$param_types = array(
|
1158 |
-
'ad_placements_validation_only' => 'bool',
|
1159 |
-
'bytes' => 'Object',
|
1160 |
-
'creative_folder_id' => 'string',
|
1161 |
-
'name' => 'string',
|
1162 |
-
'validation_ad_placements' => 'list<validation_ad_placements_enum>',
|
1163 |
-
);
|
1164 |
-
$enums = array(
|
1165 |
-
'validation_ad_placements_enum' => BusinessImageValidationAdPlacementsValues::getInstance()->getValues(),
|
1166 |
-
);
|
1167 |
-
|
1168 |
-
$request = new ApiRequest(
|
1169 |
-
$this->api,
|
1170 |
-
$this->data['id'],
|
1171 |
-
RequestInterface::METHOD_POST,
|
1172 |
-
'/images',
|
1173 |
-
new BusinessImage(),
|
1174 |
-
'EDGE',
|
1175 |
-
BusinessImage::getFieldsEnum()->getValues(),
|
1176 |
-
new TypeChecker($param_types, $enums)
|
1177 |
-
);
|
1178 |
-
$request->addParams($params);
|
1179 |
-
$request->addFields($fields);
|
1180 |
-
return $pending ? $request : $request->execute();
|
1181 |
-
}
|
1182 |
-
|
1183 |
public function getInitiatedAudienceSharingRequests(array $fields = array(), array $params = array(), $pending = false) {
|
1184 |
$this->assureId();
|
1185 |
|
@@ -1307,6 +1303,7 @@ class Business extends AbstractCrudObject {
|
|
1307 |
$this->assureId();
|
1308 |
|
1309 |
$param_types = array(
|
|
|
1310 |
'existing_client_business_id' => 'string',
|
1311 |
'name' => 'string',
|
1312 |
'sales_rep_email' => 'string',
|
@@ -1534,6 +1531,7 @@ class Business extends AbstractCrudObject {
|
|
1534 |
$this->assureId();
|
1535 |
|
1536 |
$param_types = array(
|
|
|
1537 |
'client_user_id' => 'int',
|
1538 |
);
|
1539 |
$enums = array(
|
@@ -1558,6 +1556,7 @@ class Business extends AbstractCrudObject {
|
|
1558 |
$this->assureId();
|
1559 |
|
1560 |
$param_types = array(
|
|
|
1561 |
'name' => 'string',
|
1562 |
'page_permitted_tasks' => 'list<page_permitted_tasks_enum>',
|
1563 |
'sales_rep_email' => 'string',
|
@@ -1710,12 +1709,15 @@ class Business extends AbstractCrudObject {
|
|
1710 |
$this->assureId();
|
1711 |
|
1712 |
$param_types = array(
|
|
|
|
|
1713 |
'commerce_merchant_settings' => 'Object',
|
1714 |
'da_display_settings' => 'Object',
|
1715 |
'destination_catalog_settings' => 'map',
|
1716 |
'flight_catalog_settings' => 'map',
|
1717 |
'name' => 'string',
|
1718 |
'onsite_commerce_merchant' => 'Object',
|
|
|
1719 |
'store_catalog_settings' => 'map',
|
1720 |
'vertical' => 'vertical_enum',
|
1721 |
);
|
@@ -1877,29 +1879,6 @@ class Business extends AbstractCrudObject {
|
|
1877 |
return $pending ? $request : $request->execute();
|
1878 |
}
|
1879 |
|
1880 |
-
public function getPendingSharedCreativeFolders(array $fields = array(), array $params = array(), $pending = false) {
|
1881 |
-
$this->assureId();
|
1882 |
-
|
1883 |
-
$param_types = array(
|
1884 |
-
);
|
1885 |
-
$enums = array(
|
1886 |
-
);
|
1887 |
-
|
1888 |
-
$request = new ApiRequest(
|
1889 |
-
$this->api,
|
1890 |
-
$this->data['id'],
|
1891 |
-
RequestInterface::METHOD_GET,
|
1892 |
-
'/pending_shared_creative_folders',
|
1893 |
-
new BusinessCreativeFolder(),
|
1894 |
-
'EDGE',
|
1895 |
-
BusinessCreativeFolder::getFieldsEnum()->getValues(),
|
1896 |
-
new TypeChecker($param_types, $enums)
|
1897 |
-
);
|
1898 |
-
$request->addParams($params);
|
1899 |
-
$request->addFields($fields);
|
1900 |
-
return $pending ? $request : $request->execute();
|
1901 |
-
}
|
1902 |
-
|
1903 |
public function getPendingUsers(array $fields = array(), array $params = array(), $pending = false) {
|
1904 |
$this->assureId();
|
1905 |
|
@@ -1928,12 +1907,14 @@ class Business extends AbstractCrudObject {
|
|
1928 |
$this->assureId();
|
1929 |
|
1930 |
$param_types = array(
|
|
|
1931 |
'height' => 'int',
|
1932 |
'redirect' => 'bool',
|
1933 |
'type' => 'type_enum',
|
1934 |
'width' => 'int',
|
1935 |
);
|
1936 |
$enums = array(
|
|
|
1937 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
1938 |
);
|
1939 |
|
@@ -2136,110 +2117,6 @@ class Business extends AbstractCrudObject {
|
|
2136 |
return $pending ? $request : $request->execute();
|
2137 |
}
|
2138 |
|
2139 |
-
public function createVideo(array $fields = array(), array $params = array(), $pending = false) {
|
2140 |
-
$this->assureId();
|
2141 |
-
|
2142 |
-
$param_types = array(
|
2143 |
-
'ad_placements_validation_only' => 'bool',
|
2144 |
-
'adaptive_type' => 'string',
|
2145 |
-
'animated_effect_id' => 'unsigned int',
|
2146 |
-
'application_id' => 'string',
|
2147 |
-
'asked_fun_fact_prompt_id' => 'unsigned int',
|
2148 |
-
'attribution_app_id' => 'string',
|
2149 |
-
'audio_story_wave_animation_handle' => 'string',
|
2150 |
-
'chunk_session_id' => 'string',
|
2151 |
-
'composer_entry_picker' => 'string',
|
2152 |
-
'composer_entry_point' => 'string',
|
2153 |
-
'composer_entry_time' => 'unsigned int',
|
2154 |
-
'composer_session_events_log' => 'string',
|
2155 |
-
'composer_session_id' => 'string',
|
2156 |
-
'composer_source_surface' => 'string',
|
2157 |
-
'composer_type' => 'string',
|
2158 |
-
'container_type' => 'container_type_enum',
|
2159 |
-
'content_category' => 'content_category_enum',
|
2160 |
-
'creative_folder_id' => 'string',
|
2161 |
-
'description' => 'string',
|
2162 |
-
'embeddable' => 'bool',
|
2163 |
-
'end_offset' => 'unsigned int',
|
2164 |
-
'fbuploader_video_file_chunk' => 'string',
|
2165 |
-
'file_size' => 'unsigned int',
|
2166 |
-
'file_url' => 'string',
|
2167 |
-
'fisheye_video_cropped' => 'bool',
|
2168 |
-
'formatting' => 'formatting_enum',
|
2169 |
-
'fov' => 'unsigned int',
|
2170 |
-
'front_z_rotation' => 'float',
|
2171 |
-
'fun_fact_prompt_id' => 'unsigned int',
|
2172 |
-
'fun_fact_toastee_id' => 'unsigned int',
|
2173 |
-
'guide' => 'list<list<unsigned int>>',
|
2174 |
-
'guide_enabled' => 'bool',
|
2175 |
-
'has_nickname' => 'bool',
|
2176 |
-
'holiday_card' => 'string',
|
2177 |
-
'initial_heading' => 'unsigned int',
|
2178 |
-
'initial_pitch' => 'unsigned int',
|
2179 |
-
'instant_game_entry_point_data' => 'string',
|
2180 |
-
'is_boost_intended' => 'bool',
|
2181 |
-
'is_group_linking_post' => 'bool',
|
2182 |
-
'is_voice_clip' => 'bool',
|
2183 |
-
'location_source_id' => 'string',
|
2184 |
-
'offer_like_post_id' => 'unsigned int',
|
2185 |
-
'og_action_type_id' => 'string',
|
2186 |
-
'og_icon_id' => 'string',
|
2187 |
-
'og_object_id' => 'string',
|
2188 |
-
'og_phrase' => 'string',
|
2189 |
-
'og_suggestion_mechanism' => 'string',
|
2190 |
-
'original_fov' => 'unsigned int',
|
2191 |
-
'original_projection_type' => 'original_projection_type_enum',
|
2192 |
-
'publish_event_id' => 'unsigned int',
|
2193 |
-
'react_mode_metadata' => 'string',
|
2194 |
-
'referenced_sticker_id' => 'string',
|
2195 |
-
'replace_video_id' => 'string',
|
2196 |
-
'sales_promo_id' => 'unsigned int',
|
2197 |
-
'slideshow_spec' => 'map',
|
2198 |
-
'source' => 'string',
|
2199 |
-
'spherical' => 'bool',
|
2200 |
-
'start_offset' => 'unsigned int',
|
2201 |
-
'swap_mode' => 'swap_mode_enum',
|
2202 |
-
'text_format_metadata' => 'string',
|
2203 |
-
'throwback_camera_roll_media' => 'string',
|
2204 |
-
'thumb' => 'file',
|
2205 |
-
'time_since_original_post' => 'unsigned int',
|
2206 |
-
'title' => 'string',
|
2207 |
-
'transcode_setting_properties' => 'string',
|
2208 |
-
'unpublished_content_type' => 'unpublished_content_type_enum',
|
2209 |
-
'upload_phase' => 'upload_phase_enum',
|
2210 |
-
'upload_session_id' => 'string',
|
2211 |
-
'upload_setting_properties' => 'string',
|
2212 |
-
'validation_ad_placements' => 'list<validation_ad_placements_enum>',
|
2213 |
-
'video_file_chunk' => 'string',
|
2214 |
-
'video_start_time_ms' => 'unsigned int',
|
2215 |
-
'waterfall_id' => 'string',
|
2216 |
-
);
|
2217 |
-
$enums = array(
|
2218 |
-
'container_type_enum' => AdVideoContainerTypeValues::getInstance()->getValues(),
|
2219 |
-
'content_category_enum' => AdVideoContentCategoryValues::getInstance()->getValues(),
|
2220 |
-
'formatting_enum' => AdVideoFormattingValues::getInstance()->getValues(),
|
2221 |
-
'original_projection_type_enum' => AdVideoOriginalProjectionTypeValues::getInstance()->getValues(),
|
2222 |
-
'swap_mode_enum' => AdVideoSwapModeValues::getInstance()->getValues(),
|
2223 |
-
'unpublished_content_type_enum' => AdVideoUnpublishedContentTypeValues::getInstance()->getValues(),
|
2224 |
-
'upload_phase_enum' => AdVideoUploadPhaseValues::getInstance()->getValues(),
|
2225 |
-
'validation_ad_placements_enum' => AdVideoValidationAdPlacementsValues::getInstance()->getValues(),
|
2226 |
-
);
|
2227 |
-
|
2228 |
-
$request = new ApiRequest(
|
2229 |
-
$this->api,
|
2230 |
-
$this->data['id'],
|
2231 |
-
RequestInterface::METHOD_POST,
|
2232 |
-
'/videos',
|
2233 |
-
new AdVideo(),
|
2234 |
-
'EDGE',
|
2235 |
-
AdVideo::getFieldsEnum()->getValues(),
|
2236 |
-
new TypeChecker($param_types, $enums)
|
2237 |
-
);
|
2238 |
-
$request->addParams($params);
|
2239 |
-
$request->addFields($fields);
|
2240 |
-
return $pending ? $request : $request->execute();
|
2241 |
-
}
|
2242 |
-
|
2243 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
2244 |
$this->assureId();
|
2245 |
|
35 |
use FacebookAds\Object\Values\AdNetworkAnalyticsSyncQueryResultOrderingColumnValues;
|
36 |
use FacebookAds\Object\Values\AdNetworkAnalyticsSyncQueryResultOrderingTypeValues;
|
37 |
use FacebookAds\Object\Values\AdStudyTypeValues;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
use FacebookAds\Object\Values\AdsPixelSortByValues;
|
39 |
use FacebookAds\Object\Values\BusinessAgreementRequestStatusValues;
|
40 |
use FacebookAds\Object\Values\BusinessAssetSharingAgreementRequestStatusValues;
|
|
|
|
|
41 |
use FacebookAds\Object\Values\BusinessPagePermittedTasksValues;
|
42 |
use FacebookAds\Object\Values\BusinessPermittedTasksValues;
|
43 |
use FacebookAds\Object\Values\BusinessSurveyBusinessTypeValues;
|
44 |
use FacebookAds\Object\Values\BusinessTwoFactorTypeValues;
|
45 |
use FacebookAds\Object\Values\BusinessUserRoleValues;
|
46 |
use FacebookAds\Object\Values\BusinessVerticalValues;
|
47 |
+
use FacebookAds\Object\Values\CPASCollaborationRequestRequesterAgencyOrBrandValues;
|
48 |
use FacebookAds\Object\Values\ContentDeliveryReportPlatformValues;
|
49 |
use FacebookAds\Object\Values\ContentDeliveryReportPositionValues;
|
50 |
use FacebookAds\Object\Values\CustomConversionCustomEventTypeValues;
|
55 |
use FacebookAds\Object\Values\MeasurementUploadEventTimezoneValues;
|
56 |
use FacebookAds\Object\Values\OracleTransactionTypeValues;
|
57 |
use FacebookAds\Object\Values\ProductCatalogVerticalValues;
|
58 |
+
use FacebookAds\Object\Values\ProfilePictureSourceBreakingChangeValues;
|
59 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
60 |
use FacebookAds\Object\Values\SystemUserRoleValues;
|
61 |
|
93 |
|
94 |
$param_types = array(
|
95 |
'app_id' => 'string',
|
96 |
+
'fbe_external_business_id' => 'string',
|
97 |
'scope' => 'list<Permission>',
|
98 |
'system_user_name' => 'string',
|
99 |
);
|
406 |
return $pending ? $request : $request->execute();
|
407 |
}
|
408 |
|
409 |
+
public function createAggregateRevenue(array $fields = array(), array $params = array(), $pending = false) {
|
410 |
$this->assureId();
|
411 |
|
412 |
$param_types = array(
|
413 |
+
'ecpms' => 'list<string>',
|
414 |
+
'query_ids' => 'list<string>',
|
415 |
+
'request_id' => 'string',
|
416 |
);
|
417 |
$enums = array(
|
418 |
);
|
420 |
$request = new ApiRequest(
|
421 |
$this->api,
|
422 |
$this->data['id'],
|
423 |
+
RequestInterface::METHOD_POST,
|
424 |
+
'/aggregate_revenue',
|
425 |
+
new AbstractCrudObject(),
|
426 |
'EDGE',
|
427 |
+
array(),
|
428 |
new TypeChecker($param_types, $enums)
|
429 |
);
|
430 |
$request->addParams($params);
|
432 |
return $pending ? $request : $request->execute();
|
433 |
}
|
434 |
|
435 |
+
public function getAnPlacements(array $fields = array(), array $params = array(), $pending = false) {
|
436 |
$this->assureId();
|
437 |
|
438 |
$param_types = array(
|
|
|
|
|
439 |
);
|
440 |
$enums = array(
|
|
|
441 |
);
|
442 |
|
443 |
$request = new ApiRequest(
|
444 |
$this->api,
|
445 |
$this->data['id'],
|
446 |
RequestInterface::METHOD_GET,
|
447 |
+
'/an_placements',
|
448 |
+
new AdPlacement(),
|
449 |
'EDGE',
|
450 |
+
AdPlacement::getFieldsEnum()->getValues(),
|
451 |
new TypeChecker($param_types, $enums)
|
452 |
);
|
453 |
$request->addParams($params);
|
844 |
return $pending ? $request : $request->execute();
|
845 |
}
|
846 |
|
847 |
+
public function getClientWhatsAppBusinessAccounts(array $fields = array(), array $params = array(), $pending = false) {
|
848 |
+
$this->assureId();
|
849 |
+
|
850 |
+
$param_types = array(
|
851 |
+
);
|
852 |
+
$enums = array(
|
853 |
+
);
|
854 |
+
|
855 |
+
$request = new ApiRequest(
|
856 |
+
$this->api,
|
857 |
+
$this->data['id'],
|
858 |
+
RequestInterface::METHOD_GET,
|
859 |
+
'/client_whatsapp_business_accounts',
|
860 |
+
new WhatsAppBusinessAccount(),
|
861 |
+
'EDGE',
|
862 |
+
WhatsAppBusinessAccount::getFieldsEnum()->getValues(),
|
863 |
+
new TypeChecker($param_types, $enums)
|
864 |
+
);
|
865 |
+
$request->addParams($params);
|
866 |
+
$request->addFields($fields);
|
867 |
+
return $pending ? $request : $request->execute();
|
868 |
+
}
|
869 |
+
|
870 |
public function deleteClients(array $fields = array(), array $params = array(), $pending = false) {
|
871 |
$this->assureId();
|
872 |
|
914 |
return $pending ? $request : $request->execute();
|
915 |
}
|
916 |
|
917 |
+
public function getCollaborativeAdsCollaborationRequests(array $fields = array(), array $params = array(), $pending = false) {
|
918 |
$this->assureId();
|
919 |
|
920 |
$param_types = array(
|
921 |
+
'status' => 'string',
|
922 |
);
|
923 |
$enums = array(
|
924 |
);
|
927 |
$this->api,
|
928 |
$this->data['id'],
|
929 |
RequestInterface::METHOD_GET,
|
930 |
+
'/collaborative_ads_collaboration_requests',
|
931 |
+
new CPASCollaborationRequest(),
|
932 |
'EDGE',
|
933 |
+
CPASCollaborationRequest::getFieldsEnum()->getValues(),
|
934 |
new TypeChecker($param_types, $enums)
|
935 |
);
|
936 |
$request->addParams($params);
|
938 |
return $pending ? $request : $request->execute();
|
939 |
}
|
940 |
|
941 |
+
public function createCollaborativeAdsCollaborationRequest(array $fields = array(), array $params = array(), $pending = false) {
|
942 |
$this->assureId();
|
943 |
|
944 |
$param_types = array(
|
945 |
+
'brands' => 'list<string>',
|
946 |
+
'contact_email' => 'string',
|
947 |
+
'contact_first_name' => 'string',
|
948 |
+
'contact_last_name' => 'string',
|
949 |
+
'phone_number' => 'string',
|
950 |
+
'receiver_business' => 'string',
|
951 |
+
'requester_agency_or_brand' => 'requester_agency_or_brand_enum',
|
952 |
+
'sender_client_business' => 'string',
|
953 |
);
|
954 |
$enums = array(
|
955 |
+
'requester_agency_or_brand_enum' => CPASCollaborationRequestRequesterAgencyOrBrandValues::getInstance()->getValues(),
|
|
|
956 |
);
|
957 |
|
958 |
$request = new ApiRequest(
|
959 |
$this->api,
|
960 |
$this->data['id'],
|
961 |
+
RequestInterface::METHOD_POST,
|
962 |
+
'/collaborative_ads_collaboration_requests',
|
963 |
+
new CPASCollaborationRequest(),
|
964 |
'EDGE',
|
965 |
+
CPASCollaborationRequest::getFieldsEnum()->getValues(),
|
966 |
new TypeChecker($param_types, $enums)
|
967 |
);
|
968 |
$request->addParams($params);
|
970 |
return $pending ? $request : $request->execute();
|
971 |
}
|
972 |
|
973 |
+
public function getCollaborativeAdsSuggestedPartners(array $fields = array(), array $params = array(), $pending = false) {
|
974 |
$this->assureId();
|
975 |
|
976 |
$param_types = array(
|
982 |
$this->api,
|
983 |
$this->data['id'],
|
984 |
RequestInterface::METHOD_GET,
|
985 |
+
'/collaborative_ads_suggested_partners',
|
986 |
+
new CPASAdvertiserPartnershipRecommendation(),
|
987 |
'EDGE',
|
988 |
+
CPASAdvertiserPartnershipRecommendation::getFieldsEnum()->getValues(),
|
989 |
new TypeChecker($param_types, $enums)
|
990 |
);
|
991 |
$request->addParams($params);
|
993 |
return $pending ? $request : $request->execute();
|
994 |
}
|
995 |
|
996 |
+
public function getCommerceMerchantSettings(array $fields = array(), array $params = array(), $pending = false) {
|
997 |
$this->assureId();
|
998 |
|
999 |
$param_types = array(
|
1005 |
$this->api,
|
1006 |
$this->data['id'],
|
1007 |
RequestInterface::METHOD_GET,
|
1008 |
+
'/commerce_merchant_settings',
|
1009 |
+
new CommerceMerchantSettings(),
|
1010 |
'EDGE',
|
1011 |
+
CommerceMerchantSettings::getFieldsEnum()->getValues(),
|
1012 |
new TypeChecker($param_types, $enums)
|
1013 |
);
|
1014 |
$request->addParams($params);
|
1016 |
return $pending ? $request : $request->execute();
|
1017 |
}
|
1018 |
|
1019 |
+
public function getContentDeliveryReport(array $fields = array(), array $params = array(), $pending = false) {
|
1020 |
$this->assureId();
|
1021 |
|
1022 |
$param_types = array(
|
1023 |
+
'end_date' => 'datetime',
|
1024 |
+
'page_id' => 'unsigned int',
|
1025 |
+
'platform' => 'platform_enum',
|
1026 |
+
'position' => 'position_enum',
|
1027 |
+
'start_date' => 'datetime',
|
1028 |
+
'summary' => 'bool',
|
1029 |
);
|
1030 |
$enums = array(
|
1031 |
+
'platform_enum' => ContentDeliveryReportPlatformValues::getInstance()->getValues(),
|
1032 |
+
'position_enum' => ContentDeliveryReportPositionValues::getInstance()->getValues(),
|
1033 |
);
|
1034 |
|
1035 |
$request = new ApiRequest(
|
1036 |
$this->api,
|
1037 |
$this->data['id'],
|
1038 |
+
RequestInterface::METHOD_GET,
|
1039 |
+
'/content_delivery_report',
|
1040 |
+
new ContentDeliveryReport(),
|
1041 |
'EDGE',
|
1042 |
+
ContentDeliveryReport::getFieldsEnum()->getValues(),
|
1043 |
new TypeChecker($param_types, $enums)
|
1044 |
);
|
1045 |
$request->addParams($params);
|
1047 |
return $pending ? $request : $request->execute();
|
1048 |
}
|
1049 |
|
1050 |
+
public function createCreateAndApplyPublisherBlockList(array $fields = array(), array $params = array(), $pending = false) {
|
1051 |
$this->assureId();
|
1052 |
|
1053 |
$param_types = array(
|
1054 |
+
'is_auto_blocking_on' => 'bool',
|
1055 |
+
'name' => 'string',
|
1056 |
+
'publisher_urls' => 'list<string>',
|
1057 |
);
|
1058 |
$enums = array(
|
1059 |
);
|
1061 |
$request = new ApiRequest(
|
1062 |
$this->api,
|
1063 |
$this->data['id'],
|
1064 |
+
RequestInterface::METHOD_POST,
|
1065 |
+
'/create_and_apply_publisher_block_list',
|
1066 |
+
new AbstractCrudObject(),
|
1067 |
'EDGE',
|
1068 |
+
array(),
|
1069 |
new TypeChecker($param_types, $enums)
|
1070 |
);
|
1071 |
$request->addParams($params);
|
1176 |
return $pending ? $request : $request->execute();
|
1177 |
}
|
1178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1179 |
public function getInitiatedAudienceSharingRequests(array $fields = array(), array $params = array(), $pending = false) {
|
1180 |
$this->assureId();
|
1181 |
|
1303 |
$this->assureId();
|
1304 |
|
1305 |
$param_types = array(
|
1306 |
+
'child_business_external_id' => 'string',
|
1307 |
'existing_client_business_id' => 'string',
|
1308 |
'name' => 'string',
|
1309 |
'sales_rep_email' => 'string',
|
1531 |
$this->assureId();
|
1532 |
|
1533 |
$param_types = array(
|
1534 |
+
'child_business_external_id' => 'string',
|
1535 |
'client_user_id' => 'int',
|
1536 |
);
|
1537 |
$enums = array(
|
1556 |
$this->assureId();
|
1557 |
|
1558 |
$param_types = array(
|
1559 |
+
'child_business_external_id' => 'string',
|
1560 |
'name' => 'string',
|
1561 |
'page_permitted_tasks' => 'list<page_permitted_tasks_enum>',
|
1562 |
'sales_rep_email' => 'string',
|
1709 |
$this->assureId();
|
1710 |
|
1711 |
$param_types = array(
|
1712 |
+
'catalog_segment_filter' => 'Object',
|
1713 |
+
'catalog_segment_product_set_id' => 'string',
|
1714 |
'commerce_merchant_settings' => 'Object',
|
1715 |
'da_display_settings' => 'Object',
|
1716 |
'destination_catalog_settings' => 'map',
|
1717 |
'flight_catalog_settings' => 'map',
|
1718 |
'name' => 'string',
|
1719 |
'onsite_commerce_merchant' => 'Object',
|
1720 |
+
'parent_catalog_id' => 'string',
|
1721 |
'store_catalog_settings' => 'map',
|
1722 |
'vertical' => 'vertical_enum',
|
1723 |
);
|
1879 |
return $pending ? $request : $request->execute();
|
1880 |
}
|
1881 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1882 |
public function getPendingUsers(array $fields = array(), array $params = array(), $pending = false) {
|
1883 |
$this->assureId();
|
1884 |
|
1907 |
$this->assureId();
|
1908 |
|
1909 |
$param_types = array(
|
1910 |
+
'breaking_change' => 'breaking_change_enum',
|
1911 |
'height' => 'int',
|
1912 |
'redirect' => 'bool',
|
1913 |
'type' => 'type_enum',
|
1914 |
'width' => 'int',
|
1915 |
);
|
1916 |
$enums = array(
|
1917 |
+
'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),
|
1918 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
1919 |
);
|
1920 |
|
2117 |
return $pending ? $request : $request->execute();
|
2118 |
}
|
2119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2120 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
2121 |
$this->assureId();
|
2122 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessCreative.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\BusinessCreativeFields;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* This class is auto-generated.
|
35 |
-
*
|
36 |
-
* For any issues or feature requests related to this class, please let us know
|
37 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
38 |
-
* pull request for this class.
|
39 |
-
*
|
40 |
-
*/
|
41 |
-
|
42 |
-
class BusinessCreative extends AbstractCrudObject {
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @return BusinessCreativeFields
|
46 |
-
*/
|
47 |
-
public static function getFieldsEnum() {
|
48 |
-
return BusinessCreativeFields::getInstance();
|
49 |
-
}
|
50 |
-
|
51 |
-
protected static function getReferencedEnums() {
|
52 |
-
$ref_enums = array();
|
53 |
-
return $ref_enums;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
public function getAdPlacementValidationResults(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_GET,
|
69 |
-
'/ad_placement_validation_results',
|
70 |
-
new AbstractCrudObject(),
|
71 |
-
'EDGE',
|
72 |
-
array(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessCreativeFolder.php
DELETED
@@ -1,262 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\BusinessCreativeFolderFields;
|
32 |
-
use FacebookAds\Object\Values\BusinessCreativeFolderPermittedTasksValues;
|
33 |
-
use FacebookAds\Object\Values\BusinessCreativeFolderTasksValues;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* This class is auto-generated.
|
37 |
-
*
|
38 |
-
* For any issues or feature requests related to this class, please let us know
|
39 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
40 |
-
* pull request for this class.
|
41 |
-
*
|
42 |
-
*/
|
43 |
-
|
44 |
-
class BusinessCreativeFolder extends AbstractCrudObject {
|
45 |
-
|
46 |
-
/**
|
47 |
-
* @deprecated getEndpoint function is deprecated
|
48 |
-
*/
|
49 |
-
protected function getEndpoint() {
|
50 |
-
return 'creative_folders';
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return BusinessCreativeFolderFields
|
55 |
-
*/
|
56 |
-
public static function getFieldsEnum() {
|
57 |
-
return BusinessCreativeFolderFields::getInstance();
|
58 |
-
}
|
59 |
-
|
60 |
-
protected static function getReferencedEnums() {
|
61 |
-
$ref_enums = array();
|
62 |
-
$ref_enums['PermittedTasks'] = BusinessCreativeFolderPermittedTasksValues::getInstance()->getValues();
|
63 |
-
$ref_enums['Tasks'] = BusinessCreativeFolderTasksValues::getInstance()->getValues();
|
64 |
-
return $ref_enums;
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
public function getAgencies(array $fields = array(), array $params = array(), $pending = false) {
|
69 |
-
$this->assureId();
|
70 |
-
|
71 |
-
$param_types = array(
|
72 |
-
);
|
73 |
-
$enums = array(
|
74 |
-
);
|
75 |
-
|
76 |
-
$request = new ApiRequest(
|
77 |
-
$this->api,
|
78 |
-
$this->data['id'],
|
79 |
-
RequestInterface::METHOD_GET,
|
80 |
-
'/agencies',
|
81 |
-
new Business(),
|
82 |
-
'EDGE',
|
83 |
-
Business::getFieldsEnum()->getValues(),
|
84 |
-
new TypeChecker($param_types, $enums)
|
85 |
-
);
|
86 |
-
$request->addParams($params);
|
87 |
-
$request->addFields($fields);
|
88 |
-
return $pending ? $request : $request->execute();
|
89 |
-
}
|
90 |
-
|
91 |
-
public function createAgency(array $fields = array(), array $params = array(), $pending = false) {
|
92 |
-
$this->assureId();
|
93 |
-
|
94 |
-
$param_types = array(
|
95 |
-
'business' => 'string',
|
96 |
-
'permitted_tasks' => 'list<permitted_tasks_enum>',
|
97 |
-
);
|
98 |
-
$enums = array(
|
99 |
-
'permitted_tasks_enum' => BusinessCreativeFolderPermittedTasksValues::getInstance()->getValues(),
|
100 |
-
);
|
101 |
-
|
102 |
-
$request = new ApiRequest(
|
103 |
-
$this->api,
|
104 |
-
$this->data['id'],
|
105 |
-
RequestInterface::METHOD_POST,
|
106 |
-
'/agencies',
|
107 |
-
new BusinessCreativeFolder(),
|
108 |
-
'EDGE',
|
109 |
-
BusinessCreativeFolder::getFieldsEnum()->getValues(),
|
110 |
-
new TypeChecker($param_types, $enums)
|
111 |
-
);
|
112 |
-
$request->addParams($params);
|
113 |
-
$request->addFields($fields);
|
114 |
-
return $pending ? $request : $request->execute();
|
115 |
-
}
|
116 |
-
|
117 |
-
public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {
|
118 |
-
$this->assureId();
|
119 |
-
|
120 |
-
$param_types = array(
|
121 |
-
'business' => 'string',
|
122 |
-
);
|
123 |
-
$enums = array(
|
124 |
-
);
|
125 |
-
|
126 |
-
$request = new ApiRequest(
|
127 |
-
$this->api,
|
128 |
-
$this->data['id'],
|
129 |
-
RequestInterface::METHOD_GET,
|
130 |
-
'/assigned_users',
|
131 |
-
new AssignedUser(),
|
132 |
-
'EDGE',
|
133 |
-
AssignedUser::getFieldsEnum()->getValues(),
|
134 |
-
new TypeChecker($param_types, $enums)
|
135 |
-
);
|
136 |
-
$request->addParams($params);
|
137 |
-
$request->addFields($fields);
|
138 |
-
return $pending ? $request : $request->execute();
|
139 |
-
}
|
140 |
-
|
141 |
-
public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {
|
142 |
-
$this->assureId();
|
143 |
-
|
144 |
-
$param_types = array(
|
145 |
-
'tasks' => 'list<tasks_enum>',
|
146 |
-
'user' => 'int',
|
147 |
-
);
|
148 |
-
$enums = array(
|
149 |
-
'tasks_enum' => BusinessCreativeFolderTasksValues::getInstance()->getValues(),
|
150 |
-
);
|
151 |
-
|
152 |
-
$request = new ApiRequest(
|
153 |
-
$this->api,
|
154 |
-
$this->data['id'],
|
155 |
-
RequestInterface::METHOD_POST,
|
156 |
-
'/assigned_users',
|
157 |
-
new BusinessCreativeFolder(),
|
158 |
-
'EDGE',
|
159 |
-
BusinessCreativeFolder::getFieldsEnum()->getValues(),
|
160 |
-
new TypeChecker($param_types, $enums)
|
161 |
-
);
|
162 |
-
$request->addParams($params);
|
163 |
-
$request->addFields($fields);
|
164 |
-
return $pending ? $request : $request->execute();
|
165 |
-
}
|
166 |
-
|
167 |
-
public function getSubFolders(array $fields = array(), array $params = array(), $pending = false) {
|
168 |
-
$this->assureId();
|
169 |
-
|
170 |
-
$param_types = array(
|
171 |
-
);
|
172 |
-
$enums = array(
|
173 |
-
);
|
174 |
-
|
175 |
-
$request = new ApiRequest(
|
176 |
-
$this->api,
|
177 |
-
$this->data['id'],
|
178 |
-
RequestInterface::METHOD_GET,
|
179 |
-
'/subfolders',
|
180 |
-
new BusinessCreativeFolder(),
|
181 |
-
'EDGE',
|
182 |
-
BusinessCreativeFolder::getFieldsEnum()->getValues(),
|
183 |
-
new TypeChecker($param_types, $enums)
|
184 |
-
);
|
185 |
-
$request->addParams($params);
|
186 |
-
$request->addFields($fields);
|
187 |
-
return $pending ? $request : $request->execute();
|
188 |
-
}
|
189 |
-
|
190 |
-
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {
|
191 |
-
$this->assureId();
|
192 |
-
|
193 |
-
$param_types = array(
|
194 |
-
);
|
195 |
-
$enums = array(
|
196 |
-
);
|
197 |
-
|
198 |
-
$request = new ApiRequest(
|
199 |
-
$this->api,
|
200 |
-
$this->data['id'],
|
201 |
-
RequestInterface::METHOD_DELETE,
|
202 |
-
'/',
|
203 |
-
new AbstractCrudObject(),
|
204 |
-
'NODE',
|
205 |
-
array(),
|
206 |
-
new TypeChecker($param_types, $enums)
|
207 |
-
);
|
208 |
-
$request->addParams($params);
|
209 |
-
$request->addFields($fields);
|
210 |
-
return $pending ? $request : $request->execute();
|
211 |
-
}
|
212 |
-
|
213 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
214 |
-
$this->assureId();
|
215 |
-
|
216 |
-
$param_types = array(
|
217 |
-
);
|
218 |
-
$enums = array(
|
219 |
-
);
|
220 |
-
|
221 |
-
$request = new ApiRequest(
|
222 |
-
$this->api,
|
223 |
-
$this->data['id'],
|
224 |
-
RequestInterface::METHOD_GET,
|
225 |
-
'/',
|
226 |
-
new BusinessCreativeFolder(),
|
227 |
-
'NODE',
|
228 |
-
BusinessCreativeFolder::getFieldsEnum()->getValues(),
|
229 |
-
new TypeChecker($param_types, $enums)
|
230 |
-
);
|
231 |
-
$request->addParams($params);
|
232 |
-
$request->addFields($fields);
|
233 |
-
return $pending ? $request : $request->execute();
|
234 |
-
}
|
235 |
-
|
236 |
-
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
|
237 |
-
$this->assureId();
|
238 |
-
|
239 |
-
$param_types = array(
|
240 |
-
'creative_insight_permissions' => 'map',
|
241 |
-
'description' => 'string',
|
242 |
-
'name' => 'string',
|
243 |
-
);
|
244 |
-
$enums = array(
|
245 |
-
);
|
246 |
-
|
247 |
-
$request = new ApiRequest(
|
248 |
-
$this->api,
|
249 |
-
$this->data['id'],
|
250 |
-
RequestInterface::METHOD_POST,
|
251 |
-
'/',
|
252 |
-
new BusinessCreativeFolder(),
|
253 |
-
'NODE',
|
254 |
-
BusinessCreativeFolder::getFieldsEnum()->getValues(),
|
255 |
-
new TypeChecker($param_types, $enums)
|
256 |
-
);
|
257 |
-
$request->addParams($params);
|
258 |
-
$request->addFields($fields);
|
259 |
-
return $pending ? $request : $request->execute();
|
260 |
-
}
|
261 |
-
|
262 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessImage.php
DELETED
@@ -1,245 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\BusinessImageFields;
|
32 |
-
use FacebookAds\Object\Values\BusinessImageValidationAdPlacementsValues;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This class is auto-generated.
|
36 |
-
*
|
37 |
-
* For any issues or feature requests related to this class, please let us know
|
38 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
39 |
-
* pull request for this class.
|
40 |
-
*
|
41 |
-
*/
|
42 |
-
|
43 |
-
class BusinessImage extends AbstractCrudObject {
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @deprecated getEndpoint function is deprecated
|
47 |
-
*/
|
48 |
-
protected function getEndpoint() {
|
49 |
-
return 'images';
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return BusinessImageFields
|
54 |
-
*/
|
55 |
-
public static function getFieldsEnum() {
|
56 |
-
return BusinessImageFields::getInstance();
|
57 |
-
}
|
58 |
-
|
59 |
-
protected static function getReferencedEnums() {
|
60 |
-
$ref_enums = array();
|
61 |
-
$ref_enums['ValidationAdPlacements'] = BusinessImageValidationAdPlacementsValues::getInstance()->getValues();
|
62 |
-
return $ref_enums;
|
63 |
-
}
|
64 |
-
|
65 |
-
|
66 |
-
public function getAdPlacementValidationResults(array $fields = array(), array $params = array(), $pending = false) {
|
67 |
-
$this->assureId();
|
68 |
-
|
69 |
-
$param_types = array(
|
70 |
-
);
|
71 |
-
$enums = array(
|
72 |
-
);
|
73 |
-
|
74 |
-
$request = new ApiRequest(
|
75 |
-
$this->api,
|
76 |
-
$this->data['id'],
|
77 |
-
RequestInterface::METHOD_GET,
|
78 |
-
'/ad_placement_validation_results',
|
79 |
-
new AbstractCrudObject(),
|
80 |
-
'EDGE',
|
81 |
-
array(),
|
82 |
-
new TypeChecker($param_types, $enums)
|
83 |
-
);
|
84 |
-
$request->addParams($params);
|
85 |
-
$request->addFields($fields);
|
86 |
-
return $pending ? $request : $request->execute();
|
87 |
-
}
|
88 |
-
|
89 |
-
public function deleteCreativeAssetTags(array $fields = array(), array $params = array(), $pending = false) {
|
90 |
-
$this->assureId();
|
91 |
-
|
92 |
-
$param_types = array(
|
93 |
-
'business_id' => 'string',
|
94 |
-
'tag_name' => 'string',
|
95 |
-
);
|
96 |
-
$enums = array(
|
97 |
-
);
|
98 |
-
|
99 |
-
$request = new ApiRequest(
|
100 |
-
$this->api,
|
101 |
-
$this->data['id'],
|
102 |
-
RequestInterface::METHOD_DELETE,
|
103 |
-
'/creative_asset_tags',
|
104 |
-
new AbstractCrudObject(),
|
105 |
-
'EDGE',
|
106 |
-
array(),
|
107 |
-
new TypeChecker($param_types, $enums)
|
108 |
-
);
|
109 |
-
$request->addParams($params);
|
110 |
-
$request->addFields($fields);
|
111 |
-
return $pending ? $request : $request->execute();
|
112 |
-
}
|
113 |
-
|
114 |
-
public function getCreativeAssetTags(array $fields = array(), array $params = array(), $pending = false) {
|
115 |
-
$this->assureId();
|
116 |
-
|
117 |
-
$param_types = array(
|
118 |
-
'business_id' => 'string',
|
119 |
-
);
|
120 |
-
$enums = array(
|
121 |
-
);
|
122 |
-
|
123 |
-
$request = new ApiRequest(
|
124 |
-
$this->api,
|
125 |
-
$this->data['id'],
|
126 |
-
RequestInterface::METHOD_GET,
|
127 |
-
'/creative_asset_tags',
|
128 |
-
new CreativeAssetTag(),
|
129 |
-
'EDGE',
|
130 |
-
CreativeAssetTag::getFieldsEnum()->getValues(),
|
131 |
-
new TypeChecker($param_types, $enums)
|
132 |
-
);
|
133 |
-
$request->addParams($params);
|
134 |
-
$request->addFields($fields);
|
135 |
-
return $pending ? $request : $request->execute();
|
136 |
-
}
|
137 |
-
|
138 |
-
public function createCreativeAssetTag(array $fields = array(), array $params = array(), $pending = false) {
|
139 |
-
$this->assureId();
|
140 |
-
|
141 |
-
$param_types = array(
|
142 |
-
'business_id' => 'string',
|
143 |
-
'tag_name' => 'string',
|
144 |
-
);
|
145 |
-
$enums = array(
|
146 |
-
);
|
147 |
-
|
148 |
-
$request = new ApiRequest(
|
149 |
-
$this->api,
|
150 |
-
$this->data['id'],
|
151 |
-
RequestInterface::METHOD_POST,
|
152 |
-
'/creative_asset_tags',
|
153 |
-
new BusinessImage(),
|
154 |
-
'EDGE',
|
155 |
-
BusinessImage::getFieldsEnum()->getValues(),
|
156 |
-
new TypeChecker($param_types, $enums)
|
157 |
-
);
|
158 |
-
$request->addParams($params);
|
159 |
-
$request->addFields($fields);
|
160 |
-
return $pending ? $request : $request->execute();
|
161 |
-
}
|
162 |
-
|
163 |
-
public function getInsights(array $fields = array(), array $params = array(), $pending = false) {
|
164 |
-
$this->assureId();
|
165 |
-
|
166 |
-
$param_types = array(
|
167 |
-
'breakdowns' => 'list<breakdowns_enum>',
|
168 |
-
'time_range' => 'Object',
|
169 |
-
);
|
170 |
-
$enums = array(
|
171 |
-
'breakdowns_enum' => array(
|
172 |
-
'ad_id',
|
173 |
-
'age',
|
174 |
-
'country',
|
175 |
-
'device_platform',
|
176 |
-
'gender',
|
177 |
-
'objective',
|
178 |
-
'optimization_goal',
|
179 |
-
'platform_position',
|
180 |
-
'publisher_platform',
|
181 |
-
),
|
182 |
-
);
|
183 |
-
|
184 |
-
$request = new ApiRequest(
|
185 |
-
$this->api,
|
186 |
-
$this->data['id'],
|
187 |
-
RequestInterface::METHOD_GET,
|
188 |
-
'/insights',
|
189 |
-
new AbstractCrudObject(),
|
190 |
-
'EDGE',
|
191 |
-
array(),
|
192 |
-
new TypeChecker($param_types, $enums)
|
193 |
-
);
|
194 |
-
$request->addParams($params);
|
195 |
-
$request->addFields($fields);
|
196 |
-
return $pending ? $request : $request->execute();
|
197 |
-
}
|
198 |
-
|
199 |
-
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {
|
200 |
-
$this->assureId();
|
201 |
-
|
202 |
-
$param_types = array(
|
203 |
-
);
|
204 |
-
$enums = array(
|
205 |
-
);
|
206 |
-
|
207 |
-
$request = new ApiRequest(
|
208 |
-
$this->api,
|
209 |
-
$this->data['id'],
|
210 |
-
RequestInterface::METHOD_DELETE,
|
211 |
-
'/',
|
212 |
-
new AbstractCrudObject(),
|
213 |
-
'NODE',
|
214 |
-
array(),
|
215 |
-
new TypeChecker($param_types, $enums)
|
216 |
-
);
|
217 |
-
$request->addParams($params);
|
218 |
-
$request->addFields($fields);
|
219 |
-
return $pending ? $request : $request->execute();
|
220 |
-
}
|
221 |
-
|
222 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
223 |
-
$this->assureId();
|
224 |
-
|
225 |
-
$param_types = array(
|
226 |
-
);
|
227 |
-
$enums = array(
|
228 |
-
);
|
229 |
-
|
230 |
-
$request = new ApiRequest(
|
231 |
-
$this->api,
|
232 |
-
$this->data['id'],
|
233 |
-
RequestInterface::METHOD_GET,
|
234 |
-
'/',
|
235 |
-
new BusinessImage(),
|
236 |
-
'NODE',
|
237 |
-
BusinessImage::getFieldsEnum()->getValues(),
|
238 |
-
new TypeChecker($param_types, $enums)
|
239 |
-
);
|
240 |
-
$request->addParams($params);
|
241 |
-
$request->addFields($fields);
|
242 |
-
return $pending ? $request : $request->execute();
|
243 |
-
}
|
244 |
-
|
245 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/BusinessUnit.php
CHANGED
@@ -215,7 +215,7 @@ class BusinessUnit extends AbstractCrudObject {
|
|
215 |
|
216 |
$param_types = array(
|
217 |
'click_lookback_window' => 'unsigned int',
|
218 |
-
'date_range' => '
|
219 |
'fb_conversion_event_id' => 'unsigned int',
|
220 |
'limit' => 'unsigned int',
|
221 |
'metric_context' => 'map',
|
215 |
|
216 |
$param_types = array(
|
217 |
'click_lookback_window' => 'unsigned int',
|
218 |
+
'date_range' => 'map',
|
219 |
'fb_conversion_event_id' => 'unsigned int',
|
220 |
'limit' => 'unsigned int',
|
221 |
'metric_context' => 'map',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{IterativeSplitTestConfig.php → CPASAdvertiserPartnershipRecommendation.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\IterativeSplitTestConfigFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
@@ -67,9 +67,9 @@ class IterativeSplitTestConfig extends AbstractCrudObject {
|
|
67 |
$this->data['id'],
|
68 |
RequestInterface::METHOD_GET,
|
69 |
'/',
|
70 |
-
new
|
71 |
'NODE',
|
72 |
-
|
73 |
new TypeChecker($param_types, $enums)
|
74 |
);
|
75 |
$request->addParams($params);
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\CPASAdvertiserPartnershipRecommendationFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class CPASAdvertiserPartnershipRecommendation extends AbstractCrudObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return CPASAdvertiserPartnershipRecommendationFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return CPASAdvertiserPartnershipRecommendationFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
67 |
$this->data['id'],
|
68 |
RequestInterface::METHOD_GET,
|
69 |
'/',
|
70 |
+
new CPASAdvertiserPartnershipRecommendation(),
|
71 |
'NODE',
|
72 |
+
CPASAdvertiserPartnershipRecommendation::getFieldsEnum()->getValues(),
|
73 |
new TypeChecker($param_types, $enums)
|
74 |
);
|
75 |
$request->addParams($params);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{BusinessCreativeFolderSharingAgreement.php → CPASCollaborationRequest.php}
RENAMED
@@ -28,8 +28,8 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
-
use FacebookAds\Object\Values\
|
33 |
|
34 |
/**
|
35 |
* This class is auto-generated.
|
@@ -40,18 +40,25 @@ use FacebookAds\Object\Values\BusinessCreativeFolderSharingAgreementRequestStatu
|
|
40 |
*
|
41 |
*/
|
42 |
|
43 |
-
class
|
44 |
|
45 |
/**
|
46 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
*/
|
48 |
public static function getFieldsEnum() {
|
49 |
-
return
|
50 |
}
|
51 |
|
52 |
protected static function getReferencedEnums() {
|
53 |
$ref_enums = array();
|
54 |
-
$ref_enums['
|
55 |
return $ref_enums;
|
56 |
}
|
57 |
|
@@ -69,9 +76,9 @@ class BusinessCreativeFolderSharingAgreement extends AbstractCrudObject {
|
|
69 |
$this->data['id'],
|
70 |
RequestInterface::METHOD_GET,
|
71 |
'/',
|
72 |
-
new
|
73 |
'NODE',
|
74 |
-
|
75 |
new TypeChecker($param_types, $enums)
|
76 |
);
|
77 |
$request->addParams($params);
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\CPASCollaborationRequestFields;
|
32 |
+
use FacebookAds\Object\Values\CPASCollaborationRequestRequesterAgencyOrBrandValues;
|
33 |
|
34 |
/**
|
35 |
* This class is auto-generated.
|
40 |
*
|
41 |
*/
|
42 |
|
43 |
+
class CPASCollaborationRequest extends AbstractCrudObject {
|
44 |
|
45 |
/**
|
46 |
+
* @deprecated getEndpoint function is deprecated
|
47 |
+
*/
|
48 |
+
protected function getEndpoint() {
|
49 |
+
return 'collaborative_ads_collaboration_requests';
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @return CPASCollaborationRequestFields
|
54 |
*/
|
55 |
public static function getFieldsEnum() {
|
56 |
+
return CPASCollaborationRequestFields::getInstance();
|
57 |
}
|
58 |
|
59 |
protected static function getReferencedEnums() {
|
60 |
$ref_enums = array();
|
61 |
+
$ref_enums['RequesterAgencyOrBrand'] = CPASCollaborationRequestRequesterAgencyOrBrandValues::getInstance()->getValues();
|
62 |
return $ref_enums;
|
63 |
}
|
64 |
|
76 |
$this->data['id'],
|
77 |
RequestInterface::METHOD_GET,
|
78 |
'/',
|
79 |
+
new CPASCollaborationRequest(),
|
80 |
'NODE',
|
81 |
+
CPASCollaborationRequest::getFieldsEnum()->getValues(),
|
82 |
new TypeChecker($param_types, $enums)
|
83 |
);
|
84 |
$request->addParams($params);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Campaign.php
CHANGED
@@ -47,6 +47,7 @@ use FacebookAds\Object\Values\CampaignExecutionOptionsValues;
|
|
47 |
use FacebookAds\Object\Values\CampaignObjectiveValues;
|
48 |
use FacebookAds\Object\Values\CampaignOperatorValues;
|
49 |
use FacebookAds\Object\Values\CampaignSpecialAdCategoriesValues;
|
|
|
50 |
use FacebookAds\Object\Values\CampaignSpecialAdCategoryValues;
|
51 |
use FacebookAds\Object\Values\CampaignStatusOptionValues;
|
52 |
use FacebookAds\Object\Values\CampaignStatusValues;
|
@@ -93,6 +94,7 @@ class Campaign extends AbstractArchivableCrudObject {
|
|
93 |
$ref_enums['ExecutionOptions'] = CampaignExecutionOptionsValues::getInstance()->getValues();
|
94 |
$ref_enums['Objective'] = CampaignObjectiveValues::getInstance()->getValues();
|
95 |
$ref_enums['SpecialAdCategories'] = CampaignSpecialAdCategoriesValues::getInstance()->getValues();
|
|
|
96 |
$ref_enums['Operator'] = CampaignOperatorValues::getInstance()->getValues();
|
97 |
$ref_enums['SpecialAdCategory'] = CampaignSpecialAdCategoryValues::getInstance()->getValues();
|
98 |
$ref_enums['StatusOption'] = CampaignStatusOptionValues::getInstance()->getValues();
|
@@ -509,6 +511,7 @@ class Campaign extends AbstractArchivableCrudObject {
|
|
509 |
'promoted_object' => 'Object',
|
510 |
'special_ad_categories' => 'list<special_ad_categories_enum>',
|
511 |
'special_ad_category' => 'special_ad_category_enum',
|
|
|
512 |
'spend_cap' => 'unsigned int',
|
513 |
'status' => 'status_enum',
|
514 |
'upstream_events' => 'map',
|
@@ -519,6 +522,7 @@ class Campaign extends AbstractArchivableCrudObject {
|
|
519 |
'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(),
|
520 |
'special_ad_categories_enum' => CampaignSpecialAdCategoriesValues::getInstance()->getValues(),
|
521 |
'special_ad_category_enum' => CampaignSpecialAdCategoryValues::getInstance()->getValues(),
|
|
|
522 |
'status_enum' => CampaignStatusValues::getInstance()->getValues(),
|
523 |
);
|
524 |
|
47 |
use FacebookAds\Object\Values\CampaignObjectiveValues;
|
48 |
use FacebookAds\Object\Values\CampaignOperatorValues;
|
49 |
use FacebookAds\Object\Values\CampaignSpecialAdCategoriesValues;
|
50 |
+
use FacebookAds\Object\Values\CampaignSpecialAdCategoryCountryValues;
|
51 |
use FacebookAds\Object\Values\CampaignSpecialAdCategoryValues;
|
52 |
use FacebookAds\Object\Values\CampaignStatusOptionValues;
|
53 |
use FacebookAds\Object\Values\CampaignStatusValues;
|
94 |
$ref_enums['ExecutionOptions'] = CampaignExecutionOptionsValues::getInstance()->getValues();
|
95 |
$ref_enums['Objective'] = CampaignObjectiveValues::getInstance()->getValues();
|
96 |
$ref_enums['SpecialAdCategories'] = CampaignSpecialAdCategoriesValues::getInstance()->getValues();
|
97 |
+
$ref_enums['SpecialAdCategoryCountry'] = CampaignSpecialAdCategoryCountryValues::getInstance()->getValues();
|
98 |
$ref_enums['Operator'] = CampaignOperatorValues::getInstance()->getValues();
|
99 |
$ref_enums['SpecialAdCategory'] = CampaignSpecialAdCategoryValues::getInstance()->getValues();
|
100 |
$ref_enums['StatusOption'] = CampaignStatusOptionValues::getInstance()->getValues();
|
511 |
'promoted_object' => 'Object',
|
512 |
'special_ad_categories' => 'list<special_ad_categories_enum>',
|
513 |
'special_ad_category' => 'special_ad_category_enum',
|
514 |
+
'special_ad_category_country' => 'list<special_ad_category_country_enum>',
|
515 |
'spend_cap' => 'unsigned int',
|
516 |
'status' => 'status_enum',
|
517 |
'upstream_events' => 'map',
|
522 |
'objective_enum' => CampaignObjectiveValues::getInstance()->getValues(),
|
523 |
'special_ad_categories_enum' => CampaignSpecialAdCategoriesValues::getInstance()->getValues(),
|
524 |
'special_ad_category_enum' => CampaignSpecialAdCategoryValues::getInstance()->getValues(),
|
525 |
+
'special_ad_category_country_enum' => CampaignSpecialAdCategoryCountryValues::getInstance()->getValues(),
|
526 |
'status_enum' => CampaignStatusValues::getInstance()->getValues(),
|
527 |
);
|
528 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{ClientTransparencyStatus.php → CatalogSubVerticalList.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\ClientTransparencyStatusFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\CatalogSubVerticalListFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class CatalogSubVerticalList extends AbstractObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return CatalogSubVerticalListFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return CatalogSubVerticalListFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/CommerceMerchantSettings.php
CHANGED
@@ -29,6 +29,7 @@ use FacebookAds\Cursor;
|
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\CommerceMerchantSettingsFields;
|
|
|
32 |
use FacebookAds\Object\Values\CommerceMerchantSettingsMerchantStatusValues;
|
33 |
|
34 |
/**
|
@@ -51,6 +52,7 @@ class CommerceMerchantSettings extends AbstractCrudObject {
|
|
51 |
|
52 |
protected static function getReferencedEnums() {
|
53 |
$ref_enums = array();
|
|
|
54 |
$ref_enums['MerchantStatus'] = CommerceMerchantSettingsMerchantStatusValues::getInstance()->getValues();
|
55 |
return $ref_enums;
|
56 |
}
|
@@ -254,6 +256,58 @@ class CommerceMerchantSettings extends AbstractCrudObject {
|
|
254 |
return $pending ? $request : $request->execute();
|
255 |
}
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
public function getTaxSettings(array $fields = array(), array $params = array(), $pending = false) {
|
258 |
$this->assureId();
|
259 |
|
@@ -277,6 +331,35 @@ class CommerceMerchantSettings extends AbstractCrudObject {
|
|
277 |
return $pending ? $request : $request->execute();
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
281 |
$this->assureId();
|
282 |
|
@@ -305,12 +388,14 @@ class CommerceMerchantSettings extends AbstractCrudObject {
|
|
305 |
|
306 |
$param_types = array(
|
307 |
'contact_email' => 'string',
|
|
|
308 |
'merchant_alert_email' => 'string',
|
309 |
'merchant_status' => 'merchant_status_enum',
|
310 |
'onsite_commerce_merchant' => 'Object',
|
311 |
'terms' => 'string',
|
312 |
);
|
313 |
$enums = array(
|
|
|
314 |
'merchant_status_enum' => CommerceMerchantSettingsMerchantStatusValues::getInstance()->getValues(),
|
315 |
);
|
316 |
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\CommerceMerchantSettingsFields;
|
32 |
+
use FacebookAds\Object\Values\CommerceMerchantSettingsCtaValues;
|
33 |
use FacebookAds\Object\Values\CommerceMerchantSettingsMerchantStatusValues;
|
34 |
|
35 |
/**
|
52 |
|
53 |
protected static function getReferencedEnums() {
|
54 |
$ref_enums = array();
|
55 |
+
$ref_enums['Cta'] = CommerceMerchantSettingsCtaValues::getInstance()->getValues();
|
56 |
$ref_enums['MerchantStatus'] = CommerceMerchantSettingsMerchantStatusValues::getInstance()->getValues();
|
57 |
return $ref_enums;
|
58 |
}
|
256 |
return $pending ? $request : $request->execute();
|
257 |
}
|
258 |
|
259 |
+
public function getShippingProfiles(array $fields = array(), array $params = array(), $pending = false) {
|
260 |
+
$this->assureId();
|
261 |
+
|
262 |
+
$param_types = array(
|
263 |
+
'reference_id' => 'string',
|
264 |
+
);
|
265 |
+
$enums = array(
|
266 |
+
);
|
267 |
+
|
268 |
+
$request = new ApiRequest(
|
269 |
+
$this->api,
|
270 |
+
$this->data['id'],
|
271 |
+
RequestInterface::METHOD_GET,
|
272 |
+
'/shipping_profiles',
|
273 |
+
new AbstractCrudObject(),
|
274 |
+
'EDGE',
|
275 |
+
array(),
|
276 |
+
new TypeChecker($param_types, $enums)
|
277 |
+
);
|
278 |
+
$request->addParams($params);
|
279 |
+
$request->addFields($fields);
|
280 |
+
return $pending ? $request : $request->execute();
|
281 |
+
}
|
282 |
+
|
283 |
+
public function createShippingProfile(array $fields = array(), array $params = array(), $pending = false) {
|
284 |
+
$this->assureId();
|
285 |
+
|
286 |
+
$param_types = array(
|
287 |
+
'handling_time' => 'map',
|
288 |
+
'is_default_shipping_profile' => 'bool',
|
289 |
+
'name' => 'string',
|
290 |
+
'reference_id' => 'string',
|
291 |
+
'shipping_destinations' => 'list<map>',
|
292 |
+
);
|
293 |
+
$enums = array(
|
294 |
+
);
|
295 |
+
|
296 |
+
$request = new ApiRequest(
|
297 |
+
$this->api,
|
298 |
+
$this->data['id'],
|
299 |
+
RequestInterface::METHOD_POST,
|
300 |
+
'/shipping_profiles',
|
301 |
+
new AbstractCrudObject(),
|
302 |
+
'EDGE',
|
303 |
+
array(),
|
304 |
+
new TypeChecker($param_types, $enums)
|
305 |
+
);
|
306 |
+
$request->addParams($params);
|
307 |
+
$request->addFields($fields);
|
308 |
+
return $pending ? $request : $request->execute();
|
309 |
+
}
|
310 |
+
|
311 |
public function getTaxSettings(array $fields = array(), array $params = array(), $pending = false) {
|
312 |
$this->assureId();
|
313 |
|
331 |
return $pending ? $request : $request->execute();
|
332 |
}
|
333 |
|
334 |
+
public function createWhatsappChannel(array $fields = array(), array $params = array(), $pending = false) {
|
335 |
+
$this->assureId();
|
336 |
+
|
337 |
+
$param_types = array(
|
338 |
+
'op' => 'op_enum',
|
339 |
+
'whatsapp_business_accounts' => 'list<string>',
|
340 |
+
);
|
341 |
+
$enums = array(
|
342 |
+
'op_enum' => array(
|
343 |
+
'ADD',
|
344 |
+
'REMOVE',
|
345 |
+
),
|
346 |
+
);
|
347 |
+
|
348 |
+
$request = new ApiRequest(
|
349 |
+
$this->api,
|
350 |
+
$this->data['id'],
|
351 |
+
RequestInterface::METHOD_POST,
|
352 |
+
'/whatsapp_channel',
|
353 |
+
new AbstractCrudObject(),
|
354 |
+
'EDGE',
|
355 |
+
array(),
|
356 |
+
new TypeChecker($param_types, $enums)
|
357 |
+
);
|
358 |
+
$request->addParams($params);
|
359 |
+
$request->addFields($fields);
|
360 |
+
return $pending ? $request : $request->execute();
|
361 |
+
}
|
362 |
+
|
363 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
364 |
$this->assureId();
|
365 |
|
388 |
|
389 |
$param_types = array(
|
390 |
'contact_email' => 'string',
|
391 |
+
'cta' => 'cta_enum',
|
392 |
'merchant_alert_email' => 'string',
|
393 |
'merchant_status' => 'merchant_status_enum',
|
394 |
'onsite_commerce_merchant' => 'Object',
|
395 |
'terms' => 'string',
|
396 |
);
|
397 |
$enums = array(
|
398 |
+
'cta_enum' => CommerceMerchantSettingsCtaValues::getInstance()->getValues(),
|
399 |
'merchant_status_enum' => CommerceMerchantSettingsMerchantStatusValues::getInstance()->getValues(),
|
400 |
);
|
401 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/CommerceOrder.php
CHANGED
@@ -66,6 +66,7 @@ class CommerceOrder extends AbstractCrudObject {
|
|
66 |
$param_types = array(
|
67 |
'idempotency_key' => 'string',
|
68 |
'merchant_order_reference' => 'string',
|
|
|
69 |
);
|
70 |
$enums = array(
|
71 |
);
|
@@ -181,6 +182,29 @@ class CommerceOrder extends AbstractCrudObject {
|
|
181 |
return $pending ? $request : $request->execute();
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
public function getPromotions(array $fields = array(), array $params = array(), $pending = false) {
|
185 |
$this->assureId();
|
186 |
|
66 |
$param_types = array(
|
67 |
'idempotency_key' => 'string',
|
68 |
'merchant_order_reference' => 'string',
|
69 |
+
'return_error_response' => 'bool',
|
70 |
);
|
71 |
$enums = array(
|
72 |
);
|
182 |
return $pending ? $request : $request->execute();
|
183 |
}
|
184 |
|
185 |
+
public function getPromotionDetails(array $fields = array(), array $params = array(), $pending = false) {
|
186 |
+
$this->assureId();
|
187 |
+
|
188 |
+
$param_types = array(
|
189 |
+
);
|
190 |
+
$enums = array(
|
191 |
+
);
|
192 |
+
|
193 |
+
$request = new ApiRequest(
|
194 |
+
$this->api,
|
195 |
+
$this->data['id'],
|
196 |
+
RequestInterface::METHOD_GET,
|
197 |
+
'/promotion_details',
|
198 |
+
new AbstractCrudObject(),
|
199 |
+
'EDGE',
|
200 |
+
array(),
|
201 |
+
new TypeChecker($param_types, $enums)
|
202 |
+
);
|
203 |
+
$request->addParams($params);
|
204 |
+
$request->addFields($fields);
|
205 |
+
return $pending ? $request : $request->execute();
|
206 |
+
}
|
207 |
+
|
208 |
public function getPromotions(array $fields = array(), array $params = array(), $pending = false) {
|
209 |
$this->assureId();
|
210 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/CommerceOrderTransactionDetail.php
CHANGED
@@ -54,6 +54,29 @@ class CommerceOrderTransactionDetail extends AbstractCrudObject {
|
|
54 |
}
|
55 |
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
public function getTaxDetails(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
$this->assureId();
|
59 |
|
54 |
}
|
55 |
|
56 |
|
57 |
+
public function getItems(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
+
$this->assureId();
|
59 |
+
|
60 |
+
$param_types = array(
|
61 |
+
);
|
62 |
+
$enums = array(
|
63 |
+
);
|
64 |
+
|
65 |
+
$request = new ApiRequest(
|
66 |
+
$this->api,
|
67 |
+
$this->data['id'],
|
68 |
+
RequestInterface::METHOD_GET,
|
69 |
+
'/items',
|
70 |
+
new AbstractCrudObject(),
|
71 |
+
'EDGE',
|
72 |
+
array(),
|
73 |
+
new TypeChecker($param_types, $enums)
|
74 |
+
);
|
75 |
+
$request->addParams($params);
|
76 |
+
$request->addFields($fields);
|
77 |
+
return $pending ? $request : $request->execute();
|
78 |
+
}
|
79 |
+
|
80 |
public function getTaxDetails(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
$this->assureId();
|
82 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{CreativeAssetTag.php → ConnectionsTargeting.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\CreativeAssetTagFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\ConnectionsTargetingFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class ConnectionsTargeting extends AbstractCrudObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return ConnectionsTargetingFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return ConnectionsTargetingFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/DACheck.php
CHANGED
@@ -29,6 +29,7 @@ use FacebookAds\Cursor;
|
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\DACheckFields;
|
|
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -50,6 +51,7 @@ class DACheck extends AbstractObject {
|
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
52 |
$ref_enums = array();
|
|
|
53 |
return $ref_enums;
|
54 |
}
|
55 |
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\DACheckFields;
|
32 |
+
use FacebookAds\Object\Values\DACheckConnectionMethodValues;
|
33 |
|
34 |
/**
|
35 |
* This class is auto-generated.
|
51 |
|
52 |
protected static function getReferencedEnums() {
|
53 |
$ref_enums = array();
|
54 |
+
$ref_enums['ConnectionMethod'] = DACheckConnectionMethodValues::getInstance()->getValues();
|
55 |
return $ref_enums;
|
56 |
}
|
57 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Event.php
CHANGED
@@ -31,6 +31,7 @@ use FacebookAds\TypeChecker;
|
|
31 |
use FacebookAds\Object\Fields\EventFields;
|
32 |
use FacebookAds\Object\Values\EventCategoryValues;
|
33 |
use FacebookAds\Object\Values\EventEventStateFilterValues;
|
|
|
34 |
use FacebookAds\Object\Values\EventTimeFilterValues;
|
35 |
use FacebookAds\Object\Values\EventTypeValues;
|
36 |
use FacebookAds\Object\Values\LiveVideoProjectionValues;
|
@@ -60,6 +61,7 @@ class Event extends AbstractCrudObject {
|
|
60 |
protected static function getReferencedEnums() {
|
61 |
$ref_enums = array();
|
62 |
$ref_enums['Category'] = EventCategoryValues::getInstance()->getValues();
|
|
|
63 |
$ref_enums['Type'] = EventTypeValues::getInstance()->getValues();
|
64 |
$ref_enums['EventStateFilter'] = EventEventStateFilterValues::getInstance()->getValues();
|
65 |
$ref_enums['TimeFilter'] = EventTimeFilterValues::getInstance()->getValues();
|
@@ -142,6 +144,7 @@ class Event extends AbstractCrudObject {
|
|
142 |
$param_types = array(
|
143 |
'content_tags' => 'list<string>',
|
144 |
'description' => 'string',
|
|
|
145 |
'encoding_settings' => 'string',
|
146 |
'fisheye_video_cropped' => 'bool',
|
147 |
'front_z_rotation' => 'float',
|
@@ -153,7 +156,6 @@ class Event extends AbstractCrudObject {
|
|
153 |
'privacy' => 'string',
|
154 |
'projection' => 'projection_enum',
|
155 |
'published' => 'bool',
|
156 |
-
'save_vod' => 'bool',
|
157 |
'schedule_custom_profile_image' => 'file',
|
158 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
159 |
'status' => 'status_enum',
|
31 |
use FacebookAds\Object\Fields\EventFields;
|
32 |
use FacebookAds\Object\Values\EventCategoryValues;
|
33 |
use FacebookAds\Object\Values\EventEventStateFilterValues;
|
34 |
+
use FacebookAds\Object\Values\EventOnlineEventFormatValues;
|
35 |
use FacebookAds\Object\Values\EventTimeFilterValues;
|
36 |
use FacebookAds\Object\Values\EventTypeValues;
|
37 |
use FacebookAds\Object\Values\LiveVideoProjectionValues;
|
61 |
protected static function getReferencedEnums() {
|
62 |
$ref_enums = array();
|
63 |
$ref_enums['Category'] = EventCategoryValues::getInstance()->getValues();
|
64 |
+
$ref_enums['OnlineEventFormat'] = EventOnlineEventFormatValues::getInstance()->getValues();
|
65 |
$ref_enums['Type'] = EventTypeValues::getInstance()->getValues();
|
66 |
$ref_enums['EventStateFilter'] = EventEventStateFilterValues::getInstance()->getValues();
|
67 |
$ref_enums['TimeFilter'] = EventTimeFilterValues::getInstance()->getValues();
|
144 |
$param_types = array(
|
145 |
'content_tags' => 'list<string>',
|
146 |
'description' => 'string',
|
147 |
+
'enable_backup_ingest' => 'bool',
|
148 |
'encoding_settings' => 'string',
|
149 |
'fisheye_video_cropped' => 'bool',
|
150 |
'front_z_rotation' => 'float',
|
156 |
'privacy' => 'string',
|
157 |
'projection' => 'projection_enum',
|
158 |
'published' => 'bool',
|
|
|
159 |
'schedule_custom_profile_image' => 'file',
|
160 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
161 |
'status' => 'status_enum',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ExtendedCredit.php
CHANGED
@@ -160,6 +160,31 @@ class ExtendedCredit extends AbstractCrudObject {
|
|
160 |
return $pending ? $request : $request->execute();
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
164 |
$this->assureId();
|
165 |
|
160 |
return $pending ? $request : $request->execute();
|
161 |
}
|
162 |
|
163 |
+
public function createWhatsappCreditSharingAndAttach(array $fields = array(), array $params = array(), $pending = false) {
|
164 |
+
$this->assureId();
|
165 |
+
|
166 |
+
$param_types = array(
|
167 |
+
'waba_currency' => 'string',
|
168 |
+
'waba_id' => 'string',
|
169 |
+
);
|
170 |
+
$enums = array(
|
171 |
+
);
|
172 |
+
|
173 |
+
$request = new ApiRequest(
|
174 |
+
$this->api,
|
175 |
+
$this->data['id'],
|
176 |
+
RequestInterface::METHOD_POST,
|
177 |
+
'/whatsapp_credit_sharing_and_attach',
|
178 |
+
new AbstractCrudObject(),
|
179 |
+
'EDGE',
|
180 |
+
array(),
|
181 |
+
new TypeChecker($param_types, $enums)
|
182 |
+
);
|
183 |
+
$request->addParams($params);
|
184 |
+
$request->addFields($fields);
|
185 |
+
return $pending ? $request : $request->execute();
|
186 |
+
}
|
187 |
+
|
188 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
189 |
$this->assureId();
|
190 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ExternalEventSource.php
CHANGED
@@ -61,27 +61,4 @@ class ExternalEventSource extends AbstractCrudObject {
|
|
61 |
}
|
62 |
|
63 |
|
64 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
65 |
-
$this->assureId();
|
66 |
-
|
67 |
-
$param_types = array(
|
68 |
-
);
|
69 |
-
$enums = array(
|
70 |
-
);
|
71 |
-
|
72 |
-
$request = new ApiRequest(
|
73 |
-
$this->api,
|
74 |
-
$this->data['id'],
|
75 |
-
RequestInterface::METHOD_GET,
|
76 |
-
'/',
|
77 |
-
new ExternalEventSource(),
|
78 |
-
'NODE',
|
79 |
-
ExternalEventSource::getFieldsEnum()->getValues(),
|
80 |
-
new TypeChecker($param_types, $enums)
|
81 |
-
);
|
82 |
-
$request->addParams($params);
|
83 |
-
$request->addFields($fields);
|
84 |
-
return $pending ? $request : $request->execute();
|
85 |
-
}
|
86 |
-
|
87 |
}
|
61 |
}
|
62 |
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdAccountAdVolumeFields.php
CHANGED
@@ -38,14 +38,32 @@ use FacebookAds\Enum\AbstractEnum;
|
|
38 |
class AdAccountAdVolumeFields extends AbstractEnum {
|
39 |
|
40 |
const ACTOR_ID = 'actor_id';
|
|
|
|
|
|
|
|
|
41 |
const ADS_RUNNING_OR_IN_REVIEW_COUNT = 'ads_running_or_in_review_count';
|
|
|
42 |
const CURRENT_ACCOUNT_ADS_RUNNING_OR_IN_REVIEW_COUNT = 'current_account_ads_running_or_in_review_count';
|
|
|
|
|
|
|
|
|
43 |
|
44 |
public function getFieldTypes() {
|
45 |
return array(
|
46 |
'actor_id' => 'string',
|
|
|
|
|
|
|
|
|
47 |
'ads_running_or_in_review_count' => 'unsigned int',
|
|
|
48 |
'current_account_ads_running_or_in_review_count' => 'unsigned int',
|
|
|
|
|
|
|
|
|
49 |
);
|
50 |
}
|
51 |
}
|
38 |
class AdAccountAdVolumeFields extends AbstractEnum {
|
39 |
|
40 |
const ACTOR_ID = 'actor_id';
|
41 |
+
const ACTOR_NAME = 'actor_name';
|
42 |
+
const AD_LIMIT_SCOPE_BUSINESS = 'ad_limit_scope_business';
|
43 |
+
const AD_LIMIT_SCOPE_BUSINESS_MANAGER_ID = 'ad_limit_scope_business_manager_id';
|
44 |
+
const AD_LIMIT_SET_BY_PAGE_ADMIN = 'ad_limit_set_by_page_admin';
|
45 |
const ADS_RUNNING_OR_IN_REVIEW_COUNT = 'ads_running_or_in_review_count';
|
46 |
+
const ADS_RUNNING_OR_IN_REVIEW_COUNT_SUBJECT_TO_LIMIT_SET_BY_PAGE = 'ads_running_or_in_review_count_subject_to_limit_set_by_page';
|
47 |
const CURRENT_ACCOUNT_ADS_RUNNING_OR_IN_REVIEW_COUNT = 'current_account_ads_running_or_in_review_count';
|
48 |
+
const FUTURE_LIMIT_ACTIVATION_DATE = 'future_limit_activation_date';
|
49 |
+
const FUTURE_LIMIT_ON_ADS_RUNNING_OR_IN_REVIEW = 'future_limit_on_ads_running_or_in_review';
|
50 |
+
const LIMIT_ON_ADS_RUNNING_OR_IN_REVIEW = 'limit_on_ads_running_or_in_review';
|
51 |
+
const RECOMMENDATIONS = 'recommendations';
|
52 |
|
53 |
public function getFieldTypes() {
|
54 |
return array(
|
55 |
'actor_id' => 'string',
|
56 |
+
'actor_name' => 'string',
|
57 |
+
'ad_limit_scope_business' => 'Business',
|
58 |
+
'ad_limit_scope_business_manager_id' => 'string',
|
59 |
+
'ad_limit_set_by_page_admin' => 'unsigned int',
|
60 |
'ads_running_or_in_review_count' => 'unsigned int',
|
61 |
+
'ads_running_or_in_review_count_subject_to_limit_set_by_page' => 'unsigned int',
|
62 |
'current_account_ads_running_or_in_review_count' => 'unsigned int',
|
63 |
+
'future_limit_activation_date' => 'string',
|
64 |
+
'future_limit_on_ads_running_or_in_review' => 'unsigned int',
|
65 |
+
'limit_on_ads_running_or_in_review' => 'unsigned int',
|
66 |
+
'recommendations' => 'list<Object>',
|
67 |
);
|
68 |
}
|
69 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdAssetFeedSpecFields.php
CHANGED
@@ -51,6 +51,7 @@ class AdAssetFeedSpecFields extends AbstractEnum {
|
|
51 |
const IMAGES = 'images';
|
52 |
const LINK_URLS = 'link_urls';
|
53 |
const OPTIMIZATION_TYPE = 'optimization_type';
|
|
|
54 |
const TITLES = 'titles';
|
55 |
const VIDEOS = 'videos';
|
56 |
|
@@ -70,6 +71,7 @@ class AdAssetFeedSpecFields extends AbstractEnum {
|
|
70 |
'images' => 'list<AdAssetFeedSpecImage>',
|
71 |
'link_urls' => 'list<AdAssetFeedSpecLinkURL>',
|
72 |
'optimization_type' => 'string',
|
|
|
73 |
'titles' => 'list<AdAssetFeedSpecTitle>',
|
74 |
'videos' => 'list<AdAssetFeedSpecVideo>',
|
75 |
);
|
51 |
const IMAGES = 'images';
|
52 |
const LINK_URLS = 'link_urls';
|
53 |
const OPTIMIZATION_TYPE = 'optimization_type';
|
54 |
+
const POSTS = 'posts';
|
55 |
const TITLES = 'titles';
|
56 |
const VIDEOS = 'videos';
|
57 |
|
71 |
'images' => 'list<AdAssetFeedSpecImage>',
|
72 |
'link_urls' => 'list<AdAssetFeedSpecLinkURL>',
|
73 |
'optimization_type' => 'string',
|
74 |
+
'posts' => 'list<Object>',
|
75 |
'titles' => 'list<AdAssetFeedSpecTitle>',
|
76 |
'videos' => 'list<AdAssetFeedSpecVideo>',
|
77 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdCampaignActivityFields.php
CHANGED
@@ -53,8 +53,6 @@ class AdCampaignActivityFields extends AbstractEnum {
|
|
53 |
const BID_TYPE_OLD = 'bid_type_old';
|
54 |
const BILLING_EVENT_NEW = 'billing_event_new';
|
55 |
const BILLING_EVENT_OLD = 'billing_event_old';
|
56 |
-
const BRANDE_AUDIENCE_ID_NEW = 'brande_audience_id_new';
|
57 |
-
const BRANDE_AUDIENCE_ID_OLD = 'brande_audience_id_old';
|
58 |
const BUDGET_LIMIT_NEW = 'budget_limit_new';
|
59 |
const BUDGET_LIMIT_OLD = 'budget_limit_old';
|
60 |
const CREATED_TIME = 'created_time';
|
@@ -112,8 +110,6 @@ class AdCampaignActivityFields extends AbstractEnum {
|
|
112 |
'bid_type_old' => 'string',
|
113 |
'billing_event_new' => 'BillingEventNew',
|
114 |
'billing_event_old' => 'BillingEventOld',
|
115 |
-
'brande_audience_id_new' => 'BrandAudience',
|
116 |
-
'brande_audience_id_old' => 'BrandAudience',
|
117 |
'budget_limit_new' => 'Object',
|
118 |
'budget_limit_old' => 'Object',
|
119 |
'created_time' => 'datetime',
|
53 |
const BID_TYPE_OLD = 'bid_type_old';
|
54 |
const BILLING_EVENT_NEW = 'billing_event_new';
|
55 |
const BILLING_EVENT_OLD = 'billing_event_old';
|
|
|
|
|
56 |
const BUDGET_LIMIT_NEW = 'budget_limit_new';
|
57 |
const BUDGET_LIMIT_OLD = 'budget_limit_old';
|
58 |
const CREATED_TIME = 'created_time';
|
110 |
'bid_type_old' => 'string',
|
111 |
'billing_event_new' => 'BillingEventNew',
|
112 |
'billing_event_old' => 'BillingEventOld',
|
|
|
|
|
113 |
'budget_limit_new' => 'Object',
|
114 |
'budget_limit_old' => 'Object',
|
115 |
'created_time' => 'datetime',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{AtlasURLFields.php → AdCreativeInstagramBrandedContentFields.php}
RENAMED
@@ -35,13 +35,11 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
40 |
-
const URL = 'url';
|
41 |
|
42 |
public function getFieldTypes() {
|
43 |
return array(
|
44 |
-
'url' => 'string',
|
45 |
);
|
46 |
}
|
47 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class AdCreativeInstagramBrandedContentFields extends AbstractEnum {
|
39 |
|
|
|
40 |
|
41 |
public function getFieldTypes() {
|
42 |
return array(
|
|
|
43 |
);
|
44 |
}
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdCreativeInteractiveComponentsSpecFields.php
CHANGED
@@ -37,10 +37,12 @@ use FacebookAds\Enum\AbstractEnum;
|
|
37 |
|
38 |
class AdCreativeInteractiveComponentsSpecFields extends AbstractEnum {
|
39 |
|
|
|
40 |
const COMPONENTS = 'components';
|
41 |
|
42 |
public function getFieldTypes() {
|
43 |
return array(
|
|
|
44 |
'components' => 'list<Object>',
|
45 |
);
|
46 |
}
|
37 |
|
38 |
class AdCreativeInteractiveComponentsSpecFields extends AbstractEnum {
|
39 |
|
40 |
+
const CHILD_ATTACHMENTS = 'child_attachments';
|
41 |
const COMPONENTS = 'components';
|
42 |
|
43 |
public function getFieldTypes() {
|
44 |
return array(
|
45 |
+
'child_attachments' => 'list<Object>',
|
46 |
'components' => 'list<Object>',
|
47 |
);
|
48 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdPlacePageSetFields.php
CHANGED
@@ -43,6 +43,7 @@ class AdPlacePageSetFields extends AbstractEnum {
|
|
43 |
const NAME = 'name';
|
44 |
const PAGES_COUNT = 'pages_count';
|
45 |
const PARENT_PAGE = 'parent_page';
|
|
|
46 |
const TARGETED_AREA_TYPE = 'targeted_area_type';
|
47 |
|
48 |
public function getFieldTypes() {
|
@@ -53,6 +54,7 @@ class AdPlacePageSetFields extends AbstractEnum {
|
|
53 |
'name' => 'string',
|
54 |
'pages_count' => 'int',
|
55 |
'parent_page' => 'Page',
|
|
|
56 |
'targeted_area_type' => 'TargetedAreaType',
|
57 |
);
|
58 |
}
|
43 |
const NAME = 'name';
|
44 |
const PAGES_COUNT = 'pages_count';
|
45 |
const PARENT_PAGE = 'parent_page';
|
46 |
+
const CATEGORY = 'category';
|
47 |
const TARGETED_AREA_TYPE = 'targeted_area_type';
|
48 |
|
49 |
public function getFieldTypes() {
|
54 |
'name' => 'string',
|
55 |
'pages_count' => 'int',
|
56 |
'parent_page' => 'Page',
|
57 |
+
'category' => 'Category',
|
58 |
'targeted_area_type' => 'TargetedAreaType',
|
59 |
);
|
60 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdReportSpecFields.php
CHANGED
@@ -48,7 +48,6 @@ class AdReportSpecFields extends AbstractEnum {
|
|
48 |
const ID = 'id';
|
49 |
const INSIGHTS_SECTION = 'insights_section';
|
50 |
const NAME = 'name';
|
51 |
-
const REPORT_SCHEDULE = 'report_schedule';
|
52 |
const REPORT_SCHEDULE_ID = 'report_schedule_id';
|
53 |
const SORT_BY = 'sort_by';
|
54 |
const SORT_DIR = 'sort_dir';
|
@@ -69,7 +68,6 @@ class AdReportSpecFields extends AbstractEnum {
|
|
69 |
'id' => 'string',
|
70 |
'insights_section' => 'Object',
|
71 |
'name' => 'string',
|
72 |
-
'report_schedule' => 'Object',
|
73 |
'report_schedule_id' => 'string',
|
74 |
'sort_by' => 'string',
|
75 |
'sort_dir' => 'string',
|
48 |
const ID = 'id';
|
49 |
const INSIGHTS_SECTION = 'insights_section';
|
50 |
const NAME = 'name';
|
|
|
51 |
const REPORT_SCHEDULE_ID = 'report_schedule_id';
|
52 |
const SORT_BY = 'sort_by';
|
53 |
const SORT_DIR = 'sort_dir';
|
68 |
'id' => 'string',
|
69 |
'insights_section' => 'Object',
|
70 |
'name' => 'string',
|
|
|
71 |
'report_schedule_id' => 'string',
|
72 |
'sort_by' => 'string',
|
73 |
'sort_dir' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdgroupPlacementSpecificReviewFeedbackFields.php
CHANGED
@@ -39,12 +39,16 @@ class AdgroupPlacementSpecificReviewFeedbackFields extends AbstractEnum {
|
|
39 |
|
40 |
const ACCOUNT_ADMIN = 'account_admin';
|
41 |
const AD = 'ad';
|
|
|
42 |
const B2C = 'b2c';
|
|
|
43 |
const BSG = 'bsg';
|
44 |
const CITY_COMMUNITY = 'city_community';
|
|
|
45 |
const DAILY_DEALS = 'daily_deals';
|
46 |
const DAILY_DEALS_LEGACY = 'daily_deals_legacy';
|
47 |
const DPA = 'dpa';
|
|
|
48 |
const DRI_COUNTERFEIT = 'dri_counterfeit';
|
49 |
const FACEBOOK = 'facebook';
|
50 |
const FACEBOOK_PAGES_LIVE_SHOPPING = 'facebook_pages_live_shopping';
|
@@ -70,12 +74,16 @@ class AdgroupPlacementSpecificReviewFeedbackFields extends AbstractEnum {
|
|
70 |
return array(
|
71 |
'account_admin' => 'map<string, string>',
|
72 |
'ad' => 'map<string, string>',
|
|
|
73 |
'b2c' => 'map<string, string>',
|
|
|
74 |
'bsg' => 'map<string, string>',
|
75 |
'city_community' => 'map<string, string>',
|
|
|
76 |
'daily_deals' => 'map<string, string>',
|
77 |
'daily_deals_legacy' => 'map<string, string>',
|
78 |
'dpa' => 'map<string, string>',
|
|
|
79 |
'dri_counterfeit' => 'map<string, string>',
|
80 |
'facebook' => 'map<string, string>',
|
81 |
'facebook_pages_live_shopping' => 'map<string, string>',
|
39 |
|
40 |
const ACCOUNT_ADMIN = 'account_admin';
|
41 |
const AD = 'ad';
|
42 |
+
const ADS_CONVERSION_EXPERIENCES = 'ads_conversion_experiences';
|
43 |
const B2C = 'b2c';
|
44 |
+
const B2C_COMMERCE_UNIFIED = 'b2c_commerce_unified';
|
45 |
const BSG = 'bsg';
|
46 |
const CITY_COMMUNITY = 'city_community';
|
47 |
+
const COMMERCE = 'commerce';
|
48 |
const DAILY_DEALS = 'daily_deals';
|
49 |
const DAILY_DEALS_LEGACY = 'daily_deals_legacy';
|
50 |
const DPA = 'dpa';
|
51 |
+
const DRI_COPYRIGHT = 'dri_copyright';
|
52 |
const DRI_COUNTERFEIT = 'dri_counterfeit';
|
53 |
const FACEBOOK = 'facebook';
|
54 |
const FACEBOOK_PAGES_LIVE_SHOPPING = 'facebook_pages_live_shopping';
|
74 |
return array(
|
75 |
'account_admin' => 'map<string, string>',
|
76 |
'ad' => 'map<string, string>',
|
77 |
+
'ads_conversion_experiences' => 'map<string, string>',
|
78 |
'b2c' => 'map<string, string>',
|
79 |
+
'b2c_commerce_unified' => 'map<string, string>',
|
80 |
'bsg' => 'map<string, string>',
|
81 |
'city_community' => 'map<string, string>',
|
82 |
+
'commerce' => 'map<string, string>',
|
83 |
'daily_deals' => 'map<string, string>',
|
84 |
'daily_deals_legacy' => 'map<string, string>',
|
85 |
'dpa' => 'map<string, string>',
|
86 |
+
'dri_copyright' => 'map<string, string>',
|
87 |
'dri_counterfeit' => 'map<string, string>',
|
88 |
'facebook' => 'map<string, string>',
|
89 |
'facebook_pages_live_shopping' => 'map<string, string>',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{AdsInterestFields.php → AdoptablePetFields.php}
RENAMED
@@ -35,25 +35,53 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
40 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
const DESCRIPTION = 'description';
|
42 |
-
const
|
43 |
const ID = 'id';
|
|
|
44 |
const NAME = 'name';
|
45 |
-
const
|
46 |
-
const
|
|
|
|
|
|
|
|
|
47 |
|
48 |
public function getFieldTypes() {
|
49 |
return array(
|
50 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
'description' => 'string',
|
52 |
-
'
|
53 |
'id' => 'string',
|
|
|
54 |
'name' => 'string',
|
55 |
-
'
|
56 |
-
'
|
|
|
|
|
|
|
|
|
57 |
);
|
58 |
}
|
59 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class AdoptablePetFields extends AbstractEnum {
|
39 |
|
40 |
+
const ADDRESS = 'address';
|
41 |
+
const ADOPTABLE_PET_ID = 'adoptable_pet_id';
|
42 |
+
const ADOPTION_APPLICATION_FORM_URL = 'adoption_application_form_url';
|
43 |
+
const AGE_BUCKET = 'age_bucket';
|
44 |
+
const ANIMAL_TYPE = 'animal_type';
|
45 |
+
const APPLINKS = 'applinks';
|
46 |
+
const AVAILABILITY = 'availability';
|
47 |
+
const BREED = 'breed';
|
48 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
49 |
+
const CURRENCY = 'currency';
|
50 |
const DESCRIPTION = 'description';
|
51 |
+
const GENDER = 'gender';
|
52 |
const ID = 'id';
|
53 |
+
const IMAGES = 'images';
|
54 |
const NAME = 'name';
|
55 |
+
const PRICE = 'price';
|
56 |
+
const SANITIZED_IMAGES = 'sanitized_images';
|
57 |
+
const SHELTER_NAME = 'shelter_name';
|
58 |
+
const SHELTER_PAGE_ID = 'shelter_page_id';
|
59 |
+
const SIZE = 'size';
|
60 |
+
const URL = 'url';
|
61 |
|
62 |
public function getFieldTypes() {
|
63 |
return array(
|
64 |
+
'address' => 'Object',
|
65 |
+
'adoptable_pet_id' => 'string',
|
66 |
+
'adoption_application_form_url' => 'string',
|
67 |
+
'age_bucket' => 'string',
|
68 |
+
'animal_type' => 'string',
|
69 |
+
'applinks' => 'CatalogItemAppLinks',
|
70 |
+
'availability' => 'string',
|
71 |
+
'breed' => 'string',
|
72 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
73 |
+
'currency' => 'string',
|
74 |
'description' => 'string',
|
75 |
+
'gender' => 'string',
|
76 |
'id' => 'string',
|
77 |
+
'images' => 'list<string>',
|
78 |
'name' => 'string',
|
79 |
+
'price' => 'string',
|
80 |
+
'sanitized_images' => 'list<string>',
|
81 |
+
'shelter_name' => 'string',
|
82 |
+
'shelter_page_id' => 'Page',
|
83 |
+
'size' => 'string',
|
84 |
+
'url' => 'string',
|
85 |
);
|
86 |
}
|
87 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdsInsightsFields.php
CHANGED
@@ -67,6 +67,7 @@ class AdsInsightsFields extends AbstractEnum {
|
|
67 |
const CAMPAIGN_NAME = 'campaign_name';
|
68 |
const CANVAS_AVG_VIEW_PERCENT = 'canvas_avg_view_percent';
|
69 |
const CANVAS_AVG_VIEW_TIME = 'canvas_avg_view_time';
|
|
|
70 |
const CATALOG_SEGMENT_VALUE = 'catalog_segment_value';
|
71 |
const CATALOG_SEGMENT_VALUE_MOBILE_PURCHASE_ROAS = 'catalog_segment_value_mobile_purchase_roas';
|
72 |
const CATALOG_SEGMENT_VALUE_OMNI_PURCHASE_ROAS = 'catalog_segment_value_omni_purchase_roas';
|
@@ -75,6 +76,8 @@ class AdsInsightsFields extends AbstractEnum {
|
|
75 |
const CONVERSION_RATE_RANKING = 'conversion_rate_ranking';
|
76 |
const CONVERSION_VALUES = 'conversion_values';
|
77 |
const CONVERSIONS = 'conversions';
|
|
|
|
|
78 |
const COST_PER_15_SEC_VIDEO_VIEW = 'cost_per_15_sec_video_view';
|
79 |
const COST_PER_2_SEC_CONTINUOUS_VIDEO_VIEW = 'cost_per_2_sec_continuous_video_view';
|
80 |
const COST_PER_ACTION_TYPE = 'cost_per_action_type';
|
@@ -119,6 +122,7 @@ class AdsInsightsFields extends AbstractEnum {
|
|
119 |
const INSTANT_EXPERIENCE_CLICKS_TO_OPEN = 'instant_experience_clicks_to_open';
|
120 |
const INSTANT_EXPERIENCE_CLICKS_TO_START = 'instant_experience_clicks_to_start';
|
121 |
const INSTANT_EXPERIENCE_OUTBOUND_CLICKS = 'instant_experience_outbound_clicks';
|
|
|
122 |
const LABELS = 'labels';
|
123 |
const LOCATION = 'location';
|
124 |
const MOBILE_APP_PURCHASE_ROAS = 'mobile_app_purchase_roas';
|
@@ -200,6 +204,7 @@ class AdsInsightsFields extends AbstractEnum {
|
|
200 |
'campaign_name' => 'string',
|
201 |
'canvas_avg_view_percent' => 'string',
|
202 |
'canvas_avg_view_time' => 'string',
|
|
|
203 |
'catalog_segment_value' => 'list<AdsActionStats>',
|
204 |
'catalog_segment_value_mobile_purchase_roas' => 'list<AdsActionStats>',
|
205 |
'catalog_segment_value_omni_purchase_roas' => 'list<AdsActionStats>',
|
@@ -208,6 +213,8 @@ class AdsInsightsFields extends AbstractEnum {
|
|
208 |
'conversion_rate_ranking' => 'string',
|
209 |
'conversion_values' => 'list<AdsActionStats>',
|
210 |
'conversions' => 'list<AdsActionStats>',
|
|
|
|
|
211 |
'cost_per_15_sec_video_view' => 'list<AdsActionStats>',
|
212 |
'cost_per_2_sec_continuous_video_view' => 'list<AdsActionStats>',
|
213 |
'cost_per_action_type' => 'list<AdsActionStats>',
|
@@ -252,6 +259,7 @@ class AdsInsightsFields extends AbstractEnum {
|
|
252 |
'instant_experience_clicks_to_open' => 'string',
|
253 |
'instant_experience_clicks_to_start' => 'string',
|
254 |
'instant_experience_outbound_clicks' => 'string',
|
|
|
255 |
'labels' => 'string',
|
256 |
'location' => 'string',
|
257 |
'mobile_app_purchase_roas' => 'list<AdsActionStats>',
|
67 |
const CAMPAIGN_NAME = 'campaign_name';
|
68 |
const CANVAS_AVG_VIEW_PERCENT = 'canvas_avg_view_percent';
|
69 |
const CANVAS_AVG_VIEW_TIME = 'canvas_avg_view_time';
|
70 |
+
const CATALOG_SEGMENT_ACTIONS = 'catalog_segment_actions';
|
71 |
const CATALOG_SEGMENT_VALUE = 'catalog_segment_value';
|
72 |
const CATALOG_SEGMENT_VALUE_MOBILE_PURCHASE_ROAS = 'catalog_segment_value_mobile_purchase_roas';
|
73 |
const CATALOG_SEGMENT_VALUE_OMNI_PURCHASE_ROAS = 'catalog_segment_value_omni_purchase_roas';
|
76 |
const CONVERSION_RATE_RANKING = 'conversion_rate_ranking';
|
77 |
const CONVERSION_VALUES = 'conversion_values';
|
78 |
const CONVERSIONS = 'conversions';
|
79 |
+
const CONVERTED_PRODUCT_QUANTITY = 'converted_product_quantity';
|
80 |
+
const CONVERTED_PRODUCT_VALUE = 'converted_product_value';
|
81 |
const COST_PER_15_SEC_VIDEO_VIEW = 'cost_per_15_sec_video_view';
|
82 |
const COST_PER_2_SEC_CONTINUOUS_VIDEO_VIEW = 'cost_per_2_sec_continuous_video_view';
|
83 |
const COST_PER_ACTION_TYPE = 'cost_per_action_type';
|
122 |
const INSTANT_EXPERIENCE_CLICKS_TO_OPEN = 'instant_experience_clicks_to_open';
|
123 |
const INSTANT_EXPERIENCE_CLICKS_TO_START = 'instant_experience_clicks_to_start';
|
124 |
const INSTANT_EXPERIENCE_OUTBOUND_CLICKS = 'instant_experience_outbound_clicks';
|
125 |
+
const INTERACTIVE_COMPONENT_TAP = 'interactive_component_tap';
|
126 |
const LABELS = 'labels';
|
127 |
const LOCATION = 'location';
|
128 |
const MOBILE_APP_PURCHASE_ROAS = 'mobile_app_purchase_roas';
|
204 |
'campaign_name' => 'string',
|
205 |
'canvas_avg_view_percent' => 'string',
|
206 |
'canvas_avg_view_time' => 'string',
|
207 |
+
'catalog_segment_actions' => 'list<AdsActionStats>',
|
208 |
'catalog_segment_value' => 'list<AdsActionStats>',
|
209 |
'catalog_segment_value_mobile_purchase_roas' => 'list<AdsActionStats>',
|
210 |
'catalog_segment_value_omni_purchase_roas' => 'list<AdsActionStats>',
|
213 |
'conversion_rate_ranking' => 'string',
|
214 |
'conversion_values' => 'list<AdsActionStats>',
|
215 |
'conversions' => 'list<AdsActionStats>',
|
216 |
+
'converted_product_quantity' => 'list<AdsActionStats>',
|
217 |
+
'converted_product_value' => 'list<AdsActionStats>',
|
218 |
'cost_per_15_sec_video_view' => 'list<AdsActionStats>',
|
219 |
'cost_per_2_sec_continuous_video_view' => 'list<AdsActionStats>',
|
220 |
'cost_per_action_type' => 'list<AdsActionStats>',
|
259 |
'instant_experience_clicks_to_open' => 'string',
|
260 |
'instant_experience_clicks_to_start' => 'string',
|
261 |
'instant_experience_outbound_clicks' => 'string',
|
262 |
+
'interactive_component_tap' => 'list<AdsActionStats>',
|
263 |
'labels' => 'string',
|
264 |
'location' => 'string',
|
265 |
'mobile_app_purchase_roas' => 'list<AdsActionStats>',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AutomotiveModelFields.php
CHANGED
@@ -41,6 +41,7 @@ class AutomotiveModelFields extends AbstractEnum {
|
|
41 |
const AUTOMOTIVE_MODEL_ID = 'automotive_model_id';
|
42 |
const AVAILABILITY = 'availability';
|
43 |
const BODY_STYLE = 'body_style';
|
|
|
44 |
const CURRENCY = 'currency';
|
45 |
const CUSTOM_LABEL_0 = 'custom_label_0';
|
46 |
const DESCRIPTION = 'description';
|
@@ -70,6 +71,7 @@ class AutomotiveModelFields extends AbstractEnum {
|
|
70 |
'automotive_model_id' => 'string',
|
71 |
'availability' => 'string',
|
72 |
'body_style' => 'string',
|
|
|
73 |
'currency' => 'string',
|
74 |
'custom_label_0' => 'string',
|
75 |
'description' => 'string',
|
41 |
const AUTOMOTIVE_MODEL_ID = 'automotive_model_id';
|
42 |
const AVAILABILITY = 'availability';
|
43 |
const BODY_STYLE = 'body_style';
|
44 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
45 |
const CURRENCY = 'currency';
|
46 |
const CUSTOM_LABEL_0 = 'custom_label_0';
|
47 |
const DESCRIPTION = 'description';
|
71 |
'automotive_model_id' => 'string',
|
72 |
'availability' => 'string',
|
73 |
'body_style' => 'string',
|
74 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
75 |
'currency' => 'string',
|
76 |
'custom_label_0' => 'string',
|
77 |
'description' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/BusinessCreativeFields.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class BusinessCreativeFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const CREATION_TIME = 'creation_time';
|
41 |
-
const DURATION = 'duration';
|
42 |
-
const HASH = 'hash';
|
43 |
-
const HEIGHT = 'height';
|
44 |
-
const ID = 'id';
|
45 |
-
const NAME = 'name';
|
46 |
-
const THUMBNAIL = 'thumbnail';
|
47 |
-
const TYPE = 'type';
|
48 |
-
const URL = 'url';
|
49 |
-
const VIDEO_ID = 'video_id';
|
50 |
-
const WIDTH = 'width';
|
51 |
-
|
52 |
-
public function getFieldTypes() {
|
53 |
-
return array(
|
54 |
-
'creation_time' => 'datetime',
|
55 |
-
'duration' => 'int',
|
56 |
-
'hash' => 'string',
|
57 |
-
'height' => 'int',
|
58 |
-
'id' => 'string',
|
59 |
-
'name' => 'string',
|
60 |
-
'thumbnail' => 'string',
|
61 |
-
'type' => 'string',
|
62 |
-
'url' => 'string',
|
63 |
-
'video_id' => 'string',
|
64 |
-
'width' => 'int',
|
65 |
-
);
|
66 |
-
}
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/BusinessCreativeFolderFields.php
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class BusinessCreativeFolderFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const BUSINESS = 'business';
|
41 |
-
const CREATION_TIME = 'creation_time';
|
42 |
-
const CREATIVE_INSIGHT_PERMISSIONS = 'creative_insight_permissions';
|
43 |
-
const DESCRIPTION = 'description';
|
44 |
-
const ID = 'id';
|
45 |
-
const MEDIA_LIBRARY_URL = 'media_library_url';
|
46 |
-
const NAME = 'name';
|
47 |
-
const PARENT_FOLDER = 'parent_folder';
|
48 |
-
const PARENT_FOLDER_ID = 'parent_folder_id';
|
49 |
-
|
50 |
-
public function getFieldTypes() {
|
51 |
-
return array(
|
52 |
-
'business' => 'Business',
|
53 |
-
'creation_time' => 'datetime',
|
54 |
-
'creative_insight_permissions' => 'map<string, string>',
|
55 |
-
'description' => 'string',
|
56 |
-
'id' => 'string',
|
57 |
-
'media_library_url' => 'string',
|
58 |
-
'name' => 'string',
|
59 |
-
'parent_folder' => 'BusinessCreativeFolder',
|
60 |
-
'parent_folder_id' => 'string',
|
61 |
-
);
|
62 |
-
}
|
63 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/BusinessImageFields.php
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class BusinessImageFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const BUSINESS = 'business';
|
41 |
-
const CREATION_TIME = 'creation_time';
|
42 |
-
const HASH = 'hash';
|
43 |
-
const HEIGHT = 'height';
|
44 |
-
const ID = 'id';
|
45 |
-
const MEDIA_LIBRARY_URL = 'media_library_url';
|
46 |
-
const NAME = 'name';
|
47 |
-
const URL = 'url';
|
48 |
-
const URL_128 = 'url_128';
|
49 |
-
const WIDTH = 'width';
|
50 |
-
const AD_PLACEMENTS_VALIDATION_ONLY = 'ad_placements_validation_only';
|
51 |
-
const BYTES = 'bytes';
|
52 |
-
const CREATIVE_FOLDER_ID = 'creative_folder_id';
|
53 |
-
const VALIDATION_AD_PLACEMENTS = 'validation_ad_placements';
|
54 |
-
|
55 |
-
public function getFieldTypes() {
|
56 |
-
return array(
|
57 |
-
'business' => 'Business',
|
58 |
-
'creation_time' => 'datetime',
|
59 |
-
'hash' => 'string',
|
60 |
-
'height' => 'int',
|
61 |
-
'id' => 'string',
|
62 |
-
'media_library_url' => 'string',
|
63 |
-
'name' => 'string',
|
64 |
-
'url' => 'string',
|
65 |
-
'url_128' => 'string',
|
66 |
-
'width' => 'int',
|
67 |
-
'ad_placements_validation_only' => 'bool',
|
68 |
-
'bytes' => 'Object',
|
69 |
-
'creative_folder_id' => 'string',
|
70 |
-
'validation_ad_placements' => 'list<ValidationAdPlacements>',
|
71 |
-
);
|
72 |
-
}
|
73 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{BusinessCreativeFolderSharingAgreementFields.php → CPASAdvertiserPartnershipRecommendationFields.php}
RENAMED
@@ -35,19 +35,29 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
40 |
-
const
|
|
|
|
|
|
|
41 |
const ID = 'id';
|
42 |
-
const
|
|
|
43 |
const STATUS = 'status';
|
|
|
44 |
|
45 |
public function getFieldTypes() {
|
46 |
return array(
|
47 |
-
'
|
|
|
|
|
|
|
48 |
'id' => 'string',
|
49 |
-
'
|
|
|
50 |
'status' => 'string',
|
|
|
51 |
);
|
52 |
}
|
53 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class CPASAdvertiserPartnershipRecommendationFields extends AbstractEnum {
|
39 |
|
40 |
+
const ADVERTISER_BUSINESS_ID = 'advertiser_business_id';
|
41 |
+
const BRAND_BUSINESS_ID = 'brand_business_id';
|
42 |
+
const BRANDS = 'brands';
|
43 |
+
const COUNTRIES = 'countries';
|
44 |
const ID = 'id';
|
45 |
+
const MERCHANT_BUSINESS_ID = 'merchant_business_id';
|
46 |
+
const MERCHANT_CATEGORIES = 'merchant_categories';
|
47 |
const STATUS = 'status';
|
48 |
+
const STATUS_REASON = 'status_reason';
|
49 |
|
50 |
public function getFieldTypes() {
|
51 |
return array(
|
52 |
+
'advertiser_business_id' => 'string',
|
53 |
+
'brand_business_id' => 'string',
|
54 |
+
'brands' => 'list<string>',
|
55 |
+
'countries' => 'list<string>',
|
56 |
'id' => 'string',
|
57 |
+
'merchant_business_id' => 'string',
|
58 |
+
'merchant_categories' => 'list<string>',
|
59 |
'status' => 'string',
|
60 |
+
'status_reason' => 'string',
|
61 |
);
|
62 |
}
|
63 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{BrandAudienceFields.php → CPASCollaborationRequestFields.php}
RENAMED
@@ -35,31 +35,31 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
|
|
43 |
const ID = 'id';
|
44 |
-
const
|
45 |
-
const
|
|
|
|
|
46 |
const STATUS = 'status';
|
47 |
-
const TARGETING = 'targeting';
|
48 |
-
const TIME_CREATED = 'time_created';
|
49 |
-
const TIME_UPDATED = 'time_updated';
|
50 |
|
51 |
public function getFieldTypes() {
|
52 |
return array(
|
53 |
-
'
|
54 |
-
'
|
55 |
-
'
|
|
|
56 |
'id' => 'string',
|
57 |
-
'
|
58 |
-
'
|
|
|
|
|
59 |
'status' => 'string',
|
60 |
-
'targeting' => 'Targeting',
|
61 |
-
'time_created' => 'datetime',
|
62 |
-
'time_updated' => 'datetime',
|
63 |
);
|
64 |
}
|
65 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class CPASCollaborationRequestFields extends AbstractEnum {
|
39 |
|
40 |
+
const BRANDS = 'brands';
|
41 |
+
const CONTACT_EMAIL = 'contact_email';
|
42 |
+
const CONTACT_FIRST_NAME = 'contact_first_name';
|
43 |
+
const CONTACT_LAST_NAME = 'contact_last_name';
|
44 |
const ID = 'id';
|
45 |
+
const PHONE_NUMBER = 'phone_number';
|
46 |
+
const RECEIVER_BUSINESS = 'receiver_business';
|
47 |
+
const REQUESTER_AGENCY_OR_BRAND = 'requester_agency_or_brand';
|
48 |
+
const SENDER_CLIENT_BUSINESS = 'sender_client_business';
|
49 |
const STATUS = 'status';
|
|
|
|
|
|
|
50 |
|
51 |
public function getFieldTypes() {
|
52 |
return array(
|
53 |
+
'brands' => 'list<string>',
|
54 |
+
'contact_email' => 'string',
|
55 |
+
'contact_first_name' => 'string',
|
56 |
+
'contact_last_name' => 'string',
|
57 |
'id' => 'string',
|
58 |
+
'phone_number' => 'string',
|
59 |
+
'receiver_business' => 'Business',
|
60 |
+
'requester_agency_or_brand' => 'string',
|
61 |
+
'sender_client_business' => 'Business',
|
62 |
'status' => 'string',
|
|
|
|
|
|
|
63 |
);
|
64 |
}
|
65 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CampaignFields.php
CHANGED
@@ -64,6 +64,7 @@ class CampaignFields extends AbstractEnum {
|
|
64 |
const SOURCE_CAMPAIGN_ID = 'source_campaign_id';
|
65 |
const SPECIAL_AD_CATEGORIES = 'special_ad_categories';
|
66 |
const SPECIAL_AD_CATEGORY = 'special_ad_category';
|
|
|
67 |
const SPEND_CAP = 'spend_cap';
|
68 |
const START_TIME = 'start_time';
|
69 |
const STATUS = 'status';
|
@@ -104,6 +105,7 @@ class CampaignFields extends AbstractEnum {
|
|
104 |
'source_campaign_id' => 'string',
|
105 |
'special_ad_categories' => 'list<string>',
|
106 |
'special_ad_category' => 'string',
|
|
|
107 |
'spend_cap' => 'string',
|
108 |
'start_time' => 'datetime',
|
109 |
'status' => 'Status',
|
64 |
const SOURCE_CAMPAIGN_ID = 'source_campaign_id';
|
65 |
const SPECIAL_AD_CATEGORIES = 'special_ad_categories';
|
66 |
const SPECIAL_AD_CATEGORY = 'special_ad_category';
|
67 |
+
const SPECIAL_AD_CATEGORY_COUNTRY = 'special_ad_category_country';
|
68 |
const SPEND_CAP = 'spend_cap';
|
69 |
const START_TIME = 'start_time';
|
70 |
const STATUS = 'status';
|
105 |
'source_campaign_id' => 'string',
|
106 |
'special_ad_categories' => 'list<string>',
|
107 |
'special_ad_category' => 'string',
|
108 |
+
'special_ad_category_country' => 'list<string>',
|
109 |
'spend_cap' => 'string',
|
110 |
'start_time' => 'datetime',
|
111 |
'status' => 'Status',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CatalogSubVerticalListFields.php
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Fields;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
|
38 |
+
class CatalogSubVerticalListFields extends AbstractEnum {
|
39 |
+
|
40 |
+
const APPLIANCES = 'appliances';
|
41 |
+
const BABY_FEEDING = 'baby_feeding';
|
42 |
+
const BABY_TRANSPORT = 'baby_transport';
|
43 |
+
const BEAUTY = 'beauty';
|
44 |
+
const BEDDING = 'bedding';
|
45 |
+
const CAMERAS = 'cameras';
|
46 |
+
const CAMERAS_AND_PHOTOS = 'cameras_and_photos';
|
47 |
+
const CELL_PHONES_AND_SMART_WATCHES = 'cell_phones_and_smart_watches';
|
48 |
+
const CLEANING_SUPPLIES = 'cleaning_supplies';
|
49 |
+
const CLO_OFFER = 'clo_offer';
|
50 |
+
const CLOTHING = 'clothing';
|
51 |
+
const CLOTHING_ACCESSORIES = 'clothing_accessories';
|
52 |
+
const CLOTHING_GROUP = 'clothing_group';
|
53 |
+
const COMPUTER_COMPONENTS = 'computer_components';
|
54 |
+
const COMPUTERS_AND_TABLETS = 'computers_and_tablets';
|
55 |
+
const COMPUTERS_LAPTOPS_AND_TABLETS = 'computers_laptops_and_tablets';
|
56 |
+
const DIAPERING_AND_POTTY_TRAINING = 'diapering_and_potty_training';
|
57 |
+
const ELECTRONIC_ACCESSORIES_AND_CABLES = 'electronic_accessories_and_cables';
|
58 |
+
const ELECTRONICS_ACCESSORIES = 'electronics_accessories';
|
59 |
+
const FURNITURE = 'furniture';
|
60 |
+
const HEALTH = 'health';
|
61 |
+
const HOME = 'home';
|
62 |
+
const HOME_GOODS = 'home_goods';
|
63 |
+
const HOUSEHOLD_AND_CLEANING_SUPPLIES = 'household_and_cleaning_supplies';
|
64 |
+
const JEWELRY = 'jewelry';
|
65 |
+
const LARGE_APPLIANCES = 'large_appliances';
|
66 |
+
const LOYALTY_OFFER = 'loyalty_offer';
|
67 |
+
const MEETUP_SPACE = 'meetup_space';
|
68 |
+
const NURSERY = 'nursery';
|
69 |
+
const PRINTERS_AND_SCANNERS = 'printers_and_scanners';
|
70 |
+
const PRINTERS_SCANNERS_AND_FAX_MACHINES = 'printers_scanners_and_fax_machines';
|
71 |
+
const PRODUCT_DISCOUNT = 'product_discount';
|
72 |
+
const PROJECTORS = 'projectors';
|
73 |
+
const SHOES = 'shoes';
|
74 |
+
const SHOES_AND_FOOTWEAR = 'shoes_and_footwear';
|
75 |
+
const SOFTWARE = 'software';
|
76 |
+
const TELEVISIONS_AND_MONITORS = 'televisions_and_monitors';
|
77 |
+
const TEST_CHILD_SUB_VERTICAL = 'test_child_sub_vertical';
|
78 |
+
const TEST_GRAND_CHILD_SUB_VERTICAL = 'test_grand_child_sub_vertical';
|
79 |
+
const TEST_SUB_VERTICAL = 'test_sub_vertical';
|
80 |
+
const TEST_SUB_VERTICAL_ALIAS = 'test_sub_vertical_alias';
|
81 |
+
const TEST_SUB_VERTICAL_DATA_OBJECT = 'test_sub_vertical_data_object';
|
82 |
+
const THIRD_PARTY_ELECTRONICS = 'third_party_electronics';
|
83 |
+
const THIRD_PARTY_TOYS_AND_GAMES = 'third_party_toys_and_games';
|
84 |
+
const TOYS = 'toys';
|
85 |
+
const TOYS_AND_GAMES = 'toys_and_games';
|
86 |
+
const TVS_AND_MONITORS = 'tvs_and_monitors';
|
87 |
+
const VEHICLE_MANUFACTURER = 'vehicle_manufacturer';
|
88 |
+
const VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES = 'video_game_consoles_and_video_games';
|
89 |
+
const VIDEO_GAMES_AND_CONSOLES = 'video_games_and_consoles';
|
90 |
+
const VIDEO_PROJECTORS = 'video_projectors';
|
91 |
+
const WATCHES = 'watches';
|
92 |
+
|
93 |
+
public function getFieldTypes() {
|
94 |
+
return array(
|
95 |
+
'appliances' => 'Object',
|
96 |
+
'baby_feeding' => 'Object',
|
97 |
+
'baby_transport' => 'Object',
|
98 |
+
'beauty' => 'Object',
|
99 |
+
'bedding' => 'Object',
|
100 |
+
'cameras' => 'Object',
|
101 |
+
'cameras_and_photos' => 'Object',
|
102 |
+
'cell_phones_and_smart_watches' => 'Object',
|
103 |
+
'cleaning_supplies' => 'Object',
|
104 |
+
'clo_offer' => 'Object',
|
105 |
+
'clothing' => 'Object',
|
106 |
+
'clothing_accessories' => 'Object',
|
107 |
+
'clothing_group' => 'Object',
|
108 |
+
'computer_components' => 'Object',
|
109 |
+
'computers_and_tablets' => 'Object',
|
110 |
+
'computers_laptops_and_tablets' => 'Object',
|
111 |
+
'diapering_and_potty_training' => 'Object',
|
112 |
+
'electronic_accessories_and_cables' => 'Object',
|
113 |
+
'electronics_accessories' => 'Object',
|
114 |
+
'furniture' => 'Object',
|
115 |
+
'health' => 'Object',
|
116 |
+
'home' => 'Object',
|
117 |
+
'home_goods' => 'Object',
|
118 |
+
'household_and_cleaning_supplies' => 'Object',
|
119 |
+
'jewelry' => 'Object',
|
120 |
+
'large_appliances' => 'Object',
|
121 |
+
'loyalty_offer' => 'Object',
|
122 |
+
'meetup_space' => 'Object',
|
123 |
+
'nursery' => 'Object',
|
124 |
+
'printers_and_scanners' => 'Object',
|
125 |
+
'printers_scanners_and_fax_machines' => 'Object',
|
126 |
+
'product_discount' => 'Object',
|
127 |
+
'projectors' => 'Object',
|
128 |
+
'shoes' => 'Object',
|
129 |
+
'shoes_and_footwear' => 'Object',
|
130 |
+
'software' => 'Object',
|
131 |
+
'televisions_and_monitors' => 'Object',
|
132 |
+
'test_child_sub_vertical' => 'Object',
|
133 |
+
'test_grand_child_sub_vertical' => 'Object',
|
134 |
+
'test_sub_vertical' => 'Object',
|
135 |
+
'test_sub_vertical_alias' => 'Object',
|
136 |
+
'test_sub_vertical_data_object' => 'Object',
|
137 |
+
'third_party_electronics' => 'Object',
|
138 |
+
'third_party_toys_and_games' => 'Object',
|
139 |
+
'toys' => 'Object',
|
140 |
+
'toys_and_games' => 'Object',
|
141 |
+
'tvs_and_monitors' => 'Object',
|
142 |
+
'vehicle_manufacturer' => 'Object',
|
143 |
+
'video_game_consoles_and_video_games' => 'Object',
|
144 |
+
'video_games_and_consoles' => 'Object',
|
145 |
+
'video_projectors' => 'Object',
|
146 |
+
'watches' => 'Object',
|
147 |
+
);
|
148 |
+
}
|
149 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ClientTransparencyStatusFields.php
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class ClientTransparencyStatusFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const GRACE_PERIOD_EXPIRATION_DATE = 'grace_period_expiration_date';
|
41 |
-
const HAS_OWNING_BUSINESS = 'has_owning_business';
|
42 |
-
const IS_SATISFIED = 'is_satisfied';
|
43 |
-
const OWNING_BUSINESS_REQUIREMENTS = 'owning_business_requirements';
|
44 |
-
|
45 |
-
public function getFieldTypes() {
|
46 |
-
return array(
|
47 |
-
'grace_period_expiration_date' => 'datetime',
|
48 |
-
'has_owning_business' => 'bool',
|
49 |
-
'is_satisfied' => 'bool',
|
50 |
-
'owning_business_requirements' => 'Object',
|
51 |
-
);
|
52 |
-
}
|
53 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CommerceMerchantSettingsFields.php
CHANGED
@@ -40,6 +40,7 @@ class CommerceMerchantSettingsFields extends AbstractEnum {
|
|
40 |
const BRAINTREE_MERCHANT_ID = 'braintree_merchant_id';
|
41 |
const CHECKOUT_MESSAGE = 'checkout_message';
|
42 |
const CONTACT_EMAIL = 'contact_email';
|
|
|
43 |
const DISABLE_CHECKOUT_URLS = 'disable_checkout_urls';
|
44 |
const DISPLAY_NAME = 'display_name';
|
45 |
const FACEBOOK_CHANNEL = 'facebook_channel';
|
@@ -58,12 +59,14 @@ class CommerceMerchantSettingsFields extends AbstractEnum {
|
|
58 |
const SUPPORTED_CARD_TYPES = 'supported_card_types';
|
59 |
const TERMS = 'terms';
|
60 |
const TERMS_URL_BY_LOCALE = 'terms_url_by_locale';
|
|
|
61 |
|
62 |
public function getFieldTypes() {
|
63 |
return array(
|
64 |
'braintree_merchant_id' => 'string',
|
65 |
'checkout_message' => 'string',
|
66 |
'contact_email' => 'string',
|
|
|
67 |
'disable_checkout_urls' => 'bool',
|
68 |
'display_name' => 'string',
|
69 |
'facebook_channel' => 'Object',
|
@@ -82,6 +85,7 @@ class CommerceMerchantSettingsFields extends AbstractEnum {
|
|
82 |
'supported_card_types' => 'list<string>',
|
83 |
'terms' => 'string',
|
84 |
'terms_url_by_locale' => 'map<string, string>',
|
|
|
85 |
);
|
86 |
}
|
87 |
}
|
40 |
const BRAINTREE_MERCHANT_ID = 'braintree_merchant_id';
|
41 |
const CHECKOUT_MESSAGE = 'checkout_message';
|
42 |
const CONTACT_EMAIL = 'contact_email';
|
43 |
+
const CTA = 'cta';
|
44 |
const DISABLE_CHECKOUT_URLS = 'disable_checkout_urls';
|
45 |
const DISPLAY_NAME = 'display_name';
|
46 |
const FACEBOOK_CHANNEL = 'facebook_channel';
|
59 |
const SUPPORTED_CARD_TYPES = 'supported_card_types';
|
60 |
const TERMS = 'terms';
|
61 |
const TERMS_URL_BY_LOCALE = 'terms_url_by_locale';
|
62 |
+
const WHATSAPP_CHANNEL = 'whatsapp_channel';
|
63 |
|
64 |
public function getFieldTypes() {
|
65 |
return array(
|
66 |
'braintree_merchant_id' => 'string',
|
67 |
'checkout_message' => 'string',
|
68 |
'contact_email' => 'string',
|
69 |
+
'cta' => 'string',
|
70 |
'disable_checkout_urls' => 'bool',
|
71 |
'display_name' => 'string',
|
72 |
'facebook_channel' => 'Object',
|
85 |
'supported_card_types' => 'list<string>',
|
86 |
'terms' => 'string',
|
87 |
'terms_url_by_locale' => 'map<string, string>',
|
88 |
+
'whatsapp_channel' => 'Object',
|
89 |
);
|
90 |
}
|
91 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/CommerceOrderFields.php
CHANGED
@@ -43,6 +43,7 @@ class CommerceOrderFields extends AbstractEnum {
|
|
43 |
const ESTIMATED_PAYMENT_DETAILS = 'estimated_payment_details';
|
44 |
const ID = 'id';
|
45 |
const IS_GROUP_BUY = 'is_group_buy';
|
|
|
46 |
const LAST_UPDATED = 'last_updated';
|
47 |
const MERCHANT_ORDER_ID = 'merchant_order_id';
|
48 |
const ORDER_STATUS = 'order_status';
|
@@ -58,6 +59,7 @@ class CommerceOrderFields extends AbstractEnum {
|
|
58 |
'estimated_payment_details' => 'Object',
|
59 |
'id' => 'string',
|
60 |
'is_group_buy' => 'bool',
|
|
|
61 |
'last_updated' => 'string',
|
62 |
'merchant_order_id' => 'string',
|
63 |
'order_status' => 'Object',
|
43 |
const ESTIMATED_PAYMENT_DETAILS = 'estimated_payment_details';
|
44 |
const ID = 'id';
|
45 |
const IS_GROUP_BUY = 'is_group_buy';
|
46 |
+
const IS_TEST_ORDER = 'is_test_order';
|
47 |
const LAST_UPDATED = 'last_updated';
|
48 |
const MERCHANT_ORDER_ID = 'merchant_order_id';
|
49 |
const ORDER_STATUS = 'order_status';
|
59 |
'estimated_payment_details' => 'Object',
|
60 |
'id' => 'string',
|
61 |
'is_group_buy' => 'bool',
|
62 |
+
'is_test_order' => 'bool',
|
63 |
'last_updated' => 'string',
|
64 |
'merchant_order_id' => 'string',
|
65 |
'order_status' => 'Object',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{CreativeAssetTagFields.php → ConnectionsTargetingFields.php}
RENAMED
@@ -35,12 +35,14 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
|
|
40 |
const NAME = 'name';
|
41 |
|
42 |
public function getFieldTypes() {
|
43 |
return array(
|
|
|
44 |
'name' => 'string',
|
45 |
);
|
46 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class ConnectionsTargetingFields extends AbstractEnum {
|
39 |
|
40 |
+
const ID = 'id';
|
41 |
const NAME = 'name';
|
42 |
|
43 |
public function getFieldTypes() {
|
44 |
return array(
|
45 |
+
'id' => 'string',
|
46 |
'name' => 'string',
|
47 |
);
|
48 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/DestinationFields.php
CHANGED
@@ -39,6 +39,7 @@ class DestinationFields extends AbstractEnum {
|
|
39 |
|
40 |
const ADDRESS = 'address';
|
41 |
const APPLINKS = 'applinks';
|
|
|
42 |
const CURRENCY = 'currency';
|
43 |
const DESCRIPTION = 'description';
|
44 |
const DESTINATION_ID = 'destination_id';
|
@@ -55,6 +56,7 @@ class DestinationFields extends AbstractEnum {
|
|
55 |
return array(
|
56 |
'address' => 'string',
|
57 |
'applinks' => 'CatalogItemAppLinks',
|
|
|
58 |
'currency' => 'string',
|
59 |
'description' => 'string',
|
60 |
'destination_id' => 'string',
|
39 |
|
40 |
const ADDRESS = 'address';
|
41 |
const APPLINKS = 'applinks';
|
42 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
43 |
const CURRENCY = 'currency';
|
44 |
const DESCRIPTION = 'description';
|
45 |
const DESTINATION_ID = 'destination_id';
|
56 |
return array(
|
57 |
'address' => 'string',
|
58 |
'applinks' => 'CatalogItemAppLinks',
|
59 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
60 |
'currency' => 'string',
|
61 |
'description' => 'string',
|
62 |
'destination_id' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/EventFields.php
CHANGED
@@ -56,6 +56,8 @@ class EventFields extends AbstractEnum {
|
|
56 |
const MAYBE_COUNT = 'maybe_count';
|
57 |
const NAME = 'name';
|
58 |
const NOREPLY_COUNT = 'noreply_count';
|
|
|
|
|
59 |
const OWNER = 'owner';
|
60 |
const PARENT_GROUP = 'parent_group';
|
61 |
const PLACE = 'place';
|
@@ -90,6 +92,8 @@ class EventFields extends AbstractEnum {
|
|
90 |
'maybe_count' => 'int',
|
91 |
'name' => 'string',
|
92 |
'noreply_count' => 'int',
|
|
|
|
|
93 |
'owner' => 'Object',
|
94 |
'parent_group' => 'Group',
|
95 |
'place' => 'Place',
|
56 |
const MAYBE_COUNT = 'maybe_count';
|
57 |
const NAME = 'name';
|
58 |
const NOREPLY_COUNT = 'noreply_count';
|
59 |
+
const ONLINE_EVENT_FORMAT = 'online_event_format';
|
60 |
+
const ONLINE_EVENT_THIRD_PARTY_URL = 'online_event_third_party_url';
|
61 |
const OWNER = 'owner';
|
62 |
const PARENT_GROUP = 'parent_group';
|
63 |
const PLACE = 'place';
|
92 |
'maybe_count' => 'int',
|
93 |
'name' => 'string',
|
94 |
'noreply_count' => 'int',
|
95 |
+
'online_event_format' => 'OnlineEventFormat',
|
96 |
+
'online_event_third_party_url' => 'string',
|
97 |
'owner' => 'Object',
|
98 |
'parent_group' => 'Group',
|
99 |
'place' => 'Place',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/FlightFields.php
CHANGED
@@ -38,6 +38,7 @@ use FacebookAds\Enum\AbstractEnum;
|
|
38 |
class FlightFields extends AbstractEnum {
|
39 |
|
40 |
const APPLINKS = 'applinks';
|
|
|
41 |
const CURRENCY = 'currency';
|
42 |
const DESCRIPTION = 'description';
|
43 |
const DESTINATION_AIRPORT = 'destination_airport';
|
@@ -56,6 +57,7 @@ class FlightFields extends AbstractEnum {
|
|
56 |
public function getFieldTypes() {
|
57 |
return array(
|
58 |
'applinks' => 'CatalogItemAppLinks',
|
|
|
59 |
'currency' => 'string',
|
60 |
'description' => 'string',
|
61 |
'destination_airport' => 'string',
|
38 |
class FlightFields extends AbstractEnum {
|
39 |
|
40 |
const APPLINKS = 'applinks';
|
41 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
42 |
const CURRENCY = 'currency';
|
43 |
const DESCRIPTION = 'description';
|
44 |
const DESTINATION_AIRPORT = 'destination_airport';
|
57 |
public function getFieldTypes() {
|
58 |
return array(
|
59 |
'applinks' => 'CatalogItemAppLinks',
|
60 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
61 |
'currency' => 'string',
|
62 |
'description' => 'string',
|
63 |
'destination_airport' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/HomeListingFields.php
CHANGED
@@ -49,6 +49,7 @@ class HomeListingFields extends AbstractEnum {
|
|
49 |
const AREA_SIZE = 'area_size';
|
50 |
const AREA_UNIT = 'area_unit';
|
51 |
const AVAILABILITY = 'availability';
|
|
|
52 |
const CO_2_EMISSION_RATING_EU = 'co_2_emission_rating_eu';
|
53 |
const CURRENCY = 'currency';
|
54 |
const DAYS_ON_MARKET = 'days_on_market';
|
@@ -94,6 +95,7 @@ class HomeListingFields extends AbstractEnum {
|
|
94 |
'area_size' => 'unsigned int',
|
95 |
'area_unit' => 'string',
|
96 |
'availability' => 'string',
|
|
|
97 |
'co_2_emission_rating_eu' => 'Object',
|
98 |
'currency' => 'string',
|
99 |
'days_on_market' => 'unsigned int',
|
49 |
const AREA_SIZE = 'area_size';
|
50 |
const AREA_UNIT = 'area_unit';
|
51 |
const AVAILABILITY = 'availability';
|
52 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
53 |
const CO_2_EMISSION_RATING_EU = 'co_2_emission_rating_eu';
|
54 |
const CURRENCY = 'currency';
|
55 |
const DAYS_ON_MARKET = 'days_on_market';
|
95 |
'area_size' => 'unsigned int',
|
96 |
'area_unit' => 'string',
|
97 |
'availability' => 'string',
|
98 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
99 |
'co_2_emission_rating_eu' => 'Object',
|
100 |
'currency' => 'string',
|
101 |
'days_on_market' => 'unsigned int',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/HotelFields.php
CHANGED
@@ -41,6 +41,7 @@ class HotelFields extends AbstractEnum {
|
|
41 |
const APPLINKS = 'applinks';
|
42 |
const BRAND = 'brand';
|
43 |
const CATEGORY = 'category';
|
|
|
44 |
const CURRENCY = 'currency';
|
45 |
const DESCRIPTION = 'description';
|
46 |
const GUEST_RATINGS = 'guest_ratings';
|
@@ -64,6 +65,7 @@ class HotelFields extends AbstractEnum {
|
|
64 |
'applinks' => 'CatalogItemAppLinks',
|
65 |
'brand' => 'string',
|
66 |
'category' => 'string',
|
|
|
67 |
'currency' => 'string',
|
68 |
'description' => 'string',
|
69 |
'guest_ratings' => 'string',
|
41 |
const APPLINKS = 'applinks';
|
42 |
const BRAND = 'brand';
|
43 |
const CATEGORY = 'category';
|
44 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
45 |
const CURRENCY = 'currency';
|
46 |
const DESCRIPTION = 'description';
|
47 |
const GUEST_RATINGS = 'guest_ratings';
|
65 |
'applinks' => 'CatalogItemAppLinks',
|
66 |
'brand' => 'string',
|
67 |
'category' => 'string',
|
68 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
69 |
'currency' => 'string',
|
70 |
'description' => 'string',
|
71 |
'guest_ratings' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/IGMediaFields.php
CHANGED
@@ -37,6 +37,7 @@ use FacebookAds\Enum\AbstractEnum;
|
|
37 |
|
38 |
class IGMediaFields extends AbstractEnum {
|
39 |
|
|
|
40 |
const CAPTION = 'caption';
|
41 |
const COMMENTS_COUNT = 'comments_count';
|
42 |
const ID = 'id';
|
@@ -54,6 +55,7 @@ class IGMediaFields extends AbstractEnum {
|
|
54 |
|
55 |
public function getFieldTypes() {
|
56 |
return array(
|
|
|
57 |
'caption' => 'string',
|
58 |
'comments_count' => 'int',
|
59 |
'id' => 'string',
|
37 |
|
38 |
class IGMediaFields extends AbstractEnum {
|
39 |
|
40 |
+
const ALT_TEXT = 'alt_text';
|
41 |
const CAPTION = 'caption';
|
42 |
const COMMENTS_COUNT = 'comments_count';
|
43 |
const ID = 'id';
|
55 |
|
56 |
public function getFieldTypes() {
|
57 |
return array(
|
58 |
+
'alt_text' => 'string',
|
59 |
'caption' => 'string',
|
60 |
'comments_count' => 'int',
|
61 |
'id' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/IterativeSplitTestConfigFields.php
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class IterativeSplitTestConfigFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const BUDGET = 'budget';
|
41 |
-
const END_TIME = 'end_time';
|
42 |
-
const GUIDANCE = 'guidance';
|
43 |
-
const ID = 'id';
|
44 |
-
const ITERATIVE_SPLIT_TEST_ORIGINAL_VARIANT_ID = 'iterative_split_test_original_variant_id';
|
45 |
-
const ITERATIVE_SPLIT_TEST_VARIANT_TO_SPLIT_MAPPING = 'iterative_split_test_variant_to_split_mapping';
|
46 |
-
const RESULTS_WINDOW = 'results_window';
|
47 |
-
const SPLITS = 'splits';
|
48 |
-
const START_TIME = 'start_time';
|
49 |
-
|
50 |
-
public function getFieldTypes() {
|
51 |
-
return array(
|
52 |
-
'budget' => 'int',
|
53 |
-
'end_time' => 'datetime',
|
54 |
-
'guidance' => 'Object',
|
55 |
-
'id' => 'string',
|
56 |
-
'iterative_split_test_original_variant_id' => 'string',
|
57 |
-
'iterative_split_test_variant_to_split_mapping' => 'map<string, int>',
|
58 |
-
'results_window' => 'Object',
|
59 |
-
'splits' => 'list<int>',
|
60 |
-
'start_time' => 'datetime',
|
61 |
-
);
|
62 |
-
}
|
63 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/OracleTransactionFields.php
CHANGED
@@ -42,7 +42,6 @@ class OracleTransactionFields extends AbstractEnum {
|
|
42 |
const AMOUNT_DUE = 'amount_due';
|
43 |
const BILLED_AMOUNT_DETAILS = 'billed_amount_details';
|
44 |
const BILLING_PERIOD = 'billing_period';
|
45 |
-
const CAMPAIGN = 'campaign';
|
46 |
const CDN_DOWNLOAD_URI = 'cdn_download_uri';
|
47 |
const CURRENCY = 'currency';
|
48 |
const DOWNLOAD_URI = 'download_uri';
|
@@ -64,7 +63,6 @@ class OracleTransactionFields extends AbstractEnum {
|
|
64 |
'amount_due' => 'CurrencyAmount',
|
65 |
'billed_amount_details' => 'BilledAmountDetails',
|
66 |
'billing_period' => 'string',
|
67 |
-
'campaign' => 'AtlasCampaign',
|
68 |
'cdn_download_uri' => 'string',
|
69 |
'currency' => 'string',
|
70 |
'download_uri' => 'string',
|
42 |
const AMOUNT_DUE = 'amount_due';
|
43 |
const BILLED_AMOUNT_DETAILS = 'billed_amount_details';
|
44 |
const BILLING_PERIOD = 'billing_period';
|
|
|
45 |
const CDN_DOWNLOAD_URI = 'cdn_download_uri';
|
46 |
const CURRENCY = 'currency';
|
47 |
const DOWNLOAD_URI = 'download_uri';
|
63 |
'amount_due' => 'CurrencyAmount',
|
64 |
'billed_amount_details' => 'BilledAmountDetails',
|
65 |
'billing_period' => 'string',
|
|
|
66 |
'cdn_download_uri' => 'string',
|
67 |
'currency' => 'string',
|
68 |
'download_uri' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageAboutStoryFields.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class PageAboutStoryFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const COMPOSED_TEXT = 'composed_text';
|
41 |
-
const COVER_PHOTO = 'cover_photo';
|
42 |
-
const ENTITY_MAP = 'entity_map';
|
43 |
-
const ID = 'id';
|
44 |
-
const IS_PUBLISHED = 'is_published';
|
45 |
-
const PAGE_ID = 'page_id';
|
46 |
-
const TITLE = 'title';
|
47 |
-
|
48 |
-
public function getFieldTypes() {
|
49 |
-
return array(
|
50 |
-
'composed_text' => 'list<Object>',
|
51 |
-
'cover_photo' => 'Photo',
|
52 |
-
'entity_map' => 'list<Object>',
|
53 |
-
'id' => 'string',
|
54 |
-
'is_published' => 'bool',
|
55 |
-
'page_id' => 'string',
|
56 |
-
'title' => 'string',
|
57 |
-
);
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageAdminNoteFields.php
CHANGED
@@ -40,6 +40,7 @@ class PageAdminNoteFields extends AbstractEnum {
|
|
40 |
const BODY = 'body';
|
41 |
const FROM = 'from';
|
42 |
const ID = 'id';
|
|
|
43 |
const USER = 'user';
|
44 |
|
45 |
public function getFieldTypes() {
|
@@ -47,6 +48,7 @@ class PageAdminNoteFields extends AbstractEnum {
|
|
47 |
'body' => 'string',
|
48 |
'from' => 'Page',
|
49 |
'id' => 'string',
|
|
|
50 |
'user' => 'User',
|
51 |
);
|
52 |
}
|
40 |
const BODY = 'body';
|
41 |
const FROM = 'from';
|
42 |
const ID = 'id';
|
43 |
+
const NOTE_LABEL = 'note_label';
|
44 |
const USER = 'user';
|
45 |
|
46 |
public function getFieldTypes() {
|
48 |
'body' => 'string',
|
49 |
'from' => 'Page',
|
50 |
'id' => 'string',
|
51 |
+
'note_label' => 'string',
|
52 |
'user' => 'User',
|
53 |
);
|
54 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageFields.php
CHANGED
@@ -128,7 +128,6 @@ class PageFields extends AbstractEnum {
|
|
128 |
const NEW_LIKE_COUNT = 'new_like_count';
|
129 |
const OFFER_ELIGIBLE = 'offer_eligible';
|
130 |
const OVERALL_STAR_RATING = 'overall_star_rating';
|
131 |
-
const PAGE_ABOUT_STORY = 'page_about_story';
|
132 |
const PAGE_TOKEN = 'page_token';
|
133 |
const PARENT_PAGE = 'parent_page';
|
134 |
const PARKING = 'parking';
|
@@ -137,6 +136,7 @@ class PageFields extends AbstractEnum {
|
|
137 |
const PERSONAL_INTERESTS = 'personal_interests';
|
138 |
const PHARMA_SAFETY_INFO = 'pharma_safety_info';
|
139 |
const PHONE = 'phone';
|
|
|
140 |
const PLACE_TYPE = 'place_type';
|
141 |
const PLOT_OUTLINE = 'plot_outline';
|
142 |
const PREFERRED_AUDIENCE = 'preferred_audience';
|
@@ -272,7 +272,6 @@ class PageFields extends AbstractEnum {
|
|
272 |
'new_like_count' => 'unsigned int',
|
273 |
'offer_eligible' => 'bool',
|
274 |
'overall_star_rating' => 'float',
|
275 |
-
'page_about_story' => 'PageAboutStory',
|
276 |
'page_token' => 'string',
|
277 |
'parent_page' => 'Page',
|
278 |
'parking' => 'PageParking',
|
@@ -281,6 +280,7 @@ class PageFields extends AbstractEnum {
|
|
281 |
'personal_interests' => 'string',
|
282 |
'pharma_safety_info' => 'string',
|
283 |
'phone' => 'string',
|
|
|
284 |
'place_type' => 'string',
|
285 |
'plot_outline' => 'string',
|
286 |
'preferred_audience' => 'Targeting',
|
128 |
const NEW_LIKE_COUNT = 'new_like_count';
|
129 |
const OFFER_ELIGIBLE = 'offer_eligible';
|
130 |
const OVERALL_STAR_RATING = 'overall_star_rating';
|
|
|
131 |
const PAGE_TOKEN = 'page_token';
|
132 |
const PARENT_PAGE = 'parent_page';
|
133 |
const PARKING = 'parking';
|
136 |
const PERSONAL_INTERESTS = 'personal_interests';
|
137 |
const PHARMA_SAFETY_INFO = 'pharma_safety_info';
|
138 |
const PHONE = 'phone';
|
139 |
+
const PICKUP_OPTIONS = 'pickup_options';
|
140 |
const PLACE_TYPE = 'place_type';
|
141 |
const PLOT_OUTLINE = 'plot_outline';
|
142 |
const PREFERRED_AUDIENCE = 'preferred_audience';
|
272 |
'new_like_count' => 'unsigned int',
|
273 |
'offer_eligible' => 'bool',
|
274 |
'overall_star_rating' => 'float',
|
|
|
275 |
'page_token' => 'string',
|
276 |
'parent_page' => 'Page',
|
277 |
'parking' => 'PageParking',
|
280 |
'personal_interests' => 'string',
|
281 |
'pharma_safety_info' => 'string',
|
282 |
'phone' => 'string',
|
283 |
+
'pickup_options' => 'list<string>',
|
284 |
'place_type' => 'string',
|
285 |
'plot_outline' => 'string',
|
286 |
'preferred_audience' => 'Targeting',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PagePostFields.php
CHANGED
@@ -62,6 +62,7 @@ class PagePostFields extends AbstractEnum {
|
|
62 |
const ID = 'id';
|
63 |
const IMPLICIT_PLACE = 'implicit_place';
|
64 |
const INSTAGRAM_ELIGIBILITY = 'instagram_eligibility';
|
|
|
65 |
const IS_APP_SHARE = 'is_app_share';
|
66 |
const IS_ELIGIBLE_FOR_PROMOTION = 'is_eligible_for_promotion';
|
67 |
const IS_EXPIRED = 'is_expired';
|
@@ -80,6 +81,7 @@ class PagePostFields extends AbstractEnum {
|
|
80 |
const PERMALINK_URL = 'permalink_url';
|
81 |
const PICTURE = 'picture';
|
82 |
const PLACE = 'place';
|
|
|
83 |
const PRIVACY = 'privacy';
|
84 |
const PROMOTABLE_ID = 'promotable_id';
|
85 |
const PROMOTION_STATUS = 'promotion_status';
|
@@ -128,6 +130,7 @@ class PagePostFields extends AbstractEnum {
|
|
128 |
'id' => 'string',
|
129 |
'implicit_place' => 'Place',
|
130 |
'instagram_eligibility' => 'string',
|
|
|
131 |
'is_app_share' => 'bool',
|
132 |
'is_eligible_for_promotion' => 'bool',
|
133 |
'is_expired' => 'bool',
|
@@ -146,6 +149,7 @@ class PagePostFields extends AbstractEnum {
|
|
146 |
'permalink_url' => 'Object',
|
147 |
'picture' => 'string',
|
148 |
'place' => 'Place',
|
|
|
149 |
'privacy' => 'Privacy',
|
150 |
'promotable_id' => 'string',
|
151 |
'promotion_status' => 'string',
|
62 |
const ID = 'id';
|
63 |
const IMPLICIT_PLACE = 'implicit_place';
|
64 |
const INSTAGRAM_ELIGIBILITY = 'instagram_eligibility';
|
65 |
+
const INSTREAM_ELIGIBILITY = 'instream_eligibility';
|
66 |
const IS_APP_SHARE = 'is_app_share';
|
67 |
const IS_ELIGIBLE_FOR_PROMOTION = 'is_eligible_for_promotion';
|
68 |
const IS_EXPIRED = 'is_expired';
|
81 |
const PERMALINK_URL = 'permalink_url';
|
82 |
const PICTURE = 'picture';
|
83 |
const PLACE = 'place';
|
84 |
+
const POLL = 'poll';
|
85 |
const PRIVACY = 'privacy';
|
86 |
const PROMOTABLE_ID = 'promotable_id';
|
87 |
const PROMOTION_STATUS = 'promotion_status';
|
130 |
'id' => 'string',
|
131 |
'implicit_place' => 'Place',
|
132 |
'instagram_eligibility' => 'string',
|
133 |
+
'instream_eligibility' => 'string',
|
134 |
'is_app_share' => 'bool',
|
135 |
'is_eligible_for_promotion' => 'bool',
|
136 |
'is_expired' => 'bool',
|
149 |
'permalink_url' => 'Object',
|
150 |
'picture' => 'string',
|
151 |
'place' => 'Place',
|
152 |
+
'poll' => 'Object',
|
153 |
'privacy' => 'Privacy',
|
154 |
'promotable_id' => 'string',
|
155 |
'promotion_status' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PaymentSubscriptionFields.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Fields;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
|
38 |
+
class PaymentSubscriptionFields extends AbstractEnum {
|
39 |
+
|
40 |
+
const AMOUNT = 'amount';
|
41 |
+
const APP_PARAM_DATA = 'app_param_data';
|
42 |
+
const APPLICATION = 'application';
|
43 |
+
const BILLING_PERIOD = 'billing_period';
|
44 |
+
const CANCELED_REASON = 'canceled_reason';
|
45 |
+
const CREATED_TIME = 'created_time';
|
46 |
+
const CURRENCY = 'currency';
|
47 |
+
const ID = 'id';
|
48 |
+
const LAST_PAYMENT = 'last_payment';
|
49 |
+
const NEXT_BILL_TIME = 'next_bill_time';
|
50 |
+
const NEXT_PERIOD_AMOUNT = 'next_period_amount';
|
51 |
+
const NEXT_PERIOD_CURRENCY = 'next_period_currency';
|
52 |
+
const NEXT_PERIOD_PRODUCT = 'next_period_product';
|
53 |
+
const PAYMENT_STATUS = 'payment_status';
|
54 |
+
const PENDING_CANCEL = 'pending_cancel';
|
55 |
+
const PERIOD_START_TIME = 'period_start_time';
|
56 |
+
const PRODUCT = 'product';
|
57 |
+
const STATUS = 'status';
|
58 |
+
const TEST = 'test';
|
59 |
+
const TRIAL_AMOUNT = 'trial_amount';
|
60 |
+
const TRIAL_CURRENCY = 'trial_currency';
|
61 |
+
const TRIAL_EXPIRY_TIME = 'trial_expiry_time';
|
62 |
+
const UPDATED_TIME = 'updated_time';
|
63 |
+
const USER = 'user';
|
64 |
+
|
65 |
+
public function getFieldTypes() {
|
66 |
+
return array(
|
67 |
+
'amount' => 'string',
|
68 |
+
'app_param_data' => 'string',
|
69 |
+
'application' => 'Profile',
|
70 |
+
'billing_period' => 'string',
|
71 |
+
'canceled_reason' => 'string',
|
72 |
+
'created_time' => 'datetime',
|
73 |
+
'currency' => 'string',
|
74 |
+
'id' => 'string',
|
75 |
+
'last_payment' => 'string',
|
76 |
+
'next_bill_time' => 'datetime',
|
77 |
+
'next_period_amount' => 'string',
|
78 |
+
'next_period_currency' => 'string',
|
79 |
+
'next_period_product' => 'string',
|
80 |
+
'payment_status' => 'string',
|
81 |
+
'pending_cancel' => 'bool',
|
82 |
+
'period_start_time' => 'datetime',
|
83 |
+
'product' => 'string',
|
84 |
+
'status' => 'string',
|
85 |
+
'test' => 'unsigned int',
|
86 |
+
'trial_amount' => 'string',
|
87 |
+
'trial_currency' => 'string',
|
88 |
+
'trial_expiry_time' => 'datetime',
|
89 |
+
'updated_time' => 'datetime',
|
90 |
+
'user' => 'Profile',
|
91 |
+
);
|
92 |
+
}
|
93 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PostFields.php
CHANGED
@@ -64,6 +64,7 @@ class PostFields extends AbstractEnum {
|
|
64 |
const ID = 'id';
|
65 |
const IMPLICIT_PLACE = 'implicit_place';
|
66 |
const INSTAGRAM_ELIGIBILITY = 'instagram_eligibility';
|
|
|
67 |
const IS_APP_SHARE = 'is_app_share';
|
68 |
const IS_ELIGIBLE_FOR_PROMOTION = 'is_eligible_for_promotion';
|
69 |
const IS_EXPIRED = 'is_expired';
|
@@ -85,6 +86,7 @@ class PostFields extends AbstractEnum {
|
|
85 |
const PERMALINK_URL = 'permalink_url';
|
86 |
const PICTURE = 'picture';
|
87 |
const PLACE = 'place';
|
|
|
88 |
const PRIVACY = 'privacy';
|
89 |
const PROMOTABLE_ID = 'promotable_id';
|
90 |
const PROMOTION_STATUS = 'promotion_status';
|
@@ -137,6 +139,7 @@ class PostFields extends AbstractEnum {
|
|
137 |
'id' => 'string',
|
138 |
'implicit_place' => 'Place',
|
139 |
'instagram_eligibility' => 'string',
|
|
|
140 |
'is_app_share' => 'bool',
|
141 |
'is_eligible_for_promotion' => 'bool',
|
142 |
'is_expired' => 'bool',
|
@@ -158,6 +161,7 @@ class PostFields extends AbstractEnum {
|
|
158 |
'permalink_url' => 'Object',
|
159 |
'picture' => 'string',
|
160 |
'place' => 'Place',
|
|
|
161 |
'privacy' => 'Privacy',
|
162 |
'promotable_id' => 'string',
|
163 |
'promotion_status' => 'string',
|
64 |
const ID = 'id';
|
65 |
const IMPLICIT_PLACE = 'implicit_place';
|
66 |
const INSTAGRAM_ELIGIBILITY = 'instagram_eligibility';
|
67 |
+
const INSTREAM_ELIGIBILITY = 'instream_eligibility';
|
68 |
const IS_APP_SHARE = 'is_app_share';
|
69 |
const IS_ELIGIBLE_FOR_PROMOTION = 'is_eligible_for_promotion';
|
70 |
const IS_EXPIRED = 'is_expired';
|
86 |
const PERMALINK_URL = 'permalink_url';
|
87 |
const PICTURE = 'picture';
|
88 |
const PLACE = 'place';
|
89 |
+
const POLL = 'poll';
|
90 |
const PRIVACY = 'privacy';
|
91 |
const PROMOTABLE_ID = 'promotable_id';
|
92 |
const PROMOTION_STATUS = 'promotion_status';
|
139 |
'id' => 'string',
|
140 |
'implicit_place' => 'Place',
|
141 |
'instagram_eligibility' => 'string',
|
142 |
+
'instream_eligibility' => 'string',
|
143 |
'is_app_share' => 'bool',
|
144 |
'is_eligible_for_promotion' => 'bool',
|
145 |
'is_expired' => 'bool',
|
161 |
'permalink_url' => 'Object',
|
162 |
'picture' => 'string',
|
163 |
'place' => 'Place',
|
164 |
+
'poll' => 'Object',
|
165 |
'privacy' => 'Privacy',
|
166 |
'promotable_id' => 'string',
|
167 |
'promotion_status' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductCatalogFields.php
CHANGED
@@ -49,9 +49,12 @@ class ProductCatalogFields extends AbstractEnum {
|
|
49 |
const PRODUCT_COUNT = 'product_count';
|
50 |
const STORE_CATALOG_SETTINGS = 'store_catalog_settings';
|
51 |
const VERTICAL = 'vertical';
|
|
|
|
|
52 |
const DESTINATION_CATALOG_SETTINGS = 'destination_catalog_settings';
|
53 |
const FLIGHT_CATALOG_SETTINGS = 'flight_catalog_settings';
|
54 |
const ONSITE_COMMERCE_MERCHANT = 'onsite_commerce_merchant';
|
|
|
55 |
|
56 |
public function getFieldTypes() {
|
57 |
return array(
|
@@ -67,9 +70,12 @@ class ProductCatalogFields extends AbstractEnum {
|
|
67 |
'product_count' => 'int',
|
68 |
'store_catalog_settings' => 'StoreCatalogSettings',
|
69 |
'vertical' => 'string',
|
|
|
|
|
70 |
'destination_catalog_settings' => 'map',
|
71 |
'flight_catalog_settings' => 'map',
|
72 |
'onsite_commerce_merchant' => 'Object',
|
|
|
73 |
);
|
74 |
}
|
75 |
}
|
49 |
const PRODUCT_COUNT = 'product_count';
|
50 |
const STORE_CATALOG_SETTINGS = 'store_catalog_settings';
|
51 |
const VERTICAL = 'vertical';
|
52 |
+
const CATALOG_SEGMENT_FILTER = 'catalog_segment_filter';
|
53 |
+
const CATALOG_SEGMENT_PRODUCT_SET_ID = 'catalog_segment_product_set_id';
|
54 |
const DESTINATION_CATALOG_SETTINGS = 'destination_catalog_settings';
|
55 |
const FLIGHT_CATALOG_SETTINGS = 'flight_catalog_settings';
|
56 |
const ONSITE_COMMERCE_MERCHANT = 'onsite_commerce_merchant';
|
57 |
+
const PARENT_CATALOG_ID = 'parent_catalog_id';
|
58 |
|
59 |
public function getFieldTypes() {
|
60 |
return array(
|
70 |
'product_count' => 'int',
|
71 |
'store_catalog_settings' => 'StoreCatalogSettings',
|
72 |
'vertical' => 'string',
|
73 |
+
'catalog_segment_filter' => 'Object',
|
74 |
+
'catalog_segment_product_set_id' => 'string',
|
75 |
'destination_catalog_settings' => 'map',
|
76 |
'flight_catalog_settings' => 'map',
|
77 |
'onsite_commerce_merchant' => 'Object',
|
78 |
+
'parent_catalog_id' => 'string',
|
79 |
);
|
80 |
}
|
81 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductFeedFields.php
CHANGED
@@ -45,6 +45,7 @@ class ProductFeedFields extends AbstractEnum {
|
|
45 |
const ENCODING = 'encoding';
|
46 |
const FILE_NAME = 'file_name';
|
47 |
const ID = 'id';
|
|
|
48 |
const LATEST_UPLOAD = 'latest_upload';
|
49 |
const NAME = 'name';
|
50 |
const OVERRIDE_TYPE = 'override_type';
|
@@ -67,6 +68,7 @@ class ProductFeedFields extends AbstractEnum {
|
|
67 |
'encoding' => 'string',
|
68 |
'file_name' => 'string',
|
69 |
'id' => 'string',
|
|
|
70 |
'latest_upload' => 'ProductFeedUpload',
|
71 |
'name' => 'string',
|
72 |
'override_type' => 'string',
|
45 |
const ENCODING = 'encoding';
|
46 |
const FILE_NAME = 'file_name';
|
47 |
const ID = 'id';
|
48 |
+
const ITEM_SUB_TYPE = 'item_sub_type';
|
49 |
const LATEST_UPLOAD = 'latest_upload';
|
50 |
const NAME = 'name';
|
51 |
const OVERRIDE_TYPE = 'override_type';
|
68 |
'encoding' => 'string',
|
69 |
'file_name' => 'string',
|
70 |
'id' => 'string',
|
71 |
+
'item_sub_type' => 'string',
|
72 |
'latest_upload' => 'ProductFeedUpload',
|
73 |
'name' => 'string',
|
74 |
'override_type' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductItemFields.php
CHANGED
@@ -46,6 +46,7 @@ class ProductItemFields extends AbstractEnum {
|
|
46 |
const BRAND = 'brand';
|
47 |
const CAPABILITY_TO_REVIEW_STATUS = 'capability_to_review_status';
|
48 |
const CATEGORY = 'category';
|
|
|
49 |
const COLOR = 'color';
|
50 |
const COMMERCE_INSIGHTS = 'commerce_insights';
|
51 |
const CONDITION = 'condition';
|
@@ -58,6 +59,7 @@ class ProductItemFields extends AbstractEnum {
|
|
58 |
const CUSTOM_LABEL_4 = 'custom_label_4';
|
59 |
const DESCRIPTION = 'description';
|
60 |
const EXPIRATION_DATE = 'expiration_date';
|
|
|
61 |
const GENDER = 'gender';
|
62 |
const GTIN = 'gtin';
|
63 |
const ID = 'id';
|
@@ -125,6 +127,7 @@ class ProductItemFields extends AbstractEnum {
|
|
125 |
'brand' => 'string',
|
126 |
'capability_to_review_status' => 'map<Object, Object>',
|
127 |
'category' => 'string',
|
|
|
128 |
'color' => 'string',
|
129 |
'commerce_insights' => 'ProductItemCommerceInsights',
|
130 |
'condition' => 'Condition',
|
@@ -137,6 +140,7 @@ class ProductItemFields extends AbstractEnum {
|
|
137 |
'custom_label_4' => 'string',
|
138 |
'description' => 'string',
|
139 |
'expiration_date' => 'string',
|
|
|
140 |
'gender' => 'Gender',
|
141 |
'gtin' => 'string',
|
142 |
'id' => 'string',
|
46 |
const BRAND = 'brand';
|
47 |
const CAPABILITY_TO_REVIEW_STATUS = 'capability_to_review_status';
|
48 |
const CATEGORY = 'category';
|
49 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
50 |
const COLOR = 'color';
|
51 |
const COMMERCE_INSIGHTS = 'commerce_insights';
|
52 |
const CONDITION = 'condition';
|
59 |
const CUSTOM_LABEL_4 = 'custom_label_4';
|
60 |
const DESCRIPTION = 'description';
|
61 |
const EXPIRATION_DATE = 'expiration_date';
|
62 |
+
const FB_PRODUCT_CATEGORY = 'fb_product_category';
|
63 |
const GENDER = 'gender';
|
64 |
const GTIN = 'gtin';
|
65 |
const ID = 'id';
|
127 |
'brand' => 'string',
|
128 |
'capability_to_review_status' => 'map<Object, Object>',
|
129 |
'category' => 'string',
|
130 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
131 |
'color' => 'string',
|
132 |
'commerce_insights' => 'ProductItemCommerceInsights',
|
133 |
'condition' => 'Condition',
|
140 |
'custom_label_4' => 'string',
|
141 |
'description' => 'string',
|
142 |
'expiration_date' => 'string',
|
143 |
+
'fb_product_category' => 'string',
|
144 |
'gender' => 'Gender',
|
145 |
'gtin' => 'string',
|
146 |
'id' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductSetFields.php
CHANGED
@@ -40,18 +40,26 @@ class ProductSetFields extends AbstractEnum {
|
|
40 |
const AUTO_CREATION_URL = 'auto_creation_url';
|
41 |
const FILTER = 'filter';
|
42 |
const ID = 'id';
|
|
|
|
|
43 |
const NAME = 'name';
|
44 |
const PRODUCT_CATALOG = 'product_catalog';
|
45 |
const PRODUCT_COUNT = 'product_count';
|
|
|
|
|
46 |
|
47 |
public function getFieldTypes() {
|
48 |
return array(
|
49 |
'auto_creation_url' => 'string',
|
50 |
'filter' => 'string',
|
51 |
'id' => 'string',
|
|
|
|
|
52 |
'name' => 'string',
|
53 |
'product_catalog' => 'ProductCatalog',
|
54 |
'product_count' => 'unsigned int',
|
|
|
|
|
55 |
);
|
56 |
}
|
57 |
}
|
40 |
const AUTO_CREATION_URL = 'auto_creation_url';
|
41 |
const FILTER = 'filter';
|
42 |
const ID = 'id';
|
43 |
+
const LATEST_METADATA = 'latest_metadata';
|
44 |
+
const LIVE_METADATA = 'live_metadata';
|
45 |
const NAME = 'name';
|
46 |
const PRODUCT_CATALOG = 'product_catalog';
|
47 |
const PRODUCT_COUNT = 'product_count';
|
48 |
+
const RETAILER_ID = 'retailer_id';
|
49 |
+
const METADATA = 'metadata';
|
50 |
|
51 |
public function getFieldTypes() {
|
52 |
return array(
|
53 |
'auto_creation_url' => 'string',
|
54 |
'filter' => 'string',
|
55 |
'id' => 'string',
|
56 |
+
'latest_metadata' => 'ProductSetMetadata',
|
57 |
+
'live_metadata' => 'ProductSetMetadata',
|
58 |
'name' => 'string',
|
59 |
'product_catalog' => 'ProductCatalog',
|
60 |
'product_count' => 'unsigned int',
|
61 |
+
'retailer_id' => 'string',
|
62 |
+
'metadata' => 'map',
|
63 |
);
|
64 |
}
|
65 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{MessengerPlatformReferralFields.php → ProductSetMetadataFields.php}
RENAMED
@@ -35,21 +35,19 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
43 |
-
const
|
44 |
-
const TYPE = 'type';
|
45 |
|
46 |
public function getFieldTypes() {
|
47 |
return array(
|
48 |
-
'
|
49 |
-
'
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'type' => 'string',
|
53 |
);
|
54 |
}
|
55 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class ProductSetMetadataFields extends AbstractEnum {
|
39 |
|
40 |
+
const COVER_IMAGE_URL = 'cover_image_url';
|
41 |
+
const DESCRIPTION = 'description';
|
42 |
+
const EXTERNAL_URL = 'external_url';
|
43 |
+
const INTEGRITY_REVIEW_STATUS = 'integrity_review_status';
|
|
|
44 |
|
45 |
public function getFieldTypes() {
|
46 |
return array(
|
47 |
+
'cover_image_url' => 'string',
|
48 |
+
'description' => 'string',
|
49 |
+
'external_url' => 'string',
|
50 |
+
'integrity_review_status' => 'string',
|
|
|
51 |
);
|
52 |
}
|
53 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/SecuritySettingsFields.php
CHANGED
@@ -37,11 +37,9 @@ use FacebookAds\Enum\AbstractEnum;
|
|
37 |
|
38 |
class SecuritySettingsFields extends AbstractEnum {
|
39 |
|
40 |
-
const SECURE_BROWSING = 'secure_browsing';
|
41 |
|
42 |
public function getFieldTypes() {
|
43 |
return array(
|
44 |
-
'secure_browsing' => 'Object',
|
45 |
);
|
46 |
}
|
47 |
}
|
37 |
|
38 |
class SecuritySettingsFields extends AbstractEnum {
|
39 |
|
|
|
40 |
|
41 |
public function getFieldTypes() {
|
42 |
return array(
|
|
|
43 |
);
|
44 |
}
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/SplitTestConfigFields.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class SplitTestConfigFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const BUDGET = 'budget';
|
41 |
-
const EARLY_WINNER_DECLARATION_ENABLED = 'early_winner_declaration_enabled';
|
42 |
-
const END_TIME = 'end_time';
|
43 |
-
const SPLITS = 'splits';
|
44 |
-
const START_TIME = 'start_time';
|
45 |
-
const TEST_VARIABLE = 'test_variable';
|
46 |
-
const ID = 'id';
|
47 |
-
|
48 |
-
public function getFieldTypes() {
|
49 |
-
return array(
|
50 |
-
'budget' => 'int',
|
51 |
-
'early_winner_declaration_enabled' => 'bool',
|
52 |
-
'end_time' => 'datetime',
|
53 |
-
'splits' => 'list<int>',
|
54 |
-
'start_time' => 'datetime',
|
55 |
-
'test_variable' => 'string',
|
56 |
-
'id' => 'string',
|
57 |
-
);
|
58 |
-
}
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/TargetingFields.php
CHANGED
@@ -95,6 +95,7 @@ class TargetingFields extends AbstractEnum {
|
|
95 |
const INCOME = 'income';
|
96 |
const INDUSTRIES = 'industries';
|
97 |
const INSTAGRAM_POSITIONS = 'instagram_positions';
|
|
|
98 |
const INTERESTED_IN = 'interested_in';
|
99 |
const INTERESTS = 'interests';
|
100 |
const IS_WHATSAPP_DESTINATION_AD = 'is_whatsapp_destination_ad';
|
@@ -137,7 +138,7 @@ class TargetingFields extends AbstractEnum {
|
|
137 |
'catalog_based_targeting' => 'CatalogBasedTargeting',
|
138 |
'cities' => 'list<IDName>',
|
139 |
'college_years' => 'list<unsigned int>',
|
140 |
-
'connections' => 'list<
|
141 |
'contextual_targeting_categories' => 'list<IDName>',
|
142 |
'countries' => 'list<string>',
|
143 |
'country' => 'list<string>',
|
@@ -159,7 +160,7 @@ class TargetingFields extends AbstractEnum {
|
|
159 |
'ethnic_affinity' => 'list<IDName>',
|
160 |
'exclude_reached_since' => 'list<string>',
|
161 |
'excluded_brand_safety_content_types' => 'list<string>',
|
162 |
-
'excluded_connections' => 'list<
|
163 |
'excluded_custom_audiences' => 'list<RawCustomAudience>',
|
164 |
'excluded_dynamic_audience_ids' => 'list<string>',
|
165 |
'excluded_engagement_specs' => 'list<TargetingDynamicRule>',
|
@@ -174,7 +175,7 @@ class TargetingFields extends AbstractEnum {
|
|
174 |
'family_statuses' => 'list<IDName>',
|
175 |
'fb_deal_id' => 'string',
|
176 |
'flexible_spec' => 'list<FlexibleTargeting>',
|
177 |
-
'friends_of_connections' => 'list<
|
178 |
'genders' => 'list<unsigned int>',
|
179 |
'generation' => 'list<IDName>',
|
180 |
'geo_locations' => 'TargetingGeoLocation',
|
@@ -185,6 +186,7 @@ class TargetingFields extends AbstractEnum {
|
|
185 |
'income' => 'list<IDName>',
|
186 |
'industries' => 'list<IDName>',
|
187 |
'instagram_positions' => 'list<string>',
|
|
|
188 |
'interested_in' => 'list<unsigned int>',
|
189 |
'interests' => 'list<IDName>',
|
190 |
'is_whatsapp_destination_ad' => 'bool',
|
95 |
const INCOME = 'income';
|
96 |
const INDUSTRIES = 'industries';
|
97 |
const INSTAGRAM_POSITIONS = 'instagram_positions';
|
98 |
+
const INSTREAM_VIDEO_SKIPPABLE_EXCLUDED = 'instream_video_skippable_excluded';
|
99 |
const INTERESTED_IN = 'interested_in';
|
100 |
const INTERESTS = 'interests';
|
101 |
const IS_WHATSAPP_DESTINATION_AD = 'is_whatsapp_destination_ad';
|
138 |
'catalog_based_targeting' => 'CatalogBasedTargeting',
|
139 |
'cities' => 'list<IDName>',
|
140 |
'college_years' => 'list<unsigned int>',
|
141 |
+
'connections' => 'list<ConnectionsTargeting>',
|
142 |
'contextual_targeting_categories' => 'list<IDName>',
|
143 |
'countries' => 'list<string>',
|
144 |
'country' => 'list<string>',
|
160 |
'ethnic_affinity' => 'list<IDName>',
|
161 |
'exclude_reached_since' => 'list<string>',
|
162 |
'excluded_brand_safety_content_types' => 'list<string>',
|
163 |
+
'excluded_connections' => 'list<ConnectionsTargeting>',
|
164 |
'excluded_custom_audiences' => 'list<RawCustomAudience>',
|
165 |
'excluded_dynamic_audience_ids' => 'list<string>',
|
166 |
'excluded_engagement_specs' => 'list<TargetingDynamicRule>',
|
175 |
'family_statuses' => 'list<IDName>',
|
176 |
'fb_deal_id' => 'string',
|
177 |
'flexible_spec' => 'list<FlexibleTargeting>',
|
178 |
+
'friends_of_connections' => 'list<ConnectionsTargeting>',
|
179 |
'genders' => 'list<unsigned int>',
|
180 |
'generation' => 'list<IDName>',
|
181 |
'geo_locations' => 'TargetingGeoLocation',
|
186 |
'income' => 'list<IDName>',
|
187 |
'industries' => 'list<IDName>',
|
188 |
'instagram_positions' => 'list<string>',
|
189 |
+
'instream_video_skippable_excluded' => 'bool',
|
190 |
'interested_in' => 'list<unsigned int>',
|
191 |
'interests' => 'list<IDName>',
|
192 |
'is_whatsapp_destination_ad' => 'bool',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/{StreamingReactionFields.php → TargetingRelaxationFields.php}
RENAMED
@@ -35,15 +35,13 @@ use FacebookAds\Enum\AbstractEnum;
|
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const REACTION_TYPE = 'reaction_type';
|
42 |
|
43 |
public function getFieldTypes() {
|
44 |
return array(
|
45 |
-
'
|
46 |
-
'reaction_type' => 'ReactionType',
|
47 |
);
|
48 |
}
|
49 |
}
|
35 |
*
|
36 |
*/
|
37 |
|
38 |
+
class TargetingRelaxationFields extends AbstractEnum {
|
39 |
|
40 |
+
const LOOKALIKE = 'lookalike';
|
|
|
41 |
|
42 |
public function getFieldTypes() {
|
43 |
return array(
|
44 |
+
'lookalike' => 'unsigned int',
|
|
|
45 |
);
|
46 |
}
|
47 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UnifiedThreadFields.php
CHANGED
@@ -42,6 +42,7 @@ class UnifiedThreadFields extends AbstractEnum {
|
|
42 |
const ID = 'id';
|
43 |
const IS_SUBSCRIBED = 'is_subscribed';
|
44 |
const LINK = 'link';
|
|
|
45 |
const MESSAGE_COUNT = 'message_count';
|
46 |
const NAME = 'name';
|
47 |
const PARTICIPANTS = 'participants';
|
@@ -60,6 +61,7 @@ class UnifiedThreadFields extends AbstractEnum {
|
|
60 |
'id' => 'string',
|
61 |
'is_subscribed' => 'bool',
|
62 |
'link' => 'string',
|
|
|
63 |
'message_count' => 'int',
|
64 |
'name' => 'string',
|
65 |
'participants' => 'Object',
|
42 |
const ID = 'id';
|
43 |
const IS_SUBSCRIBED = 'is_subscribed';
|
44 |
const LINK = 'link';
|
45 |
+
const LINKED_GROUP = 'linked_group';
|
46 |
const MESSAGE_COUNT = 'message_count';
|
47 |
const NAME = 'name';
|
48 |
const PARTICIPANTS = 'participants';
|
61 |
'id' => 'string',
|
62 |
'is_subscribed' => 'bool',
|
63 |
'link' => 'string',
|
64 |
+
'linked_group' => 'Group',
|
65 |
'message_count' => 'int',
|
66 |
'name' => 'string',
|
67 |
'participants' => 'Object',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UserFields.php
CHANGED
@@ -43,7 +43,6 @@ class UserFields extends AbstractEnum {
|
|
43 |
const AGE_RANGE = 'age_range';
|
44 |
const AUTH_METHOD = 'auth_method';
|
45 |
const BIRTHDAY = 'birthday';
|
46 |
-
const CAN_REVIEW_MEASUREMENT_REQUEST = 'can_review_measurement_request';
|
47 |
const COVER = 'cover';
|
48 |
const CURRENCY = 'currency';
|
49 |
const DEVICES = 'devices';
|
@@ -59,9 +58,7 @@ class UserFields extends AbstractEnum {
|
|
59 |
const INSTALL_TYPE = 'install_type';
|
60 |
const INSTALLED = 'installed';
|
61 |
const INTERESTED_IN = 'interested_in';
|
62 |
-
const IS_FAMEDEEPLINKINGUSER = 'is_famedeeplinkinguser';
|
63 |
const IS_GUEST_USER = 'is_guest_user';
|
64 |
-
const IS_SHARED_LOGIN = 'is_shared_login';
|
65 |
const IS_VERIFIED = 'is_verified';
|
66 |
const LANGUAGES = 'languages';
|
67 |
const LAST_NAME = 'last_name';
|
@@ -81,20 +78,17 @@ class UserFields extends AbstractEnum {
|
|
81 |
const QUOTES = 'quotes';
|
82 |
const RELATIONSHIP_STATUS = 'relationship_status';
|
83 |
const RELIGION = 'religion';
|
84 |
-
const SECURITY_SETTINGS = 'security_settings';
|
85 |
const SHARED_LOGIN_UPGRADE_REQUIRED_BY = 'shared_login_upgrade_required_by';
|
86 |
const SHORT_NAME = 'short_name';
|
87 |
const SIGNIFICANT_OTHER = 'significant_other';
|
88 |
const SPORTS = 'sports';
|
89 |
const SUPPORTS_DONATE_BUTTON_IN_LIVE_VIDEO = 'supports_donate_button_in_live_video';
|
90 |
-
const TEST_GROUP = 'test_group';
|
91 |
const THIRD_PARTY_ID = 'third_party_id';
|
92 |
const TIMEZONE = 'timezone';
|
93 |
const TOKEN_FOR_BUSINESS = 'token_for_business';
|
94 |
const UPDATED_TIME = 'updated_time';
|
95 |
const VERIFIED = 'verified';
|
96 |
const VIDEO_UPLOAD_LIMITS = 'video_upload_limits';
|
97 |
-
const VIEWER_CAN_SEND_GIFT = 'viewer_can_send_gift';
|
98 |
const WEBSITE = 'website';
|
99 |
const WORK = 'work';
|
100 |
|
@@ -106,7 +100,6 @@ class UserFields extends AbstractEnum {
|
|
106 |
'age_range' => 'AgeRange',
|
107 |
'auth_method' => 'string',
|
108 |
'birthday' => 'string',
|
109 |
-
'can_review_measurement_request' => 'bool',
|
110 |
'cover' => 'UserCoverPhoto',
|
111 |
'currency' => 'Currency',
|
112 |
'devices' => 'list<UserDevice>',
|
@@ -122,9 +115,7 @@ class UserFields extends AbstractEnum {
|
|
122 |
'install_type' => 'string',
|
123 |
'installed' => 'bool',
|
124 |
'interested_in' => 'list<string>',
|
125 |
-
'is_famedeeplinkinguser' => 'bool',
|
126 |
'is_guest_user' => 'bool',
|
127 |
-
'is_shared_login' => 'bool',
|
128 |
'is_verified' => 'bool',
|
129 |
'languages' => 'list<Experience>',
|
130 |
'last_name' => 'string',
|
@@ -144,20 +135,17 @@ class UserFields extends AbstractEnum {
|
|
144 |
'quotes' => 'string',
|
145 |
'relationship_status' => 'string',
|
146 |
'religion' => 'string',
|
147 |
-
'security_settings' => 'SecuritySettings',
|
148 |
'shared_login_upgrade_required_by' => 'datetime',
|
149 |
'short_name' => 'string',
|
150 |
'significant_other' => 'User',
|
151 |
'sports' => 'list<Experience>',
|
152 |
'supports_donate_button_in_live_video' => 'bool',
|
153 |
-
'test_group' => 'unsigned int',
|
154 |
'third_party_id' => 'string',
|
155 |
'timezone' => 'float',
|
156 |
'token_for_business' => 'string',
|
157 |
'updated_time' => 'datetime',
|
158 |
'verified' => 'bool',
|
159 |
'video_upload_limits' => 'VideoUploadLimits',
|
160 |
-
'viewer_can_send_gift' => 'bool',
|
161 |
'website' => 'string',
|
162 |
'work' => 'list<Object>',
|
163 |
);
|
43 |
const AGE_RANGE = 'age_range';
|
44 |
const AUTH_METHOD = 'auth_method';
|
45 |
const BIRTHDAY = 'birthday';
|
|
|
46 |
const COVER = 'cover';
|
47 |
const CURRENCY = 'currency';
|
48 |
const DEVICES = 'devices';
|
58 |
const INSTALL_TYPE = 'install_type';
|
59 |
const INSTALLED = 'installed';
|
60 |
const INTERESTED_IN = 'interested_in';
|
|
|
61 |
const IS_GUEST_USER = 'is_guest_user';
|
|
|
62 |
const IS_VERIFIED = 'is_verified';
|
63 |
const LANGUAGES = 'languages';
|
64 |
const LAST_NAME = 'last_name';
|
78 |
const QUOTES = 'quotes';
|
79 |
const RELATIONSHIP_STATUS = 'relationship_status';
|
80 |
const RELIGION = 'religion';
|
|
|
81 |
const SHARED_LOGIN_UPGRADE_REQUIRED_BY = 'shared_login_upgrade_required_by';
|
82 |
const SHORT_NAME = 'short_name';
|
83 |
const SIGNIFICANT_OTHER = 'significant_other';
|
84 |
const SPORTS = 'sports';
|
85 |
const SUPPORTS_DONATE_BUTTON_IN_LIVE_VIDEO = 'supports_donate_button_in_live_video';
|
|
|
86 |
const THIRD_PARTY_ID = 'third_party_id';
|
87 |
const TIMEZONE = 'timezone';
|
88 |
const TOKEN_FOR_BUSINESS = 'token_for_business';
|
89 |
const UPDATED_TIME = 'updated_time';
|
90 |
const VERIFIED = 'verified';
|
91 |
const VIDEO_UPLOAD_LIMITS = 'video_upload_limits';
|
|
|
92 |
const WEBSITE = 'website';
|
93 |
const WORK = 'work';
|
94 |
|
100 |
'age_range' => 'AgeRange',
|
101 |
'auth_method' => 'string',
|
102 |
'birthday' => 'string',
|
|
|
103 |
'cover' => 'UserCoverPhoto',
|
104 |
'currency' => 'Currency',
|
105 |
'devices' => 'list<UserDevice>',
|
115 |
'install_type' => 'string',
|
116 |
'installed' => 'bool',
|
117 |
'interested_in' => 'list<string>',
|
|
|
118 |
'is_guest_user' => 'bool',
|
|
|
119 |
'is_verified' => 'bool',
|
120 |
'languages' => 'list<Experience>',
|
121 |
'last_name' => 'string',
|
135 |
'quotes' => 'string',
|
136 |
'relationship_status' => 'string',
|
137 |
'religion' => 'string',
|
|
|
138 |
'shared_login_upgrade_required_by' => 'datetime',
|
139 |
'short_name' => 'string',
|
140 |
'significant_other' => 'User',
|
141 |
'sports' => 'list<Experience>',
|
142 |
'supports_donate_button_in_live_video' => 'bool',
|
|
|
143 |
'third_party_id' => 'string',
|
144 |
'timezone' => 'float',
|
145 |
'token_for_business' => 'string',
|
146 |
'updated_time' => 'datetime',
|
147 |
'verified' => 'bool',
|
148 |
'video_upload_limits' => 'VideoUploadLimits',
|
|
|
149 |
'website' => 'string',
|
150 |
'work' => 'list<Object>',
|
151 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UserInfluenceFields.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class UserInfluenceFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const TRUST = 'trust';
|
41 |
-
const TRUST_CODE = 'trust_code';
|
42 |
-
const VERSION = 'version';
|
43 |
-
|
44 |
-
public function getFieldTypes() {
|
45 |
-
return array(
|
46 |
-
'trust' => 'string',
|
47 |
-
'trust_code' => 'int',
|
48 |
-
'version' => 'int',
|
49 |
-
);
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/UserTaggableFriendFields.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class UserTaggableFriendFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const FIRST_NAME = 'first_name';
|
41 |
-
const ID = 'id';
|
42 |
-
const LAST_NAME = 'last_name';
|
43 |
-
const MIDDLE_NAME = 'middle_name';
|
44 |
-
const NAME = 'name';
|
45 |
-
|
46 |
-
public function getFieldTypes() {
|
47 |
-
return array(
|
48 |
-
'first_name' => 'string',
|
49 |
-
'id' => 'string',
|
50 |
-
'last_name' => 'string',
|
51 |
-
'middle_name' => 'string',
|
52 |
-
'name' => 'string',
|
53 |
-
);
|
54 |
-
}
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/VehicleFields.php
CHANGED
@@ -41,6 +41,7 @@ class VehicleFields extends AbstractEnum {
|
|
41 |
const APPLINKS = 'applinks';
|
42 |
const AVAILABILITY = 'availability';
|
43 |
const BODY_STYLE = 'body_style';
|
|
|
44 |
const CONDITION = 'condition';
|
45 |
const CURRENCY = 'currency';
|
46 |
const CUSTOM_LABEL_0 = 'custom_label_0';
|
@@ -88,6 +89,7 @@ class VehicleFields extends AbstractEnum {
|
|
88 |
'applinks' => 'CatalogItemAppLinks',
|
89 |
'availability' => 'string',
|
90 |
'body_style' => 'string',
|
|
|
91 |
'condition' => 'string',
|
92 |
'currency' => 'string',
|
93 |
'custom_label_0' => 'string',
|
41 |
const APPLINKS = 'applinks';
|
42 |
const AVAILABILITY = 'availability';
|
43 |
const BODY_STYLE = 'body_style';
|
44 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
45 |
const CONDITION = 'condition';
|
46 |
const CURRENCY = 'currency';
|
47 |
const CUSTOM_LABEL_0 = 'custom_label_0';
|
89 |
'applinks' => 'CatalogItemAppLinks',
|
90 |
'availability' => 'string',
|
91 |
'body_style' => 'string',
|
92 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
93 |
'condition' => 'string',
|
94 |
'currency' => 'string',
|
95 |
'custom_label_0' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/VehicleOfferFields.php
CHANGED
@@ -45,6 +45,7 @@ class VehicleOfferFields extends AbstractEnum {
|
|
45 |
const BODY_STYLE = 'body_style';
|
46 |
const CASHBACK_CURRENCY = 'cashback_currency';
|
47 |
const CASHBACK_PRICE = 'cashback_price';
|
|
|
48 |
const CURRENCY = 'currency';
|
49 |
const DMA_CODES = 'dma_codes';
|
50 |
const DOWNPAYMENT_CURRENCY = 'downpayment_currency';
|
@@ -81,6 +82,7 @@ class VehicleOfferFields extends AbstractEnum {
|
|
81 |
'body_style' => 'string',
|
82 |
'cashback_currency' => 'string',
|
83 |
'cashback_price' => 'string',
|
|
|
84 |
'currency' => 'string',
|
85 |
'dma_codes' => 'list<string>',
|
86 |
'downpayment_currency' => 'string',
|
45 |
const BODY_STYLE = 'body_style';
|
46 |
const CASHBACK_CURRENCY = 'cashback_currency';
|
47 |
const CASHBACK_PRICE = 'cashback_price';
|
48 |
+
const CATEGORY_SPECIFIC_FIELDS = 'category_specific_fields';
|
49 |
const CURRENCY = 'currency';
|
50 |
const DMA_CODES = 'dma_codes';
|
51 |
const DOWNPAYMENT_CURRENCY = 'downpayment_currency';
|
82 |
'body_style' => 'string',
|
83 |
'cashback_currency' => 'string',
|
84 |
'cashback_price' => 'string',
|
85 |
+
'category_specific_fields' => 'CatalogSubVerticalList',
|
86 |
'currency' => 'string',
|
87 |
'dma_codes' => 'list<string>',
|
88 |
'downpayment_currency' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/WhatsAppBusinessAccountFields.php
CHANGED
@@ -43,6 +43,7 @@ class WhatsAppBusinessAccountFields extends AbstractEnum {
|
|
43 |
const MESSAGE_TEMPLATE_NAMESPACE = 'message_template_namespace';
|
44 |
const NAME = 'name';
|
45 |
const ON_BEHALF_OF_BUSINESS_INFO = 'on_behalf_of_business_info';
|
|
|
46 |
const PURCHASE_ORDER_NUMBER = 'purchase_order_number';
|
47 |
const STATUS = 'status';
|
48 |
const TIMEZONE_ID = 'timezone_id';
|
@@ -55,6 +56,7 @@ class WhatsAppBusinessAccountFields extends AbstractEnum {
|
|
55 |
'message_template_namespace' => 'string',
|
56 |
'name' => 'string',
|
57 |
'on_behalf_of_business_info' => 'Object',
|
|
|
58 |
'purchase_order_number' => 'string',
|
59 |
'status' => 'string',
|
60 |
'timezone_id' => 'string',
|
43 |
const MESSAGE_TEMPLATE_NAMESPACE = 'message_template_namespace';
|
44 |
const NAME = 'name';
|
45 |
const ON_BEHALF_OF_BUSINESS_INFO = 'on_behalf_of_business_info';
|
46 |
+
const PRIMARY_FUNDING_ID = 'primary_funding_id';
|
47 |
const PURCHASE_ORDER_NUMBER = 'purchase_order_number';
|
48 |
const STATUS = 'status';
|
49 |
const TIMEZONE_ID = 'timezone_id';
|
56 |
'message_template_namespace' => 'string',
|
57 |
'name' => 'string',
|
58 |
'on_behalf_of_business_info' => 'Object',
|
59 |
+
'primary_funding_id' => 'string',
|
60 |
'purchase_order_number' => 'string',
|
61 |
'status' => 'string',
|
62 |
'timezone_id' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/WhatsAppBusinessProfileFields.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Fields;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
|
38 |
-
class WhatsAppBusinessProfileFields extends AbstractEnum {
|
39 |
-
|
40 |
-
const ID = 'id';
|
41 |
-
const NAME_VERIFICATION = 'name_verification';
|
42 |
-
const VERIFIED_NAME = 'verified_name';
|
43 |
-
|
44 |
-
public function getFieldTypes() {
|
45 |
-
return array(
|
46 |
-
'id' => 'string',
|
47 |
-
'name_verification' => 'Object',
|
48 |
-
'verified_name' => 'string',
|
49 |
-
);
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Group.php
CHANGED
@@ -51,6 +51,7 @@ use FacebookAds\Object\Values\LiveVideoStereoscopicModeValues;
|
|
51 |
use FacebookAds\Object\Values\LiveVideoStreamTypeValues;
|
52 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
53 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
|
|
54 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
55 |
|
56 |
/**
|
@@ -510,6 +511,7 @@ class Group extends AbstractCrudObject {
|
|
510 |
$param_types = array(
|
511 |
'content_tags' => 'list<string>',
|
512 |
'description' => 'string',
|
|
|
513 |
'encoding_settings' => 'string',
|
514 |
'fisheye_video_cropped' => 'bool',
|
515 |
'front_z_rotation' => 'float',
|
@@ -521,7 +523,6 @@ class Group extends AbstractCrudObject {
|
|
521 |
'privacy' => 'string',
|
522 |
'projection' => 'projection_enum',
|
523 |
'published' => 'bool',
|
524 |
-
'save_vod' => 'bool',
|
525 |
'schedule_custom_profile_image' => 'file',
|
526 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
527 |
'status' => 'status_enum',
|
@@ -710,12 +711,14 @@ class Group extends AbstractCrudObject {
|
|
710 |
$this->assureId();
|
711 |
|
712 |
$param_types = array(
|
|
|
713 |
'height' => 'int',
|
714 |
'redirect' => 'bool',
|
715 |
'type' => 'type_enum',
|
716 |
'width' => 'int',
|
717 |
);
|
718 |
$enums = array(
|
|
|
719 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
720 |
);
|
721 |
|
@@ -778,6 +781,7 @@ class Group extends AbstractCrudObject {
|
|
778 |
'composer_type' => 'string',
|
779 |
'container_type' => 'container_type_enum',
|
780 |
'content_category' => 'content_category_enum',
|
|
|
781 |
'description' => 'string',
|
782 |
'embeddable' => 'bool',
|
783 |
'end_offset' => 'unsigned int',
|
@@ -833,6 +837,7 @@ class Group extends AbstractCrudObject {
|
|
833 |
'upload_session_id' => 'string',
|
834 |
'upload_setting_properties' => 'string',
|
835 |
'video_file_chunk' => 'string',
|
|
|
836 |
'video_start_time_ms' => 'unsigned int',
|
837 |
'waterfall_id' => 'string',
|
838 |
);
|
51 |
use FacebookAds\Object\Values\LiveVideoStreamTypeValues;
|
52 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
53 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
54 |
+
use FacebookAds\Object\Values\ProfilePictureSourceBreakingChangeValues;
|
55 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
56 |
|
57 |
/**
|
511 |
$param_types = array(
|
512 |
'content_tags' => 'list<string>',
|
513 |
'description' => 'string',
|
514 |
+
'enable_backup_ingest' => 'bool',
|
515 |
'encoding_settings' => 'string',
|
516 |
'fisheye_video_cropped' => 'bool',
|
517 |
'front_z_rotation' => 'float',
|
523 |
'privacy' => 'string',
|
524 |
'projection' => 'projection_enum',
|
525 |
'published' => 'bool',
|
|
|
526 |
'schedule_custom_profile_image' => 'file',
|
527 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
528 |
'status' => 'status_enum',
|
711 |
$this->assureId();
|
712 |
|
713 |
$param_types = array(
|
714 |
+
'breaking_change' => 'breaking_change_enum',
|
715 |
'height' => 'int',
|
716 |
'redirect' => 'bool',
|
717 |
'type' => 'type_enum',
|
718 |
'width' => 'int',
|
719 |
);
|
720 |
$enums = array(
|
721 |
+
'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),
|
722 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
723 |
);
|
724 |
|
781 |
'composer_type' => 'string',
|
782 |
'container_type' => 'container_type_enum',
|
783 |
'content_category' => 'content_category_enum',
|
784 |
+
'creative_tools' => 'string',
|
785 |
'description' => 'string',
|
786 |
'embeddable' => 'bool',
|
787 |
'end_offset' => 'unsigned int',
|
837 |
'upload_session_id' => 'string',
|
838 |
'upload_setting_properties' => 'string',
|
839 |
'video_file_chunk' => 'string',
|
840 |
+
'video_id_original' => 'string',
|
841 |
'video_start_time_ms' => 'unsigned int',
|
842 |
'waterfall_id' => 'string',
|
843 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/LifeEvent.php
CHANGED
@@ -110,29 +110,6 @@ class LifeEvent extends AbstractCrudObject {
|
|
110 |
return $pending ? $request : $request->execute();
|
111 |
}
|
112 |
|
113 |
-
public function getPhotos(array $fields = array(), array $params = array(), $pending = false) {
|
114 |
-
$this->assureId();
|
115 |
-
|
116 |
-
$param_types = array(
|
117 |
-
);
|
118 |
-
$enums = array(
|
119 |
-
);
|
120 |
-
|
121 |
-
$request = new ApiRequest(
|
122 |
-
$this->api,
|
123 |
-
$this->data['id'],
|
124 |
-
RequestInterface::METHOD_GET,
|
125 |
-
'/photos',
|
126 |
-
new Photo(),
|
127 |
-
'EDGE',
|
128 |
-
Photo::getFieldsEnum()->getValues(),
|
129 |
-
new TypeChecker($param_types, $enums)
|
130 |
-
);
|
131 |
-
$request->addParams($params);
|
132 |
-
$request->addFields($fields);
|
133 |
-
return $pending ? $request : $request->execute();
|
134 |
-
}
|
135 |
-
|
136 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
137 |
$this->assureId();
|
138 |
|
110 |
return $pending ? $request : $request->execute();
|
111 |
}
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
114 |
$this->assureId();
|
115 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Link.php
CHANGED
@@ -30,7 +30,6 @@ use FacebookAds\Http\RequestInterface;
|
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\LinkFields;
|
32 |
use FacebookAds\Object\Values\CommentCommentPrivacyValueValues;
|
33 |
-
use FacebookAds\Object\Values\ProfileTypeValues;
|
34 |
|
35 |
/**
|
36 |
* This class is auto-generated.
|
@@ -116,31 +115,6 @@ class Link extends AbstractCrudObject {
|
|
116 |
return $pending ? $request : $request->execute();
|
117 |
}
|
118 |
|
119 |
-
public function getReactions(array $fields = array(), array $params = array(), $pending = false) {
|
120 |
-
$this->assureId();
|
121 |
-
|
122 |
-
$param_types = array(
|
123 |
-
'type' => 'type_enum',
|
124 |
-
);
|
125 |
-
$enums = array(
|
126 |
-
'type_enum' => ProfileTypeValues::getInstance()->getValues(),
|
127 |
-
);
|
128 |
-
|
129 |
-
$request = new ApiRequest(
|
130 |
-
$this->api,
|
131 |
-
$this->data['id'],
|
132 |
-
RequestInterface::METHOD_GET,
|
133 |
-
'/reactions',
|
134 |
-
new Profile(),
|
135 |
-
'EDGE',
|
136 |
-
Profile::getFieldsEnum()->getValues(),
|
137 |
-
new TypeChecker($param_types, $enums)
|
138 |
-
);
|
139 |
-
$request->addParams($params);
|
140 |
-
$request->addFields($fields);
|
141 |
-
return $pending ? $request : $request->execute();
|
142 |
-
}
|
143 |
-
|
144 |
public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {
|
145 |
$this->assureId();
|
146 |
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\LinkFields;
|
32 |
use FacebookAds\Object\Values\CommentCommentPrivacyValueValues;
|
|
|
33 |
|
34 |
/**
|
35 |
* This class is auto-generated.
|
115 |
return $pending ? $request : $request->execute();
|
116 |
}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {
|
119 |
$this->assureId();
|
120 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/LiveVideo.php
CHANGED
@@ -62,12 +62,12 @@ class LiveVideo extends AbstractCrudObject {
|
|
62 |
|
63 |
protected static function getReferencedEnums() {
|
64 |
$ref_enums = array();
|
|
|
65 |
$ref_enums['Projection'] = LiveVideoProjectionValues::getInstance()->getValues();
|
66 |
$ref_enums['SpatialAudioFormat'] = LiveVideoSpatialAudioFormatValues::getInstance()->getValues();
|
67 |
$ref_enums['Status'] = LiveVideoStatusValues::getInstance()->getValues();
|
68 |
$ref_enums['StereoscopicMode'] = LiveVideoStereoscopicModeValues::getInstance()->getValues();
|
69 |
$ref_enums['StreamType'] = LiveVideoStreamTypeValues::getInstance()->getValues();
|
70 |
-
$ref_enums['BroadcastStatus'] = LiveVideoBroadcastStatusValues::getInstance()->getValues();
|
71 |
$ref_enums['Source'] = LiveVideoSourceValues::getInstance()->getValues();
|
72 |
$ref_enums['LiveCommentModerationSetting'] = LiveVideoLiveCommentModerationSettingValues::getInstance()->getValues();
|
73 |
return $ref_enums;
|
@@ -220,29 +220,6 @@ class LiveVideo extends AbstractCrudObject {
|
|
220 |
return $pending ? $request : $request->execute();
|
221 |
}
|
222 |
|
223 |
-
public function getLikes(array $fields = array(), array $params = array(), $pending = false) {
|
224 |
-
$this->assureId();
|
225 |
-
|
226 |
-
$param_types = array(
|
227 |
-
);
|
228 |
-
$enums = array(
|
229 |
-
);
|
230 |
-
|
231 |
-
$request = new ApiRequest(
|
232 |
-
$this->api,
|
233 |
-
$this->data['id'],
|
234 |
-
RequestInterface::METHOD_GET,
|
235 |
-
'/likes',
|
236 |
-
new Profile(),
|
237 |
-
'EDGE',
|
238 |
-
Profile::getFieldsEnum()->getValues(),
|
239 |
-
new TypeChecker($param_types, $enums)
|
240 |
-
);
|
241 |
-
$request->addParams($params);
|
242 |
-
$request->addFields($fields);
|
243 |
-
return $pending ? $request : $request->execute();
|
244 |
-
}
|
245 |
-
|
246 |
public function getPolls(array $fields = array(), array $params = array(), $pending = false) {
|
247 |
$this->assureId();
|
248 |
|
@@ -392,6 +369,7 @@ class LiveVideo extends AbstractCrudObject {
|
|
392 |
'is_manual_mode' => 'bool',
|
393 |
'live_comment_moderation_setting' => 'list<live_comment_moderation_setting_enum>',
|
394 |
'live_encoders' => 'list<string>',
|
|
|
395 |
'og_icon_id' => 'string',
|
396 |
'og_phrase' => 'string',
|
397 |
'place' => 'Object',
|
62 |
|
63 |
protected static function getReferencedEnums() {
|
64 |
$ref_enums = array();
|
65 |
+
$ref_enums['BroadcastStatus'] = LiveVideoBroadcastStatusValues::getInstance()->getValues();
|
66 |
$ref_enums['Projection'] = LiveVideoProjectionValues::getInstance()->getValues();
|
67 |
$ref_enums['SpatialAudioFormat'] = LiveVideoSpatialAudioFormatValues::getInstance()->getValues();
|
68 |
$ref_enums['Status'] = LiveVideoStatusValues::getInstance()->getValues();
|
69 |
$ref_enums['StereoscopicMode'] = LiveVideoStereoscopicModeValues::getInstance()->getValues();
|
70 |
$ref_enums['StreamType'] = LiveVideoStreamTypeValues::getInstance()->getValues();
|
|
|
71 |
$ref_enums['Source'] = LiveVideoSourceValues::getInstance()->getValues();
|
72 |
$ref_enums['LiveCommentModerationSetting'] = LiveVideoLiveCommentModerationSettingValues::getInstance()->getValues();
|
73 |
return $ref_enums;
|
220 |
return $pending ? $request : $request->execute();
|
221 |
}
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
public function getPolls(array $fields = array(), array $params = array(), $pending = false) {
|
224 |
$this->assureId();
|
225 |
|
369 |
'is_manual_mode' => 'bool',
|
370 |
'live_comment_moderation_setting' => 'list<live_comment_moderation_setting_enum>',
|
371 |
'live_encoders' => 'list<string>',
|
372 |
+
'master_ingest_stream_id' => 'string',
|
373 |
'og_icon_id' => 'string',
|
374 |
'og_phrase' => 'string',
|
375 |
'place' => 'Object',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/MediaFingerprint.php
CHANGED
@@ -102,4 +102,31 @@ class MediaFingerprint extends AbstractCrudObject {
|
|
102 |
return $pending ? $request : $request->execute();
|
103 |
}
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
102 |
return $pending ? $request : $request->execute();
|
103 |
}
|
104 |
|
105 |
+
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
|
106 |
+
$this->assureId();
|
107 |
+
|
108 |
+
$param_types = array(
|
109 |
+
'metadata' => 'list',
|
110 |
+
'source' => 'file',
|
111 |
+
'title' => 'string',
|
112 |
+
'universal_content_id' => 'string',
|
113 |
+
);
|
114 |
+
$enums = array(
|
115 |
+
);
|
116 |
+
|
117 |
+
$request = new ApiRequest(
|
118 |
+
$this->api,
|
119 |
+
$this->data['id'],
|
120 |
+
RequestInterface::METHOD_POST,
|
121 |
+
'/',
|
122 |
+
new MediaFingerprint(),
|
123 |
+
'NODE',
|
124 |
+
MediaFingerprint::getFieldsEnum()->getValues(),
|
125 |
+
new TypeChecker($param_types, $enums)
|
126 |
+
);
|
127 |
+
$request->addParams($params);
|
128 |
+
$request->addFields($fields);
|
129 |
+
return $pending ? $request : $request->execute();
|
130 |
+
}
|
131 |
+
|
132 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/MessengerPlatformReferral.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\MessengerPlatformReferralFields;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* This class is auto-generated.
|
35 |
-
*
|
36 |
-
* For any issues or feature requests related to this class, please let us know
|
37 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
38 |
-
* pull request for this class.
|
39 |
-
*
|
40 |
-
*/
|
41 |
-
|
42 |
-
class MessengerPlatformReferral extends AbstractCrudObject {
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @return MessengerPlatformReferralFields
|
46 |
-
*/
|
47 |
-
public static function getFieldsEnum() {
|
48 |
-
return MessengerPlatformReferralFields::getInstance();
|
49 |
-
}
|
50 |
-
|
51 |
-
protected static function getReferencedEnums() {
|
52 |
-
$ref_enums = array();
|
53 |
-
return $ref_enums;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_GET,
|
69 |
-
'/',
|
70 |
-
new MessengerPlatformReferral(),
|
71 |
-
'NODE',
|
72 |
-
MessengerPlatformReferral::getFieldsEnum()->getValues(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/NativeOfferView.php
CHANGED
@@ -54,29 +54,6 @@ class NativeOfferView extends AbstractCrudObject {
|
|
54 |
}
|
55 |
|
56 |
|
57 |
-
public function getPhotos(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_GET,
|
69 |
-
'/photos',
|
70 |
-
new Photo(),
|
71 |
-
'EDGE',
|
72 |
-
Photo::getFieldsEnum()->getValues(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
public function createPhoto(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
$this->assureId();
|
82 |
|
54 |
}
|
55 |
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
public function createPhoto(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
$this->assureId();
|
59 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/OracleTransaction.php
CHANGED
@@ -79,30 +79,6 @@ class OracleTransaction extends AbstractCrudObject {
|
|
79 |
return $pending ? $request : $request->execute();
|
80 |
}
|
81 |
|
82 |
-
public function getData(array $fields = array(), array $params = array(), $pending = false) {
|
83 |
-
$this->assureId();
|
84 |
-
|
85 |
-
$param_types = array(
|
86 |
-
'redirect' => 'bool',
|
87 |
-
);
|
88 |
-
$enums = array(
|
89 |
-
);
|
90 |
-
|
91 |
-
$request = new ApiRequest(
|
92 |
-
$this->api,
|
93 |
-
$this->data['id'],
|
94 |
-
RequestInterface::METHOD_GET,
|
95 |
-
'/data',
|
96 |
-
new AtlasURL(),
|
97 |
-
'EDGE',
|
98 |
-
AtlasURL::getFieldsEnum()->getValues(),
|
99 |
-
new TypeChecker($param_types, $enums)
|
100 |
-
);
|
101 |
-
$request->addParams($params);
|
102 |
-
$request->addFields($fields);
|
103 |
-
return $pending ? $request : $request->execute();
|
104 |
-
}
|
105 |
-
|
106 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
107 |
$this->assureId();
|
108 |
|
79 |
return $pending ? $request : $request->execute();
|
80 |
}
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
83 |
$this->assureId();
|
84 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Page.php
CHANGED
@@ -60,30 +60,28 @@ use FacebookAds\Object\Values\NativeOfferLocationTypeValues;
|
|
60 |
use FacebookAds\Object\Values\PageAttireValues;
|
61 |
use FacebookAds\Object\Values\PageBackdatedTimeGranularityValues;
|
62 |
use FacebookAds\Object\Values\PageCheckinEntryPointValues;
|
63 |
-
use FacebookAds\Object\Values\PageDomainActionTypeValues;
|
64 |
use FacebookAds\Object\Values\PageFoodStylesValues;
|
65 |
use FacebookAds\Object\Values\PageFormattingValues;
|
66 |
use FacebookAds\Object\Values\PageMessagingTypeValues;
|
67 |
use FacebookAds\Object\Values\PageModelValues;
|
68 |
use FacebookAds\Object\Values\PageNotificationTypeValues;
|
69 |
-
use FacebookAds\Object\Values\PagePaymentDevModeActionValues;
|
70 |
use FacebookAds\Object\Values\PagePermittedTasksValues;
|
|
|
71 |
use FacebookAds\Object\Values\PagePlaceAttachmentSettingValues;
|
72 |
use FacebookAds\Object\Values\PagePostSurfacesBlacklistValues;
|
73 |
use FacebookAds\Object\Values\PagePostWithValues;
|
74 |
use FacebookAds\Object\Values\PagePostingToRedspaceValues;
|
75 |
use FacebookAds\Object\Values\PagePublishStatusValues;
|
76 |
use FacebookAds\Object\Values\PageSenderActionValues;
|
77 |
-
use FacebookAds\Object\Values\PageSettingTypeValues;
|
78 |
use FacebookAds\Object\Values\PageSubscribedFieldsValues;
|
79 |
use FacebookAds\Object\Values\PageTargetSurfaceValues;
|
80 |
use FacebookAds\Object\Values\PageTasksValues;
|
81 |
use FacebookAds\Object\Values\PageTemporaryStatusValues;
|
82 |
-
use FacebookAds\Object\Values\PageThreadStateValues;
|
83 |
use FacebookAds\Object\Values\PageUnpublishedContentTypeValues;
|
84 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
85 |
use FacebookAds\Object\Values\PhotoTypeValues;
|
86 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
|
|
87 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
88 |
use FacebookAds\Object\Values\VideoCopyrightContentCategoryValues;
|
89 |
use FacebookAds\Object\Values\VideoCopyrightMonitoringTypeValues;
|
@@ -118,6 +116,7 @@ class Page extends AbstractCrudObject {
|
|
118 |
$ref_enums = array();
|
119 |
$ref_enums['Attire'] = PageAttireValues::getInstance()->getValues();
|
120 |
$ref_enums['FoodStyles'] = PageFoodStylesValues::getInstance()->getValues();
|
|
|
121 |
$ref_enums['TemporaryStatus'] = PageTemporaryStatusValues::getInstance()->getValues();
|
122 |
$ref_enums['PermittedTasks'] = PagePermittedTasksValues::getInstance()->getValues();
|
123 |
$ref_enums['Tasks'] = PageTasksValues::getInstance()->getValues();
|
@@ -135,10 +134,6 @@ class Page extends AbstractCrudObject {
|
|
135 |
$ref_enums['SenderAction'] = PageSenderActionValues::getInstance()->getValues();
|
136 |
$ref_enums['Model'] = PageModelValues::getInstance()->getValues();
|
137 |
$ref_enums['SubscribedFields'] = PageSubscribedFieldsValues::getInstance()->getValues();
|
138 |
-
$ref_enums['DomainActionType'] = PageDomainActionTypeValues::getInstance()->getValues();
|
139 |
-
$ref_enums['PaymentDevModeAction'] = PagePaymentDevModeActionValues::getInstance()->getValues();
|
140 |
-
$ref_enums['SettingType'] = PageSettingTypeValues::getInstance()->getValues();
|
141 |
-
$ref_enums['ThreadState'] = PageThreadStateValues::getInstance()->getValues();
|
142 |
return $ref_enums;
|
143 |
}
|
144 |
|
@@ -444,6 +439,31 @@ class Page extends AbstractCrudObject {
|
|
444 |
return $pending ? $request : $request->execute();
|
445 |
}
|
446 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
public function getCallToActions(array $fields = array(), array $params = array(), $pending = false) {
|
448 |
$this->assureId();
|
449 |
|
@@ -1028,6 +1048,31 @@ class Page extends AbstractCrudObject {
|
|
1028 |
return $pending ? $request : $request->execute();
|
1029 |
}
|
1030 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1031 |
public function getFeed(array $fields = array(), array $params = array(), $pending = false) {
|
1032 |
$this->assureId();
|
1033 |
|
@@ -1579,6 +1624,7 @@ class Page extends AbstractCrudObject {
|
|
1579 |
'crossposting_actions' => 'list<map>',
|
1580 |
'custom_labels' => 'list<string>',
|
1581 |
'description' => 'string',
|
|
|
1582 |
'encoding_settings' => 'string',
|
1583 |
'fisheye_video_cropped' => 'bool',
|
1584 |
'front_z_rotation' => 'float',
|
@@ -1591,7 +1637,6 @@ class Page extends AbstractCrudObject {
|
|
1591 |
'privacy' => 'string',
|
1592 |
'projection' => 'projection_enum',
|
1593 |
'published' => 'bool',
|
1594 |
-
'save_vod' => 'bool',
|
1595 |
'schedule_custom_profile_image' => 'file',
|
1596 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
1597 |
'status' => 'status_enum',
|
@@ -1687,6 +1732,7 @@ class Page extends AbstractCrudObject {
|
|
1687 |
'page_username' => 'string',
|
1688 |
'permanently_closed' => 'bool',
|
1689 |
'phone' => 'string',
|
|
|
1690 |
'place_topics' => 'list<string>',
|
1691 |
'price_range' => 'string',
|
1692 |
'store_code' => 'string',
|
@@ -1697,6 +1743,7 @@ class Page extends AbstractCrudObject {
|
|
1697 |
'website' => 'string',
|
1698 |
);
|
1699 |
$enums = array(
|
|
|
1700 |
'temporary_status_enum' => PageTemporaryStatusValues::getInstance()->getValues(),
|
1701 |
);
|
1702 |
|
@@ -1886,6 +1933,7 @@ class Page extends AbstractCrudObject {
|
|
1886 |
'ICE_BREAKERS',
|
1887 |
'PAYMENT_SETTINGS',
|
1888 |
'PERSISTENT_MENU',
|
|
|
1889 |
'TARGET_AUDIENCE',
|
1890 |
'WHITELISTED_DOMAINS',
|
1891 |
),
|
@@ -2033,6 +2081,7 @@ class Page extends AbstractCrudObject {
|
|
2033 |
$this->assureId();
|
2034 |
|
2035 |
$param_types = array(
|
|
|
2036 |
'custom_token' => 'string',
|
2037 |
'model' => 'model_enum',
|
2038 |
'n_best' => 'unsigned int',
|
@@ -2059,34 +2108,6 @@ class Page extends AbstractCrudObject {
|
|
2059 |
return $pending ? $request : $request->execute();
|
2060 |
}
|
2061 |
|
2062 |
-
public function createPageAboutStory(array $fields = array(), array $params = array(), $pending = false) {
|
2063 |
-
$this->assureId();
|
2064 |
-
|
2065 |
-
$param_types = array(
|
2066 |
-
'composed_text' => 'list<map>',
|
2067 |
-
'cover_photo' => 'map',
|
2068 |
-
'entity_map' => 'list<map>',
|
2069 |
-
'is_published' => 'bool',
|
2070 |
-
'title' => 'string',
|
2071 |
-
);
|
2072 |
-
$enums = array(
|
2073 |
-
);
|
2074 |
-
|
2075 |
-
$request = new ApiRequest(
|
2076 |
-
$this->api,
|
2077 |
-
$this->data['id'],
|
2078 |
-
RequestInterface::METHOD_POST,
|
2079 |
-
'/page_about_story',
|
2080 |
-
new Page(),
|
2081 |
-
'EDGE',
|
2082 |
-
Page::getFieldsEnum()->getValues(),
|
2083 |
-
new TypeChecker($param_types, $enums)
|
2084 |
-
);
|
2085 |
-
$request->addParams($params);
|
2086 |
-
$request->addFields($fields);
|
2087 |
-
return $pending ? $request : $request->execute();
|
2088 |
-
}
|
2089 |
-
|
2090 |
public function getPageBackedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {
|
2091 |
$this->assureId();
|
2092 |
|
@@ -2281,7 +2302,6 @@ class Page extends AbstractCrudObject {
|
|
2281 |
'initial_view_heading_override_degrees' => 'unsigned int',
|
2282 |
'initial_view_pitch_override_degrees' => 'unsigned int',
|
2283 |
'initial_view_vertical_fov_override_degrees' => 'unsigned int',
|
2284 |
-
'instagram_product_tags' => 'list<map>',
|
2285 |
'ios_bundle_id' => 'string',
|
2286 |
'is_explicit_location' => 'bool',
|
2287 |
'is_explicit_place' => 'bool',
|
@@ -2345,12 +2365,14 @@ class Page extends AbstractCrudObject {
|
|
2345 |
$this->assureId();
|
2346 |
|
2347 |
$param_types = array(
|
|
|
2348 |
'height' => 'int',
|
2349 |
'redirect' => 'bool',
|
2350 |
'type' => 'type_enum',
|
2351 |
'width' => 'int',
|
2352 |
);
|
2353 |
$enums = array(
|
|
|
2354 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
2355 |
);
|
2356 |
|
@@ -2374,6 +2396,7 @@ class Page extends AbstractCrudObject {
|
|
2374 |
|
2375 |
$param_types = array(
|
2376 |
'android_key_hash' => 'string',
|
|
|
2377 |
'caption' => 'string',
|
2378 |
'composer_session_id' => 'string',
|
2379 |
'has_umg' => 'bool',
|
@@ -2416,29 +2439,6 @@ class Page extends AbstractCrudObject {
|
|
2416 |
return $pending ? $request : $request->execute();
|
2417 |
}
|
2418 |
|
2419 |
-
public function getPlaceTopics(array $fields = array(), array $params = array(), $pending = false) {
|
2420 |
-
$this->assureId();
|
2421 |
-
|
2422 |
-
$param_types = array(
|
2423 |
-
);
|
2424 |
-
$enums = array(
|
2425 |
-
);
|
2426 |
-
|
2427 |
-
$request = new ApiRequest(
|
2428 |
-
$this->api,
|
2429 |
-
$this->data['id'],
|
2430 |
-
RequestInterface::METHOD_GET,
|
2431 |
-
'/place_topics',
|
2432 |
-
new PlaceTopic(),
|
2433 |
-
'EDGE',
|
2434 |
-
PlaceTopic::getFieldsEnum()->getValues(),
|
2435 |
-
new TypeChecker($param_types, $enums)
|
2436 |
-
);
|
2437 |
-
$request->addParams($params);
|
2438 |
-
$request->addFields($fields);
|
2439 |
-
return $pending ? $request : $request->execute();
|
2440 |
-
}
|
2441 |
-
|
2442 |
public function getPosts(array $fields = array(), array $params = array(), $pending = false) {
|
2443 |
$this->assureId();
|
2444 |
|
@@ -2799,30 +2799,6 @@ class Page extends AbstractCrudObject {
|
|
2799 |
return $pending ? $request : $request->execute();
|
2800 |
}
|
2801 |
|
2802 |
-
public function deleteTabs(array $fields = array(), array $params = array(), $pending = false) {
|
2803 |
-
$this->assureId();
|
2804 |
-
|
2805 |
-
$param_types = array(
|
2806 |
-
'tab' => 'string',
|
2807 |
-
);
|
2808 |
-
$enums = array(
|
2809 |
-
);
|
2810 |
-
|
2811 |
-
$request = new ApiRequest(
|
2812 |
-
$this->api,
|
2813 |
-
$this->data['id'],
|
2814 |
-
RequestInterface::METHOD_DELETE,
|
2815 |
-
'/tabs',
|
2816 |
-
new AbstractCrudObject(),
|
2817 |
-
'EDGE',
|
2818 |
-
array(),
|
2819 |
-
new TypeChecker($param_types, $enums)
|
2820 |
-
);
|
2821 |
-
$request->addParams($params);
|
2822 |
-
$request->addFields($fields);
|
2823 |
-
return $pending ? $request : $request->execute();
|
2824 |
-
}
|
2825 |
-
|
2826 |
public function getTabs(array $fields = array(), array $params = array(), $pending = false) {
|
2827 |
$this->assureId();
|
2828 |
|
@@ -2948,71 +2924,6 @@ class Page extends AbstractCrudObject {
|
|
2948 |
return $pending ? $request : $request->execute();
|
2949 |
}
|
2950 |
|
2951 |
-
public function deleteThreadSettings(array $fields = array(), array $params = array(), $pending = false) {
|
2952 |
-
$this->assureId();
|
2953 |
-
|
2954 |
-
$param_types = array(
|
2955 |
-
'setting_type' => 'setting_type_enum',
|
2956 |
-
'thread_state' => 'thread_state_enum',
|
2957 |
-
);
|
2958 |
-
$enums = array(
|
2959 |
-
'setting_type_enum' => PageSettingTypeValues::getInstance()->getValues(),
|
2960 |
-
'thread_state_enum' => PageThreadStateValues::getInstance()->getValues(),
|
2961 |
-
);
|
2962 |
-
|
2963 |
-
$request = new ApiRequest(
|
2964 |
-
$this->api,
|
2965 |
-
$this->data['id'],
|
2966 |
-
RequestInterface::METHOD_DELETE,
|
2967 |
-
'/thread_settings',
|
2968 |
-
new AbstractCrudObject(),
|
2969 |
-
'EDGE',
|
2970 |
-
array(),
|
2971 |
-
new TypeChecker($param_types, $enums)
|
2972 |
-
);
|
2973 |
-
$request->addParams($params);
|
2974 |
-
$request->addFields($fields);
|
2975 |
-
return $pending ? $request : $request->execute();
|
2976 |
-
}
|
2977 |
-
|
2978 |
-
public function createThreadSetting(array $fields = array(), array $params = array(), $pending = false) {
|
2979 |
-
$this->assureId();
|
2980 |
-
|
2981 |
-
$param_types = array(
|
2982 |
-
'account_linking_url' => 'string',
|
2983 |
-
'call_to_actions' => 'list<Object>',
|
2984 |
-
'domain_action_type' => 'domain_action_type_enum',
|
2985 |
-
'greeting' => 'Object',
|
2986 |
-
'payment_dev_mode_action' => 'payment_dev_mode_action_enum',
|
2987 |
-
'payment_privacy_url' => 'string',
|
2988 |
-
'payment_public_key' => 'string',
|
2989 |
-
'payment_testers' => 'list<string>',
|
2990 |
-
'setting_type' => 'setting_type_enum',
|
2991 |
-
'thread_state' => 'thread_state_enum',
|
2992 |
-
'whitelisted_domains' => 'list<string>',
|
2993 |
-
);
|
2994 |
-
$enums = array(
|
2995 |
-
'domain_action_type_enum' => PageDomainActionTypeValues::getInstance()->getValues(),
|
2996 |
-
'payment_dev_mode_action_enum' => PagePaymentDevModeActionValues::getInstance()->getValues(),
|
2997 |
-
'setting_type_enum' => PageSettingTypeValues::getInstance()->getValues(),
|
2998 |
-
'thread_state_enum' => PageThreadStateValues::getInstance()->getValues(),
|
2999 |
-
);
|
3000 |
-
|
3001 |
-
$request = new ApiRequest(
|
3002 |
-
$this->api,
|
3003 |
-
$this->data['id'],
|
3004 |
-
RequestInterface::METHOD_POST,
|
3005 |
-
'/thread_settings',
|
3006 |
-
new Page(),
|
3007 |
-
'EDGE',
|
3008 |
-
Page::getFieldsEnum()->getValues(),
|
3009 |
-
new TypeChecker($param_types, $enums)
|
3010 |
-
);
|
3011 |
-
$request->addParams($params);
|
3012 |
-
$request->addFields($fields);
|
3013 |
-
return $pending ? $request : $request->execute();
|
3014 |
-
}
|
3015 |
-
|
3016 |
public function getThreads(array $fields = array(), array $params = array(), $pending = false) {
|
3017 |
$this->assureId();
|
3018 |
|
@@ -3221,6 +3132,7 @@ class Page extends AbstractCrudObject {
|
|
3221 |
'container_type' => 'container_type_enum',
|
3222 |
'content_category' => 'content_category_enum',
|
3223 |
'content_tags' => 'list<string>',
|
|
|
3224 |
'crossposted_video_id' => 'string',
|
3225 |
'custom_labels' => 'list<string>',
|
3226 |
'description' => 'string',
|
@@ -3293,6 +3205,7 @@ class Page extends AbstractCrudObject {
|
|
3293 |
'upload_setting_properties' => 'string',
|
3294 |
'video_asset_id' => 'string',
|
3295 |
'video_file_chunk' => 'string',
|
|
|
3296 |
'video_start_time_ms' => 'unsigned int',
|
3297 |
'waterfall_id' => 'string',
|
3298 |
);
|
@@ -3414,6 +3327,7 @@ class Page extends AbstractCrudObject {
|
|
3414 |
'parking' => 'map',
|
3415 |
'payment_options' => 'map',
|
3416 |
'phone' => 'string',
|
|
|
3417 |
'plot_outline' => 'string',
|
3418 |
'price_range' => 'string',
|
3419 |
'public_transit' => 'string',
|
@@ -3432,6 +3346,7 @@ class Page extends AbstractCrudObject {
|
|
3432 |
$enums = array(
|
3433 |
'attire_enum' => PageAttireValues::getInstance()->getValues(),
|
3434 |
'food_styles_enum' => PageFoodStylesValues::getInstance()->getValues(),
|
|
|
3435 |
'temporary_status_enum' => PageTemporaryStatusValues::getInstance()->getValues(),
|
3436 |
);
|
3437 |
|
60 |
use FacebookAds\Object\Values\PageAttireValues;
|
61 |
use FacebookAds\Object\Values\PageBackdatedTimeGranularityValues;
|
62 |
use FacebookAds\Object\Values\PageCheckinEntryPointValues;
|
|
|
63 |
use FacebookAds\Object\Values\PageFoodStylesValues;
|
64 |
use FacebookAds\Object\Values\PageFormattingValues;
|
65 |
use FacebookAds\Object\Values\PageMessagingTypeValues;
|
66 |
use FacebookAds\Object\Values\PageModelValues;
|
67 |
use FacebookAds\Object\Values\PageNotificationTypeValues;
|
|
|
68 |
use FacebookAds\Object\Values\PagePermittedTasksValues;
|
69 |
+
use FacebookAds\Object\Values\PagePickupOptionsValues;
|
70 |
use FacebookAds\Object\Values\PagePlaceAttachmentSettingValues;
|
71 |
use FacebookAds\Object\Values\PagePostSurfacesBlacklistValues;
|
72 |
use FacebookAds\Object\Values\PagePostWithValues;
|
73 |
use FacebookAds\Object\Values\PagePostingToRedspaceValues;
|
74 |
use FacebookAds\Object\Values\PagePublishStatusValues;
|
75 |
use FacebookAds\Object\Values\PageSenderActionValues;
|
|
|
76 |
use FacebookAds\Object\Values\PageSubscribedFieldsValues;
|
77 |
use FacebookAds\Object\Values\PageTargetSurfaceValues;
|
78 |
use FacebookAds\Object\Values\PageTasksValues;
|
79 |
use FacebookAds\Object\Values\PageTemporaryStatusValues;
|
|
|
80 |
use FacebookAds\Object\Values\PageUnpublishedContentTypeValues;
|
81 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
82 |
use FacebookAds\Object\Values\PhotoTypeValues;
|
83 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
84 |
+
use FacebookAds\Object\Values\ProfilePictureSourceBreakingChangeValues;
|
85 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
86 |
use FacebookAds\Object\Values\VideoCopyrightContentCategoryValues;
|
87 |
use FacebookAds\Object\Values\VideoCopyrightMonitoringTypeValues;
|
116 |
$ref_enums = array();
|
117 |
$ref_enums['Attire'] = PageAttireValues::getInstance()->getValues();
|
118 |
$ref_enums['FoodStyles'] = PageFoodStylesValues::getInstance()->getValues();
|
119 |
+
$ref_enums['PickupOptions'] = PagePickupOptionsValues::getInstance()->getValues();
|
120 |
$ref_enums['TemporaryStatus'] = PageTemporaryStatusValues::getInstance()->getValues();
|
121 |
$ref_enums['PermittedTasks'] = PagePermittedTasksValues::getInstance()->getValues();
|
122 |
$ref_enums['Tasks'] = PageTasksValues::getInstance()->getValues();
|
134 |
$ref_enums['SenderAction'] = PageSenderActionValues::getInstance()->getValues();
|
135 |
$ref_enums['Model'] = PageModelValues::getInstance()->getValues();
|
136 |
$ref_enums['SubscribedFields'] = PageSubscribedFieldsValues::getInstance()->getValues();
|
|
|
|
|
|
|
|
|
137 |
return $ref_enums;
|
138 |
}
|
139 |
|
439 |
return $pending ? $request : $request->execute();
|
440 |
}
|
441 |
|
442 |
+
public function createBusinessDatum(array $fields = array(), array $params = array(), $pending = false) {
|
443 |
+
$this->assureId();
|
444 |
+
|
445 |
+
$param_types = array(
|
446 |
+
'data' => 'list<string>',
|
447 |
+
'partner_agent' => 'string',
|
448 |
+
);
|
449 |
+
$enums = array(
|
450 |
+
);
|
451 |
+
|
452 |
+
$request = new ApiRequest(
|
453 |
+
$this->api,
|
454 |
+
$this->data['id'],
|
455 |
+
RequestInterface::METHOD_POST,
|
456 |
+
'/business_data',
|
457 |
+
new Page(),
|
458 |
+
'EDGE',
|
459 |
+
Page::getFieldsEnum()->getValues(),
|
460 |
+
new TypeChecker($param_types, $enums)
|
461 |
+
);
|
462 |
+
$request->addParams($params);
|
463 |
+
$request->addFields($fields);
|
464 |
+
return $pending ? $request : $request->execute();
|
465 |
+
}
|
466 |
+
|
467 |
public function getCallToActions(array $fields = array(), array $params = array(), $pending = false) {
|
468 |
$this->assureId();
|
469 |
|
1048 |
return $pending ? $request : $request->execute();
|
1049 |
}
|
1050 |
|
1051 |
+
public function createExtendThreadControl(array $fields = array(), array $params = array(), $pending = false) {
|
1052 |
+
$this->assureId();
|
1053 |
+
|
1054 |
+
$param_types = array(
|
1055 |
+
'duration' => 'unsigned int',
|
1056 |
+
'recipient' => 'Object',
|
1057 |
+
);
|
1058 |
+
$enums = array(
|
1059 |
+
);
|
1060 |
+
|
1061 |
+
$request = new ApiRequest(
|
1062 |
+
$this->api,
|
1063 |
+
$this->data['id'],
|
1064 |
+
RequestInterface::METHOD_POST,
|
1065 |
+
'/extend_thread_control',
|
1066 |
+
new Page(),
|
1067 |
+
'EDGE',
|
1068 |
+
Page::getFieldsEnum()->getValues(),
|
1069 |
+
new TypeChecker($param_types, $enums)
|
1070 |
+
);
|
1071 |
+
$request->addParams($params);
|
1072 |
+
$request->addFields($fields);
|
1073 |
+
return $pending ? $request : $request->execute();
|
1074 |
+
}
|
1075 |
+
|
1076 |
public function getFeed(array $fields = array(), array $params = array(), $pending = false) {
|
1077 |
$this->assureId();
|
1078 |
|
1624 |
'crossposting_actions' => 'list<map>',
|
1625 |
'custom_labels' => 'list<string>',
|
1626 |
'description' => 'string',
|
1627 |
+
'enable_backup_ingest' => 'bool',
|
1628 |
'encoding_settings' => 'string',
|
1629 |
'fisheye_video_cropped' => 'bool',
|
1630 |
'front_z_rotation' => 'float',
|
1637 |
'privacy' => 'string',
|
1638 |
'projection' => 'projection_enum',
|
1639 |
'published' => 'bool',
|
|
|
1640 |
'schedule_custom_profile_image' => 'file',
|
1641 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
1642 |
'status' => 'status_enum',
|
1732 |
'page_username' => 'string',
|
1733 |
'permanently_closed' => 'bool',
|
1734 |
'phone' => 'string',
|
1735 |
+
'pickup_options' => 'list<pickup_options_enum>',
|
1736 |
'place_topics' => 'list<string>',
|
1737 |
'price_range' => 'string',
|
1738 |
'store_code' => 'string',
|
1743 |
'website' => 'string',
|
1744 |
);
|
1745 |
$enums = array(
|
1746 |
+
'pickup_options_enum' => PagePickupOptionsValues::getInstance()->getValues(),
|
1747 |
'temporary_status_enum' => PageTemporaryStatusValues::getInstance()->getValues(),
|
1748 |
);
|
1749 |
|
1933 |
'ICE_BREAKERS',
|
1934 |
'PAYMENT_SETTINGS',
|
1935 |
'PERSISTENT_MENU',
|
1936 |
+
'PLATFORM',
|
1937 |
'TARGET_AUDIENCE',
|
1938 |
'WHITELISTED_DOMAINS',
|
1939 |
),
|
2081 |
$this->assureId();
|
2082 |
|
2083 |
$param_types = array(
|
2084 |
+
'api_version' => 'Object',
|
2085 |
'custom_token' => 'string',
|
2086 |
'model' => 'model_enum',
|
2087 |
'n_best' => 'unsigned int',
|
2108 |
return $pending ? $request : $request->execute();
|
2109 |
}
|
2110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2111 |
public function getPageBackedInstagramAccounts(array $fields = array(), array $params = array(), $pending = false) {
|
2112 |
$this->assureId();
|
2113 |
|
2302 |
'initial_view_heading_override_degrees' => 'unsigned int',
|
2303 |
'initial_view_pitch_override_degrees' => 'unsigned int',
|
2304 |
'initial_view_vertical_fov_override_degrees' => 'unsigned int',
|
|
|
2305 |
'ios_bundle_id' => 'string',
|
2306 |
'is_explicit_location' => 'bool',
|
2307 |
'is_explicit_place' => 'bool',
|
2365 |
$this->assureId();
|
2366 |
|
2367 |
$param_types = array(
|
2368 |
+
'breaking_change' => 'breaking_change_enum',
|
2369 |
'height' => 'int',
|
2370 |
'redirect' => 'bool',
|
2371 |
'type' => 'type_enum',
|
2372 |
'width' => 'int',
|
2373 |
);
|
2374 |
$enums = array(
|
2375 |
+
'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),
|
2376 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
2377 |
);
|
2378 |
|
2396 |
|
2397 |
$param_types = array(
|
2398 |
'android_key_hash' => 'string',
|
2399 |
+
'burn_media_effect' => 'bool',
|
2400 |
'caption' => 'string',
|
2401 |
'composer_session_id' => 'string',
|
2402 |
'has_umg' => 'bool',
|
2439 |
return $pending ? $request : $request->execute();
|
2440 |
}
|
2441 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2442 |
public function getPosts(array $fields = array(), array $params = array(), $pending = false) {
|
2443 |
$this->assureId();
|
2444 |
|
2799 |
return $pending ? $request : $request->execute();
|
2800 |
}
|
2801 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2802 |
public function getTabs(array $fields = array(), array $params = array(), $pending = false) {
|
2803 |
$this->assureId();
|
2804 |
|
2924 |
return $pending ? $request : $request->execute();
|
2925 |
}
|
2926 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2927 |
public function getThreads(array $fields = array(), array $params = array(), $pending = false) {
|
2928 |
$this->assureId();
|
2929 |
|
3132 |
'container_type' => 'container_type_enum',
|
3133 |
'content_category' => 'content_category_enum',
|
3134 |
'content_tags' => 'list<string>',
|
3135 |
+
'creative_tools' => 'string',
|
3136 |
'crossposted_video_id' => 'string',
|
3137 |
'custom_labels' => 'list<string>',
|
3138 |
'description' => 'string',
|
3205 |
'upload_setting_properties' => 'string',
|
3206 |
'video_asset_id' => 'string',
|
3207 |
'video_file_chunk' => 'string',
|
3208 |
+
'video_id_original' => 'string',
|
3209 |
'video_start_time_ms' => 'unsigned int',
|
3210 |
'waterfall_id' => 'string',
|
3211 |
);
|
3327 |
'parking' => 'map',
|
3328 |
'payment_options' => 'map',
|
3329 |
'phone' => 'string',
|
3330 |
+
'pickup_options' => 'list<pickup_options_enum>',
|
3331 |
'plot_outline' => 'string',
|
3332 |
'price_range' => 'string',
|
3333 |
'public_transit' => 'string',
|
3346 |
$enums = array(
|
3347 |
'attire_enum' => PageAttireValues::getInstance()->getValues(),
|
3348 |
'food_styles_enum' => PageFoodStylesValues::getInstance()->getValues(),
|
3349 |
+
'pickup_options_enum' => PagePickupOptionsValues::getInstance()->getValues(),
|
3350 |
'temporary_status_enum' => PageTemporaryStatusValues::getInstance()->getValues(),
|
3351 |
);
|
3352 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/PageAboutStory.php
DELETED
@@ -1,131 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\PageAboutStoryFields;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* This class is auto-generated.
|
35 |
-
*
|
36 |
-
* For any issues or feature requests related to this class, please let us know
|
37 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
38 |
-
* pull request for this class.
|
39 |
-
*
|
40 |
-
*/
|
41 |
-
|
42 |
-
class PageAboutStory extends AbstractCrudObject {
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @return PageAboutStoryFields
|
46 |
-
*/
|
47 |
-
public static function getFieldsEnum() {
|
48 |
-
return PageAboutStoryFields::getInstance();
|
49 |
-
}
|
50 |
-
|
51 |
-
protected static function getReferencedEnums() {
|
52 |
-
$ref_enums = array();
|
53 |
-
return $ref_enums;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_DELETE,
|
69 |
-
'/',
|
70 |
-
new AbstractCrudObject(),
|
71 |
-
'NODE',
|
72 |
-
array(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
-
$this->assureId();
|
82 |
-
|
83 |
-
$param_types = array(
|
84 |
-
);
|
85 |
-
$enums = array(
|
86 |
-
);
|
87 |
-
|
88 |
-
$request = new ApiRequest(
|
89 |
-
$this->api,
|
90 |
-
$this->data['id'],
|
91 |
-
RequestInterface::METHOD_GET,
|
92 |
-
'/',
|
93 |
-
new PageAboutStory(),
|
94 |
-
'NODE',
|
95 |
-
PageAboutStory::getFieldsEnum()->getValues(),
|
96 |
-
new TypeChecker($param_types, $enums)
|
97 |
-
);
|
98 |
-
$request->addParams($params);
|
99 |
-
$request->addFields($fields);
|
100 |
-
return $pending ? $request : $request->execute();
|
101 |
-
}
|
102 |
-
|
103 |
-
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
|
104 |
-
$this->assureId();
|
105 |
-
|
106 |
-
$param_types = array(
|
107 |
-
'composed_text' => 'list<map>',
|
108 |
-
'cover_photo' => 'map',
|
109 |
-
'entity_map' => 'list<map>',
|
110 |
-
'is_published' => 'bool',
|
111 |
-
'title' => 'string',
|
112 |
-
);
|
113 |
-
$enums = array(
|
114 |
-
);
|
115 |
-
|
116 |
-
$request = new ApiRequest(
|
117 |
-
$this->api,
|
118 |
-
$this->data['id'],
|
119 |
-
RequestInterface::METHOD_POST,
|
120 |
-
'/',
|
121 |
-
new PageAboutStory(),
|
122 |
-
'NODE',
|
123 |
-
PageAboutStory::getFieldsEnum()->getValues(),
|
124 |
-
new TypeChecker($param_types, $enums)
|
125 |
-
);
|
126 |
-
$request->addParams($params);
|
127 |
-
$request->addFields($fields);
|
128 |
-
return $pending ? $request : $request->execute();
|
129 |
-
}
|
130 |
-
|
131 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/PageChangeProposal.php
CHANGED
@@ -54,51 +54,4 @@ class PageChangeProposal extends AbstractCrudObject {
|
|
54 |
}
|
55 |
|
56 |
|
57 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_GET,
|
69 |
-
'/',
|
70 |
-
new PageChangeProposal(),
|
71 |
-
'NODE',
|
72 |
-
PageChangeProposal::getFieldsEnum()->getValues(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
-
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
-
$this->assureId();
|
82 |
-
|
83 |
-
$param_types = array(
|
84 |
-
'accept' => 'bool',
|
85 |
-
);
|
86 |
-
$enums = array(
|
87 |
-
);
|
88 |
-
|
89 |
-
$request = new ApiRequest(
|
90 |
-
$this->api,
|
91 |
-
$this->data['id'],
|
92 |
-
RequestInterface::METHOD_POST,
|
93 |
-
'/',
|
94 |
-
new PageChangeProposal(),
|
95 |
-
'NODE',
|
96 |
-
PageChangeProposal::getFieldsEnum()->getValues(),
|
97 |
-
new TypeChecker($param_types, $enums)
|
98 |
-
);
|
99 |
-
$request->addParams($params);
|
100 |
-
$request->addFields($fields);
|
101 |
-
return $pending ? $request : $request->execute();
|
102 |
-
}
|
103 |
-
|
104 |
}
|
54 |
}
|
55 |
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{BrandAudience.php → PaymentSubscription.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\BrandAudienceFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
@@ -67,9 +67,9 @@ class BrandAudience extends AbstractCrudObject {
|
|
67 |
$this->data['id'],
|
68 |
RequestInterface::METHOD_GET,
|
69 |
'/',
|
70 |
-
new
|
71 |
'NODE',
|
72 |
-
|
73 |
new TypeChecker($param_types, $enums)
|
74 |
);
|
75 |
$request->addParams($params);
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\PaymentSubscriptionFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class PaymentSubscription extends AbstractCrudObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return PaymentSubscriptionFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return PaymentSubscriptionFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
67 |
$this->data['id'],
|
68 |
RequestInterface::METHOD_GET,
|
69 |
'/',
|
70 |
+
new PaymentSubscription(),
|
71 |
'NODE',
|
72 |
+
PaymentSubscription::getFieldsEnum()->getValues(),
|
73 |
new TypeChecker($param_types, $enums)
|
74 |
);
|
75 |
$request->addParams($params);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Photo.php
CHANGED
@@ -38,6 +38,7 @@ use FacebookAds\Object\Values\InsightsResultPeriodValues;
|
|
38 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
39 |
use FacebookAds\Object\Values\PhotoTypeValues;
|
40 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
|
|
41 |
|
42 |
/**
|
43 |
* This class is auto-generated.
|
@@ -213,6 +214,31 @@ class Photo extends AbstractCrudObject {
|
|
213 |
return $pending ? $request : $request->execute();
|
214 |
}
|
215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {
|
217 |
$this->assureId();
|
218 |
|
38 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
39 |
use FacebookAds\Object\Values\PhotoTypeValues;
|
40 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
41 |
+
use FacebookAds\Object\Values\ProfileTypeValues;
|
42 |
|
43 |
/**
|
44 |
* This class is auto-generated.
|
214 |
return $pending ? $request : $request->execute();
|
215 |
}
|
216 |
|
217 |
+
public function getReactions(array $fields = array(), array $params = array(), $pending = false) {
|
218 |
+
$this->assureId();
|
219 |
+
|
220 |
+
$param_types = array(
|
221 |
+
'type' => 'type_enum',
|
222 |
+
);
|
223 |
+
$enums = array(
|
224 |
+
'type_enum' => ProfileTypeValues::getInstance()->getValues(),
|
225 |
+
);
|
226 |
+
|
227 |
+
$request = new ApiRequest(
|
228 |
+
$this->api,
|
229 |
+
$this->data['id'],
|
230 |
+
RequestInterface::METHOD_GET,
|
231 |
+
'/reactions',
|
232 |
+
new Profile(),
|
233 |
+
'EDGE',
|
234 |
+
Profile::getFieldsEnum()->getValues(),
|
235 |
+
new TypeChecker($param_types, $enums)
|
236 |
+
);
|
237 |
+
$request->addParams($params);
|
238 |
+
$request->addFields($fields);
|
239 |
+
return $pending ? $request : $request->execute();
|
240 |
+
}
|
241 |
+
|
242 |
public function getSharedPosts(array $fields = array(), array $params = array(), $pending = false) {
|
243 |
$this->assureId();
|
244 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Post.php
CHANGED
@@ -295,6 +295,8 @@ class Post extends AbstractCrudObject {
|
|
295 |
'LOCAL',
|
296 |
'LOOKALIKE',
|
297 |
'MARKETPLACE_DEFAULT',
|
|
|
|
|
298 |
'MULT_CUSTOM_AUDIENCES',
|
299 |
'NCPP',
|
300 |
'SAVED_AUDIENCE',
|
@@ -345,6 +347,7 @@ class Post extends AbstractCrudObject {
|
|
345 |
'SAY_THANKS',
|
346 |
'SEE_MORE',
|
347 |
'SELL_NOW',
|
|
|
348 |
'SHARE',
|
349 |
'SHOP_NOW',
|
350 |
'SIGN_UP',
|
295 |
'LOCAL',
|
296 |
'LOOKALIKE',
|
297 |
'MARKETPLACE_DEFAULT',
|
298 |
+
'MARKETPLACE_NATIONWIDE_AUDIENCE',
|
299 |
+
'MARKETPLACE_SAVED_AUDIENCE',
|
300 |
'MULT_CUSTOM_AUDIENCES',
|
301 |
'NCPP',
|
302 |
'SAVED_AUDIENCE',
|
347 |
'SAY_THANKS',
|
348 |
'SEE_MORE',
|
349 |
'SELL_NOW',
|
350 |
+
'SEND_A_GIFT',
|
351 |
'SHARE',
|
352 |
'SHOP_NOW',
|
353 |
'SIGN_UP',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductCatalog.php
CHANGED
@@ -30,6 +30,7 @@ use FacebookAds\Http\RequestInterface;
|
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\ProductCatalogFields;
|
32 |
use FacebookAds\Object\Values\ProductCatalogCategoryCategorizationCriteriaValues;
|
|
|
33 |
use FacebookAds\Object\Values\ProductCatalogPermittedRolesValues;
|
34 |
use FacebookAds\Object\Values\ProductCatalogPermittedTasksValues;
|
35 |
use FacebookAds\Object\Values\ProductCatalogStandardValues;
|
@@ -39,6 +40,7 @@ use FacebookAds\Object\Values\ProductEventStatBreakdownsValues;
|
|
39 |
use FacebookAds\Object\Values\ProductFeedDelimiterValues;
|
40 |
use FacebookAds\Object\Values\ProductFeedEncodingValues;
|
41 |
use FacebookAds\Object\Values\ProductFeedFeedTypeValues;
|
|
|
42 |
use FacebookAds\Object\Values\ProductFeedOverrideTypeValues;
|
43 |
use FacebookAds\Object\Values\ProductFeedQuotedFieldsModeValues;
|
44 |
use FacebookAds\Object\Values\ProductItemAvailabilityValues;
|
@@ -87,6 +89,7 @@ class ProductCatalog extends AbstractCrudObject {
|
|
87 |
$ref_enums['PermittedTasks'] = ProductCatalogPermittedTasksValues::getInstance()->getValues();
|
88 |
$ref_enums['Tasks'] = ProductCatalogTasksValues::getInstance()->getValues();
|
89 |
$ref_enums['Standard'] = ProductCatalogStandardValues::getInstance()->getValues();
|
|
|
90 |
return $ref_enums;
|
91 |
}
|
92 |
|
@@ -145,6 +148,7 @@ class ProductCatalog extends AbstractCrudObject {
|
|
145 |
'business' => 'string',
|
146 |
'permitted_roles' => 'list<permitted_roles_enum>',
|
147 |
'permitted_tasks' => 'list<permitted_tasks_enum>',
|
|
|
148 |
);
|
149 |
$enums = array(
|
150 |
'permitted_roles_enum' => ProductCatalogPermittedRolesValues::getInstance()->getValues(),
|
@@ -718,10 +722,12 @@ class ProductCatalog extends AbstractCrudObject {
|
|
718 |
|
719 |
$param_types = array(
|
720 |
'allow_upsert' => 'bool',
|
|
|
721 |
'item_type' => 'string',
|
722 |
'requests' => 'map',
|
723 |
);
|
724 |
$enums = array(
|
|
|
725 |
);
|
726 |
|
727 |
$request = new ApiRequest(
|
@@ -851,6 +857,7 @@ class ProductCatalog extends AbstractCrudObject {
|
|
851 |
'encoding' => 'encoding_enum',
|
852 |
'feed_type' => 'feed_type_enum',
|
853 |
'file_name' => 'string',
|
|
|
854 |
'name' => 'string',
|
855 |
'override_type' => 'override_type_enum',
|
856 |
'override_value' => 'string',
|
@@ -864,6 +871,7 @@ class ProductCatalog extends AbstractCrudObject {
|
|
864 |
'delimiter_enum' => ProductFeedDelimiterValues::getInstance()->getValues(),
|
865 |
'encoding_enum' => ProductFeedEncodingValues::getInstance()->getValues(),
|
866 |
'feed_type_enum' => ProductFeedFeedTypeValues::getInstance()->getValues(),
|
|
|
867 |
'override_type_enum' => ProductFeedOverrideTypeValues::getInstance()->getValues(),
|
868 |
'quoted_fields_mode_enum' => ProductFeedQuotedFieldsModeValues::getInstance()->getValues(),
|
869 |
);
|
@@ -963,7 +971,9 @@ class ProductCatalog extends AbstractCrudObject {
|
|
963 |
|
964 |
$param_types = array(
|
965 |
'filter' => 'Object',
|
|
|
966 |
'name' => 'string',
|
|
|
967 |
);
|
968 |
$enums = array(
|
969 |
);
|
@@ -1047,6 +1057,7 @@ class ProductCatalog extends AbstractCrudObject {
|
|
1047 |
'availability' => 'availability_enum',
|
1048 |
'brand' => 'string',
|
1049 |
'category' => 'string',
|
|
|
1050 |
'checkout_url' => 'string',
|
1051 |
'color' => 'string',
|
1052 |
'commerce_tax_category' => 'commerce_tax_category_enum',
|
@@ -1060,6 +1071,7 @@ class ProductCatalog extends AbstractCrudObject {
|
|
1060 |
'custom_label_4' => 'string',
|
1061 |
'description' => 'string',
|
1062 |
'expiration_date' => 'string',
|
|
|
1063 |
'gender' => 'gender_enum',
|
1064 |
'gtin' => 'string',
|
1065 |
'image_url' => 'string',
|
@@ -1261,8 +1273,16 @@ class ProductCatalog extends AbstractCrudObject {
|
|
1261 |
$this->assureId();
|
1262 |
|
1263 |
$param_types = array(
|
|
|
1264 |
);
|
1265 |
$enums = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1266 |
);
|
1267 |
|
1268 |
$request = new ApiRequest(
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\ProductCatalogFields;
|
32 |
use FacebookAds\Object\Values\ProductCatalogCategoryCategorizationCriteriaValues;
|
33 |
+
use FacebookAds\Object\Values\ProductCatalogItemSubTypeValues;
|
34 |
use FacebookAds\Object\Values\ProductCatalogPermittedRolesValues;
|
35 |
use FacebookAds\Object\Values\ProductCatalogPermittedTasksValues;
|
36 |
use FacebookAds\Object\Values\ProductCatalogStandardValues;
|
40 |
use FacebookAds\Object\Values\ProductFeedDelimiterValues;
|
41 |
use FacebookAds\Object\Values\ProductFeedEncodingValues;
|
42 |
use FacebookAds\Object\Values\ProductFeedFeedTypeValues;
|
43 |
+
use FacebookAds\Object\Values\ProductFeedItemSubTypeValues;
|
44 |
use FacebookAds\Object\Values\ProductFeedOverrideTypeValues;
|
45 |
use FacebookAds\Object\Values\ProductFeedQuotedFieldsModeValues;
|
46 |
use FacebookAds\Object\Values\ProductItemAvailabilityValues;
|
89 |
$ref_enums['PermittedTasks'] = ProductCatalogPermittedTasksValues::getInstance()->getValues();
|
90 |
$ref_enums['Tasks'] = ProductCatalogTasksValues::getInstance()->getValues();
|
91 |
$ref_enums['Standard'] = ProductCatalogStandardValues::getInstance()->getValues();
|
92 |
+
$ref_enums['ItemSubType'] = ProductCatalogItemSubTypeValues::getInstance()->getValues();
|
93 |
return $ref_enums;
|
94 |
}
|
95 |
|
148 |
'business' => 'string',
|
149 |
'permitted_roles' => 'list<permitted_roles_enum>',
|
150 |
'permitted_tasks' => 'list<permitted_tasks_enum>',
|
151 |
+
'utm_settings' => 'map',
|
152 |
);
|
153 |
$enums = array(
|
154 |
'permitted_roles_enum' => ProductCatalogPermittedRolesValues::getInstance()->getValues(),
|
722 |
|
723 |
$param_types = array(
|
724 |
'allow_upsert' => 'bool',
|
725 |
+
'item_sub_type' => 'item_sub_type_enum',
|
726 |
'item_type' => 'string',
|
727 |
'requests' => 'map',
|
728 |
);
|
729 |
$enums = array(
|
730 |
+
'item_sub_type_enum' => ProductCatalogItemSubTypeValues::getInstance()->getValues(),
|
731 |
);
|
732 |
|
733 |
$request = new ApiRequest(
|
857 |
'encoding' => 'encoding_enum',
|
858 |
'feed_type' => 'feed_type_enum',
|
859 |
'file_name' => 'string',
|
860 |
+
'item_sub_type' => 'item_sub_type_enum',
|
861 |
'name' => 'string',
|
862 |
'override_type' => 'override_type_enum',
|
863 |
'override_value' => 'string',
|
871 |
'delimiter_enum' => ProductFeedDelimiterValues::getInstance()->getValues(),
|
872 |
'encoding_enum' => ProductFeedEncodingValues::getInstance()->getValues(),
|
873 |
'feed_type_enum' => ProductFeedFeedTypeValues::getInstance()->getValues(),
|
874 |
+
'item_sub_type_enum' => ProductFeedItemSubTypeValues::getInstance()->getValues(),
|
875 |
'override_type_enum' => ProductFeedOverrideTypeValues::getInstance()->getValues(),
|
876 |
'quoted_fields_mode_enum' => ProductFeedQuotedFieldsModeValues::getInstance()->getValues(),
|
877 |
);
|
971 |
|
972 |
$param_types = array(
|
973 |
'filter' => 'Object',
|
974 |
+
'metadata' => 'map',
|
975 |
'name' => 'string',
|
976 |
+
'retailer_id' => 'string',
|
977 |
);
|
978 |
$enums = array(
|
979 |
);
|
1057 |
'availability' => 'availability_enum',
|
1058 |
'brand' => 'string',
|
1059 |
'category' => 'string',
|
1060 |
+
'category_specific_fields' => 'map',
|
1061 |
'checkout_url' => 'string',
|
1062 |
'color' => 'string',
|
1063 |
'commerce_tax_category' => 'commerce_tax_category_enum',
|
1071 |
'custom_label_4' => 'string',
|
1072 |
'description' => 'string',
|
1073 |
'expiration_date' => 'string',
|
1074 |
+
'fb_product_category' => 'string',
|
1075 |
'gender' => 'gender_enum',
|
1076 |
'gtin' => 'string',
|
1077 |
'image_url' => 'string',
|
1273 |
$this->assureId();
|
1274 |
|
1275 |
$param_types = array(
|
1276 |
+
'segment_use_cases' => 'list<segment_use_cases_enum>',
|
1277 |
);
|
1278 |
$enums = array(
|
1279 |
+
'segment_use_cases_enum' => array(
|
1280 |
+
'COLLAB_ADS',
|
1281 |
+
'COLLAB_ADS_FOR_MARKETPLACE_PARTNER',
|
1282 |
+
'IG_SHOPPING',
|
1283 |
+
'MARKETPLACE_SHOPS',
|
1284 |
+
'TEST',
|
1285 |
+
),
|
1286 |
);
|
1287 |
|
1288 |
$request = new ApiRequest(
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductFeed.php
CHANGED
@@ -32,6 +32,7 @@ use FacebookAds\Object\Fields\ProductFeedFields;
|
|
32 |
use FacebookAds\Object\Values\ProductFeedDelimiterValues;
|
33 |
use FacebookAds\Object\Values\ProductFeedEncodingValues;
|
34 |
use FacebookAds\Object\Values\ProductFeedFeedTypeValues;
|
|
|
35 |
use FacebookAds\Object\Values\ProductFeedOverrideTypeValues;
|
36 |
use FacebookAds\Object\Values\ProductFeedQuotedFieldsModeValues;
|
37 |
use FacebookAds\Object\Values\ProductFeedRuleRuleTypeValues;
|
@@ -67,6 +68,7 @@ class ProductFeed extends AbstractCrudObject {
|
|
67 |
$ref_enums['QuotedFieldsMode'] = ProductFeedQuotedFieldsModeValues::getInstance()->getValues();
|
68 |
$ref_enums['Encoding'] = ProductFeedEncodingValues::getInstance()->getValues();
|
69 |
$ref_enums['FeedType'] = ProductFeedFeedTypeValues::getInstance()->getValues();
|
|
|
70 |
$ref_enums['OverrideType'] = ProductFeedOverrideTypeValues::getInstance()->getValues();
|
71 |
return $ref_enums;
|
72 |
}
|
32 |
use FacebookAds\Object\Values\ProductFeedDelimiterValues;
|
33 |
use FacebookAds\Object\Values\ProductFeedEncodingValues;
|
34 |
use FacebookAds\Object\Values\ProductFeedFeedTypeValues;
|
35 |
+
use FacebookAds\Object\Values\ProductFeedItemSubTypeValues;
|
36 |
use FacebookAds\Object\Values\ProductFeedOverrideTypeValues;
|
37 |
use FacebookAds\Object\Values\ProductFeedQuotedFieldsModeValues;
|
38 |
use FacebookAds\Object\Values\ProductFeedRuleRuleTypeValues;
|
68 |
$ref_enums['QuotedFieldsMode'] = ProductFeedQuotedFieldsModeValues::getInstance()->getValues();
|
69 |
$ref_enums['Encoding'] = ProductFeedEncodingValues::getInstance()->getValues();
|
70 |
$ref_enums['FeedType'] = ProductFeedFeedTypeValues::getInstance()->getValues();
|
71 |
+
$ref_enums['ItemSubType'] = ProductFeedItemSubTypeValues::getInstance()->getValues();
|
72 |
$ref_enums['OverrideType'] = ProductFeedOverrideTypeValues::getInstance()->getValues();
|
73 |
return $ref_enums;
|
74 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductGroup.php
CHANGED
@@ -115,6 +115,7 @@ class ProductGroup extends AbstractCrudObject {
|
|
115 |
'custom_label_4' => 'string',
|
116 |
'description' => 'string',
|
117 |
'expiration_date' => 'string',
|
|
|
118 |
'gender' => 'gender_enum',
|
119 |
'gtin' => 'string',
|
120 |
'image_url' => 'string',
|
115 |
'custom_label_4' => 'string',
|
116 |
'description' => 'string',
|
117 |
'expiration_date' => 'string',
|
118 |
+
'fb_product_category' => 'string',
|
119 |
'gender' => 'gender_enum',
|
120 |
'gtin' => 'string',
|
121 |
'image_url' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductItem.php
CHANGED
@@ -162,6 +162,7 @@ class ProductItem extends AbstractCrudObject {
|
|
162 |
'availability' => 'availability_enum',
|
163 |
'brand' => 'string',
|
164 |
'category' => 'string',
|
|
|
165 |
'checkout_url' => 'string',
|
166 |
'color' => 'string',
|
167 |
'commerce_tax_category' => 'commerce_tax_category_enum',
|
@@ -175,6 +176,7 @@ class ProductItem extends AbstractCrudObject {
|
|
175 |
'custom_label_4' => 'string',
|
176 |
'description' => 'string',
|
177 |
'expiration_date' => 'string',
|
|
|
178 |
'gender' => 'gender_enum',
|
179 |
'gtin' => 'string',
|
180 |
'image_url' => 'string',
|
162 |
'availability' => 'availability_enum',
|
163 |
'brand' => 'string',
|
164 |
'category' => 'string',
|
165 |
+
'category_specific_fields' => 'map',
|
166 |
'checkout_url' => 'string',
|
167 |
'color' => 'string',
|
168 |
'commerce_tax_category' => 'commerce_tax_category_enum',
|
176 |
'custom_label_4' => 'string',
|
177 |
'description' => 'string',
|
178 |
'expiration_date' => 'string',
|
179 |
+
'fb_product_category' => 'string',
|
180 |
'gender' => 'gender_enum',
|
181 |
'gtin' => 'string',
|
182 |
'image_url' => 'string',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductSet.php
CHANGED
@@ -312,7 +312,9 @@ class ProductSet extends AbstractCrudObject {
|
|
312 |
|
313 |
$param_types = array(
|
314 |
'filter' => 'Object',
|
|
|
315 |
'name' => 'string',
|
|
|
316 |
);
|
317 |
$enums = array(
|
318 |
);
|
312 |
|
313 |
$param_types = array(
|
314 |
'filter' => 'Object',
|
315 |
+
'metadata' => 'map',
|
316 |
'name' => 'string',
|
317 |
+
'retailer_id' => 'string',
|
318 |
);
|
319 |
$enums = array(
|
320 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{UserInfluence.php → ProductSetMetadata.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\UserInfluenceFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\ProductSetMetadataFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class ProductSetMetadata extends AbstractObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return ProductSetMetadataFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return ProductSetMetadataFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Profile.php
CHANGED
@@ -29,6 +29,7 @@ use FacebookAds\Cursor;
|
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\ProfileFields;
|
|
|
32 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
33 |
use FacebookAds\Object\Values\ProfileProfileTypeValues;
|
34 |
use FacebookAds\Object\Values\ProfileTypeValues;
|
@@ -63,12 +64,14 @@ class Profile extends AbstractCrudObject {
|
|
63 |
$this->assureId();
|
64 |
|
65 |
$param_types = array(
|
|
|
66 |
'height' => 'int',
|
67 |
'redirect' => 'bool',
|
68 |
'type' => 'type_enum',
|
69 |
'width' => 'int',
|
70 |
);
|
71 |
$enums = array(
|
|
|
72 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
73 |
);
|
74 |
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\ProfileFields;
|
32 |
+
use FacebookAds\Object\Values\ProfilePictureSourceBreakingChangeValues;
|
33 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
34 |
use FacebookAds\Object\Values\ProfileProfileTypeValues;
|
35 |
use FacebookAds\Object\Values\ProfileTypeValues;
|
64 |
$this->assureId();
|
65 |
|
66 |
$param_types = array(
|
67 |
+
'breaking_change' => 'breaking_change_enum',
|
68 |
'height' => 'int',
|
69 |
'redirect' => 'bool',
|
70 |
'type' => 'type_enum',
|
71 |
'width' => 'int',
|
72 |
);
|
73 |
$enums = array(
|
74 |
+
'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),
|
75 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
76 |
);
|
77 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProfilePictureSource.php
CHANGED
@@ -29,6 +29,7 @@ use FacebookAds\Cursor;
|
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\ProfilePictureSourceFields;
|
|
|
32 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
33 |
|
34 |
/**
|
@@ -52,6 +53,7 @@ class ProfilePictureSource extends AbstractObject {
|
|
52 |
protected static function getReferencedEnums() {
|
53 |
$ref_enums = array();
|
54 |
$ref_enums['Type'] = ProfilePictureSourceTypeValues::getInstance()->getValues();
|
|
|
55 |
return $ref_enums;
|
56 |
}
|
57 |
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\ProfilePictureSourceFields;
|
32 |
+
use FacebookAds\Object\Values\ProfilePictureSourceBreakingChangeValues;
|
33 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
34 |
|
35 |
/**
|
53 |
protected static function getReferencedEnums() {
|
54 |
$ref_enums = array();
|
55 |
$ref_enums['Type'] = ProfilePictureSourceTypeValues::getInstance()->getValues();
|
56 |
+
$ref_enums['BreakingChange'] = ProfilePictureSourceBreakingChangeValues::getInstance()->getValues();
|
57 |
return $ref_enums;
|
58 |
}
|
59 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/PublisherBlockList.php
CHANGED
@@ -61,6 +61,30 @@ class PublisherBlockList extends AbstractCrudObject {
|
|
61 |
}
|
62 |
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
public function getPagedWebPublishers(array $fields = array(), array $params = array(), $pending = false) {
|
65 |
$this->assureId();
|
66 |
|
61 |
}
|
62 |
|
63 |
|
64 |
+
public function createAppendPublisherUrl(array $fields = array(), array $params = array(), $pending = false) {
|
65 |
+
$this->assureId();
|
66 |
+
|
67 |
+
$param_types = array(
|
68 |
+
'publisher_urls' => 'list<string>',
|
69 |
+
);
|
70 |
+
$enums = array(
|
71 |
+
);
|
72 |
+
|
73 |
+
$request = new ApiRequest(
|
74 |
+
$this->api,
|
75 |
+
$this->data['id'],
|
76 |
+
RequestInterface::METHOD_POST,
|
77 |
+
'/append_publisher_urls',
|
78 |
+
new AbstractCrudObject(),
|
79 |
+
'EDGE',
|
80 |
+
array(),
|
81 |
+
new TypeChecker($param_types, $enums)
|
82 |
+
);
|
83 |
+
$request->addParams($params);
|
84 |
+
$request->addFields($fields);
|
85 |
+
return $pending ? $request : $request->execute();
|
86 |
+
}
|
87 |
+
|
88 |
public function getPagedWebPublishers(array $fields = array(), array $params = array(), $pending = false) {
|
89 |
$this->assureId();
|
90 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/SavedAudience.php
CHANGED
@@ -54,29 +54,6 @@ class SavedAudience extends AbstractCrudObject {
|
|
54 |
}
|
55 |
|
56 |
|
57 |
-
public function deleteSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_DELETE,
|
69 |
-
'/',
|
70 |
-
new AbstractCrudObject(),
|
71 |
-
'NODE',
|
72 |
-
array(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
$this->assureId();
|
82 |
|
54 |
}
|
55 |
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
$this->assureId();
|
59 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/AsyncClient.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAds\Api;
|
28 |
+
|
29 |
+
use GuzzleHttp\Client;
|
30 |
+
use GuzzleHttp\HandlerStack;
|
31 |
+
use GuzzleHttp\Handler\CurlHandler;
|
32 |
+
|
33 |
+
class AsyncClient extends Singleton {
|
34 |
+
protected $client = null;
|
35 |
+
|
36 |
+
public function __construct() {
|
37 |
+
$handler_stack = HandlerStack::create(new CurlHandler([
|
38 |
+
'options' => [
|
39 |
+
CURLOPT_CONNECTTIMEOUT => 10,
|
40 |
+
CURLOPT_TIMEOUT => 60,
|
41 |
+
CURLOPT_RETURNTRANSFER => true,
|
42 |
+
CURLOPT_HEADER => true,
|
43 |
+
CURLOPT_CAINFO => Api::instance()->getHttpClient()->getCaBundlePath(),
|
44 |
+
]
|
45 |
+
]));
|
46 |
+
|
47 |
+
$this->client = new Client(['handler' => $handler_stack]);
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getClient() {
|
51 |
+
return $this->client;
|
52 |
+
}
|
53 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/BatchProcessor.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
use GuzzleHttp\Promise;
|
28 |
+
|
29 |
+
class BatchProcessor {
|
30 |
+
protected $batch_size;
|
31 |
+
protected $concurrent_requests;
|
32 |
+
protected $pixel_id;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Constructor
|
36 |
+
* @param int $pixel_id
|
37 |
+
* @param int $batch_size
|
38 |
+
* @param int $concurrent_requests
|
39 |
+
*/
|
40 |
+
public function __construct($pixel_id, $batch_size = 50, $concurrent_requests = 4) {
|
41 |
+
$this->pixel_id = $pixel_id;
|
42 |
+
// Note: batch_size is only used in processEvents and processEventsGenerator
|
43 |
+
$this->batch_size = $batch_size;
|
44 |
+
$this->concurrent_requests = $concurrent_requests;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Processes events that have identical event_request params
|
49 |
+
* @param array $event_request_params
|
50 |
+
* @param array|\FacebookAds\Object\ServerSide\Event $events
|
51 |
+
* @return void
|
52 |
+
*/
|
53 |
+
public function processEvents($event_request_params, $events) {
|
54 |
+
$generator = $this->processEventsGenerator($event_request_params, $events);
|
55 |
+
foreach ($generator as $promises) {
|
56 |
+
Promise\unwrap($promises);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* This generator returns event_requests promises for events that have identical event_request params
|
62 |
+
* @param array $event_request_params
|
63 |
+
* @param array|\FacebookAds\Object\ServerSide\Event $events
|
64 |
+
* @return Generator|array|\GuzzleHttp\Promise\PromiseInterface $promises
|
65 |
+
*/
|
66 |
+
public function processEventsGenerator($event_request_params, $events) {
|
67 |
+
$index = 0;
|
68 |
+
while ($index < count($events)) {
|
69 |
+
$promises = [];
|
70 |
+
|
71 |
+
while ($index < count($events) && count($promises) < $this->concurrent_requests) {
|
72 |
+
$params = array_merge(
|
73 |
+
array('events' => array_slice($events, $index, $this->batch_size)),
|
74 |
+
$event_request_params
|
75 |
+
);
|
76 |
+
$event_request = new EventRequestAsync(
|
77 |
+
$this->pixel_id,
|
78 |
+
$params
|
79 |
+
);
|
80 |
+
|
81 |
+
$promises[] = $event_request->execute();
|
82 |
+
$index += $this->batch_size;
|
83 |
+
}
|
84 |
+
|
85 |
+
yield $promises;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Processes async event_requests
|
91 |
+
* @param array|\FacebookAds\Object\ServerSide\EventRequestAsync $event_requests_async
|
92 |
+
* @return void
|
93 |
+
*/
|
94 |
+
public function processEventRequests($event_requests_async) {
|
95 |
+
$generator = $this->processEventRequestsGenerator($event_requests_async);
|
96 |
+
foreach ($generator as $promises) {
|
97 |
+
Promise\unwrap($promises);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* This generator returns event_requests promises
|
103 |
+
* @param array|\FacebookAds\Object\ServerSide\EventRequestAsync $event_requests_async
|
104 |
+
* @return Generator|array|\GuzzleHttp\Promise\PromiseInterface $promises
|
105 |
+
*/
|
106 |
+
public function processEventRequestsGenerator($event_requests_async) {
|
107 |
+
$index = 0;
|
108 |
+
while ($index < count($event_requests_async)) {
|
109 |
+
$promises = [];
|
110 |
+
|
111 |
+
$offset = 0;
|
112 |
+
while (($index + $offset) < count($event_requests_async) && count($promises) < $this->concurrent_requests) {
|
113 |
+
$promises[] = $event_requests_async[$index + $offset]->execute();
|
114 |
+
$offset += 1;
|
115 |
+
}
|
116 |
+
$index += $offset;
|
117 |
+
|
118 |
+
yield $promises;
|
119 |
+
}
|
120 |
+
}
|
121 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/CustomData.php
CHANGED
@@ -25,6 +25,7 @@
|
|
25 |
namespace FacebookAds\Object\ServerSide;
|
26 |
|
27 |
use ArrayAccess;
|
|
|
28 |
|
29 |
|
30 |
class CustomData implements ArrayAccess {
|
@@ -46,6 +47,8 @@ class CustomData implements ArrayAccess {
|
|
46 |
'num_items' => 'string',
|
47 |
'status' => 'string',
|
48 |
'search_string' => 'string',
|
|
|
|
|
49 |
'custom_properties' => 'array'
|
50 |
);
|
51 |
/**
|
@@ -65,6 +68,8 @@ class CustomData implements ArrayAccess {
|
|
65 |
'num_items' => 'num_items',
|
66 |
'status' => 'status',
|
67 |
'search_string' => 'search_string',
|
|
|
|
|
68 |
'custom_properties' => 'custom_properties'
|
69 |
);
|
70 |
/**
|
@@ -84,6 +89,8 @@ class CustomData implements ArrayAccess {
|
|
84 |
'num_items' => 'setNumItems',
|
85 |
'status' => 'setStatus',
|
86 |
'search_string' => 'setSearchString',
|
|
|
|
|
87 |
'custom_properties' => 'setCustomProperties'
|
88 |
);
|
89 |
/**
|
@@ -103,6 +110,8 @@ class CustomData implements ArrayAccess {
|
|
103 |
'num_items' => 'getNumItems',
|
104 |
'status' => 'getStatus',
|
105 |
'search_string' => 'getSearchString',
|
|
|
|
|
106 |
'custom_properties' => 'getCustomProperties'
|
107 |
);
|
108 |
/**
|
@@ -128,6 +137,8 @@ class CustomData implements ArrayAccess {
|
|
128 |
$this->container['num_items'] = isset($data['num_items']) ? $data['num_items'] : null;
|
129 |
$this->container['status'] = isset($data['status']) ? $data['status'] : null;
|
130 |
$this->container['search_string'] = isset($data['search_string']) ? $data['search_string'] : null;
|
|
|
|
|
131 |
$this->container['custom_properties'] = isset($data['custom_properties']) ? $data['custom_properties'] : null;
|
132 |
}
|
133 |
|
@@ -310,6 +321,28 @@ class CustomData implements ArrayAccess {
|
|
310 |
return $this;
|
311 |
}
|
312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
/**
|
314 |
* Sets custom_properties that are not defined as the standard properties list in custom data.
|
315 |
* @param array custom_properties dictionary to include custom properties that are not defined in custom data.
|
@@ -400,6 +433,9 @@ class CustomData implements ArrayAccess {
|
|
400 |
$normalized_payload['num_items'] = $this->getNumItems();
|
401 |
$normalized_payload['status'] = $this->getStatus();
|
402 |
$normalized_payload['search_string'] = $this->getSearchString();
|
|
|
|
|
|
|
403 |
|
404 |
if (isset($this->container['contents'])) {
|
405 |
$contents = [];
|
@@ -524,6 +560,22 @@ class CustomData implements ArrayAccess {
|
|
524 |
return $this->container['search_string'];
|
525 |
}
|
526 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
/**
|
528 |
* Gets Custom Properties dictionary to add properties that are not defined as part of the custom data.
|
529 |
* @return array
|
25 |
namespace FacebookAds\Object\ServerSide;
|
26 |
|
27 |
use ArrayAccess;
|
28 |
+
use InvalidArgumentException;
|
29 |
|
30 |
|
31 |
class CustomData implements ArrayAccess {
|
47 |
'num_items' => 'string',
|
48 |
'status' => 'string',
|
49 |
'search_string' => 'string',
|
50 |
+
'item_number' => 'string',
|
51 |
+
'delivery_category' => 'string',
|
52 |
'custom_properties' => 'array'
|
53 |
);
|
54 |
/**
|
68 |
'num_items' => 'num_items',
|
69 |
'status' => 'status',
|
70 |
'search_string' => 'search_string',
|
71 |
+
'item_number' => 'item_number',
|
72 |
+
'delivery_category' => 'delivery_category',
|
73 |
'custom_properties' => 'custom_properties'
|
74 |
);
|
75 |
/**
|
89 |
'num_items' => 'setNumItems',
|
90 |
'status' => 'setStatus',
|
91 |
'search_string' => 'setSearchString',
|
92 |
+
'item_number' => 'setItemNumber',
|
93 |
+
'delivery_category' => 'setDeliveryCategory',
|
94 |
'custom_properties' => 'setCustomProperties'
|
95 |
);
|
96 |
/**
|
110 |
'num_items' => 'getNumItems',
|
111 |
'status' => 'getStatus',
|
112 |
'search_string' => 'getSearchString',
|
113 |
+
'item_number' => 'getItemNumber',
|
114 |
+
'delivery_category' => 'getDeliveryCategory',
|
115 |
'custom_properties' => 'getCustomProperties'
|
116 |
);
|
117 |
/**
|
137 |
$this->container['num_items'] = isset($data['num_items']) ? $data['num_items'] : null;
|
138 |
$this->container['status'] = isset($data['status']) ? $data['status'] : null;
|
139 |
$this->container['search_string'] = isset($data['search_string']) ? $data['search_string'] : null;
|
140 |
+
$this->container['item_number'] = isset($data['item_number']) ? $data['item_number'] : null;
|
141 |
+
$this->container['delivery_category'] = isset($data['delivery_category']) ? $data['delivery_category'] : null;
|
142 |
$this->container['custom_properties'] = isset($data['custom_properties']) ? $data['custom_properties'] : null;
|
143 |
}
|
144 |
|
321 |
return $this;
|
322 |
}
|
323 |
|
324 |
+
/**
|
325 |
+
* Sets Type of delivery for a purchase event.
|
326 |
+
* @param string $delivery_category Type of delivery for a purchase event.
|
327 |
+
* @return $this
|
328 |
+
*/
|
329 |
+
public function setDeliveryCategory($delivery_category) {
|
330 |
+
$this->container['delivery_category'] = $delivery_category;
|
331 |
+
|
332 |
+
return $this;
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Sets the item_number.
|
337 |
+
* @param string $item_number The item number.
|
338 |
+
* @return $this
|
339 |
+
*/
|
340 |
+
public function setItemNumber($item_number) {
|
341 |
+
$this->container['item_number'] = $item_number;
|
342 |
+
|
343 |
+
return $this;
|
344 |
+
}
|
345 |
+
|
346 |
/**
|
347 |
* Sets custom_properties that are not defined as the standard properties list in custom data.
|
348 |
* @param array custom_properties dictionary to include custom properties that are not defined in custom data.
|
433 |
$normalized_payload['num_items'] = $this->getNumItems();
|
434 |
$normalized_payload['status'] = $this->getStatus();
|
435 |
$normalized_payload['search_string'] = $this->getSearchString();
|
436 |
+
$normalized_payload['item_number'] = $this->getItemNumber();
|
437 |
+
$normalized_payload['delivery_category'] =
|
438 |
+
Normalizer::normalize('delivery_category', $this->getDeliveryCategory());
|
439 |
|
440 |
if (isset($this->container['contents'])) {
|
441 |
$contents = [];
|
560 |
return $this->container['search_string'];
|
561 |
}
|
562 |
|
563 |
+
/**
|
564 |
+
* Gets a delivery_category for a purchase order.
|
565 |
+
* @return string
|
566 |
+
*/
|
567 |
+
public function getDeliveryCategory() {
|
568 |
+
return $this->container['delivery_category'];
|
569 |
+
}
|
570 |
+
|
571 |
+
/**
|
572 |
+
* Gets the item number.
|
573 |
+
* @return string
|
574 |
+
*/
|
575 |
+
public function getItemNumber() {
|
576 |
+
return $this->container['item_number'];
|
577 |
+
}
|
578 |
+
|
579 |
/**
|
580 |
* Gets Custom Properties dictionary to add properties that are not defined as part of the custom data.
|
581 |
* @return array
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/DeliveryCategory.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Class DeliveryCategory
|
31 |
+
*
|
32 |
+
* Type of delivery for a purchase event.
|
33 |
+
*
|
34 |
+
* @package FacebookAds\Object\ServerSide
|
35 |
+
*/
|
36 |
+
class DeliveryCategory extends AbstractEnum {
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Customer needs to enter the store to get the purchased product.
|
40 |
+
*/
|
41 |
+
const IN_STORE = 'in_store';
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Customer picks up their order by driving to a store and waiting inside their vehicle.
|
45 |
+
*/
|
46 |
+
const CURBSIDE = 'curbside';
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Purchase is delivered to the customer's home.
|
50 |
+
*/
|
51 |
+
const HOME_DELIVERY = 'home_delivery';
|
52 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequest.php
CHANGED
@@ -25,6 +25,8 @@
|
|
25 |
namespace FacebookAds\Object\ServerSide;
|
26 |
|
27 |
use ArrayAccess;
|
|
|
|
|
28 |
use FacebookAds\Object\AdsPixel;
|
29 |
|
30 |
/**
|
@@ -40,7 +42,11 @@ class EventRequest implements ArrayAccess {
|
|
40 |
protected static $param_types = array(
|
41 |
'events' => '\FacebookAds\Object\ServerSide\Event[]',
|
42 |
'test_event_code' => 'string',
|
43 |
-
'partner_agent' => 'string'
|
|
|
|
|
|
|
|
|
44 |
);
|
45 |
/**
|
46 |
* Array of attributes where the key is the local name, and the value is the original name
|
@@ -49,7 +55,11 @@ class EventRequest implements ArrayAccess {
|
|
49 |
protected static $attributeMap = array(
|
50 |
'events' => 'events',
|
51 |
'test_event_code' => 'test_event_code',
|
52 |
-
'partner_agent' => 'partner_agent'
|
|
|
|
|
|
|
|
|
53 |
);
|
54 |
/**
|
55 |
* Array of attributes to setter functions (for deserialization of responses)
|
@@ -58,7 +68,11 @@ class EventRequest implements ArrayAccess {
|
|
58 |
protected static $setters = array(
|
59 |
'events' => 'setEvents',
|
60 |
'test_event_code' => 'setTestEventCode',
|
61 |
-
'partner_agent' => 'setPartnerAgent'
|
|
|
|
|
|
|
|
|
62 |
);
|
63 |
/**
|
64 |
* Array of attributes to getter functions (for serialization of requests)
|
@@ -67,7 +81,11 @@ class EventRequest implements ArrayAccess {
|
|
67 |
protected static $getters = array(
|
68 |
'events' => 'getEvents',
|
69 |
'test_event_code' => 'getTestEventCode',
|
70 |
-
'partner_agent' => 'getPartnerAgent'
|
|
|
|
|
|
|
|
|
71 |
);
|
72 |
/**
|
73 |
* Associative array for storing property values
|
@@ -75,6 +93,8 @@ class EventRequest implements ArrayAccess {
|
|
75 |
*/
|
76 |
protected $container = array();
|
77 |
|
|
|
|
|
78 |
/**
|
79 |
* Constructor
|
80 |
* @param string $pixel_id pixel id
|
@@ -85,6 +105,10 @@ class EventRequest implements ArrayAccess {
|
|
85 |
$this->container['events'] = isset($data['events']) ? $data['events'] : null;
|
86 |
$this->container['test_event_code'] = isset($data['test_event_code']) ? $data['test_event_code'] : null;
|
87 |
$this->container['partner_agent'] = isset($data['partner_agent']) ? $data['partner_agent'] : null;
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
public static function paramTypes() {
|
@@ -179,11 +203,39 @@ class EventRequest implements ArrayAccess {
|
|
179 |
return $this;
|
180 |
}
|
181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
/**
|
183 |
* Execute the request
|
184 |
* @return EventResponse
|
185 |
*/
|
186 |
public function execute() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
$fields = array();
|
188 |
$normalized_param = $this->normalize();
|
189 |
$ads_pixel = new AdsPixel($this->container['pixel_id']);
|
@@ -195,11 +247,45 @@ class EventRequest implements ArrayAccess {
|
|
195 |
return $event_response;
|
196 |
}
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
/**
|
199 |
* Normalize
|
200 |
* @return array
|
201 |
*/
|
202 |
-
|
203 |
$normalized_events = array();
|
204 |
$events = $this->getEvents();
|
205 |
if (!is_null($events)) {
|
@@ -213,6 +299,10 @@ class EventRequest implements ArrayAccess {
|
|
213 |
'data' => $normalized_events,
|
214 |
'test_event_code' => $this->container['test_event_code'],
|
215 |
'partner_agent' => $this->container['partner_agent'],
|
|
|
|
|
|
|
|
|
216 |
);
|
217 |
$normalized_payload = array_filter($normalized_payload);
|
218 |
|
@@ -235,6 +325,76 @@ class EventRequest implements ArrayAccess {
|
|
235 |
return $this->container['partner_agent'];
|
236 |
}
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
/**
|
239 |
* Returns true if offset exists. False otherwise.
|
240 |
* @param integer $offset Offset
|
25 |
namespace FacebookAds\Object\ServerSide;
|
26 |
|
27 |
use ArrayAccess;
|
28 |
+
use FacebookAds\Api;
|
29 |
+
use FacebookAds\ApiConfig;
|
30 |
use FacebookAds\Object\AdsPixel;
|
31 |
|
32 |
/**
|
42 |
protected static $param_types = array(
|
43 |
'events' => '\FacebookAds\Object\ServerSide\Event[]',
|
44 |
'test_event_code' => 'string',
|
45 |
+
'partner_agent' => 'string',
|
46 |
+
'namespace_id' => 'string',
|
47 |
+
'upload_id' => 'string',
|
48 |
+
'upload_tag' => 'string',
|
49 |
+
'upload_source' => 'string'
|
50 |
);
|
51 |
/**
|
52 |
* Array of attributes where the key is the local name, and the value is the original name
|
55 |
protected static $attributeMap = array(
|
56 |
'events' => 'events',
|
57 |
'test_event_code' => 'test_event_code',
|
58 |
+
'partner_agent' => 'partner_agent',
|
59 |
+
'namespace_id' => 'namespace_id',
|
60 |
+
'upload_id' => 'upload_id',
|
61 |
+
'upload_tag' => 'upload_tag',
|
62 |
+
'upload_source' => 'upload_source'
|
63 |
);
|
64 |
/**
|
65 |
* Array of attributes to setter functions (for deserialization of responses)
|
68 |
protected static $setters = array(
|
69 |
'events' => 'setEvents',
|
70 |
'test_event_code' => 'setTestEventCode',
|
71 |
+
'partner_agent' => 'setPartnerAgent',
|
72 |
+
'namespace_id' => 'setNamespaceId',
|
73 |
+
'upload_id' => 'setUploadId',
|
74 |
+
'upload_tag' => 'setUploadTag',
|
75 |
+
'upload_source' => 'setUploadSource'
|
76 |
);
|
77 |
/**
|
78 |
* Array of attributes to getter functions (for serialization of requests)
|
81 |
protected static $getters = array(
|
82 |
'events' => 'getEvents',
|
83 |
'test_event_code' => 'getTestEventCode',
|
84 |
+
'partner_agent' => 'getPartnerAgent',
|
85 |
+
'namespace_id' => 'getNamespaceId',
|
86 |
+
'upload_id' => 'getUploadId',
|
87 |
+
'upload_tag' => 'getUploadTag',
|
88 |
+
'upload_source' => 'getUploadSource'
|
89 |
);
|
90 |
/**
|
91 |
* Associative array for storing property values
|
93 |
*/
|
94 |
protected $container = array();
|
95 |
|
96 |
+
protected $http_service_class = null;
|
97 |
+
|
98 |
/**
|
99 |
* Constructor
|
100 |
* @param string $pixel_id pixel id
|
105 |
$this->container['events'] = isset($data['events']) ? $data['events'] : null;
|
106 |
$this->container['test_event_code'] = isset($data['test_event_code']) ? $data['test_event_code'] : null;
|
107 |
$this->container['partner_agent'] = isset($data['partner_agent']) ? $data['partner_agent'] : null;
|
108 |
+
$this->container['namespace_id'] = isset($data['namespace_id']) ? $data['namespace_id'] : null;
|
109 |
+
$this->container['upload_id'] = isset($data['upload_id']) ? $data['upload_id'] : null;
|
110 |
+
$this->container['upload_tag'] = isset($data['upload_tag']) ? $data['upload_tag'] : null;
|
111 |
+
$this->container['upload_source'] = isset($data['upload_source']) ? $data['upload_source'] : null;
|
112 |
}
|
113 |
|
114 |
public static function paramTypes() {
|
203 |
return $this;
|
204 |
}
|
205 |
|
206 |
+
/**
|
207 |
+
* Sets a Custom HTTP Service, which overrides the default HTTP service
|
208 |
+
* used to send the event request.
|
209 |
+
* @param string $http_service_class The class name that implements the HttpServiceInterface
|
210 |
+
* @return $this
|
211 |
+
*/
|
212 |
+
public function setHttpService(string $http_service_class) {
|
213 |
+
$this->http_service_class = $http_service_class;
|
214 |
+
|
215 |
+
return $this;
|
216 |
+
}
|
217 |
+
|
218 |
/**
|
219 |
* Execute the request
|
220 |
* @return EventResponse
|
221 |
*/
|
222 |
public function execute() {
|
223 |
+
$http_service_class = null;
|
224 |
+
|
225 |
+
if ($this->http_service_class != null) {
|
226 |
+
$http_service_class = $this->http_service_class;
|
227 |
+
} else {
|
228 |
+
$http_service_class = HttpServiceClientConfig::getInstance()->getClient();
|
229 |
+
}
|
230 |
+
|
231 |
+
if ($http_service_class != null) {
|
232 |
+
return $this->customHttpServiceExecute($http_service_class);
|
233 |
+
}
|
234 |
+
|
235 |
+
return $this->defaultExecute();
|
236 |
+
}
|
237 |
+
|
238 |
+
private function defaultExecute() {
|
239 |
$fields = array();
|
240 |
$normalized_param = $this->normalize();
|
241 |
$ads_pixel = new AdsPixel($this->container['pixel_id']);
|
247 |
return $event_response;
|
248 |
}
|
249 |
|
250 |
+
private function customHttpServiceExecute($http_service_class) {
|
251 |
+
$base_url = 'https://graph.facebook.com/v' . ApiConfig::APIVersion;
|
252 |
+
$url = $base_url . '/' . $this->container['pixel_id'] . '/events';
|
253 |
+
|
254 |
+
$headers = array(
|
255 |
+
'User-Agent' => 'fbbizsdk-php-v' . ApiConfig::APIVersion,
|
256 |
+
'Accept-Encoding' => '*',
|
257 |
+
);
|
258 |
+
|
259 |
+
$curl_options = array(
|
260 |
+
CURLOPT_CONNECTTIMEOUT => 10,
|
261 |
+
CURLOPT_TIMEOUT => 60,
|
262 |
+
CURLOPT_RETURNTRANSFER => true,
|
263 |
+
CURLOPT_HEADER => true,
|
264 |
+
CURLOPT_CAINFO => Util::getCaBundlePath(),
|
265 |
+
);
|
266 |
+
|
267 |
+
$params = $this->normalize();
|
268 |
+
if (HttpServiceClientConfig::getInstance()->getAccessToken() == null) {
|
269 |
+
$params['access_token'] = Api::instance()->getSession()->getAccessToken();
|
270 |
+
} else {
|
271 |
+
$params['access_token'] = HttpServiceClientConfig::getInstance()->getAccessToken();
|
272 |
+
}
|
273 |
+
|
274 |
+
$http_service = new $http_service_class();
|
275 |
+
return $http_service->executeRequest(
|
276 |
+
$url,
|
277 |
+
HttpMethod::POST,
|
278 |
+
$curl_options,
|
279 |
+
$headers,
|
280 |
+
$params
|
281 |
+
);
|
282 |
+
}
|
283 |
+
|
284 |
/**
|
285 |
* Normalize
|
286 |
* @return array
|
287 |
*/
|
288 |
+
public function normalize() {
|
289 |
$normalized_events = array();
|
290 |
$events = $this->getEvents();
|
291 |
if (!is_null($events)) {
|
299 |
'data' => $normalized_events,
|
300 |
'test_event_code' => $this->container['test_event_code'],
|
301 |
'partner_agent' => $this->container['partner_agent'],
|
302 |
+
'namespace_id' => $this->container['namespace_id'],
|
303 |
+
'upload_id' => $this->container['upload_id'],
|
304 |
+
'upload_tag' => $this->container['upload_tag'],
|
305 |
+
'upload_source' => $this->container['upload_source'],
|
306 |
);
|
307 |
$normalized_payload = array_filter($normalized_payload);
|
308 |
|
325 |
return $this->container['partner_agent'];
|
326 |
}
|
327 |
|
328 |
+
/**
|
329 |
+
* Gets namespace_id, a scope used to resolve extern_id or Third-party ID.
|
330 |
+
* Can be another data set or data partner ID.
|
331 |
+
* @return string
|
332 |
+
*/
|
333 |
+
public function getNamespaceId() {
|
334 |
+
return $this->container['namespace_id'];
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Sets namespace_id, a scope used to resolve extern_id or Third-party ID.
|
339 |
+
* Can be another data set or data partner ID.
|
340 |
+
* @return $this
|
341 |
+
*/
|
342 |
+
public function setNamespaceId($namespace_id) {
|
343 |
+
$this->container['namespace_id'] = $namespace_id;
|
344 |
+
return $this;
|
345 |
+
}
|
346 |
+
|
347 |
+
/**
|
348 |
+
* Gets upload_id, a unique id used to denote the current set being uploaded.
|
349 |
+
* @return string
|
350 |
+
*/
|
351 |
+
public function getUploadId() {
|
352 |
+
return $this->container['upload_id'];
|
353 |
+
}
|
354 |
+
|
355 |
+
/**
|
356 |
+
* Sets upload_id, a unique id used to denote the current set being uploaded.
|
357 |
+
* @return $this
|
358 |
+
*/
|
359 |
+
public function setUploadId($upload_id) {
|
360 |
+
$this->container['upload_id'] = $upload_id;
|
361 |
+
return $this;
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Gets upload_tag, a tag string added to track your Offline event uploads.
|
366 |
+
* @return string
|
367 |
+
*/
|
368 |
+
public function getUploadTag() {
|
369 |
+
return $this->container['upload_tag'];
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Sets upload_tag, a tag string added to track your Offline event uploads.
|
374 |
+
* @return $this
|
375 |
+
*/
|
376 |
+
public function setUploadTag($upload_tag) {
|
377 |
+
$this->container['upload_tag'] = $upload_tag;
|
378 |
+
return $this;
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Gets upload_source, the origin/source of data for the dataset to be uploaded.
|
383 |
+
* @return string
|
384 |
+
*/
|
385 |
+
public function getUploadSource() {
|
386 |
+
return $this->container['upload_source'];
|
387 |
+
}
|
388 |
+
|
389 |
+
/**
|
390 |
+
* Sets upload_source, the origin/source of data for the dataset to be uploaded.
|
391 |
+
* @return $this
|
392 |
+
*/
|
393 |
+
public function setUploadSource($upload_source) {
|
394 |
+
$this->container['upload_source'] = $upload_source;
|
395 |
+
return $this;
|
396 |
+
}
|
397 |
+
|
398 |
/**
|
399 |
* Returns true if offset exists. False otherwise.
|
400 |
* @param integer $offset Offset
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequestAsync.php
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAds\Api;
|
28 |
+
use FacebookAds\ApiConfig;
|
29 |
+
use FacebookAds\Http\Client;
|
30 |
+
use GuzzleHttp\Psr7\Request;
|
31 |
+
use GuzzleHttp\Psr7\MultipartStream;
|
32 |
+
|
33 |
+
class EventRequestAsync extends EventRequest {
|
34 |
+
/**
|
35 |
+
* Return an asynchronous request Promise
|
36 |
+
* @return \GuzzleHttp\Promise\PromiseInterface
|
37 |
+
*/
|
38 |
+
public function execute() {
|
39 |
+
$normalized_param = $this->normalize();
|
40 |
+
$pixel_id = $this->container['pixel_id'];
|
41 |
+
return $this->eventPromise(
|
42 |
+
$pixel_id,
|
43 |
+
$normalized_param
|
44 |
+
);
|
45 |
+
}
|
46 |
+
|
47 |
+
private function eventPromise(string $pixel_id, array $params = array()) {
|
48 |
+
$access_token = Api::instance()->getSession()->getAccessToken();
|
49 |
+
$headers = array(
|
50 |
+
'User-Agent' => 'fbbizsdk-php-v'.ApiConfig::APIVersion,
|
51 |
+
'Accept-Encoding' => '*',
|
52 |
+
);
|
53 |
+
|
54 |
+
$domain = Client::DEFAULT_LAST_LEVEL_DOMAIN . '.' . Client::DEFAULT_GRAPH_BASE_DOMAIN;
|
55 |
+
$base_url = 'https://' . $domain . '/v' . ApiConfig::APIVersion;
|
56 |
+
|
57 |
+
$url = $base_url.'/'.$pixel_id.'/events';
|
58 |
+
|
59 |
+
$events_json = \GuzzleHttp\json_encode($params['data']);
|
60 |
+
$multipart_contents = [
|
61 |
+
[
|
62 |
+
'name' => 'access_token',
|
63 |
+
'contents' => $access_token,
|
64 |
+
'headers' => array('Content-Type' => 'multipart/form-data'),
|
65 |
+
],
|
66 |
+
[
|
67 |
+
'name' => 'data',
|
68 |
+
'contents' => $events_json,
|
69 |
+
'headers' => array('Content-Type' => 'multipart/form-data'),
|
70 |
+
]
|
71 |
+
];
|
72 |
+
|
73 |
+
foreach ($params as $key => $value) {
|
74 |
+
if ($key !== 'data') {
|
75 |
+
$multipart_contents[] = [
|
76 |
+
'name' => $key,
|
77 |
+
'contents' => $value,
|
78 |
+
'headers' => array('Content-Type' => 'multipart/form-data'),
|
79 |
+
];
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
$body = new MultipartStream($multipart_contents);
|
84 |
+
$request = new Request('POST', $url, $headers, $body);
|
85 |
+
|
86 |
+
$client = AsyncClient::getInstance()->getClient();
|
87 |
+
return $client->sendAsync($request);
|
88 |
+
}
|
89 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/HttpMethod.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
final class HttpMethod extends AbstractEnum {
|
30 |
+
const POST = 'POST';
|
31 |
+
const PUT = 'PUT';
|
32 |
+
const GET = 'GET';
|
33 |
+
const DELETE = 'DELETE';
|
34 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/HttpServiceClientConfig.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
class HttpServiceClientConfig extends Singleton {
|
28 |
+
protected $client_class = null;
|
29 |
+
protected $access_token = null;
|
30 |
+
|
31 |
+
public function __construct() {}
|
32 |
+
|
33 |
+
public function getClient() {
|
34 |
+
return $this->client_class;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getAccessToken() {
|
38 |
+
return $this->access_token;
|
39 |
+
}
|
40 |
+
|
41 |
+
public function setClient($client_class) {
|
42 |
+
$this->client_class = $client_class;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function setAccessToken($access_token) {
|
46 |
+
$this->access_token = $access_token;
|
47 |
+
}
|
48 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/HttpServiceInterface.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
interface HttpServiceInterface {
|
28 |
+
/**
|
29 |
+
* @param string $url The graph API endpoint that will be requested
|
30 |
+
* @param FacebookAds\Object\ServerSide\HttpMethod $method The HTTP request method
|
31 |
+
* @param array $curl_options Contains curl options
|
32 |
+
* @param array $headers Contains HTTP request headers including User-Agent and Accept-Encoding
|
33 |
+
* @param array $params Contains request parameters including access_token, data, test_event_code, etc.
|
34 |
+
*/
|
35 |
+
public function executeRequest($url, $method, array $curl_options, array $headers, array $params);
|
36 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/Normalizer.php
CHANGED
@@ -79,6 +79,34 @@ class Normalizer {
|
|
79 |
case 'currency':
|
80 |
$normalized_data = Normalizer::normalizeCurrency($data);
|
81 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
default:
|
83 |
}
|
84 |
|
@@ -171,6 +199,93 @@ class Normalizer {
|
|
171 |
return $result;
|
172 |
}
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
/**
|
175 |
* @param string $phone_number Phone number to be normalized.
|
176 |
* @return bool
|
79 |
case 'currency':
|
80 |
$normalized_data = Normalizer::normalizeCurrency($data);
|
81 |
break;
|
82 |
+
|
83 |
+
case 'f5first':
|
84 |
+
$normalized_data = Normalizer::normalizeF5($data);
|
85 |
+
break;
|
86 |
+
|
87 |
+
case 'f5last':
|
88 |
+
$normalized_data = Normalizer::normalizeF5($data);
|
89 |
+
break;
|
90 |
+
|
91 |
+
case 'fi':
|
92 |
+
$normalized_data = Normalizer::normalizeFi($data);
|
93 |
+
break;
|
94 |
+
|
95 |
+
case 'dobd':
|
96 |
+
$normalized_data = Normalizer::normalizeDobd($data);
|
97 |
+
break;
|
98 |
+
|
99 |
+
case 'dobm':
|
100 |
+
$normalized_data = Normalizer::normalizeDobm($data);
|
101 |
+
break;
|
102 |
+
|
103 |
+
case 'doby':
|
104 |
+
$normalized_data = Normalizer::normalizeDoby($data);
|
105 |
+
break;
|
106 |
+
|
107 |
+
case 'delivery_category':
|
108 |
+
$normalized_data = Normalizer::normalizeDeliveryCategory($data);
|
109 |
+
break;
|
110 |
default:
|
111 |
}
|
112 |
|
199 |
return $result;
|
200 |
}
|
201 |
|
202 |
+
/**
|
203 |
+
* @param string $name A first or last name to be normalized.
|
204 |
+
* @return string
|
205 |
+
*/
|
206 |
+
private static function normalizeF5($name) {
|
207 |
+
return substr($name, 0, 5);
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* @param string $fi A first initial to be normalized.
|
212 |
+
* @return string
|
213 |
+
*/
|
214 |
+
private static function normalizeFi($fi) {
|
215 |
+
return substr($fi, 0, 1);
|
216 |
+
}
|
217 |
+
|
218 |
+
/**
|
219 |
+
* @param string $dobd A date of birth day to be normalized.
|
220 |
+
* @return string
|
221 |
+
*/
|
222 |
+
private static function normalizeDobd($dobd) {
|
223 |
+
if (strlen($dobd) == 1) {
|
224 |
+
$dobd = '0' . $dobd;
|
225 |
+
}
|
226 |
+
|
227 |
+
if (!preg_match('/^[0-9]{2}$/', $dobd)) {
|
228 |
+
throw new InvalidArgumentException('Invalid dobd passed(' . $dobd . '). Date of birth day should be in format "DD".');
|
229 |
+
}
|
230 |
+
|
231 |
+
$dobd_int = intval($dobd);
|
232 |
+
$in_day_range = ($dobd_int >= 1) && ($dobd_int <= 31);
|
233 |
+
if (!$in_day_range) {
|
234 |
+
throw new InvalidArgumentException('Invalid dobd passed(' . $dobd . '). Date of birth day should be in format "DD".');
|
235 |
+
}
|
236 |
+
|
237 |
+
return $dobd;
|
238 |
+
}
|
239 |
+
|
240 |
+
/**
|
241 |
+
* @param string $dobm A date of birth month to be normalized.
|
242 |
+
* @return string
|
243 |
+
*/
|
244 |
+
private static function normalizeDobm($dobm) {
|
245 |
+
if (strlen($dobm) == 1) {
|
246 |
+
$dobm = '0' . $dobm;
|
247 |
+
}
|
248 |
+
|
249 |
+
if (!preg_match('/^[0-9]{2}$/', $dobm)) {
|
250 |
+
throw new InvalidArgumentException('Invalid dobm passed(' . $dobm . '). Date of birth month should be in format "MM".');
|
251 |
+
}
|
252 |
+
|
253 |
+
$dobm_int = intval($dobm);
|
254 |
+
$in_month_range = ($dobm_int >= 1) && ($dobm_int <= 12);
|
255 |
+
if (!$in_month_range) {
|
256 |
+
throw new InvalidArgumentException('Invalid dobm passed(' . $dobm . '). Date of birth month should be in format "MM".');
|
257 |
+
}
|
258 |
+
|
259 |
+
return $dobm;
|
260 |
+
}
|
261 |
+
|
262 |
+
/**
|
263 |
+
* @param string $doby A date of birth year to be normalized.
|
264 |
+
* @return string
|
265 |
+
*/
|
266 |
+
private static function normalizeDoby($doby) {
|
267 |
+
if (!preg_match('/^[0-9]{4}$/', $doby)) {
|
268 |
+
throw new InvalidArgumentException('Invalid doby passed(' . $doby . '). Date of birth year should be in format "YYYY".');
|
269 |
+
}
|
270 |
+
|
271 |
+
return $doby;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Normalizes the type of DeliveryCategory and throws error if invalid.
|
276 |
+
* @param string $delivery_category type of DeliveryCategory.
|
277 |
+
* @return string
|
278 |
+
*/
|
279 |
+
private static function normalizeDeliveryCategory($delivery_category) {
|
280 |
+
|
281 |
+
$delivery_categories = DeliveryCategory::getInstance()->getValues();
|
282 |
+
if(!DeliveryCategory::getInstance()->isValidValue($delivery_category))
|
283 |
+
throw new InvalidArgumentException('Invalid delivery_category passed: ' . $delivery_category .
|
284 |
+
'.Allowed values are one of ' . implode(",",$delivery_categories));
|
285 |
+
|
286 |
+
return $delivery_category;
|
287 |
+
}
|
288 |
+
|
289 |
/**
|
290 |
* @param string $phone_number Phone number to be normalized.
|
291 |
* @return bool
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/Singleton.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\ServerSide;
|
26 |
+
|
27 |
+
abstract class Singleton {
|
28 |
+
/**
|
29 |
+
* @var array
|
30 |
+
*/
|
31 |
+
protected static $instances = array();
|
32 |
+
|
33 |
+
|
34 |
+
private function __construct() {}
|
35 |
+
|
36 |
+
public static function getInstance() {
|
37 |
+
$fqn = get_called_class();
|
38 |
+
if (!array_key_exists($fqn, static::$instances)) {
|
39 |
+
static::$instances[$fqn] = new static();
|
40 |
+
}
|
41 |
+
|
42 |
+
return static::$instances[$fqn];
|
43 |
+
}
|
44 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/UserData.php
CHANGED
@@ -59,7 +59,14 @@ class UserData implements ArrayAccess {
|
|
59 |
'fbc' => 'string',
|
60 |
'fbp' => 'string',
|
61 |
'subscription_id' => 'string',
|
62 |
-
'fb_login_id' => 'string'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
);
|
64 |
/**
|
65 |
* Array of attributes where the key is the local name, and the value is the original name
|
@@ -82,7 +89,14 @@ class UserData implements ArrayAccess {
|
|
82 |
'fbc' => 'fbc',
|
83 |
'fbp' => 'fbp',
|
84 |
'subscription_id' => 'subscription_id',
|
85 |
-
'fb_login_id' => 'fb_login_id'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
);
|
87 |
/**
|
88 |
* Array of attributes to setter functions (for deserialization of responses)
|
@@ -105,7 +119,14 @@ class UserData implements ArrayAccess {
|
|
105 |
'fbc' => 'setFbc',
|
106 |
'fbp' => 'setFbp',
|
107 |
'subscription_id' => 'setSubscriptionId',
|
108 |
-
'fb_login_id' => 'setFbLoginId'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
);
|
110 |
/**
|
111 |
* Array of attributes to getter functions (for serialization of requests)
|
@@ -128,7 +149,14 @@ class UserData implements ArrayAccess {
|
|
128 |
'fbc' => 'getFbc',
|
129 |
'fbp' => 'getFbp',
|
130 |
'subscription_id' => 'getSubscriptionId',
|
131 |
-
'fb_login_id' => 'getFbLoginId'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
);
|
133 |
/**
|
134 |
* Associative array for storing property values
|
@@ -158,6 +186,13 @@ class UserData implements ArrayAccess {
|
|
158 |
$this->container['fbp'] = isset($data['fbp']) ? $data['fbp'] : null;
|
159 |
$this->container['subscription_id'] = isset($data['subscription_id']) ? $data['subscription_id'] : null;
|
160 |
$this->container['fb_login_id'] = isset($data['fb_login_id']) ? $data['fb_login_id'] : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
}
|
162 |
|
163 |
public static function paramTypes() {
|
@@ -414,6 +449,84 @@ class UserData implements ArrayAccess {
|
|
414 |
return $this;
|
415 |
}
|
416 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
/**
|
418 |
* Returns true if offset exists. False otherwise.
|
419 |
* @param integer $offset Offset
|
@@ -475,6 +588,13 @@ class UserData implements ArrayAccess {
|
|
475 |
$normalized_payload['fbp'] = $this->getFbp();
|
476 |
$normalized_payload['subscription_id'] = $this->getSubscriptionId();
|
477 |
$normalized_payload['fb_login_id'] = $this->getFbLoginId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
$normalized_payload = array_filter($normalized_payload);
|
479 |
return $normalized_payload;
|
480 |
}
|
@@ -614,6 +734,63 @@ class UserData implements ArrayAccess {
|
|
614 |
public function getFbLoginId() {
|
615 |
return $this->container['fb_login_id'];
|
616 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
617 |
/**
|
618 |
* Gets the string presentation of the object
|
619 |
* @return string
|
59 |
'fbc' => 'string',
|
60 |
'fbp' => 'string',
|
61 |
'subscription_id' => 'string',
|
62 |
+
'fb_login_id' => 'string',
|
63 |
+
'lead_id' => 'string',
|
64 |
+
'f5first' => 'string',
|
65 |
+
'f5last' => 'string',
|
66 |
+
'fi' => 'string',
|
67 |
+
'dobd' => 'string',
|
68 |
+
'dobm' => 'string',
|
69 |
+
'doby' => 'string'
|
70 |
);
|
71 |
/**
|
72 |
* Array of attributes where the key is the local name, and the value is the original name
|
89 |
'fbc' => 'fbc',
|
90 |
'fbp' => 'fbp',
|
91 |
'subscription_id' => 'subscription_id',
|
92 |
+
'fb_login_id' => 'fb_login_id',
|
93 |
+
'lead_id' => 'lead_id',
|
94 |
+
'f5first' => 'f5first',
|
95 |
+
'f5last' => 'f5last',
|
96 |
+
'fi' => 'fi',
|
97 |
+
'dobd' => 'dobd',
|
98 |
+
'dobm' => 'dobm',
|
99 |
+
'doby' => 'doby'
|
100 |
);
|
101 |
/**
|
102 |
* Array of attributes to setter functions (for deserialization of responses)
|
119 |
'fbc' => 'setFbc',
|
120 |
'fbp' => 'setFbp',
|
121 |
'subscription_id' => 'setSubscriptionId',
|
122 |
+
'fb_login_id' => 'setFbLoginId',
|
123 |
+
'lead_id' => 'setLeadId',
|
124 |
+
'f5first' => 'setF5first',
|
125 |
+
'f5last' => 'setF5last',
|
126 |
+
'fi' => 'setFi',
|
127 |
+
'dobd' => 'setDobd',
|
128 |
+
'dobm' => 'setDobm',
|
129 |
+
'doby' => 'setDoby'
|
130 |
);
|
131 |
/**
|
132 |
* Array of attributes to getter functions (for serialization of requests)
|
149 |
'fbc' => 'getFbc',
|
150 |
'fbp' => 'getFbp',
|
151 |
'subscription_id' => 'getSubscriptionId',
|
152 |
+
'fb_login_id' => 'getFbLoginId',
|
153 |
+
'lead_id' => 'getLeadId',
|
154 |
+
'f5first' => 'getF5first',
|
155 |
+
'f5last' => 'getF5last',
|
156 |
+
'fi' => 'getFi',
|
157 |
+
'dobd' => 'getDobd',
|
158 |
+
'dobm' => 'getDobm',
|
159 |
+
'doby' => 'getDoby'
|
160 |
);
|
161 |
/**
|
162 |
* Associative array for storing property values
|
186 |
$this->container['fbp'] = isset($data['fbp']) ? $data['fbp'] : null;
|
187 |
$this->container['subscription_id'] = isset($data['subscription_id']) ? $data['subscription_id'] : null;
|
188 |
$this->container['fb_login_id'] = isset($data['fb_login_id']) ? $data['fb_login_id'] : null;
|
189 |
+
$this->container['lead_id'] = isset($data['lead_id']) ? $data['lead_id'] : null;
|
190 |
+
$this->container['f5first'] = isset($data['f5first']) ? $data['f5first'] : null;
|
191 |
+
$this->container['f5last'] = isset($data['f5last']) ? $data['f5last'] : null;
|
192 |
+
$this->container['fi'] = isset($data['fi']) ? $data['fi'] : null;
|
193 |
+
$this->container['dobd'] = isset($data['dobd']) ? $data['dobd'] : null;
|
194 |
+
$this->container['dobm'] = isset($data['dobm']) ? $data['dobm'] : null;
|
195 |
+
$this->container['doby'] = isset($data['doby']) ? $data['doby'] : null;
|
196 |
}
|
197 |
|
198 |
public static function paramTypes() {
|
449 |
return $this;
|
450 |
}
|
451 |
|
452 |
+
/**
|
453 |
+
* Sets lead_id for the user in this transaction.
|
454 |
+
* A lead_id is associated with a lead generated by Facebook's Lead Ads.
|
455 |
+
* @param string $lead_id The lead_id for the user in this transaction.
|
456 |
+
* @return $this
|
457 |
+
*/
|
458 |
+
public function setLeadId($lead_id) {
|
459 |
+
$this->container['lead_id'] = $lead_id;
|
460 |
+
|
461 |
+
return $this;
|
462 |
+
}
|
463 |
+
|
464 |
+
/**
|
465 |
+
* Sets the first 5 letters of the first name.
|
466 |
+
* @param string $f5first The first 5 letters of the first name.
|
467 |
+
* @return $this
|
468 |
+
*/
|
469 |
+
public function setF5first($f5first) {
|
470 |
+
$this->container['f5first'] = $f5first;
|
471 |
+
|
472 |
+
return $this;
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* Sets the first 5 letters of the last name.
|
477 |
+
* @param string $f5last The first 5 letters of the last name.
|
478 |
+
* @return $this
|
479 |
+
*/
|
480 |
+
public function setF5last($f5last) {
|
481 |
+
$this->container['f5last'] = $f5last;
|
482 |
+
|
483 |
+
return $this;
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Sets the first initial.
|
488 |
+
* @param string $fi The first initial.
|
489 |
+
* @return $this
|
490 |
+
*/
|
491 |
+
public function setFi($fi) {
|
492 |
+
$this->container['fi'] = $fi;
|
493 |
+
|
494 |
+
return $this;
|
495 |
+
}
|
496 |
+
|
497 |
+
/**
|
498 |
+
* Sets the date of birth day.
|
499 |
+
* @param string $dobd The date of birth day.
|
500 |
+
* @return $this
|
501 |
+
*/
|
502 |
+
public function setDobd($dobd) {
|
503 |
+
$this->container['dobd'] = $dobd;
|
504 |
+
|
505 |
+
return $this;
|
506 |
+
}
|
507 |
+
|
508 |
+
/**
|
509 |
+
* Sets the date of birth month.
|
510 |
+
* @param string $dobm The date of birth month.
|
511 |
+
* @return $this
|
512 |
+
*/
|
513 |
+
public function setDobm($dobm) {
|
514 |
+
$this->container['dobm'] = $dobm;
|
515 |
+
|
516 |
+
return $this;
|
517 |
+
}
|
518 |
+
|
519 |
+
/**
|
520 |
+
* Sets the date of birth year.
|
521 |
+
* @param string $doby The date of birth year.
|
522 |
+
* @return $this
|
523 |
+
*/
|
524 |
+
public function setDoby($doby) {
|
525 |
+
$this->container['doby'] = $doby;
|
526 |
+
|
527 |
+
return $this;
|
528 |
+
}
|
529 |
+
|
530 |
/**
|
531 |
* Returns true if offset exists. False otherwise.
|
532 |
* @param integer $offset Offset
|
588 |
$normalized_payload['fbp'] = $this->getFbp();
|
589 |
$normalized_payload['subscription_id'] = $this->getSubscriptionId();
|
590 |
$normalized_payload['fb_login_id'] = $this->getFbLoginId();
|
591 |
+
$normalized_payload['lead_id'] = $this->getLeadId();
|
592 |
+
$normalized_payload['f5first'] = Util::hash(Normalizer::normalize('f5first', $this->getF5first()));
|
593 |
+
$normalized_payload['f5last'] = Util::hash(Normalizer::normalize('f5last', $this->getF5last()));
|
594 |
+
$normalized_payload['fi'] = Util::hash(Normalizer::normalize('fi', $this->getFi()));
|
595 |
+
$normalized_payload['dobd'] = Util::hash(Normalizer::normalize('dobd', $this->getDobd()));
|
596 |
+
$normalized_payload['dobm'] = Util::hash(Normalizer::normalize('dobm', $this->getDobm()));
|
597 |
+
$normalized_payload['doby'] = Util::hash(Normalizer::normalize('doby', $this->getDoby()));
|
598 |
$normalized_payload = array_filter($normalized_payload);
|
599 |
return $normalized_payload;
|
600 |
}
|
734 |
public function getFbLoginId() {
|
735 |
return $this->container['fb_login_id'];
|
736 |
}
|
737 |
+
|
738 |
+
/**
|
739 |
+
* Gets the lead_id for the user in this transaction.
|
740 |
+
* @return string
|
741 |
+
*/
|
742 |
+
public function getLeadId() {
|
743 |
+
return $this->container['lead_id'];
|
744 |
+
}
|
745 |
+
|
746 |
+
/**
|
747 |
+
* Gets the first 5 letters of the first name.
|
748 |
+
* @return string
|
749 |
+
*/
|
750 |
+
public function getF5first() {
|
751 |
+
return $this->container['f5first'];
|
752 |
+
}
|
753 |
+
|
754 |
+
/**
|
755 |
+
* Gets the first 5 letters of the last name.
|
756 |
+
* @return string
|
757 |
+
*/
|
758 |
+
public function getF5last() {
|
759 |
+
return $this->container['f5last'];
|
760 |
+
}
|
761 |
+
|
762 |
+
/**
|
763 |
+
* Gets the first initial.
|
764 |
+
* @return string
|
765 |
+
*/
|
766 |
+
public function getFi() {
|
767 |
+
return $this->container['fi'];
|
768 |
+
}
|
769 |
+
|
770 |
+
/**
|
771 |
+
* Gets the date of birth day.
|
772 |
+
* @return string
|
773 |
+
*/
|
774 |
+
public function getDobd() {
|
775 |
+
return $this->container['dobd'];
|
776 |
+
}
|
777 |
+
|
778 |
+
/**
|
779 |
+
* Gets the date of birth month.
|
780 |
+
* @return string
|
781 |
+
*/
|
782 |
+
public function getDobm() {
|
783 |
+
return $this->container['dobm'];
|
784 |
+
}
|
785 |
+
|
786 |
+
/**
|
787 |
+
* Gets the date of birth year.
|
788 |
+
* @return string
|
789 |
+
*/
|
790 |
+
public function getDoby() {
|
791 |
+
return $this->container['doby'];
|
792 |
+
}
|
793 |
+
|
794 |
/**
|
795 |
* Gets the string presentation of the object
|
796 |
* @return string
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ServerSide/Util.php
CHANGED
@@ -132,4 +132,10 @@ class Util {
|
|
132 |
|
133 |
return $fbc;
|
134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
}
|
132 |
|
133 |
return $fbc;
|
134 |
}
|
135 |
+
|
136 |
+
public static function getCaBundlePath() {
|
137 |
+
return __DIR__.DIRECTORY_SEPARATOR
|
138 |
+
.str_repeat('..'.DIRECTORY_SEPARATOR, 4)
|
139 |
+
.'fb_ca_chain_bundle.crt';
|
140 |
+
}
|
141 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/SplitTestConfig.php
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\SplitTestConfigFields;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* This class is auto-generated.
|
35 |
-
*
|
36 |
-
* For any issues or feature requests related to this class, please let us know
|
37 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
38 |
-
* pull request for this class.
|
39 |
-
*
|
40 |
-
*/
|
41 |
-
|
42 |
-
class SplitTestConfig extends AbstractCrudObject {
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @return SplitTestConfigFields
|
46 |
-
*/
|
47 |
-
public static function getFieldsEnum() {
|
48 |
-
return SplitTestConfigFields::getInstance();
|
49 |
-
}
|
50 |
-
|
51 |
-
protected static function getReferencedEnums() {
|
52 |
-
$ref_enums = array();
|
53 |
-
return $ref_enums;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_GET,
|
69 |
-
'/',
|
70 |
-
new SplitTestConfig(),
|
71 |
-
'NODE',
|
72 |
-
SplitTestConfig::getFieldsEnum()->getValues(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/StreamingReaction.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\StreamingReactionFields;
|
32 |
-
use FacebookAds\Object\Values\StreamingReactionReactionTypeValues;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This class is auto-generated.
|
36 |
-
*
|
37 |
-
* For any issues or feature requests related to this class, please let us know
|
38 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
39 |
-
* pull request for this class.
|
40 |
-
*
|
41 |
-
*/
|
42 |
-
|
43 |
-
class StreamingReaction extends AbstractObject {
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @return StreamingReactionFields
|
47 |
-
*/
|
48 |
-
public static function getFieldsEnum() {
|
49 |
-
return StreamingReactionFields::getInstance();
|
50 |
-
}
|
51 |
-
|
52 |
-
protected static function getReferencedEnums() {
|
53 |
-
$ref_enums = array();
|
54 |
-
$ref_enums['ReactionType'] = StreamingReactionReactionTypeValues::getInstance()->getValues();
|
55 |
-
return $ref_enums;
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/{AtlasURL.php → TargetingRelaxation.php}
RENAMED
@@ -28,7 +28,7 @@ use FacebookAds\ApiRequest;
|
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
@@ -39,13 +39,13 @@ use FacebookAds\Object\Fields\AtlasURLFields;
|
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
-
class
|
43 |
|
44 |
/**
|
45 |
-
* @return
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
28 |
use FacebookAds\Cursor;
|
29 |
use FacebookAds\Http\RequestInterface;
|
30 |
use FacebookAds\TypeChecker;
|
31 |
+
use FacebookAds\Object\Fields\TargetingRelaxationFields;
|
32 |
|
33 |
/**
|
34 |
* This class is auto-generated.
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
+
class TargetingRelaxation extends AbstractObject {
|
43 |
|
44 |
/**
|
45 |
+
* @return TargetingRelaxationFields
|
46 |
*/
|
47 |
public static function getFieldsEnum() {
|
48 |
+
return TargetingRelaxationFields::getInstance();
|
49 |
}
|
50 |
|
51 |
protected static function getReferencedEnums() {
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/ThirdPartyMeasurementReportDataset.php
CHANGED
@@ -77,28 +77,4 @@ class ThirdPartyMeasurementReportDataset extends AbstractCrudObject {
|
|
77 |
return $pending ? $request : $request->execute();
|
78 |
}
|
79 |
|
80 |
-
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
-
$this->assureId();
|
82 |
-
|
83 |
-
$param_types = array(
|
84 |
-
'data' => 'list<map>',
|
85 |
-
);
|
86 |
-
$enums = array(
|
87 |
-
);
|
88 |
-
|
89 |
-
$request = new ApiRequest(
|
90 |
-
$this->api,
|
91 |
-
$this->data['id'],
|
92 |
-
RequestInterface::METHOD_POST,
|
93 |
-
'/',
|
94 |
-
new ThirdPartyMeasurementReportDataset(),
|
95 |
-
'NODE',
|
96 |
-
ThirdPartyMeasurementReportDataset::getFieldsEnum()->getValues(),
|
97 |
-
new TypeChecker($param_types, $enums)
|
98 |
-
);
|
99 |
-
$request->addParams($params);
|
100 |
-
$request->addFields($fields);
|
101 |
-
return $pending ? $request : $request->execute();
|
102 |
-
}
|
103 |
-
|
104 |
}
|
77 |
return $pending ? $request : $request->execute();
|
78 |
}
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/URL.php
CHANGED
@@ -84,6 +84,7 @@ class URL extends AbstractCrudObject {
|
|
84 |
|
85 |
$param_types = array(
|
86 |
'blacklist' => 'bool',
|
|
|
87 |
'hmac' => 'string',
|
88 |
'locale' => 'list<Object>',
|
89 |
'scopes' => 'list<scopes_enum>',
|
84 |
|
85 |
$param_types = array(
|
86 |
'blacklist' => 'bool',
|
87 |
+
'denylist' => 'bool',
|
88 |
'hmac' => 'string',
|
89 |
'locale' => 'list<Object>',
|
90 |
'scopes' => 'list<scopes_enum>',
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/User.php
CHANGED
@@ -52,6 +52,7 @@ use FacebookAds\Object\Values\PermissionStatusValues;
|
|
52 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
53 |
use FacebookAds\Object\Values\PhotoTypeValues;
|
54 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
|
|
55 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
56 |
use FacebookAds\Object\Values\UserFilteringValues;
|
57 |
use FacebookAds\Object\Values\UserLocalNewsMegaphoneDismissStatusValues;
|
@@ -541,6 +542,7 @@ class User extends AbstractCrudObject {
|
|
541 |
$this->assureId();
|
542 |
|
543 |
$param_types = array(
|
|
|
544 |
'email' => 'string',
|
545 |
'name' => 'string',
|
546 |
'primary_page' => 'string',
|
@@ -827,29 +829,6 @@ class User extends AbstractCrudObject {
|
|
827 |
return $pending ? $request : $request->execute();
|
828 |
}
|
829 |
|
830 |
-
public function getFriendLists(array $fields = array(), array $params = array(), $pending = false) {
|
831 |
-
$this->assureId();
|
832 |
-
|
833 |
-
$param_types = array(
|
834 |
-
);
|
835 |
-
$enums = array(
|
836 |
-
);
|
837 |
-
|
838 |
-
$request = new ApiRequest(
|
839 |
-
$this->api,
|
840 |
-
$this->data['id'],
|
841 |
-
RequestInterface::METHOD_GET,
|
842 |
-
'/friendlists',
|
843 |
-
new FriendList(),
|
844 |
-
'EDGE',
|
845 |
-
FriendList::getFieldsEnum()->getValues(),
|
846 |
-
new TypeChecker($param_types, $enums)
|
847 |
-
);
|
848 |
-
$request->addParams($params);
|
849 |
-
$request->addFields($fields);
|
850 |
-
return $pending ? $request : $request->execute();
|
851 |
-
}
|
852 |
-
|
853 |
public function getFriends(array $fields = array(), array $params = array(), $pending = false) {
|
854 |
$this->assureId();
|
855 |
|
@@ -1196,6 +1175,7 @@ class User extends AbstractCrudObject {
|
|
1196 |
$param_types = array(
|
1197 |
'content_tags' => 'list<string>',
|
1198 |
'description' => 'string',
|
|
|
1199 |
'encoding_settings' => 'string',
|
1200 |
'fisheye_video_cropped' => 'bool',
|
1201 |
'front_z_rotation' => 'float',
|
@@ -1207,7 +1187,6 @@ class User extends AbstractCrudObject {
|
|
1207 |
'privacy' => 'string',
|
1208 |
'projection' => 'projection_enum',
|
1209 |
'published' => 'bool',
|
1210 |
-
'save_vod' => 'bool',
|
1211 |
'schedule_custom_profile_image' => 'file',
|
1212 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
1213 |
'status' => 'status_enum',
|
@@ -1296,6 +1275,29 @@ class User extends AbstractCrudObject {
|
|
1296 |
return $pending ? $request : $request->execute();
|
1297 |
}
|
1298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1299 |
public function deletePermissions(array $fields = array(), array $params = array(), $pending = false) {
|
1300 |
$this->assureId();
|
1301 |
|
@@ -1475,12 +1477,14 @@ class User extends AbstractCrudObject {
|
|
1475 |
$this->assureId();
|
1476 |
|
1477 |
$param_types = array(
|
|
|
1478 |
'height' => 'int',
|
1479 |
'redirect' => 'bool',
|
1480 |
'type' => 'type_enum',
|
1481 |
'width' => 'int',
|
1482 |
);
|
1483 |
$enums = array(
|
|
|
1484 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
1485 |
);
|
1486 |
|
@@ -1547,29 +1551,6 @@ class User extends AbstractCrudObject {
|
|
1547 |
return $pending ? $request : $request->execute();
|
1548 |
}
|
1549 |
|
1550 |
-
public function getTaggableFriends(array $fields = array(), array $params = array(), $pending = false) {
|
1551 |
-
$this->assureId();
|
1552 |
-
|
1553 |
-
$param_types = array(
|
1554 |
-
);
|
1555 |
-
$enums = array(
|
1556 |
-
);
|
1557 |
-
|
1558 |
-
$request = new ApiRequest(
|
1559 |
-
$this->api,
|
1560 |
-
$this->data['id'],
|
1561 |
-
RequestInterface::METHOD_GET,
|
1562 |
-
'/taggable_friends',
|
1563 |
-
new UserTaggableFriend(),
|
1564 |
-
'EDGE',
|
1565 |
-
UserTaggableFriend::getFieldsEnum()->getValues(),
|
1566 |
-
new TypeChecker($param_types, $enums)
|
1567 |
-
);
|
1568 |
-
$request->addParams($params);
|
1569 |
-
$request->addFields($fields);
|
1570 |
-
return $pending ? $request : $request->execute();
|
1571 |
-
}
|
1572 |
-
|
1573 |
public function getVideos(array $fields = array(), array $params = array(), $pending = false) {
|
1574 |
$this->assureId();
|
1575 |
|
@@ -1614,6 +1595,7 @@ class User extends AbstractCrudObject {
|
|
1614 |
'composer_type' => 'string',
|
1615 |
'container_type' => 'container_type_enum',
|
1616 |
'content_category' => 'content_category_enum',
|
|
|
1617 |
'description' => 'string',
|
1618 |
'direct_share_status' => 'unsigned int',
|
1619 |
'embeddable' => 'bool',
|
@@ -1672,6 +1654,7 @@ class User extends AbstractCrudObject {
|
|
1672 |
'upload_session_id' => 'string',
|
1673 |
'upload_setting_properties' => 'string',
|
1674 |
'video_file_chunk' => 'string',
|
|
|
1675 |
'video_start_time_ms' => 'unsigned int',
|
1676 |
'waterfall_id' => 'string',
|
1677 |
);
|
52 |
use FacebookAds\Object\Values\PhotoBackdatedTimeGranularityValues;
|
53 |
use FacebookAds\Object\Values\PhotoTypeValues;
|
54 |
use FacebookAds\Object\Values\PhotoUnpublishedContentTypeValues;
|
55 |
+
use FacebookAds\Object\Values\ProfilePictureSourceBreakingChangeValues;
|
56 |
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
57 |
use FacebookAds\Object\Values\UserFilteringValues;
|
58 |
use FacebookAds\Object\Values\UserLocalNewsMegaphoneDismissStatusValues;
|
542 |
$this->assureId();
|
543 |
|
544 |
$param_types = array(
|
545 |
+
'child_business_external_id' => 'string',
|
546 |
'email' => 'string',
|
547 |
'name' => 'string',
|
548 |
'primary_page' => 'string',
|
829 |
return $pending ? $request : $request->execute();
|
830 |
}
|
831 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
832 |
public function getFriends(array $fields = array(), array $params = array(), $pending = false) {
|
833 |
$this->assureId();
|
834 |
|
1175 |
$param_types = array(
|
1176 |
'content_tags' => 'list<string>',
|
1177 |
'description' => 'string',
|
1178 |
+
'enable_backup_ingest' => 'bool',
|
1179 |
'encoding_settings' => 'string',
|
1180 |
'fisheye_video_cropped' => 'bool',
|
1181 |
'front_z_rotation' => 'float',
|
1187 |
'privacy' => 'string',
|
1188 |
'projection' => 'projection_enum',
|
1189 |
'published' => 'bool',
|
|
|
1190 |
'schedule_custom_profile_image' => 'file',
|
1191 |
'spatial_audio_format' => 'spatial_audio_format_enum',
|
1192 |
'status' => 'status_enum',
|
1275 |
return $pending ? $request : $request->execute();
|
1276 |
}
|
1277 |
|
1278 |
+
public function getOwnedProductCatalogs(array $fields = array(), array $params = array(), $pending = false) {
|
1279 |
+
$this->assureId();
|
1280 |
+
|
1281 |
+
$param_types = array(
|
1282 |
+
);
|
1283 |
+
$enums = array(
|
1284 |
+
);
|
1285 |
+
|
1286 |
+
$request = new ApiRequest(
|
1287 |
+
$this->api,
|
1288 |
+
$this->data['id'],
|
1289 |
+
RequestInterface::METHOD_GET,
|
1290 |
+
'/owned_product_catalogs',
|
1291 |
+
new ProductCatalog(),
|
1292 |
+
'EDGE',
|
1293 |
+
ProductCatalog::getFieldsEnum()->getValues(),
|
1294 |
+
new TypeChecker($param_types, $enums)
|
1295 |
+
);
|
1296 |
+
$request->addParams($params);
|
1297 |
+
$request->addFields($fields);
|
1298 |
+
return $pending ? $request : $request->execute();
|
1299 |
+
}
|
1300 |
+
|
1301 |
public function deletePermissions(array $fields = array(), array $params = array(), $pending = false) {
|
1302 |
$this->assureId();
|
1303 |
|
1477 |
$this->assureId();
|
1478 |
|
1479 |
$param_types = array(
|
1480 |
+
'breaking_change' => 'breaking_change_enum',
|
1481 |
'height' => 'int',
|
1482 |
'redirect' => 'bool',
|
1483 |
'type' => 'type_enum',
|
1484 |
'width' => 'int',
|
1485 |
);
|
1486 |
$enums = array(
|
1487 |
+
'breaking_change_enum' => ProfilePictureSourceBreakingChangeValues::getInstance()->getValues(),
|
1488 |
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
1489 |
);
|
1490 |
|
1551 |
return $pending ? $request : $request->execute();
|
1552 |
}
|
1553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1554 |
public function getVideos(array $fields = array(), array $params = array(), $pending = false) {
|
1555 |
$this->assureId();
|
1556 |
|
1595 |
'composer_type' => 'string',
|
1596 |
'container_type' => 'container_type_enum',
|
1597 |
'content_category' => 'content_category_enum',
|
1598 |
+
'creative_tools' => 'string',
|
1599 |
'description' => 'string',
|
1600 |
'direct_share_status' => 'unsigned int',
|
1601 |
'embeddable' => 'bool',
|
1654 |
'upload_session_id' => 'string',
|
1655 |
'upload_setting_properties' => 'string',
|
1656 |
'video_file_chunk' => 'string',
|
1657 |
+
'video_id_original' => 'string',
|
1658 |
'video_start_time_ms' => 'unsigned int',
|
1659 |
'waterfall_id' => 'string',
|
1660 |
);
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/UserTaggableFriend.php
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\UserTaggableFriendFields;
|
32 |
-
use FacebookAds\Object\Values\ProfilePictureSourceTypeValues;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* This class is auto-generated.
|
36 |
-
*
|
37 |
-
* For any issues or feature requests related to this class, please let us know
|
38 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
39 |
-
* pull request for this class.
|
40 |
-
*
|
41 |
-
*/
|
42 |
-
|
43 |
-
class UserTaggableFriend extends AbstractCrudObject {
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @return UserTaggableFriendFields
|
47 |
-
*/
|
48 |
-
public static function getFieldsEnum() {
|
49 |
-
return UserTaggableFriendFields::getInstance();
|
50 |
-
}
|
51 |
-
|
52 |
-
protected static function getReferencedEnums() {
|
53 |
-
$ref_enums = array();
|
54 |
-
return $ref_enums;
|
55 |
-
}
|
56 |
-
|
57 |
-
|
58 |
-
public function getPicture(array $fields = array(), array $params = array(), $pending = false) {
|
59 |
-
$this->assureId();
|
60 |
-
|
61 |
-
$param_types = array(
|
62 |
-
'height' => 'int',
|
63 |
-
'redirect' => 'bool',
|
64 |
-
'type' => 'type_enum',
|
65 |
-
'width' => 'int',
|
66 |
-
);
|
67 |
-
$enums = array(
|
68 |
-
'type_enum' => ProfilePictureSourceTypeValues::getInstance()->getValues(),
|
69 |
-
);
|
70 |
-
|
71 |
-
$request = new ApiRequest(
|
72 |
-
$this->api,
|
73 |
-
$this->data['id'],
|
74 |
-
RequestInterface::METHOD_GET,
|
75 |
-
'/picture',
|
76 |
-
new ProfilePictureSource(),
|
77 |
-
'EDGE',
|
78 |
-
ProfilePictureSource::getFieldsEnum()->getValues(),
|
79 |
-
new TypeChecker($param_types, $enums)
|
80 |
-
);
|
81 |
-
$request->addParams($params);
|
82 |
-
$request->addFields($fields);
|
83 |
-
return $pending ? $request : $request->execute();
|
84 |
-
}
|
85 |
-
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{StreamingReactionReactionTypeValues.php → AdAccountAdVolumeRecommendationTypeValues.php}
RENAMED
@@ -33,18 +33,19 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
43 |
-
const
|
44 |
-
const
|
45 |
-
const
|
46 |
-
const
|
47 |
-
const
|
48 |
-
const
|
49 |
-
const
|
|
|
50 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static AdAccountAdVolumeRecommendationTypeValues getInstance()
|
37 |
*/
|
38 |
+
class AdAccountAdVolumeRecommendationTypeValues extends AbstractEnum {
|
39 |
|
40 |
+
const AGGREGATED_BID_LIMITED = 'AGGREGATED_BID_LIMITED';
|
41 |
+
const AGGREGATED_BUDGET_LIMITED = 'AGGREGATED_BUDGET_LIMITED';
|
42 |
+
const AGGREGATED_COST_LIMITED = 'AGGREGATED_COST_LIMITED';
|
43 |
+
const AUCTION_OVERLAP = 'AUCTION_OVERLAP';
|
44 |
+
const CREATIVE_FATIGUE = 'CREATIVE_FATIGUE';
|
45 |
+
const FRAGMENTATION = 'FRAGMENTATION';
|
46 |
+
const LEARNING_LIMITED = 'LEARNING_LIMITED';
|
47 |
+
const TOP_ADSETS_WITH_ADS_UNDER_CAP = 'TOP_ADSETS_WITH_ADS_UNDER_CAP';
|
48 |
+
const TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP = 'TOP_CAMPAIGNS_WITH_ADS_UNDER_CAP';
|
49 |
+
const UNECONOMICAL_ADS_THROTTLING = 'UNECONOMICAL_ADS_THROTTLING';
|
50 |
+
const ZERO_IMPRESSION = 'ZERO_IMPRESSION';
|
51 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountCurrencyValues.php
CHANGED
@@ -87,6 +87,7 @@ class AdAccountCurrencyValues extends AbstractEnum {
|
|
87 |
const THB = 'THB';
|
88 |
const VALUE_TRY = 'TRY';
|
89 |
const TWD = 'TWD';
|
|
|
90 |
const USD = 'USD';
|
91 |
const UYU = 'UYU';
|
92 |
const VND = 'VND';
|
87 |
const THB = 'THB';
|
88 |
const VALUE_TRY = 'TRY';
|
89 |
const TWD = 'TWD';
|
90 |
+
const UAH = 'UAH';
|
91 |
const USD = 'USD';
|
92 |
const UYU = 'UYU';
|
93 |
const VND = 'VND';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountDeliveryEstimateOptimizationGoalValues.php
CHANGED
@@ -55,6 +55,7 @@ class AdAccountDeliveryEstimateOptimizationGoalValues extends AbstractEnum {
|
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
|
|
58 |
const REACH = 'REACH';
|
59 |
const REPLIES = 'REPLIES';
|
60 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
58 |
+
const QUALITY_LEAD = 'QUALITY_LEAD';
|
59 |
const REACH = 'REACH';
|
60 |
const REPLIES = 'REPLIES';
|
61 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues.php
CHANGED
@@ -46,6 +46,7 @@ class AdAccountMatchedSearchApplicationsEdgeDataAppStoreValues extends AbstractE
|
|
46 |
const INSTANT_GAME = 'INSTANT_GAME';
|
47 |
const ITUNES = 'ITUNES';
|
48 |
const ITUNES_IPAD = 'ITUNES_IPAD';
|
|
|
49 |
const ROKU_STORE = 'ROKU_STORE';
|
50 |
const WINDOWS_10_STORE = 'WINDOWS_10_STORE';
|
51 |
const WINDOWS_STORE = 'WINDOWS_STORE';
|
46 |
const INSTANT_GAME = 'INSTANT_GAME';
|
47 |
const ITUNES = 'ITUNES';
|
48 |
const ITUNES_IPAD = 'ITUNES_IPAD';
|
49 |
+
const OCULUS_APP_STORE = 'OCULUS_APP_STORE';
|
50 |
const ROKU_STORE = 'ROKU_STORE';
|
51 |
const WINDOWS_10_STORE = 'WINDOWS_10_STORE';
|
52 |
const WINDOWS_STORE = 'WINDOWS_STORE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountPermittedTasksValues.php
CHANGED
@@ -39,8 +39,5 @@ class AdAccountPermittedTasksValues extends AbstractEnum {
|
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
42 |
-
const CREATIVE = 'CREATIVE';
|
43 |
-
const DRAFT = 'DRAFT';
|
44 |
-
const FB_EMPLOYEE_DSO_ADVERTISE = 'FB_EMPLOYEE_DSO_ADVERTISE';
|
45 |
const MANAGE = 'MANAGE';
|
46 |
}
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
|
|
|
|
|
|
42 |
const MANAGE = 'MANAGE';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountTargetingUnifiedRegulatedCategoriesValues.php
CHANGED
@@ -40,5 +40,6 @@ class AdAccountTargetingUnifiedRegulatedCategoriesValues extends AbstractEnum {
|
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
|
|
43 |
const NONE = 'NONE';
|
44 |
}
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
43 |
+
const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';
|
44 |
const NONE = 'NONE';
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAccountTasksValues.php
CHANGED
@@ -39,8 +39,5 @@ class AdAccountTasksValues extends AbstractEnum {
|
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
42 |
-
const CREATIVE = 'CREATIVE';
|
43 |
-
const DRAFT = 'DRAFT';
|
44 |
-
const FB_EMPLOYEE_DSO_ADVERTISE = 'FB_EMPLOYEE_DSO_ADVERTISE';
|
45 |
const MANAGE = 'MANAGE';
|
46 |
}
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
|
|
|
|
|
|
42 |
const MANAGE = 'MANAGE';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PageDomainActionTypeValues.php → AdActivityDataSourceValues.php}
RENAMED
@@ -33,10 +33,10 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static AdActivityDataSourceValues getInstance()
|
37 |
*/
|
38 |
+
class AdActivityDataSourceValues extends AbstractEnum {
|
39 |
|
40 |
+
const CALYPSO = 'CALYPSO';
|
41 |
+
const TAO = 'TAO';
|
42 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdActivityEventTypeValues.php
CHANGED
@@ -92,6 +92,7 @@ class AdActivityEventTypeValues extends AbstractEnum {
|
|
92 |
const UPDATE_AD_SET_BIDDING = 'update_ad_set_bidding';
|
93 |
const UPDATE_AD_SET_BUDGET = 'update_ad_set_budget';
|
94 |
const UPDATE_AD_SET_DURATION = 'update_ad_set_duration';
|
|
|
95 |
const UPDATE_AD_SET_MIN_SPEND_TARGET = 'update_ad_set_min_spend_target';
|
96 |
const UPDATE_AD_SET_NAME = 'update_ad_set_name';
|
97 |
const UPDATE_AD_SET_OPTIMIZATION_GOAL = 'update_ad_set_optimization_goal';
|
@@ -112,4 +113,5 @@ class AdActivityEventTypeValues extends AbstractEnum {
|
|
112 |
const UPDATE_CAMPAIGN_NAME = 'update_campaign_name';
|
113 |
const UPDATE_CAMPAIGN_RUN_STATUS = 'update_campaign_run_status';
|
114 |
const UPDATE_CAMPAIGN_SCHEDULE = 'update_campaign_schedule';
|
|
|
115 |
}
|
92 |
const UPDATE_AD_SET_BIDDING = 'update_ad_set_bidding';
|
93 |
const UPDATE_AD_SET_BUDGET = 'update_ad_set_budget';
|
94 |
const UPDATE_AD_SET_DURATION = 'update_ad_set_duration';
|
95 |
+
const UPDATE_AD_SET_LEARNING_STAGE_STATUS = 'update_ad_set_learning_stage_status';
|
96 |
const UPDATE_AD_SET_MIN_SPEND_TARGET = 'update_ad_set_min_spend_target';
|
97 |
const UPDATE_AD_SET_NAME = 'update_ad_set_name';
|
98 |
const UPDATE_AD_SET_OPTIMIZATION_GOAL = 'update_ad_set_optimization_goal';
|
113 |
const UPDATE_CAMPAIGN_NAME = 'update_campaign_name';
|
114 |
const UPDATE_CAMPAIGN_RUN_STATUS = 'update_campaign_run_status';
|
115 |
const UPDATE_CAMPAIGN_SCHEDULE = 'update_campaign_schedule';
|
116 |
+
const UPDATE_DELIVERY_TYPE_CROSS_LEVEL_SHIFT = 'update_delivery_type_cross_level_shift';
|
117 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdAssetFeedSpecCallToActionTypesValues.php
CHANGED
@@ -81,6 +81,7 @@ class AdAssetFeedSpecCallToActionTypesValues extends AbstractEnum {
|
|
81 |
const SAY_THANKS = 'SAY_THANKS';
|
82 |
const SEE_MORE = 'SEE_MORE';
|
83 |
const SELL_NOW = 'SELL_NOW';
|
|
|
84 |
const SHARE = 'SHARE';
|
85 |
const SHOP_NOW = 'SHOP_NOW';
|
86 |
const SIGN_UP = 'SIGN_UP';
|
81 |
const SAY_THANKS = 'SAY_THANKS';
|
82 |
const SEE_MORE = 'SEE_MORE';
|
83 |
const SELL_NOW = 'SELL_NOW';
|
84 |
+
const SEND_A_GIFT = 'SEND_A_GIFT';
|
85 |
const SHARE = 'SHARE';
|
86 |
const SHOP_NOW = 'SHOP_NOW';
|
87 |
const SIGN_UP = 'SIGN_UP';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCampaignActivityOptimizationGoalNewValues.php
CHANGED
@@ -55,6 +55,7 @@ class AdCampaignActivityOptimizationGoalNewValues extends AbstractEnum {
|
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
|
|
58 |
const REACH = 'REACH';
|
59 |
const REPLIES = 'REPLIES';
|
60 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
58 |
+
const QUALITY_LEAD = 'QUALITY_LEAD';
|
59 |
const REACH = 'REACH';
|
60 |
const REPLIES = 'REPLIES';
|
61 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCampaignActivityOptimizationGoalOldValues.php
CHANGED
@@ -55,6 +55,7 @@ class AdCampaignActivityOptimizationGoalOldValues extends AbstractEnum {
|
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
|
|
58 |
const REACH = 'REACH';
|
59 |
const REPLIES = 'REPLIES';
|
60 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
58 |
+
const QUALITY_LEAD = 'QUALITY_LEAD';
|
59 |
const REACH = 'REACH';
|
60 |
const REPLIES = 'REPLIES';
|
61 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCampaignDeliveryEstimateOptimizationGoalValues.php
CHANGED
@@ -55,6 +55,7 @@ class AdCampaignDeliveryEstimateOptimizationGoalValues extends AbstractEnum {
|
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
|
|
58 |
const REACH = 'REACH';
|
59 |
const REPLIES = 'REPLIES';
|
60 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
58 |
+
const QUALITY_LEAD = 'QUALITY_LEAD';
|
59 |
const REACH = 'REACH';
|
60 |
const REPLIES = 'REPLIES';
|
61 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCreativeCallToActionTypeValues.php
CHANGED
@@ -81,6 +81,7 @@ class AdCreativeCallToActionTypeValues extends AbstractEnum {
|
|
81 |
const SAY_THANKS = 'SAY_THANKS';
|
82 |
const SEE_MORE = 'SEE_MORE';
|
83 |
const SELL_NOW = 'SELL_NOW';
|
|
|
84 |
const SHARE = 'SHARE';
|
85 |
const SHOP_NOW = 'SHOP_NOW';
|
86 |
const SIGN_UP = 'SIGN_UP';
|
81 |
const SAY_THANKS = 'SAY_THANKS';
|
82 |
const SEE_MORE = 'SEE_MORE';
|
83 |
const SELL_NOW = 'SELL_NOW';
|
84 |
+
const SEND_A_GIFT = 'SEND_A_GIFT';
|
85 |
const SHARE = 'SHARE';
|
86 |
const SHOP_NOW = 'SHOP_NOW';
|
87 |
const SIGN_UP = 'SIGN_UP';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdCreativeLinkDataCallToActionTypeValues.php
CHANGED
@@ -81,6 +81,7 @@ class AdCreativeLinkDataCallToActionTypeValues extends AbstractEnum {
|
|
81 |
const SAY_THANKS = 'SAY_THANKS';
|
82 |
const SEE_MORE = 'SEE_MORE';
|
83 |
const SELL_NOW = 'SELL_NOW';
|
|
|
84 |
const SHARE = 'SHARE';
|
85 |
const SHOP_NOW = 'SHOP_NOW';
|
86 |
const SIGN_UP = 'SIGN_UP';
|
81 |
const SAY_THANKS = 'SAY_THANKS';
|
82 |
const SEE_MORE = 'SEE_MORE';
|
83 |
const SELL_NOW = 'SELL_NOW';
|
84 |
+
const SEND_A_GIFT = 'SEND_A_GIFT';
|
85 |
const SHARE = 'SHARE';
|
86 |
const SHOP_NOW = 'SHOP_NOW';
|
87 |
const SIGN_UP = 'SIGN_UP';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdNetworkAnalyticsSyncQueryResultBreakdownsValues.php
CHANGED
@@ -52,6 +52,7 @@ class AdNetworkAnalyticsSyncQueryResultBreakdownsValues extends AbstractEnum {
|
|
52 |
const GENDER = 'GENDER';
|
53 |
const INSTANT_ARTICLE_ID = 'INSTANT_ARTICLE_ID';
|
54 |
const INSTANT_ARTICLE_PAGE_ID = 'INSTANT_ARTICLE_PAGE_ID';
|
|
|
55 |
const PLACEMENT = 'PLACEMENT';
|
56 |
const PLACEMENT_NAME = 'PLACEMENT_NAME';
|
57 |
const PLATFORM = 'PLATFORM';
|
52 |
const GENDER = 'GENDER';
|
53 |
const INSTANT_ARTICLE_ID = 'INSTANT_ARTICLE_ID';
|
54 |
const INSTANT_ARTICLE_PAGE_ID = 'INSTANT_ARTICLE_PAGE_ID';
|
55 |
+
const IS_DEAL_BACKFILL = 'IS_DEAL_BACKFILL';
|
56 |
const PLACEMENT = 'PLACEMENT';
|
57 |
const PLACEMENT_NAME = 'PLACEMENT_NAME';
|
58 |
const PLATFORM = 'PLATFORM';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PagePaymentDevModeActionValues.php → AdPlacePageSetCategoryValues.php}
RENAMED
@@ -33,10 +33,10 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static AdPlacePageSetCategoryValues getInstance()
|
37 |
*/
|
38 |
+
class AdPlacePageSetCategoryValues extends AbstractEnum {
|
39 |
|
40 |
+
const BOPUS = 'BOPUS';
|
41 |
+
const GENERAL = 'GENERAL';
|
42 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdPreviewAdFormatValues.php
CHANGED
@@ -67,6 +67,5 @@ class AdPreviewAdFormatValues extends AbstractEnum {
|
|
67 |
const RIGHT_COLUMN_STANDARD = 'RIGHT_COLUMN_STANDARD';
|
68 |
const SUGGESTED_VIDEO_DESKTOP = 'SUGGESTED_VIDEO_DESKTOP';
|
69 |
const SUGGESTED_VIDEO_MOBILE = 'SUGGESTED_VIDEO_MOBILE';
|
70 |
-
const WATCH_FEED_HOME = 'WATCH_FEED_HOME';
|
71 |
const WATCH_FEED_MOBILE = 'WATCH_FEED_MOBILE';
|
72 |
}
|
67 |
const RIGHT_COLUMN_STANDARD = 'RIGHT_COLUMN_STANDARD';
|
68 |
const SUGGESTED_VIDEO_DESKTOP = 'SUGGESTED_VIDEO_DESKTOP';
|
69 |
const SUGGESTED_VIDEO_MOBILE = 'SUGGESTED_VIDEO_MOBILE';
|
|
|
70 |
const WATCH_FEED_MOBILE = 'WATCH_FEED_MOBILE';
|
71 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdSetOptimizationGoalValues.php
CHANGED
@@ -55,6 +55,7 @@ class AdSetOptimizationGoalValues extends AbstractEnum {
|
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
|
|
58 |
const REACH = 'REACH';
|
59 |
const REPLIES = 'REPLIES';
|
60 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
55 |
const PAGE_ENGAGEMENT = 'PAGE_ENGAGEMENT';
|
56 |
const PAGE_LIKES = 'PAGE_LIKES';
|
57 |
const POST_ENGAGEMENT = 'POST_ENGAGEMENT';
|
58 |
+
const QUALITY_LEAD = 'QUALITY_LEAD';
|
59 |
const REACH = 'REACH';
|
60 |
const REPLIES = 'REPLIES';
|
61 |
const SOCIAL_IMPRESSIONS = 'SOCIAL_IMPRESSIONS';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdSetTuneForCategoryValues.php
CHANGED
@@ -40,5 +40,6 @@ class AdSetTuneForCategoryValues extends AbstractEnum {
|
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
|
|
43 |
const NONE = 'NONE';
|
44 |
}
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
43 |
+
const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';
|
44 |
const NONE = 'NONE';
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdStudyTypeValues.php
CHANGED
@@ -40,5 +40,6 @@ class AdStudyTypeValues extends AbstractEnum {
|
|
40 |
const CONTINUOUS_LIFT_CONFIG = 'CONTINUOUS_LIFT_CONFIG';
|
41 |
const GEO_LIFT = 'GEO_LIFT';
|
42 |
const LIFT = 'LIFT';
|
|
|
43 |
const SPLIT_TEST = 'SPLIT_TEST';
|
44 |
}
|
40 |
const CONTINUOUS_LIFT_CONFIG = 'CONTINUOUS_LIFT_CONFIG';
|
41 |
const GEO_LIFT = 'GEO_LIFT';
|
42 |
const LIFT = 'LIFT';
|
43 |
+
const PRIVATE_LIFT = 'PRIVATE_LIFT';
|
44 |
const SPLIT_TEST = 'SPLIT_TEST';
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdVideoContainerTypeValues.php
CHANGED
@@ -87,6 +87,7 @@ class AdVideoContainerTypeValues extends AbstractEnum {
|
|
87 |
const HEURISTIC_CLUSTER_VIDEO = 'HEURISTIC_CLUSTER_VIDEO';
|
88 |
const HEURISTIC_PREVIEW = 'HEURISTIC_PREVIEW';
|
89 |
const HIGHLIGHT_CLIP_VIDEO = 'HIGHLIGHT_CLIP_VIDEO';
|
|
|
90 |
const INSPIRATION_VIDEO = 'INSPIRATION_VIDEO';
|
91 |
const INSTAGRAM_VIDEO_COPY = 'INSTAGRAM_VIDEO_COPY';
|
92 |
const INSTANT_APPLICATION_PREVIEW = 'INSTANT_APPLICATION_PREVIEW';
|
@@ -107,6 +108,7 @@ class AdVideoContainerTypeValues extends AbstractEnum {
|
|
107 |
const MOMENTS_VIDEO = 'MOMENTS_VIDEO';
|
108 |
const NEO_ASYNC_GAME_VIDEO = 'NEO_ASYNC_GAME_VIDEO';
|
109 |
const NO_STORY = 'NO_STORY';
|
|
|
110 |
const OCULUS_CREATOR_PORTAL = 'OCULUS_CREATOR_PORTAL';
|
111 |
const OCULUS_VENUES_BROADCAST = 'OCULUS_VENUES_BROADCAST';
|
112 |
const OFFERS_VIDEO = 'OFFERS_VIDEO';
|
@@ -143,6 +145,8 @@ class AdVideoContainerTypeValues extends AbstractEnum {
|
|
143 |
const VIDEO_COMMENT = 'VIDEO_COMMENT';
|
144 |
const VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO = 'VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO';
|
145 |
const VIDEO_SUPERRES = 'VIDEO_SUPERRES';
|
|
|
146 |
const WOODHENGE = 'WOODHENGE';
|
|
|
147 |
const YOUR_DAY = 'YOUR_DAY';
|
148 |
}
|
87 |
const HEURISTIC_CLUSTER_VIDEO = 'HEURISTIC_CLUSTER_VIDEO';
|
88 |
const HEURISTIC_PREVIEW = 'HEURISTIC_PREVIEW';
|
89 |
const HIGHLIGHT_CLIP_VIDEO = 'HIGHLIGHT_CLIP_VIDEO';
|
90 |
+
const IG_STORIES_READER = 'IG_STORIES_READER';
|
91 |
const INSPIRATION_VIDEO = 'INSPIRATION_VIDEO';
|
92 |
const INSTAGRAM_VIDEO_COPY = 'INSTAGRAM_VIDEO_COPY';
|
93 |
const INSTANT_APPLICATION_PREVIEW = 'INSTANT_APPLICATION_PREVIEW';
|
108 |
const MOMENTS_VIDEO = 'MOMENTS_VIDEO';
|
109 |
const NEO_ASYNC_GAME_VIDEO = 'NEO_ASYNC_GAME_VIDEO';
|
110 |
const NO_STORY = 'NO_STORY';
|
111 |
+
const NO_STORY_WITH_ENTPOST = 'NO_STORY_WITH_ENTPOST';
|
112 |
const OCULUS_CREATOR_PORTAL = 'OCULUS_CREATOR_PORTAL';
|
113 |
const OCULUS_VENUES_BROADCAST = 'OCULUS_VENUES_BROADCAST';
|
114 |
const OFFERS_VIDEO = 'OFFERS_VIDEO';
|
145 |
const VIDEO_COMMENT = 'VIDEO_COMMENT';
|
146 |
const VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO = 'VIDEO_CREATIVE_EDITOR_AUTOGEN_AD_VIDEO';
|
147 |
const VIDEO_SUPERRES = 'VIDEO_SUPERRES';
|
148 |
+
const VU_GENERATED_VIDEO = 'VU_GENERATED_VIDEO';
|
149 |
const WOODHENGE = 'WOODHENGE';
|
150 |
+
const WORK_KNOWLEDGE_VIDEO = 'WORK_KNOWLEDGE_VIDEO';
|
151 |
const YOUR_DAY = 'YOUR_DAY';
|
152 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdVideoOriginalProjectionTypeValues.php
CHANGED
@@ -38,7 +38,6 @@ use FacebookAds\Enum\AbstractEnum;
|
|
38 |
class AdVideoOriginalProjectionTypeValues extends AbstractEnum {
|
39 |
|
40 |
const CUBEMAP = 'cubemap';
|
41 |
-
const EQUIANGULAR_CUBEMAP = 'equiangular_cubemap';
|
42 |
const EQUIRECTANGULAR = 'equirectangular';
|
43 |
const HALF_EQUIRECTANGULAR = 'half_equirectangular';
|
44 |
}
|
38 |
class AdVideoOriginalProjectionTypeValues extends AbstractEnum {
|
39 |
|
40 |
const CUBEMAP = 'cubemap';
|
|
|
41 |
const EQUIRECTANGULAR = 'equirectangular';
|
42 |
const HALF_EQUIRECTANGULAR = 'half_equirectangular';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdVideoValidationAdPlacementsValues.php
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Values;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
* @method static AdVideoValidationAdPlacementsValues getInstance()
|
37 |
-
*/
|
38 |
-
class AdVideoValidationAdPlacementsValues extends AbstractEnum {
|
39 |
-
|
40 |
-
const AUDIENCE_NETWORK_INSTREAM_VIDEO = 'AUDIENCE_NETWORK_INSTREAM_VIDEO';
|
41 |
-
const AUDIENCE_NETWORK_INSTREAM_VIDEO_MOBILE = 'AUDIENCE_NETWORK_INSTREAM_VIDEO_MOBILE';
|
42 |
-
const AUDIENCE_NETWORK_REWARDED_VIDEO = 'AUDIENCE_NETWORK_REWARDED_VIDEO';
|
43 |
-
const DESKTOP_FEED_STANDARD = 'DESKTOP_FEED_STANDARD';
|
44 |
-
const FACEBOOK_STORY_MOBILE = 'FACEBOOK_STORY_MOBILE';
|
45 |
-
const INSTAGRAM_STANDARD = 'INSTAGRAM_STANDARD';
|
46 |
-
const INSTAGRAM_STORY = 'INSTAGRAM_STORY';
|
47 |
-
const INSTANT_ARTICLE_STANDARD = 'INSTANT_ARTICLE_STANDARD';
|
48 |
-
const INSTREAM_VIDEO_DESKTOP = 'INSTREAM_VIDEO_DESKTOP';
|
49 |
-
const INSTREAM_VIDEO_IMAGE = 'INSTREAM_VIDEO_IMAGE';
|
50 |
-
const INSTREAM_VIDEO_MOBILE = 'INSTREAM_VIDEO_MOBILE';
|
51 |
-
const MESSENGER_MOBILE_INBOX_MEDIA = 'MESSENGER_MOBILE_INBOX_MEDIA';
|
52 |
-
const MESSENGER_MOBILE_STORY_MEDIA = 'MESSENGER_MOBILE_STORY_MEDIA';
|
53 |
-
const MOBILE_FEED_STANDARD = 'MOBILE_FEED_STANDARD';
|
54 |
-
const MOBILE_FULLWIDTH = 'MOBILE_FULLWIDTH';
|
55 |
-
const MOBILE_INTERSTITIAL = 'MOBILE_INTERSTITIAL';
|
56 |
-
const MOBILE_MEDIUM_RECTANGLE = 'MOBILE_MEDIUM_RECTANGLE';
|
57 |
-
const MOBILE_NATIVE = 'MOBILE_NATIVE';
|
58 |
-
const RIGHT_COLUMN_STANDARD = 'RIGHT_COLUMN_STANDARD';
|
59 |
-
const SUGGESTED_VIDEO_MOBILE = 'SUGGESTED_VIDEO_MOBILE';
|
60 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/AdsPixelAutomaticMatchingFieldsValues.php
CHANGED
@@ -37,7 +37,9 @@ use FacebookAds\Enum\AbstractEnum;
|
|
37 |
*/
|
38 |
class AdsPixelAutomaticMatchingFieldsValues extends AbstractEnum {
|
39 |
|
|
|
40 |
const CT = 'ct';
|
|
|
41 |
const EM = 'em';
|
42 |
const FN = 'fn';
|
43 |
const GE = 'ge';
|
37 |
*/
|
38 |
class AdsPixelAutomaticMatchingFieldsValues extends AbstractEnum {
|
39 |
|
40 |
+
const COUNTRY = 'country';
|
41 |
const CT = 'ct';
|
42 |
+
const DB = 'db';
|
43 |
const EM = 'em';
|
44 |
const FN = 'fn';
|
45 |
const GE = 'ge';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ApplicationSupportedPlatformsValues.php
CHANGED
@@ -45,6 +45,7 @@ class ApplicationSupportedPlatformsValues extends AbstractEnum {
|
|
45 |
const IPAD = 'IPAD';
|
46 |
const IPHONE = 'IPHONE';
|
47 |
const MOBILE_WEB = 'MOBILE_WEB';
|
|
|
48 |
const SUPPLEMENTARY_IMAGES = 'SUPPLEMENTARY_IMAGES';
|
49 |
const WEB = 'WEB';
|
50 |
const WINDOWS = 'WINDOWS';
|
45 |
const IPAD = 'IPAD';
|
46 |
const IPHONE = 'IPHONE';
|
47 |
const MOBILE_WEB = 'MOBILE_WEB';
|
48 |
+
const OCULUS = 'OCULUS';
|
49 |
const SUPPLEMENTARY_IMAGES = 'SUPPLEMENTARY_IMAGES';
|
50 |
const WEB = 'WEB';
|
51 |
const WINDOWS = 'WINDOWS';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessAssetGroupAdaccountTasksValues.php
CHANGED
@@ -39,8 +39,5 @@ class BusinessAssetGroupAdaccountTasksValues extends AbstractEnum {
|
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
42 |
-
const CREATIVE = 'CREATIVE';
|
43 |
-
const DRAFT = 'DRAFT';
|
44 |
-
const FB_EMPLOYEE_DSO_ADVERTISE = 'FB_EMPLOYEE_DSO_ADVERTISE';
|
45 |
const MANAGE = 'MANAGE';
|
46 |
}
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
|
|
|
|
|
|
42 |
const MANAGE = 'MANAGE';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessAssetGroupPageTasksValues.php
CHANGED
@@ -44,6 +44,7 @@ class BusinessAssetGroupPageTasksValues extends AbstractEnum {
|
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
|
|
47 |
const MODERATE = 'MODERATE';
|
48 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
49 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
@@ -51,6 +52,7 @@ class BusinessAssetGroupPageTasksValues extends AbstractEnum {
|
|
51 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
52 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
53 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
|
|
54 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
55 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
56 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
47 |
+
const MESSAGING = 'MESSAGING';
|
48 |
const MODERATE = 'MODERATE';
|
49 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
50 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
52 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
53 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
54 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
55 |
+
const PROFILE_PLUS_LIVE_STREAM_MODERATION = 'PROFILE_PLUS_LIVE_STREAM_MODERATION';
|
56 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
57 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
58 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessCreativeFolderTasksValues.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Values;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
* @method static BusinessCreativeFolderTasksValues getInstance()
|
37 |
-
*/
|
38 |
-
class BusinessCreativeFolderTasksValues extends AbstractEnum {
|
39 |
-
|
40 |
-
const CREATE_CONTENT = 'CREATE_CONTENT';
|
41 |
-
const MANAGE_CONTENT = 'MANAGE_CONTENT';
|
42 |
-
const MANAGE_PERMISSIONS = 'MANAGE_PERMISSIONS';
|
43 |
-
const VIEW_CONTENT = 'VIEW_CONTENT';
|
44 |
-
const VIEW_INSIGHTS = 'VIEW_INSIGHTS';
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessImageValidationAdPlacementsValues.php
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object\Values;
|
26 |
-
|
27 |
-
use FacebookAds\Enum\AbstractEnum;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* This class is auto-generated.
|
31 |
-
*
|
32 |
-
* For any issues or feature requests related to this class, please let us know
|
33 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
-
* pull request for this class.
|
35 |
-
*
|
36 |
-
* @method static BusinessImageValidationAdPlacementsValues getInstance()
|
37 |
-
*/
|
38 |
-
class BusinessImageValidationAdPlacementsValues extends AbstractEnum {
|
39 |
-
|
40 |
-
const AUDIENCE_NETWORK_INSTREAM_VIDEO = 'AUDIENCE_NETWORK_INSTREAM_VIDEO';
|
41 |
-
const AUDIENCE_NETWORK_INSTREAM_VIDEO_MOBILE = 'AUDIENCE_NETWORK_INSTREAM_VIDEO_MOBILE';
|
42 |
-
const AUDIENCE_NETWORK_REWARDED_VIDEO = 'AUDIENCE_NETWORK_REWARDED_VIDEO';
|
43 |
-
const DESKTOP_FEED_STANDARD = 'DESKTOP_FEED_STANDARD';
|
44 |
-
const FACEBOOK_STORY_MOBILE = 'FACEBOOK_STORY_MOBILE';
|
45 |
-
const INSTAGRAM_STANDARD = 'INSTAGRAM_STANDARD';
|
46 |
-
const INSTAGRAM_STORY = 'INSTAGRAM_STORY';
|
47 |
-
const INSTANT_ARTICLE_STANDARD = 'INSTANT_ARTICLE_STANDARD';
|
48 |
-
const INSTREAM_VIDEO_DESKTOP = 'INSTREAM_VIDEO_DESKTOP';
|
49 |
-
const INSTREAM_VIDEO_IMAGE = 'INSTREAM_VIDEO_IMAGE';
|
50 |
-
const INSTREAM_VIDEO_MOBILE = 'INSTREAM_VIDEO_MOBILE';
|
51 |
-
const MESSENGER_MOBILE_INBOX_MEDIA = 'MESSENGER_MOBILE_INBOX_MEDIA';
|
52 |
-
const MESSENGER_MOBILE_STORY_MEDIA = 'MESSENGER_MOBILE_STORY_MEDIA';
|
53 |
-
const MOBILE_FEED_STANDARD = 'MOBILE_FEED_STANDARD';
|
54 |
-
const MOBILE_FULLWIDTH = 'MOBILE_FULLWIDTH';
|
55 |
-
const MOBILE_INTERSTITIAL = 'MOBILE_INTERSTITIAL';
|
56 |
-
const MOBILE_MEDIUM_RECTANGLE = 'MOBILE_MEDIUM_RECTANGLE';
|
57 |
-
const MOBILE_NATIVE = 'MOBILE_NATIVE';
|
58 |
-
const RIGHT_COLUMN_STANDARD = 'RIGHT_COLUMN_STANDARD';
|
59 |
-
const SUGGESTED_VIDEO_MOBILE = 'SUGGESTED_VIDEO_MOBILE';
|
60 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessPagePermittedTasksValues.php
CHANGED
@@ -44,6 +44,7 @@ class BusinessPagePermittedTasksValues extends AbstractEnum {
|
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
|
|
47 |
const MODERATE = 'MODERATE';
|
48 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
49 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
@@ -51,6 +52,7 @@ class BusinessPagePermittedTasksValues extends AbstractEnum {
|
|
51 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
52 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
53 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
|
|
54 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
55 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
56 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
47 |
+
const MESSAGING = 'MESSAGING';
|
48 |
const MODERATE = 'MODERATE';
|
49 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
50 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
52 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
53 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
54 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
55 |
+
const PROFILE_PLUS_LIVE_STREAM_MODERATION = 'PROFILE_PLUS_LIVE_STREAM_MODERATION';
|
56 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
57 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
58 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessPermittedTasksValues.php
CHANGED
@@ -39,8 +39,5 @@ class BusinessPermittedTasksValues extends AbstractEnum {
|
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
42 |
-
const CREATIVE = 'CREATIVE';
|
43 |
-
const DRAFT = 'DRAFT';
|
44 |
-
const FB_EMPLOYEE_DSO_ADVERTISE = 'FB_EMPLOYEE_DSO_ADVERTISE';
|
45 |
const MANAGE = 'MANAGE';
|
46 |
}
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const ANALYZE = 'ANALYZE';
|
|
|
|
|
|
|
42 |
const MANAGE = 'MANAGE';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessRoleRequestRoleValues.php
CHANGED
@@ -43,4 +43,13 @@ class BusinessRoleRequestRoleValues extends AbstractEnum {
|
|
43 |
const EMPLOYEE = 'EMPLOYEE';
|
44 |
const FINANCE_ANALYST = 'FINANCE_ANALYST';
|
45 |
const FINANCE_EDITOR = 'FINANCE_EDITOR';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
43 |
const EMPLOYEE = 'EMPLOYEE';
|
44 |
const FINANCE_ANALYST = 'FINANCE_ANALYST';
|
45 |
const FINANCE_EDITOR = 'FINANCE_EDITOR';
|
46 |
+
const FINANCE_EDIT_TASK = 'FINANCE_EDIT_TASK';
|
47 |
+
const FINANCE_VIEW_TASK = 'FINANCE_VIEW_TASK';
|
48 |
+
const MODERATE_TASK = 'MODERATE_TASK';
|
49 |
+
const OPERATE_TASK = 'OPERATE_TASK';
|
50 |
+
const PARTNER_CENTER_ADMIN = 'PARTNER_CENTER_ADMIN';
|
51 |
+
const PARTNER_CENTER_ANALYST = 'PARTNER_CENTER_ANALYST';
|
52 |
+
const PARTNER_CENTER_EDUCATION = 'PARTNER_CENTER_EDUCATION';
|
53 |
+
const PARTNER_CENTER_MARKETING = 'PARTNER_CENTER_MARKETING';
|
54 |
+
const PARTNER_CENTER_OPERATIONS = 'PARTNER_CENTER_OPERATIONS';
|
55 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/BusinessUserRoleValues.php
CHANGED
@@ -43,4 +43,13 @@ class BusinessUserRoleValues extends AbstractEnum {
|
|
43 |
const EMPLOYEE = 'EMPLOYEE';
|
44 |
const FINANCE_ANALYST = 'FINANCE_ANALYST';
|
45 |
const FINANCE_EDITOR = 'FINANCE_EDITOR';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
43 |
const EMPLOYEE = 'EMPLOYEE';
|
44 |
const FINANCE_ANALYST = 'FINANCE_ANALYST';
|
45 |
const FINANCE_EDITOR = 'FINANCE_EDITOR';
|
46 |
+
const FINANCE_EDIT_TASK = 'FINANCE_EDIT_TASK';
|
47 |
+
const FINANCE_VIEW_TASK = 'FINANCE_VIEW_TASK';
|
48 |
+
const MODERATE_TASK = 'MODERATE_TASK';
|
49 |
+
const OPERATE_TASK = 'OPERATE_TASK';
|
50 |
+
const PARTNER_CENTER_ADMIN = 'PARTNER_CENTER_ADMIN';
|
51 |
+
const PARTNER_CENTER_ANALYST = 'PARTNER_CENTER_ANALYST';
|
52 |
+
const PARTNER_CENTER_EDUCATION = 'PARTNER_CENTER_EDUCATION';
|
53 |
+
const PARTNER_CENTER_MARKETING = 'PARTNER_CENTER_MARKETING';
|
54 |
+
const PARTNER_CENTER_OPERATIONS = 'PARTNER_CENTER_OPERATIONS';
|
55 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CPASCollaborationRequestRequesterAgencyOrBrandValues.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Values;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
* @method static CPASCollaborationRequestRequesterAgencyOrBrandValues getInstance()
|
37 |
+
*/
|
38 |
+
class CPASCollaborationRequestRequesterAgencyOrBrandValues extends AbstractEnum {
|
39 |
+
|
40 |
+
const AGENCY = 'AGENCY';
|
41 |
+
const BRAND = 'BRAND';
|
42 |
+
const MERCHANT = 'MERCHANT';
|
43 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CampaignSpecialAdCategoriesValues.php
CHANGED
@@ -40,5 +40,6 @@ class CampaignSpecialAdCategoriesValues extends AbstractEnum {
|
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
|
|
43 |
const NONE = 'NONE';
|
44 |
}
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
43 |
+
const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';
|
44 |
const NONE = 'NONE';
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CampaignSpecialAdCategoryCountryValues.php
ADDED
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Values;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
* @method static CampaignSpecialAdCategoryCountryValues getInstance()
|
37 |
+
*/
|
38 |
+
class CampaignSpecialAdCategoryCountryValues extends AbstractEnum {
|
39 |
+
|
40 |
+
const AD = 'AD';
|
41 |
+
const AE = 'AE';
|
42 |
+
const AF = 'AF';
|
43 |
+
const AG = 'AG';
|
44 |
+
const AI = 'AI';
|
45 |
+
const AL = 'AL';
|
46 |
+
const AM = 'AM';
|
47 |
+
const AN = 'AN';
|
48 |
+
const AO = 'AO';
|
49 |
+
const AQ = 'AQ';
|
50 |
+
const AR = 'AR';
|
51 |
+
const VALUE_AS = 'AS';
|
52 |
+
const AT = 'AT';
|
53 |
+
const AU = 'AU';
|
54 |
+
const AW = 'AW';
|
55 |
+
const AX = 'AX';
|
56 |
+
const AZ = 'AZ';
|
57 |
+
const BA = 'BA';
|
58 |
+
const BB = 'BB';
|
59 |
+
const BD = 'BD';
|
60 |
+
const BE = 'BE';
|
61 |
+
const BF = 'BF';
|
62 |
+
const BG = 'BG';
|
63 |
+
const BH = 'BH';
|
64 |
+
const BI = 'BI';
|
65 |
+
const BJ = 'BJ';
|
66 |
+
const BL = 'BL';
|
67 |
+
const BM = 'BM';
|
68 |
+
const BN = 'BN';
|
69 |
+
const BO = 'BO';
|
70 |
+
const BQ = 'BQ';
|
71 |
+
const BR = 'BR';
|
72 |
+
const BS = 'BS';
|
73 |
+
const BT = 'BT';
|
74 |
+
const BV = 'BV';
|
75 |
+
const BW = 'BW';
|
76 |
+
const BY = 'BY';
|
77 |
+
const BZ = 'BZ';
|
78 |
+
const CA = 'CA';
|
79 |
+
const CC = 'CC';
|
80 |
+
const CD = 'CD';
|
81 |
+
const CF = 'CF';
|
82 |
+
const CG = 'CG';
|
83 |
+
const CH = 'CH';
|
84 |
+
const CI = 'CI';
|
85 |
+
const CK = 'CK';
|
86 |
+
const CL = 'CL';
|
87 |
+
const CM = 'CM';
|
88 |
+
const CN = 'CN';
|
89 |
+
const CO = 'CO';
|
90 |
+
const CR = 'CR';
|
91 |
+
const CU = 'CU';
|
92 |
+
const CV = 'CV';
|
93 |
+
const CW = 'CW';
|
94 |
+
const CX = 'CX';
|
95 |
+
const CY = 'CY';
|
96 |
+
const CZ = 'CZ';
|
97 |
+
const DE = 'DE';
|
98 |
+
const DJ = 'DJ';
|
99 |
+
const DK = 'DK';
|
100 |
+
const DM = 'DM';
|
101 |
+
const VALUE_DO = 'DO';
|
102 |
+
const DZ = 'DZ';
|
103 |
+
const EC = 'EC';
|
104 |
+
const EE = 'EE';
|
105 |
+
const EG = 'EG';
|
106 |
+
const EH = 'EH';
|
107 |
+
const ER = 'ER';
|
108 |
+
const ES = 'ES';
|
109 |
+
const ET = 'ET';
|
110 |
+
const FI = 'FI';
|
111 |
+
const FJ = 'FJ';
|
112 |
+
const FK = 'FK';
|
113 |
+
const FM = 'FM';
|
114 |
+
const FO = 'FO';
|
115 |
+
const FR = 'FR';
|
116 |
+
const GA = 'GA';
|
117 |
+
const GB = 'GB';
|
118 |
+
const GD = 'GD';
|
119 |
+
const GE = 'GE';
|
120 |
+
const GF = 'GF';
|
121 |
+
const GG = 'GG';
|
122 |
+
const GH = 'GH';
|
123 |
+
const GI = 'GI';
|
124 |
+
const GL = 'GL';
|
125 |
+
const GM = 'GM';
|
126 |
+
const GN = 'GN';
|
127 |
+
const GP = 'GP';
|
128 |
+
const GQ = 'GQ';
|
129 |
+
const GR = 'GR';
|
130 |
+
const GS = 'GS';
|
131 |
+
const GT = 'GT';
|
132 |
+
const GU = 'GU';
|
133 |
+
const GW = 'GW';
|
134 |
+
const GY = 'GY';
|
135 |
+
const HK = 'HK';
|
136 |
+
const HM = 'HM';
|
137 |
+
const HN = 'HN';
|
138 |
+
const HR = 'HR';
|
139 |
+
const HT = 'HT';
|
140 |
+
const HU = 'HU';
|
141 |
+
const ID = 'ID';
|
142 |
+
const IE = 'IE';
|
143 |
+
const IL = 'IL';
|
144 |
+
const IM = 'IM';
|
145 |
+
const IN = 'IN';
|
146 |
+
const IO = 'IO';
|
147 |
+
const IQ = 'IQ';
|
148 |
+
const IR = 'IR';
|
149 |
+
const IS = 'IS';
|
150 |
+
const IT = 'IT';
|
151 |
+
const JE = 'JE';
|
152 |
+
const JM = 'JM';
|
153 |
+
const JO = 'JO';
|
154 |
+
const JP = 'JP';
|
155 |
+
const KE = 'KE';
|
156 |
+
const KG = 'KG';
|
157 |
+
const KH = 'KH';
|
158 |
+
const KI = 'KI';
|
159 |
+
const KM = 'KM';
|
160 |
+
const KN = 'KN';
|
161 |
+
const KP = 'KP';
|
162 |
+
const KR = 'KR';
|
163 |
+
const KW = 'KW';
|
164 |
+
const KY = 'KY';
|
165 |
+
const KZ = 'KZ';
|
166 |
+
const LA = 'LA';
|
167 |
+
const LB = 'LB';
|
168 |
+
const LC = 'LC';
|
169 |
+
const LI = 'LI';
|
170 |
+
const LK = 'LK';
|
171 |
+
const LR = 'LR';
|
172 |
+
const LS = 'LS';
|
173 |
+
const LT = 'LT';
|
174 |
+
const LU = 'LU';
|
175 |
+
const LV = 'LV';
|
176 |
+
const LY = 'LY';
|
177 |
+
const MA = 'MA';
|
178 |
+
const MC = 'MC';
|
179 |
+
const MD = 'MD';
|
180 |
+
const ME = 'ME';
|
181 |
+
const MF = 'MF';
|
182 |
+
const MG = 'MG';
|
183 |
+
const MH = 'MH';
|
184 |
+
const MK = 'MK';
|
185 |
+
const ML = 'ML';
|
186 |
+
const MM = 'MM';
|
187 |
+
const MN = 'MN';
|
188 |
+
const MO = 'MO';
|
189 |
+
const MP = 'MP';
|
190 |
+
const MQ = 'MQ';
|
191 |
+
const MR = 'MR';
|
192 |
+
const MS = 'MS';
|
193 |
+
const MT = 'MT';
|
194 |
+
const MU = 'MU';
|
195 |
+
const MV = 'MV';
|
196 |
+
const MW = 'MW';
|
197 |
+
const MX = 'MX';
|
198 |
+
const MY = 'MY';
|
199 |
+
const MZ = 'MZ';
|
200 |
+
const NA = 'NA';
|
201 |
+
const NC = 'NC';
|
202 |
+
const NE = 'NE';
|
203 |
+
const NF = 'NF';
|
204 |
+
const NG = 'NG';
|
205 |
+
const NI = 'NI';
|
206 |
+
const NL = 'NL';
|
207 |
+
const NO = 'NO';
|
208 |
+
const NP = 'NP';
|
209 |
+
const NR = 'NR';
|
210 |
+
const NU = 'NU';
|
211 |
+
const NZ = 'NZ';
|
212 |
+
const OM = 'OM';
|
213 |
+
const PA = 'PA';
|
214 |
+
const PE = 'PE';
|
215 |
+
const PF = 'PF';
|
216 |
+
const PG = 'PG';
|
217 |
+
const PH = 'PH';
|
218 |
+
const PK = 'PK';
|
219 |
+
const PL = 'PL';
|
220 |
+
const PM = 'PM';
|
221 |
+
const PN = 'PN';
|
222 |
+
const PR = 'PR';
|
223 |
+
const PS = 'PS';
|
224 |
+
const PT = 'PT';
|
225 |
+
const PW = 'PW';
|
226 |
+
const PY = 'PY';
|
227 |
+
const QA = 'QA';
|
228 |
+
const RE = 'RE';
|
229 |
+
const RO = 'RO';
|
230 |
+
const RS = 'RS';
|
231 |
+
const RU = 'RU';
|
232 |
+
const RW = 'RW';
|
233 |
+
const SA = 'SA';
|
234 |
+
const SB = 'SB';
|
235 |
+
const SC = 'SC';
|
236 |
+
const SD = 'SD';
|
237 |
+
const SE = 'SE';
|
238 |
+
const SG = 'SG';
|
239 |
+
const SH = 'SH';
|
240 |
+
const SI = 'SI';
|
241 |
+
const SJ = 'SJ';
|
242 |
+
const SK = 'SK';
|
243 |
+
const SL = 'SL';
|
244 |
+
const SM = 'SM';
|
245 |
+
const SN = 'SN';
|
246 |
+
const SO = 'SO';
|
247 |
+
const SR = 'SR';
|
248 |
+
const SS = 'SS';
|
249 |
+
const ST = 'ST';
|
250 |
+
const SV = 'SV';
|
251 |
+
const SX = 'SX';
|
252 |
+
const SY = 'SY';
|
253 |
+
const SZ = 'SZ';
|
254 |
+
const TC = 'TC';
|
255 |
+
const TD = 'TD';
|
256 |
+
const TF = 'TF';
|
257 |
+
const TG = 'TG';
|
258 |
+
const TH = 'TH';
|
259 |
+
const TJ = 'TJ';
|
260 |
+
const TK = 'TK';
|
261 |
+
const TL = 'TL';
|
262 |
+
const TM = 'TM';
|
263 |
+
const TN = 'TN';
|
264 |
+
const TO = 'TO';
|
265 |
+
const TR = 'TR';
|
266 |
+
const TT = 'TT';
|
267 |
+
const TV = 'TV';
|
268 |
+
const TW = 'TW';
|
269 |
+
const TZ = 'TZ';
|
270 |
+
const UA = 'UA';
|
271 |
+
const UG = 'UG';
|
272 |
+
const UM = 'UM';
|
273 |
+
const US = 'US';
|
274 |
+
const UY = 'UY';
|
275 |
+
const UZ = 'UZ';
|
276 |
+
const VA = 'VA';
|
277 |
+
const VC = 'VC';
|
278 |
+
const VE = 'VE';
|
279 |
+
const VG = 'VG';
|
280 |
+
const VI = 'VI';
|
281 |
+
const VN = 'VN';
|
282 |
+
const VU = 'VU';
|
283 |
+
const WF = 'WF';
|
284 |
+
const WS = 'WS';
|
285 |
+
const XK = 'XK';
|
286 |
+
const YE = 'YE';
|
287 |
+
const YT = 'YT';
|
288 |
+
const ZA = 'ZA';
|
289 |
+
const ZM = 'ZM';
|
290 |
+
const ZW = 'ZW';
|
291 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CampaignSpecialAdCategoryValues.php
CHANGED
@@ -40,5 +40,6 @@ class CampaignSpecialAdCategoryValues extends AbstractEnum {
|
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
|
|
43 |
const NONE = 'NONE';
|
44 |
}
|
40 |
const CREDIT = 'CREDIT';
|
41 |
const EMPLOYMENT = 'EMPLOYMENT';
|
42 |
const HOUSING = 'HOUSING';
|
43 |
+
const ISSUES_ELECTIONS_POLITICS = 'ISSUES_ELECTIONS_POLITICS';
|
44 |
const NONE = 'NONE';
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CommerceMerchantSettingsCtaValues.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Values;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
* @method static CommerceMerchantSettingsCtaValues getInstance()
|
37 |
+
*/
|
38 |
+
class CommerceMerchantSettingsCtaValues extends AbstractEnum {
|
39 |
+
|
40 |
+
const CONTACT_MERCHANT = 'CONTACT_MERCHANT';
|
41 |
+
const OFFSITE_LINK = 'OFFSITE_LINK';
|
42 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/CustomAudienceDataSourceSubTypeValues.php
CHANGED
@@ -79,6 +79,7 @@ class CustomAudienceDataSourceSubTypeValues extends AbstractEnum {
|
|
79 |
const PLATFORM = 'PLATFORM';
|
80 |
const PLATFORM_USERS = 'PLATFORM_USERS';
|
81 |
const SEED_LIST = 'SEED_LIST';
|
|
|
82 |
const SMART_AUDIENCE = 'SMART_AUDIENCE';
|
83 |
const STORE_VISIT_EVENTS = 'STORE_VISIT_EVENTS';
|
84 |
const S_EXPR = 'S_EXPR';
|
79 |
const PLATFORM = 'PLATFORM';
|
80 |
const PLATFORM_USERS = 'PLATFORM_USERS';
|
81 |
const SEED_LIST = 'SEED_LIST';
|
82 |
+
const SIGNAL_SOURCE = 'SIGNAL_SOURCE';
|
83 |
const SMART_AUDIENCE = 'SMART_AUDIENCE';
|
84 |
const STORE_VISIT_EVENTS = 'STORE_VISIT_EVENTS';
|
85 |
const S_EXPR = 'S_EXPR';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/DACheckConnectionMethodValues.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Values;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
* @method static DACheckConnectionMethodValues getInstance()
|
37 |
+
*/
|
38 |
+
class DACheckConnectionMethodValues extends AbstractEnum {
|
39 |
+
|
40 |
+
const ALL = 'ALL';
|
41 |
+
const APP = 'APP';
|
42 |
+
const BROWSER = 'BROWSER';
|
43 |
+
const SERVER = 'SERVER';
|
44 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PageSettingTypeValues.php → EventOnlineEventFormatValues.php}
RENAMED
@@ -33,13 +33,13 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
43 |
-
const
|
44 |
-
const
|
45 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static EventOnlineEventFormatValues getInstance()
|
37 |
*/
|
38 |
+
class EventOnlineEventFormatValues extends AbstractEnum {
|
39 |
|
40 |
+
const FB_LIVE = 'fb_live';
|
41 |
+
const MESSENGER_ROOM = 'messenger_room';
|
42 |
+
const NONE = 'none';
|
43 |
+
const OTHER = 'other';
|
44 |
+
const THIRD_PARTY = 'third_party';
|
45 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/EventTypeValues.php
CHANGED
@@ -38,6 +38,7 @@ use FacebookAds\Enum\AbstractEnum;
|
|
38 |
class EventTypeValues extends AbstractEnum {
|
39 |
|
40 |
const COMMUNITY = 'community';
|
|
|
41 |
const GROUP = 'group';
|
42 |
const VALUE_PRIVATE = 'private';
|
43 |
const VALUE_PUBLIC = 'public';
|
38 |
class EventTypeValues extends AbstractEnum {
|
39 |
|
40 |
const COMMUNITY = 'community';
|
41 |
+
const FRIENDS = 'friends';
|
42 |
const GROUP = 'group';
|
43 |
const VALUE_PRIVATE = 'private';
|
44 |
const VALUE_PUBLIC = 'public';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/GroupGroupTypeValues.php
CHANGED
@@ -71,6 +71,7 @@ class GroupGroupTypeValues extends AbstractEnum {
|
|
71 |
const STUDY_GROUP = 'STUDY_GROUP';
|
72 |
const SUPPORT = 'SUPPORT';
|
73 |
const TEAMMATES = 'TEAMMATES';
|
|
|
74 |
const TRAVEL_PLANNING = 'TRAVEL_PLANNING';
|
75 |
const WORK_ANNOUNCEMENT = 'WORK_ANNOUNCEMENT';
|
76 |
const WORK_DEMO_GROUP = 'WORK_DEMO_GROUP';
|
@@ -78,10 +79,12 @@ class GroupGroupTypeValues extends AbstractEnum {
|
|
78 |
const WORK_EPHEMERAL = 'WORK_EPHEMERAL';
|
79 |
const WORK_FEEDBACK = 'WORK_FEEDBACK';
|
80 |
const WORK_FOR_SALE = 'WORK_FOR_SALE';
|
|
|
81 |
const WORK_LEARNING = 'WORK_LEARNING';
|
82 |
const WORK_MENTORSHIP = 'WORK_MENTORSHIP';
|
83 |
const WORK_MULTI_COMPANY = 'WORK_MULTI_COMPANY';
|
84 |
const WORK_RECRUITING = 'WORK_RECRUITING';
|
|
|
85 |
const WORK_SOCIAL = 'WORK_SOCIAL';
|
86 |
const WORK_TEAM = 'WORK_TEAM';
|
87 |
const WORK_TEAMWORK = 'WORK_TEAMWORK';
|
71 |
const STUDY_GROUP = 'STUDY_GROUP';
|
72 |
const SUPPORT = 'SUPPORT';
|
73 |
const TEAMMATES = 'TEAMMATES';
|
74 |
+
const THEME = 'THEME';
|
75 |
const TRAVEL_PLANNING = 'TRAVEL_PLANNING';
|
76 |
const WORK_ANNOUNCEMENT = 'WORK_ANNOUNCEMENT';
|
77 |
const WORK_DEMO_GROUP = 'WORK_DEMO_GROUP';
|
79 |
const WORK_EPHEMERAL = 'WORK_EPHEMERAL';
|
80 |
const WORK_FEEDBACK = 'WORK_FEEDBACK';
|
81 |
const WORK_FOR_SALE = 'WORK_FOR_SALE';
|
82 |
+
const WORK_GARDEN = 'WORK_GARDEN';
|
83 |
const WORK_LEARNING = 'WORK_LEARNING';
|
84 |
const WORK_MENTORSHIP = 'WORK_MENTORSHIP';
|
85 |
const WORK_MULTI_COMPANY = 'WORK_MULTI_COMPANY';
|
86 |
const WORK_RECRUITING = 'WORK_RECRUITING';
|
87 |
+
const WORK_RESUME_REVIEW = 'WORK_RESUME_REVIEW';
|
88 |
const WORK_SOCIAL = 'WORK_SOCIAL';
|
89 |
const WORK_TEAM = 'WORK_TEAM';
|
90 |
const WORK_TEAMWORK = 'WORK_TEAMWORK';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/GroupPurposeValues.php
CHANGED
@@ -71,6 +71,7 @@ class GroupPurposeValues extends AbstractEnum {
|
|
71 |
const STUDY_GROUP = 'STUDY_GROUP';
|
72 |
const SUPPORT = 'SUPPORT';
|
73 |
const TEAMMATES = 'TEAMMATES';
|
|
|
74 |
const TRAVEL_PLANNING = 'TRAVEL_PLANNING';
|
75 |
const WORK_ANNOUNCEMENT = 'WORK_ANNOUNCEMENT';
|
76 |
const WORK_DEMO_GROUP = 'WORK_DEMO_GROUP';
|
@@ -78,10 +79,12 @@ class GroupPurposeValues extends AbstractEnum {
|
|
78 |
const WORK_EPHEMERAL = 'WORK_EPHEMERAL';
|
79 |
const WORK_FEEDBACK = 'WORK_FEEDBACK';
|
80 |
const WORK_FOR_SALE = 'WORK_FOR_SALE';
|
|
|
81 |
const WORK_LEARNING = 'WORK_LEARNING';
|
82 |
const WORK_MENTORSHIP = 'WORK_MENTORSHIP';
|
83 |
const WORK_MULTI_COMPANY = 'WORK_MULTI_COMPANY';
|
84 |
const WORK_RECRUITING = 'WORK_RECRUITING';
|
|
|
85 |
const WORK_SOCIAL = 'WORK_SOCIAL';
|
86 |
const WORK_TEAM = 'WORK_TEAM';
|
87 |
const WORK_TEAMWORK = 'WORK_TEAMWORK';
|
71 |
const STUDY_GROUP = 'STUDY_GROUP';
|
72 |
const SUPPORT = 'SUPPORT';
|
73 |
const TEAMMATES = 'TEAMMATES';
|
74 |
+
const THEME = 'THEME';
|
75 |
const TRAVEL_PLANNING = 'TRAVEL_PLANNING';
|
76 |
const WORK_ANNOUNCEMENT = 'WORK_ANNOUNCEMENT';
|
77 |
const WORK_DEMO_GROUP = 'WORK_DEMO_GROUP';
|
79 |
const WORK_EPHEMERAL = 'WORK_EPHEMERAL';
|
80 |
const WORK_FEEDBACK = 'WORK_FEEDBACK';
|
81 |
const WORK_FOR_SALE = 'WORK_FOR_SALE';
|
82 |
+
const WORK_GARDEN = 'WORK_GARDEN';
|
83 |
const WORK_LEARNING = 'WORK_LEARNING';
|
84 |
const WORK_MENTORSHIP = 'WORK_MENTORSHIP';
|
85 |
const WORK_MULTI_COMPANY = 'WORK_MULTI_COMPANY';
|
86 |
const WORK_RECRUITING = 'WORK_RECRUITING';
|
87 |
+
const WORK_RESUME_REVIEW = 'WORK_RESUME_REVIEW';
|
88 |
const WORK_SOCIAL = 'WORK_SOCIAL';
|
89 |
const WORK_TEAM = 'WORK_TEAM';
|
90 |
const WORK_TEAMWORK = 'WORK_TEAMWORK';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/LiveVideoBroadcastStatusValues.php
CHANGED
@@ -37,13 +37,13 @@ use FacebookAds\Enum\AbstractEnum;
|
|
37 |
*/
|
38 |
class LiveVideoBroadcastStatusValues extends AbstractEnum {
|
39 |
|
40 |
-
const LIVE = '
|
41 |
-
const LIVE_STOPPED = '
|
42 |
-
const PROCESSING = '
|
43 |
-
const SCHEDULED_CANCELED = '
|
44 |
-
const SCHEDULED_EXPIRED = '
|
45 |
-
const SCHEDULED_LIVE = '
|
46 |
-
const SCHEDULED_UNPUBLISHED = '
|
47 |
-
const UNPUBLISHED = '
|
48 |
-
const VOD = '
|
49 |
}
|
37 |
*/
|
38 |
class LiveVideoBroadcastStatusValues extends AbstractEnum {
|
39 |
|
40 |
+
const LIVE = 'live';
|
41 |
+
const LIVE_STOPPED = 'live_stopped';
|
42 |
+
const PROCESSING = 'processing';
|
43 |
+
const SCHEDULED_CANCELED = 'scheduled_canceled';
|
44 |
+
const SCHEDULED_EXPIRED = 'scheduled_expired';
|
45 |
+
const SCHEDULED_LIVE = 'scheduled_live';
|
46 |
+
const SCHEDULED_UNPUBLISHED = 'scheduled_unpublished';
|
47 |
+
const UNPUBLISHED = 'unpublished';
|
48 |
+
const VOD = 'vod';
|
49 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageCallToActionAndroidDestinationTypeValues.php
CHANGED
@@ -42,6 +42,7 @@ class PageCallToActionAndroidDestinationTypeValues extends AbstractEnum {
|
|
42 |
const EMAIL = 'EMAIL';
|
43 |
const FACEBOOK_APP = 'FACEBOOK_APP';
|
44 |
const FOLLOW = 'FOLLOW';
|
|
|
45 |
const MESSENGER = 'MESSENGER';
|
46 |
const MINI_SHOP = 'MINI_SHOP';
|
47 |
const NONE = 'NONE';
|
42 |
const EMAIL = 'EMAIL';
|
43 |
const FACEBOOK_APP = 'FACEBOOK_APP';
|
44 |
const FOLLOW = 'FOLLOW';
|
45 |
+
const MARKETPLACE_INVENTORY_PAGE = 'MARKETPLACE_INVENTORY_PAGE';
|
46 |
const MESSENGER = 'MESSENGER';
|
47 |
const MINI_SHOP = 'MINI_SHOP';
|
48 |
const NONE = 'NONE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageCallToActionIphoneDestinationTypeValues.php
CHANGED
@@ -42,6 +42,7 @@ class PageCallToActionIphoneDestinationTypeValues extends AbstractEnum {
|
|
42 |
const EMAIL = 'EMAIL';
|
43 |
const FACEBOOK_APP = 'FACEBOOK_APP';
|
44 |
const FOLLOW = 'FOLLOW';
|
|
|
45 |
const MESSENGER = 'MESSENGER';
|
46 |
const MINI_SHOP = 'MINI_SHOP';
|
47 |
const NONE = 'NONE';
|
42 |
const EMAIL = 'EMAIL';
|
43 |
const FACEBOOK_APP = 'FACEBOOK_APP';
|
44 |
const FOLLOW = 'FOLLOW';
|
45 |
+
const MARKETPLACE_INVENTORY_PAGE = 'MARKETPLACE_INVENTORY_PAGE';
|
46 |
const MESSENGER = 'MESSENGER';
|
47 |
const MINI_SHOP = 'MINI_SHOP';
|
48 |
const NONE = 'NONE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageCallToActionTypeValues.php
CHANGED
@@ -65,6 +65,7 @@ class PageCallToActionTypeValues extends AbstractEnum {
|
|
65 |
const SHOP_NOW = 'SHOP_NOW';
|
66 |
const SHOP_ON_FACEBOOK = 'SHOP_ON_FACEBOOK';
|
67 |
const SIGN_UP = 'SIGN_UP';
|
|
|
68 |
const VIEW_SHOP = 'VIEW_SHOP';
|
69 |
const VISIT_GROUP = 'VISIT_GROUP';
|
70 |
const WATCH_NOW = 'WATCH_NOW';
|
65 |
const SHOP_NOW = 'SHOP_NOW';
|
66 |
const SHOP_ON_FACEBOOK = 'SHOP_ON_FACEBOOK';
|
67 |
const SIGN_UP = 'SIGN_UP';
|
68 |
+
const VIEW_INVENTORY = 'VIEW_INVENTORY';
|
69 |
const VIEW_SHOP = 'VIEW_SHOP';
|
70 |
const VISIT_GROUP = 'VISIT_GROUP';
|
71 |
const WATCH_NOW = 'WATCH_NOW';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PagePermittedTasksValues.php
CHANGED
@@ -44,6 +44,7 @@ class PagePermittedTasksValues extends AbstractEnum {
|
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
|
|
47 |
const MODERATE = 'MODERATE';
|
48 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
49 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
@@ -51,6 +52,7 @@ class PagePermittedTasksValues extends AbstractEnum {
|
|
51 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
52 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
53 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
|
|
54 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
55 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
56 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
47 |
+
const MESSAGING = 'MESSAGING';
|
48 |
const MODERATE = 'MODERATE';
|
49 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
50 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
52 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
53 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
54 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
55 |
+
const PROFILE_PLUS_LIVE_STREAM_MODERATION = 'PROFILE_PLUS_LIVE_STREAM_MODERATION';
|
56 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
57 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
58 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PagePickupOptionsValues.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Values;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
* @method static PagePickupOptionsValues getInstance()
|
37 |
+
*/
|
38 |
+
class PagePickupOptionsValues extends AbstractEnum {
|
39 |
+
|
40 |
+
const CURBSIDE = 'CURBSIDE';
|
41 |
+
const IN_STORE = 'IN_STORE';
|
42 |
+
const OTHER = 'OTHER';
|
43 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageSubscribedFieldsValues.php
CHANGED
@@ -45,7 +45,6 @@ class PageSubscribedFieldsValues extends AbstractEnum {
|
|
45 |
const BRANDED_CAMERA = 'branded_camera';
|
46 |
const CATEGORY = 'category';
|
47 |
const CHECKINS = 'checkins';
|
48 |
-
const COMMERCE_ORDER = 'commerce_order';
|
49 |
const COMPANY_OVERVIEW = 'company_overview';
|
50 |
const CONVERSATIONS = 'conversations';
|
51 |
const CULINARY_TEAM = 'culinary_team';
|
@@ -81,6 +80,7 @@ class PageSubscribedFieldsValues extends AbstractEnum {
|
|
81 |
const MESSAGING_CHECKOUT_UPDATES = 'messaging_checkout_updates';
|
82 |
const MESSAGING_DIRECT_SENDS = 'messaging_direct_sends';
|
83 |
const MESSAGING_FBLOGIN_ACCOUNT_LINKING = 'messaging_fblogin_account_linking';
|
|
|
84 |
const MESSAGING_GAME_PLAYS = 'messaging_game_plays';
|
85 |
const MESSAGING_HANDOVERS = 'messaging_handovers';
|
86 |
const MESSAGING_OPTINS = 'messaging_optins';
|
45 |
const BRANDED_CAMERA = 'branded_camera';
|
46 |
const CATEGORY = 'category';
|
47 |
const CHECKINS = 'checkins';
|
|
|
48 |
const COMPANY_OVERVIEW = 'company_overview';
|
49 |
const CONVERSATIONS = 'conversations';
|
50 |
const CULINARY_TEAM = 'culinary_team';
|
80 |
const MESSAGING_CHECKOUT_UPDATES = 'messaging_checkout_updates';
|
81 |
const MESSAGING_DIRECT_SENDS = 'messaging_direct_sends';
|
82 |
const MESSAGING_FBLOGIN_ACCOUNT_LINKING = 'messaging_fblogin_account_linking';
|
83 |
+
const MESSAGING_FEEDBACK = 'messaging_feedback';
|
84 |
const MESSAGING_GAME_PLAYS = 'messaging_game_plays';
|
85 |
const MESSAGING_HANDOVERS = 'messaging_handovers';
|
86 |
const MESSAGING_OPTINS = 'messaging_optins';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/PageTasksValues.php
CHANGED
@@ -44,6 +44,7 @@ class PageTasksValues extends AbstractEnum {
|
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
|
|
47 |
const MODERATE = 'MODERATE';
|
48 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
49 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
@@ -51,6 +52,7 @@ class PageTasksValues extends AbstractEnum {
|
|
51 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
52 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
53 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
|
|
54 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
55 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
56 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
44 |
const MANAGE = 'MANAGE';
|
45 |
const MANAGE_JOBS = 'MANAGE_JOBS';
|
46 |
const MANAGE_LEADS = 'MANAGE_LEADS';
|
47 |
+
const MESSAGING = 'MESSAGING';
|
48 |
const MODERATE = 'MODERATE';
|
49 |
const MODERATE_COMMUNITY = 'MODERATE_COMMUNITY';
|
50 |
const PAGES_MESSAGING = 'PAGES_MESSAGING';
|
52 |
const PROFILE_PLUS_ADVERTISE = 'PROFILE_PLUS_ADVERTISE';
|
53 |
const PROFILE_PLUS_ANALYZE = 'PROFILE_PLUS_ANALYZE';
|
54 |
const PROFILE_PLUS_CREATE_CONTENT = 'PROFILE_PLUS_CREATE_CONTENT';
|
55 |
+
const PROFILE_PLUS_LIVE_STREAM_MODERATION = 'PROFILE_PLUS_LIVE_STREAM_MODERATION';
|
56 |
const PROFILE_PLUS_MANAGE = 'PROFILE_PLUS_MANAGE';
|
57 |
const PROFILE_PLUS_MESSAGING = 'PROFILE_PLUS_MESSAGING';
|
58 |
const PROFILE_PLUS_MODERATE = 'PROFILE_PLUS_MODERATE';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{BusinessCreativeFolderSharingAgreementRequestStatusValues.php → ProductCatalogItemSubTypeValues.php}
RENAMED
@@ -33,13 +33,34 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
43 |
-
const
|
44 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static ProductCatalogItemSubTypeValues getInstance()
|
37 |
*/
|
38 |
+
class ProductCatalogItemSubTypeValues extends AbstractEnum {
|
39 |
|
40 |
+
const APPLIANCES = 'APPLIANCES';
|
41 |
+
const BABY_FEEDING = 'BABY_FEEDING';
|
42 |
+
const BABY_TRANSPORT = 'BABY_TRANSPORT';
|
43 |
+
const BEAUTY = 'BEAUTY';
|
44 |
+
const BEDDING = 'BEDDING';
|
45 |
+
const CAMERAS = 'CAMERAS';
|
46 |
+
const CELL_PHONES_AND_SMART_WATCHES = 'CELL_PHONES_AND_SMART_WATCHES';
|
47 |
+
const CLEANING_SUPPLIES = 'CLEANING_SUPPLIES';
|
48 |
+
const CLOTHING = 'CLOTHING';
|
49 |
+
const CLOTHING_ACCESSORIES = 'CLOTHING_ACCESSORIES';
|
50 |
+
const COMPUTERS_AND_TABLETS = 'COMPUTERS_AND_TABLETS';
|
51 |
+
const DIAPERING_AND_POTTY_TRAINING = 'DIAPERING_AND_POTTY_TRAINING';
|
52 |
+
const ELECTRONICS_ACCESSORIES = 'ELECTRONICS_ACCESSORIES';
|
53 |
+
const FURNITURE = 'FURNITURE';
|
54 |
+
const HEALTH = 'HEALTH';
|
55 |
+
const HOME_GOODS = 'HOME_GOODS';
|
56 |
+
const JEWELRY = 'JEWELRY';
|
57 |
+
const NURSERY = 'NURSERY';
|
58 |
+
const PRINTERS_AND_SCANNERS = 'PRINTERS_AND_SCANNERS';
|
59 |
+
const PROJECTORS = 'PROJECTORS';
|
60 |
+
const SHOES_AND_FOOTWEAR = 'SHOES_AND_FOOTWEAR';
|
61 |
+
const SOFTWARE = 'SOFTWARE';
|
62 |
+
const TOYS = 'TOYS';
|
63 |
+
const TVS_AND_MONITORS = 'TVS_AND_MONITORS';
|
64 |
+
const VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES = 'VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES';
|
65 |
+
const WATCHES = 'WATCHES';
|
66 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductCatalogPermittedTasksValues.php
CHANGED
@@ -39,4 +39,5 @@ class ProductCatalogPermittedTasksValues extends AbstractEnum {
|
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const MANAGE = 'MANAGE';
|
|
|
42 |
}
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const MANAGE = 'MANAGE';
|
42 |
+
const MANAGE_AR = 'MANAGE_AR';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductCatalogTasksValues.php
CHANGED
@@ -39,4 +39,5 @@ class ProductCatalogTasksValues extends AbstractEnum {
|
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const MANAGE = 'MANAGE';
|
|
|
42 |
}
|
39 |
|
40 |
const ADVERTISE = 'ADVERTISE';
|
41 |
const MANAGE = 'MANAGE';
|
42 |
+
const MANAGE_AR = 'MANAGE_AR';
|
43 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductCatalogVerticalValues.php
CHANGED
@@ -37,6 +37,7 @@ use FacebookAds\Enum\AbstractEnum;
|
|
37 |
*/
|
38 |
class ProductCatalogVerticalValues extends AbstractEnum {
|
39 |
|
|
|
40 |
const BOOKABLE = 'bookable';
|
41 |
const COMMERCE = 'commerce';
|
42 |
const DESTINATIONS = 'destinations';
|
37 |
*/
|
38 |
class ProductCatalogVerticalValues extends AbstractEnum {
|
39 |
|
40 |
+
const ADOPTABLE_PETS = 'adoptable_pets';
|
41 |
const BOOKABLE = 'bookable';
|
42 |
const COMMERCE = 'commerce';
|
43 |
const DESTINATIONS = 'destinations';
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/ProductFeedFeedTypeValues.php
CHANGED
@@ -48,6 +48,7 @@ class ProductFeedFeedTypeValues extends AbstractEnum {
|
|
48 |
const MEDIA_TITLE = 'MEDIA_TITLE';
|
49 |
const OFFER = 'OFFER';
|
50 |
const PRODUCTS = 'PRODUCTS';
|
|
|
51 |
const VEHICLES = 'VEHICLES';
|
52 |
const VEHICLE_OFFER = 'VEHICLE_OFFER';
|
53 |
}
|
48 |
const MEDIA_TITLE = 'MEDIA_TITLE';
|
49 |
const OFFER = 'OFFER';
|
50 |
const PRODUCTS = 'PRODUCTS';
|
51 |
+
const TRANSACTABLE_ITEMS = 'TRANSACTABLE_ITEMS';
|
52 |
const VEHICLES = 'VEHICLES';
|
53 |
const VEHICLE_OFFER = 'VEHICLE_OFFER';
|
54 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{BusinessCreativeFolderPermittedTasksValues.php → ProductFeedItemSubTypeValues.php}
RENAMED
@@ -33,13 +33,34 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const
|
42 |
-
const
|
43 |
-
const
|
44 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static ProductFeedItemSubTypeValues getInstance()
|
37 |
*/
|
38 |
+
class ProductFeedItemSubTypeValues extends AbstractEnum {
|
39 |
|
40 |
+
const APPLIANCES = 'APPLIANCES';
|
41 |
+
const BABY_FEEDING = 'BABY_FEEDING';
|
42 |
+
const BABY_TRANSPORT = 'BABY_TRANSPORT';
|
43 |
+
const BEAUTY = 'BEAUTY';
|
44 |
+
const BEDDING = 'BEDDING';
|
45 |
+
const CAMERAS = 'CAMERAS';
|
46 |
+
const CELL_PHONES_AND_SMART_WATCHES = 'CELL_PHONES_AND_SMART_WATCHES';
|
47 |
+
const CLEANING_SUPPLIES = 'CLEANING_SUPPLIES';
|
48 |
+
const CLOTHING = 'CLOTHING';
|
49 |
+
const CLOTHING_ACCESSORIES = 'CLOTHING_ACCESSORIES';
|
50 |
+
const COMPUTERS_AND_TABLETS = 'COMPUTERS_AND_TABLETS';
|
51 |
+
const DIAPERING_AND_POTTY_TRAINING = 'DIAPERING_AND_POTTY_TRAINING';
|
52 |
+
const ELECTRONICS_ACCESSORIES = 'ELECTRONICS_ACCESSORIES';
|
53 |
+
const FURNITURE = 'FURNITURE';
|
54 |
+
const HEALTH = 'HEALTH';
|
55 |
+
const HOME_GOODS = 'HOME_GOODS';
|
56 |
+
const JEWELRY = 'JEWELRY';
|
57 |
+
const NURSERY = 'NURSERY';
|
58 |
+
const PRINTERS_AND_SCANNERS = 'PRINTERS_AND_SCANNERS';
|
59 |
+
const PROJECTORS = 'PROJECTORS';
|
60 |
+
const SHOES_AND_FOOTWEAR = 'SHOES_AND_FOOTWEAR';
|
61 |
+
const SOFTWARE = 'SOFTWARE';
|
62 |
+
const TOYS = 'TOYS';
|
63 |
+
const TVS_AND_MONITORS = 'TVS_AND_MONITORS';
|
64 |
+
const VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES = 'VIDEO_GAME_CONSOLES_AND_VIDEO_GAMES';
|
65 |
+
const WATCHES = 'WATCHES';
|
66 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/{PageThreadStateValues.php → ProfilePictureSourceBreakingChangeValues.php}
RENAMED
@@ -33,10 +33,9 @@ use FacebookAds\Enum\AbstractEnum;
|
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
-
* @method static
|
37 |
*/
|
38 |
-
class
|
39 |
|
40 |
-
const
|
41 |
-
const NEW_THREAD = 'NEW_THREAD';
|
42 |
}
|
33 |
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
* pull request for this class.
|
35 |
*
|
36 |
+
* @method static ProfilePictureSourceBreakingChangeValues getInstance()
|
37 |
*/
|
38 |
+
class ProfilePictureSourceBreakingChangeValues extends AbstractEnum {
|
39 |
|
40 |
+
const PROFILE_PICTURE = 'PROFILE_PICTURE';
|
|
|
41 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/SystemUserRoleValues.php
CHANGED
@@ -43,4 +43,13 @@ class SystemUserRoleValues extends AbstractEnum {
|
|
43 |
const EMPLOYEE = 'EMPLOYEE';
|
44 |
const FINANCE_ANALYST = 'FINANCE_ANALYST';
|
45 |
const FINANCE_EDITOR = 'FINANCE_EDITOR';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
43 |
const EMPLOYEE = 'EMPLOYEE';
|
44 |
const FINANCE_ANALYST = 'FINANCE_ANALYST';
|
45 |
const FINANCE_EDITOR = 'FINANCE_EDITOR';
|
46 |
+
const FINANCE_EDIT_TASK = 'FINANCE_EDIT_TASK';
|
47 |
+
const FINANCE_VIEW_TASK = 'FINANCE_VIEW_TASK';
|
48 |
+
const MODERATE_TASK = 'MODERATE_TASK';
|
49 |
+
const OPERATE_TASK = 'OPERATE_TASK';
|
50 |
+
const PARTNER_CENTER_ADMIN = 'PARTNER_CENTER_ADMIN';
|
51 |
+
const PARTNER_CENTER_ANALYST = 'PARTNER_CENTER_ANALYST';
|
52 |
+
const PARTNER_CENTER_EDUCATION = 'PARTNER_CENTER_EDUCATION';
|
53 |
+
const PARTNER_CENTER_MARKETING = 'PARTNER_CENTER_MARKETING';
|
54 |
+
const PARTNER_CENTER_OPERATIONS = 'PARTNER_CENTER_OPERATIONS';
|
55 |
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/WhatsAppBusinessAccountTasksValues.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAds\Object\Values;
|
26 |
+
|
27 |
+
use FacebookAds\Enum\AbstractEnum;
|
28 |
+
|
29 |
+
/**
|
30 |
+
* This class is auto-generated.
|
31 |
+
*
|
32 |
+
* For any issues or feature requests related to this class, please let us know
|
33 |
+
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
34 |
+
* pull request for this class.
|
35 |
+
*
|
36 |
+
* @method static WhatsAppBusinessAccountTasksValues getInstance()
|
37 |
+
*/
|
38 |
+
class WhatsAppBusinessAccountTasksValues extends AbstractEnum {
|
39 |
+
|
40 |
+
const DEVELOP = 'DEVELOP';
|
41 |
+
const MANAGE = 'MANAGE';
|
42 |
+
const MANAGE_PHONE = 'MANAGE_PHONE';
|
43 |
+
const MANAGE_TEMPLATES = 'MANAGE_TEMPLATES';
|
44 |
+
const VIEW_COST = 'VIEW_COST';
|
45 |
+
}
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/WhatsAppBusinessAccount.php
CHANGED
@@ -30,6 +30,7 @@ use FacebookAds\Http\RequestInterface;
|
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\WhatsAppBusinessAccountFields;
|
32 |
use FacebookAds\Object\Values\WhatsAppBusinessAccountCategoryValues;
|
|
|
33 |
|
34 |
/**
|
35 |
* This class is auto-generated.
|
@@ -51,11 +52,86 @@ class WhatsAppBusinessAccount extends AbstractCrudObject {
|
|
51 |
|
52 |
protected static function getReferencedEnums() {
|
53 |
$ref_enums = array();
|
|
|
54 |
$ref_enums['Category'] = WhatsAppBusinessAccountCategoryValues::getInstance()->getValues();
|
55 |
return $ref_enums;
|
56 |
}
|
57 |
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
public function deleteMessageTemplates(array $fields = array(), array $params = array(), $pending = false) {
|
60 |
$this->assureId();
|
61 |
|
30 |
use FacebookAds\TypeChecker;
|
31 |
use FacebookAds\Object\Fields\WhatsAppBusinessAccountFields;
|
32 |
use FacebookAds\Object\Values\WhatsAppBusinessAccountCategoryValues;
|
33 |
+
use FacebookAds\Object\Values\WhatsAppBusinessAccountTasksValues;
|
34 |
|
35 |
/**
|
36 |
* This class is auto-generated.
|
52 |
|
53 |
protected static function getReferencedEnums() {
|
54 |
$ref_enums = array();
|
55 |
+
$ref_enums['Tasks'] = WhatsAppBusinessAccountTasksValues::getInstance()->getValues();
|
56 |
$ref_enums['Category'] = WhatsAppBusinessAccountCategoryValues::getInstance()->getValues();
|
57 |
return $ref_enums;
|
58 |
}
|
59 |
|
60 |
|
61 |
+
public function deleteAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {
|
62 |
+
$this->assureId();
|
63 |
+
|
64 |
+
$param_types = array(
|
65 |
+
'user' => 'int',
|
66 |
+
);
|
67 |
+
$enums = array(
|
68 |
+
);
|
69 |
+
|
70 |
+
$request = new ApiRequest(
|
71 |
+
$this->api,
|
72 |
+
$this->data['id'],
|
73 |
+
RequestInterface::METHOD_DELETE,
|
74 |
+
'/assigned_users',
|
75 |
+
new AbstractCrudObject(),
|
76 |
+
'EDGE',
|
77 |
+
array(),
|
78 |
+
new TypeChecker($param_types, $enums)
|
79 |
+
);
|
80 |
+
$request->addParams($params);
|
81 |
+
$request->addFields($fields);
|
82 |
+
return $pending ? $request : $request->execute();
|
83 |
+
}
|
84 |
+
|
85 |
+
public function getAssignedUsers(array $fields = array(), array $params = array(), $pending = false) {
|
86 |
+
$this->assureId();
|
87 |
+
|
88 |
+
$param_types = array(
|
89 |
+
'business' => 'string',
|
90 |
+
);
|
91 |
+
$enums = array(
|
92 |
+
);
|
93 |
+
|
94 |
+
$request = new ApiRequest(
|
95 |
+
$this->api,
|
96 |
+
$this->data['id'],
|
97 |
+
RequestInterface::METHOD_GET,
|
98 |
+
'/assigned_users',
|
99 |
+
new AssignedUser(),
|
100 |
+
'EDGE',
|
101 |
+
AssignedUser::getFieldsEnum()->getValues(),
|
102 |
+
new TypeChecker($param_types, $enums)
|
103 |
+
);
|
104 |
+
$request->addParams($params);
|
105 |
+
$request->addFields($fields);
|
106 |
+
return $pending ? $request : $request->execute();
|
107 |
+
}
|
108 |
+
|
109 |
+
public function createAssignedUser(array $fields = array(), array $params = array(), $pending = false) {
|
110 |
+
$this->assureId();
|
111 |
+
|
112 |
+
$param_types = array(
|
113 |
+
'tasks' => 'list<tasks_enum>',
|
114 |
+
'user' => 'int',
|
115 |
+
);
|
116 |
+
$enums = array(
|
117 |
+
'tasks_enum' => WhatsAppBusinessAccountTasksValues::getInstance()->getValues(),
|
118 |
+
);
|
119 |
+
|
120 |
+
$request = new ApiRequest(
|
121 |
+
$this->api,
|
122 |
+
$this->data['id'],
|
123 |
+
RequestInterface::METHOD_POST,
|
124 |
+
'/assigned_users',
|
125 |
+
new WhatsAppBusinessAccount(),
|
126 |
+
'EDGE',
|
127 |
+
WhatsAppBusinessAccount::getFieldsEnum()->getValues(),
|
128 |
+
new TypeChecker($param_types, $enums)
|
129 |
+
);
|
130 |
+
$request->addParams($params);
|
131 |
+
$request->addFields($fields);
|
132 |
+
return $pending ? $request : $request->execute();
|
133 |
+
}
|
134 |
+
|
135 |
public function deleteMessageTemplates(array $fields = array(), array $params = array(), $pending = false) {
|
136 |
$this->assureId();
|
137 |
|
vendor/facebook/php-business-sdk/src/FacebookAds/Object/WhatsAppBusinessProfile.php
DELETED
@@ -1,104 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
4 |
-
*
|
5 |
-
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
-
* use, copy, modify, and distribute this software in source code or binary
|
7 |
-
* form for use in connection with the web services and APIs provided by
|
8 |
-
* Facebook.
|
9 |
-
*
|
10 |
-
* As with any software that integrates with the Facebook platform, your use
|
11 |
-
* of this software is subject to the Facebook Developer Principles and
|
12 |
-
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
-
* shall be included in all copies or substantial portions of the software.
|
14 |
-
*
|
15 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
-
* DEALINGS IN THE SOFTWARE.
|
22 |
-
*
|
23 |
-
*/
|
24 |
-
|
25 |
-
namespace FacebookAds\Object;
|
26 |
-
|
27 |
-
use FacebookAds\ApiRequest;
|
28 |
-
use FacebookAds\Cursor;
|
29 |
-
use FacebookAds\Http\RequestInterface;
|
30 |
-
use FacebookAds\TypeChecker;
|
31 |
-
use FacebookAds\Object\Fields\WhatsAppBusinessProfileFields;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* This class is auto-generated.
|
35 |
-
*
|
36 |
-
* For any issues or feature requests related to this class, please let us know
|
37 |
-
* on github and we'll fix in our codegen framework. We'll not be able to accept
|
38 |
-
* pull request for this class.
|
39 |
-
*
|
40 |
-
*/
|
41 |
-
|
42 |
-
class WhatsAppBusinessProfile extends AbstractCrudObject {
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @return WhatsAppBusinessProfileFields
|
46 |
-
*/
|
47 |
-
public static function getFieldsEnum() {
|
48 |
-
return WhatsAppBusinessProfileFields::getInstance();
|
49 |
-
}
|
50 |
-
|
51 |
-
protected static function getReferencedEnums() {
|
52 |
-
$ref_enums = array();
|
53 |
-
return $ref_enums;
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
|
58 |
-
$this->assureId();
|
59 |
-
|
60 |
-
$param_types = array(
|
61 |
-
);
|
62 |
-
$enums = array(
|
63 |
-
);
|
64 |
-
|
65 |
-
$request = new ApiRequest(
|
66 |
-
$this->api,
|
67 |
-
$this->data['id'],
|
68 |
-
RequestInterface::METHOD_GET,
|
69 |
-
'/',
|
70 |
-
new WhatsAppBusinessProfile(),
|
71 |
-
'NODE',
|
72 |
-
WhatsAppBusinessProfile::getFieldsEnum()->getValues(),
|
73 |
-
new TypeChecker($param_types, $enums)
|
74 |
-
);
|
75 |
-
$request->addParams($params);
|
76 |
-
$request->addFields($fields);
|
77 |
-
return $pending ? $request : $request->execute();
|
78 |
-
}
|
79 |
-
|
80 |
-
public function updateSelf(array $fields = array(), array $params = array(), $pending = false) {
|
81 |
-
$this->assureId();
|
82 |
-
|
83 |
-
$param_types = array(
|
84 |
-
'verified_name' => 'string',
|
85 |
-
);
|
86 |
-
$enums = array(
|
87 |
-
);
|
88 |
-
|
89 |
-
$request = new ApiRequest(
|
90 |
-
$this->api,
|
91 |
-
$this->data['id'],
|
92 |
-
RequestInterface::METHOD_POST,
|
93 |
-
'/',
|
94 |
-
new WhatsAppBusinessProfile(),
|
95 |
-
'NODE',
|
96 |
-
WhatsAppBusinessProfile::getFieldsEnum()->getValues(),
|
97 |
-
new TypeChecker($param_types, $enums)
|
98 |
-
);
|
99 |
-
$request->addParams($params);
|
100 |
-
$request->addFields($fields);
|
101 |
-
return $pending ? $request : $request->execute();
|
102 |
-
}
|
103 |
-
|
104 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/facebook/php-business-sdk/test/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
/report
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/AsyncClientTest.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAdsTest\AbstractUnitTestCase;
|
28 |
+
use FacebookAds\Object\ServerSide\AsyncClient;
|
29 |
+
use FacebookAds\Api;
|
30 |
+
|
31 |
+
use GuzzleHttp\HandlerStack;
|
32 |
+
use GuzzleHttp\Handler\CurlHandler;
|
33 |
+
|
34 |
+
Api::init(null, null, 'access-token', false);
|
35 |
+
|
36 |
+
class AsyncClientTest extends AbstractUnitTestCase {
|
37 |
+
public function testSingleton() {
|
38 |
+
$client1 = AsyncClient::getInstance()->getClient();
|
39 |
+
$client2 = AsyncClient::getInstance()->getClient();
|
40 |
+
|
41 |
+
$this->assertEquals($client1, $client2);
|
42 |
+
}
|
43 |
+
|
44 |
+
public function testCurlOptions() {
|
45 |
+
$async_client = AsyncClient::getInstance()->getClient();
|
46 |
+
$expected_handler = HandlerStack::create(new CurlHandler([
|
47 |
+
'options' => [
|
48 |
+
CURLOPT_CONNECTTIMEOUT => 10,
|
49 |
+
CURLOPT_TIMEOUT => 60,
|
50 |
+
CURLOPT_RETURNTRANSFER => true,
|
51 |
+
CURLOPT_HEADER => true,
|
52 |
+
CURLOPT_CAINFO => Api::instance()->getHttpClient()->getCaBundlePath(),
|
53 |
+
]
|
54 |
+
]));
|
55 |
+
|
56 |
+
$this->assertEquals($expected_handler, $async_client->getConfig()['handler']);
|
57 |
+
}
|
58 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/BatchProcessorTest.php
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAdsTest\AbstractUnitTestCase;
|
28 |
+
use FacebookAds\Object\ServerSide\Event;
|
29 |
+
use FacebookAds\Object\ServerSide\UserData;
|
30 |
+
use FacebookAds\Object\ServerSide\BatchProcessor;
|
31 |
+
use FacebookAds\Api;
|
32 |
+
use GuzzleHttp\Promise;
|
33 |
+
use Mockery as m;
|
34 |
+
|
35 |
+
class BatchProcessorTest extends AbstractUnitTestCase {
|
36 |
+
protected function setUp(): void {
|
37 |
+
$this->user_data = (new UserData())->setEmail('joe@eg.com');
|
38 |
+
$this->event = (new Event())
|
39 |
+
->setEventName('Purchase')
|
40 |
+
->setEventTime(time())
|
41 |
+
->setUserData($this->user_data);
|
42 |
+
$this->pixel_id = 'pixel-id-0';
|
43 |
+
$this->test_event_code = 'test-code-1';
|
44 |
+
$batch_size = 5;
|
45 |
+
$concurrent_requests = 2;
|
46 |
+
$this->batch_processor = new BatchProcessor($this->pixel_id, $batch_size, $concurrent_requests);
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function tearDown(): void {
|
50 |
+
m::close();
|
51 |
+
}
|
52 |
+
|
53 |
+
public function testProcessEvents() {
|
54 |
+
$expected_event_request_params = array(
|
55 |
+
'events' => array_fill(0, 5, $this->event),
|
56 |
+
'test_event_code' => $this->test_event_code,
|
57 |
+
);
|
58 |
+
|
59 |
+
$mock_event_request_async = m::mock('overload:FacebookAds\Object\ServerSide\EventRequestAsync');
|
60 |
+
$mock_guzzle_promise = m::mock();
|
61 |
+
|
62 |
+
$mock_event_request_async
|
63 |
+
->shouldReceive('__construct')
|
64 |
+
->atLeast()
|
65 |
+
->once()
|
66 |
+
->with($this->pixel_id, $expected_event_request_params);
|
67 |
+
$mock_event_request_async
|
68 |
+
->shouldReceive('execute')
|
69 |
+
->atLeast()
|
70 |
+
->once()
|
71 |
+
->andReturn($mock_guzzle_promise);
|
72 |
+
$mock_guzzle_promise
|
73 |
+
->shouldReceive('wait')
|
74 |
+
->times(3);
|
75 |
+
$this->addToAssertionCount(
|
76 |
+
m::getContainer()->mockery_getExpectationCount()
|
77 |
+
);
|
78 |
+
|
79 |
+
$events = array_fill(0, 15, $this->event);
|
80 |
+
$this->batch_processor->processEvents(
|
81 |
+
array('test_event_code' => $this->test_event_code),
|
82 |
+
$events
|
83 |
+
);
|
84 |
+
}
|
85 |
+
|
86 |
+
public function testProcessEventsGenerator() {
|
87 |
+
$expected_event_request_params = array(
|
88 |
+
'events' => array_fill(0, 5, $this->event),
|
89 |
+
'test_event_code' => $this->test_event_code,
|
90 |
+
);
|
91 |
+
|
92 |
+
$mock_event_request_async = m::mock('overload:FacebookAds\Object\ServerSide\EventRequestAsync');
|
93 |
+
$mock_guzzle_promise = m::mock();
|
94 |
+
|
95 |
+
$mock_event_request_async
|
96 |
+
->shouldReceive('__construct')
|
97 |
+
->atLeast()
|
98 |
+
->once()
|
99 |
+
->with($this->pixel_id, $expected_event_request_params);
|
100 |
+
$mock_event_request_async
|
101 |
+
->shouldReceive('execute')
|
102 |
+
->atLeast()
|
103 |
+
->once()
|
104 |
+
->andReturn($mock_guzzle_promise);
|
105 |
+
$mock_guzzle_promise
|
106 |
+
->shouldReceive('wait')
|
107 |
+
->times(3);
|
108 |
+
|
109 |
+
$events = array_fill(0, 15, $this->event);
|
110 |
+
$generator = $this->batch_processor->processEventsGenerator(
|
111 |
+
array('test_event_code' => $this->test_event_code),
|
112 |
+
$events
|
113 |
+
);
|
114 |
+
$iterations = 0;
|
115 |
+
foreach ($generator as $promises) {
|
116 |
+
$iterations += 1;
|
117 |
+
Promise\unwrap($promises);
|
118 |
+
}
|
119 |
+
|
120 |
+
$this->assertEquals($iterations, 2);
|
121 |
+
}
|
122 |
+
|
123 |
+
public function testProcessEventRequests() {
|
124 |
+
$mock_event_request_async = m::mock();
|
125 |
+
$mock_guzzle_promise = m::mock();
|
126 |
+
$expected_event_request_params = array_fill(0, 5, $mock_event_request_async);
|
127 |
+
|
128 |
+
$mock_event_request_async
|
129 |
+
->shouldReceive('execute')
|
130 |
+
->times(5)
|
131 |
+
->andReturn($mock_guzzle_promise);
|
132 |
+
$mock_guzzle_promise
|
133 |
+
->shouldReceive('wait')
|
134 |
+
->times(5);
|
135 |
+
$this->addToAssertionCount(
|
136 |
+
m::getContainer()->mockery_getExpectationCount()
|
137 |
+
);
|
138 |
+
|
139 |
+
$event_requests = array_fill(0, 5, $mock_event_request_async);
|
140 |
+
$this->batch_processor->processEventRequests($event_requests);
|
141 |
+
}
|
142 |
+
|
143 |
+
public function testProcessEventRequestsGenerator() {
|
144 |
+
$mock_event_request_async = m::mock();
|
145 |
+
$mock_guzzle_promise = m::mock();
|
146 |
+
$expected_event_request_params = array_fill(0, 5, $mock_event_request_async);
|
147 |
+
|
148 |
+
$mock_event_request_async
|
149 |
+
->shouldReceive('execute')
|
150 |
+
->times(5)
|
151 |
+
->andReturn($mock_guzzle_promise);
|
152 |
+
$mock_guzzle_promise
|
153 |
+
->shouldReceive('wait')
|
154 |
+
->times(5);
|
155 |
+
|
156 |
+
$event_requests = array_fill(0, 5, $mock_event_request_async);
|
157 |
+
$generator = $this->batch_processor->processEventRequestsGenerator($event_requests);
|
158 |
+
$iterations = 0;
|
159 |
+
foreach ($generator as $promises) {
|
160 |
+
$iterations += 1;
|
161 |
+
Promise\unwrap($promises);
|
162 |
+
}
|
163 |
+
|
164 |
+
$this->assertEquals(3, $iterations);
|
165 |
+
}
|
166 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/CustomDataTest.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object;
|
26 |
+
|
27 |
+
use FacebookAdsTest\AbstractUnitTestCase;
|
28 |
+
use FacebookAds\Object\ServerSide\CustomData;
|
29 |
+
use FacebookAds\Object\ServerSide\Content;
|
30 |
+
use FacebookAds\Object\ServerSide\DeliveryCategory;
|
31 |
+
|
32 |
+
class CustomDataTest extends AbstractUnitTestCase {
|
33 |
+
public function testBuilderAndConstructor() {
|
34 |
+
$custom_properties = array(
|
35 |
+
'custom1' => 'property1',
|
36 |
+
'custom2' => 'property2'
|
37 |
+
);
|
38 |
+
$content_state = array('title' => 'content-1');
|
39 |
+
$content = new Content($content_state);
|
40 |
+
$state = array(
|
41 |
+
'value' => 0.1,
|
42 |
+
'currency' => 'usd',
|
43 |
+
'content_name' => 'content-name-2',
|
44 |
+
'content_category' => 'content-category-3',
|
45 |
+
'content_ids' => array('id-1', 'id2'),
|
46 |
+
'content_type' => 'content-type-4',
|
47 |
+
'order_id' => 'order-id-5',
|
48 |
+
'predicted_ltv' => 6.10,
|
49 |
+
'num_items' => 7,
|
50 |
+
'status' => 'status-8',
|
51 |
+
'search_string' => 'search-string-9',
|
52 |
+
'item_number' => 'item-number-10',
|
53 |
+
'delivery_category' => DeliveryCategory::CURBSIDE,
|
54 |
+
);
|
55 |
+
$expected = array_merge(
|
56 |
+
$state,
|
57 |
+
array('contents' => array($content_state)),
|
58 |
+
$custom_properties
|
59 |
+
);
|
60 |
+
$builder = (new CustomData())
|
61 |
+
->setValue($state['value'])
|
62 |
+
->setCurrency($state['currency'])
|
63 |
+
->setContentName($state['content_name'])
|
64 |
+
->setContentCategory($state['content_category'])
|
65 |
+
->setContentIds($state['content_ids'])
|
66 |
+
->setContents(array($content))
|
67 |
+
->setContentType($state['content_type'])
|
68 |
+
->setOrderId($state['order_id'])
|
69 |
+
->setPredictedLtv($state['predicted_ltv'])
|
70 |
+
->setNumItems($state['num_items'])
|
71 |
+
->setStatus($state['status'])
|
72 |
+
->setSearchString($state['search_string'])
|
73 |
+
->setItemNumber($state['item_number'])
|
74 |
+
->setDeliveryCategory($state['delivery_category'])
|
75 |
+
->setCustomProperties($custom_properties);
|
76 |
+
$this->assertEquals($expected, $builder->normalize());
|
77 |
+
|
78 |
+
$constructor = new CustomData(array(
|
79 |
+
'value' => $state['value'],
|
80 |
+
'currency' => $state['currency'],
|
81 |
+
'content_name' => $state['content_name'],
|
82 |
+
'content_category' => $state['content_category'],
|
83 |
+
'content_ids' => $state['content_ids'],
|
84 |
+
'contents' => array($content),
|
85 |
+
'content_type' => $state['content_type'],
|
86 |
+
'order_id' => $state['order_id'],
|
87 |
+
'predicted_ltv' => $state['predicted_ltv'],
|
88 |
+
'num_items' => $state['num_items'],
|
89 |
+
'status' => $state['status'],
|
90 |
+
'search_string' => $state['search_string'],
|
91 |
+
'item_number' => $state['item_number'],
|
92 |
+
'delivery_category' => $state['delivery_category'],
|
93 |
+
'custom_properties' => $custom_properties
|
94 |
+
));
|
95 |
+
$this->assertEquals($expected, $constructor->normalize());
|
96 |
+
}
|
97 |
+
|
98 |
+
public function testInvalidDeliveryCategory() {
|
99 |
+
$test_delivery_category = 'invalid_delivery_category';
|
100 |
+
|
101 |
+
$custom_data = (new CustomData())->setDeliveryCategory($test_delivery_category);
|
102 |
+
|
103 |
+
try {
|
104 |
+
$normalized_payload = $custom_data->normalize();
|
105 |
+
} catch (\Exception $exception) {
|
106 |
+
$has_throw_exception = true;
|
107 |
+
$expected_string = sprintf("Invalid delivery_category passed: %s",$test_delivery_category);
|
108 |
+
$this->assertStringContainsString($expected_string, $exception->getMessage());
|
109 |
+
}
|
110 |
+
|
111 |
+
$this->assertTrue($has_throw_exception);
|
112 |
+
}
|
113 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/EventRequestAsyncTest.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAdsTest\AbstractUnitTestCase;
|
28 |
+
use FacebookAds\Object\ServerSide\Event;
|
29 |
+
use FacebookAds\Object\ServerSide\EventRequestAsync;
|
30 |
+
use FacebookAds\Api;
|
31 |
+
|
32 |
+
class EventRequestAsyncTest extends AbstractUnitTestCase {
|
33 |
+
public function testBuilder() {
|
34 |
+
$event = new Event(array('event_name' => 'my-event'));
|
35 |
+
$expected = array(
|
36 |
+
'data' => array(array('event_name' => $event['event_name'])),
|
37 |
+
'test_event_code' => 'test-event-code-0',
|
38 |
+
'partner_agent' => 'partner-agent-1',
|
39 |
+
'namespace_id' => 'namespace-id-2',
|
40 |
+
'upload_id' => 'upload-id-3',
|
41 |
+
'upload_tag' => 'upload-tag-4',
|
42 |
+
'upload_source' => 'upload-source-5',
|
43 |
+
);
|
44 |
+
$event_request_async = (new EventRequestAsync('pixel-id'))
|
45 |
+
->setEvents(array($event))
|
46 |
+
->setTestEventCode($expected['test_event_code'])
|
47 |
+
->setPartnerAgent($expected['partner_agent'])
|
48 |
+
->setNamespaceId($expected['namespace_id'])
|
49 |
+
->setUploadId($expected['upload_id'])
|
50 |
+
->setUploadTag($expected['upload_tag'])
|
51 |
+
->setUploadSource($expected['upload_source']);
|
52 |
+
|
53 |
+
$this->assertEquals($expected, $event_request_async->normalize());
|
54 |
+
}
|
55 |
+
|
56 |
+
public function testConstructor() {
|
57 |
+
$event = new Event(array('event_name' => 'my-event'));
|
58 |
+
$expected_event = array('data' => [array('event_name' => $event['event_name'])]);
|
59 |
+
$state = array(
|
60 |
+
'test_event_code' => 'test-event-code-0',
|
61 |
+
'partner_agent' => 'partner-agent-1',
|
62 |
+
'namespace_id' => 'namespace-id-2',
|
63 |
+
'upload_id' => 'upload-id-3',
|
64 |
+
'upload_tag' => 'upload-tag-4',
|
65 |
+
'upload_source' => 'upload-source-5',
|
66 |
+
);
|
67 |
+
$data = array_merge(array('events' => array($event)), $state);
|
68 |
+
$expected = array_merge($state, $expected_event);
|
69 |
+
$event_request_async = new EventRequestAsync('pixel-id', $data);
|
70 |
+
|
71 |
+
$this->assertEquals($expected, $event_request_async->normalize());
|
72 |
+
}
|
73 |
+
|
74 |
+
public function testPromiseCancel() {
|
75 |
+
Api::init(null, null, 'access-token-123');
|
76 |
+
$event_request_async = new EventRequestAsync('pixel-id-456', array(
|
77 |
+
'test_event_code' => 'test-event-code-0',
|
78 |
+
'events' => array(new Event(array('event_name' => 'my-event')))
|
79 |
+
));
|
80 |
+
$promise = $event_request_async->execute();
|
81 |
+
$promise->cancel();
|
82 |
+
|
83 |
+
$this->assertEquals('rejected', $promise->getState());
|
84 |
+
}
|
85 |
+
|
86 |
+
public function testPromiseReject() {
|
87 |
+
Api::init(null, null, 'access-token-123');
|
88 |
+
$event_request_async = new EventRequestAsync('pixel-id-456', array(
|
89 |
+
'test_event_code' => 'test-event-code-0',
|
90 |
+
'events' => array(new Event(array('event_name' => 'my-event')))
|
91 |
+
));
|
92 |
+
$promise = $event_request_async->execute();
|
93 |
+
$promise->reject('some error');
|
94 |
+
|
95 |
+
$this->assertEquals('rejected', $promise->getState());
|
96 |
+
}
|
97 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/EventRequestTest.php
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide;
|
26 |
+
|
27 |
+
use FacebookAdsTest\AbstractUnitTestCase;
|
28 |
+
use FacebookAdsTest\Object\ServerSide\TestHelpers\FakeHttpService;
|
29 |
+
use FacebookAdsTest\Object\ServerSide\TestHelpers\AnotherHttpService;
|
30 |
+
use FacebookAds\Api;
|
31 |
+
use FacebookAds\ApiConfig;
|
32 |
+
use FacebookAds\Http\Client;
|
33 |
+
use FacebookAds\Object\AbstractObject;
|
34 |
+
use FacebookAds\Object\ServerSide\Event;
|
35 |
+
use FacebookAds\Object\ServerSide\EventRequest;
|
36 |
+
use FacebookAds\Object\ServerSide\EventResponse;
|
37 |
+
use FacebookAds\Object\ServerSide\HttpServiceClientConfig;
|
38 |
+
use FacebookAds\Object\ServerSide\Util;
|
39 |
+
use Mockery as m;
|
40 |
+
|
41 |
+
class EventRequestTest extends AbstractUnitTestCase {
|
42 |
+
protected function setUp(): void {
|
43 |
+
$this->expected_pixel_id = 'pixel-1000';
|
44 |
+
$this->expected_url = 'https://graph.facebook.com/v'
|
45 |
+
. ApiConfig::APIVersion
|
46 |
+
. '/'
|
47 |
+
. $this->expected_pixel_id
|
48 |
+
. '/events';
|
49 |
+
$this->expected_headers = array(
|
50 |
+
'User-Agent' => 'fbbizsdk-php-v' . ApiConfig::APIVersion,
|
51 |
+
'Accept-Encoding' => '*',
|
52 |
+
);
|
53 |
+
$this->expected_access_token = 'a-test-token';
|
54 |
+
$this->expected_curl_options = array(
|
55 |
+
CURLOPT_CONNECTTIMEOUT => 10,
|
56 |
+
CURLOPT_TIMEOUT => 60,
|
57 |
+
CURLOPT_RETURNTRANSFER => true,
|
58 |
+
CURLOPT_HEADER => true,
|
59 |
+
CURLOPT_CAINFO => Util::getCaBundlePath(),
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
protected function tearDown(): void {
|
64 |
+
m::close();
|
65 |
+
}
|
66 |
+
|
67 |
+
public function testBuilder() {
|
68 |
+
$event = new Event(array('event_name' => 'event-123'));
|
69 |
+
$expected = array(
|
70 |
+
'data' => array(array('event_name' => $event['event_name'])),
|
71 |
+
'test_event_code' => 'test-event-code-0',
|
72 |
+
'partner_agent' => 'partner-agent-1',
|
73 |
+
'namespace_id' => 'namespace-id-2',
|
74 |
+
'upload_id' => 'upload-id-3',
|
75 |
+
'upload_tag' => 'upload-tag-4',
|
76 |
+
'upload_source' => 'upload-source-5',
|
77 |
+
);
|
78 |
+
$event_request = (new EventRequest('pixel-id'))
|
79 |
+
->setEvents(array($event))
|
80 |
+
->setTestEventCode($expected['test_event_code'])
|
81 |
+
->setPartnerAgent($expected['partner_agent'])
|
82 |
+
->setNamespaceId($expected['namespace_id'])
|
83 |
+
->setUploadId($expected['upload_id'])
|
84 |
+
->setUploadTag($expected['upload_tag'])
|
85 |
+
->setUploadSource($expected['upload_source']);
|
86 |
+
|
87 |
+
$this->assertEquals($expected, $event_request->normalize());
|
88 |
+
}
|
89 |
+
|
90 |
+
public function testConstructor() {
|
91 |
+
$event = new Event(array('event_name' => 'event-123'));
|
92 |
+
$expected_event = array('data' => [array('event_name' => $event['event_name'])]);
|
93 |
+
$state = array(
|
94 |
+
'test_event_code' => 'test-event-code-0',
|
95 |
+
'partner_agent' => 'partner-agent-1',
|
96 |
+
'namespace_id' => 'namespace-id-2',
|
97 |
+
'upload_id' => 'upload-id-3',
|
98 |
+
'upload_tag' => 'upload-tag-4',
|
99 |
+
'upload_source' => 'upload-source-5',
|
100 |
+
);
|
101 |
+
$data = array_merge(array('events' => array($event)), $state);
|
102 |
+
$expected = array_merge($state, $expected_event);
|
103 |
+
$event_request = new EventRequest('pixel-id', $data);
|
104 |
+
|
105 |
+
$this->assertEquals($expected, $event_request->normalize());
|
106 |
+
}
|
107 |
+
|
108 |
+
public function testDefaultHttpService() {
|
109 |
+
$mock_ads_pixel = m::mock('overload:FacebookAds\Object\AdsPixel');
|
110 |
+
$mock_ads_pixel
|
111 |
+
->shouldReceive('__construct')
|
112 |
+
->once()
|
113 |
+
->with($this->expected_pixel_id);
|
114 |
+
$event_response_contents = array('data' => array('events_received' => 1));
|
115 |
+
$expected_event_response = new EventResponse($event_response_contents);
|
116 |
+
$create_response_mock = $this->createMock(AbstractObject::class);
|
117 |
+
$create_response_mock
|
118 |
+
->expects($this->once())
|
119 |
+
->method('exportAllData')
|
120 |
+
->willReturn($event_response_contents);
|
121 |
+
$event_request = new EventRequest($this->expected_pixel_id);
|
122 |
+
$event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));
|
123 |
+
$mock_ads_pixel
|
124 |
+
->shouldReceive('createEvent')
|
125 |
+
->once()
|
126 |
+
->with(array(), $event_request->normalize())
|
127 |
+
->andReturn($create_response_mock);
|
128 |
+
$actual_event_response = $event_request->execute();
|
129 |
+
|
130 |
+
$this->assertEquals($expected_event_response, $actual_event_response);
|
131 |
+
}
|
132 |
+
|
133 |
+
public function testSetHttpService() {
|
134 |
+
Api::init(null, null, $this->expected_access_token, false);
|
135 |
+
$mock_fake_service_class = m::mock('overload:FacebookAdsTest\Object\ServerSide\TestHelpers\FakeHttpService');
|
136 |
+
$expected_event_response = new EventResponse(
|
137 |
+
array(
|
138 |
+
'data' => array('events_received' => 1)
|
139 |
+
)
|
140 |
+
);
|
141 |
+
$event_request = new EventRequest($this->expected_pixel_id);
|
142 |
+
$event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));
|
143 |
+
$event_request->setHttpService(FakeHttpService::class);
|
144 |
+
$mock_fake_service_class
|
145 |
+
->shouldReceive('executeRequest')
|
146 |
+
->once()
|
147 |
+
->with(
|
148 |
+
$this->expected_url,
|
149 |
+
'POST',
|
150 |
+
$this->expected_curl_options,
|
151 |
+
$this->expected_headers,
|
152 |
+
$this->normalize_and_merge($event_request, $this->expected_access_token)
|
153 |
+
)
|
154 |
+
->andReturn($expected_event_response);
|
155 |
+
$actual_event_response = $event_request->execute();
|
156 |
+
|
157 |
+
$this->assertEquals($expected_event_response, $actual_event_response);
|
158 |
+
}
|
159 |
+
|
160 |
+
public function testSetHttpServiceClientConfig() {
|
161 |
+
$mock_fake_service_class = m::mock('overload:FacebookAdsTest\Object\ServerSide\TestHelpers\FakeHttpService');
|
162 |
+
$expected_event_response = new EventResponse(
|
163 |
+
array(
|
164 |
+
'data' => array('events_received' => 1)
|
165 |
+
)
|
166 |
+
);
|
167 |
+
$event_request = new EventRequest($this->expected_pixel_id);
|
168 |
+
$event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));
|
169 |
+
$mock_fake_service_class
|
170 |
+
->shouldReceive('executeRequest')
|
171 |
+
->once()
|
172 |
+
->with(
|
173 |
+
$this->expected_url,
|
174 |
+
'POST',
|
175 |
+
$this->expected_curl_options,
|
176 |
+
$this->expected_headers,
|
177 |
+
$this->normalize_and_merge($event_request, $this->expected_access_token)
|
178 |
+
)
|
179 |
+
->andReturn($expected_event_response);
|
180 |
+
HttpServiceClientConfig::getInstance()->setClient(FakeHttpService::class);
|
181 |
+
HttpServiceClientConfig::getInstance()->setAccessToken($this->expected_access_token);
|
182 |
+
$actual_event_response = $event_request->execute();
|
183 |
+
|
184 |
+
$this->assertEquals($expected_event_response, $actual_event_response);
|
185 |
+
}
|
186 |
+
|
187 |
+
public function testEventRequestHttpServiceOverridesClientConfig() {
|
188 |
+
Api::init(null, null, 'a-different-access-token', false);
|
189 |
+
$mock_fake_service_class = m::mock('overload:FacebookAdsTest\Object\ServerSide\TestHelpers\AnotherHttpService');
|
190 |
+
$expected_event_response = new EventResponse(
|
191 |
+
array(
|
192 |
+
'data' => array('events_received' => 1)
|
193 |
+
)
|
194 |
+
);
|
195 |
+
$event_request = new EventRequest($this->expected_pixel_id);
|
196 |
+
$event_request->setEvents(array(new Event(array('event_name' => 'event-123'))));
|
197 |
+
$event_request->setHttpService(AnotherHttpService::class);
|
198 |
+
$mock_fake_service_class
|
199 |
+
->shouldReceive('executeRequest')
|
200 |
+
->once()
|
201 |
+
->with(
|
202 |
+
$this->expected_url,
|
203 |
+
'POST',
|
204 |
+
$this->expected_curl_options,
|
205 |
+
$this->expected_headers,
|
206 |
+
$this->normalize_and_merge($event_request, $this->expected_access_token)
|
207 |
+
)
|
208 |
+
->andReturn($expected_event_response);
|
209 |
+
HttpServiceClientConfig::getInstance()->setClient(FakeHttpService::class);
|
210 |
+
HttpServiceClientConfig::getInstance()->setAccessToken($this->expected_access_token);
|
211 |
+
$actual_event_response = $event_request->execute();
|
212 |
+
|
213 |
+
$this->assertEquals($expected_event_response, $actual_event_response);
|
214 |
+
}
|
215 |
+
|
216 |
+
// Test helper functions
|
217 |
+
|
218 |
+
protected function normalize_and_merge($event_request, $access_token) {
|
219 |
+
$normalized_merged = $event_request->normalize();
|
220 |
+
$normalized_merged['access_token'] = $access_token;
|
221 |
+
return $normalized_merged;
|
222 |
+
}
|
223 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/ServerSideNormalizeTest.php
CHANGED
@@ -33,7 +33,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
33 |
/**
|
34 |
* Test cases for Email Normalization
|
35 |
*/
|
36 |
-
public function
|
37 |
return array(
|
38 |
array(
|
39 |
"foo(.bar)@baz.com/",
|
@@ -51,7 +51,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
51 |
}
|
52 |
|
53 |
/**
|
54 |
-
* @dataProvider
|
55 |
*/
|
56 |
public function testEmailNormalize($input, $expected) {
|
57 |
$this->assertEquals(
|
@@ -62,7 +62,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
62 |
/**
|
63 |
* Test cases for Phone Normalization
|
64 |
*/
|
65 |
-
public function
|
66 |
return array(
|
67 |
array(
|
68 |
'123-456-7890',
|
@@ -84,7 +84,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
84 |
}
|
85 |
|
86 |
/**
|
87 |
-
* @dataProvider
|
88 |
*/
|
89 |
public function testPhoneNormalize($input, $expected) {
|
90 |
$this->assertEquals(
|
@@ -95,7 +95,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
95 |
/**
|
96 |
* Test cases for Postal Code Normalization
|
97 |
*/
|
98 |
-
public function
|
99 |
return array(
|
100 |
array(
|
101 |
' 98121',
|
@@ -117,7 +117,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
117 |
}
|
118 |
|
119 |
/**
|
120 |
-
* @dataProvider
|
121 |
*/
|
122 |
public function testPostalCodeNormalize($input, $expected) {
|
123 |
$this->assertEquals(
|
@@ -128,7 +128,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
128 |
/**
|
129 |
* Test cases for City Normalization
|
130 |
*/
|
131 |
-
public function
|
132 |
return array(
|
133 |
array(
|
134 |
'Menlo Park',
|
@@ -146,7 +146,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
146 |
}
|
147 |
|
148 |
/**
|
149 |
-
* @dataProvider
|
150 |
*/
|
151 |
public function testCityNormalize($input, $expected) {
|
152 |
$this->assertEquals(
|
@@ -157,7 +157,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
157 |
/**
|
158 |
* Test cases for Country Normalization
|
159 |
*/
|
160 |
-
public function
|
161 |
return array(
|
162 |
array(
|
163 |
' US ',
|
@@ -171,7 +171,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
171 |
}
|
172 |
|
173 |
/**
|
174 |
-
* @dataProvider
|
175 |
*/
|
176 |
public function testCountryNormalize($input, $expected) {
|
177 |
$this->assertEquals(
|
@@ -182,7 +182,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
182 |
/**
|
183 |
* Test cases for Currency Normalization
|
184 |
*/
|
185 |
-
public function
|
186 |
return array(
|
187 |
array(
|
188 |
' ABC ', // Can't validate the data, just normalizes.
|
@@ -196,7 +196,7 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
196 |
}
|
197 |
|
198 |
/**
|
199 |
-
* @dataProvider
|
200 |
*/
|
201 |
public function testCurrencyNormalize($input, $expected) {
|
202 |
$this->assertEquals(
|
@@ -242,4 +242,292 @@ class ServerSideNormalizeTest extends AbstractUnitTestCase {
|
|
242 |
}
|
243 |
$this->assertTrue($has_throw_exception);
|
244 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
}
|
33 |
/**
|
34 |
* Test cases for Email Normalization
|
35 |
*/
|
36 |
+
public function emailNormalizeData() {
|
37 |
return array(
|
38 |
array(
|
39 |
"foo(.bar)@baz.com/",
|
51 |
}
|
52 |
|
53 |
/**
|
54 |
+
* @dataProvider emailNormalizeData
|
55 |
*/
|
56 |
public function testEmailNormalize($input, $expected) {
|
57 |
$this->assertEquals(
|
62 |
/**
|
63 |
* Test cases for Phone Normalization
|
64 |
*/
|
65 |
+
public function phoneNormalizeData() {
|
66 |
return array(
|
67 |
array(
|
68 |
'123-456-7890',
|
84 |
}
|
85 |
|
86 |
/**
|
87 |
+
* @dataProvider phoneNormalizeData
|
88 |
*/
|
89 |
public function testPhoneNormalize($input, $expected) {
|
90 |
$this->assertEquals(
|
95 |
/**
|
96 |
* Test cases for Postal Code Normalization
|
97 |
*/
|
98 |
+
public function postalCodeNormalizeData() {
|
99 |
return array(
|
100 |
array(
|
101 |
' 98121',
|
117 |
}
|
118 |
|
119 |
/**
|
120 |
+
* @dataProvider postalCodeNormalizeData
|
121 |
*/
|
122 |
public function testPostalCodeNormalize($input, $expected) {
|
123 |
$this->assertEquals(
|
128 |
/**
|
129 |
* Test cases for City Normalization
|
130 |
*/
|
131 |
+
public function cityNormalizeData() {
|
132 |
return array(
|
133 |
array(
|
134 |
'Menlo Park',
|
146 |
}
|
147 |
|
148 |
/**
|
149 |
+
* @dataProvider cityNormalizeData
|
150 |
*/
|
151 |
public function testCityNormalize($input, $expected) {
|
152 |
$this->assertEquals(
|
157 |
/**
|
158 |
* Test cases for Country Normalization
|
159 |
*/
|
160 |
+
public function countryNormalizeData() {
|
161 |
return array(
|
162 |
array(
|
163 |
' US ',
|
171 |
}
|
172 |
|
173 |
/**
|
174 |
+
* @dataProvider countryNormalizeData
|
175 |
*/
|
176 |
public function testCountryNormalize($input, $expected) {
|
177 |
$this->assertEquals(
|
182 |
/**
|
183 |
* Test cases for Currency Normalization
|
184 |
*/
|
185 |
+
public function currencyNormalizeData() {
|
186 |
return array(
|
187 |
array(
|
188 |
' ABC ', // Can't validate the data, just normalizes.
|
196 |
}
|
197 |
|
198 |
/**
|
199 |
+
* @dataProvider currencyNormalizeData
|
200 |
*/
|
201 |
public function testCurrencyNormalize($input, $expected) {
|
202 |
$this->assertEquals(
|
242 |
}
|
243 |
$this->assertTrue($has_throw_exception);
|
244 |
}
|
245 |
+
|
246 |
+
public function f5firstData() {
|
247 |
+
return array(
|
248 |
+
array(
|
249 |
+
'George',
|
250 |
+
'georg',
|
251 |
+
),
|
252 |
+
array(
|
253 |
+
'John',
|
254 |
+
'john',
|
255 |
+
),
|
256 |
+
array(
|
257 |
+
'',
|
258 |
+
'',
|
259 |
+
),
|
260 |
+
array(
|
261 |
+
null,
|
262 |
+
null,
|
263 |
+
),
|
264 |
+
);
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* @dataProvider f5firstData
|
269 |
+
*/
|
270 |
+
public function testF5first($input, $expected) {
|
271 |
+
$this->assertEquals(
|
272 |
+
$expected,
|
273 |
+
Normalizer::normalize('f5first', $input)
|
274 |
+
);
|
275 |
+
}
|
276 |
+
|
277 |
+
public function f5lastData() {
|
278 |
+
return array(
|
279 |
+
array(
|
280 |
+
'Washington',
|
281 |
+
'washi',
|
282 |
+
),
|
283 |
+
array(
|
284 |
+
'Adams',
|
285 |
+
'adams',
|
286 |
+
),
|
287 |
+
array(
|
288 |
+
'',
|
289 |
+
'',
|
290 |
+
),
|
291 |
+
array(
|
292 |
+
null,
|
293 |
+
null,
|
294 |
+
),
|
295 |
+
);
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* @dataProvider f5lastData
|
300 |
+
*/
|
301 |
+
public function testF5last($input, $expected) {
|
302 |
+
$this->assertEquals(
|
303 |
+
$expected,
|
304 |
+
Normalizer::normalize('f5last', $input)
|
305 |
+
);
|
306 |
+
}
|
307 |
+
|
308 |
+
public function fiData() {
|
309 |
+
return array(
|
310 |
+
array(
|
311 |
+
'GW',
|
312 |
+
'g',
|
313 |
+
),
|
314 |
+
array(
|
315 |
+
'j',
|
316 |
+
'j',
|
317 |
+
),
|
318 |
+
array(
|
319 |
+
'',
|
320 |
+
'',
|
321 |
+
),
|
322 |
+
array(
|
323 |
+
null,
|
324 |
+
null,
|
325 |
+
),
|
326 |
+
);
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* @dataProvider fiData
|
331 |
+
*/
|
332 |
+
public function testFi($input, $expected) {
|
333 |
+
$this->assertEquals(
|
334 |
+
$expected,
|
335 |
+
Normalizer::normalize('fi', $input)
|
336 |
+
);
|
337 |
+
}
|
338 |
+
|
339 |
+
public function dobdData() {
|
340 |
+
return array(
|
341 |
+
array(
|
342 |
+
'1',
|
343 |
+
'01',
|
344 |
+
),
|
345 |
+
array(
|
346 |
+
'9',
|
347 |
+
'09',
|
348 |
+
),
|
349 |
+
array(
|
350 |
+
'31',
|
351 |
+
'31',
|
352 |
+
),
|
353 |
+
array(
|
354 |
+
'',
|
355 |
+
'',
|
356 |
+
),
|
357 |
+
array(
|
358 |
+
null,
|
359 |
+
null,
|
360 |
+
),
|
361 |
+
);
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* @dataProvider dobdData
|
366 |
+
*/
|
367 |
+
public function testDobd($input, $expected) {
|
368 |
+
$this->assertEquals(
|
369 |
+
$expected,
|
370 |
+
Normalizer::normalize('dobd', $input)
|
371 |
+
);
|
372 |
+
}
|
373 |
+
|
374 |
+
public function testDobdException() {
|
375 |
+
$failure_cases = array(
|
376 |
+
'-1',
|
377 |
+
'0',
|
378 |
+
'32',
|
379 |
+
'2b',
|
380 |
+
'ab',
|
381 |
+
);
|
382 |
+
$exceptions_counter = 0;
|
383 |
+
$has_throw_exception = false;
|
384 |
+
foreach ($failure_cases as $case) {
|
385 |
+
try {
|
386 |
+
Normalizer::normalize('dobd', $case);
|
387 |
+
} catch (\Exception $e) {
|
388 |
+
$exceptions_counter += 1;
|
389 |
+
}
|
390 |
+
}
|
391 |
+
$this->assertEquals(count($failure_cases), $exceptions_counter);
|
392 |
+
}
|
393 |
+
|
394 |
+
public function dobmData() {
|
395 |
+
return array(
|
396 |
+
array(
|
397 |
+
'1',
|
398 |
+
'01',
|
399 |
+
),
|
400 |
+
array(
|
401 |
+
'5',
|
402 |
+
'05',
|
403 |
+
),
|
404 |
+
array(
|
405 |
+
'12',
|
406 |
+
'12',
|
407 |
+
),
|
408 |
+
array(
|
409 |
+
'',
|
410 |
+
'',
|
411 |
+
),
|
412 |
+
array(
|
413 |
+
null,
|
414 |
+
null,
|
415 |
+
),
|
416 |
+
);
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* @dataProvider dobmData
|
421 |
+
*/
|
422 |
+
public function testDobm($input, $expected) {
|
423 |
+
$this->assertEquals(
|
424 |
+
$expected,
|
425 |
+
Normalizer::normalize('dobm', $input)
|
426 |
+
);
|
427 |
+
}
|
428 |
+
|
429 |
+
public function testDobmException() {
|
430 |
+
$failure_cases = array(
|
431 |
+
'-1',
|
432 |
+
'0',
|
433 |
+
'13',
|
434 |
+
'1a',
|
435 |
+
'May',
|
436 |
+
'oc',
|
437 |
+
);
|
438 |
+
$exceptions_counter = 0;
|
439 |
+
$has_throw_exception = false;
|
440 |
+
foreach ($failure_cases as $case) {
|
441 |
+
try {
|
442 |
+
Normalizer::normalize('dobm', $case);
|
443 |
+
} catch (\Exception $e) {
|
444 |
+
$exceptions_counter += 1;
|
445 |
+
}
|
446 |
+
}
|
447 |
+
$this->assertEquals(count($failure_cases), $exceptions_counter);
|
448 |
+
}
|
449 |
+
|
450 |
+
public function dobyData() {
|
451 |
+
return array(
|
452 |
+
array(
|
453 |
+
'1995',
|
454 |
+
'1995',
|
455 |
+
),
|
456 |
+
array(
|
457 |
+
'9999',
|
458 |
+
'9999',
|
459 |
+
),
|
460 |
+
array(
|
461 |
+
'1000',
|
462 |
+
'1000',
|
463 |
+
),
|
464 |
+
array(
|
465 |
+
'',
|
466 |
+
'',
|
467 |
+
),
|
468 |
+
array(
|
469 |
+
null,
|
470 |
+
null,
|
471 |
+
),
|
472 |
+
);
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* @dataProvider dobyData
|
477 |
+
*/
|
478 |
+
public function testDoby($input, $expected) {
|
479 |
+
$this->assertEquals(
|
480 |
+
$expected,
|
481 |
+
Normalizer::normalize('doby', $input)
|
482 |
+
);
|
483 |
+
}
|
484 |
+
|
485 |
+
public function testDobyException() {
|
486 |
+
$failure_cases = array(
|
487 |
+
'-1',
|
488 |
+
'0',
|
489 |
+
'20',
|
490 |
+
'12345',
|
491 |
+
'nineteen-eighty',
|
492 |
+
);
|
493 |
+
$exceptions_counter = 0;
|
494 |
+
$has_throw_exception = false;
|
495 |
+
foreach ($failure_cases as $case) {
|
496 |
+
try {
|
497 |
+
Normalizer::normalize('doby', $case);
|
498 |
+
} catch (\Exception $e) {
|
499 |
+
$exceptions_counter += 1;
|
500 |
+
}
|
501 |
+
}
|
502 |
+
$this->assertEquals(count($failure_cases), $exceptions_counter);
|
503 |
+
}
|
504 |
+
|
505 |
+
/**
|
506 |
+
* Test cases for DeliveryCategory Normalization
|
507 |
+
*/
|
508 |
+
public function deliveryCategoryNormalizeData() {
|
509 |
+
return array(
|
510 |
+
array(
|
511 |
+
'home_delivery',
|
512 |
+
'home_delivery',
|
513 |
+
),
|
514 |
+
array(
|
515 |
+
'CURBSIDE',
|
516 |
+
'curbside',
|
517 |
+
),
|
518 |
+
array(
|
519 |
+
' IN_STORE ',
|
520 |
+
'in_store',
|
521 |
+
),
|
522 |
+
);
|
523 |
+
}
|
524 |
+
|
525 |
+
/**
|
526 |
+
* @dataProvider deliveryCategoryNormalizeData
|
527 |
+
*/
|
528 |
+
public function testDeliveryCategoryNormalize($input, $expected) {
|
529 |
+
$this->assertEquals(
|
530 |
+
$expected,
|
531 |
+
Normalizer::normalize('delivery_category', $input));
|
532 |
+
}
|
533 |
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/ServerSideUtilTest.php
CHANGED
@@ -99,4 +99,8 @@ class ServerSideUtilTest extends TestCase {
|
|
99 |
|
100 |
$this->assertEquals("_fbp_value", Util::getFbp());
|
101 |
}
|
|
|
|
|
|
|
|
|
102 |
}
|
99 |
|
100 |
$this->assertEquals("_fbp_value", Util::getFbp());
|
101 |
}
|
102 |
+
|
103 |
+
public function testGetCaBundlePath() {
|
104 |
+
$this->assertTrue(file_exists(Util::getCaBundlePath()));
|
105 |
+
}
|
106 |
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/TestHelpers/AnotherHttpService.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide\TestHelpers;
|
26 |
+
use FacebookAds\Object\ServerSide\HttpServiceInterface;
|
27 |
+
|
28 |
+
class AnotherHttpService implements HttpServiceInterface {
|
29 |
+
public function executeRequest($url, $method, array $curl_options, array $headers, array $params) {
|
30 |
+
return null;
|
31 |
+
}
|
32 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/TestHelpers/E2ETestHttpService.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide\TestHelpers;
|
26 |
+
use FacebookAds\Object\ServerSide\HttpServiceInterface;
|
27 |
+
|
28 |
+
use GuzzleHttp\Client;
|
29 |
+
use GuzzleHttp\HandlerStack;
|
30 |
+
use GuzzleHttp\Handler\CurlHandler;
|
31 |
+
use GuzzleHttp\Psr7\MultipartStream;
|
32 |
+
use GuzzleHttp\Psr7\Request;
|
33 |
+
|
34 |
+
class E2ETestHttpService implements HttpServiceInterface {
|
35 |
+
public function executeRequest($url, $method, array $curl_options, array $headers, array $params) {
|
36 |
+
$multipart_contents = [];
|
37 |
+
|
38 |
+
foreach ($params as $key => $value) {
|
39 |
+
if ($key === 'data') {
|
40 |
+
$multipart_contents[] = [
|
41 |
+
'name' => $key,
|
42 |
+
'contents' => \GuzzleHttp\json_encode($value),
|
43 |
+
'headers' => array('Content-Type' => 'multipart/form-data'),
|
44 |
+
];
|
45 |
+
} else {
|
46 |
+
$multipart_contents[] = [
|
47 |
+
'name' => $key,
|
48 |
+
'contents' => $value,
|
49 |
+
'headers' => array('Content-Type' => 'multipart/form-data'),
|
50 |
+
];
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
$body = new MultipartStream($multipart_contents);
|
55 |
+
$request = new Request($method, $url, $headers, $body);
|
56 |
+
|
57 |
+
$handler_stack = HandlerStack::create(
|
58 |
+
new CurlHandler(['options' => $curl_options])
|
59 |
+
);
|
60 |
+
|
61 |
+
$client = new Client(['handler' => $handler_stack]);
|
62 |
+
return $client->send($request);
|
63 |
+
}
|
64 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/TestHelpers/FakeHttpService.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object\ServerSide\TestHelpers;
|
26 |
+
use FacebookAds\Object\ServerSide\HttpServiceInterface;
|
27 |
+
|
28 |
+
class FakeHttpService implements HttpServiceInterface {
|
29 |
+
public function executeRequest($url, $method, array $curl_options, array $headers, array $params) {
|
30 |
+
return null;
|
31 |
+
}
|
32 |
+
}
|
vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/ServerSide/UserDataTest.php
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
4 |
+
*
|
5 |
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to
|
6 |
+
* use, copy, modify, and distribute this software in source code or binary
|
7 |
+
* form for use in connection with the web services and APIs provided by
|
8 |
+
* Facebook.
|
9 |
+
*
|
10 |
+
* As with any software that integrates with the Facebook platform, your use
|
11 |
+
* of this software is subject to the Facebook Developer Principles and
|
12 |
+
* Policies [http://developers.facebook.com/policy/]. This copyright notice
|
13 |
+
* shall be included in all copies or substantial portions of the software.
|
14 |
+
*
|
15 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
18 |
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
20 |
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
21 |
+
* DEALINGS IN THE SOFTWARE.
|
22 |
+
*
|
23 |
+
*/
|
24 |
+
|
25 |
+
namespace FacebookAdsTest\Object;
|
26 |
+
|
27 |
+
use FacebookAdsTest\AbstractUnitTestCase;
|
28 |
+
use FacebookAds\Object\ServerSide\UserData;
|
29 |
+
use FacebookAds\Object\ServerSide\Util;
|
30 |
+
|
31 |
+
|
32 |
+
class UserDataTest extends AbstractUnitTestCase {
|
33 |
+
public function testBuilderAndConstructor() {
|
34 |
+
$initial_state = array(
|
35 |
+
'email' => 'email-0@test.com',
|
36 |
+
'phone' => '1234567890',
|
37 |
+
'gender' => 'f',
|
38 |
+
'date_of_birth' => '01/01/2001',
|
39 |
+
'last_name' => 'last_name-4',
|
40 |
+
'first_name' => 'first_name-5',
|
41 |
+
'city' => 'city',
|
42 |
+
'state' => 'state',
|
43 |
+
'country_code' => 'us',
|
44 |
+
'zip_code' => '12345',
|
45 |
+
'external_id' => 'external_id-10',
|
46 |
+
'client_ip_address' => 'client_ip_address-11',
|
47 |
+
'client_user_agent' => 'client_user_agent-12',
|
48 |
+
'fbc' => 'fbc-13',
|
49 |
+
'fbp' => 'fbp-14',
|
50 |
+
'subscription_id' => 'subscription_id-15',
|
51 |
+
'fb_login_id' => 'fb_login_id-16',
|
52 |
+
'lead_id' => 'lead_id-17',
|
53 |
+
'f5first' => 'f5fir',
|
54 |
+
'f5last' => 'f5las',
|
55 |
+
'fi' => 'f',
|
56 |
+
'dobd' => '01',
|
57 |
+
'dobm' => '01',
|
58 |
+
'doby' => '2001'
|
59 |
+
);
|
60 |
+
$expected = array(
|
61 |
+
'em' => Util::hash($initial_state['email']),
|
62 |
+
'ph' => Util::hash($initial_state['phone']),
|
63 |
+
'ge' => Util::hash($initial_state['gender']),
|
64 |
+
'db' => Util::hash($initial_state['date_of_birth']),
|
65 |
+
'ln' => Util::hash($initial_state['last_name']),
|
66 |
+
'fn' => Util::hash($initial_state['first_name']),
|
67 |
+
'ct' => Util::hash($initial_state['city']),
|
68 |
+
'st' => Util::hash($initial_state['state']),
|
69 |
+
'country' => Util::hash($initial_state['country_code']),
|
70 |
+
'zp' => Util::hash($initial_state['zip_code']),
|
71 |
+
'external_id' => 'external_id-10',
|
72 |
+
'client_ip_address' => 'client_ip_address-11',
|
73 |
+
'client_user_agent' => 'client_user_agent-12',
|
74 |
+
'fbc' => 'fbc-13',
|
75 |
+
'fbp' => 'fbp-14',
|
76 |
+
'subscription_id' => 'subscription_id-15',
|
77 |
+
'fb_login_id' => 'fb_login_id-16',
|
78 |
+
'lead_id' => 'lead_id-17',
|
79 |
+
'f5first' => Util::hash($initial_state['f5first']),
|
80 |
+
'f5last' => Util::hash($initial_state['f5last']),
|
81 |
+
'fi' => Util::hash($initial_state['fi']),
|
82 |
+
'dobd' => Util::hash($initial_state['dobd']),
|
83 |
+
'dobm' => Util::hash($initial_state['dobm']),
|
84 |
+
'doby' => Util::hash($initial_state['doby'])
|
85 |
+
);
|
86 |
+
$builder = (new UserData())
|
87 |
+
->setEmail($initial_state['email'])
|
88 |
+
->setPhone($initial_state['phone'])
|
89 |
+
->setGender($initial_state['gender'])
|
90 |
+
->setDateOfBirth($initial_state['date_of_birth'])
|
91 |
+
->setLastName($initial_state['last_name'])
|
92 |
+
->setFirstName($initial_state['first_name'])
|
93 |
+
->setCity($initial_state['city'])
|
94 |
+
->setState($initial_state['state'])
|
95 |
+
->setCountryCode($initial_state['country_code'])
|
96 |
+
->setZipCode($initial_state['zip_code'])
|
97 |
+
->setExternalId($initial_state['external_id'])
|
98 |
+
->setClientIpAddress($initial_state['client_ip_address'])
|
99 |
+
->setClientUserAgent($initial_state['client_user_agent'])
|
100 |
+
->setFbc($initial_state['fbc'])
|
101 |
+
->setFbp($initial_state['fbp'])
|
102 |
+
->setSubscriptionId($initial_state['subscription_id'])
|
103 |
+
->setFbLoginId($initial_state['fb_login_id'])
|
104 |
+
->setLeadId($initial_state['lead_id'])
|
105 |
+
->setF5first($initial_state['f5first'])
|
106 |
+
->setF5last($initial_state['f5last'])
|
107 |
+
->setFi($initial_state['fi'])
|
108 |
+
->setDobd($initial_state['dobd'])
|
109 |
+
->setDobm($initial_state['dobm'])
|
110 |
+
->setDoby($initial_state['doby']);
|
111 |
+
$this->assertEquals($expected, $builder->normalize());
|
112 |
+
|
113 |
+
$constructor = new UserData($initial_state);
|
114 |
+
$this->assertEquals($expected, $constructor->normalize());
|
115 |
+
}
|
116 |
+
}
|
vendor/guzzlehttp/guzzle/.php_cs
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$config = PhpCsFixer\Config::create()
|
4 |
+
->setRiskyAllowed(true)
|
5 |
+
->setRules([
|
6 |
+
'@PSR2' => true,
|
7 |
+
'array_syntax' => ['syntax' => 'short'],
|
8 |
+
'declare_strict_types' => false,
|
9 |
+
'concat_space' => ['spacing'=>'one'],
|
10 |
+
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
|
11 |
+
'ordered_imports' => true,
|
12 |
+
// 'phpdoc_align' => ['align'=>'vertical'],
|
13 |
+
// 'native_function_invocation' => true,
|
14 |
+
])
|
15 |
+
->setFinder(
|
16 |
+
PhpCsFixer\Finder::create()
|
17 |
+
->in(__DIR__.'/src')
|
18 |
+
->in(__DIR__.'/tests')
|
19 |
+
->name('*.php')
|
20 |
+
)
|
21 |
+
;
|
22 |
+
|
23 |
+
return $config;
|
vendor/guzzlehttp/guzzle/CHANGELOG.md
ADDED
@@ -0,0 +1,1338 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Change Log
|
2 |
+
|
3 |
+
## 6.5.5 - 2020-06-16
|
4 |
+
|
5 |
+
* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678)
|
6 |
+
|
7 |
+
## 6.5.4 - 2020-05-25
|
8 |
+
|
9 |
+
* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626)
|
10 |
+
|
11 |
+
## 6.5.3 - 2020-04-18
|
12 |
+
|
13 |
+
* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550)
|
14 |
+
* Remove use of internal functions [#2548](https://github.com/guzzle/guzzle/pull/2548)
|
15 |
+
|
16 |
+
## 6.5.2 - 2019-12-23
|
17 |
+
|
18 |
+
* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489)
|
19 |
+
|
20 |
+
## 6.5.1 - 2019-12-21
|
21 |
+
|
22 |
+
* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454)
|
23 |
+
* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424)
|
24 |
+
|
25 |
+
## 6.5.0 - 2019-12-07
|
26 |
+
|
27 |
+
* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143)
|
28 |
+
* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287)
|
29 |
+
* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132)
|
30 |
+
* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132)
|
31 |
+
Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds.
|
32 |
+
**After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.**
|
33 |
+
`Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed.
|
34 |
+
* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348)
|
35 |
+
* Deprecated `ClientInterface::VERSION`
|
36 |
+
|
37 |
+
## 6.4.1 - 2019-10-23
|
38 |
+
|
39 |
+
* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
|
40 |
+
* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`
|
41 |
+
|
42 |
+
## 6.4.0 - 2019-10-23
|
43 |
+
|
44 |
+
* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108)
|
45 |
+
* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081)
|
46 |
+
* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161)
|
47 |
+
* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163)
|
48 |
+
* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242)
|
49 |
+
* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284)
|
50 |
+
* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273)
|
51 |
+
* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335)
|
52 |
+
* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362)
|
53 |
+
|
54 |
+
## 6.3.3 - 2018-04-22
|
55 |
+
|
56 |
+
* Fix: Default headers when decode_content is specified
|
57 |
+
|
58 |
+
|
59 |
+
## 6.3.2 - 2018-03-26
|
60 |
+
|
61 |
+
* Fix: Release process
|
62 |
+
|
63 |
+
|
64 |
+
## 6.3.1 - 2018-03-26
|
65 |
+
|
66 |
+
* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014)
|
67 |
+
* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012)
|
68 |
+
* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999)
|
69 |
+
* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998)
|
70 |
+
* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953)
|
71 |
+
* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915)
|
72 |
+
* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916)
|
73 |
+
|
74 |
+
+ Minor code cleanups, documentation fixes and clarifications.
|
75 |
+
|
76 |
+
|
77 |
+
## 6.3.0 - 2017-06-22
|
78 |
+
|
79 |
+
* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659)
|
80 |
+
* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621)
|
81 |
+
* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580)
|
82 |
+
* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609)
|
83 |
+
* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641)
|
84 |
+
* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611)
|
85 |
+
* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811)
|
86 |
+
* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642)
|
87 |
+
* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569)
|
88 |
+
* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711)
|
89 |
+
* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745)
|
90 |
+
* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721)
|
91 |
+
* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318)
|
92 |
+
* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684)
|
93 |
+
* Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827)
|
94 |
+
|
95 |
+
|
96 |
+
+ Minor code cleanups, documentation fixes and clarifications.
|
97 |
+
|
98 |
+
## 6.2.3 - 2017-02-28
|
99 |
+
|
100 |
+
* Fix deprecations with guzzle/psr7 version 1.4
|
101 |
+
|
102 |
+
## 6.2.2 - 2016-10-08
|
103 |
+
|
104 |
+
* Allow to pass nullable Response to delay callable
|
105 |
+
* Only add scheme when host is present
|
106 |
+
* Fix drain case where content-length is the literal string zero
|
107 |
+
* Obfuscate in-URL credentials in exceptions
|
108 |
+
|
109 |
+
## 6.2.1 - 2016-07-18
|
110 |
+
|
111 |
+
* Address HTTP_PROXY security vulnerability, CVE-2016-5385:
|
112 |
+
https://httpoxy.org/
|
113 |
+
* Fixing timeout bug with StreamHandler:
|
114 |
+
https://github.com/guzzle/guzzle/pull/1488
|
115 |
+
* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when
|
116 |
+
a server does not honor `Connection: close`.
|
117 |
+
* Ignore URI fragment when sending requests.
|
118 |
+
|
119 |
+
## 6.2.0 - 2016-03-21
|
120 |
+
|
121 |
+
* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`.
|
122 |
+
https://github.com/guzzle/guzzle/pull/1389
|
123 |
+
* Bug fix: Fix sleep calculation when waiting for delayed requests.
|
124 |
+
https://github.com/guzzle/guzzle/pull/1324
|
125 |
+
* Feature: More flexible history containers.
|
126 |
+
https://github.com/guzzle/guzzle/pull/1373
|
127 |
+
* Bug fix: defer sink stream opening in StreamHandler.
|
128 |
+
https://github.com/guzzle/guzzle/pull/1377
|
129 |
+
* Bug fix: do not attempt to escape cookie values.
|
130 |
+
https://github.com/guzzle/guzzle/pull/1406
|
131 |
+
* Feature: report original content encoding and length on decoded responses.
|
132 |
+
https://github.com/guzzle/guzzle/pull/1409
|
133 |
+
* Bug fix: rewind seekable request bodies before dispatching to cURL.
|
134 |
+
https://github.com/guzzle/guzzle/pull/1422
|
135 |
+
* Bug fix: provide an empty string to `http_build_query` for HHVM workaround.
|
136 |
+
https://github.com/guzzle/guzzle/pull/1367
|
137 |
+
|
138 |
+
## 6.1.1 - 2015-11-22
|
139 |
+
|
140 |
+
* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler
|
141 |
+
https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4
|
142 |
+
* Feature: HandlerStack is now more generic.
|
143 |
+
https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e
|
144 |
+
* Bug fix: setting verify to false in the StreamHandler now disables peer
|
145 |
+
verification. https://github.com/guzzle/guzzle/issues/1256
|
146 |
+
* Feature: Middleware now uses an exception factory, including more error
|
147 |
+
context. https://github.com/guzzle/guzzle/pull/1282
|
148 |
+
* Feature: better support for disabled functions.
|
149 |
+
https://github.com/guzzle/guzzle/pull/1287
|
150 |
+
* Bug fix: fixed regression where MockHandler was not using `sink`.
|
151 |
+
https://github.com/guzzle/guzzle/pull/1292
|
152 |
+
|
153 |
+
## 6.1.0 - 2015-09-08
|
154 |
+
|
155 |
+
* Feature: Added the `on_stats` request option to provide access to transfer
|
156 |
+
statistics for requests. https://github.com/guzzle/guzzle/pull/1202
|
157 |
+
* Feature: Added the ability to persist session cookies in CookieJars.
|
158 |
+
https://github.com/guzzle/guzzle/pull/1195
|
159 |
+
* Feature: Some compatibility updates for Google APP Engine
|
160 |
+
https://github.com/guzzle/guzzle/pull/1216
|
161 |
+
* Feature: Added support for NO_PROXY to prevent the use of a proxy based on
|
162 |
+
a simple set of rules. https://github.com/guzzle/guzzle/pull/1197
|
163 |
+
* Feature: Cookies can now contain square brackets.
|
164 |
+
https://github.com/guzzle/guzzle/pull/1237
|
165 |
+
* Bug fix: Now correctly parsing `=` inside of quotes in Cookies.
|
166 |
+
https://github.com/guzzle/guzzle/pull/1232
|
167 |
+
* Bug fix: Cusotm cURL options now correctly override curl options of the
|
168 |
+
same name. https://github.com/guzzle/guzzle/pull/1221
|
169 |
+
* Bug fix: Content-Type header is now added when using an explicitly provided
|
170 |
+
multipart body. https://github.com/guzzle/guzzle/pull/1218
|
171 |
+
* Bug fix: Now ignoring Set-Cookie headers that have no name.
|
172 |
+
* Bug fix: Reason phrase is no longer cast to an int in some cases in the
|
173 |
+
cURL handler. https://github.com/guzzle/guzzle/pull/1187
|
174 |
+
* Bug fix: Remove the Authorization header when redirecting if the Host
|
175 |
+
header changes. https://github.com/guzzle/guzzle/pull/1207
|
176 |
+
* Bug fix: Cookie path matching fixes
|
177 |
+
https://github.com/guzzle/guzzle/issues/1129
|
178 |
+
* Bug fix: Fixing the cURL `body_as_string` setting
|
179 |
+
https://github.com/guzzle/guzzle/pull/1201
|
180 |
+
* Bug fix: quotes are no longer stripped when parsing cookies.
|
181 |
+
https://github.com/guzzle/guzzle/issues/1172
|
182 |
+
* Bug fix: `form_params` and `query` now always uses the `&` separator.
|
183 |
+
https://github.com/guzzle/guzzle/pull/1163
|
184 |
+
* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set.
|
185 |
+
https://github.com/guzzle/guzzle/pull/1189
|
186 |
+
|
187 |
+
## 6.0.2 - 2015-07-04
|
188 |
+
|
189 |
+
* Fixed a memory leak in the curl handlers in which references to callbacks
|
190 |
+
were not being removed by `curl_reset`.
|
191 |
+
* Cookies are now extracted properly before redirects.
|
192 |
+
* Cookies now allow more character ranges.
|
193 |
+
* Decoded Content-Encoding responses are now modified to correctly reflect
|
194 |
+
their state if the encoding was automatically removed by a handler. This
|
195 |
+
means that the `Content-Encoding` header may be removed an the
|
196 |
+
`Content-Length` modified to reflect the message size after removing the
|
197 |
+
encoding.
|
198 |
+
* Added a more explicit error message when trying to use `form_params` and
|
199 |
+
`multipart` in the same request.
|
200 |
+
* Several fixes for HHVM support.
|
201 |
+
* Functions are now conditionally required using an additional level of
|
202 |
+
indirection to help with global Composer installations.
|
203 |
+
|
204 |
+
## 6.0.1 - 2015-05-27
|
205 |
+
|
206 |
+
* Fixed a bug with serializing the `query` request option where the `&`
|
207 |
+
separator was missing.
|
208 |
+
* Added a better error message for when `body` is provided as an array. Please
|
209 |
+
use `form_params` or `multipart` instead.
|
210 |
+
* Various doc fixes.
|
211 |
+
|
212 |
+
## 6.0.0 - 2015-05-26
|
213 |
+
|
214 |
+
* See the UPGRADING.md document for more information.
|
215 |
+
* Added `multipart` and `form_params` request options.
|
216 |
+
* Added `synchronous` request option.
|
217 |
+
* Added the `on_headers` request option.
|
218 |
+
* Fixed `expect` handling.
|
219 |
+
* No longer adding default middlewares in the client ctor. These need to be
|
220 |
+
present on the provided handler in order to work.
|
221 |
+
* Requests are no longer initiated when sending async requests with the
|
222 |
+
CurlMultiHandler. This prevents unexpected recursion from requests completing
|
223 |
+
while ticking the cURL loop.
|
224 |
+
* Removed the semantics of setting `default` to `true`. This is no longer
|
225 |
+
required now that the cURL loop is not ticked for async requests.
|
226 |
+
* Added request and response logging middleware.
|
227 |
+
* No longer allowing self signed certificates when using the StreamHandler.
|
228 |
+
* Ensuring that `sink` is valid if saving to a file.
|
229 |
+
* Request exceptions now include a "handler context" which provides handler
|
230 |
+
specific contextual information.
|
231 |
+
* Added `GuzzleHttp\RequestOptions` to allow request options to be applied
|
232 |
+
using constants.
|
233 |
+
* `$maxHandles` has been removed from CurlMultiHandler.
|
234 |
+
* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package.
|
235 |
+
|
236 |
+
## 5.3.0 - 2015-05-19
|
237 |
+
|
238 |
+
* Mock now supports `save_to`
|
239 |
+
* Marked `AbstractRequestEvent::getTransaction()` as public.
|
240 |
+
* Fixed a bug in which multiple headers using different casing would overwrite
|
241 |
+
previous headers in the associative array.
|
242 |
+
* Added `Utils::getDefaultHandler()`
|
243 |
+
* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated.
|
244 |
+
* URL scheme is now always lowercased.
|
245 |
+
|
246 |
+
## 6.0.0-beta.1
|
247 |
+
|
248 |
+
* Requires PHP >= 5.5
|
249 |
+
* Updated to use PSR-7
|
250 |
+
* Requires immutable messages, which basically means an event based system
|
251 |
+
owned by a request instance is no longer possible.
|
252 |
+
* Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7).
|
253 |
+
* Removed the dependency on `guzzlehttp/streams`. These stream abstractions
|
254 |
+
are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7`
|
255 |
+
namespace.
|
256 |
+
* Added middleware and handler system
|
257 |
+
* Replaced the Guzzle event and subscriber system with a middleware system.
|
258 |
+
* No longer depends on RingPHP, but rather places the HTTP handlers directly
|
259 |
+
in Guzzle, operating on PSR-7 messages.
|
260 |
+
* Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which
|
261 |
+
means the `guzzlehttp/retry-subscriber` is now obsolete.
|
262 |
+
* Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`.
|
263 |
+
* Asynchronous responses
|
264 |
+
* No longer supports the `future` request option to send an async request.
|
265 |
+
Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`,
|
266 |
+
`getAsync`, etc.).
|
267 |
+
* Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid
|
268 |
+
recursion required by chaining and forwarding react promises. See
|
269 |
+
https://github.com/guzzle/promises
|
270 |
+
* Added `requestAsync` and `sendAsync` to send request asynchronously.
|
271 |
+
* Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests
|
272 |
+
asynchronously.
|
273 |
+
* Request options
|
274 |
+
* POST and form updates
|
275 |
+
* Added the `form_fields` and `form_files` request options.
|
276 |
+
* Removed the `GuzzleHttp\Post` namespace.
|
277 |
+
* The `body` request option no longer accepts an array for POST requests.
|
278 |
+
* The `exceptions` request option has been deprecated in favor of the
|
279 |
+
`http_errors` request options.
|
280 |
+
* The `save_to` request option has been deprecated in favor of `sink` request
|
281 |
+
option.
|
282 |
+
* Clients no longer accept an array of URI template string and variables for
|
283 |
+
URI variables. You will need to expand URI templates before passing them
|
284 |
+
into a client constructor or request method.
|
285 |
+
* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are
|
286 |
+
now magic methods that will send synchronous requests.
|
287 |
+
* Replaced `Utils.php` with plain functions in `functions.php`.
|
288 |
+
* Removed `GuzzleHttp\Collection`.
|
289 |
+
* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as
|
290 |
+
an array.
|
291 |
+
* Removed `GuzzleHttp\Query`. Query string handling is now handled using an
|
292 |
+
associative array passed into the `query` request option. The query string
|
293 |
+
is serialized using PHP's `http_build_query`. If you need more control, you
|
294 |
+
can pass the query string in as a string.
|
295 |
+
* `GuzzleHttp\QueryParser` has been replaced with the
|
296 |
+
`GuzzleHttp\Psr7\parse_query`.
|
297 |
+
|
298 |
+
## 5.2.0 - 2015-01-27
|
299 |
+
|
300 |
+
* Added `AppliesHeadersInterface` to make applying headers to a request based
|
301 |
+
on the body more generic and not specific to `PostBodyInterface`.
|
302 |
+
* Reduced the number of stack frames needed to send requests.
|
303 |
+
* Nested futures are now resolved in the client rather than the RequestFsm
|
304 |
+
* Finishing state transitions is now handled in the RequestFsm rather than the
|
305 |
+
RingBridge.
|
306 |
+
* Added a guard in the Pool class to not use recursion for request retries.
|
307 |
+
|
308 |
+
## 5.1.0 - 2014-12-19
|
309 |
+
|
310 |
+
* Pool class no longer uses recursion when a request is intercepted.
|
311 |
+
* The size of a Pool can now be dynamically adjusted using a callback.
|
312 |
+
See https://github.com/guzzle/guzzle/pull/943.
|
313 |
+
* Setting a request option to `null` when creating a request with a client will
|
314 |
+
ensure that the option is not set. This allows you to overwrite default
|
315 |
+
request options on a per-request basis.
|
316 |
+
See https://github.com/guzzle/guzzle/pull/937.
|
317 |
+
* Added the ability to limit which protocols are allowed for redirects by
|
318 |
+
specifying a `protocols` array in the `allow_redirects` request option.
|
319 |
+
* Nested futures due to retries are now resolved when waiting for synchronous
|
320 |
+
responses. See https://github.com/guzzle/guzzle/pull/947.
|
321 |
+
* `"0"` is now an allowed URI path. See
|
322 |
+
https://github.com/guzzle/guzzle/pull/935.
|
323 |
+
* `Query` no longer typehints on the `$query` argument in the constructor,
|
324 |
+
allowing for strings and arrays.
|
325 |
+
* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle
|
326 |
+
specific exceptions if necessary.
|
327 |
+
|
328 |
+
## 5.0.3 - 2014-11-03
|
329 |
+
|
330 |
+
This change updates query strings so that they are treated as un-encoded values
|
331 |
+
by default where the value represents an un-encoded value to send over the
|
332 |
+
wire. A Query object then encodes the value before sending over the wire. This
|
333 |
+
means that even value query string values (e.g., ":") are url encoded. This
|
334 |
+
makes the Query class match PHP's http_build_query function. However, if you
|
335 |
+
want to send requests over the wire using valid query string characters that do
|
336 |
+
not need to be encoded, then you can provide a string to Url::setQuery() and
|
337 |
+
pass true as the second argument to specify that the query string is a raw
|
338 |
+
string that should not be parsed or encoded (unless a call to getQuery() is
|
339 |
+
subsequently made, forcing the query-string to be converted into a Query
|
340 |
+
object).
|
341 |
+
|
342 |
+
## 5.0.2 - 2014-10-30
|
343 |
+
|
344 |
+
* Added a trailing `\r\n` to multipart/form-data payloads. See
|
345 |
+
https://github.com/guzzle/guzzle/pull/871
|
346 |
+
* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs.
|
347 |
+
* Status codes are now returned as integers. See
|
348 |
+
https://github.com/guzzle/guzzle/issues/881
|
349 |
+
* No longer overwriting an existing `application/x-www-form-urlencoded` header
|
350 |
+
when sending POST requests, allowing for customized headers. See
|
351 |
+
https://github.com/guzzle/guzzle/issues/877
|
352 |
+
* Improved path URL serialization.
|
353 |
+
|
354 |
+
* No longer double percent-encoding characters in the path or query string if
|
355 |
+
they are already encoded.
|
356 |
+
* Now properly encoding the supplied path to a URL object, instead of only
|
357 |
+
encoding ' ' and '?'.
|
358 |
+
* Note: This has been changed in 5.0.3 to now encode query string values by
|
359 |
+
default unless the `rawString` argument is provided when setting the query
|
360 |
+
string on a URL: Now allowing many more characters to be present in the
|
361 |
+
query string without being percent encoded. See http://tools.ietf.org/html/rfc3986#appendix-A
|
362 |
+
|
363 |
+
## 5.0.1 - 2014-10-16
|
364 |
+
|
365 |
+
Bugfix release.
|
366 |
+
|
367 |
+
* Fixed an issue where connection errors still returned response object in
|
368 |
+
error and end events event though the response is unusable. This has been
|
369 |
+
corrected so that a response is not returned in the `getResponse` method of
|
370 |
+
these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867
|
371 |
+
* Fixed an issue where transfer statistics were not being populated in the
|
372 |
+
RingBridge. https://github.com/guzzle/guzzle/issues/866
|
373 |
+
|
374 |
+
## 5.0.0 - 2014-10-12
|
375 |
+
|
376 |
+
Adding support for non-blocking responses and some minor API cleanup.
|
377 |
+
|
378 |
+
### New Features
|
379 |
+
|
380 |
+
* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`.
|
381 |
+
* Added a public API for creating a default HTTP adapter.
|
382 |
+
* Updated the redirect plugin to be non-blocking so that redirects are sent
|
383 |
+
concurrently. Other plugins like this can now be updated to be non-blocking.
|
384 |
+
* Added a "progress" event so that you can get upload and download progress
|
385 |
+
events.
|
386 |
+
* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers
|
387 |
+
requests concurrently using a capped pool size as efficiently as possible.
|
388 |
+
* Added `hasListeners()` to EmitterInterface.
|
389 |
+
* Removed `GuzzleHttp\ClientInterface::sendAll` and marked
|
390 |
+
`GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the
|
391 |
+
recommended way).
|
392 |
+
|
393 |
+
### Breaking changes
|
394 |
+
|
395 |
+
The breaking changes in this release are relatively minor. The biggest thing to
|
396 |
+
look out for is that request and response objects no longer implement fluent
|
397 |
+
interfaces.
|
398 |
+
|
399 |
+
* Removed the fluent interfaces (i.e., `return $this`) from requests,
|
400 |
+
responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`,
|
401 |
+
`GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and
|
402 |
+
`GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of
|
403 |
+
why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/.
|
404 |
+
This also makes the Guzzle message interfaces compatible with the current
|
405 |
+
PSR-7 message proposal.
|
406 |
+
* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except
|
407 |
+
for the HTTP request functions from function.php, these functions are now
|
408 |
+
implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode`
|
409 |
+
moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to
|
410 |
+
`GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to
|
411 |
+
`GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be
|
412 |
+
`GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php
|
413 |
+
caused problems for many users: they aren't PSR-4 compliant, require an
|
414 |
+
explicit include, and needed an if-guard to ensure that the functions are not
|
415 |
+
declared multiple times.
|
416 |
+
* Rewrote adapter layer.
|
417 |
+
* Removing all classes from `GuzzleHttp\Adapter`, these are now
|
418 |
+
implemented as callables that are stored in `GuzzleHttp\Ring\Client`.
|
419 |
+
* Removed the concept of "parallel adapters". Sending requests serially or
|
420 |
+
concurrently is now handled using a single adapter.
|
421 |
+
* Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The
|
422 |
+
Transaction object now exposes the request, response, and client as public
|
423 |
+
properties. The getters and setters have been removed.
|
424 |
+
* Removed the "headers" event. This event was only useful for changing the
|
425 |
+
body a response once the headers of the response were known. You can implement
|
426 |
+
a similar behavior in a number of ways. One example might be to use a
|
427 |
+
FnStream that has access to the transaction being sent. For example, when the
|
428 |
+
first byte is written, you could check if the response headers match your
|
429 |
+
expectations, and if so, change the actual stream body that is being
|
430 |
+
written to.
|
431 |
+
* Removed the `asArray` parameter from
|
432 |
+
`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header
|
433 |
+
value as an array, then use the newly added `getHeaderAsArray()` method of
|
434 |
+
`MessageInterface`. This change makes the Guzzle interfaces compatible with
|
435 |
+
the PSR-7 interfaces.
|
436 |
+
* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add
|
437 |
+
custom request options using double-dispatch (this was an implementation
|
438 |
+
detail). Instead, you should now provide an associative array to the
|
439 |
+
constructor which is a mapping of the request option name mapping to a
|
440 |
+
function that applies the option value to a request.
|
441 |
+
* Removed the concept of "throwImmediately" from exceptions and error events.
|
442 |
+
This control mechanism was used to stop a transfer of concurrent requests
|
443 |
+
from completing. This can now be handled by throwing the exception or by
|
444 |
+
cancelling a pool of requests or each outstanding future request individually.
|
445 |
+
* Updated to "GuzzleHttp\Streams" 3.0.
|
446 |
+
* `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a
|
447 |
+
`maxLen` parameter. This update makes the Guzzle streams project
|
448 |
+
compatible with the current PSR-7 proposal.
|
449 |
+
* `GuzzleHttp\Stream\Stream::__construct`,
|
450 |
+
`GuzzleHttp\Stream\Stream::factory`, and
|
451 |
+
`GuzzleHttp\Stream\Utils::create` no longer accept a size in the second
|
452 |
+
argument. They now accept an associative array of options, including the
|
453 |
+
"size" key and "metadata" key which can be used to provide custom metadata.
|
454 |
+
|
455 |
+
## 4.2.2 - 2014-09-08
|
456 |
+
|
457 |
+
* Fixed a memory leak in the CurlAdapter when reusing cURL handles.
|
458 |
+
* No longer using `request_fulluri` in stream adapter proxies.
|
459 |
+
* Relative redirects are now based on the last response, not the first response.
|
460 |
+
|
461 |
+
## 4.2.1 - 2014-08-19
|
462 |
+
|
463 |
+
* Ensuring that the StreamAdapter does not always add a Content-Type header
|
464 |
+
* Adding automated github releases with a phar and zip
|
465 |
+
|
466 |
+
## 4.2.0 - 2014-08-17
|
467 |
+
|
468 |
+
* Now merging in default options using a case-insensitive comparison.
|
469 |
+
Closes https://github.com/guzzle/guzzle/issues/767
|
470 |
+
* Added the ability to automatically decode `Content-Encoding` response bodies
|
471 |
+
using the `decode_content` request option. This is set to `true` by default
|
472 |
+
to decode the response body if it comes over the wire with a
|
473 |
+
`Content-Encoding`. Set this value to `false` to disable decoding the
|
474 |
+
response content, and pass a string to provide a request `Accept-Encoding`
|
475 |
+
header and turn on automatic response decoding. This feature now allows you
|
476 |
+
to pass an `Accept-Encoding` header in the headers of a request but still
|
477 |
+
disable automatic response decoding.
|
478 |
+
Closes https://github.com/guzzle/guzzle/issues/764
|
479 |
+
* Added the ability to throw an exception immediately when transferring
|
480 |
+
requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760
|
481 |
+
* Updating guzzlehttp/streams dependency to ~2.1
|
482 |
+
* No longer utilizing the now deprecated namespaced methods from the stream
|
483 |
+
package.
|
484 |
+
|
485 |
+
## 4.1.8 - 2014-08-14
|
486 |
+
|
487 |
+
* Fixed an issue in the CurlFactory that caused setting the `stream=false`
|
488 |
+
request option to throw an exception.
|
489 |
+
See: https://github.com/guzzle/guzzle/issues/769
|
490 |
+
* TransactionIterator now calls rewind on the inner iterator.
|
491 |
+
See: https://github.com/guzzle/guzzle/pull/765
|
492 |
+
* You can now set the `Content-Type` header to `multipart/form-data`
|
493 |
+
when creating POST requests to force multipart bodies.
|
494 |
+
See https://github.com/guzzle/guzzle/issues/768
|
495 |
+
|
496 |
+
## 4.1.7 - 2014-08-07
|
497 |
+
|
498 |
+
* Fixed an error in the HistoryPlugin that caused the same request and response
|
499 |
+
to be logged multiple times when an HTTP protocol error occurs.
|
500 |
+
* Ensuring that cURL does not add a default Content-Type when no Content-Type
|
501 |
+
has been supplied by the user. This prevents the adapter layer from modifying
|
502 |
+
the request that is sent over the wire after any listeners may have already
|
503 |
+
put the request in a desired state (e.g., signed the request).
|
504 |
+
* Throwing an exception when you attempt to send requests that have the
|
505 |
+
"stream" set to true in parallel using the MultiAdapter.
|
506 |
+
* Only calling curl_multi_select when there are active cURL handles. This was
|
507 |
+
previously changed and caused performance problems on some systems due to PHP
|
508 |
+
always selecting until the maximum select timeout.
|
509 |
+
* Fixed a bug where multipart/form-data POST fields were not correctly
|
510 |
+
aggregated (e.g., values with "&").
|
511 |
+
|
512 |
+
## 4.1.6 - 2014-08-03
|
513 |
+
|
514 |
+
* Added helper methods to make it easier to represent messages as strings,
|
515 |
+
including getting the start line and getting headers as a string.
|
516 |
+
|
517 |
+
## 4.1.5 - 2014-08-02
|
518 |
+
|
519 |
+
* Automatically retrying cURL "Connection died, retrying a fresh connect"
|
520 |
+
errors when possible.
|
521 |
+
* cURL implementation cleanup
|
522 |
+
* Allowing multiple event subscriber listeners to be registered per event by
|
523 |
+
passing an array of arrays of listener configuration.
|
524 |
+
|
525 |
+
## 4.1.4 - 2014-07-22
|
526 |
+
|
527 |
+
* Fixed a bug that caused multi-part POST requests with more than one field to
|
528 |
+
serialize incorrectly.
|
529 |
+
* Paths can now be set to "0"
|
530 |
+
* `ResponseInterface::xml` now accepts a `libxml_options` option and added a
|
531 |
+
missing default argument that was required when parsing XML response bodies.
|
532 |
+
* A `save_to` stream is now created lazily, which means that files are not
|
533 |
+
created on disk unless a request succeeds.
|
534 |
+
|
535 |
+
## 4.1.3 - 2014-07-15
|
536 |
+
|
537 |
+
* Various fixes to multipart/form-data POST uploads
|
538 |
+
* Wrapping function.php in an if-statement to ensure Guzzle can be used
|
539 |
+
globally and in a Composer install
|
540 |
+
* Fixed an issue with generating and merging in events to an event array
|
541 |
+
* POST headers are only applied before sending a request to allow you to change
|
542 |
+
the query aggregator used before uploading
|
543 |
+
* Added much more robust query string parsing
|
544 |
+
* Fixed various parsing and normalization issues with URLs
|
545 |
+
* Fixing an issue where multi-valued headers were not being utilized correctly
|
546 |
+
in the StreamAdapter
|
547 |
+
|
548 |
+
## 4.1.2 - 2014-06-18
|
549 |
+
|
550 |
+
* Added support for sending payloads with GET requests
|
551 |
+
|
552 |
+
## 4.1.1 - 2014-06-08
|
553 |
+
|
554 |
+
* Fixed an issue related to using custom message factory options in subclasses
|
555 |
+
* Fixed an issue with nested form fields in a multi-part POST
|
556 |
+
* Fixed an issue with using the `json` request option for POST requests
|
557 |
+
* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar`
|
558 |
+
|
559 |
+
## 4.1.0 - 2014-05-27
|
560 |
+
|
561 |
+
* Added a `json` request option to easily serialize JSON payloads.
|
562 |
+
* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON.
|
563 |
+
* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`.
|
564 |
+
* Added the ability to provide an emitter to a client in the client constructor.
|
565 |
+
* Added the ability to persist a cookie session using $_SESSION.
|
566 |
+
* Added a trait that can be used to add event listeners to an iterator.
|
567 |
+
* Removed request method constants from RequestInterface.
|
568 |
+
* Fixed warning when invalid request start-lines are received.
|
569 |
+
* Updated MessageFactory to work with custom request option methods.
|
570 |
+
* Updated cacert bundle to latest build.
|
571 |
+
|
572 |
+
4.0.2 (2014-04-16)
|
573 |
+
------------------
|
574 |
+
|
575 |
+
* Proxy requests using the StreamAdapter now properly use request_fulluri (#632)
|
576 |
+
* Added the ability to set scalars as POST fields (#628)
|
577 |
+
|
578 |
+
## 4.0.1 - 2014-04-04
|
579 |
+
|
580 |
+
* The HTTP status code of a response is now set as the exception code of
|
581 |
+
RequestException objects.
|
582 |
+
* 303 redirects will now correctly switch from POST to GET requests.
|
583 |
+
* The default parallel adapter of a client now correctly uses the MultiAdapter.
|
584 |
+
* HasDataTrait now initializes the internal data array as an empty array so
|
585 |
+
that the toArray() method always returns an array.
|
586 |
+
|
587 |
+
## 4.0.0 - 2014-03-29
|
588 |
+
|
589 |
+
* For more information on the 4.0 transition, see:
|
590 |
+
http://mtdowling.com/blog/2014/03/15/guzzle-4-rc/
|
591 |
+
* For information on changes and upgrading, see:
|
592 |
+
https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40
|
593 |
+
* Added `GuzzleHttp\batch()` as a convenience function for sending requests in
|
594 |
+
parallel without needing to write asynchronous code.
|
595 |
+
* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`.
|
596 |
+
You can now pass a callable or an array of associative arrays where each
|
597 |
+
associative array contains the "fn", "priority", and "once" keys.
|
598 |
+
|
599 |
+
## 4.0.0.rc-2 - 2014-03-25
|
600 |
+
|
601 |
+
* Removed `getConfig()` and `setConfig()` from clients to avoid confusion
|
602 |
+
around whether things like base_url, message_factory, etc. should be able to
|
603 |
+
be retrieved or modified.
|
604 |
+
* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface
|
605 |
+
* functions.php functions were renamed using snake_case to match PHP idioms
|
606 |
+
* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and
|
607 |
+
`GUZZLE_CURL_SELECT_TIMEOUT` environment variables
|
608 |
+
* Added the ability to specify custom `sendAll()` event priorities
|
609 |
+
* Added the ability to specify custom stream context options to the stream
|
610 |
+
adapter.
|
611 |
+
* Added a functions.php function for `get_path()` and `set_path()`
|
612 |
+
* CurlAdapter and MultiAdapter now use a callable to generate curl resources
|
613 |
+
* MockAdapter now properly reads a body and emits a `headers` event
|
614 |
+
* Updated Url class to check if a scheme and host are set before adding ":"
|
615 |
+
and "//". This allows empty Url (e.g., "") to be serialized as "".
|
616 |
+
* Parsing invalid XML no longer emits warnings
|
617 |
+
* Curl classes now properly throw AdapterExceptions
|
618 |
+
* Various performance optimizations
|
619 |
+
* Streams are created with the faster `Stream\create()` function
|
620 |
+
* Marked deprecation_proxy() as internal
|
621 |
+
* Test server is now a collection of static methods on a class
|
622 |
+
|
623 |
+
## 4.0.0-rc.1 - 2014-03-15
|
624 |
+
|
625 |
+
* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40
|
626 |
+
|
627 |
+
## 3.8.1 - 2014-01-28
|
628 |
+
|
629 |
+
* Bug: Always using GET requests when redirecting from a 303 response
|
630 |
+
* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in
|
631 |
+
`Guzzle\Http\ClientInterface::setSslVerification()`
|
632 |
+
* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL
|
633 |
+
* Bug: The body of a request can now be set to `"0"`
|
634 |
+
* Sending PHP stream requests no longer forces `HTTP/1.0`
|
635 |
+
* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of
|
636 |
+
each sub-exception
|
637 |
+
* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than
|
638 |
+
clobbering everything).
|
639 |
+
* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators)
|
640 |
+
* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`.
|
641 |
+
For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`.
|
642 |
+
* Now properly escaping the regular expression delimiter when matching Cookie domains.
|
643 |
+
* Network access is now disabled when loading XML documents
|
644 |
+
|
645 |
+
## 3.8.0 - 2013-12-05
|
646 |
+
|
647 |
+
* Added the ability to define a POST name for a file
|
648 |
+
* JSON response parsing now properly walks additionalProperties
|
649 |
+
* cURL error code 18 is now retried automatically in the BackoffPlugin
|
650 |
+
* Fixed a cURL error when URLs contain fragments
|
651 |
+
* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were
|
652 |
+
CurlExceptions
|
653 |
+
* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e)
|
654 |
+
* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS`
|
655 |
+
* Fixed a bug that was encountered when parsing empty header parameters
|
656 |
+
* UriTemplate now has a `setRegex()` method to match the docs
|
657 |
+
* The `debug` request parameter now checks if it is truthy rather than if it exists
|
658 |
+
* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin
|
659 |
+
* Added the ability to combine URLs using strict RFC 3986 compliance
|
660 |
+
* Command objects can now return the validation errors encountered by the command
|
661 |
+
* Various fixes to cache revalidation (#437 and 29797e5)
|
662 |
+
* Various fixes to the AsyncPlugin
|
663 |
+
* Cleaned up build scripts
|
664 |
+
|
665 |
+
## 3.7.4 - 2013-10-02
|
666 |
+
|
667 |
+
* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430)
|
668 |
+
* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp
|
669 |
+
(see https://github.com/aws/aws-sdk-php/issues/147)
|
670 |
+
* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots
|
671 |
+
* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420)
|
672 |
+
* Updated the bundled cacert.pem (#419)
|
673 |
+
* OauthPlugin now supports adding authentication to headers or query string (#425)
|
674 |
+
|
675 |
+
## 3.7.3 - 2013-09-08
|
676 |
+
|
677 |
+
* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and
|
678 |
+
`CommandTransferException`.
|
679 |
+
* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description
|
680 |
+
* Schemas are only injected into response models when explicitly configured.
|
681 |
+
* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of
|
682 |
+
an EntityBody.
|
683 |
+
* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator.
|
684 |
+
* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`.
|
685 |
+
* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody()
|
686 |
+
* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin
|
687 |
+
* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests
|
688 |
+
* Bug fix: Properly parsing headers that contain commas contained in quotes
|
689 |
+
* Bug fix: mimetype guessing based on a filename is now case-insensitive
|
690 |
+
|
691 |
+
## 3.7.2 - 2013-08-02
|
692 |
+
|
693 |
+
* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander
|
694 |
+
See https://github.com/guzzle/guzzle/issues/371
|
695 |
+
* Bug fix: Cookie domains are now matched correctly according to RFC 6265
|
696 |
+
See https://github.com/guzzle/guzzle/issues/377
|
697 |
+
* Bug fix: GET parameters are now used when calculating an OAuth signature
|
698 |
+
* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted
|
699 |
+
* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched
|
700 |
+
* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input.
|
701 |
+
See https://github.com/guzzle/guzzle/issues/379
|
702 |
+
* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See
|
703 |
+
https://github.com/guzzle/guzzle/pull/380
|
704 |
+
* cURL multi cleanup and optimizations
|
705 |
+
|
706 |
+
## 3.7.1 - 2013-07-05
|
707 |
+
|
708 |
+
* Bug fix: Setting default options on a client now works
|
709 |
+
* Bug fix: Setting options on HEAD requests now works. See #352
|
710 |
+
* Bug fix: Moving stream factory before send event to before building the stream. See #353
|
711 |
+
* Bug fix: Cookies no longer match on IP addresses per RFC 6265
|
712 |
+
* Bug fix: Correctly parsing header parameters that are in `<>` and quotes
|
713 |
+
* Added `cert` and `ssl_key` as request options
|
714 |
+
* `Host` header can now diverge from the host part of a URL if the header is set manually
|
715 |
+
* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter
|
716 |
+
* OAuth parameters are only added via the plugin if they aren't already set
|
717 |
+
* Exceptions are now thrown when a URL cannot be parsed
|
718 |
+
* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails
|
719 |
+
* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin
|
720 |
+
|
721 |
+
## 3.7.0 - 2013-06-10
|
722 |
+
|
723 |
+
* See UPGRADING.md for more information on how to upgrade.
|
724 |
+
* Requests now support the ability to specify an array of $options when creating a request to more easily modify a
|
725 |
+
request. You can pass a 'request.options' configuration setting to a client to apply default request options to
|
726 |
+
every request created by a client (e.g. default query string variables, headers, curl options, etc.).
|
727 |
+
* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`.
|
728 |
+
See `Guzzle\Http\StaticClient::mount`.
|
729 |
+
* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests
|
730 |
+
created by a command (e.g. custom headers, query string variables, timeout settings, etc.).
|
731 |
+
* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the
|
732 |
+
headers of a response
|
733 |
+
* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key
|
734 |
+
(e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`)
|
735 |
+
* ServiceBuilders now support storing and retrieving arbitrary data
|
736 |
+
* CachePlugin can now purge all resources for a given URI
|
737 |
+
* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource
|
738 |
+
* CachePlugin now uses the Vary header to determine if a resource is a cache hit
|
739 |
+
* `Guzzle\Http\Message\Response` now implements `\Serializable`
|
740 |
+
* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters
|
741 |
+
* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable
|
742 |
+
* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()`
|
743 |
+
* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size
|
744 |
+
* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message
|
745 |
+
* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older
|
746 |
+
Symfony users can still use the old version of Monolog.
|
747 |
+
* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`.
|
748 |
+
Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`.
|
749 |
+
* Several performance improvements to `Guzzle\Common\Collection`
|
750 |
+
* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`:
|
751 |
+
createRequest, head, delete, put, patch, post, options, prepareRequest
|
752 |
+
* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()`
|
753 |
+
* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface`
|
754 |
+
* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to
|
755 |
+
`Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a
|
756 |
+
resource, string, or EntityBody into the $options parameter to specify the download location of the response.
|
757 |
+
* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a
|
758 |
+
default `array()`
|
759 |
+
* Added `Guzzle\Stream\StreamInterface::isRepeatable`
|
760 |
+
* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use
|
761 |
+
$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or
|
762 |
+
$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`.
|
763 |
+
* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`.
|
764 |
+
* Removed `Guzzle\Http\ClientInterface::expandTemplate()`
|
765 |
+
* Removed `Guzzle\Http\ClientInterface::setRequestFactory()`
|
766 |
+
* Removed `Guzzle\Http\ClientInterface::getCurlMulti()`
|
767 |
+
* Removed `Guzzle\Http\Message\RequestInterface::canCache`
|
768 |
+
* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`
|
769 |
+
* Removed `Guzzle\Http\Message\RequestInterface::isRedirect`
|
770 |
+
* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods.
|
771 |
+
* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting
|
772 |
+
`Guzzle\Common\Version::$emitWarnings` to true.
|
773 |
+
* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use
|
774 |
+
`$request->getResponseBody()->isRepeatable()` instead.
|
775 |
+
* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use
|
776 |
+
`Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
|
777 |
+
* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use
|
778 |
+
`Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
|
779 |
+
* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead.
|
780 |
+
* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead.
|
781 |
+
* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated
|
782 |
+
* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand.
|
783 |
+
These will work through Guzzle 4.0
|
784 |
+
* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params].
|
785 |
+
* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client.
|
786 |
+
* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`.
|
787 |
+
* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`.
|
788 |
+
* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8.
|
789 |
+
* Marked `Guzzle\Common\Collection::inject()` as deprecated.
|
790 |
+
* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');`
|
791 |
+
* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a
|
792 |
+
CacheStorageInterface. These two objects and interface will be removed in a future version.
|
793 |
+
* Always setting X-cache headers on cached responses
|
794 |
+
* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
|
795 |
+
* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface
|
796 |
+
$request, Response $response);`
|
797 |
+
* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);`
|
798 |
+
* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);`
|
799 |
+
* Added `CacheStorageInterface::purge($url)`
|
800 |
+
* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin
|
801 |
+
$plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache,
|
802 |
+
CanCacheStrategyInterface $canCache = null)`
|
803 |
+
* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)`
|
804 |
+
|
805 |
+
## 3.6.0 - 2013-05-29
|
806 |
+
|
807 |
+
* ServiceDescription now implements ToArrayInterface
|
808 |
+
* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters
|
809 |
+
* Guzzle can now correctly parse incomplete URLs
|
810 |
+
* Mixed casing of headers are now forced to be a single consistent casing across all values for that header.
|
811 |
+
* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution
|
812 |
+
* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader().
|
813 |
+
* Specific header implementations can be created for complex headers. When a message creates a header, it uses a
|
814 |
+
HeaderFactory which can map specific headers to specific header classes. There is now a Link header and
|
815 |
+
CacheControl header implementation.
|
816 |
+
* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate
|
817 |
+
* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti()
|
818 |
+
* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in
|
819 |
+
Guzzle\Http\Curl\RequestMediator
|
820 |
+
* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string.
|
821 |
+
* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface
|
822 |
+
* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders()
|
823 |
+
* Removed Guzzle\Parser\ParserRegister::get(). Use getParser()
|
824 |
+
* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser().
|
825 |
+
* All response header helper functions return a string rather than mixing Header objects and strings inconsistently
|
826 |
+
* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle
|
827 |
+
directly via interfaces
|
828 |
+
* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist
|
829 |
+
but are a no-op until removed.
|
830 |
+
* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a
|
831 |
+
`Guzzle\Service\Command\ArrayCommandInterface`.
|
832 |
+
* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response
|
833 |
+
on a request while the request is still being transferred
|
834 |
+
* The ability to case-insensitively search for header values
|
835 |
+
* Guzzle\Http\Message\Header::hasExactHeader
|
836 |
+
* Guzzle\Http\Message\Header::raw. Use getAll()
|
837 |
+
* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object
|
838 |
+
instead.
|
839 |
+
* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess
|
840 |
+
* Added the ability to cast Model objects to a string to view debug information.
|
841 |
+
|
842 |
+
## 3.5.0 - 2013-05-13
|
843 |
+
|
844 |
+
* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times
|
845 |
+
* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove
|
846 |
+
itself from the EventDispatcher)
|
847 |
+
* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values
|
848 |
+
* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too
|
849 |
+
* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a
|
850 |
+
non-existent key
|
851 |
+
* Bug: All __call() method arguments are now required (helps with mocking frameworks)
|
852 |
+
* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference
|
853 |
+
to help with refcount based garbage collection of resources created by sending a request
|
854 |
+
* Deprecating ZF1 cache and log adapters. These will be removed in the next major version.
|
855 |
+
* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the
|
856 |
+
HistoryPlugin for a history.
|
857 |
+
* Added a `responseBody` alias for the `response_body` location
|
858 |
+
* Refactored internals to no longer rely on Response::getRequest()
|
859 |
+
* HistoryPlugin can now be cast to a string
|
860 |
+
* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests
|
861 |
+
and responses that are sent over the wire
|
862 |
+
* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects
|
863 |
+
|
864 |
+
## 3.4.3 - 2013-04-30
|
865 |
+
|
866 |
+
* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response
|
867 |
+
* Added a check to re-extract the temp cacert bundle from the phar before sending each request
|
868 |
+
|
869 |
+
## 3.4.2 - 2013-04-29
|
870 |
+
|
871 |
+
* Bug fix: Stream objects now work correctly with "a" and "a+" modes
|
872 |
+
* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present
|
873 |
+
* Bug fix: AsyncPlugin no longer forces HEAD requests
|
874 |
+
* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter
|
875 |
+
* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails
|
876 |
+
* Setting a response on a request will write to the custom request body from the response body if one is specified
|
877 |
+
* LogPlugin now writes to php://output when STDERR is undefined
|
878 |
+
* Added the ability to set multiple POST files for the same key in a single call
|
879 |
+
* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default
|
880 |
+
* Added the ability to queue CurlExceptions to the MockPlugin
|
881 |
+
* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send)
|
882 |
+
* Configuration loading now allows remote files
|
883 |
+
|
884 |
+
## 3.4.1 - 2013-04-16
|
885 |
+
|
886 |
+
* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti
|
887 |
+
handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost.
|
888 |
+
* Exceptions are now properly grouped when sending requests in parallel
|
889 |
+
* Redirects are now properly aggregated when a multi transaction fails
|
890 |
+
* Redirects now set the response on the original object even in the event of a failure
|
891 |
+
* Bug fix: Model names are now properly set even when using $refs
|
892 |
+
* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax
|
893 |
+
* Added support for oauth_callback in OAuth signatures
|
894 |
+
* Added support for oauth_verifier in OAuth signatures
|
895 |
+
* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection
|
896 |
+
|
897 |
+
## 3.4.0 - 2013-04-11
|
898 |
+
|
899 |
+
* Bug fix: URLs are now resolved correctly based on http://tools.ietf.org/html/rfc3986#section-5.2. #289
|
900 |
+
* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289
|
901 |
+
* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263
|
902 |
+
* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264.
|
903 |
+
* Bug fix: Added `number` type to service descriptions.
|
904 |
+
* Bug fix: empty parameters are removed from an OAuth signature
|
905 |
+
* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header
|
906 |
+
* Bug fix: Fixed "array to string" error when validating a union of types in a service description
|
907 |
+
* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream
|
908 |
+
* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin.
|
909 |
+
* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs.
|
910 |
+
* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections.
|
911 |
+
* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if
|
912 |
+
the Content-Type can be determined based on the entity body or the path of the request.
|
913 |
+
* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder.
|
914 |
+
* Added support for a PSR-3 LogAdapter.
|
915 |
+
* Added a `command.after_prepare` event
|
916 |
+
* Added `oauth_callback` parameter to the OauthPlugin
|
917 |
+
* Added the ability to create a custom stream class when using a stream factory
|
918 |
+
* Added a CachingEntityBody decorator
|
919 |
+
* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized.
|
920 |
+
* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar.
|
921 |
+
* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies
|
922 |
+
* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This
|
923 |
+
means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use
|
924 |
+
POST fields or files (the latter is only used when emulating a form POST in the browser).
|
925 |
+
* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest
|
926 |
+
|
927 |
+
## 3.3.1 - 2013-03-10
|
928 |
+
|
929 |
+
* Added the ability to create PHP streaming responses from HTTP requests
|
930 |
+
* Bug fix: Running any filters when parsing response headers with service descriptions
|
931 |
+
* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing
|
932 |
+
* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across
|
933 |
+
response location visitors.
|
934 |
+
* Bug fix: Removed the possibility of creating configuration files with circular dependencies
|
935 |
+
* RequestFactory::create() now uses the key of a POST file when setting the POST file name
|
936 |
+
* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set
|
937 |
+
|
938 |
+
## 3.3.0 - 2013-03-03
|
939 |
+
|
940 |
+
* A large number of performance optimizations have been made
|
941 |
+
* Bug fix: Added 'wb' as a valid write mode for streams
|
942 |
+
* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned
|
943 |
+
* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()`
|
944 |
+
* BC: Removed `Guzzle\Http\Utils` class
|
945 |
+
* BC: Setting a service description on a client will no longer modify the client's command factories.
|
946 |
+
* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using
|
947 |
+
the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io'
|
948 |
+
* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to
|
949 |
+
lowercase
|
950 |
+
* Operation parameter objects are now lazy loaded internally
|
951 |
+
* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses
|
952 |
+
* Added support for instantiating responseType=class responseClass classes. Classes must implement
|
953 |
+
`Guzzle\Service\Command\ResponseClassInterface`
|
954 |
+
* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These
|
955 |
+
additional properties also support locations and can be used to parse JSON responses where the outermost part of the
|
956 |
+
JSON is an array
|
957 |
+
* Added support for nested renaming of JSON models (rename sentAs to name)
|
958 |
+
* CachePlugin
|
959 |
+
* Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error
|
960 |
+
* Debug headers can now added to cached response in the CachePlugin
|
961 |
+
|
962 |
+
## 3.2.0 - 2013-02-14
|
963 |
+
|
964 |
+
* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients.
|
965 |
+
* URLs with no path no longer contain a "/" by default
|
966 |
+
* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url.
|
967 |
+
* BadResponseException no longer includes the full request and response message
|
968 |
+
* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface
|
969 |
+
* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface
|
970 |
+
* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription
|
971 |
+
* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list
|
972 |
+
* xmlEncoding can now be customized for the XML declaration of a XML service description operation
|
973 |
+
* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value
|
974 |
+
aggregation and no longer uses callbacks
|
975 |
+
* The URL encoding implementation of Guzzle\Http\QueryString can now be customized
|
976 |
+
* Bug fix: Filters were not always invoked for array service description parameters
|
977 |
+
* Bug fix: Redirects now use a target response body rather than a temporary response body
|
978 |
+
* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded
|
979 |
+
* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives
|
980 |
+
|
981 |
+
## 3.1.2 - 2013-01-27
|
982 |
+
|
983 |
+
* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the
|
984 |
+
response body. For example, the XmlVisitor now parses the XML response into an array in the before() method.
|
985 |
+
* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent
|
986 |
+
* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444)
|
987 |
+
* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse()
|
988 |
+
* Setting default headers on a client after setting the user-agent will not erase the user-agent setting
|
989 |
+
|
990 |
+
## 3.1.1 - 2013-01-20
|
991 |
+
|
992 |
+
* Adding wildcard support to Guzzle\Common\Collection::getPath()
|
993 |
+
* Adding alias support to ServiceBuilder configs
|
994 |
+
* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface
|
995 |
+
|
996 |
+
## 3.1.0 - 2013-01-12
|
997 |
+
|
998 |
+
* BC: CurlException now extends from RequestException rather than BadResponseException
|
999 |
+
* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse()
|
1000 |
+
* Added getData to ServiceDescriptionInterface
|
1001 |
+
* Added context array to RequestInterface::setState()
|
1002 |
+
* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http
|
1003 |
+
* Bug: Adding required content-type when JSON request visitor adds JSON to a command
|
1004 |
+
* Bug: Fixing the serialization of a service description with custom data
|
1005 |
+
* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing
|
1006 |
+
an array of successful and failed responses
|
1007 |
+
* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection
|
1008 |
+
* Added Guzzle\Http\IoEmittingEntityBody
|
1009 |
+
* Moved command filtration from validators to location visitors
|
1010 |
+
* Added `extends` attributes to service description parameters
|
1011 |
+
* Added getModels to ServiceDescriptionInterface
|
1012 |
+
|
1013 |
+
## 3.0.7 - 2012-12-19
|
1014 |
+
|
1015 |
+
* Fixing phar detection when forcing a cacert to system if null or true
|
1016 |
+
* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()`
|
1017 |
+
* Cleaning up `Guzzle\Common\Collection::inject` method
|
1018 |
+
* Adding a response_body location to service descriptions
|
1019 |
+
|
1020 |
+
## 3.0.6 - 2012-12-09
|
1021 |
+
|
1022 |
+
* CurlMulti performance improvements
|
1023 |
+
* Adding setErrorResponses() to Operation
|
1024 |
+
* composer.json tweaks
|
1025 |
+
|
1026 |
+
## 3.0.5 - 2012-11-18
|
1027 |
+
|
1028 |
+
* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin
|
1029 |
+
* Bug: Response body can now be a string containing "0"
|
1030 |
+
* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert
|
1031 |
+
* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs
|
1032 |
+
* Added support for XML attributes in service description responses
|
1033 |
+
* DefaultRequestSerializer now supports array URI parameter values for URI template expansion
|
1034 |
+
* Added better mimetype guessing to requests and post files
|
1035 |
+
|
1036 |
+
## 3.0.4 - 2012-11-11
|
1037 |
+
|
1038 |
+
* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value
|
1039 |
+
* Bug: Cookies can now be added that have a name, domain, or value set to "0"
|
1040 |
+
* Bug: Using the system cacert bundle when using the Phar
|
1041 |
+
* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures
|
1042 |
+
* Enhanced cookie jar de-duplication
|
1043 |
+
* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added
|
1044 |
+
* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies
|
1045 |
+
* Added the ability to create any sort of hash for a stream rather than just an MD5 hash
|
1046 |
+
|
1047 |
+
## 3.0.3 - 2012-11-04
|
1048 |
+
|
1049 |
+
* Implementing redirects in PHP rather than cURL
|
1050 |
+
* Added PECL URI template extension and using as default parser if available
|
1051 |
+
* Bug: Fixed Content-Length parsing of Response factory
|
1052 |
+
* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams.
|
1053 |
+
* Adding ToArrayInterface throughout library
|
1054 |
+
* Fixing OauthPlugin to create unique nonce values per request
|
1055 |
+
|
1056 |
+
## 3.0.2 - 2012-10-25
|
1057 |
+
|
1058 |
+
* Magic methods are enabled by default on clients
|
1059 |
+
* Magic methods return the result of a command
|
1060 |
+
* Service clients no longer require a base_url option in the factory
|
1061 |
+
* Bug: Fixed an issue with URI templates where null template variables were being expanded
|
1062 |
+
|
1063 |
+
## 3.0.1 - 2012-10-22
|
1064 |
+
|
1065 |
+
* Models can now be used like regular collection objects by calling filter, map, etc.
|
1066 |
+
* Models no longer require a Parameter structure or initial data in the constructor
|
1067 |
+
* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator`
|
1068 |
+
|
1069 |
+
## 3.0.0 - 2012-10-15
|
1070 |
+
|
1071 |
+
* Rewrote service description format to be based on Swagger
|
1072 |
+
* Now based on JSON schema
|
1073 |
+
* Added nested input structures and nested response models
|
1074 |
+
* Support for JSON and XML input and output models
|
1075 |
+
* Renamed `commands` to `operations`
|
1076 |
+
* Removed dot class notation
|
1077 |
+
* Removed custom types
|
1078 |
+
* Broke the project into smaller top-level namespaces to be more component friendly
|
1079 |
+
* Removed support for XML configs and descriptions. Use arrays or JSON files.
|
1080 |
+
* Removed the Validation component and Inspector
|
1081 |
+
* Moved all cookie code to Guzzle\Plugin\Cookie
|
1082 |
+
* Magic methods on a Guzzle\Service\Client now return the command un-executed.
|
1083 |
+
* Calling getResult() or getResponse() on a command will lazily execute the command if needed.
|
1084 |
+
* Now shipping with cURL's CA certs and using it by default
|
1085 |
+
* Added previousResponse() method to response objects
|
1086 |
+
* No longer sending Accept and Accept-Encoding headers on every request
|
1087 |
+
* Only sending an Expect header by default when a payload is greater than 1MB
|
1088 |
+
* Added/moved client options:
|
1089 |
+
* curl.blacklist to curl.option.blacklist
|
1090 |
+
* Added ssl.certificate_authority
|
1091 |
+
* Added a Guzzle\Iterator component
|
1092 |
+
* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin
|
1093 |
+
* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin)
|
1094 |
+
* Added a more robust caching plugin
|
1095 |
+
* Added setBody to response objects
|
1096 |
+
* Updating LogPlugin to use a more flexible MessageFormatter
|
1097 |
+
* Added a completely revamped build process
|
1098 |
+
* Cleaning up Collection class and removing default values from the get method
|
1099 |
+
* Fixed ZF2 cache adapters
|
1100 |
+
|
1101 |
+
## 2.8.8 - 2012-10-15
|
1102 |
+
|
1103 |
+
* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did
|
1104 |
+
|
1105 |
+
## 2.8.7 - 2012-09-30
|
1106 |
+
|
1107 |
+
* Bug: Fixed config file aliases for JSON includes
|
1108 |
+
* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests
|
1109 |
+
* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload
|
1110 |
+
* Bug: Hardening request and response parsing to account for missing parts
|
1111 |
+
* Bug: Fixed PEAR packaging
|
1112 |
+
* Bug: Fixed Request::getInfo
|
1113 |
+
* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail
|
1114 |
+
* Adding the ability for the namespace Iterator factory to look in multiple directories
|
1115 |
+
* Added more getters/setters/removers from service descriptions
|
1116 |
+
* Added the ability to remove POST fields from OAuth signatures
|
1117 |
+
* OAuth plugin now supports 2-legged OAuth
|
1118 |
+
|
1119 |
+
## 2.8.6 - 2012-09-05
|
1120 |
+
|
1121 |
+
* Added the ability to modify and build service descriptions
|
1122 |
+
* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command
|
1123 |
+
* Added a `json` parameter location
|
1124 |
+
* Now allowing dot notation for classes in the CacheAdapterFactory
|
1125 |
+
* Using the union of two arrays rather than an array_merge when extending service builder services and service params
|
1126 |
+
* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references
|
1127 |
+
in service builder config files.
|
1128 |
+
* Services defined in two different config files that include one another will by default replace the previously
|
1129 |
+
defined service, but you can now create services that extend themselves and merge their settings over the previous
|
1130 |
+
* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like
|
1131 |
+
'_default' with a default JSON configuration file.
|
1132 |
+
|
1133 |
+
## 2.8.5 - 2012-08-29
|
1134 |
+
|
1135 |
+
* Bug: Suppressed empty arrays from URI templates
|
1136 |
+
* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching
|
1137 |
+
* Added support for HTTP responses that do not contain a reason phrase in the start-line
|
1138 |
+
* AbstractCommand commands are now invokable
|
1139 |
+
* Added a way to get the data used when signing an Oauth request before a request is sent
|
1140 |
+
|
1141 |
+
## 2.8.4 - 2012-08-15
|
1142 |
+
|
1143 |
+
* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin
|
1144 |
+
* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable.
|
1145 |
+
* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream
|
1146 |
+
* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream
|
1147 |
+
* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5())
|
1148 |
+
* Added additional response status codes
|
1149 |
+
* Removed SSL information from the default User-Agent header
|
1150 |
+
* DELETE requests can now send an entity body
|
1151 |
+
* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries
|
1152 |
+
* Added the ability of the MockPlugin to consume mocked request bodies
|
1153 |
+
* LogPlugin now exposes request and response objects in the extras array
|
1154 |
+
|
1155 |
+
## 2.8.3 - 2012-07-30
|
1156 |
+
|
1157 |
+
* Bug: Fixed a case where empty POST requests were sent as GET requests
|
1158 |
+
* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body
|
1159 |
+
* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new
|
1160 |
+
* Added multiple inheritance to service description commands
|
1161 |
+
* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()`
|
1162 |
+
* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything
|
1163 |
+
* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles
|
1164 |
+
|
1165 |
+
## 2.8.2 - 2012-07-24
|
1166 |
+
|
1167 |
+
* Bug: Query string values set to 0 are no longer dropped from the query string
|
1168 |
+
* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()`
|
1169 |
+
* Bug: `+` is now treated as an encoded space when parsing query strings
|
1170 |
+
* QueryString and Collection performance improvements
|
1171 |
+
* Allowing dot notation for class paths in filters attribute of a service descriptions
|
1172 |
+
|
1173 |
+
## 2.8.1 - 2012-07-16
|
1174 |
+
|
1175 |
+
* Loosening Event Dispatcher dependency
|
1176 |
+
* POST redirects can now be customized using CURLOPT_POSTREDIR
|
1177 |
+
|
1178 |
+
## 2.8.0 - 2012-07-15
|
1179 |
+
|
1180 |
+
* BC: Guzzle\Http\Query
|
1181 |
+
* Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl)
|
1182 |
+
* Changed isEncodingValues() and isEncodingFields() to isUrlEncoding()
|
1183 |
+
* Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool)
|
1184 |
+
* Changed the aggregation functions of QueryString to be static methods
|
1185 |
+
* Can now use fromString() with querystrings that have a leading ?
|
1186 |
+
* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters
|
1187 |
+
* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body
|
1188 |
+
* Cookies are no longer URL decoded by default
|
1189 |
+
* Bug: URI template variables set to null are no longer expanded
|
1190 |
+
|
1191 |
+
## 2.7.2 - 2012-07-02
|
1192 |
+
|
1193 |
+
* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser.
|
1194 |
+
* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty()
|
1195 |
+
* CachePlugin now allows for a custom request parameter function to check if a request can be cached
|
1196 |
+
* Bug fix: CachePlugin now only caches GET and HEAD requests by default
|
1197 |
+
* Bug fix: Using header glue when transferring headers over the wire
|
1198 |
+
* Allowing deeply nested arrays for composite variables in URI templates
|
1199 |
+
* Batch divisors can now return iterators or arrays
|
1200 |
+
|
1201 |
+
## 2.7.1 - 2012-06-26
|
1202 |
+
|
1203 |
+
* Minor patch to update version number in UA string
|
1204 |
+
* Updating build process
|
1205 |
+
|
1206 |
+
## 2.7.0 - 2012-06-25
|
1207 |
+
|
1208 |
+
* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes.
|
1209 |
+
* BC: Removed magic setX methods from commands
|
1210 |
+
* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method
|
1211 |
+
* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable.
|
1212 |
+
* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity)
|
1213 |
+
* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace
|
1214 |
+
* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin
|
1215 |
+
* Added the ability to set POST fields and files in a service description
|
1216 |
+
* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method
|
1217 |
+
* Adding a command.before_prepare event to clients
|
1218 |
+
* Added BatchClosureTransfer and BatchClosureDivisor
|
1219 |
+
* BatchTransferException now includes references to the batch divisor and transfer strategies
|
1220 |
+
* Fixed some tests so that they pass more reliably
|
1221 |
+
* Added Guzzle\Common\Log\ArrayLogAdapter
|
1222 |
+
|
1223 |
+
## 2.6.6 - 2012-06-10
|
1224 |
+
|
1225 |
+
* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin
|
1226 |
+
* BC: Removing Guzzle\Service\Command\CommandSet
|
1227 |
+
* Adding generic batching system (replaces the batch queue plugin and command set)
|
1228 |
+
* Updating ZF cache and log adapters and now using ZF's composer repository
|
1229 |
+
* Bug: Setting the name of each ApiParam when creating through an ApiCommand
|
1230 |
+
* Adding result_type, result_doc, deprecated, and doc_url to service descriptions
|
1231 |
+
* Bug: Changed the default cookie header casing back to 'Cookie'
|
1232 |
+
|
1233 |
+
## 2.6.5 - 2012-06-03
|
1234 |
+
|
1235 |
+
* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource()
|
1236 |
+
* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from
|
1237 |
+
* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data
|
1238 |
+
* BC: Renaming methods in the CookieJarInterface
|
1239 |
+
* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations
|
1240 |
+
* Making the default glue for HTTP headers ';' instead of ','
|
1241 |
+
* Adding a removeValue to Guzzle\Http\Message\Header
|
1242 |
+
* Adding getCookies() to request interface.
|
1243 |
+
* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber()
|
1244 |
+
|
1245 |
+
## 2.6.4 - 2012-05-30
|
1246 |
+
|
1247 |
+
* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class.
|
1248 |
+
* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand
|
1249 |
+
* Bug: Fixing magic method command calls on clients
|
1250 |
+
* Bug: Email constraint only validates strings
|
1251 |
+
* Bug: Aggregate POST fields when POST files are present in curl handle
|
1252 |
+
* Bug: Fixing default User-Agent header
|
1253 |
+
* Bug: Only appending or prepending parameters in commands if they are specified
|
1254 |
+
* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes
|
1255 |
+
* Allowing the use of dot notation for class namespaces when using instance_of constraint
|
1256 |
+
* Added any_match validation constraint
|
1257 |
+
* Added an AsyncPlugin
|
1258 |
+
* Passing request object to the calculateWait method of the ExponentialBackoffPlugin
|
1259 |
+
* Allowing the result of a command object to be changed
|
1260 |
+
* Parsing location and type sub values when instantiating a service description rather than over and over at runtime
|
1261 |
+
|
1262 |
+
## 2.6.3 - 2012-05-23
|
1263 |
+
|
1264 |
+
* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options.
|
1265 |
+
* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields.
|
1266 |
+
* You can now use an array of data when creating PUT request bodies in the request factory.
|
1267 |
+
* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable.
|
1268 |
+
* [Http] Adding support for Content-Type in multipart POST uploads per upload
|
1269 |
+
* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1])
|
1270 |
+
* Adding more POST data operations for easier manipulation of POST data.
|
1271 |
+
* You can now set empty POST fields.
|
1272 |
+
* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files.
|
1273 |
+
* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate.
|
1274 |
+
* CS updates
|
1275 |
+
|
1276 |
+
## 2.6.2 - 2012-05-19
|
1277 |
+
|
1278 |
+
* [Http] Better handling of nested scope requests in CurlMulti. Requests are now always prepares in the send() method rather than the addRequest() method.
|
1279 |
+
|
1280 |
+
## 2.6.1 - 2012-05-19
|
1281 |
+
|
1282 |
+
* [BC] Removing 'path' support in service descriptions. Use 'uri'.
|
1283 |
+
* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache.
|
1284 |
+
* [BC] Removing Guzzle\Common\NullObject. Use https://github.com/mtdowling/NullObject if you need it.
|
1285 |
+
* [BC] Removing Guzzle\Common\XmlElement.
|
1286 |
+
* All commands, both dynamic and concrete, have ApiCommand objects.
|
1287 |
+
* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits.
|
1288 |
+
* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored.
|
1289 |
+
* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible.
|
1290 |
+
|
1291 |
+
## 2.6.0 - 2012-05-15
|
1292 |
+
|
1293 |
+
* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder
|
1294 |
+
* [BC] Executing a Command returns the result of the command rather than the command
|
1295 |
+
* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed.
|
1296 |
+
* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args.
|
1297 |
+
* [BC] Moving ResourceIterator* to Guzzle\Service\Resource
|
1298 |
+
* [BC] Completely refactored ResourceIterators to iterate over a cloned command object
|
1299 |
+
* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate
|
1300 |
+
* [BC] Guzzle\Guzzle is now deprecated
|
1301 |
+
* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject
|
1302 |
+
* Adding Guzzle\Version class to give version information about Guzzle
|
1303 |
+
* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate()
|
1304 |
+
* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data
|
1305 |
+
* ServiceDescription and ServiceBuilder are now cacheable using similar configs
|
1306 |
+
* Changing the format of XML and JSON service builder configs. Backwards compatible.
|
1307 |
+
* Cleaned up Cookie parsing
|
1308 |
+
* Trimming the default Guzzle User-Agent header
|
1309 |
+
* Adding a setOnComplete() method to Commands that is called when a command completes
|
1310 |
+
* Keeping track of requests that were mocked in the MockPlugin
|
1311 |
+
* Fixed a caching bug in the CacheAdapterFactory
|
1312 |
+
* Inspector objects can be injected into a Command object
|
1313 |
+
* Refactoring a lot of code and tests to be case insensitive when dealing with headers
|
1314 |
+
* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL
|
1315 |
+
* Adding the ability to set global option overrides to service builder configs
|
1316 |
+
* Adding the ability to include other service builder config files from within XML and JSON files
|
1317 |
+
* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method.
|
1318 |
+
|
1319 |
+
## 2.5.0 - 2012-05-08
|
1320 |
+
|
1321 |
+
* Major performance improvements
|
1322 |
+
* [BC] Simplifying Guzzle\Common\Collection. Please check to see if you are using features that are now deprecated.
|
1323 |
+
* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component.
|
1324 |
+
* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates. Use "{}"
|
1325 |
+
* Added the ability to passed parameters to all requests created by a client
|
1326 |
+
* Added callback functionality to the ExponentialBackoffPlugin
|
1327 |
+
* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies.
|
1328 |
+
* Rewinding request stream bodies when retrying requests
|
1329 |
+
* Exception is thrown when JSON response body cannot be decoded
|
1330 |
+
* Added configurable magic method calls to clients and commands. This is off by default.
|
1331 |
+
* Fixed a defect that added a hash to every parsed URL part
|
1332 |
+
* Fixed duplicate none generation for OauthPlugin.
|
1333 |
+
* Emitting an event each time a client is generated by a ServiceBuilder
|
1334 |
+
* Using an ApiParams object instead of a Collection for parameters of an ApiCommand
|
1335 |
+
* cache.* request parameters should be renamed to params.cache.*
|
1336 |
+
* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle.
|
1337 |
+
* Added the ability to disable type validation of service descriptions
|
1338 |
+
* ServiceDescriptions and ServiceBuilders are now Serializable
|
vendor/guzzlehttp/guzzle/Dockerfile
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM composer:latest as setup
|
2 |
+
|
3 |
+
RUN mkdir /guzzle
|
4 |
+
|
5 |
+
WORKDIR /guzzle
|
6 |
+
|
7 |
+
RUN set -xe \
|
8 |
+
&& composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár <mark.sagikazar@gmail.com>" --no-interaction \
|
9 |
+
&& composer require guzzlehttp/guzzle
|
10 |
+
|
11 |
+
|
12 |
+
FROM php:7.3
|
13 |
+
|
14 |
+
RUN mkdir /guzzle
|
15 |
+
|
16 |
+
WORKDIR /guzzle
|
17 |
+
|
18 |
+
COPY --from=setup /guzzle /guzzle
|
vendor/guzzlehttp/guzzle/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
of this software and associated documentation files (the "Software"), to deal
|
5 |
+
in the Software without restriction, including without limitation the rights
|
6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
copies of the Software, and to permit persons to whom the Software is
|
8 |
+
furnished to do so, subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in
|
11 |
+
all copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
+
THE SOFTWARE.
|
vendor/guzzlehttp/guzzle/README.md
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Guzzle, PHP HTTP client
|
2 |
+
=======================
|
3 |
+
|
4 |
+
[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases)
|
5 |
+
[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle)
|
6 |
+
[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle)
|
7 |
+
|
8 |
+
Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
|
9 |
+
trivial to integrate with web services.
|
10 |
+
|
11 |
+
- Simple interface for building query strings, POST requests, streaming large
|
12 |
+
uploads, streaming large downloads, using HTTP cookies, uploading JSON data,
|
13 |
+
etc...
|
14 |
+
- Can send both synchronous and asynchronous requests using the same interface.
|
15 |
+
- Uses PSR-7 interfaces for requests, responses, and streams. This allows you
|
16 |
+
to utilize other PSR-7 compatible libraries with Guzzle.
|
17 |
+
- Abstracts away the underlying HTTP transport, allowing you to write
|
18 |
+
environment and transport agnostic code; i.e., no hard dependency on cURL,
|
19 |
+
PHP streams, sockets, or non-blocking event loops.
|
20 |
+
- Middleware system allows you to augment and compose client behavior.
|
21 |
+
|
22 |
+
```php
|
23 |
+
$client = new \GuzzleHttp\Client();
|
24 |
+
$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
|
25 |
+
|
26 |
+
echo $response->getStatusCode(); # 200
|
27 |
+
echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8'
|
28 |
+
echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}'
|
29 |
+
|
30 |
+
# Send an asynchronous request.
|
31 |
+
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
|
32 |
+
$promise = $client->sendAsync($request)->then(function ($response) {
|
33 |
+
echo 'I completed! ' . $response->getBody();
|
34 |
+
});
|
35 |
+
|
36 |
+
$promise->wait();
|
37 |
+
```
|
38 |
+
|
39 |
+
## Help and docs
|
40 |
+
|
41 |
+
- [Documentation](http://guzzlephp.org/)
|
42 |
+
- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle)
|
43 |
+
- [Gitter](https://gitter.im/guzzle/guzzle)
|
44 |
+
|
45 |
+
|
46 |
+
## Installing Guzzle
|
47 |
+
|
48 |
+
The recommended way to install Guzzle is through
|
49 |
+
[Composer](http://getcomposer.org).
|
50 |
+
|
51 |
+
```bash
|
52 |
+
# Install Composer
|
53 |
+
curl -sS https://getcomposer.org/installer | php
|
54 |
+
```
|
55 |
+
|
56 |
+
Next, run the Composer command to install the latest stable version of Guzzle:
|
57 |
+
|
58 |
+
```bash
|
59 |
+
composer require guzzlehttp/guzzle
|
60 |
+
```
|
61 |
+
|
62 |
+
After installing, you need to require Composer's autoloader:
|
63 |
+
|
64 |
+
```php
|
65 |
+
require 'vendor/autoload.php';
|
66 |
+
```
|
67 |
+
|
68 |
+
You can then later update Guzzle using composer:
|
69 |
+
|
70 |
+
```bash
|
71 |
+
composer update
|
72 |
+
```
|
73 |
+
|
74 |
+
|
75 |
+
## Version Guidance
|
76 |
+
|
77 |
+
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|
78 |
+
|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------|
|
79 |
+
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 |
|
80 |
+
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 |
|
81 |
+
| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 |
|
82 |
+
| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 |
|
83 |
+
|
84 |
+
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
|
85 |
+
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
|
86 |
+
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
|
87 |
+
[guzzle-6-repo]: https://github.com/guzzle/guzzle
|
88 |
+
[guzzle-3-docs]: http://guzzle3.readthedocs.org
|
89 |
+
[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/
|
90 |
+
[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/
|
vendor/guzzlehttp/guzzle/UPGRADING.md
ADDED
@@ -0,0 +1,1203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Guzzle Upgrade Guide
|
2 |
+
====================
|
3 |
+
|
4 |
+
5.0 to 6.0
|
5 |
+
----------
|
6 |
+
|
7 |
+
Guzzle now uses [PSR-7](http://www.php-fig.org/psr/psr-7/) for HTTP messages.
|
8 |
+
Due to the fact that these messages are immutable, this prompted a refactoring
|
9 |
+
of Guzzle to use a middleware based system rather than an event system. Any
|
10 |
+
HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be
|
11 |
+
updated to work with the new immutable PSR-7 request and response objects. Any
|
12 |
+
event listeners or subscribers need to be updated to become middleware
|
13 |
+
functions that wrap handlers (or are injected into a
|
14 |
+
`GuzzleHttp\HandlerStack`).
|
15 |
+
|
16 |
+
- Removed `GuzzleHttp\BatchResults`
|
17 |
+
- Removed `GuzzleHttp\Collection`
|
18 |
+
- Removed `GuzzleHttp\HasDataTrait`
|
19 |
+
- Removed `GuzzleHttp\ToArrayInterface`
|
20 |
+
- The `guzzlehttp/streams` dependency has been removed. Stream functionality
|
21 |
+
is now present in the `GuzzleHttp\Psr7` namespace provided by the
|
22 |
+
`guzzlehttp/psr7` package.
|
23 |
+
- Guzzle no longer uses ReactPHP promises and now uses the
|
24 |
+
`guzzlehttp/promises` library. We use a custom promise library for three
|
25 |
+
significant reasons:
|
26 |
+
1. React promises (at the time of writing this) are recursive. Promise
|
27 |
+
chaining and promise resolution will eventually blow the stack. Guzzle
|
28 |
+
promises are not recursive as they use a sort of trampolining technique.
|
29 |
+
Note: there has been movement in the React project to modify promises to
|
30 |
+
no longer utilize recursion.
|
31 |
+
2. Guzzle needs to have the ability to synchronously block on a promise to
|
32 |
+
wait for a result. Guzzle promises allows this functionality (and does
|
33 |
+
not require the use of recursion).
|
34 |
+
3. Because we need to be able to wait on a result, doing so using React
|
35 |
+
promises requires wrapping react promises with RingPHP futures. This
|
36 |
+
overhead is no longer needed, reducing stack sizes, reducing complexity,
|
37 |
+
and improving performance.
|
38 |
+
- `GuzzleHttp\Mimetypes` has been moved to a function in
|
39 |
+
`GuzzleHttp\Psr7\mimetype_from_extension` and
|
40 |
+
`GuzzleHttp\Psr7\mimetype_from_filename`.
|
41 |
+
- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query
|
42 |
+
strings must now be passed into request objects as strings, or provided to
|
43 |
+
the `query` request option when creating requests with clients. The `query`
|
44 |
+
option uses PHP's `http_build_query` to convert an array to a string. If you
|
45 |
+
need a different serialization technique, you will need to pass the query
|
46 |
+
string in as a string. There are a couple helper functions that will make
|
47 |
+
working with query strings easier: `GuzzleHttp\Psr7\parse_query` and
|
48 |
+
`GuzzleHttp\Psr7\build_query`.
|
49 |
+
- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware
|
50 |
+
system based on PSR-7, using RingPHP and it's middleware system as well adds
|
51 |
+
more complexity than the benefits it provides. All HTTP handlers that were
|
52 |
+
present in RingPHP have been modified to work directly with PSR-7 messages
|
53 |
+
and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces
|
54 |
+
complexity in Guzzle, removes a dependency, and improves performance. RingPHP
|
55 |
+
will be maintained for Guzzle 5 support, but will no longer be a part of
|
56 |
+
Guzzle 6.
|
57 |
+
- As Guzzle now uses a middleware based systems the event system and RingPHP
|
58 |
+
integration has been removed. Note: while the event system has been removed,
|
59 |
+
it is possible to add your own type of event system that is powered by the
|
60 |
+
middleware system.
|
61 |
+
- Removed the `Event` namespace.
|
62 |
+
- Removed the `Subscriber` namespace.
|
63 |
+
- Removed `Transaction` class
|
64 |
+
- Removed `RequestFsm`
|
65 |
+
- Removed `RingBridge`
|
66 |
+
- `GuzzleHttp\Subscriber\Cookie` is now provided by
|
67 |
+
`GuzzleHttp\Middleware::cookies`
|
68 |
+
- `GuzzleHttp\Subscriber\HttpError` is now provided by
|
69 |
+
`GuzzleHttp\Middleware::httpError`
|
70 |
+
- `GuzzleHttp\Subscriber\History` is now provided by
|
71 |
+
`GuzzleHttp\Middleware::history`
|
72 |
+
- `GuzzleHttp\Subscriber\Mock` is now provided by
|
73 |
+
`GuzzleHttp\Handler\MockHandler`
|
74 |
+
- `GuzzleHttp\Subscriber\Prepare` is now provided by
|
75 |
+
`GuzzleHttp\PrepareBodyMiddleware`
|
76 |
+
- `GuzzleHttp\Subscriber\Redirect` is now provided by
|
77 |
+
`GuzzleHttp\RedirectMiddleware`
|
78 |
+
- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in
|
79 |
+
`GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone.
|
80 |
+
- Static functions in `GuzzleHttp\Utils` have been moved to namespaced
|
81 |
+
functions under the `GuzzleHttp` namespace. This requires either a Composer
|
82 |
+
based autoloader or you to include functions.php.
|
83 |
+
- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to
|
84 |
+
`GuzzleHttp\ClientInterface::getConfig`.
|
85 |
+
- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed.
|
86 |
+
- The `json` and `xml` methods of response objects has been removed. With the
|
87 |
+
migration to strictly adhering to PSR-7 as the interface for Guzzle messages,
|
88 |
+
adding methods to message interfaces would actually require Guzzle messages
|
89 |
+
to extend from PSR-7 messages rather then work with them directly.
|
90 |
+
|
91 |
+
## Migrating to middleware
|
92 |
+
|
93 |
+
The change to PSR-7 unfortunately required significant refactoring to Guzzle
|
94 |
+
due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event
|
95 |
+
system from plugins. The event system relied on mutability of HTTP messages and
|
96 |
+
side effects in order to work. With immutable messages, you have to change your
|
97 |
+
workflow to become more about either returning a value (e.g., functional
|
98 |
+
middlewares) or setting a value on an object. Guzzle v6 has chosen the
|
99 |
+
functional middleware approach.
|
100 |
+
|
101 |
+
Instead of using the event system to listen for things like the `before` event,
|
102 |
+
you now create a stack based middleware function that intercepts a request on
|
103 |
+
the way in and the promise of the response on the way out. This is a much
|
104 |
+
simpler and more predictable approach than the event system and works nicely
|
105 |
+
with PSR-7 middleware. Due to the use of promises, the middleware system is
|
106 |
+
also asynchronous.
|
107 |
+
|
108 |
+
v5:
|
109 |
+
|
110 |
+
```php
|
111 |
+
use GuzzleHttp\Event\BeforeEvent;
|
112 |
+
$client = new GuzzleHttp\Client();
|
113 |
+
// Get the emitter and listen to the before event.
|
114 |
+
$client->getEmitter()->on('before', function (BeforeEvent $e) {
|
115 |
+
// Guzzle v5 events relied on mutation
|
116 |
+
$e->getRequest()->setHeader('X-Foo', 'Bar');
|
117 |
+
});
|
118 |
+
```
|
119 |
+
|
120 |
+
v6:
|
121 |
+
|
122 |
+
In v6, you can modify the request before it is sent using the `mapRequest`
|
123 |
+
middleware. The idiomatic way in v6 to modify the request/response lifecycle is
|
124 |
+
to setup a handler middleware stack up front and inject the handler into a
|
125 |
+
client.
|
126 |
+
|
127 |
+
```php
|
128 |
+
use GuzzleHttp\Middleware;
|
129 |
+
// Create a handler stack that has all of the default middlewares attached
|
130 |
+
$handler = GuzzleHttp\HandlerStack::create();
|
131 |
+
// Push the handler onto the handler stack
|
132 |
+
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
|
133 |
+
// Notice that we have to return a request object
|
134 |
+
return $request->withHeader('X-Foo', 'Bar');
|
135 |
+
}));
|
136 |
+
// Inject the handler into the client
|
137 |
+
$client = new GuzzleHttp\Client(['handler' => $handler]);
|
138 |
+
```
|
139 |
+
|
140 |
+
## POST Requests
|
141 |
+
|
142 |
+
This version added the [`form_params`](http://guzzle.readthedocs.org/en/latest/request-options.html#form_params)
|
143 |
+
and `multipart` request options. `form_params` is an associative array of
|
144 |
+
strings or array of strings and is used to serialize an
|
145 |
+
`application/x-www-form-urlencoded` POST request. The
|
146 |
+
[`multipart`](http://guzzle.readthedocs.org/en/latest/request-options.html#multipart)
|
147 |
+
option is now used to send a multipart/form-data POST request.
|
148 |
+
|
149 |
+
`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add
|
150 |
+
POST files to a multipart/form-data request.
|
151 |
+
|
152 |
+
The `body` option no longer accepts an array to send POST requests. Please use
|
153 |
+
`multipart` or `form_params` instead.
|
154 |
+
|
155 |
+
The `base_url` option has been renamed to `base_uri`.
|
156 |
+
|
157 |
+
4.x to 5.0
|
158 |
+
----------
|
159 |
+
|
160 |
+
## Rewritten Adapter Layer
|
161 |
+
|
162 |
+
Guzzle now uses [RingPHP](http://ringphp.readthedocs.org/en/latest) to send
|
163 |
+
HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor
|
164 |
+
is still supported, but it has now been renamed to `handler`. Instead of
|
165 |
+
passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP
|
166 |
+
`callable` that follows the RingPHP specification.
|
167 |
+
|
168 |
+
## Removed Fluent Interfaces
|
169 |
+
|
170 |
+
[Fluent interfaces were removed](http://ocramius.github.io/blog/fluent-interfaces-are-evil)
|
171 |
+
from the following classes:
|
172 |
+
|
173 |
+
- `GuzzleHttp\Collection`
|
174 |
+
- `GuzzleHttp\Url`
|
175 |
+
- `GuzzleHttp\Query`
|
176 |
+
- `GuzzleHttp\Post\PostBody`
|
177 |
+
- `GuzzleHttp\Cookie\SetCookie`
|
178 |
+
|
179 |
+
## Removed functions.php
|
180 |
+
|
181 |
+
Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following
|
182 |
+
functions can be used as replacements.
|
183 |
+
|
184 |
+
- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode`
|
185 |
+
- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath`
|
186 |
+
- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path`
|
187 |
+
- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however,
|
188 |
+
deprecated in favor of using `GuzzleHttp\Pool::batch()`.
|
189 |
+
|
190 |
+
The "procedural" global client has been removed with no replacement (e.g.,
|
191 |
+
`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client`
|
192 |
+
object as a replacement.
|
193 |
+
|
194 |
+
## `throwImmediately` has been removed
|
195 |
+
|
196 |
+
The concept of "throwImmediately" has been removed from exceptions and error
|
197 |
+
events. This control mechanism was used to stop a transfer of concurrent
|
198 |
+
requests from completing. This can now be handled by throwing the exception or
|
199 |
+
by cancelling a pool of requests or each outstanding future request
|
200 |
+
individually.
|
201 |
+
|
202 |
+
## headers event has been removed
|
203 |
+
|
204 |
+
Removed the "headers" event. This event was only useful for changing the
|
205 |
+
body a response once the headers of the response were known. You can implement
|
206 |
+
a similar behavior in a number of ways. One example might be to use a
|
207 |
+
FnStream that has access to the transaction being sent. For example, when the
|
208 |
+
first byte is written, you could check if the response headers match your
|
209 |
+
expectations, and if so, change the actual stream body that is being
|
210 |
+
written to.
|
211 |
+
|
212 |
+
## Updates to HTTP Messages
|
213 |
+
|
214 |
+
Removed the `asArray` parameter from
|
215 |
+
`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header
|
216 |
+
value as an array, then use the newly added `getHeaderAsArray()` method of
|
217 |
+
`MessageInterface`. This change makes the Guzzle interfaces compatible with
|
218 |
+
the PSR-7 interfaces.
|
219 |
+
|
220 |
+
3.x to 4.0
|
221 |
+
----------
|
222 |
+
|
223 |
+
## Overarching changes:
|
224 |
+
|
225 |
+
- Now requires PHP 5.4 or greater.
|
226 |
+
- No longer requires cURL to send requests.
|
227 |
+
- Guzzle no longer wraps every exception it throws. Only exceptions that are
|
228 |
+
recoverable are now wrapped by Guzzle.
|
229 |
+
- Various namespaces have been removed or renamed.
|
230 |
+
- No longer requiring the Symfony EventDispatcher. A custom event dispatcher
|
231 |
+
based on the Symfony EventDispatcher is
|
232 |
+
now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant
|
233 |
+
speed and functionality improvements).
|
234 |
+
|
235 |
+
Changes per Guzzle 3.x namespace are described below.
|
236 |
+
|
237 |
+
## Batch
|
238 |
+
|
239 |
+
The `Guzzle\Batch` namespace has been removed. This is best left to
|
240 |
+
third-parties to implement on top of Guzzle's core HTTP library.
|
241 |
+
|
242 |
+
## Cache
|
243 |
+
|
244 |
+
The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement
|
245 |
+
has been implemented yet, but hoping to utilize a PSR cache interface).
|
246 |
+
|
247 |
+
## Common
|
248 |
+
|
249 |
+
- Removed all of the wrapped exceptions. It's better to use the standard PHP
|
250 |
+
library for unrecoverable exceptions.
|
251 |
+
- `FromConfigInterface` has been removed.
|
252 |
+
- `Guzzle\Common\Version` has been removed. The VERSION constant can be found
|
253 |
+
at `GuzzleHttp\ClientInterface::VERSION`.
|
254 |
+
|
255 |
+
### Collection
|
256 |
+
|
257 |
+
- `getAll` has been removed. Use `toArray` to convert a collection to an array.
|
258 |
+
- `inject` has been removed.
|
259 |
+
- `keySearch` has been removed.
|
260 |
+
- `getPath` no longer supports wildcard expressions. Use something better like
|
261 |
+
JMESPath for this.
|
262 |
+
- `setPath` now supports appending to an existing array via the `[]` notation.
|
263 |
+
|
264 |
+
### Events
|
265 |
+
|
266 |
+
Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses
|
267 |
+
`GuzzleHttp\Event\Emitter`.
|
268 |
+
|
269 |
+
- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by
|
270 |
+
`GuzzleHttp\Event\EmitterInterface`.
|
271 |
+
- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by
|
272 |
+
`GuzzleHttp\Event\Emitter`.
|
273 |
+
- `Symfony\Component\EventDispatcher\Event` is replaced by
|
274 |
+
`GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in
|
275 |
+
`GuzzleHttp\Event\EventInterface`.
|
276 |
+
- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and
|
277 |
+
`HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the
|
278 |
+
event emitter of a request, client, etc. now uses the `getEmitter` method
|
279 |
+
rather than the `getDispatcher` method.
|
280 |
+
|
281 |
+
#### Emitter
|
282 |
+
|
283 |
+
- Use the `once()` method to add a listener that automatically removes itself
|
284 |
+
the first time it is invoked.
|
285 |
+
- Use the `listeners()` method to retrieve a list of event listeners rather than
|
286 |
+
the `getListeners()` method.
|
287 |
+
- Use `emit()` instead of `dispatch()` to emit an event from an emitter.
|
288 |
+
- Use `attach()` instead of `addSubscriber()` and `detach()` instead of
|
289 |
+
`removeSubscriber()`.
|
290 |
+
|
291 |
+
```php
|
292 |
+
$mock = new Mock();
|
293 |
+
// 3.x
|
294 |
+
$request->getEventDispatcher()->addSubscriber($mock);
|
295 |
+
$request->getEventDispatcher()->removeSubscriber($mock);
|
296 |
+
// 4.x
|
297 |
+
$request->getEmitter()->attach($mock);
|
298 |
+
$request->getEmitter()->detach($mock);
|
299 |
+
```
|
300 |
+
|
301 |
+
Use the `on()` method to add a listener rather than the `addListener()` method.
|
302 |
+
|
303 |
+
```php
|
304 |
+
// 3.x
|
305 |
+
$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } );
|
306 |
+
// 4.x
|
307 |
+
$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } );
|
308 |
+
```
|
309 |
+
|
310 |
+
## Http
|
311 |
+
|
312 |
+
### General changes
|
313 |
+
|
314 |
+
- The cacert.pem certificate has been moved to `src/cacert.pem`.
|
315 |
+
- Added the concept of adapters that are used to transfer requests over the
|
316 |
+
wire.
|
317 |
+
- Simplified the event system.
|
318 |
+
- Sending requests in parallel is still possible, but batching is no longer a
|
319 |
+
concept of the HTTP layer. Instead, you must use the `complete` and `error`
|
320 |
+
events to asynchronously manage parallel request transfers.
|
321 |
+
- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`.
|
322 |
+
- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`.
|
323 |
+
- QueryAggregators have been rewritten so that they are simply callable
|
324 |
+
functions.
|
325 |
+
- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in
|
326 |
+
`functions.php` for an easy to use static client instance.
|
327 |
+
- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from
|
328 |
+
`GuzzleHttp\Exception\TransferException`.
|
329 |
+
|
330 |
+
### Client
|
331 |
+
|
332 |
+
Calling methods like `get()`, `post()`, `head()`, etc. no longer create and
|
333 |
+
return a request, but rather creates a request, sends the request, and returns
|
334 |
+
the response.
|
335 |
+
|
336 |
+
```php
|
337 |
+
// 3.0
|
338 |
+
$request = $client->get('/');
|
339 |
+
$response = $request->send();
|
340 |
+
|
341 |
+
// 4.0
|
342 |
+
$response = $client->get('/');
|
343 |
+
|
344 |
+
// or, to mirror the previous behavior
|
345 |
+
$request = $client->createRequest('GET', '/');
|
346 |
+
$response = $client->send($request);
|
347 |
+
```
|
348 |
+
|
349 |
+
`GuzzleHttp\ClientInterface` has changed.
|
350 |
+
|
351 |
+
- The `send` method no longer accepts more than one request. Use `sendAll` to
|
352 |
+
send multiple requests in parallel.
|
353 |
+
- `setUserAgent()` has been removed. Use a default request option instead. You
|
354 |
+
could, for example, do something like:
|
355 |
+
`$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`.
|
356 |
+
- `setSslVerification()` has been removed. Use default request options instead,
|
357 |
+
like `$client->setConfig('defaults/verify', true)`.
|
358 |
+
|
359 |
+
`GuzzleHttp\Client` has changed.
|
360 |
+
|
361 |
+
- The constructor now accepts only an associative array. You can include a
|
362 |
+
`base_url` string or array to use a URI template as the base URL of a client.
|
363 |
+
You can also specify a `defaults` key that is an associative array of default
|
364 |
+
request options. You can pass an `adapter` to use a custom adapter,
|
365 |
+
`batch_adapter` to use a custom adapter for sending requests in parallel, or
|
366 |
+
a `message_factory` to change the factory used to create HTTP requests and
|
367 |
+
responses.
|
368 |
+
- The client no longer emits a `client.create_request` event.
|
369 |
+
- Creating requests with a client no longer automatically utilize a URI
|
370 |
+
template. You must pass an array into a creational method (e.g.,
|
371 |
+
`createRequest`, `get`, `put`, etc.) in order to expand a URI template.
|
372 |
+
|
373 |
+
### Messages
|
374 |
+
|
375 |
+
Messages no longer have references to their counterparts (i.e., a request no
|
376 |
+
longer has a reference to it's response, and a response no loger has a
|
377 |
+
reference to its request). This association is now managed through a
|
378 |
+
`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to
|
379 |
+
these transaction objects using request events that are emitted over the
|
380 |
+
lifecycle of a request.
|
381 |
+
|
382 |
+
#### Requests with a body
|
383 |
+
|
384 |
+
- `GuzzleHttp\Message\EntityEnclosingRequest` and
|
385 |
+
`GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The
|
386 |
+
separation between requests that contain a body and requests that do not
|
387 |
+
contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface`
|
388 |
+
handles both use cases.
|
389 |
+
- Any method that previously accepts a `GuzzleHttp\Response` object now accept a
|
390 |
+
`GuzzleHttp\Message\ResponseInterface`.
|
391 |
+
- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to
|
392 |
+
`GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create
|
393 |
+
both requests and responses and is implemented in
|
394 |
+
`GuzzleHttp\Message\MessageFactory`.
|
395 |
+
- POST field and file methods have been removed from the request object. You
|
396 |
+
must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface`
|
397 |
+
to control the format of a POST body. Requests that are created using a
|
398 |
+
standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use
|
399 |
+
a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if
|
400 |
+
the method is POST and no body is provided.
|
401 |
+
|
402 |
+
```php
|
403 |
+
$request = $client->createRequest('POST', '/');
|
404 |
+
$request->getBody()->setField('foo', 'bar');
|
405 |
+
$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r')));
|
406 |
+
```
|
407 |
+
|
408 |
+
#### Headers
|
409 |
+
|
410 |
+
- `GuzzleHttp\Message\Header` has been removed. Header values are now simply
|
411 |
+
represented by an array of values or as a string. Header values are returned
|
412 |
+
as a string by default when retrieving a header value from a message. You can
|
413 |
+
pass an optional argument of `true` to retrieve a header value as an array
|
414 |
+
of strings instead of a single concatenated string.
|
415 |
+
- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to
|
416 |
+
`GuzzleHttp\Post`. This interface has been simplified and now allows the
|
417 |
+
addition of arbitrary headers.
|
418 |
+
- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most
|
419 |
+
of the custom headers are now handled separately in specific
|
420 |
+
subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has
|
421 |
+
been updated to properly handle headers that contain parameters (like the
|
422 |
+
`Link` header).
|
423 |
+
|
424 |
+
#### Responses
|
425 |
+
|
426 |
+
- `GuzzleHttp\Message\Response::getInfo()` and
|
427 |
+
`GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event
|
428 |
+
system to retrieve this type of information.
|
429 |
+
- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed.
|
430 |
+
- `GuzzleHttp\Message\Response::getMessage()` has been removed.
|
431 |
+
- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific
|
432 |
+
methods have moved to the CacheSubscriber.
|
433 |
+
- Header specific helper functions like `getContentMd5()` have been removed.
|
434 |
+
Just use `getHeader('Content-MD5')` instead.
|
435 |
+
- `GuzzleHttp\Message\Response::setRequest()` and
|
436 |
+
`GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event
|
437 |
+
system to work with request and response objects as a transaction.
|
438 |
+
- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the
|
439 |
+
Redirect subscriber instead.
|
440 |
+
- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have
|
441 |
+
been removed. Use `getStatusCode()` instead.
|
442 |
+
|
443 |
+
#### Streaming responses
|
444 |
+
|
445 |
+
Streaming requests can now be created by a client directly, returning a
|
446 |
+
`GuzzleHttp\Message\ResponseInterface` object that contains a body stream
|
447 |
+
referencing an open PHP HTTP stream.
|
448 |
+
|
449 |
+
```php
|
450 |
+
// 3.0
|
451 |
+
use Guzzle\Stream\PhpStreamRequestFactory;
|
452 |
+
$request = $client->get('/');
|
453 |
+
$factory = new PhpStreamRequestFactory();
|
454 |
+
$stream = $factory->fromRequest($request);
|
455 |
+
$data = $stream->read(1024);
|
456 |
+
|
457 |
+
// 4.0
|
458 |
+
$response = $client->get('/', ['stream' => true]);
|
459 |
+
// Read some data off of the stream in the response body
|
460 |
+
$data = $response->getBody()->read(1024);
|
461 |
+
```
|
462 |
+
|
463 |
+
#### Redirects
|
464 |
+
|
465 |
+
The `configureRedirects()` method has been removed in favor of a
|
466 |
+
`allow_redirects` request option.
|
467 |
+
|
468 |
+
```php
|
469 |
+
// Standard redirects with a default of a max of 5 redirects
|
470 |
+
$request = $client->createRequest('GET', '/', ['allow_redirects' => true]);
|
471 |
+
|
472 |
+
// Strict redirects with a custom number of redirects
|
473 |
+
$request = $client->createRequest('GET', '/', [
|
474 |
+
'allow_redirects' => ['max' => 5, 'strict' => true]
|
475 |
+
]);
|
476 |
+
```
|
477 |
+
|
478 |
+
#### EntityBody
|
479 |
+
|
480 |
+
EntityBody interfaces and classes have been removed or moved to
|
481 |
+
`GuzzleHttp\Stream`. All classes and interfaces that once required
|
482 |
+
`GuzzleHttp\EntityBodyInterface` now require
|
483 |
+
`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no
|
484 |
+
longer uses `GuzzleHttp\EntityBody::factory` but now uses
|
485 |
+
`GuzzleHttp\Stream\Stream::factory` or even better:
|
486 |
+
`GuzzleHttp\Stream\create()`.
|
487 |
+
|
488 |
+
- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface`
|
489 |
+
- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream`
|
490 |
+
- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream`
|
491 |
+
- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream`
|
492 |
+
- `Guzzle\Http\IoEmittyinEntityBody` has been removed.
|
493 |
+
|
494 |
+
#### Request lifecycle events
|
495 |
+
|
496 |
+
Requests previously submitted a large number of requests. The number of events
|
497 |
+
emitted over the lifecycle of a request has been significantly reduced to make
|
498 |
+
it easier to understand how to extend the behavior of a request. All events
|
499 |
+
emitted during the lifecycle of a request now emit a custom
|
500 |
+
`GuzzleHttp\Event\EventInterface` object that contains context providing
|
501 |
+
methods and a way in which to modify the transaction at that specific point in
|
502 |
+
time (e.g., intercept the request and set a response on the transaction).
|
503 |
+
|
504 |
+
- `request.before_send` has been renamed to `before` and now emits a
|
505 |
+
`GuzzleHttp\Event\BeforeEvent`
|
506 |
+
- `request.complete` has been renamed to `complete` and now emits a
|
507 |
+
`GuzzleHttp\Event\CompleteEvent`.
|
508 |
+
- `request.sent` has been removed. Use `complete`.
|
509 |
+
- `request.success` has been removed. Use `complete`.
|
510 |
+
- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`.
|
511 |
+
- `request.exception` has been removed. Use `error`.
|
512 |
+
- `request.receive.status_line` has been removed.
|
513 |
+
- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to
|
514 |
+
maintain a status update.
|
515 |
+
- `curl.callback.write` has been removed. Use a custom `StreamInterface` to
|
516 |
+
intercept writes.
|
517 |
+
- `curl.callback.read` has been removed. Use a custom `StreamInterface` to
|
518 |
+
intercept reads.
|
519 |
+
|
520 |
+
`headers` is a new event that is emitted after the response headers of a
|
521 |
+
request have been received before the body of the response is downloaded. This
|
522 |
+
event emits a `GuzzleHttp\Event\HeadersEvent`.
|
523 |
+
|
524 |
+
You can intercept a request and inject a response using the `intercept()` event
|
525 |
+
of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and
|
526 |
+
`GuzzleHttp\Event\ErrorEvent` event.
|
527 |
+
|
528 |
+
See: http://docs.guzzlephp.org/en/latest/events.html
|
529 |
+
|
530 |
+
## Inflection
|
531 |
+
|
532 |
+
The `Guzzle\Inflection` namespace has been removed. This is not a core concern
|
533 |
+
of Guzzle.
|
534 |
+
|
535 |
+
## Iterator
|
536 |
+
|
537 |
+
The `Guzzle\Iterator` namespace has been removed.
|
538 |
+
|
539 |
+
- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and
|
540 |
+
`Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of
|
541 |
+
Guzzle itself.
|
542 |
+
- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent
|
543 |
+
class is shipped with PHP 5.4.
|
544 |
+
- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because
|
545 |
+
it's easier to just wrap an iterator in a generator that maps values.
|
546 |
+
|
547 |
+
For a replacement of these iterators, see https://github.com/nikic/iter
|
548 |
+
|
549 |
+
## Log
|
550 |
+
|
551 |
+
The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The
|
552 |
+
`Guzzle\Log` namespace has been removed. Guzzle now relies on
|
553 |
+
`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been
|
554 |
+
moved to `GuzzleHttp\Subscriber\Log\Formatter`.
|
555 |
+
|
556 |
+
## Parser
|
557 |
+
|
558 |
+
The `Guzzle\Parser` namespace has been removed. This was previously used to
|
559 |
+
make it possible to plug in custom parsers for cookies, messages, URI
|
560 |
+
templates, and URLs; however, this level of complexity is not needed in Guzzle
|
561 |
+
so it has been removed.
|
562 |
+
|
563 |
+
- Cookie: Cookie parsing logic has been moved to
|
564 |
+
`GuzzleHttp\Cookie\SetCookie::fromString`.
|
565 |
+
- Message: Message parsing logic for both requests and responses has been moved
|
566 |
+
to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only
|
567 |
+
used in debugging or deserializing messages, so it doesn't make sense for
|
568 |
+
Guzzle as a library to add this level of complexity to parsing messages.
|
569 |
+
- UriTemplate: URI template parsing has been moved to
|
570 |
+
`GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL
|
571 |
+
URI template library if it is installed.
|
572 |
+
- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously
|
573 |
+
it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary,
|
574 |
+
then developers are free to subclass `GuzzleHttp\Url`.
|
575 |
+
|
576 |
+
## Plugin
|
577 |
+
|
578 |
+
The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`.
|
579 |
+
Several plugins are shipping with the core Guzzle library under this namespace.
|
580 |
+
|
581 |
+
- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar
|
582 |
+
code has moved to `GuzzleHttp\Cookie`.
|
583 |
+
- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin.
|
584 |
+
- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is
|
585 |
+
received.
|
586 |
+
- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin.
|
587 |
+
- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before
|
588 |
+
sending. This subscriber is attached to all requests by default.
|
589 |
+
- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin.
|
590 |
+
|
591 |
+
The following plugins have been removed (third-parties are free to re-implement
|
592 |
+
these if needed):
|
593 |
+
|
594 |
+
- `GuzzleHttp\Plugin\Async` has been removed.
|
595 |
+
- `GuzzleHttp\Plugin\CurlAuth` has been removed.
|
596 |
+
- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This
|
597 |
+
functionality should instead be implemented with event listeners that occur
|
598 |
+
after normal response parsing occurs in the guzzle/command package.
|
599 |
+
|
600 |
+
The following plugins are not part of the core Guzzle package, but are provided
|
601 |
+
in separate repositories:
|
602 |
+
|
603 |
+
- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler
|
604 |
+
to build custom retry policies using simple functions rather than various
|
605 |
+
chained classes. See: https://github.com/guzzle/retry-subscriber
|
606 |
+
- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to
|
607 |
+
https://github.com/guzzle/cache-subscriber
|
608 |
+
- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to
|
609 |
+
https://github.com/guzzle/log-subscriber
|
610 |
+
- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to
|
611 |
+
https://github.com/guzzle/message-integrity-subscriber
|
612 |
+
- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to
|
613 |
+
`GuzzleHttp\Subscriber\MockSubscriber`.
|
614 |
+
- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to
|
615 |
+
https://github.com/guzzle/oauth-subscriber
|
616 |
+
|
617 |
+
## Service
|
618 |
+
|
619 |
+
The service description layer of Guzzle has moved into two separate packages:
|
620 |
+
|
621 |
+
- http://github.com/guzzle/command Provides a high level abstraction over web
|
622 |
+
services by representing web service operations using commands.
|
623 |
+
- http://github.com/guzzle/guzzle-services Provides an implementation of
|
624 |
+
guzzle/command that provides request serialization and response parsing using
|
625 |
+
Guzzle service descriptions.
|
626 |
+
|
627 |
+
## Stream
|
628 |
+
|
629 |
+
Stream have moved to a separate package available at
|
630 |
+
https://github.com/guzzle/streams.
|
631 |
+
|
632 |
+
`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take
|
633 |
+
on the responsibilities of `Guzzle\Http\EntityBody` and
|
634 |
+
`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number
|
635 |
+
of methods implemented by the `StreamInterface` has been drastically reduced to
|
636 |
+
allow developers to more easily extend and decorate stream behavior.
|
637 |
+
|
638 |
+
## Removed methods from StreamInterface
|
639 |
+
|
640 |
+
- `getStream` and `setStream` have been removed to better encapsulate streams.
|
641 |
+
- `getMetadata` and `setMetadata` have been removed in favor of
|
642 |
+
`GuzzleHttp\Stream\MetadataStreamInterface`.
|
643 |
+
- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been
|
644 |
+
removed. This data is accessible when
|
645 |
+
using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`.
|
646 |
+
- `rewind` has been removed. Use `seek(0)` for a similar behavior.
|
647 |
+
|
648 |
+
## Renamed methods
|
649 |
+
|
650 |
+
- `detachStream` has been renamed to `detach`.
|
651 |
+
- `feof` has been renamed to `eof`.
|
652 |
+
- `ftell` has been renamed to `tell`.
|
653 |
+
- `readLine` has moved from an instance method to a static class method of
|
654 |
+
`GuzzleHttp\Stream\Stream`.
|
655 |
+
|
656 |
+
## Metadata streams
|
657 |
+
|
658 |
+
`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams
|
659 |
+
that contain additional metadata accessible via `getMetadata()`.
|
660 |
+
`GuzzleHttp\Stream\StreamInterface::getMetadata` and
|
661 |
+
`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed.
|
662 |
+
|
663 |
+
## StreamRequestFactory
|
664 |
+
|
665 |
+
The entire concept of the StreamRequestFactory has been removed. The way this
|
666 |
+
was used in Guzzle 3 broke the actual interface of sending streaming requests
|
667 |
+
(instead of getting back a Response, you got a StreamInterface). Streaming
|
668 |
+
PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`.
|
669 |
+
|
670 |
+
3.6 to 3.7
|
671 |
+
----------
|
672 |
+
|
673 |
+
### Deprecations
|
674 |
+
|
675 |
+
- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.:
|
676 |
+
|
677 |
+
```php
|
678 |
+
\Guzzle\Common\Version::$emitWarnings = true;
|
679 |
+
```
|
680 |
+
|
681 |
+
The following APIs and options have been marked as deprecated:
|
682 |
+
|
683 |
+
- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead.
|
684 |
+
- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
|
685 |
+
- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
|
686 |
+
- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead.
|
687 |
+
- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead.
|
688 |
+
- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated
|
689 |
+
- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client.
|
690 |
+
- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8.
|
691 |
+
- Marked `Guzzle\Common\Collection::inject()` as deprecated.
|
692 |
+
- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use
|
693 |
+
`$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or
|
694 |
+
`$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));`
|
695 |
+
|
696 |
+
3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational
|
697 |
+
request methods. When paired with a client's configuration settings, these options allow you to specify default settings
|
698 |
+
for various aspects of a request. Because these options make other previous configuration options redundant, several
|
699 |
+
configuration options and methods of a client and AbstractCommand have been deprecated.
|
700 |
+
|
701 |
+
- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`.
|
702 |
+
- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`.
|
703 |
+
- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')`
|
704 |
+
- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0
|
705 |
+
|
706 |
+
$command = $client->getCommand('foo', array(
|
707 |
+
'command.headers' => array('Test' => '123'),
|
708 |
+
'command.response_body' => '/path/to/file'
|
709 |
+
));
|
710 |
+
|
711 |
+
// Should be changed to:
|
712 |
+
|
713 |
+
$command = $client->getCommand('foo', array(
|
714 |
+
'command.request_options' => array(
|
715 |
+
'headers' => array('Test' => '123'),
|
716 |
+
'save_as' => '/path/to/file'
|
717 |
+
)
|
718 |
+
));
|
719 |
+
|
720 |
+
### Interface changes
|
721 |
+
|
722 |
+
Additions and changes (you will need to update any implementations or subclasses you may have created):
|
723 |
+
|
724 |
+
- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`:
|
725 |
+
createRequest, head, delete, put, patch, post, options, prepareRequest
|
726 |
+
- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()`
|
727 |
+
- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface`
|
728 |
+
- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to
|
729 |
+
`Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a
|
730 |
+
resource, string, or EntityBody into the $options parameter to specify the download location of the response.
|
731 |
+
- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a
|
732 |
+
default `array()`
|
733 |
+
- Added `Guzzle\Stream\StreamInterface::isRepeatable`
|
734 |
+
- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods.
|
735 |
+
|
736 |
+
The following methods were removed from interfaces. All of these methods are still available in the concrete classes
|
737 |
+
that implement them, but you should update your code to use alternative methods:
|
738 |
+
|
739 |
+
- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use
|
740 |
+
`$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or
|
741 |
+
`$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or
|
742 |
+
`$client->setDefaultOption('headers/{header_name}', 'value')`. or
|
743 |
+
`$client->setDefaultOption('headers', array('header_name' => 'value'))`.
|
744 |
+
- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`.
|
745 |
+
- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail.
|
746 |
+
- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail.
|
747 |
+
- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail.
|
748 |
+
- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin.
|
749 |
+
- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin.
|
750 |
+
- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin.
|
751 |
+
|
752 |
+
### Cache plugin breaking changes
|
753 |
+
|
754 |
+
- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a
|
755 |
+
CacheStorageInterface. These two objects and interface will be removed in a future version.
|
756 |
+
- Always setting X-cache headers on cached responses
|
757 |
+
- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
|
758 |
+
- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface
|
759 |
+
$request, Response $response);`
|
760 |
+
- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);`
|
761 |
+
- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);`
|
762 |
+
- Added `CacheStorageInterface::purge($url)`
|
763 |
+
- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin
|
764 |
+
$plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache,
|
765 |
+
CanCacheStrategyInterface $canCache = null)`
|
766 |
+
- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)`
|
767 |
+
|
768 |
+
3.5 to 3.6
|
769 |
+
----------
|
770 |
+
|
771 |
+
* Mixed casing of headers are now forced to be a single consistent casing across all values for that header.
|
772 |
+
* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution
|
773 |
+
* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader().
|
774 |
+
For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader().
|
775 |
+
Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request.
|
776 |
+
* Specific header implementations can be created for complex headers. When a message creates a header, it uses a
|
777 |
+
HeaderFactory which can map specific headers to specific header classes. There is now a Link header and
|
778 |
+
CacheControl header implementation.
|
779 |
+
* Moved getLinks() from Response to just be used on a Link header object.
|
780 |
+
|
781 |
+
If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the
|
782 |
+
HeaderInterface (e.g. toArray(), getAll(), etc.).
|
783 |
+
|
784 |
+
### Interface changes
|
785 |
+
|
786 |
+
* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate
|
787 |
+
* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti()
|
788 |
+
* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in
|
789 |
+
Guzzle\Http\Curl\RequestMediator
|
790 |
+
* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string.
|
791 |
+
* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface
|
792 |
+
* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders()
|
793 |
+
|
794 |
+
### Removed deprecated functions
|
795 |
+
|
796 |
+
* Removed Guzzle\Parser\ParserRegister::get(). Use getParser()
|
797 |
+
* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser().
|
798 |
+
|
799 |
+
### Deprecations
|
800 |
+
|
801 |
+
* The ability to case-insensitively search for header values
|
802 |
+
* Guzzle\Http\Message\Header::hasExactHeader
|
803 |
+
* Guzzle\Http\Message\Header::raw. Use getAll()
|
804 |
+
* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object
|
805 |
+
instead.
|
806 |
+
|
807 |
+
### Other changes
|
808 |
+
|
809 |
+
* All response header helper functions return a string rather than mixing Header objects and strings inconsistently
|
810 |
+
* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle
|
811 |
+
directly via interfaces
|
812 |
+
* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist
|
813 |
+
but are a no-op until removed.
|
814 |
+
* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a
|
815 |
+
`Guzzle\Service\Command\ArrayCommandInterface`.
|
816 |
+
* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response
|
817 |
+
on a request while the request is still being transferred
|
818 |
+
* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess
|
819 |
+
|
820 |
+
3.3 to 3.4
|
821 |
+
----------
|
822 |
+
|
823 |
+
Base URLs of a client now follow the rules of http://tools.ietf.org/html/rfc3986#section-5.2.2 when merging URLs.
|
824 |
+
|
825 |
+
3.2 to 3.3
|
826 |
+
----------
|
827 |
+
|
828 |
+
### Response::getEtag() quote stripping removed
|
829 |
+
|
830 |
+
`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header
|
831 |
+
|
832 |
+
### Removed `Guzzle\Http\Utils`
|
833 |
+
|
834 |
+
The `Guzzle\Http\Utils` class was removed. This class was only used for testing.
|
835 |
+
|
836 |
+
### Stream wrapper and type
|
837 |
+
|
838 |
+
`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase.
|
839 |
+
|
840 |
+
### curl.emit_io became emit_io
|
841 |
+
|
842 |
+
Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the
|
843 |
+
'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io'
|
844 |
+
|
845 |
+
3.1 to 3.2
|
846 |
+
----------
|
847 |
+
|
848 |
+
### CurlMulti is no longer reused globally
|
849 |
+
|
850 |
+
Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added
|
851 |
+
to a single client can pollute requests dispatched from other clients.
|
852 |
+
|
853 |
+
If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the
|
854 |
+
ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is
|
855 |
+
created.
|
856 |
+
|
857 |
+
```php
|
858 |
+
$multi = new Guzzle\Http\Curl\CurlMulti();
|
859 |
+
$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json');
|
860 |
+
$builder->addListener('service_builder.create_client', function ($event) use ($multi) {
|
861 |
+
$event['client']->setCurlMulti($multi);
|
862 |
+
}
|
863 |
+
});
|
864 |
+
```
|
865 |
+
|
866 |
+
### No default path
|
867 |
+
|
868 |
+
URLs no longer have a default path value of '/' if no path was specified.
|
869 |
+
|
870 |
+
Before:
|
871 |
+
|
872 |
+
```php
|
873 |
+
$request = $client->get('http://www.foo.com');
|
874 |
+
echo $request->getUrl();
|
875 |
+
// >> http://www.foo.com/
|
876 |
+
```
|
877 |
+
|
878 |
+
After:
|
879 |
+
|
880 |
+
```php
|
881 |
+
$request = $client->get('http://www.foo.com');
|
882 |
+
echo $request->getUrl();
|
883 |
+
// >> http://www.foo.com
|
884 |
+
```
|
885 |
+
|
886 |
+
### Less verbose BadResponseException
|
887 |
+
|
888 |
+
The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and
|
889 |
+
response information. You can, however, get access to the request and response object by calling `getRequest()` or
|
890 |
+
`getResponse()` on the exception object.
|
891 |
+
|
892 |
+
### Query parameter aggregation
|
893 |
+
|
894 |
+
Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a
|
895 |
+
setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is
|
896 |
+
responsible for handling the aggregation of multi-valued query string variables into a flattened hash.
|
897 |
+
|
898 |
+
2.8 to 3.x
|
899 |
+
----------
|
900 |
+
|
901 |
+
### Guzzle\Service\Inspector
|
902 |
+
|
903 |
+
Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig`
|
904 |
+
|
905 |
+
**Before**
|
906 |
+
|
907 |
+
```php
|
908 |
+
use Guzzle\Service\Inspector;
|
909 |
+
|
910 |
+
class YourClient extends \Guzzle\Service\Client
|
911 |
+
{
|
912 |
+
public static function factory($config = array())
|
913 |
+
{
|
914 |
+
$default = array();
|
915 |
+
$required = array('base_url', 'username', 'api_key');
|
916 |
+
$config = Inspector::fromConfig($config, $default, $required);
|
917 |
+
|
918 |
+
$client = new self(
|
919 |
+
$config->get('base_url'),
|
920 |
+
$config->get('username'),
|
921 |
+
$config->get('api_key')
|
922 |
+
);
|
923 |
+
$client->setConfig($config);
|
924 |
+
|
925 |
+
$client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json'));
|
926 |
+
|
927 |
+
return $client;
|
928 |
+
}
|
929 |
+
```
|
930 |
+
|
931 |
+
**After**
|
932 |
+
|
933 |
+
```php
|
934 |
+
use Guzzle\Common\Collection;
|
935 |
+
|
936 |
+
class YourClient extends \Guzzle\Service\Client
|
937 |
+
{
|
938 |
+
public static function factory($config = array())
|
939 |
+
{
|
940 |
+
$default = array();
|
941 |
+
$required = array('base_url', 'username', 'api_key');
|
942 |
+
$config = Collection::fromConfig($config, $default, $required);
|
943 |
+
|
944 |
+
$client = new self(
|
945 |
+
$config->get('base_url'),
|
946 |
+
$config->get('username'),
|
947 |
+
$config->get('api_key')
|
948 |
+
);
|
949 |
+
$client->setConfig($config);
|
950 |
+
|
951 |
+
$client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json'));
|
952 |
+
|
953 |
+
return $client;
|
954 |
+
}
|
955 |
+
```
|
956 |
+
|
957 |
+
### Convert XML Service Descriptions to JSON
|
958 |
+
|
959 |
+
**Before**
|
960 |
+
|
961 |
+
```xml
|
962 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
963 |
+
<client>
|
964 |
+
<commands>
|
965 |
+
<!-- Groups -->
|
966 |
+
<command name="list_groups" method="GET" uri="groups.json">
|
967 |
+
<doc>Get a list of groups</doc>
|
968 |
+
</command>
|
969 |
+
<command name="search_groups" method="GET" uri='search.json?query="{{query}} type:group"'>
|
970 |
+
<doc>Uses a search query to get a list of groups</doc>
|
971 |
+
<param name="query" type="string" required="true" />
|
972 |
+
</command>
|
973 |
+
<command name="create_group" method="POST" uri="groups.json">
|
974 |
+
<doc>Create a group</doc>
|
975 |
+
<param name="data" type="array" location="body" filters="json_encode" doc="Group JSON"/>
|
976 |
+
<param name="Content-Type" location="header" static="application/json"/>
|
977 |
+
</command>
|
978 |
+
<command name="delete_group" method="DELETE" uri="groups/{{id}}.json">
|
979 |
+
<doc>Delete a group by ID</doc>
|
980 |
+
<param name="id" type="integer" required="true"/>
|
981 |
+
</command>
|
982 |
+
<command name="get_group" method="GET" uri="groups/{{id}}.json">
|
983 |
+
<param name="id" type="integer" required="true"/>
|
984 |
+
</command>
|
985 |
+
<command name="update_group" method="PUT" uri="groups/{{id}}.json">
|
986 |
+
<doc>Update a group</doc>
|
987 |
+
<param name="id" type="integer" required="true"/>
|
988 |
+
<param name="data" type="array" location="body" filters="json_encode" doc="Group JSON"/>
|
989 |
+
<param name="Content-Type" location="header" static="application/json"/>
|
990 |
+
</command>
|
991 |
+
</commands>
|
992 |
+
</client>
|
993 |
+
```
|
994 |
+
|
995 |
+
**After**
|
996 |
+
|
997 |
+
```json
|
998 |
+
{
|
999 |
+
"name": "Zendesk REST API v2",
|
1000 |
+
"apiVersion": "2012-12-31",
|
1001 |
+
"description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users",
|
1002 |
+
"operations": {
|
1003 |
+
"list_groups": {
|
1004 |
+
"httpMethod":"GET",
|
1005 |
+
"uri": "groups.json",
|
1006 |
+
"summary": "Get a list of groups"
|
1007 |
+
},
|
1008 |
+
"search_groups":{
|
1009 |
+
"httpMethod":"GET",
|
1010 |
+
"uri": "search.json?query=\"{query} type:group\"",
|
1011 |
+
"summary": "Uses a search query to get a list of groups",
|
1012 |
+
"parameters":{
|
1013 |
+
"query":{
|
1014 |
+
"location": "uri",
|
1015 |
+
"description":"Zendesk Search Query",
|
1016 |
+
"type": "string",
|
1017 |
+
"required": true
|
1018 |
+
}
|
1019 |
+
}
|
1020 |
+
},
|
1021 |
+
"create_group": {
|
1022 |
+
"httpMethod":"POST",
|
1023 |
+
"uri": "groups.json",
|
1024 |
+
"summary": "Create a group",
|
1025 |
+
"parameters":{
|
1026 |
+
"data": {
|
1027 |
+
"type": "array",
|
1028 |
+
"location": "body",
|
1029 |
+
"description":"Group JSON",
|
1030 |
+
"filters": "json_encode",
|
1031 |
+
"required": true
|
1032 |
+
},
|
1033 |
+
"Content-Type":{
|
1034 |
+
"type": "string",
|
1035 |
+
"location":"header",
|
1036 |
+
"static": "application/json"
|
1037 |
+
}
|
1038 |
+
}
|
1039 |
+
},
|
1040 |
+
"delete_group": {
|
1041 |
+
"httpMethod":"DELETE",
|
1042 |
+
"uri": "groups/{id}.json",
|
1043 |
+
"summary": "Delete a group",
|
1044 |
+
"parameters":{
|
1045 |
+
"id":{
|
1046 |
+
"location": "uri",
|
1047 |
+
"description":"Group to delete by ID",
|
1048 |
+
"type": "integer",
|
1049 |
+
"required": true
|
1050 |
+
}
|
1051 |
+
}
|
1052 |
+
},
|
1053 |
+
"get_group": {
|
1054 |
+
"httpMethod":"GET",
|
1055 |
+
"uri": "groups/{id}.json",
|
1056 |
+
"summary": "Get a ticket",
|
1057 |
+
"parameters":{
|
1058 |
+
"id":{
|
1059 |
+
"location": "uri",
|
1060 |
+
"description":"Group to get by ID",
|
1061 |
+
"type": "integer",
|
1062 |
+
"required": true
|
1063 |
+
}
|
1064 |
+
}
|
1065 |
+
},
|
1066 |
+
"update_group": {
|
1067 |
+
"httpMethod":"PUT",
|
1068 |
+
"uri": "groups/{id}.json",
|
1069 |
+
"summary": "Update a group",
|
1070 |
+
"parameters":{
|
1071 |
+
"id": {
|
1072 |
+
"location": "uri",
|
1073 |
+
"description":"Group to update by ID",
|
1074 |
+
"type": "integer",
|
1075 |
+
"required": true
|
1076 |
+
},
|
1077 |
+
"data": {
|
1078 |
+
"type": "array",
|
1079 |
+
"location": "body",
|
1080 |
+
"description":"Group JSON",
|
1081 |
+
"filters": "json_encode",
|
1082 |
+
"required": true
|
1083 |
+
},
|
1084 |
+
"Content-Type":{
|
1085 |
+
"type": "string",
|
1086 |
+
"location":"header",
|
1087 |
+
"static": "application/json"
|
1088 |
+
}
|
1089 |
+
}
|
1090 |
+
}
|
1091 |
+
}
|
1092 |
+
```
|
1093 |
+
|
1094 |
+
### Guzzle\Service\Description\ServiceDescription
|
1095 |
+
|
1096 |
+
Commands are now called Operations
|
1097 |
+
|
1098 |
+
**Before**
|
1099 |
+
|
1100 |
+
```php
|
1101 |
+
use Guzzle\Service\Description\ServiceDescription;
|
1102 |
+
|
1103 |
+
$sd = new ServiceDescription();
|
1104 |
+
$sd->getCommands(); // @returns ApiCommandInterface[]
|
1105 |
+
$sd->hasCommand($name);
|
1106 |
+
$sd->getCommand($name); // @returns ApiCommandInterface|null
|
1107 |
+
$sd->addCommand($command); // @param ApiCommandInterface $command
|
1108 |
+
```
|
1109 |
+
|
1110 |
+
**After**
|
1111 |
+
|
1112 |
+
```php
|
1113 |
+
use Guzzle\Service\Description\ServiceDescription;
|
1114 |
+
|
1115 |
+
$sd = new ServiceDescription();
|
1116 |
+
$sd->getOperations(); // @returns OperationInterface[]
|
1117 |
+
$sd->hasOperation($name);
|
1118 |
+
$sd->getOperation($name); // @returns OperationInterface|null
|
1119 |
+
$sd->addOperation($operation); // @param OperationInterface $operation
|
1120 |
+
```
|
1121 |
+
|
1122 |
+
### Guzzle\Common\Inflection\Inflector
|
1123 |
+
|
1124 |
+
Namespace is now `Guzzle\Inflection\Inflector`
|
1125 |
+
|
1126 |
+
### Guzzle\Http\Plugin
|
1127 |
+
|
1128 |
+
Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below.
|
1129 |
+
|
1130 |
+
### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log
|
1131 |
+
|
1132 |
+
Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively.
|
1133 |
+
|
1134 |
+
**Before**
|
1135 |
+
|
1136 |
+
```php
|
1137 |
+
use Guzzle\Common\Log\ClosureLogAdapter;
|
1138 |
+
use Guzzle\Http\Plugin\LogPlugin;
|
1139 |
+
|
1140 |
+
/** @var \Guzzle\Http\Client */
|
1141 |
+
$client;
|
1142 |
+
|
1143 |
+
// $verbosity is an integer indicating desired message verbosity level
|
1144 |
+
$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE);
|
1145 |
+
```
|
1146 |
+
|
1147 |
+
**After**
|
1148 |
+
|
1149 |
+
```php
|
1150 |
+
use Guzzle\Log\ClosureLogAdapter;
|
1151 |
+
use Guzzle\Log\MessageFormatter;
|
1152 |
+
use Guzzle\Plugin\Log\LogPlugin;
|
1153 |
+
|
1154 |
+
/** @var \Guzzle\Http\Client */
|
1155 |
+
$client;
|
1156 |
+
|
1157 |
+
// $format is a string indicating desired message format -- @see MessageFormatter
|
1158 |
+
$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT);
|
1159 |
+
```
|
1160 |
+
|
1161 |
+
### Guzzle\Http\Plugin\CurlAuthPlugin
|
1162 |
+
|
1163 |
+
Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`.
|
1164 |
+
|
1165 |
+
### Guzzle\Http\Plugin\ExponentialBackoffPlugin
|
1166 |
+
|
1167 |
+
Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes.
|
1168 |
+
|
1169 |
+
**Before**
|
1170 |
+
|
1171 |
+
```php
|
1172 |
+
use Guzzle\Http\Plugin\ExponentialBackoffPlugin;
|
1173 |
+
|
1174 |
+
$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge(
|
1175 |
+
ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429)
|
1176 |
+
));
|
1177 |
+
|
1178 |
+
$client->addSubscriber($backoffPlugin);
|
1179 |
+
```
|
1180 |
+
|
1181 |
+
**After**
|
1182 |
+
|
1183 |
+
```php
|
1184 |
+
use Guzzle\Plugin\Backoff\BackoffPlugin;
|
1185 |
+
use Guzzle\Plugin\Backoff\HttpBackoffStrategy;
|
1186 |
+
|
1187 |
+
// Use convenient factory method instead -- see implementation for ideas of what
|
1188 |
+
// you can do with chaining backoff strategies
|
1189 |
+
$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge(
|
1190 |
+
HttpBackoffStrategy::getDefaultFailureCodes(), array(429)
|
1191 |
+
));
|
1192 |
+
$client->addSubscriber($backoffPlugin);
|
1193 |
+
```
|
1194 |
+
|
1195 |
+
### Known Issues
|
1196 |
+
|
1197 |
+
#### [BUG] Accept-Encoding header behavior changed unintentionally.
|
1198 |
+
|
1199 |
+
(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e)
|
1200 |
+
|
1201 |
+
In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to
|
1202 |
+
properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen.
|
1203 |
+
See issue #217 for a workaround, or use a version containing the fix.
|
vendor/guzzlehttp/guzzle/composer.json
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "guzzlehttp/guzzle",
|
3 |
+
"type": "library",
|
4 |
+
"description": "Guzzle is a PHP HTTP client library",
|
5 |
+
"keywords": [
|
6 |
+
"framework",
|
7 |
+
"http",
|
8 |
+
"rest",
|
9 |
+
"web service",
|
10 |
+
"curl",
|
11 |
+
"client",
|
12 |
+
"HTTP client"
|
13 |
+
],
|
14 |
+
"homepage": "http://guzzlephp.org/",
|
15 |
+
"license": "MIT",
|
16 |
+
"authors": [
|
17 |
+
{
|
18 |
+
"name": "Michael Dowling",
|
19 |
+
"email": "mtdowling@gmail.com",
|
20 |
+
"homepage": "https://github.com/mtdowling"
|
21 |
+
}
|
22 |
+
],
|
23 |
+
"require": {
|
24 |
+
"php": ">=5.5",
|
25 |
+
"ext-json": "*",
|
26 |
+
"symfony/polyfill-intl-idn": "^1.17.0",
|
27 |
+
"guzzlehttp/promises": "^1.0",
|
28 |
+
"guzzlehttp/psr7": "^1.6.1"
|
29 |
+
},
|
30 |
+
"require-dev": {
|
31 |
+
"ext-curl": "*",
|
32 |
+
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
33 |
+
"psr/log": "^1.1"
|
34 |
+
},
|
35 |
+
"suggest": {
|
36 |
+
"psr/log": "Required for using the Log middleware"
|
37 |
+
},
|
38 |
+
"config": {
|
39 |
+
"sort-packages": true
|
40 |
+
},
|
41 |
+
"extra": {
|
42 |
+
"branch-alias": {
|
43 |
+
"dev-master": "6.5-dev"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"autoload": {
|
47 |
+
"psr-4": {
|
48 |
+
"GuzzleHttp\\": "src/"
|
49 |
+
},
|
50 |
+
"files": [
|
51 |
+
"src/functions_include.php"
|
52 |
+
]
|
53 |
+
},
|
54 |
+
"autoload-dev": {
|
55 |
+
"psr-4": {
|
56 |
+
"GuzzleHttp\\Tests\\": "tests/"
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
vendor/guzzlehttp/guzzle/src/Client.php
ADDED
@@ -0,0 +1,501 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Cookie\CookieJar;
|
5 |
+
use GuzzleHttp\Exception\GuzzleException;
|
6 |
+
use GuzzleHttp\Promise;
|
7 |
+
use GuzzleHttp\Psr7;
|
8 |
+
use Psr\Http\Message\RequestInterface;
|
9 |
+
use Psr\Http\Message\ResponseInterface;
|
10 |
+
use Psr\Http\Message\UriInterface;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @method ResponseInterface get(string|UriInterface $uri, array $options = [])
|
14 |
+
* @method ResponseInterface head(string|UriInterface $uri, array $options = [])
|
15 |
+
* @method ResponseInterface put(string|UriInterface $uri, array $options = [])
|
16 |
+
* @method ResponseInterface post(string|UriInterface $uri, array $options = [])
|
17 |
+
* @method ResponseInterface patch(string|UriInterface $uri, array $options = [])
|
18 |
+
* @method ResponseInterface delete(string|UriInterface $uri, array $options = [])
|
19 |
+
* @method Promise\PromiseInterface getAsync(string|UriInterface $uri, array $options = [])
|
20 |
+
* @method Promise\PromiseInterface headAsync(string|UriInterface $uri, array $options = [])
|
21 |
+
* @method Promise\PromiseInterface putAsync(string|UriInterface $uri, array $options = [])
|
22 |
+
* @method Promise\PromiseInterface postAsync(string|UriInterface $uri, array $options = [])
|
23 |
+
* @method Promise\PromiseInterface patchAsync(string|UriInterface $uri, array $options = [])
|
24 |
+
* @method Promise\PromiseInterface deleteAsync(string|UriInterface $uri, array $options = [])
|
25 |
+
*/
|
26 |
+
class Client implements ClientInterface
|
27 |
+
{
|
28 |
+
/** @var array Default request options */
|
29 |
+
private $config;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Clients accept an array of constructor parameters.
|
33 |
+
*
|
34 |
+
* Here's an example of creating a client using a base_uri and an array of
|
35 |
+
* default request options to apply to each request:
|
36 |
+
*
|
37 |
+
* $client = new Client([
|
38 |
+
* 'base_uri' => 'http://www.foo.com/1.0/',
|
39 |
+
* 'timeout' => 0,
|
40 |
+
* 'allow_redirects' => false,
|
41 |
+
* 'proxy' => '192.168.16.1:10'
|
42 |
+
* ]);
|
43 |
+
*
|
44 |
+
* Client configuration settings include the following options:
|
45 |
+
*
|
46 |
+
* - handler: (callable) Function that transfers HTTP requests over the
|
47 |
+
* wire. The function is called with a Psr7\Http\Message\RequestInterface
|
48 |
+
* and array of transfer options, and must return a
|
49 |
+
* GuzzleHttp\Promise\PromiseInterface that is fulfilled with a
|
50 |
+
* Psr7\Http\Message\ResponseInterface on success.
|
51 |
+
* If no handler is provided, a default handler will be created
|
52 |
+
* that enables all of the request options below by attaching all of the
|
53 |
+
* default middleware to the handler.
|
54 |
+
* - base_uri: (string|UriInterface) Base URI of the client that is merged
|
55 |
+
* into relative URIs. Can be a string or instance of UriInterface.
|
56 |
+
* - **: any request option
|
57 |
+
*
|
58 |
+
* @param array $config Client configuration settings.
|
59 |
+
*
|
60 |
+
* @see \GuzzleHttp\RequestOptions for a list of available request options.
|
61 |
+
*/
|
62 |
+
public function __construct(array $config = [])
|
63 |
+
{
|
64 |
+
if (!isset($config['handler'])) {
|
65 |
+
$config['handler'] = HandlerStack::create();
|
66 |
+
} elseif (!is_callable($config['handler'])) {
|
67 |
+
throw new \InvalidArgumentException('handler must be a callable');
|
68 |
+
}
|
69 |
+
|
70 |
+
// Convert the base_uri to a UriInterface
|
71 |
+
if (isset($config['base_uri'])) {
|
72 |
+
$config['base_uri'] = Psr7\uri_for($config['base_uri']);
|
73 |
+
}
|
74 |
+
|
75 |
+
$this->configureDefaults($config);
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @param string $method
|
80 |
+
* @param array $args
|
81 |
+
*
|
82 |
+
* @return Promise\PromiseInterface
|
83 |
+
*/
|
84 |
+
public function __call($method, $args)
|
85 |
+
{
|
86 |
+
if (count($args) < 1) {
|
87 |
+
throw new \InvalidArgumentException('Magic request methods require a URI and optional options array');
|
88 |
+
}
|
89 |
+
|
90 |
+
$uri = $args[0];
|
91 |
+
$opts = isset($args[1]) ? $args[1] : [];
|
92 |
+
|
93 |
+
return substr($method, -5) === 'Async'
|
94 |
+
? $this->requestAsync(substr($method, 0, -5), $uri, $opts)
|
95 |
+
: $this->request($method, $uri, $opts);
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Asynchronously send an HTTP request.
|
100 |
+
*
|
101 |
+
* @param array $options Request options to apply to the given
|
102 |
+
* request and to the transfer. See \GuzzleHttp\RequestOptions.
|
103 |
+
*
|
104 |
+
* @return Promise\PromiseInterface
|
105 |
+
*/
|
106 |
+
public function sendAsync(RequestInterface $request, array $options = [])
|
107 |
+
{
|
108 |
+
// Merge the base URI into the request URI if needed.
|
109 |
+
$options = $this->prepareDefaults($options);
|
110 |
+
|
111 |
+
return $this->transfer(
|
112 |
+
$request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')),
|
113 |
+
$options
|
114 |
+
);
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Send an HTTP request.
|
119 |
+
*
|
120 |
+
* @param array $options Request options to apply to the given
|
121 |
+
* request and to the transfer. See \GuzzleHttp\RequestOptions.
|
122 |
+
*
|
123 |
+
* @return ResponseInterface
|
124 |
+
* @throws GuzzleException
|
125 |
+
*/
|
126 |
+
public function send(RequestInterface $request, array $options = [])
|
127 |
+
{
|
128 |
+
$options[RequestOptions::SYNCHRONOUS] = true;
|
129 |
+
return $this->sendAsync($request, $options)->wait();
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Create and send an asynchronous HTTP request.
|
134 |
+
*
|
135 |
+
* Use an absolute path to override the base path of the client, or a
|
136 |
+
* relative path to append to the base path of the client. The URL can
|
137 |
+
* contain the query string as well. Use an array to provide a URL
|
138 |
+
* template and additional variables to use in the URL template expansion.
|
139 |
+
*
|
140 |
+
* @param string $method HTTP method
|
141 |
+
* @param string|UriInterface $uri URI object or string.
|
142 |
+
* @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
|
143 |
+
*
|
144 |
+
* @return Promise\PromiseInterface
|
145 |
+
*/
|
146 |
+
public function requestAsync($method, $uri = '', array $options = [])
|
147 |
+
{
|
148 |
+
$options = $this->prepareDefaults($options);
|
149 |
+
// Remove request modifying parameter because it can be done up-front.
|
150 |
+
$headers = isset($options['headers']) ? $options['headers'] : [];
|
151 |
+
$body = isset($options['body']) ? $options['body'] : null;
|
152 |
+
$version = isset($options['version']) ? $options['version'] : '1.1';
|
153 |
+
// Merge the URI into the base URI.
|
154 |
+
$uri = $this->buildUri($uri, $options);
|
155 |
+
if (is_array($body)) {
|
156 |
+
$this->invalidBody();
|
157 |
+
}
|
158 |
+
$request = new Psr7\Request($method, $uri, $headers, $body, $version);
|
159 |
+
// Remove the option so that they are not doubly-applied.
|
160 |
+
unset($options['headers'], $options['body'], $options['version']);
|
161 |
+
|
162 |
+
return $this->transfer($request, $options);
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Create and send an HTTP request.
|
167 |
+
*
|
168 |
+
* Use an absolute path to override the base path of the client, or a
|
169 |
+
* relative path to append to the base path of the client. The URL can
|
170 |
+
* contain the query string as well.
|
171 |
+
*
|
172 |
+
* @param string $method HTTP method.
|
173 |
+
* @param string|UriInterface $uri URI object or string.
|
174 |
+
* @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
|
175 |
+
*
|
176 |
+
* @return ResponseInterface
|
177 |
+
* @throws GuzzleException
|
178 |
+
*/
|
179 |
+
public function request($method, $uri = '', array $options = [])
|
180 |
+
{
|
181 |
+
$options[RequestOptions::SYNCHRONOUS] = true;
|
182 |
+
return $this->requestAsync($method, $uri, $options)->wait();
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Get a client configuration option.
|
187 |
+
*
|
188 |
+
* These options include default request options of the client, a "handler"
|
189 |
+
* (if utilized by the concrete client), and a "base_uri" if utilized by
|
190 |
+
* the concrete client.
|
191 |
+
*
|
192 |
+
* @param string|null $option The config option to retrieve.
|
193 |
+
*
|
194 |
+
* @return mixed
|
195 |
+
*/
|
196 |
+
public function getConfig($option = null)
|
197 |
+
{
|
198 |
+
return $option === null
|
199 |
+
? $this->config
|
200 |
+
: (isset($this->config[$option]) ? $this->config[$option] : null);
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* @param string|null $uri
|
205 |
+
*
|
206 |
+
* @return UriInterface
|
207 |
+
*/
|
208 |
+
private function buildUri($uri, array $config)
|
209 |
+
{
|
210 |
+
// for BC we accept null which would otherwise fail in uri_for
|
211 |
+
$uri = Psr7\uri_for($uri === null ? '' : $uri);
|
212 |
+
|
213 |
+
if (isset($config['base_uri'])) {
|
214 |
+
$uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
|
215 |
+
}
|
216 |
+
|
217 |
+
if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
|
218 |
+
$idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion'];
|
219 |
+
$uri = Utils::idnUriConvert($uri, $idnOptions);
|
220 |
+
}
|
221 |
+
|
222 |
+
return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Configures the default options for a client.
|
227 |
+
*
|
228 |
+
* @param array $config
|
229 |
+
* @return void
|
230 |
+
*/
|
231 |
+
private function configureDefaults(array $config)
|
232 |
+
{
|
233 |
+
$defaults = [
|
234 |
+
'allow_redirects' => RedirectMiddleware::$defaultSettings,
|
235 |
+
'http_errors' => true,
|
236 |
+
'decode_content' => true,
|
237 |
+
'verify' => true,
|
238 |
+
'cookies' => false,
|
239 |
+
'idn_conversion' => true,
|
240 |
+
];
|
241 |
+
|
242 |
+
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
|
243 |
+
|
244 |
+
// We can only trust the HTTP_PROXY environment variable in a CLI
|
245 |
+
// process due to the fact that PHP has no reliable mechanism to
|
246 |
+
// get environment variables that start with "HTTP_".
|
247 |
+
if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) {
|
248 |
+
$defaults['proxy']['http'] = getenv('HTTP_PROXY');
|
249 |
+
}
|
250 |
+
|
251 |
+
if ($proxy = getenv('HTTPS_PROXY')) {
|
252 |
+
$defaults['proxy']['https'] = $proxy;
|
253 |
+
}
|
254 |
+
|
255 |
+
if ($noProxy = getenv('NO_PROXY')) {
|
256 |
+
$cleanedNoProxy = str_replace(' ', '', $noProxy);
|
257 |
+
$defaults['proxy']['no'] = explode(',', $cleanedNoProxy);
|
258 |
+
}
|
259 |
+
|
260 |
+
$this->config = $config + $defaults;
|
261 |
+
|
262 |
+
if (!empty($config['cookies']) && $config['cookies'] === true) {
|
263 |
+
$this->config['cookies'] = new CookieJar();
|
264 |
+
}
|
265 |
+
|
266 |
+
// Add the default user-agent header.
|
267 |
+
if (!isset($this->config['headers'])) {
|
268 |
+
$this->config['headers'] = ['User-Agent' => default_user_agent()];
|
269 |
+
} else {
|
270 |
+
// Add the User-Agent header if one was not already set.
|
271 |
+
foreach (array_keys($this->config['headers']) as $name) {
|
272 |
+
if (strtolower($name) === 'user-agent') {
|
273 |
+
return;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
$this->config['headers']['User-Agent'] = default_user_agent();
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Merges default options into the array.
|
282 |
+
*
|
283 |
+
* @param array $options Options to modify by reference
|
284 |
+
*
|
285 |
+
* @return array
|
286 |
+
*/
|
287 |
+
private function prepareDefaults(array $options)
|
288 |
+
{
|
289 |
+
$defaults = $this->config;
|
290 |
+
|
291 |
+
if (!empty($defaults['headers'])) {
|
292 |
+
// Default headers are only added if they are not present.
|
293 |
+
$defaults['_conditional'] = $defaults['headers'];
|
294 |
+
unset($defaults['headers']);
|
295 |
+
}
|
296 |
+
|
297 |
+
// Special handling for headers is required as they are added as
|
298 |
+
// conditional headers and as headers passed to a request ctor.
|
299 |
+
if (array_key_exists('headers', $options)) {
|
300 |
+
// Allows default headers to be unset.
|
301 |
+
if ($options['headers'] === null) {
|
302 |
+
$defaults['_conditional'] = [];
|
303 |
+
unset($options['headers']);
|
304 |
+
} elseif (!is_array($options['headers'])) {
|
305 |
+
throw new \InvalidArgumentException('headers must be an array');
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
// Shallow merge defaults underneath options.
|
310 |
+
$result = $options + $defaults;
|
311 |
+
|
312 |
+
// Remove null values.
|
313 |
+
foreach ($result as $k => $v) {
|
314 |
+
if ($v === null) {
|
315 |
+
unset($result[$k]);
|
316 |
+
}
|
317 |
+
}
|
318 |
+
|
319 |
+
return $result;
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Transfers the given request and applies request options.
|
324 |
+
*
|
325 |
+
* The URI of the request is not modified and the request options are used
|
326 |
+
* as-is without merging in default options.
|
327 |
+
*
|
328 |
+
* @param array $options See \GuzzleHttp\RequestOptions.
|
329 |
+
*
|
330 |
+
* @return Promise\PromiseInterface
|
331 |
+
*/
|
332 |
+
private function transfer(RequestInterface $request, array $options)
|
333 |
+
{
|
334 |
+
// save_to -> sink
|
335 |
+
if (isset($options['save_to'])) {
|
336 |
+
$options['sink'] = $options['save_to'];
|
337 |
+
unset($options['save_to']);
|
338 |
+
}
|
339 |
+
|
340 |
+
// exceptions -> http_errors
|
341 |
+
if (isset($options['exceptions'])) {
|
342 |
+
$options['http_errors'] = $options['exceptions'];
|
343 |
+
unset($options['exceptions']);
|
344 |
+
}
|
345 |
+
|
346 |
+
$request = $this->applyOptions($request, $options);
|
347 |
+
/** @var HandlerStack $handler */
|
348 |
+
$handler = $options['handler'];
|
349 |
+
|
350 |
+
try {
|
351 |
+
return Promise\promise_for($handler($request, $options));
|
352 |
+
} catch (\Exception $e) {
|
353 |
+
return Promise\rejection_for($e);
|
354 |
+
}
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Applies the array of request options to a request.
|
359 |
+
*
|
360 |
+
* @param RequestInterface $request
|
361 |
+
* @param array $options
|
362 |
+
*
|
363 |
+
* @return RequestInterface
|
364 |
+
*/
|
365 |
+
private function applyOptions(RequestInterface $request, array &$options)
|
366 |
+
{
|
367 |
+
$modify = [
|
368 |
+
'set_headers' => [],
|
369 |
+
];
|
370 |
+
|
371 |
+
if (isset($options['headers'])) {
|
372 |
+
$modify['set_headers'] = $options['headers'];
|
373 |
+
unset($options['headers']);
|
374 |
+
}
|
375 |
+
|
376 |
+
if (isset($options['form_params'])) {
|
377 |
+
if (isset($options['multipart'])) {
|
378 |
+
throw new \InvalidArgumentException('You cannot use '
|
379 |
+
. 'form_params and multipart at the same time. Use the '
|
380 |
+
. 'form_params option if you want to send application/'
|
381 |
+
. 'x-www-form-urlencoded requests, and the multipart '
|
382 |
+
. 'option to send multipart/form-data requests.');
|
383 |
+
}
|
384 |
+
$options['body'] = http_build_query($options['form_params'], '', '&');
|
385 |
+
unset($options['form_params']);
|
386 |
+
// Ensure that we don't have the header in different case and set the new value.
|
387 |
+
$options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
|
388 |
+
$options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
|
389 |
+
}
|
390 |
+
|
391 |
+
if (isset($options['multipart'])) {
|
392 |
+
$options['body'] = new Psr7\MultipartStream($options['multipart']);
|
393 |
+
unset($options['multipart']);
|
394 |
+
}
|
395 |
+
|
396 |
+
if (isset($options['json'])) {
|
397 |
+
$options['body'] = \GuzzleHttp\json_encode($options['json']);
|
398 |
+
unset($options['json']);
|
399 |
+
// Ensure that we don't have the header in different case and set the new value.
|
400 |
+
$options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
|
401 |
+
$options['_conditional']['Content-Type'] = 'application/json';
|
402 |
+
}
|
403 |
+
|
404 |
+
if (!empty($options['decode_content'])
|
405 |
+
&& $options['decode_content'] !== true
|
406 |
+
) {
|
407 |
+
// Ensure that we don't have the header in different case and set the new value.
|
408 |
+
$options['_conditional'] = Psr7\_caseless_remove(['Accept-Encoding'], $options['_conditional']);
|
409 |
+
$modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
|
410 |
+
}
|
411 |
+
|
412 |
+
if (isset($options['body'])) {
|
413 |
+
if (is_array($options['body'])) {
|
414 |
+
$this->invalidBody();
|
415 |
+
}
|
416 |
+
$modify['body'] = Psr7\stream_for($options['body']);
|
417 |
+
unset($options['body']);
|
418 |
+
}
|
419 |
+
|
420 |
+
if (!empty($options['auth']) && is_array($options['auth'])) {
|
421 |
+
$value = $options['auth'];
|
422 |
+
$type = isset($value[2]) ? strtolower($value[2]) : 'basic';
|
423 |
+
switch ($type) {
|
424 |
+
case 'basic':
|
425 |
+
// Ensure that we don't have the header in different case and set the new value.
|
426 |
+
$modify['set_headers'] = Psr7\_caseless_remove(['Authorization'], $modify['set_headers']);
|
427 |
+
$modify['set_headers']['Authorization'] = 'Basic '
|
428 |
+
. base64_encode("$value[0]:$value[1]");
|
429 |
+
break;
|
430 |
+
case 'digest':
|
431 |
+
// @todo: Do not rely on curl
|
432 |
+
$options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_DIGEST;
|
433 |
+
$options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
|
434 |
+
break;
|
435 |
+
case 'ntlm':
|
436 |
+
$options['curl'][CURLOPT_HTTPAUTH] = CURLAUTH_NTLM;
|
437 |
+
$options['curl'][CURLOPT_USERPWD] = "$value[0]:$value[1]";
|
438 |
+
break;
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
if (isset($options['query'])) {
|
443 |
+
$value = $options['query'];
|
444 |
+
if (is_array($value)) {
|
445 |
+
$value = http_build_query($value, null, '&', PHP_QUERY_RFC3986);
|
446 |
+
}
|
447 |
+
if (!is_string($value)) {
|
448 |
+
throw new \InvalidArgumentException('query must be a string or array');
|
449 |
+
}
|
450 |
+
$modify['query'] = $value;
|
451 |
+
unset($options['query']);
|
452 |
+
}
|
453 |
+
|
454 |
+
// Ensure that sink is not an invalid value.
|
455 |
+
if (isset($options['sink'])) {
|
456 |
+
// TODO: Add more sink validation?
|
457 |
+
if (is_bool($options['sink'])) {
|
458 |
+
throw new \InvalidArgumentException('sink must not be a boolean');
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
$request = Psr7\modify_request($request, $modify);
|
463 |
+
if ($request->getBody() instanceof Psr7\MultipartStream) {
|
464 |
+
// Use a multipart/form-data POST if a Content-Type is not set.
|
465 |
+
// Ensure that we don't have the header in different case and set the new value.
|
466 |
+
$options['_conditional'] = Psr7\_caseless_remove(['Content-Type'], $options['_conditional']);
|
467 |
+
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
|
468 |
+
. $request->getBody()->getBoundary();
|
469 |
+
}
|
470 |
+
|
471 |
+
// Merge in conditional headers if they are not present.
|
472 |
+
if (isset($options['_conditional'])) {
|
473 |
+
// Build up the changes so it's in a single clone of the message.
|
474 |
+
$modify = [];
|
475 |
+
foreach ($options['_conditional'] as $k => $v) {
|
476 |
+
if (!$request->hasHeader($k)) {
|
477 |
+
$modify['set_headers'][$k] = $v;
|
478 |
+
}
|
479 |
+
}
|
480 |
+
$request = Psr7\modify_request($request, $modify);
|
481 |
+
// Don't pass this internal value along to middleware/handlers.
|
482 |
+
unset($options['_conditional']);
|
483 |
+
}
|
484 |
+
|
485 |
+
return $request;
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* Throw Exception with pre-set message.
|
490 |
+
* @return void
|
491 |
+
* @throws \InvalidArgumentException Invalid body.
|
492 |
+
*/
|
493 |
+
private function invalidBody()
|
494 |
+
{
|
495 |
+
throw new \InvalidArgumentException('Passing in the "body" request '
|
496 |
+
. 'option as an array to send a POST request has been deprecated. '
|
497 |
+
. 'Please use the "form_params" request option to send a '
|
498 |
+
. 'application/x-www-form-urlencoded request, or the "multipart" '
|
499 |
+
. 'request option to send a multipart/form-data request.');
|
500 |
+
}
|
501 |
+
}
|
vendor/guzzlehttp/guzzle/src/ClientInterface.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Exception\GuzzleException;
|
5 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
6 |
+
use Psr\Http\Message\RequestInterface;
|
7 |
+
use Psr\Http\Message\ResponseInterface;
|
8 |
+
use Psr\Http\Message\UriInterface;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Client interface for sending HTTP requests.
|
12 |
+
*/
|
13 |
+
interface ClientInterface
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @deprecated Will be removed in Guzzle 7.0.0
|
17 |
+
*/
|
18 |
+
const VERSION = '6.5.5';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Send an HTTP request.
|
22 |
+
*
|
23 |
+
* @param RequestInterface $request Request to send
|
24 |
+
* @param array $options Request options to apply to the given
|
25 |
+
* request and to the transfer.
|
26 |
+
*
|
27 |
+
* @return ResponseInterface
|
28 |
+
* @throws GuzzleException
|
29 |
+
*/
|
30 |
+
public function send(RequestInterface $request, array $options = []);
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Asynchronously send an HTTP request.
|
34 |
+
*
|
35 |
+
* @param RequestInterface $request Request to send
|
36 |
+
* @param array $options Request options to apply to the given
|
37 |
+
* request and to the transfer.
|
38 |
+
*
|
39 |
+
* @return PromiseInterface
|
40 |
+
*/
|
41 |
+
public function sendAsync(RequestInterface $request, array $options = []);
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Create and send an HTTP request.
|
45 |
+
*
|
46 |
+
* Use an absolute path to override the base path of the client, or a
|
47 |
+
* relative path to append to the base path of the client. The URL can
|
48 |
+
* contain the query string as well.
|
49 |
+
*
|
50 |
+
* @param string $method HTTP method.
|
51 |
+
* @param string|UriInterface $uri URI object or string.
|
52 |
+
* @param array $options Request options to apply.
|
53 |
+
*
|
54 |
+
* @return ResponseInterface
|
55 |
+
* @throws GuzzleException
|
56 |
+
*/
|
57 |
+
public function request($method, $uri, array $options = []);
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Create and send an asynchronous HTTP request.
|
61 |
+
*
|
62 |
+
* Use an absolute path to override the base path of the client, or a
|
63 |
+
* relative path to append to the base path of the client. The URL can
|
64 |
+
* contain the query string as well. Use an array to provide a URL
|
65 |
+
* template and additional variables to use in the URL template expansion.
|
66 |
+
*
|
67 |
+
* @param string $method HTTP method
|
68 |
+
* @param string|UriInterface $uri URI object or string.
|
69 |
+
* @param array $options Request options to apply.
|
70 |
+
*
|
71 |
+
* @return PromiseInterface
|
72 |
+
*/
|
73 |
+
public function requestAsync($method, $uri, array $options = []);
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Get a client configuration option.
|
77 |
+
*
|
78 |
+
* These options include default request options of the client, a "handler"
|
79 |
+
* (if utilized by the concrete client), and a "base_uri" if utilized by
|
80 |
+
* the concrete client.
|
81 |
+
*
|
82 |
+
* @param string|null $option The config option to retrieve.
|
83 |
+
*
|
84 |
+
* @return mixed
|
85 |
+
*/
|
86 |
+
public function getConfig($option = null);
|
87 |
+
}
|
vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
ADDED
@@ -0,0 +1,316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Cookie;
|
3 |
+
|
4 |
+
use Psr\Http\Message\RequestInterface;
|
5 |
+
use Psr\Http\Message\ResponseInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Cookie jar that stores cookies as an array
|
9 |
+
*/
|
10 |
+
class CookieJar implements CookieJarInterface
|
11 |
+
{
|
12 |
+
/** @var SetCookie[] Loaded cookie data */
|
13 |
+
private $cookies = [];
|
14 |
+
|
15 |
+
/** @var bool */
|
16 |
+
private $strictMode;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @param bool $strictMode Set to true to throw exceptions when invalid
|
20 |
+
* cookies are added to the cookie jar.
|
21 |
+
* @param array $cookieArray Array of SetCookie objects or a hash of
|
22 |
+
* arrays that can be used with the SetCookie
|
23 |
+
* constructor
|
24 |
+
*/
|
25 |
+
public function __construct($strictMode = false, $cookieArray = [])
|
26 |
+
{
|
27 |
+
$this->strictMode = $strictMode;
|
28 |
+
|
29 |
+
foreach ($cookieArray as $cookie) {
|
30 |
+
if (!($cookie instanceof SetCookie)) {
|
31 |
+
$cookie = new SetCookie($cookie);
|
32 |
+
}
|
33 |
+
$this->setCookie($cookie);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Create a new Cookie jar from an associative array and domain.
|
39 |
+
*
|
40 |
+
* @param array $cookies Cookies to create the jar from
|
41 |
+
* @param string $domain Domain to set the cookies to
|
42 |
+
*
|
43 |
+
* @return self
|
44 |
+
*/
|
45 |
+
public static function fromArray(array $cookies, $domain)
|
46 |
+
{
|
47 |
+
$cookieJar = new self();
|
48 |
+
foreach ($cookies as $name => $value) {
|
49 |
+
$cookieJar->setCookie(new SetCookie([
|
50 |
+
'Domain' => $domain,
|
51 |
+
'Name' => $name,
|
52 |
+
'Value' => $value,
|
53 |
+
'Discard' => true
|
54 |
+
]));
|
55 |
+
}
|
56 |
+
|
57 |
+
return $cookieJar;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @deprecated
|
62 |
+
*/
|
63 |
+
public static function getCookieValue($value)
|
64 |
+
{
|
65 |
+
return $value;
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Evaluate if this cookie should be persisted to storage
|
70 |
+
* that survives between requests.
|
71 |
+
*
|
72 |
+
* @param SetCookie $cookie Being evaluated.
|
73 |
+
* @param bool $allowSessionCookies If we should persist session cookies
|
74 |
+
* @return bool
|
75 |
+
*/
|
76 |
+
public static function shouldPersist(
|
77 |
+
SetCookie $cookie,
|
78 |
+
$allowSessionCookies = false
|
79 |
+
) {
|
80 |
+
if ($cookie->getExpires() || $allowSessionCookies) {
|
81 |
+
if (!$cookie->getDiscard()) {
|
82 |
+
return true;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
return false;
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Finds and returns the cookie based on the name
|
91 |
+
*
|
92 |
+
* @param string $name cookie name to search for
|
93 |
+
* @return SetCookie|null cookie that was found or null if not found
|
94 |
+
*/
|
95 |
+
public function getCookieByName($name)
|
96 |
+
{
|
97 |
+
// don't allow a non string name
|
98 |
+
if ($name === null || !is_scalar($name)) {
|
99 |
+
return null;
|
100 |
+
}
|
101 |
+
foreach ($this->cookies as $cookie) {
|
102 |
+
if ($cookie->getName() !== null && strcasecmp($cookie->getName(), $name) === 0) {
|
103 |
+
return $cookie;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
return null;
|
108 |
+
}
|
109 |
+
|
110 |
+
public function toArray()
|
111 |
+
{
|
112 |
+
return array_map(function (SetCookie $cookie) {
|
113 |
+
return $cookie->toArray();
|
114 |
+
}, $this->getIterator()->getArrayCopy());
|
115 |
+
}
|
116 |
+
|
117 |
+
public function clear($domain = null, $path = null, $name = null)
|
118 |
+
{
|
119 |
+
if (!$domain) {
|
120 |
+
$this->cookies = [];
|
121 |
+
return;
|
122 |
+
} elseif (!$path) {
|
123 |
+
$this->cookies = array_filter(
|
124 |
+
$this->cookies,
|
125 |
+
function (SetCookie $cookie) use ($domain) {
|
126 |
+
return !$cookie->matchesDomain($domain);
|
127 |
+
}
|
128 |
+
);
|
129 |
+
} elseif (!$name) {
|
130 |
+
$this->cookies = array_filter(
|
131 |
+
$this->cookies,
|
132 |
+
function (SetCookie $cookie) use ($path, $domain) {
|
133 |
+
return !($cookie->matchesPath($path) &&
|
134 |
+
$cookie->matchesDomain($domain));
|
135 |
+
}
|
136 |
+
);
|
137 |
+
} else {
|
138 |
+
$this->cookies = array_filter(
|
139 |
+
$this->cookies,
|
140 |
+
function (SetCookie $cookie) use ($path, $domain, $name) {
|
141 |
+
return !($cookie->getName() == $name &&
|
142 |
+
$cookie->matchesPath($path) &&
|
143 |
+
$cookie->matchesDomain($domain));
|
144 |
+
}
|
145 |
+
);
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
public function clearSessionCookies()
|
150 |
+
{
|
151 |
+
$this->cookies = array_filter(
|
152 |
+
$this->cookies,
|
153 |
+
function (SetCookie $cookie) {
|
154 |
+
return !$cookie->getDiscard() && $cookie->getExpires();
|
155 |
+
}
|
156 |
+
);
|
157 |
+
}
|
158 |
+
|
159 |
+
public function setCookie(SetCookie $cookie)
|
160 |
+
{
|
161 |
+
// If the name string is empty (but not 0), ignore the set-cookie
|
162 |
+
// string entirely.
|
163 |
+
$name = $cookie->getName();
|
164 |
+
if (!$name && $name !== '0') {
|
165 |
+
return false;
|
166 |
+
}
|
167 |
+
|
168 |
+
// Only allow cookies with set and valid domain, name, value
|
169 |
+
$result = $cookie->validate();
|
170 |
+
if ($result !== true) {
|
171 |
+
if ($this->strictMode) {
|
172 |
+
throw new \RuntimeException('Invalid cookie: ' . $result);
|
173 |
+
} else {
|
174 |
+
$this->removeCookieIfEmpty($cookie);
|
175 |
+
return false;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
// Resolve conflicts with previously set cookies
|
180 |
+
foreach ($this->cookies as $i => $c) {
|
181 |
+
|
182 |
+
// Two cookies are identical, when their path, and domain are
|
183 |
+
// identical.
|
184 |
+
if ($c->getPath() != $cookie->getPath() ||
|
185 |
+
$c->getDomain() != $cookie->getDomain() ||
|
186 |
+
$c->getName() != $cookie->getName()
|
187 |
+
) {
|
188 |
+
continue;
|
189 |
+
}
|
190 |
+
|
191 |
+
// The previously set cookie is a discard cookie and this one is
|
192 |
+
// not so allow the new cookie to be set
|
193 |
+
if (!$cookie->getDiscard() && $c->getDiscard()) {
|
194 |
+
unset($this->cookies[$i]);
|
195 |
+
continue;
|
196 |
+
}
|
197 |
+
|
198 |
+
// If the new cookie's expiration is further into the future, then
|
199 |
+
// replace the old cookie
|
200 |
+
if ($cookie->getExpires() > $c->getExpires()) {
|
201 |
+
unset($this->cookies[$i]);
|
202 |
+
continue;
|
203 |
+
}
|
204 |
+
|
205 |
+
// If the value has changed, we better change it
|
206 |
+
if ($cookie->getValue() !== $c->getValue()) {
|
207 |
+
unset($this->cookies[$i]);
|
208 |
+
continue;
|
209 |
+
}
|
210 |
+
|
211 |
+
// The cookie exists, so no need to continue
|
212 |
+
return false;
|
213 |
+
}
|
214 |
+
|
215 |
+
$this->cookies[] = $cookie;
|
216 |
+
|
217 |
+
return true;
|
218 |
+
}
|
219 |
+
|
220 |
+
public function count()
|
221 |
+
{
|
222 |
+
return count($this->cookies);
|
223 |
+
}
|
224 |
+
|
225 |
+
public function getIterator()
|
226 |
+
{
|
227 |
+
return new \ArrayIterator(array_values($this->cookies));
|
228 |
+
}
|
229 |
+
|
230 |
+
public function extractCookies(
|
231 |
+
RequestInterface $request,
|
232 |
+
ResponseInterface $response
|
233 |
+
) {
|
234 |
+
if ($cookieHeader = $response->getHeader('Set-Cookie')) {
|
235 |
+
foreach ($cookieHeader as $cookie) {
|
236 |
+
$sc = SetCookie::fromString($cookie);
|
237 |
+
if (!$sc->getDomain()) {
|
238 |
+
$sc->setDomain($request->getUri()->getHost());
|
239 |
+
}
|
240 |
+
if (0 !== strpos($sc->getPath(), '/')) {
|
241 |
+
$sc->setPath($this->getCookiePathFromRequest($request));
|
242 |
+
}
|
243 |
+
$this->setCookie($sc);
|
244 |
+
}
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Computes cookie path following RFC 6265 section 5.1.4
|
250 |
+
*
|
251 |
+
* @link https://tools.ietf.org/html/rfc6265#section-5.1.4
|
252 |
+
*
|
253 |
+
* @param RequestInterface $request
|
254 |
+
* @return string
|
255 |
+
*/
|
256 |
+
private function getCookiePathFromRequest(RequestInterface $request)
|
257 |
+
{
|
258 |
+
$uriPath = $request->getUri()->getPath();
|
259 |
+
if ('' === $uriPath) {
|
260 |
+
return '/';
|
261 |
+
}
|
262 |
+
if (0 !== strpos($uriPath, '/')) {
|
263 |
+
return '/';
|
264 |
+
}
|
265 |
+
if ('/' === $uriPath) {
|
266 |
+
return '/';
|
267 |
+
}
|
268 |
+
if (0 === $lastSlashPos = strrpos($uriPath, '/')) {
|
269 |
+
return '/';
|
270 |
+
}
|
271 |
+
|
272 |
+
return substr($uriPath, 0, $lastSlashPos);
|
273 |
+
}
|
274 |
+
|
275 |
+
public function withCookieHeader(RequestInterface $request)
|
276 |
+
{
|
277 |
+
$values = [];
|
278 |
+
$uri = $request->getUri();
|
279 |
+
$scheme = $uri->getScheme();
|
280 |
+
$host = $uri->getHost();
|
281 |
+
$path = $uri->getPath() ?: '/';
|
282 |
+
|
283 |
+
foreach ($this->cookies as $cookie) {
|
284 |
+
if ($cookie->matchesPath($path) &&
|
285 |
+
$cookie->matchesDomain($host) &&
|
286 |
+
!$cookie->isExpired() &&
|
287 |
+
(!$cookie->getSecure() || $scheme === 'https')
|
288 |
+
) {
|
289 |
+
$values[] = $cookie->getName() . '='
|
290 |
+
. $cookie->getValue();
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
+
return $values
|
295 |
+
? $request->withHeader('Cookie', implode('; ', $values))
|
296 |
+
: $request;
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* If a cookie already exists and the server asks to set it again with a
|
301 |
+
* null value, the cookie must be deleted.
|
302 |
+
*
|
303 |
+
* @param SetCookie $cookie
|
304 |
+
*/
|
305 |
+
private function removeCookieIfEmpty(SetCookie $cookie)
|
306 |
+
{
|
307 |
+
$cookieValue = $cookie->getValue();
|
308 |
+
if ($cookieValue === null || $cookieValue === '') {
|
309 |
+
$this->clear(
|
310 |
+
$cookie->getDomain(),
|
311 |
+
$cookie->getPath(),
|
312 |
+
$cookie->getName()
|
313 |
+
);
|
314 |
+
}
|
315 |
+
}
|
316 |
+
}
|
vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Cookie;
|
3 |
+
|
4 |
+
use Psr\Http\Message\RequestInterface;
|
5 |
+
use Psr\Http\Message\ResponseInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Stores HTTP cookies.
|
9 |
+
*
|
10 |
+
* It extracts cookies from HTTP requests, and returns them in HTTP responses.
|
11 |
+
* CookieJarInterface instances automatically expire contained cookies when
|
12 |
+
* necessary. Subclasses are also responsible for storing and retrieving
|
13 |
+
* cookies from a file, database, etc.
|
14 |
+
*
|
15 |
+
* @link http://docs.python.org/2/library/cookielib.html Inspiration
|
16 |
+
*/
|
17 |
+
interface CookieJarInterface extends \Countable, \IteratorAggregate
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* Create a request with added cookie headers.
|
21 |
+
*
|
22 |
+
* If no matching cookies are found in the cookie jar, then no Cookie
|
23 |
+
* header is added to the request and the same request is returned.
|
24 |
+
*
|
25 |
+
* @param RequestInterface $request Request object to modify.
|
26 |
+
*
|
27 |
+
* @return RequestInterface returns the modified request.
|
28 |
+
*/
|
29 |
+
public function withCookieHeader(RequestInterface $request);
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Extract cookies from an HTTP response and store them in the CookieJar.
|
33 |
+
*
|
34 |
+
* @param RequestInterface $request Request that was sent
|
35 |
+
* @param ResponseInterface $response Response that was received
|
36 |
+
*/
|
37 |
+
public function extractCookies(
|
38 |
+
RequestInterface $request,
|
39 |
+
ResponseInterface $response
|
40 |
+
);
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Sets a cookie in the cookie jar.
|
44 |
+
*
|
45 |
+
* @param SetCookie $cookie Cookie to set.
|
46 |
+
*
|
47 |
+
* @return bool Returns true on success or false on failure
|
48 |
+
*/
|
49 |
+
public function setCookie(SetCookie $cookie);
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Remove cookies currently held in the cookie jar.
|
53 |
+
*
|
54 |
+
* Invoking this method without arguments will empty the whole cookie jar.
|
55 |
+
* If given a $domain argument only cookies belonging to that domain will
|
56 |
+
* be removed. If given a $domain and $path argument, cookies belonging to
|
57 |
+
* the specified path within that domain are removed. If given all three
|
58 |
+
* arguments, then the cookie with the specified name, path and domain is
|
59 |
+
* removed.
|
60 |
+
*
|
61 |
+
* @param string|null $domain Clears cookies matching a domain
|
62 |
+
* @param string|null $path Clears cookies matching a domain and path
|
63 |
+
* @param string|null $name Clears cookies matching a domain, path, and name
|
64 |
+
*
|
65 |
+
* @return CookieJarInterface
|
66 |
+
*/
|
67 |
+
public function clear($domain = null, $path = null, $name = null);
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Discard all sessions cookies.
|
71 |
+
*
|
72 |
+
* Removes cookies that don't have an expire field or a have a discard
|
73 |
+
* field set to true. To be called when the user agent shuts down according
|
74 |
+
* to RFC 2965.
|
75 |
+
*/
|
76 |
+
public function clearSessionCookies();
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Converts the cookie jar to an array.
|
80 |
+
*
|
81 |
+
* @return array
|
82 |
+
*/
|
83 |
+
public function toArray();
|
84 |
+
}
|
vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Cookie;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Persists non-session cookies using a JSON formatted file
|
6 |
+
*/
|
7 |
+
class FileCookieJar extends CookieJar
|
8 |
+
{
|
9 |
+
/** @var string filename */
|
10 |
+
private $filename;
|
11 |
+
|
12 |
+
/** @var bool Control whether to persist session cookies or not. */
|
13 |
+
private $storeSessionCookies;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Create a new FileCookieJar object
|
17 |
+
*
|
18 |
+
* @param string $cookieFile File to store the cookie data
|
19 |
+
* @param bool $storeSessionCookies Set to true to store session cookies
|
20 |
+
* in the cookie jar.
|
21 |
+
*
|
22 |
+
* @throws \RuntimeException if the file cannot be found or created
|
23 |
+
*/
|
24 |
+
public function __construct($cookieFile, $storeSessionCookies = false)
|
25 |
+
{
|
26 |
+
parent::__construct();
|
27 |
+
$this->filename = $cookieFile;
|
28 |
+
$this->storeSessionCookies = $storeSessionCookies;
|
29 |
+
|
30 |
+
if (file_exists($cookieFile)) {
|
31 |
+
$this->load($cookieFile);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Saves the file when shutting down
|
37 |
+
*/
|
38 |
+
public function __destruct()
|
39 |
+
{
|
40 |
+
$this->save($this->filename);
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Saves the cookies to a file.
|
45 |
+
*
|
46 |
+
* @param string $filename File to save
|
47 |
+
* @throws \RuntimeException if the file cannot be found or created
|
48 |
+
*/
|
49 |
+
public function save($filename)
|
50 |
+
{
|
51 |
+
$json = [];
|
52 |
+
foreach ($this as $cookie) {
|
53 |
+
/** @var SetCookie $cookie */
|
54 |
+
if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
|
55 |
+
$json[] = $cookie->toArray();
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
$jsonStr = \GuzzleHttp\json_encode($json);
|
60 |
+
if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) {
|
61 |
+
throw new \RuntimeException("Unable to save file {$filename}");
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Load cookies from a JSON formatted file.
|
67 |
+
*
|
68 |
+
* Old cookies are kept unless overwritten by newly loaded ones.
|
69 |
+
*
|
70 |
+
* @param string $filename Cookie file to load.
|
71 |
+
* @throws \RuntimeException if the file cannot be loaded.
|
72 |
+
*/
|
73 |
+
public function load($filename)
|
74 |
+
{
|
75 |
+
$json = file_get_contents($filename);
|
76 |
+
if (false === $json) {
|
77 |
+
throw new \RuntimeException("Unable to load file {$filename}");
|
78 |
+
} elseif ($json === '') {
|
79 |
+
return;
|
80 |
+
}
|
81 |
+
|
82 |
+
$data = \GuzzleHttp\json_decode($json, true);
|
83 |
+
if (is_array($data)) {
|
84 |
+
foreach (json_decode($json, true) as $cookie) {
|
85 |
+
$this->setCookie(new SetCookie($cookie));
|
86 |
+
}
|
87 |
+
} elseif (strlen($data)) {
|
88 |
+
throw new \RuntimeException("Invalid cookie file: {$filename}");
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Cookie;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Persists cookies in the client session
|
6 |
+
*/
|
7 |
+
class SessionCookieJar extends CookieJar
|
8 |
+
{
|
9 |
+
/** @var string session key */
|
10 |
+
private $sessionKey;
|
11 |
+
|
12 |
+
/** @var bool Control whether to persist session cookies or not. */
|
13 |
+
private $storeSessionCookies;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Create a new SessionCookieJar object
|
17 |
+
*
|
18 |
+
* @param string $sessionKey Session key name to store the cookie
|
19 |
+
* data in session
|
20 |
+
* @param bool $storeSessionCookies Set to true to store session cookies
|
21 |
+
* in the cookie jar.
|
22 |
+
*/
|
23 |
+
public function __construct($sessionKey, $storeSessionCookies = false)
|
24 |
+
{
|
25 |
+
parent::__construct();
|
26 |
+
$this->sessionKey = $sessionKey;
|
27 |
+
$this->storeSessionCookies = $storeSessionCookies;
|
28 |
+
$this->load();
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Saves cookies to session when shutting down
|
33 |
+
*/
|
34 |
+
public function __destruct()
|
35 |
+
{
|
36 |
+
$this->save();
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Save cookies to the client session
|
41 |
+
*/
|
42 |
+
public function save()
|
43 |
+
{
|
44 |
+
$json = [];
|
45 |
+
foreach ($this as $cookie) {
|
46 |
+
/** @var SetCookie $cookie */
|
47 |
+
if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
|
48 |
+
$json[] = $cookie->toArray();
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
$_SESSION[$this->sessionKey] = json_encode($json);
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Load the contents of the client session into the data array
|
57 |
+
*/
|
58 |
+
protected function load()
|
59 |
+
{
|
60 |
+
if (!isset($_SESSION[$this->sessionKey])) {
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
$data = json_decode($_SESSION[$this->sessionKey], true);
|
64 |
+
if (is_array($data)) {
|
65 |
+
foreach ($data as $cookie) {
|
66 |
+
$this->setCookie(new SetCookie($cookie));
|
67 |
+
}
|
68 |
+
} elseif (strlen($data)) {
|
69 |
+
throw new \RuntimeException("Invalid cookie data");
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
ADDED
@@ -0,0 +1,403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Cookie;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Set-Cookie object
|
6 |
+
*/
|
7 |
+
class SetCookie
|
8 |
+
{
|
9 |
+
/** @var array */
|
10 |
+
private static $defaults = [
|
11 |
+
'Name' => null,
|
12 |
+
'Value' => null,
|
13 |
+
'Domain' => null,
|
14 |
+
'Path' => '/',
|
15 |
+
'Max-Age' => null,
|
16 |
+
'Expires' => null,
|
17 |
+
'Secure' => false,
|
18 |
+
'Discard' => false,
|
19 |
+
'HttpOnly' => false
|
20 |
+
];
|
21 |
+
|
22 |
+
/** @var array Cookie data */
|
23 |
+
private $data;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Create a new SetCookie object from a string
|
27 |
+
*
|
28 |
+
* @param string $cookie Set-Cookie header string
|
29 |
+
*
|
30 |
+
* @return self
|
31 |
+
*/
|
32 |
+
public static function fromString($cookie)
|
33 |
+
{
|
34 |
+
// Create the default return array
|
35 |
+
$data = self::$defaults;
|
36 |
+
// Explode the cookie string using a series of semicolons
|
37 |
+
$pieces = array_filter(array_map('trim', explode(';', $cookie)));
|
38 |
+
// The name of the cookie (first kvp) must exist and include an equal sign.
|
39 |
+
if (empty($pieces[0]) || !strpos($pieces[0], '=')) {
|
40 |
+
return new self($data);
|
41 |
+
}
|
42 |
+
|
43 |
+
// Add the cookie pieces into the parsed data array
|
44 |
+
foreach ($pieces as $part) {
|
45 |
+
$cookieParts = explode('=', $part, 2);
|
46 |
+
$key = trim($cookieParts[0]);
|
47 |
+
$value = isset($cookieParts[1])
|
48 |
+
? trim($cookieParts[1], " \n\r\t\0\x0B")
|
49 |
+
: true;
|
50 |
+
|
51 |
+
// Only check for non-cookies when cookies have been found
|
52 |
+
if (empty($data['Name'])) {
|
53 |
+
$data['Name'] = $key;
|
54 |
+
$data['Value'] = $value;
|
55 |
+
} else {
|
56 |
+
foreach (array_keys(self::$defaults) as $search) {
|
57 |
+
if (!strcasecmp($search, $key)) {
|
58 |
+
$data[$search] = $value;
|
59 |
+
continue 2;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
$data[$key] = $value;
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
return new self($data);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @param array $data Array of cookie data provided by a Cookie parser
|
71 |
+
*/
|
72 |
+
public function __construct(array $data = [])
|
73 |
+
{
|
74 |
+
$this->data = array_replace(self::$defaults, $data);
|
75 |
+
// Extract the Expires value and turn it into a UNIX timestamp if needed
|
76 |
+
if (!$this->getExpires() && $this->getMaxAge()) {
|
77 |
+
// Calculate the Expires date
|
78 |
+
$this->setExpires(time() + $this->getMaxAge());
|
79 |
+
} elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
|
80 |
+
$this->setExpires($this->getExpires());
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
public function __toString()
|
85 |
+
{
|
86 |
+
$str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
|
87 |
+
foreach ($this->data as $k => $v) {
|
88 |
+
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
|
89 |
+
if ($k === 'Expires') {
|
90 |
+
$str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
|
91 |
+
} else {
|
92 |
+
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
return rtrim($str, '; ');
|
98 |
+
}
|
99 |
+
|
100 |
+
public function toArray()
|
101 |
+
{
|
102 |
+
return $this->data;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Get the cookie name
|
107 |
+
*
|
108 |
+
* @return string
|
109 |
+
*/
|
110 |
+
public function getName()
|
111 |
+
{
|
112 |
+
return $this->data['Name'];
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Set the cookie name
|
117 |
+
*
|
118 |
+
* @param string $name Cookie name
|
119 |
+
*/
|
120 |
+
public function setName($name)
|
121 |
+
{
|
122 |
+
$this->data['Name'] = $name;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Get the cookie value
|
127 |
+
*
|
128 |
+
* @return string
|
129 |
+
*/
|
130 |
+
public function getValue()
|
131 |
+
{
|
132 |
+
return $this->data['Value'];
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Set the cookie value
|
137 |
+
*
|
138 |
+
* @param string $value Cookie value
|
139 |
+
*/
|
140 |
+
public function setValue($value)
|
141 |
+
{
|
142 |
+
$this->data['Value'] = $value;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Get the domain
|
147 |
+
*
|
148 |
+
* @return string|null
|
149 |
+
*/
|
150 |
+
public function getDomain()
|
151 |
+
{
|
152 |
+
return $this->data['Domain'];
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Set the domain of the cookie
|
157 |
+
*
|
158 |
+
* @param string $domain
|
159 |
+
*/
|
160 |
+
public function setDomain($domain)
|
161 |
+
{
|
162 |
+
$this->data['Domain'] = $domain;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Get the path
|
167 |
+
*
|
168 |
+
* @return string
|
169 |
+
*/
|
170 |
+
public function getPath()
|
171 |
+
{
|
172 |
+
return $this->data['Path'];
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Set the path of the cookie
|
177 |
+
*
|
178 |
+
* @param string $path Path of the cookie
|
179 |
+
*/
|
180 |
+
public function setPath($path)
|
181 |
+
{
|
182 |
+
$this->data['Path'] = $path;
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Maximum lifetime of the cookie in seconds
|
187 |
+
*
|
188 |
+
* @return int|null
|
189 |
+
*/
|
190 |
+
public function getMaxAge()
|
191 |
+
{
|
192 |
+
return $this->data['Max-Age'];
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Set the max-age of the cookie
|
197 |
+
*
|
198 |
+
* @param int $maxAge Max age of the cookie in seconds
|
199 |
+
*/
|
200 |
+
public function setMaxAge($maxAge)
|
201 |
+
{
|
202 |
+
$this->data['Max-Age'] = $maxAge;
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* The UNIX timestamp when the cookie Expires
|
207 |
+
*
|
208 |
+
* @return mixed
|
209 |
+
*/
|
210 |
+
public function getExpires()
|
211 |
+
{
|
212 |
+
return $this->data['Expires'];
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Set the unix timestamp for which the cookie will expire
|
217 |
+
*
|
218 |
+
* @param int $timestamp Unix timestamp
|
219 |
+
*/
|
220 |
+
public function setExpires($timestamp)
|
221 |
+
{
|
222 |
+
$this->data['Expires'] = is_numeric($timestamp)
|
223 |
+
? (int) $timestamp
|
224 |
+
: strtotime($timestamp);
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Get whether or not this is a secure cookie
|
229 |
+
*
|
230 |
+
* @return bool|null
|
231 |
+
*/
|
232 |
+
public function getSecure()
|
233 |
+
{
|
234 |
+
return $this->data['Secure'];
|
235 |
+
}
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Set whether or not the cookie is secure
|
239 |
+
*
|
240 |
+
* @param bool $secure Set to true or false if secure
|
241 |
+
*/
|
242 |
+
public function setSecure($secure)
|
243 |
+
{
|
244 |
+
$this->data['Secure'] = $secure;
|
245 |
+
}
|
246 |
+
|
247 |
+
/**
|
248 |
+
* Get whether or not this is a session cookie
|
249 |
+
*
|
250 |
+
* @return bool|null
|
251 |
+
*/
|
252 |
+
public function getDiscard()
|
253 |
+
{
|
254 |
+
return $this->data['Discard'];
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Set whether or not this is a session cookie
|
259 |
+
*
|
260 |
+
* @param bool $discard Set to true or false if this is a session cookie
|
261 |
+
*/
|
262 |
+
public function setDiscard($discard)
|
263 |
+
{
|
264 |
+
$this->data['Discard'] = $discard;
|
265 |
+
}
|
266 |
+
|
267 |
+
/**
|
268 |
+
* Get whether or not this is an HTTP only cookie
|
269 |
+
*
|
270 |
+
* @return bool
|
271 |
+
*/
|
272 |
+
public function getHttpOnly()
|
273 |
+
{
|
274 |
+
return $this->data['HttpOnly'];
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Set whether or not this is an HTTP only cookie
|
279 |
+
*
|
280 |
+
* @param bool $httpOnly Set to true or false if this is HTTP only
|
281 |
+
*/
|
282 |
+
public function setHttpOnly($httpOnly)
|
283 |
+
{
|
284 |
+
$this->data['HttpOnly'] = $httpOnly;
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* Check if the cookie matches a path value.
|
289 |
+
*
|
290 |
+
* A request-path path-matches a given cookie-path if at least one of
|
291 |
+
* the following conditions holds:
|
292 |
+
*
|
293 |
+
* - The cookie-path and the request-path are identical.
|
294 |
+
* - The cookie-path is a prefix of the request-path, and the last
|
295 |
+
* character of the cookie-path is %x2F ("/").
|
296 |
+
* - The cookie-path is a prefix of the request-path, and the first
|
297 |
+
* character of the request-path that is not included in the cookie-
|
298 |
+
* path is a %x2F ("/") character.
|
299 |
+
*
|
300 |
+
* @param string $requestPath Path to check against
|
301 |
+
*
|
302 |
+
* @return bool
|
303 |
+
*/
|
304 |
+
public function matchesPath($requestPath)
|
305 |
+
{
|
306 |
+
$cookiePath = $this->getPath();
|
307 |
+
|
308 |
+
// Match on exact matches or when path is the default empty "/"
|
309 |
+
if ($cookiePath === '/' || $cookiePath == $requestPath) {
|
310 |
+
return true;
|
311 |
+
}
|
312 |
+
|
313 |
+
// Ensure that the cookie-path is a prefix of the request path.
|
314 |
+
if (0 !== strpos($requestPath, $cookiePath)) {
|
315 |
+
return false;
|
316 |
+
}
|
317 |
+
|
318 |
+
// Match if the last character of the cookie-path is "/"
|
319 |
+
if (substr($cookiePath, -1, 1) === '/') {
|
320 |
+
return true;
|
321 |
+
}
|
322 |
+
|
323 |
+
// Match if the first character not included in cookie path is "/"
|
324 |
+
return substr($requestPath, strlen($cookiePath), 1) === '/';
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Check if the cookie matches a domain value
|
329 |
+
*
|
330 |
+
* @param string $domain Domain to check against
|
331 |
+
*
|
332 |
+
* @return bool
|
333 |
+
*/
|
334 |
+
public function matchesDomain($domain)
|
335 |
+
{
|
336 |
+
// Remove the leading '.' as per spec in RFC 6265.
|
337 |
+
// http://tools.ietf.org/html/rfc6265#section-5.2.3
|
338 |
+
$cookieDomain = ltrim($this->getDomain(), '.');
|
339 |
+
|
340 |
+
// Domain not set or exact match.
|
341 |
+
if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
|
342 |
+
return true;
|
343 |
+
}
|
344 |
+
|
345 |
+
// Matching the subdomain according to RFC 6265.
|
346 |
+
// http://tools.ietf.org/html/rfc6265#section-5.1.3
|
347 |
+
if (filter_var($domain, FILTER_VALIDATE_IP)) {
|
348 |
+
return false;
|
349 |
+
}
|
350 |
+
|
351 |
+
return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
|
352 |
+
}
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Check if the cookie is expired
|
356 |
+
*
|
357 |
+
* @return bool
|
358 |
+
*/
|
359 |
+
public function isExpired()
|
360 |
+
{
|
361 |
+
return $this->getExpires() !== null && time() > $this->getExpires();
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Check if the cookie is valid according to RFC 6265
|
366 |
+
*
|
367 |
+
* @return bool|string Returns true if valid or an error message if invalid
|
368 |
+
*/
|
369 |
+
public function validate()
|
370 |
+
{
|
371 |
+
// Names must not be empty, but can be 0
|
372 |
+
$name = $this->getName();
|
373 |
+
if (empty($name) && !is_numeric($name)) {
|
374 |
+
return 'The cookie name must not be empty';
|
375 |
+
}
|
376 |
+
|
377 |
+
// Check if any of the invalid characters are present in the cookie name
|
378 |
+
if (preg_match(
|
379 |
+
'/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
|
380 |
+
$name
|
381 |
+
)) {
|
382 |
+
return 'Cookie name must not contain invalid characters: ASCII '
|
383 |
+
. 'Control characters (0-31;127), space, tab and the '
|
384 |
+
. 'following characters: ()<>@,;:\"/?={}';
|
385 |
+
}
|
386 |
+
|
387 |
+
// Value must not be empty, but can be 0
|
388 |
+
$value = $this->getValue();
|
389 |
+
if (empty($value) && !is_numeric($value)) {
|
390 |
+
return 'The cookie value must not be empty';
|
391 |
+
}
|
392 |
+
|
393 |
+
// Domains must not be empty, but can be 0
|
394 |
+
// A "0" is not a valid internet domain, but may be used as server name
|
395 |
+
// in a private network.
|
396 |
+
$domain = $this->getDomain();
|
397 |
+
if (empty($domain) && !is_numeric($domain)) {
|
398 |
+
return 'The cookie domain must not be empty';
|
399 |
+
}
|
400 |
+
|
401 |
+
return true;
|
402 |
+
}
|
403 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
use Psr\Http\Message\RequestInterface;
|
5 |
+
use Psr\Http\Message\ResponseInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Exception when an HTTP error occurs (4xx or 5xx error)
|
9 |
+
*/
|
10 |
+
class BadResponseException extends RequestException
|
11 |
+
{
|
12 |
+
public function __construct(
|
13 |
+
$message,
|
14 |
+
RequestInterface $request,
|
15 |
+
ResponseInterface $response = null,
|
16 |
+
\Exception $previous = null,
|
17 |
+
array $handlerContext = []
|
18 |
+
) {
|
19 |
+
if (null === $response) {
|
20 |
+
@trigger_error(
|
21 |
+
'Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.',
|
22 |
+
E_USER_DEPRECATED
|
23 |
+
);
|
24 |
+
}
|
25 |
+
parent::__construct($message, $request, $response, $previous, $handlerContext);
|
26 |
+
}
|
27 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/ClientException.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Exception when a client error is encountered (4xx codes)
|
6 |
+
*/
|
7 |
+
class ClientException extends BadResponseException
|
8 |
+
{
|
9 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
use Psr\Http\Message\RequestInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Exception thrown when a connection cannot be established.
|
8 |
+
*
|
9 |
+
* Note that no response is present for a ConnectException
|
10 |
+
*/
|
11 |
+
class ConnectException extends RequestException
|
12 |
+
{
|
13 |
+
public function __construct(
|
14 |
+
$message,
|
15 |
+
RequestInterface $request,
|
16 |
+
\Exception $previous = null,
|
17 |
+
array $handlerContext = []
|
18 |
+
) {
|
19 |
+
parent::__construct($message, $request, null, $previous, $handlerContext);
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @return null
|
24 |
+
*/
|
25 |
+
public function getResponse()
|
26 |
+
{
|
27 |
+
return null;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @return bool
|
32 |
+
*/
|
33 |
+
public function hasResponse()
|
34 |
+
{
|
35 |
+
return false;
|
36 |
+
}
|
37 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
use Throwable;
|
5 |
+
|
6 |
+
if (interface_exists(Throwable::class)) {
|
7 |
+
interface GuzzleException extends Throwable
|
8 |
+
{
|
9 |
+
}
|
10 |
+
} else {
|
11 |
+
/**
|
12 |
+
* @method string getMessage()
|
13 |
+
* @method \Throwable|null getPrevious()
|
14 |
+
* @method mixed getCode()
|
15 |
+
* @method string getFile()
|
16 |
+
* @method int getLine()
|
17 |
+
* @method array getTrace()
|
18 |
+
* @method string getTraceAsString()
|
19 |
+
*/
|
20 |
+
interface GuzzleException
|
21 |
+
{
|
22 |
+
}
|
23 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace GuzzleHttp\Exception;
|
4 |
+
|
5 |
+
final class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException
|
6 |
+
{
|
7 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
5 |
+
use Psr\Http\Message\RequestInterface;
|
6 |
+
use Psr\Http\Message\ResponseInterface;
|
7 |
+
use Psr\Http\Message\UriInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* HTTP Request exception
|
11 |
+
*/
|
12 |
+
class RequestException extends TransferException
|
13 |
+
{
|
14 |
+
/** @var RequestInterface */
|
15 |
+
private $request;
|
16 |
+
|
17 |
+
/** @var ResponseInterface|null */
|
18 |
+
private $response;
|
19 |
+
|
20 |
+
/** @var array */
|
21 |
+
private $handlerContext;
|
22 |
+
|
23 |
+
public function __construct(
|
24 |
+
$message,
|
25 |
+
RequestInterface $request,
|
26 |
+
ResponseInterface $response = null,
|
27 |
+
\Exception $previous = null,
|
28 |
+
array $handlerContext = []
|
29 |
+
) {
|
30 |
+
// Set the code of the exception if the response is set and not future.
|
31 |
+
$code = $response && !($response instanceof PromiseInterface)
|
32 |
+
? $response->getStatusCode()
|
33 |
+
: 0;
|
34 |
+
parent::__construct($message, $code, $previous);
|
35 |
+
$this->request = $request;
|
36 |
+
$this->response = $response;
|
37 |
+
$this->handlerContext = $handlerContext;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Wrap non-RequestExceptions with a RequestException
|
42 |
+
*
|
43 |
+
* @param RequestInterface $request
|
44 |
+
* @param \Exception $e
|
45 |
+
*
|
46 |
+
* @return RequestException
|
47 |
+
*/
|
48 |
+
public static function wrapException(RequestInterface $request, \Exception $e)
|
49 |
+
{
|
50 |
+
return $e instanceof RequestException
|
51 |
+
? $e
|
52 |
+
: new RequestException($e->getMessage(), $request, null, $e);
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Factory method to create a new exception with a normalized error message
|
57 |
+
*
|
58 |
+
* @param RequestInterface $request Request
|
59 |
+
* @param ResponseInterface $response Response received
|
60 |
+
* @param \Exception $previous Previous exception
|
61 |
+
* @param array $ctx Optional handler context.
|
62 |
+
*
|
63 |
+
* @return self
|
64 |
+
*/
|
65 |
+
public static function create(
|
66 |
+
RequestInterface $request,
|
67 |
+
ResponseInterface $response = null,
|
68 |
+
\Exception $previous = null,
|
69 |
+
array $ctx = []
|
70 |
+
) {
|
71 |
+
if (!$response) {
|
72 |
+
return new self(
|
73 |
+
'Error completing request',
|
74 |
+
$request,
|
75 |
+
null,
|
76 |
+
$previous,
|
77 |
+
$ctx
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
+
$level = (int) floor($response->getStatusCode() / 100);
|
82 |
+
if ($level === 4) {
|
83 |
+
$label = 'Client error';
|
84 |
+
$className = ClientException::class;
|
85 |
+
} elseif ($level === 5) {
|
86 |
+
$label = 'Server error';
|
87 |
+
$className = ServerException::class;
|
88 |
+
} else {
|
89 |
+
$label = 'Unsuccessful request';
|
90 |
+
$className = __CLASS__;
|
91 |
+
}
|
92 |
+
|
93 |
+
$uri = $request->getUri();
|
94 |
+
$uri = static::obfuscateUri($uri);
|
95 |
+
|
96 |
+
// Client Error: `GET /` resulted in a `404 Not Found` response:
|
97 |
+
// <html> ... (truncated)
|
98 |
+
$message = sprintf(
|
99 |
+
'%s: `%s %s` resulted in a `%s %s` response',
|
100 |
+
$label,
|
101 |
+
$request->getMethod(),
|
102 |
+
$uri,
|
103 |
+
$response->getStatusCode(),
|
104 |
+
$response->getReasonPhrase()
|
105 |
+
);
|
106 |
+
|
107 |
+
$summary = static::getResponseBodySummary($response);
|
108 |
+
|
109 |
+
if ($summary !== null) {
|
110 |
+
$message .= ":\n{$summary}\n";
|
111 |
+
}
|
112 |
+
|
113 |
+
return new $className($message, $request, $response, $previous, $ctx);
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Get a short summary of the response
|
118 |
+
*
|
119 |
+
* Will return `null` if the response is not printable.
|
120 |
+
*
|
121 |
+
* @param ResponseInterface $response
|
122 |
+
*
|
123 |
+
* @return string|null
|
124 |
+
*/
|
125 |
+
public static function getResponseBodySummary(ResponseInterface $response)
|
126 |
+
{
|
127 |
+
return \GuzzleHttp\Psr7\get_message_body_summary($response);
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Obfuscates URI if there is a username and a password present
|
132 |
+
*
|
133 |
+
* @param UriInterface $uri
|
134 |
+
*
|
135 |
+
* @return UriInterface
|
136 |
+
*/
|
137 |
+
private static function obfuscateUri(UriInterface $uri)
|
138 |
+
{
|
139 |
+
$userInfo = $uri->getUserInfo();
|
140 |
+
|
141 |
+
if (false !== ($pos = strpos($userInfo, ':'))) {
|
142 |
+
return $uri->withUserInfo(substr($userInfo, 0, $pos), '***');
|
143 |
+
}
|
144 |
+
|
145 |
+
return $uri;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get the request that caused the exception
|
150 |
+
*
|
151 |
+
* @return RequestInterface
|
152 |
+
*/
|
153 |
+
public function getRequest()
|
154 |
+
{
|
155 |
+
return $this->request;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Get the associated response
|
160 |
+
*
|
161 |
+
* @return ResponseInterface|null
|
162 |
+
*/
|
163 |
+
public function getResponse()
|
164 |
+
{
|
165 |
+
return $this->response;
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Check if a response was received
|
170 |
+
*
|
171 |
+
* @return bool
|
172 |
+
*/
|
173 |
+
public function hasResponse()
|
174 |
+
{
|
175 |
+
return $this->response !== null;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Get contextual information about the error from the underlying handler.
|
180 |
+
*
|
181 |
+
* The contents of this array will vary depending on which handler you are
|
182 |
+
* using. It may also be just an empty array. Relying on this data will
|
183 |
+
* couple you to a specific handler, but can give more debug information
|
184 |
+
* when needed.
|
185 |
+
*
|
186 |
+
* @return array
|
187 |
+
*/
|
188 |
+
public function getHandlerContext()
|
189 |
+
{
|
190 |
+
return $this->handlerContext;
|
191 |
+
}
|
192 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/SeekException.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Exception thrown when a seek fails on a stream.
|
8 |
+
*/
|
9 |
+
class SeekException extends \RuntimeException implements GuzzleException
|
10 |
+
{
|
11 |
+
private $stream;
|
12 |
+
|
13 |
+
public function __construct(StreamInterface $stream, $pos = 0, $msg = '')
|
14 |
+
{
|
15 |
+
$this->stream = $stream;
|
16 |
+
$msg = $msg ?: 'Could not seek the stream to position ' . $pos;
|
17 |
+
parent::__construct($msg);
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @return StreamInterface
|
22 |
+
*/
|
23 |
+
public function getStream()
|
24 |
+
{
|
25 |
+
return $this->stream;
|
26 |
+
}
|
27 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/ServerException.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Exception when a server error is encountered (5xx codes)
|
6 |
+
*/
|
7 |
+
class ServerException extends BadResponseException
|
8 |
+
{
|
9 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
class TooManyRedirectsException extends RequestException
|
5 |
+
{
|
6 |
+
}
|
vendor/guzzlehttp/guzzle/src/Exception/TransferException.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Exception;
|
3 |
+
|
4 |
+
class TransferException extends \RuntimeException implements GuzzleException
|
5 |
+
{
|
6 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
ADDED
@@ -0,0 +1,585 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\Exception\ConnectException;
|
5 |
+
use GuzzleHttp\Exception\RequestException;
|
6 |
+
use GuzzleHttp\Promise\FulfilledPromise;
|
7 |
+
use GuzzleHttp\Psr7;
|
8 |
+
use GuzzleHttp\Psr7\LazyOpenStream;
|
9 |
+
use GuzzleHttp\TransferStats;
|
10 |
+
use Psr\Http\Message\RequestInterface;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Creates curl resources from a request
|
14 |
+
*/
|
15 |
+
class CurlFactory implements CurlFactoryInterface
|
16 |
+
{
|
17 |
+
const CURL_VERSION_STR = 'curl_version';
|
18 |
+
const LOW_CURL_VERSION_NUMBER = '7.21.2';
|
19 |
+
|
20 |
+
/** @var array */
|
21 |
+
private $handles = [];
|
22 |
+
|
23 |
+
/** @var int Total number of idle handles to keep in cache */
|
24 |
+
private $maxHandles;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @param int $maxHandles Maximum number of idle handles.
|
28 |
+
*/
|
29 |
+
public function __construct($maxHandles)
|
30 |
+
{
|
31 |
+
$this->maxHandles = $maxHandles;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function create(RequestInterface $request, array $options)
|
35 |
+
{
|
36 |
+
if (isset($options['curl']['body_as_string'])) {
|
37 |
+
$options['_body_as_string'] = $options['curl']['body_as_string'];
|
38 |
+
unset($options['curl']['body_as_string']);
|
39 |
+
}
|
40 |
+
|
41 |
+
$easy = new EasyHandle;
|
42 |
+
$easy->request = $request;
|
43 |
+
$easy->options = $options;
|
44 |
+
$conf = $this->getDefaultConf($easy);
|
45 |
+
$this->applyMethod($easy, $conf);
|
46 |
+
$this->applyHandlerOptions($easy, $conf);
|
47 |
+
$this->applyHeaders($easy, $conf);
|
48 |
+
unset($conf['_headers']);
|
49 |
+
|
50 |
+
// Add handler options from the request configuration options
|
51 |
+
if (isset($options['curl'])) {
|
52 |
+
$conf = array_replace($conf, $options['curl']);
|
53 |
+
}
|
54 |
+
|
55 |
+
$conf[CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
|
56 |
+
$easy->handle = $this->handles
|
57 |
+
? array_pop($this->handles)
|
58 |
+
: curl_init();
|
59 |
+
curl_setopt_array($easy->handle, $conf);
|
60 |
+
|
61 |
+
return $easy;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function release(EasyHandle $easy)
|
65 |
+
{
|
66 |
+
$resource = $easy->handle;
|
67 |
+
unset($easy->handle);
|
68 |
+
|
69 |
+
if (count($this->handles) >= $this->maxHandles) {
|
70 |
+
curl_close($resource);
|
71 |
+
} else {
|
72 |
+
// Remove all callback functions as they can hold onto references
|
73 |
+
// and are not cleaned up by curl_reset. Using curl_setopt_array
|
74 |
+
// does not work for some reason, so removing each one
|
75 |
+
// individually.
|
76 |
+
curl_setopt($resource, CURLOPT_HEADERFUNCTION, null);
|
77 |
+
curl_setopt($resource, CURLOPT_READFUNCTION, null);
|
78 |
+
curl_setopt($resource, CURLOPT_WRITEFUNCTION, null);
|
79 |
+
curl_setopt($resource, CURLOPT_PROGRESSFUNCTION, null);
|
80 |
+
curl_reset($resource);
|
81 |
+
$this->handles[] = $resource;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
/**
|
86 |
+
* Completes a cURL transaction, either returning a response promise or a
|
87 |
+
* rejected promise.
|
88 |
+
*
|
89 |
+
* @param callable $handler
|
90 |
+
* @param EasyHandle $easy
|
91 |
+
* @param CurlFactoryInterface $factory Dictates how the handle is released
|
92 |
+
*
|
93 |
+
* @return \GuzzleHttp\Promise\PromiseInterface
|
94 |
+
*/
|
95 |
+
public static function finish(
|
96 |
+
callable $handler,
|
97 |
+
EasyHandle $easy,
|
98 |
+
CurlFactoryInterface $factory
|
99 |
+
) {
|
100 |
+
if (isset($easy->options['on_stats'])) {
|
101 |
+
self::invokeStats($easy);
|
102 |
+
}
|
103 |
+
|
104 |
+
if (!$easy->response || $easy->errno) {
|
105 |
+
return self::finishError($handler, $easy, $factory);
|
106 |
+
}
|
107 |
+
|
108 |
+
// Return the response if it is present and there is no error.
|
109 |
+
$factory->release($easy);
|
110 |
+
|
111 |
+
// Rewind the body of the response if possible.
|
112 |
+
$body = $easy->response->getBody();
|
113 |
+
if ($body->isSeekable()) {
|
114 |
+
$body->rewind();
|
115 |
+
}
|
116 |
+
|
117 |
+
return new FulfilledPromise($easy->response);
|
118 |
+
}
|
119 |
+
|
120 |
+
private static function invokeStats(EasyHandle $easy)
|
121 |
+
{
|
122 |
+
$curlStats = curl_getinfo($easy->handle);
|
123 |
+
$curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME);
|
124 |
+
$stats = new TransferStats(
|
125 |
+
$easy->request,
|
126 |
+
$easy->response,
|
127 |
+
$curlStats['total_time'],
|
128 |
+
$easy->errno,
|
129 |
+
$curlStats
|
130 |
+
);
|
131 |
+
call_user_func($easy->options['on_stats'], $stats);
|
132 |
+
}
|
133 |
+
|
134 |
+
private static function finishError(
|
135 |
+
callable $handler,
|
136 |
+
EasyHandle $easy,
|
137 |
+
CurlFactoryInterface $factory
|
138 |
+
) {
|
139 |
+
// Get error information and release the handle to the factory.
|
140 |
+
$ctx = [
|
141 |
+
'errno' => $easy->errno,
|
142 |
+
'error' => curl_error($easy->handle),
|
143 |
+
'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME),
|
144 |
+
] + curl_getinfo($easy->handle);
|
145 |
+
$ctx[self::CURL_VERSION_STR] = curl_version()['version'];
|
146 |
+
$factory->release($easy);
|
147 |
+
|
148 |
+
// Retry when nothing is present or when curl failed to rewind.
|
149 |
+
if (empty($easy->options['_err_message'])
|
150 |
+
&& (!$easy->errno || $easy->errno == 65)
|
151 |
+
) {
|
152 |
+
return self::retryFailedRewind($handler, $easy, $ctx);
|
153 |
+
}
|
154 |
+
|
155 |
+
return self::createRejection($easy, $ctx);
|
156 |
+
}
|
157 |
+
|
158 |
+
private static function createRejection(EasyHandle $easy, array $ctx)
|
159 |
+
{
|
160 |
+
static $connectionErrors = [
|
161 |
+
CURLE_OPERATION_TIMEOUTED => true,
|
162 |
+
CURLE_COULDNT_RESOLVE_HOST => true,
|
163 |
+
CURLE_COULDNT_CONNECT => true,
|
164 |
+
CURLE_SSL_CONNECT_ERROR => true,
|
165 |
+
CURLE_GOT_NOTHING => true,
|
166 |
+
];
|
167 |
+
|
168 |
+
// If an exception was encountered during the onHeaders event, then
|
169 |
+
// return a rejected promise that wraps that exception.
|
170 |
+
if ($easy->onHeadersException) {
|
171 |
+
return \GuzzleHttp\Promise\rejection_for(
|
172 |
+
new RequestException(
|
173 |
+
'An error was encountered during the on_headers event',
|
174 |
+
$easy->request,
|
175 |
+
$easy->response,
|
176 |
+
$easy->onHeadersException,
|
177 |
+
$ctx
|
178 |
+
)
|
179 |
+
);
|
180 |
+
}
|
181 |
+
if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) {
|
182 |
+
$message = sprintf(
|
183 |
+
'cURL error %s: %s (%s)',
|
184 |
+
$ctx['errno'],
|
185 |
+
$ctx['error'],
|
186 |
+
'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
|
187 |
+
);
|
188 |
+
} else {
|
189 |
+
$message = sprintf(
|
190 |
+
'cURL error %s: %s (%s) for %s',
|
191 |
+
$ctx['errno'],
|
192 |
+
$ctx['error'],
|
193 |
+
'see https://curl.haxx.se/libcurl/c/libcurl-errors.html',
|
194 |
+
$easy->request->getUri()
|
195 |
+
);
|
196 |
+
}
|
197 |
+
|
198 |
+
// Create a connection exception if it was a specific error code.
|
199 |
+
$error = isset($connectionErrors[$easy->errno])
|
200 |
+
? new ConnectException($message, $easy->request, null, $ctx)
|
201 |
+
: new RequestException($message, $easy->request, $easy->response, null, $ctx);
|
202 |
+
|
203 |
+
return \GuzzleHttp\Promise\rejection_for($error);
|
204 |
+
}
|
205 |
+
|
206 |
+
private function getDefaultConf(EasyHandle $easy)
|
207 |
+
{
|
208 |
+
$conf = [
|
209 |
+
'_headers' => $easy->request->getHeaders(),
|
210 |
+
CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
|
211 |
+
CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
|
212 |
+
CURLOPT_RETURNTRANSFER => false,
|
213 |
+
CURLOPT_HEADER => false,
|
214 |
+
CURLOPT_CONNECTTIMEOUT => 150,
|
215 |
+
];
|
216 |
+
|
217 |
+
if (defined('CURLOPT_PROTOCOLS')) {
|
218 |
+
$conf[CURLOPT_PROTOCOLS] = CURLPROTO_HTTP | CURLPROTO_HTTPS;
|
219 |
+
}
|
220 |
+
|
221 |
+
$version = $easy->request->getProtocolVersion();
|
222 |
+
if ($version == 1.1) {
|
223 |
+
$conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
|
224 |
+
} elseif ($version == 2.0) {
|
225 |
+
$conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
|
226 |
+
} else {
|
227 |
+
$conf[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
|
228 |
+
}
|
229 |
+
|
230 |
+
return $conf;
|
231 |
+
}
|
232 |
+
|
233 |
+
private function applyMethod(EasyHandle $easy, array &$conf)
|
234 |
+
{
|
235 |
+
$body = $easy->request->getBody();
|
236 |
+
$size = $body->getSize();
|
237 |
+
|
238 |
+
if ($size === null || $size > 0) {
|
239 |
+
$this->applyBody($easy->request, $easy->options, $conf);
|
240 |
+
return;
|
241 |
+
}
|
242 |
+
|
243 |
+
$method = $easy->request->getMethod();
|
244 |
+
if ($method === 'PUT' || $method === 'POST') {
|
245 |
+
// See http://tools.ietf.org/html/rfc7230#section-3.3.2
|
246 |
+
if (!$easy->request->hasHeader('Content-Length')) {
|
247 |
+
$conf[CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
|
248 |
+
}
|
249 |
+
} elseif ($method === 'HEAD') {
|
250 |
+
$conf[CURLOPT_NOBODY] = true;
|
251 |
+
unset(
|
252 |
+
$conf[CURLOPT_WRITEFUNCTION],
|
253 |
+
$conf[CURLOPT_READFUNCTION],
|
254 |
+
$conf[CURLOPT_FILE],
|
255 |
+
$conf[CURLOPT_INFILE]
|
256 |
+
);
|
257 |
+
}
|
258 |
+
}
|
259 |
+
|
260 |
+
private function applyBody(RequestInterface $request, array $options, array &$conf)
|
261 |
+
{
|
262 |
+
$size = $request->hasHeader('Content-Length')
|
263 |
+
? (int) $request->getHeaderLine('Content-Length')
|
264 |
+
: null;
|
265 |
+
|
266 |
+
// Send the body as a string if the size is less than 1MB OR if the
|
267 |
+
// [curl][body_as_string] request value is set.
|
268 |
+
if (($size !== null && $size < 1000000) ||
|
269 |
+
!empty($options['_body_as_string'])
|
270 |
+
) {
|
271 |
+
$conf[CURLOPT_POSTFIELDS] = (string) $request->getBody();
|
272 |
+
// Don't duplicate the Content-Length header
|
273 |
+
$this->removeHeader('Content-Length', $conf);
|
274 |
+
$this->removeHeader('Transfer-Encoding', $conf);
|
275 |
+
} else {
|
276 |
+
$conf[CURLOPT_UPLOAD] = true;
|
277 |
+
if ($size !== null) {
|
278 |
+
$conf[CURLOPT_INFILESIZE] = $size;
|
279 |
+
$this->removeHeader('Content-Length', $conf);
|
280 |
+
}
|
281 |
+
$body = $request->getBody();
|
282 |
+
if ($body->isSeekable()) {
|
283 |
+
$body->rewind();
|
284 |
+
}
|
285 |
+
$conf[CURLOPT_READFUNCTION] = function ($ch, $fd, $length) use ($body) {
|
286 |
+
return $body->read($length);
|
287 |
+
};
|
288 |
+
}
|
289 |
+
|
290 |
+
// If the Expect header is not present, prevent curl from adding it
|
291 |
+
if (!$request->hasHeader('Expect')) {
|
292 |
+
$conf[CURLOPT_HTTPHEADER][] = 'Expect:';
|
293 |
+
}
|
294 |
+
|
295 |
+
// cURL sometimes adds a content-type by default. Prevent this.
|
296 |
+
if (!$request->hasHeader('Content-Type')) {
|
297 |
+
$conf[CURLOPT_HTTPHEADER][] = 'Content-Type:';
|
298 |
+
}
|
299 |
+
}
|
300 |
+
|
301 |
+
private function applyHeaders(EasyHandle $easy, array &$conf)
|
302 |
+
{
|
303 |
+
foreach ($conf['_headers'] as $name => $values) {
|
304 |
+
foreach ($values as $value) {
|
305 |
+
$value = (string) $value;
|
306 |
+
if ($value === '') {
|
307 |
+
// cURL requires a special format for empty headers.
|
308 |
+
// See https://github.com/guzzle/guzzle/issues/1882 for more details.
|
309 |
+
$conf[CURLOPT_HTTPHEADER][] = "$name;";
|
310 |
+
} else {
|
311 |
+
$conf[CURLOPT_HTTPHEADER][] = "$name: $value";
|
312 |
+
}
|
313 |
+
}
|
314 |
+
}
|
315 |
+
|
316 |
+
// Remove the Accept header if one was not set
|
317 |
+
if (!$easy->request->hasHeader('Accept')) {
|
318 |
+
$conf[CURLOPT_HTTPHEADER][] = 'Accept:';
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
/**
|
323 |
+
* Remove a header from the options array.
|
324 |
+
*
|
325 |
+
* @param string $name Case-insensitive header to remove
|
326 |
+
* @param array $options Array of options to modify
|
327 |
+
*/
|
328 |
+
private function removeHeader($name, array &$options)
|
329 |
+
{
|
330 |
+
foreach (array_keys($options['_headers']) as $key) {
|
331 |
+
if (!strcasecmp($key, $name)) {
|
332 |
+
unset($options['_headers'][$key]);
|
333 |
+
return;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
|
338 |
+
private function applyHandlerOptions(EasyHandle $easy, array &$conf)
|
339 |
+
{
|
340 |
+
$options = $easy->options;
|
341 |
+
if (isset($options['verify'])) {
|
342 |
+
if ($options['verify'] === false) {
|
343 |
+
unset($conf[CURLOPT_CAINFO]);
|
344 |
+
$conf[CURLOPT_SSL_VERIFYHOST] = 0;
|
345 |
+
$conf[CURLOPT_SSL_VERIFYPEER] = false;
|
346 |
+
} else {
|
347 |
+
$conf[CURLOPT_SSL_VERIFYHOST] = 2;
|
348 |
+
$conf[CURLOPT_SSL_VERIFYPEER] = true;
|
349 |
+
if (is_string($options['verify'])) {
|
350 |
+
// Throw an error if the file/folder/link path is not valid or doesn't exist.
|
351 |
+
if (!file_exists($options['verify'])) {
|
352 |
+
throw new \InvalidArgumentException(
|
353 |
+
"SSL CA bundle not found: {$options['verify']}"
|
354 |
+
);
|
355 |
+
}
|
356 |
+
// If it's a directory or a link to a directory use CURLOPT_CAPATH.
|
357 |
+
// If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
|
358 |
+
if (is_dir($options['verify']) ||
|
359 |
+
(is_link($options['verify']) && is_dir(readlink($options['verify'])))) {
|
360 |
+
$conf[CURLOPT_CAPATH] = $options['verify'];
|
361 |
+
} else {
|
362 |
+
$conf[CURLOPT_CAINFO] = $options['verify'];
|
363 |
+
}
|
364 |
+
}
|
365 |
+
}
|
366 |
+
}
|
367 |
+
|
368 |
+
if (!empty($options['decode_content'])) {
|
369 |
+
$accept = $easy->request->getHeaderLine('Accept-Encoding');
|
370 |
+
if ($accept) {
|
371 |
+
$conf[CURLOPT_ENCODING] = $accept;
|
372 |
+
} else {
|
373 |
+
$conf[CURLOPT_ENCODING] = '';
|
374 |
+
// Don't let curl send the header over the wire
|
375 |
+
$conf[CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
if (isset($options['sink'])) {
|
380 |
+
$sink = $options['sink'];
|
381 |
+
if (!is_string($sink)) {
|
382 |
+
$sink = \GuzzleHttp\Psr7\stream_for($sink);
|
383 |
+
} elseif (!is_dir(dirname($sink))) {
|
384 |
+
// Ensure that the directory exists before failing in curl.
|
385 |
+
throw new \RuntimeException(sprintf(
|
386 |
+
'Directory %s does not exist for sink value of %s',
|
387 |
+
dirname($sink),
|
388 |
+
$sink
|
389 |
+
));
|
390 |
+
} else {
|
391 |
+
$sink = new LazyOpenStream($sink, 'w+');
|
392 |
+
}
|
393 |
+
$easy->sink = $sink;
|
394 |
+
$conf[CURLOPT_WRITEFUNCTION] = function ($ch, $write) use ($sink) {
|
395 |
+
return $sink->write($write);
|
396 |
+
};
|
397 |
+
} else {
|
398 |
+
// Use a default temp stream if no sink was set.
|
399 |
+
$conf[CURLOPT_FILE] = fopen('php://temp', 'w+');
|
400 |
+
$easy->sink = Psr7\stream_for($conf[CURLOPT_FILE]);
|
401 |
+
}
|
402 |
+
$timeoutRequiresNoSignal = false;
|
403 |
+
if (isset($options['timeout'])) {
|
404 |
+
$timeoutRequiresNoSignal |= $options['timeout'] < 1;
|
405 |
+
$conf[CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
|
406 |
+
}
|
407 |
+
|
408 |
+
// CURL default value is CURL_IPRESOLVE_WHATEVER
|
409 |
+
if (isset($options['force_ip_resolve'])) {
|
410 |
+
if ('v4' === $options['force_ip_resolve']) {
|
411 |
+
$conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
|
412 |
+
} elseif ('v6' === $options['force_ip_resolve']) {
|
413 |
+
$conf[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V6;
|
414 |
+
}
|
415 |
+
}
|
416 |
+
|
417 |
+
if (isset($options['connect_timeout'])) {
|
418 |
+
$timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
|
419 |
+
$conf[CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
|
420 |
+
}
|
421 |
+
|
422 |
+
if ($timeoutRequiresNoSignal && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
|
423 |
+
$conf[CURLOPT_NOSIGNAL] = true;
|
424 |
+
}
|
425 |
+
|
426 |
+
if (isset($options['proxy'])) {
|
427 |
+
if (!is_array($options['proxy'])) {
|
428 |
+
$conf[CURLOPT_PROXY] = $options['proxy'];
|
429 |
+
} else {
|
430 |
+
$scheme = $easy->request->getUri()->getScheme();
|
431 |
+
if (isset($options['proxy'][$scheme])) {
|
432 |
+
$host = $easy->request->getUri()->getHost();
|
433 |
+
if (!isset($options['proxy']['no']) ||
|
434 |
+
!\GuzzleHttp\is_host_in_noproxy($host, $options['proxy']['no'])
|
435 |
+
) {
|
436 |
+
$conf[CURLOPT_PROXY] = $options['proxy'][$scheme];
|
437 |
+
}
|
438 |
+
}
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
if (isset($options['cert'])) {
|
443 |
+
$cert = $options['cert'];
|
444 |
+
if (is_array($cert)) {
|
445 |
+
$conf[CURLOPT_SSLCERTPASSWD] = $cert[1];
|
446 |
+
$cert = $cert[0];
|
447 |
+
}
|
448 |
+
if (!file_exists($cert)) {
|
449 |
+
throw new \InvalidArgumentException(
|
450 |
+
"SSL certificate not found: {$cert}"
|
451 |
+
);
|
452 |
+
}
|
453 |
+
$conf[CURLOPT_SSLCERT] = $cert;
|
454 |
+
}
|
455 |
+
|
456 |
+
if (isset($options['ssl_key'])) {
|
457 |
+
if (is_array($options['ssl_key'])) {
|
458 |
+
if (count($options['ssl_key']) === 2) {
|
459 |
+
list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key'];
|
460 |
+
} else {
|
461 |
+
list($sslKey) = $options['ssl_key'];
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
$sslKey = isset($sslKey) ? $sslKey: $options['ssl_key'];
|
466 |
+
|
467 |
+
if (!file_exists($sslKey)) {
|
468 |
+
throw new \InvalidArgumentException(
|
469 |
+
"SSL private key not found: {$sslKey}"
|
470 |
+
);
|
471 |
+
}
|
472 |
+
$conf[CURLOPT_SSLKEY] = $sslKey;
|
473 |
+
}
|
474 |
+
|
475 |
+
if (isset($options['progress'])) {
|
476 |
+
$progress = $options['progress'];
|
477 |
+
if (!is_callable($progress)) {
|
478 |
+
throw new \InvalidArgumentException(
|
479 |
+
'progress client option must be callable'
|
480 |
+
);
|
481 |
+
}
|
482 |
+
$conf[CURLOPT_NOPROGRESS] = false;
|
483 |
+
$conf[CURLOPT_PROGRESSFUNCTION] = function () use ($progress) {
|
484 |
+
$args = func_get_args();
|
485 |
+
// PHP 5.5 pushed the handle onto the start of the args
|
486 |
+
if (is_resource($args[0])) {
|
487 |
+
array_shift($args);
|
488 |
+
}
|
489 |
+
call_user_func_array($progress, $args);
|
490 |
+
};
|
491 |
+
}
|
492 |
+
|
493 |
+
if (!empty($options['debug'])) {
|
494 |
+
$conf[CURLOPT_STDERR] = \GuzzleHttp\debug_resource($options['debug']);
|
495 |
+
$conf[CURLOPT_VERBOSE] = true;
|
496 |
+
}
|
497 |
+
}
|
498 |
+
|
499 |
+
/**
|
500 |
+
* This function ensures that a response was set on a transaction. If one
|
501 |
+
* was not set, then the request is retried if possible. This error
|
502 |
+
* typically means you are sending a payload, curl encountered a
|
503 |
+
* "Connection died, retrying a fresh connect" error, tried to rewind the
|
504 |
+
* stream, and then encountered a "necessary data rewind wasn't possible"
|
505 |
+
* error, causing the request to be sent through curl_multi_info_read()
|
506 |
+
* without an error status.
|
507 |
+
*/
|
508 |
+
private static function retryFailedRewind(
|
509 |
+
callable $handler,
|
510 |
+
EasyHandle $easy,
|
511 |
+
array $ctx
|
512 |
+
) {
|
513 |
+
try {
|
514 |
+
// Only rewind if the body has been read from.
|
515 |
+
$body = $easy->request->getBody();
|
516 |
+
if ($body->tell() > 0) {
|
517 |
+
$body->rewind();
|
518 |
+
}
|
519 |
+
} catch (\RuntimeException $e) {
|
520 |
+
$ctx['error'] = 'The connection unexpectedly failed without '
|
521 |
+
. 'providing an error. The request would have been retried, '
|
522 |
+
. 'but attempting to rewind the request body failed. '
|
523 |
+
. 'Exception: ' . $e;
|
524 |
+
return self::createRejection($easy, $ctx);
|
525 |
+
}
|
526 |
+
|
527 |
+
// Retry no more than 3 times before giving up.
|
528 |
+
if (!isset($easy->options['_curl_retries'])) {
|
529 |
+
$easy->options['_curl_retries'] = 1;
|
530 |
+
} elseif ($easy->options['_curl_retries'] == 2) {
|
531 |
+
$ctx['error'] = 'The cURL request was retried 3 times '
|
532 |
+
. 'and did not succeed. The most likely reason for the failure '
|
533 |
+
. 'is that cURL was unable to rewind the body of the request '
|
534 |
+
. 'and subsequent retries resulted in the same error. Turn on '
|
535 |
+
. 'the debug option to see what went wrong. See '
|
536 |
+
. 'https://bugs.php.net/bug.php?id=47204 for more information.';
|
537 |
+
return self::createRejection($easy, $ctx);
|
538 |
+
} else {
|
539 |
+
$easy->options['_curl_retries']++;
|
540 |
+
}
|
541 |
+
|
542 |
+
return $handler($easy->request, $easy->options);
|
543 |
+
}
|
544 |
+
|
545 |
+
private function createHeaderFn(EasyHandle $easy)
|
546 |
+
{
|
547 |
+
if (isset($easy->options['on_headers'])) {
|
548 |
+
$onHeaders = $easy->options['on_headers'];
|
549 |
+
|
550 |
+
if (!is_callable($onHeaders)) {
|
551 |
+
throw new \InvalidArgumentException('on_headers must be callable');
|
552 |
+
}
|
553 |
+
} else {
|
554 |
+
$onHeaders = null;
|
555 |
+
}
|
556 |
+
|
557 |
+
return function ($ch, $h) use (
|
558 |
+
$onHeaders,
|
559 |
+
$easy,
|
560 |
+
&$startingResponse
|
561 |
+
) {
|
562 |
+
$value = trim($h);
|
563 |
+
if ($value === '') {
|
564 |
+
$startingResponse = true;
|
565 |
+
$easy->createResponse();
|
566 |
+
if ($onHeaders !== null) {
|
567 |
+
try {
|
568 |
+
$onHeaders($easy->response);
|
569 |
+
} catch (\Exception $e) {
|
570 |
+
// Associate the exception with the handle and trigger
|
571 |
+
// a curl header write error by returning 0.
|
572 |
+
$easy->onHeadersException = $e;
|
573 |
+
return -1;
|
574 |
+
}
|
575 |
+
}
|
576 |
+
} elseif ($startingResponse) {
|
577 |
+
$startingResponse = false;
|
578 |
+
$easy->headers = [$value];
|
579 |
+
} else {
|
580 |
+
$easy->headers[] = $value;
|
581 |
+
}
|
582 |
+
return strlen($h);
|
583 |
+
};
|
584 |
+
}
|
585 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use Psr\Http\Message\RequestInterface;
|
5 |
+
|
6 |
+
interface CurlFactoryInterface
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* Creates a cURL handle resource.
|
10 |
+
*
|
11 |
+
* @param RequestInterface $request Request
|
12 |
+
* @param array $options Transfer options
|
13 |
+
*
|
14 |
+
* @return EasyHandle
|
15 |
+
* @throws \RuntimeException when an option cannot be applied
|
16 |
+
*/
|
17 |
+
public function create(RequestInterface $request, array $options);
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Release an easy handle, allowing it to be reused or closed.
|
21 |
+
*
|
22 |
+
* This function must call unset on the easy handle's "handle" property.
|
23 |
+
*
|
24 |
+
* @param EasyHandle $easy
|
25 |
+
*/
|
26 |
+
public function release(EasyHandle $easy);
|
27 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\Psr7;
|
5 |
+
use Psr\Http\Message\RequestInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* HTTP handler that uses cURL easy handles as a transport layer.
|
9 |
+
*
|
10 |
+
* When using the CurlHandler, custom curl options can be specified as an
|
11 |
+
* associative array of curl option constants mapping to values in the
|
12 |
+
* **curl** key of the "client" key of the request.
|
13 |
+
*/
|
14 |
+
class CurlHandler
|
15 |
+
{
|
16 |
+
/** @var CurlFactoryInterface */
|
17 |
+
private $factory;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Accepts an associative array of options:
|
21 |
+
*
|
22 |
+
* - factory: Optional curl factory used to create cURL handles.
|
23 |
+
*
|
24 |
+
* @param array $options Array of options to use with the handler
|
25 |
+
*/
|
26 |
+
public function __construct(array $options = [])
|
27 |
+
{
|
28 |
+
$this->factory = isset($options['handle_factory'])
|
29 |
+
? $options['handle_factory']
|
30 |
+
: new CurlFactory(3);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function __invoke(RequestInterface $request, array $options)
|
34 |
+
{
|
35 |
+
if (isset($options['delay'])) {
|
36 |
+
usleep($options['delay'] * 1000);
|
37 |
+
}
|
38 |
+
|
39 |
+
$easy = $this->factory->create($request, $options);
|
40 |
+
curl_exec($easy->handle);
|
41 |
+
$easy->errno = curl_errno($easy->handle);
|
42 |
+
|
43 |
+
return CurlFactory::finish($this, $easy, $this->factory);
|
44 |
+
}
|
45 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\Promise as P;
|
5 |
+
use GuzzleHttp\Promise\Promise;
|
6 |
+
use GuzzleHttp\Utils;
|
7 |
+
use Psr\Http\Message\RequestInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Returns an asynchronous response using curl_multi_* functions.
|
11 |
+
*
|
12 |
+
* When using the CurlMultiHandler, custom curl options can be specified as an
|
13 |
+
* associative array of curl option constants mapping to values in the
|
14 |
+
* **curl** key of the provided request options.
|
15 |
+
*
|
16 |
+
* @property resource $_mh Internal use only. Lazy loaded multi-handle.
|
17 |
+
*/
|
18 |
+
class CurlMultiHandler
|
19 |
+
{
|
20 |
+
/** @var CurlFactoryInterface */
|
21 |
+
private $factory;
|
22 |
+
private $selectTimeout;
|
23 |
+
private $active;
|
24 |
+
private $handles = [];
|
25 |
+
private $delays = [];
|
26 |
+
private $options = [];
|
27 |
+
|
28 |
+
/**
|
29 |
+
* This handler accepts the following options:
|
30 |
+
*
|
31 |
+
* - handle_factory: An optional factory used to create curl handles
|
32 |
+
* - select_timeout: Optional timeout (in seconds) to block before timing
|
33 |
+
* out while selecting curl handles. Defaults to 1 second.
|
34 |
+
* - options: An associative array of CURLMOPT_* options and
|
35 |
+
* corresponding values for curl_multi_setopt()
|
36 |
+
*
|
37 |
+
* @param array $options
|
38 |
+
*/
|
39 |
+
public function __construct(array $options = [])
|
40 |
+
{
|
41 |
+
$this->factory = isset($options['handle_factory'])
|
42 |
+
? $options['handle_factory'] : new CurlFactory(50);
|
43 |
+
|
44 |
+
if (isset($options['select_timeout'])) {
|
45 |
+
$this->selectTimeout = $options['select_timeout'];
|
46 |
+
} elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
|
47 |
+
$this->selectTimeout = $selectTimeout;
|
48 |
+
} else {
|
49 |
+
$this->selectTimeout = 1;
|
50 |
+
}
|
51 |
+
|
52 |
+
$this->options = isset($options['options']) ? $options['options'] : [];
|
53 |
+
}
|
54 |
+
|
55 |
+
public function __get($name)
|
56 |
+
{
|
57 |
+
if ($name === '_mh') {
|
58 |
+
$this->_mh = curl_multi_init();
|
59 |
+
|
60 |
+
foreach ($this->options as $option => $value) {
|
61 |
+
// A warning is raised in case of a wrong option.
|
62 |
+
curl_multi_setopt($this->_mh, $option, $value);
|
63 |
+
}
|
64 |
+
|
65 |
+
// Further calls to _mh will return the value directly, without entering the
|
66 |
+
// __get() method at all.
|
67 |
+
return $this->_mh;
|
68 |
+
}
|
69 |
+
|
70 |
+
throw new \BadMethodCallException();
|
71 |
+
}
|
72 |
+
|
73 |
+
public function __destruct()
|
74 |
+
{
|
75 |
+
if (isset($this->_mh)) {
|
76 |
+
curl_multi_close($this->_mh);
|
77 |
+
unset($this->_mh);
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
public function __invoke(RequestInterface $request, array $options)
|
82 |
+
{
|
83 |
+
$easy = $this->factory->create($request, $options);
|
84 |
+
$id = (int) $easy->handle;
|
85 |
+
|
86 |
+
$promise = new Promise(
|
87 |
+
[$this, 'execute'],
|
88 |
+
function () use ($id) {
|
89 |
+
return $this->cancel($id);
|
90 |
+
}
|
91 |
+
);
|
92 |
+
|
93 |
+
$this->addRequest(['easy' => $easy, 'deferred' => $promise]);
|
94 |
+
|
95 |
+
return $promise;
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Ticks the curl event loop.
|
100 |
+
*/
|
101 |
+
public function tick()
|
102 |
+
{
|
103 |
+
// Add any delayed handles if needed.
|
104 |
+
if ($this->delays) {
|
105 |
+
$currentTime = Utils::currentTime();
|
106 |
+
foreach ($this->delays as $id => $delay) {
|
107 |
+
if ($currentTime >= $delay) {
|
108 |
+
unset($this->delays[$id]);
|
109 |
+
curl_multi_add_handle(
|
110 |
+
$this->_mh,
|
111 |
+
$this->handles[$id]['easy']->handle
|
112 |
+
);
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
// Step through the task queue which may add additional requests.
|
118 |
+
P\queue()->run();
|
119 |
+
|
120 |
+
if ($this->active &&
|
121 |
+
curl_multi_select($this->_mh, $this->selectTimeout) === -1
|
122 |
+
) {
|
123 |
+
// Perform a usleep if a select returns -1.
|
124 |
+
// See: https://bugs.php.net/bug.php?id=61141
|
125 |
+
usleep(250);
|
126 |
+
}
|
127 |
+
|
128 |
+
while (curl_multi_exec($this->_mh, $this->active) === CURLM_CALL_MULTI_PERFORM);
|
129 |
+
|
130 |
+
$this->processMessages();
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Runs until all outstanding connections have completed.
|
135 |
+
*/
|
136 |
+
public function execute()
|
137 |
+
{
|
138 |
+
$queue = P\queue();
|
139 |
+
|
140 |
+
while ($this->handles || !$queue->isEmpty()) {
|
141 |
+
// If there are no transfers, then sleep for the next delay
|
142 |
+
if (!$this->active && $this->delays) {
|
143 |
+
usleep($this->timeToNext());
|
144 |
+
}
|
145 |
+
$this->tick();
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
private function addRequest(array $entry)
|
150 |
+
{
|
151 |
+
$easy = $entry['easy'];
|
152 |
+
$id = (int) $easy->handle;
|
153 |
+
$this->handles[$id] = $entry;
|
154 |
+
if (empty($easy->options['delay'])) {
|
155 |
+
curl_multi_add_handle($this->_mh, $easy->handle);
|
156 |
+
} else {
|
157 |
+
$this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000);
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Cancels a handle from sending and removes references to it.
|
163 |
+
*
|
164 |
+
* @param int $id Handle ID to cancel and remove.
|
165 |
+
*
|
166 |
+
* @return bool True on success, false on failure.
|
167 |
+
*/
|
168 |
+
private function cancel($id)
|
169 |
+
{
|
170 |
+
// Cannot cancel if it has been processed.
|
171 |
+
if (!isset($this->handles[$id])) {
|
172 |
+
return false;
|
173 |
+
}
|
174 |
+
|
175 |
+
$handle = $this->handles[$id]['easy']->handle;
|
176 |
+
unset($this->delays[$id], $this->handles[$id]);
|
177 |
+
curl_multi_remove_handle($this->_mh, $handle);
|
178 |
+
curl_close($handle);
|
179 |
+
|
180 |
+
return true;
|
181 |
+
}
|
182 |
+
|
183 |
+
private function processMessages()
|
184 |
+
{
|
185 |
+
while ($done = curl_multi_info_read($this->_mh)) {
|
186 |
+
$id = (int) $done['handle'];
|
187 |
+
curl_multi_remove_handle($this->_mh, $done['handle']);
|
188 |
+
|
189 |
+
if (!isset($this->handles[$id])) {
|
190 |
+
// Probably was cancelled.
|
191 |
+
continue;
|
192 |
+
}
|
193 |
+
|
194 |
+
$entry = $this->handles[$id];
|
195 |
+
unset($this->handles[$id], $this->delays[$id]);
|
196 |
+
$entry['easy']->errno = $done['result'];
|
197 |
+
$entry['deferred']->resolve(
|
198 |
+
CurlFactory::finish(
|
199 |
+
$this,
|
200 |
+
$entry['easy'],
|
201 |
+
$this->factory
|
202 |
+
)
|
203 |
+
);
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
private function timeToNext()
|
208 |
+
{
|
209 |
+
$currentTime = Utils::currentTime();
|
210 |
+
$nextTime = PHP_INT_MAX;
|
211 |
+
foreach ($this->delays as $time) {
|
212 |
+
if ($time < $nextTime) {
|
213 |
+
$nextTime = $time;
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
+
return max(0, $nextTime - $currentTime) * 1000000;
|
218 |
+
}
|
219 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\Psr7\Response;
|
5 |
+
use Psr\Http\Message\RequestInterface;
|
6 |
+
use Psr\Http\Message\ResponseInterface;
|
7 |
+
use Psr\Http\Message\StreamInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Represents a cURL easy handle and the data it populates.
|
11 |
+
*
|
12 |
+
* @internal
|
13 |
+
*/
|
14 |
+
final class EasyHandle
|
15 |
+
{
|
16 |
+
/** @var resource cURL resource */
|
17 |
+
public $handle;
|
18 |
+
|
19 |
+
/** @var StreamInterface Where data is being written */
|
20 |
+
public $sink;
|
21 |
+
|
22 |
+
/** @var array Received HTTP headers so far */
|
23 |
+
public $headers = [];
|
24 |
+
|
25 |
+
/** @var ResponseInterface Received response (if any) */
|
26 |
+
public $response;
|
27 |
+
|
28 |
+
/** @var RequestInterface Request being sent */
|
29 |
+
public $request;
|
30 |
+
|
31 |
+
/** @var array Request options */
|
32 |
+
public $options = [];
|
33 |
+
|
34 |
+
/** @var int cURL error number (if any) */
|
35 |
+
public $errno = 0;
|
36 |
+
|
37 |
+
/** @var \Exception Exception during on_headers (if any) */
|
38 |
+
public $onHeadersException;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Attach a response to the easy handle based on the received headers.
|
42 |
+
*
|
43 |
+
* @throws \RuntimeException if no headers have been received.
|
44 |
+
*/
|
45 |
+
public function createResponse()
|
46 |
+
{
|
47 |
+
if (empty($this->headers)) {
|
48 |
+
throw new \RuntimeException('No headers have been received');
|
49 |
+
}
|
50 |
+
|
51 |
+
// HTTP-version SP status-code SP reason-phrase
|
52 |
+
$startLine = explode(' ', array_shift($this->headers), 3);
|
53 |
+
$headers = \GuzzleHttp\headers_from_lines($this->headers);
|
54 |
+
$normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
|
55 |
+
|
56 |
+
if (!empty($this->options['decode_content'])
|
57 |
+
&& isset($normalizedKeys['content-encoding'])
|
58 |
+
) {
|
59 |
+
$headers['x-encoded-content-encoding']
|
60 |
+
= $headers[$normalizedKeys['content-encoding']];
|
61 |
+
unset($headers[$normalizedKeys['content-encoding']]);
|
62 |
+
if (isset($normalizedKeys['content-length'])) {
|
63 |
+
$headers['x-encoded-content-length']
|
64 |
+
= $headers[$normalizedKeys['content-length']];
|
65 |
+
|
66 |
+
$bodyLength = (int) $this->sink->getSize();
|
67 |
+
if ($bodyLength) {
|
68 |
+
$headers[$normalizedKeys['content-length']] = $bodyLength;
|
69 |
+
} else {
|
70 |
+
unset($headers[$normalizedKeys['content-length']]);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
// Attach a response to the easy handle with the parsed headers.
|
76 |
+
$this->response = new Response(
|
77 |
+
$startLine[1],
|
78 |
+
$headers,
|
79 |
+
$this->sink,
|
80 |
+
substr($startLine[0], 5),
|
81 |
+
isset($startLine[2]) ? (string) $startLine[2] : null
|
82 |
+
);
|
83 |
+
}
|
84 |
+
|
85 |
+
public function __get($name)
|
86 |
+
{
|
87 |
+
$msg = $name === 'handle'
|
88 |
+
? 'The EasyHandle has been released'
|
89 |
+
: 'Invalid property: ' . $name;
|
90 |
+
throw new \BadMethodCallException($msg);
|
91 |
+
}
|
92 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
ADDED
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\Exception\RequestException;
|
5 |
+
use GuzzleHttp\HandlerStack;
|
6 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
7 |
+
use GuzzleHttp\Promise\RejectedPromise;
|
8 |
+
use GuzzleHttp\TransferStats;
|
9 |
+
use Psr\Http\Message\RequestInterface;
|
10 |
+
use Psr\Http\Message\ResponseInterface;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Handler that returns responses or throw exceptions from a queue.
|
14 |
+
*/
|
15 |
+
class MockHandler implements \Countable
|
16 |
+
{
|
17 |
+
private $queue = [];
|
18 |
+
private $lastRequest;
|
19 |
+
private $lastOptions;
|
20 |
+
private $onFulfilled;
|
21 |
+
private $onRejected;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Creates a new MockHandler that uses the default handler stack list of
|
25 |
+
* middlewares.
|
26 |
+
*
|
27 |
+
* @param array $queue Array of responses, callables, or exceptions.
|
28 |
+
* @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
|
29 |
+
* @param callable $onRejected Callback to invoke when the return value is rejected.
|
30 |
+
*
|
31 |
+
* @return HandlerStack
|
32 |
+
*/
|
33 |
+
public static function createWithMiddleware(
|
34 |
+
array $queue = null,
|
35 |
+
callable $onFulfilled = null,
|
36 |
+
callable $onRejected = null
|
37 |
+
) {
|
38 |
+
return HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* The passed in value must be an array of
|
43 |
+
* {@see Psr7\Http\Message\ResponseInterface} objects, Exceptions,
|
44 |
+
* callables, or Promises.
|
45 |
+
*
|
46 |
+
* @param array $queue
|
47 |
+
* @param callable $onFulfilled Callback to invoke when the return value is fulfilled.
|
48 |
+
* @param callable $onRejected Callback to invoke when the return value is rejected.
|
49 |
+
*/
|
50 |
+
public function __construct(
|
51 |
+
array $queue = null,
|
52 |
+
callable $onFulfilled = null,
|
53 |
+
callable $onRejected = null
|
54 |
+
) {
|
55 |
+
$this->onFulfilled = $onFulfilled;
|
56 |
+
$this->onRejected = $onRejected;
|
57 |
+
|
58 |
+
if ($queue) {
|
59 |
+
call_user_func_array([$this, 'append'], $queue);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
public function __invoke(RequestInterface $request, array $options)
|
64 |
+
{
|
65 |
+
if (!$this->queue) {
|
66 |
+
throw new \OutOfBoundsException('Mock queue is empty');
|
67 |
+
}
|
68 |
+
|
69 |
+
if (isset($options['delay']) && is_numeric($options['delay'])) {
|
70 |
+
usleep($options['delay'] * 1000);
|
71 |
+
}
|
72 |
+
|
73 |
+
$this->lastRequest = $request;
|
74 |
+
$this->lastOptions = $options;
|
75 |
+
$response = array_shift($this->queue);
|
76 |
+
|
77 |
+
if (isset($options['on_headers'])) {
|
78 |
+
if (!is_callable($options['on_headers'])) {
|
79 |
+
throw new \InvalidArgumentException('on_headers must be callable');
|
80 |
+
}
|
81 |
+
try {
|
82 |
+
$options['on_headers']($response);
|
83 |
+
} catch (\Exception $e) {
|
84 |
+
$msg = 'An error was encountered during the on_headers event';
|
85 |
+
$response = new RequestException($msg, $request, $response, $e);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
if (is_callable($response)) {
|
90 |
+
$response = call_user_func($response, $request, $options);
|
91 |
+
}
|
92 |
+
|
93 |
+
$response = $response instanceof \Exception
|
94 |
+
? \GuzzleHttp\Promise\rejection_for($response)
|
95 |
+
: \GuzzleHttp\Promise\promise_for($response);
|
96 |
+
|
97 |
+
return $response->then(
|
98 |
+
function ($value) use ($request, $options) {
|
99 |
+
$this->invokeStats($request, $options, $value);
|
100 |
+
if ($this->onFulfilled) {
|
101 |
+
call_user_func($this->onFulfilled, $value);
|
102 |
+
}
|
103 |
+
if (isset($options['sink'])) {
|
104 |
+
$contents = (string) $value->getBody();
|
105 |
+
$sink = $options['sink'];
|
106 |
+
|
107 |
+
if (is_resource($sink)) {
|
108 |
+
fwrite($sink, $contents);
|
109 |
+
} elseif (is_string($sink)) {
|
110 |
+
file_put_contents($sink, $contents);
|
111 |
+
} elseif ($sink instanceof \Psr\Http\Message\StreamInterface) {
|
112 |
+
$sink->write($contents);
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
return $value;
|
117 |
+
},
|
118 |
+
function ($reason) use ($request, $options) {
|
119 |
+
$this->invokeStats($request, $options, null, $reason);
|
120 |
+
if ($this->onRejected) {
|
121 |
+
call_user_func($this->onRejected, $reason);
|
122 |
+
}
|
123 |
+
return \GuzzleHttp\Promise\rejection_for($reason);
|
124 |
+
}
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Adds one or more variadic requests, exceptions, callables, or promises
|
130 |
+
* to the queue.
|
131 |
+
*/
|
132 |
+
public function append()
|
133 |
+
{
|
134 |
+
foreach (func_get_args() as $value) {
|
135 |
+
if ($value instanceof ResponseInterface
|
136 |
+
|| $value instanceof \Exception
|
137 |
+
|| $value instanceof PromiseInterface
|
138 |
+
|| is_callable($value)
|
139 |
+
) {
|
140 |
+
$this->queue[] = $value;
|
141 |
+
} else {
|
142 |
+
throw new \InvalidArgumentException('Expected a response or '
|
143 |
+
. 'exception. Found ' . \GuzzleHttp\describe_type($value));
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Get the last received request.
|
150 |
+
*
|
151 |
+
* @return RequestInterface
|
152 |
+
*/
|
153 |
+
public function getLastRequest()
|
154 |
+
{
|
155 |
+
return $this->lastRequest;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Get the last received request options.
|
160 |
+
*
|
161 |
+
* @return array
|
162 |
+
*/
|
163 |
+
public function getLastOptions()
|
164 |
+
{
|
165 |
+
return $this->lastOptions;
|
166 |
+
}
|
167 |
+
|
168 |
+
/**
|
169 |
+
* Returns the number of remaining items in the queue.
|
170 |
+
*
|
171 |
+
* @return int
|
172 |
+
*/
|
173 |
+
public function count()
|
174 |
+
{
|
175 |
+
return count($this->queue);
|
176 |
+
}
|
177 |
+
|
178 |
+
public function reset()
|
179 |
+
{
|
180 |
+
$this->queue = [];
|
181 |
+
}
|
182 |
+
|
183 |
+
private function invokeStats(
|
184 |
+
RequestInterface $request,
|
185 |
+
array $options,
|
186 |
+
ResponseInterface $response = null,
|
187 |
+
$reason = null
|
188 |
+
) {
|
189 |
+
if (isset($options['on_stats'])) {
|
190 |
+
$transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0;
|
191 |
+
$stats = new TransferStats($request, $response, $transferTime, $reason);
|
192 |
+
call_user_func($options['on_stats'], $stats);
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\RequestOptions;
|
5 |
+
use Psr\Http\Message\RequestInterface;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Provides basic proxies for handlers.
|
9 |
+
*/
|
10 |
+
class Proxy
|
11 |
+
{
|
12 |
+
/**
|
13 |
+
* Sends synchronous requests to a specific handler while sending all other
|
14 |
+
* requests to another handler.
|
15 |
+
*
|
16 |
+
* @param callable $default Handler used for normal responses
|
17 |
+
* @param callable $sync Handler used for synchronous responses.
|
18 |
+
*
|
19 |
+
* @return callable Returns the composed handler.
|
20 |
+
*/
|
21 |
+
public static function wrapSync(
|
22 |
+
callable $default,
|
23 |
+
callable $sync
|
24 |
+
) {
|
25 |
+
return function (RequestInterface $request, array $options) use ($default, $sync) {
|
26 |
+
return empty($options[RequestOptions::SYNCHRONOUS])
|
27 |
+
? $default($request, $options)
|
28 |
+
: $sync($request, $options);
|
29 |
+
};
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Sends streaming requests to a streaming compatible handler while sending
|
34 |
+
* all other requests to a default handler.
|
35 |
+
*
|
36 |
+
* This, for example, could be useful for taking advantage of the
|
37 |
+
* performance benefits of curl while still supporting true streaming
|
38 |
+
* through the StreamHandler.
|
39 |
+
*
|
40 |
+
* @param callable $default Handler used for non-streaming responses
|
41 |
+
* @param callable $streaming Handler used for streaming responses
|
42 |
+
*
|
43 |
+
* @return callable Returns the composed handler.
|
44 |
+
*/
|
45 |
+
public static function wrapStreaming(
|
46 |
+
callable $default,
|
47 |
+
callable $streaming
|
48 |
+
) {
|
49 |
+
return function (RequestInterface $request, array $options) use ($default, $streaming) {
|
50 |
+
return empty($options['stream'])
|
51 |
+
? $default($request, $options)
|
52 |
+
: $streaming($request, $options);
|
53 |
+
};
|
54 |
+
}
|
55 |
+
}
|
vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
ADDED
@@ -0,0 +1,545 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Handler;
|
3 |
+
|
4 |
+
use GuzzleHttp\Exception\ConnectException;
|
5 |
+
use GuzzleHttp\Exception\RequestException;
|
6 |
+
use GuzzleHttp\Promise\FulfilledPromise;
|
7 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
8 |
+
use GuzzleHttp\Psr7;
|
9 |
+
use GuzzleHttp\TransferStats;
|
10 |
+
use GuzzleHttp\Utils;
|
11 |
+
use Psr\Http\Message\RequestInterface;
|
12 |
+
use Psr\Http\Message\ResponseInterface;
|
13 |
+
use Psr\Http\Message\StreamInterface;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* HTTP handler that uses PHP's HTTP stream wrapper.
|
17 |
+
*/
|
18 |
+
class StreamHandler
|
19 |
+
{
|
20 |
+
private $lastHeaders = [];
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Sends an HTTP request.
|
24 |
+
*
|
25 |
+
* @param RequestInterface $request Request to send.
|
26 |
+
* @param array $options Request transfer options.
|
27 |
+
*
|
28 |
+
* @return PromiseInterface
|
29 |
+
*/
|
30 |
+
public function __invoke(RequestInterface $request, array $options)
|
31 |
+
{
|
32 |
+
// Sleep if there is a delay specified.
|
33 |
+
if (isset($options['delay'])) {
|
34 |
+
usleep($options['delay'] * 1000);
|
35 |
+
}
|
36 |
+
|
37 |
+
$startTime = isset($options['on_stats']) ? Utils::currentTime() : null;
|
38 |
+
|
39 |
+
try {
|
40 |
+
// Does not support the expect header.
|
41 |
+
$request = $request->withoutHeader('Expect');
|
42 |
+
|
43 |
+
// Append a content-length header if body size is zero to match
|
44 |
+
// cURL's behavior.
|
45 |
+
if (0 === $request->getBody()->getSize()) {
|
46 |
+
$request = $request->withHeader('Content-Length', '0');
|
47 |
+
}
|
48 |
+
|
49 |
+
return $this->createResponse(
|
50 |
+
$request,
|
51 |
+
$options,
|
52 |
+
$this->createStream($request, $options),
|
53 |
+
$startTime
|
54 |
+
);
|
55 |
+
} catch (\InvalidArgumentException $e) {
|
56 |
+
throw $e;
|
57 |
+
} catch (\Exception $e) {
|
58 |
+
// Determine if the error was a networking error.
|
59 |
+
$message = $e->getMessage();
|
60 |
+
// This list can probably get more comprehensive.
|
61 |
+
if (strpos($message, 'getaddrinfo') // DNS lookup failed
|
62 |
+
|| strpos($message, 'Connection refused')
|
63 |
+
|| strpos($message, "couldn't connect to host") // error on HHVM
|
64 |
+
|| strpos($message, "connection attempt failed")
|
65 |
+
) {
|
66 |
+
$e = new ConnectException($e->getMessage(), $request, $e);
|
67 |
+
}
|
68 |
+
$e = RequestException::wrapException($request, $e);
|
69 |
+
$this->invokeStats($options, $request, $startTime, null, $e);
|
70 |
+
|
71 |
+
return \GuzzleHttp\Promise\rejection_for($e);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
private function invokeStats(
|
76 |
+
array $options,
|
77 |
+
RequestInterface $request,
|
78 |
+
$startTime,
|
79 |
+
ResponseInterface $response = null,
|
80 |
+
$error = null
|
81 |
+
) {
|
82 |
+
if (isset($options['on_stats'])) {
|
83 |
+
$stats = new TransferStats(
|
84 |
+
$request,
|
85 |
+
$response,
|
86 |
+
Utils::currentTime() - $startTime,
|
87 |
+
$error,
|
88 |
+
[]
|
89 |
+
);
|
90 |
+
call_user_func($options['on_stats'], $stats);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
private function createResponse(
|
95 |
+
RequestInterface $request,
|
96 |
+
array $options,
|
97 |
+
$stream,
|
98 |
+
$startTime
|
99 |
+
) {
|
100 |
+
$hdrs = $this->lastHeaders;
|
101 |
+
$this->lastHeaders = [];
|
102 |
+
$parts = explode(' ', array_shift($hdrs), 3);
|
103 |
+
$ver = explode('/', $parts[0])[1];
|
104 |
+
$status = $parts[1];
|
105 |
+
$reason = isset($parts[2]) ? $parts[2] : null;
|
106 |
+
$headers = \GuzzleHttp\headers_from_lines($hdrs);
|
107 |
+
list($stream, $headers) = $this->checkDecode($options, $headers, $stream);
|
108 |
+
$stream = Psr7\stream_for($stream);
|
109 |
+
$sink = $stream;
|
110 |
+
|
111 |
+
if (strcasecmp('HEAD', $request->getMethod())) {
|
112 |
+
$sink = $this->createSink($stream, $options);
|
113 |
+
}
|
114 |
+
|
115 |
+
$response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
|
116 |
+
|
117 |
+
if (isset($options['on_headers'])) {
|
118 |
+
try {
|
119 |
+
$options['on_headers']($response);
|
120 |
+
} catch (\Exception $e) {
|
121 |
+
$msg = 'An error was encountered during the on_headers event';
|
122 |
+
$ex = new RequestException($msg, $request, $response, $e);
|
123 |
+
return \GuzzleHttp\Promise\rejection_for($ex);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
// Do not drain when the request is a HEAD request because they have
|
128 |
+
// no body.
|
129 |
+
if ($sink !== $stream) {
|
130 |
+
$this->drain(
|
131 |
+
$stream,
|
132 |
+
$sink,
|
133 |
+
$response->getHeaderLine('Content-Length')
|
134 |
+
);
|
135 |
+
}
|
136 |
+
|
137 |
+
$this->invokeStats($options, $request, $startTime, $response, null);
|
138 |
+
|
139 |
+
return new FulfilledPromise($response);
|
140 |
+
}
|
141 |
+
|
142 |
+
private function createSink(StreamInterface $stream, array $options)
|
143 |
+
{
|
144 |
+
if (!empty($options['stream'])) {
|
145 |
+
return $stream;
|
146 |
+
}
|
147 |
+
|
148 |
+
$sink = isset($options['sink'])
|
149 |
+
? $options['sink']
|
150 |
+
: fopen('php://temp', 'r+');
|
151 |
+
|
152 |
+
return is_string($sink)
|
153 |
+
? new Psr7\LazyOpenStream($sink, 'w+')
|
154 |
+
: Psr7\stream_for($sink);
|
155 |
+
}
|
156 |
+
|
157 |
+
private function checkDecode(array $options, array $headers, $stream)
|
158 |
+
{
|
159 |
+
// Automatically decode responses when instructed.
|
160 |
+
if (!empty($options['decode_content'])) {
|
161 |
+
$normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
|
162 |
+
if (isset($normalizedKeys['content-encoding'])) {
|
163 |
+
$encoding = $headers[$normalizedKeys['content-encoding']];
|
164 |
+
if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
|
165 |
+
$stream = new Psr7\InflateStream(
|
166 |
+
Psr7\stream_for($stream)
|
167 |
+
);
|
168 |
+
$headers['x-encoded-content-encoding']
|
169 |
+
= $headers[$normalizedKeys['content-encoding']];
|
170 |
+
// Remove content-encoding header
|
171 |
+
unset($headers[$normalizedKeys['content-encoding']]);
|
172 |
+
// Fix content-length header
|
173 |
+
if (isset($normalizedKeys['content-length'])) {
|
174 |
+
$headers['x-encoded-content-length']
|
175 |
+
= $headers[$normalizedKeys['content-length']];
|
176 |
+
|
177 |
+
$length = (int) $stream->getSize();
|
178 |
+
if ($length === 0) {
|
179 |
+
unset($headers[$normalizedKeys['content-length']]);
|
180 |
+
} else {
|
181 |
+
$headers[$normalizedKeys['content-length']] = [$length];
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
return [$stream, $headers];
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Drains the source stream into the "sink" client option.
|
193 |
+
*
|
194 |
+
* @param StreamInterface $source
|
195 |
+
* @param StreamInterface $sink
|
196 |
+
* @param string $contentLength Header specifying the amount of
|
197 |
+
* data to read.
|
198 |
+
*
|
199 |
+
* @return StreamInterface
|
200 |
+
* @throws \RuntimeException when the sink option is invalid.
|
201 |
+
*/
|
202 |
+
private function drain(
|
203 |
+
StreamInterface $source,
|
204 |
+
StreamInterface $sink,
|
205 |
+
$contentLength
|
206 |
+
) {
|
207 |
+
// If a content-length header is provided, then stop reading once
|
208 |
+
// that number of bytes has been read. This can prevent infinitely
|
209 |
+
// reading from a stream when dealing with servers that do not honor
|
210 |
+
// Connection: Close headers.
|
211 |
+
Psr7\copy_to_stream(
|
212 |
+
$source,
|
213 |
+
$sink,
|
214 |
+
(strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
|
215 |
+
);
|
216 |
+
|
217 |
+
$sink->seek(0);
|
218 |
+
$source->close();
|
219 |
+
|
220 |
+
return $sink;
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Create a resource and check to ensure it was created successfully
|
225 |
+
*
|
226 |
+
* @param callable $callback Callable that returns stream resource
|
227 |
+
*
|
228 |
+
* @return resource
|
229 |
+
* @throws \RuntimeException on error
|
230 |
+
*/
|
231 |
+
private function createResource(callable $callback)
|
232 |
+
{
|
233 |
+
$errors = null;
|
234 |
+
set_error_handler(function ($_, $msg, $file, $line) use (&$errors) {
|
235 |
+
$errors[] = [
|
236 |
+
'message' => $msg,
|
237 |
+
'file' => $file,
|
238 |
+
'line' => $line
|
239 |
+
];
|
240 |
+
return true;
|
241 |
+
});
|
242 |
+
|
243 |
+
$resource = $callback();
|
244 |
+
restore_error_handler();
|
245 |
+
|
246 |
+
if (!$resource) {
|
247 |
+
$message = 'Error creating resource: ';
|
248 |
+
foreach ($errors as $err) {
|
249 |
+
foreach ($err as $key => $value) {
|
250 |
+
$message .= "[$key] $value" . PHP_EOL;
|
251 |
+
}
|
252 |
+
}
|
253 |
+
throw new \RuntimeException(trim($message));
|
254 |
+
}
|
255 |
+
|
256 |
+
return $resource;
|
257 |
+
}
|
258 |
+
|
259 |
+
private function createStream(RequestInterface $request, array $options)
|
260 |
+
{
|
261 |
+
static $methods;
|
262 |
+
if (!$methods) {
|
263 |
+
$methods = array_flip(get_class_methods(__CLASS__));
|
264 |
+
}
|
265 |
+
|
266 |
+
// HTTP/1.1 streams using the PHP stream wrapper require a
|
267 |
+
// Connection: close header
|
268 |
+
if ($request->getProtocolVersion() == '1.1'
|
269 |
+
&& !$request->hasHeader('Connection')
|
270 |
+
) {
|
271 |
+
$request = $request->withHeader('Connection', 'close');
|
272 |
+
}
|
273 |
+
|
274 |
+
// Ensure SSL is verified by default
|
275 |
+
if (!isset($options['verify'])) {
|
276 |
+
$options['verify'] = true;
|
277 |
+
}
|
278 |
+
|
279 |
+
$params = [];
|
280 |
+
$context = $this->getDefaultContext($request);
|
281 |
+
|
282 |
+
if (isset($options['on_headers']) && !is_callable($options['on_headers'])) {
|
283 |
+
throw new \InvalidArgumentException('on_headers must be callable');
|
284 |
+
}
|
285 |
+
|
286 |
+
if (!empty($options)) {
|
287 |
+
foreach ($options as $key => $value) {
|
288 |
+
$method = "add_{$key}";
|
289 |
+
if (isset($methods[$method])) {
|
290 |
+
$this->{$method}($request, $context, $value, $params);
|
291 |
+
}
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
if (isset($options['stream_context'])) {
|
296 |
+
if (!is_array($options['stream_context'])) {
|
297 |
+
throw new \InvalidArgumentException('stream_context must be an array');
|
298 |
+
}
|
299 |
+
$context = array_replace_recursive(
|
300 |
+
$context,
|
301 |
+
$options['stream_context']
|
302 |
+
);
|
303 |
+
}
|
304 |
+
|
305 |
+
// Microsoft NTLM authentication only supported with curl handler
|
306 |
+
if (isset($options['auth'])
|
307 |
+
&& is_array($options['auth'])
|
308 |
+
&& isset($options['auth'][2])
|
309 |
+
&& 'ntlm' == $options['auth'][2]
|
310 |
+
) {
|
311 |
+
throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
|
312 |
+
}
|
313 |
+
|
314 |
+
$uri = $this->resolveHost($request, $options);
|
315 |
+
|
316 |
+
$context = $this->createResource(
|
317 |
+
function () use ($context, $params) {
|
318 |
+
return stream_context_create($context, $params);
|
319 |
+
}
|
320 |
+
);
|
321 |
+
|
322 |
+
return $this->createResource(
|
323 |
+
function () use ($uri, &$http_response_header, $context, $options) {
|
324 |
+
$resource = fopen((string) $uri, 'r', null, $context);
|
325 |
+
$this->lastHeaders = $http_response_header;
|
326 |
+
|
327 |
+
if (isset($options['read_timeout'])) {
|
328 |
+
$readTimeout = $options['read_timeout'];
|
329 |
+
$sec = (int) $readTimeout;
|
330 |
+
$usec = ($readTimeout - $sec) * 100000;
|
331 |
+
stream_set_timeout($resource, $sec, $usec);
|
332 |
+
}
|
333 |
+
|
334 |
+
return $resource;
|
335 |
+
}
|
336 |
+
);
|
337 |
+
}
|
338 |
+
|
339 |
+
private function resolveHost(RequestInterface $request, array $options)
|
340 |
+
{
|
341 |
+
$uri = $request->getUri();
|
342 |
+
|
343 |
+
if (isset($options['force_ip_resolve']) && !filter_var($uri->getHost(), FILTER_VALIDATE_IP)) {
|
344 |
+
if ('v4' === $options['force_ip_resolve']) {
|
345 |
+
$records = dns_get_record($uri->getHost(), DNS_A);
|
346 |
+
if (!isset($records[0]['ip'])) {
|
347 |
+
throw new ConnectException(
|
348 |
+
sprintf(
|
349 |
+
"Could not resolve IPv4 address for host '%s'",
|
350 |
+
$uri->getHost()
|
351 |
+
),
|
352 |
+
$request
|
353 |
+
);
|
354 |
+
}
|
355 |
+
$uri = $uri->withHost($records[0]['ip']);
|
356 |
+
} elseif ('v6' === $options['force_ip_resolve']) {
|
357 |
+
$records = dns_get_record($uri->getHost(), DNS_AAAA);
|
358 |
+
if (!isset($records[0]['ipv6'])) {
|
359 |
+
throw new ConnectException(
|
360 |
+
sprintf(
|
361 |
+
"Could not resolve IPv6 address for host '%s'",
|
362 |
+
$uri->getHost()
|
363 |
+
),
|
364 |
+
$request
|
365 |
+
);
|
366 |
+
}
|
367 |
+
$uri = $uri->withHost('[' . $records[0]['ipv6'] . ']');
|
368 |
+
}
|
369 |
+
}
|
370 |
+
|
371 |
+
return $uri;
|
372 |
+
}
|
373 |
+
|
374 |
+
private function getDefaultContext(RequestInterface $request)
|
375 |
+
{
|
376 |
+
$headers = '';
|
377 |
+
foreach ($request->getHeaders() as $name => $value) {
|
378 |
+
foreach ($value as $val) {
|
379 |
+
$headers .= "$name: $val\r\n";
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
$context = [
|
384 |
+
'http' => [
|
385 |
+
'method' => $request->getMethod(),
|
386 |
+
'header' => $headers,
|
387 |
+
'protocol_version' => $request->getProtocolVersion(),
|
388 |
+
'ignore_errors' => true,
|
389 |
+
'follow_location' => 0,
|
390 |
+
],
|
391 |
+
];
|
392 |
+
|
393 |
+
$body = (string) $request->getBody();
|
394 |
+
|
395 |
+
if (!empty($body)) {
|
396 |
+
$context['http']['content'] = $body;
|
397 |
+
// Prevent the HTTP handler from adding a Content-Type header.
|
398 |
+
if (!$request->hasHeader('Content-Type')) {
|
399 |
+
$context['http']['header'] .= "Content-Type:\r\n";
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
$context['http']['header'] = rtrim($context['http']['header']);
|
404 |
+
|
405 |
+
return $context;
|
406 |
+
}
|
407 |
+
|
408 |
+
private function add_proxy(RequestInterface $request, &$options, $value, &$params)
|
409 |
+
{
|
410 |
+
if (!is_array($value)) {
|
411 |
+
$options['http']['proxy'] = $value;
|
412 |
+
} else {
|
413 |
+
$scheme = $request->getUri()->getScheme();
|
414 |
+
if (isset($value[$scheme])) {
|
415 |
+
if (!isset($value['no'])
|
416 |
+
|| !\GuzzleHttp\is_host_in_noproxy(
|
417 |
+
$request->getUri()->getHost(),
|
418 |
+
$value['no']
|
419 |
+
)
|
420 |
+
) {
|
421 |
+
$options['http']['proxy'] = $value[$scheme];
|
422 |
+
}
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}
|
426 |
+
|
427 |
+
private function add_timeout(RequestInterface $request, &$options, $value, &$params)
|
428 |
+
{
|
429 |
+
if ($value > 0) {
|
430 |
+
$options['http']['timeout'] = $value;
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
private function add_verify(RequestInterface $request, &$options, $value, &$params)
|
435 |
+
{
|
436 |
+
if ($value === true) {
|
437 |
+
// PHP 5.6 or greater will find the system cert by default. When
|
438 |
+
// < 5.6, use the Guzzle bundled cacert.
|
439 |
+
if (PHP_VERSION_ID < 50600) {
|
440 |
+
$options['ssl']['cafile'] = \GuzzleHttp\default_ca_bundle();
|
441 |
+
}
|
442 |
+
} elseif (is_string($value)) {
|
443 |
+
$options['ssl']['cafile'] = $value;
|
444 |
+
if (!file_exists($value)) {
|
445 |
+
throw new \RuntimeException("SSL CA bundle not found: $value");
|
446 |
+
}
|
447 |
+
} elseif ($value === false) {
|
448 |
+
$options['ssl']['verify_peer'] = false;
|
449 |
+
$options['ssl']['verify_peer_name'] = false;
|
450 |
+
return;
|
451 |
+
} else {
|
452 |
+
throw new \InvalidArgumentException('Invalid verify request option');
|
453 |
+
}
|
454 |
+
|
455 |
+
$options['ssl']['verify_peer'] = true;
|
456 |
+
$options['ssl']['verify_peer_name'] = true;
|
457 |
+
$options['ssl']['allow_self_signed'] = false;
|
458 |
+
}
|
459 |
+
|
460 |
+
private function add_cert(RequestInterface $request, &$options, $value, &$params)
|
461 |
+
{
|
462 |
+
if (is_array($value)) {
|
463 |
+
$options['ssl']['passphrase'] = $value[1];
|
464 |
+
$value = $value[0];
|
465 |
+
}
|
466 |
+
|
467 |
+
if (!file_exists($value)) {
|
468 |
+
throw new \RuntimeException("SSL certificate not found: {$value}");
|
469 |
+
}
|
470 |
+
|
471 |
+
$options['ssl']['local_cert'] = $value;
|
472 |
+
}
|
473 |
+
|
474 |
+
private function add_progress(RequestInterface $request, &$options, $value, &$params)
|
475 |
+
{
|
476 |
+
$this->addNotification(
|
477 |
+
$params,
|
478 |
+
function ($code, $a, $b, $c, $transferred, $total) use ($value) {
|
479 |
+
if ($code == STREAM_NOTIFY_PROGRESS) {
|
480 |
+
$value($total, $transferred, null, null);
|
481 |
+
}
|
482 |
+
}
|
483 |
+
);
|
484 |
+
}
|
485 |
+
|
486 |
+
private function add_debug(RequestInterface $request, &$options, $value, &$params)
|
487 |
+
{
|
488 |
+
if ($value === false) {
|
489 |
+
return;
|
490 |
+
}
|
491 |
+
|
492 |
+
static $map = [
|
493 |
+
STREAM_NOTIFY_CONNECT => 'CONNECT',
|
494 |
+
STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
|
495 |
+
STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
|
496 |
+
STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
|
497 |
+
STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
|
498 |
+
STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
|
499 |
+
STREAM_NOTIFY_PROGRESS => 'PROGRESS',
|
500 |
+
STREAM_NOTIFY_FAILURE => 'FAILURE',
|
501 |
+
STREAM_NOTIFY_COMPLETED => 'COMPLETED',
|
502 |
+
STREAM_NOTIFY_RESOLVE => 'RESOLVE',
|
503 |
+
];
|
504 |
+
static $args = ['severity', 'message', 'message_code',
|
505 |
+
'bytes_transferred', 'bytes_max'];
|
506 |
+
|
507 |
+
$value = \GuzzleHttp\debug_resource($value);
|
508 |
+
$ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
|
509 |
+
$this->addNotification(
|
510 |
+
$params,
|
511 |
+
function () use ($ident, $value, $map, $args) {
|
512 |
+
$passed = func_get_args();
|
513 |
+
$code = array_shift($passed);
|
514 |
+
fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
|
515 |
+
foreach (array_filter($passed) as $i => $v) {
|
516 |
+
fwrite($value, $args[$i] . ': "' . $v . '" ');
|
517 |
+
}
|
518 |
+
fwrite($value, "\n");
|
519 |
+
}
|
520 |
+
);
|
521 |
+
}
|
522 |
+
|
523 |
+
private function addNotification(array &$params, callable $notify)
|
524 |
+
{
|
525 |
+
// Wrap the existing function if needed.
|
526 |
+
if (!isset($params['notification'])) {
|
527 |
+
$params['notification'] = $notify;
|
528 |
+
} else {
|
529 |
+
$params['notification'] = $this->callArray([
|
530 |
+
$params['notification'],
|
531 |
+
$notify
|
532 |
+
]);
|
533 |
+
}
|
534 |
+
}
|
535 |
+
|
536 |
+
private function callArray(array $functions)
|
537 |
+
{
|
538 |
+
return function () use ($functions) {
|
539 |
+
$args = func_get_args();
|
540 |
+
foreach ($functions as $fn) {
|
541 |
+
call_user_func_array($fn, $args);
|
542 |
+
}
|
543 |
+
};
|
544 |
+
}
|
545 |
+
}
|
vendor/guzzlehttp/guzzle/src/HandlerStack.php
ADDED
@@ -0,0 +1,277 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
5 |
+
use Psr\Http\Message\RequestInterface;
|
6 |
+
use Psr\Http\Message\ResponseInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Creates a composed Guzzle handler function by stacking middlewares on top of
|
10 |
+
* an HTTP handler function.
|
11 |
+
*/
|
12 |
+
class HandlerStack
|
13 |
+
{
|
14 |
+
/** @var callable|null */
|
15 |
+
private $handler;
|
16 |
+
|
17 |
+
/** @var array */
|
18 |
+
private $stack = [];
|
19 |
+
|
20 |
+
/** @var callable|null */
|
21 |
+
private $cached;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Creates a default handler stack that can be used by clients.
|
25 |
+
*
|
26 |
+
* The returned handler will wrap the provided handler or use the most
|
27 |
+
* appropriate default handler for your system. The returned HandlerStack has
|
28 |
+
* support for cookies, redirects, HTTP error exceptions, and preparing a body
|
29 |
+
* before sending.
|
30 |
+
*
|
31 |
+
* The returned handler stack can be passed to a client in the "handler"
|
32 |
+
* option.
|
33 |
+
*
|
34 |
+
* @param callable $handler HTTP handler function to use with the stack. If no
|
35 |
+
* handler is provided, the best handler for your
|
36 |
+
* system will be utilized.
|
37 |
+
*
|
38 |
+
* @return HandlerStack
|
39 |
+
*/
|
40 |
+
public static function create(callable $handler = null)
|
41 |
+
{
|
42 |
+
$stack = new self($handler ?: choose_handler());
|
43 |
+
$stack->push(Middleware::httpErrors(), 'http_errors');
|
44 |
+
$stack->push(Middleware::redirect(), 'allow_redirects');
|
45 |
+
$stack->push(Middleware::cookies(), 'cookies');
|
46 |
+
$stack->push(Middleware::prepareBody(), 'prepare_body');
|
47 |
+
|
48 |
+
return $stack;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* @param callable $handler Underlying HTTP handler.
|
53 |
+
*/
|
54 |
+
public function __construct(callable $handler = null)
|
55 |
+
{
|
56 |
+
$this->handler = $handler;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Invokes the handler stack as a composed handler
|
61 |
+
*
|
62 |
+
* @param RequestInterface $request
|
63 |
+
* @param array $options
|
64 |
+
*
|
65 |
+
* @return ResponseInterface|PromiseInterface
|
66 |
+
*/
|
67 |
+
public function __invoke(RequestInterface $request, array $options)
|
68 |
+
{
|
69 |
+
$handler = $this->resolve();
|
70 |
+
|
71 |
+
return $handler($request, $options);
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Dumps a string representation of the stack.
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function __toString()
|
80 |
+
{
|
81 |
+
$depth = 0;
|
82 |
+
$stack = [];
|
83 |
+
if ($this->handler) {
|
84 |
+
$stack[] = "0) Handler: " . $this->debugCallable($this->handler);
|
85 |
+
}
|
86 |
+
|
87 |
+
$result = '';
|
88 |
+
foreach (array_reverse($this->stack) as $tuple) {
|
89 |
+
$depth++;
|
90 |
+
$str = "{$depth}) Name: '{$tuple[1]}', ";
|
91 |
+
$str .= "Function: " . $this->debugCallable($tuple[0]);
|
92 |
+
$result = "> {$str}\n{$result}";
|
93 |
+
$stack[] = $str;
|
94 |
+
}
|
95 |
+
|
96 |
+
foreach (array_keys($stack) as $k) {
|
97 |
+
$result .= "< {$stack[$k]}\n";
|
98 |
+
}
|
99 |
+
|
100 |
+
return $result;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Set the HTTP handler that actually returns a promise.
|
105 |
+
*
|
106 |
+
* @param callable $handler Accepts a request and array of options and
|
107 |
+
* returns a Promise.
|
108 |
+
*/
|
109 |
+
public function setHandler(callable $handler)
|
110 |
+
{
|
111 |
+
$this->handler = $handler;
|
112 |
+
$this->cached = null;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Returns true if the builder has a handler.
|
117 |
+
*
|
118 |
+
* @return bool
|
119 |
+
*/
|
120 |
+
public function hasHandler()
|
121 |
+
{
|
122 |
+
return (bool) $this->handler;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Unshift a middleware to the bottom of the stack.
|
127 |
+
*
|
128 |
+
* @param callable $middleware Middleware function
|
129 |
+
* @param string $name Name to register for this middleware.
|
130 |
+
*/
|
131 |
+
public function unshift(callable $middleware, $name = null)
|
132 |
+
{
|
133 |
+
array_unshift($this->stack, [$middleware, $name]);
|
134 |
+
$this->cached = null;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Push a middleware to the top of the stack.
|
139 |
+
*
|
140 |
+
* @param callable $middleware Middleware function
|
141 |
+
* @param string $name Name to register for this middleware.
|
142 |
+
*/
|
143 |
+
public function push(callable $middleware, $name = '')
|
144 |
+
{
|
145 |
+
$this->stack[] = [$middleware, $name];
|
146 |
+
$this->cached = null;
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Add a middleware before another middleware by name.
|
151 |
+
*
|
152 |
+
* @param string $findName Middleware to find
|
153 |
+
* @param callable $middleware Middleware function
|
154 |
+
* @param string $withName Name to register for this middleware.
|
155 |
+
*/
|
156 |
+
public function before($findName, callable $middleware, $withName = '')
|
157 |
+
{
|
158 |
+
$this->splice($findName, $withName, $middleware, true);
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* Add a middleware after another middleware by name.
|
163 |
+
*
|
164 |
+
* @param string $findName Middleware to find
|
165 |
+
* @param callable $middleware Middleware function
|
166 |
+
* @param string $withName Name to register for this middleware.
|
167 |
+
*/
|
168 |
+
public function after($findName, callable $middleware, $withName = '')
|
169 |
+
{
|
170 |
+
$this->splice($findName, $withName, $middleware, false);
|
171 |
+
}
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Remove a middleware by instance or name from the stack.
|
175 |
+
*
|
176 |
+
* @param callable|string $remove Middleware to remove by instance or name.
|
177 |
+
*/
|
178 |
+
public function remove($remove)
|
179 |
+
{
|
180 |
+
$this->cached = null;
|
181 |
+
$idx = is_callable($remove) ? 0 : 1;
|
182 |
+
$this->stack = array_values(array_filter(
|
183 |
+
$this->stack,
|
184 |
+
function ($tuple) use ($idx, $remove) {
|
185 |
+
return $tuple[$idx] !== $remove;
|
186 |
+
}
|
187 |
+
));
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Compose the middleware and handler into a single callable function.
|
192 |
+
*
|
193 |
+
* @return callable
|
194 |
+
*/
|
195 |
+
public function resolve()
|
196 |
+
{
|
197 |
+
if (!$this->cached) {
|
198 |
+
if (!($prev = $this->handler)) {
|
199 |
+
throw new \LogicException('No handler has been specified');
|
200 |
+
}
|
201 |
+
|
202 |
+
foreach (array_reverse($this->stack) as $fn) {
|
203 |
+
$prev = $fn[0]($prev);
|
204 |
+
}
|
205 |
+
|
206 |
+
$this->cached = $prev;
|
207 |
+
}
|
208 |
+
|
209 |
+
return $this->cached;
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* @param string $name
|
214 |
+
* @return int
|
215 |
+
*/
|
216 |
+
private function findByName($name)
|
217 |
+
{
|
218 |
+
foreach ($this->stack as $k => $v) {
|
219 |
+
if ($v[1] === $name) {
|
220 |
+
return $k;
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
throw new \InvalidArgumentException("Middleware not found: $name");
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Splices a function into the middleware list at a specific position.
|
229 |
+
*
|
230 |
+
* @param string $findName
|
231 |
+
* @param string $withName
|
232 |
+
* @param callable $middleware
|
233 |
+
* @param bool $before
|
234 |
+
*/
|
235 |
+
private function splice($findName, $withName, callable $middleware, $before)
|
236 |
+
{
|
237 |
+
$this->cached = null;
|
238 |
+
$idx = $this->findByName($findName);
|
239 |
+
$tuple = [$middleware, $withName];
|
240 |
+
|
241 |
+
if ($before) {
|
242 |
+
if ($idx === 0) {
|
243 |
+
array_unshift($this->stack, $tuple);
|
244 |
+
} else {
|
245 |
+
$replacement = [$tuple, $this->stack[$idx]];
|
246 |
+
array_splice($this->stack, $idx, 1, $replacement);
|
247 |
+
}
|
248 |
+
} elseif ($idx === count($this->stack) - 1) {
|
249 |
+
$this->stack[] = $tuple;
|
250 |
+
} else {
|
251 |
+
$replacement = [$this->stack[$idx], $tuple];
|
252 |
+
array_splice($this->stack, $idx, 1, $replacement);
|
253 |
+
}
|
254 |
+
}
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Provides a debug string for a given callable.
|
258 |
+
*
|
259 |
+
* @param array|callable $fn Function to write as a string.
|
260 |
+
*
|
261 |
+
* @return string
|
262 |
+
*/
|
263 |
+
private function debugCallable($fn)
|
264 |
+
{
|
265 |
+
if (is_string($fn)) {
|
266 |
+
return "callable({$fn})";
|
267 |
+
}
|
268 |
+
|
269 |
+
if (is_array($fn)) {
|
270 |
+
return is_string($fn[0])
|
271 |
+
? "callable({$fn[0]}::{$fn[1]})"
|
272 |
+
: "callable(['" . get_class($fn[0]) . "', '{$fn[1]}'])";
|
273 |
+
}
|
274 |
+
|
275 |
+
return 'callable(' . spl_object_hash($fn) . ')';
|
276 |
+
}
|
277 |
+
}
|
vendor/guzzlehttp/guzzle/src/MessageFormatter.php
ADDED
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use Psr\Http\Message\MessageInterface;
|
5 |
+
use Psr\Http\Message\RequestInterface;
|
6 |
+
use Psr\Http\Message\ResponseInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Formats log messages using variable substitutions for requests, responses,
|
10 |
+
* and other transactional data.
|
11 |
+
*
|
12 |
+
* The following variable substitutions are supported:
|
13 |
+
*
|
14 |
+
* - {request}: Full HTTP request message
|
15 |
+
* - {response}: Full HTTP response message
|
16 |
+
* - {ts}: ISO 8601 date in GMT
|
17 |
+
* - {date_iso_8601} ISO 8601 date in GMT
|
18 |
+
* - {date_common_log} Apache common log date using the configured timezone.
|
19 |
+
* - {host}: Host of the request
|
20 |
+
* - {method}: Method of the request
|
21 |
+
* - {uri}: URI of the request
|
22 |
+
* - {version}: Protocol version
|
23 |
+
* - {target}: Request target of the request (path + query + fragment)
|
24 |
+
* - {hostname}: Hostname of the machine that sent the request
|
25 |
+
* - {code}: Status code of the response (if available)
|
26 |
+
* - {phrase}: Reason phrase of the response (if available)
|
27 |
+
* - {error}: Any error messages (if available)
|
28 |
+
* - {req_header_*}: Replace `*` with the lowercased name of a request header to add to the message
|
29 |
+
* - {res_header_*}: Replace `*` with the lowercased name of a response header to add to the message
|
30 |
+
* - {req_headers}: Request headers
|
31 |
+
* - {res_headers}: Response headers
|
32 |
+
* - {req_body}: Request body
|
33 |
+
* - {res_body}: Response body
|
34 |
+
*/
|
35 |
+
class MessageFormatter
|
36 |
+
{
|
37 |
+
/**
|
38 |
+
* Apache Common Log Format.
|
39 |
+
* @link http://httpd.apache.org/docs/2.4/logs.html#common
|
40 |
+
* @var string
|
41 |
+
*/
|
42 |
+
const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
|
43 |
+
const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
|
44 |
+
const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
|
45 |
+
|
46 |
+
/** @var string Template used to format log messages */
|
47 |
+
private $template;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @param string $template Log message template
|
51 |
+
*/
|
52 |
+
public function __construct($template = self::CLF)
|
53 |
+
{
|
54 |
+
$this->template = $template ?: self::CLF;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Returns a formatted message string.
|
59 |
+
*
|
60 |
+
* @param RequestInterface $request Request that was sent
|
61 |
+
* @param ResponseInterface $response Response that was received
|
62 |
+
* @param \Exception $error Exception that was received
|
63 |
+
*
|
64 |
+
* @return string
|
65 |
+
*/
|
66 |
+
public function format(
|
67 |
+
RequestInterface $request,
|
68 |
+
ResponseInterface $response = null,
|
69 |
+
\Exception $error = null
|
70 |
+
) {
|
71 |
+
$cache = [];
|
72 |
+
|
73 |
+
return preg_replace_callback(
|
74 |
+
'/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
|
75 |
+
function (array $matches) use ($request, $response, $error, &$cache) {
|
76 |
+
if (isset($cache[$matches[1]])) {
|
77 |
+
return $cache[$matches[1]];
|
78 |
+
}
|
79 |
+
|
80 |
+
$result = '';
|
81 |
+
switch ($matches[1]) {
|
82 |
+
case 'request':
|
83 |
+
$result = Psr7\str($request);
|
84 |
+
break;
|
85 |
+
case 'response':
|
86 |
+
$result = $response ? Psr7\str($response) : '';
|
87 |
+
break;
|
88 |
+
case 'req_headers':
|
89 |
+
$result = trim($request->getMethod()
|
90 |
+
. ' ' . $request->getRequestTarget())
|
91 |
+
. ' HTTP/' . $request->getProtocolVersion() . "\r\n"
|
92 |
+
. $this->headers($request);
|
93 |
+
break;
|
94 |
+
case 'res_headers':
|
95 |
+
$result = $response ?
|
96 |
+
sprintf(
|
97 |
+
'HTTP/%s %d %s',
|
98 |
+
$response->getProtocolVersion(),
|
99 |
+
$response->getStatusCode(),
|
100 |
+
$response->getReasonPhrase()
|
101 |
+
) . "\r\n" . $this->headers($response)
|
102 |
+
: 'NULL';
|
103 |
+
break;
|
104 |
+
case 'req_body':
|
105 |
+
$result = $request->getBody();
|
106 |
+
break;
|
107 |
+
case 'res_body':
|
108 |
+
$result = $response ? $response->getBody() : 'NULL';
|
109 |
+
break;
|
110 |
+
case 'ts':
|
111 |
+
case 'date_iso_8601':
|
112 |
+
$result = gmdate('c');
|
113 |
+
break;
|
114 |
+
case 'date_common_log':
|
115 |
+
$result = date('d/M/Y:H:i:s O');
|
116 |
+
break;
|
117 |
+
case 'method':
|
118 |
+
$result = $request->getMethod();
|
119 |
+
break;
|
120 |
+
case 'version':
|
121 |
+
$result = $request->getProtocolVersion();
|
122 |
+
break;
|
123 |
+
case 'uri':
|
124 |
+
case 'url':
|
125 |
+
$result = $request->getUri();
|
126 |
+
break;
|
127 |
+
case 'target':
|
128 |
+
$result = $request->getRequestTarget();
|
129 |
+
break;
|
130 |
+
case 'req_version':
|
131 |
+
$result = $request->getProtocolVersion();
|
132 |
+
break;
|
133 |
+
case 'res_version':
|
134 |
+
$result = $response
|
135 |
+
? $response->getProtocolVersion()
|
136 |
+
: 'NULL';
|
137 |
+
break;
|
138 |
+
case 'host':
|
139 |
+
$result = $request->getHeaderLine('Host');
|
140 |
+
break;
|
141 |
+
case 'hostname':
|
142 |
+
$result = gethostname();
|
143 |
+
break;
|
144 |
+
case 'code':
|
145 |
+
$result = $response ? $response->getStatusCode() : 'NULL';
|
146 |
+
break;
|
147 |
+
case 'phrase':
|
148 |
+
$result = $response ? $response->getReasonPhrase() : 'NULL';
|
149 |
+
break;
|
150 |
+
case 'error':
|
151 |
+
$result = $error ? $error->getMessage() : 'NULL';
|
152 |
+
break;
|
153 |
+
default:
|
154 |
+
// handle prefixed dynamic headers
|
155 |
+
if (strpos($matches[1], 'req_header_') === 0) {
|
156 |
+
$result = $request->getHeaderLine(substr($matches[1], 11));
|
157 |
+
} elseif (strpos($matches[1], 'res_header_') === 0) {
|
158 |
+
$result = $response
|
159 |
+
? $response->getHeaderLine(substr($matches[1], 11))
|
160 |
+
: 'NULL';
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
$cache[$matches[1]] = $result;
|
165 |
+
return $result;
|
166 |
+
},
|
167 |
+
$this->template
|
168 |
+
);
|
169 |
+
}
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Get headers from message as string
|
173 |
+
*
|
174 |
+
* @return string
|
175 |
+
*/
|
176 |
+
private function headers(MessageInterface $message)
|
177 |
+
{
|
178 |
+
$result = '';
|
179 |
+
foreach ($message->getHeaders() as $name => $values) {
|
180 |
+
$result .= $name . ': ' . implode(', ', $values) . "\r\n";
|
181 |
+
}
|
182 |
+
|
183 |
+
return trim($result);
|
184 |
+
}
|
185 |
+
}
|
vendor/guzzlehttp/guzzle/src/Middleware.php
ADDED
@@ -0,0 +1,254 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Cookie\CookieJarInterface;
|
5 |
+
use GuzzleHttp\Exception\RequestException;
|
6 |
+
use GuzzleHttp\Promise\RejectedPromise;
|
7 |
+
use GuzzleHttp\Psr7;
|
8 |
+
use Psr\Http\Message\ResponseInterface;
|
9 |
+
use Psr\Log\LoggerInterface;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Functions used to create and wrap handlers with handler middleware.
|
13 |
+
*/
|
14 |
+
final class Middleware
|
15 |
+
{
|
16 |
+
/**
|
17 |
+
* Middleware that adds cookies to requests.
|
18 |
+
*
|
19 |
+
* The options array must be set to a CookieJarInterface in order to use
|
20 |
+
* cookies. This is typically handled for you by a client.
|
21 |
+
*
|
22 |
+
* @return callable Returns a function that accepts the next handler.
|
23 |
+
*/
|
24 |
+
public static function cookies()
|
25 |
+
{
|
26 |
+
return function (callable $handler) {
|
27 |
+
return function ($request, array $options) use ($handler) {
|
28 |
+
if (empty($options['cookies'])) {
|
29 |
+
return $handler($request, $options);
|
30 |
+
} elseif (!($options['cookies'] instanceof CookieJarInterface)) {
|
31 |
+
throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
|
32 |
+
}
|
33 |
+
$cookieJar = $options['cookies'];
|
34 |
+
$request = $cookieJar->withCookieHeader($request);
|
35 |
+
return $handler($request, $options)
|
36 |
+
->then(
|
37 |
+
function ($response) use ($cookieJar, $request) {
|
38 |
+
$cookieJar->extractCookies($request, $response);
|
39 |
+
return $response;
|
40 |
+
}
|
41 |
+
);
|
42 |
+
};
|
43 |
+
};
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Middleware that throws exceptions for 4xx or 5xx responses when the
|
48 |
+
* "http_error" request option is set to true.
|
49 |
+
*
|
50 |
+
* @return callable Returns a function that accepts the next handler.
|
51 |
+
*/
|
52 |
+
public static function httpErrors()
|
53 |
+
{
|
54 |
+
return function (callable $handler) {
|
55 |
+
return function ($request, array $options) use ($handler) {
|
56 |
+
if (empty($options['http_errors'])) {
|
57 |
+
return $handler($request, $options);
|
58 |
+
}
|
59 |
+
return $handler($request, $options)->then(
|
60 |
+
function (ResponseInterface $response) use ($request) {
|
61 |
+
$code = $response->getStatusCode();
|
62 |
+
if ($code < 400) {
|
63 |
+
return $response;
|
64 |
+
}
|
65 |
+
throw RequestException::create($request, $response);
|
66 |
+
}
|
67 |
+
);
|
68 |
+
};
|
69 |
+
};
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Middleware that pushes history data to an ArrayAccess container.
|
74 |
+
*
|
75 |
+
* @param array|\ArrayAccess $container Container to hold the history (by reference).
|
76 |
+
*
|
77 |
+
* @return callable Returns a function that accepts the next handler.
|
78 |
+
* @throws \InvalidArgumentException if container is not an array or ArrayAccess.
|
79 |
+
*/
|
80 |
+
public static function history(&$container)
|
81 |
+
{
|
82 |
+
if (!is_array($container) && !$container instanceof \ArrayAccess) {
|
83 |
+
throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
|
84 |
+
}
|
85 |
+
|
86 |
+
return function (callable $handler) use (&$container) {
|
87 |
+
return function ($request, array $options) use ($handler, &$container) {
|
88 |
+
return $handler($request, $options)->then(
|
89 |
+
function ($value) use ($request, &$container, $options) {
|
90 |
+
$container[] = [
|
91 |
+
'request' => $request,
|
92 |
+
'response' => $value,
|
93 |
+
'error' => null,
|
94 |
+
'options' => $options
|
95 |
+
];
|
96 |
+
return $value;
|
97 |
+
},
|
98 |
+
function ($reason) use ($request, &$container, $options) {
|
99 |
+
$container[] = [
|
100 |
+
'request' => $request,
|
101 |
+
'response' => null,
|
102 |
+
'error' => $reason,
|
103 |
+
'options' => $options
|
104 |
+
];
|
105 |
+
return \GuzzleHttp\Promise\rejection_for($reason);
|
106 |
+
}
|
107 |
+
);
|
108 |
+
};
|
109 |
+
};
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Middleware that invokes a callback before and after sending a request.
|
114 |
+
*
|
115 |
+
* The provided listener cannot modify or alter the response. It simply
|
116 |
+
* "taps" into the chain to be notified before returning the promise. The
|
117 |
+
* before listener accepts a request and options array, and the after
|
118 |
+
* listener accepts a request, options array, and response promise.
|
119 |
+
*
|
120 |
+
* @param callable $before Function to invoke before forwarding the request.
|
121 |
+
* @param callable $after Function invoked after forwarding.
|
122 |
+
*
|
123 |
+
* @return callable Returns a function that accepts the next handler.
|
124 |
+
*/
|
125 |
+
public static function tap(callable $before = null, callable $after = null)
|
126 |
+
{
|
127 |
+
return function (callable $handler) use ($before, $after) {
|
128 |
+
return function ($request, array $options) use ($handler, $before, $after) {
|
129 |
+
if ($before) {
|
130 |
+
$before($request, $options);
|
131 |
+
}
|
132 |
+
$response = $handler($request, $options);
|
133 |
+
if ($after) {
|
134 |
+
$after($request, $options, $response);
|
135 |
+
}
|
136 |
+
return $response;
|
137 |
+
};
|
138 |
+
};
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Middleware that handles request redirects.
|
143 |
+
*
|
144 |
+
* @return callable Returns a function that accepts the next handler.
|
145 |
+
*/
|
146 |
+
public static function redirect()
|
147 |
+
{
|
148 |
+
return function (callable $handler) {
|
149 |
+
return new RedirectMiddleware($handler);
|
150 |
+
};
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Middleware that retries requests based on the boolean result of
|
155 |
+
* invoking the provided "decider" function.
|
156 |
+
*
|
157 |
+
* If no delay function is provided, a simple implementation of exponential
|
158 |
+
* backoff will be utilized.
|
159 |
+
*
|
160 |
+
* @param callable $decider Function that accepts the number of retries,
|
161 |
+
* a request, [response], and [exception] and
|
162 |
+
* returns true if the request is to be retried.
|
163 |
+
* @param callable $delay Function that accepts the number of retries and
|
164 |
+
* returns the number of milliseconds to delay.
|
165 |
+
*
|
166 |
+
* @return callable Returns a function that accepts the next handler.
|
167 |
+
*/
|
168 |
+
public static function retry(callable $decider, callable $delay = null)
|
169 |
+
{
|
170 |
+
return function (callable $handler) use ($decider, $delay) {
|
171 |
+
return new RetryMiddleware($decider, $handler, $delay);
|
172 |
+
};
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Middleware that logs requests, responses, and errors using a message
|
177 |
+
* formatter.
|
178 |
+
*
|
179 |
+
* @param LoggerInterface $logger Logs messages.
|
180 |
+
* @param MessageFormatter $formatter Formatter used to create message strings.
|
181 |
+
* @param string $logLevel Level at which to log requests.
|
182 |
+
*
|
183 |
+
* @return callable Returns a function that accepts the next handler.
|
184 |
+
*/
|
185 |
+
public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */)
|
186 |
+
{
|
187 |
+
return function (callable $handler) use ($logger, $formatter, $logLevel) {
|
188 |
+
return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
|
189 |
+
return $handler($request, $options)->then(
|
190 |
+
function ($response) use ($logger, $request, $formatter, $logLevel) {
|
191 |
+
$message = $formatter->format($request, $response);
|
192 |
+
$logger->log($logLevel, $message);
|
193 |
+
return $response;
|
194 |
+
},
|
195 |
+
function ($reason) use ($logger, $request, $formatter) {
|
196 |
+
$response = $reason instanceof RequestException
|
197 |
+
? $reason->getResponse()
|
198 |
+
: null;
|
199 |
+
$message = $formatter->format($request, $response, $reason);
|
200 |
+
$logger->notice($message);
|
201 |
+
return \GuzzleHttp\Promise\rejection_for($reason);
|
202 |
+
}
|
203 |
+
);
|
204 |
+
};
|
205 |
+
};
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* This middleware adds a default content-type if possible, a default
|
210 |
+
* content-length or transfer-encoding header, and the expect header.
|
211 |
+
*
|
212 |
+
* @return callable
|
213 |
+
*/
|
214 |
+
public static function prepareBody()
|
215 |
+
{
|
216 |
+
return function (callable $handler) {
|
217 |
+
return new PrepareBodyMiddleware($handler);
|
218 |
+
};
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Middleware that applies a map function to the request before passing to
|
223 |
+
* the next handler.
|
224 |
+
*
|
225 |
+
* @param callable $fn Function that accepts a RequestInterface and returns
|
226 |
+
* a RequestInterface.
|
227 |
+
* @return callable
|
228 |
+
*/
|
229 |
+
public static function mapRequest(callable $fn)
|
230 |
+
{
|
231 |
+
return function (callable $handler) use ($fn) {
|
232 |
+
return function ($request, array $options) use ($handler, $fn) {
|
233 |
+
return $handler($fn($request), $options);
|
234 |
+
};
|
235 |
+
};
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Middleware that applies a map function to the resolved promise's
|
240 |
+
* response.
|
241 |
+
*
|
242 |
+
* @param callable $fn Function that accepts a ResponseInterface and
|
243 |
+
* returns a ResponseInterface.
|
244 |
+
* @return callable
|
245 |
+
*/
|
246 |
+
public static function mapResponse(callable $fn)
|
247 |
+
{
|
248 |
+
return function (callable $handler) use ($fn) {
|
249 |
+
return function ($request, array $options) use ($handler, $fn) {
|
250 |
+
return $handler($request, $options)->then($fn);
|
251 |
+
};
|
252 |
+
};
|
253 |
+
}
|
254 |
+
}
|
vendor/guzzlehttp/guzzle/src/Pool.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Promise\EachPromise;
|
5 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
6 |
+
use GuzzleHttp\Promise\PromisorInterface;
|
7 |
+
use Psr\Http\Message\RequestInterface;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Sends an iterator of requests concurrently using a capped pool size.
|
11 |
+
*
|
12 |
+
* The pool will read from an iterator until it is cancelled or until the
|
13 |
+
* iterator is consumed. When a request is yielded, the request is sent after
|
14 |
+
* applying the "request_options" request options (if provided in the ctor).
|
15 |
+
*
|
16 |
+
* When a function is yielded by the iterator, the function is provided the
|
17 |
+
* "request_options" array that should be merged on top of any existing
|
18 |
+
* options, and the function MUST then return a wait-able promise.
|
19 |
+
*/
|
20 |
+
class Pool implements PromisorInterface
|
21 |
+
{
|
22 |
+
/** @var EachPromise */
|
23 |
+
private $each;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @param ClientInterface $client Client used to send the requests.
|
27 |
+
* @param array|\Iterator $requests Requests or functions that return
|
28 |
+
* requests to send concurrently.
|
29 |
+
* @param array $config Associative array of options
|
30 |
+
* - concurrency: (int) Maximum number of requests to send concurrently
|
31 |
+
* - options: Array of request options to apply to each request.
|
32 |
+
* - fulfilled: (callable) Function to invoke when a request completes.
|
33 |
+
* - rejected: (callable) Function to invoke when a request is rejected.
|
34 |
+
*/
|
35 |
+
public function __construct(
|
36 |
+
ClientInterface $client,
|
37 |
+
$requests,
|
38 |
+
array $config = []
|
39 |
+
) {
|
40 |
+
// Backwards compatibility.
|
41 |
+
if (isset($config['pool_size'])) {
|
42 |
+
$config['concurrency'] = $config['pool_size'];
|
43 |
+
} elseif (!isset($config['concurrency'])) {
|
44 |
+
$config['concurrency'] = 25;
|
45 |
+
}
|
46 |
+
|
47 |
+
if (isset($config['options'])) {
|
48 |
+
$opts = $config['options'];
|
49 |
+
unset($config['options']);
|
50 |
+
} else {
|
51 |
+
$opts = [];
|
52 |
+
}
|
53 |
+
|
54 |
+
$iterable = \GuzzleHttp\Promise\iter_for($requests);
|
55 |
+
$requests = function () use ($iterable, $client, $opts) {
|
56 |
+
foreach ($iterable as $key => $rfn) {
|
57 |
+
if ($rfn instanceof RequestInterface) {
|
58 |
+
yield $key => $client->sendAsync($rfn, $opts);
|
59 |
+
} elseif (is_callable($rfn)) {
|
60 |
+
yield $key => $rfn($opts);
|
61 |
+
} else {
|
62 |
+
throw new \InvalidArgumentException('Each value yielded by '
|
63 |
+
. 'the iterator must be a Psr7\Http\Message\RequestInterface '
|
64 |
+
. 'or a callable that returns a promise that fulfills '
|
65 |
+
. 'with a Psr7\Message\Http\ResponseInterface object.');
|
66 |
+
}
|
67 |
+
}
|
68 |
+
};
|
69 |
+
|
70 |
+
$this->each = new EachPromise($requests(), $config);
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Get promise
|
75 |
+
*
|
76 |
+
* @return PromiseInterface
|
77 |
+
*/
|
78 |
+
public function promise()
|
79 |
+
{
|
80 |
+
return $this->each->promise();
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Sends multiple requests concurrently and returns an array of responses
|
85 |
+
* and exceptions that uses the same ordering as the provided requests.
|
86 |
+
*
|
87 |
+
* IMPORTANT: This method keeps every request and response in memory, and
|
88 |
+
* as such, is NOT recommended when sending a large number or an
|
89 |
+
* indeterminate number of requests concurrently.
|
90 |
+
*
|
91 |
+
* @param ClientInterface $client Client used to send the requests
|
92 |
+
* @param array|\Iterator $requests Requests to send concurrently.
|
93 |
+
* @param array $options Passes through the options available in
|
94 |
+
* {@see GuzzleHttp\Pool::__construct}
|
95 |
+
*
|
96 |
+
* @return array Returns an array containing the response or an exception
|
97 |
+
* in the same order that the requests were sent.
|
98 |
+
* @throws \InvalidArgumentException if the event format is incorrect.
|
99 |
+
*/
|
100 |
+
public static function batch(
|
101 |
+
ClientInterface $client,
|
102 |
+
$requests,
|
103 |
+
array $options = []
|
104 |
+
) {
|
105 |
+
$res = [];
|
106 |
+
self::cmpCallback($options, 'fulfilled', $res);
|
107 |
+
self::cmpCallback($options, 'rejected', $res);
|
108 |
+
$pool = new static($client, $requests, $options);
|
109 |
+
$pool->promise()->wait();
|
110 |
+
ksort($res);
|
111 |
+
|
112 |
+
return $res;
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Execute callback(s)
|
117 |
+
*
|
118 |
+
* @return void
|
119 |
+
*/
|
120 |
+
private static function cmpCallback(array &$options, $name, array &$results)
|
121 |
+
{
|
122 |
+
if (!isset($options[$name])) {
|
123 |
+
$options[$name] = function ($v, $k) use (&$results) {
|
124 |
+
$results[$k] = $v;
|
125 |
+
};
|
126 |
+
} else {
|
127 |
+
$currentFn = $options[$name];
|
128 |
+
$options[$name] = function ($v, $k) use (&$results, $currentFn) {
|
129 |
+
$currentFn($v, $k);
|
130 |
+
$results[$k] = $v;
|
131 |
+
};
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
ADDED
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
5 |
+
use GuzzleHttp\Psr7;
|
6 |
+
use Psr\Http\Message\RequestInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Prepares requests that contain a body, adding the Content-Length,
|
10 |
+
* Content-Type, and Expect headers.
|
11 |
+
*/
|
12 |
+
class PrepareBodyMiddleware
|
13 |
+
{
|
14 |
+
/** @var callable */
|
15 |
+
private $nextHandler;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param callable $nextHandler Next handler to invoke.
|
19 |
+
*/
|
20 |
+
public function __construct(callable $nextHandler)
|
21 |
+
{
|
22 |
+
$this->nextHandler = $nextHandler;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @param RequestInterface $request
|
27 |
+
* @param array $options
|
28 |
+
*
|
29 |
+
* @return PromiseInterface
|
30 |
+
*/
|
31 |
+
public function __invoke(RequestInterface $request, array $options)
|
32 |
+
{
|
33 |
+
$fn = $this->nextHandler;
|
34 |
+
|
35 |
+
// Don't do anything if the request has no body.
|
36 |
+
if ($request->getBody()->getSize() === 0) {
|
37 |
+
return $fn($request, $options);
|
38 |
+
}
|
39 |
+
|
40 |
+
$modify = [];
|
41 |
+
|
42 |
+
// Add a default content-type if possible.
|
43 |
+
if (!$request->hasHeader('Content-Type')) {
|
44 |
+
if ($uri = $request->getBody()->getMetadata('uri')) {
|
45 |
+
if ($type = Psr7\mimetype_from_filename($uri)) {
|
46 |
+
$modify['set_headers']['Content-Type'] = $type;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
// Add a default content-length or transfer-encoding header.
|
52 |
+
if (!$request->hasHeader('Content-Length')
|
53 |
+
&& !$request->hasHeader('Transfer-Encoding')
|
54 |
+
) {
|
55 |
+
$size = $request->getBody()->getSize();
|
56 |
+
if ($size !== null) {
|
57 |
+
$modify['set_headers']['Content-Length'] = $size;
|
58 |
+
} else {
|
59 |
+
$modify['set_headers']['Transfer-Encoding'] = 'chunked';
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
// Add the expect header if needed.
|
64 |
+
$this->addExpectHeader($request, $options, $modify);
|
65 |
+
|
66 |
+
return $fn(Psr7\modify_request($request, $modify), $options);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Add expect header
|
71 |
+
*
|
72 |
+
* @return void
|
73 |
+
*/
|
74 |
+
private function addExpectHeader(
|
75 |
+
RequestInterface $request,
|
76 |
+
array $options,
|
77 |
+
array &$modify
|
78 |
+
) {
|
79 |
+
// Determine if the Expect header should be used
|
80 |
+
if ($request->hasHeader('Expect')) {
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
$expect = isset($options['expect']) ? $options['expect'] : null;
|
85 |
+
|
86 |
+
// Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
|
87 |
+
if ($expect === false || $request->getProtocolVersion() < 1.1) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
// The expect header is unconditionally enabled
|
92 |
+
if ($expect === true) {
|
93 |
+
$modify['set_headers']['Expect'] = '100-Continue';
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
|
97 |
+
// By default, send the expect header when the payload is > 1mb
|
98 |
+
if ($expect === null) {
|
99 |
+
$expect = 1048576;
|
100 |
+
}
|
101 |
+
|
102 |
+
// Always add if the body cannot be rewound, the size cannot be
|
103 |
+
// determined, or the size is greater than the cutoff threshold
|
104 |
+
$body = $request->getBody();
|
105 |
+
$size = $body->getSize();
|
106 |
+
|
107 |
+
if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
|
108 |
+
$modify['set_headers']['Expect'] = '100-Continue';
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
ADDED
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Exception\BadResponseException;
|
5 |
+
use GuzzleHttp\Exception\TooManyRedirectsException;
|
6 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
7 |
+
use GuzzleHttp\Psr7;
|
8 |
+
use Psr\Http\Message\RequestInterface;
|
9 |
+
use Psr\Http\Message\ResponseInterface;
|
10 |
+
use Psr\Http\Message\UriInterface;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Request redirect middleware.
|
14 |
+
*
|
15 |
+
* Apply this middleware like other middleware using
|
16 |
+
* {@see \GuzzleHttp\Middleware::redirect()}.
|
17 |
+
*/
|
18 |
+
class RedirectMiddleware
|
19 |
+
{
|
20 |
+
const HISTORY_HEADER = 'X-Guzzle-Redirect-History';
|
21 |
+
|
22 |
+
const STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History';
|
23 |
+
|
24 |
+
public static $defaultSettings = [
|
25 |
+
'max' => 5,
|
26 |
+
'protocols' => ['http', 'https'],
|
27 |
+
'strict' => false,
|
28 |
+
'referer' => false,
|
29 |
+
'track_redirects' => false,
|
30 |
+
];
|
31 |
+
|
32 |
+
/** @var callable */
|
33 |
+
private $nextHandler;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* @param callable $nextHandler Next handler to invoke.
|
37 |
+
*/
|
38 |
+
public function __construct(callable $nextHandler)
|
39 |
+
{
|
40 |
+
$this->nextHandler = $nextHandler;
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* @param RequestInterface $request
|
45 |
+
* @param array $options
|
46 |
+
*
|
47 |
+
* @return PromiseInterface
|
48 |
+
*/
|
49 |
+
public function __invoke(RequestInterface $request, array $options)
|
50 |
+
{
|
51 |
+
$fn = $this->nextHandler;
|
52 |
+
|
53 |
+
if (empty($options['allow_redirects'])) {
|
54 |
+
return $fn($request, $options);
|
55 |
+
}
|
56 |
+
|
57 |
+
if ($options['allow_redirects'] === true) {
|
58 |
+
$options['allow_redirects'] = self::$defaultSettings;
|
59 |
+
} elseif (!is_array($options['allow_redirects'])) {
|
60 |
+
throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
|
61 |
+
} else {
|
62 |
+
// Merge the default settings with the provided settings
|
63 |
+
$options['allow_redirects'] += self::$defaultSettings;
|
64 |
+
}
|
65 |
+
|
66 |
+
if (empty($options['allow_redirects']['max'])) {
|
67 |
+
return $fn($request, $options);
|
68 |
+
}
|
69 |
+
|
70 |
+
return $fn($request, $options)
|
71 |
+
->then(function (ResponseInterface $response) use ($request, $options) {
|
72 |
+
return $this->checkRedirect($request, $options, $response);
|
73 |
+
});
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @param RequestInterface $request
|
78 |
+
* @param array $options
|
79 |
+
* @param ResponseInterface $response
|
80 |
+
*
|
81 |
+
* @return ResponseInterface|PromiseInterface
|
82 |
+
*/
|
83 |
+
public function checkRedirect(
|
84 |
+
RequestInterface $request,
|
85 |
+
array $options,
|
86 |
+
ResponseInterface $response
|
87 |
+
) {
|
88 |
+
if (substr($response->getStatusCode(), 0, 1) != '3'
|
89 |
+
|| !$response->hasHeader('Location')
|
90 |
+
) {
|
91 |
+
return $response;
|
92 |
+
}
|
93 |
+
|
94 |
+
$this->guardMax($request, $options);
|
95 |
+
$nextRequest = $this->modifyRequest($request, $options, $response);
|
96 |
+
|
97 |
+
if (isset($options['allow_redirects']['on_redirect'])) {
|
98 |
+
call_user_func(
|
99 |
+
$options['allow_redirects']['on_redirect'],
|
100 |
+
$request,
|
101 |
+
$response,
|
102 |
+
$nextRequest->getUri()
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
/** @var PromiseInterface|ResponseInterface $promise */
|
107 |
+
$promise = $this($nextRequest, $options);
|
108 |
+
|
109 |
+
// Add headers to be able to track history of redirects.
|
110 |
+
if (!empty($options['allow_redirects']['track_redirects'])) {
|
111 |
+
return $this->withTracking(
|
112 |
+
$promise,
|
113 |
+
(string) $nextRequest->getUri(),
|
114 |
+
$response->getStatusCode()
|
115 |
+
);
|
116 |
+
}
|
117 |
+
|
118 |
+
return $promise;
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Enable tracking on promise.
|
123 |
+
*
|
124 |
+
* @return PromiseInterface
|
125 |
+
*/
|
126 |
+
private function withTracking(PromiseInterface $promise, $uri, $statusCode)
|
127 |
+
{
|
128 |
+
return $promise->then(
|
129 |
+
function (ResponseInterface $response) use ($uri, $statusCode) {
|
130 |
+
// Note that we are pushing to the front of the list as this
|
131 |
+
// would be an earlier response than what is currently present
|
132 |
+
// in the history header.
|
133 |
+
$historyHeader = $response->getHeader(self::HISTORY_HEADER);
|
134 |
+
$statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
|
135 |
+
array_unshift($historyHeader, $uri);
|
136 |
+
array_unshift($statusHeader, $statusCode);
|
137 |
+
return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
|
138 |
+
->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
|
139 |
+
}
|
140 |
+
);
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Check for too many redirects
|
145 |
+
*
|
146 |
+
* @return void
|
147 |
+
*
|
148 |
+
* @throws TooManyRedirectsException Too many redirects.
|
149 |
+
*/
|
150 |
+
private function guardMax(RequestInterface $request, array &$options)
|
151 |
+
{
|
152 |
+
$current = isset($options['__redirect_count'])
|
153 |
+
? $options['__redirect_count']
|
154 |
+
: 0;
|
155 |
+
$options['__redirect_count'] = $current + 1;
|
156 |
+
$max = $options['allow_redirects']['max'];
|
157 |
+
|
158 |
+
if ($options['__redirect_count'] > $max) {
|
159 |
+
throw new TooManyRedirectsException(
|
160 |
+
"Will not follow more than {$max} redirects",
|
161 |
+
$request
|
162 |
+
);
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* @param RequestInterface $request
|
168 |
+
* @param array $options
|
169 |
+
* @param ResponseInterface $response
|
170 |
+
*
|
171 |
+
* @return RequestInterface
|
172 |
+
*/
|
173 |
+
public function modifyRequest(
|
174 |
+
RequestInterface $request,
|
175 |
+
array $options,
|
176 |
+
ResponseInterface $response
|
177 |
+
) {
|
178 |
+
// Request modifications to apply.
|
179 |
+
$modify = [];
|
180 |
+
$protocols = $options['allow_redirects']['protocols'];
|
181 |
+
|
182 |
+
// Use a GET request if this is an entity enclosing request and we are
|
183 |
+
// not forcing RFC compliance, but rather emulating what all browsers
|
184 |
+
// would do.
|
185 |
+
$statusCode = $response->getStatusCode();
|
186 |
+
if ($statusCode == 303 ||
|
187 |
+
($statusCode <= 302 && !$options['allow_redirects']['strict'])
|
188 |
+
) {
|
189 |
+
$modify['method'] = 'GET';
|
190 |
+
$modify['body'] = '';
|
191 |
+
}
|
192 |
+
|
193 |
+
$uri = $this->redirectUri($request, $response, $protocols);
|
194 |
+
if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
|
195 |
+
$idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion'];
|
196 |
+
$uri = Utils::idnUriConvert($uri, $idnOptions);
|
197 |
+
}
|
198 |
+
|
199 |
+
$modify['uri'] = $uri;
|
200 |
+
Psr7\rewind_body($request);
|
201 |
+
|
202 |
+
// Add the Referer header if it is told to do so and only
|
203 |
+
// add the header if we are not redirecting from https to http.
|
204 |
+
if ($options['allow_redirects']['referer']
|
205 |
+
&& $modify['uri']->getScheme() === $request->getUri()->getScheme()
|
206 |
+
) {
|
207 |
+
$uri = $request->getUri()->withUserInfo('');
|
208 |
+
$modify['set_headers']['Referer'] = (string) $uri;
|
209 |
+
} else {
|
210 |
+
$modify['remove_headers'][] = 'Referer';
|
211 |
+
}
|
212 |
+
|
213 |
+
// Remove Authorization header if host is different.
|
214 |
+
if ($request->getUri()->getHost() !== $modify['uri']->getHost()) {
|
215 |
+
$modify['remove_headers'][] = 'Authorization';
|
216 |
+
}
|
217 |
+
|
218 |
+
return Psr7\modify_request($request, $modify);
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Set the appropriate URL on the request based on the location header
|
223 |
+
*
|
224 |
+
* @param RequestInterface $request
|
225 |
+
* @param ResponseInterface $response
|
226 |
+
* @param array $protocols
|
227 |
+
*
|
228 |
+
* @return UriInterface
|
229 |
+
*/
|
230 |
+
private function redirectUri(
|
231 |
+
RequestInterface $request,
|
232 |
+
ResponseInterface $response,
|
233 |
+
array $protocols
|
234 |
+
) {
|
235 |
+
$location = Psr7\UriResolver::resolve(
|
236 |
+
$request->getUri(),
|
237 |
+
new Psr7\Uri($response->getHeaderLine('Location'))
|
238 |
+
);
|
239 |
+
|
240 |
+
// Ensure that the redirect URI is allowed based on the protocols.
|
241 |
+
if (!in_array($location->getScheme(), $protocols)) {
|
242 |
+
throw new BadResponseException(
|
243 |
+
sprintf(
|
244 |
+
'Redirect URI, %s, does not use one of the allowed redirect protocols: %s',
|
245 |
+
$location,
|
246 |
+
implode(', ', $protocols)
|
247 |
+
),
|
248 |
+
$request,
|
249 |
+
$response
|
250 |
+
);
|
251 |
+
}
|
252 |
+
|
253 |
+
return $location;
|
254 |
+
}
|
255 |
+
}
|
vendor/guzzlehttp/guzzle/src/RequestOptions.php
ADDED
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* This class contains a list of built-in Guzzle request options.
|
6 |
+
*
|
7 |
+
* More documentation for each option can be found at http://guzzlephp.org/.
|
8 |
+
*
|
9 |
+
* @link http://docs.guzzlephp.org/en/v6/request-options.html
|
10 |
+
*/
|
11 |
+
final class RequestOptions
|
12 |
+
{
|
13 |
+
/**
|
14 |
+
* allow_redirects: (bool|array) Controls redirect behavior. Pass false
|
15 |
+
* to disable redirects, pass true to enable redirects, pass an
|
16 |
+
* associative to provide custom redirect settings. Defaults to "false".
|
17 |
+
* This option only works if your handler has the RedirectMiddleware. When
|
18 |
+
* passing an associative array, you can provide the following key value
|
19 |
+
* pairs:
|
20 |
+
*
|
21 |
+
* - max: (int, default=5) maximum number of allowed redirects.
|
22 |
+
* - strict: (bool, default=false) Set to true to use strict redirects
|
23 |
+
* meaning redirect POST requests with POST requests vs. doing what most
|
24 |
+
* browsers do which is redirect POST requests with GET requests
|
25 |
+
* - referer: (bool, default=false) Set to true to enable the Referer
|
26 |
+
* header.
|
27 |
+
* - protocols: (array, default=['http', 'https']) Allowed redirect
|
28 |
+
* protocols.
|
29 |
+
* - on_redirect: (callable) PHP callable that is invoked when a redirect
|
30 |
+
* is encountered. The callable is invoked with the request, the redirect
|
31 |
+
* response that was received, and the effective URI. Any return value
|
32 |
+
* from the on_redirect function is ignored.
|
33 |
+
*/
|
34 |
+
const ALLOW_REDIRECTS = 'allow_redirects';
|
35 |
+
|
36 |
+
/**
|
37 |
+
* auth: (array) Pass an array of HTTP authentication parameters to use
|
38 |
+
* with the request. The array must contain the username in index [0],
|
39 |
+
* the password in index [1], and you can optionally provide a built-in
|
40 |
+
* authentication type in index [2]. Pass null to disable authentication
|
41 |
+
* for a request.
|
42 |
+
*/
|
43 |
+
const AUTH = 'auth';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* body: (resource|string|null|int|float|StreamInterface|callable|\Iterator)
|
47 |
+
* Body to send in the request.
|
48 |
+
*/
|
49 |
+
const BODY = 'body';
|
50 |
+
|
51 |
+
/**
|
52 |
+
* cert: (string|array) Set to a string to specify the path to a file
|
53 |
+
* containing a PEM formatted SSL client side certificate. If a password
|
54 |
+
* is required, then set cert to an array containing the path to the PEM
|
55 |
+
* file in the first array element followed by the certificate password
|
56 |
+
* in the second array element.
|
57 |
+
*/
|
58 |
+
const CERT = 'cert';
|
59 |
+
|
60 |
+
/**
|
61 |
+
* cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false)
|
62 |
+
* Specifies whether or not cookies are used in a request or what cookie
|
63 |
+
* jar to use or what cookies to send. This option only works if your
|
64 |
+
* handler has the `cookie` middleware. Valid values are `false` and
|
65 |
+
* an instance of {@see GuzzleHttp\Cookie\CookieJarInterface}.
|
66 |
+
*/
|
67 |
+
const COOKIES = 'cookies';
|
68 |
+
|
69 |
+
/**
|
70 |
+
* connect_timeout: (float, default=0) Float describing the number of
|
71 |
+
* seconds to wait while trying to connect to a server. Use 0 to wait
|
72 |
+
* indefinitely (the default behavior).
|
73 |
+
*/
|
74 |
+
const CONNECT_TIMEOUT = 'connect_timeout';
|
75 |
+
|
76 |
+
/**
|
77 |
+
* debug: (bool|resource) Set to true or set to a PHP stream returned by
|
78 |
+
* fopen() enable debug output with the HTTP handler used to send a
|
79 |
+
* request.
|
80 |
+
*/
|
81 |
+
const DEBUG = 'debug';
|
82 |
+
|
83 |
+
/**
|
84 |
+
* decode_content: (bool, default=true) Specify whether or not
|
85 |
+
* Content-Encoding responses (gzip, deflate, etc.) are automatically
|
86 |
+
* decoded.
|
87 |
+
*/
|
88 |
+
const DECODE_CONTENT = 'decode_content';
|
89 |
+
|
90 |
+
/**
|
91 |
+
* delay: (int) The amount of time to delay before sending in milliseconds.
|
92 |
+
*/
|
93 |
+
const DELAY = 'delay';
|
94 |
+
|
95 |
+
/**
|
96 |
+
* expect: (bool|integer) Controls the behavior of the
|
97 |
+
* "Expect: 100-Continue" header.
|
98 |
+
*
|
99 |
+
* Set to `true` to enable the "Expect: 100-Continue" header for all
|
100 |
+
* requests that sends a body. Set to `false` to disable the
|
101 |
+
* "Expect: 100-Continue" header for all requests. Set to a number so that
|
102 |
+
* the size of the payload must be greater than the number in order to send
|
103 |
+
* the Expect header. Setting to a number will send the Expect header for
|
104 |
+
* all requests in which the size of the payload cannot be determined or
|
105 |
+
* where the body is not rewindable.
|
106 |
+
*
|
107 |
+
* By default, Guzzle will add the "Expect: 100-Continue" header when the
|
108 |
+
* size of the body of a request is greater than 1 MB and a request is
|
109 |
+
* using HTTP/1.1.
|
110 |
+
*/
|
111 |
+
const EXPECT = 'expect';
|
112 |
+
|
113 |
+
/**
|
114 |
+
* form_params: (array) Associative array of form field names to values
|
115 |
+
* where each value is a string or array of strings. Sets the Content-Type
|
116 |
+
* header to application/x-www-form-urlencoded when no Content-Type header
|
117 |
+
* is already present.
|
118 |
+
*/
|
119 |
+
const FORM_PARAMS = 'form_params';
|
120 |
+
|
121 |
+
/**
|
122 |
+
* headers: (array) Associative array of HTTP headers. Each value MUST be
|
123 |
+
* a string or array of strings.
|
124 |
+
*/
|
125 |
+
const HEADERS = 'headers';
|
126 |
+
|
127 |
+
/**
|
128 |
+
* http_errors: (bool, default=true) Set to false to disable exceptions
|
129 |
+
* when a non- successful HTTP response is received. By default,
|
130 |
+
* exceptions will be thrown for 4xx and 5xx responses. This option only
|
131 |
+
* works if your handler has the `httpErrors` middleware.
|
132 |
+
*/
|
133 |
+
const HTTP_ERRORS = 'http_errors';
|
134 |
+
|
135 |
+
/**
|
136 |
+
* idn: (bool|int, default=true) A combination of IDNA_* constants for
|
137 |
+
* idn_to_ascii() PHP's function (see "options" parameter). Set to false to
|
138 |
+
* disable IDN support completely, or to true to use the default
|
139 |
+
* configuration (IDNA_DEFAULT constant).
|
140 |
+
*/
|
141 |
+
const IDN_CONVERSION = 'idn_conversion';
|
142 |
+
|
143 |
+
/**
|
144 |
+
* json: (mixed) Adds JSON data to a request. The provided value is JSON
|
145 |
+
* encoded and a Content-Type header of application/json will be added to
|
146 |
+
* the request if no Content-Type header is already present.
|
147 |
+
*/
|
148 |
+
const JSON = 'json';
|
149 |
+
|
150 |
+
/**
|
151 |
+
* multipart: (array) Array of associative arrays, each containing a
|
152 |
+
* required "name" key mapping to the form field, name, a required
|
153 |
+
* "contents" key mapping to a StreamInterface|resource|string, an
|
154 |
+
* optional "headers" associative array of custom headers, and an
|
155 |
+
* optional "filename" key mapping to a string to send as the filename in
|
156 |
+
* the part. If no "filename" key is present, then no "filename" attribute
|
157 |
+
* will be added to the part.
|
158 |
+
*/
|
159 |
+
const MULTIPART = 'multipart';
|
160 |
+
|
161 |
+
/**
|
162 |
+
* on_headers: (callable) A callable that is invoked when the HTTP headers
|
163 |
+
* of the response have been received but the body has not yet begun to
|
164 |
+
* download.
|
165 |
+
*/
|
166 |
+
const ON_HEADERS = 'on_headers';
|
167 |
+
|
168 |
+
/**
|
169 |
+
* on_stats: (callable) allows you to get access to transfer statistics of
|
170 |
+
* a request and access the lower level transfer details of the handler
|
171 |
+
* associated with your client. ``on_stats`` is a callable that is invoked
|
172 |
+
* when a handler has finished sending a request. The callback is invoked
|
173 |
+
* with transfer statistics about the request, the response received, or
|
174 |
+
* the error encountered. Included in the data is the total amount of time
|
175 |
+
* taken to send the request.
|
176 |
+
*/
|
177 |
+
const ON_STATS = 'on_stats';
|
178 |
+
|
179 |
+
/**
|
180 |
+
* progress: (callable) Defines a function to invoke when transfer
|
181 |
+
* progress is made. The function accepts the following positional
|
182 |
+
* arguments: the total number of bytes expected to be downloaded, the
|
183 |
+
* number of bytes downloaded so far, the number of bytes expected to be
|
184 |
+
* uploaded, the number of bytes uploaded so far.
|
185 |
+
*/
|
186 |
+
const PROGRESS = 'progress';
|
187 |
+
|
188 |
+
/**
|
189 |
+
* proxy: (string|array) Pass a string to specify an HTTP proxy, or an
|
190 |
+
* array to specify different proxies for different protocols (where the
|
191 |
+
* key is the protocol and the value is a proxy string).
|
192 |
+
*/
|
193 |
+
const PROXY = 'proxy';
|
194 |
+
|
195 |
+
/**
|
196 |
+
* query: (array|string) Associative array of query string values to add
|
197 |
+
* to the request. This option uses PHP's http_build_query() to create
|
198 |
+
* the string representation. Pass a string value if you need more
|
199 |
+
* control than what this method provides
|
200 |
+
*/
|
201 |
+
const QUERY = 'query';
|
202 |
+
|
203 |
+
/**
|
204 |
+
* sink: (resource|string|StreamInterface) Where the data of the
|
205 |
+
* response is written to. Defaults to a PHP temp stream. Providing a
|
206 |
+
* string will write data to a file by the given name.
|
207 |
+
*/
|
208 |
+
const SINK = 'sink';
|
209 |
+
|
210 |
+
/**
|
211 |
+
* synchronous: (bool) Set to true to inform HTTP handlers that you intend
|
212 |
+
* on waiting on the response. This can be useful for optimizations. Note
|
213 |
+
* that a promise is still returned if you are using one of the async
|
214 |
+
* client methods.
|
215 |
+
*/
|
216 |
+
const SYNCHRONOUS = 'synchronous';
|
217 |
+
|
218 |
+
/**
|
219 |
+
* ssl_key: (array|string) Specify the path to a file containing a private
|
220 |
+
* SSL key in PEM format. If a password is required, then set to an array
|
221 |
+
* containing the path to the SSL key in the first array element followed
|
222 |
+
* by the password required for the certificate in the second element.
|
223 |
+
*/
|
224 |
+
const SSL_KEY = 'ssl_key';
|
225 |
+
|
226 |
+
/**
|
227 |
+
* stream: Set to true to attempt to stream a response rather than
|
228 |
+
* download it all up-front.
|
229 |
+
*/
|
230 |
+
const STREAM = 'stream';
|
231 |
+
|
232 |
+
/**
|
233 |
+
* verify: (bool|string, default=true) Describes the SSL certificate
|
234 |
+
* verification behavior of a request. Set to true to enable SSL
|
235 |
+
* certificate verification using the system CA bundle when available
|
236 |
+
* (the default). Set to false to disable certificate verification (this
|
237 |
+
* is insecure!). Set to a string to provide the path to a CA bundle on
|
238 |
+
* disk to enable verification using a custom certificate.
|
239 |
+
*/
|
240 |
+
const VERIFY = 'verify';
|
241 |
+
|
242 |
+
/**
|
243 |
+
* timeout: (float, default=0) Float describing the timeout of the
|
244 |
+
* request in seconds. Use 0 to wait indefinitely (the default behavior).
|
245 |
+
*/
|
246 |
+
const TIMEOUT = 'timeout';
|
247 |
+
|
248 |
+
/**
|
249 |
+
* read_timeout: (float, default=default_socket_timeout ini setting) Float describing
|
250 |
+
* the body read timeout, for stream requests.
|
251 |
+
*/
|
252 |
+
const READ_TIMEOUT = 'read_timeout';
|
253 |
+
|
254 |
+
/**
|
255 |
+
* version: (float) Specifies the HTTP protocol version to attempt to use.
|
256 |
+
*/
|
257 |
+
const VERSION = 'version';
|
258 |
+
|
259 |
+
/**
|
260 |
+
* force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol
|
261 |
+
*/
|
262 |
+
const FORCE_IP_RESOLVE = 'force_ip_resolve';
|
263 |
+
}
|
vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Promise\PromiseInterface;
|
5 |
+
use GuzzleHttp\Promise\RejectedPromise;
|
6 |
+
use GuzzleHttp\Psr7;
|
7 |
+
use Psr\Http\Message\RequestInterface;
|
8 |
+
use Psr\Http\Message\ResponseInterface;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Middleware that retries requests based on the boolean result of
|
12 |
+
* invoking the provided "decider" function.
|
13 |
+
*/
|
14 |
+
class RetryMiddleware
|
15 |
+
{
|
16 |
+
/** @var callable */
|
17 |
+
private $nextHandler;
|
18 |
+
|
19 |
+
/** @var callable */
|
20 |
+
private $decider;
|
21 |
+
|
22 |
+
/** @var callable */
|
23 |
+
private $delay;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @param callable $decider Function that accepts the number of retries,
|
27 |
+
* a request, [response], and [exception] and
|
28 |
+
* returns true if the request is to be
|
29 |
+
* retried.
|
30 |
+
* @param callable $nextHandler Next handler to invoke.
|
31 |
+
* @param callable $delay Function that accepts the number of retries
|
32 |
+
* and [response] and returns the number of
|
33 |
+
* milliseconds to delay.
|
34 |
+
*/
|
35 |
+
public function __construct(
|
36 |
+
callable $decider,
|
37 |
+
callable $nextHandler,
|
38 |
+
callable $delay = null
|
39 |
+
) {
|
40 |
+
$this->decider = $decider;
|
41 |
+
$this->nextHandler = $nextHandler;
|
42 |
+
$this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Default exponential backoff delay function.
|
47 |
+
*
|
48 |
+
* @param int $retries
|
49 |
+
*
|
50 |
+
* @return int milliseconds.
|
51 |
+
*/
|
52 |
+
public static function exponentialDelay($retries)
|
53 |
+
{
|
54 |
+
return (int) pow(2, $retries - 1) * 1000;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* @param RequestInterface $request
|
59 |
+
* @param array $options
|
60 |
+
*
|
61 |
+
* @return PromiseInterface
|
62 |
+
*/
|
63 |
+
public function __invoke(RequestInterface $request, array $options)
|
64 |
+
{
|
65 |
+
if (!isset($options['retries'])) {
|
66 |
+
$options['retries'] = 0;
|
67 |
+
}
|
68 |
+
|
69 |
+
$fn = $this->nextHandler;
|
70 |
+
return $fn($request, $options)
|
71 |
+
->then(
|
72 |
+
$this->onFulfilled($request, $options),
|
73 |
+
$this->onRejected($request, $options)
|
74 |
+
);
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Execute fulfilled closure
|
79 |
+
*
|
80 |
+
* @return mixed
|
81 |
+
*/
|
82 |
+
private function onFulfilled(RequestInterface $req, array $options)
|
83 |
+
{
|
84 |
+
return function ($value) use ($req, $options) {
|
85 |
+
if (!call_user_func(
|
86 |
+
$this->decider,
|
87 |
+
$options['retries'],
|
88 |
+
$req,
|
89 |
+
$value,
|
90 |
+
null
|
91 |
+
)) {
|
92 |
+
return $value;
|
93 |
+
}
|
94 |
+
return $this->doRetry($req, $options, $value);
|
95 |
+
};
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Execute rejected closure
|
100 |
+
*
|
101 |
+
* @return callable
|
102 |
+
*/
|
103 |
+
private function onRejected(RequestInterface $req, array $options)
|
104 |
+
{
|
105 |
+
return function ($reason) use ($req, $options) {
|
106 |
+
if (!call_user_func(
|
107 |
+
$this->decider,
|
108 |
+
$options['retries'],
|
109 |
+
$req,
|
110 |
+
null,
|
111 |
+
$reason
|
112 |
+
)) {
|
113 |
+
return \GuzzleHttp\Promise\rejection_for($reason);
|
114 |
+
}
|
115 |
+
return $this->doRetry($req, $options);
|
116 |
+
};
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* @return self
|
121 |
+
*/
|
122 |
+
private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
|
123 |
+
{
|
124 |
+
$options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
|
125 |
+
|
126 |
+
return $this($request, $options);
|
127 |
+
}
|
128 |
+
}
|
vendor/guzzlehttp/guzzle/src/TransferStats.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use Psr\Http\Message\RequestInterface;
|
5 |
+
use Psr\Http\Message\ResponseInterface;
|
6 |
+
use Psr\Http\Message\UriInterface;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Represents data at the point after it was transferred either successfully
|
10 |
+
* or after a network error.
|
11 |
+
*/
|
12 |
+
final class TransferStats
|
13 |
+
{
|
14 |
+
private $request;
|
15 |
+
private $response;
|
16 |
+
private $transferTime;
|
17 |
+
private $handlerStats;
|
18 |
+
private $handlerErrorData;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param RequestInterface $request Request that was sent.
|
22 |
+
* @param ResponseInterface|null $response Response received (if any)
|
23 |
+
* @param float|null $transferTime Total handler transfer time.
|
24 |
+
* @param mixed $handlerErrorData Handler error data.
|
25 |
+
* @param array $handlerStats Handler specific stats.
|
26 |
+
*/
|
27 |
+
public function __construct(
|
28 |
+
RequestInterface $request,
|
29 |
+
ResponseInterface $response = null,
|
30 |
+
$transferTime = null,
|
31 |
+
$handlerErrorData = null,
|
32 |
+
$handlerStats = []
|
33 |
+
) {
|
34 |
+
$this->request = $request;
|
35 |
+
$this->response = $response;
|
36 |
+
$this->transferTime = $transferTime;
|
37 |
+
$this->handlerErrorData = $handlerErrorData;
|
38 |
+
$this->handlerStats = $handlerStats;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @return RequestInterface
|
43 |
+
*/
|
44 |
+
public function getRequest()
|
45 |
+
{
|
46 |
+
return $this->request;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Returns the response that was received (if any).
|
51 |
+
*
|
52 |
+
* @return ResponseInterface|null
|
53 |
+
*/
|
54 |
+
public function getResponse()
|
55 |
+
{
|
56 |
+
return $this->response;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Returns true if a response was received.
|
61 |
+
*
|
62 |
+
* @return bool
|
63 |
+
*/
|
64 |
+
public function hasResponse()
|
65 |
+
{
|
66 |
+
return $this->response !== null;
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Gets handler specific error data.
|
71 |
+
*
|
72 |
+
* This might be an exception, a integer representing an error code, or
|
73 |
+
* anything else. Relying on this value assumes that you know what handler
|
74 |
+
* you are using.
|
75 |
+
*
|
76 |
+
* @return mixed
|
77 |
+
*/
|
78 |
+
public function getHandlerErrorData()
|
79 |
+
{
|
80 |
+
return $this->handlerErrorData;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Get the effective URI the request was sent to.
|
85 |
+
*
|
86 |
+
* @return UriInterface
|
87 |
+
*/
|
88 |
+
public function getEffectiveUri()
|
89 |
+
{
|
90 |
+
return $this->request->getUri();
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Get the estimated time the request was being transferred by the handler.
|
95 |
+
*
|
96 |
+
* @return float|null Time in seconds.
|
97 |
+
*/
|
98 |
+
public function getTransferTime()
|
99 |
+
{
|
100 |
+
return $this->transferTime;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Gets an array of all of the handler specific transfer data.
|
105 |
+
*
|
106 |
+
* @return array
|
107 |
+
*/
|
108 |
+
public function getHandlerStats()
|
109 |
+
{
|
110 |
+
return $this->handlerStats;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Get a specific handler statistic from the handler by name.
|
115 |
+
*
|
116 |
+
* @param string $stat Handler specific transfer stat to retrieve.
|
117 |
+
*
|
118 |
+
* @return mixed|null
|
119 |
+
*/
|
120 |
+
public function getHandlerStat($stat)
|
121 |
+
{
|
122 |
+
return isset($this->handlerStats[$stat])
|
123 |
+
? $this->handlerStats[$stat]
|
124 |
+
: null;
|
125 |
+
}
|
126 |
+
}
|
vendor/guzzlehttp/guzzle/src/UriTemplate.php
ADDED
@@ -0,0 +1,237 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Expands URI templates. Userland implementation of PECL uri_template.
|
6 |
+
*
|
7 |
+
* @link http://tools.ietf.org/html/rfc6570
|
8 |
+
*/
|
9 |
+
class UriTemplate
|
10 |
+
{
|
11 |
+
/** @var string URI template */
|
12 |
+
private $template;
|
13 |
+
|
14 |
+
/** @var array Variables to use in the template expansion */
|
15 |
+
private $variables;
|
16 |
+
|
17 |
+
/** @var array Hash for quick operator lookups */
|
18 |
+
private static $operatorHash = [
|
19 |
+
'' => ['prefix' => '', 'joiner' => ',', 'query' => false],
|
20 |
+
'+' => ['prefix' => '', 'joiner' => ',', 'query' => false],
|
21 |
+
'#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
|
22 |
+
'.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
|
23 |
+
'/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
|
24 |
+
';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
|
25 |
+
'?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
|
26 |
+
'&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]
|
27 |
+
];
|
28 |
+
|
29 |
+
/** @var array Delimiters */
|
30 |
+
private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$',
|
31 |
+
'&', '\'', '(', ')', '*', '+', ',', ';', '='];
|
32 |
+
|
33 |
+
/** @var array Percent encoded delimiters */
|
34 |
+
private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D',
|
35 |
+
'%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
|
36 |
+
'%3B', '%3D'];
|
37 |
+
|
38 |
+
public function expand($template, array $variables)
|
39 |
+
{
|
40 |
+
if (false === strpos($template, '{')) {
|
41 |
+
return $template;
|
42 |
+
}
|
43 |
+
|
44 |
+
$this->template = $template;
|
45 |
+
$this->variables = $variables;
|
46 |
+
|
47 |
+
return preg_replace_callback(
|
48 |
+
'/\{([^\}]+)\}/',
|
49 |
+
[$this, 'expandMatch'],
|
50 |
+
$this->template
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Parse an expression into parts
|
56 |
+
*
|
57 |
+
* @param string $expression Expression to parse
|
58 |
+
*
|
59 |
+
* @return array Returns an associative array of parts
|
60 |
+
*/
|
61 |
+
private function parseExpression($expression)
|
62 |
+
{
|
63 |
+
$result = [];
|
64 |
+
|
65 |
+
if (isset(self::$operatorHash[$expression[0]])) {
|
66 |
+
$result['operator'] = $expression[0];
|
67 |
+
$expression = substr($expression, 1);
|
68 |
+
} else {
|
69 |
+
$result['operator'] = '';
|
70 |
+
}
|
71 |
+
|
72 |
+
foreach (explode(',', $expression) as $value) {
|
73 |
+
$value = trim($value);
|
74 |
+
$varspec = [];
|
75 |
+
if ($colonPos = strpos($value, ':')) {
|
76 |
+
$varspec['value'] = substr($value, 0, $colonPos);
|
77 |
+
$varspec['modifier'] = ':';
|
78 |
+
$varspec['position'] = (int) substr($value, $colonPos + 1);
|
79 |
+
} elseif (substr($value, -1) === '*') {
|
80 |
+
$varspec['modifier'] = '*';
|
81 |
+
$varspec['value'] = substr($value, 0, -1);
|
82 |
+
} else {
|
83 |
+
$varspec['value'] = (string) $value;
|
84 |
+
$varspec['modifier'] = '';
|
85 |
+
}
|
86 |
+
$result['values'][] = $varspec;
|
87 |
+
}
|
88 |
+
|
89 |
+
return $result;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Process an expansion
|
94 |
+
*
|
95 |
+
* @param array $matches Matches met in the preg_replace_callback
|
96 |
+
*
|
97 |
+
* @return string Returns the replacement string
|
98 |
+
*/
|
99 |
+
private function expandMatch(array $matches)
|
100 |
+
{
|
101 |
+
static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
|
102 |
+
|
103 |
+
$replacements = [];
|
104 |
+
$parsed = self::parseExpression($matches[1]);
|
105 |
+
$prefix = self::$operatorHash[$parsed['operator']]['prefix'];
|
106 |
+
$joiner = self::$operatorHash[$parsed['operator']]['joiner'];
|
107 |
+
$useQuery = self::$operatorHash[$parsed['operator']]['query'];
|
108 |
+
|
109 |
+
foreach ($parsed['values'] as $value) {
|
110 |
+
if (!isset($this->variables[$value['value']])) {
|
111 |
+
continue;
|
112 |
+
}
|
113 |
+
|
114 |
+
$variable = $this->variables[$value['value']];
|
115 |
+
$actuallyUseQuery = $useQuery;
|
116 |
+
$expanded = '';
|
117 |
+
|
118 |
+
if (is_array($variable)) {
|
119 |
+
$isAssoc = $this->isAssoc($variable);
|
120 |
+
$kvp = [];
|
121 |
+
foreach ($variable as $key => $var) {
|
122 |
+
if ($isAssoc) {
|
123 |
+
$key = rawurlencode($key);
|
124 |
+
$isNestedArray = is_array($var);
|
125 |
+
} else {
|
126 |
+
$isNestedArray = false;
|
127 |
+
}
|
128 |
+
|
129 |
+
if (!$isNestedArray) {
|
130 |
+
$var = rawurlencode($var);
|
131 |
+
if ($parsed['operator'] === '+' ||
|
132 |
+
$parsed['operator'] === '#'
|
133 |
+
) {
|
134 |
+
$var = $this->decodeReserved($var);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
if ($value['modifier'] === '*') {
|
139 |
+
if ($isAssoc) {
|
140 |
+
if ($isNestedArray) {
|
141 |
+
// Nested arrays must allow for deeply nested
|
142 |
+
// structures.
|
143 |
+
$var = strtr(
|
144 |
+
http_build_query([$key => $var]),
|
145 |
+
$rfc1738to3986
|
146 |
+
);
|
147 |
+
} else {
|
148 |
+
$var = $key . '=' . $var;
|
149 |
+
}
|
150 |
+
} elseif ($key > 0 && $actuallyUseQuery) {
|
151 |
+
$var = $value['value'] . '=' . $var;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
$kvp[$key] = $var;
|
156 |
+
}
|
157 |
+
|
158 |
+
if (empty($variable)) {
|
159 |
+
$actuallyUseQuery = false;
|
160 |
+
} elseif ($value['modifier'] === '*') {
|
161 |
+
$expanded = implode($joiner, $kvp);
|
162 |
+
if ($isAssoc) {
|
163 |
+
// Don't prepend the value name when using the explode
|
164 |
+
// modifier with an associative array.
|
165 |
+
$actuallyUseQuery = false;
|
166 |
+
}
|
167 |
+
} else {
|
168 |
+
if ($isAssoc) {
|
169 |
+
// When an associative array is encountered and the
|
170 |
+
// explode modifier is not set, then the result must be
|
171 |
+
// a comma separated list of keys followed by their
|
172 |
+
// respective values.
|
173 |
+
foreach ($kvp as $k => &$v) {
|
174 |
+
$v = $k . ',' . $v;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
$expanded = implode(',', $kvp);
|
178 |
+
}
|
179 |
+
} else {
|
180 |
+
if ($value['modifier'] === ':') {
|
181 |
+
$variable = substr($variable, 0, $value['position']);
|
182 |
+
}
|
183 |
+
$expanded = rawurlencode($variable);
|
184 |
+
if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
|
185 |
+
$expanded = $this->decodeReserved($expanded);
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
if ($actuallyUseQuery) {
|
190 |
+
if (!$expanded && $joiner !== '&') {
|
191 |
+
$expanded = $value['value'];
|
192 |
+
} else {
|
193 |
+
$expanded = $value['value'] . '=' . $expanded;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
$replacements[] = $expanded;
|
198 |
+
}
|
199 |
+
|
200 |
+
$ret = implode($joiner, $replacements);
|
201 |
+
if ($ret && $prefix) {
|
202 |
+
return $prefix . $ret;
|
203 |
+
}
|
204 |
+
|
205 |
+
return $ret;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Determines if an array is associative.
|
210 |
+
*
|
211 |
+
* This makes the assumption that input arrays are sequences or hashes.
|
212 |
+
* This assumption is a tradeoff for accuracy in favor of speed, but it
|
213 |
+
* should work in almost every case where input is supplied for a URI
|
214 |
+
* template.
|
215 |
+
*
|
216 |
+
* @param array $array Array to check
|
217 |
+
*
|
218 |
+
* @return bool
|
219 |
+
*/
|
220 |
+
private function isAssoc(array $array)
|
221 |
+
{
|
222 |
+
return $array && array_keys($array)[0] !== 0;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Removes percent encoding on reserved characters (used with + and #
|
227 |
+
* modifiers).
|
228 |
+
*
|
229 |
+
* @param string $string String to fix
|
230 |
+
*
|
231 |
+
* @return string
|
232 |
+
*/
|
233 |
+
private function decodeReserved($string)
|
234 |
+
{
|
235 |
+
return str_replace(self::$delimsPct, self::$delims, $string);
|
236 |
+
}
|
237 |
+
}
|
vendor/guzzlehttp/guzzle/src/Utils.php
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Exception\InvalidArgumentException;
|
5 |
+
use Psr\Http\Message\UriInterface;
|
6 |
+
use Symfony\Polyfill\Intl\Idn\Idn;
|
7 |
+
|
8 |
+
final class Utils
|
9 |
+
{
|
10 |
+
/**
|
11 |
+
* Wrapper for the hrtime() or microtime() functions
|
12 |
+
* (depending on the PHP version, one of the two is used)
|
13 |
+
*
|
14 |
+
* @return float|mixed UNIX timestamp
|
15 |
+
*
|
16 |
+
* @internal
|
17 |
+
*/
|
18 |
+
public static function currentTime()
|
19 |
+
{
|
20 |
+
return function_exists('hrtime') ? hrtime(true) / 1e9 : microtime(true);
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @param int $options
|
25 |
+
*
|
26 |
+
* @return UriInterface
|
27 |
+
* @throws InvalidArgumentException
|
28 |
+
*
|
29 |
+
* @internal
|
30 |
+
*/
|
31 |
+
public static function idnUriConvert(UriInterface $uri, $options = 0)
|
32 |
+
{
|
33 |
+
if ($uri->getHost()) {
|
34 |
+
$asciiHost = self::idnToAsci($uri->getHost(), $options, $info);
|
35 |
+
if ($asciiHost === false) {
|
36 |
+
$errorBitSet = isset($info['errors']) ? $info['errors'] : 0;
|
37 |
+
|
38 |
+
$errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) {
|
39 |
+
return substr($name, 0, 11) === 'IDNA_ERROR_';
|
40 |
+
});
|
41 |
+
|
42 |
+
$errors = [];
|
43 |
+
foreach ($errorConstants as $errorConstant) {
|
44 |
+
if ($errorBitSet & constant($errorConstant)) {
|
45 |
+
$errors[] = $errorConstant;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
$errorMessage = 'IDN conversion failed';
|
50 |
+
if ($errors) {
|
51 |
+
$errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
|
52 |
+
}
|
53 |
+
|
54 |
+
throw new InvalidArgumentException($errorMessage);
|
55 |
+
} else {
|
56 |
+
if ($uri->getHost() !== $asciiHost) {
|
57 |
+
// Replace URI only if the ASCII version is different
|
58 |
+
$uri = $uri->withHost($asciiHost);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return $uri;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* @param string $domain
|
68 |
+
* @param int $options
|
69 |
+
* @param array $info
|
70 |
+
*
|
71 |
+
* @return string|false
|
72 |
+
*/
|
73 |
+
private static function idnToAsci($domain, $options, &$info = [])
|
74 |
+
{
|
75 |
+
if (\preg_match('%^[ -~]+$%', $domain) === 1) {
|
76 |
+
return $domain;
|
77 |
+
}
|
78 |
+
|
79 |
+
if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) {
|
80 |
+
return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info);
|
81 |
+
}
|
82 |
+
|
83 |
+
/*
|
84 |
+
* The Idn class is marked as @internal. Verify that class and method exists.
|
85 |
+
*/
|
86 |
+
if (method_exists(Idn::class, 'idn_to_ascii')) {
|
87 |
+
return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info);
|
88 |
+
}
|
89 |
+
|
90 |
+
throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old');
|
91 |
+
}
|
92 |
+
}
|
vendor/guzzlehttp/guzzle/src/functions.php
ADDED
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp;
|
3 |
+
|
4 |
+
use GuzzleHttp\Handler\CurlHandler;
|
5 |
+
use GuzzleHttp\Handler\CurlMultiHandler;
|
6 |
+
use GuzzleHttp\Handler\Proxy;
|
7 |
+
use GuzzleHttp\Handler\StreamHandler;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Expands a URI template
|
11 |
+
*
|
12 |
+
* @param string $template URI template
|
13 |
+
* @param array $variables Template variables
|
14 |
+
*
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
function uri_template($template, array $variables)
|
18 |
+
{
|
19 |
+
if (extension_loaded('uri_template')) {
|
20 |
+
// @codeCoverageIgnoreStart
|
21 |
+
return \uri_template($template, $variables);
|
22 |
+
// @codeCoverageIgnoreEnd
|
23 |
+
}
|
24 |
+
|
25 |
+
static $uriTemplate;
|
26 |
+
if (!$uriTemplate) {
|
27 |
+
$uriTemplate = new UriTemplate();
|
28 |
+
}
|
29 |
+
|
30 |
+
return $uriTemplate->expand($template, $variables);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Debug function used to describe the provided value type and class.
|
35 |
+
*
|
36 |
+
* @param mixed $input
|
37 |
+
*
|
38 |
+
* @return string Returns a string containing the type of the variable and
|
39 |
+
* if a class is provided, the class name.
|
40 |
+
*/
|
41 |
+
function describe_type($input)
|
42 |
+
{
|
43 |
+
switch (gettype($input)) {
|
44 |
+
case 'object':
|
45 |
+
return 'object(' . get_class($input) . ')';
|
46 |
+
case 'array':
|
47 |
+
return 'array(' . count($input) . ')';
|
48 |
+
default:
|
49 |
+
ob_start();
|
50 |
+
var_dump($input);
|
51 |
+
// normalize float vs double
|
52 |
+
return str_replace('double(', 'float(', rtrim(ob_get_clean()));
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Parses an array of header lines into an associative array of headers.
|
58 |
+
*
|
59 |
+
* @param iterable $lines Header lines array of strings in the following
|
60 |
+
* format: "Name: Value"
|
61 |
+
* @return array
|
62 |
+
*/
|
63 |
+
function headers_from_lines($lines)
|
64 |
+
{
|
65 |
+
$headers = [];
|
66 |
+
|
67 |
+
foreach ($lines as $line) {
|
68 |
+
$parts = explode(':', $line, 2);
|
69 |
+
$headers[trim($parts[0])][] = isset($parts[1])
|
70 |
+
? trim($parts[1])
|
71 |
+
: null;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $headers;
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Returns a debug stream based on the provided variable.
|
79 |
+
*
|
80 |
+
* @param mixed $value Optional value
|
81 |
+
*
|
82 |
+
* @return resource
|
83 |
+
*/
|
84 |
+
function debug_resource($value = null)
|
85 |
+
{
|
86 |
+
if (is_resource($value)) {
|
87 |
+
return $value;
|
88 |
+
} elseif (defined('STDOUT')) {
|
89 |
+
return STDOUT;
|
90 |
+
}
|
91 |
+
|
92 |
+
return fopen('php://output', 'w');
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Chooses and creates a default handler to use based on the environment.
|
97 |
+
*
|
98 |
+
* The returned handler is not wrapped by any default middlewares.
|
99 |
+
*
|
100 |
+
* @return callable Returns the best handler for the given system.
|
101 |
+
* @throws \RuntimeException if no viable Handler is available.
|
102 |
+
*/
|
103 |
+
function choose_handler()
|
104 |
+
{
|
105 |
+
$handler = null;
|
106 |
+
if (function_exists('curl_multi_exec') && function_exists('curl_exec')) {
|
107 |
+
$handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
|
108 |
+
} elseif (function_exists('curl_exec')) {
|
109 |
+
$handler = new CurlHandler();
|
110 |
+
} elseif (function_exists('curl_multi_exec')) {
|
111 |
+
$handler = new CurlMultiHandler();
|
112 |
+
}
|
113 |
+
|
114 |
+
if (ini_get('allow_url_fopen')) {
|
115 |
+
$handler = $handler
|
116 |
+
? Proxy::wrapStreaming($handler, new StreamHandler())
|
117 |
+
: new StreamHandler();
|
118 |
+
} elseif (!$handler) {
|
119 |
+
throw new \RuntimeException('GuzzleHttp requires cURL, the '
|
120 |
+
. 'allow_url_fopen ini setting, or a custom HTTP handler.');
|
121 |
+
}
|
122 |
+
|
123 |
+
return $handler;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Get the default User-Agent string to use with Guzzle
|
128 |
+
*
|
129 |
+
* @return string
|
130 |
+
*/
|
131 |
+
function default_user_agent()
|
132 |
+
{
|
133 |
+
static $defaultAgent = '';
|
134 |
+
|
135 |
+
if (!$defaultAgent) {
|
136 |
+
$defaultAgent = 'GuzzleHttp/' . Client::VERSION;
|
137 |
+
if (extension_loaded('curl') && function_exists('curl_version')) {
|
138 |
+
$defaultAgent .= ' curl/' . \curl_version()['version'];
|
139 |
+
}
|
140 |
+
$defaultAgent .= ' PHP/' . PHP_VERSION;
|
141 |
+
}
|
142 |
+
|
143 |
+
return $defaultAgent;
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Returns the default cacert bundle for the current system.
|
148 |
+
*
|
149 |
+
* First, the openssl.cafile and curl.cainfo php.ini settings are checked.
|
150 |
+
* If those settings are not configured, then the common locations for
|
151 |
+
* bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X
|
152 |
+
* and Windows are checked. If any of these file locations are found on
|
153 |
+
* disk, they will be utilized.
|
154 |
+
*
|
155 |
+
* Note: the result of this function is cached for subsequent calls.
|
156 |
+
*
|
157 |
+
* @return string
|
158 |
+
* @throws \RuntimeException if no bundle can be found.
|
159 |
+
*/
|
160 |
+
function default_ca_bundle()
|
161 |
+
{
|
162 |
+
static $cached = null;
|
163 |
+
static $cafiles = [
|
164 |
+
// Red Hat, CentOS, Fedora (provided by the ca-certificates package)
|
165 |
+
'/etc/pki/tls/certs/ca-bundle.crt',
|
166 |
+
// Ubuntu, Debian (provided by the ca-certificates package)
|
167 |
+
'/etc/ssl/certs/ca-certificates.crt',
|
168 |
+
// FreeBSD (provided by the ca_root_nss package)
|
169 |
+
'/usr/local/share/certs/ca-root-nss.crt',
|
170 |
+
// SLES 12 (provided by the ca-certificates package)
|
171 |
+
'/var/lib/ca-certificates/ca-bundle.pem',
|
172 |
+
// OS X provided by homebrew (using the default path)
|
173 |
+
'/usr/local/etc/openssl/cert.pem',
|
174 |
+
// Google app engine
|
175 |
+
'/etc/ca-certificates.crt',
|
176 |
+
// Windows?
|
177 |
+
'C:\\windows\\system32\\curl-ca-bundle.crt',
|
178 |
+
'C:\\windows\\curl-ca-bundle.crt',
|
179 |
+
];
|
180 |
+
|
181 |
+
if ($cached) {
|
182 |
+
return $cached;
|
183 |
+
}
|
184 |
+
|
185 |
+
if ($ca = ini_get('openssl.cafile')) {
|
186 |
+
return $cached = $ca;
|
187 |
+
}
|
188 |
+
|
189 |
+
if ($ca = ini_get('curl.cainfo')) {
|
190 |
+
return $cached = $ca;
|
191 |
+
}
|
192 |
+
|
193 |
+
foreach ($cafiles as $filename) {
|
194 |
+
if (file_exists($filename)) {
|
195 |
+
return $cached = $filename;
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
throw new \RuntimeException(
|
200 |
+
<<< EOT
|
201 |
+
No system CA bundle could be found in any of the the common system locations.
|
202 |
+
PHP versions earlier than 5.6 are not properly configured to use the system's
|
203 |
+
CA bundle by default. In order to verify peer certificates, you will need to
|
204 |
+
supply the path on disk to a certificate bundle to the 'verify' request
|
205 |
+
option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not
|
206 |
+
need a specific certificate bundle, then Mozilla provides a commonly used CA
|
207 |
+
bundle which can be downloaded here (provided by the maintainer of cURL):
|
208 |
+
https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt. Once
|
209 |
+
you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP
|
210 |
+
ini setting to point to the path to the file, allowing you to omit the 'verify'
|
211 |
+
request option. See http://curl.haxx.se/docs/sslcerts.html for more
|
212 |
+
information.
|
213 |
+
EOT
|
214 |
+
);
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Creates an associative array of lowercase header names to the actual
|
219 |
+
* header casing.
|
220 |
+
*
|
221 |
+
* @param array $headers
|
222 |
+
*
|
223 |
+
* @return array
|
224 |
+
*/
|
225 |
+
function normalize_header_keys(array $headers)
|
226 |
+
{
|
227 |
+
$result = [];
|
228 |
+
foreach (array_keys($headers) as $key) {
|
229 |
+
$result[strtolower($key)] = $key;
|
230 |
+
}
|
231 |
+
|
232 |
+
return $result;
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* Returns true if the provided host matches any of the no proxy areas.
|
237 |
+
*
|
238 |
+
* This method will strip a port from the host if it is present. Each pattern
|
239 |
+
* can be matched with an exact match (e.g., "foo.com" == "foo.com") or a
|
240 |
+
* partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" ==
|
241 |
+
* "baz.foo.com", but ".foo.com" != "foo.com").
|
242 |
+
*
|
243 |
+
* Areas are matched in the following cases:
|
244 |
+
* 1. "*" (without quotes) always matches any hosts.
|
245 |
+
* 2. An exact match.
|
246 |
+
* 3. The area starts with "." and the area is the last part of the host. e.g.
|
247 |
+
* '.mit.edu' will match any host that ends with '.mit.edu'.
|
248 |
+
*
|
249 |
+
* @param string $host Host to check against the patterns.
|
250 |
+
* @param array $noProxyArray An array of host patterns.
|
251 |
+
*
|
252 |
+
* @return bool
|
253 |
+
*/
|
254 |
+
function is_host_in_noproxy($host, array $noProxyArray)
|
255 |
+
{
|
256 |
+
if (strlen($host) === 0) {
|
257 |
+
throw new \InvalidArgumentException('Empty host provided');
|
258 |
+
}
|
259 |
+
|
260 |
+
// Strip port if present.
|
261 |
+
if (strpos($host, ':')) {
|
262 |
+
$host = explode($host, ':', 2)[0];
|
263 |
+
}
|
264 |
+
|
265 |
+
foreach ($noProxyArray as $area) {
|
266 |
+
// Always match on wildcards.
|
267 |
+
if ($area === '*') {
|
268 |
+
return true;
|
269 |
+
} elseif (empty($area)) {
|
270 |
+
// Don't match on empty values.
|
271 |
+
continue;
|
272 |
+
} elseif ($area === $host) {
|
273 |
+
// Exact matches.
|
274 |
+
return true;
|
275 |
+
} else {
|
276 |
+
// Special match if the area when prefixed with ".". Remove any
|
277 |
+
// existing leading "." and add a new leading ".".
|
278 |
+
$area = '.' . ltrim($area, '.');
|
279 |
+
if (substr($host, -(strlen($area))) === $area) {
|
280 |
+
return true;
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
return false;
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Wrapper for json_decode that throws when an error occurs.
|
290 |
+
*
|
291 |
+
* @param string $json JSON data to parse
|
292 |
+
* @param bool $assoc When true, returned objects will be converted
|
293 |
+
* into associative arrays.
|
294 |
+
* @param int $depth User specified recursion depth.
|
295 |
+
* @param int $options Bitmask of JSON decode options.
|
296 |
+
*
|
297 |
+
* @return mixed
|
298 |
+
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
|
299 |
+
* @link http://www.php.net/manual/en/function.json-decode.php
|
300 |
+
*/
|
301 |
+
function json_decode($json, $assoc = false, $depth = 512, $options = 0)
|
302 |
+
{
|
303 |
+
$data = \json_decode($json, $assoc, $depth, $options);
|
304 |
+
if (JSON_ERROR_NONE !== json_last_error()) {
|
305 |
+
throw new Exception\InvalidArgumentException(
|
306 |
+
'json_decode error: ' . json_last_error_msg()
|
307 |
+
);
|
308 |
+
}
|
309 |
+
|
310 |
+
return $data;
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* Wrapper for JSON encoding that throws when an error occurs.
|
315 |
+
*
|
316 |
+
* @param mixed $value The value being encoded
|
317 |
+
* @param int $options JSON encode option bitmask
|
318 |
+
* @param int $depth Set the maximum depth. Must be greater than zero.
|
319 |
+
*
|
320 |
+
* @return string
|
321 |
+
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
|
322 |
+
* @link http://www.php.net/manual/en/function.json-encode.php
|
323 |
+
*/
|
324 |
+
function json_encode($value, $options = 0, $depth = 512)
|
325 |
+
{
|
326 |
+
$json = \json_encode($value, $options, $depth);
|
327 |
+
if (JSON_ERROR_NONE !== json_last_error()) {
|
328 |
+
throw new Exception\InvalidArgumentException(
|
329 |
+
'json_encode error: ' . json_last_error_msg()
|
330 |
+
);
|
331 |
+
}
|
332 |
+
|
333 |
+
return $json;
|
334 |
+
}
|
vendor/guzzlehttp/guzzle/src/functions_include.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Don't redefine the functions if included multiple times.
|
4 |
+
if (!function_exists('GuzzleHttp\uri_template')) {
|
5 |
+
require __DIR__ . '/functions.php';
|
6 |
+
}
|
vendor/guzzlehttp/promises/CHANGELOG.md
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# CHANGELOG
|
2 |
+
|
3 |
+
|
4 |
+
## 1.3.1 - 2016-12-20
|
5 |
+
|
6 |
+
### Fixed
|
7 |
+
|
8 |
+
- `wait()` foreign promise compatibility
|
9 |
+
|
10 |
+
|
11 |
+
## 1.3.0 - 2016-11-18
|
12 |
+
|
13 |
+
### Added
|
14 |
+
|
15 |
+
- Adds support for custom task queues.
|
16 |
+
|
17 |
+
### Fixed
|
18 |
+
|
19 |
+
- Fixed coroutine promise memory leak.
|
20 |
+
|
21 |
+
|
22 |
+
## 1.2.0 - 2016-05-18
|
23 |
+
|
24 |
+
### Changed
|
25 |
+
|
26 |
+
- Update to now catch `\Throwable` on PHP 7+
|
27 |
+
|
28 |
+
|
29 |
+
## 1.1.0 - 2016-03-07
|
30 |
+
|
31 |
+
### Changed
|
32 |
+
|
33 |
+
- Update EachPromise to prevent recurring on a iterator when advancing, as this
|
34 |
+
could trigger fatal generator errors.
|
35 |
+
- Update Promise to allow recursive waiting without unwrapping exceptions.
|
36 |
+
|
37 |
+
|
38 |
+
## 1.0.3 - 2015-10-15
|
39 |
+
|
40 |
+
### Changed
|
41 |
+
|
42 |
+
- Update EachPromise to immediately resolve when the underlying promise iterator
|
43 |
+
is empty. Previously, such a promise would throw an exception when its `wait`
|
44 |
+
function was called.
|
45 |
+
|
46 |
+
|
47 |
+
## 1.0.2 - 2015-05-15
|
48 |
+
|
49 |
+
### Changed
|
50 |
+
|
51 |
+
- Conditionally require functions.php.
|
52 |
+
|
53 |
+
|
54 |
+
## 1.0.1 - 2015-06-24
|
55 |
+
|
56 |
+
### Changed
|
57 |
+
|
58 |
+
- Updating EachPromise to call next on the underlying promise iterator as late
|
59 |
+
as possible to ensure that generators that generate new requests based on
|
60 |
+
callbacks are not iterated until after callbacks are invoked.
|
61 |
+
|
62 |
+
|
63 |
+
## 1.0.0 - 2015-05-12
|
64 |
+
|
65 |
+
- Initial release
|
vendor/guzzlehttp/promises/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
of this software and associated documentation files (the "Software"), to deal
|
5 |
+
in the Software without restriction, including without limitation the rights
|
6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
copies of the Software, and to permit persons to whom the Software is
|
8 |
+
furnished to do so, subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in
|
11 |
+
all copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
+
THE SOFTWARE.
|
vendor/guzzlehttp/promises/Makefile
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
all: clean test
|
2 |
+
|
3 |
+
test:
|
4 |
+
vendor/bin/phpunit
|
5 |
+
|
6 |
+
coverage:
|
7 |
+
vendor/bin/phpunit --coverage-html=artifacts/coverage
|
8 |
+
|
9 |
+
view-coverage:
|
10 |
+
open artifacts/coverage/index.html
|
11 |
+
|
12 |
+
clean:
|
13 |
+
rm -rf artifacts/*
|
vendor/guzzlehttp/promises/README.md
ADDED
@@ -0,0 +1,504 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Guzzle Promises
|
2 |
+
|
3 |
+
[Promises/A+](https://promisesaplus.com/) implementation that handles promise
|
4 |
+
chaining and resolution iteratively, allowing for "infinite" promise chaining
|
5 |
+
while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/)
|
6 |
+
for a general introduction to promises.
|
7 |
+
|
8 |
+
- [Features](#features)
|
9 |
+
- [Quick start](#quick-start)
|
10 |
+
- [Synchronous wait](#synchronous-wait)
|
11 |
+
- [Cancellation](#cancellation)
|
12 |
+
- [API](#api)
|
13 |
+
- [Promise](#promise)
|
14 |
+
- [FulfilledPromise](#fulfilledpromise)
|
15 |
+
- [RejectedPromise](#rejectedpromise)
|
16 |
+
- [Promise interop](#promise-interop)
|
17 |
+
- [Implementation notes](#implementation-notes)
|
18 |
+
|
19 |
+
|
20 |
+
# Features
|
21 |
+
|
22 |
+
- [Promises/A+](https://promisesaplus.com/) implementation.
|
23 |
+
- Promise resolution and chaining is handled iteratively, allowing for
|
24 |
+
"infinite" promise chaining.
|
25 |
+
- Promises have a synchronous `wait` method.
|
26 |
+
- Promises can be cancelled.
|
27 |
+
- Works with any object that has a `then` function.
|
28 |
+
- C# style async/await coroutine promises using
|
29 |
+
`GuzzleHttp\Promise\coroutine()`.
|
30 |
+
|
31 |
+
|
32 |
+
# Quick start
|
33 |
+
|
34 |
+
A *promise* represents the eventual result of an asynchronous operation. The
|
35 |
+
primary way of interacting with a promise is through its `then` method, which
|
36 |
+
registers callbacks to receive either a promise's eventual value or the reason
|
37 |
+
why the promise cannot be fulfilled.
|
38 |
+
|
39 |
+
|
40 |
+
## Callbacks
|
41 |
+
|
42 |
+
Callbacks are registered with the `then` method by providing an optional
|
43 |
+
`$onFulfilled` followed by an optional `$onRejected` function.
|
44 |
+
|
45 |
+
|
46 |
+
```php
|
47 |
+
use GuzzleHttp\Promise\Promise;
|
48 |
+
|
49 |
+
$promise = new Promise();
|
50 |
+
$promise->then(
|
51 |
+
// $onFulfilled
|
52 |
+
function ($value) {
|
53 |
+
echo 'The promise was fulfilled.';
|
54 |
+
},
|
55 |
+
// $onRejected
|
56 |
+
function ($reason) {
|
57 |
+
echo 'The promise was rejected.';
|
58 |
+
}
|
59 |
+
);
|
60 |
+
```
|
61 |
+
|
62 |
+
*Resolving* a promise means that you either fulfill a promise with a *value* or
|
63 |
+
reject a promise with a *reason*. Resolving a promises triggers callbacks
|
64 |
+
registered with the promises's `then` method. These callbacks are triggered
|
65 |
+
only once and in the order in which they were added.
|
66 |
+
|
67 |
+
|
68 |
+
## Resolving a promise
|
69 |
+
|
70 |
+
Promises are fulfilled using the `resolve($value)` method. Resolving a promise
|
71 |
+
with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
|
72 |
+
all of the onFulfilled callbacks (resolving a promise with a rejected promise
|
73 |
+
will reject the promise and trigger the `$onRejected` callbacks).
|
74 |
+
|
75 |
+
```php
|
76 |
+
use GuzzleHttp\Promise\Promise;
|
77 |
+
|
78 |
+
$promise = new Promise();
|
79 |
+
$promise
|
80 |
+
->then(function ($value) {
|
81 |
+
// Return a value and don't break the chain
|
82 |
+
return "Hello, " . $value;
|
83 |
+
})
|
84 |
+
// This then is executed after the first then and receives the value
|
85 |
+
// returned from the first then.
|
86 |
+
->then(function ($value) {
|
87 |
+
echo $value;
|
88 |
+
});
|
89 |
+
|
90 |
+
// Resolving the promise triggers the $onFulfilled callbacks and outputs
|
91 |
+
// "Hello, reader".
|
92 |
+
$promise->resolve('reader.');
|
93 |
+
```
|
94 |
+
|
95 |
+
|
96 |
+
## Promise forwarding
|
97 |
+
|
98 |
+
Promises can be chained one after the other. Each then in the chain is a new
|
99 |
+
promise. The return value of a promise is what's forwarded to the next
|
100 |
+
promise in the chain. Returning a promise in a `then` callback will cause the
|
101 |
+
subsequent promises in the chain to only be fulfilled when the returned promise
|
102 |
+
has been fulfilled. The next promise in the chain will be invoked with the
|
103 |
+
resolved value of the promise.
|
104 |
+
|
105 |
+
```php
|
106 |
+
use GuzzleHttp\Promise\Promise;
|
107 |
+
|
108 |
+
$promise = new Promise();
|
109 |
+
$nextPromise = new Promise();
|
110 |
+
|
111 |
+
$promise
|
112 |
+
->then(function ($value) use ($nextPromise) {
|
113 |
+
echo $value;
|
114 |
+
return $nextPromise;
|
115 |
+
})
|
116 |
+
->then(function ($value) {
|
117 |
+
echo $value;
|
118 |
+
});
|
119 |
+
|
120 |
+
// Triggers the first callback and outputs "A"
|
121 |
+
$promise->resolve('A');
|
122 |
+
// Triggers the second callback and outputs "B"
|
123 |
+
$nextPromise->resolve('B');
|
124 |
+
```
|
125 |
+
|
126 |
+
## Promise rejection
|
127 |
+
|
128 |
+
When a promise is rejected, the `$onRejected` callbacks are invoked with the
|
129 |
+
rejection reason.
|
130 |
+
|
131 |
+
```php
|
132 |
+
use GuzzleHttp\Promise\Promise;
|
133 |
+
|
134 |
+
$promise = new Promise();
|
135 |
+
$promise->then(null, function ($reason) {
|
136 |
+
echo $reason;
|
137 |
+
});
|
138 |
+
|
139 |
+
$promise->reject('Error!');
|
140 |
+
// Outputs "Error!"
|
141 |
+
```
|
142 |
+
|
143 |
+
## Rejection forwarding
|
144 |
+
|
145 |
+
If an exception is thrown in an `$onRejected` callback, subsequent
|
146 |
+
`$onRejected` callbacks are invoked with the thrown exception as the reason.
|
147 |
+
|
148 |
+
```php
|
149 |
+
use GuzzleHttp\Promise\Promise;
|
150 |
+
|
151 |
+
$promise = new Promise();
|
152 |
+
$promise->then(null, function ($reason) {
|
153 |
+
throw new \Exception($reason);
|
154 |
+
})->then(null, function ($reason) {
|
155 |
+
assert($reason->getMessage() === 'Error!');
|
156 |
+
});
|
157 |
+
|
158 |
+
$promise->reject('Error!');
|
159 |
+
```
|
160 |
+
|
161 |
+
You can also forward a rejection down the promise chain by returning a
|
162 |
+
`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or
|
163 |
+
`$onRejected` callback.
|
164 |
+
|
165 |
+
```php
|
166 |
+
use GuzzleHttp\Promise\Promise;
|
167 |
+
use GuzzleHttp\Promise\RejectedPromise;
|
168 |
+
|
169 |
+
$promise = new Promise();
|
170 |
+
$promise->then(null, function ($reason) {
|
171 |
+
return new RejectedPromise($reason);
|
172 |
+
})->then(null, function ($reason) {
|
173 |
+
assert($reason === 'Error!');
|
174 |
+
});
|
175 |
+
|
176 |
+
$promise->reject('Error!');
|
177 |
+
```
|
178 |
+
|
179 |
+
If an exception is not thrown in a `$onRejected` callback and the callback
|
180 |
+
does not return a rejected promise, downstream `$onFulfilled` callbacks are
|
181 |
+
invoked using the value returned from the `$onRejected` callback.
|
182 |
+
|
183 |
+
```php
|
184 |
+
use GuzzleHttp\Promise\Promise;
|
185 |
+
use GuzzleHttp\Promise\RejectedPromise;
|
186 |
+
|
187 |
+
$promise = new Promise();
|
188 |
+
$promise
|
189 |
+
->then(null, function ($reason) {
|
190 |
+
return "It's ok";
|
191 |
+
})
|
192 |
+
->then(function ($value) {
|
193 |
+
assert($value === "It's ok");
|
194 |
+
});
|
195 |
+
|
196 |
+
$promise->reject('Error!');
|
197 |
+
```
|
198 |
+
|
199 |
+
# Synchronous wait
|
200 |
+
|
201 |
+
You can synchronously force promises to complete using a promise's `wait`
|
202 |
+
method. When creating a promise, you can provide a wait function that is used
|
203 |
+
to synchronously force a promise to complete. When a wait function is invoked
|
204 |
+
it is expected to deliver a value to the promise or reject the promise. If the
|
205 |
+
wait function does not deliver a value, then an exception is thrown. The wait
|
206 |
+
function provided to a promise constructor is invoked when the `wait` function
|
207 |
+
of the promise is called.
|
208 |
+
|
209 |
+
```php
|
210 |
+
$promise = new Promise(function () use (&$promise) {
|
211 |
+
$promise->resolve('foo');
|
212 |
+
});
|
213 |
+
|
214 |
+
// Calling wait will return the value of the promise.
|
215 |
+
echo $promise->wait(); // outputs "foo"
|
216 |
+
```
|
217 |
+
|
218 |
+
If an exception is encountered while invoking the wait function of a promise,
|
219 |
+
the promise is rejected with the exception and the exception is thrown.
|
220 |
+
|
221 |
+
```php
|
222 |
+
$promise = new Promise(function () use (&$promise) {
|
223 |
+
throw new \Exception('foo');
|
224 |
+
});
|
225 |
+
|
226 |
+
$promise->wait(); // throws the exception.
|
227 |
+
```
|
228 |
+
|
229 |
+
Calling `wait` on a promise that has been fulfilled will not trigger the wait
|
230 |
+
function. It will simply return the previously resolved value.
|
231 |
+
|
232 |
+
```php
|
233 |
+
$promise = new Promise(function () { die('this is not called!'); });
|
234 |
+
$promise->resolve('foo');
|
235 |
+
echo $promise->wait(); // outputs "foo"
|
236 |
+
```
|
237 |
+
|
238 |
+
Calling `wait` on a promise that has been rejected will throw an exception. If
|
239 |
+
the rejection reason is an instance of `\Exception` the reason is thrown.
|
240 |
+
Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason
|
241 |
+
can be obtained by calling the `getReason` method of the exception.
|
242 |
+
|
243 |
+
```php
|
244 |
+
$promise = new Promise();
|
245 |
+
$promise->reject('foo');
|
246 |
+
$promise->wait();
|
247 |
+
```
|
248 |
+
|
249 |
+
> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo'
|
250 |
+
|
251 |
+
|
252 |
+
## Unwrapping a promise
|
253 |
+
|
254 |
+
When synchronously waiting on a promise, you are joining the state of the
|
255 |
+
promise into the current state of execution (i.e., return the value of the
|
256 |
+
promise if it was fulfilled or throw an exception if it was rejected). This is
|
257 |
+
called "unwrapping" the promise. Waiting on a promise will by default unwrap
|
258 |
+
the promise state.
|
259 |
+
|
260 |
+
You can force a promise to resolve and *not* unwrap the state of the promise
|
261 |
+
by passing `false` to the first argument of the `wait` function:
|
262 |
+
|
263 |
+
```php
|
264 |
+
$promise = new Promise();
|
265 |
+
$promise->reject('foo');
|
266 |
+
// This will not throw an exception. It simply ensures the promise has
|
267 |
+
// been resolved.
|
268 |
+
$promise->wait(false);
|
269 |
+
```
|
270 |
+
|
271 |
+
When unwrapping a promise, the resolved value of the promise will be waited
|
272 |
+
upon until the unwrapped value is not a promise. This means that if you resolve
|
273 |
+
promise A with a promise B and unwrap promise A, the value returned by the
|
274 |
+
wait function will be the value delivered to promise B.
|
275 |
+
|
276 |
+
**Note**: when you do not unwrap the promise, no value is returned.
|
277 |
+
|
278 |
+
|
279 |
+
# Cancellation
|
280 |
+
|
281 |
+
You can cancel a promise that has not yet been fulfilled using the `cancel()`
|
282 |
+
method of a promise. When creating a promise you can provide an optional
|
283 |
+
cancel function that when invoked cancels the action of computing a resolution
|
284 |
+
of the promise.
|
285 |
+
|
286 |
+
|
287 |
+
# API
|
288 |
+
|
289 |
+
|
290 |
+
## Promise
|
291 |
+
|
292 |
+
When creating a promise object, you can provide an optional `$waitFn` and
|
293 |
+
`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
|
294 |
+
expected to resolve the promise. `$cancelFn` is a function with no arguments
|
295 |
+
that is expected to cancel the computation of a promise. It is invoked when the
|
296 |
+
`cancel()` method of a promise is called.
|
297 |
+
|
298 |
+
```php
|
299 |
+
use GuzzleHttp\Promise\Promise;
|
300 |
+
|
301 |
+
$promise = new Promise(
|
302 |
+
function () use (&$promise) {
|
303 |
+
$promise->resolve('waited');
|
304 |
+
},
|
305 |
+
function () {
|
306 |
+
// do something that will cancel the promise computation (e.g., close
|
307 |
+
// a socket, cancel a database query, etc...)
|
308 |
+
}
|
309 |
+
);
|
310 |
+
|
311 |
+
assert('waited' === $promise->wait());
|
312 |
+
```
|
313 |
+
|
314 |
+
A promise has the following methods:
|
315 |
+
|
316 |
+
- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface`
|
317 |
+
|
318 |
+
Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
|
319 |
+
|
320 |
+
- `otherwise(callable $onRejected) : PromiseInterface`
|
321 |
+
|
322 |
+
Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
|
323 |
+
|
324 |
+
- `wait($unwrap = true) : mixed`
|
325 |
+
|
326 |
+
Synchronously waits on the promise to complete.
|
327 |
+
|
328 |
+
`$unwrap` controls whether or not the value of the promise is returned for a
|
329 |
+
fulfilled promise or if an exception is thrown if the promise is rejected.
|
330 |
+
This is set to `true` by default.
|
331 |
+
|
332 |
+
- `cancel()`
|
333 |
+
|
334 |
+
Attempts to cancel the promise if possible. The promise being cancelled and
|
335 |
+
the parent most ancestor that has not yet been resolved will also be
|
336 |
+
cancelled. Any promises waiting on the cancelled promise to resolve will also
|
337 |
+
be cancelled.
|
338 |
+
|
339 |
+
- `getState() : string`
|
340 |
+
|
341 |
+
Returns the state of the promise. One of `pending`, `fulfilled`, or
|
342 |
+
`rejected`.
|
343 |
+
|
344 |
+
- `resolve($value)`
|
345 |
+
|
346 |
+
Fulfills the promise with the given `$value`.
|
347 |
+
|
348 |
+
- `reject($reason)`
|
349 |
+
|
350 |
+
Rejects the promise with the given `$reason`.
|
351 |
+
|
352 |
+
|
353 |
+
## FulfilledPromise
|
354 |
+
|
355 |
+
A fulfilled promise can be created to represent a promise that has been
|
356 |
+
fulfilled.
|
357 |
+
|
358 |
+
```php
|
359 |
+
use GuzzleHttp\Promise\FulfilledPromise;
|
360 |
+
|
361 |
+
$promise = new FulfilledPromise('value');
|
362 |
+
|
363 |
+
// Fulfilled callbacks are immediately invoked.
|
364 |
+
$promise->then(function ($value) {
|
365 |
+
echo $value;
|
366 |
+
});
|
367 |
+
```
|
368 |
+
|
369 |
+
|
370 |
+
## RejectedPromise
|
371 |
+
|
372 |
+
A rejected promise can be created to represent a promise that has been
|
373 |
+
rejected.
|
374 |
+
|
375 |
+
```php
|
376 |
+
use GuzzleHttp\Promise\RejectedPromise;
|
377 |
+
|
378 |
+
$promise = new RejectedPromise('Error');
|
379 |
+
|
380 |
+
// Rejected callbacks are immediately invoked.
|
381 |
+
$promise->then(null, function ($reason) {
|
382 |
+
echo $reason;
|
383 |
+
});
|
384 |
+
```
|
385 |
+
|
386 |
+
|
387 |
+
# Promise interop
|
388 |
+
|
389 |
+
This library works with foreign promises that have a `then` method. This means
|
390 |
+
you can use Guzzle promises with [React promises](https://github.com/reactphp/promise)
|
391 |
+
for example. When a foreign promise is returned inside of a then method
|
392 |
+
callback, promise resolution will occur recursively.
|
393 |
+
|
394 |
+
```php
|
395 |
+
// Create a React promise
|
396 |
+
$deferred = new React\Promise\Deferred();
|
397 |
+
$reactPromise = $deferred->promise();
|
398 |
+
|
399 |
+
// Create a Guzzle promise that is fulfilled with a React promise.
|
400 |
+
$guzzlePromise = new \GuzzleHttp\Promise\Promise();
|
401 |
+
$guzzlePromise->then(function ($value) use ($reactPromise) {
|
402 |
+
// Do something something with the value...
|
403 |
+
// Return the React promise
|
404 |
+
return $reactPromise;
|
405 |
+
});
|
406 |
+
```
|
407 |
+
|
408 |
+
Please note that wait and cancel chaining is no longer possible when forwarding
|
409 |
+
a foreign promise. You will need to wrap a third-party promise with a Guzzle
|
410 |
+
promise in order to utilize wait and cancel functions with foreign promises.
|
411 |
+
|
412 |
+
|
413 |
+
## Event Loop Integration
|
414 |
+
|
415 |
+
In order to keep the stack size constant, Guzzle promises are resolved
|
416 |
+
asynchronously using a task queue. When waiting on promises synchronously, the
|
417 |
+
task queue will be automatically run to ensure that the blocking promise and
|
418 |
+
any forwarded promises are resolved. When using promises asynchronously in an
|
419 |
+
event loop, you will need to run the task queue on each tick of the loop. If
|
420 |
+
you do not run the task queue, then promises will not be resolved.
|
421 |
+
|
422 |
+
You can run the task queue using the `run()` method of the global task queue
|
423 |
+
instance.
|
424 |
+
|
425 |
+
```php
|
426 |
+
// Get the global task queue
|
427 |
+
$queue = \GuzzleHttp\Promise\queue();
|
428 |
+
$queue->run();
|
429 |
+
```
|
430 |
+
|
431 |
+
For example, you could use Guzzle promises with React using a periodic timer:
|
432 |
+
|
433 |
+
```php
|
434 |
+
$loop = React\EventLoop\Factory::create();
|
435 |
+
$loop->addPeriodicTimer(0, [$queue, 'run']);
|
436 |
+
```
|
437 |
+
|
438 |
+
*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
|
439 |
+
|
440 |
+
|
441 |
+
# Implementation notes
|
442 |
+
|
443 |
+
|
444 |
+
## Promise resolution and chaining is handled iteratively
|
445 |
+
|
446 |
+
By shuffling pending handlers from one owner to another, promises are
|
447 |
+
resolved iteratively, allowing for "infinite" then chaining.
|
448 |
+
|
449 |
+
```php
|
450 |
+
<?php
|
451 |
+
require 'vendor/autoload.php';
|
452 |
+
|
453 |
+
use GuzzleHttp\Promise\Promise;
|
454 |
+
|
455 |
+
$parent = new Promise();
|
456 |
+
$p = $parent;
|
457 |
+
|
458 |
+
for ($i = 0; $i < 1000; $i++) {
|
459 |
+
$p = $p->then(function ($v) {
|
460 |
+
// The stack size remains constant (a good thing)
|
461 |
+
echo xdebug_get_stack_depth() . ', ';
|
462 |
+
return $v + 1;
|
463 |
+
});
|
464 |
+
}
|
465 |
+
|
466 |
+
$parent->resolve(0);
|
467 |
+
var_dump($p->wait()); // int(1000)
|
468 |
+
|
469 |
+
```
|
470 |
+
|
471 |
+
When a promise is fulfilled or rejected with a non-promise value, the promise
|
472 |
+
then takes ownership of the handlers of each child promise and delivers values
|
473 |
+
down the chain without using recursion.
|
474 |
+
|
475 |
+
When a promise is resolved with another promise, the original promise transfers
|
476 |
+
all of its pending handlers to the new promise. When the new promise is
|
477 |
+
eventually resolved, all of the pending handlers are delivered the forwarded
|
478 |
+
value.
|
479 |
+
|
480 |
+
|
481 |
+
## A promise is the deferred.
|
482 |
+
|
483 |
+
Some promise libraries implement promises using a deferred object to represent
|
484 |
+
a computation and a promise object to represent the delivery of the result of
|
485 |
+
the computation. This is a nice separation of computation and delivery because
|
486 |
+
consumers of the promise cannot modify the value that will be eventually
|
487 |
+
delivered.
|
488 |
+
|
489 |
+
One side effect of being able to implement promise resolution and chaining
|
490 |
+
iteratively is that you need to be able for one promise to reach into the state
|
491 |
+
of another promise to shuffle around ownership of handlers. In order to achieve
|
492 |
+
this without making the handlers of a promise publicly mutable, a promise is
|
493 |
+
also the deferred value, allowing promises of the same parent class to reach
|
494 |
+
into and modify the private properties of promises of the same type. While this
|
495 |
+
does allow consumers of the value to modify the resolution or rejection of the
|
496 |
+
deferred, it is a small price to pay for keeping the stack size constant.
|
497 |
+
|
498 |
+
```php
|
499 |
+
$promise = new Promise();
|
500 |
+
$promise->then(function ($value) { echo $value; });
|
501 |
+
// The promise is the deferred value, so you can deliver a value to it.
|
502 |
+
$promise->resolve('foo');
|
503 |
+
// prints "foo"
|
504 |
+
```
|
vendor/guzzlehttp/promises/composer.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "guzzlehttp/promises",
|
3 |
+
"description": "Guzzle promises library",
|
4 |
+
"keywords": ["promise"],
|
5 |
+
"license": "MIT",
|
6 |
+
"authors": [
|
7 |
+
{
|
8 |
+
"name": "Michael Dowling",
|
9 |
+
"email": "mtdowling@gmail.com",
|
10 |
+
"homepage": "https://github.com/mtdowling"
|
11 |
+
}
|
12 |
+
],
|
13 |
+
"require": {
|
14 |
+
"php": ">=5.5.0"
|
15 |
+
},
|
16 |
+
"require-dev": {
|
17 |
+
"phpunit/phpunit": "^4.0"
|
18 |
+
},
|
19 |
+
"autoload": {
|
20 |
+
"psr-4": {
|
21 |
+
"GuzzleHttp\\Promise\\": "src/"
|
22 |
+
},
|
23 |
+
"files": ["src/functions_include.php"]
|
24 |
+
},
|
25 |
+
"scripts": {
|
26 |
+
"test": "vendor/bin/phpunit",
|
27 |
+
"test-ci": "vendor/bin/phpunit --coverage-text"
|
28 |
+
},
|
29 |
+
"extra": {
|
30 |
+
"branch-alias": {
|
31 |
+
"dev-master": "1.4-dev"
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
vendor/guzzlehttp/promises/src/AggregateException.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Exception thrown when too many errors occur in the some() or any() methods.
|
6 |
+
*/
|
7 |
+
class AggregateException extends RejectionException
|
8 |
+
{
|
9 |
+
public function __construct($msg, array $reasons)
|
10 |
+
{
|
11 |
+
parent::__construct(
|
12 |
+
$reasons,
|
13 |
+
sprintf('%s; %d rejected promises', $msg, count($reasons))
|
14 |
+
);
|
15 |
+
}
|
16 |
+
}
|
vendor/guzzlehttp/promises/src/CancellationException.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Exception that is set as the reason for a promise that has been cancelled.
|
6 |
+
*/
|
7 |
+
class CancellationException extends RejectionException
|
8 |
+
{
|
9 |
+
}
|
vendor/guzzlehttp/promises/src/Coroutine.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
use Exception;
|
5 |
+
use Generator;
|
6 |
+
use Throwable;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Creates a promise that is resolved using a generator that yields values or
|
10 |
+
* promises (somewhat similar to C#'s async keyword).
|
11 |
+
*
|
12 |
+
* When called, the coroutine function will start an instance of the generator
|
13 |
+
* and returns a promise that is fulfilled with its final yielded value.
|
14 |
+
*
|
15 |
+
* Control is returned back to the generator when the yielded promise settles.
|
16 |
+
* This can lead to less verbose code when doing lots of sequential async calls
|
17 |
+
* with minimal processing in between.
|
18 |
+
*
|
19 |
+
* use GuzzleHttp\Promise;
|
20 |
+
*
|
21 |
+
* function createPromise($value) {
|
22 |
+
* return new Promise\FulfilledPromise($value);
|
23 |
+
* }
|
24 |
+
*
|
25 |
+
* $promise = Promise\coroutine(function () {
|
26 |
+
* $value = (yield createPromise('a'));
|
27 |
+
* try {
|
28 |
+
* $value = (yield createPromise($value . 'b'));
|
29 |
+
* } catch (\Exception $e) {
|
30 |
+
* // The promise was rejected.
|
31 |
+
* }
|
32 |
+
* yield $value . 'c';
|
33 |
+
* });
|
34 |
+
*
|
35 |
+
* // Outputs "abc"
|
36 |
+
* $promise->then(function ($v) { echo $v; });
|
37 |
+
*
|
38 |
+
* @param callable $generatorFn Generator function to wrap into a promise.
|
39 |
+
*
|
40 |
+
* @return Promise
|
41 |
+
* @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration
|
42 |
+
*/
|
43 |
+
final class Coroutine implements PromiseInterface
|
44 |
+
{
|
45 |
+
/**
|
46 |
+
* @var PromiseInterface|null
|
47 |
+
*/
|
48 |
+
private $currentPromise;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* @var Generator
|
52 |
+
*/
|
53 |
+
private $generator;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* @var Promise
|
57 |
+
*/
|
58 |
+
private $result;
|
59 |
+
|
60 |
+
public function __construct(callable $generatorFn)
|
61 |
+
{
|
62 |
+
$this->generator = $generatorFn();
|
63 |
+
$this->result = new Promise(function () {
|
64 |
+
while (isset($this->currentPromise)) {
|
65 |
+
$this->currentPromise->wait();
|
66 |
+
}
|
67 |
+
});
|
68 |
+
$this->nextCoroutine($this->generator->current());
|
69 |
+
}
|
70 |
+
|
71 |
+
public function then(
|
72 |
+
callable $onFulfilled = null,
|
73 |
+
callable $onRejected = null
|
74 |
+
) {
|
75 |
+
return $this->result->then($onFulfilled, $onRejected);
|
76 |
+
}
|
77 |
+
|
78 |
+
public function otherwise(callable $onRejected)
|
79 |
+
{
|
80 |
+
return $this->result->otherwise($onRejected);
|
81 |
+
}
|
82 |
+
|
83 |
+
public function wait($unwrap = true)
|
84 |
+
{
|
85 |
+
return $this->result->wait($unwrap);
|
86 |
+
}
|
87 |
+
|
88 |
+
public function getState()
|
89 |
+
{
|
90 |
+
return $this->result->getState();
|
91 |
+
}
|
92 |
+
|
93 |
+
public function resolve($value)
|
94 |
+
{
|
95 |
+
$this->result->resolve($value);
|
96 |
+
}
|
97 |
+
|
98 |
+
public function reject($reason)
|
99 |
+
{
|
100 |
+
$this->result->reject($reason);
|
101 |
+
}
|
102 |
+
|
103 |
+
public function cancel()
|
104 |
+
{
|
105 |
+
$this->currentPromise->cancel();
|
106 |
+
$this->result->cancel();
|
107 |
+
}
|
108 |
+
|
109 |
+
private function nextCoroutine($yielded)
|
110 |
+
{
|
111 |
+
$this->currentPromise = promise_for($yielded)
|
112 |
+
->then([$this, '_handleSuccess'], [$this, '_handleFailure']);
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* @internal
|
117 |
+
*/
|
118 |
+
public function _handleSuccess($value)
|
119 |
+
{
|
120 |
+
unset($this->currentPromise);
|
121 |
+
try {
|
122 |
+
$next = $this->generator->send($value);
|
123 |
+
if ($this->generator->valid()) {
|
124 |
+
$this->nextCoroutine($next);
|
125 |
+
} else {
|
126 |
+
$this->result->resolve($value);
|
127 |
+
}
|
128 |
+
} catch (Exception $exception) {
|
129 |
+
$this->result->reject($exception);
|
130 |
+
} catch (Throwable $throwable) {
|
131 |
+
$this->result->reject($throwable);
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* @internal
|
137 |
+
*/
|
138 |
+
public function _handleFailure($reason)
|
139 |
+
{
|
140 |
+
unset($this->currentPromise);
|
141 |
+
try {
|
142 |
+
$nextYield = $this->generator->throw(exception_for($reason));
|
143 |
+
// The throw was caught, so keep iterating on the coroutine
|
144 |
+
$this->nextCoroutine($nextYield);
|
145 |
+
} catch (Exception $exception) {
|
146 |
+
$this->result->reject($exception);
|
147 |
+
} catch (Throwable $throwable) {
|
148 |
+
$this->result->reject($throwable);
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
vendor/guzzlehttp/promises/src/EachPromise.php
ADDED
@@ -0,0 +1,229 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Represents a promise that iterates over many promises and invokes
|
6 |
+
* side-effect functions in the process.
|
7 |
+
*/
|
8 |
+
class EachPromise implements PromisorInterface
|
9 |
+
{
|
10 |
+
private $pending = [];
|
11 |
+
|
12 |
+
/** @var \Iterator */
|
13 |
+
private $iterable;
|
14 |
+
|
15 |
+
/** @var callable|int */
|
16 |
+
private $concurrency;
|
17 |
+
|
18 |
+
/** @var callable */
|
19 |
+
private $onFulfilled;
|
20 |
+
|
21 |
+
/** @var callable */
|
22 |
+
private $onRejected;
|
23 |
+
|
24 |
+
/** @var Promise */
|
25 |
+
private $aggregate;
|
26 |
+
|
27 |
+
/** @var bool */
|
28 |
+
private $mutex;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Configuration hash can include the following key value pairs:
|
32 |
+
*
|
33 |
+
* - fulfilled: (callable) Invoked when a promise fulfills. The function
|
34 |
+
* is invoked with three arguments: the fulfillment value, the index
|
35 |
+
* position from the iterable list of the promise, and the aggregate
|
36 |
+
* promise that manages all of the promises. The aggregate promise may
|
37 |
+
* be resolved from within the callback to short-circuit the promise.
|
38 |
+
* - rejected: (callable) Invoked when a promise is rejected. The
|
39 |
+
* function is invoked with three arguments: the rejection reason, the
|
40 |
+
* index position from the iterable list of the promise, and the
|
41 |
+
* aggregate promise that manages all of the promises. The aggregate
|
42 |
+
* promise may be resolved from within the callback to short-circuit
|
43 |
+
* the promise.
|
44 |
+
* - concurrency: (integer) Pass this configuration option to limit the
|
45 |
+
* allowed number of outstanding concurrently executing promises,
|
46 |
+
* creating a capped pool of promises. There is no limit by default.
|
47 |
+
*
|
48 |
+
* @param mixed $iterable Promises or values to iterate.
|
49 |
+
* @param array $config Configuration options
|
50 |
+
*/
|
51 |
+
public function __construct($iterable, array $config = [])
|
52 |
+
{
|
53 |
+
$this->iterable = iter_for($iterable);
|
54 |
+
|
55 |
+
if (isset($config['concurrency'])) {
|
56 |
+
$this->concurrency = $config['concurrency'];
|
57 |
+
}
|
58 |
+
|
59 |
+
if (isset($config['fulfilled'])) {
|
60 |
+
$this->onFulfilled = $config['fulfilled'];
|
61 |
+
}
|
62 |
+
|
63 |
+
if (isset($config['rejected'])) {
|
64 |
+
$this->onRejected = $config['rejected'];
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function promise()
|
69 |
+
{
|
70 |
+
if ($this->aggregate) {
|
71 |
+
return $this->aggregate;
|
72 |
+
}
|
73 |
+
|
74 |
+
try {
|
75 |
+
$this->createPromise();
|
76 |
+
$this->iterable->rewind();
|
77 |
+
$this->refillPending();
|
78 |
+
} catch (\Throwable $e) {
|
79 |
+
$this->aggregate->reject($e);
|
80 |
+
} catch (\Exception $e) {
|
81 |
+
$this->aggregate->reject($e);
|
82 |
+
}
|
83 |
+
|
84 |
+
return $this->aggregate;
|
85 |
+
}
|
86 |
+
|
87 |
+
private function createPromise()
|
88 |
+
{
|
89 |
+
$this->mutex = false;
|
90 |
+
$this->aggregate = new Promise(function () {
|
91 |
+
reset($this->pending);
|
92 |
+
if (empty($this->pending) && !$this->iterable->valid()) {
|
93 |
+
$this->aggregate->resolve(null);
|
94 |
+
return;
|
95 |
+
}
|
96 |
+
|
97 |
+
// Consume a potentially fluctuating list of promises while
|
98 |
+
// ensuring that indexes are maintained (precluding array_shift).
|
99 |
+
while ($promise = current($this->pending)) {
|
100 |
+
next($this->pending);
|
101 |
+
$promise->wait();
|
102 |
+
if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
|
103 |
+
return;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
});
|
107 |
+
|
108 |
+
// Clear the references when the promise is resolved.
|
109 |
+
$clearFn = function () {
|
110 |
+
$this->iterable = $this->concurrency = $this->pending = null;
|
111 |
+
$this->onFulfilled = $this->onRejected = null;
|
112 |
+
};
|
113 |
+
|
114 |
+
$this->aggregate->then($clearFn, $clearFn);
|
115 |
+
}
|
116 |
+
|
117 |
+
private function refillPending()
|
118 |
+
{
|
119 |
+
if (!$this->concurrency) {
|
120 |
+
// Add all pending promises.
|
121 |
+
while ($this->addPending() && $this->advanceIterator());
|
122 |
+
return;
|
123 |
+
}
|
124 |
+
|
125 |
+
// Add only up to N pending promises.
|
126 |
+
$concurrency = is_callable($this->concurrency)
|
127 |
+
? call_user_func($this->concurrency, count($this->pending))
|
128 |
+
: $this->concurrency;
|
129 |
+
$concurrency = max($concurrency - count($this->pending), 0);
|
130 |
+
// Concurrency may be set to 0 to disallow new promises.
|
131 |
+
if (!$concurrency) {
|
132 |
+
return;
|
133 |
+
}
|
134 |
+
// Add the first pending promise.
|
135 |
+
$this->addPending();
|
136 |
+
// Note this is special handling for concurrency=1 so that we do
|
137 |
+
// not advance the iterator after adding the first promise. This
|
138 |
+
// helps work around issues with generators that might not have the
|
139 |
+
// next value to yield until promise callbacks are called.
|
140 |
+
while (--$concurrency
|
141 |
+
&& $this->advanceIterator()
|
142 |
+
&& $this->addPending());
|
143 |
+
}
|
144 |
+
|
145 |
+
private function addPending()
|
146 |
+
{
|
147 |
+
if (!$this->iterable || !$this->iterable->valid()) {
|
148 |
+
return false;
|
149 |
+
}
|
150 |
+
|
151 |
+
$promise = promise_for($this->iterable->current());
|
152 |
+
$idx = $this->iterable->key();
|
153 |
+
|
154 |
+
$this->pending[$idx] = $promise->then(
|
155 |
+
function ($value) use ($idx) {
|
156 |
+
if ($this->onFulfilled) {
|
157 |
+
call_user_func(
|
158 |
+
$this->onFulfilled, $value, $idx, $this->aggregate
|
159 |
+
);
|
160 |
+
}
|
161 |
+
$this->step($idx);
|
162 |
+
},
|
163 |
+
function ($reason) use ($idx) {
|
164 |
+
if ($this->onRejected) {
|
165 |
+
call_user_func(
|
166 |
+
$this->onRejected, $reason, $idx, $this->aggregate
|
167 |
+
);
|
168 |
+
}
|
169 |
+
$this->step($idx);
|
170 |
+
}
|
171 |
+
);
|
172 |
+
|
173 |
+
return true;
|
174 |
+
}
|
175 |
+
|
176 |
+
private function advanceIterator()
|
177 |
+
{
|
178 |
+
// Place a lock on the iterator so that we ensure to not recurse,
|
179 |
+
// preventing fatal generator errors.
|
180 |
+
if ($this->mutex) {
|
181 |
+
return false;
|
182 |
+
}
|
183 |
+
|
184 |
+
$this->mutex = true;
|
185 |
+
|
186 |
+
try {
|
187 |
+
$this->iterable->next();
|
188 |
+
$this->mutex = false;
|
189 |
+
return true;
|
190 |
+
} catch (\Throwable $e) {
|
191 |
+
$this->aggregate->reject($e);
|
192 |
+
$this->mutex = false;
|
193 |
+
return false;
|
194 |
+
} catch (\Exception $e) {
|
195 |
+
$this->aggregate->reject($e);
|
196 |
+
$this->mutex = false;
|
197 |
+
return false;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
private function step($idx)
|
202 |
+
{
|
203 |
+
// If the promise was already resolved, then ignore this step.
|
204 |
+
if ($this->aggregate->getState() !== PromiseInterface::PENDING) {
|
205 |
+
return;
|
206 |
+
}
|
207 |
+
|
208 |
+
unset($this->pending[$idx]);
|
209 |
+
|
210 |
+
// Only refill pending promises if we are not locked, preventing the
|
211 |
+
// EachPromise to recursively invoke the provided iterator, which
|
212 |
+
// cause a fatal error: "Cannot resume an already running generator"
|
213 |
+
if ($this->advanceIterator() && !$this->checkIfFinished()) {
|
214 |
+
// Add more pending promises if possible.
|
215 |
+
$this->refillPending();
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
private function checkIfFinished()
|
220 |
+
{
|
221 |
+
if (!$this->pending && !$this->iterable->valid()) {
|
222 |
+
// Resolve the promise if there's nothing left to do.
|
223 |
+
$this->aggregate->resolve(null);
|
224 |
+
return true;
|
225 |
+
}
|
226 |
+
|
227 |
+
return false;
|
228 |
+
}
|
229 |
+
}
|
vendor/guzzlehttp/promises/src/FulfilledPromise.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* A promise that has been fulfilled.
|
6 |
+
*
|
7 |
+
* Thenning off of this promise will invoke the onFulfilled callback
|
8 |
+
* immediately and ignore other callbacks.
|
9 |
+
*/
|
10 |
+
class FulfilledPromise implements PromiseInterface
|
11 |
+
{
|
12 |
+
private $value;
|
13 |
+
|
14 |
+
public function __construct($value)
|
15 |
+
{
|
16 |
+
if (method_exists($value, 'then')) {
|
17 |
+
throw new \InvalidArgumentException(
|
18 |
+
'You cannot create a FulfilledPromise with a promise.');
|
19 |
+
}
|
20 |
+
|
21 |
+
$this->value = $value;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function then(
|
25 |
+
callable $onFulfilled = null,
|
26 |
+
callable $onRejected = null
|
27 |
+
) {
|
28 |
+
// Return itself if there is no onFulfilled function.
|
29 |
+
if (!$onFulfilled) {
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
$queue = queue();
|
34 |
+
$p = new Promise([$queue, 'run']);
|
35 |
+
$value = $this->value;
|
36 |
+
$queue->add(static function () use ($p, $value, $onFulfilled) {
|
37 |
+
if ($p->getState() === self::PENDING) {
|
38 |
+
try {
|
39 |
+
$p->resolve($onFulfilled($value));
|
40 |
+
} catch (\Throwable $e) {
|
41 |
+
$p->reject($e);
|
42 |
+
} catch (\Exception $e) {
|
43 |
+
$p->reject($e);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
});
|
47 |
+
|
48 |
+
return $p;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function otherwise(callable $onRejected)
|
52 |
+
{
|
53 |
+
return $this->then(null, $onRejected);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function wait($unwrap = true, $defaultDelivery = null)
|
57 |
+
{
|
58 |
+
return $unwrap ? $this->value : null;
|
59 |
+
}
|
60 |
+
|
61 |
+
public function getState()
|
62 |
+
{
|
63 |
+
return self::FULFILLED;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function resolve($value)
|
67 |
+
{
|
68 |
+
if ($value !== $this->value) {
|
69 |
+
throw new \LogicException("Cannot resolve a fulfilled promise");
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
public function reject($reason)
|
74 |
+
{
|
75 |
+
throw new \LogicException("Cannot reject a fulfilled promise");
|
76 |
+
}
|
77 |
+
|
78 |
+
public function cancel()
|
79 |
+
{
|
80 |
+
// pass
|
81 |
+
}
|
82 |
+
}
|
vendor/guzzlehttp/promises/src/Promise.php
ADDED
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Promises/A+ implementation that avoids recursion when possible.
|
6 |
+
*
|
7 |
+
* @link https://promisesaplus.com/
|
8 |
+
*/
|
9 |
+
class Promise implements PromiseInterface
|
10 |
+
{
|
11 |
+
private $state = self::PENDING;
|
12 |
+
private $result;
|
13 |
+
private $cancelFn;
|
14 |
+
private $waitFn;
|
15 |
+
private $waitList;
|
16 |
+
private $handlers = [];
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @param callable $waitFn Fn that when invoked resolves the promise.
|
20 |
+
* @param callable $cancelFn Fn that when invoked cancels the promise.
|
21 |
+
*/
|
22 |
+
public function __construct(
|
23 |
+
callable $waitFn = null,
|
24 |
+
callable $cancelFn = null
|
25 |
+
) {
|
26 |
+
$this->waitFn = $waitFn;
|
27 |
+
$this->cancelFn = $cancelFn;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function then(
|
31 |
+
callable $onFulfilled = null,
|
32 |
+
callable $onRejected = null
|
33 |
+
) {
|
34 |
+
if ($this->state === self::PENDING) {
|
35 |
+
$p = new Promise(null, [$this, 'cancel']);
|
36 |
+
$this->handlers[] = [$p, $onFulfilled, $onRejected];
|
37 |
+
$p->waitList = $this->waitList;
|
38 |
+
$p->waitList[] = $this;
|
39 |
+
return $p;
|
40 |
+
}
|
41 |
+
|
42 |
+
// Return a fulfilled promise and immediately invoke any callbacks.
|
43 |
+
if ($this->state === self::FULFILLED) {
|
44 |
+
return $onFulfilled
|
45 |
+
? promise_for($this->result)->then($onFulfilled)
|
46 |
+
: promise_for($this->result);
|
47 |
+
}
|
48 |
+
|
49 |
+
// It's either cancelled or rejected, so return a rejected promise
|
50 |
+
// and immediately invoke any callbacks.
|
51 |
+
$rejection = rejection_for($this->result);
|
52 |
+
return $onRejected ? $rejection->then(null, $onRejected) : $rejection;
|
53 |
+
}
|
54 |
+
|
55 |
+
public function otherwise(callable $onRejected)
|
56 |
+
{
|
57 |
+
return $this->then(null, $onRejected);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function wait($unwrap = true)
|
61 |
+
{
|
62 |
+
$this->waitIfPending();
|
63 |
+
|
64 |
+
$inner = $this->result instanceof PromiseInterface
|
65 |
+
? $this->result->wait($unwrap)
|
66 |
+
: $this->result;
|
67 |
+
|
68 |
+
if ($unwrap) {
|
69 |
+
if ($this->result instanceof PromiseInterface
|
70 |
+
|| $this->state === self::FULFILLED
|
71 |
+
) {
|
72 |
+
return $inner;
|
73 |
+
} else {
|
74 |
+
// It's rejected so "unwrap" and throw an exception.
|
75 |
+
throw exception_for($inner);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
public function getState()
|
81 |
+
{
|
82 |
+
return $this->state;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function cancel()
|
86 |
+
{
|
87 |
+
if ($this->state !== self::PENDING) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
$this->waitFn = $this->waitList = null;
|
92 |
+
|
93 |
+
if ($this->cancelFn) {
|
94 |
+
$fn = $this->cancelFn;
|
95 |
+
$this->cancelFn = null;
|
96 |
+
try {
|
97 |
+
$fn();
|
98 |
+
} catch (\Throwable $e) {
|
99 |
+
$this->reject($e);
|
100 |
+
} catch (\Exception $e) {
|
101 |
+
$this->reject($e);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
// Reject the promise only if it wasn't rejected in a then callback.
|
106 |
+
if ($this->state === self::PENDING) {
|
107 |
+
$this->reject(new CancellationException('Promise has been cancelled'));
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
public function resolve($value)
|
112 |
+
{
|
113 |
+
$this->settle(self::FULFILLED, $value);
|
114 |
+
}
|
115 |
+
|
116 |
+
public function reject($reason)
|
117 |
+
{
|
118 |
+
$this->settle(self::REJECTED, $reason);
|
119 |
+
}
|
120 |
+
|
121 |
+
private function settle($state, $value)
|
122 |
+
{
|
123 |
+
if ($this->state !== self::PENDING) {
|
124 |
+
// Ignore calls with the same resolution.
|
125 |
+
if ($state === $this->state && $value === $this->result) {
|
126 |
+
return;
|
127 |
+
}
|
128 |
+
throw $this->state === $state
|
129 |
+
? new \LogicException("The promise is already {$state}.")
|
130 |
+
: new \LogicException("Cannot change a {$this->state} promise to {$state}");
|
131 |
+
}
|
132 |
+
|
133 |
+
if ($value === $this) {
|
134 |
+
throw new \LogicException('Cannot fulfill or reject a promise with itself');
|
135 |
+
}
|
136 |
+
|
137 |
+
// Clear out the state of the promise but stash the handlers.
|
138 |
+
$this->state = $state;
|
139 |
+
$this->result = $value;
|
140 |
+
$handlers = $this->handlers;
|
141 |
+
$this->handlers = null;
|
142 |
+
$this->waitList = $this->waitFn = null;
|
143 |
+
$this->cancelFn = null;
|
144 |
+
|
145 |
+
if (!$handlers) {
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
|
149 |
+
// If the value was not a settled promise or a thenable, then resolve
|
150 |
+
// it in the task queue using the correct ID.
|
151 |
+
if (!method_exists($value, 'then')) {
|
152 |
+
$id = $state === self::FULFILLED ? 1 : 2;
|
153 |
+
// It's a success, so resolve the handlers in the queue.
|
154 |
+
queue()->add(static function () use ($id, $value, $handlers) {
|
155 |
+
foreach ($handlers as $handler) {
|
156 |
+
self::callHandler($id, $value, $handler);
|
157 |
+
}
|
158 |
+
});
|
159 |
+
} elseif ($value instanceof Promise
|
160 |
+
&& $value->getState() === self::PENDING
|
161 |
+
) {
|
162 |
+
// We can just merge our handlers onto the next promise.
|
163 |
+
$value->handlers = array_merge($value->handlers, $handlers);
|
164 |
+
} else {
|
165 |
+
// Resolve the handlers when the forwarded promise is resolved.
|
166 |
+
$value->then(
|
167 |
+
static function ($value) use ($handlers) {
|
168 |
+
foreach ($handlers as $handler) {
|
169 |
+
self::callHandler(1, $value, $handler);
|
170 |
+
}
|
171 |
+
},
|
172 |
+
static function ($reason) use ($handlers) {
|
173 |
+
foreach ($handlers as $handler) {
|
174 |
+
self::callHandler(2, $reason, $handler);
|
175 |
+
}
|
176 |
+
}
|
177 |
+
);
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Call a stack of handlers using a specific callback index and value.
|
183 |
+
*
|
184 |
+
* @param int $index 1 (resolve) or 2 (reject).
|
185 |
+
* @param mixed $value Value to pass to the callback.
|
186 |
+
* @param array $handler Array of handler data (promise and callbacks).
|
187 |
+
*
|
188 |
+
* @return array Returns the next group to resolve.
|
189 |
+
*/
|
190 |
+
private static function callHandler($index, $value, array $handler)
|
191 |
+
{
|
192 |
+
/** @var PromiseInterface $promise */
|
193 |
+
$promise = $handler[0];
|
194 |
+
|
195 |
+
// The promise may have been cancelled or resolved before placing
|
196 |
+
// this thunk in the queue.
|
197 |
+
if ($promise->getState() !== self::PENDING) {
|
198 |
+
return;
|
199 |
+
}
|
200 |
+
|
201 |
+
try {
|
202 |
+
if (isset($handler[$index])) {
|
203 |
+
$promise->resolve($handler[$index]($value));
|
204 |
+
} elseif ($index === 1) {
|
205 |
+
// Forward resolution values as-is.
|
206 |
+
$promise->resolve($value);
|
207 |
+
} else {
|
208 |
+
// Forward rejections down the chain.
|
209 |
+
$promise->reject($value);
|
210 |
+
}
|
211 |
+
} catch (\Throwable $reason) {
|
212 |
+
$promise->reject($reason);
|
213 |
+
} catch (\Exception $reason) {
|
214 |
+
$promise->reject($reason);
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
private function waitIfPending()
|
219 |
+
{
|
220 |
+
if ($this->state !== self::PENDING) {
|
221 |
+
return;
|
222 |
+
} elseif ($this->waitFn) {
|
223 |
+
$this->invokeWaitFn();
|
224 |
+
} elseif ($this->waitList) {
|
225 |
+
$this->invokeWaitList();
|
226 |
+
} else {
|
227 |
+
// If there's not wait function, then reject the promise.
|
228 |
+
$this->reject('Cannot wait on a promise that has '
|
229 |
+
. 'no internal wait function. You must provide a wait '
|
230 |
+
. 'function when constructing the promise to be able to '
|
231 |
+
. 'wait on a promise.');
|
232 |
+
}
|
233 |
+
|
234 |
+
queue()->run();
|
235 |
+
|
236 |
+
if ($this->state === self::PENDING) {
|
237 |
+
$this->reject('Invoking the wait callback did not resolve the promise');
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
private function invokeWaitFn()
|
242 |
+
{
|
243 |
+
try {
|
244 |
+
$wfn = $this->waitFn;
|
245 |
+
$this->waitFn = null;
|
246 |
+
$wfn(true);
|
247 |
+
} catch (\Exception $reason) {
|
248 |
+
if ($this->state === self::PENDING) {
|
249 |
+
// The promise has not been resolved yet, so reject the promise
|
250 |
+
// with the exception.
|
251 |
+
$this->reject($reason);
|
252 |
+
} else {
|
253 |
+
// The promise was already resolved, so there's a problem in
|
254 |
+
// the application.
|
255 |
+
throw $reason;
|
256 |
+
}
|
257 |
+
}
|
258 |
+
}
|
259 |
+
|
260 |
+
private function invokeWaitList()
|
261 |
+
{
|
262 |
+
$waitList = $this->waitList;
|
263 |
+
$this->waitList = null;
|
264 |
+
|
265 |
+
foreach ($waitList as $result) {
|
266 |
+
while (true) {
|
267 |
+
$result->waitIfPending();
|
268 |
+
|
269 |
+
if ($result->result instanceof Promise) {
|
270 |
+
$result = $result->result;
|
271 |
+
} else {
|
272 |
+
if ($result->result instanceof PromiseInterface) {
|
273 |
+
$result->result->wait(false);
|
274 |
+
}
|
275 |
+
break;
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
}
|
280 |
+
}
|
vendor/guzzlehttp/promises/src/PromiseInterface.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* A promise represents the eventual result of an asynchronous operation.
|
6 |
+
*
|
7 |
+
* The primary way of interacting with a promise is through its then method,
|
8 |
+
* which registers callbacks to receive either a promise’s eventual value or
|
9 |
+
* the reason why the promise cannot be fulfilled.
|
10 |
+
*
|
11 |
+
* @link https://promisesaplus.com/
|
12 |
+
*/
|
13 |
+
interface PromiseInterface
|
14 |
+
{
|
15 |
+
const PENDING = 'pending';
|
16 |
+
const FULFILLED = 'fulfilled';
|
17 |
+
const REJECTED = 'rejected';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Appends fulfillment and rejection handlers to the promise, and returns
|
21 |
+
* a new promise resolving to the return value of the called handler.
|
22 |
+
*
|
23 |
+
* @param callable $onFulfilled Invoked when the promise fulfills.
|
24 |
+
* @param callable $onRejected Invoked when the promise is rejected.
|
25 |
+
*
|
26 |
+
* @return PromiseInterface
|
27 |
+
*/
|
28 |
+
public function then(
|
29 |
+
callable $onFulfilled = null,
|
30 |
+
callable $onRejected = null
|
31 |
+
);
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Appends a rejection handler callback to the promise, and returns a new
|
35 |
+
* promise resolving to the return value of the callback if it is called,
|
36 |
+
* or to its original fulfillment value if the promise is instead
|
37 |
+
* fulfilled.
|
38 |
+
*
|
39 |
+
* @param callable $onRejected Invoked when the promise is rejected.
|
40 |
+
*
|
41 |
+
* @return PromiseInterface
|
42 |
+
*/
|
43 |
+
public function otherwise(callable $onRejected);
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get the state of the promise ("pending", "rejected", or "fulfilled").
|
47 |
+
*
|
48 |
+
* The three states can be checked against the constants defined on
|
49 |
+
* PromiseInterface: PENDING, FULFILLED, and REJECTED.
|
50 |
+
*
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function getState();
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Resolve the promise with the given value.
|
57 |
+
*
|
58 |
+
* @param mixed $value
|
59 |
+
* @throws \RuntimeException if the promise is already resolved.
|
60 |
+
*/
|
61 |
+
public function resolve($value);
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Reject the promise with the given reason.
|
65 |
+
*
|
66 |
+
* @param mixed $reason
|
67 |
+
* @throws \RuntimeException if the promise is already resolved.
|
68 |
+
*/
|
69 |
+
public function reject($reason);
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Cancels the promise if possible.
|
73 |
+
*
|
74 |
+
* @link https://github.com/promises-aplus/cancellation-spec/issues/7
|
75 |
+
*/
|
76 |
+
public function cancel();
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Waits until the promise completes if possible.
|
80 |
+
*
|
81 |
+
* Pass $unwrap as true to unwrap the result of the promise, either
|
82 |
+
* returning the resolved value or throwing the rejected exception.
|
83 |
+
*
|
84 |
+
* If the promise cannot be waited on, then the promise will be rejected.
|
85 |
+
*
|
86 |
+
* @param bool $unwrap
|
87 |
+
*
|
88 |
+
* @return mixed
|
89 |
+
* @throws \LogicException if the promise has no wait function or if the
|
90 |
+
* promise does not settle after waiting.
|
91 |
+
*/
|
92 |
+
public function wait($unwrap = true);
|
93 |
+
}
|
vendor/guzzlehttp/promises/src/PromisorInterface.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Interface used with classes that return a promise.
|
6 |
+
*/
|
7 |
+
interface PromisorInterface
|
8 |
+
{
|
9 |
+
/**
|
10 |
+
* Returns a promise.
|
11 |
+
*
|
12 |
+
* @return PromiseInterface
|
13 |
+
*/
|
14 |
+
public function promise();
|
15 |
+
}
|
vendor/guzzlehttp/promises/src/RejectedPromise.php
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* A promise that has been rejected.
|
6 |
+
*
|
7 |
+
* Thenning off of this promise will invoke the onRejected callback
|
8 |
+
* immediately and ignore other callbacks.
|
9 |
+
*/
|
10 |
+
class RejectedPromise implements PromiseInterface
|
11 |
+
{
|
12 |
+
private $reason;
|
13 |
+
|
14 |
+
public function __construct($reason)
|
15 |
+
{
|
16 |
+
if (method_exists($reason, 'then')) {
|
17 |
+
throw new \InvalidArgumentException(
|
18 |
+
'You cannot create a RejectedPromise with a promise.');
|
19 |
+
}
|
20 |
+
|
21 |
+
$this->reason = $reason;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function then(
|
25 |
+
callable $onFulfilled = null,
|
26 |
+
callable $onRejected = null
|
27 |
+
) {
|
28 |
+
// If there's no onRejected callback then just return self.
|
29 |
+
if (!$onRejected) {
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
$queue = queue();
|
34 |
+
$reason = $this->reason;
|
35 |
+
$p = new Promise([$queue, 'run']);
|
36 |
+
$queue->add(static function () use ($p, $reason, $onRejected) {
|
37 |
+
if ($p->getState() === self::PENDING) {
|
38 |
+
try {
|
39 |
+
// Return a resolved promise if onRejected does not throw.
|
40 |
+
$p->resolve($onRejected($reason));
|
41 |
+
} catch (\Throwable $e) {
|
42 |
+
// onRejected threw, so return a rejected promise.
|
43 |
+
$p->reject($e);
|
44 |
+
} catch (\Exception $e) {
|
45 |
+
// onRejected threw, so return a rejected promise.
|
46 |
+
$p->reject($e);
|
47 |
+
}
|
48 |
+
}
|
49 |
+
});
|
50 |
+
|
51 |
+
return $p;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function otherwise(callable $onRejected)
|
55 |
+
{
|
56 |
+
return $this->then(null, $onRejected);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function wait($unwrap = true, $defaultDelivery = null)
|
60 |
+
{
|
61 |
+
if ($unwrap) {
|
62 |
+
throw exception_for($this->reason);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
public function getState()
|
67 |
+
{
|
68 |
+
return self::REJECTED;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function resolve($value)
|
72 |
+
{
|
73 |
+
throw new \LogicException("Cannot resolve a rejected promise");
|
74 |
+
}
|
75 |
+
|
76 |
+
public function reject($reason)
|
77 |
+
{
|
78 |
+
if ($reason !== $this->reason) {
|
79 |
+
throw new \LogicException("Cannot reject a rejected promise");
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
public function cancel()
|
84 |
+
{
|
85 |
+
// pass
|
86 |
+
}
|
87 |
+
}
|
vendor/guzzlehttp/promises/src/RejectionException.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* A special exception that is thrown when waiting on a rejected promise.
|
6 |
+
*
|
7 |
+
* The reason value is available via the getReason() method.
|
8 |
+
*/
|
9 |
+
class RejectionException extends \RuntimeException
|
10 |
+
{
|
11 |
+
/** @var mixed Rejection reason. */
|
12 |
+
private $reason;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @param mixed $reason Rejection reason.
|
16 |
+
* @param string $description Optional description
|
17 |
+
*/
|
18 |
+
public function __construct($reason, $description = null)
|
19 |
+
{
|
20 |
+
$this->reason = $reason;
|
21 |
+
|
22 |
+
$message = 'The promise was rejected';
|
23 |
+
|
24 |
+
if ($description) {
|
25 |
+
$message .= ' with reason: ' . $description;
|
26 |
+
} elseif (is_string($reason)
|
27 |
+
|| (is_object($reason) && method_exists($reason, '__toString'))
|
28 |
+
) {
|
29 |
+
$message .= ' with reason: ' . $this->reason;
|
30 |
+
} elseif ($reason instanceof \JsonSerializable) {
|
31 |
+
$message .= ' with reason: '
|
32 |
+
. json_encode($this->reason, JSON_PRETTY_PRINT);
|
33 |
+
}
|
34 |
+
|
35 |
+
parent::__construct($message);
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Returns the rejection reason.
|
40 |
+
*
|
41 |
+
* @return mixed
|
42 |
+
*/
|
43 |
+
public function getReason()
|
44 |
+
{
|
45 |
+
return $this->reason;
|
46 |
+
}
|
47 |
+
}
|
vendor/guzzlehttp/promises/src/TaskQueue.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* A task queue that executes tasks in a FIFO order.
|
6 |
+
*
|
7 |
+
* This task queue class is used to settle promises asynchronously and
|
8 |
+
* maintains a constant stack size. You can use the task queue asynchronously
|
9 |
+
* by calling the `run()` function of the global task queue in an event loop.
|
10 |
+
*
|
11 |
+
* GuzzleHttp\Promise\queue()->run();
|
12 |
+
*/
|
13 |
+
class TaskQueue implements TaskQueueInterface
|
14 |
+
{
|
15 |
+
private $enableShutdown = true;
|
16 |
+
private $queue = [];
|
17 |
+
|
18 |
+
public function __construct($withShutdown = true)
|
19 |
+
{
|
20 |
+
if ($withShutdown) {
|
21 |
+
register_shutdown_function(function () {
|
22 |
+
if ($this->enableShutdown) {
|
23 |
+
// Only run the tasks if an E_ERROR didn't occur.
|
24 |
+
$err = error_get_last();
|
25 |
+
if (!$err || ($err['type'] ^ E_ERROR)) {
|
26 |
+
$this->run();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
});
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
public function isEmpty()
|
34 |
+
{
|
35 |
+
return !$this->queue;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function add(callable $task)
|
39 |
+
{
|
40 |
+
$this->queue[] = $task;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function run()
|
44 |
+
{
|
45 |
+
/** @var callable $task */
|
46 |
+
while ($task = array_shift($this->queue)) {
|
47 |
+
$task();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* The task queue will be run and exhausted by default when the process
|
53 |
+
* exits IFF the exit is not the result of a PHP E_ERROR error.
|
54 |
+
*
|
55 |
+
* You can disable running the automatic shutdown of the queue by calling
|
56 |
+
* this function. If you disable the task queue shutdown process, then you
|
57 |
+
* MUST either run the task queue (as a result of running your event loop
|
58 |
+
* or manually using the run() method) or wait on each outstanding promise.
|
59 |
+
*
|
60 |
+
* Note: This shutdown will occur before any destructors are triggered.
|
61 |
+
*/
|
62 |
+
public function disableShutdown()
|
63 |
+
{
|
64 |
+
$this->enableShutdown = false;
|
65 |
+
}
|
66 |
+
}
|
vendor/guzzlehttp/promises/src/TaskQueueInterface.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
interface TaskQueueInterface
|
5 |
+
{
|
6 |
+
/**
|
7 |
+
* Returns true if the queue is empty.
|
8 |
+
*
|
9 |
+
* @return bool
|
10 |
+
*/
|
11 |
+
public function isEmpty();
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Adds a task to the queue that will be executed the next time run is
|
15 |
+
* called.
|
16 |
+
*
|
17 |
+
* @param callable $task
|
18 |
+
*/
|
19 |
+
public function add(callable $task);
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Execute all of the pending task in the queue.
|
23 |
+
*/
|
24 |
+
public function run();
|
25 |
+
}
|
vendor/guzzlehttp/promises/src/functions.php
ADDED
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Promise;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Get the global task queue used for promise resolution.
|
6 |
+
*
|
7 |
+
* This task queue MUST be run in an event loop in order for promises to be
|
8 |
+
* settled asynchronously. It will be automatically run when synchronously
|
9 |
+
* waiting on a promise.
|
10 |
+
*
|
11 |
+
* <code>
|
12 |
+
* while ($eventLoop->isRunning()) {
|
13 |
+
* GuzzleHttp\Promise\queue()->run();
|
14 |
+
* }
|
15 |
+
* </code>
|
16 |
+
*
|
17 |
+
* @param TaskQueueInterface $assign Optionally specify a new queue instance.
|
18 |
+
*
|
19 |
+
* @return TaskQueueInterface
|
20 |
+
*/
|
21 |
+
function queue(TaskQueueInterface $assign = null)
|
22 |
+
{
|
23 |
+
static $queue;
|
24 |
+
|
25 |
+
if ($assign) {
|
26 |
+
$queue = $assign;
|
27 |
+
} elseif (!$queue) {
|
28 |
+
$queue = new TaskQueue();
|
29 |
+
}
|
30 |
+
|
31 |
+
return $queue;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Adds a function to run in the task queue when it is next `run()` and returns
|
36 |
+
* a promise that is fulfilled or rejected with the result.
|
37 |
+
*
|
38 |
+
* @param callable $task Task function to run.
|
39 |
+
*
|
40 |
+
* @return PromiseInterface
|
41 |
+
*/
|
42 |
+
function task(callable $task)
|
43 |
+
{
|
44 |
+
$queue = queue();
|
45 |
+
$promise = new Promise([$queue, 'run']);
|
46 |
+
$queue->add(function () use ($task, $promise) {
|
47 |
+
try {
|
48 |
+
$promise->resolve($task());
|
49 |
+
} catch (\Throwable $e) {
|
50 |
+
$promise->reject($e);
|
51 |
+
} catch (\Exception $e) {
|
52 |
+
$promise->reject($e);
|
53 |
+
}
|
54 |
+
});
|
55 |
+
|
56 |
+
return $promise;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Creates a promise for a value if the value is not a promise.
|
61 |
+
*
|
62 |
+
* @param mixed $value Promise or value.
|
63 |
+
*
|
64 |
+
* @return PromiseInterface
|
65 |
+
*/
|
66 |
+
function promise_for($value)
|
67 |
+
{
|
68 |
+
if ($value instanceof PromiseInterface) {
|
69 |
+
return $value;
|
70 |
+
}
|
71 |
+
|
72 |
+
// Return a Guzzle promise that shadows the given promise.
|
73 |
+
if (method_exists($value, 'then')) {
|
74 |
+
$wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null;
|
75 |
+
$cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
|
76 |
+
$promise = new Promise($wfn, $cfn);
|
77 |
+
$value->then([$promise, 'resolve'], [$promise, 'reject']);
|
78 |
+
return $promise;
|
79 |
+
}
|
80 |
+
|
81 |
+
return new FulfilledPromise($value);
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Creates a rejected promise for a reason if the reason is not a promise. If
|
86 |
+
* the provided reason is a promise, then it is returned as-is.
|
87 |
+
*
|
88 |
+
* @param mixed $reason Promise or reason.
|
89 |
+
*
|
90 |
+
* @return PromiseInterface
|
91 |
+
*/
|
92 |
+
function rejection_for($reason)
|
93 |
+
{
|
94 |
+
if ($reason instanceof PromiseInterface) {
|
95 |
+
return $reason;
|
96 |
+
}
|
97 |
+
|
98 |
+
return new RejectedPromise($reason);
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Create an exception for a rejected promise value.
|
103 |
+
*
|
104 |
+
* @param mixed $reason
|
105 |
+
*
|
106 |
+
* @return \Exception|\Throwable
|
107 |
+
*/
|
108 |
+
function exception_for($reason)
|
109 |
+
{
|
110 |
+
return $reason instanceof \Exception || $reason instanceof \Throwable
|
111 |
+
? $reason
|
112 |
+
: new RejectionException($reason);
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Returns an iterator for the given value.
|
117 |
+
*
|
118 |
+
* @param mixed $value
|
119 |
+
*
|
120 |
+
* @return \Iterator
|
121 |
+
*/
|
122 |
+
function iter_for($value)
|
123 |
+
{
|
124 |
+
if ($value instanceof \Iterator) {
|
125 |
+
return $value;
|
126 |
+
} elseif (is_array($value)) {
|
127 |
+
return new \ArrayIterator($value);
|
128 |
+
} else {
|
129 |
+
return new \ArrayIterator([$value]);
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Synchronously waits on a promise to resolve and returns an inspection state
|
135 |
+
* array.
|
136 |
+
*
|
137 |
+
* Returns a state associative array containing a "state" key mapping to a
|
138 |
+
* valid promise state. If the state of the promise is "fulfilled", the array
|
139 |
+
* will contain a "value" key mapping to the fulfilled value of the promise. If
|
140 |
+
* the promise is rejected, the array will contain a "reason" key mapping to
|
141 |
+
* the rejection reason of the promise.
|
142 |
+
*
|
143 |
+
* @param PromiseInterface $promise Promise or value.
|
144 |
+
*
|
145 |
+
* @return array
|
146 |
+
*/
|
147 |
+
function inspect(PromiseInterface $promise)
|
148 |
+
{
|
149 |
+
try {
|
150 |
+
return [
|
151 |
+
'state' => PromiseInterface::FULFILLED,
|
152 |
+
'value' => $promise->wait()
|
153 |
+
];
|
154 |
+
} catch (RejectionException $e) {
|
155 |
+
return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()];
|
156 |
+
} catch (\Throwable $e) {
|
157 |
+
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
|
158 |
+
} catch (\Exception $e) {
|
159 |
+
return ['state' => PromiseInterface::REJECTED, 'reason' => $e];
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* Waits on all of the provided promises, but does not unwrap rejected promises
|
165 |
+
* as thrown exception.
|
166 |
+
*
|
167 |
+
* Returns an array of inspection state arrays.
|
168 |
+
*
|
169 |
+
* @param PromiseInterface[] $promises Traversable of promises to wait upon.
|
170 |
+
*
|
171 |
+
* @return array
|
172 |
+
* @see GuzzleHttp\Promise\inspect for the inspection state array format.
|
173 |
+
*/
|
174 |
+
function inspect_all($promises)
|
175 |
+
{
|
176 |
+
$results = [];
|
177 |
+
foreach ($promises as $key => $promise) {
|
178 |
+
$results[$key] = inspect($promise);
|
179 |
+
}
|
180 |
+
|
181 |
+
return $results;
|
182 |
+
}
|
183 |
+
|
184 |
+
/**
|
185 |
+
* Waits on all of the provided promises and returns the fulfilled values.
|
186 |
+
*
|
187 |
+
* Returns an array that contains the value of each promise (in the same order
|
188 |
+
* the promises were provided). An exception is thrown if any of the promises
|
189 |
+
* are rejected.
|
190 |
+
*
|
191 |
+
* @param mixed $promises Iterable of PromiseInterface objects to wait on.
|
192 |
+
*
|
193 |
+
* @return array
|
194 |
+
* @throws \Exception on error
|
195 |
+
* @throws \Throwable on error in PHP >=7
|
196 |
+
*/
|
197 |
+
function unwrap($promises)
|
198 |
+
{
|
199 |
+
$results = [];
|
200 |
+
foreach ($promises as $key => $promise) {
|
201 |
+
$results[$key] = $promise->wait();
|
202 |
+
}
|
203 |
+
|
204 |
+
return $results;
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* Given an array of promises, return a promise that is fulfilled when all the
|
209 |
+
* items in the array are fulfilled.
|
210 |
+
*
|
211 |
+
* The promise's fulfillment value is an array with fulfillment values at
|
212 |
+
* respective positions to the original array. If any promise in the array
|
213 |
+
* rejects, the returned promise is rejected with the rejection reason.
|
214 |
+
*
|
215 |
+
* @param mixed $promises Promises or values.
|
216 |
+
*
|
217 |
+
* @return PromiseInterface
|
218 |
+
*/
|
219 |
+
function all($promises)
|
220 |
+
{
|
221 |
+
$results = [];
|
222 |
+
return each(
|
223 |
+
$promises,
|
224 |
+
function ($value, $idx) use (&$results) {
|
225 |
+
$results[$idx] = $value;
|
226 |
+
},
|
227 |
+
function ($reason, $idx, Promise $aggregate) {
|
228 |
+
$aggregate->reject($reason);
|
229 |
+
}
|
230 |
+
)->then(function () use (&$results) {
|
231 |
+
ksort($results);
|
232 |
+
return $results;
|
233 |
+
});
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Initiate a competitive race between multiple promises or values (values will
|
238 |
+
* become immediately fulfilled promises).
|
239 |
+
*
|
240 |
+
* When count amount of promises have been fulfilled, the returned promise is
|
241 |
+
* fulfilled with an array that contains the fulfillment values of the winners
|
242 |
+
* in order of resolution.
|
243 |
+
*
|
244 |
+
* This prommise is rejected with a {@see GuzzleHttp\Promise\AggregateException}
|
245 |
+
* if the number of fulfilled promises is less than the desired $count.
|
246 |
+
*
|
247 |
+
* @param int $count Total number of promises.
|
248 |
+
* @param mixed $promises Promises or values.
|
249 |
+
*
|
250 |
+
* @return PromiseInterface
|
251 |
+
*/
|
252 |
+
function some($count, $promises)
|
253 |
+
{
|
254 |
+
$results = [];
|
255 |
+
$rejections = [];
|
256 |
+
|
257 |
+
return each(
|
258 |
+
$promises,
|
259 |
+
function ($value, $idx, PromiseInterface $p) use (&$results, $count) {
|
260 |
+
if ($p->getState() !== PromiseInterface::PENDING) {
|
261 |
+
return;
|
262 |
+
}
|
263 |
+
$results[$idx] = $value;
|
264 |
+
if (count($results) >= $count) {
|
265 |
+
$p->resolve(null);
|
266 |
+
}
|
267 |
+
},
|
268 |
+
function ($reason) use (&$rejections) {
|
269 |
+
$rejections[] = $reason;
|
270 |
+
}
|
271 |
+
)->then(
|
272 |
+
function () use (&$results, &$rejections, $count) {
|
273 |
+
if (count($results) !== $count) {
|
274 |
+
throw new AggregateException(
|
275 |
+
'Not enough promises to fulfill count',
|
276 |
+
$rejections
|
277 |
+
);
|
278 |
+
}
|
279 |
+
ksort($results);
|
280 |
+
return array_values($results);
|
281 |
+
}
|
282 |
+
);
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Like some(), with 1 as count. However, if the promise fulfills, the
|
287 |
+
* fulfillment value is not an array of 1 but the value directly.
|
288 |
+
*
|
289 |
+
* @param mixed $promises Promises or values.
|
290 |
+
*
|
291 |
+
* @return PromiseInterface
|
292 |
+
*/
|
293 |
+
function any($promises)
|
294 |
+
{
|
295 |
+
return some(1, $promises)->then(function ($values) { return $values[0]; });
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Returns a promise that is fulfilled when all of the provided promises have
|
300 |
+
* been fulfilled or rejected.
|
301 |
+
*
|
302 |
+
* The returned promise is fulfilled with an array of inspection state arrays.
|
303 |
+
*
|
304 |
+
* @param mixed $promises Promises or values.
|
305 |
+
*
|
306 |
+
* @return PromiseInterface
|
307 |
+
* @see GuzzleHttp\Promise\inspect for the inspection state array format.
|
308 |
+
*/
|
309 |
+
function settle($promises)
|
310 |
+
{
|
311 |
+
$results = [];
|
312 |
+
|
313 |
+
return each(
|
314 |
+
$promises,
|
315 |
+
function ($value, $idx) use (&$results) {
|
316 |
+
$results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value];
|
317 |
+
},
|
318 |
+
function ($reason, $idx) use (&$results) {
|
319 |
+
$results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason];
|
320 |
+
}
|
321 |
+
)->then(function () use (&$results) {
|
322 |
+
ksort($results);
|
323 |
+
return $results;
|
324 |
+
});
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Given an iterator that yields promises or values, returns a promise that is
|
329 |
+
* fulfilled with a null value when the iterator has been consumed or the
|
330 |
+
* aggregate promise has been fulfilled or rejected.
|
331 |
+
*
|
332 |
+
* $onFulfilled is a function that accepts the fulfilled value, iterator
|
333 |
+
* index, and the aggregate promise. The callback can invoke any necessary side
|
334 |
+
* effects and choose to resolve or reject the aggregate promise if needed.
|
335 |
+
*
|
336 |
+
* $onRejected is a function that accepts the rejection reason, iterator
|
337 |
+
* index, and the aggregate promise. The callback can invoke any necessary side
|
338 |
+
* effects and choose to resolve or reject the aggregate promise if needed.
|
339 |
+
*
|
340 |
+
* @param mixed $iterable Iterator or array to iterate over.
|
341 |
+
* @param callable $onFulfilled
|
342 |
+
* @param callable $onRejected
|
343 |
+
*
|
344 |
+
* @return PromiseInterface
|
345 |
+
*/
|
346 |
+
function each(
|
347 |
+
$iterable,
|
348 |
+
callable $onFulfilled = null,
|
349 |
+
callable $onRejected = null
|
350 |
+
) {
|
351 |
+
return (new EachPromise($iterable, [
|
352 |
+
'fulfilled' => $onFulfilled,
|
353 |
+
'rejected' => $onRejected
|
354 |
+
]))->promise();
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Like each, but only allows a certain number of outstanding promises at any
|
359 |
+
* given time.
|
360 |
+
*
|
361 |
+
* $concurrency may be an integer or a function that accepts the number of
|
362 |
+
* pending promises and returns a numeric concurrency limit value to allow for
|
363 |
+
* dynamic a concurrency size.
|
364 |
+
*
|
365 |
+
* @param mixed $iterable
|
366 |
+
* @param int|callable $concurrency
|
367 |
+
* @param callable $onFulfilled
|
368 |
+
* @param callable $onRejected
|
369 |
+
*
|
370 |
+
* @return PromiseInterface
|
371 |
+
*/
|
372 |
+
function each_limit(
|
373 |
+
$iterable,
|
374 |
+
$concurrency,
|
375 |
+
callable $onFulfilled = null,
|
376 |
+
callable $onRejected = null
|
377 |
+
) {
|
378 |
+
return (new EachPromise($iterable, [
|
379 |
+
'fulfilled' => $onFulfilled,
|
380 |
+
'rejected' => $onRejected,
|
381 |
+
'concurrency' => $concurrency
|
382 |
+
]))->promise();
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Like each_limit, but ensures that no promise in the given $iterable argument
|
387 |
+
* is rejected. If any promise is rejected, then the aggregate promise is
|
388 |
+
* rejected with the encountered rejection.
|
389 |
+
*
|
390 |
+
* @param mixed $iterable
|
391 |
+
* @param int|callable $concurrency
|
392 |
+
* @param callable $onFulfilled
|
393 |
+
*
|
394 |
+
* @return PromiseInterface
|
395 |
+
*/
|
396 |
+
function each_limit_all(
|
397 |
+
$iterable,
|
398 |
+
$concurrency,
|
399 |
+
callable $onFulfilled = null
|
400 |
+
) {
|
401 |
+
return each_limit(
|
402 |
+
$iterable,
|
403 |
+
$concurrency,
|
404 |
+
$onFulfilled,
|
405 |
+
function ($reason, $idx, PromiseInterface $aggregate) {
|
406 |
+
$aggregate->reject($reason);
|
407 |
+
}
|
408 |
+
);
|
409 |
+
}
|
410 |
+
|
411 |
+
/**
|
412 |
+
* Returns true if a promise is fulfilled.
|
413 |
+
*
|
414 |
+
* @param PromiseInterface $promise
|
415 |
+
*
|
416 |
+
* @return bool
|
417 |
+
*/
|
418 |
+
function is_fulfilled(PromiseInterface $promise)
|
419 |
+
{
|
420 |
+
return $promise->getState() === PromiseInterface::FULFILLED;
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Returns true if a promise is rejected.
|
425 |
+
*
|
426 |
+
* @param PromiseInterface $promise
|
427 |
+
*
|
428 |
+
* @return bool
|
429 |
+
*/
|
430 |
+
function is_rejected(PromiseInterface $promise)
|
431 |
+
{
|
432 |
+
return $promise->getState() === PromiseInterface::REJECTED;
|
433 |
+
}
|
434 |
+
|
435 |
+
/**
|
436 |
+
* Returns true if a promise is fulfilled or rejected.
|
437 |
+
*
|
438 |
+
* @param PromiseInterface $promise
|
439 |
+
*
|
440 |
+
* @return bool
|
441 |
+
*/
|
442 |
+
function is_settled(PromiseInterface $promise)
|
443 |
+
{
|
444 |
+
return $promise->getState() !== PromiseInterface::PENDING;
|
445 |
+
}
|
446 |
+
|
447 |
+
/**
|
448 |
+
* @see Coroutine
|
449 |
+
*
|
450 |
+
* @param callable $generatorFn
|
451 |
+
*
|
452 |
+
* @return PromiseInterface
|
453 |
+
*/
|
454 |
+
function coroutine(callable $generatorFn)
|
455 |
+
{
|
456 |
+
return new Coroutine($generatorFn);
|
457 |
+
}
|
vendor/guzzlehttp/promises/src/functions_include.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Don't redefine the functions if included multiple times.
|
4 |
+
if (!function_exists('GuzzleHttp\Promise\promise_for')) {
|
5 |
+
require __DIR__ . '/functions.php';
|
6 |
+
}
|
vendor/guzzlehttp/psr7/CHANGELOG.md
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Change Log
|
2 |
+
|
3 |
+
|
4 |
+
All notable changes to this project will be documented in this file.
|
5 |
+
|
6 |
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
7 |
+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
8 |
+
|
9 |
+
|
10 |
+
## [Unreleased]
|
11 |
+
|
12 |
+
|
13 |
+
## [1.6.0]
|
14 |
+
|
15 |
+
### Added
|
16 |
+
|
17 |
+
- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244)
|
18 |
+
- Added MIME type for WEBP image format (#246)
|
19 |
+
- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272)
|
20 |
+
|
21 |
+
### Changed
|
22 |
+
|
23 |
+
- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262)
|
24 |
+
- Accept port number 0 to be valid (#270)
|
25 |
+
|
26 |
+
### Fixed
|
27 |
+
|
28 |
+
- Fixed subsequent reads from `php://input` in ServerRequest (#247)
|
29 |
+
- Fixed readable/writable detection for certain stream modes (#248)
|
30 |
+
- Fixed encoding of special characters in the `userInfo` component of an URI (#253)
|
31 |
+
|
32 |
+
|
33 |
+
## [1.5.2] - 2018-12-04
|
34 |
+
|
35 |
+
### Fixed
|
36 |
+
|
37 |
+
- Check body size when getting the message summary
|
38 |
+
|
39 |
+
|
40 |
+
## [1.5.1] - 2018-12-04
|
41 |
+
|
42 |
+
### Fixed
|
43 |
+
|
44 |
+
- Get the summary of a body only if it is readable
|
45 |
+
|
46 |
+
|
47 |
+
## [1.5.0] - 2018-12-03
|
48 |
+
|
49 |
+
### Added
|
50 |
+
|
51 |
+
- Response first-line to response string exception (fixes #145)
|
52 |
+
- A test for #129 behavior
|
53 |
+
- `get_message_body_summary` function in order to get the message summary
|
54 |
+
- `3gp` and `mkv` mime types
|
55 |
+
|
56 |
+
### Changed
|
57 |
+
|
58 |
+
- Clarify exception message when stream is detached
|
59 |
+
|
60 |
+
### Deprecated
|
61 |
+
|
62 |
+
- Deprecated parsing folded header lines as per RFC 7230
|
63 |
+
|
64 |
+
### Fixed
|
65 |
+
|
66 |
+
- Fix `AppendStream::detach` to not close streams
|
67 |
+
- `InflateStream` preserves `isSeekable` attribute of the underlying stream
|
68 |
+
- `ServerRequest::getUriFromGlobals` to support URLs in query parameters
|
69 |
+
|
70 |
+
|
71 |
+
Several other fixes and improvements.
|
72 |
+
|
73 |
+
|
74 |
+
## [1.4.2] - 2017-03-20
|
75 |
+
|
76 |
+
### Fixed
|
77 |
+
|
78 |
+
- Reverted BC break to `Uri::resolve` and `Uri::removeDotSegments` by removing
|
79 |
+
calls to `trigger_error` when deprecated methods are invoked.
|
80 |
+
|
81 |
+
|
82 |
+
## [1.4.1] - 2017-02-27
|
83 |
+
|
84 |
+
### Added
|
85 |
+
|
86 |
+
- Rriggering of silenced deprecation warnings.
|
87 |
+
|
88 |
+
### Fixed
|
89 |
+
|
90 |
+
- Reverted BC break by reintroducing behavior to automagically fix a URI with a
|
91 |
+
relative path and an authority by adding a leading slash to the path. It's only
|
92 |
+
deprecated now.
|
93 |
+
|
94 |
+
|
95 |
+
## [1.4.0] - 2017-02-21
|
96 |
+
|
97 |
+
### Added
|
98 |
+
|
99 |
+
- Added common URI utility methods based on RFC 3986 (see documentation in the readme):
|
100 |
+
- `Uri::isDefaultPort`
|
101 |
+
- `Uri::isAbsolute`
|
102 |
+
- `Uri::isNetworkPathReference`
|
103 |
+
- `Uri::isAbsolutePathReference`
|
104 |
+
- `Uri::isRelativePathReference`
|
105 |
+
- `Uri::isSameDocumentReference`
|
106 |
+
- `Uri::composeComponents`
|
107 |
+
- `UriNormalizer::normalize`
|
108 |
+
- `UriNormalizer::isEquivalent`
|
109 |
+
- `UriResolver::relativize`
|
110 |
+
|
111 |
+
### Changed
|
112 |
+
|
113 |
+
- Ensure `ServerRequest::getUriFromGlobals` returns a URI in absolute form.
|
114 |
+
- Allow `parse_response` to parse a response without delimiting space and reason.
|
115 |
+
- Ensure each URI modification results in a valid URI according to PSR-7 discussions.
|
116 |
+
Invalid modifications will throw an exception instead of returning a wrong URI or
|
117 |
+
doing some magic.
|
118 |
+
- `(new Uri)->withPath('foo')->withHost('example.com')` will throw an exception
|
119 |
+
because the path of a URI with an authority must start with a slash "/" or be empty
|
120 |
+
- `(new Uri())->withScheme('http')` will return `'http://localhost'`
|
121 |
+
|
122 |
+
### Deprecated
|
123 |
+
|
124 |
+
- `Uri::resolve` in favor of `UriResolver::resolve`
|
125 |
+
- `Uri::removeDotSegments` in favor of `UriResolver::removeDotSegments`
|
126 |
+
|
127 |
+
### Fixed
|
128 |
+
|
129 |
+
- `Stream::read` when length parameter <= 0.
|
130 |
+
- `copy_to_stream` reads bytes in chunks instead of `maxLen` into memory.
|
131 |
+
- `ServerRequest::getUriFromGlobals` when `Host` header contains port.
|
132 |
+
- Compatibility of URIs with `file` scheme and empty host.
|
133 |
+
|
134 |
+
|
135 |
+
## [1.3.1] - 2016-06-25
|
136 |
+
|
137 |
+
### Fixed
|
138 |
+
|
139 |
+
- `Uri::__toString` for network path references, e.g. `//example.org`.
|
140 |
+
- Missing lowercase normalization for host.
|
141 |
+
- Handling of URI components in case they are `'0'` in a lot of places,
|
142 |
+
e.g. as a user info password.
|
143 |
+
- `Uri::withAddedHeader` to correctly merge headers with different case.
|
144 |
+
- Trimming of header values in `Uri::withAddedHeader`. Header values may
|
145 |
+
be surrounded by whitespace which should be ignored according to RFC 7230
|
146 |
+
Section 3.2.4. This does not apply to header names.
|
147 |
+
- `Uri::withAddedHeader` with an array of header values.
|
148 |
+
- `Uri::resolve` when base path has no slash and handling of fragment.
|
149 |
+
- Handling of encoding in `Uri::with(out)QueryValue` so one can pass the
|
150 |
+
key/value both in encoded as well as decoded form to those methods. This is
|
151 |
+
consistent with withPath, withQuery etc.
|
152 |
+
- `ServerRequest::withoutAttribute` when attribute value is null.
|
153 |
+
|
154 |
+
|
155 |
+
## [1.3.0] - 2016-04-13
|
156 |
+
|
157 |
+
### Added
|
158 |
+
|
159 |
+
- Remaining interfaces needed for full PSR7 compatibility
|
160 |
+
(ServerRequestInterface, UploadedFileInterface, etc.).
|
161 |
+
- Support for stream_for from scalars.
|
162 |
+
|
163 |
+
### Changed
|
164 |
+
|
165 |
+
- Can now extend Uri.
|
166 |
+
|
167 |
+
### Fixed
|
168 |
+
- A bug in validating request methods by making it more permissive.
|
169 |
+
|
170 |
+
|
171 |
+
## [1.2.3] - 2016-02-18
|
172 |
+
|
173 |
+
### Fixed
|
174 |
+
|
175 |
+
- Support in `GuzzleHttp\Psr7\CachingStream` for seeking forward on remote
|
176 |
+
streams, which can sometimes return fewer bytes than requested with `fread`.
|
177 |
+
- Handling of gzipped responses with FNAME headers.
|
178 |
+
|
179 |
+
|
180 |
+
## [1.2.2] - 2016-01-22
|
181 |
+
|
182 |
+
### Added
|
183 |
+
|
184 |
+
- Support for URIs without any authority.
|
185 |
+
- Support for HTTP 451 'Unavailable For Legal Reasons.'
|
186 |
+
- Support for using '0' as a filename.
|
187 |
+
- Support for including non-standard ports in Host headers.
|
188 |
+
|
189 |
+
|
190 |
+
## [1.2.1] - 2015-11-02
|
191 |
+
|
192 |
+
### Changes
|
193 |
+
|
194 |
+
- Now supporting negative offsets when seeking to SEEK_END.
|
195 |
+
|
196 |
+
|
197 |
+
## [1.2.0] - 2015-08-15
|
198 |
+
|
199 |
+
### Changed
|
200 |
+
|
201 |
+
- Body as `"0"` is now properly added to a response.
|
202 |
+
- Now allowing forward seeking in CachingStream.
|
203 |
+
- Now properly parsing HTTP requests that contain proxy targets in
|
204 |
+
`parse_request`.
|
205 |
+
- functions.php is now conditionally required.
|
206 |
+
- user-info is no longer dropped when resolving URIs.
|
207 |
+
|
208 |
+
|
209 |
+
## [1.1.0] - 2015-06-24
|
210 |
+
|
211 |
+
### Changed
|
212 |
+
|
213 |
+
- URIs can now be relative.
|
214 |
+
- `multipart/form-data` headers are now overridden case-insensitively.
|
215 |
+
- URI paths no longer encode the following characters because they are allowed
|
216 |
+
in URIs: "(", ")", "*", "!", "'"
|
217 |
+
- A port is no longer added to a URI when the scheme is missing and no port is
|
218 |
+
present.
|
219 |
+
|
220 |
+
|
221 |
+
## 1.0.0 - 2015-05-19
|
222 |
+
|
223 |
+
Initial release.
|
224 |
+
|
225 |
+
Currently unsupported:
|
226 |
+
|
227 |
+
- `Psr\Http\Message\ServerRequestInterface`
|
228 |
+
- `Psr\Http\Message\UploadedFileInterface`
|
229 |
+
|
230 |
+
|
231 |
+
|
232 |
+
[Unreleased]: https://github.com/guzzle/psr7/compare/1.6.0...HEAD
|
233 |
+
[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0
|
234 |
+
[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2
|
235 |
+
[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1
|
236 |
+
[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0
|
237 |
+
[1.4.2]: https://github.com/guzzle/psr7/compare/1.4.1...1.4.2
|
238 |
+
[1.4.1]: https://github.com/guzzle/psr7/compare/1.4.0...1.4.1
|
239 |
+
[1.4.0]: https://github.com/guzzle/psr7/compare/1.3.1...1.4.0
|
240 |
+
[1.3.1]: https://github.com/guzzle/psr7/compare/1.3.0...1.3.1
|
241 |
+
[1.3.0]: https://github.com/guzzle/psr7/compare/1.2.3...1.3.0
|
242 |
+
[1.2.3]: https://github.com/guzzle/psr7/compare/1.2.2...1.2.3
|
243 |
+
[1.2.2]: https://github.com/guzzle/psr7/compare/1.2.1...1.2.2
|
244 |
+
[1.2.1]: https://github.com/guzzle/psr7/compare/1.2.0...1.2.1
|
245 |
+
[1.2.0]: https://github.com/guzzle/psr7/compare/1.1.0...1.2.0
|
246 |
+
[1.1.0]: https://github.com/guzzle/psr7/compare/1.0.0...1.1.0
|
vendor/guzzlehttp/psr7/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
+
of this software and associated documentation files (the "Software"), to deal
|
5 |
+
in the Software without restriction, including without limitation the rights
|
6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
+
copies of the Software, and to permit persons to whom the Software is
|
8 |
+
furnished to do so, subject to the following conditions:
|
9 |
+
|
10 |
+
The above copyright notice and this permission notice shall be included in
|
11 |
+
all copies or substantial portions of the Software.
|
12 |
+
|
13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
+
THE SOFTWARE.
|
vendor/guzzlehttp/psr7/README.md
ADDED
@@ -0,0 +1,745 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# PSR-7 Message Implementation
|
2 |
+
|
3 |
+
This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/)
|
4 |
+
message implementation, several stream decorators, and some helpful
|
5 |
+
functionality like query string parsing.
|
6 |
+
|
7 |
+
|
8 |
+
[![Build Status](https://travis-ci.org/guzzle/psr7.svg?branch=master)](https://travis-ci.org/guzzle/psr7)
|
9 |
+
|
10 |
+
|
11 |
+
# Stream implementation
|
12 |
+
|
13 |
+
This package comes with a number of stream implementations and stream
|
14 |
+
decorators.
|
15 |
+
|
16 |
+
|
17 |
+
## AppendStream
|
18 |
+
|
19 |
+
`GuzzleHttp\Psr7\AppendStream`
|
20 |
+
|
21 |
+
Reads from multiple streams, one after the other.
|
22 |
+
|
23 |
+
```php
|
24 |
+
use GuzzleHttp\Psr7;
|
25 |
+
|
26 |
+
$a = Psr7\stream_for('abc, ');
|
27 |
+
$b = Psr7\stream_for('123.');
|
28 |
+
$composed = new Psr7\AppendStream([$a, $b]);
|
29 |
+
|
30 |
+
$composed->addStream(Psr7\stream_for(' Above all listen to me'));
|
31 |
+
|
32 |
+
echo $composed; // abc, 123. Above all listen to me.
|
33 |
+
```
|
34 |
+
|
35 |
+
|
36 |
+
## BufferStream
|
37 |
+
|
38 |
+
`GuzzleHttp\Psr7\BufferStream`
|
39 |
+
|
40 |
+
Provides a buffer stream that can be written to fill a buffer, and read
|
41 |
+
from to remove bytes from the buffer.
|
42 |
+
|
43 |
+
This stream returns a "hwm" metadata value that tells upstream consumers
|
44 |
+
what the configured high water mark of the stream is, or the maximum
|
45 |
+
preferred size of the buffer.
|
46 |
+
|
47 |
+
```php
|
48 |
+
use GuzzleHttp\Psr7;
|
49 |
+
|
50 |
+
// When more than 1024 bytes are in the buffer, it will begin returning
|
51 |
+
// false to writes. This is an indication that writers should slow down.
|
52 |
+
$buffer = new Psr7\BufferStream(1024);
|
53 |
+
```
|
54 |
+
|
55 |
+
|
56 |
+
## CachingStream
|
57 |
+
|
58 |
+
The CachingStream is used to allow seeking over previously read bytes on
|
59 |
+
non-seekable streams. This can be useful when transferring a non-seekable
|
60 |
+
entity body fails due to needing to rewind the stream (for example, resulting
|
61 |
+
from a redirect). Data that is read from the remote stream will be buffered in
|
62 |
+
a PHP temp stream so that previously read bytes are cached first in memory,
|
63 |
+
then on disk.
|
64 |
+
|
65 |
+
```php
|
66 |
+
use GuzzleHttp\Psr7;
|
67 |
+
|
68 |
+
$original = Psr7\stream_for(fopen('http://www.google.com', 'r'));
|
69 |
+
$stream = new Psr7\CachingStream($original);
|
70 |
+
|
71 |
+
$stream->read(1024);
|
72 |
+
echo $stream->tell();
|
73 |
+
// 1024
|
74 |
+
|
75 |
+
$stream->seek(0);
|
76 |
+
echo $stream->tell();
|
77 |
+
// 0
|
78 |
+
```
|
79 |
+
|
80 |
+
|
81 |
+
## DroppingStream
|
82 |
+
|
83 |
+
`GuzzleHttp\Psr7\DroppingStream`
|
84 |
+
|
85 |
+
Stream decorator that begins dropping data once the size of the underlying
|
86 |
+
stream becomes too full.
|
87 |
+
|
88 |
+
```php
|
89 |
+
use GuzzleHttp\Psr7;
|
90 |
+
|
91 |
+
// Create an empty stream
|
92 |
+
$stream = Psr7\stream_for();
|
93 |
+
|
94 |
+
// Start dropping data when the stream has more than 10 bytes
|
95 |
+
$dropping = new Psr7\DroppingStream($stream, 10);
|
96 |
+
|
97 |
+
$dropping->write('01234567890123456789');
|
98 |
+
echo $stream; // 0123456789
|
99 |
+
```
|
100 |
+
|
101 |
+
|
102 |
+
## FnStream
|
103 |
+
|
104 |
+
`GuzzleHttp\Psr7\FnStream`
|
105 |
+
|
106 |
+
Compose stream implementations based on a hash of functions.
|
107 |
+
|
108 |
+
Allows for easy testing and extension of a provided stream without needing
|
109 |
+
to create a concrete class for a simple extension point.
|
110 |
+
|
111 |
+
```php
|
112 |
+
|
113 |
+
use GuzzleHttp\Psr7;
|
114 |
+
|
115 |
+
$stream = Psr7\stream_for('hi');
|
116 |
+
$fnStream = Psr7\FnStream::decorate($stream, [
|
117 |
+
'rewind' => function () use ($stream) {
|
118 |
+
echo 'About to rewind - ';
|
119 |
+
$stream->rewind();
|
120 |
+
echo 'rewound!';
|
121 |
+
}
|
122 |
+
]);
|
123 |
+
|
124 |
+
$fnStream->rewind();
|
125 |
+
// Outputs: About to rewind - rewound!
|
126 |
+
```
|
127 |
+
|
128 |
+
|
129 |
+
## InflateStream
|
130 |
+
|
131 |
+
`GuzzleHttp\Psr7\InflateStream`
|
132 |
+
|
133 |
+
Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
|
134 |
+
|
135 |
+
This stream decorator skips the first 10 bytes of the given stream to remove
|
136 |
+
the gzip header, converts the provided stream to a PHP stream resource,
|
137 |
+
then appends the zlib.inflate filter. The stream is then converted back
|
138 |
+
to a Guzzle stream resource to be used as a Guzzle stream.
|
139 |
+
|
140 |
+
|
141 |
+
## LazyOpenStream
|
142 |
+
|
143 |
+
`GuzzleHttp\Psr7\LazyOpenStream`
|
144 |
+
|
145 |
+
Lazily reads or writes to a file that is opened only after an IO operation
|
146 |
+
take place on the stream.
|
147 |
+
|
148 |
+
```php
|
149 |
+
use GuzzleHttp\Psr7;
|
150 |
+
|
151 |
+
$stream = new Psr7\LazyOpenStream('/path/to/file', 'r');
|
152 |
+
// The file has not yet been opened...
|
153 |
+
|
154 |
+
echo $stream->read(10);
|
155 |
+
// The file is opened and read from only when needed.
|
156 |
+
```
|
157 |
+
|
158 |
+
|
159 |
+
## LimitStream
|
160 |
+
|
161 |
+
`GuzzleHttp\Psr7\LimitStream`
|
162 |
+
|
163 |
+
LimitStream can be used to read a subset or slice of an existing stream object.
|
164 |
+
This can be useful for breaking a large file into smaller pieces to be sent in
|
165 |
+
chunks (e.g. Amazon S3's multipart upload API).
|
166 |
+
|
167 |
+
```php
|
168 |
+
use GuzzleHttp\Psr7;
|
169 |
+
|
170 |
+
$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+'));
|
171 |
+
echo $original->getSize();
|
172 |
+
// >>> 1048576
|
173 |
+
|
174 |
+
// Limit the size of the body to 1024 bytes and start reading from byte 2048
|
175 |
+
$stream = new Psr7\LimitStream($original, 1024, 2048);
|
176 |
+
echo $stream->getSize();
|
177 |
+
// >>> 1024
|
178 |
+
echo $stream->tell();
|
179 |
+
// >>> 0
|
180 |
+
```
|
181 |
+
|
182 |
+
|
183 |
+
## MultipartStream
|
184 |
+
|
185 |
+
`GuzzleHttp\Psr7\MultipartStream`
|
186 |
+
|
187 |
+
Stream that when read returns bytes for a streaming multipart or
|
188 |
+
multipart/form-data stream.
|
189 |
+
|
190 |
+
|
191 |
+
## NoSeekStream
|
192 |
+
|
193 |
+
`GuzzleHttp\Psr7\NoSeekStream`
|
194 |
+
|
195 |
+
NoSeekStream wraps a stream and does not allow seeking.
|
196 |
+
|
197 |
+
```php
|
198 |
+
use GuzzleHttp\Psr7;
|
199 |
+
|
200 |
+
$original = Psr7\stream_for('foo');
|
201 |
+
$noSeek = new Psr7\NoSeekStream($original);
|
202 |
+
|
203 |
+
echo $noSeek->read(3);
|
204 |
+
// foo
|
205 |
+
var_export($noSeek->isSeekable());
|
206 |
+
// false
|
207 |
+
$noSeek->seek(0);
|
208 |
+
var_export($noSeek->read(3));
|
209 |
+
// NULL
|
210 |
+
```
|
211 |
+
|
212 |
+
|
213 |
+
## PumpStream
|
214 |
+
|
215 |
+
`GuzzleHttp\Psr7\PumpStream`
|
216 |
+
|
217 |
+
Provides a read only stream that pumps data from a PHP callable.
|
218 |
+
|
219 |
+
When invoking the provided callable, the PumpStream will pass the amount of
|
220 |
+
data requested to read to the callable. The callable can choose to ignore
|
221 |
+
this value and return fewer or more bytes than requested. Any extra data
|
222 |
+
returned by the provided callable is buffered internally until drained using
|
223 |
+
the read() function of the PumpStream. The provided callable MUST return
|
224 |
+
false when there is no more data to read.
|
225 |
+
|
226 |
+
|
227 |
+
## Implementing stream decorators
|
228 |
+
|
229 |
+
Creating a stream decorator is very easy thanks to the
|
230 |
+
`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that
|
231 |
+
implement `Psr\Http\Message\StreamInterface` by proxying to an underlying
|
232 |
+
stream. Just `use` the `StreamDecoratorTrait` and implement your custom
|
233 |
+
methods.
|
234 |
+
|
235 |
+
For example, let's say we wanted to call a specific function each time the last
|
236 |
+
byte is read from a stream. This could be implemented by overriding the
|
237 |
+
`read()` method.
|
238 |
+
|
239 |
+
```php
|
240 |
+
use Psr\Http\Message\StreamInterface;
|
241 |
+
use GuzzleHttp\Psr7\StreamDecoratorTrait;
|
242 |
+
|
243 |
+
class EofCallbackStream implements StreamInterface
|
244 |
+
{
|
245 |
+
use StreamDecoratorTrait;
|
246 |
+
|
247 |
+
private $callback;
|
248 |
+
|
249 |
+
public function __construct(StreamInterface $stream, callable $cb)
|
250 |
+
{
|
251 |
+
$this->stream = $stream;
|
252 |
+
$this->callback = $cb;
|
253 |
+
}
|
254 |
+
|
255 |
+
public function read($length)
|
256 |
+
{
|
257 |
+
$result = $this->stream->read($length);
|
258 |
+
|
259 |
+
// Invoke the callback when EOF is hit.
|
260 |
+
if ($this->eof()) {
|
261 |
+
call_user_func($this->callback);
|
262 |
+
}
|
263 |
+
|
264 |
+
return $result;
|
265 |
+
}
|
266 |
+
}
|
267 |
+
```
|
268 |
+
|
269 |
+
This decorator could be added to any existing stream and used like so:
|
270 |
+
|
271 |
+
```php
|
272 |
+
use GuzzleHttp\Psr7;
|
273 |
+
|
274 |
+
$original = Psr7\stream_for('foo');
|
275 |
+
|
276 |
+
$eofStream = new EofCallbackStream($original, function () {
|
277 |
+
echo 'EOF!';
|
278 |
+
});
|
279 |
+
|
280 |
+
$eofStream->read(2);
|
281 |
+
$eofStream->read(1);
|
282 |
+
// echoes "EOF!"
|
283 |
+
$eofStream->seek(0);
|
284 |
+
$eofStream->read(3);
|
285 |
+
// echoes "EOF!"
|
286 |
+
```
|
287 |
+
|
288 |
+
|
289 |
+
## PHP StreamWrapper
|
290 |
+
|
291 |
+
You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a
|
292 |
+
PSR-7 stream as a PHP stream resource.
|
293 |
+
|
294 |
+
Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP
|
295 |
+
stream from a PSR-7 stream.
|
296 |
+
|
297 |
+
```php
|
298 |
+
use GuzzleHttp\Psr7\StreamWrapper;
|
299 |
+
|
300 |
+
$stream = GuzzleHttp\Psr7\stream_for('hello!');
|
301 |
+
$resource = StreamWrapper::getResource($stream);
|
302 |
+
echo fread($resource, 6); // outputs hello!
|
303 |
+
```
|
304 |
+
|
305 |
+
|
306 |
+
# Function API
|
307 |
+
|
308 |
+
There are various functions available under the `GuzzleHttp\Psr7` namespace.
|
309 |
+
|
310 |
+
|
311 |
+
## `function str`
|
312 |
+
|
313 |
+
`function str(MessageInterface $message)`
|
314 |
+
|
315 |
+
Returns the string representation of an HTTP message.
|
316 |
+
|
317 |
+
```php
|
318 |
+
$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
|
319 |
+
echo GuzzleHttp\Psr7\str($request);
|
320 |
+
```
|
321 |
+
|
322 |
+
|
323 |
+
## `function uri_for`
|
324 |
+
|
325 |
+
`function uri_for($uri)`
|
326 |
+
|
327 |
+
This function accepts a string or `Psr\Http\Message\UriInterface` and returns a
|
328 |
+
UriInterface for the given value. If the value is already a `UriInterface`, it
|
329 |
+
is returned as-is.
|
330 |
+
|
331 |
+
```php
|
332 |
+
$uri = GuzzleHttp\Psr7\uri_for('http://example.com');
|
333 |
+
assert($uri === GuzzleHttp\Psr7\uri_for($uri));
|
334 |
+
```
|
335 |
+
|
336 |
+
|
337 |
+
## `function stream_for`
|
338 |
+
|
339 |
+
`function stream_for($resource = '', array $options = [])`
|
340 |
+
|
341 |
+
Create a new stream based on the input type.
|
342 |
+
|
343 |
+
Options is an associative array that can contain the following keys:
|
344 |
+
|
345 |
+
* - metadata: Array of custom metadata.
|
346 |
+
* - size: Size of the stream.
|
347 |
+
|
348 |
+
This method accepts the following `$resource` types:
|
349 |
+
|
350 |
+
- `Psr\Http\Message\StreamInterface`: Returns the value as-is.
|
351 |
+
- `string`: Creates a stream object that uses the given string as the contents.
|
352 |
+
- `resource`: Creates a stream object that wraps the given PHP stream resource.
|
353 |
+
- `Iterator`: If the provided value implements `Iterator`, then a read-only
|
354 |
+
stream object will be created that wraps the given iterable. Each time the
|
355 |
+
stream is read from, data from the iterator will fill a buffer and will be
|
356 |
+
continuously called until the buffer is equal to the requested read size.
|
357 |
+
Subsequent read calls will first read from the buffer and then call `next`
|
358 |
+
on the underlying iterator until it is exhausted.
|
359 |
+
- `object` with `__toString()`: If the object has the `__toString()` method,
|
360 |
+
the object will be cast to a string and then a stream will be returned that
|
361 |
+
uses the string value.
|
362 |
+
- `NULL`: When `null` is passed, an empty stream object is returned.
|
363 |
+
- `callable` When a callable is passed, a read-only stream object will be
|
364 |
+
created that invokes the given callable. The callable is invoked with the
|
365 |
+
number of suggested bytes to read. The callable can return any number of
|
366 |
+
bytes, but MUST return `false` when there is no more data to return. The
|
367 |
+
stream object that wraps the callable will invoke the callable until the
|
368 |
+
number of requested bytes are available. Any additional bytes will be
|
369 |
+
buffered and used in subsequent reads.
|
370 |
+
|
371 |
+
```php
|
372 |
+
$stream = GuzzleHttp\Psr7\stream_for('foo');
|
373 |
+
$stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r'));
|
374 |
+
|
375 |
+
$generator = function ($bytes) {
|
376 |
+
for ($i = 0; $i < $bytes; $i++) {
|
377 |
+
yield ' ';
|
378 |
+
}
|
379 |
+
}
|
380 |
+
|
381 |
+
$stream = GuzzleHttp\Psr7\stream_for($generator(100));
|
382 |
+
```
|
383 |
+
|
384 |
+
|
385 |
+
## `function parse_header`
|
386 |
+
|
387 |
+
`function parse_header($header)`
|
388 |
+
|
389 |
+
Parse an array of header values containing ";" separated data into an array of
|
390 |
+
associative arrays representing the header key value pair data of the header.
|
391 |
+
When a parameter does not contain a value, but just contains a key, this
|
392 |
+
function will inject a key with a '' string value.
|
393 |
+
|
394 |
+
|
395 |
+
## `function normalize_header`
|
396 |
+
|
397 |
+
`function normalize_header($header)`
|
398 |
+
|
399 |
+
Converts an array of header values that may contain comma separated headers
|
400 |
+
into an array of headers with no comma separated values.
|
401 |
+
|
402 |
+
|
403 |
+
## `function modify_request`
|
404 |
+
|
405 |
+
`function modify_request(RequestInterface $request, array $changes)`
|
406 |
+
|
407 |
+
Clone and modify a request with the given changes. This method is useful for
|
408 |
+
reducing the number of clones needed to mutate a message.
|
409 |
+
|
410 |
+
The changes can be one of:
|
411 |
+
|
412 |
+
- method: (string) Changes the HTTP method.
|
413 |
+
- set_headers: (array) Sets the given headers.
|
414 |
+
- remove_headers: (array) Remove the given headers.
|
415 |
+
- body: (mixed) Sets the given body.
|
416 |
+
- uri: (UriInterface) Set the URI.
|
417 |
+
- query: (string) Set the query string value of the URI.
|
418 |
+
- version: (string) Set the protocol version.
|
419 |
+
|
420 |
+
|
421 |
+
## `function rewind_body`
|
422 |
+
|
423 |
+
`function rewind_body(MessageInterface $message)`
|
424 |
+
|
425 |
+
Attempts to rewind a message body and throws an exception on failure. The body
|
426 |
+
of the message will only be rewound if a call to `tell()` returns a value other
|
427 |
+
than `0`.
|
428 |
+
|
429 |
+
|
430 |
+
## `function try_fopen`
|
431 |
+
|
432 |
+
`function try_fopen($filename, $mode)`
|
433 |
+
|
434 |
+
Safely opens a PHP stream resource using a filename.
|
435 |
+
|
436 |
+
When fopen fails, PHP normally raises a warning. This function adds an error
|
437 |
+
handler that checks for errors and throws an exception instead.
|
438 |
+
|
439 |
+
|
440 |
+
## `function copy_to_string`
|
441 |
+
|
442 |
+
`function copy_to_string(StreamInterface $stream, $maxLen = -1)`
|
443 |
+
|
444 |
+
Copy the contents of a stream into a string until the given number of bytes
|
445 |
+
have been read.
|
446 |
+
|
447 |
+
|
448 |
+
## `function copy_to_stream`
|
449 |
+
|
450 |
+
`function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)`
|
451 |
+
|
452 |
+
Copy the contents of a stream into another stream until the given number of
|
453 |
+
bytes have been read.
|
454 |
+
|
455 |
+
|
456 |
+
## `function hash`
|
457 |
+
|
458 |
+
`function hash(StreamInterface $stream, $algo, $rawOutput = false)`
|
459 |
+
|
460 |
+
Calculate a hash of a Stream. This method reads the entire stream to calculate
|
461 |
+
a rolling hash (based on PHP's hash_init functions).
|
462 |
+
|
463 |
+
|
464 |
+
## `function readline`
|
465 |
+
|
466 |
+
`function readline(StreamInterface $stream, $maxLength = null)`
|
467 |
+
|
468 |
+
Read a line from the stream up to the maximum allowed buffer length.
|
469 |
+
|
470 |
+
|
471 |
+
## `function parse_request`
|
472 |
+
|
473 |
+
`function parse_request($message)`
|
474 |
+
|
475 |
+
Parses a request message string into a request object.
|
476 |
+
|
477 |
+
|
478 |
+
## `function parse_response`
|
479 |
+
|
480 |
+
`function parse_response($message)`
|
481 |
+
|
482 |
+
Parses a response message string into a response object.
|
483 |
+
|
484 |
+
|
485 |
+
## `function parse_query`
|
486 |
+
|
487 |
+
`function parse_query($str, $urlEncoding = true)`
|
488 |
+
|
489 |
+
Parse a query string into an associative array.
|
490 |
+
|
491 |
+
If multiple values are found for the same key, the value of that key value pair
|
492 |
+
will become an array. This function does not parse nested PHP style arrays into
|
493 |
+
an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed into
|
494 |
+
`['foo[a]' => '1', 'foo[b]' => '2']`).
|
495 |
+
|
496 |
+
|
497 |
+
## `function build_query`
|
498 |
+
|
499 |
+
`function build_query(array $params, $encoding = PHP_QUERY_RFC3986)`
|
500 |
+
|
501 |
+
Build a query string from an array of key value pairs.
|
502 |
+
|
503 |
+
This function can use the return value of parse_query() to build a query string.
|
504 |
+
This function does not modify the provided keys when an array is encountered
|
505 |
+
(like http_build_query would).
|
506 |
+
|
507 |
+
|
508 |
+
## `function mimetype_from_filename`
|
509 |
+
|
510 |
+
`function mimetype_from_filename($filename)`
|
511 |
+
|
512 |
+
Determines the mimetype of a file by looking at its extension.
|
513 |
+
|
514 |
+
|
515 |
+
## `function mimetype_from_extension`
|
516 |
+
|
517 |
+
`function mimetype_from_extension($extension)`
|
518 |
+
|
519 |
+
Maps a file extensions to a mimetype.
|
520 |
+
|
521 |
+
|
522 |
+
# Additional URI Methods
|
523 |
+
|
524 |
+
Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class,
|
525 |
+
this library also provides additional functionality when working with URIs as static methods.
|
526 |
+
|
527 |
+
## URI Types
|
528 |
+
|
529 |
+
An instance of `Psr\Http\Message\UriInterface` can either be an absolute URI or a relative reference.
|
530 |
+
An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI,
|
531 |
+
the base URI. Relative references can be divided into several forms according to
|
532 |
+
[RFC 3986 Section 4.2](https://tools.ietf.org/html/rfc3986#section-4.2):
|
533 |
+
|
534 |
+
- network-path references, e.g. `//example.com/path`
|
535 |
+
- absolute-path references, e.g. `/path`
|
536 |
+
- relative-path references, e.g. `subpath`
|
537 |
+
|
538 |
+
The following methods can be used to identify the type of the URI.
|
539 |
+
|
540 |
+
### `GuzzleHttp\Psr7\Uri::isAbsolute`
|
541 |
+
|
542 |
+
`public static function isAbsolute(UriInterface $uri): bool`
|
543 |
+
|
544 |
+
Whether the URI is absolute, i.e. it has a scheme.
|
545 |
+
|
546 |
+
### `GuzzleHttp\Psr7\Uri::isNetworkPathReference`
|
547 |
+
|
548 |
+
`public static function isNetworkPathReference(UriInterface $uri): bool`
|
549 |
+
|
550 |
+
Whether the URI is a network-path reference. A relative reference that begins with two slash characters is
|
551 |
+
termed an network-path reference.
|
552 |
+
|
553 |
+
### `GuzzleHttp\Psr7\Uri::isAbsolutePathReference`
|
554 |
+
|
555 |
+
`public static function isAbsolutePathReference(UriInterface $uri): bool`
|
556 |
+
|
557 |
+
Whether the URI is a absolute-path reference. A relative reference that begins with a single slash character is
|
558 |
+
termed an absolute-path reference.
|
559 |
+
|
560 |
+
### `GuzzleHttp\Psr7\Uri::isRelativePathReference`
|
561 |
+
|
562 |
+
`public static function isRelativePathReference(UriInterface $uri): bool`
|
563 |
+
|
564 |
+
Whether the URI is a relative-path reference. A relative reference that does not begin with a slash character is
|
565 |
+
termed a relative-path reference.
|
566 |
+
|
567 |
+
### `GuzzleHttp\Psr7\Uri::isSameDocumentReference`
|
568 |
+
|
569 |
+
`public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool`
|
570 |
+
|
571 |
+
Whether the URI is a same-document reference. A same-document reference refers to a URI that is, aside from its
|
572 |
+
fragment component, identical to the base URI. When no base URI is given, only an empty URI reference
|
573 |
+
(apart from its fragment) is considered a same-document reference.
|
574 |
+
|
575 |
+
## URI Components
|
576 |
+
|
577 |
+
Additional methods to work with URI components.
|
578 |
+
|
579 |
+
### `GuzzleHttp\Psr7\Uri::isDefaultPort`
|
580 |
+
|
581 |
+
`public static function isDefaultPort(UriInterface $uri): bool`
|
582 |
+
|
583 |
+
Whether the URI has the default port of the current scheme. `Psr\Http\Message\UriInterface::getPort` may return null
|
584 |
+
or the standard port. This method can be used independently of the implementation.
|
585 |
+
|
586 |
+
### `GuzzleHttp\Psr7\Uri::composeComponents`
|
587 |
+
|
588 |
+
`public static function composeComponents($scheme, $authority, $path, $query, $fragment): string`
|
589 |
+
|
590 |
+
Composes a URI reference string from its various components according to
|
591 |
+
[RFC 3986 Section 5.3](https://tools.ietf.org/html/rfc3986#section-5.3). Usually this method does not need to be called
|
592 |
+
manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__toString`.
|
593 |
+
|
594 |
+
### `GuzzleHttp\Psr7\Uri::fromParts`
|
595 |
+
|
596 |
+
`public static function fromParts(array $parts): UriInterface`
|
597 |
+
|
598 |
+
Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components.
|
599 |
+
|
600 |
+
|
601 |
+
### `GuzzleHttp\Psr7\Uri::withQueryValue`
|
602 |
+
|
603 |
+
`public static function withQueryValue(UriInterface $uri, $key, $value): UriInterface`
|
604 |
+
|
605 |
+
Creates a new URI with a specific query string value. Any existing query string values that exactly match the
|
606 |
+
provided key are removed and replaced with the given key value pair. A value of null will set the query string
|
607 |
+
key without a value, e.g. "key" instead of "key=value".
|
608 |
+
|
609 |
+
### `GuzzleHttp\Psr7\Uri::withQueryValues`
|
610 |
+
|
611 |
+
`public static function withQueryValues(UriInterface $uri, array $keyValueArray): UriInterface`
|
612 |
+
|
613 |
+
Creates a new URI with multiple query string values. It has the same behavior as `withQueryValue()` but for an
|
614 |
+
associative array of key => value.
|
615 |
+
|
616 |
+
### `GuzzleHttp\Psr7\Uri::withoutQueryValue`
|
617 |
+
|
618 |
+
`public static function withoutQueryValue(UriInterface $uri, $key): UriInterface`
|
619 |
+
|
620 |
+
Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the
|
621 |
+
provided key are removed.
|
622 |
+
|
623 |
+
## Reference Resolution
|
624 |
+
|
625 |
+
`GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according
|
626 |
+
to [RFC 3986 Section 5](https://tools.ietf.org/html/rfc3986#section-5). This is for example also what web browsers
|
627 |
+
do when resolving a link in a website based on the current request URI.
|
628 |
+
|
629 |
+
### `GuzzleHttp\Psr7\UriResolver::resolve`
|
630 |
+
|
631 |
+
`public static function resolve(UriInterface $base, UriInterface $rel): UriInterface`
|
632 |
+
|
633 |
+
Converts the relative URI into a new URI that is resolved against the base URI.
|
634 |
+
|
635 |
+
### `GuzzleHttp\Psr7\UriResolver::removeDotSegments`
|
636 |
+
|
637 |
+
`public static function removeDotSegments(string $path): string`
|
638 |
+
|
639 |
+
Removes dot segments from a path and returns the new path according to
|
640 |
+
[RFC 3986 Section 5.2.4](https://tools.ietf.org/html/rfc3986#section-5.2.4).
|
641 |
+
|
642 |
+
### `GuzzleHttp\Psr7\UriResolver::relativize`
|
643 |
+
|
644 |
+
`public static function relativize(UriInterface $base, UriInterface $target): UriInterface`
|
645 |
+
|
646 |
+
Returns the target URI as a relative reference from the base URI. This method is the counterpart to resolve():
|
647 |
+
|
648 |
+
```php
|
649 |
+
(string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target))
|
650 |
+
```
|
651 |
+
|
652 |
+
One use-case is to use the current request URI as base URI and then generate relative links in your documents
|
653 |
+
to reduce the document size or offer self-contained downloadable document archives.
|
654 |
+
|
655 |
+
```php
|
656 |
+
$base = new Uri('http://example.com/a/b/');
|
657 |
+
echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'.
|
658 |
+
echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'.
|
659 |
+
echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'.
|
660 |
+
echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'.
|
661 |
+
```
|
662 |
+
|
663 |
+
## Normalization and Comparison
|
664 |
+
|
665 |
+
`GuzzleHttp\Psr7\UriNormalizer` provides methods to normalize and compare URIs according to
|
666 |
+
[RFC 3986 Section 6](https://tools.ietf.org/html/rfc3986#section-6).
|
667 |
+
|
668 |
+
### `GuzzleHttp\Psr7\UriNormalizer::normalize`
|
669 |
+
|
670 |
+
`public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS): UriInterface`
|
671 |
+
|
672 |
+
Returns a normalized URI. The scheme and host component are already normalized to lowercase per PSR-7 UriInterface.
|
673 |
+
This methods adds additional normalizations that can be configured with the `$flags` parameter which is a bitmask
|
674 |
+
of normalizations to apply. The following normalizations are available:
|
675 |
+
|
676 |
+
- `UriNormalizer::PRESERVING_NORMALIZATIONS`
|
677 |
+
|
678 |
+
Default normalizations which only include the ones that preserve semantics.
|
679 |
+
|
680 |
+
- `UriNormalizer::CAPITALIZE_PERCENT_ENCODING`
|
681 |
+
|
682 |
+
All letters within a percent-encoding triplet (e.g., "%3A") are case-insensitive, and should be capitalized.
|
683 |
+
|
684 |
+
Example: `http://example.org/a%c2%b1b` → `http://example.org/a%C2%B1b`
|
685 |
+
|
686 |
+
- `UriNormalizer::DECODE_UNRESERVED_CHARACTERS`
|
687 |
+
|
688 |
+
Decodes percent-encoded octets of unreserved characters. For consistency, percent-encoded octets in the ranges of
|
689 |
+
ALPHA (%41–%5A and %61–%7A), DIGIT (%30–%39), hyphen (%2D), period (%2E), underscore (%5F), or tilde (%7E) should
|
690 |
+
not be created by URI producers and, when found in a URI, should be decoded to their corresponding unreserved
|
691 |
+
characters by URI normalizers.
|
692 |
+
|
693 |
+
Example: `http://example.org/%7Eusern%61me/` → `http://example.org/~username/`
|
694 |
+
|
695 |
+
- `UriNormalizer::CONVERT_EMPTY_PATH`
|
696 |
+
|
697 |
+
Converts the empty path to "/" for http and https URIs.
|
698 |
+
|
699 |
+
Example: `http://example.org` → `http://example.org/`
|
700 |
+
|
701 |
+
- `UriNormalizer::REMOVE_DEFAULT_HOST`
|
702 |
+
|
703 |
+
Removes the default host of the given URI scheme from the URI. Only the "file" scheme defines the default host
|
704 |
+
"localhost". All of `file:/myfile`, `file:///myfile`, and `file://localhost/myfile` are equivalent according to
|
705 |
+
RFC 3986.
|
706 |
+
|
707 |
+
Example: `file://localhost/myfile` → `file:///myfile`
|
708 |
+
|
709 |
+
- `UriNormalizer::REMOVE_DEFAULT_PORT`
|
710 |
+
|
711 |
+
Removes the default port of the given URI scheme from the URI.
|
712 |
+
|
713 |
+
Example: `http://example.org:80/` → `http://example.org/`
|
714 |
+
|
715 |
+
- `UriNormalizer::REMOVE_DOT_SEGMENTS`
|
716 |
+
|
717 |
+
Removes unnecessary dot-segments. Dot-segments in relative-path references are not removed as it would
|
718 |
+
change the semantics of the URI reference.
|
719 |
+
|
720 |
+
Example: `http://example.org/../a/b/../c/./d.html` → `http://example.org/a/c/d.html`
|
721 |
+
|
722 |
+
- `UriNormalizer::REMOVE_DUPLICATE_SLASHES`
|
723 |
+
|
724 |
+
Paths which include two or more adjacent slashes are converted to one. Webservers usually ignore duplicate slashes
|
725 |
+
and treat those URIs equivalent. But in theory those URIs do not need to be equivalent. So this normalization
|
726 |
+
may change the semantics. Encoded slashes (%2F) are not removed.
|
727 |
+
|
728 |
+
Example: `http://example.org//foo///bar.html` → `http://example.org/foo/bar.html`
|
729 |
+
|
730 |
+
- `UriNormalizer::SORT_QUERY_PARAMETERS`
|
731 |
+
|
732 |
+
Sort query parameters with their values in alphabetical order. However, the order of parameters in a URI may be
|
733 |
+
significant (this is not defined by the standard). So this normalization is not safe and may change the semantics
|
734 |
+
of the URI.
|
735 |
+
|
736 |
+
Example: `?lang=en&article=fred` → `?article=fred&lang=en`
|
737 |
+
|
738 |
+
### `GuzzleHttp\Psr7\UriNormalizer::isEquivalent`
|
739 |
+
|
740 |
+
`public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS): bool`
|
741 |
+
|
742 |
+
Whether two URIs can be considered equivalent. Both URIs are normalized automatically before comparison with the given
|
743 |
+
`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
|
744 |
+
This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
|
745 |
+
equivalence or difference of relative references does not mean anything.
|
vendor/guzzlehttp/psr7/composer.json
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "guzzlehttp/psr7",
|
3 |
+
"type": "library",
|
4 |
+
"description": "PSR-7 message implementation that also provides common utility methods",
|
5 |
+
"keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"],
|
6 |
+
"license": "MIT",
|
7 |
+
"authors": [
|
8 |
+
{
|
9 |
+
"name": "Michael Dowling",
|
10 |
+
"email": "mtdowling@gmail.com",
|
11 |
+
"homepage": "https://github.com/mtdowling"
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"name": "Tobias Schultze",
|
15 |
+
"homepage": "https://github.com/Tobion"
|
16 |
+
}
|
17 |
+
],
|
18 |
+
"require": {
|
19 |
+
"php": ">=5.4.0",
|
20 |
+
"psr/http-message": "~1.0",
|
21 |
+
"ralouphie/getallheaders": "^2.0.5 || ^3.0.0"
|
22 |
+
},
|
23 |
+
"require-dev": {
|
24 |
+
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8",
|
25 |
+
"ext-zlib": "*"
|
26 |
+
},
|
27 |
+
"provide": {
|
28 |
+
"psr/http-message-implementation": "1.0"
|
29 |
+
},
|
30 |
+
"suggest": {
|
31 |
+
"zendframework/zend-httphandlerrunner": "Emit PSR-7 responses"
|
32 |
+
},
|
33 |
+
"autoload": {
|
34 |
+
"psr-4": {
|
35 |
+
"GuzzleHttp\\Psr7\\": "src/"
|
36 |
+
},
|
37 |
+
"files": ["src/functions_include.php"]
|
38 |
+
},
|
39 |
+
"autoload-dev": {
|
40 |
+
"psr-4": {
|
41 |
+
"GuzzleHttp\\Tests\\Psr7\\": "tests/"
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"extra": {
|
45 |
+
"branch-alias": {
|
46 |
+
"dev-master": "1.6-dev"
|
47 |
+
}
|
48 |
+
}
|
49 |
+
}
|
vendor/guzzlehttp/psr7/src/AppendStream.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Reads from multiple streams, one after the other.
|
8 |
+
*
|
9 |
+
* This is a read-only stream decorator.
|
10 |
+
*/
|
11 |
+
class AppendStream implements StreamInterface
|
12 |
+
{
|
13 |
+
/** @var StreamInterface[] Streams being decorated */
|
14 |
+
private $streams = [];
|
15 |
+
|
16 |
+
private $seekable = true;
|
17 |
+
private $current = 0;
|
18 |
+
private $pos = 0;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param StreamInterface[] $streams Streams to decorate. Each stream must
|
22 |
+
* be readable.
|
23 |
+
*/
|
24 |
+
public function __construct(array $streams = [])
|
25 |
+
{
|
26 |
+
foreach ($streams as $stream) {
|
27 |
+
$this->addStream($stream);
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
public function __toString()
|
32 |
+
{
|
33 |
+
try {
|
34 |
+
$this->rewind();
|
35 |
+
return $this->getContents();
|
36 |
+
} catch (\Exception $e) {
|
37 |
+
return '';
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Add a stream to the AppendStream
|
43 |
+
*
|
44 |
+
* @param StreamInterface $stream Stream to append. Must be readable.
|
45 |
+
*
|
46 |
+
* @throws \InvalidArgumentException if the stream is not readable
|
47 |
+
*/
|
48 |
+
public function addStream(StreamInterface $stream)
|
49 |
+
{
|
50 |
+
if (!$stream->isReadable()) {
|
51 |
+
throw new \InvalidArgumentException('Each stream must be readable');
|
52 |
+
}
|
53 |
+
|
54 |
+
// The stream is only seekable if all streams are seekable
|
55 |
+
if (!$stream->isSeekable()) {
|
56 |
+
$this->seekable = false;
|
57 |
+
}
|
58 |
+
|
59 |
+
$this->streams[] = $stream;
|
60 |
+
}
|
61 |
+
|
62 |
+
public function getContents()
|
63 |
+
{
|
64 |
+
return copy_to_string($this);
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Closes each attached stream.
|
69 |
+
*
|
70 |
+
* {@inheritdoc}
|
71 |
+
*/
|
72 |
+
public function close()
|
73 |
+
{
|
74 |
+
$this->pos = $this->current = 0;
|
75 |
+
$this->seekable = true;
|
76 |
+
|
77 |
+
foreach ($this->streams as $stream) {
|
78 |
+
$stream->close();
|
79 |
+
}
|
80 |
+
|
81 |
+
$this->streams = [];
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Detaches each attached stream.
|
86 |
+
*
|
87 |
+
* Returns null as it's not clear which underlying stream resource to return.
|
88 |
+
*
|
89 |
+
* {@inheritdoc}
|
90 |
+
*/
|
91 |
+
public function detach()
|
92 |
+
{
|
93 |
+
$this->pos = $this->current = 0;
|
94 |
+
$this->seekable = true;
|
95 |
+
|
96 |
+
foreach ($this->streams as $stream) {
|
97 |
+
$stream->detach();
|
98 |
+
}
|
99 |
+
|
100 |
+
$this->streams = [];
|
101 |
+
}
|
102 |
+
|
103 |
+
public function tell()
|
104 |
+
{
|
105 |
+
return $this->pos;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Tries to calculate the size by adding the size of each stream.
|
110 |
+
*
|
111 |
+
* If any of the streams do not return a valid number, then the size of the
|
112 |
+
* append stream cannot be determined and null is returned.
|
113 |
+
*
|
114 |
+
* {@inheritdoc}
|
115 |
+
*/
|
116 |
+
public function getSize()
|
117 |
+
{
|
118 |
+
$size = 0;
|
119 |
+
|
120 |
+
foreach ($this->streams as $stream) {
|
121 |
+
$s = $stream->getSize();
|
122 |
+
if ($s === null) {
|
123 |
+
return null;
|
124 |
+
}
|
125 |
+
$size += $s;
|
126 |
+
}
|
127 |
+
|
128 |
+
return $size;
|
129 |
+
}
|
130 |
+
|
131 |
+
public function eof()
|
132 |
+
{
|
133 |
+
return !$this->streams ||
|
134 |
+
($this->current >= count($this->streams) - 1 &&
|
135 |
+
$this->streams[$this->current]->eof());
|
136 |
+
}
|
137 |
+
|
138 |
+
public function rewind()
|
139 |
+
{
|
140 |
+
$this->seek(0);
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Attempts to seek to the given position. Only supports SEEK_SET.
|
145 |
+
*
|
146 |
+
* {@inheritdoc}
|
147 |
+
*/
|
148 |
+
public function seek($offset, $whence = SEEK_SET)
|
149 |
+
{
|
150 |
+
if (!$this->seekable) {
|
151 |
+
throw new \RuntimeException('This AppendStream is not seekable');
|
152 |
+
} elseif ($whence !== SEEK_SET) {
|
153 |
+
throw new \RuntimeException('The AppendStream can only seek with SEEK_SET');
|
154 |
+
}
|
155 |
+
|
156 |
+
$this->pos = $this->current = 0;
|
157 |
+
|
158 |
+
// Rewind each stream
|
159 |
+
foreach ($this->streams as $i => $stream) {
|
160 |
+
try {
|
161 |
+
$stream->rewind();
|
162 |
+
} catch (\Exception $e) {
|
163 |
+
throw new \RuntimeException('Unable to seek stream '
|
164 |
+
. $i . ' of the AppendStream', 0, $e);
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
// Seek to the actual position by reading from each stream
|
169 |
+
while ($this->pos < $offset && !$this->eof()) {
|
170 |
+
$result = $this->read(min(8096, $offset - $this->pos));
|
171 |
+
if ($result === '') {
|
172 |
+
break;
|
173 |
+
}
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Reads from all of the appended streams until the length is met or EOF.
|
179 |
+
*
|
180 |
+
* {@inheritdoc}
|
181 |
+
*/
|
182 |
+
public function read($length)
|
183 |
+
{
|
184 |
+
$buffer = '';
|
185 |
+
$total = count($this->streams) - 1;
|
186 |
+
$remaining = $length;
|
187 |
+
$progressToNext = false;
|
188 |
+
|
189 |
+
while ($remaining > 0) {
|
190 |
+
|
191 |
+
// Progress to the next stream if needed.
|
192 |
+
if ($progressToNext || $this->streams[$this->current]->eof()) {
|
193 |
+
$progressToNext = false;
|
194 |
+
if ($this->current === $total) {
|
195 |
+
break;
|
196 |
+
}
|
197 |
+
$this->current++;
|
198 |
+
}
|
199 |
+
|
200 |
+
$result = $this->streams[$this->current]->read($remaining);
|
201 |
+
|
202 |
+
// Using a loose comparison here to match on '', false, and null
|
203 |
+
if ($result == null) {
|
204 |
+
$progressToNext = true;
|
205 |
+
continue;
|
206 |
+
}
|
207 |
+
|
208 |
+
$buffer .= $result;
|
209 |
+
$remaining = $length - strlen($buffer);
|
210 |
+
}
|
211 |
+
|
212 |
+
$this->pos += strlen($buffer);
|
213 |
+
|
214 |
+
return $buffer;
|
215 |
+
}
|
216 |
+
|
217 |
+
public function isReadable()
|
218 |
+
{
|
219 |
+
return true;
|
220 |
+
}
|
221 |
+
|
222 |
+
public function isWritable()
|
223 |
+
{
|
224 |
+
return false;
|
225 |
+
}
|
226 |
+
|
227 |
+
public function isSeekable()
|
228 |
+
{
|
229 |
+
return $this->seekable;
|
230 |
+
}
|
231 |
+
|
232 |
+
public function write($string)
|
233 |
+
{
|
234 |
+
throw new \RuntimeException('Cannot write to an AppendStream');
|
235 |
+
}
|
236 |
+
|
237 |
+
public function getMetadata($key = null)
|
238 |
+
{
|
239 |
+
return $key ? null : [];
|
240 |
+
}
|
241 |
+
}
|
vendor/guzzlehttp/psr7/src/BufferStream.php
ADDED
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Provides a buffer stream that can be written to to fill a buffer, and read
|
8 |
+
* from to remove bytes from the buffer.
|
9 |
+
*
|
10 |
+
* This stream returns a "hwm" metadata value that tells upstream consumers
|
11 |
+
* what the configured high water mark of the stream is, or the maximum
|
12 |
+
* preferred size of the buffer.
|
13 |
+
*/
|
14 |
+
class BufferStream implements StreamInterface
|
15 |
+
{
|
16 |
+
private $hwm;
|
17 |
+
private $buffer = '';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @param int $hwm High water mark, representing the preferred maximum
|
21 |
+
* buffer size. If the size of the buffer exceeds the high
|
22 |
+
* water mark, then calls to write will continue to succeed
|
23 |
+
* but will return false to inform writers to slow down
|
24 |
+
* until the buffer has been drained by reading from it.
|
25 |
+
*/
|
26 |
+
public function __construct($hwm = 16384)
|
27 |
+
{
|
28 |
+
$this->hwm = $hwm;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function __toString()
|
32 |
+
{
|
33 |
+
return $this->getContents();
|
34 |
+
}
|
35 |
+
|
36 |
+
public function getContents()
|
37 |
+
{
|
38 |
+
$buffer = $this->buffer;
|
39 |
+
$this->buffer = '';
|
40 |
+
|
41 |
+
return $buffer;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function close()
|
45 |
+
{
|
46 |
+
$this->buffer = '';
|
47 |
+
}
|
48 |
+
|
49 |
+
public function detach()
|
50 |
+
{
|
51 |
+
$this->close();
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getSize()
|
55 |
+
{
|
56 |
+
return strlen($this->buffer);
|
57 |
+
}
|
58 |
+
|
59 |
+
public function isReadable()
|
60 |
+
{
|
61 |
+
return true;
|
62 |
+
}
|
63 |
+
|
64 |
+
public function isWritable()
|
65 |
+
{
|
66 |
+
return true;
|
67 |
+
}
|
68 |
+
|
69 |
+
public function isSeekable()
|
70 |
+
{
|
71 |
+
return false;
|
72 |
+
}
|
73 |
+
|
74 |
+
public function rewind()
|
75 |
+
{
|
76 |
+
$this->seek(0);
|
77 |
+
}
|
78 |
+
|
79 |
+
public function seek($offset, $whence = SEEK_SET)
|
80 |
+
{
|
81 |
+
throw new \RuntimeException('Cannot seek a BufferStream');
|
82 |
+
}
|
83 |
+
|
84 |
+
public function eof()
|
85 |
+
{
|
86 |
+
return strlen($this->buffer) === 0;
|
87 |
+
}
|
88 |
+
|
89 |
+
public function tell()
|
90 |
+
{
|
91 |
+
throw new \RuntimeException('Cannot determine the position of a BufferStream');
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Reads data from the buffer.
|
96 |
+
*/
|
97 |
+
public function read($length)
|
98 |
+
{
|
99 |
+
$currentLength = strlen($this->buffer);
|
100 |
+
|
101 |
+
if ($length >= $currentLength) {
|
102 |
+
// No need to slice the buffer because we don't have enough data.
|
103 |
+
$result = $this->buffer;
|
104 |
+
$this->buffer = '';
|
105 |
+
} else {
|
106 |
+
// Slice up the result to provide a subset of the buffer.
|
107 |
+
$result = substr($this->buffer, 0, $length);
|
108 |
+
$this->buffer = substr($this->buffer, $length);
|
109 |
+
}
|
110 |
+
|
111 |
+
return $result;
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Writes data to the buffer.
|
116 |
+
*/
|
117 |
+
public function write($string)
|
118 |
+
{
|
119 |
+
$this->buffer .= $string;
|
120 |
+
|
121 |
+
// TODO: What should happen here?
|
122 |
+
if (strlen($this->buffer) >= $this->hwm) {
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
|
126 |
+
return strlen($string);
|
127 |
+
}
|
128 |
+
|
129 |
+
public function getMetadata($key = null)
|
130 |
+
{
|
131 |
+
if ($key == 'hwm') {
|
132 |
+
return $this->hwm;
|
133 |
+
}
|
134 |
+
|
135 |
+
return $key ? null : [];
|
136 |
+
}
|
137 |
+
}
|
vendor/guzzlehttp/psr7/src/CachingStream.php
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Stream decorator that can cache previously read bytes from a sequentially
|
8 |
+
* read stream.
|
9 |
+
*/
|
10 |
+
class CachingStream implements StreamInterface
|
11 |
+
{
|
12 |
+
use StreamDecoratorTrait;
|
13 |
+
|
14 |
+
/** @var StreamInterface Stream being wrapped */
|
15 |
+
private $remoteStream;
|
16 |
+
|
17 |
+
/** @var int Number of bytes to skip reading due to a write on the buffer */
|
18 |
+
private $skipReadBytes = 0;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* We will treat the buffer object as the body of the stream
|
22 |
+
*
|
23 |
+
* @param StreamInterface $stream Stream to cache
|
24 |
+
* @param StreamInterface $target Optionally specify where data is cached
|
25 |
+
*/
|
26 |
+
public function __construct(
|
27 |
+
StreamInterface $stream,
|
28 |
+
StreamInterface $target = null
|
29 |
+
) {
|
30 |
+
$this->remoteStream = $stream;
|
31 |
+
$this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
|
32 |
+
}
|
33 |
+
|
34 |
+
public function getSize()
|
35 |
+
{
|
36 |
+
return max($this->stream->getSize(), $this->remoteStream->getSize());
|
37 |
+
}
|
38 |
+
|
39 |
+
public function rewind()
|
40 |
+
{
|
41 |
+
$this->seek(0);
|
42 |
+
}
|
43 |
+
|
44 |
+
public function seek($offset, $whence = SEEK_SET)
|
45 |
+
{
|
46 |
+
if ($whence == SEEK_SET) {
|
47 |
+
$byte = $offset;
|
48 |
+
} elseif ($whence == SEEK_CUR) {
|
49 |
+
$byte = $offset + $this->tell();
|
50 |
+
} elseif ($whence == SEEK_END) {
|
51 |
+
$size = $this->remoteStream->getSize();
|
52 |
+
if ($size === null) {
|
53 |
+
$size = $this->cacheEntireStream();
|
54 |
+
}
|
55 |
+
$byte = $size + $offset;
|
56 |
+
} else {
|
57 |
+
throw new \InvalidArgumentException('Invalid whence');
|
58 |
+
}
|
59 |
+
|
60 |
+
$diff = $byte - $this->stream->getSize();
|
61 |
+
|
62 |
+
if ($diff > 0) {
|
63 |
+
// Read the remoteStream until we have read in at least the amount
|
64 |
+
// of bytes requested, or we reach the end of the file.
|
65 |
+
while ($diff > 0 && !$this->remoteStream->eof()) {
|
66 |
+
$this->read($diff);
|
67 |
+
$diff = $byte - $this->stream->getSize();
|
68 |
+
}
|
69 |
+
} else {
|
70 |
+
// We can just do a normal seek since we've already seen this byte.
|
71 |
+
$this->stream->seek($byte);
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
public function read($length)
|
76 |
+
{
|
77 |
+
// Perform a regular read on any previously read data from the buffer
|
78 |
+
$data = $this->stream->read($length);
|
79 |
+
$remaining = $length - strlen($data);
|
80 |
+
|
81 |
+
// More data was requested so read from the remote stream
|
82 |
+
if ($remaining) {
|
83 |
+
// If data was written to the buffer in a position that would have
|
84 |
+
// been filled from the remote stream, then we must skip bytes on
|
85 |
+
// the remote stream to emulate overwriting bytes from that
|
86 |
+
// position. This mimics the behavior of other PHP stream wrappers.
|
87 |
+
$remoteData = $this->remoteStream->read(
|
88 |
+
$remaining + $this->skipReadBytes
|
89 |
+
);
|
90 |
+
|
91 |
+
if ($this->skipReadBytes) {
|
92 |
+
$len = strlen($remoteData);
|
93 |
+
$remoteData = substr($remoteData, $this->skipReadBytes);
|
94 |
+
$this->skipReadBytes = max(0, $this->skipReadBytes - $len);
|
95 |
+
}
|
96 |
+
|
97 |
+
$data .= $remoteData;
|
98 |
+
$this->stream->write($remoteData);
|
99 |
+
}
|
100 |
+
|
101 |
+
return $data;
|
102 |
+
}
|
103 |
+
|
104 |
+
public function write($string)
|
105 |
+
{
|
106 |
+
// When appending to the end of the currently read stream, you'll want
|
107 |
+
// to skip bytes from being read from the remote stream to emulate
|
108 |
+
// other stream wrappers. Basically replacing bytes of data of a fixed
|
109 |
+
// length.
|
110 |
+
$overflow = (strlen($string) + $this->tell()) - $this->remoteStream->tell();
|
111 |
+
if ($overflow > 0) {
|
112 |
+
$this->skipReadBytes += $overflow;
|
113 |
+
}
|
114 |
+
|
115 |
+
return $this->stream->write($string);
|
116 |
+
}
|
117 |
+
|
118 |
+
public function eof()
|
119 |
+
{
|
120 |
+
return $this->stream->eof() && $this->remoteStream->eof();
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Close both the remote stream and buffer stream
|
125 |
+
*/
|
126 |
+
public function close()
|
127 |
+
{
|
128 |
+
$this->remoteStream->close() && $this->stream->close();
|
129 |
+
}
|
130 |
+
|
131 |
+
private function cacheEntireStream()
|
132 |
+
{
|
133 |
+
$target = new FnStream(['write' => 'strlen']);
|
134 |
+
copy_to_stream($this, $target);
|
135 |
+
|
136 |
+
return $this->tell();
|
137 |
+
}
|
138 |
+
}
|
vendor/guzzlehttp/psr7/src/DroppingStream.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Stream decorator that begins dropping data once the size of the underlying
|
8 |
+
* stream becomes too full.
|
9 |
+
*/
|
10 |
+
class DroppingStream implements StreamInterface
|
11 |
+
{
|
12 |
+
use StreamDecoratorTrait;
|
13 |
+
|
14 |
+
private $maxLength;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @param StreamInterface $stream Underlying stream to decorate.
|
18 |
+
* @param int $maxLength Maximum size before dropping data.
|
19 |
+
*/
|
20 |
+
public function __construct(StreamInterface $stream, $maxLength)
|
21 |
+
{
|
22 |
+
$this->stream = $stream;
|
23 |
+
$this->maxLength = $maxLength;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function write($string)
|
27 |
+
{
|
28 |
+
$diff = $this->maxLength - $this->stream->getSize();
|
29 |
+
|
30 |
+
// Begin returning 0 when the underlying stream is too large.
|
31 |
+
if ($diff <= 0) {
|
32 |
+
return 0;
|
33 |
+
}
|
34 |
+
|
35 |
+
// Write the stream or a subset of the stream if needed.
|
36 |
+
if (strlen($string) < $diff) {
|
37 |
+
return $this->stream->write($string);
|
38 |
+
}
|
39 |
+
|
40 |
+
return $this->stream->write(substr($string, 0, $diff));
|
41 |
+
}
|
42 |
+
}
|
vendor/guzzlehttp/psr7/src/FnStream.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Compose stream implementations based on a hash of functions.
|
8 |
+
*
|
9 |
+
* Allows for easy testing and extension of a provided stream without needing
|
10 |
+
* to create a concrete class for a simple extension point.
|
11 |
+
*/
|
12 |
+
class FnStream implements StreamInterface
|
13 |
+
{
|
14 |
+
/** @var array */
|
15 |
+
private $methods;
|
16 |
+
|
17 |
+
/** @var array Methods that must be implemented in the given array */
|
18 |
+
private static $slots = ['__toString', 'close', 'detach', 'rewind',
|
19 |
+
'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write',
|
20 |
+
'isReadable', 'read', 'getContents', 'getMetadata'];
|
21 |
+
|
22 |
+
/**
|
23 |
+
* @param array $methods Hash of method name to a callable.
|
24 |
+
*/
|
25 |
+
public function __construct(array $methods)
|
26 |
+
{
|
27 |
+
$this->methods = $methods;
|
28 |
+
|
29 |
+
// Create the functions on the class
|
30 |
+
foreach ($methods as $name => $fn) {
|
31 |
+
$this->{'_fn_' . $name} = $fn;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Lazily determine which methods are not implemented.
|
37 |
+
* @throws \BadMethodCallException
|
38 |
+
*/
|
39 |
+
public function __get($name)
|
40 |
+
{
|
41 |
+
throw new \BadMethodCallException(str_replace('_fn_', '', $name)
|
42 |
+
. '() is not implemented in the FnStream');
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* The close method is called on the underlying stream only if possible.
|
47 |
+
*/
|
48 |
+
public function __destruct()
|
49 |
+
{
|
50 |
+
if (isset($this->_fn_close)) {
|
51 |
+
call_user_func($this->_fn_close);
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* An unserialize would allow the __destruct to run when the unserialized value goes out of scope.
|
57 |
+
* @throws \LogicException
|
58 |
+
*/
|
59 |
+
public function __wakeup()
|
60 |
+
{
|
61 |
+
throw new \LogicException('FnStream should never be unserialized');
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Adds custom functionality to an underlying stream by intercepting
|
66 |
+
* specific method calls.
|
67 |
+
*
|
68 |
+
* @param StreamInterface $stream Stream to decorate
|
69 |
+
* @param array $methods Hash of method name to a closure
|
70 |
+
*
|
71 |
+
* @return FnStream
|
72 |
+
*/
|
73 |
+
public static function decorate(StreamInterface $stream, array $methods)
|
74 |
+
{
|
75 |
+
// If any of the required methods were not provided, then simply
|
76 |
+
// proxy to the decorated stream.
|
77 |
+
foreach (array_diff(self::$slots, array_keys($methods)) as $diff) {
|
78 |
+
$methods[$diff] = [$stream, $diff];
|
79 |
+
}
|
80 |
+
|
81 |
+
return new self($methods);
|
82 |
+
}
|
83 |
+
|
84 |
+
public function __toString()
|
85 |
+
{
|
86 |
+
return call_user_func($this->_fn___toString);
|
87 |
+
}
|
88 |
+
|
89 |
+
public function close()
|
90 |
+
{
|
91 |
+
return call_user_func($this->_fn_close);
|
92 |
+
}
|
93 |
+
|
94 |
+
public function detach()
|
95 |
+
{
|
96 |
+
return call_user_func($this->_fn_detach);
|
97 |
+
}
|
98 |
+
|
99 |
+
public function getSize()
|
100 |
+
{
|
101 |
+
return call_user_func($this->_fn_getSize);
|
102 |
+
}
|
103 |
+
|
104 |
+
public function tell()
|
105 |
+
{
|
106 |
+
return call_user_func($this->_fn_tell);
|
107 |
+
}
|
108 |
+
|
109 |
+
public function eof()
|
110 |
+
{
|
111 |
+
return call_user_func($this->_fn_eof);
|
112 |
+
}
|
113 |
+
|
114 |
+
public function isSeekable()
|
115 |
+
{
|
116 |
+
return call_user_func($this->_fn_isSeekable);
|
117 |
+
}
|
118 |
+
|
119 |
+
public function rewind()
|
120 |
+
{
|
121 |
+
call_user_func($this->_fn_rewind);
|
122 |
+
}
|
123 |
+
|
124 |
+
public function seek($offset, $whence = SEEK_SET)
|
125 |
+
{
|
126 |
+
call_user_func($this->_fn_seek, $offset, $whence);
|
127 |
+
}
|
128 |
+
|
129 |
+
public function isWritable()
|
130 |
+
{
|
131 |
+
return call_user_func($this->_fn_isWritable);
|
132 |
+
}
|
133 |
+
|
134 |
+
public function write($string)
|
135 |
+
{
|
136 |
+
return call_user_func($this->_fn_write, $string);
|
137 |
+
}
|
138 |
+
|
139 |
+
public function isReadable()
|
140 |
+
{
|
141 |
+
return call_user_func($this->_fn_isReadable);
|
142 |
+
}
|
143 |
+
|
144 |
+
public function read($length)
|
145 |
+
{
|
146 |
+
return call_user_func($this->_fn_read, $length);
|
147 |
+
}
|
148 |
+
|
149 |
+
public function getContents()
|
150 |
+
{
|
151 |
+
return call_user_func($this->_fn_getContents);
|
152 |
+
}
|
153 |
+
|
154 |
+
public function getMetadata($key = null)
|
155 |
+
{
|
156 |
+
return call_user_func($this->_fn_getMetadata, $key);
|
157 |
+
}
|
158 |
+
}
|
vendor/guzzlehttp/psr7/src/InflateStream.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
|
8 |
+
*
|
9 |
+
* This stream decorator skips the first 10 bytes of the given stream to remove
|
10 |
+
* the gzip header, converts the provided stream to a PHP stream resource,
|
11 |
+
* then appends the zlib.inflate filter. The stream is then converted back
|
12 |
+
* to a Guzzle stream resource to be used as a Guzzle stream.
|
13 |
+
*
|
14 |
+
* @link http://tools.ietf.org/html/rfc1952
|
15 |
+
* @link http://php.net/manual/en/filters.compression.php
|
16 |
+
*/
|
17 |
+
class InflateStream implements StreamInterface
|
18 |
+
{
|
19 |
+
use StreamDecoratorTrait;
|
20 |
+
|
21 |
+
public function __construct(StreamInterface $stream)
|
22 |
+
{
|
23 |
+
// read the first 10 bytes, ie. gzip header
|
24 |
+
$header = $stream->read(10);
|
25 |
+
$filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header);
|
26 |
+
// Skip the header, that is 10 + length of filename + 1 (nil) bytes
|
27 |
+
$stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength);
|
28 |
+
$resource = StreamWrapper::getResource($stream);
|
29 |
+
stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ);
|
30 |
+
$this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource));
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @param StreamInterface $stream
|
35 |
+
* @param $header
|
36 |
+
* @return int
|
37 |
+
*/
|
38 |
+
private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
|
39 |
+
{
|
40 |
+
$filename_header_length = 0;
|
41 |
+
|
42 |
+
if (substr(bin2hex($header), 6, 2) === '08') {
|
43 |
+
// we have a filename, read until nil
|
44 |
+
$filename_header_length = 1;
|
45 |
+
while ($stream->read(1) !== chr(0)) {
|
46 |
+
$filename_header_length++;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
return $filename_header_length;
|
51 |
+
}
|
52 |
+
}
|
vendor/guzzlehttp/psr7/src/LazyOpenStream.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Lazily reads or writes to a file that is opened only after an IO operation
|
8 |
+
* take place on the stream.
|
9 |
+
*/
|
10 |
+
class LazyOpenStream implements StreamInterface
|
11 |
+
{
|
12 |
+
use StreamDecoratorTrait;
|
13 |
+
|
14 |
+
/** @var string File to open */
|
15 |
+
private $filename;
|
16 |
+
|
17 |
+
/** @var string $mode */
|
18 |
+
private $mode;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param string $filename File to lazily open
|
22 |
+
* @param string $mode fopen mode to use when opening the stream
|
23 |
+
*/
|
24 |
+
public function __construct($filename, $mode)
|
25 |
+
{
|
26 |
+
$this->filename = $filename;
|
27 |
+
$this->mode = $mode;
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Creates the underlying stream lazily when required.
|
32 |
+
*
|
33 |
+
* @return StreamInterface
|
34 |
+
*/
|
35 |
+
protected function createStream()
|
36 |
+
{
|
37 |
+
return stream_for(try_fopen($this->filename, $this->mode));
|
38 |
+
}
|
39 |
+
}
|
vendor/guzzlehttp/psr7/src/LimitStream.php
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Decorator used to return only a subset of a stream
|
9 |
+
*/
|
10 |
+
class LimitStream implements StreamInterface
|
11 |
+
{
|
12 |
+
use StreamDecoratorTrait;
|
13 |
+
|
14 |
+
/** @var int Offset to start reading from */
|
15 |
+
private $offset;
|
16 |
+
|
17 |
+
/** @var int Limit the number of bytes that can be read */
|
18 |
+
private $limit;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param StreamInterface $stream Stream to wrap
|
22 |
+
* @param int $limit Total number of bytes to allow to be read
|
23 |
+
* from the stream. Pass -1 for no limit.
|
24 |
+
* @param int $offset Position to seek to before reading (only
|
25 |
+
* works on seekable streams).
|
26 |
+
*/
|
27 |
+
public function __construct(
|
28 |
+
StreamInterface $stream,
|
29 |
+
$limit = -1,
|
30 |
+
$offset = 0
|
31 |
+
) {
|
32 |
+
$this->stream = $stream;
|
33 |
+
$this->setLimit($limit);
|
34 |
+
$this->setOffset($offset);
|
35 |
+
}
|
36 |
+
|
37 |
+
public function eof()
|
38 |
+
{
|
39 |
+
// Always return true if the underlying stream is EOF
|
40 |
+
if ($this->stream->eof()) {
|
41 |
+
return true;
|
42 |
+
}
|
43 |
+
|
44 |
+
// No limit and the underlying stream is not at EOF
|
45 |
+
if ($this->limit == -1) {
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
return $this->stream->tell() >= $this->offset + $this->limit;
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Returns the size of the limited subset of data
|
54 |
+
* {@inheritdoc}
|
55 |
+
*/
|
56 |
+
public function getSize()
|
57 |
+
{
|
58 |
+
if (null === ($length = $this->stream->getSize())) {
|
59 |
+
return null;
|
60 |
+
} elseif ($this->limit == -1) {
|
61 |
+
return $length - $this->offset;
|
62 |
+
} else {
|
63 |
+
return min($this->limit, $length - $this->offset);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Allow for a bounded seek on the read limited stream
|
69 |
+
* {@inheritdoc}
|
70 |
+
*/
|
71 |
+
public function seek($offset, $whence = SEEK_SET)
|
72 |
+
{
|
73 |
+
if ($whence !== SEEK_SET || $offset < 0) {
|
74 |
+
throw new \RuntimeException(sprintf(
|
75 |
+
'Cannot seek to offset %s with whence %s',
|
76 |
+
$offset,
|
77 |
+
$whence
|
78 |
+
));
|
79 |
+
}
|
80 |
+
|
81 |
+
$offset += $this->offset;
|
82 |
+
|
83 |
+
if ($this->limit !== -1) {
|
84 |
+
if ($offset > $this->offset + $this->limit) {
|
85 |
+
$offset = $this->offset + $this->limit;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
$this->stream->seek($offset);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Give a relative tell()
|
94 |
+
* {@inheritdoc}
|
95 |
+
*/
|
96 |
+
public function tell()
|
97 |
+
{
|
98 |
+
return $this->stream->tell() - $this->offset;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Set the offset to start limiting from
|
103 |
+
*
|
104 |
+
* @param int $offset Offset to seek to and begin byte limiting from
|
105 |
+
*
|
106 |
+
* @throws \RuntimeException if the stream cannot be seeked.
|
107 |
+
*/
|
108 |
+
public function setOffset($offset)
|
109 |
+
{
|
110 |
+
$current = $this->stream->tell();
|
111 |
+
|
112 |
+
if ($current !== $offset) {
|
113 |
+
// If the stream cannot seek to the offset position, then read to it
|
114 |
+
if ($this->stream->isSeekable()) {
|
115 |
+
$this->stream->seek($offset);
|
116 |
+
} elseif ($current > $offset) {
|
117 |
+
throw new \RuntimeException("Could not seek to stream offset $offset");
|
118 |
+
} else {
|
119 |
+
$this->stream->read($offset - $current);
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
$this->offset = $offset;
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Set the limit of bytes that the decorator allows to be read from the
|
128 |
+
* stream.
|
129 |
+
*
|
130 |
+
* @param int $limit Number of bytes to allow to be read from the stream.
|
131 |
+
* Use -1 for no limit.
|
132 |
+
*/
|
133 |
+
public function setLimit($limit)
|
134 |
+
{
|
135 |
+
$this->limit = $limit;
|
136 |
+
}
|
137 |
+
|
138 |
+
public function read($length)
|
139 |
+
{
|
140 |
+
if ($this->limit == -1) {
|
141 |
+
return $this->stream->read($length);
|
142 |
+
}
|
143 |
+
|
144 |
+
// Check if the current position is less than the total allowed
|
145 |
+
// bytes + original offset
|
146 |
+
$remaining = ($this->offset + $this->limit) - $this->stream->tell();
|
147 |
+
if ($remaining > 0) {
|
148 |
+
// Only return the amount of requested data, ensuring that the byte
|
149 |
+
// limit is not exceeded
|
150 |
+
return $this->stream->read(min($remaining, $length));
|
151 |
+
}
|
152 |
+
|
153 |
+
return '';
|
154 |
+
}
|
155 |
+
}
|
vendor/guzzlehttp/psr7/src/MessageTrait.php
ADDED
@@ -0,0 +1,213 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Trait implementing functionality common to requests and responses.
|
8 |
+
*/
|
9 |
+
trait MessageTrait
|
10 |
+
{
|
11 |
+
/** @var array Map of all registered headers, as original name => array of values */
|
12 |
+
private $headers = [];
|
13 |
+
|
14 |
+
/** @var array Map of lowercase header name => original name at registration */
|
15 |
+
private $headerNames = [];
|
16 |
+
|
17 |
+
/** @var string */
|
18 |
+
private $protocol = '1.1';
|
19 |
+
|
20 |
+
/** @var StreamInterface */
|
21 |
+
private $stream;
|
22 |
+
|
23 |
+
public function getProtocolVersion()
|
24 |
+
{
|
25 |
+
return $this->protocol;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function withProtocolVersion($version)
|
29 |
+
{
|
30 |
+
if ($this->protocol === $version) {
|
31 |
+
return $this;
|
32 |
+
}
|
33 |
+
|
34 |
+
$new = clone $this;
|
35 |
+
$new->protocol = $version;
|
36 |
+
return $new;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function getHeaders()
|
40 |
+
{
|
41 |
+
return $this->headers;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function hasHeader($header)
|
45 |
+
{
|
46 |
+
return isset($this->headerNames[strtolower($header)]);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function getHeader($header)
|
50 |
+
{
|
51 |
+
$header = strtolower($header);
|
52 |
+
|
53 |
+
if (!isset($this->headerNames[$header])) {
|
54 |
+
return [];
|
55 |
+
}
|
56 |
+
|
57 |
+
$header = $this->headerNames[$header];
|
58 |
+
|
59 |
+
return $this->headers[$header];
|
60 |
+
}
|
61 |
+
|
62 |
+
public function getHeaderLine($header)
|
63 |
+
{
|
64 |
+
return implode(', ', $this->getHeader($header));
|
65 |
+
}
|
66 |
+
|
67 |
+
public function withHeader($header, $value)
|
68 |
+
{
|
69 |
+
$this->assertHeader($header);
|
70 |
+
$value = $this->normalizeHeaderValue($value);
|
71 |
+
$normalized = strtolower($header);
|
72 |
+
|
73 |
+
$new = clone $this;
|
74 |
+
if (isset($new->headerNames[$normalized])) {
|
75 |
+
unset($new->headers[$new->headerNames[$normalized]]);
|
76 |
+
}
|
77 |
+
$new->headerNames[$normalized] = $header;
|
78 |
+
$new->headers[$header] = $value;
|
79 |
+
|
80 |
+
return $new;
|
81 |
+
}
|
82 |
+
|
83 |
+
public function withAddedHeader($header, $value)
|
84 |
+
{
|
85 |
+
$this->assertHeader($header);
|
86 |
+
$value = $this->normalizeHeaderValue($value);
|
87 |
+
$normalized = strtolower($header);
|
88 |
+
|
89 |
+
$new = clone $this;
|
90 |
+
if (isset($new->headerNames[$normalized])) {
|
91 |
+
$header = $this->headerNames[$normalized];
|
92 |
+
$new->headers[$header] = array_merge($this->headers[$header], $value);
|
93 |
+
} else {
|
94 |
+
$new->headerNames[$normalized] = $header;
|
95 |
+
$new->headers[$header] = $value;
|
96 |
+
}
|
97 |
+
|
98 |
+
return $new;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function withoutHeader($header)
|
102 |
+
{
|
103 |
+
$normalized = strtolower($header);
|
104 |
+
|
105 |
+
if (!isset($this->headerNames[$normalized])) {
|
106 |
+
return $this;
|
107 |
+
}
|
108 |
+
|
109 |
+
$header = $this->headerNames[$normalized];
|
110 |
+
|
111 |
+
$new = clone $this;
|
112 |
+
unset($new->headers[$header], $new->headerNames[$normalized]);
|
113 |
+
|
114 |
+
return $new;
|
115 |
+
}
|
116 |
+
|
117 |
+
public function getBody()
|
118 |
+
{
|
119 |
+
if (!$this->stream) {
|
120 |
+
$this->stream = stream_for('');
|
121 |
+
}
|
122 |
+
|
123 |
+
return $this->stream;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function withBody(StreamInterface $body)
|
127 |
+
{
|
128 |
+
if ($body === $this->stream) {
|
129 |
+
return $this;
|
130 |
+
}
|
131 |
+
|
132 |
+
$new = clone $this;
|
133 |
+
$new->stream = $body;
|
134 |
+
return $new;
|
135 |
+
}
|
136 |
+
|
137 |
+
private function setHeaders(array $headers)
|
138 |
+
{
|
139 |
+
$this->headerNames = $this->headers = [];
|
140 |
+
foreach ($headers as $header => $value) {
|
141 |
+
if (is_int($header)) {
|
142 |
+
// Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec
|
143 |
+
// and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass.
|
144 |
+
$header = (string) $header;
|
145 |
+
}
|
146 |
+
$this->assertHeader($header);
|
147 |
+
$value = $this->normalizeHeaderValue($value);
|
148 |
+
$normalized = strtolower($header);
|
149 |
+
if (isset($this->headerNames[$normalized])) {
|
150 |
+
$header = $this->headerNames[$normalized];
|
151 |
+
$this->headers[$header] = array_merge($this->headers[$header], $value);
|
152 |
+
} else {
|
153 |
+
$this->headerNames[$normalized] = $header;
|
154 |
+
$this->headers[$header] = $value;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
private function normalizeHeaderValue($value)
|
160 |
+
{
|
161 |
+
if (!is_array($value)) {
|
162 |
+
return $this->trimHeaderValues([$value]);
|
163 |
+
}
|
164 |
+
|
165 |
+
if (count($value) === 0) {
|
166 |
+
throw new \InvalidArgumentException('Header value can not be an empty array.');
|
167 |
+
}
|
168 |
+
|
169 |
+
return $this->trimHeaderValues($value);
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Trims whitespace from the header values.
|
174 |
+
*
|
175 |
+
* Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.
|
176 |
+
*
|
177 |
+
* header-field = field-name ":" OWS field-value OWS
|
178 |
+
* OWS = *( SP / HTAB )
|
179 |
+
*
|
180 |
+
* @param string[] $values Header values
|
181 |
+
*
|
182 |
+
* @return string[] Trimmed header values
|
183 |
+
*
|
184 |
+
* @see https://tools.ietf.org/html/rfc7230#section-3.2.4
|
185 |
+
*/
|
186 |
+
private function trimHeaderValues(array $values)
|
187 |
+
{
|
188 |
+
return array_map(function ($value) {
|
189 |
+
if (!is_scalar($value) && null !== $value) {
|
190 |
+
throw new \InvalidArgumentException(sprintf(
|
191 |
+
'Header value must be scalar or null but %s provided.',
|
192 |
+
is_object($value) ? get_class($value) : gettype($value)
|
193 |
+
));
|
194 |
+
}
|
195 |
+
|
196 |
+
return trim((string) $value, " \t");
|
197 |
+
}, $values);
|
198 |
+
}
|
199 |
+
|
200 |
+
private function assertHeader($header)
|
201 |
+
{
|
202 |
+
if (!is_string($header)) {
|
203 |
+
throw new \InvalidArgumentException(sprintf(
|
204 |
+
'Header name must be a string but %s provided.',
|
205 |
+
is_object($header) ? get_class($header) : gettype($header)
|
206 |
+
));
|
207 |
+
}
|
208 |
+
|
209 |
+
if ($header === '') {
|
210 |
+
throw new \InvalidArgumentException('Header name can not be empty.');
|
211 |
+
}
|
212 |
+
}
|
213 |
+
}
|
vendor/guzzlehttp/psr7/src/MultipartStream.php
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Stream that when read returns bytes for a streaming multipart or
|
8 |
+
* multipart/form-data stream.
|
9 |
+
*/
|
10 |
+
class MultipartStream implements StreamInterface
|
11 |
+
{
|
12 |
+
use StreamDecoratorTrait;
|
13 |
+
|
14 |
+
private $boundary;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @param array $elements Array of associative arrays, each containing a
|
18 |
+
* required "name" key mapping to the form field,
|
19 |
+
* name, a required "contents" key mapping to a
|
20 |
+
* StreamInterface/resource/string, an optional
|
21 |
+
* "headers" associative array of custom headers,
|
22 |
+
* and an optional "filename" key mapping to a
|
23 |
+
* string to send as the filename in the part.
|
24 |
+
* @param string $boundary You can optionally provide a specific boundary
|
25 |
+
*
|
26 |
+
* @throws \InvalidArgumentException
|
27 |
+
*/
|
28 |
+
public function __construct(array $elements = [], $boundary = null)
|
29 |
+
{
|
30 |
+
$this->boundary = $boundary ?: sha1(uniqid('', true));
|
31 |
+
$this->stream = $this->createStream($elements);
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get the boundary
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
+
public function getBoundary()
|
40 |
+
{
|
41 |
+
return $this->boundary;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function isWritable()
|
45 |
+
{
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Get the headers needed before transferring the content of a POST file
|
51 |
+
*/
|
52 |
+
private function getHeaders(array $headers)
|
53 |
+
{
|
54 |
+
$str = '';
|
55 |
+
foreach ($headers as $key => $value) {
|
56 |
+
$str .= "{$key}: {$value}\r\n";
|
57 |
+
}
|
58 |
+
|
59 |
+
return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n";
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Create the aggregate stream that will be used to upload the POST data
|
64 |
+
*/
|
65 |
+
protected function createStream(array $elements)
|
66 |
+
{
|
67 |
+
$stream = new AppendStream();
|
68 |
+
|
69 |
+
foreach ($elements as $element) {
|
70 |
+
$this->addElement($stream, $element);
|
71 |
+
}
|
72 |
+
|
73 |
+
// Add the trailing boundary with CRLF
|
74 |
+
$stream->addStream(stream_for("--{$this->boundary}--\r\n"));
|
75 |
+
|
76 |
+
return $stream;
|
77 |
+
}
|
78 |
+
|
79 |
+
private function addElement(AppendStream $stream, array $element)
|
80 |
+
{
|
81 |
+
foreach (['contents', 'name'] as $key) {
|
82 |
+
if (!array_key_exists($key, $element)) {
|
83 |
+
throw new \InvalidArgumentException("A '{$key}' key is required");
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
$element['contents'] = stream_for($element['contents']);
|
88 |
+
|
89 |
+
if (empty($element['filename'])) {
|
90 |
+
$uri = $element['contents']->getMetadata('uri');
|
91 |
+
if (substr($uri, 0, 6) !== 'php://') {
|
92 |
+
$element['filename'] = $uri;
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
list($body, $headers) = $this->createElement(
|
97 |
+
$element['name'],
|
98 |
+
$element['contents'],
|
99 |
+
isset($element['filename']) ? $element['filename'] : null,
|
100 |
+
isset($element['headers']) ? $element['headers'] : []
|
101 |
+
);
|
102 |
+
|
103 |
+
$stream->addStream(stream_for($this->getHeaders($headers)));
|
104 |
+
$stream->addStream($body);
|
105 |
+
$stream->addStream(stream_for("\r\n"));
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* @return array
|
110 |
+
*/
|
111 |
+
private function createElement($name, StreamInterface $stream, $filename, array $headers)
|
112 |
+
{
|
113 |
+
// Set a default content-disposition header if one was no provided
|
114 |
+
$disposition = $this->getHeader($headers, 'content-disposition');
|
115 |
+
if (!$disposition) {
|
116 |
+
$headers['Content-Disposition'] = ($filename === '0' || $filename)
|
117 |
+
? sprintf('form-data; name="%s"; filename="%s"',
|
118 |
+
$name,
|
119 |
+
basename($filename))
|
120 |
+
: "form-data; name=\"{$name}\"";
|
121 |
+
}
|
122 |
+
|
123 |
+
// Set a default content-length header if one was no provided
|
124 |
+
$length = $this->getHeader($headers, 'content-length');
|
125 |
+
if (!$length) {
|
126 |
+
if ($length = $stream->getSize()) {
|
127 |
+
$headers['Content-Length'] = (string) $length;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
// Set a default Content-Type if one was not supplied
|
132 |
+
$type = $this->getHeader($headers, 'content-type');
|
133 |
+
if (!$type && ($filename === '0' || $filename)) {
|
134 |
+
if ($type = mimetype_from_filename($filename)) {
|
135 |
+
$headers['Content-Type'] = $type;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
return [$stream, $headers];
|
140 |
+
}
|
141 |
+
|
142 |
+
private function getHeader(array $headers, $key)
|
143 |
+
{
|
144 |
+
$lowercaseHeader = strtolower($key);
|
145 |
+
foreach ($headers as $k => $v) {
|
146 |
+
if (strtolower($k) === $lowercaseHeader) {
|
147 |
+
return $v;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
return null;
|
152 |
+
}
|
153 |
+
}
|
vendor/guzzlehttp/psr7/src/NoSeekStream.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace GuzzleHttp\Psr7;
|
3 |
+
|
4 |
+
use Psr\Http\Message\StreamInterface;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Stream decorator that prevents a stream from being seeked
|
8 |
+
*/
|
9 |
+
class NoSeekStream implements StreamInterface
|
10 |
+
{
|
11 |
+
use StreamDecoratorTrait;
|
12 |
+
|
13 |
+
public function seek($offset, $whence = SEEK_SET)
|
14 |
+
{
|
15 |
+
throw new \RuntimeException('Cannot seek a NoSeekStream');
|
16 |
+
}
|
17 |
+
|
18 |
+
public function isSeekable()
|
19 |
+
{
|
20 |
+
return false;
|
21 |
+
}
|
22 |
+
}
|