Skip to content

Commit 7929d00

Browse files
committed
Update docs
1 parent d63eb6f commit 7929d00

File tree

7 files changed

+69
-69
lines changed

7 files changed

+69
-69
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Simple ticketing bundle for any project.
99

1010
## Requirements
1111

12-
[Packagist](https://packagist.org/packages/hackzilla/ticket-bundle)
12+
You can see the full requirement definitions for each available version in [Packagist](https://packagist.org/packages/hackzilla/ticket-bundle).
1313

1414
## Setup
1515

Resources/doc/migrate/v1-to-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Add your user class into your config.
44

55
```yaml
66
hackzilla_ticket:
7-
user_class: AppBundle\Entity\User
7+
user_class: App\Entity\User
88
```
99
1010
```Hackzilla\Bundle\TicketBundle\User\UserInterface``` has been replaced with ```Hackzilla\Bundle\TicketBundle\Manager\UserManagerInterface```

Resources/doc/setup/feature/attachments.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,50 @@
22

33
## Attachments
44

5-
Add UploaderBundle in your composer.json:
5+
Add UploaderBundle to your requirements:
66

7-
```json
8-
{
9-
"require": {
10-
"hackzilla/ticket-bundle": "~3.0",
11-
"vich/uploader-bundle": "~1.0"
12-
}
13-
}
7+
```bash
8+
composer require vich/uploader-bundle
149
```
1510

1611
Specify the uploader config, so the bundle knows where to store the files.
1712

1813
```yaml
1914
hackzilla_ticket:
20-
user_class: AppBundle\Entity\User
21-
ticket_class: Hackzilla\Bundle\TicketBundle\Entity\TicketWithAttachment
22-
message_class: Hackzilla\Bundle\TicketBundle\Entity\TicketMessageWithAttachment
15+
user_class: App\Entity\User
16+
ticket_class: Hackzilla\Bundle\TicketBundle\Entity\TicketWithAttachment
17+
message_class: Hackzilla\Bundle\TicketBundle\Entity\TicketMessageWithAttachment
2318
features:
24-
attachment: true
19+
attachment: true
2520

2621
vich_uploader:
2722
db_driver: orm
2823

2924
mappings:
3025
ticket_message_attachment:
31-
uri_prefix: /attachment
32-
upload_destination: %kernel.root_dir%/../var/uploads/attachment/
26+
uri_prefix: /attachment
27+
upload_destination: '%kernel.root_dir%/../var/uploads/attachment/'
3328
```
3429
3530
See [VichUploaderBundle](https://github.com/dustin10/VichUploaderBundle/blob/master/Resources/doc/index.md) documentation for more details.
3631
37-
Don't forget to register VichUploaderBundle in AppKernel.
32+
If you are not using [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), you must enable the bundles manually in the kernel:
33+
34+
```php
35+
<?php
36+
// config/bundles.php
37+
38+
return [
39+
Vich\UploaderBundle\VichUploaderBundle => ['all' => true],
40+
Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle::class => ['all' => true],
41+
// ...
42+
// Your application bundles
43+
];
44+
```
45+
46+
If you are using an older kernel implementation, you must update the `registerBundles()` method:
3847

39-
``` php
48+
```php
4049
<?php
4150
// app/AppKernel.php
4251

@@ -54,6 +63,6 @@ public function registerBundles()
5463

5564
## Custom Entity
5665

57-
If you want to implement your own entities then you will want to extend
58-
66+
If you want to implement your own entities then you will want to extend
67+
5968
``` \Hackzilla\Bundle\TicketBundle\Model\TicketFeature\MessageAttachmentInterface ```

Resources/doc/setup/feature/custom-entities.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Once you've defined your entities then you will need to override the builtin one
1313

1414
```yaml
1515
hackzilla_ticket:
16-
ticket_class: AppBundle\Entity\Ticket
17-
message_class: AppBundle\Entity\TicketMessage
16+
ticket_class: App\Entity\Ticket
17+
message_class: App\Entity\TicketMessage
1818
```
1919
2020
@@ -28,14 +28,14 @@ hackzilla_ticket:
2828
### Traits
2929
3030
To make creating your own entities a little easier there are traits.
31-
The only thing missing form the traits are the primary id. This will allow you to use whatever you want as the primary id, whether its int or uuid.
31+
The only thing missing form the traits are the primary id. This will allow you to use whatever you want as the primary id, whether its int or uuid.
3232
3333
| Entity | Trait |
3434
| --------------- | --------------------------------------------------------------------------------- |
3535
| Ticket | Hackzilla\Bundle\TicketBundle\Entity\Traits\TicketTrait |
3636
| Ticket Message | Hackzilla\Bundle\TicketBundle\Entity\Traits\TicketMessageTrait |
3737
| Ticket Message | Hackzilla\Bundle\TicketBundle\Entity\Traits\TicketFeature\MessageAttachmentTrait |
3838
39-
At the moment they only support xml configuration. Use the [TicketBundle xml](Resources/config/doctrine/model) as a basis and copy it into your bundle.
39+
At the moment they only support xml configuration. Use the [TicketBundle xml](Resources/config/doctrine/model) as a basis and copy it into your bundle.
4040
4141
If you know of a better way, then either open an Issue or Pull Request.

Resources/doc/setup/feature/events.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
TicketBundle show fires events for creating, updating, and deleting of tickets.
44

5-
* hackzilla.ticket.create
6-
* hackzilla.ticket.update
7-
* hackzilla.ticket.delete
5+
* `hackzilla.ticket.create`
6+
* `hackzilla.ticket.update`
7+
* `hackzilla.ticket.delete`
88

99
See for example of how to create listener: http://symfony.com/doc/current/cookbook/service_container/event_listener.html
1010

11-
1211
Add your user, ticket and ticket message entities into your config.
1312

1413
```yaml
1514
hackzilla_ticket:
16-
user_class: AppBundle\Entity\User
17-
ticket_class: AppBundle\Entity\Ticket
18-
message_class: AppBundle\Entity\Message
15+
user_class: App\Entity\User
16+
ticket_class: App\Entity\Ticket
17+
message_class: App\Entity\Message
1918
```
2019
2120
Your entities needs to implement:

Resources/doc/setup/fosuserbundle.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22

33
## Step 1: Installation
44

5-
Add HackzillaTicketBundle to your requirements:
5+
Add HackzillaTicketBundle and FOSUserBundle to your requirements:
66

77
```bash
8-
composer require hackzilla/ticket-bundle:^2.0@dev
9-
composer require friendsofsymfony/user-bundle:^2.0
8+
composer require hackzilla/ticket-bundle friendsofsymfony/user-bundle
109
```
1110

1211
Specify your user class in your config, this will be exactly the same as `user_class` in FOSUserBundle.
1312

1413
```yaml
1514
hackzilla_ticket:
16-
user_class: AppBundle\Entity\User
15+
user_class: App\Entity\User
1716
```
1817
1918
Your user class needs to implement ```Hackzilla\Bundle\TicketBundle\Model\UserInterface```
@@ -23,7 +22,7 @@ You'll end up with a class like:
2322
```php
2423
<?php
2524
26-
namespace AppBundle\Entity;
25+
namespace App\Entity;
2726
2827
use FOS\UserBundle\Model\User as BaseUser;
2928
@@ -32,11 +31,11 @@ class User extends BaseUser implements \Hackzilla\Bundle\TicketBundle\Model\User
3231
}
3332
```
3433

35-
Follow [FOSUserBundle guide][1]
34+
Follow [FOSUserBundle guide](https://github.com/FriendsOfSymfony/FOSUserBundle)
3635

3736
## Step 2: Enable the bundle
3837

39-
Enable the bundle in the kernel:
38+
If you are not using [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), you must enable the bundles manually in the kernel:
4039

4140
```php
4241
<?php
@@ -52,7 +51,7 @@ return [
5251
];
5352
```
5453

55-
Or if you are not using Flex:
54+
If you are using an older kernel implementation, you must update the `registerBundles()` method:
5655

5756
```php
5857
<?php
@@ -96,5 +95,3 @@ You can assign "ROLE_TICKET_ADMIN" to any user you want to be able to administer
9695
## Step 5: Create tables
9796

9897
```bin/console doctrine:schema:update --force```
99-
100-
[1]: https://github.com/FriendsOfSymfony/FOSUserBundle

Resources/doc/setup/other.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@
22

33
## Step 1: Installation
44

5-
Add HackzillaTicketBundle in your composer.json:
5+
Add HackzillaTicketBundle to your requirements:
66

7-
```json
8-
{
9-
"require": {
10-
"hackzilla/ticket-bundle": "~2.0@dev",
11-
}
12-
}
7+
```bash
8+
composer require hackzilla/ticket-bundle
139
```
1410

1511
Specify your user class in your config, if you are using FOSUserBundle, then this will be exactly the same.
1612

1713
```yaml
1814
hackzilla_ticket:
19-
user_class: AppBundle\Entity\User
15+
user_class: App\Entity\User
2016
```
2117
2218
Your user class needs to implement ```Hackzilla\Bundle\TicketBundle\Model\UserInterface```
@@ -26,34 +22,33 @@ You should end up with a class similar to:
2622
```php
2723
<?php
2824
29-
namespace AppBundle\Entity;
25+
namespace App\Entity;
3026
3127
class User implements \Hackzilla\Bundle\TicketBundle\Model\UserInterface
3228
{
3329
}
3430
```
3531

32+
## Step 2: Enable the bundle
3633

37-
Install Composer
38-
39-
```
40-
curl -sS https://getcomposer.org/installer | php
41-
mv composer.phar /usr/local/bin/composer
42-
```
43-
44-
Now tell composer to download the library by running the command:
34+
If you are not using [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), you must enable the bundles manually in the kernel:
4535

46-
``` bash
47-
$ composer update hackzilla/ticket-bundle
36+
```php
37+
<?php
38+
// config/bundles.php
39+
40+
return [
41+
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
42+
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
43+
Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle::class => ['all' => true],
44+
// ...
45+
// Your application bundles
46+
];
4847
```
4948

50-
Composer will install the bundle into your project's `vendor/hackzilla` directory.
51-
52-
## Step 2: Enable the bundle
53-
54-
Enable the bundle in the kernel:
49+
If you are using an older kernel implementation, you must update the `registerBundles()` method:
5550

56-
``` php
51+
```php
5752
<?php
5853
// app/AppKernel.php
5954
@@ -75,21 +70,21 @@ public function registerBundles()
7570
``` yml
7671
hackzilla_ticket:
7772
resource: "@HackzillaTicketBundle/Resources/config/routing.yml"
78-
prefix: /
73+
prefix: /
7974
```
8075

8176
or
8277

8378
``` yml
8479
hackzilla_ticket:
8580
resource: "@HackzillaTicketBundle/Resources/config/routing/ticket.yml"
86-
prefix: /ticket
81+
prefix: /ticket
8782
```
8883

8984
## Step 4: Roles
9085

9186
All users can create tickets, even anonymous users.
92-
You can assign ROLE_TICKET_ADMIN to any user you want to be able to administer the ticketing system.
87+
You can assign "ROLE_TICKET_ADMIN" to any user you want to be able to administer the ticketing system.
9388

9489
## Step 5: Create tables
9590

0 commit comments

Comments
 (0)