flamix/plugin-helpers
Composer 安装命令:
composer require flamix/plugin-helpers
包简介
Flamix package to help create CMS plugins
README 文档
README
About
Microframework for writing CMS plugins, contains development logic and several helpers.
Install & Usage
composer require flamix/plugin-helpers
// Init $plugin = \Flamix\Plugin\Init::init(__DIR__, 'FLAMIX_EXCHANGE_PLUGIN')->setLogsPath(WP_CONTENT_DIR . '/upload/flamix/'); // Show witch constant was defined dd($plugin->defined());
Queue
Example how to use Jobs.
use Flamix\Plugin\Queue\SQL; use Flamix\Plugin\Queue\JobCommands; use Flamix\Plugin\Queue\Interfaces\ShouldQueue; class Order extends JobCommands implements ShouldQueue { protected string $success = 'SENT'; protected string $logChannel = 'woo_orders'; /** * Return SQL bridge. * Raw SQL commands for work with JOBs. * * @return SQL */ public function sqlClosure(): SQL { global $wpdb; return new SQL($wpdb->prefix . 'flamix_order_jobs', function ($query, ...$var) use ($wpdb) { return $wpdb->prepare($query, ...$var); }); } /** * Make WP Query to DB and return result. * * @param string $query * @return array|object|\stdClass[]|null */ public function query(string $query) { global $wpdb; return $wpdb->get_results($query); } }
统计信息
- 总下载量: 140
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-11-03
