├── .gitignore ├── README.md ├── docs ├── realtime-web-stack-integration-hosted-symfony-pusher.png ├── realtime-web-stack-integration-self-hosted-symfony-faye.png └── realtime-web-stack-integration-self-hosted-symfony-ratchet.png ├── faye ├── .gitignore ├── index.js └── package.json ├── ratchet ├── .gitignore ├── bin │ └── chat-server.php ├── composer.json ├── composer.lock └── src │ └── ChatApp │ └── Chat.php └── symfony ├── .gitignore ├── README.md ├── app ├── .htaccess ├── AppCache.php ├── AppKernel.php ├── Resources │ └── views │ │ ├── base.html.twig │ │ └── chat │ │ └── chat.html.twig ├── SymfonyRequirements.php ├── autoload.php ├── cache │ └── .gitkeep ├── check.php ├── config │ ├── config.yml │ ├── config_dev.yml │ ├── config_prod.yml │ ├── config_test.yml │ ├── nexmo.yml.example │ ├── parameters.yml.dist │ ├── pusher.yml.example │ ├── routing.yml │ ├── routing_dev.yml │ ├── security.yml │ └── services.yml ├── console ├── data │ └── .gitkeep ├── logs │ └── .gitkeep └── phpunit.xml.dist ├── composer.json ├── composer.lock ├── reset-db.sh ├── src ├── .htaccess └── AppBundle │ ├── AppBundle.php │ ├── Controller │ └── ChatController.php │ ├── Entity │ ├── Caller.php │ ├── ChatMessage.php │ └── ChatMessageRepository.php │ └── Tests │ └── Controller │ └── DefaultControllerTest.php └── web ├── .htaccess ├── app.php ├── app_dev.php ├── apple-touch-icon.png ├── config.php ├── favicon.ico ├── js ├── core-chat.js ├── faye-chat.js ├── pusher-chat.js └── ratchet-chat.js └── robots.txt /.gitignore: -------------------------------------------------------------------------------- 1 | symfony/app/config/pusher.yml 2 | symfony/app/config/nexmo.yml 3 | dump.rdb 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Real-Time & Symfony Samples 2 | 3 | This project demonstrates how to add real-time functionality to a [Symfony](http://symfony.com/) 2 application using three different real-time web technologies 4 | 5 | 1. [Ratchet (PHP)](http://socketo.me/) 6 | 2. [Faye (Node)](http://faye.jcoglan.com) 7 | 3. [Pusher (Hosted service)](https://pusher.com) 8 | 9 | It also adds support for sending an SMS with [Nexmo](https://www.nexmo.com). 10 | 11 | These samples were originally prepare for a talk at Symfony Live London 2015 and then for CloudConf 2016. You can view the resources here: 12 | 13 | * Real-time Web Apps & Symfony. What are your options? - Symfony Live 2015 14 | * [Schedule](http://london2015.live.symfony.com/speakers#yui_3_17_2_1_1442233551897_235) 15 | * [Slides](http://leggetter.github.io/realtime-symfony/) 16 | * [Video](https://www.youtube.com/watch?v=LX2KoVK7mqA) 17 | * Real-time Web Apps & PHP. What are your options? - CloudConf 2016 18 | * [Schedule](http://2016.cloudconf.it/schedule.html) 19 | * [Slides](http://leggetter.github.io/realtime-php/) 20 | * Video - coming soon 21 | 22 | ## Symfony App Setup 23 | 24 | Install the Symfony app dependencies: 25 | 26 | ```bash 27 | cd symfony 28 | composer install 29 | cd .. 30 | ``` 31 | 32 | If you wish to run the Pusher sample you'll need to create a `app/config/pusher.yml` and [signup](https://pusher.com/signup) for a free account. If you don't wish to run the Pusher sample you will need to remove the `import` from `app/config/config.yml`. 33 | 34 | Once the dependencies are installed you'll need to create the database for the sample chat application. 35 | 36 | ```bash 37 | php symfony/app/console doctrine:database:create 38 | php symfony/app/console doctrine:schema:update --force 39 | ``` 40 | 41 | Run the application: 42 | 43 | ```bash 44 | php symfony/app/console server:run 45 | ``` 46 | 47 | ## Symfony + Ratchet 48 | 49 | ![Symfony + Ratchet architecture overview](docs/realtime-web-stack-integration-self-hosted-symfony-ratchet.png) 50 | 51 | ### Dependencies 52 | 53 | For this sample to work you will need [Redis installed](http://redis.io/topics/quickstart). 54 | 55 | *Note: Redis only works on \*nix machines* 56 | 57 | Install the Ratchet application dependencies: 58 | 59 | ``` 60 | cd ratchet 61 | composer install 62 | cd .. 63 | ``` 64 | 65 | ### Code Changes 66 | 67 | Messages will be recieved by Ratchet from the Symfony application via Redis (`Symfony -> Redis -> Ratchet`). So, you'll need to uncomment the code that publishes the chat messages to Redis. 68 | 69 | Open up `symfony/src/AppBundle/Controller/ChatController.php` and ensure the following is uncommented: 70 | 71 | ```php 72 | $data = [ 73 | 'event' => 'new-message', 74 | 'data' => $message 75 | ]; 76 | $jsonContent = json_encode($data); 77 | $redis = new Client('tcp://127.0.0.1:6379'); 78 | $redis->publish('chat', $jsonContent); 79 | ``` 80 | 81 | ### Running the App 82 | 83 | Ensure the Symfony application is running: 84 | 85 | ```bash 86 | php symfony/app/console server:run 87 | ``` 88 | 89 | In a new console/terminal window ensure redis is running: 90 | 91 | ```bash 92 | redis-server 93 | ``` 94 | 95 | In a new console/terminal run the Ratchet application: 96 | 97 | ```bash 98 | php ratchet/bin/chat-server.php 99 | ``` 100 | 101 | Navigate to `http://localhost:8000/chat/ratchet`. Open a 2nd browser window so you can see the messages appear in both windows. 102 | 103 | ## Symfony + Faye 104 | 105 | ![Symfony + Faye architecture overview](docs/realtime-web-stack-integration-self-hosted-symfony-faye.png) 106 | 107 | ### Dependencies 108 | 109 | For this sample to work you will need [Redis installed](http://redis.io/topics/quickstart). 110 | 111 | *Note: Redis only works on \*nix machines* 112 | 113 | Install the Faye application dependencies: 114 | 115 | ``` 116 | cd faye 117 | npm install 118 | cd .. 119 | ``` 120 | 121 | ### Code Changes 122 | 123 | Messages will be received by Faye from the Symfony application via Redis (`Symfony -> Redis -> Faye`). So, you'll need to uncomment the code that publishes the chat messages to Redis. 124 | 125 | Open up `symfony/src/AppBundle/Controller/ChatController.php` and ensure the following is uncommented: 126 | 127 | ```php 128 | $data = [ 129 | 'event' => 'new-message', 130 | 'data' => $message 131 | ]; 132 | $jsonContent = json_encode($data); 133 | $redis = new Client('tcp://127.0.0.1:6379'); 134 | $redis->publish('chat', $jsonContent); 135 | ``` 136 | 137 | ### Running the App 138 | 139 | Ensure the Symfony application is running: 140 | 141 | ```bash 142 | php symfony/app/console server:run 143 | ``` 144 | 145 | In a new console/terminal window ensure redis is running: 146 | 147 | ```bash 148 | redis-server 149 | ``` 150 | 151 | In a new console/terminal run the Faye application: 152 | 153 | ```bash 154 | node faye/index.js 155 | ``` 156 | 157 | Navigate to `http://localhost:8000/chat/faye`. Open a 2nd browser window so you can see the messages appear in both windows. 158 | 159 | ## Symfony + Pusher 160 | 161 | ![Symfony + Pusher architecture overview](docs/realtime-web-stack-integration-hosted-symfony-pusher.png) 162 | 163 | ### Dependencies 164 | 165 | For this sample to work you will need to [signup](https://pusher.com/signup) for a free Pusher account. 166 | 167 | ### Code Changes 168 | 169 | Messages will be sent to Pusher and on to the web browser client via the Pusher service. 170 | 171 | Open up `symfony/src/AppBundle/Controller/ChatController.php` and ensure the following is uncommented: 172 | 173 | ```php 174 | $pusher = $this->container->get('lopi_pusher.pusher'); 175 | $pusher->trigger( 176 | 'chat', 177 | 'new-message', 178 | $message 179 | ); 180 | ``` 181 | 182 | *Note: If you've previously used the Ratchet or Faye sample then you should comment out the lines that interact with Redis.* 183 | 184 | ### Running the App 185 | 186 | Ensure the Symfony application is running: 187 | 188 | ```bash 189 | php symfony/app/console server:run 190 | ``` 191 | 192 | Navigate to `http://localhost:8000/chat/pusher`. Open a 2nd browser window so you can see the messages appear in both windows. 193 | 194 | ## Questions/Feedback 195 | 196 | If you've any questions about this sample please [raise and issue](issues/). If you've any more general questions then please email me: phil@pusher.com/phil@leggetter.co.uk. 197 | -------------------------------------------------------------------------------- /docs/realtime-web-stack-integration-hosted-symfony-pusher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/docs/realtime-web-stack-integration-hosted-symfony-pusher.png -------------------------------------------------------------------------------- /docs/realtime-web-stack-integration-self-hosted-symfony-faye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/docs/realtime-web-stack-integration-self-hosted-symfony-faye.png -------------------------------------------------------------------------------- /docs/realtime-web-stack-integration-self-hosted-symfony-ratchet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/docs/realtime-web-stack-integration-self-hosted-symfony-ratchet.png -------------------------------------------------------------------------------- /faye/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /faye/index.js: -------------------------------------------------------------------------------- 1 | var http = require('http'), 2 | faye = require('faye'); 3 | 4 | var Redis = require('ioredis'); 5 | 6 | var server = http.createServer(), 7 | bayeux = new faye.NodeAdapter({mount: '/', timeout: 45}); 8 | 9 | var fayeClient = bayeux.getClient(); 10 | 11 | var redis = new Redis(); 12 | redis.subscribe('chat', function (err, count) { 13 | if(err) { 14 | console.error(err); 15 | } 16 | }); 17 | 18 | redis.on('message', function (channel, message) { 19 | console.log('Receive message %s from channel %s', message, channel); 20 | 21 | fayeClient.publish('/' + channel, JSON.parse(message)); 22 | 23 | }); 24 | 25 | bayeux.attach(server); 26 | server.listen(8080); 27 | -------------------------------------------------------------------------------- /faye/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "faye-symfony", 3 | "version": "0.1.0", 4 | "description": "Faye + Symfony via Redis example", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Pusher (https://pusher.com)", 10 | "license": "MIT", 11 | "dependencies": { 12 | "faye": "^1.1.2", 13 | "ioredis": "^1.8.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ratchet/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | -------------------------------------------------------------------------------- /ratchet/bin/chat-server.php: -------------------------------------------------------------------------------- 1 | loop); 21 | $redis->connect(function($redis) use($chat) { 22 | $chat->init($redis); 23 | }); 24 | 25 | $server->run(); 26 | -------------------------------------------------------------------------------- /ratchet/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "autoload": { 3 | "psr-0": { 4 | "ChatApp": "src" 5 | } 6 | }, 7 | "require": { 8 | "cboden/ratchet": "0.3.*", 9 | "predis/predis-async": "dev-master" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ratchet/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "66443638e6fab36b7d26aaf853d81306", 8 | "packages": [ 9 | { 10 | "name": "cboden/ratchet", 11 | "version": "v0.3.3", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/ratchetphp/Ratchet.git", 15 | "reference": "6b247c05251b4b5cbd14243366b649f99a0e5681" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/6b247c05251b4b5cbd14243366b649f99a0e5681", 20 | "reference": "6b247c05251b4b5cbd14243366b649f99a0e5681", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "guzzle/http": "^3.6", 25 | "php": ">=5.3.9", 26 | "react/socket": "^0.3 || ^0.4", 27 | "symfony/http-foundation": "^2.2", 28 | "symfony/routing": "^2.2" 29 | }, 30 | "type": "library", 31 | "autoload": { 32 | "psr-4": { 33 | "Ratchet\\": "src/Ratchet" 34 | } 35 | }, 36 | "notification-url": "https://packagist.org/downloads/", 37 | "license": [ 38 | "MIT" 39 | ], 40 | "authors": [ 41 | { 42 | "name": "Chris Boden", 43 | "email": "cboden@gmail.com", 44 | "role": "Developer" 45 | } 46 | ], 47 | "description": "PHP WebSocket library", 48 | "homepage": "http://socketo.me", 49 | "keywords": [ 50 | "Ratchet", 51 | "WebSockets", 52 | "server", 53 | "sockets" 54 | ], 55 | "time": "2015-05-27 12:51:05" 56 | }, 57 | { 58 | "name": "clue/redis-protocol", 59 | "version": "v0.3.0", 60 | "source": { 61 | "type": "git", 62 | "url": "https://github.com/clue/php-redis-protocol.git", 63 | "reference": "2ffcdfa281b1084f666340e13f05a1d26d35ed26" 64 | }, 65 | "dist": { 66 | "type": "zip", 67 | "url": "https://api.github.com/repos/clue/php-redis-protocol/zipball/2ffcdfa281b1084f666340e13f05a1d26d35ed26", 68 | "reference": "2ffcdfa281b1084f666340e13f05a1d26d35ed26", 69 | "shasum": "" 70 | }, 71 | "require": { 72 | "php": ">=5.3" 73 | }, 74 | "type": "library", 75 | "autoload": { 76 | "psr-0": { 77 | "Clue\\Redis\\Protocol": "src" 78 | } 79 | }, 80 | "notification-url": "https://packagist.org/downloads/", 81 | "license": [ 82 | "MIT" 83 | ], 84 | "authors": [ 85 | { 86 | "name": "Christian Lück", 87 | "email": "christian@lueck.tv" 88 | } 89 | ], 90 | "description": "A streaming redis wire protocol parser and serializer implementation in PHP", 91 | "homepage": "https://github.com/clue/redis-protocol", 92 | "keywords": [ 93 | "parser", 94 | "protocol", 95 | "redis", 96 | "serializer", 97 | "streaming" 98 | ], 99 | "time": "2014-01-26 23:49:05" 100 | }, 101 | { 102 | "name": "evenement/evenement", 103 | "version": "v2.0.0", 104 | "source": { 105 | "type": "git", 106 | "url": "https://github.com/igorw/evenement.git", 107 | "reference": "f6e843799fd4f4184d54d8fc7b5b3551c9fa803e" 108 | }, 109 | "dist": { 110 | "type": "zip", 111 | "url": "https://api.github.com/repos/igorw/evenement/zipball/f6e843799fd4f4184d54d8fc7b5b3551c9fa803e", 112 | "reference": "f6e843799fd4f4184d54d8fc7b5b3551c9fa803e", 113 | "shasum": "" 114 | }, 115 | "require": { 116 | "php": ">=5.4.0" 117 | }, 118 | "type": "library", 119 | "extra": { 120 | "branch-alias": { 121 | "dev-master": "2.0-dev" 122 | } 123 | }, 124 | "autoload": { 125 | "psr-0": { 126 | "Evenement": "src" 127 | } 128 | }, 129 | "notification-url": "https://packagist.org/downloads/", 130 | "license": [ 131 | "MIT" 132 | ], 133 | "authors": [ 134 | { 135 | "name": "Igor Wiedler", 136 | "email": "igor@wiedler.ch", 137 | "homepage": "http://wiedler.ch/igor/" 138 | } 139 | ], 140 | "description": "Événement is a very simple event dispatching library for PHP", 141 | "keywords": [ 142 | "event-dispatcher", 143 | "event-emitter" 144 | ], 145 | "time": "2012-11-02 14:49:47" 146 | }, 147 | { 148 | "name": "guzzle/common", 149 | "version": "v3.9.2", 150 | "target-dir": "Guzzle/Common", 151 | "source": { 152 | "type": "git", 153 | "url": "https://github.com/Guzzle3/common.git", 154 | "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc" 155 | }, 156 | "dist": { 157 | "type": "zip", 158 | "url": "https://api.github.com/repos/Guzzle3/common/zipball/2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", 159 | "reference": "2e36af7cf2ce3ea1f2d7c2831843b883a8e7b7dc", 160 | "shasum": "" 161 | }, 162 | "require": { 163 | "php": ">=5.3.2", 164 | "symfony/event-dispatcher": ">=2.1" 165 | }, 166 | "type": "library", 167 | "extra": { 168 | "branch-alias": { 169 | "dev-master": "3.7-dev" 170 | } 171 | }, 172 | "autoload": { 173 | "psr-0": { 174 | "Guzzle\\Common": "" 175 | } 176 | }, 177 | "notification-url": "https://packagist.org/downloads/", 178 | "license": [ 179 | "MIT" 180 | ], 181 | "description": "Common libraries used by Guzzle", 182 | "homepage": "http://guzzlephp.org/", 183 | "keywords": [ 184 | "collection", 185 | "common", 186 | "event", 187 | "exception" 188 | ], 189 | "abandoned": "guzzle/guzzle", 190 | "time": "2014-08-11 04:32:36" 191 | }, 192 | { 193 | "name": "guzzle/http", 194 | "version": "v3.9.2", 195 | "target-dir": "Guzzle/Http", 196 | "source": { 197 | "type": "git", 198 | "url": "https://github.com/Guzzle3/http.git", 199 | "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5" 200 | }, 201 | "dist": { 202 | "type": "zip", 203 | "url": "https://api.github.com/repos/Guzzle3/http/zipball/1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", 204 | "reference": "1e8dd1e2ba9dc42332396f39fbfab950b2301dc5", 205 | "shasum": "" 206 | }, 207 | "require": { 208 | "guzzle/common": "self.version", 209 | "guzzle/parser": "self.version", 210 | "guzzle/stream": "self.version", 211 | "php": ">=5.3.2" 212 | }, 213 | "suggest": { 214 | "ext-curl": "*" 215 | }, 216 | "type": "library", 217 | "extra": { 218 | "branch-alias": { 219 | "dev-master": "3.7-dev" 220 | } 221 | }, 222 | "autoload": { 223 | "psr-0": { 224 | "Guzzle\\Http": "" 225 | } 226 | }, 227 | "notification-url": "https://packagist.org/downloads/", 228 | "license": [ 229 | "MIT" 230 | ], 231 | "authors": [ 232 | { 233 | "name": "Michael Dowling", 234 | "email": "mtdowling@gmail.com", 235 | "homepage": "https://github.com/mtdowling" 236 | } 237 | ], 238 | "description": "HTTP libraries used by Guzzle", 239 | "homepage": "http://guzzlephp.org/", 240 | "keywords": [ 241 | "Guzzle", 242 | "client", 243 | "curl", 244 | "http", 245 | "http client" 246 | ], 247 | "abandoned": "guzzle/guzzle", 248 | "time": "2014-08-11 04:32:36" 249 | }, 250 | { 251 | "name": "guzzle/parser", 252 | "version": "v3.9.2", 253 | "target-dir": "Guzzle/Parser", 254 | "source": { 255 | "type": "git", 256 | "url": "https://github.com/Guzzle3/parser.git", 257 | "reference": "6874d171318a8e93eb6d224cf85e4678490b625c" 258 | }, 259 | "dist": { 260 | "type": "zip", 261 | "url": "https://api.github.com/repos/Guzzle3/parser/zipball/6874d171318a8e93eb6d224cf85e4678490b625c", 262 | "reference": "6874d171318a8e93eb6d224cf85e4678490b625c", 263 | "shasum": "" 264 | }, 265 | "require": { 266 | "php": ">=5.3.2" 267 | }, 268 | "type": "library", 269 | "extra": { 270 | "branch-alias": { 271 | "dev-master": "3.7-dev" 272 | } 273 | }, 274 | "autoload": { 275 | "psr-0": { 276 | "Guzzle\\Parser": "" 277 | } 278 | }, 279 | "notification-url": "https://packagist.org/downloads/", 280 | "license": [ 281 | "MIT" 282 | ], 283 | "description": "Interchangeable parsers used by Guzzle", 284 | "homepage": "http://guzzlephp.org/", 285 | "keywords": [ 286 | "URI Template", 287 | "cookie", 288 | "http", 289 | "message", 290 | "url" 291 | ], 292 | "abandoned": "guzzle/guzzle", 293 | "time": "2014-02-05 18:29:46" 294 | }, 295 | { 296 | "name": "guzzle/stream", 297 | "version": "v3.9.2", 298 | "target-dir": "Guzzle/Stream", 299 | "source": { 300 | "type": "git", 301 | "url": "https://github.com/Guzzle3/stream.git", 302 | "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0" 303 | }, 304 | "dist": { 305 | "type": "zip", 306 | "url": "https://api.github.com/repos/Guzzle3/stream/zipball/60c7fed02e98d2c518dae8f97874c8f4622100f0", 307 | "reference": "60c7fed02e98d2c518dae8f97874c8f4622100f0", 308 | "shasum": "" 309 | }, 310 | "require": { 311 | "guzzle/common": "self.version", 312 | "php": ">=5.3.2" 313 | }, 314 | "suggest": { 315 | "guzzle/http": "To convert Guzzle request objects to PHP streams" 316 | }, 317 | "type": "library", 318 | "extra": { 319 | "branch-alias": { 320 | "dev-master": "3.7-dev" 321 | } 322 | }, 323 | "autoload": { 324 | "psr-0": { 325 | "Guzzle\\Stream": "" 326 | } 327 | }, 328 | "notification-url": "https://packagist.org/downloads/", 329 | "license": [ 330 | "MIT" 331 | ], 332 | "authors": [ 333 | { 334 | "name": "Michael Dowling", 335 | "email": "mtdowling@gmail.com", 336 | "homepage": "https://github.com/mtdowling" 337 | } 338 | ], 339 | "description": "Guzzle stream wrapper component", 340 | "homepage": "http://guzzlephp.org/", 341 | "keywords": [ 342 | "Guzzle", 343 | "component", 344 | "stream" 345 | ], 346 | "abandoned": "guzzle/guzzle", 347 | "time": "2014-05-01 21:36:02" 348 | }, 349 | { 350 | "name": "predis/predis", 351 | "version": "v1.0.3", 352 | "source": { 353 | "type": "git", 354 | "url": "https://github.com/nrk/predis.git", 355 | "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04" 356 | }, 357 | "dist": { 358 | "type": "zip", 359 | "url": "https://api.github.com/repos/nrk/predis/zipball/84060b9034d756b4d79641667d7f9efe1aeb8e04", 360 | "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04", 361 | "shasum": "" 362 | }, 363 | "require": { 364 | "php": ">=5.3.2" 365 | }, 366 | "require-dev": { 367 | "phpunit/phpunit": "~4.0" 368 | }, 369 | "suggest": { 370 | "ext-curl": "Allows access to Webdis when paired with phpiredis", 371 | "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" 372 | }, 373 | "type": "library", 374 | "autoload": { 375 | "psr-4": { 376 | "Predis\\": "src/" 377 | } 378 | }, 379 | "notification-url": "https://packagist.org/downloads/", 380 | "license": [ 381 | "MIT" 382 | ], 383 | "authors": [ 384 | { 385 | "name": "Daniele Alessandri", 386 | "email": "suppakilla@gmail.com", 387 | "homepage": "http://clorophilla.net" 388 | } 389 | ], 390 | "description": "Flexible and feature-complete PHP client library for Redis", 391 | "homepage": "http://github.com/nrk/predis", 392 | "keywords": [ 393 | "nosql", 394 | "predis", 395 | "redis" 396 | ], 397 | "time": "2015-07-30 18:34:15" 398 | }, 399 | { 400 | "name": "predis/predis-async", 401 | "version": "dev-master", 402 | "source": { 403 | "type": "git", 404 | "url": "https://github.com/nrk/predis-async.git", 405 | "reference": "b278b9efc40386149c29205224a617d3024cd559" 406 | }, 407 | "dist": { 408 | "type": "zip", 409 | "url": "https://api.github.com/repos/nrk/predis-async/zipball/b278b9efc40386149c29205224a617d3024cd559", 410 | "reference": "b278b9efc40386149c29205224a617d3024cd559", 411 | "shasum": "" 412 | }, 413 | "require": { 414 | "clue/redis-protocol": "0.3.*", 415 | "php": ">=5.4.0", 416 | "predis/predis": "~1.0", 417 | "react/event-loop": "0.4.*" 418 | }, 419 | "require-dev": { 420 | "phpunit/phpunit": "~4.0" 421 | }, 422 | "suggest": { 423 | "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" 424 | }, 425 | "type": "library", 426 | "autoload": { 427 | "psr-4": { 428 | "Predis\\Async\\": "src/" 429 | } 430 | }, 431 | "notification-url": "https://packagist.org/downloads/", 432 | "license": [ 433 | "MIT" 434 | ], 435 | "authors": [ 436 | { 437 | "name": "Daniele Alessandri", 438 | "email": "suppakilla@gmail.com", 439 | "homepage": "http://clorophilla.net" 440 | } 441 | ], 442 | "description": "Asynchronous version of Predis", 443 | "homepage": "http://github.com/nrk/predis-async", 444 | "keywords": [ 445 | "nosql", 446 | "predis", 447 | "redis" 448 | ], 449 | "time": "2014-10-26 13:24:49" 450 | }, 451 | { 452 | "name": "react/event-loop", 453 | "version": "v0.4.1", 454 | "source": { 455 | "type": "git", 456 | "url": "https://github.com/reactphp/event-loop.git", 457 | "reference": "18c5297087ca01de85518e2b55078f444144aa1b" 458 | }, 459 | "dist": { 460 | "type": "zip", 461 | "url": "https://api.github.com/repos/reactphp/event-loop/zipball/18c5297087ca01de85518e2b55078f444144aa1b", 462 | "reference": "18c5297087ca01de85518e2b55078f444144aa1b", 463 | "shasum": "" 464 | }, 465 | "require": { 466 | "php": ">=5.4.0" 467 | }, 468 | "suggest": { 469 | "ext-event": "~1.0", 470 | "ext-libev": "*", 471 | "ext-libevent": ">=0.1.0" 472 | }, 473 | "type": "library", 474 | "extra": { 475 | "branch-alias": { 476 | "dev-master": "0.4-dev" 477 | } 478 | }, 479 | "autoload": { 480 | "psr-4": { 481 | "React\\EventLoop\\": "" 482 | } 483 | }, 484 | "notification-url": "https://packagist.org/downloads/", 485 | "license": [ 486 | "MIT" 487 | ], 488 | "description": "Event loop abstraction layer that libraries can use for evented I/O.", 489 | "keywords": [ 490 | "event-loop" 491 | ], 492 | "time": "2014-02-26 17:36:58" 493 | }, 494 | { 495 | "name": "react/socket", 496 | "version": "v0.4.2", 497 | "source": { 498 | "type": "git", 499 | "url": "https://github.com/reactphp/socket.git", 500 | "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc" 501 | }, 502 | "dist": { 503 | "type": "zip", 504 | "url": "https://api.github.com/repos/reactphp/socket/zipball/a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", 505 | "reference": "a6acf405ca53fc6cfbfe7c77778ededff46aa7cc", 506 | "shasum": "" 507 | }, 508 | "require": { 509 | "evenement/evenement": "~2.0", 510 | "php": ">=5.4.0", 511 | "react/event-loop": "0.4.*", 512 | "react/stream": "0.4.*" 513 | }, 514 | "type": "library", 515 | "extra": { 516 | "branch-alias": { 517 | "dev-master": "0.4-dev" 518 | } 519 | }, 520 | "autoload": { 521 | "psr-4": { 522 | "React\\Socket\\": "src" 523 | } 524 | }, 525 | "notification-url": "https://packagist.org/downloads/", 526 | "license": [ 527 | "MIT" 528 | ], 529 | "description": "Library for building an evented socket server.", 530 | "keywords": [ 531 | "Socket" 532 | ], 533 | "time": "2014-05-25 17:02:16" 534 | }, 535 | { 536 | "name": "react/stream", 537 | "version": "v0.4.2", 538 | "source": { 539 | "type": "git", 540 | "url": "https://github.com/reactphp/stream.git", 541 | "reference": "acc7a5fec02e0aea674560e1d13c40ed0c8c5465" 542 | }, 543 | "dist": { 544 | "type": "zip", 545 | "url": "https://api.github.com/repos/reactphp/stream/zipball/acc7a5fec02e0aea674560e1d13c40ed0c8c5465", 546 | "reference": "acc7a5fec02e0aea674560e1d13c40ed0c8c5465", 547 | "shasum": "" 548 | }, 549 | "require": { 550 | "evenement/evenement": "~2.0", 551 | "php": ">=5.4.0" 552 | }, 553 | "require-dev": { 554 | "react/event-loop": "0.4.*", 555 | "react/promise": "~2.0" 556 | }, 557 | "suggest": { 558 | "react/event-loop": "0.4.*", 559 | "react/promise": "~2.0" 560 | }, 561 | "type": "library", 562 | "extra": { 563 | "branch-alias": { 564 | "dev-master": "0.5-dev" 565 | } 566 | }, 567 | "autoload": { 568 | "psr-4": { 569 | "React\\Stream\\": "src" 570 | } 571 | }, 572 | "notification-url": "https://packagist.org/downloads/", 573 | "license": [ 574 | "MIT" 575 | ], 576 | "description": "Basic readable and writable stream interfaces that support piping.", 577 | "keywords": [ 578 | "pipe", 579 | "stream" 580 | ], 581 | "time": "2014-09-10 03:32:31" 582 | }, 583 | { 584 | "name": "symfony/event-dispatcher", 585 | "version": "v2.7.4", 586 | "source": { 587 | "type": "git", 588 | "url": "https://github.com/symfony/EventDispatcher.git", 589 | "reference": "b58c916f1db03a611b72dd702564f30ad8fe83fa" 590 | }, 591 | "dist": { 592 | "type": "zip", 593 | "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/b58c916f1db03a611b72dd702564f30ad8fe83fa", 594 | "reference": "b58c916f1db03a611b72dd702564f30ad8fe83fa", 595 | "shasum": "" 596 | }, 597 | "require": { 598 | "php": ">=5.3.9" 599 | }, 600 | "require-dev": { 601 | "psr/log": "~1.0", 602 | "symfony/config": "~2.0,>=2.0.5", 603 | "symfony/dependency-injection": "~2.6", 604 | "symfony/expression-language": "~2.6", 605 | "symfony/phpunit-bridge": "~2.7", 606 | "symfony/stopwatch": "~2.3" 607 | }, 608 | "suggest": { 609 | "symfony/dependency-injection": "", 610 | "symfony/http-kernel": "" 611 | }, 612 | "type": "library", 613 | "extra": { 614 | "branch-alias": { 615 | "dev-master": "2.7-dev" 616 | } 617 | }, 618 | "autoload": { 619 | "psr-4": { 620 | "Symfony\\Component\\EventDispatcher\\": "" 621 | } 622 | }, 623 | "notification-url": "https://packagist.org/downloads/", 624 | "license": [ 625 | "MIT" 626 | ], 627 | "authors": [ 628 | { 629 | "name": "Fabien Potencier", 630 | "email": "fabien@symfony.com" 631 | }, 632 | { 633 | "name": "Symfony Community", 634 | "homepage": "https://symfony.com/contributors" 635 | } 636 | ], 637 | "description": "Symfony EventDispatcher Component", 638 | "homepage": "https://symfony.com", 639 | "time": "2015-08-24 07:13:45" 640 | }, 641 | { 642 | "name": "symfony/http-foundation", 643 | "version": "v2.7.4", 644 | "source": { 645 | "type": "git", 646 | "url": "https://github.com/symfony/HttpFoundation.git", 647 | "reference": "7253c2041652353e71560bbd300d6256d170ddaf" 648 | }, 649 | "dist": { 650 | "type": "zip", 651 | "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/7253c2041652353e71560bbd300d6256d170ddaf", 652 | "reference": "7253c2041652353e71560bbd300d6256d170ddaf", 653 | "shasum": "" 654 | }, 655 | "require": { 656 | "php": ">=5.3.9" 657 | }, 658 | "require-dev": { 659 | "symfony/expression-language": "~2.4", 660 | "symfony/phpunit-bridge": "~2.7" 661 | }, 662 | "type": "library", 663 | "extra": { 664 | "branch-alias": { 665 | "dev-master": "2.7-dev" 666 | } 667 | }, 668 | "autoload": { 669 | "psr-4": { 670 | "Symfony\\Component\\HttpFoundation\\": "" 671 | }, 672 | "classmap": [ 673 | "Resources/stubs" 674 | ] 675 | }, 676 | "notification-url": "https://packagist.org/downloads/", 677 | "license": [ 678 | "MIT" 679 | ], 680 | "authors": [ 681 | { 682 | "name": "Fabien Potencier", 683 | "email": "fabien@symfony.com" 684 | }, 685 | { 686 | "name": "Symfony Community", 687 | "homepage": "https://symfony.com/contributors" 688 | } 689 | ], 690 | "description": "Symfony HttpFoundation Component", 691 | "homepage": "https://symfony.com", 692 | "time": "2015-08-27 06:45:45" 693 | }, 694 | { 695 | "name": "symfony/routing", 696 | "version": "v2.7.4", 697 | "source": { 698 | "type": "git", 699 | "url": "https://github.com/symfony/Routing.git", 700 | "reference": "20b1378cb6efffb77ea0608232f18c8f0dd25109" 701 | }, 702 | "dist": { 703 | "type": "zip", 704 | "url": "https://api.github.com/repos/symfony/Routing/zipball/20b1378cb6efffb77ea0608232f18c8f0dd25109", 705 | "reference": "20b1378cb6efffb77ea0608232f18c8f0dd25109", 706 | "shasum": "" 707 | }, 708 | "require": { 709 | "php": ">=5.3.9" 710 | }, 711 | "conflict": { 712 | "symfony/config": "<2.7" 713 | }, 714 | "require-dev": { 715 | "doctrine/annotations": "~1.0", 716 | "doctrine/common": "~2.2", 717 | "psr/log": "~1.0", 718 | "symfony/config": "~2.7", 719 | "symfony/expression-language": "~2.4", 720 | "symfony/http-foundation": "~2.3", 721 | "symfony/phpunit-bridge": "~2.7", 722 | "symfony/yaml": "~2.0,>=2.0.5" 723 | }, 724 | "suggest": { 725 | "doctrine/annotations": "For using the annotation loader", 726 | "symfony/config": "For using the all-in-one router or any loader", 727 | "symfony/expression-language": "For using expression matching", 728 | "symfony/yaml": "For using the YAML loader" 729 | }, 730 | "type": "library", 731 | "extra": { 732 | "branch-alias": { 733 | "dev-master": "2.7-dev" 734 | } 735 | }, 736 | "autoload": { 737 | "psr-4": { 738 | "Symfony\\Component\\Routing\\": "" 739 | } 740 | }, 741 | "notification-url": "https://packagist.org/downloads/", 742 | "license": [ 743 | "MIT" 744 | ], 745 | "authors": [ 746 | { 747 | "name": "Fabien Potencier", 748 | "email": "fabien@symfony.com" 749 | }, 750 | { 751 | "name": "Symfony Community", 752 | "homepage": "https://symfony.com/contributors" 753 | } 754 | ], 755 | "description": "Symfony Routing Component", 756 | "homepage": "https://symfony.com", 757 | "keywords": [ 758 | "router", 759 | "routing", 760 | "uri", 761 | "url" 762 | ], 763 | "time": "2015-08-24 07:13:45" 764 | } 765 | ], 766 | "packages-dev": [], 767 | "aliases": [], 768 | "minimum-stability": "stable", 769 | "stability-flags": { 770 | "predis/predis-async": 20 771 | }, 772 | "prefer-stable": false, 773 | "prefer-lowest": false, 774 | "platform": [], 775 | "platform-dev": [] 776 | } 777 | -------------------------------------------------------------------------------- /ratchet/src/ChatApp/Chat.php: -------------------------------------------------------------------------------- 1 | wsclients = new \SplObjectStorage(); 17 | 18 | echo "Ratchet Chat server running\n"; 19 | } 20 | 21 | public function init($redis) 22 | { 23 | echo "Connected to Redis, now listening for incoming messages...\n"; 24 | 25 | $redis->pubSubLoop('chat', function ($event) { 26 | echo "Received message `{$event->payload}` from {$event->channel}.\n"; 27 | 28 | foreach ($this->wsclients as $wsclient) { 29 | $wsclient->send($event->payload); 30 | } 31 | }); 32 | 33 | } 34 | 35 | public function onOpen(ConnectionInterface $conn) 36 | { 37 | // Store the new connection to send messages to later 38 | $this->wsclients->attach($conn); 39 | 40 | echo "New connection! ({$conn->resourceId})\n"; 41 | } 42 | 43 | public function onMessage(ConnectionInterface $from, $msg) 44 | { 45 | // we don't want to do anything with incoming messages 46 | } 47 | 48 | public function onClose(ConnectionInterface $conn) 49 | { 50 | // The connection is closed, remove it, as we can no longer send it messages 51 | $this->wsclients->detach($conn); 52 | 53 | echo "Connection {$conn->resourceId} has disconnected\n"; 54 | } 55 | 56 | public function onError(ConnectionInterface $conn, \Exception $e) 57 | { 58 | trigger_error("An error has occurred: {$e->getMessage()}\n", E_USER_WARNING); 59 | $conn->close(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /symfony/.gitignore: -------------------------------------------------------------------------------- 1 | # Cache and logs (Symfony2) 2 | /app/cache/* 3 | /app/logs/* 4 | !app/cache/.gitkeep 5 | !app/logs/.gitkeep 6 | 7 | # Cache and logs (Symfony3) 8 | /var/cache/* 9 | /var/logs/* 10 | !var/cache/.gitkeep 11 | !var/logs/.gitkeep 12 | 13 | # Parameters 14 | /app/config/parameters.yml 15 | /app/config/parameters.ini 16 | 17 | # Managed by Composer 18 | /app/bootstrap.php.cache 19 | /var/bootstrap.php.cache 20 | /bin/* 21 | !bin/console 22 | !bin/symfony_requirements 23 | /vendor/ 24 | 25 | # Assets and user uploads 26 | /web/bundles/ 27 | /web/uploads/ 28 | 29 | # PHPUnit 30 | /app/phpunit.xml 31 | /phpunit.xml 32 | 33 | # Build data 34 | /build/ 35 | 36 | # Composer PHAR 37 | /composer.phar 38 | 39 | vendor 40 | app/data/sqlite.db -------------------------------------------------------------------------------- /symfony/README.md: -------------------------------------------------------------------------------- 1 | # Real-Time Symfony App 2 | 3 | An application used as part of presentations at: 4 | 5 | * Real-time Web Apps & Symfony. What are your options? - Symfony Live 2015 6 | * [Schedule](http://london2015.live.symfony.com/speakers#yui_3_17_2_1_1442233551897_235) 7 | * [Slides](http://leggetter.github.io/realtime-symfony/) 8 | * [Video](https://www.youtube.com/watch?v=LX2KoVK7mqA) 9 | * Real-time Web Apps & PHP. What are your options? - CloudConf 2016 10 | * [Schedule](http://2016.cloudconf.it/schedule.html) 11 | * [Slides](http://leggetter.github.io/realtime-php/) 12 | * Video - coming soon 13 | 14 | ## Setup 15 | 16 | ### `app/config/pusher.yml` 17 | 18 | Rename `app/config/pusher.yml.example` to `pusher.yml` and add your Pusher application credentials: 19 | 20 | ```yml 21 | parameters: 22 | pusher.app_id: YOUR_APP_ID 23 | pusher.app_key: YOUR_APP_KEY 24 | pusher.app_secret: YOUR_APP_SECRET 25 | ``` 26 | 27 | ### `app/config/nexmo.yml` 28 | 29 | If you also want to send SMS when a message is posted you will need to sign up for a [Nexmo account](https://www.nexmo.com) and add your credentials to a `nexmo.yml` configuration file. 30 | 31 | Rename `app/config/nexmo.yml.example` to `nexmo.yml` and add your Nexmo API credentials: 32 | 33 | ```yml 34 | parameters: 35 | nexmo.api_key: YOUR_API_KEY 36 | nexmo.api_secret: YOUR_API_SECRET 37 | nexmo.from_name: Nexmo 38 | ``` 39 | -------------------------------------------------------------------------------- /symfony/app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /symfony/app/AppCache.php: -------------------------------------------------------------------------------- 1 | getEnvironment(), array('dev', 'test'))) { 25 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 26 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 27 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 28 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 29 | } 30 | 31 | return $bundles; 32 | } 33 | 34 | public function registerContainerConfiguration(LoaderInterface $loader) 35 | { 36 | $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /symfony/app/Resources/views/base.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block title %}{% endblock %} 6 | 7 | 8 | 9 | 10 | 11 | 12 | {% block stylesheets %}{% endblock %} 13 | 14 | 15 | 16 | 17 |
18 |
19 |
    20 |
  1. 21 |
    22 |

    {% block hero_heading %}{% endblock %} 23 | {% block hero_sub_heading %}{% endblock %} 24 |

    25 |
  2. 26 |
27 |
28 |
29 | 30 | {% block main %}{% endblock %} 31 | 32 | {% block javascripts %}{% endblock %} 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /symfony/app/Resources/views/chat/chat.html.twig: -------------------------------------------------------------------------------- 1 | {% extends 'base.html.twig' %} 2 | 3 | {% block hero_heading %}Real-Time Chat{% endblock %} 4 | 5 | {% block hero_sub_heading %}Fundamental real-time communication.{% endblock %} 6 | 7 | {% block main %} 8 | 9 |
10 |
11 | 12 | 13 | 22 | 23 | 24 |
25 | 26 |
27 |
28 | Today 29 |
30 |
31 | 32 |
33 | 34 |
35 | 36 |
37 |
38 | 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 61 | {% endblock %} 62 | 63 | {% block javascripts %} 64 | 65 | 66 | 67 | 68 | {% if framework is defined %} 69 | 70 | {% endif %} 71 | {% endblock %} 72 | 73 | {% block framework %}{% endblock %} 74 | 75 | {% block stylesheets %} 76 | 107 | {% endblock %} 108 | -------------------------------------------------------------------------------- /symfony/app/SymfonyRequirements.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | * Users of PHP 5.2 should be able to run the requirements checks. 14 | * This is why the file and all classes must be compatible with PHP 5.2+ 15 | * (e.g. not using namespaces and closures). 16 | * 17 | * ************** CAUTION ************** 18 | * 19 | * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of 20 | * the installation/update process. The original file resides in the 21 | * SensioDistributionBundle. 22 | * 23 | * ************** CAUTION ************** 24 | */ 25 | 26 | /** 27 | * Represents a single PHP requirement, e.g. an installed extension. 28 | * It can be a mandatory requirement or an optional recommendation. 29 | * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. 30 | * 31 | * @author Tobias Schultze 32 | */ 33 | class Requirement 34 | { 35 | private $fulfilled; 36 | private $testMessage; 37 | private $helpText; 38 | private $helpHtml; 39 | private $optional; 40 | 41 | /** 42 | * Constructor that initializes the requirement. 43 | * 44 | * @param bool $fulfilled Whether the requirement is fulfilled 45 | * @param string $testMessage The message for testing the requirement 46 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 47 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 48 | * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement 49 | */ 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) 51 | { 52 | $this->fulfilled = (bool) $fulfilled; 53 | $this->testMessage = (string) $testMessage; 54 | $this->helpHtml = (string) $helpHtml; 55 | $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; 56 | $this->optional = (bool) $optional; 57 | } 58 | 59 | /** 60 | * Returns whether the requirement is fulfilled. 61 | * 62 | * @return bool true if fulfilled, otherwise false 63 | */ 64 | public function isFulfilled() 65 | { 66 | return $this->fulfilled; 67 | } 68 | 69 | /** 70 | * Returns the message for testing the requirement. 71 | * 72 | * @return string The test message 73 | */ 74 | public function getTestMessage() 75 | { 76 | return $this->testMessage; 77 | } 78 | 79 | /** 80 | * Returns the help text for resolving the problem. 81 | * 82 | * @return string The help text 83 | */ 84 | public function getHelpText() 85 | { 86 | return $this->helpText; 87 | } 88 | 89 | /** 90 | * Returns the help text formatted in HTML. 91 | * 92 | * @return string The HTML help 93 | */ 94 | public function getHelpHtml() 95 | { 96 | return $this->helpHtml; 97 | } 98 | 99 | /** 100 | * Returns whether this is only an optional recommendation and not a mandatory requirement. 101 | * 102 | * @return bool true if optional, false if mandatory 103 | */ 104 | public function isOptional() 105 | { 106 | return $this->optional; 107 | } 108 | } 109 | 110 | /** 111 | * Represents a PHP requirement in form of a php.ini configuration. 112 | * 113 | * @author Tobias Schultze 114 | */ 115 | class PhpIniRequirement extends Requirement 116 | { 117 | /** 118 | * Constructor that initializes the requirement. 119 | * 120 | * @param string $cfgName The configuration name used for ini_get() 121 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 122 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 123 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 124 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 125 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 126 | * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 127 | * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 128 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 129 | * @param bool $optional Whether this is only an optional recommendation not a mandatory requirement 130 | */ 131 | public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) 132 | { 133 | $cfgValue = ini_get($cfgName); 134 | 135 | if (is_callable($evaluation)) { 136 | if (null === $testMessage || null === $helpHtml) { 137 | throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); 138 | } 139 | 140 | $fulfilled = call_user_func($evaluation, $cfgValue); 141 | } else { 142 | if (null === $testMessage) { 143 | $testMessage = sprintf('%s %s be %s in php.ini', 144 | $cfgName, 145 | $optional ? 'should' : 'must', 146 | $evaluation ? 'enabled' : 'disabled' 147 | ); 148 | } 149 | 150 | if (null === $helpHtml) { 151 | $helpHtml = sprintf('Set %s to %s in php.ini*.', 152 | $cfgName, 153 | $evaluation ? 'on' : 'off' 154 | ); 155 | } 156 | 157 | $fulfilled = $evaluation == $cfgValue; 158 | } 159 | 160 | parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); 161 | } 162 | } 163 | 164 | /** 165 | * A RequirementCollection represents a set of Requirement instances. 166 | * 167 | * @author Tobias Schultze 168 | */ 169 | class RequirementCollection implements IteratorAggregate 170 | { 171 | private $requirements = array(); 172 | 173 | /** 174 | * Gets the current RequirementCollection as an Iterator. 175 | * 176 | * @return Traversable A Traversable interface 177 | */ 178 | public function getIterator() 179 | { 180 | return new ArrayIterator($this->requirements); 181 | } 182 | 183 | /** 184 | * Adds a Requirement. 185 | * 186 | * @param Requirement $requirement A Requirement instance 187 | */ 188 | public function add(Requirement $requirement) 189 | { 190 | $this->requirements[] = $requirement; 191 | } 192 | 193 | /** 194 | * Adds a mandatory requirement. 195 | * 196 | * @param bool $fulfilled Whether the requirement is fulfilled 197 | * @param string $testMessage The message for testing the requirement 198 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 199 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 200 | */ 201 | public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) 202 | { 203 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); 204 | } 205 | 206 | /** 207 | * Adds an optional recommendation. 208 | * 209 | * @param bool $fulfilled Whether the recommendation is fulfilled 210 | * @param string $testMessage The message for testing the recommendation 211 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 212 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 213 | */ 214 | public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) 215 | { 216 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); 217 | } 218 | 219 | /** 220 | * Adds a mandatory requirement in form of a php.ini configuration. 221 | * 222 | * @param string $cfgName The configuration name used for ini_get() 223 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 224 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 225 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 226 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 227 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 228 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 229 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 230 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 231 | */ 232 | public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 233 | { 234 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); 235 | } 236 | 237 | /** 238 | * Adds an optional recommendation in form of a php.ini configuration. 239 | * 240 | * @param string $cfgName The configuration name used for ini_get() 241 | * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, 242 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 243 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 244 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 245 | * Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 246 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived) 247 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived) 248 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 249 | */ 250 | public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 251 | { 252 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); 253 | } 254 | 255 | /** 256 | * Adds a requirement collection to the current set of requirements. 257 | * 258 | * @param RequirementCollection $collection A RequirementCollection instance 259 | */ 260 | public function addCollection(RequirementCollection $collection) 261 | { 262 | $this->requirements = array_merge($this->requirements, $collection->all()); 263 | } 264 | 265 | /** 266 | * Returns both requirements and recommendations. 267 | * 268 | * @return array Array of Requirement instances 269 | */ 270 | public function all() 271 | { 272 | return $this->requirements; 273 | } 274 | 275 | /** 276 | * Returns all mandatory requirements. 277 | * 278 | * @return array Array of Requirement instances 279 | */ 280 | public function getRequirements() 281 | { 282 | $array = array(); 283 | foreach ($this->requirements as $req) { 284 | if (!$req->isOptional()) { 285 | $array[] = $req; 286 | } 287 | } 288 | 289 | return $array; 290 | } 291 | 292 | /** 293 | * Returns the mandatory requirements that were not met. 294 | * 295 | * @return array Array of Requirement instances 296 | */ 297 | public function getFailedRequirements() 298 | { 299 | $array = array(); 300 | foreach ($this->requirements as $req) { 301 | if (!$req->isFulfilled() && !$req->isOptional()) { 302 | $array[] = $req; 303 | } 304 | } 305 | 306 | return $array; 307 | } 308 | 309 | /** 310 | * Returns all optional recommendations. 311 | * 312 | * @return array Array of Requirement instances 313 | */ 314 | public function getRecommendations() 315 | { 316 | $array = array(); 317 | foreach ($this->requirements as $req) { 318 | if ($req->isOptional()) { 319 | $array[] = $req; 320 | } 321 | } 322 | 323 | return $array; 324 | } 325 | 326 | /** 327 | * Returns the recommendations that were not met. 328 | * 329 | * @return array Array of Requirement instances 330 | */ 331 | public function getFailedRecommendations() 332 | { 333 | $array = array(); 334 | foreach ($this->requirements as $req) { 335 | if (!$req->isFulfilled() && $req->isOptional()) { 336 | $array[] = $req; 337 | } 338 | } 339 | 340 | return $array; 341 | } 342 | 343 | /** 344 | * Returns whether a php.ini configuration is not correct. 345 | * 346 | * @return bool php.ini configuration problem? 347 | */ 348 | public function hasPhpIniConfigIssue() 349 | { 350 | foreach ($this->requirements as $req) { 351 | if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { 352 | return true; 353 | } 354 | } 355 | 356 | return false; 357 | } 358 | 359 | /** 360 | * Returns the PHP configuration file (php.ini) path. 361 | * 362 | * @return string|false php.ini file path 363 | */ 364 | public function getPhpIniConfigPath() 365 | { 366 | return get_cfg_var('cfg_file_path'); 367 | } 368 | } 369 | 370 | /** 371 | * This class specifies all requirements and optional recommendations that 372 | * are necessary to run the Symfony Standard Edition. 373 | * 374 | * @author Tobias Schultze 375 | * @author Fabien Potencier 376 | */ 377 | class SymfonyRequirements extends RequirementCollection 378 | { 379 | const REQUIRED_PHP_VERSION = '5.3.3'; 380 | 381 | /** 382 | * Constructor that initializes the requirements. 383 | */ 384 | public function __construct() 385 | { 386 | /* mandatory requirements follow */ 387 | 388 | $installedPhpVersion = phpversion(); 389 | 390 | $this->addRequirement( 391 | version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='), 392 | sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion), 393 | sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. 394 | Before using Symfony, upgrade your PHP installation, preferably to the latest version.', 395 | $installedPhpVersion, self::REQUIRED_PHP_VERSION), 396 | sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion) 397 | ); 398 | 399 | $this->addRequirement( 400 | version_compare($installedPhpVersion, '5.3.16', '!='), 401 | 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it', 402 | 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)' 403 | ); 404 | 405 | $this->addRequirement( 406 | is_dir(__DIR__.'/../vendor/composer'), 407 | 'Vendor libraries must be installed', 408 | 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. '. 409 | 'Then run "php composer.phar install" to install them.' 410 | ); 411 | 412 | $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; 413 | 414 | $this->addRequirement( 415 | is_writable($cacheDir), 416 | 'app/cache/ or var/cache/ directory must be writable', 417 | 'Change the permissions of either "app/cache/" or "var/cache/" directory so that the web server can write into it.' 418 | ); 419 | 420 | $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; 421 | 422 | $this->addRequirement( 423 | is_writable($logsDir), 424 | 'app/logs/ or var/logs/ directory must be writable', 425 | 'Change the permissions of either "app/logs/" or "var/logs/" directory so that the web server can write into it.' 426 | ); 427 | 428 | $this->addPhpIniRequirement( 429 | 'date.timezone', true, false, 430 | 'date.timezone setting must be set', 431 | 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' 432 | ); 433 | 434 | if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { 435 | $timezones = array(); 436 | foreach (DateTimeZone::listAbbreviations() as $abbreviations) { 437 | foreach ($abbreviations as $abbreviation) { 438 | $timezones[$abbreviation['timezone_id']] = true; 439 | } 440 | } 441 | 442 | $this->addRequirement( 443 | isset($timezones[@date_default_timezone_get()]), 444 | sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()), 445 | 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' 446 | ); 447 | } 448 | 449 | $this->addRequirement( 450 | function_exists('json_encode'), 451 | 'json_encode() must be available', 452 | 'Install and enable the JSON extension.' 453 | ); 454 | 455 | $this->addRequirement( 456 | function_exists('session_start'), 457 | 'session_start() must be available', 458 | 'Install and enable the session extension.' 459 | ); 460 | 461 | $this->addRequirement( 462 | function_exists('ctype_alpha'), 463 | 'ctype_alpha() must be available', 464 | 'Install and enable the ctype extension.' 465 | ); 466 | 467 | $this->addRequirement( 468 | function_exists('token_get_all'), 469 | 'token_get_all() must be available', 470 | 'Install and enable the Tokenizer extension.' 471 | ); 472 | 473 | $this->addRequirement( 474 | function_exists('simplexml_import_dom'), 475 | 'simplexml_import_dom() must be available', 476 | 'Install and enable the SimpleXML extension.' 477 | ); 478 | 479 | if (function_exists('apc_store') && ini_get('apc.enabled')) { 480 | if (version_compare($installedPhpVersion, '5.4.0', '>=')) { 481 | $this->addRequirement( 482 | version_compare(phpversion('apc'), '3.1.13', '>='), 483 | 'APC version must be at least 3.1.13 when using PHP 5.4', 484 | 'Upgrade your APC extension (3.1.13+).' 485 | ); 486 | } else { 487 | $this->addRequirement( 488 | version_compare(phpversion('apc'), '3.0.17', '>='), 489 | 'APC version must be at least 3.0.17', 490 | 'Upgrade your APC extension (3.0.17+).' 491 | ); 492 | } 493 | } 494 | 495 | $this->addPhpIniRequirement('detect_unicode', false); 496 | 497 | if (extension_loaded('suhosin')) { 498 | $this->addPhpIniRequirement( 499 | 'suhosin.executor.include.whitelist', 500 | create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), 501 | false, 502 | 'suhosin.executor.include.whitelist must be configured correctly in php.ini', 503 | 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' 504 | ); 505 | } 506 | 507 | if (extension_loaded('xdebug')) { 508 | $this->addPhpIniRequirement( 509 | 'xdebug.show_exception_trace', false, true 510 | ); 511 | 512 | $this->addPhpIniRequirement( 513 | 'xdebug.scream', false, true 514 | ); 515 | 516 | $this->addPhpIniRecommendation( 517 | 'xdebug.max_nesting_level', 518 | create_function('$cfgValue', 'return $cfgValue > 100;'), 519 | true, 520 | 'xdebug.max_nesting_level should be above 100 in php.ini', 521 | 'Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.' 522 | ); 523 | } 524 | 525 | $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; 526 | 527 | $this->addRequirement( 528 | null !== $pcreVersion, 529 | 'PCRE extension must be available', 530 | 'Install the PCRE extension (version 8.0+).' 531 | ); 532 | 533 | if (extension_loaded('mbstring')) { 534 | $this->addPhpIniRequirement( 535 | 'mbstring.func_overload', 536 | create_function('$cfgValue', 'return (int) $cfgValue === 0;'), 537 | true, 538 | 'string functions should not be overloaded', 539 | 'Set "mbstring.func_overload" to 0 in php.ini* to disable function overloading by the mbstring extension.' 540 | ); 541 | } 542 | 543 | /* optional recommendations follow */ 544 | 545 | if (file_exists(__DIR__.'/../vendor/composer')) { 546 | require_once __DIR__.'/../vendor/autoload.php'; 547 | 548 | try { 549 | $r = new \ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); 550 | 551 | $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); 552 | } catch (\ReflectionException $e) { 553 | $contents = ''; 554 | } 555 | $this->addRecommendation( 556 | file_get_contents(__FILE__) === $contents, 557 | 'Requirements file should be up-to-date', 558 | 'Your requirements file is outdated. Run composer install and re-check your configuration.' 559 | ); 560 | } 561 | 562 | $this->addRecommendation( 563 | version_compare($installedPhpVersion, '5.3.4', '>='), 564 | 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions', 565 | 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.' 566 | ); 567 | 568 | $this->addRecommendation( 569 | version_compare($installedPhpVersion, '5.3.8', '>='), 570 | 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156', 571 | 'Install PHP 5.3.8 or newer if your project uses annotations.' 572 | ); 573 | 574 | $this->addRecommendation( 575 | version_compare($installedPhpVersion, '5.4.0', '!='), 576 | 'You should not use PHP 5.4.0 due to the PHP bug #61453', 577 | 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.' 578 | ); 579 | 580 | $this->addRecommendation( 581 | version_compare($installedPhpVersion, '5.4.11', '>='), 582 | 'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)', 583 | 'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.' 584 | ); 585 | 586 | $this->addRecommendation( 587 | (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<')) 588 | || 589 | version_compare($installedPhpVersion, '5.4.8', '>='), 590 | 'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909', 591 | 'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.' 592 | ); 593 | 594 | if (null !== $pcreVersion) { 595 | $this->addRecommendation( 596 | $pcreVersion >= 8.0, 597 | sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion), 598 | 'PCRE 8.0+ is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.' 599 | ); 600 | } 601 | 602 | $this->addRecommendation( 603 | class_exists('DomDocument'), 604 | 'PHP-DOM and PHP-XML modules should be installed', 605 | 'Install and enable the PHP-DOM and the PHP-XML modules.' 606 | ); 607 | 608 | $this->addRecommendation( 609 | function_exists('mb_strlen'), 610 | 'mb_strlen() should be available', 611 | 'Install and enable the mbstring extension.' 612 | ); 613 | 614 | $this->addRecommendation( 615 | function_exists('iconv'), 616 | 'iconv() should be available', 617 | 'Install and enable the iconv extension.' 618 | ); 619 | 620 | $this->addRecommendation( 621 | function_exists('utf8_decode'), 622 | 'utf8_decode() should be available', 623 | 'Install and enable the XML extension.' 624 | ); 625 | 626 | $this->addRecommendation( 627 | function_exists('filter_var'), 628 | 'filter_var() should be available', 629 | 'Install and enable the filter extension.' 630 | ); 631 | 632 | if (!defined('PHP_WINDOWS_VERSION_BUILD')) { 633 | $this->addRecommendation( 634 | function_exists('posix_isatty'), 635 | 'posix_isatty() should be available', 636 | 'Install and enable the php_posix extension (used to colorize the CLI output).' 637 | ); 638 | } 639 | 640 | $this->addRecommendation( 641 | extension_loaded('intl'), 642 | 'intl extension should be available', 643 | 'Install and enable the intl extension (used for validators).' 644 | ); 645 | 646 | if (extension_loaded('intl')) { 647 | // in some WAMP server installations, new Collator() returns null 648 | $this->addRecommendation( 649 | null !== new Collator('fr_FR'), 650 | 'intl extension should be correctly configured', 651 | 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' 652 | ); 653 | 654 | // check for compatible ICU versions (only done when you have the intl extension) 655 | if (defined('INTL_ICU_VERSION')) { 656 | $version = INTL_ICU_VERSION; 657 | } else { 658 | $reflector = new ReflectionExtension('intl'); 659 | 660 | ob_start(); 661 | $reflector->info(); 662 | $output = strip_tags(ob_get_clean()); 663 | 664 | preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); 665 | $version = $matches[1]; 666 | } 667 | 668 | $this->addRecommendation( 669 | version_compare($version, '4.0', '>='), 670 | 'intl ICU version should be at least 4+', 671 | 'Upgrade your intl extension with a newer ICU version (4+).' 672 | ); 673 | 674 | $this->addPhpIniRecommendation( 675 | 'intl.error_level', 676 | create_function('$cfgValue', 'return (int) $cfgValue === 0;'), 677 | true, 678 | 'intl.error_level should be 0 in php.ini', 679 | 'Set "intl.error_level" to "0" in php.ini* to inhibit the messages when an error occurs in ICU functions.' 680 | ); 681 | } 682 | 683 | $accelerator = 684 | (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable')) 685 | || 686 | (extension_loaded('apc') && ini_get('apc.enabled')) 687 | || 688 | (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable')) 689 | || 690 | (extension_loaded('Zend OPcache') && ini_get('opcache.enable')) 691 | || 692 | (extension_loaded('xcache') && ini_get('xcache.cacher')) 693 | || 694 | (extension_loaded('wincache') && ini_get('wincache.ocenabled')) 695 | ; 696 | 697 | $this->addRecommendation( 698 | $accelerator, 699 | 'a PHP accelerator should be installed', 700 | 'Install and/or enable a PHP accelerator (highly recommended).' 701 | ); 702 | 703 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { 704 | $this->addRecommendation( 705 | $this->getRealpathCacheSize() > 1000, 706 | 'realpath_cache_size should be above 1024 in php.ini', 707 | 'Set "realpath_cache_size" to e.g. "1024" in php.ini* to improve performance on windows.' 708 | ); 709 | } 710 | 711 | $this->addPhpIniRecommendation('short_open_tag', false); 712 | 713 | $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); 714 | 715 | $this->addPhpIniRecommendation('register_globals', false, true); 716 | 717 | $this->addPhpIniRecommendation('session.auto_start', false); 718 | 719 | $this->addRecommendation( 720 | class_exists('PDO'), 721 | 'PDO should be installed', 722 | 'Install PDO (mandatory for Doctrine).' 723 | ); 724 | 725 | if (class_exists('PDO')) { 726 | $drivers = PDO::getAvailableDrivers(); 727 | $this->addRecommendation( 728 | count($drivers) > 0, 729 | sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), 730 | 'Install PDO drivers (mandatory for Doctrine).' 731 | ); 732 | } 733 | } 734 | 735 | /** 736 | * Loads realpath_cache_size from php.ini and converts it to int. 737 | * 738 | * (e.g. 16k is converted to 16384 int) 739 | * 740 | * @return int 741 | */ 742 | protected function getRealpathCacheSize() 743 | { 744 | $size = ini_get('realpath_cache_size'); 745 | $size = trim($size); 746 | $unit = strtolower(substr($size, -1, 1)); 747 | switch ($unit) { 748 | case 'g': 749 | return $size * 1024 * 1024 * 1024; 750 | case 'm': 751 | return $size * 1024 * 1024; 752 | case 'k': 753 | return $size * 1024; 754 | default: 755 | return (int) $size; 756 | } 757 | } 758 | } 759 | -------------------------------------------------------------------------------- /symfony/app/autoload.php: -------------------------------------------------------------------------------- 1 | getPhpIniConfigPath(); 8 | 9 | echo_title('Symfony2 Requirements Checker'); 10 | 11 | echo '> PHP is using the following php.ini file:'.PHP_EOL; 12 | if ($iniPath) { 13 | echo_style('green', ' '.$iniPath); 14 | } else { 15 | echo_style('warning', ' WARNING: No configuration file (php.ini) used by PHP!'); 16 | } 17 | 18 | echo PHP_EOL.PHP_EOL; 19 | 20 | echo '> Checking Symfony requirements:'.PHP_EOL.' '; 21 | 22 | $messages = array(); 23 | foreach ($symfonyRequirements->getRequirements() as $req) { 24 | /** @var $req Requirement */ 25 | if ($helpText = get_error_message($req, $lineSize)) { 26 | echo_style('red', 'E'); 27 | $messages['error'][] = $helpText; 28 | } else { 29 | echo_style('green', '.'); 30 | } 31 | } 32 | 33 | $checkPassed = empty($messages['error']); 34 | 35 | foreach ($symfonyRequirements->getRecommendations() as $req) { 36 | if ($helpText = get_error_message($req, $lineSize)) { 37 | echo_style('yellow', 'W'); 38 | $messages['warning'][] = $helpText; 39 | } else { 40 | echo_style('green', '.'); 41 | } 42 | } 43 | 44 | if ($checkPassed) { 45 | echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects'); 46 | } else { 47 | echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects'); 48 | 49 | echo_title('Fix the following mandatory requirements', 'red'); 50 | 51 | foreach ($messages['error'] as $helpText) { 52 | echo ' * '.$helpText.PHP_EOL; 53 | } 54 | } 55 | 56 | if (!empty($messages['warning'])) { 57 | echo_title('Optional recommendations to improve your setup', 'yellow'); 58 | 59 | foreach ($messages['warning'] as $helpText) { 60 | echo ' * '.$helpText.PHP_EOL; 61 | } 62 | } 63 | 64 | echo PHP_EOL; 65 | echo_style('title', 'Note'); 66 | echo ' The command console could use a different php.ini file'.PHP_EOL; 67 | echo_style('title', '~~~~'); 68 | echo ' than the one used with your web server. To be on the'.PHP_EOL; 69 | echo ' safe side, please check the requirements from your web'.PHP_EOL; 70 | echo ' server using the '; 71 | echo_style('yellow', 'web/config.php'); 72 | echo ' script.'.PHP_EOL; 73 | echo PHP_EOL; 74 | 75 | exit($checkPassed ? 0 : 1); 76 | 77 | function get_error_message(Requirement $requirement, $lineSize) 78 | { 79 | if ($requirement->isFulfilled()) { 80 | return; 81 | } 82 | 83 | $errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL; 84 | $errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL; 85 | 86 | return $errorMessage; 87 | } 88 | 89 | function echo_title($title, $style = null) 90 | { 91 | $style = $style ?: 'title'; 92 | 93 | echo PHP_EOL; 94 | echo_style($style, $title.PHP_EOL); 95 | echo_style($style, str_repeat('~', strlen($title)).PHP_EOL); 96 | echo PHP_EOL; 97 | } 98 | 99 | function echo_style($style, $message) 100 | { 101 | // ANSI color codes 102 | $styles = array( 103 | 'reset' => "\033[0m", 104 | 'red' => "\033[31m", 105 | 'green' => "\033[32m", 106 | 'yellow' => "\033[33m", 107 | 'error' => "\033[37;41m", 108 | 'success' => "\033[37;42m", 109 | 'title' => "\033[34m", 110 | ); 111 | $supports = has_color_support(); 112 | 113 | echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : ''); 114 | } 115 | 116 | function echo_block($style, $title, $message) 117 | { 118 | $message = ' '.trim($message).' '; 119 | $width = strlen($message); 120 | 121 | echo PHP_EOL.PHP_EOL; 122 | 123 | echo_style($style, str_repeat(' ', $width).PHP_EOL); 124 | echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL); 125 | echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL); 126 | echo_style($style, str_repeat(' ', $width).PHP_EOL); 127 | } 128 | 129 | function has_color_support() 130 | { 131 | static $support; 132 | 133 | if (null === $support) { 134 | if (DIRECTORY_SEPARATOR == '\\') { 135 | $support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); 136 | } else { 137 | $support = function_exists('posix_isatty') && @posix_isatty(STDOUT); 138 | } 139 | } 140 | 141 | return $support; 142 | } 143 | -------------------------------------------------------------------------------- /symfony/app/config/config.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: parameters.yml } 3 | - { resource: security.yml } 4 | - { resource: services.yml } 5 | - { resource: pusher.yml } 6 | - { resource: nexmo.yml } 7 | 8 | # Put parameters here that don't need to change on each machine where the app is deployed 9 | # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration 10 | parameters: 11 | locale: en 12 | 13 | framework: 14 | #esi: ~ 15 | #translator: { fallbacks: ["%locale%"] } 16 | secret: "%secret%" 17 | router: 18 | resource: "%kernel.root_dir%/config/routing.yml" 19 | strict_requirements: ~ 20 | form: ~ 21 | csrf_protection: ~ 22 | validation: { enable_annotations: true } 23 | #serializer: { enable_annotations: true } 24 | templating: 25 | engines: ['twig'] 26 | #assets_version: SomeVersionScheme 27 | default_locale: "%locale%" 28 | trusted_hosts: ~ 29 | trusted_proxies: ~ 30 | session: 31 | # handler_id set to null will use default session handler from php.ini 32 | handler_id: ~ 33 | fragments: ~ 34 | http_method_override: true 35 | 36 | # Twig Configuration 37 | twig: 38 | debug: "%kernel.debug%" 39 | strict_variables: "%kernel.debug%" 40 | 41 | # Assetic Configuration 42 | assetic: 43 | debug: "%kernel.debug%" 44 | use_controller: false 45 | bundles: [ ] 46 | #java: /usr/bin/java 47 | filters: 48 | cssrewrite: ~ 49 | #closure: 50 | # jar: "%kernel.root_dir%/Resources/java/compiler.jar" 51 | #yui_css: 52 | # jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar" 53 | 54 | # Doctrine Configuration 55 | doctrine: 56 | dbal: 57 | driver: pdo_sqlite 58 | path: "%kernel.root_dir%/data/sqlite.db" 59 | charset: UTF8 60 | 61 | orm: 62 | auto_generate_proxy_classes: "%kernel.debug%" 63 | naming_strategy: doctrine.orm.naming_strategy.underscore 64 | auto_mapping: true 65 | 66 | # Swiftmailer Configuration 67 | swiftmailer: 68 | transport: "%mailer_transport%" 69 | host: "%mailer_host%" 70 | username: "%mailer_user%" 71 | password: "%mailer_password%" 72 | spool: { type: memory } 73 | 74 | lopi_pusher: 75 | app_id: "%pusher.app_id%" 76 | key: "%pusher.app_key%" 77 | secret: "%pusher.app_secret%" 78 | 79 | jhg_nexmo: 80 | api_key: "%nexmo.api_key%" 81 | api_secret: "%nexmo.api_secret%" 82 | from_name: "%nexmo.from_name%" 83 | -------------------------------------------------------------------------------- /symfony/app/config/config_dev.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | framework: 5 | router: 6 | resource: "%kernel.root_dir%/config/routing_dev.yml" 7 | strict_requirements: true 8 | profiler: { only_exceptions: false } 9 | 10 | web_profiler: 11 | toolbar: true 12 | intercept_redirects: false 13 | 14 | monolog: 15 | handlers: 16 | main: 17 | type: stream 18 | path: "%kernel.logs_dir%/%kernel.environment%.log" 19 | level: debug 20 | console: 21 | type: console 22 | bubble: false 23 | verbosity_levels: 24 | VERBOSITY_VERBOSE: INFO 25 | VERBOSITY_VERY_VERBOSE: DEBUG 26 | channels: ["!doctrine"] 27 | console_very_verbose: 28 | type: console 29 | bubble: false 30 | verbosity_levels: 31 | VERBOSITY_VERBOSE: NOTICE 32 | VERBOSITY_VERY_VERBOSE: NOTICE 33 | VERBOSITY_DEBUG: DEBUG 34 | channels: ["doctrine"] 35 | # uncomment to get logging in your browser 36 | # you may have to allow bigger header sizes in your Web server configuration 37 | #firephp: 38 | # type: firephp 39 | # level: info 40 | #chromephp: 41 | # type: chromephp 42 | # level: info 43 | 44 | assetic: 45 | use_controller: true 46 | 47 | #swiftmailer: 48 | # delivery_address: me@example.com 49 | -------------------------------------------------------------------------------- /symfony/app/config/config_prod.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | #framework: 5 | # validation: 6 | # cache: validator.mapping.cache.apc 7 | # serializer: 8 | # cache: serializer.mapping.cache.apc 9 | 10 | #doctrine: 11 | # orm: 12 | # metadata_cache_driver: apc 13 | # result_cache_driver: apc 14 | # query_cache_driver: apc 15 | 16 | monolog: 17 | handlers: 18 | main: 19 | type: fingers_crossed 20 | action_level: error 21 | handler: nested 22 | nested: 23 | type: stream 24 | path: "%kernel.logs_dir%/%kernel.environment%.log" 25 | level: debug 26 | console: 27 | type: console 28 | -------------------------------------------------------------------------------- /symfony/app/config/config_test.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config_dev.yml } 3 | 4 | framework: 5 | test: ~ 6 | session: 7 | storage_id: session.storage.mock_file 8 | profiler: 9 | collect: false 10 | 11 | web_profiler: 12 | toolbar: false 13 | intercept_redirects: false 14 | 15 | swiftmailer: 16 | disable_delivery: true 17 | -------------------------------------------------------------------------------- /symfony/app/config/nexmo.yml.example: -------------------------------------------------------------------------------- 1 | parameters: 2 | nexmo.api_key: YOUR_API_KEY 3 | nexmo.api_secret: YOUR_API_SECRET 4 | nexmo.from_name: Nexmo 5 | -------------------------------------------------------------------------------- /symfony/app/config/parameters.yml.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of what your parameters.yml file should look like 2 | # Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | parameters: 5 | database_host: 127.0.0.1 6 | database_port: ~ 7 | database_name: symfony 8 | database_user: root 9 | database_password: ~ 10 | # You should uncomment this if you want use pdo_sqlite 11 | # database_path: "%kernel.root_dir%/data.db3" 12 | 13 | mailer_transport: smtp 14 | mailer_host: 127.0.0.1 15 | mailer_user: ~ 16 | mailer_password: ~ 17 | 18 | # A secret key that's used to generate certain security-related tokens 19 | secret: ThisTokenIsNotSoSecretChangeIt 20 | -------------------------------------------------------------------------------- /symfony/app/config/pusher.yml.example: -------------------------------------------------------------------------------- 1 | parameters: 2 | pusher.app_id: YOUR_APP_ID 3 | pusher.app_key: YOUR_APP_KEY 4 | pusher.app_secret: YOUR_APP_SECRET 5 | -------------------------------------------------------------------------------- /symfony/app/config/routing.yml: -------------------------------------------------------------------------------- 1 | app: 2 | resource: "@AppBundle/Controller/" 3 | type: annotation 4 | -------------------------------------------------------------------------------- /symfony/app/config/routing_dev.yml: -------------------------------------------------------------------------------- 1 | _wdt: 2 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" 3 | prefix: /_wdt 4 | 5 | _profiler: 6 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" 7 | prefix: /_profiler 8 | 9 | _configurator: 10 | resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" 11 | prefix: /_configurator 12 | 13 | _errors: 14 | resource: "@TwigBundle/Resources/config/routing/errors.xml" 15 | prefix: /_error 16 | 17 | _main: 18 | resource: routing.yml 19 | -------------------------------------------------------------------------------- /symfony/app/config/security.yml: -------------------------------------------------------------------------------- 1 | # To get started with security, check out the documentation: 2 | # http://symfony.com/doc/current/book/security.html 3 | security: 4 | 5 | # http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers 6 | providers: 7 | in_memory: 8 | memory: ~ 9 | 10 | firewalls: 11 | # disables authentication for assets and the profiler, adapt it according to your needs 12 | dev: 13 | pattern: ^/(_(profiler|wdt)|css|images|js)/ 14 | security: false 15 | 16 | main: 17 | anonymous: ~ 18 | # activate different ways to authenticate 19 | 20 | # http_basic: ~ 21 | # http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate 22 | 23 | # form_login: ~ 24 | # http://symfony.com/doc/current/cookbook/security/form_login_setup.html 25 | -------------------------------------------------------------------------------- /symfony/app/config/services.yml: -------------------------------------------------------------------------------- 1 | # Learn more about services, parameters and containers at 2 | # http://symfony.com/doc/current/book/service_container.html 3 | parameters: 4 | # parameter_name: value 5 | 6 | services: 7 | # service_name: 8 | # class: AppBundle\Directory\ClassName 9 | # arguments: ["@another_service_name", "plain_value", "%parameter_name%"] 10 | -------------------------------------------------------------------------------- /symfony/app/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); 19 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; 20 | 21 | if ($debug) { 22 | Debug::enable(); 23 | } 24 | 25 | $kernel = new AppKernel($env, $debug); 26 | $application = new Application($kernel); 27 | $application->run($input); 28 | -------------------------------------------------------------------------------- /symfony/app/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/symfony/app/data/.gitkeep -------------------------------------------------------------------------------- /symfony/app/logs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/symfony/app/logs/.gitkeep -------------------------------------------------------------------------------- /symfony/app/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | ../src/*/*Bundle/Tests 13 | ../src/*/Bundle/*Bundle/Tests 14 | ../src/*Bundle/Tests 15 | 16 | 17 | 18 | 23 | 24 | 25 | 26 | ../src 27 | 28 | ../src/*Bundle/Resources 29 | ../src/*Bundle/Tests 30 | ../src/*/*Bundle/Resources 31 | ../src/*/*Bundle/Tests 32 | ../src/*/Bundle/*Bundle/Resources 33 | ../src/*/Bundle/*Bundle/Tests 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /symfony/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pusher/gs.pusher.php.symfony", 3 | "license": "proprietary", 4 | "type": "project", 5 | "autoload": { 6 | "psr-4": { 7 | "": "src/", 8 | "SymfonyStandard\\": "app/SymfonyStandard/" 9 | } 10 | }, 11 | "require": { 12 | "php": ">=5.3.9", 13 | "symfony/symfony": "2.7.*", 14 | "doctrine/orm": "~2.2,>=2.2.3,<2.5", 15 | "doctrine/dbal": "<2.5", 16 | "doctrine/doctrine-bundle": "~1.4", 17 | "symfony/assetic-bundle": "~2.3", 18 | "symfony/swiftmailer-bundle": "~2.3", 19 | "symfony/monolog-bundle": "~2.4", 20 | "sensio/distribution-bundle": "~4.0", 21 | "sensio/framework-extra-bundle": "~3.0,>=3.0.2", 22 | "incenteev/composer-parameter-handler": "~2.0", 23 | "laupifrpar/pusher-bundle": "^1.2", 24 | "predis/predis": "^1.0", 25 | "javihgil/nexmo-bundle": "^0.9.2" 26 | }, 27 | "require-dev": { 28 | "sensio/generator-bundle": "~2.3" 29 | }, 30 | "scripts": { 31 | "post-root-package-install": [ 32 | "SymfonyStandard\\Composer::hookRootPackageInstall" 33 | ], 34 | "post-install-cmd": [ 35 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 36 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 37 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 38 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 39 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 40 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles", 41 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 42 | ], 43 | "post-update-cmd": [ 44 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 45 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 46 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 47 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 48 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 49 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles", 50 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 51 | ] 52 | }, 53 | "config": { 54 | "bin-dir": "bin" 55 | }, 56 | "extra": { 57 | "symfony-app-dir": "app", 58 | "symfony-web-dir": "web", 59 | "symfony-assets-install": "relative", 60 | "incenteev-parameters": { 61 | "file": "app/config/parameters.yml" 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /symfony/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "bf07db2ade2d4fc6ec90e2b2a0d9b2de", 8 | "packages": [ 9 | { 10 | "name": "doctrine/annotations", 11 | "version": "v1.2.7", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/doctrine/annotations.git", 15 | "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", 20 | "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "doctrine/lexer": "1.*", 25 | "php": ">=5.3.2" 26 | }, 27 | "require-dev": { 28 | "doctrine/cache": "1.*", 29 | "phpunit/phpunit": "4.*" 30 | }, 31 | "type": "library", 32 | "extra": { 33 | "branch-alias": { 34 | "dev-master": "1.3.x-dev" 35 | } 36 | }, 37 | "autoload": { 38 | "psr-0": { 39 | "Doctrine\\Common\\Annotations\\": "lib/" 40 | } 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "MIT" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "Roman Borschel", 49 | "email": "roman@code-factory.org" 50 | }, 51 | { 52 | "name": "Benjamin Eberlei", 53 | "email": "kontakt@beberlei.de" 54 | }, 55 | { 56 | "name": "Guilherme Blanco", 57 | "email": "guilhermeblanco@gmail.com" 58 | }, 59 | { 60 | "name": "Jonathan Wage", 61 | "email": "jonwage@gmail.com" 62 | }, 63 | { 64 | "name": "Johannes Schmitt", 65 | "email": "schmittjoh@gmail.com" 66 | } 67 | ], 68 | "description": "Docblock Annotations Parser", 69 | "homepage": "http://www.doctrine-project.org", 70 | "keywords": [ 71 | "annotations", 72 | "docblock", 73 | "parser" 74 | ], 75 | "time": "2015-08-31 12:32:49" 76 | }, 77 | { 78 | "name": "doctrine/cache", 79 | "version": "v1.4.2", 80 | "source": { 81 | "type": "git", 82 | "url": "https://github.com/doctrine/cache.git", 83 | "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca" 84 | }, 85 | "dist": { 86 | "type": "zip", 87 | "url": "https://api.github.com/repos/doctrine/cache/zipball/8c434000f420ade76a07c64cbe08ca47e5c101ca", 88 | "reference": "8c434000f420ade76a07c64cbe08ca47e5c101ca", 89 | "shasum": "" 90 | }, 91 | "require": { 92 | "php": ">=5.3.2" 93 | }, 94 | "conflict": { 95 | "doctrine/common": ">2.2,<2.4" 96 | }, 97 | "require-dev": { 98 | "phpunit/phpunit": ">=3.7", 99 | "predis/predis": "~1.0", 100 | "satooshi/php-coveralls": "~0.6" 101 | }, 102 | "type": "library", 103 | "extra": { 104 | "branch-alias": { 105 | "dev-master": "1.5.x-dev" 106 | } 107 | }, 108 | "autoload": { 109 | "psr-0": { 110 | "Doctrine\\Common\\Cache\\": "lib/" 111 | } 112 | }, 113 | "notification-url": "https://packagist.org/downloads/", 114 | "license": [ 115 | "MIT" 116 | ], 117 | "authors": [ 118 | { 119 | "name": "Roman Borschel", 120 | "email": "roman@code-factory.org" 121 | }, 122 | { 123 | "name": "Benjamin Eberlei", 124 | "email": "kontakt@beberlei.de" 125 | }, 126 | { 127 | "name": "Guilherme Blanco", 128 | "email": "guilhermeblanco@gmail.com" 129 | }, 130 | { 131 | "name": "Jonathan Wage", 132 | "email": "jonwage@gmail.com" 133 | }, 134 | { 135 | "name": "Johannes Schmitt", 136 | "email": "schmittjoh@gmail.com" 137 | } 138 | ], 139 | "description": "Caching library offering an object-oriented API for many cache backends", 140 | "homepage": "http://www.doctrine-project.org", 141 | "keywords": [ 142 | "cache", 143 | "caching" 144 | ], 145 | "time": "2015-08-31 12:36:41" 146 | }, 147 | { 148 | "name": "doctrine/collections", 149 | "version": "v1.3.0", 150 | "source": { 151 | "type": "git", 152 | "url": "https://github.com/doctrine/collections.git", 153 | "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a" 154 | }, 155 | "dist": { 156 | "type": "zip", 157 | "url": "https://api.github.com/repos/doctrine/collections/zipball/6c1e4eef75f310ea1b3e30945e9f06e652128b8a", 158 | "reference": "6c1e4eef75f310ea1b3e30945e9f06e652128b8a", 159 | "shasum": "" 160 | }, 161 | "require": { 162 | "php": ">=5.3.2" 163 | }, 164 | "require-dev": { 165 | "phpunit/phpunit": "~4.0" 166 | }, 167 | "type": "library", 168 | "extra": { 169 | "branch-alias": { 170 | "dev-master": "1.2.x-dev" 171 | } 172 | }, 173 | "autoload": { 174 | "psr-0": { 175 | "Doctrine\\Common\\Collections\\": "lib/" 176 | } 177 | }, 178 | "notification-url": "https://packagist.org/downloads/", 179 | "license": [ 180 | "MIT" 181 | ], 182 | "authors": [ 183 | { 184 | "name": "Roman Borschel", 185 | "email": "roman@code-factory.org" 186 | }, 187 | { 188 | "name": "Benjamin Eberlei", 189 | "email": "kontakt@beberlei.de" 190 | }, 191 | { 192 | "name": "Guilherme Blanco", 193 | "email": "guilhermeblanco@gmail.com" 194 | }, 195 | { 196 | "name": "Jonathan Wage", 197 | "email": "jonwage@gmail.com" 198 | }, 199 | { 200 | "name": "Johannes Schmitt", 201 | "email": "schmittjoh@gmail.com" 202 | } 203 | ], 204 | "description": "Collections Abstraction library", 205 | "homepage": "http://www.doctrine-project.org", 206 | "keywords": [ 207 | "array", 208 | "collections", 209 | "iterator" 210 | ], 211 | "time": "2015-04-14 22:21:58" 212 | }, 213 | { 214 | "name": "doctrine/common", 215 | "version": "v2.5.1", 216 | "source": { 217 | "type": "git", 218 | "url": "https://github.com/doctrine/common.git", 219 | "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9" 220 | }, 221 | "dist": { 222 | "type": "zip", 223 | "url": "https://api.github.com/repos/doctrine/common/zipball/0009b8f0d4a917aabc971fb089eba80e872f83f9", 224 | "reference": "0009b8f0d4a917aabc971fb089eba80e872f83f9", 225 | "shasum": "" 226 | }, 227 | "require": { 228 | "doctrine/annotations": "1.*", 229 | "doctrine/cache": "1.*", 230 | "doctrine/collections": "1.*", 231 | "doctrine/inflector": "1.*", 232 | "doctrine/lexer": "1.*", 233 | "php": ">=5.3.2" 234 | }, 235 | "require-dev": { 236 | "phpunit/phpunit": "~3.7" 237 | }, 238 | "type": "library", 239 | "extra": { 240 | "branch-alias": { 241 | "dev-master": "2.6.x-dev" 242 | } 243 | }, 244 | "autoload": { 245 | "psr-0": { 246 | "Doctrine\\Common\\": "lib/" 247 | } 248 | }, 249 | "notification-url": "https://packagist.org/downloads/", 250 | "license": [ 251 | "MIT" 252 | ], 253 | "authors": [ 254 | { 255 | "name": "Roman Borschel", 256 | "email": "roman@code-factory.org" 257 | }, 258 | { 259 | "name": "Benjamin Eberlei", 260 | "email": "kontakt@beberlei.de" 261 | }, 262 | { 263 | "name": "Guilherme Blanco", 264 | "email": "guilhermeblanco@gmail.com" 265 | }, 266 | { 267 | "name": "Jonathan Wage", 268 | "email": "jonwage@gmail.com" 269 | }, 270 | { 271 | "name": "Johannes Schmitt", 272 | "email": "schmittjoh@gmail.com" 273 | } 274 | ], 275 | "description": "Common Library for Doctrine projects", 276 | "homepage": "http://www.doctrine-project.org", 277 | "keywords": [ 278 | "annotations", 279 | "collections", 280 | "eventmanager", 281 | "persistence", 282 | "spl" 283 | ], 284 | "time": "2015-08-31 13:00:22" 285 | }, 286 | { 287 | "name": "doctrine/dbal", 288 | "version": "v2.4.4", 289 | "source": { 290 | "type": "git", 291 | "url": "https://github.com/doctrine/dbal.git", 292 | "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b" 293 | }, 294 | "dist": { 295 | "type": "zip", 296 | "url": "https://api.github.com/repos/doctrine/dbal/zipball/a370e5b95e509a7809d11f3d280acfc9310d464b", 297 | "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b", 298 | "shasum": "" 299 | }, 300 | "require": { 301 | "doctrine/common": "~2.4", 302 | "php": ">=5.3.2" 303 | }, 304 | "require-dev": { 305 | "phpunit/phpunit": "3.7.*", 306 | "symfony/console": "~2.0" 307 | }, 308 | "suggest": { 309 | "symfony/console": "For helpful console commands such as SQL execution and import of files." 310 | }, 311 | "type": "library", 312 | "autoload": { 313 | "psr-0": { 314 | "Doctrine\\DBAL\\": "lib/" 315 | } 316 | }, 317 | "notification-url": "https://packagist.org/downloads/", 318 | "license": [ 319 | "MIT" 320 | ], 321 | "authors": [ 322 | { 323 | "name": "Roman Borschel", 324 | "email": "roman@code-factory.org" 325 | }, 326 | { 327 | "name": "Benjamin Eberlei", 328 | "email": "kontakt@beberlei.de" 329 | }, 330 | { 331 | "name": "Guilherme Blanco", 332 | "email": "guilhermeblanco@gmail.com" 333 | }, 334 | { 335 | "name": "Jonathan Wage", 336 | "email": "jonwage@gmail.com" 337 | } 338 | ], 339 | "description": "Database Abstraction Layer", 340 | "homepage": "http://www.doctrine-project.org", 341 | "keywords": [ 342 | "database", 343 | "dbal", 344 | "persistence", 345 | "queryobject" 346 | ], 347 | "time": "2015-01-12 21:57:01" 348 | }, 349 | { 350 | "name": "doctrine/doctrine-bundle", 351 | "version": "v1.5.1", 352 | "source": { 353 | "type": "git", 354 | "url": "https://github.com/doctrine/DoctrineBundle.git", 355 | "reference": "8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01" 356 | }, 357 | "dist": { 358 | "type": "zip", 359 | "url": "https://api.github.com/repos/doctrine/DoctrineBundle/zipball/8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01", 360 | "reference": "8c5cedb4f2f7ebb66a963ae46ad9daa1e31cee01", 361 | "shasum": "" 362 | }, 363 | "require": { 364 | "doctrine/dbal": "~2.3", 365 | "doctrine/doctrine-cache-bundle": "~1.0", 366 | "jdorn/sql-formatter": "~1.1", 367 | "php": ">=5.3.2", 368 | "symfony/console": "~2.3|~3.0", 369 | "symfony/doctrine-bridge": "~2.2|~3.0", 370 | "symfony/framework-bundle": "~2.3|~3.0" 371 | }, 372 | "require-dev": { 373 | "doctrine/orm": "~2.3", 374 | "phpunit/phpunit": "~4", 375 | "satooshi/php-coveralls": "~0.6.1", 376 | "symfony/validator": "~2.2|~3.0", 377 | "symfony/yaml": "~2.2|~3.0", 378 | "twig/twig": "~1.10" 379 | }, 380 | "suggest": { 381 | "doctrine/orm": "The Doctrine ORM integration is optional in the bundle.", 382 | "symfony/web-profiler-bundle": "to use the data collector" 383 | }, 384 | "type": "symfony-bundle", 385 | "extra": { 386 | "branch-alias": { 387 | "dev-master": "1.5.x-dev" 388 | } 389 | }, 390 | "autoload": { 391 | "psr-4": { 392 | "Doctrine\\Bundle\\DoctrineBundle\\": "" 393 | } 394 | }, 395 | "notification-url": "https://packagist.org/downloads/", 396 | "license": [ 397 | "MIT" 398 | ], 399 | "authors": [ 400 | { 401 | "name": "Symfony Community", 402 | "homepage": "http://symfony.com/contributors" 403 | }, 404 | { 405 | "name": "Benjamin Eberlei", 406 | "email": "kontakt@beberlei.de" 407 | }, 408 | { 409 | "name": "Doctrine Project", 410 | "homepage": "http://www.doctrine-project.org/" 411 | }, 412 | { 413 | "name": "Fabien Potencier", 414 | "email": "fabien@symfony.com" 415 | } 416 | ], 417 | "description": "Symfony DoctrineBundle", 418 | "homepage": "http://www.doctrine-project.org", 419 | "keywords": [ 420 | "database", 421 | "dbal", 422 | "orm", 423 | "persistence" 424 | ], 425 | "time": "2015-08-12 15:52:00" 426 | }, 427 | { 428 | "name": "doctrine/doctrine-cache-bundle", 429 | "version": "v1.0.1", 430 | "target-dir": "Doctrine/Bundle/DoctrineCacheBundle", 431 | "source": { 432 | "type": "git", 433 | "url": "https://github.com/doctrine/DoctrineCacheBundle.git", 434 | "reference": "e4b6f810aa047f9cbfe41c3d6a3d7e83d7477a9d" 435 | }, 436 | "dist": { 437 | "type": "zip", 438 | "url": "https://api.github.com/repos/doctrine/DoctrineCacheBundle/zipball/e4b6f810aa047f9cbfe41c3d6a3d7e83d7477a9d", 439 | "reference": "e4b6f810aa047f9cbfe41c3d6a3d7e83d7477a9d", 440 | "shasum": "" 441 | }, 442 | "require": { 443 | "doctrine/cache": "~1.3", 444 | "doctrine/inflector": "~1.0", 445 | "php": ">=5.3.2", 446 | "symfony/doctrine-bridge": "~2.2", 447 | "symfony/framework-bundle": "~2.2", 448 | "symfony/security": "~2.2" 449 | }, 450 | "require-dev": { 451 | "instaclick/coding-standard": "~1.1", 452 | "instaclick/object-calisthenics-sniffs": "dev-master", 453 | "instaclick/symfony2-coding-standard": "dev-remaster", 454 | "phpunit/phpunit": "~3.7", 455 | "satooshi/php-coveralls": "~0.6.1", 456 | "squizlabs/php_codesniffer": "dev-master", 457 | "symfony/console": "~2.2", 458 | "symfony/finder": "~2.2", 459 | "symfony/validator": "~2.2", 460 | "symfony/yaml": "~2.2" 461 | }, 462 | "type": "symfony-bundle", 463 | "extra": { 464 | "branch-alias": { 465 | "dev-master": "1.0.x-dev" 466 | } 467 | }, 468 | "autoload": { 469 | "psr-0": { 470 | "Doctrine\\Bundle\\DoctrineCacheBundle": "" 471 | } 472 | }, 473 | "notification-url": "https://packagist.org/downloads/", 474 | "license": [ 475 | "MIT" 476 | ], 477 | "authors": [ 478 | { 479 | "name": "Symfony Community", 480 | "homepage": "http://symfony.com/contributors" 481 | }, 482 | { 483 | "name": "Benjamin Eberlei", 484 | "email": "kontakt@beberlei.de" 485 | }, 486 | { 487 | "name": "Fabio B. Silva", 488 | "email": "fabio.bat.silva@gmail.com" 489 | }, 490 | { 491 | "name": "Guilherme Blanco", 492 | "email": "guilhermeblanco@hotmail.com" 493 | }, 494 | { 495 | "name": "Doctrine Project", 496 | "homepage": "http://www.doctrine-project.org/" 497 | }, 498 | { 499 | "name": "Fabien Potencier", 500 | "email": "fabien@symfony.com" 501 | } 502 | ], 503 | "description": "Symfony2 Bundle for Doctrine Cache", 504 | "homepage": "http://www.doctrine-project.org", 505 | "keywords": [ 506 | "cache", 507 | "caching" 508 | ], 509 | "time": "2014-11-28 09:43:36" 510 | }, 511 | { 512 | "name": "doctrine/inflector", 513 | "version": "v1.0.1", 514 | "source": { 515 | "type": "git", 516 | "url": "https://github.com/doctrine/inflector.git", 517 | "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" 518 | }, 519 | "dist": { 520 | "type": "zip", 521 | "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", 522 | "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", 523 | "shasum": "" 524 | }, 525 | "require": { 526 | "php": ">=5.3.2" 527 | }, 528 | "require-dev": { 529 | "phpunit/phpunit": "4.*" 530 | }, 531 | "type": "library", 532 | "extra": { 533 | "branch-alias": { 534 | "dev-master": "1.0.x-dev" 535 | } 536 | }, 537 | "autoload": { 538 | "psr-0": { 539 | "Doctrine\\Common\\Inflector\\": "lib/" 540 | } 541 | }, 542 | "notification-url": "https://packagist.org/downloads/", 543 | "license": [ 544 | "MIT" 545 | ], 546 | "authors": [ 547 | { 548 | "name": "Roman Borschel", 549 | "email": "roman@code-factory.org" 550 | }, 551 | { 552 | "name": "Benjamin Eberlei", 553 | "email": "kontakt@beberlei.de" 554 | }, 555 | { 556 | "name": "Guilherme Blanco", 557 | "email": "guilhermeblanco@gmail.com" 558 | }, 559 | { 560 | "name": "Jonathan Wage", 561 | "email": "jonwage@gmail.com" 562 | }, 563 | { 564 | "name": "Johannes Schmitt", 565 | "email": "schmittjoh@gmail.com" 566 | } 567 | ], 568 | "description": "Common String Manipulations with regard to casing and singular/plural rules.", 569 | "homepage": "http://www.doctrine-project.org", 570 | "keywords": [ 571 | "inflection", 572 | "pluralize", 573 | "singularize", 574 | "string" 575 | ], 576 | "time": "2014-12-20 21:24:13" 577 | }, 578 | { 579 | "name": "doctrine/lexer", 580 | "version": "v1.0.1", 581 | "source": { 582 | "type": "git", 583 | "url": "https://github.com/doctrine/lexer.git", 584 | "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" 585 | }, 586 | "dist": { 587 | "type": "zip", 588 | "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", 589 | "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", 590 | "shasum": "" 591 | }, 592 | "require": { 593 | "php": ">=5.3.2" 594 | }, 595 | "type": "library", 596 | "extra": { 597 | "branch-alias": { 598 | "dev-master": "1.0.x-dev" 599 | } 600 | }, 601 | "autoload": { 602 | "psr-0": { 603 | "Doctrine\\Common\\Lexer\\": "lib/" 604 | } 605 | }, 606 | "notification-url": "https://packagist.org/downloads/", 607 | "license": [ 608 | "MIT" 609 | ], 610 | "authors": [ 611 | { 612 | "name": "Roman Borschel", 613 | "email": "roman@code-factory.org" 614 | }, 615 | { 616 | "name": "Guilherme Blanco", 617 | "email": "guilhermeblanco@gmail.com" 618 | }, 619 | { 620 | "name": "Johannes Schmitt", 621 | "email": "schmittjoh@gmail.com" 622 | } 623 | ], 624 | "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", 625 | "homepage": "http://www.doctrine-project.org", 626 | "keywords": [ 627 | "lexer", 628 | "parser" 629 | ], 630 | "time": "2014-09-09 13:34:57" 631 | }, 632 | { 633 | "name": "doctrine/orm", 634 | "version": "v2.4.8", 635 | "source": { 636 | "type": "git", 637 | "url": "https://github.com/doctrine/doctrine2.git", 638 | "reference": "5aedac1e5c5caaeac14798822c70325dc242d467" 639 | }, 640 | "dist": { 641 | "type": "zip", 642 | "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/5aedac1e5c5caaeac14798822c70325dc242d467", 643 | "reference": "5aedac1e5c5caaeac14798822c70325dc242d467", 644 | "shasum": "" 645 | }, 646 | "require": { 647 | "doctrine/collections": "~1.1", 648 | "doctrine/dbal": "~2.4", 649 | "ext-pdo": "*", 650 | "php": ">=5.3.2", 651 | "symfony/console": "~2.0" 652 | }, 653 | "require-dev": { 654 | "satooshi/php-coveralls": "dev-master", 655 | "symfony/yaml": "~2.1" 656 | }, 657 | "suggest": { 658 | "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" 659 | }, 660 | "bin": [ 661 | "bin/doctrine", 662 | "bin/doctrine.php" 663 | ], 664 | "type": "library", 665 | "extra": { 666 | "branch-alias": { 667 | "dev-master": "2.4.x-dev" 668 | } 669 | }, 670 | "autoload": { 671 | "psr-0": { 672 | "Doctrine\\ORM\\": "lib/" 673 | } 674 | }, 675 | "notification-url": "https://packagist.org/downloads/", 676 | "license": [ 677 | "MIT" 678 | ], 679 | "authors": [ 680 | { 681 | "name": "Roman Borschel", 682 | "email": "roman@code-factory.org" 683 | }, 684 | { 685 | "name": "Benjamin Eberlei", 686 | "email": "kontakt@beberlei.de" 687 | }, 688 | { 689 | "name": "Guilherme Blanco", 690 | "email": "guilhermeblanco@gmail.com" 691 | }, 692 | { 693 | "name": "Jonathan Wage", 694 | "email": "jonwage@gmail.com" 695 | } 696 | ], 697 | "description": "Object-Relational-Mapper for PHP", 698 | "homepage": "http://www.doctrine-project.org", 699 | "keywords": [ 700 | "database", 701 | "orm" 702 | ], 703 | "time": "2015-08-31 13:19:01" 704 | }, 705 | { 706 | "name": "incenteev/composer-parameter-handler", 707 | "version": "v2.1.1", 708 | "source": { 709 | "type": "git", 710 | "url": "https://github.com/Incenteev/ParameterHandler.git", 711 | "reference": "84a205fe80a46101607bafbc423019527893ddd0" 712 | }, 713 | "dist": { 714 | "type": "zip", 715 | "url": "https://api.github.com/repos/Incenteev/ParameterHandler/zipball/84a205fe80a46101607bafbc423019527893ddd0", 716 | "reference": "84a205fe80a46101607bafbc423019527893ddd0", 717 | "shasum": "" 718 | }, 719 | "require": { 720 | "php": ">=5.3.3", 721 | "symfony/yaml": "~2.0" 722 | }, 723 | "require-dev": { 724 | "composer/composer": "1.0.*@dev", 725 | "phpspec/prophecy-phpunit": "~1.0", 726 | "symfony/filesystem": "~2.2" 727 | }, 728 | "type": "library", 729 | "extra": { 730 | "branch-alias": { 731 | "dev-master": "2.1.x-dev" 732 | } 733 | }, 734 | "autoload": { 735 | "psr-4": { 736 | "Incenteev\\ParameterHandler\\": "" 737 | } 738 | }, 739 | "notification-url": "https://packagist.org/downloads/", 740 | "license": [ 741 | "MIT" 742 | ], 743 | "authors": [ 744 | { 745 | "name": "Christophe Coevoet", 746 | "email": "stof@notk.org" 747 | } 748 | ], 749 | "description": "Composer script handling your ignored parameter file", 750 | "homepage": "https://github.com/Incenteev/ParameterHandler", 751 | "keywords": [ 752 | "parameters management" 753 | ], 754 | "time": "2015-06-03 08:27:03" 755 | }, 756 | { 757 | "name": "javihgil/nexmo-bundle", 758 | "version": "v0.9.2", 759 | "target-dir": "Jhg/NexmoBundle", 760 | "source": { 761 | "type": "git", 762 | "url": "https://github.com/javihgil/nexmo-bundle.git", 763 | "reference": "4222594e29bbe40e62f1fbb8998523478da6c31f" 764 | }, 765 | "dist": { 766 | "type": "zip", 767 | "url": "https://api.github.com/repos/javihgil/nexmo-bundle/zipball/4222594e29bbe40e62f1fbb8998523478da6c31f", 768 | "reference": "4222594e29bbe40e62f1fbb8998523478da6c31f", 769 | "shasum": "" 770 | }, 771 | "require": { 772 | "php": ">=5.3.2", 773 | "symfony/framework-bundle": ">=2.2.0" 774 | }, 775 | "type": "symfony-bundle", 776 | "autoload": { 777 | "psr-0": { 778 | "Jhg\\NexmoBundle": "" 779 | } 780 | }, 781 | "notification-url": "https://packagist.org/downloads/", 782 | "license": [ 783 | "MIT" 784 | ], 785 | "authors": [ 786 | { 787 | "name": "Javi Hernández Gil", 788 | "homepage": "https://github.com/javihgil/nexmo-bundle" 789 | } 790 | ], 791 | "description": "This bundle integrates Nexmo libs", 792 | "keywords": [ 793 | "bundle", 794 | "nexmo", 795 | "sms", 796 | "symfony" 797 | ], 798 | "time": "2016-03-01 06:42:07" 799 | }, 800 | { 801 | "name": "jdorn/sql-formatter", 802 | "version": "v1.2.17", 803 | "source": { 804 | "type": "git", 805 | "url": "https://github.com/jdorn/sql-formatter.git", 806 | "reference": "64990d96e0959dff8e059dfcdc1af130728d92bc" 807 | }, 808 | "dist": { 809 | "type": "zip", 810 | "url": "https://api.github.com/repos/jdorn/sql-formatter/zipball/64990d96e0959dff8e059dfcdc1af130728d92bc", 811 | "reference": "64990d96e0959dff8e059dfcdc1af130728d92bc", 812 | "shasum": "" 813 | }, 814 | "require": { 815 | "php": ">=5.2.4" 816 | }, 817 | "require-dev": { 818 | "phpunit/phpunit": "3.7.*" 819 | }, 820 | "type": "library", 821 | "extra": { 822 | "branch-alias": { 823 | "dev-master": "1.3.x-dev" 824 | } 825 | }, 826 | "autoload": { 827 | "classmap": [ 828 | "lib" 829 | ] 830 | }, 831 | "notification-url": "https://packagist.org/downloads/", 832 | "license": [ 833 | "MIT" 834 | ], 835 | "authors": [ 836 | { 837 | "name": "Jeremy Dorn", 838 | "email": "jeremy@jeremydorn.com", 839 | "homepage": "http://jeremydorn.com/" 840 | } 841 | ], 842 | "description": "a PHP SQL highlighting library", 843 | "homepage": "https://github.com/jdorn/sql-formatter/", 844 | "keywords": [ 845 | "highlight", 846 | "sql" 847 | ], 848 | "time": "2014-01-12 16:20:24" 849 | }, 850 | { 851 | "name": "kriswallsmith/assetic", 852 | "version": "v1.3.0", 853 | "source": { 854 | "type": "git", 855 | "url": "https://github.com/kriswallsmith/assetic.git", 856 | "reference": "56cb5d6dec9e7a68a4da2fa89844f39d41092f31" 857 | }, 858 | "dist": { 859 | "type": "zip", 860 | "url": "https://api.github.com/repos/kriswallsmith/assetic/zipball/56cb5d6dec9e7a68a4da2fa89844f39d41092f31", 861 | "reference": "56cb5d6dec9e7a68a4da2fa89844f39d41092f31", 862 | "shasum": "" 863 | }, 864 | "require": { 865 | "php": ">=5.3.1", 866 | "symfony/process": "~2.1" 867 | }, 868 | "conflict": { 869 | "twig/twig": "<1.12" 870 | }, 871 | "require-dev": { 872 | "cssmin/cssmin": "*", 873 | "joliclic/javascript-packer": "*", 874 | "kamicane/packager": "*", 875 | "leafo/lessphp": "^0.3.7", 876 | "leafo/scssphp": "*@dev", 877 | "leafo/scssphp-compass": "*@dev", 878 | "mrclay/minify": "*", 879 | "patchwork/jsqueeze": "~1.0|~2.0", 880 | "phpunit/phpunit": "~4.8", 881 | "psr/log": "~1.0", 882 | "ptachoire/cssembed": "*", 883 | "symfony/phpunit-bridge": "~2.7", 884 | "twig/twig": "~1.8|~2.0" 885 | }, 886 | "suggest": { 887 | "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", 888 | "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", 889 | "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", 890 | "patchwork/jsqueeze": "Assetic provides the integration with the JSqueeze JavaScript compressor", 891 | "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", 892 | "twig/twig": "Assetic provides the integration with the Twig templating engine" 893 | }, 894 | "type": "library", 895 | "extra": { 896 | "branch-alias": { 897 | "dev-master": "1.3-dev" 898 | } 899 | }, 900 | "autoload": { 901 | "psr-0": { 902 | "Assetic": "src/" 903 | }, 904 | "files": [ 905 | "src/functions.php" 906 | ] 907 | }, 908 | "notification-url": "https://packagist.org/downloads/", 909 | "license": [ 910 | "MIT" 911 | ], 912 | "authors": [ 913 | { 914 | "name": "Kris Wallsmith", 915 | "email": "kris.wallsmith@gmail.com", 916 | "homepage": "http://kriswallsmith.net/" 917 | } 918 | ], 919 | "description": "Asset Management for PHP", 920 | "homepage": "https://github.com/kriswallsmith/assetic", 921 | "keywords": [ 922 | "assets", 923 | "compression", 924 | "minification" 925 | ], 926 | "time": "2015-08-31 19:07:16" 927 | }, 928 | { 929 | "name": "laupifrpar/pusher-bundle", 930 | "version": "v1.2.6", 931 | "target-dir": "Lopi/Bundle/PusherBundle", 932 | "source": { 933 | "type": "git", 934 | "url": "https://github.com/laupiFrpar/LopiPusherBundle.git", 935 | "reference": "61522a76b1031fcfb03ebe55b6c8d261474ffe3e" 936 | }, 937 | "dist": { 938 | "type": "zip", 939 | "url": "https://api.github.com/repos/laupiFrpar/LopiPusherBundle/zipball/61522a76b1031fcfb03ebe55b6c8d261474ffe3e", 940 | "reference": "61522a76b1031fcfb03ebe55b6c8d261474ffe3e", 941 | "shasum": "" 942 | }, 943 | "require": { 944 | "php": ">=5.3.3", 945 | "pusher/pusher-php-server": ">=2.2.1" 946 | }, 947 | "require-dev": { 948 | "symfony/config": "~2.3", 949 | "symfony/dependency-injection": "~2.3", 950 | "symfony/http-kernel": "~2.3" 951 | }, 952 | "type": "symfony-bundle", 953 | "autoload": { 954 | "psr-0": { 955 | "Lopi\\Bundle\\PusherBundle": "" 956 | } 957 | }, 958 | "notification-url": "https://packagist.org/downloads/", 959 | "license": [ 960 | "MIT" 961 | ], 962 | "authors": [ 963 | { 964 | "name": "Pierre-Louis Launay", 965 | "email": "laupi.frpar@gmail.com", 966 | "homepage": "https://github.com/laupiFrpar", 967 | "role": "developer" 968 | }, 969 | { 970 | "name": "Community contributors", 971 | "homepage": "https://github.com/laupifrpar/lopipusherbundle/contributors" 972 | } 973 | ], 974 | "description": "A Pusher bundle for Symfony2", 975 | "homepage": "https://github.com/laupifrpar/lopipusherbundle", 976 | "keywords": [ 977 | "nosql", 978 | "pusher", 979 | "symfony" 980 | ], 981 | "time": "2015-06-25 14:17:26" 982 | }, 983 | { 984 | "name": "monolog/monolog", 985 | "version": "1.17.1", 986 | "source": { 987 | "type": "git", 988 | "url": "https://github.com/Seldaek/monolog.git", 989 | "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422" 990 | }, 991 | "dist": { 992 | "type": "zip", 993 | "url": "https://api.github.com/repos/Seldaek/monolog/zipball/0524c87587ab85bc4c2d6f5b41253ccb930a5422", 994 | "reference": "0524c87587ab85bc4c2d6f5b41253ccb930a5422", 995 | "shasum": "" 996 | }, 997 | "require": { 998 | "php": ">=5.3.0", 999 | "psr/log": "~1.0" 1000 | }, 1001 | "provide": { 1002 | "psr/log-implementation": "1.0.0" 1003 | }, 1004 | "require-dev": { 1005 | "aws/aws-sdk-php": "^2.4.9", 1006 | "doctrine/couchdb": "~1.0@dev", 1007 | "graylog2/gelf-php": "~1.0", 1008 | "php-console/php-console": "^3.1.3", 1009 | "phpunit/phpunit": "~4.5", 1010 | "phpunit/phpunit-mock-objects": "2.3.0", 1011 | "raven/raven": "~0.11", 1012 | "ruflin/elastica": ">=0.90 <3.0", 1013 | "swiftmailer/swiftmailer": "~5.3", 1014 | "videlalvaro/php-amqplib": "~2.4" 1015 | }, 1016 | "suggest": { 1017 | "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", 1018 | "doctrine/couchdb": "Allow sending log messages to a CouchDB server", 1019 | "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", 1020 | "ext-mongo": "Allow sending log messages to a MongoDB server", 1021 | "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", 1022 | "php-console/php-console": "Allow sending log messages to Google Chrome", 1023 | "raven/raven": "Allow sending log messages to a Sentry server", 1024 | "rollbar/rollbar": "Allow sending log messages to Rollbar", 1025 | "ruflin/elastica": "Allow sending log messages to an Elastic Search server", 1026 | "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib" 1027 | }, 1028 | "type": "library", 1029 | "extra": { 1030 | "branch-alias": { 1031 | "dev-master": "1.16.x-dev" 1032 | } 1033 | }, 1034 | "autoload": { 1035 | "psr-4": { 1036 | "Monolog\\": "src/Monolog" 1037 | } 1038 | }, 1039 | "notification-url": "https://packagist.org/downloads/", 1040 | "license": [ 1041 | "MIT" 1042 | ], 1043 | "authors": [ 1044 | { 1045 | "name": "Jordi Boggiano", 1046 | "email": "j.boggiano@seld.be", 1047 | "homepage": "http://seld.be" 1048 | } 1049 | ], 1050 | "description": "Sends your logs to files, sockets, inboxes, databases and various web services", 1051 | "homepage": "http://github.com/Seldaek/monolog", 1052 | "keywords": [ 1053 | "log", 1054 | "logging", 1055 | "psr-3" 1056 | ], 1057 | "time": "2015-08-31 09:17:37" 1058 | }, 1059 | { 1060 | "name": "predis/predis", 1061 | "version": "v1.0.3", 1062 | "source": { 1063 | "type": "git", 1064 | "url": "https://github.com/nrk/predis.git", 1065 | "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04" 1066 | }, 1067 | "dist": { 1068 | "type": "zip", 1069 | "url": "https://api.github.com/repos/nrk/predis/zipball/84060b9034d756b4d79641667d7f9efe1aeb8e04", 1070 | "reference": "84060b9034d756b4d79641667d7f9efe1aeb8e04", 1071 | "shasum": "" 1072 | }, 1073 | "require": { 1074 | "php": ">=5.3.2" 1075 | }, 1076 | "require-dev": { 1077 | "phpunit/phpunit": "~4.0" 1078 | }, 1079 | "suggest": { 1080 | "ext-curl": "Allows access to Webdis when paired with phpiredis", 1081 | "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" 1082 | }, 1083 | "type": "library", 1084 | "autoload": { 1085 | "psr-4": { 1086 | "Predis\\": "src/" 1087 | } 1088 | }, 1089 | "notification-url": "https://packagist.org/downloads/", 1090 | "license": [ 1091 | "MIT" 1092 | ], 1093 | "authors": [ 1094 | { 1095 | "name": "Daniele Alessandri", 1096 | "email": "suppakilla@gmail.com", 1097 | "homepage": "http://clorophilla.net" 1098 | } 1099 | ], 1100 | "description": "Flexible and feature-complete PHP client library for Redis", 1101 | "homepage": "http://github.com/nrk/predis", 1102 | "keywords": [ 1103 | "nosql", 1104 | "predis", 1105 | "redis" 1106 | ], 1107 | "time": "2015-07-30 18:34:15" 1108 | }, 1109 | { 1110 | "name": "psr/log", 1111 | "version": "1.0.0", 1112 | "source": { 1113 | "type": "git", 1114 | "url": "https://github.com/php-fig/log.git", 1115 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" 1116 | }, 1117 | "dist": { 1118 | "type": "zip", 1119 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", 1120 | "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", 1121 | "shasum": "" 1122 | }, 1123 | "type": "library", 1124 | "autoload": { 1125 | "psr-0": { 1126 | "Psr\\Log\\": "" 1127 | } 1128 | }, 1129 | "notification-url": "https://packagist.org/downloads/", 1130 | "license": [ 1131 | "MIT" 1132 | ], 1133 | "authors": [ 1134 | { 1135 | "name": "PHP-FIG", 1136 | "homepage": "http://www.php-fig.org/" 1137 | } 1138 | ], 1139 | "description": "Common interface for logging libraries", 1140 | "keywords": [ 1141 | "log", 1142 | "psr", 1143 | "psr-3" 1144 | ], 1145 | "time": "2012-12-21 11:40:51" 1146 | }, 1147 | { 1148 | "name": "pusher/pusher-php-server", 1149 | "version": "v2.2.1", 1150 | "source": { 1151 | "type": "git", 1152 | "url": "https://github.com/pusher/pusher-http-php.git", 1153 | "reference": "79d755cc5d5b02b67779e2a40782fd6e3726657d" 1154 | }, 1155 | "dist": { 1156 | "type": "zip", 1157 | "url": "https://api.github.com/repos/pusher/pusher-http-php/zipball/79d755cc5d5b02b67779e2a40782fd6e3726657d", 1158 | "reference": "79d755cc5d5b02b67779e2a40782fd6e3726657d", 1159 | "shasum": "" 1160 | }, 1161 | "require": { 1162 | "ext-curl": "*", 1163 | "php": ">=5.2" 1164 | }, 1165 | "require-dev": { 1166 | "phpunit/phpunit": "~4" 1167 | }, 1168 | "type": "library", 1169 | "autoload": { 1170 | "classmap": [ 1171 | "lib/" 1172 | ] 1173 | }, 1174 | "notification-url": "https://packagist.org/downloads/", 1175 | "license": [ 1176 | "MIT" 1177 | ], 1178 | "description": "Library for interacting with the Pusher REST API", 1179 | "homepage": "https://github.com/pusher/pusher-php-server", 1180 | "keywords": [ 1181 | "events", 1182 | "php-pusher-server", 1183 | "publish", 1184 | "pusher", 1185 | "realtime", 1186 | "rest", 1187 | "trigger" 1188 | ], 1189 | "time": "2015-05-13 11:01:46" 1190 | }, 1191 | { 1192 | "name": "sensio/distribution-bundle", 1193 | "version": "v4.0.1", 1194 | "target-dir": "Sensio/Bundle/DistributionBundle", 1195 | "source": { 1196 | "type": "git", 1197 | "url": "https://github.com/sensiolabs/SensioDistributionBundle.git", 1198 | "reference": "62d99ba41144e704300e40f755346553702b27c9" 1199 | }, 1200 | "dist": { 1201 | "type": "zip", 1202 | "url": "https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/62d99ba41144e704300e40f755346553702b27c9", 1203 | "reference": "62d99ba41144e704300e40f755346553702b27c9", 1204 | "shasum": "" 1205 | }, 1206 | "require": { 1207 | "php": ">=5.3.9", 1208 | "sensiolabs/security-checker": "~3.0", 1209 | "symfony/class-loader": "~2.2", 1210 | "symfony/framework-bundle": "~2.3", 1211 | "symfony/process": "~2.2" 1212 | }, 1213 | "require-dev": { 1214 | "symfony/form": "~2.2", 1215 | "symfony/validator": "~2.2", 1216 | "symfony/yaml": "~2.2" 1217 | }, 1218 | "suggest": { 1219 | "symfony/form": "If you want to use the configurator", 1220 | "symfony/validator": "If you want to use the configurator", 1221 | "symfony/yaml": "If you want to use the configurator" 1222 | }, 1223 | "type": "symfony-bundle", 1224 | "extra": { 1225 | "branch-alias": { 1226 | "dev-master": "4.0.x-dev" 1227 | } 1228 | }, 1229 | "autoload": { 1230 | "psr-0": { 1231 | "Sensio\\Bundle\\DistributionBundle": "" 1232 | } 1233 | }, 1234 | "notification-url": "https://packagist.org/downloads/", 1235 | "license": [ 1236 | "MIT" 1237 | ], 1238 | "authors": [ 1239 | { 1240 | "name": "Fabien Potencier", 1241 | "email": "fabien@symfony.com" 1242 | } 1243 | ], 1244 | "description": "Base bundle for Symfony Distributions", 1245 | "keywords": [ 1246 | "configuration", 1247 | "distribution" 1248 | ], 1249 | "time": "2015-08-03 10:07:56" 1250 | }, 1251 | { 1252 | "name": "sensio/framework-extra-bundle", 1253 | "version": "v3.0.10", 1254 | "source": { 1255 | "type": "git", 1256 | "url": "https://github.com/sensiolabs/SensioFrameworkExtraBundle.git", 1257 | "reference": "18fc2063c4d6569cdca47a39fbac32342eb65f3c" 1258 | }, 1259 | "dist": { 1260 | "type": "zip", 1261 | "url": "https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/18fc2063c4d6569cdca47a39fbac32342eb65f3c", 1262 | "reference": "18fc2063c4d6569cdca47a39fbac32342eb65f3c", 1263 | "shasum": "" 1264 | }, 1265 | "require": { 1266 | "doctrine/common": "~2.2", 1267 | "symfony/framework-bundle": "~2.3" 1268 | }, 1269 | "require-dev": { 1270 | "symfony/expression-language": "~2.4", 1271 | "symfony/security-bundle": "~2.4" 1272 | }, 1273 | "suggest": { 1274 | "symfony/expression-language": "", 1275 | "symfony/psr-http-message-bridge": "To use the PSR-7 converters", 1276 | "symfony/security-bundle": "" 1277 | }, 1278 | "type": "symfony-bundle", 1279 | "extra": { 1280 | "branch-alias": { 1281 | "dev-master": "3.0.x-dev" 1282 | } 1283 | }, 1284 | "autoload": { 1285 | "psr-4": { 1286 | "Sensio\\Bundle\\FrameworkExtraBundle\\": "" 1287 | } 1288 | }, 1289 | "notification-url": "https://packagist.org/downloads/", 1290 | "license": [ 1291 | "MIT" 1292 | ], 1293 | "authors": [ 1294 | { 1295 | "name": "Fabien Potencier", 1296 | "email": "fabien@symfony.com" 1297 | } 1298 | ], 1299 | "description": "This bundle provides a way to configure your controllers with annotations", 1300 | "keywords": [ 1301 | "annotations", 1302 | "controllers" 1303 | ], 1304 | "time": "2015-08-03 11:59:27" 1305 | }, 1306 | { 1307 | "name": "sensiolabs/security-checker", 1308 | "version": "v3.0.1", 1309 | "source": { 1310 | "type": "git", 1311 | "url": "https://github.com/sensiolabs/security-checker.git", 1312 | "reference": "7735fd97ff7303d9df776b8dbc970f949399abc9" 1313 | }, 1314 | "dist": { 1315 | "type": "zip", 1316 | "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/7735fd97ff7303d9df776b8dbc970f949399abc9", 1317 | "reference": "7735fd97ff7303d9df776b8dbc970f949399abc9", 1318 | "shasum": "" 1319 | }, 1320 | "require": { 1321 | "symfony/console": "~2.0" 1322 | }, 1323 | "bin": [ 1324 | "security-checker" 1325 | ], 1326 | "type": "library", 1327 | "extra": { 1328 | "branch-alias": { 1329 | "dev-master": "3.0-dev" 1330 | } 1331 | }, 1332 | "autoload": { 1333 | "psr-0": { 1334 | "SensioLabs\\Security": "" 1335 | } 1336 | }, 1337 | "notification-url": "https://packagist.org/downloads/", 1338 | "license": [ 1339 | "MIT" 1340 | ], 1341 | "authors": [ 1342 | { 1343 | "name": "Fabien Potencier", 1344 | "email": "fabien.potencier@gmail.com" 1345 | } 1346 | ], 1347 | "description": "A security checker for your composer.lock", 1348 | "time": "2015-08-11 12:11:25" 1349 | }, 1350 | { 1351 | "name": "swiftmailer/swiftmailer", 1352 | "version": "v5.4.1", 1353 | "source": { 1354 | "type": "git", 1355 | "url": "https://github.com/swiftmailer/swiftmailer.git", 1356 | "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421" 1357 | }, 1358 | "dist": { 1359 | "type": "zip", 1360 | "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/0697e6aa65c83edf97bb0f23d8763f94e3f11421", 1361 | "reference": "0697e6aa65c83edf97bb0f23d8763f94e3f11421", 1362 | "shasum": "" 1363 | }, 1364 | "require": { 1365 | "php": ">=5.3.3" 1366 | }, 1367 | "require-dev": { 1368 | "mockery/mockery": "~0.9.1,<0.9.4" 1369 | }, 1370 | "type": "library", 1371 | "extra": { 1372 | "branch-alias": { 1373 | "dev-master": "5.4-dev" 1374 | } 1375 | }, 1376 | "autoload": { 1377 | "files": [ 1378 | "lib/swift_required.php" 1379 | ] 1380 | }, 1381 | "notification-url": "https://packagist.org/downloads/", 1382 | "license": [ 1383 | "MIT" 1384 | ], 1385 | "authors": [ 1386 | { 1387 | "name": "Chris Corbyn" 1388 | }, 1389 | { 1390 | "name": "Fabien Potencier", 1391 | "email": "fabien@symfony.com" 1392 | } 1393 | ], 1394 | "description": "Swiftmailer, free feature-rich PHP mailer", 1395 | "homepage": "http://swiftmailer.org", 1396 | "keywords": [ 1397 | "email", 1398 | "mail", 1399 | "mailer" 1400 | ], 1401 | "time": "2015-06-06 14:19:39" 1402 | }, 1403 | { 1404 | "name": "symfony/assetic-bundle", 1405 | "version": "v2.7.0", 1406 | "source": { 1407 | "type": "git", 1408 | "url": "https://github.com/symfony/assetic-bundle.git", 1409 | "reference": "3ae5c8ca3079b6e0033cc9fbfb6500e2bc964da5" 1410 | }, 1411 | "dist": { 1412 | "type": "zip", 1413 | "url": "https://api.github.com/repos/symfony/assetic-bundle/zipball/3ae5c8ca3079b6e0033cc9fbfb6500e2bc964da5", 1414 | "reference": "3ae5c8ca3079b6e0033cc9fbfb6500e2bc964da5", 1415 | "shasum": "" 1416 | }, 1417 | "require": { 1418 | "kriswallsmith/assetic": "~1.3", 1419 | "php": ">=5.3.0", 1420 | "symfony/console": "~2.3", 1421 | "symfony/dependency-injection": "~2.3", 1422 | "symfony/framework-bundle": "~2.3", 1423 | "symfony/yaml": "~2.3" 1424 | }, 1425 | "conflict": { 1426 | "kriswallsmith/spork": "<=0.2", 1427 | "twig/twig": "<1.20" 1428 | }, 1429 | "require-dev": { 1430 | "kriswallsmith/spork": "~0.3", 1431 | "patchwork/jsqueeze": "~1.0", 1432 | "symfony/class-loader": "~2.3", 1433 | "symfony/css-selector": "~2.3", 1434 | "symfony/dom-crawler": "~2.3", 1435 | "symfony/phpunit-bridge": "~2.7", 1436 | "symfony/twig-bundle": "~2.3" 1437 | }, 1438 | "suggest": { 1439 | "kriswallsmith/spork": "to be able to dump assets in parallel", 1440 | "symfony/twig-bundle": "to use the Twig integration" 1441 | }, 1442 | "type": "symfony-bundle", 1443 | "extra": { 1444 | "branch-alias": { 1445 | "dev-master": "2.7-dev" 1446 | } 1447 | }, 1448 | "autoload": { 1449 | "psr-4": { 1450 | "Symfony\\Bundle\\AsseticBundle\\": "" 1451 | } 1452 | }, 1453 | "notification-url": "https://packagist.org/downloads/", 1454 | "license": [ 1455 | "MIT" 1456 | ], 1457 | "authors": [ 1458 | { 1459 | "name": "Kris Wallsmith", 1460 | "email": "kris.wallsmith@gmail.com", 1461 | "homepage": "http://kriswallsmith.net/" 1462 | } 1463 | ], 1464 | "description": "Integrates Assetic into Symfony2", 1465 | "homepage": "https://github.com/symfony/AsseticBundle", 1466 | "keywords": [ 1467 | "assets", 1468 | "compression", 1469 | "minification" 1470 | ], 1471 | "time": "2015-09-01 00:05:29" 1472 | }, 1473 | { 1474 | "name": "symfony/monolog-bundle", 1475 | "version": "v2.7.1", 1476 | "source": { 1477 | "type": "git", 1478 | "url": "https://github.com/symfony/monolog-bundle.git", 1479 | "reference": "9320b6863404c70ebe111e9040dab96f251de7ac" 1480 | }, 1481 | "dist": { 1482 | "type": "zip", 1483 | "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/9320b6863404c70ebe111e9040dab96f251de7ac", 1484 | "reference": "9320b6863404c70ebe111e9040dab96f251de7ac", 1485 | "shasum": "" 1486 | }, 1487 | "require": { 1488 | "monolog/monolog": "~1.8", 1489 | "php": ">=5.3.2", 1490 | "symfony/config": "~2.3", 1491 | "symfony/dependency-injection": "~2.3", 1492 | "symfony/http-kernel": "~2.3", 1493 | "symfony/monolog-bridge": "~2.3" 1494 | }, 1495 | "require-dev": { 1496 | "symfony/console": "~2.3", 1497 | "symfony/yaml": "~2.3" 1498 | }, 1499 | "type": "symfony-bundle", 1500 | "extra": { 1501 | "branch-alias": { 1502 | "dev-master": "2.7.x-dev" 1503 | } 1504 | }, 1505 | "autoload": { 1506 | "psr-4": { 1507 | "Symfony\\Bundle\\MonologBundle\\": "" 1508 | } 1509 | }, 1510 | "notification-url": "https://packagist.org/downloads/", 1511 | "license": [ 1512 | "MIT" 1513 | ], 1514 | "authors": [ 1515 | { 1516 | "name": "Symfony Community", 1517 | "homepage": "http://symfony.com/contributors" 1518 | }, 1519 | { 1520 | "name": "Fabien Potencier", 1521 | "email": "fabien@symfony.com" 1522 | } 1523 | ], 1524 | "description": "Symfony MonologBundle", 1525 | "homepage": "http://symfony.com", 1526 | "keywords": [ 1527 | "log", 1528 | "logging" 1529 | ], 1530 | "time": "2015-01-04 20:21:17" 1531 | }, 1532 | { 1533 | "name": "symfony/swiftmailer-bundle", 1534 | "version": "v2.3.8", 1535 | "source": { 1536 | "type": "git", 1537 | "url": "https://github.com/symfony/swiftmailer-bundle.git", 1538 | "reference": "970b13d01871207e81d17b17ddda025e7e21e797" 1539 | }, 1540 | "dist": { 1541 | "type": "zip", 1542 | "url": "https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/970b13d01871207e81d17b17ddda025e7e21e797", 1543 | "reference": "970b13d01871207e81d17b17ddda025e7e21e797", 1544 | "shasum": "" 1545 | }, 1546 | "require": { 1547 | "php": ">=5.3.2", 1548 | "swiftmailer/swiftmailer": ">=4.2.0,~5.0", 1549 | "symfony/swiftmailer-bridge": "~2.1" 1550 | }, 1551 | "require-dev": { 1552 | "symfony/config": "~2.1", 1553 | "symfony/dependency-injection": "~2.1", 1554 | "symfony/http-kernel": "~2.1", 1555 | "symfony/yaml": "~2.1" 1556 | }, 1557 | "suggest": { 1558 | "psr/log": "Allows logging" 1559 | }, 1560 | "type": "symfony-bundle", 1561 | "extra": { 1562 | "branch-alias": { 1563 | "dev-master": "2.3-dev" 1564 | } 1565 | }, 1566 | "autoload": { 1567 | "psr-4": { 1568 | "Symfony\\Bundle\\SwiftmailerBundle\\": "" 1569 | } 1570 | }, 1571 | "notification-url": "https://packagist.org/downloads/", 1572 | "license": [ 1573 | "MIT" 1574 | ], 1575 | "authors": [ 1576 | { 1577 | "name": "Symfony Community", 1578 | "homepage": "http://symfony.com/contributors" 1579 | }, 1580 | { 1581 | "name": "Fabien Potencier", 1582 | "email": "fabien@symfony.com" 1583 | } 1584 | ], 1585 | "description": "Symfony SwiftmailerBundle", 1586 | "homepage": "http://symfony.com", 1587 | "time": "2014-12-01 17:44:50" 1588 | }, 1589 | { 1590 | "name": "symfony/symfony", 1591 | "version": "v2.7.4", 1592 | "source": { 1593 | "type": "git", 1594 | "url": "https://github.com/symfony/symfony.git", 1595 | "reference": "1fdf23fe28876844b887b0e1935c9adda43ee645" 1596 | }, 1597 | "dist": { 1598 | "type": "zip", 1599 | "url": "https://api.github.com/repos/symfony/symfony/zipball/1fdf23fe28876844b887b0e1935c9adda43ee645", 1600 | "reference": "1fdf23fe28876844b887b0e1935c9adda43ee645", 1601 | "shasum": "" 1602 | }, 1603 | "require": { 1604 | "doctrine/common": "~2.3", 1605 | "php": ">=5.3.9", 1606 | "psr/log": "~1.0", 1607 | "twig/twig": "~1.20|~2.0" 1608 | }, 1609 | "replace": { 1610 | "symfony/asset": "self.version", 1611 | "symfony/browser-kit": "self.version", 1612 | "symfony/class-loader": "self.version", 1613 | "symfony/config": "self.version", 1614 | "symfony/console": "self.version", 1615 | "symfony/css-selector": "self.version", 1616 | "symfony/debug": "self.version", 1617 | "symfony/debug-bundle": "self.version", 1618 | "symfony/dependency-injection": "self.version", 1619 | "symfony/doctrine-bridge": "self.version", 1620 | "symfony/dom-crawler": "self.version", 1621 | "symfony/event-dispatcher": "self.version", 1622 | "symfony/expression-language": "self.version", 1623 | "symfony/filesystem": "self.version", 1624 | "symfony/finder": "self.version", 1625 | "symfony/form": "self.version", 1626 | "symfony/framework-bundle": "self.version", 1627 | "symfony/http-foundation": "self.version", 1628 | "symfony/http-kernel": "self.version", 1629 | "symfony/intl": "self.version", 1630 | "symfony/locale": "self.version", 1631 | "symfony/monolog-bridge": "self.version", 1632 | "symfony/options-resolver": "self.version", 1633 | "symfony/process": "self.version", 1634 | "symfony/property-access": "self.version", 1635 | "symfony/proxy-manager-bridge": "self.version", 1636 | "symfony/routing": "self.version", 1637 | "symfony/security": "self.version", 1638 | "symfony/security-acl": "self.version", 1639 | "symfony/security-bundle": "self.version", 1640 | "symfony/security-core": "self.version", 1641 | "symfony/security-csrf": "self.version", 1642 | "symfony/security-http": "self.version", 1643 | "symfony/serializer": "self.version", 1644 | "symfony/stopwatch": "self.version", 1645 | "symfony/swiftmailer-bridge": "self.version", 1646 | "symfony/templating": "self.version", 1647 | "symfony/translation": "self.version", 1648 | "symfony/twig-bridge": "self.version", 1649 | "symfony/twig-bundle": "self.version", 1650 | "symfony/validator": "self.version", 1651 | "symfony/var-dumper": "self.version", 1652 | "symfony/web-profiler-bundle": "self.version", 1653 | "symfony/yaml": "self.version" 1654 | }, 1655 | "require-dev": { 1656 | "doctrine/data-fixtures": "1.0.*", 1657 | "doctrine/dbal": "~2.2", 1658 | "doctrine/doctrine-bundle": "~1.2", 1659 | "doctrine/orm": "~2.2,>=2.2.3", 1660 | "egulias/email-validator": "~1.2", 1661 | "ircmaxell/password-compat": "~1.0", 1662 | "monolog/monolog": "~1.11", 1663 | "ocramius/proxy-manager": "~0.4|~1.0", 1664 | "symfony/phpunit-bridge": "self.version" 1665 | }, 1666 | "type": "library", 1667 | "extra": { 1668 | "branch-alias": { 1669 | "dev-master": "2.7-dev" 1670 | } 1671 | }, 1672 | "autoload": { 1673 | "psr-4": { 1674 | "Symfony\\Bridge\\Doctrine\\": "src/Symfony/Bridge/Doctrine/", 1675 | "Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/", 1676 | "Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/", 1677 | "Symfony\\Bridge\\Swiftmailer\\": "src/Symfony/Bridge/Swiftmailer/", 1678 | "Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/", 1679 | "Symfony\\Bundle\\": "src/Symfony/Bundle/", 1680 | "Symfony\\Component\\": "src/Symfony/Component/" 1681 | }, 1682 | "classmap": [ 1683 | "src/Symfony/Component/HttpFoundation/Resources/stubs", 1684 | "src/Symfony/Component/Intl/Resources/stubs" 1685 | ], 1686 | "files": [ 1687 | "src/Symfony/Component/Intl/Resources/stubs/functions.php" 1688 | ] 1689 | }, 1690 | "notification-url": "https://packagist.org/downloads/", 1691 | "license": [ 1692 | "MIT" 1693 | ], 1694 | "authors": [ 1695 | { 1696 | "name": "Fabien Potencier", 1697 | "email": "fabien@symfony.com" 1698 | }, 1699 | { 1700 | "name": "Symfony Community", 1701 | "homepage": "https://symfony.com/contributors" 1702 | } 1703 | ], 1704 | "description": "The Symfony PHP framework", 1705 | "homepage": "https://symfony.com", 1706 | "keywords": [ 1707 | "framework" 1708 | ], 1709 | "time": "2015-09-08 14:26:39" 1710 | }, 1711 | { 1712 | "name": "twig/twig", 1713 | "version": "v1.22.0", 1714 | "source": { 1715 | "type": "git", 1716 | "url": "https://github.com/twigphp/Twig.git", 1717 | "reference": "204a6c94907c2c2225322c267e09adbb2b1c04fd" 1718 | }, 1719 | "dist": { 1720 | "type": "zip", 1721 | "url": "https://api.github.com/repos/twigphp/Twig/zipball/204a6c94907c2c2225322c267e09adbb2b1c04fd", 1722 | "reference": "204a6c94907c2c2225322c267e09adbb2b1c04fd", 1723 | "shasum": "" 1724 | }, 1725 | "require": { 1726 | "php": ">=5.2.7" 1727 | }, 1728 | "require-dev": { 1729 | "symfony/debug": "~2.7", 1730 | "symfony/phpunit-bridge": "~2.7" 1731 | }, 1732 | "type": "library", 1733 | "extra": { 1734 | "branch-alias": { 1735 | "dev-master": "1.22-dev" 1736 | } 1737 | }, 1738 | "autoload": { 1739 | "psr-0": { 1740 | "Twig_": "lib/" 1741 | } 1742 | }, 1743 | "notification-url": "https://packagist.org/downloads/", 1744 | "license": [ 1745 | "BSD-3-Clause" 1746 | ], 1747 | "authors": [ 1748 | { 1749 | "name": "Fabien Potencier", 1750 | "email": "fabien@symfony.com", 1751 | "homepage": "http://fabien.potencier.org", 1752 | "role": "Lead Developer" 1753 | }, 1754 | { 1755 | "name": "Armin Ronacher", 1756 | "email": "armin.ronacher@active-4.com", 1757 | "role": "Project Founder" 1758 | }, 1759 | { 1760 | "name": "Twig Team", 1761 | "homepage": "http://twig.sensiolabs.org/contributors", 1762 | "role": "Contributors" 1763 | } 1764 | ], 1765 | "description": "Twig, the flexible, fast, and secure template language for PHP", 1766 | "homepage": "http://twig.sensiolabs.org", 1767 | "keywords": [ 1768 | "templating" 1769 | ], 1770 | "time": "2015-09-13 17:12:38" 1771 | } 1772 | ], 1773 | "packages-dev": [ 1774 | { 1775 | "name": "sensio/generator-bundle", 1776 | "version": "v2.5.3", 1777 | "target-dir": "Sensio/Bundle/GeneratorBundle", 1778 | "source": { 1779 | "type": "git", 1780 | "url": "https://github.com/sensiolabs/SensioGeneratorBundle.git", 1781 | "reference": "e50108c2133ee5c9c484555faed50c17a61221d3" 1782 | }, 1783 | "dist": { 1784 | "type": "zip", 1785 | "url": "https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/e50108c2133ee5c9c484555faed50c17a61221d3", 1786 | "reference": "e50108c2133ee5c9c484555faed50c17a61221d3", 1787 | "shasum": "" 1788 | }, 1789 | "require": { 1790 | "symfony/console": "~2.5", 1791 | "symfony/framework-bundle": "~2.2" 1792 | }, 1793 | "require-dev": { 1794 | "doctrine/orm": "~2.2,>=2.2.3", 1795 | "symfony/doctrine-bridge": "~2.2", 1796 | "twig/twig": "~1.11" 1797 | }, 1798 | "type": "symfony-bundle", 1799 | "extra": { 1800 | "branch-alias": { 1801 | "dev-master": "2.5.x-dev" 1802 | } 1803 | }, 1804 | "autoload": { 1805 | "psr-0": { 1806 | "Sensio\\Bundle\\GeneratorBundle": "" 1807 | } 1808 | }, 1809 | "notification-url": "https://packagist.org/downloads/", 1810 | "license": [ 1811 | "MIT" 1812 | ], 1813 | "authors": [ 1814 | { 1815 | "name": "Fabien Potencier", 1816 | "email": "fabien@symfony.com" 1817 | } 1818 | ], 1819 | "description": "This bundle generates code for you", 1820 | "time": "2015-03-17 06:36:52" 1821 | } 1822 | ], 1823 | "aliases": [], 1824 | "minimum-stability": "stable", 1825 | "stability-flags": [], 1826 | "prefer-stable": false, 1827 | "prefer-lowest": false, 1828 | "platform": { 1829 | "php": ">=5.3.9" 1830 | }, 1831 | "platform-dev": [] 1832 | } 1833 | -------------------------------------------------------------------------------- /symfony/reset-db.sh: -------------------------------------------------------------------------------- 1 | rm app/data/sqlite.db 2 | php app/console doctrine:database:create 3 | php app/console doctrine:schema:update --force 4 | -------------------------------------------------------------------------------- /symfony/src/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Order deny,allow 6 | Deny from all 7 | 8 | -------------------------------------------------------------------------------- /symfony/src/AppBundle/AppBundle.php: -------------------------------------------------------------------------------- 1 | getDoctrine() 24 | ->getRepository('AppBundle:ChatMessage') 25 | ->findAll(); 26 | 27 | $response = new JsonResponse(); 28 | $response->setData($messages); 29 | return $response; 30 | } 31 | 32 | /** 33 | * @Route("/chat-api/message") 34 | */ 35 | public function postMessage(Request $request) 36 | { 37 | $message = new ChatMessage(); 38 | $message 39 | ->setUsername($request->get('username')) 40 | ->setText($request->get('chat_text')) 41 | ->setTimestamp(new \DateTime()); 42 | 43 | $em = $this->getDoctrine()->getManager(); 44 | $em->persist($message); 45 | $em->flush(); 46 | 47 | // Uncomment this to publish to redis and use Ratchet or Faye 48 | // $data = [ 49 | // 'event' => 'new-message', 50 | // 'data' => $message 51 | // ]; 52 | // $jsonContent = json_encode($data); 53 | // $redis = new Client('tcp://127.0.0.1:6379'); 54 | // $redis->publish('chat', $jsonContent); 55 | 56 | // Uncomment this to use Pusher 57 | // $pusher = $this->container->get('lopi_pusher.pusher'); 58 | // $pusher->trigger( 59 | // 'chat', 60 | // 'new-message', 61 | // $message 62 | // ); 63 | 64 | // Uncomment to sent an SMS to any registered numbers. 65 | // $this->sendSmsToAll($message); 66 | 67 | $response = new JsonResponse(); 68 | $response->setData($message); 69 | return $response; 70 | } 71 | 72 | // Utility 73 | 74 | private function sendSmsToAll($message) { 75 | 76 | $repository = $this->getDoctrine() 77 | ->getRepository('AppBundle:Caller'); 78 | 79 | $query = $repository->createQueryBuilder('c') 80 | ->select('c') 81 | ->groupBy('c.phoneNumber') 82 | ->getQuery(); 83 | 84 | $callers = $query->getResult(); 85 | 86 | $sender = $this->container->get('jhg_nexmo_sms'); 87 | foreach ($callers as $caller) { 88 | $sender->sendText($caller->getPhoneNumber(), $message->getText(), $message->getUsername()); 89 | } 90 | } 91 | 92 | // ---------------------------------- 93 | 94 | // View Routes 95 | 96 | /** 97 | * @Route("/", name="homepage") 98 | */ 99 | public function indexAction(Request $request) 100 | { 101 | return $this->render('chat/chat.html.twig'); 102 | } 103 | 104 | /** 105 | * @Route("/chat/{framework}") 106 | */ 107 | public function chat($framework) 108 | { 109 | return $this->render('chat/chat.html.twig', 110 | ['framework' => $framework]); 111 | } 112 | 113 | /** 114 | * @Route("/faye", name="faye") 115 | */ 116 | public function fayeChat(Request $request) 117 | { 118 | return $this->render('chat/faye.html.twig'); 119 | } 120 | 121 | // ---------------------------------- 122 | 123 | /** 124 | * @Route("/chat-api/incoming-call") 125 | */ 126 | public function incomingCall(Request $request) 127 | { 128 | $caller = new Caller(); 129 | $caller 130 | ->setPhoneNumber($request->get('nexmo_caller_id')) 131 | ->setCalledAt(new \DateTime()); 132 | 133 | $em = $this->getDoctrine()->getManager(); 134 | $em->persist($caller); 135 | $em->flush(); 136 | 137 | $pusher = $this->container->get('lopi_pusher.pusher'); 138 | $pusher->trigger( 139 | 'chat', 140 | 'incoming-call', 141 | array( 142 | 'number' => '...' . substr($caller->getPhoneNumber(), -4), 143 | 'called_at' => $caller->getCalledAt() 144 | ) 145 | ); 146 | 147 | $xml = '' . 148 | '' . 149 | '
' . 150 | '' . 151 | 'Hello Cloud Conf!' . 152 | '' . 153 | '
' . 154 | '
'; 155 | 156 | $response = new Response( 157 | $xml, 158 | Response::HTTP_OK, 159 | array('content-type' => 'xml') 160 | ); 161 | 162 | return $response; 163 | } 164 | 165 | /** 166 | * @Route("/chat-api/callers") 167 | */ 168 | public function listUniqueCallers() { 169 | $repository = $this->getDoctrine() 170 | ->getRepository('AppBundle:Caller'); 171 | 172 | $query = $repository->createQueryBuilder('c') 173 | ->select('c') 174 | ->groupBy('c.phoneNumber') 175 | ->getQuery(); 176 | 177 | $callers = $query->getResult(); 178 | 179 | $allNumbers = []; 180 | foreach ($callers as $caller) { 181 | $allNumbers[] = $caller->getPhoneNumber(); 182 | } 183 | 184 | $response = new JsonResponse(); 185 | $response->setData($allNumbers); 186 | return $response; 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /symfony/src/AppBundle/Entity/Caller.php: -------------------------------------------------------------------------------- 1 | id; 47 | } 48 | 49 | /** 50 | * Set calledAt 51 | * 52 | * @param \DateTime $calledAt 53 | * @return Caller 54 | */ 55 | public function setCalledAt($calledAt) 56 | { 57 | $this->calledAt = $calledAt; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Get calledAt 64 | * 65 | * @return \DateTime 66 | */ 67 | public function getCalledAt() 68 | { 69 | return $this->calledAt; 70 | } 71 | 72 | /** 73 | * Set phoneNumber 74 | * 75 | * @param string $phoneNumber 76 | * @return Caller 77 | */ 78 | public function setPhoneNumber($phoneNumber) 79 | { 80 | $this->phoneNumber = $phoneNumber; 81 | 82 | return $this; 83 | } 84 | 85 | /** 86 | * Get phoneNumber 87 | * 88 | * @return string 89 | */ 90 | public function getPhoneNumber() 91 | { 92 | return $this->phoneNumber; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /symfony/src/AppBundle/Entity/ChatMessage.php: -------------------------------------------------------------------------------- 1 | id; 54 | } 55 | 56 | /** 57 | * Set text 58 | * 59 | * @param string $text 60 | * @return ChatMessage 61 | */ 62 | public function setText($text) 63 | { 64 | $this->text = $text; 65 | 66 | return $this; 67 | } 68 | 69 | /** 70 | * Get text 71 | * 72 | * @return string 73 | */ 74 | public function getText() 75 | { 76 | return $this->text; 77 | } 78 | 79 | /** 80 | * Set username 81 | * 82 | * @param string $username 83 | * @return ChatMessage 84 | */ 85 | public function setUsername($username) 86 | { 87 | $this->username = $username; 88 | 89 | return $this; 90 | } 91 | 92 | /** 93 | * Get username 94 | * 95 | * @return string 96 | */ 97 | public function getUsername() 98 | { 99 | return $this->username; 100 | } 101 | 102 | /** 103 | * Set timestamp 104 | * 105 | * @param \DateTime $timestamp 106 | * @return ChatMessage 107 | */ 108 | public function setTimestamp($timestamp) 109 | { 110 | $this->timestamp = $timestamp; 111 | 112 | return $this; 113 | } 114 | 115 | /** 116 | * Get timestamp 117 | * 118 | * @return \DateTime 119 | */ 120 | public function getTimestamp() 121 | { 122 | return $this->timestamp; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /symfony/src/AppBundle/Entity/ChatMessageRepository.php: -------------------------------------------------------------------------------- 1 | request('GET', '/'); 14 | 15 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); 16 | $this->assertContains('Welcome to Symfony', $crawler->filter('#container h1')->text()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /symfony/web/.htaccess: -------------------------------------------------------------------------------- 1 | # Use the front controller as index file. It serves as a fallback solution when 2 | # every other rewrite/redirect fails (e.g. in an aliased environment without 3 | # mod_rewrite). Additionally, this reduces the matching process for the 4 | # start page (path "/") because otherwise Apache will apply the rewriting rules 5 | # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). 6 | DirectoryIndex app.php 7 | 8 | # By default, Apache does not evaluate symbolic links if you did not enable this 9 | # feature in your server configuration. Uncomment the following line if you 10 | # install assets as symlinks or if you experience problems related to symlinks 11 | # when compiling LESS/Sass/CoffeScript assets. 12 | # Options FollowSymlinks 13 | 14 | # Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve 15 | # to the front controller "/app.php" but be rewritten to "/app.php/app". 16 | 17 | Options -MultiViews 18 | 19 | 20 | 21 | RewriteEngine On 22 | 23 | # Determine the RewriteBase automatically and set it as environment variable. 24 | # If you are using Apache aliases to do mass virtual hosting or installed the 25 | # project in a subdirectory, the base path will be prepended to allow proper 26 | # resolution of the app.php file and to redirect to the correct URI. It will 27 | # work in environments without path prefix as well, providing a safe, one-size 28 | # fits all solution. But as you do not need it in this case, you can comment 29 | # the following 2 lines to eliminate the overhead. 30 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 31 | RewriteRule ^(.*) - [E=BASE:%1] 32 | 33 | # Sets the HTTP_AUTHORIZATION header removed by apache 34 | RewriteCond %{HTTP:Authorization} . 35 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 36 | 37 | # Redirect to URI without front controller to prevent duplicate content 38 | # (with and without `/app.php`). Only do this redirect on the initial 39 | # rewrite by Apache and not on subsequent cycles. Otherwise we would get an 40 | # endless redirect loop (request -> rewrite to front controller -> 41 | # redirect -> request -> ...). 42 | # So in case you get a "too many redirects" error or you always get redirected 43 | # to the start page because your Apache does not expose the REDIRECT_STATUS 44 | # environment variable, you have 2 choices: 45 | # - disable this feature by commenting the following 2 lines or 46 | # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 47 | # following RewriteCond (best solution) 48 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 49 | RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] 50 | 51 | # If the requested filename exists, simply serve it. 52 | # We only want to let Apache serve files and not directories. 53 | RewriteCond %{REQUEST_FILENAME} -f 54 | RewriteRule .? - [L] 55 | 56 | # Rewrite all other queries to the front controller. 57 | RewriteRule .? %{ENV:BASE}/app.php [L] 58 | 59 | 60 | 61 | 62 | # When mod_rewrite is not available, we instruct a temporary redirect of 63 | # the start page to the front controller explicitly so that the website 64 | # and the generated links can still be used. 65 | RedirectMatch 302 ^/$ /app.php/ 66 | # RedirectTemp cannot be used instead 67 | 68 | 69 | -------------------------------------------------------------------------------- /symfony/web/app.php: -------------------------------------------------------------------------------- 1 | unregister(); 15 | $apcLoader->register(true); 16 | */ 17 | 18 | require_once __DIR__.'/../app/AppKernel.php'; 19 | //require_once __DIR__.'/../app/AppCache.php'; 20 | 21 | $kernel = new AppKernel('prod', false); 22 | $kernel->loadClassCache(); 23 | //$kernel = new AppCache($kernel); 24 | 25 | // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter 26 | //Request::enableHttpMethodParameterOverride(); 27 | $request = Request::createFromGlobals(); 28 | $response = $kernel->handle($request); 29 | $response->send(); 30 | $kernel->terminate($request, $response); 31 | -------------------------------------------------------------------------------- /symfony/web/app_dev.php: -------------------------------------------------------------------------------- 1 | loadClassCache(); 28 | $request = Request::createFromGlobals(); 29 | $response = $kernel->handle($request); 30 | $response->send(); 31 | $kernel->terminate($request, $response); 32 | -------------------------------------------------------------------------------- /symfony/web/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/symfony/web/apple-touch-icon.png -------------------------------------------------------------------------------- /symfony/web/config.php: -------------------------------------------------------------------------------- 1 | getFailedRequirements(); 20 | $minorProblems = $symfonyRequirements->getFailedRecommendations(); 21 | 22 | ?> 23 | 24 | 25 | 26 | 27 | 28 | Symfony Configuration 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 | 39 | 40 | 60 |
61 | 62 |
63 |
64 |
65 |

Welcome!

66 |

Welcome to your new Symfony project.

67 |

68 | This script will guide you through the basic configuration of your project. 69 | You can also do the same by editing the ‘app/config/parameters.yml’ file directly. 70 |

71 | 72 | 73 |

Major problems

74 |

Major problems have been detected and must be fixed before continuing:

75 |
    76 | 77 |
  1. getHelpHtml() ?>
  2. 78 | 79 |
80 | 81 | 82 | 83 |

Recommendations

84 |

85 | Additionally, toTo enhance your Symfony experience, 86 | it’s recommended that you fix the following: 87 |

88 |
    89 | 90 |
  1. getHelpHtml() ?>
  2. 91 | 92 |
93 | 94 | 95 | hasPhpIniConfigIssue()): ?> 96 |

