# Zend\_Barcode nachladen

**URL:** <https://forum.shopware.com/t/zend-barcode-nachladen/34105>\
**Category:** Programmierung\
**Created:** [1. Februar 2016 um 11:10 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105 "2016-02-01T11:10:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [1. Februar 2016 um 11:10 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105/1 "2016-02-01T11:10:40Z")

</div>

tach zusammen,

in Library/Zend/ wurde&nbsp;&nbsp;Barcode entfernt.  
Die&nbsp;Zend\_Barcode Klasse brauch allerdings.

Wie kann ich das in meinem&nbsp;Plugin hinzufügen ohne die benötigten Files in Core zu kopieren?

Hab’s versucht mit:

- Ordernstruktur im Plugin&nbsp;Library/Zend/ angelegt und Dateien hineinkopirt  
-&nbsp;Zend\_Loader::loadClass(‚Zend\_Barcode‘, dirname(\_\_FILE\_\_).’/…/…/Library/’);

Hab ihr eine&nbsp;elegant Lösung für mich?

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [1. Februar 2016 um 12:23 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105/2 "2016-02-01T12:23:31Z")

</div>

Ich würde das via Composer mit dem ZendBarcode Package ([zf1/zend-barcode - Packagist](https://packagist.org/packages/zf1/zend-barcode)) machen.

---

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [1. Februar 2016 um 13:10 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105/3 "2016-02-01T13:10:40Z")

</div>

hi,

danke, aber wie soll ich das nun SW beibringen?

dachte es würde ala&nbsp;“Components” gehen?

&nbsp;

```
$this->Application()->Loader()->registerNamespace(
	'Shopware\Components',
	$this->Path() . 'Components/'
);
```

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [1. Februar 2016 um 21:55 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105/4 "2016-02-01T21:55:26Z")

</div>

Erstellung der composer.json&nbsp;  
composer install  
In der Bootstrap so etwas (ungetestet) einfügen:

```
public function afterInit() {
    require_once($this->Path().'/vendor/autoload.php');
}

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)\
**Post date:** [1. Februar 2016 um 22:50 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105/5 "2016-02-01T22:50:31Z")

</div>

Hi pino,

schau’ mal in den Shopware Community Blog. Dort gibt es einen sehr schönen&nbsp;Beitrag zu „Best Practices“ bei der Plugin Entwicklung von Daniel Nögel. Ein Abschnitt befasst sich mit Dependency Injection ( auch mit Composer wie von Thomas über mir&nbsp;erwähnt)

[https://developers.shopware.com/blog/2015/11/11/best-practices-of-shopware-plugin-development/#dependency-injection](https://developers.shopware.com/blog/2015/11/11/best-practices-of-shopware-plugin-development/#dependency-injection)

Viele Grüße

---

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [3. Februar 2016 um 09:23 UTC](https://forum.shopware.com/t/zend-barcode-nachladen/34105/6 "2016-02-03T09:23:02Z")

</div>

danke euch beiden (ledier gibts kein bedank mehr).

ich geh das mal durch.

> **[Best practices of Shopware plugin development](https://developers.shopware.com/blog/2015/11/11/best-practices-of-shopware-plugin-development/#using-composer)**
>
> Developing a Shopware plugin is quite easy: Create some directories and a Bootstrap.php file, register some events, add some
> templates - done.
> Of course it
