Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
for some a reason I need to track entry point of laravel framework,how can I do that, is there any way to do that, I need to debug also how can laravel load service provider of package step by step is there any way or something like so, I ask just if can tell me how?
and what I mean by track?
I mean to display stack trace when laravel run, to see variables loaded into memory.
Entry point is ./public/index.php. For debugging people usually use xdebug but I never really needed it. I usually just dd($something). If you have laravel 6 you have ddd() helper that dumps the variable but also shows you the stack trace and other useful info. You can ddd() directly in the ./vendor in the provider if you want. Put any variables you want to see in the ddd. If you don't have laravel 6 then you can throw an exception to see the trace or dd() whatever you want to see. There are other ways of course but this was always enough for me.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last year.
Improve this question
I am learning laravel 8. I am getting confused visualizing how the whole thing works like request respond cycle, routes etc.
Is there any source where the whole laravel working scheme is visualized?
Got this image from google. Hope this is clear to you. The basic flow you need to remember:
Define Route
Call Controller#method for that route
Call Model to Query the database
Pass data to a blade view file
render that blade view file for user to see
There are many more things come in when you start developing properly. EG:
Events, Jobs, Mailables, Notifications
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a lot of .php and/or .php files on my site. Is there a way to go through each site/page and work out which ones(if any) have errors in the console in the broswer?
More generally, I am looking at making a change to many pages on my site and I am just wondering what is the best way to automate the test process to see that I did not break anything with the changes I made.
Note: the errors in the console in the broswer, will give me errors, but it would not show errors that only the human eye could detect.
Have you considered an automated testing framework?
http://matthewdaly.co.uk/blog/2012/11/03/testing-php-web-applications-with-cucumber/
Repetitively manually testing ur site is not fun.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have recently start work with twig in my project,
I have check that twig have create cache folder, and check that twig basically create some php classes for cache,
I want to understand exactly how this mechanism is work, how it beneficial to reduce the page loading time, any one can help me ?
Twig evaluation process looks like:
Your templates are parsed, abstract syntax tree (AST) is built from then and then AST is transformed into php code
Php code from the step #1 is evaluated
With Twig templates caching you eliminate step #1, since the transformation results are written to a cache files.
So it is highly recommended to use it on production. Just make sure you clear the template directory cache on deploy or specify another directory as a target. It could be a good idea to include the application version number in the path.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to create an age gateway/verification bundle for Symfony2. I'm new to the framework and not sure of the right way to implement it.
So far I have it set-up as a voter but it appears you then have to call isGranted() with a role on every action you want the gateway to show up. The problem is that, at that point, I don't think the user has a role.
This leads me to believe that I should be doing things differently, e.g., firewall or a listener maybe.
Can someone please advise on the best method along with some background info/links to help get me started?
Looking at a an answer to a similar question, a simple way to do this would be to create a twig template which checks for the presence of a cookie using:
{% if app.request.cookies.has('someCookie') %}
If that's not present, then you can inject the required Javascript to display a popup, insert a META REFRESH to force a redirect, or some other action.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
sometimes if a table is marked as crashed, a simple
REPAIR TABLE `tablename`
works fine to continue.
how do I add an automatic repair in my PHP script?
I get the error:
1194 - Table 'whos_online' is marked as crashed and should be repaired
This is very unlikely to make sense.
If you need to repair tables so frequently that you need to automate it, there's something wrong with your setup. You need to fix the root cause in that case.
An automated solution would also be difficult to implement. You'd have to parse the mySQL error message to find out whether the reason your query failed is maybe related to a broken table. There are thousands of different possible reasons why a query could fail.
The usual way is to monitor what is going on on the web site, and having an administrator react to problems. You could, for example, have your web app send you an E-Mail when a query fails.