« first day (525 days earlier)      last day (4414 days later) » 

12:29 AM
@rdlowrey About to pull Artax. Any last commits before I do so?
 
user895378
hold on, lemme do git status and make sure
 
user895378
wait one sec, I've changed the bootstrap file around a bit.
 
Well, nevermind.
I forgot that I didn't finish installing PHP 5.4
lol
The deb packages failed miserably.
Have to compile myself.
 
user895378
That sucks. Okay, I pushed that. I've been fiddling with the bootstrap to streamline things as far as submodules go. There's now an autoloader registered in the main bootstrap file for any submodule classes.
 
user895378
I'm going to be creating a new repo for my logging package and adding that as a submodule in a bit, so you can see my thought process on how submodule libs are already accounted for in the autoloader registered by the bootstrap if you're interested.
 
user895378
12:46 AM
@LeviMorrison Any preference on changing the Artax-HTTP to Artax-Http before we start working with it?
 
@rdlowrey Http. UpperCamelCase all the way.
 
user895378
That's what I was thinking too ... I'm going to change that real quick.
 
user895378
Right now it's HTTP
 
user895378
@LeviMorrison Allright, that's fixed. You can also see how I've structured the Log submodule. Basically the directory structure is the only thing that's important.
 
user895378
/
  Http/            <--- Submodule component Name
     src/
       Artax/     <--- Top level namespace
         Http/     <--- Component Namespace
            ClassName.php
            SubNamespace/
 
12:54 AM
ola
 
user895378
yo. Stupid space formatting. I just edited that like 10 times
 
I am confused.
 
user895378
Okay, please explain :)
 
A. What is `/` here?
B. I assume `Http/src` is my app, but then I have `Artax` inside of it? And then I have myself inside Artax?
 
user895378
I was looking at it like this:
 
user895378
1:02 AM
The Http component is a standalone thing. You can either (1) include the main core bootstrap file and you're all set. You've got an autoloader registered. The other option is to use the Http functionality on its own and include a simple Artax-Http.php bootstrap file.
 
user895378
Your app doesn't live in any of those directories
 
user895378
You just include a single bootstrap file.
 
user895378
And the Artax libs live in some sort of "vendors" directory or wherever you want them to live.
 
user895378
So if you wanted to use the logging package on it's own, you'd just include the Artax-Log.php bootstrap file here. It loads an autoloader for you in that bootstrap. Or, if you're using the core library, that bootstrap file already specifies an autoloader that works for any component libraries and you don't need to include the component bootstrap files.
 
user895378
Basically I was trying to make each individual component as standalone as possible.
 
1:08 AM
Here's what I was thinking:
Well, nvm.
 
user895378
I'm happy to change if it makes sense. That was just my first thought. As long as we're on the same page it makes no difference :)
 
user895378
Does my message spam make sense? Because if not I can try to be more concise :)
 
/    <---- project
   Artax/
          src/ <---- the CORE
         Http/     <--- Not actual namespaced as Artax/Http, but *just* Http.
              src /
                      ClassName.php
              test/
 
user895378
where the top level / is the Http submodule, right?
 
user895378
The only problem I have with that is there are bound to be other things that use the Http namespace ... you're going to have collision issues ...
 
user895378
1:14 AM
I know you can alias them, but still ...
 
I see what you mean. Use the Artax namespace but it doesn't actually depend on any Artax code.
 
user895378
That also makes sense
 
Thinking aloud:
 
brb doing the assosiation bonus dance
 
user895378
@CarrieKendall lol
 
1:16 AM
/
   Artax/
      src/
      test/
      Http/
         src/
         test/
      Log/
         src/
         test/
The hardest part about submodules is autoloading, it seems.
 
user895378
Okay, that makes perfect sense to me.
 
Code encounters: new Artax/Http/Router
 
user895378
Yeah, the autoloader is the impetus for all of this
 
user895378
How about I just work to take all the "core" libs and put them in the same format as you have above
 
Hang on, not quite
If we have two branches, master and test, then we can remove the src/ folder
 
user895378
So we have:
 
/
   Artax/
      test/ <-- on test branch only
      Http/
         Router.php
         test/ <-- on test branch only
      Log/
         Database.php
         test/ <-- on test branch only
Or that
Well, you still need the original src, nvm.
 
user895378
No, I like yours
 
user895378
Well ... now I don't know.
 
user895378
@CarrieKendall That's a lot of dups :)
 
user895378
1:22 AM
How about this: I have to go right now because I'm supposed to meet this chick for a movie in 30 minutes and I haven't showered since the gym :) I'll be back around later ... like 1230 or 1 EDT -- not really into this girl :)
 
user895378
So work out whatever seems right to you and if you feel good about it, feel free to make the changes and push ... or just wait and we can discuss further.
 
