FuelPHP

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
I sit in IRC with the developers a lot. FuelPHP is the brainchild of really 3 people who got frustrated with the company behind codeigniter's slow release cycle. One of them actually worked for EllisLabs which is why there was a bit of turmoil at the beginning of the year.

The biggest frustration came from CI's PHP4 compatibility layer. Kohana is pretty much in the same boat for the same reason. PHP 5 especially 5.2 and 5.3 have some very good OOP ideals that make implementing enterprise-grade design patterns a reality. It really makes PHP one of the better web languages despite whatever nonsense you hear from a Ruby guy who will try to sell you the world with Rails conventions.

Since then the PyroCMS/FuelPHP developers have mended and extended EllisLab's relationship with the community.

The last time I actually played with FuelPHP I wound up not going too far because of its lack of NginX support. I think they've fixed that since and I'll play around with it. But essentially it is made by a quality team of guys who understand PHP's OOP model and love interfaces, abstracts and namespaces and want to do more Java/C#-like stuff with php.
 

Ka0t1x

Golden Member
Jan 23, 2004
1,724
0
71
I've been doing PHP for nearly 9 years, and I've dabbled in Rails for a while now. When I seen this my eyes lit up because its a pretty good mix of everything combined, really. I gave it some time and I've come to like it, there was a problem with the scaffolding but its an easy fix. That's the problem I had committing with CI.. the object stuff wasn't really up to snuff.

I'm just waiting for Oracle support before I pitch it to the PM for version 2 stuff.

I was really happy to get a command line for database changes.
 
Last edited:

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
Eh, I don't get hung up in one programming languages object model vs anothers. In some ways ruby is a step back (interfaces). Python has its object model quirks too (privacy). At the end of the day it all boils down to the right tool for the right job.

I think legacy apps need something like codeigniter. Start ups need something like rails, grails. Or we could all just move to Spring 3 or .Net MVC and be done with it. :)
 

uclabachelor

Senior member
Nov 9, 2009
448
0
71

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I've been doing PHP for nearly 9 years, and I've dabbled in Rails for a while now. When I seen this my eyes lit up because its a pretty good mix of everything combined, really. I gave it some time and I've come to like it, there was a problem with the scaffolding but its an easy fix. That's the problem I had committing with CI.. the object stuff wasn't really up to snuff.

I'm just waiting for Oracle support before I pitch it to the PM for version 2 stuff.

I was really happy to get a command line for database changes.

It says it supports PDO, that should work for oracle right?
 

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
You really need the instant client on your machine to touch an oracle database. PDO usually isn't enough unfortunately.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
Yea but you install instant client, then you use pecl to make everything work with pdo.
 

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
Yea but you install instant client, then you use pecl to make everything work with pdo.

Indeed. But I tell you that just isn't easy advice to give. The instant client is only supported on Redhat ES and several other distros. You might as well say to someone, "switch distros or learn to hack the userspace." Because that is what you need to do in most cases. It is actually easier to develop Oracle PHP applications on Windows or Mac.

Barring the latter, there are how-to's to installing the instant client on Ubuntu and Debian which are completely unsupported by Oracle and will not work out of the box. You must spoof your userspace to point to files that only exist on Redhat ES.

It is not a terrible out of your way... but it is a deal breaker for people who have just jumped into an oracle shop.

http://obsessivecoder.com/2010/04/2...0g-on-ubuntu-9-10-karmic-koala-server-64-bit/

But that is a start :)
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
We use pdo and oracle on ubuntu and have for the last 5 years in production. So if anyone needs help it's dead simple to configure and only requires a library install and 2 simlinks.
 

beginner99

Diamond Member
Jun 2, 2009
5,320
1,768
136
somewhat off topic but connecting to oracle (not only from php) is a PITA. It might be the server I'm connecting to, not sure, but basically from all of those many possible connection strings only the full "tnsnames-like" version with SID worked for me.
Not to mention that getting it to run in the first place was a bit cumbersome too. MySql postgresql, java-databases are a charm compared to it.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
somewhat off topic but connecting to oracle (not only from php) is a PITA. It might be the server I'm connecting to, not sure, but basically from all of those many possible connection strings only the full "tnsnames-like" version with SID worked for me.
Not to mention that getting it to run in the first place was a bit cumbersome too. MySql postgresql, java-databases are a charm compared to it.

I've always just done:

Code:
$db_username = 'user';
$db_password = '123456';
$db = 'oci:dbname=hostname/InstanceName';
try {
	$dbh = new PDO($db,$db_username,$db_password);
} catch (PDOException $e) {
	print "Error!: " . $e->getMessage() . "\n";
	die();
}

or for codeigniter

Code:
$dbhost = 'hostname';    //host
$dbport= '1521';          //port default is 1521
$dbname = 'PROD';        //name of database or instance  
$dbConnString = $dbhost . ':' . $dbport . '/' . $dbname;

$db['default']['hostname'] = $dbConnString;
$db['default']['username'] = 'user';
$db['default']['password'] = 'pass';
$db['default']['database'] = '';
$db['default']['dbdriver'] = 'oci8';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
 

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
We use pdo and oracle on ubuntu and have for the last 5 years in production. So if anyone needs help it's dead simple to configure and only requires a library install and 2 simlinks.

It isn't quite dead simple on 64 bit versions that run headless. Trust me, I wish it were. It is completely possible but it isn't dead simple. Dead simple is running instant client setup on Solaris 5.10.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
It isn't quite dead simple on 64 bit versions that run headless. Trust me, I wish it were. It is completely possible but it isn't dead simple. Dead simple is running instant client setup on Solaris 5.10.

Ok,

Simple, cause we run 64bit headless vm's. It's 7 major steps.

Installing oracle instant client on ubuntu.

Install the required software to compile on ubuntu.
sudo apt-get install build-essential php5-dev php-pear libaio1 unzip

Download the Oracle Instant Client, you need the basic (not rpm) and the sdk
Run these commands
cd /opt
sudo unzip <location-of-instant-client-basic>
sudo unzip <location-of-instant-client-sdk>
mv instantclient_11_1 instantclient
cd instantclient
sudo ln -s libclntsh.so.11.1 libclntsh.so

The symbolic link is needed by during the compilation step later.
Now install the oracle php module
sudo pecl install oci8

You will be prompted for the location of the library:
instantclient,/opt/instantclient

If successful, you may now add a file containing the following line to /etc/php5/conf.d/
extension = oci8.so

Now install your tnsnames.ora file into /opt/instantclient

Now you need to specify a path in the Enviroment variable TNS_ADMIN. This should point to your tnsnames.ora file on the server. I placed my tnsnames.ora in /opt/instantclient and used the SetENV function in the /etc/apache/envvars file to set the path.
export TNS_ADMIN=/opt/instantclient

Restart apache
sudo /etc/init.d/apache2 restart

Check <?php echo phpinfo() ?> to verify if the OCI8 module is available.

Very easy to do. PDO after that is even easier. We run 75 ubuntu servers.
 

hooflung

Golden Member
Dec 31, 2004
1,190
1
0
Code:
ENV="$ENV TNS_ADMIN=/opt/instantclient LD_LIBRARY_PATH=/opt/oracle/instantclient"

I've added that to the apache2 file, under the original ENV= line, inside init.d instead of using the envvars method.