Checking if a patreon user has a tier in my page and own a product in my shop different methods in php? [closed]

I have a patreon page with products in my shop and subscription tiers too. I am new to patreon so not understanding it fully.

For my external website, I want user to login with patreon and check if user owns a product from the shop and also check if user owns a subscription tier.

Are these methods different of checking the subscriptions and products.

Thank you so much in advanced

How to run a docker container on a host in a php laravel inside a docker container

We are currently running pphlaravel (api server) as a container using docker.

Among my logics is creating and running docker images of hosts as containers. For example, the docker SDK in phlavel and the docker HTTP in phlavel.

This is not a docker in docker. Question about how to run docker container from php laravel inside docker container to host.

I have tried the following methods at the moment.
#1

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://localhost/containers/create");
    curl_setopt($ch, CURLOPT_UNIX_SOCKET_PATH, "/var/run/docker.sock");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'Content-Type: application/json',
    ]);

    $response = curl_exec($ch);
    $error = curl_error($ch);
    curl_close($ch);

result:

{
    "error": "Couldn't connect to server"
}

#2

$createCommand = sprintf(
"curl --unix-socket /var/run/docker.sock -H 'Content-Type: application/json' -d '%s' -X POST http://localhost/v1.47/containers/create 2>&1",
json_encode([
    'Image' => 'test-image',
    'Cmd' => ['python3', 'main.py', $args1, $args2],
])
);

$createOutput = shell_exec($createCommand);

result:

curl (7) failed to connect

Is there a way to run docker containers on the host from phlaravel inside docker container?

Get spesific infos from another website with php

I try to get some infos from another website and ı can get product name but ı can’t get Stock Name.

this is the website div element whichone is ı want to get infos

<div class="col-xl-5 offset-xl-1 col-lg-6 order-3">
            <div class="product-right">
                <div class="product-brand">
                     <a href="/marka/kaly">Kaly</a>
                    </div>
                    <div class="product-title">
                     <h1>Yamaha MT 25 Stop Komple Ledli Bluetoothlu (Kayar Sinyalli)</h1>
                    </div>
                    <div class="product-sku">Stok Kodu : KM11855-B04</div>
                                                                                                                                        
                    <div class="product-price">
                        <div class="price-text">
                            <div class="product-price-old">
                                2.550,30 <span>₺</span>
                            </div>
                        </div>
                    </div>

I can get product-band ‘kaly’ with this code :

 $urun_parcala=explode('<a href="/marka/',$site);
    $urun_parcala2=explode('"',$urun_parcala[1]);
    return $urun_parcala2[1];

but I cant get product-sku with this code :

 $fgc_urun=file_get_contents("https://www.kalyoncumotor.com/urun/yamaha-mt-25-stop-komple-ledli-kayar-sinyalli");
    $urun_parcala=explode('<div class="product-sku">',$fgc_urun);
    $urun_parcala2=explode('</d',$urun_parcala[0]);
     print_r($urun_parcala2);

Exporting custom field values from Odoo into Woocommerce using the api or python requests module

I am trying to integrate Woocommerce and Odoo by sharing the data between them. For custom fields I could not find a way to import or export them using the api like for the tags or categories fields, so for the import I used the python requests module to get the data for that field.

requests.get('https://{company_name}.standout-digital.com/wp-json/wp/v2/{field_name}')

it worked as expected and I was allowed to get all the data I needed. For the export, I assumed I could do the same thing with a post request instead of a get request

requests.post('https://{company_name}.standout-digital.com/wp-json/wp/v2/{field_name}', {'name': '{name}'})

But I ended up getting a 401 error ‘Sorry, you are not allowed to create terms in this taxonomy.’ I tried including the authentication in the request with the consumer key and secret key but I get the same response.

I also tried writing some php code in Woocommerce using the Snippets plugin to make it so that the field would be writable but I don’t know much php and this is what I got. It also didn’t change anything even after activating the snippet.

function {function_name}() {
    $args = array(
        'label'            => '{label}',
        'rewrite'          => array( 'slug' => '{slug}' ),
        'hierarchical'     => true,
        'show_in_rest'     => true,
        'rest_base'        => '{base_name}',
        'show_ui'          => true,
        'show_in_menu'     => true,
    );
    register_taxonomy('{base_name}', 'product', $args);
}
add_action('init', '{function_name}');

