« first day (425 days earlier)      last day (4506 days later) » 

12:02 AM
hey are there any people who are good with ipb here?
 
What the hell is IPB?
International Peace Bureau?
Irish Public Bodies?
:-P
 
:S so nobody knows Joomla?
 
Oh, I hate dealing with Joomla.
And other products like that (what was it, drupal or something)
 
reposting...
what is the name of URLs which look like this: http://krugman.blogs.nytimes.com/2011/12/14/speaking-of-people-whose-models-have-failed/ ? is that "clean URL?"
 
12:19 AM
Clean URLs, RESTful URLs or user-friendly URLs are purely structural URLs that do not contain a query string and instead contain only the path of the resource (after the scheme [e.g. http] and the authority [e.g. example.org]). This is often done for aesthetic, usability, or search engine optimization (SEO) purposes. Other reasons for designing a clean URL structure for a website or web service include ensuring that individual resources remain under the same URL for years, which makes the World Wide Web a more stable and useful system, and to make them memorable, logical, easy to type, h...
 
ah yea thats it
i have no idea where to start on how to make my website work like that, know of any good resources?
 
@JMRboosties google.com/…
Generally with PHP you'll implement something Apache mod_rewrite
For example, some frameworks have it setup so that all requests are routed through one file, say /web/index.php and the url is parsed so that it reads (to the framework) controller/action/param1/param2/paramN
obviously how you implement it is going to be up to you and what you're wanting it to do
 
sounds complicated
 
It isn't really
 
@Ozbekov I agree, Wordpress isn't that bad because of how well documented it is, but Joomla is just ridiculous
nothing on the nets seems to help me really
 
12:28 AM
@JMRboosties Route all requests to one file, look at the URI requested by the user, parse it to the appropriate Controller::action($param1, $param2, ...)
 
@CharlesSprayberry this tutorial is mentioning htaccess, which is the file that you should route requests to...
he put the file in the root directory, does he mean literally the root/ directory or the www directory?
 
12:44 AM
man im in over my head on this
 
And actually without seeing the tutorial I couldn't say for certain what they mean
It depends entirely on your directory structure
If you'll give me a moment I can whip up a little something that might explain it better
 
thanks a lot man
 
@JMRboosties Assuming you have an Apache/PHP installation with mod_rewrite enabled?
 
yes my server is apache and uses php5
 
12:52 AM
i dont know where to search to check mod_rewrite
im gonna go home now, thanks for your help. if you have something you wanted to show me i can check back in here in like 2 hours, else you can email me @ jmrboosties@gmail.com but dont break a sweat or anything, really though thanks for the help i appreciate people taking time to help the newbies
later
 
1:29 AM
guys any help to reopen this question? stackoverflow.com/questions/8388410/…
 
1:48 AM
Joomla and that Drupal thing.
I hate them both. Rather than to use them, I would sit and re-write the system myself and be much happier.
I love rewriting and refactoring stuff.
 
mornings
 
Mornin'
 
hallo
 
2:19 AM
Evening.
 
Hello
I'm Harvey... Man..fren...gen...sen...ton...
 
Hello Harvey Manfrengensenton.
 
2:32 AM
I love that movie.
 
Afternoon!
 
2:46 AM
howdy
 
2:57 AM
@CharlesSprayberry How you going ?
 
It's going pretty good, how about yourself?
 
Same here, having a good day.
 
3:13 AM
@Ozbeko What are your thoughts about WordPress?
Drupal should probably come in a box that says, "Some assembly required." The core doesn't come bundled with an image upload or WYSIWYG editor so it needs a higher skill level to get started.
 
@Nitin , it is horrible .. probably as horrible as Drupal
 
@tereško What CMS do you prefer?
 
custom written one for each project
 
@tereško Do you use a popular framework or do you rollout your own libraries?
 
yes
 
3:22 AM
@tereško How long does it take you to build the code for a custom CMS, on an average?
 
it takes as long as it takes
what the hell do you want ?
 