@rdlowrey i could post for days on eregi :P take it easy
 
user895378
Either later if you're around or tomorrow etc if not
 
user895378
@CarrieKendall You too!
 
@rdlowrey Sounds good.
Maybe I'll take my wife out to dinner or something.
 
1:25 AM
i am going to have sexy time with UMLs, wooooo
 
@CarrieKendall What software do you use for UML?
 
if you promise not to cry i'll tell
ArgoUML
 
I haven't heard of it.
Does it support code generation?
 
not on mac
but, the mac version is crippled
 
Does it run on Linux?
 
1:31 AM
yup here is a link
 
No new version in over a year, when other years have multiple releases? is it a dying project?
 
1:46 AM
sorry, stepped away for coffee. yeah, i personally wouldn't recommend it. i am just limited by OS X
 
I'm looking for some solid UML software than can generate code in PHP. Haven't found it yet.
 
2:30 AM
whats the syntax for having an optional capture in regex?
so, say i want to capture from strings : '/controller', '/controller/action', and '/controller/action/id'
and the action or id elements are optional
 
2:53 AM
evenin folks
i believe its ( )
(action/id)
i can never remember regex syntax so i use this site to help: gskinner.com/RegExr
 
oo that is a pretty good site. i always use rubular
figured it out... you do ([whatever])?
 
yes
 
the question mark after the capture
 
and you can specify like OR with (is|was)
im sorry ( and ) is or
(is OR WAS)
optional is ?
 
ok i have /^(?:\/)([-\w]*)(?:(?:\/)([-\w]+))?(?:(?:\/)([-\w]+))?/
 
2:57 AM
yeah that looks like gobbilygoop to me
 
hahah i know it always does when you're done with it
the funny thing about regex
 
3:31 AM
posted on March 24, 2012 by Paul Reinheimer

Some aspects of Natural Load Testing's site have never really performed that well. The site was under incredibly rapid development so I didn't want to invest too much time in making performance tweaks on code or even architecture that might change in the next week. No joke, we've re-written our load tester at least three times. Two complete re-writes in the same language, then we sw

 
gentlemen, whats best practice as far as @packages go, as in phpdoc?
like if I have:

// ...
class someClass P {};
class someClassException extends Exception {};
should they be in the same package? or should i group the exceptions from different files with this exception in a package?
or is it just personal preference?
@ircmaxell "Yo dawg, I heard you like variables... so we brought you some awesome functions"
 
3:53 AM
:-)
 
 
2 hours later…
5:45 AM
Is there anybody here?
@user1131997 What's that?
 
6:08 AM
1
Q: Is the Controller on the MVC pattern the same as the Page Controller pattern described by Martin Fowler?

KeyneI'm experienced in working with MVC web applications (Zend Framework). When I was looking for a better description of each layer of the MVC pattern (i.e. Model, View, Controller) I've found the Page Controller pattern that describes a similar behavior as you can see on the image below: http://ma...

 
 
2 hours later…
7:45 AM
hi
 
8:03 AM
im a bit curious , @GordonM , was the answer i wrote for Kayne complete crap or just a bit biased
especially since i got dv-bombed because of it
 
8:22 AM
@tereško i didnt dv it but I'd say page controller is pretty much your average mvc controller as we see it in most frameworks
 
so , basically , that bullshit there
 
no, not really
most of it is ok.
just the part about the controller not being a controller is not right
oh and page controller goes well with front controller. poeaa states that
 
since i was trying to decide if i should delete it, this really did not clear it up
 
you cant delete it anyway since its accepted
 
fu#$
 
8:29 AM
just open pg 333 in poeaa and update the answer accordingly :)
 
yeah .. when i wake up completely
 
8:41 AM
i'll better red the whole chapter
 
9:01 AM
Good morning
 
Hey @tereško you've used ArrayObject class, right?
 
nope , have not
 
IteratorAggregate interface?
Correct me if I'm wrong, but to have an object behave exactly like an array, I have to extend that class and overload its methods, correct?
 
10:15 AM
I have only implemented ArrarAccess and Iterator
never needed to other functionality
 
@Gordon Nice to see that there is something wrong on the answer
@tereško Don't need to delete it. But what isn't clear is that the controller decides what to do with the model. So, in this case, it implements the model behavior, thus business logic
@tereško I saw the dv. Not me though. What need to be fixed, in fact?
@tereško I've removed it as the accepted answer until we fix it.
 
@Keyne controller does not decide what to do with model layer
it just changes the state of the domain objects
 
@tereško So, what's wrong?
I would say that the repository decides, right?
It must be a layer responsible for that
Btw, changing the state means that you will decide which state you want. The available states are described on the domain object, but the available actions to change the state is on the business logic
When a user is created for example, you will decide the initial state. It is business logic
 
