hey guys.. m stuckd with file write function in php.. there is a php script which opens an existing file in a mode, www-data is the owner of that folder. m getting permission denied error for opening that file. i don hav to change the code.. so i cant use chmod or chown functions..
Is someone here working with drupal, I am using a Webform and I want to use as default value the profile information field tokens. How can I use them? Currently I have only the possibility to parse the %email token.
@Leri ofcourse it's worth it. You'll be so flexible and able to go anywhere you wanna go.. It sucks you failed, twice, but many people did the same. Go try again!
@vascowhite: thanks for reply, actually i have some file uploaded on my server, now on click of those link i want to open them in browser tab, i wrote a code to download it, but i want to open it in another tab of browser.
this makes no sense to me, I think this should be more strictly handled. E.g. there is no reason to invoke a callback for an invalid classname or is there some reason?
@Leri I wish I had started driving when I came out of school too, but on the other side, I got a great job, many friends got a drivers license but are not able to buy a car because of no job..
The [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* regex only applies when the name is used directly in some special syntactical element. Some examples:
$varName // <-- varName needs to satisfy the regex
$foo->propertyName // <-- propertyName needs to satisfy the regex
class ClassName {} // <...
I need to replace some chars in the columns of a table, by using the REPLACE command.
I know that the REPLACE command needs a column name, then the text to change (in the following example, the 'a' char) and the new text (in the following case, the 'e' char).
UPDATE my_table SET my_column = REP...
@Leri but to be serious, if you're not feeling to well, why won't you ask if you can go?... I would do the same! Actually, I'm chatting on SO instead of doing work...
I have used the json post for form submit to a php page.In json request russian characters are showing correctly(checked in firebug console).but in php $_POST it shows like this "%u041F%u0440%u043E%u0441%u043C%u043E%u0442%u0440".
Added the utf-8 meta tag.saved the file as utf-8.but still it...
@JoelKidd If I were in your position, and had exhausted all other options, I would look at that because it's the only difference I could see. Maybe nothing to do with it, but as a last resort, worth the check
There needs to be some better MVC tutorials/blogs out there for PHP. I know language is not the concern of a pattern but still it's easier to relate to.
@hakre i cant change the code.. m workin on my local host.. so file permisiions i can change.after a file is created in some folder owned by www-data.. another script is tryin to access that file. shall i change the owner of that oflder..?
@DaveRandom Seems like it's a step up from sending flat images over the wire though, still shocking that it's this complicated to do something that in 2013 should be so simple
@Jimbo Indeed. Websockets are inherently not great for streaming tbh because of the overheads of the stupid framing layer, you either end up with a lot of transport overhead or a huge lag/startup time
@Fabien No. Firstly, the model is a layer - which contains services, domain objects etc. So, you Dependency Inject both your view and services into your Controller.
@Fabien Your view is usually the end of the line. You create your controller, DI your services from the model layer and view into the controller, you talk from controller to service, then controller to view to render template
@Fabien If you want to make an AJAX call, this is still treated like a normal request - ie it hits the controller, which has all it requires Dependency Injected, and returns data via the view
@DaveRandom because i already have a $this->name = $name;, but i need to map it to another array ($fields, from another system) but it has a new set of keys.. my concern is that i am just repeating all of the mapping again which i think make the code bloat with lots of dupe code
@reikyoushin There is literally no functional difference between $this->name = $fields['name2'] = $name; and $this->name = $name; $fields['name2'] = $name; and $this->name = $name; $fields['name2'] = $this->name; - all 3 do the exact same thing.
The php-errors has been recently added as synonym to php.
It was working pretty well in the past to find related content when you tagged some component (e.g. like phpunit or simplexml) with it.
This benefit is now gone. Most often with errors related if not duplicate questions are easily spotte...
@DaveRandom problem is, there are almost 30 fields on that array.. so i think its cleaner if i do ` $this->name = $fields['name2'] = $name;` 30 times than doing all $this->name = $name; 30 times, then doing another $fields['name2'] = $this->name; 30 times again.. what do you think?
@DarkAshelin the object fields and the array fields differ, since its from another system.. i am just trying to map em 1:1, so i can't loop em up. and if i will loop em, isnt it better to just use toArray() then?
@DanLugg yes, i'm porting my system to another system.. its more of a 'i have my own DB, and i need to insert into the other system's db too just so the other system (the old one) will still see the changes on the new one'
You can probably simplify things by writing a mapping routine, and centralize the field reassignment, but other than that you're probably stuck doing it by hand.
Anyone know of a good free alternative to SoapUI? There recent releases have gotten too heavy for me. Just looking for something simple to test webservices with
guys, one question.. since people say the model contains the datamappers, does that mean i should pass from the controller the POST variables to the model and let the model handle it?
@Jack right now, i instantiate a domain object in the controller and map everything.. but they say i need to map inside the model layer, in this case the domain object, no?
@Jack yeah thats what they say.. but my controller does the mapping, so how do i make it so that i can transfer the mapping to the model layer? what i'm thinking is to pass it to the domain object.. or do i make sense? i'm still new to these terms so please bear with me
@Jack uhmm i didn't get it. isnt it the ORM binding it to the DB? now my question is should I (and how do I) move the mapping to the Lead object instead of the controller
@reikyoushin It's like Array.some() for JavaScript.
I was actually going to propose a hack for array_sum() and array_product(), which mathematically can do the same thing, but that wasn't going to work out.