@tereško I think most clients who want a website don't need a CMS - all they need is DreamWeaver to edit the content :-P
@tereško But most CMS systems come with lots of plugins that would take ages to code from scratch
 
if you are using DreamWeaver , then this is where all the resemblance to serious discussion ends
 
@Howdy_McGee I did find a couple a problem or two with the WordPress documentation where the documentation was slightly off, but overall it is an excellent reference. Here's one function specification that I fixed on their Wiki n4express.com/blog/?p=45
@tereško I don't use DreamWeaver... but if I have a client who just wants a basic website, that's when I think a statically coded website is what they need; they can use DreamWeaver to update it instead of a CMS.
@LondonBoy The page no longer shows up - it reads "Website under review" and "You are seeing this page because the system administrator of 000webhost.com is currently checking this website for malicious content." They probably temporarily blocked your hosting account.
@Howdy_McGee You can hack through the inner workings if need be, but ideally they ought to have a documentation like WordPress does. Check out their codex.
@Ozbekov IPB = Invision Power Board. It is an alternative to vBulletin and phpBB. They had a free released called Invision Free but later discontinued it.
 
3:37 AM
yo
 
@Nitin Sorry - I was away. I like Wordpress. It's intuitive and easy to use, doesn't require a lot from me. But I don't use those CMSes anyway. I used them a lot in the past, but not anymore.
I just don't like bulletin boards in general. I don't like the forum style.
And dreamweaver....
Any web developer who touches Dreamweaver, IMHO, is far away from being a web developer.
HTML and JS must be neatly written, from scratch with PHP to minimize copy/past of page areas.
If making one-two pages, static HTML with copy paste is OK
 
@Ozbekov There's two different ways you need to look at it though. One is from the side of an editor/admin, and the other is from the side of the developer. Wordpress offers little to less to the developer...
 
That is true, and I've only done minimal things in terms of Wordpress development.
I can't even find a good bug tracking system for my C library page, so I have to write it manually.
 
lol. I liked redmine
 
mornin' , @ircmaxell
 
3:46 AM
sup?
 
i really need a consultation
 
@ircmaxell Lemme check the Redmine demo again
 
lets say there is a pretty standard instance of Request , it abstracts the GET's and POST's .. and stuff
 
it's not perfect for every usecase, but I've found it works pretty well
@tereško Ok...?
 
it would make sense for it to abstract COOKIES too .. right ?
 
3:48 AM
Hrm...
 
but then you get into a situation when you need to set the value of a cookie
 
Yes. Because it comes in a HTTP header to the server
 
and you are setting it on an object named "request"
which does not feel quite right
 
why are you setting it there?
you'd set it on the response object
 
i think, because i dont have a response object
.. maybe i should
gonna think on that for a while
 
3:50 AM
Well, for that case (cookies), you almost need a response object. Either that, or some other semi-global method for setting the cookie at the application level
But if you did a response object, you could have a method $request = $response->convertToRequest() to allow you to do internal sub-requests
 
actually working with sessions falls into the same .. emm .. area of problems
 
@ircmaxell Redmine does look good indeed.
 
@tereško Yup
@tereško As I'd argue that the session is an implementation of a request detail
 
@ircmaxell one of spots which looks like a usecase for casting classes
well .. session is tied to the cookies
 
@Ozbekov Yeah, it's quite nice. There's Jenkins hooks, and scm integration. But it's ROR and has a few other "percurialities"
@tereško Well, perhaps...
 
3:53 AM
you CAN think of them as the "serverside cookies" .. they have quite similar limitations and uses
 
@tereško Yup
 
@ircmaxell It's a bit "overfeatured" for my tiny C library though :D
 
@Ozbekov Fair, but it's multi-project, so you could use it for everything (I have 3 installs that I use that for)
 
Well
that tells me I need more projects!
 
forge.moovum.com/repositories/entry/code-snippets/… <-- The first bit of Ruby/ROR code that I ever wrote...
 
3:57 AM
Looks a lot like Python - I've never coded Ruby.
 
@Ozbekov It's similar in some respects
 
