Jump to content

r_honey

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

r_honey's Achievements

Member

Member (2/5)

0

Reputation

  1. In .NET & Java, modular programming is implemented as reusable assemblies or jar files, which can be referenced from other projects. However, I found no such approach available in PHP. There is no way to write code that can be used across projects in a central location, and reference it from multiple projects. I need to copy/paste it manually to project directories, and keep them updated. A bigger problem is include files. You have to include the file containing classes so that the classes are available. Now, I have begun working on a PHP project, that might end in excess of hundreds of classes. My way of programming is to keep each class in a separate file and logically organize classes in folders. Now how should I ensure that each script includes all files that contain classes it uses?? I though of one option. To organize the classes in namespaces, and arrange them in folders named after thir namespaces. Then I would implement the __autoload magic function, and include the file: [Root]/MyCompany/Util/XmlUtil.php corresponding to the class name: MyCompany/Util/XmlUtil when that name is passed to the _autoload function. But soon I found out, that namespaces were made available in PHP 5.3, and the server I am working on has PHP 5.2.8 I am now thinking of to include just one file "includeAll.php" in every script, that would then include all my classes in every script. Is that a good option in terms of performance or usability? Does it affect performance to include files in a script that might not actually be used by the script?? How does CMSes like Drupal, Joomla tackle this problem as they also should need to include many files in each script??
  2. Also an advice on the IDE. I am looking for the best with the most comprehensive coding & debugging features. I know, best is a vague term, but I have zeroed my options to 4: Zend Studio, Komodo IDE, Aptana, & NetBeans. Any suggestions?
  3. It has been probably one and a half years since I had a PHP assignment. From there on, it was almost exclusively ASP.NET assignments. And that is a damn lot of period in development world to change everything. And now, I again have a PHP one. I remember having to drop Html controls (or widgets, whatever you call them) manually on a PHP page, and then having to manually restore their ViewStates (that's an ASP term, but I hope I am clear what I mean) on a PostBack, if the same form was again rendered to the browser. Now, that's one thing that hampers productivity. So, has there been any such changes in PHP that enable server-side control like things, that can automatically maintain their state between PostBacks? If not, are there any (free or open-source) Thrid party libraries in PHP that provide similar functionality? Also, is there any PHP wrapper for ExtJs available (like there is Coolite for ASP.NET)?
  4. Thanx!!! I already googled & found SqlYoga, which did my job nicely. However, thanx for the reply. I have downloaded HeidiSql. It is small & fast. It might do my some other job some other time. And the Sql command line statement would also help.
  5. I backed-up my database from a Hosting server in the form of a Sql Script file. I want to analyze the DB on my local system. The script file is a bit large. When I try to import it using phpMyAdmin, the request times out after 300 seconds (but the import is still in progress). I am not sure whether Php is timing out the request, or it is MySql. Please help!!! (also which environment variable in Php or MySql ini file would I need to change)!!!
  6. In my script, sample.php, for the following redirection: header("Location: anotherPage.php?isValid=true"); isValid is passed to anotherPage.php in the URL, so has to be retrieved using Get. The only thing I want to change for the above redirection is that I want to pass the value isValid using Post, so that it is invisible to the user.
  7. Where did you post the data in your reply to index.php??
  8. In some situations, I want to redirect my user to a page with some information being posted to the page. Getting data is very easy by just extending the URL with the parameters. Is this possible with the header function. Or is there any other method of accompolishing this???
  9. I am trying to make by classes Iterable by implementing Iterator Aggregate & Iterator interfaces. But whenever my class implemets any of these, I get a Class Not Found error for that class. So, how can I make my class Iterable???
  10. Looks like type casting or type checking is the only solution. Thanx guys...
  11. I believe you did not get my point. Ok then, tell me if $a = integer; is valid or not in PHP??? And ues, I mean like an array...
  12. There are two things I am trying to accompolish with PHP types & arrays. Hope somebody here can help me: 1) You can use in PHP. That helps you to recapture the purpose of the variable when you or others visit the code later. I am trying to initialize the above variable, i.e. something like or All these give parse errors. Is it possible to accompolish what I am trying??? 2) You can return an array for indexing with both associative & otherwise, with mysql functions. I need to provide a similar functionality in my library, where users can enter elements in an array using keys, but retrieve it later using numeric indexes in the order in which they were entered. So, is this feasible???
  13. My Hosting provider puts a limit on the maximum no. of simultanoeus DB connections. So, I am providing a wrapper to my DB layer through which all modules request new DB connections to keep a check on the permissible maximum... I need to make sure that only one script, page or thread (whatever you call it) is executing inside the Request connection method of the wrapper. So, is there any built-in support for synchronization in PHP like there is synchronized construct in Java...
×
×
  • 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.