Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:service:themelicenseservice

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:service:themelicenseservice [2026/09/26 09:09] – admin adminscriptlog:lib:service:themelicenseservice [2026/09/26 09:34] (current) – admin admin
Line 17: Line 17:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Class ThemeLicenseService | +| ''@category'' | Class ThemeLicenseService | 
-  | ''@author'' | MyBlog | +| ''@author'' | MyBlog | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0.0 | +| ''@version'' | 1.0.0 | 
-  | ''@since'' | Since Release 1.0.0 |+| ''@since'' | Since Release 1.0.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
Line 32: Line 32:
 //None.// //None.//
  
-======= Properties (0) =======+======= Properties (2) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''protected'' | ''(untyped)'' | ''$apiBaseUrl'' |  | 28 | 
 +| ''private'' | ''(untyped)'' | ''$timeout'' |  | 35 |
  
 ======= Methods (10) ======= ======= Methods (10) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | Constructor | 43 | +| public | ''__construct()'' | Constructor | 43 | 
-  | public | ''readThemeConfig()'' | Read the theme.ini configuration for a given theme directory. | 55 | +| public | ''readThemeConfig()'' | Read the theme.ini configuration for a given theme directory. | 55 | 
-  | public | ''isPremiumTheme()'' | Determine whether a theme is a premium theme. | 74 | +| public | ''isPremiumTheme()'' | Determine whether a theme is a premium theme. | 74 | 
-  | public | ''activate()'' | Activate a license key against the MyBlog license API. | 97 | +| public | ''activate()'' | Activate a license key against the MyBlog license API. | 97 | 
-  | public | ''validate()'' | Validate an already-activated license. | 120 | +| public | ''validate()'' | Validate an already-activated license. | 120 | 
-  | public | ''deactivate()'' | Deactivate a theme license, releasing one activation slot. | 143 | +| public | ''deactivate()'' | Deactivate a theme license, releasing one activation slot. | 143 | 
-  | protected | ''post()'' | Send an HMAC-signed POST request to the license API. | 167 | +| protected | ''post()'' | Send an HMAC-signed POST request to the license API. | 167 | 
-  | private | ''postCurl()'' | Send the request using cURL. | 198 | +| private | ''postCurl()'' | Send the request using cURL. | 198 | 
-  | private | ''postStream()'' | Send the request using stream context (fallback when cURL is absent). | 234 | +| private | ''postStream()'' | Send the request using stream context (fallback when cURL is absent). | 234 | 
-  | protected | ''parseResponse()'' | Parse the JSON response from the license API. | 278 |+| protected | ''parseResponse()'' | Parse the JSON response from the license API. | 278 |
  
  
Line 61: Line 63:
 Constructor Constructor
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$apiBaseUrl'' | ''(untyped)'' | ''null'' | Override the license API base URL. | +|  ''$apiBaseUrl'' |  ''(untyped)'' |  ''null'' |  Override the license API base URL. | 
-  | ''$timeout'' | ''(untyped)'' | ''10'' | Request timeout in seconds. |+|  ''$timeout'' |  ''(untyped)'' |  ''10'' |  Request timeout in seconds. |
  
  
Line 76: Line 78:
 Read the theme.ini configuration for a given theme directory. Read the theme.ini configuration for a given theme directory.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$themeDirectory'' | ''(untyped)'' | //required// | //none// |+|  ''$themeDirectory'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 92: Line 94:
 Determine whether a theme is a premium theme. Determine whether a theme is a premium theme.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$themeDirectory'' | ''(untyped)'' | //required// | //none// |+|  ''$themeDirectory'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — bool **Returns:** ''(none declared)'' — bool
Line 111: Line 113:
 Body: {"license_key": "...", "domain": "..."} Body: {"license_key": "...", "domain": "..."}
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$licenseKey'' | ''(untyped)'' | //required// | The license key entered by the admin. | +|  ''$licenseKey'' |  ''(untyped)'' |  //required// |  The license key entered by the admin. | 
-  | ''$domain'' | ''(untyped)'' | //required// | The domain where the theme is installed. | +|  ''$domain'' |  ''(untyped)'' |  //required// |  The domain where the theme is installed. | 
-  | ''$productSecret'' | ''(untyped)'' | //required// | Per-product license_secret embedded in the theme. | +|  ''$productSecret'' |  ''(untyped)'' |  //required// |  Per-product license_secret embedded in the theme. | 
-  | ''$productId'' | ''(untyped)'' | //required// | MyBlog store product ID for this theme. |+|  ''$productId'' |  ''(untyped)'' |  //required// |  MyBlog store product ID for this theme. |
  
 **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array} **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array}
Line 133: Line 135:
 Body: {"license_key": "...", "product_id": N} Body: {"license_key": "...", "product_id": N}
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$licenseKey'' | ''(untyped)'' | //required// | //none// | +|  ''$licenseKey'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$productId'' | ''(untyped)'' | //required// | //none// | +|  ''$productId'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$productSecret'' | ''(untyped)'' | //required// | //none// |+|  ''$productSecret'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array} **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array}
Line 154: Line 156:
 Body: {"license_key": "...", "product_id": N} Body: {"license_key": "...", "product_id": N}
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$licenseKey'' | ''(untyped)'' | //required// | //none// | +|  ''$licenseKey'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$productId'' | ''(untyped)'' | //required// | //none// | +|  ''$productId'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$productSecret'' | ''(untyped)'' | //required// | //none// |+|  ''$productSecret'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array} **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array}
Line 176: Line 178:
   signature = hash_hmac('sha256', payload, secret)   signature = hash_hmac('sha256', payload, secret)
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$url'' | ''(untyped)'' | //required// | //none// | +|  ''$url'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$body'' | ''(untyped)'' | //required// | //none// | +|  ''$body'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$secret'' | ''(untyped)'' | //required// | //none// |+|  ''$secret'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array} **Returns:** ''(none declared)'' — array{success: bool, message: string, data?: array}
Line 194: Line 196:
 Send the request using cURL. Send the request using cURL.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$url'' | ''(untyped)'' | //required// | //none// | +|  ''$url'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$body'' | ''(untyped)'' | //required// | //none// | +|  ''$body'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$headers'' | ''array'' | //required// | //none// |+|  ''$headers'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 212: Line 214:
 Send the request using stream context (fallback when cURL is absent). Send the request using stream context (fallback when cURL is absent).
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$url'' | ''(untyped)'' | //required// | //none// | +|  ''$url'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$body'' | ''(untyped)'' | //required// | //none// | +|  ''$body'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$headers'' | ''array'' | //required// | //none// |+|  ''$headers'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 230: Line 232:
 Parse the JSON response from the license API. Parse the JSON response from the license API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$response'' | ''(untyped)'' | //required// | //none// | +|  ''$response'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$httpCode'' | ''(untyped)'' | //required// | //none// |+|  ''$httpCode'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
scriptlog/lib/service/themelicenseservice.1790413760.txt.gz · Last modified: by admin