I'm not a great big fan of scripting languages.
 
ok ... related question , if i have hierarchical structure for the application ( subcontrollers , hmvc ) , it seems like a good idea to have a choice how to deal with Request object ( use the one provided , create another , swap them ) , but that mandates another factory inside the controller .. and if i go with request/response pair - even two factories ( or same one , with just two methods ) .. do you have any comments on this ?
 
(This includes PHP :-P)
 
because as it stands now , my controller instance is already provided with 3 different factories ...
 
3:58 AM
@Ozbekov Define scripting languages...
 
@ircmaxell Ruby, Python, Perl, PHP
 
my architecture is suffering from Factoritis
 
Shell scripting
 
@tereško I'm a little blurry there, as I've never really implemented a full HMVC style app in code. I've thought about it quite a bit, but not fully
@Ozbekov You count JIT powered languages?
 
@tereško You'll need 20mg of Refactorizon daily.
 
4:00 AM
meaning where's the line between scripting language and everything else?
 
@Ozbekov you cannot treat alcoholism with more booze
 
@tereško Yeah, you might want to think on that... I try to keep the number of factories to one per package... And since in my code the MVC classes are in the same package, they have the same factory (usually)
 
@ircmaxell That's a very good question actually.
 
Yeah, with PYPY's recent advances, I'm not sure it fits in either category nicely
 
@ircmaxell I would define it as: the kind-of-front-end of computer applications, where the core features are implemented by compiled executable binaries and the scripts that control these features are implemented in scripts
Scripts are easily modifiable.
 
4:03 AM
@ircmaxell then there is the problem of "how to call it"
 
@Ozbekov Well, but I compile pypy via cpython (which is compiled C). But then pypy runs as a native binary, which then JITs other python code
 
Yes, but is "pure python" compiled?
 
What do you mean "pure"?
 
It's not. And cpython and pypy are additional modules right?
 
so I'm not sure where the line is anymore. I guess you could call static compilation vs everything else.
 
4:05 AM
Pure, meaning as you download from the python.org website.
Without anything added to it besides the library that comes with it.
 
@Ozbekov No, cpython is an implementation of the language in C, and PyPy is an implementation in python
 
@ircmaxell For an admin, WordPress offers customizability - admins can add plugins without getting developers involved. Developers, well, they get their workload reduced.
 
@Nitin I raise the BS flag right there. We're fighting it where I work, because WP offers little to no support for large scale development. In fact, automatic told us to hack core because there's no support for multiple environments (dev/qa/stage/production). So there's no support for developers. It gives a good user experience, but a crap dev experience
3
@Ozbekov I could argue that C would fit that description as well
I'm not going to, but I could...
 
@ircmaxell I agree with you on the fact that there is no solid line between them. It's also just a preference of mine, to write in C/C++ :-P
 
@Ozbekov Cool. We all have our preferences. I want to get back into C more, but have no drive to get back into C++
 
4:09 AM
@ircmaxell I like them both. After "the J-word" they feel so much better.
 
Afternoon everyone!
is there anyway to extend SplFixedArray to use string key's ?
 
@OmeidHerat No
and you don't want to
 
or maybe an alternative fixed array that allows string ?
 
@OmeidHerat They are called array(). Why not use it?
@Ozbekov I don't have anything particular against Java. My only issue with it is the same as with C++: the fact that their object model is really bastardized to the point they almost force you to write either really tightly coupled code or lasagna code. (it's hard to write lean and clean code without many layers)
 
I agree with you on that. Far too many amateur devs out there who call themselves web developers but don't understand CSS.

However, it isn't evil to recommend DreamWeaver to clients who want to edit static HTML/CSS - clients aren't always developers.
 
4:11 AM
@ircmaxell I really need to limit the size but I thought there might be something prettier then using count and OutOfRangeException.
@ircmaxell array() is not fixed. no way.
 
@ircmaxell I understand that. My only problem with Java is the fact that it has a terrible performance. Many not so much to the end-user side, but even loading a simple 1 MB file is very different in Java and C.
@ircmaxell Do you specialize in web development?
 
@OmeidHerat extend ArrayObject and override the methods that add new values
 
@Ozbekov that is not true anymore, it's heaps faster then what it was. but you can't compare a low level language like C to something that runs over a VM.
 
@Ozbekov Really, it's not that bad. It has overhead, sure. But with the JIT, performance of certain operations can be faster than C (sometimes significantly)
 
@Nitin letting client to edit HTML/CSS is always a stupid move, and recommending DreamWeaver adds just another layer of stupidity , because client will use drag-n-drop
 
4:13 AM
@Ozbekov For the past 5 or 6 years, yes
 
@OmeidHerat Do you know if you can allocate memory dynamically in Java? I have never used it, I'm not aware if java is capable of this.
 
@Ozbekov Yes, I totally agree with you on that - static HTML pages involve quite a bit of copy-paste for the site header and footer, and perhaps even the sidebar if there is one. For up to 4-5 pages, I'm totally cool with handing out static pages. Beyond that, it turns to madness to have to update each of the pages to add a link.
 
@Ozbekov No, it's managed for you, so it takes care of it for you
which is typically the cause of some of its performance problems
 
@ircmaxell I wonder the difference between C and C++ memory allocation overhead and Java
So 1 byte of dynamically allocated memory creates how much overhead in bytes, in both those systems.
 
@Ozbekov Fact: Java Objects are all allocated dynamically.
 
4:15 AM
Using a standard compiler, gcc g++
 
@tereško Yes, that's a risk the client takes. If they don't have the budget for a CMS, they either pay for the edits or use a WYSIWYG editor for the updates.
 
@OmeidHerat Yes but can you dynamically allocate memory using a function like malloc in C?
 
gosh... is PEAR still being used?
 
@Ozbekov Sure, there's overhead. But if you need to squeeze every last bit out of it, you better be using either C or assembler
@Ozbekov No
 
@ircmaxell Great! Thanks! I will give a try and see if can do anything with it.
 
4:15 AM
it's so outdated
 
@Phelios No it's not
 
how about PHPUnit?
 
@Ozbekov Have you looked at Mantis BT? It's a PHP-based bug tracking system.
 
I tried mantis and walked away imediately
 
@Phelios , that is the only thing i use it for .. ok PHPMD too
 
4:17 AM
@Nitin Yes, and I didn't like it a lot. I want something like the PHP's community notes below documentation
 
@Phelios are you trying to make a point, as a question, or just troll?
 
@ircmaxell Why? Too colorful :-P? It does show important issues right there on the 'dashboard' and it's written in PHP so if that's your scripting language of choice, you could go with it.
 
@Ozbekov I don't know that. but thumb rule: Don't speak French in English. If A is done with Method N in Lang X that doesn't mean in Lang Y A should/can be done with Method N as well.
 
@Nitin No, riddled with bugs, pita to maintain, really not thoughtfully designed, horrid interface, etc
 
I'm not sure if I'm trolling, but if it is a troll, I'm sure I'm not intending to do that at all.
:)
 
4:18 AM
@OmeidHerat I didn't say that. I'm just asking if it's possible.
 
@Ozbekov I don't get what you mean by "PHP's community notes". Do you mean something like the the comments below the php.net function specs?
 
@Nitin I'm a developer. To me, language is just an implementation detail. If I need to modify code in a language I've never written, it's pretty much just figuring out the syntax and done...
 
I was just trying to learn PHPUnit and stuck with the old PEAR documentation
 
@Nitin Yeah
 
@Ozbekov I know :) what I just mentioned in case.
 
@ircmaxell I agree. I often switch between VB, Java, and PHP. I recently tried LibertyBasic too.
 
thanks
 
@Nitin Now when you say VB...
 
lol
 
I was taught VB in high school.
I was traumatized.
 
4:23 AM
@Ozbekov Visual Basic .NET... sometimes have to maintain code written by other folk
 
@Ozbekov i was taught QBasic .. don't talk to me about trauma
 
@Ozbekov Was it Visual Basic or QBasic/GW-Basic?
 
I started with QBasic actually, when I was 12.
 
qbasic, and VB here. Although I literally wound up teaching both classes (because I knew more than the teacher)
 
@tereško There was a predecessor/variant of QBasic named QuickBasic. It could generate executable files and link to libraries too.
@Ozbekov Do you remember the ABC (All-Basic Code) packets? They were distributed on SimTel.
 
4:26 AM
@ircmaxell , hell i ended up doing that in university too , for the C# class , because teacher there was able only to read the slides
 
@ircmaxell They are both good introductory languages for people who aren't going to be computer scientists.
@Nitin I was born in 1991, so... I don't know bout them.
 
@tereško "Those who can do will do. The others teach." :-D
2
 
@Ozbekov Agree, but by that point I was actually writing in C++ and playing around with Java
 
Sorry, I can't hand out any more stars. I ran out of my vote allowance.
 
It always amazes me. Some of the young people here are so freaking good it scares me.
 
4:29 AM
@ircmaxell and @Ozbekov : You've got most of my stars today
 
;-)
 
Thanks
 
really wish there was some way you could document json files
 
fuck , i blame you @ircmaxell , now i will have to reread all the stuff about HTTP protocol
 
What is the easiest way to check the source of an internal classes in PHP ? like say an SPL class?
 
4:35 AM
@tereško :-D
@OmeidHerat Source? As in C?
Ok, I'm off to bed. Have a good one everyone
 
maybe i should give up and make another codeigniter fork
 
Alright - so I'm writing my first user-input PHP script in a year.
Can you guys remind me the basic steps to avoid SQL injection?
 
use prepared statements
use correct encoding
 
Encoding UTF-8. I will also have to convert HTML entities.
 
do not concat data into SQL query
@Ozbekov , no , you don't
 
4:38 AM
No? What happens if user types in "<" or ">"
Don't I have to convert them to &lt;?
 
learn either PDO or MySQLi and leanr how to use prepared statements
 
@tereško OK.
 
Ah sweeeeeet
 
@ircmaxell , your slides look broken on SumatraPDF , for some strange reason
 
4:49 AM
How would you create an Array Interface-ish ?
aight got it, array_keys($interface) == array_keys($instance).
 
9
Q: Policing of USB Vendor IDs

OzbekovAlthough not directly a programming question, I think I could find the best answer here. Why is the USB-IF policing the use of Vendor IDs and selling them? What happens to people who want to write open-source drivers or smaller companies where $2,000 would be a great impact? What happens if you...

I'd love to hear your comments on that question.
Or a good answer is welcome, if you have one.
 
5:45 AM
@OmeidHerat If you want to know about the internals of the SPL, they are definitely written in C. However, as someone trying to patch part of the SPL, I'll tell you that it isn't pretty. Shoot me a message about what you want and perhaps I can help you when I get your message.
 
6:10 AM
hi everyone
 
Hi
@LeviMorrison I am trying to Implement a FixedArray like SplFixedArray but I am defintally not going to patch SPL or anything I was just wanted to see how it's implemented.
 
> The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).
 
@tereško Huh ? the first line shouldn't be ...manages the representation of data.... ?
 
does this mean that the Model layer actively communicate back to Controller ? @ircmaxell , @Gordon , @salathe , @edorian
and why would it "manage the representation" ?!? That sounds like somwthing ViewModel does in MVVM pattern
2
 
Wait No.... I thought it said the view manages the behivour.... /faceplam
 
6:23 AM
<_<
 
 
1 hour later…
7:53 AM
For making more efficient systems, what PHP needs is the ability to say "run this for each request" and "run this when mod_php is started the first time". That would help avoid some of the overhead that many PHP systems have.
 
8:18 AM
@tereško Models are agnostic of the delivery mechanism. They are not even aware there is something like a "Controller" in your application
@OmeidHerat Why wth?
 
8:41 AM
@edorian I am using that a lot, and I don't see why would they drop that ?
 
