« first day (1075 days earlier)      last day (3864 days later) » 

11:00 PM
And that should include some field that represents the API call needed to access that resource
 
m59
http_response_code(201); $this->output->location = "api/collection/newId"
That's ok, then?
 
@m59 imo yes
Although it depends on what else is in $this->output
imo I think you should return a full representation of the created resource
It is nice for the user and it will wind up saving a call to your API
As after they create the resource there's a really good likelihood they'll want to do something with it too
 
@PeeHaa I consider removing classes an API break. if you remove stuff, then that gives me the impression that I may need to keep up to date if I maintain a separate repo for a symfony adapter. considering the library is not v1.0.0 it could change at any time, at least based on semantic versioning.
and that's fine. but it's more work for anyone writing an adapter, and that's something you should consider.
that's all...
 
@LeviMorrison yeah you can ... and inside loops (don't !!)
 
@igorw Well yeah that is a valid point. And that's why we are considering to remove it now (before 1.x). I just wonder how much more work it means for people writing an adapter. Besides having to either include the storage in your own package or having to start using another storage provided by the lib.
I understand writing an adapter for a moving target sucks though. That's what we up til now have mostly prevented
 
11:10 PM
Out of curiosity what project are you talking about?
 
Yea, that's a difficult issue. I've actually thought about these things myself and how I would handle stuff like that with Symfony
I came up with no good thoughts though :(
 
@cspray It's great that people use your stuff, it's just stuff like this that makes it complicated
And I present to you: ZEND FW! :D
 
Is it possible to make this query return multiple records based on multiple ATCOCodes? SELECT Lat,Lon FROM 15n7Rpi190vjrPcmbiT_hRcZ9JbXE8a_I1euHyg WHERE ATCOCode=43000334701
I tried just adding a comma and another but it didn't work
 
@JoelKidd Are you looking for IN() by any chance?
 
11:14 PM
@PeeHaa Quite possibly!
@PeeHaa Not sure though, havent used it before
Could you give an example? :D
 
WHERE ATCOCode IN(#, #, #)
Also read the docs
 
@cspray Legend, thanks man
 
@PeeHaa are you considering a 1.0.0 soon?
 
MVC/Routing using composer advice please. I have a directory like so
--/ app
----/ controllers
------/ Admin (subdomain)
------/ Blog (default + subdomain)
------ baseController.php
----/ models (as above)
----/ views (as above)
----/ library
------/ classes
--------/ common
----------[MappedRouter.php](http://pastie.org/private/eb1k1ahbhho10nygszngbg)
----------[Router.php](http://pastie.org/private/anvla9huxqrjy7hpsdlsg)
---- [boot.php](http://pastie.org/private/g6lk478fyclrjnpwmnh5ug)
--/ public
 
not really PSR-0 compliant <_<
 
11:21 PM
because of baseController?
 
@Fabien It depends on what you mean by "...grabbing the correct controller?"
 
@igorw Yes. We want to add moar tests and I want to fix some complexity issues. And maybe handle the current issues. But after that I want to release a 1.0 version cc@Lusitanian
 
If you mean autoloading then your best bet with current dir structure is a classmap based solution
 
@cspray Well ATM it works but it just feels like a bit of a cluster. Should I autoload all the stuff inside cotnrollers/models etc or just baseController and then use that to require the correct class if possible.
 
@PeeHaa in that case I mind less. can you ping me when it's done, so I can package the adapter up separately?
 
11:23 PM
Yes sure
 
good, thanks
 
@Fabien imo, all of your objects should be autoloadable; preferably in a way that a standardized autoloader can load it and if not in a way that one autoloader for your library can load all of your classes
 
@igorw Nope thank you for just constructiveness as usual :)
 
@cspray Well I am using composer for my autoloading.
 
@Fabien And it is working?
 
11:24 PM
@cspray I guess, I am not actually touching baseController atm.
 
Holy crap it's 1:30 already :(
 
@Fabien What do you mean "touching"?
 
Night all and tnx again @igorw
 
'night
 
@cspray Just not using it, file is there but not in use yet.
 
11:25 PM
@Fabien Well, is that your only class?
 
Nope, everything inside of controllers is basically a class.
 
@cspray +1
 
and models
 
So, I don't normally advertise my own libraries because it always makes me feel awkward but...
github.com/cspray/StopInjection is a static analysis library using @NikiC PHPParser to detect insecure usages of the extract function. The library is still very young and in a prototype phase; some things are still rough around the edges or just not implemented. If you have time though, and it sounds interesting to you, could you please take a look and give some feedback?
 
I think I am just being an idiot with namespacing.
 
11:28 PM
@Fabien Do you have the project on some code hosting somewhere?
Hard to say what the namespaces in that dir structure are from just dir names
 
@cspray Sorry I don't yet. I have a rough idea of what I should do now though.
I think :P
 
Well
I like the /src/ProjectName/ModuleName dir structure
and if you wanna do the org thing...
 
@Fabien You're missing a namespace off your code - which makes it weird compared to the PSR0 autoloader assumptions.
 
/src/Fabien/ProjectName/ModuleName
 
@Danack Yes, I am just sorting namespace stuff out now.
 
11:32 PM
--/src
----/ Fabscode
------/ controllers
--------/ Admin (subdomain)
--------/ Blog (default + subdomain)
-------- baseController.php
------/ models (as above)
------/ views (as above)
------/ common
--------[MappedRouter.php](pastie.org/private/…)
--------[Router.php](pastie.org/private/…)
--/public
---- [boot.php]
----/js - all the javascript
----/css - all the css
--/vendor
----/All the composer stuff.
and then in the composer.json for your project:
"autoload": {
"psr-0": {
"Fabscode": "src/"
}
}
And then maybe look at Symfony's Twig to see how people separate renering of HTML from the generating of the page.
 
@Danack Twig <3
 
@LeviMorrison gist.github.com/krakjoe/6707673 pretty cool :)
 
@crypticツ It implements the idea of separating data generation from data rendering reasonably well, even if it isn't suited for everything.
 
@JoeWatkins I actually hope your anon classes goes through. I have a use case that might be able to help remove a dependency on a concrete implementation in a module I'd really like to only interact with in interfaces
 
11:47 PM
@Danack I know what it is, just wanted to show my love for it =oP
 
@crypticツ Ah - I thought you were doing the equivalent of "Smarty <3.........;)"
 
@Danack To hell with Smarty! >.<
 
@cspray me too, I spent a while on it now ... it's a pretty neat feature ...
 
@crypticツ TAL <3
 
Oh man, could you imagine if we get variadics, named params and anon classes in one version release?
I'm still on the fence about the extended keyword support RFC...but I can see how it could be useful
 
11:53 PM
@Danack What about is there's no /src folder it's just Fabscode at the first folder?
 
"Fabscode": ""
In your composer psr autoloading
Although imo you should put it in src/
or libs/
 
@Fabien You can do that - but it may lead to composer getting confused.
 
@Danack So it'd be fine to have a src folder just to hold the fabscode for namespaces sake?
 
yes
If it isn't then all my projects are fubar ;)
 
Having it all in one folder also makes life a bit easier when telling an IDE "Look in this folder for all of this projects code"
 
11:55 PM
Righto...
 

« first day (1075 days earlier)      last day (3864 days later) »