Is there a workaround for this, or a PHP code I need to run, or alternatively a different way to do this entire thing?

Php Curl, returns jibberish, but when viewing in browser and view source, it is raw html. I need the raw html [duplicate]

I need access to the raw html which I can get by opening the url in a browser and view source. However when I try to use php and curl I get jibberish. I know that there is a fairly simple solution but I just don’t know what that is.

This is the url that I am trying to curl:

http://streetfoodfinder.com/embed/BowzersHotDogStand/calendar/small?d=7&amp;u=BowzersHotDogStand&__cf_chl_rt_tk=M7C3__P7LdOQgsBholCQLZViGZ_C5I3Z5fRz67U0N7g-1735601660-1.0.1.1-fHtNkfe7yezbiI5paU96zDuN5NAuDeaL9_eb22Z0U04

This is the html that I get back when I curl the url with php:

<!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="robots" content="noindex,nofollow"><meta name="viewport" content="width=device-width,initial-scale=1"><style>*{box-sizing:border-box;margin:0;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%;color:#313131;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}body{display:flex;flex-direction:column;height:100vh;min-height:100vh}.main-content{margin:8rem auto;max-width:60rem;padding-left:1.5rem}@media (width <= 720px){.main-content{margin-top:4rem}}.h2{font-size:1.5rem;font-weight:500;line-height:2.25rem}@media (width <= 720px){.h2{font-size:1.25rem;line-height:1.5rem}}#challenge-error-text{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI0IyMEYwMyIgZD0iTTE2IDNhMTMgMTMgMCAxIDAgMTMgMTNBMTMuMDE1IDEzLjAxNSAwIDAgMCAxNiAzbTAgMjRhMTEgMTEgMCAxIDEgMTEtMTEgMTEuMDEgMTEuMDEgMCAwIDEtMTEgMTEiLz48cGF0aCBmaWxsPSIjQjIwRjAzIiBkPSJNMTcuMDM4IDE4LjYxNUgxNC44N0wxNC41NjMgOS41aDIuNzgzem0tMS4wODQgMS40MjdxLjY2IDAgMS4wNTcuMzg4LjQwNy4zODkuNDA3Ljk5NCAwIC41OTYtLjQwNy45ODQtLjM5Ny4zOS0xLjA1Ny4zODktLjY1IDAtMS4wNTYtLjM4OS0uMzk4LS4zODktLjM5OC0uOTg0IDAtLjU5Ny4zOTgtLjk4NS40MDYtLjM5NyAxLjA1Ni0uMzk3Ii8+PC9zdmc+);background-repeat:no-repeat;background-size:contain;padding-left:34px}@media (prefers-color-scheme:dark){body{background-color:#222;color:#d9d9d9}}</style><meta http-equiv="refresh" content="390"></head><body class="no-js"><div class="main-wrapper" role="main"><div class="main-content"><noscript><div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div></noscript></div></div><script>(function(){window._cf_chl_opt={cvId: '3',cZone: "streetfoodfinder.com",cType: 'interactive',cRay: '8fa844e9396c7bb9',cH: '5kHEi3YIzviaCfYijWr6Gs7FAw0dPOMDk8tbBwTEYv0-1735627132-1.2.1.1-RVW7kZs2a6PsY7jEPP3z7.OG.o7K4bUrbd33JpZ.LwhSN97HuNNUUXby0w2MGGu5',cUPMDTk: "/embed/BowzersHotDogStand/calendar/small?d=7&amp;u=BowzersHotDogStand&__cf_chl_tk=agJsStwGO2vh6sBuUK9I0P9YanuyvpZryQnsesCBjEE-1735627132-1.0.1.1-D1OUf1zi1zWtUIeg01pU_7o.VozMCxR4s9kDAJXrd74",cFPWv: 'b',cITimeS: '1735627132',cTTimeMs: '1000',cMTimeMs: '390000',cTplC: 0,cTplV: 5,cTplB: 'cf',cK: "",fa: "/embed/BowzersHotDogStand/calendar/small?d=7&amp;u=BowzersHotDogStand&__cf_chl_f_tk=agJsStwGO2vh6sBuUK9I0P9YanuyvpZryQnsesCBjEE-1735627132-1.0.1.1-D1OUf1zi1zWtUIeg01pU_7o.VozMCxR4s9kDAJXrd74",md: "fWx1FNY1389koEzlD09voi3QRHuXyin.rGsBpUnFj7Y-1735627132-1.2.1.1-R.gVoIHPkbQBlILJlsEDY38Al8_h6KWyC4E4jorwOnFXwUeRohQj296zvFOxQywjGnKQaf1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IRowk6wmn7gXjoAUS4sJSQNGgWin_CyeXWQc91NEx_LuJLFCGmMTiSn0Acd.HV_H0CF1d1.fmKKLW44UjE"};var cpo = document.createElement('script');cpo.src = '/cdn-cgi/challenge-platform/h/b/orchestrate/chl_page/v1?ray=8fa844e9396c7bb9';window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, location.href.length - window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;if (window.history && window.history.replaceState) {var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;history.replaceState(null, null, "/embed/BowzersHotDogStand/calendar/small?d=7&amp;u=BowzersHotDogStand&__cf_chl_rt_tk=agJsStwGO2vh6sBuUK9I0P9YanuyvpZryQnsesCBjEE-1735627132-1.0.1.1-D1OUf1zi1zWtUIeg01pU_7o.VozMCxR4s9kDAJXrd74" + window._cf_chl_opt.cOgUHash);cpo.onload = function() {history.replaceState(null, null, ogU);}}document.getElementsByTagName('head')[0].appendChild(cpo);}());</script></body></html>

The html that I am looking to get, which is what you get when you go to the url directly and view source is:

<!DOCTYPE html>
<html>
<head>
    <title>Bowzers In Motion Upcoming Events / Schedule</title>
    <meta name="robots" content="noindex">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">

    <style>
        body {
            font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
            font-size: 13px;
            line-height: 1.42857143;
            color: #333;
            background-color: #2A95D3;
            margin:0;
            padding:0;
        }

        a{
            text-decoration: none;
        }

        a:hover{
            text-decoration: underline;
        }

        ul{
            border: 0;
            margin: 0;
            outline: 0;
            padding: 0;
            font-size: 100%;
        }

        small{
            font-size:0.9em;
            display:block;
        }

        #tinyheader{
            background-color: #2A95D3;
            width: 100%;
            top: 0;
            height:45px;
            font-size:16px;
            padding-left:8px;
            font-weight:bold;
            color:#FFFFFF;
            line-height:1.4;
            padding-top:5px;
            border-bottom:2px solid #2A95D3;
        }

        #tinyframe{
            background:#FFFFFF;
            border-color: #2A95D3;
            border-style: solid;
            border-width: 2px 2px 2px 2px;
            overflow:hidden;
            border-bottom-left-radius:6px;
            border-bottom-right-radius:6px;
        }

        .list li{
            padding:4px;
            padding-left:8px;
            background:#FFFFFF;
            border-bottom:inset 1px #DDDDDD;
            color:#2a2a2a;
        }

        .list li a{
            color:#2a2a2a;
        }

        #tinyheader a{
            color:#FFFFFF;
        }
        #tinyheader a:visited{
            color:#FFFFFF;
        }

        #tinyfooter a{
            color:#FFFFFF;
        }
        #tinyfooter a:visited{
            color:#FFFFFF;
        }

        .section_header{
            background-color: #666 !important;
            color:#fff !important;
            height:13px;
            line-height: 1;
        }

        .ename{
            font-weight: 500;
        }

        .etime{
            font-size:0.9em;
            font-weight:500;
        }

    </style>
    <script>
        $(function(){
            //window.setInterval(function(){console.log(window.innerHeight)}, 5000);
            function sizer(){
                //$('#tinyframe').height(window.innerHeight);
                $('#tinyscroller').height(window.innerHeight - $('#tinyheader').outerHeight() - 4);
            }
            $(window).resize(sizer);
            sizer();
        });
    </script>
