ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -0,0 +1,65 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2022 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api;
/**
* @since 2.6.0
* To avoid helpdesk tickets it's better to use model instead of interface.
* @see \Plumrocket\Base\Model\ConfigUtils
* Using interface can cause "Cannot instantiate interface"
* because <preference> applies only after cache cleaning.
*/
interface ConfigUtilsInterface
{
/**
* Receive magento config value by store
*
* @param string $path full path, eg: "pr_base/general/enabled"
* @param string|int $store store view code or id
* @return mixed
*/
public function getStoreConfig(string $path, $store = null);
/**
* Is flag set.
*
* @param string $path
* @param null $scopeCode
* @param null $scopeType
* @return bool
*/
public function isSetFlag(string $path, $scopeCode = null, $scopeType = null): bool;
/**
* Receive magento config value by store or by other scope type
*
* @param string $path full path, eg: "pr_base/general/enabled"
* @param string|int $scopeCode store view code or website code
* @param string|null $scopeType
* @return mixed
*/
public function getConfig(string $path, $scopeCode = null, $scopeType = null);
/**
* Convert multiline text into array.
*
* @param string $fieldValue
* @return array
*/
public function splitTextareaValueByLine(string $fieldValue): array;
/**
* Convert multiselect value into array.
*
* @param string $value
* @param bool $clearEmpty
* @return array
*/
public function prepareMultiselectValue(string $value, bool $clearEmpty = true): array;
}
@@ -0,0 +1,77 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api\Data;
/**
* @since 2.5.0
*/
interface ExtensionAuthorizationInterface
{
public const SIGNATURE = 'signature';
public const STATUS = 'status';
public const DATE = 'date';
/**
* Get module name.
*
* @return string
*/
public function getModuleName(): string;
/**
* Check if product is in stock
*
* @return bool
*/
public function isAuthorized(): bool;
/**
* Get status.
*
* @return int
*/
public function getStatus(): int;
/**
* Set status.
*
* @param int $status
* @return \Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface
*/
public function setStatus(int $status): ExtensionAuthorizationInterface;
/**
* Set signature.
*
* @param string $signature
* @return \Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface
*/
public function setSignature(string $signature): ExtensionAuthorizationInterface;
/**
* Get date.
*
* @return string
*/
public function getDate(): string;
/**
* Set date.
*
* @param string $date
* @return \Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface
*/
public function setDate(string $date): ExtensionAuthorizationInterface;
/**
* Check if authorization is cached.
*
* @return bool
*/
public function isCached(): bool;
}
@@ -0,0 +1,186 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api\Data;
/**
* Allows easily retrieve information about plumrocket module
*
* @since 2.5.0
*/
interface ExtensionInformationInterface
{
public const FIELD_IS_SERVICE = 'is_service';
public const FIELD_TITLE = 'title';
public const FIELD_DOCUMENTATION = 'documentation';
/** @deprecated since 2.6.0 */
public const FIELD_WIKI = 'wiki';
public const FIELD_CONFIG_SECTION = 'config_section';
public const FIELD_IS_ENABLED_PATH = 'is_enabled_path';
public const FIELD_MODULE_NAME = 'module_name';
public const FIELD_URL = 'url';
public const FIELD_MARKETPLACE_URL = 'marketplace_url';
/**
* Some examples of services - Token, AmpEmailApi
*
* @return bool
*/
public function isService(): bool;
/**
* Retrieve name of module, e.g. Twitter & Facebook Login
*
* @return string
*/
public function getTitle(): string;
/**
* Retrieve section in system settings, e.g. "pr_social_login"
*
* @return string
*/
public function getConfigSection(): string;
/**
* Retrieve section in system settings, e.g. "pr_social_login/general/enabled"
*
* @return string
*/
public function getIsEnabledFieldConfigPath(): string;
/**
* Link to documentation
*
* @return string
* @since 2.6.0
*/
public function getDocumentationLink(): string;
/**
* Link to wiki
*
* @return string
* @deprecated since 2.6.0
* @see getDocumentationLink
*/
public function getWikiLink(): string;
/**
* Get link to extension store page.
*
* @return string
* @since 2.8.0
*/
public function getUrl(): string;
/**
* Get link to extension marketplace page.
*
* @return string
* @since 2.8.0
*/
public function getMarketplaceUrl(): string;
/**
* Retrieve full name of module, e.g. SocialLoginFree
*
* @return string
*/
public function getModuleName(): string;
/**
* Retrieve full name of module, e.g. Plumrocket_SocialLoginFree
*
* @return string
*/
public function getVendorAndModuleName(): string;
/**
* Retrieve installed version by composer.json
*
* @return string
*/
public function getInstalledVersion(): string;
/**
* Set is service.
*
* @param bool $isService
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
*/
public function setIsService(bool $isService): ExtensionInformationInterface;
/**
* Set extension title.
*
* @param string $title
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
*/
public function setTitle(string $title): ExtensionInformationInterface;
/**
* Set config section key.
*
* @param string $configSection
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
*/
public function setConfigSection(string $configSection): ExtensionInformationInterface;
/**
* Set link to extension documentation.
*
* @param string $documentationLink
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
* @since 2.6.0
*/
public function setDocumentationLink(string $documentationLink): ExtensionInformationInterface;
/**
* Set link to documentation.
*
* @param string $wikiLink
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
* @deprecated since 2.6.0
* @see setDocumentationLink
*/
public function setWikiLink(string $wikiLink): ExtensionInformationInterface;
/**
* Set link to extension store page.
*
* @param string $extensionUrl
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
* @since 2.8.0
*/
public function setUrl(string $extensionUrl): ExtensionInformationInterface;
/**
* Set link to extension marketplace page.
*
* @param string $extensionMarketplaceUrl
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
* @since 2.8.0
*/
public function setMarketplaceUrl(string $extensionMarketplaceUrl): ExtensionInformationInterface;
/**
* Set module name, like Plumrocket_Base.
*
* @param string $moduleName
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
*/
public function setModuleName(string $moduleName): ExtensionInformationInterface;
/**
* Set path to "enable" config field.
*
* @param string $configPath
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
*/
public function setIsEnabledFieldConfigPath(string $configPath): ExtensionInformationInterface;
}
@@ -0,0 +1,33 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\Base\Api\Data;
use Magento\Framework\Api\SearchResultsInterface;
/**
* @since 2.5.0
*/
interface ExtensionInformationSearchResultsInterface extends SearchResultsInterface
{
/**
* Get extension information list.
*
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface[]
*/
public function getItems() : array;
/**
* Set extension information list.
*
* @param \Plumrocket\Base\Api\Data\ExtensionInformationInterface[] $items
* @return $this
*/
public function setItems(array $items) : self;
}
@@ -0,0 +1,35 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2021 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\Base\Api;
use Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface;
/**
* @since 2.5.0
*/
interface ExtensionAuthorizationRepositoryInterface
{
/**
* Get extension authorization by module name.
*
* @param string $moduleName
* @return \Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function get(string $moduleName): ExtensionAuthorizationInterface;
/**
* Save extension authorization.
*
* @param \Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface $extension
* @return \Plumrocket\Base\Api\Data\ExtensionAuthorizationInterface
*/
public function save(ExtensionAuthorizationInterface $extension): ExtensionAuthorizationInterface;
}
@@ -0,0 +1,28 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\Base\Api;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Api\SearchResultsInterface;
/**
* @since 2.5.0
*/
interface ExtensionInformationListInterface
{
/**
* Get extension information
*
* @param \Magento\Framework\Api\SearchCriteriaInterface|null $searchCriteria
* @return \Plumrocket\Base\Api\Data\ExtensionInformationSearchResultsInterface
*/
public function getList(?SearchCriteriaInterface $searchCriteria = null): SearchResultsInterface;
}
@@ -0,0 +1,70 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\Base\Api;
/**
* Allow easily retrieve status of Plumrocket extension
*
* @since 2.4.1
*/
interface ExtensionStatusInterface
{
/**
* Not installed in magento
*/
public const NOT_INSTALLED = 0;
/**
* Installed but disabled from CLI
*/
public const DISABLED_FROM_CLI = 3;
/**
* Installed but disabled in system config
*/
public const DISABLED = 1;
/**
* Installed, enabled in CLI and system config
*/
public const ENABLED = 2;
/**
* Check whether extension is installed, enabled in CLI and in Store -> Configuration
*
* @param string $moduleName either Plumrocket_SocialLoginFree or SocialLoginFree
* @return bool
*/
public function isEnabled(string $moduleName): bool;
/**
* Check whether module is disabled in Store -> Configuration
*
* @param string $moduleName either Plumrocket_SocialLoginFree or SocialLoginFree
* @return bool
*/
public function isDisabled(string $moduleName): bool;
/**
* Check whether extension is disabled from cli
*
* @param string $moduleName either Plumrocket_SocialLoginFree or SocialLoginFree
* @return bool
*/
public function isDisabledFromCli(string $moduleName): bool;
/**
* Check whether extension is not installed
*
* @param string $moduleName either Plumrocket_SocialLoginFree or SocialLoginFree
* @return bool
*/
public function isNotInstalled(string $moduleName): bool;
}
@@ -0,0 +1,27 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api;
use Plumrocket\Base\Api\Data\ExtensionInformationInterface;
/**
* Allow easily retrieve information about Plumrocket extension
*
* @since 2.3.0
*/
interface GetExtensionInformationInterface
{
/**
* Get extension configuration.
*
* @param string $moduleName can be either "Plumrocket_SocialLoginFree" or "SocialLoginFree"
* @return \Plumrocket\Base\Api\Data\ExtensionInformationInterface
*/
public function execute(string $moduleName): ExtensionInformationInterface;
}
@@ -0,0 +1,30 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
declare(strict_types=1);
namespace Plumrocket\Base\Api;
/**
* Get status of Plumrocket extension
*
* We have more convenient service for checking status
* @see \Plumrocket\Base\Api\ExtensionStatusInterface
*
* @since 2.3.9
*/
interface GetExtensionStatusInterface
{
/**
* Retrieve status of Plumrocket module
*
* @param string $moduleName e.g. SocialLoginFree or Plumrocket_SocialLoginFree
* @return int
*/
public function execute(string $moduleName): int;
}
@@ -0,0 +1,23 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api;
/**
* @since 2.1.6
*/
interface GetModuleVersionInterface
{
/**
* Get module version from composer.json.
*
* @param string $moduleName
* @return string
*/
public function execute($moduleName);
}
@@ -0,0 +1,45 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api;
/**
* Collect statistic for specific module
* Must be added to composite collector for send
* @see \Plumrocket\Base\Model\Statistic\Usage\CompositeCollector
*
* @since 2.3.0
*/
interface ModuleUsageStatisticCollectorInterface extends UsageStatisticCollectorInterface
{
/**
* Must return array
* [
* 'config' => [
* 'path' => [
* 'label' => '',
* 'value' => '',
* 'options' => [
* ['value' => value_1, 'label' => label_1],
* ['value' => value_1, 'label' => label_1],
* ],
* 'default' => ''
* ]
* ]
* ]
*
* @return array
*/
public function collect(): array;
/**
* Check if something changed after last send
*
* @return bool
*/
public function hasNewData(): bool;
}
@@ -0,0 +1,24 @@
<?php
/**
* @package Plumrocket_Base
* @copyright Copyright (c) 2020 Plumrocket Inc. (https://plumrocket.com)
* @license https://plumrocket.com/license End-user License Agreement
*/
namespace Plumrocket\Base\Api;
/**
* Collect usage statistic from all the modules that give it
*
* @since 2.3.0
*/
interface UsageStatisticCollectorInterface
{
/**
* Collect statistic.
*
* @return array
*/
public function collect(): array;
}