« first day (1344 days earlier)      last day (3830 days later) » 

11:00
@softgenic quick reminder: this is a PHP channel.
Morning madara
sorry asked in wrong room
Random licensing question. I think recently(-ish) there was a change in either the LGPL or GPL license to make it so that people selling SAAS were required to also provide source code.....Am I imagining that change or am I just being crap at google and unable to find it?
@PeeHaa Morning
11:06
It's in reference to the GMP RFC - that library is lgpl.
@hakre might be able to tell you that
11:20
@Danack What you most likely mean is AGPL, and yeah, you found it :)
For GPL and LGPL since 3 it's more clear that creators of devices can not prevent their users from getting source when the software ships with the device (Tivoization) - but that's not about SASS, it's about devices and DRM.
Any PHP star here?
I'm trying to learn Interfaces and Abstract classes
And I cannot understand what is on the Internet.
Would anyone explain me what they are, why they are used and when they are used in brief?
Is anyone even active? :l
well if you can't understand what is on the internet, how can we help as this chat is the internet, too?
Well,
You guys are speaking live to me?
You guys can explain me in simple words, cause my english sucks and I'm not a person from a country where english is natively spoken.
and your language is?
There's no translator for that language.
11:29
might be, but that was not what I was interested to learn about.
@HassanAlthaf Most of us are not native english speakers :-)
Well, my language is "memon"
It's an oral language, and its not written.
The language "memon" comes from a Province in India, called "Gujrat"
There is a City called, "Kutiana" in that specific Province
Hi all.... i am getting an error in cakephp: Error: Cannot use string offset as an array
the lines associated with this error are

