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
Error with DB::count_last_query() in 1.8.0
ping? Any chance to have a look at it?
Comment by
WanWizard
April 2016
permalink
Access a related object with another field than id
Also, not every RDBMS has the same capabilities. So where one supports a given datatype, others don't, so you don't always want the ORM do an automatic conversion. Compare for example the list of supported datatypes between Postgres and…
Comment by
WanWizard
April 2016
permalink
Access a related object with another field than id
You don't want that, that is what the typing observer is for. If you go down this route, you'll have to implement automatic conversion for any possible data type, and not only arrays, after which it will become quite messy and complex ver…
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
No. The code doesn't do anything with quality, it only calls http://php.net/manual/en/function.imagerotate.php to rotate the image.
Comment by
WanWizard
April 2016
permalink
ver 1.9
You need to do "php composer.phar install" This will give you a development setup, so git clone's. If you only want the code, use "php composer.phar install --prefer-dist" instead.
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Both have a transparent background here. I don't have Photoshop (no Windows), but I've tested in two image viewers, in Firefox, and GIMP. If I remove the alpha channel of those images in GIMP, I get a white background. So I'm still …
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
I can only force a black background by explicitly setting it, either in the config (and not overriding it in the code), or using ->config('bgcolor', '#000')
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
You are right in that the code suggests you should get a black background. Problem is I can't reproduce it. I used your original image, and this test code: $result = Image::load(DOCROOT.'assets/img/cigar.png') -&…
Comment by
WanWizard
April 2016
permalink
ver 1.9
I'll look into it. Don't really understand it, the referenced version "dev-1.9/develop" does exist on Packagist.
Comment by
WanWizard
April 2016
permalink
Access a related object with another field than id
You can do that, just use an array and use the Typing Observer to do the serialization (see for example \Auth\Model\Auth_User, it uses that for profile_fields). The advantage is that you keep all data in a single table, the downside is you can…
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
You're welcome. It's something you've got to get to grips with I'm afraid, it's basic object oriented PHP, you'll encounter it more and more.
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
If you need to add to a property that is defined in a parent class, use the _init() method. A complex example from one of our apps: /** * Model runtime initialisation */ public static function _init() { // add te requi…
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
You still override the property definitions from the Auth model. So remove $_observers and $_properties. The are all defined in the parent class. The tablename, although not needed, and all methods can stay.
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
And your fuel/classes/model/user.php is now completely empty, except for
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
$user = \Model\Auth_User::query()->where('id', '=', 7)->get_one(); returns exactly the same. What is your exact query statement?
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
Hmm... Your original image, with your code, produces a rotated image with a vertical cigar and a transparent background here. http://zupimages.net/viewer.php?id=16/15/2djy.png You did update your local code with my last fixes regarding the water…
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
I can't reproduce your problem. Test code: $user = \Model\Auth_User::find(7); var_dump($user); die(); Output (as you can see, _data[profile_fields] has become an array): object(Auth\Model\Auth_User)[35] protected …
Comment by
WanWizard
April 2016
permalink
Watermark and padding
Just committed both features. You can define different padding for top/bottom and left/right by passing something like array(10,20) for the padding.
Comment by
WanWizard
April 2016
permalink
Watermark and padding
Padding is defined in pixels, so it's a number. And padding happens depending on the defined position. If you define "center", no padding happens at all, because center is center. You can't use padding to define an "offset&…
Comment by
WanWizard
April 2016
permalink
Image class and bgcolor in preset
I can't reproduce it. If I take an image with transparency and rotate it using your code, the image is still transparent. Tried with both transparent GIF and PNG files.
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
I've posted that a few messages back: https://github.com/fuel/auth/blob/1.9/develop/classes/model/auth/user.php If you use Simpleauth and have run the auth migrations to create the user table in the correct format, you can just use this model:…
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
Auth is the Auth package (in fuel/packages/auth). That also has models, but for Ormauth. However, it's perfectly fine to look at the model (see link above) to see how the typing observer is implemented, and how the properties array should look…
Comment by
WanWizard
April 2016
permalink
Fuel\Core\PhpErrorException [ Notice ]: unserialize(): Error at offset 5 of 60 bytes
If you use the Auth package's user model, it will happen automatically. If you use your own model, use the Typing observer, and define the profile_fields' data_type as "serialize". See https://github.com/fuel/auth/blob/1.9/devel…
Comment by
WanWizard
April 2016
permalink
Access a related object with another field than id
Yup, that's a perfectly acceptable solution. Just be careful when selecting subsets. Because of the caching done by the ORM, once you selected a subset of parts (for example by using a WHERE clause), you can not access all of them anymore, b…
Comment by
WanWizard
April 2016
permalink
Mailgun API newline
Ok, thanks for the feedback.
Comment by
WanWizard
April 2016
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,367
Last Active
May 4
Roles
Administrator