|
Ok thats not too insane. You should be able to get someone to do that. I won't speculate on price, but fixing placement/dimensions simplifies a lot.
|
# ? Apr 15, 2017 01:15 |
|
|
# ? Jun 5, 2024 00:38 |
|
revmoo posted:Ok thats not too insane. You should be able to get someone to do that. I won't speculate on price, but fixing placement/dimensions simplifies a lot. Yeah, all the options should be static, nothing dynamic besides the text.
|
# ? Apr 15, 2017 01:17 |
|
Anyone know how to do a function call that is a combination of class properties, a method call, AND parameters that exists in a string? Neither eval() or call_user_func () appear to work. e: nm. Literally just figured it out, you have to pull your result variable INSIDE the string, not from the eval() call. ( and yes I know eval() is dangerous, this is internal framework code. revmoo fucked around with this message at 17:15 on Apr 20, 2017 |
# ? Apr 20, 2017 17:12 |
|
You're going to have to explain that more, it sounds like you've designed a monster. Even on internal framework code, there has to be a better way to do whatever it is you're doing without having to eval().
|
# ? Apr 20, 2017 17:42 |
|
McGlockenshire posted:You're going to have to explain that more, it sounds like you've designed a monster. I'm adding a 'remote' data capability currently which is another of the 20 or so attributes a form element can contain. The first one I'm adding points to a PHP API wrapper to an industry-specific API written as a Laravel class. API method calls map (sorta) to postgres columns, combined with xpath selectors. So you'd call "$api->thing->otherthing->filter('//xpath/goes/here')->get(); I needed to be able to put in my JSON element definition a line like: "remote_api": "thing->otherthing('//xpath/goes/here')" to, for example, populate a dropdown with remote API data. McGlockenshire posted:Even on internal framework code, there has to be a better way to do whatever it is you're doing without having to eval(). I'm all open to suggestions. Since this is an internal-use-only app, and only admins can edit form definitions, it doesn't feel like there's a whole lot of attack surface, but I would LOVE to find another way to do this. I'm all ears.
|
# ? Apr 20, 2017 18:17 |
|
I'm possibly completely misunderstanding this, but couldn't you just build an array and return it with json_encode() or whatever Laravel's JsonResponse object is?php:<? return json_encode([ 'remote_api' => $api->thing->otherthing->filter('//xpath/goes/here')->get() ]); ?>
|
# ? Apr 20, 2017 20:16 |
|
Another option might be storing each method to call or property to access more explicitly and then using method_exists() & property_exists() with PHP's ability to do dynamic property and method calls. So something likecode:
PHP code:
McGlockenshire fucked around with this message at 02:13 on Apr 21, 2017 |
# ? Apr 21, 2017 02:11 |
|
McGlockenshire posted:Another option might be storing each method to call or property to access more explicitly and then using method_exists() & property_exists() with PHP's ability to do dynamic property and method calls. So something like I like this, thanks!
|
# ? Apr 22, 2017 00:03 |
|
Edit: SOLVED! I was able to resolve the issue. I ended up needing to edit my docker-compose.yml and add my API's host to the extra-hosts section of PHP-FPM and then rebuild my containers. You can see instructions on how to do it here. Definitely an adventure tracking that one down. I am running into a strange issue. I have an application (ZF1) and an API (Laravel) running on a Docker on a Laradock container*. When I try to access the API from the application using cURL, I get a null response and the following cURL error: code:
code:
Interestingly, if I SSH into the Apache2 container, I can run cURL from the command line and get the expected result. I also get the expected result, if I go to the API endpoint in a web browser, so I know that the API is functioning correctly. I also tried running wget from the Apache2 container to see if I could get any header info: code:
code:
*Laradock: Complete setup is Laradock with Apache2 (2.4.18 on Ubuntu), MySQL, Redis, PHP-FPM (7.1), and Workspace containers. On a Windows 10 machine using Hyper V. Aniki fucked around with this message at 07:50 on May 20, 2017 |
# ? May 19, 2017 06:21 |
|
Weird question: Is it normal/appropriate to hire a developer to develop a feature you want for an already-existing open source project? There is a pretty good Open Source DMS (Document Management System) named SeedDMS (formerly Leto DMS) that has alot of features I like but lacks ONE very simple (seemingly) but very critical feature. I've already posted/talked to the developer but he's basically one guy and I can't quite pester him to implement this. But this one feature I am envisioning would be a huge step towards successfully deploying this system or not, to the point where I am willing to pay someone to (hopefully) implement it in the code. Which leads to 2 follow ups: how realistic is it to expect to hire someone to read SOMEONE ELSE's (open source) code and actually be able to decipher it well enough to make the changes I want? It seems like 70% of programmer humor is about how reading someone else's code is usually impossible, so it seems like it really might be a thing. The change I am proposing seems to me like it could be super simple (literally just a web formatting/css issue, i think) secondly, if i DID successfully get someone to make the feature I want, is it considered untoward to propose a pull request based on a hired gun's code? Does that violate some GPL/Open source poo poo? Not that it really matters to me all that much if it works for me, but I do know there are people in the Git who want this feature so I'm wondering how the dev would feel.
|
# ? May 22, 2017 19:44 |
Gozinbulx posted:secondly, if i DID successfully get someone to make the feature I want, is it considered untoward to propose a pull request based on a hired gun's code? Does that violate some GPL/Open source poo poo? Not that it really matters to me all that much if it works for me, but I do know there are people in the Git who want this feature so I'm wondering how the dev would feel. You will want to make publication or not of the modifications part of your contract with the developer. As far as I can tell, SeedDMS is GPL 2 license. I am not a lawyer, however my interpretation is that any modified or extended version must also be covered by GPL or a compatible license on 100% of the code. That in turn means anyone who receives a copy of the modified program is entitled to do whatever they want with it (including redistributing it to anyone they wish) with full source code, as long as all authors are properly credited. On the other hand, it also means that as long as you do not give anyone else a copy of the modified program, nobody else is entitled to it either. (Although I think you also couldn't stop the hired developer from running with the modifications.) The most courteous would be to hire a developer who will work with the open source project and have your required modifications become part of the public distribution. If it's something major you can perhaps negotiate having your business mentioned as a sponsor on the project website.
|
|
# ? May 22, 2017 20:54 |
|
nielsm posted:(Although I think you also couldn't stop the hired developer from running with the modifications.) I think if you make the developer's modifications part of the contract (meaning it is your intellectual property), then that would 'legally' stop them from re-using them.
|
# ? May 22, 2017 21:13 |
|
Yeah I would definitely discuss it with the dev before hiring him. I feel like the change I'm proposing is minor enough that a. I can't really try to involve myself in the project and b. that it doesn't warrant any kind of corporate sponsorship type thing. I think I'll ask the dev whether he's ok with me publishing his code and if he is, I'll mention it in the feature request thread in the Git and if the lead dev is cool, I'll put in a pull request.
|
# ? May 22, 2017 22:45 |
|
Why not approach the original author? They ought to know the codebase better than anyone else and would probably love to get a little bit of money from their project.
|
# ? May 22, 2017 22:50 |
|
rt4 posted:Why not approach the original author? They ought to know the codebase better than anyone else and would probably love to get a little bit of money from their project. I definite thought this but... how would I even go about that? I feel like im stepping into a minefield of open source principles.
|
# ? May 22, 2017 23:27 |
|
There's definitely projects out there that do this. The worst possible outcome is to be declined. The best is that you get some decent work done that also contributes to the project. Speaking as someone who has published a few modest open source projects, I'd be thrilled to receive such a proposal.
|
# ? May 23, 2017 01:33 |
|
I guess the other issue is I have no idea what a fair/reasonable compensation would be. In what form and what amount.
|
# ? May 23, 2017 03:44 |
|
Anyone know a good free/opensource Microsoft Access ODBC driver for Mac OS X and Linux? This one costs $1000 http://www.easysoft.com/products/data_access/odbc-access-driver/index.html#section=tab-1
|
# ? Jun 5, 2017 20:45 |
|
Can someone point me to a good resource for learning how to batch insert items into a MySQL database using PHP? I have a tab-delimited file of 1.1 million rows that I want to insert into a MySQL database (it's actually AWS Aurora) every hour. Most of the examples I find online are of people using arrays to receive the data from the flat file and then using loops to push the data into the database. But iterating over a million-member array one at a time seems dumb and inefficient.
|
# ? Jun 6, 2017 17:53 |
Agrikk posted:Can someone point me to a good resource for learning how to batch insert items into a MySQL database using PHP? Prepared statements and working inside a transaction should be the basic approach. Prepare your insert statement once, then execute it multiple times with different data. Work inside a transaction to allow the database to not flush to disk constantly. (But for some resumability it may be a good idea to commit the transaction every so often, say every 100 or 500 rows.) MySQL also supports inserting multiple rows in a single insert statement, using the syntax INSERT INTO table (field1, field2, ...) VALUES (a1, a2, ...), (b1, b2, ...), (c1, c2, ...), ...; It may have better performance to batch multiple input rows that way, e.g. have your prepared statement process 10 rows at a time.
|
|
# ? Jun 6, 2017 18:01 |
|
I've gotten good results by doing single-row prepared statement inserts bundled inside a transaction. Instead of using an array, iterate over a generator. Open your file up and yield rows line-by-line. http://php.net/manual/en/language.generators.syntax.php open file and start reading lines -> start transaction -> iterate inserts -> commit transaction
|
# ? Jun 6, 2017 18:41 |
Might be easier to just do it in a stored procedure on the db, no?
|
|
# ? Jun 8, 2017 14:53 |
|
What are some good resources for learning how to connect to rest APIs with OAuth? The specific one i want to work with has some instructions to connect with curl but I'd like to lean how to work with APIs in either PHP or node js This is coming from someone who has a pretty small amount of experience with the backend.
|
# ? Jun 8, 2017 23:35 |
|
One would hope Swagger + OAuth2 is mature enough to have docs and examples for both of those.
|
# ? Jun 9, 2017 00:01 |
|
Agrikk posted:Can someone point me to a good resource for learning how to batch insert items into a MySQL database using PHP? Research using LOAD DATA LOCAL FILE.
|
# ? Jun 9, 2017 00:48 |
|
Grump posted:What are some good resources for learning how to connect to rest APIs with OAuth? The PHP League packages OAuth1 and OAuth2 are a really good wrapper for this - https://github.com/thephpleague/oauth1-client and https://github.com/thephpleague/oauth2-client
|
# ? Jun 9, 2017 02:43 |
|
I don't know if this is the right thread. Some code that made me scratch my head $opt = array("type"=>"resources"); $opt["id"] = $id_product; $opt["xml"] = $xml->asXML(); echo serialize($opt);//returns a empty strings echo json_encode($opt);//returns a empty strings echo var_export($opt,true);//returns a empty strings the problem was a broken string, that was a invalid UTF8 sequence. just by having this broken string as one value inside anywhere in the array was enough for PHP to go.. ..every way possible to ask him to serialize the array.
|
# ? Jun 12, 2017 13:25 |
|
Well, yeah serialising you are just turning the content to a string, like a series of concat methods on each of the contents. If you have a broken utf8 sequence in part of it, you now have one in all of it. Something very low level is gracefully handling it, that each of those serialise methods will be calling.
|
# ? Jun 12, 2017 13:41 |
|
I've been tasked to create an app that consolidates about 15 Microsoft Access databases (each of our robots logging data to each database in a standard format) into one database so that we can easily report off the data. Simple enough. However, my problem is that I don't know where to start on actually connecting to a Microsoft Access database. There are a bunch of ODBC drivers out there it seems but the problem is that I develop on OS X and deploy to a Debian or Ubuntu server so I need to purchase an ODBC driver for both platforms. Alternatively I could probably do something with Windows which has a free ODBC driver for Access. Otherwise, I was thinking I could have the Access databases dump to a CSV or something on a scheduled task? Has anyone here ever had to do something like this and if so what is my best way going about it? If this is too retarded for PHP, should I look into creating a python script that does this instead? kiwid fucked around with this message at 17:20 on Jun 29, 2017 |
# ? Jun 29, 2017 17:16 |
|
When I had to work with Access databases and PHP I ended up converting them to MySQL using "mdbtools" I think it was called. I also had to edit the source of mdbtools to make its output actually MySQL compatible. As far as I know there's not much out there at least free that lets you connect to Access from PHP on Linux, but this was about eight or nine years ago, maybe things have improved since then.
|
# ? Jun 30, 2017 01:48 |
|
Tei posted:I don't know if this is the right thread. Makes sense to me to be honest.
|
# ? Jun 30, 2017 01:53 |
|
Tad Naff posted:When I had to work with Access databases and PHP I ended up converting them to MySQL using "mdbtools" I think it was called. I also had to edit the source of mdbtools to make its output actually MySQL compatible. As far as I know there's not much out there at least free that lets you connect to Access from PHP on Linux, but this was about eight or nine years ago, maybe things have improved since then. I checked out mdbtools and it seems like a lot of work.
|
# ? Jun 30, 2017 13:21 |
|
I have data on a text file that looks like this.... 06/14 750.00 Check Number 1127 813009592442970 06/14 100.00 Check Number 1129* 813000292622807 06/04 370.00 Check Number 1130 813005882772872 06/14 100.00 Check Number 1131 813001882618259 06/18 2,725.00 Check Number 1134* 813008892829991 06/28 400.00 Check Number 1135 813000492265151 Id like to import that data to a database with php and separate into 3 columns: DATE | AMOUNT | DESCRIPTION. For each line, If i do an explode by spaces, i can easily get the date (entry(0)) and amount(entry(1)), but the description would be any number (entry(2)(3) and so on). Is there a way to truncate the rest of the remaining entry(s) as one? Any help is appreciated. If I should go about it another way, let me know. Someone suggested I could probably formate it in Notepad++, but I wasnt sure how to go about it since the file has alot of entries.
|
# ? Jul 6, 2017 19:16 |
|
Explode has a $limit parameter:quote:If limit is set and positive, the returned array will contain a maximum of limit elements with the last element containing the rest of string. So if you apply a limit to your explode and use list (or destructuring) then you get: php:<? [$date, $amount, $description] = explode(' ', '06/14 750.00 Check Number 1127 813009592442970', 3); echo $date; // "06/14" echo $amount; // "750.00" echo $description; // "Check Number 1127 813009592442970" ?>
|
# ? Jul 6, 2017 19:39 |
|
Thanks, I had never seen the limit parameter or used List. That helped. Now I have another problem, if you or anyone could pinpoint in the right direction. I have a text file of entries, a lot which are in the correct format, line by line of date, description, amount, all on one line. But some lines are broken up in 3 seperate lines, so it would be date description amount (good ones) date description amount date description amount date description amount date (bad ones) description amount date (bad ones) description amount date description amount (good ones) date description amount (good ones) I'm not too sure how to code inside the loop of lines. I thought about checking each string to see if it starts with a date, which I can do, but I wasn't sure how to put the subsequent lines back to the line with the starting date. (Same with seeing if the string starts with a DASH)
|
# ? Jul 6, 2017 22:33 |
|
There are a few ways you could deal with this, but quick and dirty I'd probably:
That sort of idea anyway.
|
# ? Jul 7, 2017 13:38 |
|
If you want to have two problems, you can use a regex with the multiline flag. Edit: Something like this php:<? preg_match_all("/([0-9]{2}\/[0-9]{2})\s(\S+)\s(.*[0-9]{3})/m", $input_lines, $output_array); ?> duz fucked around with this message at 17:20 on Jul 8, 2017 |
# ? Jul 8, 2017 17:11 |
|
Ive been working for three months now in my first stable, solid developer job and its basically great. The only downside is in this particular app we are locked into a legacy PHP framework, Symfony 1.x to be exact paired w/ PHP 5.6 When I started I didnt know any PHP and I guess I know a bit now. But Im starting to feel a little anxious like I should be starting to branch out/ become a little more familiar with something more up to date. I know there is like, this incredibly massive repository of information called the internet we are using, but Im also very persuadable and influenceable by a really existing human , so if someone has any suggestions on something fun/ can relate to moving up from working a legacy framework like this I am all ears to be impressed upon
|
# ? Jul 27, 2017 01:44 |
|
Well drat we were just hiring, and we're in the process of updating about 50 or so PHP apps to 7 from 5.2 - 5.6. Granted very few of them are made with any sort of framework, and those that are tend to be written with an in-house framework called "Framework"... Question: when did kids stop learning PHP? It used to be that was the one web language we could count on applicants to at least have run across, which is why we standardized on it.
|
# ? Jul 27, 2017 02:13 |
|
|
# ? Jun 5, 2024 00:38 |
|
Tad Naff posted:Well drat we were just hiring, and we're in the process of updating about 50 or so PHP apps to 7 from 5.2 - 5.6. Granted very few of them are made with any sort of framework, and those that are tend to be written with an in-house framework called "Framework"... When I went through a bootcamp (be gentle :E) basically the message was that JavaScript is eating the world and the insinuation was that PHP and a boatload of other stuff was 'not cool' or not modern- it wasn't taught at any rate. Someone linked me the "PHP is a fractal of bad design" blog at some point along the way also I remember as part of the same kind of culture- PHP definitely still has its problems but that blog is also pretty old now/ its been a few versions and advances with things like composer since. It was when I was like 5 months post course, doing some contract work and stuff in the hard rocks of job hunting life that made me question I guess a lot of my newb/'trendseeking' thoughts in general. I found out for example that major applications like Slack were made with PHP and read some posts about that, met/learned of some active PHP speakers/developers on twitter basically and later learned about the huge amount of PHP questions being asked/answered on Stack Overflow as a gauge of its continued prevalence.
|
# ? Jul 27, 2017 03:07 |