php,symfony2Related issues-Collection of common programming errors
user1928775
php android mysql json json-encode
I’m using JSON to do two things at the same time First I want to send (Username & Password) to PHP File that Reads the toggle buttons status from database for Username and Password and PHP File also sends the toggle status using JSON List to Application I Combined both Reading and Also Sending the Username and Password but it always states in the Logcat an errorJSON Code i’m using Combined Sending User and Password and Receiving JSON List According to that username and Passwordprivate class
user1928775
php android database json android-asynctask
My App sends username and password to PHP file using JSON then PHP File Reads the user Columns and status from Database MY Problem is that i added everything that reads JSON from Android App in the PHP File but No data returned to that user please tell me what’s wrong with my codeApplication JSON Activity Codeprivate class JSONParse extends AsyncTask<String, String, JSONObject> {private ProgressDialog pDialog;@Overrideprotected void onPreExecute() {super.onPreExecute();pDialog = new Progre
somedev
php curl proxy http-headers twilio
Our environment requires the use of an outbound proxy for offsite services. Normally this isn’t a problem. In this case with Twilio, the extra header returned breaks the client.Outgoing headers:POST /2010-04-01/Accounts/FOO/SMS/Messages.json HTTP/1.1 Authorization: Basic FOO== User-Agent: twilio-php/3.10.0 Host: api.twilio.com Accept: */* Accept-Charset: utf-8 Content-Type: application/x-www-form-urlencoded Content-Length: 108Response Headers:HTTP/1.0 200 Connection establishedHTTP/1.1 201 Creat
Alex Goncalves
java php mysql json
.HttpClient sending commands by specifying the path of my PHP file to query this on seems to work .Converting the received stream into string work too But the end does not work … I don’t get what’s wrongI try the same thing in a pure Java projet importing all packages needed json-lib etc.. it does the conversion of the data but on the last step it fail ?!Server side:<?php$Conn = mysql_connect(“127.0.0.1″,”root”,”socrates”);if (!$Conn)echo “not connected”;$DbSelect = mysql_select_db(“impetod
Community
java php unit-testing tdd integration-testing
I would like to ask about using Unit Testing in Web Development. The idea of Unit Testing is great but does it really bring value in the context of web application? Second part of my question is about TDD. If one creates an integration test before the actual code can this approach be called “Test Driven Development”? 1. AssumptionsBy the definition Unit Test should test code on only one service layer. If a test tests code across multiple layers we have an integration test. 2. Argument2.1 No Algo
Kendall Hopkins
php events asynchronous daemon
I’m working on an online PHP application that has a need for delayed PHP event. Basically I need to be able to execute arbitrary PHP code x many seconds (but it could be days) after the initial hit to a URL. I need fairly precise execution of these PHP event, also I want it to be fairly scalable. I’m trying to avoid the need to schedule a cron job to run every second. I was looking into Gearman, but it doesn’t seem to provide any ability to schedule events and as I understand, PHP isn’t really m
InnocentKiller
java php android audio file-upload
I am trying to upload audio file to server when recording of audio get finished. I am setting audio.mp3 as default file name of audio while starting recording and storing inside SD-card. After recording get finished on button click event i am renaming audio name and trying to upload it to my server.But unfortunately i am getting error. My app is stopping unfortunately, in logcat i got below error. 01-30 15:08:58.452: E/Debug(1686): error: /storage/sdcard/filetoupload/1391074738276.mp3: open fail
koneko
java php android
I’m fetching records from mysql database and putting it into a ListView but I’m getting the said error stated in the title, “Error of input at character 1 of”. I already tried checking the php file associated with it but it’s working well and able to fetch data from the db. Below is the code where the error is being caught.public void ListDrawer() {List<Map<String, String>> announcementList = new ArrayList<Map<String, String>>();HashMap<String, String> listA;try {JS
jh314
php web-services soap
I am going crazy starting off with Web Services. I am trying to call the following WSDL using PHP and keep getting nowhere:http://webservices.sabre.com/wsdl/sabreXML1.0.00/usg/SessionCreateRQ.wsdlI found the following piece of code on the net, from someone with similar problems, but I could not get it to work either:$soap = new SoapClient(‘http://webservices.sabre.com/wsdl/sabreXML1.0.00/usg/SessionCreateRQ.wsdl’, array( ‘trace’ => true, ‘soap_version’ => SOAP_1_2, “exceptions” => 0)); $eb = new
user1400538
java php mysql linux fedora
While accessing MySql directly through php, I am able to connect to the database without issues. Whereas, while I try to access MySql indirectly – with the help of a jar file which connects to MySql db, I am not able to connect from php.I have tested this jar file from terminal and it works perfect and connects to the db.In a nutshell, for connecting to the same db:(1) php-mysql connection works perfect (2) jar – mysql connection works perfect (3) php – jar – mysql connection failsCaling shell_e
j0k
php symfony2 doctrine2
I’m trying to do this in Symfony2 with Doctrine2 v. 2.1.7:$query = $this->em->createQuery(“SELECT aFROM “.$repo.” aWHERE a.type_id = :typeidAND a.scenario = :scenAND a.contact_id = :cidAND a.row_type LIKE :rwtpORDER BY SUBSTRING(a.row_type, 4, 1) “)->setParameters(array(‘typeid’ =>$sesData[‘type_id’],’scen’ =>$sesData[‘scenario’],’cid’ =>$sesData[‘contact_id’],’rwtp’ =>’%.’.$whereVal.’%’));$customValues = $query->getResult();Doctrine 2 fails on the OR
Juan Treminio
symfony2 phpunit silex
I’m creating an application in Silex with unit tests.Running unit tests works fine against the regular session handler:$app->register(new Silex\Provider\SessionServiceProvider(), array(‘session.storage.options’ => array(‘cookie_lifetime’ => 1209600, // 2 weeks), ));and setting this flag in my unit tests:$this->app[‘session.test’] = true;If I don’t set that session.test flag, my unit tests throw a headers already sent error and all fail. With it on, my tests run well.The issue is I am
carp-enter
symfony2 mysqli
I decide to work with Symfony for three weeks, realizing a small projekt to test. Inside a Controller I use MySQL native without Problems. Now I want to change to MySQLi and nothing runs.Connecting to the DB with: $mysqliName = new mysqli(‘localhost’, ‘user’, ‘psasswd,’, ‘database’);fails with:”Class ‘blabla\HaloBundle\Controller\mysqli’ not found in /Applications/MAM…/HaloController.php”I can run MySQL in a “normal” php, out of Symfony without problems. What must I do, that I can use the MySQ
jcroll
php mysql symfony2 solr doctrine2
Doing a Native SQL Query on a class table inheritance hierarchy is mentioned in the examples in the docs but I will produce the relevant example here:<?phpuse Doctrine\ORM\Query\ResultSetMapping;// Equivalent DQL query: “select u from User u where u.name=?1” // User is a mapped base class for other classes. User owns no associations. $rsm = new ResultSetMapping; $rsm->addEntityResult(‘User’, ‘u’); $rsm->addFieldResult(‘u’, ‘id’, ‘id’); $rsm->addFieldResult(‘u’, ‘name’, ‘name’); $rsm-
Bogdan
symfony2 phpunit
I’m trying to do some functional testing with PHPUnit but it requires that I add session.storage.filesystem for the storage_id option in config.yml. This causes the login process to fail, for some reason. I get the following error in test.log : Authentication request failed: Your session has timed-out, or you have disabled cookies. Afterwards I’m redirected to the login page again. I’m certain that I have cookies enabled and that the application works without setting that option(with native sess
j0k
php forms symfony2
I have an entity type form field in my Symfony2 project. $builder = $this->createFormBuilder(); $projects = $this->getProjects();$builder->add(‘project’, ‘entity’,array(‘class’ => ‘OpexMarketOPEXMOPEXBundle:Project’,’required’ => false,’choices’ => $projects,));The problem I’m having is, when the getProjects() method will return an empty result set, the drop down list will have all the projects in the Project table.Is there any way to disable this behavior?
mogoman
symfony2 acl symfony-2.3
I’m busy implementing ACL on Class + Field (classFieldAce) level within my application. Everything seems to work fine, but I am getting unexpected behaviour from the isFieldGranted() method from the ACL. Here is my code:// setup ACL $className = ‘Acme\Model\Junk’; $oid = new ObjectIdentity(‘class’, $className);try {$acl = $aclProvider->findAcl($oid); } catch (Exception $e) {$acl = $aclProvider->createAcl($oid);$roleUser = new RoleSecurityIdentity(‘ROLE_USER’);$mask
Chris Tickner
symfony2
I have been trying to figure this out for over an hour and I have made no progress…I have the following form and its the only field:<?php $builder->add(‘cars’, ‘collection’, array(‘type’ => new CarType(),//’property_path’ => ‘[cars]’,’required’ => false,));This form receives an array, with one key “cars” pointing to an array of Car objects (which are handled fine by the CarType().When I set data to this form, it gives me a Property Path parse error, stating that the property pat
richsage
symfony2 console cli shared-hosting
I signed up for a shared hosting package at Hostgator. So far so good, but I run into trouble when executing Symfony 2.1 console commands via ssh.By default, Hostgator provides php v5.2. After some googling, I found that adding the following lines to the document root .htaccess file will turn on php v5.3, as required by Symfony:Action application/x-hg-php53 /cgi-sys/php53 AddType application/x-httpd-php53 .php suPHP_ConfigPath /opt/php53/libGreat! The Symfony pages are rendered without errors. O
LargeTuna
php mysql sql symfony2 doctrine2
I have a 3 tables that I am joining together, “PurchaseOrderProductsStatus, Product and PutAway” tables.PurchaseOrderProductsStatus Tableid | product_id | ———————- 10 | 1 |Product Tableid | Name | ————————— 1 | Acme Product 123PutAway Tableid | product_id | ———————- 100 | 1 101 | 1I am able to output the data to the screen, the issue I am running into is that it is only returning 1 row from my PutAway table. It should return
Web site is in building