foreach($items as $row){
$categoryId = $row['Category']['id'];
$item_id = $row['Item']['id'];
$attr_id = $row['Attribute']['id'];
if(!isset($tree[$categoryId])){
$tree[$categoryId] = array('id'=>$categoryId ,'name'=>$row['Category']['name'] ,'Items'=>array());

}
any help?
yes I just took a look on the map.
A few decades back, our ancestors used to live there (muslim)
And during the war in India, muslims were removed from there.
Some muslims went to Pakistan and some to Sri Lanka.
I'm from Sri Lanka.
11:31
I'm pro peace. Just to note that.
Thats how our language got spread.
Same here, hakre.
There is a new war in our country.
So, question still is how to describe what an interface is in a way you understand it, right?
A specific buddhist community is warring against us.
hi Hassan and hakre
Yeah, hakre.
11:32
@hakre thanks - for reference that Bigint RFC is dead on it's feet I think, even without the affero license coming into play - en.reddit.com/r/PHP/comments/28n42p/rfc_big_integer_support/…
can u please help me a little?
Hi Debug_Ink, I would help you but I don't use stuff like CakePHP and stuff, but I code my own engines.
@hakre 200 rep left. Tomorrow or today.
Florian you need 200 rep more?
its rather a php error
11:33
No idea bro Debug
@Danack not really. first of all, it's LGPL and PHP license can make a linking exception. Would not have been the first time we see linking exceptions.
no problem.... thanks for taking a look
@FlorianMargaine are you hunting for 200 rep?
@hakre Not on the linking - on people who write php applications and sell them.
@Danack also the status of PHP license and GPL compatibility isn't that bad any longer. I think for debian it's okay and they are normally pretty well with this.
11:35
Well hakre are you still willing to help me?
@Danack the interpreter? well, for that, the binary is already there, isn't it?
37 secs ago, by Danack
@hakre Not on the linking - on people who write php applications and sell them.
so no distribution of software takes place.
Not distributing php - people who distribute php applications as embedded runnable apps, i.e. the provide the php exe and the code to run.
@HassanAlthaf no
11:36
@Danack so they provide two softwares, right?
@HassanAlthaf sure. I'm just asking myself how you could phrase the understanding question.
Anyone here who can tell me what is a interface and when and why it is used?
@hakre If you're trying to figure out a way round the GPL licensing, to allow you to distribute apps that use GPL code without being subject to the GPL, they've probably seen it before.
it's a contract
@hakre you can do it with normal english.
@HassanAlthaf it's a bit too generic for a short sentence to say so. Some say the Interface is a contract.
11:38
Like, contract?
what do you mean by that?
Like what is it and why and when do people use it
Show me an example working code?
@HassanAlthaf You're going to be much better off reading well written articles, rather than hoping someone will be equally clear in a chat room - this techflirt.com/tutorials/oop-in-php/… seems a decent-ish article.
If possible
@Danack I'm not trying to figure out such thing. If you have two independent works, they are independent. The copyright of the one work has nothing to do with the copyright of the other work. That's just normal and no loophole at all. I'm just wondering which case you imagine that would cause an actual problem here.
What I can imagine as that PHP wants to have all core under one license.
isn't there a canonical answer on interfaces?
77
Q: Why are interfaces useful?

Pankaj UpadhyayI have been studying and coding in C# for some time now. But still, I can't figure the usefulness of Interfaces. They bring too little to the table. Other than providing the signatures of function, they do nothing. If I can remember the names and signature of the functions which are needed to be ...

there we go
Thank you very much Danack
I understood whats an abstract class.
Let me spam you with some reputation for you helping me
11:41
@hakre I don't think that would stand up in a court. You can't say we'll sell you this bit of software and this other bit we'll give you for free. It would be seen as the same transaction, and so the same distribution, and so subject to the GPL.
I'm pretty sure people have tried that before.
And failed.
@HassanAlthaf don't
Danack enjoy your 35ish reputation
thanks.
you'll make him lose reputation if you spam him
abstract protected function f1($a , $b);
11:43
@Danack Well, if you look inside the GPL it tells you something about the operating system and it's libaries. E.g. I can write proprietary software that runs on a linux system. That's no problem. So if php.exe is part of the operating system of that embedded device, I wonder how this should be a problem.
Guys whats the point of having listing all the functions in an abstract class like that
Next to that, you also have to take a look at the PHP license. If you incorporate php.exe that much, that it ain't php.exe any longer, you have to abide the license. Which means, you can't call your product related to PHP any longer.
Which perhaps then offers some different problems whether or not you need to provide (better: offer in a written statement) source for an LGPL'ed library part thereof.
@hakre Yes, that's what I meant. PHP would still be distributable freely as source code. But anyone creating something like a Docker application, that distributes PHP as compiled source code, would be subject to the GPL.
@hakre @Danack whats the point of listing all the functions in the child class with the 'abstract' keyword?
@Danack LGPL for a fraction of that code. Btw. Docker is a linux container. It interoperates with the kernel. Just to give you a broader picture here ;)
11:47
Can I have two PDO queries one one page? <?php $relatedStmt = $db->query(
@hakre Yes, but you would ship a PHP binary with it. docker.com/whatisdocker
Im getting an error: Warning: Invalid argument supplied for foreach()
foreach ($relatedStmt as $rows) { ?>
I have this foreach before;
<?php foreach ($downloadStmt as $row) { ?>
@Danack and so this would be a system library. the only thing new would be that you have source requirements for the GMP Bigint LGPL'ed library if I understood you right.
11:49
@hakre No.....the GMP library would be statically linked for your PHP binary.
@Danack And then? The PHP version you create is that secret that you fear to offer source?
Does it even differ from upstream?
@hakre No......the whole distribution would be subject to the GPL. Splitting up the applcation into a PHP bit, and a separate application bit would be a massive pain in the arse, and still not stand up in court against the GPL.
Can these be on one page?:
<?php $downloadStmt = $db->query("SELECT * FROM items WHERE id = 1"); ?>
<?php foreach ($downloadStmt as $row) { ?>

<?php $relatedStmt = $db->query("SELECT * FROM items WHERE tage LIKE id = 1");
foreach ($relatedStmt as $row) { ?>
@Danack I still don't understand. Can you put it in simple words and tell me?
@Danack But aren't you talking about LGPL here?
11:51
@HassanAlthaf No....If someone who took the time to write an article to explain it clearly, and you still don't understand, me writing something really quickly isn't going to make it any more clear to you.
danack idk wh
But I understand like that.
anyone? :D
You learn those kinda stuff by experimenting.
I wish I could experiment this Abstract and Interfaces
-.-
11:53
I can't find an alternative.
What do you mean Rahul
Where are you from
UK.
Invalid argument supplied for foreach()... :/
@hakre Yes. If you shipped a docker app with PHP with the bigint RFC you would be shipping PHP that has been statically linked against the GMP library, and so distributing the GMP library, and so the LGPL license would apply to your docker app.
Oh, Rahul
11:53
Either $downloadStmt or $row is invalid
That one works fine, it when I added the next one.
What do you mean
When you add foreach() it shows the error?
Well, paste the whole code here, and I'll see.
@Danack no, LGPL has linking exception. That is for what LGPL is for.
<?php $relatedStmt = $db->query("SELECT * FROM items WHERE tage LIKE id = 1");
foreach ($relatedStmt as $row) { ?> Thats the one that brings the error.
@hakre YOU'D BE SHIPPING THE LIBRARY NOT JUST LINKING.
seriously.
11:55
oh.
you seem to be missing that fact.
I can't put it any more clearly - hence the caps.
Try changing the variable $row to something eles?
@Danack Yes you ship it. But source requirements are for the library only.
I tried
to rows
11:55
Invalid argument supplied for foreach(
$relatedStmt is invalid I guess.
Isnt foreach() used for associative arrays?
@hakre I am an idiot. I apologise for that fact....
Changed that var, same error.
@Danack can you explain abstract class in simple words with a good example?
I am not going to bed until i learn whats an abstract class and an interface
I just skimmed a "crash course" C#-to-C++ doc, and it was actually pretty damn good.
11:58
Danack would you tell me where I would use an abstract class and an interface if I gave you a php class?
Dan Lugg can you code in C#?
I'm sorry, I can't answer that; this is the PHP room.
@HassanAlthaf any other ideas?
I don't want you to answer a problem, just a question
Rahul
Goto pastebin.com
Paste the whole code
I'll read and see
@HassanAlthaf Try to put
More than one message
On the same line
Because
It gets
Really
Annoying
Dan Lugg aren't you doing the same thing? LOL
12:00
Ell Oh Ell indeed.
@DanLugg even more..
o
n
e

l
e
t
t
e
r

per line :p
@AlmaDo Well, I know you're just being a dick, so that's okay :-P
Actually, I dunno why I came in here and started message Nazi-ing.
I only come for PHP help.
@RahulKhosla maybe populate the table, I think the table is empty.
12:02
And learning
@HassanAlthaf Thanks, had the wrong table name.
tag not taga
Does this query make sense?
WHERE tag LIKE id = 1");
Guys, anyone here who knows abstract classes and interfaces in PHP? How would you implement such stuff in a class like this pastebin.com/r9HuqFj2?
Im trying to fetch anything that has the same tags
12:04
Dunno Rahul, I've never used the 'LIKE' statement
Does the above look somewhat decent for a start?
@PeeHaa wow what's that.
CMS
I like the design
ThW
ThW
@HassanAlthaf I would not create the database connection in the constructor, that is asking for problems.
12:05
great
@ThW where should I then?
@PeeHaa Much Windows. Very 8. Such Microsoft.
;-)
I know right, it looks like Windows 8.
Is that a good thing or a bad thing @DanLugg?
ThW
ThW
@HassanAlthaf Read about "Dependecy Injection"
12:06
@PeeHaa Depends on your target clients. I like it, it's clean.
Lol @Thw I know whats Dependency Injection is
@DanLugg non technical clients
But how would I implement it without having another class?
brb going to get breakfast
Dependency Injection never works for me. :ol
12:08
I expects lots of pings with critiques when I get back :P (either positive / negative)
Anyone know if this query will make sense? WHERE tag LIKE id = 1");
Only suggestion @PeeHaa would be E_NATIVE_DARK_THEME ;-)
@PeeHaa Love the design btw, very minimalist/modern.
Seriously, for accessibility and because dark theme.
12:11
@RahulKhosla Yea, roughly.
But the contrast ratio needs to be right. (that might be, I don't know, it's just inverted)
Can you var_dump a query?
Anyone here?
$db = new mysqli('localhost', 'root', 'php123', 'sms');
Catchable fatal error: Argument 1 passed to Users\Users::__construct() must be an instance of Users\DB, none given, called in C:\xampp\htdocs\Projects\SMS\classes\class.users.php on line 109 and defined in C:\xampp\htdocs\Projects\SMS\classes\class.users.php on line 8
I am gettign this error when I am trying to do dependency injection
class DB {
public $db;
public function __construct() {
$this->db = new mysqli('localhost', 'root', 'php123', 'sms');
}
}
class Users {
protected $db;
public function __construct(DB $db) {
$this->db = $db;
}
Anyone online?
I am
But I have no idea what that means.
Lol, do you know dependency Injection etc?
Ohk.. lol
Im stuck on this.. <?php $relatedStmt = $db->query("SELECT * FROM items WHERE tag LIKE id = 1"); ?>
Wondering if that will select the tags that are the same
12:21
@PeeHaa wow. now that's a sleak interface.
@HassanAlthaf @hakre any ideas on that query?
@hakre can you use an interface and an abstract class anywhere in this pastebin.com/r9HuqFj2 code?
12:39
@HassanAlthaf yes you can. you could use an abstract class for the database connection dependent classes (those three there), e.g. having the query method and other boilerplate code, the two classes are using.
But the biggest problem I see in that example is that you create the database connection within the constructor.
Hakre
Then, can you tell me how would I implement that idea?
@PeeHaa PHP King can u help me
12:49
Nope. I'm busy. Sorry
Also I am far from a king
:p
PeeHaa you are a king.
XL for extra effect
:P
It's funny, you can grab reasonably large (like, 512x512) images of people off gravatar.
http://i.stack.imgur.com/O3UC1.jpg?s=128&g=1 > http://i.stack.imgur.com/O3UC1.jpg?s=512&g=1
So you are telling me I can find your breakfast in your beard now? :D
12:58
Probably beer spillage if anything, but yea.
:)
That's a huuuuuge bitch ^
:-)
Hahahahahahaha
Where's he been anyhow?
Did he defect again?
Neh he's still here. I think he's just busy playing with his choppers
lol
Oh yea, that kickstarter dealio.
Auto-follow air cam?
yeah
13:04
That's pretty freaking sweet
yeah looks totally kewl
Are they priced anywhere?
Dunno @tereško @tereško @tereško @tereško @tereško @tereško
I've been getting into paddleboarding, and getting more and more extreme with it (though, not so extreme yet; getting near surfing) and was gonna buy a Go Pro
@PeeHaa Did you see the dark theme?
Can someone help with this; stackoverflow.com/questions/24341727/… thanks.
13:05
@RahulKhosla s/dark theme/inverted png/
Yeah. It looks like my phones inverted theme
@PeeHaa Yeh, I just CMD+I in Photoshop.
I am totally in my right to have cv-ed this right?
@PeeHaa You would have been totally wrong to not CV it ;-)
good :D
13:08
A search on "[php] sql injection" probably yields nothing but potential (probable) dupes.
True
Same with "[php] password md5"
PeeHaa: Considering that I am asking a yes or no question, your statement is false. If you're more interested in ego-bloating and acting like a smugly-superior codewarrior, please go elsewhere. I don't have the time and simply need to know if this code is UNSAFE. — user3761993 36 secs ago
:)
> smugly-superior codewarrior
Awesome! :)
> "I don't have time for this." - and that describes it very well.
Shirly, "I haven't got time for this mickey mouse bullshit".
13:16
@HassanAlthaf what was the idea? to have code that interoperates with database? (sorry didn't read earlier)
@HassanAlthaf you can click that little arrow on the left to scroll to your text I'm replying to.
How can this query be done as a like 1? SELECT * FROM items WHERE tag = (select tag from items where id = 1)
@hakre which message? I dont seem to find one
39 mins ago, by Hassan Althaf
Then, can you tell me how would I implement that idea?
13:23
oh
Can you teach me how to use dependency injection
and abstract class for database connection
Like you suggested above.
Someone help this guy out:
$password = password_hash($password); like that ? — user3748181 2 mins ago
I have to go
@BenjaminGruenbaum Your people need you?
@HassanAlthaf dependency injection for example is to pass the $db via the constructor.
13:38
How hakre
I've written the code
Can u see whats wrong
Thank you for reply Benjamin ? How shoud final code look like ? — user3748181 15 mins ago
Does anybody knows whether there are any decent roms yet for a galaxy s5?
@HassanAlthaf you find a nice example about that in the following book of which some part is online: The Data Mapper has an AbstractMapper baseclass - martinfowler.com/eaaCatalog/dataMapper.html - this website has the page numbers of that book.
It has the code examples and discussion of it.
13:43
Where about man
You want me to buy this book? martinfowler.com/books/eaa.html
You really should stop talking to the tiny people
@rdlowrey: Thanks!
@ircmaxell what a great channel I have never seen before
Thanks
13:59
@ircmaxell do you have any plans on making new videos?
Guys.
Would anyone help me with dependency injection?
Catchable fatal error: Argument 1 passed to Users\Users::__construct() must be an instance of Users\DB, none given, called in C:\xampp\htdocs\Projects\SMS\classes\class.users.php on line 109 and defined in C:\xampp\htdocs\Projects\SMS\classes\class.users.php on line 8
I get that error.
Look at line 8, look at where you're not passing in an argument. Right there, pass in something that is an instance of Users\DB
:P
I just deleted the dependency injection
I'm going to create an abstract class for it instead
u can write variables in an abstract class right?
Yes, but people normally call them properties when they're inside a class.
What do you mean
abstract class DB {
$this->db = new mysqli('localhost', 'root', 'php123', 'sms');
}
14:13
class SomeClass {
protected $someVariable; //<--this is called a property
}
oh
cant u assign a
value?
Yes, simple values, but not something from a function. so:
protected $var = 5; //is fine.
abstract class DB {
protected $db;
$this->db = new mysqli('localhost', 'root', 'php123', 'sms');
}
And then I am trying to implement it to my class
and I have protected $db; in my class
But I get this: Parse error: syntax error, unexpected '$this' (T_VARIABLE), expecting function (T_FUNCTION) in C:\xampp\htdocs\Projects\SMS\classes\class.users.php on line 8
The line that connects to mysqli needs to be in the constructor of the class.
so, what shud I do
can i create a constructor?
in an abstract class?
What are you talking to?
Danekc
Can I do something like this:
@tereško tbh he appears ignorant (i.e. lacking knowledge) rather than dumb......but:
@HassanAlthaf You do need to use google more...
I know, I use google, if not successful I come here
Its pointless to ask question in stackoverflow as they just downvote.
So I ask here in chat
how to call the constructor??
in abstract?
But you're asking things that are really simple and are in the manual......learning everything by asking will be very tedious.
14:18
yeah, SO is full of meanies
Yes, sergey.
Everyone there is a meanie.
I cant understand the manual.
A few months back, in this group.
People used to help alot.
Like as soon as you ask something.
They would answer you and explain what is it
I'm just 14, so I have not done a degree or w/e.
"You're going to be much better off reading well written articles, rather than hoping someone will be equally clear in a chat room"
Well,
I find chatting live more better.
@HassanAlthaf Yea, but other people might not.
Yeah but but people in here don't enjoy spoon feeding people knowledge when they can't be arsed to spend the time reading the manual.
14:20
^^
@HassanAlthaf it's frustrating to see the same questions day to day that are answered at least a dozen of times on the blogs that come up on the first two pages of google result. Chats should be used when you're stuck with a problem that is extraordinary, very specific to your code or when you are in need of an opinion of more experienced developers
I am talking about
My specific code.. lol
@HassanAlthaf You really think that? You think that how to use constructors is unique to your code?
no no
I can use a constructor
How to
I give up with abstract classes
If you're stuck, throw out everything and write from scratch using a tutorial
14:33
no way
or at least open a second window and go along with the tutorial on the topic
dafuq dafuq dafuq.
'ConfigurationException' with message 'Buildfile: build.xml is not readable!'
^^ My project is sitting on a "network" mount (it's actually a VM shared mount) and phing keeps kicking back this
I'm guessing that's the culprit?
Yep. Fuck.

« first day (1344 days earlier)      last day (3830 days later) »