{"action":"created","issue":{"url":"https://api.github.com/repos/SergeyTsalkov/meekrodb/issues/38","repository_url":"https://api.github.com/repos/SergeyTsalkov/meekrodb","labels_url":"https://api.github.com/repos/SergeyTsalkov/meekrodb/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/SergeyTsalkov/meekrodb/issues/38/comments","events_url":"https://api.github.com/repos/SergeyTsalkov/meekrodb/issues/38/events","html_url":"https://github.com/SergeyTsalkov/meekrodb/issues/38","id":154921249,"number":38,"title":"Documentation seems to be incorrect when using composer","user":{"login":"steowens","id":978310,"avatar_url":"https://avatars.githubusercontent.com/u/978310?v=3","gravatar_id":"","url":"https://api.github.com/users/steowens","html_url":"https://github.com/steowens","followers_url":"https://api.github.com/users/steowens/followers","following_url":"https://api.github.com/users/steowens/following{/other_user}","gists_url":"https://api.github.com/users/steowens/gists{/gist_id}","starred_url":"https://api.github.com/users/steowens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steowens/subscriptions","organizations_url":"https://api.github.com/users/steowens/orgs","repos_url":"https://api.github.com/users/steowens/repos","events_url":"https://api.github.com/users/steowens/events{/privacy}","received_events_url":"https://api.github.com/users/steowens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-15T18:01:34Z","updated_at":"2016-05-15T18:06:10Z","closed_at":null,"body":"Added following to composer.json require object:\r\n`\r\n\"require\": {\r\n        ....\r\n        \"sergeytsalkov/meekrodb\": \"*\"\r\n    }\r\n`\r\nupdated composer and now vendor contains folder for sergeytsalkov\r\nverified existance of file **/vendor/sergeytsalkov/meekrodb/db.class.php**\r\n\r\nadded following file to projet **\"/inc/dbinit.php\"**\r\n`<?php\r\nrequire_once 'db.class.php';\r\nDB::$user = 'test';\r\nDB::$password = 'changeit';\r\nDB::$dbName = 'test';\r\nDB::$host = '127.0.0.1'; //defaults to localhost if omitted\r\nDB::$port = '3306'; // defaults to 3306 if omitted\r\nDB::$encoding = 'utf8'; // defaults to latin1 if omitted\r\n?>\r\n`\r\n\r\nadded following require statement to my **/index.php**\r\n\r\n`\r\n$root=pathinfo($_SERVER['SCRIPT_FILENAME']);\r\ndefine ('BASE_FOLDER', basename($root['dirname']));\r\ndefine ('SITE_ROOT',    realpath(dirname(__FILE__)));\r\ndefine ('SITE_URL',    'http://'.$_SERVER['HTTP_HOST'].'/'.BASE_FOLDER);\r\nrequire_once SITE_ROOT.'/inc/dbinit.php';\r\n`\r\nrefresh url pointing to index.php and get following in error logs\r\n`\r\n[Sun May 15 10:47:34.980963 2016] [:error] [pid 11309] [client 127.0.0.1:54362] PHP Fatal error:  require_once(): Failed opening required 'db.class.php' (include_path='.:/usr/share/php') in /_...excluding path ,.._ /inc/dbinit.php on line 2\r\n`\r\nI would have thought that the composer autoload process would have loaded this file and the require_once would not be needed. but certainly it is wrong since it doesn't point to the correct path to the file  **/vendor/sergeytsalkov/meekrodb/db.class.php**\r\n\r\nHere is the relevant composer.lock file contents:\r\n`\r\n        {\r\n            \"name\": \"sergeytsalkov/meekrodb\",\r\n            \"version\": \"v2.3\",\r\n            \"source\": {\r\n                \"type\": \"git\",\r\n                \"url\": \"https://github.com/SergeyTsalkov/meekrodb.git\",\r\n                \"reference\": \"eb36858f1aff94ae1665900e681a1cfb78563ee1\"\r\n            },\r\n            \"dist\": {\r\n                \"type\": \"zip\",\r\n                \"url\": \"https://api.github.com/repos/SergeyTsalkov/meekrodb/zipball/eb36858f1aff94ae1665900e681a1cfb78563ee1\",\r\n                \"reference\": \"eb36858f1aff94ae1665900e681a1cfb78563ee1\",\r\n                \"shasum\": \"\"\r\n            },\r\n            \"require\": {\r\n                \"php\": \">=5.2.0\"\r\n            },\r\n            \"type\": \"library\",\r\n            \"autoload\": {\r\n                \"classmap\": [\r\n                    \"db.class.php\"\r\n                ]\r\n            },\r\n            \"notification-url\": \"https://packagist.org/downloads/\",\r\n            \"license\": [\r\n                \"LGPL-3.0\"\r\n            ],\r\n            \"authors\": [\r\n                {\r\n                    \"name\": \"Sergey Tsalkov\",\r\n                    \"email\": \"stsalkov@gmail.com\"\r\n                }\r\n            ],\r\n            \"description\": \"The Simple PHP/MySQL Library\",\r\n            \"homepage\": \"http://www.meekro.com\",\r\n            \"keywords\": [\r\n                \"database\",\r\n                \"mysql\",\r\n                \"mysqli\",\r\n                \"pdo\"\r\n            ],\r\n            \"time\": \"2014-06-16 22:40:22\"\r\n        }\r\n`"},"comment":{"url":"https://api.github.com/repos/SergeyTsalkov/meekrodb/issues/comments/219300943","html_url":"https://github.com/SergeyTsalkov/meekrodb/issues/38#issuecomment-219300943","issue_url":"https://api.github.com/repos/SergeyTsalkov/meekrodb/issues/38","id":219300943,"user":{"login":"steowens","id":978310,"avatar_url":"https://avatars.githubusercontent.com/u/978310?v=3","gravatar_id":"","url":"https://api.github.com/users/steowens","html_url":"https://github.com/steowens","followers_url":"https://api.github.com/users/steowens/followers","following_url":"https://api.github.com/users/steowens/following{/other_user}","gists_url":"https://api.github.com/users/steowens/gists{/gist_id}","starred_url":"https://api.github.com/users/steowens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steowens/subscriptions","organizations_url":"https://api.github.com/users/steowens/orgs","repos_url":"https://api.github.com/users/steowens/repos","events_url":"https://api.github.com/users/steowens/events{/privacy}","received_events_url":"https://api.github.com/users/steowens/received_events","type":"User","site_admin":false},"created_at":"2016-05-15T18:06:10Z","updated_at":"2016-05-15T18:06:10Z","body":"I think what is happening is that because the DB class has all static methods, the composer framework fails to autoload the class.  Composer loads classes in lazy fashion. I think to fix this issue you need to add a non static method to DB and have the user call that method rather than doing the require_once that you currently do in the documentation."}}