{"id":140,"date":"2014-05-23T07:52:47","date_gmt":"2014-05-23T07:52:47","guid":{"rendered":"https:\/\/www.dafap.fr\/blog\/?p=140"},"modified":"2014-05-23T12:46:29","modified_gmt":"2014-05-23T12:46:29","slug":"zf2-et-installation-de-tcpdf","status":"publish","type":"post","link":"https:\/\/www.dafap.fr\/blog\/developpement-php\/zf2-et-installation-de-tcpdf","title":{"rendered":"ZF2 et installation de Tcpdf"},"content":{"rendered":"<p><em><strong>Pour installer Tcpdf il faut l'ajouter dans composer.json. Or cette biblioth\u00e8que n'est pas int\u00e9gr\u00e9e dans Packagist. Comment doit-on faire ?<\/strong><\/em><\/p>\n<p>D'apr\u00e8s les diff\u00e9rents posts trouv\u00e9s ici et l\u00e0, il faut ajouter :<\/p>\n<pre>\"require\" : {\r\n   ... ,\r\n   \"tecnick.com\/tcpdf\": \"*\"\r\n}\r\n\"repositories\" : [\r\n      ... ,\r\n   {\r\n      \"type\":\"package\",\r\n      \"package\": {\r\n          \"name\": \"tecnick.com\/tcpdf\",\r\n          \"version\":\"master\",\r\n          \"source\": {\r\n              \"url\": \"http:\/\/git.code.sf.net\/p\/tcpdf\/code\",\r\n              \"type\": \"git\",\r\n              \"reference\":\"master\"\r\n         }\r\n      }\r\n   }\r\n],\r\n\"autoload\": {\r\n   \"classmap\": [\r\n     \"vendor\/tecnick.com\/tcpdf\"\r\n   ]\r\n }\r\n\r\n<\/pre>\n<p>Or lors de l'ex\u00e9cution sous windows 7, l'installation \u00e9chouait en permanence :<\/p>\n<pre>D:\\monProjet&gt;php composer.phar update\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\n - Installing tecnick.com\/tcpdf (6.0.080)\r\n   Cloning fcd0098a2a8b0fb88e6ea291393dc8c1ecb2f38b\r\n\r\n [Symfony\\Component\\Process\\Exception\\ProcessTimedOutException]\r\n The process \"git clone --no-checkout \"git:\/\/git.code.sf.net\/p\/tcpdf\/code\" \r\n \"D:\\monProje t\\vendor\\tecnick.com\/tcpdf\" &amp;&amp; cd\u00a0\/D \r\n \"D:\\monProjet\\vendor\\tecnick.com\/tcpdf\"\u00a0&amp;&amp; git remote add composer \r\n \"git:\/\/git.code.sf.net\/p\/tcpdf\/code\" &amp;&amp; git fetch composer\" \r\n exceeded the timeout of 300 seconds.\r\n\r\nupdate [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]\r\n[--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] \r\n[--withdependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] \r\n...[packagesN]<\/pre>\n<p>Il faut donc augmenter le temps d'ex\u00e9cution\u00a0pour composer.phar. Pour cela, dans la console d'ex\u00e9cution de windows 7 :<\/p>\n<pre>D:\\monProjet&gt;set COMPOSER_PROCESS_TIMEOUT=5000\r\n\r\nD:\\monProjet&gt;php composer.phar update\r\nLoading composer repositories with package information\r\nUpdating dependencies (including require-dev)\r\n - Installing tecnick.com\/tcpdf (6.0.080)\r\n Cloning fcd0098a2a8b0fb88e6ea291393dc8c1ecb2f38b\r\n\r\n - Updating zf-commons\/zfc-user dev-master (70eb1db =&gt; b96419e)\r\n Checking out b96419e91bdc7ec09b49038c18634f7d0b503597\r\n\r\n - Updating zendframework\/zend-developer-tools dev-master (26af0e6 =&gt; 8907edf)\r\n Checking out 8907edf3a03ae0ac761b43e33b3629ac1b6c3cf3\r\n\r\nWriting lock file\r\nGenerating autoload files<\/pre>\n<p>Eur\u00eaka ! \u00c7a a march\u00e9 !<\/p>\n<p>Par la suite, en recherchant dans la <a href=\"https:\/\/getcomposer.org\/doc\/\" target=\"_blank\">documentation<\/a>, on peut indiquer ce d\u00e9lai dans la cl\u00e9 <em>config<\/em> de <em>composer.json<\/em> :<\/p>\n<pre> \"config\" : {\r\n    \"process-timeout\" : 5000,\r\n    \"use-include-path\": false,\r\n    \"github-protocols\": [\"git\", \"https\", \"http\"],\r\n    \"vendor-dir\": \"vendor\"\r\n },<\/pre>\n<p>Voir le d\u00e9tail sur <a href=\"https:\/\/getcomposer.org\/doc\/04-schema.md#config\" target=\"_blank\">cette page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pour installer Tcpdf il faut l&rsquo;ajouter dans composer.json. Or cette biblioth\u00e8que n&rsquo;est pas int\u00e9gr\u00e9e dans Packagist. Comment doit-on faire ? D&rsquo;apr\u00e8s les diff\u00e9rents posts trouv\u00e9s ici et l\u00e0, il faut ajouter : \u00ab\u00a0require\u00a0\u00bb : { &#8230; , \u00ab\u00a0tecnick.com\/tcpdf\u00a0\u00bb: \u00ab\u00a0*\u00a0\u00bb } \u00ab\u00a0repositories\u00a0\u00bb : [ &#8230; , { \u00ab\u00a0type\u00a0\u00bb:\u00a0\u00bbpackage\u00a0\u00bb, \u00ab\u00a0package\u00a0\u00bb: { \u00ab\u00a0name\u00a0\u00bb: \u00ab\u00a0tecnick.com\/tcpdf\u00a0\u00bb, \u00ab\u00a0version\u00a0\u00bb:\u00a0\u00bbmaster\u00a0\u00bb, \u00ab\u00a0source\u00a0\u00bb: { \u00ab\u00a0url\u00a0\u00bb: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,10],"tags":[30],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-developpement-php","category-environnement-de-travail","tag-composer-tcpdf"],"_links":{"self":[{"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":6,"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":147,"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/posts\/140\/revisions\/147"}],"wp:attachment":[{"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dafap.fr\/blog\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}