{"action":"created","issue":{"url":"https://api.github.com/repos/ramsey/uuid/issues/54","labels_url":"https://api.github.com/repos/ramsey/uuid/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/ramsey/uuid/issues/54/comments","events_url":"https://api.github.com/repos/ramsey/uuid/issues/54/events","html_url":"https://github.com/ramsey/uuid/issues/54","id":64805478,"number":54,"title":"How can I integrate this library with CodeIgniter?","user":{"login":"maxxon15","id":1046598,"avatar_url":"https://avatars.githubusercontent.com/u/1046598?v=3","gravatar_id":"","url":"https://api.github.com/users/maxxon15","html_url":"https://github.com/maxxon15","followers_url":"https://api.github.com/users/maxxon15/followers","following_url":"https://api.github.com/users/maxxon15/following{/other_user}","gists_url":"https://api.github.com/users/maxxon15/gists{/gist_id}","starred_url":"https://api.github.com/users/maxxon15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxxon15/subscriptions","organizations_url":"https://api.github.com/users/maxxon15/orgs","repos_url":"https://api.github.com/users/maxxon15/repos","events_url":"https://api.github.com/users/maxxon15/events{/privacy}","received_events_url":"https://api.github.com/users/maxxon15/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-27T17:01:16Z","updated_at":"2015-03-27T18:04:59Z","closed_at":null,"body":"Okay, this is not an \"issue\" as per se, but rather a question.\r\n\r\nHow can I integrate this with CodeIgniter?\r\n\r\n1. I included this inside the **application/third_party** folder in CodeIgniter.\r\n2. Ran composer there to include all the dependencies.\r\n3. I also made another file named **uid.php** in the **application/libraries** folder, where I wrote the following code:\r\n\r\n```php\r\n<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); \r\n\r\nrequire_once APPPATH.\"third_party/uuid/vendor/autoload.php\";\r\n\r\nuse Rhumsaa\\Uuid\\Uuid;\r\nuse Rhumsaa\\Uuid\\Exception\\UnsatisfiedDependencyException;\r\n\r\n?>\r\n```\r\n\r\n4. But, when I try out the sample code inside a Controller file's **index()** function just to try it out, it says\r\n\r\n```\r\n( ! ) Fatal error: Class 'Uuid' not found in /var/www/public/application/controllers/login.php on line 18\r\nCall Stack\r\n#\tTime\tMemory\tFunction\tLocation\r\n1\t0.0001\t242688\t{main}( )\t.../index.php:0\r\n2\t0.0009\t244688\trequire_once( '/var/www/public/system/core/CodeIgniter.php' )\t.../index.php:202\r\n3\t0.0314\t664784\tcall_user_func_array:{/var/www/public/system/core/CodeIgniter.php:360} ( )\t.../CodeIgniter.php:360\r\n4\t0.0314\t665048\tLogin->index( )\t.../CodeIgniter.php:360\r\n```\r\n\r\nI'm not even sure I'm doing something wrong.\r\nHow can I include this library? Please help! :)"},"comment":{"url":"https://api.github.com/repos/ramsey/uuid/issues/comments/87035938","html_url":"https://github.com/ramsey/uuid/issues/54#issuecomment-87035938","issue_url":"https://api.github.com/repos/ramsey/uuid/issues/54","id":87035938,"user":{"login":"harikt","id":120454,"avatar_url":"https://avatars.githubusercontent.com/u/120454?v=3","gravatar_id":"","url":"https://api.github.com/users/harikt","html_url":"https://github.com/harikt","followers_url":"https://api.github.com/users/harikt/followers","following_url":"https://api.github.com/users/harikt/following{/other_user}","gists_url":"https://api.github.com/users/harikt/gists{/gist_id}","starred_url":"https://api.github.com/users/harikt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harikt/subscriptions","organizations_url":"https://api.github.com/users/harikt/orgs","repos_url":"https://api.github.com/users/harikt/repos","events_url":"https://api.github.com/users/harikt/events{/privacy}","received_events_url":"https://api.github.com/users/harikt/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T18:04:59Z","updated_at":"2015-03-27T18:04:59Z","body":"I have not worked with codeignitter. But using composer is dead simple in any project via editing the file you know which will load always. \r\n\r\nEg : `web/index.php` , `public/index.php` and adding the line `require '/path/to/vendor/autoload.php'` .\r\n\r\nYey everything works fine ;) ."}}