Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
How to save new record with multiple primary keys
If [123] is the foreign key, and defined as only foreign key in the relationship, then you should indeed pass the other two values to forge(). Can you do: $model = Model_A::find_by_targetid($targetid,array('related'=>array('somethi…
Comment by
WanWizard
March 2017
permalink
How to save new record with multiple primary keys
What exactly doesn't work? If Model_Something has a compound primary key with 3 columns, how many are foreign keys? In the forge() array, you should only pass the data for columns that are not foreign keys. Also, make sure that your relationshi…
Comment by
WanWizard
March 2017
permalink
How to save new record with multiple primary keys
There is btw a helper method available: $fk = Model_Something::implode_key(array('a_id' => $a_id, 'no' => $no));$model->something[$fk]->delete();
Comment by
WanWizard
March 2017
permalink
How to save new record with multiple primary keys
If you want quick and direct access to the record, you could do it like that, yes. I have to say that personally, I always try to avoid compound keys, and go for a single auto-increment 'id' column als primary key. So I don't have a l…
Comment by
WanWizard
March 2017
permalink
How to save new record with multiple primary keys
You don't need to add the foreign key, the ORM will do that for you. $model = Model_A::find_by_targetid($targetid, array('related'=>array('something'=>$condition));$record = Model_something::forge(array('no'=…
Comment by
WanWizard
March 2017
permalink
How to get previous url
It works, I'm sure of that. But you have to find out why it doesn't function in your specific case. To make it work, you need to have the correct $_SERVER['HTTP_REFERER']. So start by debugging that, what does it contain at the …
Comment by
WanWizard
March 2017
permalink
Change database not from config/db.php
You're welcome. Happy coding! ;-)
Comment by
WanWizard
March 2017
permalink
Oil Generate Package with Drivers
Then it should see switches with a single dash just fine. Weird.
Comment by
WanWizard
March 2017
permalink
Is it possible to decrypt password using simpleauth?
Yes, it is (at the moment). You can also manually copy the Observer_Typing class in the Orm package over, that is the only file changed.
Comment by
WanWizard
March 2017
permalink
Change database not from config/db.php
The ORM caches objects on modelname + primary keys. So yes, if you switch connections, you may bump into cached items if the databases contain records with the same key values. You might have to add a method to your model to clear the cache when you…
Comment by
WanWizard
March 2017
permalink
Change database not from config/db.php
I've done a quick scan of the Orm query code, and as far as I can see, it uses the defined connection anywere. Could you enable the profiler (in your config.php), en enable database profiling on all your database definitions ( add $mydb['p…
Comment by
WanWizard
March 2017
permalink
Change database not from config/db.php
Every database object has an internal connection object, which is persistent. These database objects are stored by name (in your code, $conn_str). As written before, this name must match a database configuration entry. From the code I've seen, …
Comment by
WanWizard
March 2017
permalink
How to get previous url
the raw previous URL, if it exists, is stored in $_SERVER['HTTP_REFERER'], see http://php.net/manual/en/reserved.variables.server.php As this is not secure, and can be faked / overridden by clients, Response::redirect_back() will only redi…
Comment by
WanWizard
March 2017
permalink
Is it possible to decrypt password using simpleauth?
If you need to store it. use the Crypt class to encrypt / decrypt it. That at least would require access to both your database data and your code to be able to decrypt it (as the keys are in the crypt config file). If you're using Orm, 1.9/dev …
Comment by
WanWizard
March 2017
permalink
Oil Generate Package with Drivers
Could be that php.exe sees a commandline switch with a single dash as for him instead of for the php script, so it isn't passed on. You could probably test that with "php oil -v -l" (small letter V, small letter L). If they are passe…
Comment by
WanWizard
March 2017
permalink
Is it possible to decrypt password using simpleauth?
No, passwords are hashed, not encrypted. And from a security point of view, it is a very BAD idea to store passwords. Ever. If someone asks you to do that, explain to them it is not an option. Instead, add a mechanism to your application with which …
Comment by
WanWizard
March 2017
permalink
Oil Generate Package with Drivers
It works on Linux, perhaps a quirk on Windows? I don't have that environment handy, does using "--d" instead of "-d" work?
Comment by
WanWizard
March 2017
permalink
oil scaffold / admin fatal error
Your original issue should have been resolved now in 1.9/develop. https://github.com/fuel/core/issues/2051 Could you verify that is the case?
Comment by
WanWizard
March 2017
permalink
Regarding closure in FuelPHP 1.8
And what is the problem with it? Or does it work now?
Comment by
WanWizard
February 2017
permalink
Regarding closure in FuelPHP 1.8
You are using short array notation? That is not supported in PHP 5.3, only in 5.4+.
Comment by
WanWizard
February 2017
permalink
IIS Server Variables
I'll add that IIS link to the docs, in case other people have this problem. Thanks.
Comment by
WanWizard
February 2017
permalink
problem with create MongoDB instance
You might be able to get it to work using this Composer package: https://github.com/alcaeus/mongo-php-adapter
Comment by
WanWizard
February 2017
permalink
problem with create MongoDB instance
There are two PHP exensions for Mongo, the "mongo" PECL extension (which is now deprecated) and the new "mongodb" extension. Fuel uses the older extension, and I assume you have the new one installed, which is not supported at th…
Comment by
WanWizard
February 2017
permalink
IIS Server Variables
Where and how did you set FUEL_ENV? There is no reason why IIS rewrites would fail because of an environment variable, and on the Fuel side, it is only used to load a different set of config files.
Comment by
WanWizard
February 2017
permalink
Full text search in DB class or ORM?
No, I personally have very little Postgres experience.
Comment by
WanWizard
February 2017
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,369
Last Active
10:33PM
Roles
Administrator