Logs for #cakephp

Page 1 of 36,162, showing 100 records out of 3,616,199 total, starting on record 1, ending on 100

# At Username Text
# Today, 16:36 daniel.upshaw What if you want to request the HTML page like the normal route?
# Today, 16:36 daniel.upshaw An AJAX call with jQuery.... Cake is requiring a separate `/ajax/index.ctp`, with a layout when it detects an AJAX call
# Today, 16:35 slackebot <daniel.upshaw>
# Today, 16:35 daniel.upshaw Here's something super annoying
# Today, 16:17 daniel.upshaw Lol darn
# Today, 16:17 daniel.upshaw Oy
# Today, 16:17 a.didier i see... I'm on a really old project and i'm not really used to Cake2 and the previous dev did some weird stuff XD Hard to understand
# Today, 16:15 daniel.upshaw `app/View/Recipes/search.ctp`
# Today, 16:15 daniel.upshaw `app/View/Recipes/share.ctp`
# Today, 16:15 daniel.upshaw `app/View/Recipes/view.ctp`
# Today, 16:15 daniel.upshaw So each of `view`, `share`, `search` generates a response
# Today, 16:15 daniel.upshaw ```# /app/Controller/RecipesController.php class RecipesController extends AppController { public function view($id) { //action logic goes here.. } public function share($customerId, $recipeId) { //action logic goes here.. } public function search($query) { //action logic goes here.. } }```
# Today, 16:14 daniel.upshaw Controller should automatically generate a response, but you can customize it first if you need to
# Today, 16:14 daniel.upshaw The response is probably from here: https://book.cakephp.org/2.0/en/controllers.html
# Today, 16:13 daniel.upshaw So it would already know about `json` for example, so `type->('json')` is already prepared whereas as `vcf` needs `$this->response->type(array('vcf' => 'text/v-card'));` to be set first
# Today, 16:13 daniel.upshaw Although in the example, that's a custom one
# Today, 16:12 daniel.upshaw So by setting `type->('vcf');`, it's just adding the `text/v-card` MIME type to the headers
# Today, 16:12 daniel.upshaw @a.didier I think you can still use a template with a different response type
# Today, 16:02 a.didier Hello, quick question : I want to use CakeResponse on Cake2.10 but i have no idea on how to load it... The book show small code like this `$this->response->type('vcf');` nothing on how response is set...
# Today, 15:01 jeremyharris I believe the Croogo CMS has visual ACLs. I haven’t looked at it in a while but that might be a good example if they still have it
# Today, 14:59 feLiruc Hello guys... I need to implement ACL in a visual way for CakePHP 3.7, do you guys have any good source or tutorial to do that?
# Today, 14:03 jeremyharris I’m glad you got it working. I’ll try and set aside some time this week to see if I can make it automatically restore existing handlers somehow
# Today, 14:03 jeremyharris I don’t remember at the moment to be honest. I think all known cake-related state is cleaned so that the test cases have a clean state to work with
# Today, 13:27 madbbb what is the purpose of EventManager cleaning in default test case setUp() method? I don't get it. As you said I rewrote the setup method and now it works. thank you
# Today, 13:23 jeremyharris so your bootstrap will be run when the initial test suite runs, but you’ll need to re-add them in TestCase::setUp (I usually have a base test case class to do this in) so they are added for each test thereafter
# Today, 13:22 jeremyharris sorry, your test case setup I mean
# Today, 13:21 madbbb but I have require dirname(__DIR__) . '/config/bootstrap.php'; in my test bootstrap.php
# Today, 13:20 jeremyharris I think restoring them automatically might be possible, but I haven’t looked into it too much to set up a PR yet
# Today, 13:19 jeremyharris @madbbb you need to add them to your test bootstrap too; that’s what I do.
# Today, 13:09 madbbb TestCase.php creates new instance of EventManager in setUp() method. That is why I have no listeners anymore
# Today, 12:59 gourav Please give idea how I can fix this.
# Today, 12:59 gourav I am getting issue with two cake php versions 1.3 and 3.3, I want to login into cake 3.3 from 1.3 with manual auth setting, but It's not working I am using the curl for this purpose,
# Today, 12:57 gourav Hi EveryOne,
# Today, 12:57 madbbb but EventManager has no listeners in my models.
# Today, 12:51 madbbb Hello. When I run tests my event listeners do not receive events. Is there some additional setup needed for them to work in test environment? I initialise them in bootstrap.php like this: ``` $listeners = [ App\Event\InvoiceListener::class, App\Event\OrderListener::class, App\Event\TransactionListener::class ]; foreach ($listeners as $listener) { EventManager::instance()->attach(new $listener()); } ``` look like they are not
# Today, 12:51 slackebot initilizng in test env
# Today, 11:15 slackebot 'cascadeCallbacks' => true, ]); And ControllableObject have the Behavior as: $this->addBehavior('Muffin/Trash.Trash'); When i delete a ControllableObject, the behavior add only the timestamp on this table, and the relationships table are ignored :S, someone can help?
# Today, 11:15 peppejaripappalardo Hi all, just a little question about Muffin/Trash soft-delete. I have these table: ControllableObjects => AbstractResources => Resources => Volunteers. When i delete a ControllableObject, it have to delete a cascade Abastract, Resources, Volunters. At this time these table have the ForeignKey as is required by the plugin. Every have the behavior with: $this->addBehavior('Muffin/Trash.Trash', [ 'dependent' => true,
# Today, 11:04 adithya why is withFile prepending to the path provided?
# Today, 11:03 adithya $file_path = WWW_ROOT.'img/file.txt'; $response = $this->response->withFile($file_path); I'm trying to serve this file but the url generated by the withFile is /users/demouser/websites/cakeproject1/src//users/demouser/websites/cakeproject1/webroot/img/file.txt what am i doing wrong?
# Today, 11:01 unclezoot i think this line is the problem ShellDispatcher::addShortPluginAliases(265). $aliases += [$shell => $plugin]; as it assumes that you will never have 2 shells with the same name
# Today, 11:00 vossen.steven it doesnt though since it checks if the plugins are the same
# Today, 10:59 adithya $file_path = WWW_ROOT.$path; $response = $this->response->withFile($file_path);
# Today, 10:52 unclezoot seems to be all sorts of array_flipping going on in there: $fixed = array_flip($list['app']) + array_flip($list['CORE']);, so if you have a shell called Reporting.utilities and Search.utilities say, then you'll fill up your debug.log in no time
# Today, 10:51 unclezoot not without ShellDispatcher::addShortPluginAliases throwing debug warnings
# Today, 10:50 vossen.steven its possible?
# Today, 10:47 unclezoot is it not possible to have 2 shells with the same name in 2 different plugins?
# Today, 10:33 adithya thank you :slightly_smiling_face:
# Today, 10:29 dereuromark by adding the header into the response for it. :slightly_smiling_face:
# Today, 10:29 dereuromark passing them through a controller or middleware usually
# Today, 10:28 adithya Hi, how can I make downloadable links for files in my webroot/img ?
# Today, 10:09 steinkel I'll add it to the list :slightly_smiling_face:
# Today, 10:09 dereuromark did you write a blog post for it yet? :slightly_smiling_face:
# Today, 10:08 steinkel @dereuromark using the default cake log adapter, then configuring syslog to fw logs to other services
# Today, 10:07 imonsei ah dang. I have to run off again. I will come online again tomorrow. laters o/
# Today, 10:02 imonsei side note, I cant make "cake bake" show the list with the "foo" command in it, no matter where i have the twig and php file placed, so I am definitely doing something entirely wrong
# Today, 09:59 imonsei am I supposed to put the examples from "creating new bake command options" inside my theme, or in the vendor/cakephp folders?
# Today, 09:59 imonsei i have used the above chapters to create my theme, which works nicely
# Today, 09:59 unclezoot morning, how do you remove these warnings from error.log? Debug: command 'acl' in plugin 'Acl' was not aliased, conflicts with 'AclManager'
# Today, 09:59 imonsei hia again. I'm having some problems with the "extending bake" part of the cake book. I'm at the "creating new bake commands options"
# Today, 09:53 JayCH It's the prefix "api/1.0" mapping to the "Api10" plugin that I'm having issues setting up
# Today, 09:51 JayCH I was unsuccessful so here's what i'm trying to do. I want to have all my API related Controllers as a plugin "Api10", but I would like to "version" these, so say if I call "/api/1.0/images", it calles "plugin/Api10/src/Controller/ImagesController.php. I'm not quite sure if I can do that with just routing, or if I need a custom routeClass?
# Today, 09:50 neon1024 Morning all :wave:
# Today, 09:45 JayCH Thanks for the link, that sparked an idea that I'll try before wasting your time :)
# Today, 09:43 dereuromark you can also check the sandbox app and how it works there ( https://github.com/dereuromark/cakephp-sandbox/blob/master/plugins/Sandbox/config/routes.php ) in real life.
# Today, 09:42 dereuromark sure, whats the issue
# Today, 09:38 JayCH Hi! I've inherited a cakephp 3.7 app at work and can't quite get my head around plugin routing. Is this the right place to ask?
# Today, 09:15 dereuromark any adapters here you could add to awesome list for us all?
# Today, 09:12 steinkel @dereuromark using syslog here, then letting syslog fw it elsewhere
# Today, 09:10 dereuromark See https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#log-specific-servers-and-networked-logging
# Today, 09:10 dereuromark with monolog you can log to anything without having to change more than config, ideally that one as wrapper then
# Today, 09:09 conehead What logging? I am logging to graylog
# Today, 08:57 dereuromark I am surprised to not see any (monolog) wrapper logging engine in awesome list. what are people using these days? besides the database log maybe?
# Today, 08:28 dereuromark capability of retry is definitely powerful and useful here, same for better usability as you dont have the waiting time on the frontend.
# Today, 08:27 dereuromark @joey.mukherjee You can even use the queue usually for tasks that should be started right away, as with a good setup you have only a lag of a few seconds. it would only wait a few more if the workers are still all busy.
# Today, 08:26 dereuromark But this is usually not adviced for things that need to run longer than a second, or if those could be failing and could need a rerun.
# Today, 03:16 admad @joey.mukherjee if you want to trigger a task your self there's no need to use the queue plugin. Just run the shell/command your self with `exec()/shell_exec()` function
# Today, 02:23 joey.mukherjee Thanks @challgren! Can you explain "If you just want to call the queue task then call your custom task" a little bit. By call my custom task, do you mean run the task without the queue? I am looking for a way to start the task immediately or trigger it somehow so it starts? Ideally, I'd rather not use cron if I can help it.
# Today, 01:50 challgren You should always run it from the Shell. Running it from a web request will block that connection and eventually timeout. If you just want to call the queue task then call your custom task
# Yesterday, 23:34 joey.mukherjee With the dereuromark/cakephp-queue plugin, is there a way to start the queued workers from my app instead of using a cronjob? I tried using a ShellDispatcher but it waits for a response. I am doing this in case I can tweak it: ``` $shell = new ShellDispatcher (); $command = ['cake', 'queue', 'runworker', 'and']; $output = $shell->run ($command);```
# Yesterday, 19:39 vossen.steven @madbbb ok ty, I'll have to check out my host then to see how I can access it
# Yesterday, 19:39 vossen.steven I checked my db, it was only on the db not on the tables
# Yesterday, 18:15 madbbb you always have access to mysql encoding settings on shared hosting
# Yesterday, 18:15 niel45 @vossen.steven isn't utf8mb4 set on the individual database or table?
# Yesterday, 18:01 vossen.steven figured it out with your help, I have to add this to my.ini `character-set-server = utf8mb4` how would one fix this if they don't have access to it though?
# Yesterday, 17:31 madbbb my seeds with Russian characters work fine with this settings: app.php Datasources['default']['encoding'] uses default utf8 and I use docker version of mysql 5.7.23 with override.cnf with this settings: ```[client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 [mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci ``` I don't have to specify collation or
# Yesterday, 17:31 slackebot encoding anymore in my code
# Yesterday, 17:17 vossen.steven cause as far as I know you can't pass a collation and I have no clue where it's getting it from
# Yesterday, 17:16 vossen.steven and that doesn't fix the issue if you use newEntity either
# Yesterday, 17:15 vossen.steven so if i do this ``` $data = ['charr' => 'ë']; $table = $this->table('test', ['collation' => 'utf8mb4_unicode_ci']); $table->insert($data)->save(); ``` it works fine, but it seems to me it shouldn't be like that, because if I change my datasource encoding I would have to change that as well
# Yesterday, 17:10 vossen.steven if i pass `'collation' => 'utf8mb4_unicode_ci'` as option when I call $this->table in the seeder it works fine
# Yesterday, 17:09 vossen.steven been reading the docs and I might have a solution
# Yesterday, 17:08 vossen.steven both utf8mb4
# Yesterday, 17:02 madbbb @vossen.steven what's is your table collation and Datasource.encoding?
# Yesterday, 15:49 vossen.steven Does anyone know how to get the seeder to encode data properly? I have the following test in my controller and a seeder ``` $testTable = TableRegistry::get('test'); $new = $testTable->newEntity([ 'charr' => 'ë', ]); $testTable->save($new); ``` now when I retrieve the data I get ``` [ (int) 0 => object(Cake\ORM\Entity) { 'id' => (int) 1, 'charr' => 'ë', }, (int) 1 =>
# Yesterday, 15:49 slackebot object(Cake\ORM\Entity) { 'id' => (int) 2, 'charr' => 'ë', } ] ``` as you can see the seeder doesn't encode the data properly.
# Yesterday, 15:06 olanowsubomi hello, goodday. please can i asked some few questions concerning cakephp download
# Yesterday, 08:23 challgren Does anyone have any pros vs cons for using CakePHP over .NET core? Client wants to use .NET and I want to persuade him otherwise
# Jun 22nd, 19:14 joey.mukherjee Nevermind! I can just move my $userGroups into the function ($q)! Cool!
# Jun 22nd, 19:11 joey.mukherjee I've made some progress on my querying, but I'm having one more issue: ``` $userGroups = $this->Groups->find ()->select (['id']) ->matching ('MyUsers', function ($q) { return $q->where (['MyUsers.id' => $this->Auth->user ('id')]); }); $query = $this->Projects->find ()->select (['name']) ->matching ('Groups', function ($q) {