Logs for #cakephp

Page 3 of 36,163, showing 100 records out of 3,616,256 total, starting on record 201, ending on 300

# At Username Text
# Jun 21st, 18:51 daniel.upshaw Loaded wrong table
# Jun 21st, 18:51 daniel.upshaw Lol
# Jun 21st, 18:51 daniel.upshaw Whoops
# Jun 21st, 18:41 daniel.upshaw `Unknown method "findSlug"`
# Jun 21st, 18:41 daniel.upshaw `public function findSlug(Query $query, array $options)`
# Jun 21st, 18:41 daniel.upshaw Eg: https://book.cakephp.org/3.0/en/orm/behaviors.html#defining-finders
# Jun 21st, 18:39 daniel.upshaw Anyone ever tried to add a custom method to a model using a behavior?
# Jun 21st, 18:39 daniel.upshaw You can put an `exit()` in the method?
# Jun 21st, 18:39 daniel.upshaw What is the code?
# Jun 21st, 18:39 daniel.upshaw What do you mean disable json responses?
# Jun 21st, 15:20 mrfeedback urgent help needed. how can i disable json responses?
# Jun 21st, 14:47 olanowsubomi hi, please can anyone one help me solve the problem of restarting all services on wamp apache on window 7 from the administrator command line i typed 'NET START wampapache' it initially indicate ' the wampapache service is starting..........' then 'the wampapache service cannot be started a service specific error occured: 1. more help is available by typing NET HELPMSG 3547' then, i check window event viewer which brought this message
# Jun 21st, 14:47 slackebot1 ' The Apache service named reported the following error: >>> AH00015: Unable to open logs Slackbot
# Jun 21st, 14:34 olanowsubomi Hello is anyone there?
# Jun 21st, 14:32 olanowsubomi hi, please can anyone one help me solve the problem of restarting all services on wamp apache on window 7 from the administrator command line i typed 'NET START wampapache' it initially indicate ' the wampapache service is starting..........' then 'the wampapache service cannot be started a service specific error occured: 1. more help is available by typing NET HELPMSG 3547' then, i check window event viewer which brought this message
# Jun 21st, 14:32 slackebot1 ' The Apache service named reported the following error: >>> AH00015: Unable to open logs
# Jun 21st, 14:29 olanowsubomi hi, please can anyone one help me solve the problem of restarting all services on wamp apache on window 7 from the administrator command line i typed 'NET START wampapache' it initially indicate ' the wampapache service is starting..........' then 'the wampapache service cannot be started a service specific error occured: 1. more help is available by typing NET HELPMSG 3547' then, i check window event viewer which brought this message
# Jun 21st, 14:29 slackebot1 ' The Apache service named reported the following error: >>> AH00015: Unable to open logs
# Jun 21st, 13:57 itmpls i'm doing 2 saveMany's inside
# Jun 21st, 13:57 itmpls just to confirm: i don't need try/catch blocks in a transactional, it would just automatically rollback and return false?
# Jun 21st, 13:00 stephenzgalbraith @egalles you’ll get that error I believe now until you start applying policies or other forms of authorization
# Jun 21st, 12:58 egalles ok advancing in that purpose..... I get a new error.... The request to `/users` did not apply any authorization checks. But it looks like authoritzation and authentication are working together like two implements of my app middleware
# Jun 21st, 12:56 egalles ...
# Jun 21st, 11:24 egalles when i put this > ->add(new AuthorizationMiddleware($this)); in middleware
# Jun 21st, 11:24 egalles `Authorization\AuthorizationServiceProviderInterface`, `App\Application` given
# Jun 21st, 11:24 egalles now i have this error for example > Subject must be an instance of `Authorization\AuthorizationServiceInterface` or
# Jun 21st, 11:06 egalles i'ma noob with interfaces...etc anyone can help me with basic knowledge of interfaces ? are like pluggins ?
# Jun 21st, 11:06 egalles now cakephp book recommends to use authorization and authentication plugins.
# Jun 21st, 11:05 egalles i was using authcontroller since now and i see in documentation that will be deprecated
# Jun 21st, 11:04 egalles good morning
# Jun 21st, 10:44 martin morning :)
# Jun 21st, 10:26 neon1024 Morning everyone
# Jun 21st, 10:14 conehead Oh, by the way...there are "dynamic finders" as well.... https://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#dynamic-finders You should be able to do the following: `$users->findAllByRole(1)->count()` But personally I am not a big fan of these magic methods
# Jun 21st, 09:36 conehead ``` $users->find() ->where(['role' => 1]) ->count(); ```
# Jun 21st, 09:34 kgb.acct.personal I have to get the total count and the count where role = 1
# Jun 21st, 09:34 kgb.acct.personal Yess
# Jun 21st, 09:30 conehead I don't really get what you are trying to achive. Count all where `role = 1`)
# Jun 21st, 09:27 kgb.acct.personal It looks like this. But it seems hackish ``` $users->func()->count('DISTINCT CASE WHEN role = 1 THEN role END') ```
# Jun 21st, 09:27 conehead https://book.cakephp.org/3.0/en/orm/table-objects.html#afterdelete
# Jun 21st, 09:27 kgb.acct.personal How do I do conditional count?
# Jun 21st, 09:26 conehead Well you could check in afterSave or afterSaveCommit
# Jun 21st, 09:12 peppejaripappalardo Hi guys, i need an help please. I adding muffin/trash behavior a run time into the controller, because i have many entity related and that can give problem if i put the behavior into the table, e.g. Historical View. I need to cascade soft-delete item, there is a way to append into the table AddBehavior if Users deleted entity is not null?
# Jun 21st, 07:36 graziel then its in link i gave : )
# Jun 21st, 07:35 nuzulfikrie i am using the latest version
# Jun 21st, 07:35 graziel dont remember the older
# Jun 21st, 07:35 graziel in newer i think yes, https://github.com/cakephp/app/blob/master/config/routes.php#L58
# Jun 21st, 07:27 nuzulfikrie my question now is does CAKEPHP CSRF is enabled by default ? .
# Jun 21st, 07:26 nuzulfikrie disabling this line 'code' $this->loadComponent('Csrf'); 'code' resolve error.
# Jun 21st, 07:26 nuzulfikrie hi team, need help. i am having ' CRSF token mismatch error ' on delete action.
# Jun 21st, 06:49 conehead Good morning everyone
# Jun 21st, 06:09 noypi2020 Hi, Good day! mod_rewrite is enabled on the server and the .htaccess files were intact. I cannot figure out where to fix those errors.
# Jun 21st, 04:19 joey.mukherjee Looks like this works! In case someone else searches for it: ` $routes->connect ('/:uuiid', ['controller' => 'Plots', 'action' => 'view']) ->setPatterns (['uuid' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}']);`
# Jun 21st, 04:11 joey.mukherjee Is there a better way of capturing a UUID from the url?
# Jun 21st, 04:03 joey.mukherjee I copied directly from that page in the book! That's how I got the errors. Ok, I also have this: `$routes->connect ('/**', ['controller' => 'Plots', 'action' => 'view']);` I need that since I want to pass a UUID on the url?
# Jun 21st, 03:59 mrfeedback @joey.mukherjee https://book.cakephp.org/3.0/en/development/routing.html#prefix-routing
# Jun 21st, 03:59 challgren Just do something like this @joey.mukherjee
# Jun 21st, 03:57 joey.mukherjee question about admin routing... If I want an admin prefix, I add ```Router::prefix('admin', function (RouteBuilder $routes) { $routes->connect ('/', ['controller' => 'admin', 'action' => 'index']);
# Jun 20th, 20:04 ricksaccous I think it's because I'm not using the OrmPolicy but the mapper policy which runs in the middleware before the controller is hit
# Jun 20th, 19:59 ricksaccous is not stopping the policy from happening
# Jun 20th, 19:59 ricksaccous my skipAuthorization method from my component
# Jun 20th, 19:59 ricksaccous hmmm
# Jun 20th, 19:53 ricksaccous actually i think i'll be fine pushing them back to their dashboard
# Jun 20th, 19:52 ricksaccous i suppose i'll just have to write a handle that extends redirect
# Jun 20th, 19:41 ricksaccous hmm
# Jun 20th, 19:41 ricksaccous there must be an easy way to redirect to referer
# Jun 20th, 19:40 ricksaccous https://book.cakephp.org/authorization/1.1/en/middleware.html#handling-unauthorized-requests
# Jun 20th, 18:06 mdotobie gotcha. well this actually might be a better way to do this
# Jun 20th, 18:05 admad Webservice is akin to db connection and Driver is akin to pdo driver
# Jun 20th, 18:04 admad Endpoint is akin to Table and Resource is akin to Entity
# Jun 20th, 18:02 mdotobie Any insight on the difference between Endpoint and Resource?
# Jun 20th, 18:00 admad Endpoint is your model abstraction. You would create a driver which reads the json file instead of making a GET request
# Jun 20th, 17:59 mdotobie The other thing I would have wanted to add @admad would be a way to define the schema of the loaded data for validation purposes (since it’s handwritten). But I really liked the _transformResults method it has for parsing the JSON, however, I’m basically using `JsonConfig` through the `Configure` class to perform the same function.
# Jun 20th, 17:57 mdotobie @admad on this particular use the JSON is written by hand in advance it isn’t coming from a service. But I was thinking about how I could extend it in the future. I did come across Webservice when I was researching if what I was trying to do was possible and how would I architect it. My only question was around whether an “endpoint” could be a file or was a URL you’re only option.
# Jun 20th, 17:52 admad @mdotobie if you are fetching data from an external API is suggest you checkout muffin/webservice
# Jun 20th, 17:48 mdotobie I think a really good way I intend to extend this is for caching JSON data from sources. Then the cached JSON can be read in as config data and can be updated on a schedule or on demand. But it doesn’t need to be retrieved fresh on each request because it won’t change often.
# Jun 20th, 17:46 mdotobie I think I like this architecture.
# Jun 20th, 17:46 mdotobie Hey @jeremyharris, although I know I haven’t provided alot of context, I wanted to point out that as I sat here working on this I’ve decided to move the `\App\Model\Json\Json` to `App\Model\Datasource\Json`. My first experimental subclasses of this is a definition JSON file for Shipping Carrier data, the data lives in `config` and the “table” originally lived in the `\App\Model\Json` namespace as `ShippingJson` but it’s now mixed
# Jun 20th, 17:46 slackebot1 `\App\Model\Table` namespace as `ShippingItemTable`. Instead of extending `\Cake\ORM\Table` like a normal Table, it extends `App\Model\Datasource\Json`. In turn, the Entity is in the `\App\Model\Entity` namespace as `ShippingItem`
# Jun 20th, 16:27 jeremyharris same!
# Jun 20th, 16:26 mdotobie okay. sometimes I like to do a sanity check to see if the way I’m thinking about things actually makes sense. I’m prone to over-engineering…but I like the mental stretching it gives to learn how to approach problems in non-obvious ways.
# Jun 20th, 16:26 jeremyharris no need to make the developer learn their API if they don’t have good typehinted clients
# Jun 20th, 16:25 jeremyharris yeah in those cases it makes sense to me to wrap them
# Jun 20th, 16:25 jeremyharris if you need that level of abstraction then that’s fine. Sometimes it’s not necessary, because in reality your application is tied to those APIs even after the abstraction. I guess it depends on what the service class is doing
# Jun 20th, 16:25 mdotobie Well, when that API doesn’t have a straightforward API. For instance I use the Mandrill PHP library as is, but I do a lot of custom stuff to Slack so I have a SlackService class that uses the Slack API directly through Guzzle injected into the Service class.
# Jun 20th, 16:23 mdotobie I actually do something I refer to as Service classes as wrappers to API libraries.
# Jun 20th, 16:22 mdotobie That’s what I thought @jeremyharris and I figured the reason was because of what you outlined. So I think my approach of creating two new kinds of classes that mimic the Table/Entity structure without relying on the underlying datasource is the easiest way to implement what I’m after. If I was using an API as the datasource I’d probably just replace using `JsonConfig` with something like `Guzzle` as they are just intended to be the da
# Jun 20th, 16:22 slackebot1 “importers” and the `Hash` class as the data extractor.
# Jun 20th, 16:19 jeremyharris I think you’re correct. That way of writing datasources for APIs has been superseded by better API clients that have their own set of exception handling for specific API errors. I wrote maybe the first Stripe plugin that was a cakephp datasource for 2.x that translated the datasource commands, like ->read, into the appropriate REST call. However, this isn’t really useful anymore because the stripe client was released some time after
# Jun 20th, 16:19 slackebot1 is really good. I think you *could* still write something similar that would fit within the cake 3 ORM, but it would be pretty time consuming and the ORM method support would be minimal, so it probably wouldn’t be too useful
# Jun 20th, 16:13 mdotobie Partially to satisfy a use case and partially as an experiment, I’ve been creating a way to use a JSON file as a datasource (mostly as a way to more quickly iterate over an evolving data structure). I’ve created a class called `Json` in the Model folder that uses a combination of the JsonConfig and Hash classes to load a JSON file that is defined in a more specific subclass that extends the `Json` class. This structure is intended to mi
# Jun 20th, 16:13 slackebot1 the `Table` class. The returned JSON is then loaded into a `JsonObject` that mimics the `Entity` class functionality. This `JsonObject` and/or it’s subclasses include the methods that act on the JSON data. This feels like a good approach but I was interested in any feedback. I did read an article under the CakePHP 2.0 book about leveraging the Datasource class to load data from an external API source and have it work with the Table classes in a way
# Jun 20th, 16:13 slackebot1 DB data source would have worked. I like that approach as well but it seems with the changes to the ORM in Cake3, this isn’t really a path that can be taken any longer. Am I misreading that?
# Jun 20th, 15:56 neon1024 ..and you’ll need cascadeCallbacks set to true in your associations
# Jun 20th, 15:55 neon1024 You won’t be able to cascade soft-delete without the behaviour attached to the Tables if I remember
# Jun 20th, 15:55 peppejaripappalardo thx for your hint @neon1024
# Jun 20th, 15:55 peppejaripappalardo yes, the problem is that, at this time the Behavior on Events and Mission is not implemented yet. So maybe that let fail the query
# Jun 20th, 15:54 neon1024 If they were cascade soft-deleted then the query shouldn’t fail
# Jun 20th, 15:52 peppejaripappalardo Yes, i need to keep Missions and Events for Historical Archive
# Jun 20th, 15:51 neon1024 So wouldn’t that further mean, you’d want to cascade soft-delete the Missions as well
# Jun 20th, 15:51 neon1024 Wouldn’t that also mean that a Missions belongsTo Users