</head>
<body>
    <div id="tinyframe">
        <div id="tinyheader" style="">
            <a target="_blank" href="https://streetfoodfinder.com/BowzersHotDogStand">
                Bowzers In Motion
                <div style="font-size:0.75em;font-weight:400;">Upcoming Schedule</div>
            </a>
        </div>
        <div id="tinyscroller" style="width:100%; overflow-y:auto;overflow-x:hidden">
            <div id="tinycontent">
                <ul class="list">
                    
                        
                        
                            
                                
                                <li class="section_header">Today (12/31)</li>
                            
                            <li>
                                <a target="_blank" href="https://streetfoodfinder.com/BowzersHotDogStand#3255472">
                                    <div class="ename">Standardized Brewing</div>
                                    <div class="etime"><i class="fa fa-clock-o"></i> 10am-2pm</div>
                                    <small class="eaddy">
                                        5920 Evans Farm Dr Suite A<br/>
                                        Lewis Center, OH 43035
                                    </small>
                                    
                                </a>
                            </li>
                        
                            
                                
                                <li class="section_header">Saturday (1/4)</li>
                            
                            <li>
                                <a target="_blank" href="https://streetfoodfinder.com/BowzersHotDogStand#3259845">
                                    <div class="ename">3657 E Main St</div>
                                    <div class="etime"><i class="fa fa-clock-o"></i> 11am-6pm</div>
                                    <small class="eaddy">
                                        3657 E Main St<br/>
                                        Whitehall, OH 43213
                                    </small>
                                    
                                </a>
                            </li>
                        
                    
                </ul>
            </div>
        </div>
        <div id="tinyfooter" style="display:none;height:0px; background-color:#2A95D3; font-size:12px;text-align:right;padding-right:5px;">
            <a href="https://streetfoodfinder.com/BowzersHotDogStand">View Bowzers In Motion's Calendar</a>
        </div>
    </div>