11:11 AM
Hi
How to parse date and time from excel through php?
 
@Asker Never heard that excel has a "parse through PHP" output. What exactly do you want to know? Excel is large, PHP as well, and date and time can mean a lot.
 
hi @hakre Actually i'm the php begineer and i have to import data from excel to browser through php code...?
 
Congratulations for being a beginner. And welcome to the world of software development and tinkering with files.
What you describe is the big picture of what you want to do. The so called vision statement.
That's far away from writing actual code.
 
ok
My task here about that to import the excell date and time to browser through php code...
 
And your problem is?
That you've got no clue how to do that?
 
11:22 AM
I don't know how to parse the date and time format [ for example 06-02-12 02:30 ] to browser...
 
what date format needs the browser?
I didn't know that browsers need some specific time format at all, they can normally display any sort of date time formats just well.
 
ya
@hakre My question is: while the user click on "Import from excel" option on the front end, user have to upload a excel file with date and time....
 
that's not a question, that's a statement.
 
This project is some what about the travel based one...
i did't have the logic that how to add date and time to front end
 
you are totally unspecific about what you want to do which creates the image you actually don't know your work yet. You need to come into the position first to specify your needs or you will never be able to solve your problem.
 
11:27 AM
Hmm...
 
And you can't ask for help earlier, because the more you tell me, the more question marks I have in my head.
 
Mmm...
 
If you need to parse some time value, you either can do this with string functions or strtotime.
 
ok..
 
but that's just guessed and that's the best I can do. Because that is not enough, I start to feel uncomfortable.
 
11:30 AM
hmm..
 
Do you have a tutor?
 
No @hakre
:(
I just refer the w3schools website...
 
Some friend or colleague at least?
 
@Asker Hi, you already accomplished the task of list the excel data on the page?
Despite the date format?
 
The w3schools site is not actually prominent for quality tutorials.
 
11:31 AM
They are experienced and only they assign the work to me @hakre
@Keyne yes....
yes @hakre
 
@Asker If they assign the work to you, and you have got problems with the work they assigned to you, talk to them. Grab the phone and call them. now.
 
So post here the loop or the code that list it, just the part where it print the date
 
@hakre is there any tuto to learn..?
@Keyne ya...
 
Nice.. let's see.
 
@Keyne wait i send the code...
 
11:40 AM
@Asker w3fools.com .. for the details on subject
 
lol @tereško
 
@tereško lolz
 
it's actually a serious project ,
 
@Asker Tutorials, Books, professional training courses, exams. There is a lot of stuff. Just pick what suits you.
 
Tuto is the best i hope @hakre
 
11:45 AM
@Asker Btw, where's the cooooode? =P
 
yup... "
for ($x = 2; $x <= count($data->sheets[0]["cells"]); $x++)
{
$first = $data->sheets[0]["cells"][$x][1];
$middle = $data->sheets[0]["cells"][$x][2];
$last = $data->sheets[0]["cells"][$x][3];
$email = $data->sheets[0]["cells"][$x][4];
$date = $data->sheets[0]["cells"][$x][5];

$sql = "INSERT INTO new (first,middle,last,email)
VALUES ('$first' ,'$middle' ,'$last' ,'$email')";"
 
that's an SQL injection waiting to happen
 
it parse the all data which is in xcel, expect date and time...
 
@tereško Could be programming by contract as well.
 
@hakre , even then, he will be making that query a LOT of times
making a prepared statement would be extremely useful here .. and not just to have protection agains injections
 
11:49 AM
@tereško That sounds a bit like premature optimization. Worth to note down in case this get's too slow, but for the moment why to care about that when it's about the date?
 
@hakre Okay, the first point is to map a '20-11-12' date to the mysql field type, right?
Is it the format? '20-11-12'?
Actually it's 06-02-12 02:30
day-month-year
 
@Keyne I can't tell you. Asker had not give any specification so far. It's not clear what data-type $date is and which value(s) it contains.
 
@Asker Is it?
 
@Keyne yes
 
The first step is to convert it using php.net/manual/en/function.strtotime.php
 
11:53 AM
hmm...
 
It's easier with that:
<?php
$date = DateTime::createFromFormat('j-M-Y', '15-Feb-2009');
echo $date->format('Y-m-d');
?>
You will specify the format in there
Now I think you're ready to achieve it.
 
yup... thanks alot @Keyne and @hakre for your kind reply :)
 
You can also use the date() function br2.php.net/manual/en/function.date.php
 
Hmm...
 
To parse the format within the strtotime()
I'm sure you'll be able to implement one of choose options
 
11:56 AM
ya sure @keyne
@Keyne i'm the begineer of php and i was randomly prepared about php from websites. Is there a best site to learn php? Can you please send some best sites?
 
Well, the best in fact is google. Because there's a lot of good articles spread along the Internet.
 
Hmm...
@PLB ok...
 
w3schools noo =D
 
@Keyne :D
 
I will pick for you one
 
12:03 PM
@Keyne Hmm.....
what about php.net?
 
1 message moved to bin
 
php.net is good, it's the php docs. So you will always use it
 
@Keyne ok...
 
I think you need to make a clarification: do you want to learn PHP, or do you want to learn how to program? (meaning: do you know how to program, and just need to learn the new language, or do you need to learn how to program and are picking PHP as that language)
 
12:07 PM
@Keyne ya..
@ircmaxell Sir, as a begineer i want to learn php....
 
I think with that you will be able to define all searches on google and all books you need
@Asker On the link above is everything you need, I mean, most common topics
 
@Keyne i saw the site which u send before,... Hope that will help more to learn abt php...
 
It will =)
 
