Jump to content

cmiddlebrook

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by cmiddlebrook

  1. Ok thank you all. I obviously need a re-design! I've ordered a book which should help me!
  2. Okay so if I was to merge all the member records into a single member table, currently that would create a table with 2-3 million rows. Are there any limits that I would need to be aware of such as number of rows, or physical table size as this continues to scale?
  3. It's one table for each website member. I think that's reasonable. The choice is either thousands of tables or a truly gigantic single table.
  4. I have a database which currently has tens of thousands of tables and it is growing daily and I am having trouble finding a MySql client which can handle it. The problem is that most clients such as PHPMyAdmin want to try and load the entire list of tables before it will let you do anything. All I need is something that will allow me to load perhaps the first 50 tables then stop, and I can perform queries if I need to see the rest. This is becoming a real problem as I just can't load the database without it timing out or just hanging the whole computer.
  5. Yup that's exactly right. I can't see a way of solving it using the method I'm trying now. But I'm wondering if there is another way of saving the image that has been displayed. It's already rendered in the browser so I wonder if there is a way of telling the browser to save the image that is there without re-accessing the URL that generates it - some kind of caching solution perhaps? I guess these captchas are doing their jobs well as they prevent us pesky programmers from solving them lol! :-) Caroline
  6. I'm trying to grab a captcha image so that I can then pass it to the user to solve, which is why I need to get the exact image that is generated first time around. The code simply does a file_get_contents() on the URL that generates the image and then I save the output of that to a file. The actual saving of the image works... but its the wrong image - the problem is that when I access the URL that generates the image, it is different to the one on the host page. Caroline
  7. Unfortunately there are no variables. The domains I'm stuck on are ones that use just a plain URL with no variables to generate an image. Presumably it's a PHP (or similar) file that has some randomisation built in so that every time you visit that url, a new image is generated.
  8. Yeah I want to get the image that is on that page and it's tricky because every time the page is reloaded or fetched a new image is generated. How would I store instance variables?
  9. I'm using the cURL library to grab some information from a webpage. On a particular site there is an image on the page that i'd like to save to a file but the trouble is, that image is dynamically generated every time. The code contained in the HTML page is as follows: <img src="http://domain.com/branch/" id="graphic" /> (I've changed the real URL). So the URL http://domain.com/branch/ resolved to an actual image file. If I put this in my address bar I get an image file that I can save. So far so good, but I want to grab the image that was contained on the main page that I am looking at - which already has a generated image inside of the img tag. If I go directly to the URL that generates it I get a different image - not the same one. Any ideas? Thanks, Caroline
  10. I am creating files using the Zend_Log class but once finished with it, I want to be able to delete the file in some cases. However I am getting a permission denied error. The file permissions are set correctly on the log files themselves and the directory in which they are contained. I can only assume therefore that the underlying file handle to which the Zend_log object points is still open. As there is no close function on the Zend_Log class, is there a way of getting to that underlying file handle so I can close it explicitly and see if that solves my problem? Thanks, Caroline
  11. I have a database driven application that runs jobs from a queue that is held in a MySql database and accessed via Zend_DB. I have an engine that is run via a cron job that picks up these jobs and processes them. My problem is that each instance of this engine takes up around 18Mb of memory. I have a feeling the problem is with the following query: "SELECT * FROM `my queue table` WHERE `the date field` < '$now' ORDER BY `the date field` ASC LIMIT 0, 1" This is looking for the next job from the queue to process. I was hoping that by having the LIMIT clause on the end of the query that only one record would be fetched and that would keep the memory down but I'm wondering if it is the select itself that is causing the problem. In order to do the ORDER BY clause, it has to presumably sort through all the records in the queue - now over 100,000 of them and growing. Could this be the problem? I could refactor the way the queue us handled but that would be a bit of work, so is there a way I can actually test how much memory a particular query uses so I can be sure where my problem lies as right now I'm just guessing. Caroline
  12. Thank you, I've had a read of that article but I can't see any info there specifically on running PHP scripts. I think the issue is that I'm trying to run a remote script from my local PC. Running the PHP exe doesn't work as that is looking for a local path on the local machine and it doesn't recognise a URL as the path. Caroline
  13. That's good to know, do you know the syntax I would use on a windows machine? I've tried downloading the windows version of the lynx browser so that I can use a similar command line that I would use on my linux server but that's not working. When I issue the following command: "lynx -source http://mysite.com/myphpfile.php" It outputs the response that my site gives when there is a file not found error. Any ideas? Thanks, Caroline
  14. I have a Zend Application that runs on the web and allows the users to setup jobs that get put into a database in a queue system. Currently I use a cron job on my web server to run a script which runs an 'engine' which is basically just a script that takes jobs from the database queue and processes them. The problem is, my website has limited memory and I can only run a few copies of the engine concurrently before it runs low on memory. I can buy a better server but this is expensive and it occurs to me that I could use my local PC or even my laptop to run the same script. Is this possible? I have xampp installed on my local machines so the local development environment is virtually the same as that on the live server. Can I setup some kind of scheduled task on my local machine (like a cron job on my web server) to run the engine script? Thanks, Caroline
  15. If a user types in an invalid url Zend will throw up some errors and warnings about missing controllers which I don't really want clogging up my log files. I'm using the errorcontroller plugin which catches the exception and prints a friendly message to the user but there is still a php file not found warning displayed. For example if I try and access an invalid page of '/invalid', I'll get the following: 2009-11-20T15:31:27+00:00 ERR (3): PHP Warning occurred in C:\xampp\htdocs\code\ZendFramework-1.9.5\library\Zend\Loader.php on line 165 fopen(c:/xampp/htdocs/code/ima-live/application/controllers\InvalidController.php) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory I've tried using suppressNotFoundWarnings(true) on the auto loader but that doesn't seem to make any difference at all. Any idea how to suppress these? Caroline
  16. Hi there, I have a simple Zend Framework application and I am experimenting with unit testing before I develop too much code. I am using Zend_Test and the tests run ok but the assertions fail on the simplest of tests. Here is an example of what I am doing: class AccountControllerTests extends Zend_Test_PHPUnit_ControllerTestCase { public $bootstrap = 'c:\xampp\htdocs\code\ima-live\tests\TestBootstrap.php'; public function testErrorController() { $this->dispatch('poo'); $this->assertController('error'); $this->assertAction('error'); } public function testDefaultAction() { $this->dispatch('/index'); $this->assertController('index'); } The test for the error controller passes but the test for the default action fails. If I assert the last Controller to be 'error' that works so I'm assuming that Zend is throwing some kind of exception causing the error controller to be invoked. The site itself works fine both locally (using Xampp) and on a live server that I have - it's just in this test environment that its failing. I'm not really sure where to go from here. Firstly I don't know why the tests are failing but I also don't know how to get more information. Is there any way to output debugging information from the tests or write to a log file etc. Any way to extract information about the error that's being reported? Any advice greatly appreciated, Caroline
  17. My background is in desktop application development in C++ & C# and I am now learning PHP. I want to develop a membership site which will offer tools to the members and these tools will be custom written in PHP. But for the rest of the site I will want some fairly standard functionality such as a login system (I may use aMember for this as it ties in with PayPal), searching, a blog, perhaps a forum and so on. My trouble is, I just don't know how to go about building the site. I looked into CMS' such as Drupal and Joomla but I couldn't see how to integrate your own php code easily. At the other end of the scale I'm downloaded a nice simple HTML/CSS template for a site and have started using that to develop custom code and that works fine but I really don't want to be coding things like a blogging system from scratch. Then there are frameworks like CakePHP, Zend etc and I'm not sure where these fit in. I've been looking at this stuff for a couple of weeks now and I'm just going round in circles! Bottom line - I want the flexibility to develop my own tools but other than that I want to re-use as much existing code as possible. My ideal situation would be a nice CMS that allows me to build a site as easily as something like WordPress but also have sections where I just write my own PHP and bypass the CMS entirely. Any suggestions greatly appreciated. Caroline
  18. Hi there, I am new to web development, my background is with C++ and C#. In the C++ community in particular there were a handful of books containing best practices of the language that were considered essential reading such as 'Effective C++' and 'C++ Coding Standards'. I've looked around for something similar for PHP but not found anything. Does such a book exist for PHP? Caroline
  19. Thanks for the reply, that is what I was afraid of. But I still don't want to be coding the mechanics of a site from scratch. If it's not practical to plugin PHP code into a CMS such as drupal, then can it be done the other way around? In other words, are there frameworks, libraries etc that allow you to easily build a website around some PHP code? Caroline
  20. I am brand new to PHP and so I am not familiar with the tools and frameworks around but after having done some digging it sounds like Drupal may be good for what I want to do. I want to build a subscription based site that offers various tools (written in PHP) to the paid members. The tools would do a variety of things but mainly communicating with other sites such as YouTube, Google etc. I also want to build PDF's within the tool and various other stuff. I don't really want to develop a PHP site from scratch because my HTML & CSS are not great so I like the idea of using something like Drupal to manage the website itself with a nice theme, use a module to add on a forum, etc. So my question is, can you use Drupal to code your own completely custom PHP applications within it or am I somehow restricted by what Drupal can do? I want to be able to write my own PHP application in my own way but then just plug it into a website that has been built with something easy. I don't want to re-invent the wheel coding user admin, blogs, forums, blah blah. Will Drupal allow me to do that? Thanks! Caroline M
  21. I am brand new to PHP development and so far my only experience with any CMS has been WordPress. I did figure out how I could get WordPress pages to execute my PHP code but it wasn't ideal and I'm sure that would only be suitable for the simplest of applications. My intention is to build a subscription based website featuring various tools developed in PHP. In addition to the tools themselves I want to add functionality to the site such as a blog, forum, helpdesk, videos etc so another CMS that makes that stuff easy would be great. After some initial investigation it seems as though both Joomla and Drupal will do what I want, both are supported by my web host, both are integrated into the membership system I want to use and both seem popular. So, any idea which might be better for my application? If neither offers any particular benefit is either one easier or quicker to learn than the other? Right now I'm leaning slightly towards Joomla but only because their website seems nicer :-) so any suggestions would be most welcome. Caroline
×
×
  • 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.