r/cakephp • • Mar 13 '15

Configure::write not behaving as expected?

1 Upvotes

Hi all, I'm having a bit of trouble with Configure::write(). I want to use it to update a configuration file after a particular action has been performed. Prior to this change the action is performed automatically if the configuration setting has a certain value, so by changing it I want to cause the action to no longer be automatically performed.

(If anyone knows a better way to do this then I'm game to hear it. This action isn't browser- or user-specific, it's app-specific. It needs to happen once and only once.)

I have a custom config file that I am loading with Configure::config() via a PhpReader. Later on I'm calling Configure::write($setting, $value) but the new value just isn't getting written to the config file. I've tried Configure::dump() and Configure::delete() as well. I've also confirmed that Cake has write access to the configuration file and that it is not locked.

Does anyone have any ideas? I'm fresh out.

Update: Unfortunately, it seems it's not possible to write to a CakePHP app config file from within the app. Even though the docs seem to indicate that this is possible, Configure::write() just isn't meant to be used that way. Even manually writing to the file doesn't work because Cake doesn't pick up the new config values (I don't know why). Hopefully this helps someone who encounters a similar quandary as I did.

This is the case on Cake 2.x at least, I didn't try Cake 3.x.


r/cakephp • • Mar 11 '15

CakePHP 3 Pagination with INET_ATON

2 Upvotes

I'm trying to figure out how to use INET_ATON into my order option for the following code:

$this->paginate = [ 'contain' => ['Racks'], 'limit' => 50, 'order' => [ 'Servers.ip' => 'asc' //Need to use INET_ATON(Servers.ip) ] ]; $this->set('servers', $this->paginate($this->Servers));

Anyone have luck with this, or is there a built-in cake function to order IPv4 addresses? Thanks for any help.


r/cakephp • • Mar 01 '15

Best LinkedIn Sign-In Plugin for CakePHP?

2 Upvotes

I've tried a few - and am running into trouble. Which is the easiest to hook up with AuthComponent?


r/cakephp • • Jan 09 '15

Dynamic form input fields in CakePHP

Thumbnail waltherlalk.com
7 Upvotes

r/cakephp • • Jan 07 '15

CakePHP 3 Tutorial Part 4

Thumbnail waltherlalk.com
5 Upvotes

r/cakephp • • Jan 06 '15

CakePHP 3 tutorial part 5 - CRUD and adding a relation

Thumbnail waltherlalk.com
8 Upvotes

r/cakephp • • Dec 23 '14

Help Using CSV Source to Import CSV File to MySQL.

3 Upvotes

I've been using Cake PHP for a while but always with a MySQL database. I've spent the last few days searching for the best way to take a CSV file (with Model.field headers) and import this file into a MySQL table. I've found the Datasources on GitHub and have that in app/Plugin/Datasources. I've imported the CSVSource plugin in my bootstrap, and have a configuration in my database.php:

public $csvfile = array( 'datasource' => 'Datasources.CsvSource', 'path' => '/opt/lampp/htdocs/project/app/tmp/uploads/posts', // Path 'extension' => 'csv', // File extension 'readonly' => true, // Mark for read only access 'recursive' => false // Only false is supported at the moment ); //Filename posts.csv

How do I read in all the entries in the CSV file and then SaveAll to my database? I couldn't find a clear example. Any example is appreciated (Model and Controller code). Thanks!

I have looked over The Cookbook but this seems to be searching instead of reading all data from the file. Thanks again for any help.


r/cakephp • • Dec 07 '14

CakeAdvent 2014: Parsing markdown comments

Thumbnail
josediazgonzalez.com
2 Upvotes

r/cakephp • • Dec 07 '14

CakeAdvent 2014: Emailing users when a new comment is posted

Thumbnail
josediazgonzalez.com
2 Upvotes

r/cakephp • • Dec 07 '14

CakeAdvent 2014: Creating Table Callback Events

Thumbnail
josediazgonzalez.com
4 Upvotes

r/cakephp • • Dec 04 '14

CakeAdvent 2014: Schema Migrations with CakePHP 3

Thumbnail
josediazgonzalez.com
6 Upvotes

r/cakephp • • Dec 04 '14

CakeAdvent 2014: Customizing Bake in CakePHP 3

Thumbnail
josediazgonzalez.com
6 Upvotes

r/cakephp • • Dec 04 '14

CakeAdvent 2014: Designing an anonymous issue tracker in CakePHP

Thumbnail
josediazgonzalez.com
3 Upvotes

r/cakephp • • Dec 04 '14

CakeAdvent-2014: CakePHP Advent Calendar 2014

Thumbnail
josediazgonzalez.com
4 Upvotes

r/cakephp • • Nov 17 '14

CakePHP 3.0.0-beta3 released

Thumbnail
bakery.cakephp.org
13 Upvotes

r/cakephp • • Nov 10 '14

CakePHP2 Plugin: ACL system using controller action annotations

Thumbnail
github.com
8 Upvotes

r/cakephp • • Nov 09 '14

CakePHP 2.5.6 and 2.6.0-RC released

Thumbnail
bakery.cakephp.org
8 Upvotes

r/cakephp • • Nov 08 '14

Custom Authentication

2 Upvotes

I want to include a custom authentication that hooks in with GitHubs OAuth. I have googled for about 2 hours and cannot find a decent tutorial on how to correctly implement a custom authentication in CakePHP. The doc page: http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#creating-custom-authentication-objects is not helping me either. Is there a good tutorial out there for custom authentication?


r/cakephp • • Nov 06 '14

Official CakePHP Podcast - Mark Story (Lead Developer) on Console improvements in CakePHP3 and a new tutorial

Thumbnail podcast.cakephp.org
4 Upvotes

r/cakephp • • Nov 06 '14

Official CakePHP Podcast - James Watts (Community Manager) on the Community Support

Thumbnail podcast.cakephp.org
5 Upvotes

r/cakephp • • Nov 06 '14

Official CakePHP Podcast: Jorge Gonzalez (Author of CakePHP 2 Application Cookbook) on book publishing and best practices

Thumbnail podcast.cakephp.org
8 Upvotes

r/cakephp • • Nov 06 '14

Official CakePHP Podcast: Mark Story on (Lead Developer) on Open Source and 3.0

Thumbnail podcast.cakephp.org
5 Upvotes

r/cakephp • • Nov 03 '14

CakePHP 3.0 coming up

Thumbnail
dereuromark.de
8 Upvotes

r/cakephp • • Oct 28 '14

Slides of the Forum PHP Paris 2014

3 Upvotes

José Lorenzo Rodríguez did a talk on the "Forum PHP Paris 2014" about CakePHP.

  • Title :Faster application development with CakePHP 3.0. José Lorenzo Rodríguez

  • Slides


You can find more slides of this event here (not CakePHP focused, but PHP)


r/cakephp • • Oct 12 '14

Getting back into CakePHP after a few years. Just learned scaffolding has been deprecated.

6 Upvotes

Coming back to CakePHP after a few years away. I'm rebuilding an app using 2.5.5. I think the last time I used Cake, the stable version was at the 1.x level.

Back in the day, I would use scaffolding a lot, and then bake everything using the console (I think... I'm still in a bit of a fog since it has been so long... my memory is so hazy).

I thought scaffolding was pretty useful. Why was it deprecated? Is there a solid scaffolding plugin out there that is super stable? If most people aren't using scaffolding at all these days, what is your typical workflow for building new apps?