Jump to content
Larry Ullman's Book Forums

Antonio Conte

Members
  • Content Count

    1084
  • Joined

  • Last visited

  • Days Won

    126

Antonio Conte last won the day on August 26 2016

Antonio Conte had the most liked content!

Community Reputation

426 Excellent

About Antonio Conte

  • Rank
    Advanced Member
  1. Glad you are improving Edward. Making things work is always the most important point. Refactoring can happen later and bit by bit.
  2. Soap was very nice some time ago, but most web services are luckily going RESTful these days. I suggest you look into building a rest Api rather than work with Soap.
  3. This error occurs when you try to call a method on something that is not an object. In this case, the variable that should hold an object is actually a boolean. Make sure you actually create an object. An example can be the MySQLi functions.If you look at MySQLi::query(), the function returns either false (on error) or an object of the type mysql_result. A bad SQL query will make the query fail and the function to return false. The next call to $result->fetch_all(); would therefor return the error above. In you case, the error occurs when you try to call setFetchMode. It probably me
  4. Just like an array is traversable a closure is callable. The traversable part is why you can foreach an array, as foreach expects something implementing Traversable. You can actually implement Traversable directly on any object and foreach it directly. The same principle applies to anonymous functions. It's just another type of structure PHP provides you with. Functions in PHP normally provides you encapsulation and execution of a set of logic. A closure is a reference to a function's definition, and behaves more like objects in PHP. When you have a closure, you can do stuff to it, just li
  5. I can really recommend PuPHPet. It takes most of the work out of server configuration.
  6. To add to that, .NET just went open source and is available for UNIX systems. That happend very recently. My advance is to look at Jobs in your community. Also, keep in mind that programming pilars such as algorithms and data structures is appliable to any language. Learn that. Also, learn HTTP if you want to work with the web.
  7. What are your needs here? If this is a read-only (only GET-operations) API, you don't need strict authentication or might not need it at all. Tokens can be used to make sure only those with a valid key can fetch data, you can throttle their calls and build statistics. You could also consider leaving it out completly. If the API is read only, a simple token emailed to users are enough. You can add this token to a GET param or insert into a header in your calls. 1. Seems like a good idea. That way you can also retract tokens. 2. Probably. How important is security? The tokens generated shou
  8. It's quite normal to build the REST api alongside your site. It seems api.domain.com or domain.com/api/ are pretty normalt structures. While that is the most common, I myself prefer the sort of structure Rails use. This has the added benefit of allowing you to build everything once only. I don't know how easy this is to do with YII, but that's how I build in Symfony. Looking quickly at YII, the same should be possible there. Some of the reason why this is so easy are some incredible bundles like the FOSRestBundle and JMSSerilizerBundle. By defining core configuration for you app, you're co
  9. The biggest issue I had was understanding "the flow" of git. If you have get an error, you are doing something wrong. Some typical error cases: 1. You try a git pull origin master (or similar) and get an error. Your local branch is probably not clean. Do a "git status". If you have any changes, do one of two things. - If you don't care about saving your changes, you can do something like "git checkout .". That will remove any changes to tracked files. (git checkout file/to/checkout will remove single files) If you've added files using 'git add file/to/add", you can unstage them by doing "
  10. Apply some debugging. If you look at your source code, you'll see that the data you try to echo to var date is not correct. Creating JSON out of $_POST will never get you a date. You are looking for a date on the form "YYYY-MM-DD". To get that, you'll need something more like this: var date = "<?php echo $_POST['date_looking']; ?>"; Some tips. Check you source HTML code and use the Firefox/Chrome debug console to catch any errors.
  11. We use Git Flow on our projects. We also use post-receive hooks and deploy the same way as Larry does. The big difference is that the master branch only have published released, and is thus always stable. We branch out of develop using feature-branches, and merge with develop, perform staging and then goes live when our customers accept new functionality. The stage-enviroment is therefor based on develop, not master. This means we can very easily rollback to a working version if anything stops working and master is always stable. The actual development is performed on our development server th
  12. Yeah, I've both used and installed Solr at work the last few months. It's pretty amazing. Happy holliday to you, Edward.
  13. Perform a new query. Query for the new info you need and limit the result to a single result.
  14. Because IE is shit... On the more serious side, that sounds more like an header issue. I know IE can be a bit weird about headers, so that is nothing new. I experienced the same kind of problem you got a couple of weeks ago. You can find some info here: http://stackoverflow.com/questions/1218925/php-script-to-download-file-not-working-in-ie If that doesn't work, keep searching Stack Overflow. I used the google term "pdf download php internet explorer". Good luck and merry Christmas to you guys.
  15. Possibly an PHP error/warning? Try setting PHP error_reporting to off and set display_errors to false.
×
×
  • Create New...