<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'8fa849ffde2522c7',t:'MTczNTYyNzM0MC4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"rayId":"8fa849ffde2522c7","serverTiming":{"name":{"cfExtPri":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}},"version":"2024.10.5","token":"5c6abbb0d35147c59a350371cd4e0154"}' crossorigin="anonymous"></script>
</body>
</html>

What am I not doing right?

Radio Button Values From Comma Separated Values In PHP

I have stored questions and their Answer Values in mysql database table.

I want to fetch questions and their answer values as radio button.

How to achieve this ?

Current Code

id   |  question_field_name   |    question                |  answers
 1   |  gender                |    Gender ?                |  Male, Female, Transgender
 2   |  education             |    Education ?             |  Under Graduate, Graduate, Post Graduate
 3   |  like_reading          |    Do You Like Reading ?   |  Yes, No

I am using following php code to fetch questions and answers. I want to convert answers comma separated list as radio button

<?php
 $query = "select * from mytable";
 $result = $database->get_results($query);
 foreach ($result as $data){
    $field_name = $data['question_field_name'];
    $question = $data['question'];
    $answers = $data['answers'];
 ?>
 <label><?php echo $question;?></label>
     <input type="radio" name="<?php echo $field_name;?>" value="?"> 

    ### How to create here radio buttons with Answers in comma separated list stored in db in column answers
    if there are three values in comma separated list, then to create three radio buttons with each values, if two then two radio buttons ...etc...


<?php } ?>

date incorrectly stored in MariaDB

My output date 1988-00-00 differs from my input date 2012-12-12 and I cannot figure out why?

I am inserting the date 2012-12-12, which sits in variable $_SESSION[CompletionDate], into a MariaDB table with the following php script:

echo"<p>CompletionDate = ".$_SESSION['CompletionDate']."</p>

mysqli_query($cxn,"INSERT INTO conservatorreport (UniqueConservatorReportRecordID,ClockID,ConservatorID,CompletionDate,ConservatorJobIdentifier,ConservatorReportFile) VALUES ('$_SESSION[UniqueConservatorReportRecordID]','$_SESSION[UniqueClockRecordID]','$_SESSION[UniqueConservatorRecordID]',STR_TO_DATE($_SESSION[CompletionDate],'%Y-%m-%d'),'$_SESSION[ConservatorJobIdentifier]','$_SESSION[ConservatorReportFile]')")

All these variables are inserted correctly into the conservatorreport table, apart from $_SESSION[CompletionDate] which shows up in the table as 1988-00-00. The echo script sits immediately before the INSERT statement and shows:

CompletionDate = 2012-12-12

So I am convinced I am inputting 2012-12-12. I do not understand how input 2012-12-12 becomes output 1988-00-00? In the MariaDB conservatorreport table CompletionDate is defined as date.

