I encountered an issue with the mail system of laravel 5.8. As the documentation says, Mail & Local Development one can change the way of sending emails to let it write them to a log-file.
Therefor, the .env as well as the config/mail.php-file have options for that.
So, I added (the key was not here originally) a MAIL_LOG_CHANNEL-key to my .env-file with the value "mail" and changed the value of the key MAIL_DRIVER to "log".
Obviously, I added a new channel to the config/logging.php:
[...]
'mail' => [
'driver' => 'single',
'path' => storage_path('logs/mail-'.php_sapi_name().'.log'),
'level' => 'info',
],
[...]
What ever I tried, the mail was never written to the seperate log-file. I testet the channel with a normal log-statement without any problem.
I switched from MAIL_LOG_CHANNEL="mail" to MAIL_LOG_CHANNEL=mail added a default value to the section of the config/mail.php:
[before]
'log_channel' => env('MAIL_LOG_CHANNEL'),
[after]
'log_channel' => env('MAIL_LOG_CHANNEL', 'mail'),
not getting the width of a hair near to the log entry.
Only with the absolute basic configuration it actually writes the mail to the log but with this solution into the wrong log file.
Does anyone have an idea? It looks pretty strange to me.
Thanks for your help.
I found out why the logging was not working:
one have to change the level-propertiy to "debug".
After that, everything works fine.
See https://laracasts.com/discuss/channels/laravel/custom-mail-log-channel-breaks-mail-driverlog?page=1#reply=523111
for the original hint for this issue.
May that can helkp someone :)
Have a nice day.
Related
I need to debug some errors and formatting within a professional wordpress site. I need to do the debugging from the raw code. It is mostly php and JS. I have ended up with more than 2million lines of code after the most recent update. There are some empty box space on the home page and a list of bugs from the WP_DEBUG log.
This is my first time working with Wordpress at all. I am overwhelmed by the amount of code, and can't figure out where any of the bugs and issues are. I have worked with Angular Typescript in the past.
I would assume, to an extent, that some of these issues would be able to be fixed within the 'drag and drop' API of wordpress, but I have no idea how to use that either, when there is an already several million lined website code, and like I said, I was given the raw php code of over 2 mil lines to debug with.
I have been using VS code for the editor and MAMP as a live server.
I have no idea where to start, and I have not been able to find any useful tutorials online. Any help is greatly appreciated. I could really just use some guidance on how this process might work. Or if it even is something that people do, ever. It looks like according to the internet, this may not be the way to go about debugging. Feel free to ask questions I'll try to answer anything I can without giving away any confidential info.
Here are the bugs that show up on the site from WP_Debug:
Warning: preg_match(): No ending delimiter '*' found in C:\repos\website\wp-content\mu-plugins\no-cache.php on line 8
Warning: preg_match(): Empty regular expression in C:\repos\website\wp-content\mu-plugins\no-cache.php on line 8
Notice: Trying to get property 'Location' of non-object in C:\repos\website\wp-content\themes\Child-Theme\functions.php on line 45
Notice: Trying to get property 'Subrole' of non-object in C:\repos\website\wp-content\themes\Child-Theme\functions.php on line 46
Update: I am still having issues with these same errors. I am looking for assistance on how the process of debugging raw WP php code works, and if I am trying the right things. I can provide the code that a few errors are pointing to, but I do have to adjust the variables to maintain confidentiality.
\Child-Theme\functions.php (35-50):
if(class_exists(\RoleList\RoleList::class)) {
wp_localize_script('site-name', 'SiteName', [
'RoleList' => [
'categories' => $role_categories,
'locations' => \RoleList\Categories::getLocations(),
'category_counts' => \RoleList\Listings::getCategoryCounts(),
],
'CurrentRole' => [
'is_role_page' => ($listing ? true : false),
'current_category' => ($current_category ? $current_category : null),
'current_location' => ($listing->Location ? $listing->Location : null),
'current_subrole' => ($listing->Subrole ? $listing->Subrole : null),
'home_url' => home_url(),
]
]);
}
I have been brainstorming for a while now on this and finally i decided to put a question here.
I am using PayPal-PHP-SDK (restAPI) for processing payments. And i cannot make it go to the live endpoint (api.paypal.com) and always goes to sandbox (api.sandbox.paypal.com)
Progress: Using the sandbox credentials (clientId and clientSecret) in 'bootstarp.php' and 'mode' set to 'sandbox' in 'sdk_config.ini' i have successfully completed multiple sandbox transactions and completed all other parts of the project. Now the only part is making it live, which is in fact turning out to be the Achilles heel of the project.
What i have tried: I have replaced the sandbox credentials with the live ones from the client. Which he got from https://developer.paypal.com/webapps/developer/applications/myapps then under the app clicking 'show' Live Credentials. I also changed the mode to live in 'sdk_config.ini'. But still it takes me to the sandbox endpoint.
EDIT: while creating the api context in bootstarp.php there is a mode i have also set that to live, code below.
$apiContext->setConfig(
array(
'mode' => 'live',
'http.ConnectionTimeOut' => 30,
'log.LogEnabled' => true,
'log.FileName' => '../PayPal.log',
'log.LogLevel' => 'FINE',
'validation.level' => 'log'
)
);
Can anyone suggest me what i am missing here as i get no error to debug and look further. For any help or advice, thanks in advance.
Have you changed the mode in bootstrap.php? It seems you can use either the configuration in bootstrap.php or in the sdk_config.ini file but not both. Make sure mode is set to live in the bootstrap.php file if you have the sdk_config.ini path commented out as below (from the bootstrap.php file)
// Register the sdk_config.ini file in current directory
// as the configuration source.
/*
if(!defined("PP_CONFIG_PATH")) {
define("PP_CONFIG_PATH", __DIR__);
}
*/
This is probably more appropriate as a comment on Mike Miller's solution but I don't have enough rep, sorry.
I moved from the Paypal API sandbox to live literally five minutes ago, using your question and Mike's answer for information on how to do so.
The only things I changed were the values of clientId and clientSecret in bootstrap.php, and the mode (from 'sandbox' to 'live'), just like you set out in the question. I didn't edit the 'sdk_config.ini' file at all, and the path is commented out anyway, as per Mike's answer.
I note you're referring to the 'bootstrap.php' file as 'bootstarp.php' - this doesn't have anything to do with it, does it?
I had the same problem that I couldn't fix.
I'm not proud of my solution because it's not elegant at all, but it worked to start selling.
I modified the file PayPalConstants.php (located in ...\PayPal-PHP-SDK\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalConstants.php)
I just changed sandbox routes for live routes:
const REST_SANDBOX_ENDPOINT = "https://api.paypal.com/";
const OPENID_REDIRECT_SANDBOX_URL = "https://www.paypal.com/webapps/auth/protocol/openidconnect";
The following code gets stripped down at runtime:
$PhoneHomeLink=CHtml::link($this->phone_home,'tel:'.$this->phone_home);
Assuming the home phone number is 999-555-1212 the output is displaying:
<a>999-555-1212</a>
What happened to the:
999-555-1212
Hi I thought this would be easy but I guess it's more work than I planned. Does anyone have any ideas?
OK for anyone interested, I tested the function in a few different places and it worked so I figured out it was implementation on my end.
I wanted to create tel: links inside CGridview with the following code:
'home'=>array('type'=>'html','name'=>'home_phone','value'=>'CHtml::link($data->phoneHome,"tel:".$data->phoneHome)','htmlOptions'=>array('width'=>'120')),
and after scratching my head and digging and digging I found out the alternate 'type' called raw which worked magic in this situation. I just needed one item in that line changed as shown here:
'home'=>array('type'=>'raw','name'=>'home_phone','value'=>'CHtml::link($data->phoneHome,"tel:".$data->phoneHome)','htmlOptions'=>array('width'=>'120')),
For Yii 2.x CHtml() is deprecated.
Use Html(). Here what I use in a DetailView::widget() for a phone number to be called.
['attribute' => 'CW_phone',
'format' => 'raw',
'value' => Html::a($model->CW_phone,"tel:".$model->CW_phone),
],
I'm stuck at the beginning of a new site.
It's my first time, trying to use oil for generation / migration.
I successfully create a model using oil and now I want to migrate it, but
php oil refine migrate
gives me an error:
Error - invalid data source name in COREPATH/classes/database/pdo/connection.php on line 94
With a little bit of research I found out, that at least I'm not completely alone with this error, though none of the discussions I saw has been solved so far.
My db-configuration is all fine and regarding some hints I even overwrote php-cli's php.ini with the one, apache is using.
But no luck at all.
Anybody out there, who knows a solution? Any help appreciated!!!
EDIT:
I wanted to go on developing even without oil but now found that I can't even run migration from php. It's the same error message which doesn't help at all.
Please guys, anybody just has to know a solution...
have you set the database conneection in the file: fuel/app/config/development/db.php? and is in the correct form:
return array(
'default' => array(
'connection' => array(
'dsn' => 'mysql:host=localhost;dbname=fuel_intro',
'username' => 'root',
'password' => '',
),
),
);
By the error it sounds like you may have the wrong sytax in your config.
I hope this is helpful, if not please post your db config file source.
I am developing activecollab custom module; facing an issue related to Routers.
I by mistake type wrong action name in Router's action where we need to define in router, but after getting error I updated that action name but activecollabs still reading a previous action i removed files from cache and complie folders but reading previous action.
please share if you ever face this problem in development of activecollab module..
By mistake I did this: (action=>'views')
Router::map('mymodule_view', 'mymodule/view/:request_id', array('controller' => 'mymodule', 'action' => 'views' ), array('req_id' => Router::MATCH_ID) );
but after getting error i update above code by this: (action=>'views')
Router::map('mymodule_view', 'mymodule/view/:request_id', array('controller' => 'mymodule', 'action' => 'view' ), array('req_id' => Router::MATCH_ID) );
First, make sure that your system is in development mode. Open config/config.php and confirm that APPLICATION_MODE is set to in_development:
define('APPLICATION_MODE', 'in_development');
Now that you have that covered, go to activeCollab and you'll have Developer toolbar available in the lower right corner of the application interface, next to activeCollab powered button (it has a red bug icon). Use this tool to clear cache, rebuild images etc.
PS: You can also clear all files from /cache folder, just in case.