magium/mcm-pusher-factory
Composer 安装命令:
composer require magium/mcm-pusher-factory
包简介
A Magium Configuration Manager-enabled Factory that allows you to retrieve managed Pusher.com instances
README 文档
README
If you application uses the Magium Configuration Manager you can use this module to retrieve a configured Pusher instance, both on the frontend and the backend.
Installation
composer require magium/mcm-pusher-factory
Follow the instructions at the Magium Configuration Manager GitHub link to get configured, or run the bin/magium-configuration CLI.
Backend Integration
$factory = new \Magium\Configuration\MagiumConfigurationFactory();
$config = $factory->getManager()->getConfiguration();
$pusher = Magium\ConfigurationManager\Pusher\PusherFactory::staticFactory($config);
// or
$factory = new Magium\ConfigurationManager\Pusher\PusherFactory($config);
$pusher = $factory->factory();
or configure your dependency manager to make Magium\ConfigurationManager\Pusher\PusherFactory the factory for the Pusher instance.
Frontend Integration
If you want to use the frontend integration you can use the generic view handler provided here.
<?php
$factory = new \Magium\Configuration\MagiumConfigurationFactory();
$config = $factory->getManager()->getConfiguration();
$helper = new Magium\ConfigurationManager\Pusher($config);
?>
<html>
<head>
<script type="text/javascript">
var pusher = <?php echo $helper->getConnectionJavaScript(); ?>
</script>
</head>
</html>
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-05-08