Jump to content

ajlisowski

Members
  • Posts

    114
  • Joined

  • Last visited

    Never

Everything posted by ajlisowski

  1. Hey all. I am working on a web application which I plan on developing into andriod and iphone apps. I have developed an API for the web app, so the devices can make http requests to get information from the database and what not. My concern is how to authenticate the user over this process. I can easily have username/password parameters i send with any request that requires authentication. However, that seems wrong. I should be able to authenticate once and be good. Ive also considered creating a token when they first send an authentication request and then have that token be sent. But again, I feel like im trying to create a solution that probably already exists. How do facebook and twitter apps authenticate their users with those sites? I am sort of a beginner when it comes to developing an API and having third party authentication access to it. Any help or reading or anything would be great.
  2. Trimming worked. I have no idea why I didnt think of that. Turns out the binary character 0a was being left behind. I believe its fixed now. Thanks. EDIT: Just for giggles and in case it comes up, how would I run that query to modify it? I can not for the life of me select the rows that have the binary 0a in them. I try WHERE BINARY(`code`)='0a' but that doesnt work. Obviously WHERE `code`='' wouldnt either.
  3. Hello, I have a process that pulls a flat file into mysql. Certain rows have a column that has a code value that is a string. Most rows do not. I have written a query to select the ones that do not !="" However the columns with the empty string are still appearing. I believe this is because there IS some sort of character in that column. When I look at the results in phpMyAdmin I see it gives the td for that empty column as <td class=""> <br> </td> So Im guessing a new line character is being stored in the db? Any idea how to prevent this from getting in or how to query against its existance?
  4. Storing the html wouldnt work too well because i use the values outside of a dropdown. I also use them as part of a presentation piece for displaying profile info. I like the idea of just having an array.txt file that i can include which would set those smaller arrays for me. I went with the xml route because i am using zend framework and i already have config data, navigation data, ACL data in xml and figure having an xml for all my select arrays would be consistant with the rest of my framework. But either way, the consensus is to not store these smaller ones in a database, correct?
  5. Hey all. I was just wondering what you guys think is the best method for storing dropdown options. Ive almost always used mysql and had a table for each list to allow myself to pull all the correct info with one query. However it seems a bit overboard to use mysql to store a list of 3-4 static options. Does it make sense to set these as global arrays at the start of my application? Ive been experimenting with storing them in an xml. This works fine, but I wonder if it is better then the other options? Seems like mysql or a global array would be best for performance, but maybe im wrong. Whats the best way? I would assume it would matter how big the lists are? Would a list of States make more sense in mysql where as choice of gender Male/Female/Not sharing make sense in either xml or an array?
  6. Yeah the perms are fine. I went ahead and made them 777 as a test to see. I can include the files perfectly fine, but they are not being being included as part of the auto-loader and I have no idea why. Its strange. I have some custom ACL and module loading plugins I want to use for this project but I cant for the life of me figure out why the library isnt auto loaded. Oh well, Ill keep messing with it to try and figure it out. Thanks for taking a look.
  7. Hey all. I am currently developing a project that could potentially need to support a mysql database which would be hit with millions of queries per minute. Realistically, the load will likely never get that big, and if it did, I would first need to have a server capabale of handling thousands. Right now I have a shared host which obviously wont cut it. I dont know that much about server management. I contacted a buddy of mine which once ran his own webhost out of a rack in florida. I am waiting to hear back from him. Every few seconds a user will be hitting the server with two queries and then updating a row. I can likely do some query caching to help aleviate, but the nature of the project means that most queries will be unique. Will a dedicated server handle a few hundred users doing this at once? What about a few thousand? Obviously beyond that, if millions of folks are using it, id likely have to hire someone to manage the servers and run it ourselves, correct? Or do companies exist which handle this kind of scaling from minimal use all the way up to millions of queries at once?
  8. Hey all. I am starting a new zend framework project. I am borrowing code from a previous project on another server. Right now I am stuck trying to get my custom library to auto load. protected function _initAppAutoload() { $autoloader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'App', 'basePath' => dirname(__FILE__), )); $this->getApplication()->setAutoloaderNamespaces(array('App', 'myLib')); return $autoloader; } protected function _initPlugins() { $this->bootstrap('frontController'); $fc=$this->frontController; $plugin = new myLib_Controller_Plugin_Modularlayout(); $fc->registerPlugin($plugin); $aclPugin=new myLib_Plugin_Acl(); $fc->registerPlugin($aclPugin); $navplugin= new myLib_Plugin_ModuleNavigation(); $fc->registerPlugin($navplugin); } I get the error: Fatal error: Class 'myLib_Controller_Plugin_Modularlayout' not found in ***/application/Bootstrap.php on line 44 I used the same code on a different server, but my custom library was named lunaApp before. But everything else is correct. I have a file located in library/myLib/Controller/Plugin/Modularlayout.php it has the following class definition: class myLib_Controller_Plugin_Modularlayout extends Zend_Controller_Plugin_Abstract { public function routeShutdown(Zend_Controller_Request_Abstract $request) { $layout=Zend_Layout::getMvcInstance()->setLayout($request->getModuleName()); } } Any idea what is going wrong?
  9. Hey all, I was wondering if there was a way to filter what row of data gets returned when using GROUP BY. For example, lets say I have two rows idnamevalue 1value 2 1Batman1015 2Batman2025 If I do SELECT * FROM `table` GROUP BY `name` how can I know which id, value 1 and value 2 I am going to get? I would like to be able to specify that I would want to get the results for the one with the highest value 2. Is that possible? So of an ORDER BY within the GROUP BY?
  10. This is what I have for my code (it is returning the invalid Username/Password exception, which is what happens if I do nothing) $xml_auth_header = '<UsernameToken> <Username> '.$username.' </Username> <Password> '.$password.' </Password> </UsernameToken>'; $auth_header = new SoapVar($xml_auth_header, XSD_ANYXML); $ns='http://schemas.xmlsoap.org/soap/envelope/'; $actor='http://schemas.xmlsoap.org/soap/actor/next'; $header = new SoapHeader($ns,'Security', $auth_header, false,$actor); $client->addSoapInputHeader($header); Im not sure what all that wsse stuff is for though...perhaps that is needed. The namespace also confuses me.
  11. This is what I have for my code (it is returning the invalid Username/Password exception, which is what happens if I do nothing) $xml_auth_header = '<UsernameToken> <Username> '.$username.' </Username> <Password> '.$password.' </Password> </UsernameToken>'; $auth_header = new SoapVar($xml_auth_header, XSD_ANYXML); $ns='http://schemas.xmlsoap.org/soap/envelope/'; $actor='http://schemas.xmlsoap.org/soap/actor/next'; $header = new SoapHeader($ns,'Security', $auth_header, false,$actor); $client->addSoapInputHeader($header); Im not sure what all that wsse stuff is for though...perhaps that is needed. The namespace also confuses me.
  12. Ok, Im a dummy and I didnt catch the exception from soap causing it to error. Now I have but when I call Zend_Soap_Client->getLastRequest() it is empty... Im running a similar test outside of zend where I just point the standard soapclient to the wsdl and then run the call. I still get the same results. Using soapclient->__getLastRequest() returns nothing. How can I see what my request was?
  13. Hey all, I am in the midst of building an application that requires a soap request. I know very little about this coming in, so I have been banging my head a few times here. I am using Zend Framework for this application so I am using it's soap_client. Basically, things seem like they would be simple enough. I point the client ad the wsdl file then call the appropriate function. I was getting back a message that says: Invalid Username/Password. So I looked into ZFs class and added a login and password and now I get back Unauthorized. I contacted my point of contact with the company we are doing the soap call to and they said to authorize I need to add the following xml to the header: <wsse:Security xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="id-734e5a5c-ccd0-11db-90b7-512fcdfa7c5f" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username> username </wsse:Username> <wsse:Password> password </wsse:Password> </wsse:UsernameToken></wsse:Security> However, I am not sure how to go about doing this. I also do not know how to check my last request to see what I sent because ZF kills the application when it runs into a bad response it seems. If I could keep going forward and see the last request I may have a better idea of what to do. But right now Im sort of lost.
  14. Hey guys. I am trying to connect a ZF application with mssql. I believe I am unable to do so because I do not have pdo-dblib installed on my linux box. We are using redhat 5 with php 5.2.14. It seems almost impossible to find a way to install pdo-dblib on this system. Every package we find requires a custom php-common file which my system admin says would mean we would have to install about 14 other packages to maybe get things working. I feel like I am missing something. I am not 100% sure what a PDO is. I got the standard mssql calls working from linux, but not pdo-mssql or pdo-dblib. What are my options here? Should I just write a series of classes to use the standard mssql calls? Can anyone explain how a PDO works or why it is needed? Is there a way to use ZF db functions without the mssql pdo? Any help would be great.
  15. Hey all. I have a quick question about what the best way to implement something while maintaining a good MVC design. Basically I have a page that has two grids of data. I want these two grids to be sortable and paginated individually. I want to use ajax to redraw these tables when they are re-sorted/paged. Within the MVC design how should I handle this? Should I make an action for each of those grids under a controller and then have my javascript hit that action and grab the output? Obviously I need to originally draw these grids initially from the page. So how do I avoid writing redundent code? Can display the results of other actions within an action? So my main page would display the results of grid1 and grid2. Meanwhile id have ajax calls to grid1 and grid2 whenever they are paginated/resorted? Does this make sense? I get MVC a decent amount but I always get confused when it comes to dynamic pages/ajax within it. Specifically I am using ZF for this project. But this is more of a generic question.
  16. So I need some help trying to develop a query which may not even be possible... Basically I have a number of tables which represent a product. Ill simplify things with dummy tables. I have a product table which contains product information, a product_vendor table which connects a vendor to a product based on region. Then a pricing table which gives prices based on the product_vendor relationship. This allows multiple vendors to set their price per region. product id, product_sku product_name, manufacturer, product_vendor product_to_vendor_id, product_sku, vendor, region, price product_to_vendor_id price The tricky part is, I also have a modifications table. Which allows users to modify product information to be approved by an admin user later. modification product_sku, table, field, value, user So it stores what field of the product has been modified and by who. I want to write a query that gets all the product info, but replaced fields with the corresponding modifcation entry if it exists. Im not sure if a mysql query can get the job done in one go. Perhaps I would need to get all the data, then get all the modifications and run through them replacing the data of the first results with the corresponding value of the modifications table? I would like to do it in one query but im not sure thats possible. Any help would be great..
  17. So, due to some other projects probably requiring this in the future, ive decided that i need to look into filepros index files to have any chance and really having real time access to it. I am having some issues intepretting the files to determine how to store/traverse the index tree. Documentation on it can be found here: https://www.fptech.com/Products/Docs/FPFormat/autoix45.shtml#sort Basically it seems to be a tree that consists of 3 elements non leaf nodes leaf nodes a free chain. The free chain is a linked list of nodes. I dont get its purpose or how to use it to properly search for data. Non leaf nodes contain a left node and a series of other nodes. I am GUESSING the left node goes back to the "parent" node and that the right node consists of children. I would also guess that non-leaf-nodes would not contain more then ONE non-leaf-node as a child, and that the rest would be leaf-nodes. Leaf nodes contain the key data, a backwards pointer (to the parent) and a forward pointer (to the next node, which would exist if multiple records contain the same index). Is my interpretation of the documentation correct? Or am I way off? Also what the heck is the point/use of the freechain list?
  18. From meeting with my boss today, I am pretty sure our version of filepro does not have ODBC support. Plus, I believe the ODBC support filepro does have is simply reading ODBC supported DBs INTO filepro and it does not have a way to communicate back out. Though I will look into that a bit further. I believe we had this discussion internally a few months back and it was determined that the ODBC support was only one way. Thanks for looking into that though, most people dont even know what filepro is
  19. The text files are created by a database system called filepro. Our entire company pretty much runs on filepro right now but we are migrating parts to php/mysql. To be honest, I am not 100% sure of the depth of use, but I do know its pretty massive. Pretty much anything that has to do with our inventory goes through this database. New products and items are being added every day. Inventory amounts are changing constantly. Customers are being added, updated. Leads, opportunities, everything is being stored and tracked. I have ran an update to pull our product list out of this system into mysql and then we dump it back to filepro every day so other systems can have the updated inventory list. So weve migrated that to mysql, but its an ugly batch solution. If someone adds a product at noon, and then someone wants to sell that product at 2 they cant without requesting that we synch the databases. To be honest, on the project I am working on right now, I can simply pull in the data, they tables im working with wont be updated often at all. I am more looking for a long term solution to this issue. Moving everything from filepro would be optimal, but we have 100s of processes which right now utlize the filepro database so we can not simply move off of it. We have to move one system at a time and find ways to continue synching the data for future use. Or if I could find a way to search this data from PHP, we would not need to migrate from the current database. And even then, doing so would be easier because I could develop my applications to be able to easily start pulling from mysql when we are ready to switch. Which is what I am attempting to do now.
  20. Well, the problem is the data is constantly changing in the documents. Right now we run a cron which pulls the data into mysql every night for the bigger tables. I suppose I could just do that for all of them. Runs the risk of the data not being 100% up to date in all regards though. I guess we could just up the cron.
  21. Hey all. I am racking my brain trying to figure out the best way to handle a certain process my company needs me to do. First I will give a general description of the issue, then I will get into specifics. Basically I have a file that contains a bunch of data. The data stored in the file is consistant, each entry has X number of elements with a total character size of Y. Element 1 in each entry will always take up the same amount of characters. So if I have 2 elements in each data entry, each 5 characters long, then each data entry is 10 characters. Whcih means to access the 2nd element of the 3rd entry I would grab characters 15-20. I would want to be able to search this data for a number of things. Basically id want to be able to say, "give me all results where element 1 = 'pancakes'. Or where element 2 >8. Or more substaintial searches such as element 1>10 AND element 2<5. Is there a good way to do this? My first line of thought would be to run through the file, grabbing every element that can be searched on. So lets say if elements 2 and 4 can be searched on, and I have 10 entries, I would run through and grab an array holding the values for entry 2 and 4. array( array('index=>0', 'element2'=>10, 'element4'=>12), array('index=>1', 'element2'=>11, 'element4'=>-2), array('index=>2', 'element2'=>0, 'element4'=>7) ) Then, depending on the search, I would reorder the array and search through it. So if I wanted to see if element2 was greater then 8, id reorder by element2 and then search. As if this wasnt difficult enough, the issue would be on complex searches such as 'element1>10 OR (element2=6 AND element3=0)' I suppose i could store the result array of each individual search result and then merge/union/intersect based on the AND/OR. To make things ever CRAZIER, the flat files can have other flat files as children. So if I have element1 in file 1 and element1 in file 2, all of file2 data would be part of the corrisponding data in file1. So, id basically need to be able to "join" files. I have thought of a number of solutions, but im not sure how they will pan out. Ugh. In case your wondering WHY I need to do this. My company runs a lot of data off an old database called filepro which uses flat files with index and map files. Right now we have a few systems which weve "synched" with mysql which runs batch updates between the two databases to keep data consistant. We wont be coming "off" of filepro for a long, long time. But a lot of my php/mysql apps need access to the data on filepro. So, Im trying to find a way to quickly be able to search and pull data from filepro into php. Basically, i want to run search queries on the flat files. Basically id like your input on a number of things: Is this even a reasonable attempt? Is the idea of pulling the searched elements into php to actually run the search, then collecting the correct rows and getting the data directly from them a smart move? Once I have the searchable elements and index, what algorithms are good for actually running the search?
  22. I have, am and currently awaiting a response. But the folks here are always pretty knowlegable, so I figured Id check here too. Sorry about posting it in the wrong section. For future reference, what constitutes an application VS a 3rd party script?
  23. Anyone here have any experience with sugarCRM? I am in the process of tyring to build some custom modules within the application. I am having a problem grabbing child modules from a parent. If anyone is familiar with this application, let me know and I can go into details about the problem Im having and possibly figure this thing out
  24. Ah, I had to save my file as Img.php because my class was Zend_View_Helper_Img not Zend_View_Helper_img
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.