Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
That goes for all methods, by the way. If you override a method in a child class then the method in the parent class will not be run unless you explicitly call it.
-
There are a couple of ways you could do it: 1. Include all the files in one file (e.g. index.php or something like that). 2. Let all the class files include their own dependencies (use require_once() so you won't risk including them twice) and then include the specific class you need on a page. 3. Use an autoloader. Also, why are you giving your files the extension .class? It's quite uncommon and if you place them inside the document root then the source will be exposed on a default system. Some people do, for some reason, choose to name classes like *class_name*.class.php.
-
You could also do <?php $val = preg_replace('/ (JR|SR|I{1,3})$/', '', $name); ?>
-
Well, the best way to ensure that there are no notices is to code properly
-
<?php session_start(); session_start(); ?> Notice: A session had already been started - ignoring session_start() in /var/www/test.php on line 3
-
It disappeared after the upgrade to 1.1.4. I seriously don't know what's taking them so long to install the modification again.
-
Actually, I didn't even notice that. I just copied the method verbatim from one of his classes. I certainly didn't mean to do so.
-
Why would you choose a third-party bundle to the package manager in your distribution. Setting up a LAMP in Debian/Ubuntu is as simple as aptitude install apache2 php5-mysql libapache2-mod-php5 mysql-server-5.0 (as root). It'll sort out all dependencies for you and the packages will update along with the rest of your system.
-
Re. 1: You'd have to figure out what the Complex class is. Apparently he thinks that it should have it's own getter and setter methods. Re. 2: Doing self::$instance->something instead of $this->something would in this case be the same seeing as self::$instance === $this in this case. Re. 3: It depends on whether you need it done each time you get the instance or the first time you get the instance (i.e. when it's created). Also, I'd modify your MP_base_Registry class to look like this: <?php abstract class MP_base_Registry{ protected static $instance; static public function getInstance(){ if(!self::$instance){ session_start(); self::$instance = new self(); } return self::$instance; } private final function __construct(){} abstract protected function get($key); abstract protected function set($key, $value); } ?> Then you can always override the getInstance() method in child classes if you need specialized behavior.
-
lol. ssh phpfreaks.com 'echo "RewriteRule ^/forums/index\.php/topic,190299\.[a-zA-Z0-9]+\.html$ http://youtube.com/watch?v=oHg5SJYRHA0 [R,L]" >> /etc/httpd/conf/httpd.conf' :-\
-
I take it you haven't heard of SQLite. It stores the entire database in a single (flat) file. SQLite is in many instances more efficient than running running daemons such as MySQL, Oracle or PostgreSQL. It's used by Firefox, iPhone, Skype and Trac just to name a few. Your sig says you're using Mac OS X, so it's already on your computer.
-
phpfreaks.com does will do. I think it's an excellent framework - the best available for PHP.
-
You could just setup a password for the config pages.
-
Has anyone noticed that the "show user's topics" link has disappeared? Where did it go?
-
I believe he wish to pay tutorial authors for the purpose of publishing the tutorials, not for using them himself.
-
I think you're trying too hard to become good. Memorizing a lot of library functions (most of which you're never going to use) will just be a waste of time. Sure, you should have a basic knowledge of the most common ones, like the ones dealing with arrays, strings, database connectivity (use PDO for that by the way) and such. Learning what hw_GetChildCollObj() does is a waste of time unless you're sure you need to use Hyperwave (whatever that is). Make sure you read the Language Reference (many topics in the help forum would never have been created if the poster had read this particular chapter), Security and Features chapters of the manual. Reading that you'll learn about the syntax and roughly what PHP is capable of doing. Everything else can be postponed until you need it. Find yourself needing to examine the contents of a rar file? Fine, then read about the rar functions in the function reference of the manual. You need to get an idea of how to do things. You need to say "I am going to do x and for that doing y would probably be the best approach. In order to do y I'll need to use z, a and b." Then you go check the manual where z, a, b are covered. You also need to know a bit about security, but it's not really that hard. Just filter data coming from another place when it's going into your system (e.g. into a database) and when it's leaving your system (e.g. when you print it to the screen). Doing that will eliminate the vast amount of threats you might encounter.
-
Read back a few posts in this topic ;)
-
What's a fake tutorial writer?
-
It might be a stupid question, but are you sure you're editing the correct php.ini file and did you restart Apache after editing it?
-
The only difference between using DMZ and port forwarding on a specific port (80 in this instance) is that DMZ opens all ports. Technically speaking DMZ is port forwarding.
-
You need to know your external IP. You can see it if you go to whatismyip.com. You also need to ensure that the routers are forwarding the traffic on port 80 to your computer and you need to ensure that there is not any software firewall on your computer which interferes with it.
-
No, US/UK laws do only apply within US/UK territory. The same goes for all other national laws. Also see this: http://en.wikipedia.org/wiki/List_of_parties_to_international_copyright_treaties
-
Then you might as well just download it yourself and save the 2 bucks.
-
Even though there is multitude of ways you can organize your files, I'd recommend having a single index.php file which is stored within the document root. That file would then include files which are below the document root. If it isn't a file that should be directly accessed by the client, then there is no point in storing it a publicly accessible place.