* 97 | getPhpIniConfigPath()): ?> 98 | Changes to the php.ini file must be done in "getPhpIniConfigPath() ?>". 99 | 100 | To change settings, create a "php.ini". 101 | 102 |

103 | 104 | 105 | 106 |

Your configuration looks good to run Symfony.

107 | 108 | 109 | 118 |
119 |
120 |
121 |
Symfony Standard Edition
122 |
123 | 124 | 125 | -------------------------------------------------------------------------------- /symfony/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leggetter/realtime-symfony-examples/6523c3f3f1bd3c1f6a33644cdd37292ee6af50cc/symfony/web/favicon.ico -------------------------------------------------------------------------------- /symfony/web/js/core-chat.js: -------------------------------------------------------------------------------- 1 | // Log all Pusher JS info to console 2 | // Pusher.log = function(msg) { 3 | // console.log(msg); 4 | // }; 5 | 6 | var storage = window.localStorage || { setItem: function(){}, getItem: function() {}}; 7 | 8 | // Store Twitter ID entered by User. 9 | var twitterUsername = storage.getItem('username'); 10 | 11 | function init() { 12 | if(twitterUsername) { 13 | setUpUser(twitterUsername); 14 | } 15 | 16 | // Twitter username button click and Enter press handler setup 17 | $('#try-it-out').click(setUpUser); 18 | $('#input-name').keyup(function(e) { 19 | if(e.keyCode === 13) { 20 | var username = $('#input-name').val(); 21 | setUpUser(username); 22 | } 23 | }); 24 | 25 | // send button click and Enter keypress handling 26 | $('.send-message').click(sendMessage); 27 | $('.input-message').keypress(checkSend); 28 | 29 | fetchInitialMessages(); 30 | } 31 | 32 | /** 33 | * Get all existing messages. 34 | */ 35 | function fetchInitialMessages() { 36 | $.get('/chat-api/messages').success(function(messages) { 37 | messages.forEach(addMessage); 38 | }); 39 | } 40 | 41 | /** 42 | * Handle user entered events. Ensure there's a value 43 | * and store for use later. 44 | * 45 | * Also hide Twitter username input and show messages. 46 | */ 47 | function setUpUser(username) { 48 | if (!username) { 49 | return; 50 | } 51 | 52 | twitterUsername = username; 53 | storage.setItem('username', twitterUsername); 54 | 55 | $('.twitter-username-capture').slideUp(function() { 56 | $('.chat-app').fadeIn(); 57 | scrollMessagesToBottom(); 58 | }); 59 | } 60 | 61 | /** 62 | * Check to see if the Enter key has been pressed to 63 | * send a message. 64 | */ 65 | function checkSend(e) { 66 | if (e.keyCode === 13) { 67 | return sendMessage(); 68 | } 69 | } 70 | 71 | /** 72 | * Check to ensure a 3 char message has been input. 73 | * If so, send the message to the server. 74 | */ 75 | function sendMessage() { 76 | var messageText = $('.input-message').val(); 77 | if (messageText.length < 3) { 78 | return false; 79 | } 80 | 81 | // Build POST data and make AJAX request 82 | var data = { 83 | username: twitterUsername, 84 | chat_text: messageText 85 | }; 86 | $.post('/chat-api/message', data).success(sendMessageSuccess); 87 | 88 | // Ensure the normal browser event doesn't take place 89 | return false; 90 | } 91 | 92 | /** 93 | * Handle the message post success callback 94 | */ 95 | function sendMessageSuccess() { 96 | $('.input-message').val('') 97 | console.log('message sent successfully'); 98 | } 99 | 100 | /** 101 | * Build the UI for a new message and add to the DOM 102 | */ 103 | function addMessage(data) { 104 | // Create element from template and set values 105 | var el = createMessageEl(); 106 | el.find('.message-body').html(data.text); 107 | el.find('.author').text(data.username); 108 | el.find('.avatar img').attr('src', 'https://twitter.com/' + data.username + '/profile_image?size=original') 109 | 110 | // Utility to build nicely formatted time 111 | el.find('.timestamp').text(strftime('%H:%M:%S %P', new Date(data.timestamp.date))); 112 | 113 | var messages = $('#messages'); 114 | messages.append(el) 115 | 116 | scrollMessagesToBottom(); 117 | } 118 | 119 | function addIncomingCall(data) { 120 | // Create element from template and set values 121 | var el = createMessageEl(); 122 | el.find('.message-body').html(data.number); 123 | el.find('.author').hide(); 124 | el.find('.avatar img').hide(); 125 | 126 | // Utility to build nicely formatted time 127 | el.find('.timestamp').text(strftime('%H:%M:%S %P', new Date(data.called_at.date))); 128 | el.css('background-color', '#f1f5f7'); 129 | 130 | var messages = $('#messages'); 131 | messages.append(el) 132 | 133 | scrollMessagesToBottom(); 134 | } 135 | 136 | /** 137 | * Make sure the incoming message is shown. 138 | */ 139 | function scrollMessagesToBottom() { 140 | var messages = $('#messages'); 141 | messages.scrollTop(messages[0].scrollHeight); 142 | } 143 | 144 | /** 145 | * Creates a chat message element from the template 146 | */ 147 | function createMessageEl() { 148 | var text = $('#chat_message_template').text(); 149 | var el = $(text); 150 | return el; 151 | } 152 | 153 | $(init); 154 | -------------------------------------------------------------------------------- /symfony/web/js/faye-chat.js: -------------------------------------------------------------------------------- 1 | $LAB.script("http://localhost:8080/faye/client.js").wait(fayeInit); 2 | 3 | function fayeInit() { 4 | // Faye 5 | var client = new Faye.Client('http://localhost:8080/'); 6 | client.subscribe('/chat', function(payload) { 7 | if(payload.event === 'new-message') { 8 | addMessage(payload.data); 9 | } 10 | }); 11 | 12 | var Logger = { 13 | incoming: function(message, callback) { 14 | console.log('incoming', message); 15 | callback(message); 16 | }, 17 | outgoing: function(message, callback) { 18 | console.log('outgoing', message); 19 | callback(message); 20 | } 21 | }; 22 | 23 | client.addExtension(Logger); 24 | } 25 | -------------------------------------------------------------------------------- /symfony/web/js/pusher-chat.js: -------------------------------------------------------------------------------- 1 | $LAB.script("//js.pusher.com/3.0/pusher.min.js").wait(pusherInit); 2 | 3 | function pusherInit() { 4 | Pusher.log = function(msg) { 5 | console.log(msg); 6 | }; 7 | 8 | // Pusher 9 | var pusher = new Pusher('0cb24b6b414cc36a6ae6'); 10 | 11 | var channel = pusher.subscribe('chat'); 12 | channel.bind('new-message', addMessage); 13 | 14 | // What's this? ... later! 15 | channel.bind('incoming-call', addIncomingCall); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /symfony/web/js/ratchet-chat.js: -------------------------------------------------------------------------------- 1 | // Ratchet 2 | var conn = new WebSocket('ws://localhost:8080'); 3 | conn.onopen = function(e) { 4 | console.log("Connection established!"); 5 | }; 6 | 7 | conn.onmessage = function(e) { 8 | var payload = JSON.parse(e.data); 9 | console.log(payload); 10 | 11 | if(payload.event === 'new-message') { 12 | addMessage(payload.data) 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /symfony/web/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | --------------------------------------------------------------------------------