Welcome Guest, Not a member yet? Register   Sign In
Office hours - July 2017
#7

Second session transcript:

Code:
(08:58:53 AM) jlparry: ***************************************************************
(08:58:53 AM) jlparry: Welcome to the CodeIgniter Office Hour(s)
(08:58:53 AM) jlparry: This is Jim Parry, Project Lead
(08:58:53 AM) jlparry: We are here to answer any questions you have. Be nice!
(08:58:53 AM) jlparry: ***************************************************************
(09:20:13 AM) marcogmonteiro: hey jlparry
(09:20:39 AM) jlparry: hey marco
(09:21:31 AM) arkore: I have questions
(09:22:23 AM) arkore: 1) What is a real-world example of using a package in CodeIgniter that is installed from composer.
(09:22:23 AM) jlparry: arkore: shoot
(09:22:49 AM) arkore: How is it done
(09:23:05 AM) LouCypher: hey jlparry
(09:23:14 AM) arkore: paths.  package structure.
(09:24:43 AM) LouCypher: uhm .. how's that ci related ?
(09:25:06 AM) jlparry: arkore: any number of stand-alone packages on packagist.org would be good candidates: guzzle, logging, mock objects, timing, sodium_compat
(09:25:11 AM) jlparry: LouCypher: heya
(09:25:28 AM) arkore: ok, logging for example.  let's say i want to use that in my CI app
(09:25:43 AM) jlparry: arkore: in your project, composer install banana (for instance), and then just use the banana classes in their namespace, where needed
(09:25:45 AM) skope: look from packagist.org repos
(09:26:02 AM) arkore: "hen just use"
(09:26:02 AM) LouCypher: arkore here's composer.json for installing kenjis twig
(09:26:03 AM) LouCypher: http://lou.servebeer.com/cib/index.php/bin/e3148b92
(09:26:04 AM) arkore: "then just use"
(09:26:06 AM) skope: then just use
(09:26:15 AM) jlparry: arkore: composer install monolog/monolog (https://packagist.org/packages/monolog/monolog)
(09:26:16 AM) arkore: if it's in vendor.  how to you properly load it?
(09:26:19 AM) arkore: vendor/ path
(09:26:24 AM) skope: arkore: have you read the docs?
(09:26:26 AM) skope: codeigniter docs
(09:26:29 AM) skope: it's mentioned there
(09:26:32 AM) arkore: i have docs open
(09:26:36 AM) skope: good
(09:26:44 AM) jlparry: composer takes care of that -> installing a composer package updates composer.json in your project
(09:26:55 AM) arkore: jlparry, yes
(09:26:57 AM) arkore: true
(09:27:40 AM) arkore: https://www.codeigniter.com/user_guide/general/autoloader.html
(09:27:44 AM) jlparry: and that informs the CI4 autoloader, i.e. adding wherever-you-installed-that-even-if-not-in-vendor to the list of namespaced folders
(09:27:48 AM) arkore: see.  no examples provided.
(09:27:58 AM) skope: arkore: Additionally, if you want CodeIgniter to use a Composer auto-loader, just set $config['composer_autoload'] to TRUE or a custom path in application/config/config.php.
(09:28:02 AM) skope: in that page
(09:28:12 AM) arkore: yes, i have mine set to a path.
(09:28:28 AM) skope: arkore: and?
(09:28:41 AM) arkore: there is no example syntax on that autoloader page.
(09:28:48 AM) skope: example syntax of whaT?
(09:28:55 AM) arkore: example syntax of "using" the resource being autoloaded.  using it in your code.
(09:29:05 AM) marcogmonteiro: jlparry I have a question not a tecnical one, just to know what your position is on it...  https://github.com/bcit-ci/CodeIgniter4/issues/276 the use of external dependencies on ci4
(09:29:18 AM) skope: arkore: why would codeigniter guide you with using php?
(09:29:27 AM) jlparry: arkore:https://packagist.org/ ... ?
(09:29:29 AM) arkore: shouldn't codeigniter say "$this->load->library()" wont work?
(09:29:37 AM) skope: no
(09:29:42 AM) skope: because it's not related
(09:29:50 AM) skope: composer is not part of codeigniter
(09:29:53 AM) skope: you can add it
(09:30:01 AM) arkore: yet, it is in a way.
(09:30:08 AM) skope: which way
(09:30:20 AM) arkore: the fact that CI supports it and has a config item for it.
(09:30:27 AM) skope: ci supports mysql too
(09:30:33 AM) skope: you don't see manual of mysql in the docs
(09:30:41 AM) arkore: yes, and we use ->db for that
(09:30:53 AM) skope: you didn't get what i was meaning
(09:31:05 AM) skope: why would codeigniter docs teach you how to code php?
(09:31:10 AM) skope: or use composer
(09:31:16 AM) arkore: im not asking for codeigniter docs to teach me how to code.
(09:31:19 AM) skope: because composer docs itself are more extensive than ci
(09:31:20 AM) arkore: perhaps this is a bad time for questions.
(09:31:31 AM) skope: no, this is office hour
(09:31:37 AM) skope: this is the right time for questions
(09:31:42 AM) jlparry: questions for me :)
(09:31:56 AM) skope: haha lol
(09:32:00 AM) skope: that i didn't know
(09:32:55 AM) jlparry: marcogmonteiro: see earlier transcript. bundling external things through dependencies -> bad; making it easy for *you* to bundle/incorporate whatever external things tickle your fancy -> good
(09:33:54 AM) arkore: jlparry, does CI advocate usage of composer?
(09:33:58 AM) Vict0r: when is CI 4  coming out?
(09:34:33 AM) jlparry: arkore: composer dependencies in CI3 might warrant an example in the user guide, or there may already be examples on the forum. composer dependencies in CI4 not an issue, taken care of automatically
(09:34:51 AM) jlparry: arkore: CI supports composer, but doesn't insist on it
(09:36:11 AM) arkore: yes, example.  because you see, not all CI packages (in the form of composer packages, not sparks, or whatver) are not true CI packages obviously, because 1) their library name is not prefixed with CI_, and 2) vendor/...whatever/ is not the correct path for overriding libraries of CI obviously, because the correct path is application/core/ for example.
(09:36:15 AM) jlparry: Vict0r: seriously, "when it is ready". there are still work packages that we want to see in the alpha, that the community will/may eventually step up to implement. if not, we could always scale back the design/vision etc so as to afford an earlier release date :-/
(09:36:50 AM) Vict0r: oh yeah I know .. but havent heard anything .. just wondering if its months or years
(09:36:57 AM) jlparry: arkore: composer is *not* meant for CI components (CI_...)l it is intended to use with generally-reusable PHP things
(09:37:17 AM) marcogmonteiro: Vict0r check the repositiory
(09:37:29 AM) jlparry: arkore: composer can install stuff wherever you like, eg in vendors/... or in third_party/...
(09:37:32 AM) arkore: yes, jlparry, but what is the recommended way of loading these libraries into CI?
(09:38:06 AM) LouCypher: $this->load->library ?
(09:38:09 AM) jlparry: Vict0r: a multiple of months or a fraction of years
(09:38:25 AM) jlparry: LouCypher: no... arkore is asking about composer installed stuff
(09:38:27 AM) arkore: is that even a concept?
(09:39:33 AM) jlparry: arkore: if you composer install guzzlehttp/guzzle, then you simply "new \Guzzle\Whatever\Component()" where you need it (i am paraphrasing)
(09:39:39 AM) skope: arkore: not being rude, but you really should learn more php
(09:39:45 AM) arkore: jlparry, i want to make a package for codeigniter in 2017.  where can i find docs on this?  where can i find 2 real-world examples of true CI packages.
(09:39:47 AM) jlparry: arkore: is what a concept?
(09:40:26 AM) jlparry: arkore: https://github.com/bcit-ci/codeigniter-website uses guzzle, composer installed
(09:40:56 AM) arkore: jlparry, the userguide should include that sample syntax you just provided.  this isn't teaching the reader PHP, it's presenting the userguide material in a better way for certain people that read and absorb material in certain ways.
(09:40:57 AM) jlparry: arkore: https://github.com/jedi-academy/package-caboose is an example of a CI package that I use for teaching
(09:40:59 AM) skope: jlparry: i think he's trying to make libraries and helpers for codeigniter and wants to know how those are published
(09:41:24 AM) skope: so your second link is relevant
(09:41:26 AM) jlparry: arkore: the latter has no composer, only libraries, helpers and views
(09:41:40 AM) arkore: skope, that too
(09:42:21 AM) arkore: sorry, i didn't mean for this question to split into 2 questions.
(09:43:00 AM) marcogmonteiro: jedi academy <3
(09:43:03 AM) marcogmonteiro: sign me up
(09:47:08 AM) arkore: both those links are good and informative on the current standard.  i had trouble finding good examples from this list: https://github.com/codeigniter-id/awesome-codeigniter
(09:47:42 AM) arkore: you see that config "vendor-dir": "application/vendor"  part in composer.json ?
(09:47:45 AM) skope: well, not an official repo
(09:47:52 AM) arkore: you see.  that should be in userguide
(09:47:56 AM) jlparry: arkore: CI packages are written up in the user guide as part of the loader ... https://www.codeigniter.com/user_guide/libraries/loader.html
(09:48:04 AM) skope: arkore: no it should not, it's composer thing
(09:48:06 AM) skope: not codeigniter thing
(09:48:06 AM) arkore: none of the composer videos or tutorials example that, or provide real-world examples.
(09:48:41 AM) skope: if you need to use composer, you use composer docs to learn it
(09:48:51 AM) jlparry: arkore: that "awesome" repo is not affiliated with the project
(09:49:06 AM) jlparry: arkore: i see no composer.json in that repo
(09:49:40 AM) arkore: jlparry, it's a list
(09:50:41 AM) jlparry: arkore: agreed. which composer.json are you referring to with config vendor-dir"...?
(09:50:44 AM) arkore: what is the reason CI doesn't provide sample code?
(09:51:10 AM) arkore: is there some goal to keep docs as small as possible or something?
(09:51:13 AM) skope: sample code of what?
(09:51:15 AM) jlparry: arkore: there is tons of sample code in the user guide, perhaps not what you are looking for
(09:51:18 AM) arkore: of what i just said
(09:51:27 AM) skope: examples can't cover all use cases
(09:51:28 AM) arkore: jlparry, yeah, thats why i love CI docs
(09:51:35 AM) arkore: best docs i've ever seen
(09:51:37 AM) skope: not in a million years
(09:51:47 AM) arkore: a lot of projects could learn from CI's docs
(09:51:53 AM) arkore: i'm just saying though.
(09:51:58 AM) arkore: for this one area.
(09:52:09 AM) arkore: bah.
(09:52:15 AM) jlparry: arkore: neither of the above examples will make it into the user guide, because they reflect personal preferences, and are not the only way to use those
(09:52:41 AM) arkore: we really going to let "personal preferences" stop us from providing docs?
(09:52:47 AM) skope: yes
(09:52:48 AM) jlparry: arkore: yes
(09:52:53 AM) arkore: i strongly disagree.
(09:52:56 AM) skope: because docs are already there, just not in ci docs
(09:53:10 AM) arkore: nah.  you see.  this is the problem.
(09:53:21 AM) arkore: what's happening right now, is a problem we are failing to recognize.
(09:53:40 AM) jlparry: arkore: that "awesome" list has some horribly out-of-date or abandoned things on it (eg sparks).
(09:53:57 AM) arkore: jlparry, exactly.  thats why i'm happy to see the 2 links you provided.
(09:54:14 AM) arkore: there's no docs or links for me to find this information.
(09:54:17 AM) skope: please open up that problem
(09:54:21 AM) arkore: i had to come to you.
(09:54:25 AM) jlparry: arkore: there will be an official curated addins resource list, on the CI website, but not until I have time to work on it
...
(09:56:16 AM) skope: i have no patience
(09:56:27 AM) jlparry: arkore: part of my murky plan/vision was to setup the jedi-academy repo for examples, but i don't want to "force" my preferences (public folder, template parser, etc)
(09:57:19 AM) jlparry: arkore: Lonnie has written a CI3 e-book with better real-world examples, and is planning the same for CI4
(09:58:53 AM) arkore: cool.  I will have to revisit this later, I need to get back to work.  Thanks for your time, guys.
(10:01:56 AM) jlparry: arkore: can you email me your collected thoughts on what you see missing from the CI user guide? i have limited time, but will see what I can do
(10:02:35 AM) arkore: k
... Victor & skope apologized for offtopic messages & links ...
(10:03:55 AM) jlparry: interesting discussion & direction ... I will see how the edit turns out!
(10:05:06 AM) Vict0r: I though you were talking about star wars
(10:05:49 AM) jlparry: Vict0r: no, https://github.com/jedi-academy is a repo of mine with examples etc for my students
(10:06:07 AM) Vict0r: ahh xD alright
(10:06:26 AM) skope: my friend teaches programming in university too
(10:06:30 AM) skope: hmm not university, the other one
(10:06:42 AM) skope: anyway, it's nice to see that teaching materials are in github
(10:07:06 AM) jlparry: I also use the jedi-academy repo to open source my coursework
(10:08:43 AM) jlparry: ***************************************************************
(10:08:43 AM) jlparry: Thank you for having joined us for the CodeIgniter Office Hour
(10:08:43 AM) jlparry: ***************************************************************
James Parry
Project Lead
Reply


Messages In This Thread
Office hours - July 2017 - by jlp - 07-10-2017, 04:14 PM
RE: Office hours - July 2017 - by Paradinight - 07-10-2017, 08:13 PM
RE: Office hours - July 2017 - by ciadmin - 07-10-2017, 08:38 PM
RE: Office hours - July 2017 - by Wouter60 - 07-10-2017, 10:26 PM
RE: Office hours - July 2017 - by ciadmin - 07-11-2017, 12:56 AM
RE: Office hours - July 2017 - by jlp - 07-17-2017, 01:26 AM
RE: Office hours - July 2017 - by jlp - 07-17-2017, 10:30 AM
RE: Office hours - July 2017 - by PaulD - 07-17-2017, 10:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB