|
Mister Chief posted:Try: Perfect, thank you
|
# ? Aug 6, 2013 09:38 |
|
|
# ? Jun 8, 2024 07:11 |
|
Experto Crede posted:Perfect, thank you Don't ever just echo user input though, that's just cruisin' for a bruisin'.
|
# ? Aug 6, 2013 12:18 |
|
Experto Crede posted:Perfect, thank you You should look into http://us3.php.net/http_build_query if you're going to be doing anything with that data like using it for GET parameters on a subsequent request.
|
# ? Aug 6, 2013 13:41 |
|
Does anybody know a way to get PHP Codesniffer to care about php doc blocks? I tried some squizz sniffs but they were way too strict or something. phpcs works great for PSR-2 but doesn't care how you write comments.
|
# ? Aug 7, 2013 01:40 |
|
Anyone know how you set the default php.ini directory on windows? I am tearing my hair out! It thinks it is in C:\Windows but it is not. I can't find a registry entry for it either.
|
# ? Aug 8, 2013 12:55 |
|
jiggerypokery posted:Anyone know how you set the default php.ini directory on windows? I am tearing my hair out! It thinks it is in C:\Windows but it is not. I can't find a registry entry for it either. This might help (3rd and 4th entries).
|
# ? Aug 8, 2013 14:03 |
|
I'm working on wordpress, but I think this may be php related. On the code below, I'm getting a Call to undefined function on line 3, "getItems($items)". I googled and I found that I should be calling it like this "$this->getItems($items);", but that still gives me the same error. Any help is appreciated. code:
|
# ? Aug 12, 2013 01:03 |
|
stoops posted:I'm working on wordpress, but I think this may be php related. No, you do not use $this. http://www.php.net/manual/en/language.oop5.basic.php posted:The pseudo-variable $this is available when a method is called from within an object context. $this is a reference to the calling object (usually the object to which the method belongs, but possibly another object, if the method is called statically from the context of a secondary object). The code works fine when run via PHP so perhaps Wordpress is doing something weird with including that code?
|
# ? Aug 12, 2013 01:25 |
|
e:f,b
|
# ? Aug 12, 2013 01:25 |
|
spacebard posted:No, you do not use $this. Yeah, something weird was happening in wordpress. I ended up putting the function in a class php file and it worked fine.
|
# ? Aug 12, 2013 13:52 |
|
I'm writing a book on building advanced web applications using Symfony, Doctrine, Postgres, and Redis: https://advancedwebappsbook.com/ Essentially the book will talk about how to properly layout a complex Symfony project, how to test it (using unit and functional testing), and how to deploy it. The book will go through a single project (building a REST API with admin panel) from scratch. I have a pre-sale for the book now. If you're interested or have any questions, please let me know.
|
# ? Aug 19, 2013 19:01 |
|
musclecoder posted:I'm writing a book on building advanced web applications using Symfony, Doctrine, Postgres, and Redis: https://advancedwebappsbook.com/ quote:When the book is published, what exactly will I receive?
|
# ? Aug 19, 2013 19:11 |
|
DarkLotus posted:We're all friends here right? Seriously though, this is very cool. I may bite, I've wanted to learn Symfony and some of the online tutorials are not so great. Cool! Yeah I'm excited/nervous/anxious about it, but I know it will be a really great product. And I've spent countless hours going through Stackoverflow posts and blog posts from 2011 trying to figure stuff out only to have to dig down into the Symfony internals to finally get it. The Symfony docs themselves are decent and will get you a good understanding of the framework. But, when it comes to obscure configuration settings or knowing how to set up a project properly, they're pretty lacking.
|
# ? Aug 19, 2013 19:20 |
|
musclecoder posted:Cool! Yeah I'm excited/nervous/anxious about it, but I know it will be a really great product. Symfony gets a lot of love for big projects, but the steep learning curve has kept me away from it. If your book can make it easier to get something started in Symfony then it's something that I am looking forward to. Of course, my boss hates all 3rd party libraries, so it might have to be just for personal projects for a while...
|
# ? Aug 20, 2013 19:15 |
|
PlesantDilemma posted:Symfony gets a lot of love for big projects, but the steep learning curve has kept me away from it. If your book can make it easier to get something started in Symfony then it's something that I am looking forward to. Well, if you're a Symfony beginner I recommend you follow the online documentation. It does a good enough job of getting you to build a basic app. Getting started with Symfony is easy enough. 1) Install Composer - http://getcomposer.org/download/ 2) Install Symfony code:
code:
My book is more aimed at people who have some Symfony experience or people who want to become better web application developers. I'll discuss testing, deploying, and queuing, which can be applied to any application regardless of framework.
|
# ? Aug 20, 2013 20:31 |
|
revmoo posted:Does anybody know a way to get PHP Codesniffer to care about php doc blocks? I tried some squizz sniffs but they were way too strict or something. phpcs works great for PSR-2 but doesn't care how you write comments. In my ruleset.xml I have the following: code:
|
# ? Aug 20, 2013 23:23 |
|
A few updates regarding my book post from above. 1) I've lowered the pre-sale price to $19.00 to spur sales. The final price will be $39.00. There are some chapters of this book I could see charging $19 for them alone, so I think the pre-sale price is definitely worth it. 2) I've added the table of contents. If you have any questions, let me know. I won't bug the thread much more until the book is actually released. Thanks! Edit: Released the first 2 chapters and TOC of the book - TOC, Chapter 1, Chapter 2 musclecoder fucked around with this message at 20:02 on Aug 29, 2013 |
# ? Aug 23, 2013 21:27 |
|
Anyone know of a way to flush session data to the session file without waiting for the PHP script to end? I see session_write_close in the docs but that also closes the session. Anyone know of another function or maybe an extension that will do this? We are using the default session handler that just writes to files.
|
# ? Sep 13, 2013 20:47 |
|
Because session data isn't actually just normal serialized data, the only 100% reliable way to get it is going to be through session_write_close. I mean you could fake it by hand but that would be a dangerous disaster in the making. Have you tried opening the session back up after closing it? It could work. Could. If you need to begin persisting session-ish data more frequently than once per request, you really probably want to do so manually on a case-by-case basis to a datastore that's intended for such a use case.
|
# ? Sep 15, 2013 08:27 |
|
Has anyone worked with Laravel and seen the artisan tool just break? I've been working on a project for a couple hours and suddenly trying to run any artisan commands dumps an HTML error page to my terminal. Everything was working fine up to this point, and as far as I know I haven't touched anything that would cause that to happen. I've removed the bootstrap/compiled.php file and my vendor folder and re-run composer install --no-scripts (there are some hooks in my composer.json which run artisan commands, so running without --no-scripts gives me the same errors) which reinstalls everything, but doesn't fix the problem with artisan.
|
# ? Sep 15, 2013 20:33 |
|
Since Artisan runs through the Laravel core something that breaks your site will usually break Artisan too. I'd say check the error page and see what it's complaining about.
|
# ? Sep 15, 2013 20:43 |
|
Turns out I broke routes.php. Badly. Really glad I threw this thing in version control. Thanks so much, didn't realize artisan was that tied-in.
|
# ? Sep 15, 2013 20:57 |
|
I bought a script which is an 'SEO tool', and it's supposed to give a domain's page position on google based on a keyword. However, it's broken and I don't think it's working because the URL format used for the google search query looks outdated. Is anyone good with with how the google search url works? check_search_position.php line 62 php:<? if($_GET['search_engine'.$l]=="google") { $url_page="http://www.google.com/search?hl=en&q=".urlencode($_GET[keyword])."&num=100&hl=en&lr=".$_GET[lr]. "&as_qdr=all&start=".$start."&sa=N"; $count = 100; //echo "<br>inlcude url:".$url_page; ?> the whole script can be found here https://dl.dropboxusercontent.com/u/40524/searchengine-position.rar here's the 'demo' of the script of their site http://www.selfseo.com/store/demos/tools/searchengine-position/ BobFossil fucked around with this message at 23:40 on Sep 15, 2013 |
# ? Sep 15, 2013 23:29 |
|
McGlockenshire posted:Because session data isn't actually just normal serialized data, the only 100% reliable way to get it is going to be through session_write_close. I mean you could fake it by hand but that would be a dangerous disaster in the making. Yeah, ended up writing my own simple thing do use the cache extension we got. But what do you mean by "session data isn't actually just normal serialized data", I thought that it was just a file dump of serialize($_SESSION) and php uses cookies to keep track of who it belongs to. What else is in there?
|
# ? Sep 16, 2013 04:48 |
|
Depressing Box posted:Since Artisan runs through the Laravel core something that breaks your site will usually break Artisan too. I'd say check the error page and see what it's complaining about. I love laravel, but its error handling makes me want to break things. That loving error handler is the most broken thing in the laravel stack, and that worries me.
|
# ? Sep 17, 2013 16:11 |
I need to get a Windows/Apache/PHP website to auto-authenticate with an external ADS Web Services setup to use SOAP/XML over HTTP. I've never done this before, and never have any of the people I work with. I've read up a whole bunch on mod_auth_kerb etc prior to being told that the AD guys would set up ADS Web Services. My biggest stumbling block right now is that I just don't quite understand how the website requests the current user's information to SEND to ADS WS to confirm, even if the website has been added into Trusted Sites by Group Policy. I know this is an Apache problem, not a PHP one, but I can't find an Apache thread. What should I be looking at? I have a bit of time before it needs to be set up but I'm just butting my head against this part of the process and not knowing where to look. e: Found something that looks promising: http://rc.quest.com/topics/mod_auth_vas/ Will research that soon. Sulla Faex fucked around with this message at 16:46 on Sep 23, 2013 |
|
# ? Sep 20, 2013 10:55 |
|
So, having just used PDO for the first time a couple of days ago, does setting PDO::ERRMODE_EXCEPTION mean that all those methods that might return FALSE will instead throw an exception? Because gently caress "if ($result !== FALSE)", bring on "try {the universe} catch ($everything)"
|
# ? Sep 23, 2013 17:57 |
|
Yes, but to be clear that's just the constant.php:<? PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); ?>
|
# ? Sep 23, 2013 20:40 |
|
Wheany posted:So, having just used PDO for the first time a couple of days ago, does setting PDO::ERRMODE_EXCEPTION mean that all those methods that might return FALSE will instead throw an exception? Only things that would return false on error would throw an exception. Things that return false when there is no data but when there isn't an error will continue to return false.
|
# ? Sep 24, 2013 03:05 |
|
McGlockenshire posted:Only things that would return false on error would throw an exception. Well, from a quick look, PSO::prepare, beginTransaction, commit, rollBack and PDOStatement::execute, fetch and fetchAll all return false on failure, and that is good enough for now at least.
|
# ? Sep 24, 2013 07:24 |
|
BobFossil posted:I bought a script which is an 'SEO tool', and it's supposed to give a domain's page position on google based on a keyword. This is both a ToS violation and you will get captcha'd or IP blocked. https://developers.google.com/custom-search/json-api/v1/overview While we're at it, that thing is so horrendously bad (not to mention the "inlcude url" bullshit).
|
# ? Sep 26, 2013 16:19 |
|
I'm looking for some kind of installer generator for Mac or PC, but preferably both that does the following: With the click of a button on some php backend webpage, and installer will be created that packages all the files from a directory. When you download the installer and launch it, it will put all these files in a predefined or chosen directory on your computer. It's okay if this costs money or has some license fee.
|
# ? Sep 30, 2013 17:56 |
|
For Windows you can probably shell out to NSIS from PHP from either Windows or a *nix. Mac installers are just disk images. It looks like you need to actually use a Mac to create them initially, but you might be able to mount and write to them under various Linuxes as well.
|
# ? Sep 30, 2013 19:25 |
|
Thank you McGlockenshire I'll look into both of those!
|
# ? Sep 30, 2013 19:36 |
|
I need some help getting started. I'm using WordPress for lawyerist.com. It's my own, custom theme. Here's what I'm trying to do: Loop 1: * If the post was published on or after Monday, publish it in Loop 1. * If the post is the most-recent post *and* it was published today, tag it with class="current". Loop 2: * If the post was published before Monday, publish it in Loop 2. Thanks in advance for any help you can give me. I'm cool with doing multiple loops. Mostly, I'm trying to figure out how to say "if the post was published on or after Monday" and "if the post was published before Monday" in PHP.
|
# ? Oct 1, 2013 14:28 |
|
Sorry I don't have an answer for you samglover but the Wordpress Megathread might also offer some help.
|
# ? Oct 1, 2013 19:37 |
|
Thanks. I didn't see that before. Between that thread and this one, maybe a PHP or WordPress genius can get me started.
|
# ? Oct 1, 2013 20:47 |
|
Perhaps not a PHP-specific question, but: I've got a bunch of records in a database that contains shipping information. In another table, I have invoice records that I have to match to these shipment records. The tricky part is that the information I need to identify a shipment is in one of three different fields in the invoice record - and I don't know which one. Not only that, but they can match either of two different fields in the shipment record. I have to do some work on the charge records, so I am pulling them into PHP as InvoiceEntities using an Invoice mapper class. However, to match them against their respective shipments, I'm currently doing something like: php:<? $conditions = []; $fieldOne = $invoice->getFieldOne(); if ($fieldOne) { $conditions[] = ['shipment.testFieldOne = ?' => $fieldOne]; $conditions[] = ['shipment.testFieldTwo = ?' => $fieldOne]; } ... foreach ($conditions as $condition) { $result = $this->adapter->select('shipment', $condition); if ($result) return $result; } ?>
|
# ? Oct 2, 2013 07:17 |
|
Why not just use a foreign key?
|
# ? Oct 2, 2013 08:02 |
|
|
# ? Jun 8, 2024 07:11 |
|
Vasja posted:Perhaps not a PHP-specific question, but: This sounds like something that should be taking place in the query/orm. You shouldn't be using PHP to meld multiple tables into one dataset unless you really have to.
|
# ? Oct 2, 2013 08:37 |