ya it covers all the topics @keyne
@Keyne thank u frnd...
 
@Asker You're welcome
 
12:11 PM
@Keyne :)
 
Now changing the subject:
0
Q: Best way to implement a web MVC application (language agnostic)

KeyneWell, the questions is a little bit broader, so I'll assume that the basics is already defined: Controller FrontController Controllers (plugin hooks, request/response object, view handler) View View (template, scripts, partials, helpers) Model Domain model objects Domain model reposito...

 
@Asker do you know how to program?
 
I've posted on the code review to test the site, but perhaps I will migrate it to stackoverflow. Any one here, can help?
 
@ircmaxell Yes sir....
 
@ircmaxell Btw, nice post about the Micro PHP manifest
 
12:15 PM
thanks
 
So, related to the link above, where's the best place to put ACLs checks, is it part of the model layer?
@ircmaxell Any thoughts ? =)
 
12:40 PM
@Keyne The ACL Domain Model should allow any component of the framework that wants to use the ACL Domain model, to use it and to do any action the ACL offers.
 
Yes. So it's aspect oriented programming. But, as you've may see on my question above, is that right to hook up ACLs into the service layer as an standard way? Furthermore, should we bound our domain model with a service layer (a facade for the domain layer)?
@hakre Actually I'm not making my in-house framework as you stated on the answer. I'm using ZendFramework
the getRequest() method is the request object.
The HTTP request itself
so @hakre The point of the question are the necessary layers. Controller -> (model: service -> repository)
 
I think you can leave "service" out.
You want to have access inside the controllers to domain models.
 
Well, but in fact, I'm creating a "full-stack" domain model and using controllers just as PageControllers
I can use my entire domain model without ZendFramework controllers, for example.
 
No idea what you mean with "full stack" domain model.
 
Just calling the services
That's the business logic facade
lol. I thought so.
I mean. I have no logic on controllers at all.
 
12:49 PM
Okay, you have only little logic in controllers.
 
Controllers just exist to handle HTTP requests and decide which service to call
 
So you use the controllers to map the HTTP request onto class methods.
 
(Also the view)
 
What about the view?
 
Yes. As I said...
 
12:51 PM
you have not spoken much about the view, only that you're using zend framework which has these .phtml files for view.
Do you have view models?
I mean how can your controller pass the domain model into the view?
 
No. Just the usual. controller decides which view to handle
 
Anyone knows why PHP provides server vars like HTTP_PORT instead of ['HTTP']['PORT'] ?
 
The service is responsible to return the data
to the controller... So the controller bind it to the view
 
Normally you pass models into the view the view can deal with. So called view models or value objects.
Does it mean that the return value of a service is the data passed into view?
 
Yes. As in the MVC pattern on the PoEAA, domain model objects or collections are binded to the view
You could call $users = $this->userService->getUsers()
then $this->view->users = $users;
But, for instance, the getUsers() method on the usersService can do a lot.
For example getting the current user's session, checking its account, and listing just the users that are in the current user's account
 
12:56 PM
wow, normally one method should do one thing.
 
In there I mean.
The operations performed. It doesn't mean that everything is done by the same method
the getUsers() are aware of what need to be called.
=)
 
okay and now you're lost because you don't know where to place the ACL checks?
 
It's working and so far I think I know. I simply could do in that manner and be happy.
But I'm investigating the theories behind the style I've adopted.
 
then decide something. That's the important part.
You can't go on without deciding.
 
It's decided. =)
 
12:59 PM
Then go on. And if you encounter a change that requires a change in your design as well, then change it.
 
I posted on the code review to get insights about. There are patterns for everything, so I thought that someone could point to the theory behind the style.
For example, I'll post a list. Just a minute
 

« first day (525 days earlier)      last day (4414 days later) »