When I leave out the STR_TO_DATE function and submit the INSERT command as follows:

mysqli_query($cxn,"INSERT INTO conservatorreport (UniqueConservatorReportRecordID,ClockID,ConservatorID,CompletionDate,ConservatorJobIdentifier,ConservatorReportFile) VALUES ('$_SESSION[UniqueConservatorReportRecordID]','$_SESSION[UniqueClockRecordID]','$_SESSION[UniqueConservatorRecordID]',$_SESSION[CompletionDate],'$_SESSION[ConservatorJobIdentifier]','$_SESSION[ConservatorReportFile]')")

I get the following error message:

Fatal error: Uncaught mysqli_sql_exception: Incorrect date value: ‘1988’ for column conservatorreport.CompletionDate

I spent several days trying to find the bug and begin to believe it is something in the MariaDB which causes this, but I do not know where to look.

My database server details are:

Server: Localhost via UNIX socket

Server type: MariaDB

Server connection: SSL is not being used Documentation

Server version: 10.4.28-MariaDB – Source distribution

Protocol version: 10

User: root@localhost

Server charset: UTF-8 Unicode (utf8mb4)

My web server details are:

Apache/2.4.56 (Unix) OpenSSL/1.1.1t PHP/8.2.4 mod_perl/2.0.12 Perl/v5.34.1

Database client version: libmysql – mysqlnd 8.2.4

PHP extension: mysqli Documentation curl Documentation mbstring Documentation

PHP version: 8.2.4## Heading ##

About tht function configureServiceManager in class ServiceManagerConifg in ZF2

I am reading thre sources code of ZF2.I met the class ServiceManagerConifg.I can’t understand the function of the Function configureServiceManager.

class ServiceManagerConfig implements ConfigInterface
{
/* Services that can be instantiated without factories * @var array*/
protected $invokables = array('SharedEventManager' => 'Zend\EventManager\SharedEventManager', );  
protected $factories = array(                     /* Service factories  *@var array */
'EventManager'  => 'Zend\Mvc\Service\EventManagerFactory',
'ModuleManager' => 'Zend\Mvc\Service\ModuleManagerFactory',
);
protected $abstractFactories = array();           /Abstract factories   * @var array*/
protected $aliases = array(                    / Aliases  * @var array */
'Zend\EventManager\EventManagerInterface' => 'EventManager', );
/Shared services,* Services are shared by default; this is primarily to indicate services that should NOT be shared @var array  */
protected $shared = array(
'EventManager' => false,
);
/* Constructor
* Merges internal arrays with those passed via configuration * @param  array $configuration */
public function __construct(array $configuration = array())
{
if (isset($configuration['invokables'])) {
$this->invokables = array_merge($this->invokables, $configuration['invokables']);
}
if (isset($configuration['factories'])) {
$this->factories = array_merge($this->factories, $configuration['factories']);
}
if (isset($configuration['abstract_factories'])) {
$this->abstractFactories = array_merge($this->abstractFactories, $configuration['abstract_factories']);
}
if (isset($configuration['aliases'])) {
$this->aliases = array_merge($this->aliases, $configuration['aliases']);
}
if (isset($configuration['shared'])) {
$this->shared = array_merge($this->shared, $configuration['shared']);
}
}
/* Configure the provided service manager instance with the configuration in this class.
* In addition to using each of the internal properties to configure the service manager, also adds an initializer to inject
*ServiceManagerAware and ServiceLocatorAware classes with the service manager.
* @param  ServiceManager $serviceManager
* @return void */
public function configureServiceManager(ServiceManager $serviceManager)
{
foreach ($this->invokables as $name => $class) {
$serviceManager->setInvokableClass($name, $class);
}
foreach ($this->factories as $name => $factoryClass) {
$serviceManager->setFactory($name, $factoryClass);
}
foreach ($this->abstractFactories as $factoryClass) {
$serviceManager->addAbstractFactory($factoryClass);
}
foreach ($this->aliases as $name => $service) {
$serviceManager->setAlias($name, $service);
}
foreach ($this->shared as $name => $value) {
$serviceManager->setShared($name, $value);
}
$serviceManager->addInitializer(function ($instance) use ($serviceManager) {
if ($instance instanceof EventManagerAwareInterface) {
if ($instance->getEventManager() instanceof EventManagerInterface) {
$instance->getEventManager()->setSharedManager(
$serviceManager->get('SharedEventManager')
);
} else {
$instance->setEventManager($serviceManager->get('EventManager'));
}
}
});
$serviceManager->addInitializer(function ($instance) use ($serviceManager) {
if ($instance instanceof ServiceManagerAwareInterface) {
$instance->setServiceManager($serviceManager);
}
});

        $serviceManager->addInitializer(function ($instance) use ($serviceManager) {
            if ($instance instanceof ServiceLocatorAwareInterface) {
                $instance->setServiceLocator($serviceManager);
            }
        });
        $serviceManager->setService('ServiceManager', $serviceManager);
        $serviceManager->setAlias('ZendServiceManagerServiceLocatorInterface', 'ServiceManager');
        $serviceManager->setAlias('ZendServiceManagerServiceManager', 'ServiceManager');
    }

}