Because at the end of 2001 (When PHP 4.1 was released) it was decided that they are not going to copy ALL something_function functions over and make something_method functions that do the same thing expect for methods
But that all *_function functions can also operate on methods
 
well they have deprecated something_method not something_function :?
 
And given that that was 10 years ago and pretty much no open source code has ever used call_user_method it was fine to revert that initial PHP 4.0 decision
 
even if somethingA_function and somethingA_method does the same thing they should keep it I reckon, it makes code more readable. There is heaps of alias in PHP anyways.
 
It's inconsistent and arcane to leave it around. It serves no purpose and works differntly then passing method references works in the rest of the language
Imho it should have been thrown out a lot earlier. 5.0 at latest. But well PHP is BC for a very long time
And since all code that used that function errored out for over 4 years now it's fine to throw it out :)
 
8:48 AM
@edorian I don't get the second part, How is it doing things differently ?
but that is why better then $this->$DynamicCall
 
Everything else in the language always takes a method references in the form: array($object, 'method); just that one little old function has 2 parameters
 
I see, but what about 'method_exists' 'param_exists' ?
and I am sure there is lots more.
 
you mean property_exists? There was no function that did that before and there is no generic way of referencing properties
method_exist can be argued about, yeah. Apart from that I'm not aware of anything else that only works on methods and not on functions (that could operate on both)
 
oh well, if the issue was the arguments they could have add the arrray(object,method) way and keep the old way for legacy support. I have lots of functions that supports both ways or even supports swapping the parameter position for historic reasons :)
 
9:03 AM
hi
 
By the way, is it a bad idea if your router calls the controller instead of bootstrap ?
 
Well they kept it for 10 years after deprecating and throwing around E_DEPRECATED errors for over 4 years :) I guess thats fair for BC ;)
@OmeidHerat It's not all that uncommon even so one could argue that it's not the job of the router to execute the controllers. So a little semantic issue but not a big problem
 
@edorian Fair enough.
 
@GauravSharma Greetings!
@GauravSharma What PHP framework do you use?
 
9:11 AM
@OmeidHerat Maybe consider introducing a en.wikipedia.org/wiki/Front_Controller_pattern front controller. Sample implementation: github.com/thePHPcc/bankaccount/blob/master/src/framework/…
 
@Nitin nitin I try not to use a framework...mainly pure PHP
 
@GauravSharma I've had a preference to code without a framework because of the overhead. However, that's changed recently.
 
@edorian Thanks, that sounds way better then a messy bootstrap.
 
@Nitin My main reason not to use a framework is cause I've not needed to use it in any project at work..i've heard good things about CakePHP though
 
@GauravSharma CodeIgniter has been more popular than CakePHP recently. There still is a lot of CakePHP code around, though.
 
9:16 AM
@Nitin agreed
 
@GauravSharma What kind of stuff do you work on?
 
