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
Sessions and redirect causing session to lose some values
Ah, and a ps: If you make sure your logging is set so that you at least \Fuel::L_ERROR, you would have seen the exception error message in the log. Would have saved you a lot of searching...
Comment by
WanWizard
February 2014
permalink
Sessions and redirect causing session to lose some values
There is no magic in Fuel. At least not of the type that decides to do something on it's own. In general, using cookies for session is a bad idea. It requires encryption, which introduces CPU overhead, encrypted data is base64 encoded, so it t…
Comment by
WanWizard
February 2014
permalink
Sessions and redirect causing session to lose some values
What Fuel version are you using? What are you using as session backend? And do you have the issue in every browser?
Comment by
WanWizard
February 2014
permalink
Sessions and redirect causing session to lose some values
Flash data expires at the next request, used or not. Which means that when you redirect, you lose your flash data, unless you 'refresh' your flash data like Marcus suggests, or you disable flash auto-expiry in your session config by sett…
Comment by
WanWizard
February 2014
permalink
How to use MySQL functions in 'where' section
As I expected, you can not use DB::expr() in 1.5.
Comment by
WanWizard
February 2014
permalink
relationship 1-* between 2 tables
That is what I don't understand either. In your code it is not assigned a value, and the ORM will not invent one. The only thing I can think of is an error in your relation definition, so that the ORM thinks it is a foreign key, and because o…
Comment by
WanWizard
February 2014
permalink
How to use MySQL functions in 'where' section
I'm not sure DB::expr() was supported in where() clauses back in 1.5. What is the exact error message you get?
Comment by
WanWizard
February 2014
permalink
relationship 1-* between 2 tables
Where does the '1' come from? Normally your 'id' column is primary key, and defined as auto increment. Which means collisions can not occur because the database will assign the next free number. If you already have a record wi…
Comment by
WanWizard
February 2014
permalink
rolepermissions sets old records role_id to 0
Ah, ok. It depends. If you create a relation, you should start with a Rolepermission object, and assign it a Role and a Permission. And possibly a subset of actions. If you want to delete a relation, either fetch the Role or the Permission, and un…
Comment by
WanWizard
February 2014
permalink
rolepermissions sets old records role_id to 0
There is a many-to-many relation, so permissions are not deleted unless you do that yourself. Which is a good thing, the same permission record could be assigned to other roles, to groups or to users...
Comment by
WanWizard
February 2014
permalink
Assets in modules vs. public (best practices)
Can't tell you, because we haven't decided on a new solution for Assets, and we haven't started on the Theme class yet. We haven't even decided whether or not we're going to support this outside themes. But if you want my 2…
Comment by
WanWizard
February 2014
permalink
relationship 1-* between 2 tables
No. ORM enables cascading saves by default, so if you $office->save(), it will automatically save related objects, and ORM also deals with all foreign key business. So this is enough: $office = Model_Office::query()->get_one();$user = new Mo…
Comment by
WanWizard
February 2014
permalink
Add random token_salt to config.php
perhaps use save(), instead of load, set and load again?
Comment by
WanWizard
February 2014
permalink
relationship 1-* between 2 tables
You would define: Office has_many User, and User belongs_to Office. You always define the relation both ways, it is important with cascading saves and deletes, and to know what are foreign key columns and how to treat them. The foreign key (let…
Comment by
WanWizard
February 2014
permalink
Assets in modules vs. public (best practices)
I don't think there is such a thing as "best". We're looking into solving this issue for Fuel v2, and also build this into the Theme class (so themes will have asset and module support too).
Comment by
WanWizard
February 2014
permalink
Assets in modules vs. public (best practices)
Currently that is not possible, since assets need to be publicly accessable (hence they have to be in ./public), while your module code shouldn't be. The only way to deal with 4 and 5 is to make a controller that serves the asset. You could cr…
Comment by
WanWizard
February 2014
permalink
FuelPHP even more faster?
Zephir is a different language, so still you can not compare the two. A framework is about saving development time, because it automates and abstracts complicated processes, and deals with all the boilerplate of every application. It is not about s…
Comment by
WanWizard
February 2014
permalink
Add random token_salt to config.php
It doesn't overwrite, it merges, both for config and for lang files. In order of importance (low -> high): - fuel/core - packages - fuel/app - current module (if present) And for config, for each of these locations, both the global config,…
Comment by
WanWizard
February 2014
permalink
Add random token_salt to config.php
Not sure what the problem is. Losing the comments in config.php? Other than that, I don't see any issue with saving an updated config. You can also save your changes to the environment config folder (like you do with db), that will override th…
Comment by
WanWizard
February 2014
permalink
file handle how to read file of csv format
Read the (PHP) docs. As of PHP 5.3, the fileinfo extension MUST be present by default in your PHP installation. As such, FuelPHP expects it to be there. If this is your local machine, install it (for Windows, you need to load a DLL which should be …
Comment by
WanWizard
February 2014
permalink
Namespaces ?
If the current class is in a namespace, correct. Whenever you want to access a class in another namespace, you have to specify the namespace. Even if that other namespace is "no namespace" (which PHP calls the global namespace). This is a…
Comment by
WanWizard
February 2014
permalink
Add random token_salt to config.php
I see no reason why you can't load the 'config' config, change it, and save it again. Yes, it will replace the complete file, that is what save does. But from a functional point of view that should not matter. If you want to replace…
Comment by
WanWizard
February 2014
permalink
Best way to create modules
You don't need to change the prefix. If in your app a controller is defined as: class Controller_Welcome extends Controller {} then in a module called Mymodule, it is defined as namespace Mymodule; class Controller_Welcome extends \Controll…
Comment by
WanWizard
February 2014
permalink
Best way to create modules
You can always generate as normal, and then move the file from app/classes to the yourmodule/classes folder. All you need to add manually is the namespace statement. I personally never generate anything. Once you've made your first controller …
Comment by
WanWizard
February 2014
permalink
Best way to create modules
Still missing docs, and some corrections to the PR. So I can't merge this functionality yet.
Comment by
WanWizard
February 2014
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,371
Last Active
May 14
Roles
Administrator