The use in class ServiceManager

<?php
namespace ZendServiceManager;
use ReflectionClass;

class ServiceManager implements ServiceLocatorInterface
{
        /**@#+ Constants */
    const SCOPE_PARENT = 'parent';
    const SCOPE_CHILD = 'child';
protected $canonicalNames = array();        /*Lookup for canonicalized names. * @var array*/
    protected $allowOverride = false;           /** @var bool*/    
    protected $invokableClasses = array();       /* @var array*/    
    protected $factories = array();             /* @var string|callable|Closure|FactoryInterface[] */    
    protected $abstractFactories = array();      /* @var AbstractFactoryInterface[]  */    
    protected $delegators = array();           /* @var array[] */    
    protected $pendingAbstractFactoryRequests = array();   /* @var array */    
    protected $lastAbstractFactoryUsed = null;            /* @var string*/    
    protected $lastCanonicalNameUsed   = null;         /*@var string */    
    protected $shared = array();                       /* @var array */   
    protected $instances = array();                     /* Registered services and cached values * @var array*/    
    protected $aliases = array();                      /* @var array*/   
    protected $initializers = array();                   /* @var array*/    
    protected $peeringServiceManagers = array();      /* @var ServiceManager[] */    
    protected $shareByDefault = true;                /*Whether or not to share by default  *@var bool*/    
    protected $retrieveFromPeeringManagerFirst = false;     /** @var bool */    
    protected $throwExceptionInCreate = true;             /* @var bool Track whether not to throw exceptions during create()  */
                                                   /* @var array map of characters to be replaced through strtr */
    protected $canonicalNamesReplacements = array('-' => '', '_' => '', ' ' => '', '\' => '', '/' => '');
    /*Constructor
     * @param ConfigInterface $config */
    public function __construct(ConfigInterface $config = null)
    {
        if ($config) {
            $config->configureServiceManager($this);
        }
    }
   

I has try to ask gpt.It told me that”This code is the configureServiceManager method, which is responsible for configuring the ServiceManager instance and setting up various services and their dependencies. The multiple configuration steps within the method ensure that the ServiceManager correctly registers services, aliases, factories, initializers, etc”
However,Isn’t the ServiceManager used to manage services? Why, in the configuration of configureServiceManager (the configuration of the ServiceManager),it is used to ensure that the ServiceManager correctly registers services, aliases, factories, initializers, etc.?

Sale products by voucher codes [closed]

I have a WordPress site where I want to sell courses using offline voucher codes via WooCommerce. Here’s what I’m trying to achieve:

1.  I will sell the voucher codes offline (outside the website).
2.  The voucher codes should allow students to:
•   Automatically enroll in a specific course.
•   Or purchase another product for free not discount only free.

Important Note:

•   The voucher codes will not be displayed or sold as products on WooCommerce.
•   WooCommerce products will only display the courses and other items available for purchase.

How can I implement this functionality in WooCommerce or with additional plugins? Is there a way to link the voucher codes directly to course enrollment or product purchases?

Thank you for your help!

navigator.share not working in android(wirking in vivo and samsung devices) working fine on ios devices

While sharing only image description is not coming, and when i share the URL to the image description is working. I want Image + description. I tried using blob too but there was no effect. On sharing the image as canvas also rendered same issue.

<?php
    // Image URL
    $imageUrl = "https://www.example.com/demo/vd/image.jpg";
    $description = "This is an amazing image. Let me share it with you!";
    ?>
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Share Image and Copy Description</title>
    <style>
    .share-btn {
    padding: 15px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    }
    </style>
    </head>
    <body>
    
    <h1>Share this Image with Description!</h1>
    <img src="<?php echo $imageUrl; ?>" alt="Awesome Image" width="300" style="border-radius: 8px;">
    
    <!-- Share Button -->
    <button class="share-btn" id="shareBtn">Share Image and Copy Description</button>
    
    <script>

    async function shareImageAsCanvasAndCopyDescription(imageUrl, description) {
    try {
    // Create an image element to load the image
    const image = new Image();
    image.crossOrigin = "Anonymous";  
    image.src = imageUrl;
    
    image.onload = async function() {
    // Create a canvas to draw the image onto
    const canvas = document.createElement("canvas");
    const ctx = canvas.getContext("2d");
    
    // Set canvas dimensions based on image size
    canvas.width = image.width;
    canvas.height = image.height;
    
    ctx.drawImage(image, 0, 0, image.width, image.height);
    
    canvas.toBlob(async function(blob) {
    if (!blob) {
    console.error("Error creating image Blob");
    return;
    }
    
    const imageFile = new File([blob], "image.jpg", { type: "image/jpeg" });
    
    if (navigator.share) {
    await navigator.share({
    text: description,  
    files: [imageFile]   
    });
    
    console.log("Shared successfully!");
    
    await navigator.clipboard.writeText(description);
    console.log("Description copied to clipboard!");
    
    alert("Image shared and description copied to clipboard!");
    } else {
    alert("Web Share API is not supported on this browser.");
    }
    }, "image/jpeg");
    };
    } catch (error) {
    console.error("Error sharing content:", error);
    }
    }
    
    document.getElementById("shareBtn").addEventListener("click", function() {
    const imageUrl = "<?php echo $imageUrl; ?>";  
    const description = "<?php echo $description; ?>";  
    shareImageAsCanvasAndCopyDescription(imageUrl, description);
    });
    </script>
    
    </body>
    </html>

How can I run a function when a course module is added or updated in moodle?

I try to add observers on course_module_updated and course_module_created
but not triggered any of my Triggering ways

I tried:
Purge all caches. — not work
log to file. — not work
log to database. — not work
die() — not work

Is my code has wrong ?

Is the event triggered but log code not work

db/events.php

defined('MOODLE_INTERNAL') || die();
use moodle_local_plugineventevents_observer;


$observers = [
    [
        'eventname' => 'coreeventcourse_module_updated',
        'callback' => 'events_observer::course_module_updated',
        'includefile' => null,
        'internal' => true,
        'priority' => 9999
    ],
    [
        'eventname' => 'coreeventcourse_module_created',
        'callback' => 'events_observer::course_module_updated',
        'includefile' => null,
        'internal' => true,
        'priority' => 9999
    ],
];

classes/event/observer.php

namespace moodle_local_pluginevent;

defined('MOODLE_INTERNAL') || die();

class events_observer
{
    /**
     * Triggered when 'course_module_updated' event is triggered.
     *
     * @param coreeventcourse_module_updated $event
     * @return bool
     */
    public static function course_module_updated(coreeventcourse_module_updated $event)
    {
        global $DB, $CFG;
        // Log to DB
        $logdata = new stdClass();
        $logdata->eventname = $event->eventname;
        $logdata->component = 'local_course_editor';
        $logdata->action = 'updated';
        $logdata->target = 'course_module';
        $logdata->objectid = $event->objectid;
        $logdata->timecreated = time();

        $DB->insert_record('log', $logdata);


        // Log the event data to a file

        $logfile = $CFG->dirroot . '/local/moodle_local_plugin/log.txt';
        $timestamp = date('Y-m-d H:i:s');
        $eventData = json_encode($event->get_data(), JSON_PRETTY_PRINT);
        $logMessage = "[{$timestamp}] Course module updated:n{$eventData}nn";

        file_put_contents($logfile, $logMessage, FILE_APPEND);

        // end
        die(var_dump($event));
        //   return true;
    }
}

Can any one help me with that ?

Thanks!

Error uploading large file on fails using php and nginx ingress

I am currently running into an issue on PHP trying to upload a video.

It returns an error saying. I am running laravel php on GKE and using nginx-ingress.

I have updated the necessary values in php.ini

upload_max_filesize = 1024M
post_max_size = 1024M
memory_limit = 1024M

I also added the annotations to ingress:

nginx.ingress.kubernetes.io/proxy-body-size

<br />
<b>Warning</b>: POST Content-Length of 61828655 bytes exceeds the limit of 8388608 bytes in <b>Unknown</b> on line
<b>0</b><br />
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="noindex,nofollow,noarchive" />
    <title>An Error Occurred: Content Too Large</title>
    <link rel="icon"
        href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>❌</text></svg>" />
    <style>
        body {
            background-color: #fff;
            color: #222;
            font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            margin: 0;
        }

        .container {
            margin: 30px;
            max-width: 600px;
        }

        h1 {
            color: #dc3545;
            font-size: 24px;
        }

        h2 {
            font-size: 18px;
        }
    </style>
</head>

<body>
    <div class="container">
        <h1>Oops! An Error Occurred</h1>
        <h2>The server returned a "413 Content Too Large".</h2>

        <p>
            Something is broken. Please let us know what you were doing when this error occurred.
            We will fix it as soon as possible. Sorry for any inconvenience caused.
        </p>
    </div>
</body>

</html>

Any idea or help on what i can do to fix this issue? Thanks for the help

listening hook on course module or activity or resource added on moodle

I need to trigger a custom action or send an HTTP request to my API whenever a course module, activity, or resource is added in Moodle 4.5 The API will handle indexing for the added module.

Is there a way to add a hook or listen to an existing event for this scenario in Moodle?

Any guidance, examples, or references to the relevant APIs or documentation would be greatly appreciated!

Thanks in advance.

Dec 2024 – PhpStorm uploads to server – but outside of Public_Html directory — I tried everything

for the last 4 days using PhpStorm, Dec 2024 version, I have played with deplyment configuration, trying different (a) root path (b) mapping deployment path … but sadly nothing works; however, when I log into the remote server I can see that PhpStorm did create a directory outside of the Public_html directory, and the files were uploaded there indeed.

Problem is that …

for example:
I want files uploaded to xyz.com/welcome
I used the”/” as root path
and /welcome as the deployment path

However:
files get uploaded to
/home/user/
and not to
/home/user/public_html/welcome

I also checked with YouTube but the vids on this subject are over 7-9 years old, and I just recently downloaded PhpStorm some days back. So their screenshots are not the same as mine, sadly.

I never had any issues with FTP software before, but this feature is so important that I do not yet understand why there is no illustrated written examples – or even updated YouTube videos on this.

I just subscribed to PhpStorm — so I am new at this — and I’m not sure if the software has a bug in it or if I am dumber than dumb ….. please help me on this — thanks!!

I tried different deployment configurations
I tried watching youtube videos
I tried googling the answer

There is really nothing current on this issue anywhere

So, I come to StackOverflow to seek answer from the Pros

Please

How to select unique events per unique user from MySQL?

I have a table like this:

click_id event page
01 ad_click landing_page01
01 page_view landing_page01
01 page_view landing_page01
01 offer_click landing_page01
02 ad_click landing_page01
02 page_view landing_page01
02 offer_click landing_page01
02 offer_click landing_page01

I would like to get only rows that have unique events for each click_id. So I don’t want to see if somebody views the page 10 times, I only want to know if he viewed the page at all. The same goes for the offer_click event. I only want to see who clicked on the offer at all, because some people click on the offer link 10 times and gives me bad click-through-rate data when I display it.

All ad_click events have a unique click_id, because that’s where they get their id, so that’s fine.

I also want to select the whole rows, because there are a lot more colums with timestamp, IP, etc.

Please help me, I’m mighty confused by all the MySQL syntax.

Also if the way I organize my data is bad, please let me know. I haven’t really studied databases and stuff and just winged it. I have several hundred thousand rows now in my “tracker”, all in one table. It works for me, but I struggle with this particular problem.

The solution I had before was multiple queries, but it took several minutes to load, now I’m using a php array to check for duplicate click_id’s for each event, but that adds another 5 seconds just to check for one event. I’m sure it’s possible to do it faster with MySQL.

Thanks!