9:44 AM
Quick question: I have two date objects, and I want to check if any given date (there's no times, only dates) is between the two dates, including the end and begin date!
 
@sinni800 that's not a question.
 
@tereško huh?
@salathe it would be so nice if DatePeriod had a between or contains method
 
@salathe Ha, honestly, it isn't. Let me give you a question: How do I do that without inducing any troubly dates?
 
@sinni800 what's a "troubly date" ?
 
I heard that PHP has a default time value if no time value is specified
And I don't know how that affects it
 
9:48 AM
affects what?
 
@sinni800 you can simply compare DateTime objcect with $datetime < $yourdate or $yourdate > $datetime
 
A comparison by, for example, ticks
That's what I just wanted to ask, is DateTime comparable? It seemingly is.
 
@sinni800 yes. it is
 
I think I am way too tired this morning
I can't even phrase an understandable question on the first try. Thanks, @Gordon
 
@Gordon sup
 
9:54 AM
@edorian recovering from night shift. injecting coffee
 
whats all this about newtwitter?
 
Things look different again
Change, you know
 
looks the same to me
do i have to login? i never do that
 
Yeah. Your stream looks differnt
And they reworked mentions and favs and retweeted notifications and so on.
 
10:02 AM
@edorian eh, meh
 
"meh" sums it up pretty much, yes
http://www.ppi.io/ If you put the SO logo there one could assume there was at least one php question tagged with that tag :P
 
@edorian , i know if, that's why i asked
the paper seemed to imply that some information is returned to the controller
 
I missed the "oldschool mvc" reference. Though you where talking about WebMVC
 
naah .. i reading through the old papers
 
10:34 AM
Anyone knows of a nifty tool to document PHP code without having to write all the /* *\ comments all the time? Like, choose the function from a GUI, enter the info and go on. It would also be awesome if it copied my @author mark into every file
I found one online, nevkontakte.org.ru/docwriter/index.php, but that's uploading the file, editing the doc and downloading it again
 
11:04 AM
hi
 
hello
 
Hey there: why doesn't following work :
$foo = new Foo(); $className = 'Foo';
if($foo instanceof Foo)  echo 'Works';
if($foo instanceof $className) echo 'This should work too';
But when the Foo is declared in a different namespace, and we have a use statement, it doesn't work. So following doesn't work:
namespace Bar;
class Foo { }
namespace Baz;
use Bar\Foo;
$foo = new Foo(); $className = 'Foo';
if($foo instanceof Foo)  echo 'Works';
if($foo instanceof $className) echo 'This should work too'; // <-- but it doesn't work
 
because in the $foo instanceof Foo you should notice that Foo is NOT a string
Foo i a class name , within a namespace
 
Hmm, so this man page example 6, doesn't really specify if it should work with namespace or not
 
posted on December 12, 2011 by PHP Advent

It’s Christmas time again. While you write the first lines of your shiny new authentication library, the smell of tasty cookies is slowly sneaking into your room. The few minutes until they are finished is a good time to lean back and think about cookies — not the ones in the kitchen, but the cookies in your browser. Let’s explore how to securely store data on the client side, and how to dete

posted on December 12, 2011 by Bradley Holt

I’m excited to be able to announce that the first ever Boston PHP Northeast Conference will be taking place on Saturday, August 11th and Sunday, August 12th at Microsoft’s NERD Center in Cambridge, MA. This regional event is intended for PHP beginners, enthusiasts, and professionals alike. The current plan is to have four tracks: Core PHP Web Development Training User Experience (UX) Boston

posted on December 13, 2011 by Brian DeShong

This is the first in what I hope to be a multi-part series on using Magento.  I’ve been working with it since June to run one of our core sites at Half Off Depot. During these six months, we have: Built an incredible team Had our application servers swap to disk and otherwise go belly up, on numerous occasions Moved from FastCGI back to mod_php Tuned Apache a bit to squeeze more out of our ap

posted on December 13, 2011 by PHP Advent

Everyone talks about automated testing for your code, but that’s only half of the testing I need. What about the front end? Forms need some testing love, too, and SimpleTest is how I get it. SimpleTest is very easy to install. Just download the latest version, upload it to your server, then unzip it. That’s it! Now you can get started writing tests. SimpleTest can handle all of the unit tes

posted on December 13, 2011 by PHP: Hypertext Preprocessor

The PHP development team is proud to announce the third release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the third release candidate. The release candidate phase is intended as a period of bug fix

posted on December 13, 2011 by Ulf Wendel

Christmas time, time for presents! Version 1.2.0-alpha of the free and open source PHP mysqlnd replication and load balancing plugin has been made available on PECL. PECL/mysqlnd_ms makes using any kind of MySQL database cluster easier featuring: Read-write splitting: automatic, SQL hints, can be disabled Load balancing: random, round robin, ...

posted on December 14, 2011 by Maggie Nelson

PHP Advent 2011: Out with the Old, In with the... Old?: Hey, I’m in this year’s PHP Advent! Check out some MySQL goodness and how it’s changed over the years!

posted on December 14, 2011 by PHP Advent

A little over a year ago I was plunged into a nightmare world. I had accepted a new job as the lone PHP developer at a relatively small business, and when I finally got my hands on the code, I realized I’d gotten myself into a giant mess. While I’m happy at my job today, my first months were filled with disbelief, horror, anguish, doubt, and despair as I began to dig into the legacy codebase I

posted on December 14, 2011 by Mayflower Blog - PHP

In this article I’d like to compare Backbone, Knockout and JavaScriptMVC under the following points: documentation installation understanding complexity for what kind of project So let’s start with Backbone. The documentation of Backbone is available under the following link. The complete documentation is written on a single page. Its very easy to search for topics you are inte

posted on December 15, 2011 by PHP Classes

Can .NET make PHP run faster than the official PHP implementation? By Manuel Lemos Phalanger is compiler that generates .NET assemblies from PHP code, so it runs in a .NET virtual machine. The latest benchmarks seem to indicate that PHP applications compiled by Phalanger execute noticeably faster than when they are executed by the official PHP implementation based on Zend engine, even whe

 
11:16 AM
if $className = 'Bar\Foo' then it will work, right @tereško ?
 
maybe
imo all that code looks hack'ish
 
@tereško so how will you validate if the argument passed is indeed an object of a particular class? (the arguments are wrapped in an associative array)
just so you know that I have thought about Type Hinting
 
hi
actually i am embedding javascript code in php variable
but its not working what might be the issue
see my example code
$html .= " <div id=\"footadscontainer\">
<div id=\"bottomads\" >
<script type=\"text/javascript\">document.write(\"<iframe src='http://www.epicgameads.com/ads/banneriframe.php?id=yeA5z58737&t=728x90&channel=2&cb=\" + (Math.floor(Math.random()*99999) + new Date().getTime()) + \"' style='width:728px;height:90px;' frameborder='0' scrolling='no'></iframe>\");</script></div>
</div>
";
 
@phphunger why aren't you simply using single quotes inside the double quotes?
in any case, "it's not working" doesn't really work as a problem definition
 
@tereško so, looks like I have no other alternative but to actually use the full namespaced class name, That immediately renders my use statements useless. But I have to do it
 
11:30 AM
actually its a ad code
we are not supposed to change it..i guess
@JohnP: actually its a ad code
we are not supposed to change it..i guess
 
@phphunger if you can't change it, ask a person who can , and tell him that its not working :)
 
@phphunger there's nothing wrong with it per say. It works for me
shows some game ads
 
@Sudhi .. well .. you could , you know , like explain what is the thing you know , with which you want to do stuff
 
@JohnP : actually its working in localhost but when i upload it on the server the entire website is not loading
 
You can rest assured that the ad code is not the problem then.
most likely
 
11:35 AM
@tereško hehe, true. But can I redirect your attention to the $foo instanceof $classNameInTheNamespace problem I have, any thoughts ? Or do you still think its hack'ish ?
 
ok..then as per your experience what could be the reason for not working
 
yes , i think it looks like an ugly hack
 
@tereško then how would you tackle to problem (quote) " validate if the argument passed is indeed an object of a particular class? The arguments are wrapped in an associative array so no Type Hinting "
 
that sounds like design mistake
 
//how about following hack:
$className = ($obj instanceof 'StdClass') ? get_class($obj) : '';
if(! empty($className)) {
    return TRUE;//check if your class name string is part of the namespaced class name: $className
}
@tereško yeah, I have to deal with it
but if you are so keen on knowing the design, then its a Command pattern where in I declare the abstract function execute(array $args) so I can pass different arguments to different commands encapsulated in the array
nah, my above hack wont work either, as I can do use Bar\Foo1 as Baz and get_class(new Baz()) will return 'Bar\Foo1' and I will get false by comparing it with 'Baz' :(
well, if I had not wrapped it in the array, and go ahead with type hinting, I would have still need to use the namespaced class name somewhere in the code. So I might as well use it in the instanceof operator. Its not a problem if you get the concept behind it
All I need to take care is to use my interface names and not actual class names thats all
 

« first day (425 days earlier)      last day (4506 days later) »