trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
With the layout you have you should tell composer that you are using psr-0. Then, as long as you are using namespaces that coincide with your directory structure your classes will be autoloaded.
-
<?php error_reporting(E_ALL); init_set('display_errors', 1); Sorry, Ive lost my crystal ball.
-
Your question is as clear as mud.
-
What is it that you are actually trying to do?
-
PDO is not a database abstraction. It provides you the same API across databases, but it does nothing to protected you against differences in syntax between those systems. For that you would need to use something like Doctrine's DBAL on top of PDO.
-
You do realise what you are doing is opening a huge security hole? Your basically allowing anyone to inject content directly into your page.
-
PHP spl_autoload_register, spl_autoload and __autoload functions
trq replied to Ansego's topic in PHP Coding Help
Given a class called Foo within the file /lib/Foo.php spl_autoload_register(function ($class) { include '/lib/' . $class . '.php'; }); $foo = new Foo;- 6 replies
-
- spl_autoload_register
- spl_autoload
-
(and 1 more)
Tagged with:
-
PHP spl_autoload_register, spl_autoload and __autoload functions
trq replied to Ansego's topic in PHP Coding Help
I wouldn't bother creating your own autoloader, composer comes with one built in, just use that. On a side note, autoloading has nothing to do with creating objects from classes.- 6 replies
-
- spl_autoload_register
- spl_autoload
-
(and 1 more)
Tagged with:
-
Do you have a specific question?
-
There's nothing you can do in Perl, Ruby or Python that you can't do in PHP, however, some of these languages do already have certain specific tools writen in them that can come in very handy when developing PHP. For instance, Vagrant (a tool for managing development environments) is written in Ruby. Provisioning tools such as Chef and Puppet are written in Ruby while Salt is written is Python. Capistrano (a deployment tool) is written in Ruby, though there are also deployment tools such as Rocketeer written in PHP. Basically, learning another language is never going to harm you. A decent dev should have at least a handful of languages under there belt IMO.
-
You viewFriendIfExistOnTbl function does nothing to check if two users are friends. It just checks to see if the current user has any record in the friend table.
- 6 replies
-
- relational database
- php
-
(and 1 more)
Tagged with:
-
You seem to have a function within a function. That will not work as expected. If you trying to do method chaining, your need to have your methods that wouldn't normally return any useful result return an instance of the current object.
-
You cannot call header after outputting content to the response stream. Simple. Arrange your code so that you are not doing that and these errors go away.
-
You need to clarify exactly what this means. Where did you install a nameserver?
-
Assuming the DNS is managed by a different machine I don't see how it could possibly be the machine your pointing to.
-
Where? Drupal is written in PHP but you don't necessarily need it to add content.
-
I just don't see the point to be honest. The beauty of "web" apps is they are maintained in a single location. SaaS is here to stay, it's becoming more and more popular for good reason.
-
After having a quick look at your code, I say find a framework. Your code isn't great, but you know more than the basics, you just need some steering in the right direction in regards to patterns etc. A framework will teach you a lot about how to structure things it's way. Once you have mastered doing it there way, you can then start to break out (with the experience you have gained) and do things your way again.
-
<?php $query = 'foo'; ?>
-
I meant the api provider. If you don't know what it is, i'm not sure who would. What do the logs say about these requests?
-
The error is pretty self explanatory, your haven't defined $query anywhere before you use it.
-
Php comes with a web server built in. Still though, I'm not sure "client side" apps is a great domain to be using php in. I meen, you'd need to take care of the installation and maintenance of php and all then.
-
I would suggest you contact the provider, something weird is going on there.