Zend\Session invalid setting - zend-framework3

I'm working with Zend Framework 3 and after configuring the session in my module.config.php, I receive this fatal error:
Fatal error: Uncaught Zend\Session\Exception\InvalidArgumentException: 'session.class' is not a valid sessions-related ini setting
Can anyone help me with this?
Here is what I have in module.config.php:
'service_manager' => array(
'factories' => array(
'Zend\Session\Config\ConfigInterface' => 'Zend\Session\Service\SessionConfigFactory',
),
),
'session_config' => array(
'phpSaveHandler' => 'files',
'savePath' => 'C:/xampp/tmp',
'class' => 'Zend\Session\Config\StandardConfig',
'session_storage' => array(
'Zend\Session\Storage\SessionArrayStorage',
),
'session_validators' => array(
'Zend\Session\Validator\RemoteAddr',
'Zend\Session\Validator\HttpUserAgent',
),

Remove following from session_config
'class' => 'Zend\Session\Config\StandardConfig',

Related

Can't trigger theme update from a third-party source via Updates API in WordPress

I'm trying to update my theme via Updates API in WordPress and can't get it to work.
Here's the transient value:
(object) array(
'last_checked' => 1675756430,
'checked' => array(
'chipmunk-lite' => '1.0',
'chipmunk-theme' => '1.17.1',
),
'response' => array(
'chipmunk-theme' => array(
'theme' => 'chipmunk-theme',
'new_version' => '1.18.0',
'url' => 'https://chipmunktheme.com',
'package' => 'https://app.lemonsqueezy.com/download/unique_id',
'requires' => NULL,
'requires_php' => NULL,
'sections' => array(
'description' => '<p>Makes it ridiculously easy to make a content curation website for marketing, authority or just for fun. No coding skills required.</p>',
'changelog' => '1.18.0',
),
),
),
'no_update' => array(),
'translations' => array(),
)
The update alert does not show up. Is there anything wrong with it?
I'm following this guide: https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/

getting error 500 after trying to add a tab to wordpress customizer

i'm trying to add a tab to my wordpress customizer.
i use the next code:
add_action('customize_register','theme_costumizer_register');
function theme_costumizer_register($wp_customize){
$wp_customize->add_section('facebook_new_section', array(
'title' => 'Social Media',
'priority' => 10
));
$wp_customize->add_settings('facebook',
array(
'default' => 'http://facebook.com/ahiad'
));
$wp_customize->add_control(new WP_Customize_Control($wp_customize,'txtFacebookAddress',
array(
'label' => 'Facebook Link',
'section' => 'facebook_new_section',
'type' => 'text'
)));
}
the problem is every time i run this piece of code in my website, i get an error 500, could not spot the problem here...
You are using $wp_customize->settings which is not not exists, Please use $wp_customize->setting.
Please try below code :
add_action('customize_register','theme_costumizer_register');
function theme_costumizer_register($wp_customize){
$wp_customize->add_section('facebook_new_section', array(
'title' => 'Social Media',
'priority' => 10
));
$wp_customize->add_setting('facebook',
array(
'type' => 'theme_mod', // or 'option'
'capability' => 'edit_theme_options',
'theme_supports' => '', // Rarely needed.
'default' => 'http://facebook.com/ahiad',
'transport' => 'refresh', // or postMessage
'sanitize_callback' => '',
'sanitize_js_callback' => '',
));
$wp_customize->add_control('facebook',
array(
'label' => 'Facebook Link',
'section' => 'facebook_new_section',
'type' => 'text'
));
}
I hope it will helps you. Thanks

Error: One or more parameter values were invalid--DynamoDb

I am trying to update a table in DynamoDb with the following code..
$response = $client->updateItem(array(
"TableName" => "PlayerInfo",
"Key" => array(
"PlayerId" => array('N' => '201503261435580358849074082'),
),
"AttributeUpdates" => array(
'PlayerPrice' => array(
'N' => '5'
),
),
"ReturnValues" => \Aws\DynamoDb\Enum\ReturnValue::ALL_NEW
));
print_r($response);
However, an error interrupts its execution. It says:
One or more parameter values were invalid: Only DELETE action is allowed
when no attribute value is specified.
Could anybody help me with this issue?
Looks like the for format of the request was missing the 'Action' and 'Value' parameters. E.g. the following is working for me:
$response = $client->updateItem(array(
"TableName" => "PlayerInfo",
"Key" => array(
"PlayerId" => array('N' => '201503261435580358849074082'),
),
"ReturnValues" => \Aws\DynamoDb\Enum\ReturnValue::ALL_NEW,
"AttributeUpdates" => array(
'PlayerPrice' => array(
'Action' => \Aws\DynamoDb\Enum\AttributeAction::PUT,
'Value' => array('N' => '5'),
)
)
));
print_r($response);
You can also use an UpdateExpression to achieve the same effect (UpdateExpressions also provide greater flexibility than AttributeUpdates so they are generally recommended):
$response = $client->updateItem(array(
"TableName" => "PlayerInfo",
"Key" => array(
"PlayerId" => array('N' => '201503261435580358849074082'),
),
"ReturnValues" => \Aws\DynamoDb\Enum\ReturnValue::ALL_NEW,
"UpdateExpression" => "SET #pp = :val",
"ExpressionAttributeNames" => array(
"#pp" => "PlayerPrice",
),
"ExpressionAttributeValues" => array(
':val' => array('N' => '5')
)
));
print_r($response);

Accessing value of wp_customize setting

So, I've got the following code:
function themename_customize_register($wp_customize){
// Display date
$wp_customize->add_section('display_date_section', array(
'title' => 'Datum weergeven',
'description' => 'Wil je de datum weergeven?',
'priority' => 120,
));
$wp_customize->add_setting('display_date', array(
'default' => 'value1',
'capability' => 'edit_theme_options',
'type' => 'option',
));
$wp_customize->add_control('display_date_section', array(
'label' => 'Datum weergeven:',
'section' => 'display_date_section',
'settings' => 'display_date',
'type' => 'theme_mod',
'choices' => array(
'value1' => 'Ja',
'value2' => 'Nee',
),
));
}
add_action('customize_register', 'themename_customize_register');
How can I access the value of the setting? Right now whenever I try to access it (either through get_theme_mod or $wp_customize->get_settings) My main goal with the code is to let users have the ability to control wether they want to display the date or not. Can somebody help me? :D

cakephp authenticate basic only valid users

I am using the Auth with authenticate Basic.
Is there a way to check if the user is active = 1?
I would like to check that for the Form and the Basic method.
The Basic method is used, when a user log in from an iphone app sending username and password via http header.
public $components = array('Session', 'RequestHandler', 'Auth' => array(
'loginAction' => array(
'controller' => 'api',
'action' => 'login'
),
'authenticate' => array(
'Basic' => array(
'userModel' => 'Appuser',
'fields' => array(
'username' => 'name'
)
),
'Form' => array(
'userModel' => 'Appuser',
'fields' => array(
'username' => 'name'
)
)
)
));
Use the scope setting of the AuthComponent and set it using the ALL constant:
public $components = array(
'Auth' => array(
'loginAction' => array(
'controller' => 'api',
'action' => 'login'
),
'authenticate' => array(
AuthComponent::ALL => array( // Use this to apply common settings
'userModel' => 'Appuser',
'fields' => array(
'username' => 'name'
),
'scope' => array(
'Appuser.active' => 1 // This is the check you need
)
),
'Basic',
'Form'
)
)
);
For more info, refer to this section in the book.

Resources