Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all 14348 articles
Browse latest View live

Custom validation rule, variables on Model

$
0
0
Hi, I have created a custom validation rule, it's like 'is_unique', but with an extra value...
So I can not only check whether a name already exists in the database, but I can check if a user already exists with a specific company_id.
I have added this rule to a model like this:
PHP Code:
    protected $validationRules = [
        'name'    => 'is_double_unique[users,name,company_id,{company_id},id,{id}]',
        'id' => 'permit_empty',
        'company_id' => 'permit_empty'
    ]; 



For INSERTS this works great... But UPDATES always get through, even on duplicates.
I noticed that when the 'company_id' doesn't change (but the name does), the value of 'company_name' is '{company_name}'.
The user entity has a company_id, but it's not passed through to the validation rule because it's an unchanged value.
Resulting a query which checks where 'company_id = {company_id}' instead of 'company_id = 4' for example.

How can I include the data of the unchanged fields as well?

Server Overload Risk Vulnerability Fixes

$
0
0
We've identified and patched a vulnerability in the "Server Overload Risk Fixes" of CodeIgniter 2.6 that could potentially lead to Denial of Service (DoS) attacks. This vulnerability allows an attacker to consume a large amount of memory on the server.

Vulnerability Details: Fix Description:
We've developed a fix for this vulnerability that involves modifying two core files: Router.php 
and URI.php. The fix ensures that regular expressions used in routing and URI validation are properly anchored to prevent malicious exploitation.

Patch:

Code:
diff --git a/system/core/Router.php b/system/core/Router.php
index b39dc16..d1c8b50 100755
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -379,12 +379,12 @@ class CI_Router {
            $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));

            // Does the RegEx match?
-            if (preg_match('#^'.$key.'$#', $uri))
+            if (preg_match('#\A'.$key.'\z#u', $uri))
            {
                // Do we have a back-reference?
                if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)
                {
-                    $val = preg_replace('#^'.$key.'$#', $val, $uri);
+                    $val = preg_replace('#\A'.$key.'\z#u', $val, $uri);
                }

                return $this->_set_request(explode('/', $val));
diff --git a/system/core/URI.php b/system/core/URI.php
index a66cd71..cf38e17 100755
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -255,7 +255,7 @@ class CI_URI {
        {
            // preg_quote() in PHP 5.3 escapes -, so the str_replace() and addition of - to preg_quote() is to maintain backwards
            // compatibility as many are unaware of how characters in the permitted_uri_chars will be parsed as a regex pattern
-            if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str))
+            if ( ! preg_match("/\A[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+\z/iu", $str))
            {
                show_error('The URI you submitted has disallowed characters.', 400);
            }
--
2.34.1

Thank you for your attention to this matter and your continued support of CodeIgniter.

Best regards.

Can't run codeigniter 4 on macOS Sonoma (v14.4.1)

$
0
0
Hi everyone. I am trying to install CodeIgniter 4 on my MacBook Pro M1. I started by installing XAMPP, then I installed Composer, and afterwards, I enabled the extensions required in the official documentation. Everything went smoothly until I tried to view my project at localhost/project-name/public. I am receiving the following error: Class "Locale" not found on the following function:

Code:
public function initialize()
{
    // Set default locale on the server
    Locale::setDefault($this->config->defaultLocale ?? 'en'); //ERROR IS HERE

    // Set default timezone on the server
    date_default_timezone_set($this->config->appTimezone ?? 'UTC');
}

I already check if intl extension is enabled by typing this command:      
php -m | grep intl

And it returns "intl". Does anyone knows what might be? Do i need to check something in particulary?

How to understand entities, save, hasChanged

$
0
0
I have using entities and having a bit of trouble understanding them. I am importing ski resort data from a geojson file. All of the 300 ski resorts imported nicely. Now I am testing if there is an UPDATE to the geojson import file or there is a new record (INSERT). My understand is that I can use hasChanged and SAVE (save will detect if update or insert) but I cannot get hasChanged to detect a change. Here is my code.

public function update_aa_winter_sports_points_from_file(){

$file = file_get_contents(WRITEPATH.'upload_fs_data/aa_winter_sports_points.geojson');
$aa_winter_sports_points = json_decode($file); // The json_decode() function is used to decode or convert a JSON object to a PHP object.
// to count the number of ski resorts
$i = 0;

echo 'Numnber of ski resorts: '.count($aa_winter_sports_points->features); echo '</br>';

foreach ($aa_winter_sports_points->features as $aa_winter_sports_point ){

$x = array($aa_winter_sports_point->properties);

// Convert stdClass object to associative array in php
// https://stackoverflow.com/questions/3442...ray-in-php
$new_OsmSkiResort = json_decode(json_encode($x[0]), TRUE);

// get the id of the ski resort
$id = ($new_OsmSkiResort['id']);
echo $id.'</br>';

$original_OsmSkiResort = $this->OsmSkiResortModel->find($id);

$OsmSkiResort = new \App\Entities\OsmSkiResortEntity();

$OsmSkiResort->fill($new_OsmSkiResort);

if ($original_OsmSkiResort){

if (!$original_OsmSkiResort->hasChanged()){
echo "no change on record number ".$i.'</br>';
}

} else {
$y = $this->OsmSkiResortModel->save($OsmSkiResort) ;
echo "save: ".$y.'</br>';
}

$i++;
echo '</pre>';
}

}

CI Version and first steps

$
0
0
Hello,

I have taken over a project that was created with CI and is unfortunately very poorly documented. Previously PHP7.4 was used, now PHP8.3 is to be used. Since I currently have 0 experience with CI, the first question I have is:

1. which CI version was used and where can I find it? I can't find “@version”, only “@since”
2. is an update necessary (I think so, because there are many “deprecated” warnings) and how time-consuming is an update?

Greetings, Frank

Edit: PHP5.6 was used

codeigniter 4.5 loading view issue

$
0
0
PHP Code:
function test()
        {
        
$this->test2();
        }

    function 
test2()
        {
        return 
view('/themes/default_2024/layouts/Gateway/test');
        } 

I get a white screen when I do this. The reason I need this is for keeping my code clean, this is just an example, but I only get a white screen when I access the test method in the browser instead of the test.php view file. If I move the return view into the test function it of course loads.

Is this a bug or intended functionality?

SQLSRV support for CI Sessions

$
0
0
According to the documentation 
Quote:Only MySQL and PostgreSQL databases are officially supported, due to lack of advisory locking mechanisms on other platforms

However MSSQL does support such mechanisms by using sp_getapplock and sp_releaseapplock which also support timeouts, while only requiring public role membership.

Please consider supporting MSSQL for sessions, I believe that this will be beneficial for all who develop applications on the Codeigniter framework in conjunction with a MSSQL database.

Codeigniter 4 in IIS Webserver

$
0
0
Hello,
In my organization we want to use our Windows Server 2019 IIS to develop and produce real Codeigniter projects.
We have seen the server requirements in the official Codeigniter documentation:

PHP version 8.1 or later and these extensions enabled:
- international
- character string
-json

All the requirements work because we have checked them using the phpinfo() function.
Unfortunately, when we navigate to the /public folder to display the project in the browser, this message appears:
Oh! It seems we've run into a problem. Please try again later...

This is somewhat annoying for us and we did not find the problem. We have searched and read a lot about this error but apparently it is an error with the extensions, which are already activated, or a generic error.

I was wondering if anyone could help/advise me to resolve the issue.

Thanks in advance.

CI4 Executable Files

$
0
0
Is it normal to have files in the CI4 installation with execution permissions? I feel like this shouldn't be the case, at least for the php files.  Can anyone confirm/deny?

Code:
# find . -type f -executable -exec ls -l {} \;
-rwxr-xr-x 1 myuser mygroup 3080 Jan 11 00:34 ./app/Config/DocTypes.php
-rwxr-xr-x 1 myuser mygroup 3250 Jan 11 00:34 ./spark
-rwxr-xr-x 1 myuser mygroup 6246 Jan 11 00:34 ./vendor/nikic/php-parser/bin/php-parse
-rwxr-xr-x 1 myuser mygroup 3080 Jan 11 00:34 ./vendor/codeigniter4/framework/app/Config/DocTypes.php
-rwxr-xr-x 1 myuser mygroup 3250 Jan 11 00:34 ./vendor/codeigniter4/framework/spark
-rwxr-xr-x 1 myuser mygroup 729 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Test/Mock/MockResponse.php
-rwxr-xr-x 1 myuser mygroup 27574 Jan 11 00:34 ./vendor/codeigniter4/framework/system/HTTP/IncomingRequest.php
-rwxr-xr-x 1 myuser mygroup 16210 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Database/SQLSRV/Connection.php
-rwxr-xr-x 1 myuser mygroup 1255 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Database/SQLSRV/Utils.php
-rwxr-xr-x 1 myuser mygroup 12168 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Database/SQLSRV/Forge.php
-rwxr-xr-x 1 myuser mygroup 4850 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Database/SQLSRV/Result.php
-rwxr-xr-x 1 myuser mygroup 3405 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Database/SQLSRV/PreparedQuery.php
-rwxr-xr-x 1 myuser mygroup 24298 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Database/SQLSRV/Builder.php
-rwxr-xr-x 1 myuser mygroup 16328 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Helpers/html_helper.php
-rwxr-xr-x 1 myuser mygroup 23824 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Helpers/text_helper.php
-rwxr-xr-x 1 myuser mygroup 3677 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Helpers/cookie_helper.php
-rwxr-xr-x 1 myuser mygroup 10753 Jan 11 00:34 ./vendor/codeigniter4/framework/system/Helpers/inflector_helper.php
-rwxr-xr-x 1 myuser mygroup 0 Jan 11 00:34 ./vendor/codeigniter4/framework/writable/debugbar/.gitkeep
-rwxr-xr-x 1 myuser mygroup 124 Jan 11 00:34 ./vendor/codeigniter4/framework/writable/.htaccess
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./vendor/codeigniter4/framework/writable/logs/index.html
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./vendor/codeigniter4/framework/writable/session/index.html
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./vendor/codeigniter4/framework/writable/cache/index.html
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./vendor/codeigniter4/framework/writable/uploads/index.html
-rwxr-xr-x 1 myuser mygroup 2716 Jan 11 00:34 ./vendor/phpunit/phpunit/phpunit
-rwxr-xr-x 1 myuser mygroup 1481 Jan 11 00:34 ./vendor/sebastian/resource-operations/build/generate.php
-rwxr-xr-x 1 myuser mygroup 3224 Jan 11 00:34 ./vendor/bin/php-parse
-rwxr-xr-x 1 myuser mygroup 3565 Jan 11 00:34 ./vendor/bin/phpunit
-rwxr-xr-x 1 myuser mygroup 3873 Jan 11 00:34 ./builds
-rwxr-xr-x 1 myuser mygroup 0 Jan 11 00:34 ./writable/debugbar/.gitkeep
-rwxr-xr-x 1 myuser mygroup 124 Jan 11 00:34 ./writable/.htaccess
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./writable/logs/index.html
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./writable/session/index.html
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./writable/cache/index.html
-rwxr-xr-x 1 myuser mygroup 131 Jan 11 00:34 ./writable/uploads/index.html

retrieve hidden input between controllers

$
0
0
im new to codeigniter 3 and in my controller method i have a posted hidden variable ID from ckeditor in view page.
i got that from view in controller method 1 correctly.
next i should got this value in method 2 of same contrroller for more process.
i define as session variable :

PHP Code:
            $ID=$this->input->post('ID');//this hidden value is recieved as 7 which is true!
            $this->session->unset_userdata('edit_id');
            $this->session->set_userdata('edit_id'$ID); 


but when i retrieve in method 2, i got a session variable different from my posted id but with the same name in 

PHP Code:
[oturum_durumu] => 
           
[OTURUM_DB] => stdClass Object
                        
(
                            [id] => 6.

[USER_AKTIF_PROFIL_OTURUMU] => U3B6ZVBHQXdFQVB1UHlVM1l0Ny84UT09

            
[edit_id] => 
PHP Code:
        $ID $this->session->userdata('edit_id');// i got 6 here
        echo "<pre>";
        print_r('edit_id: ');
        print_r($this->session->userdata('edit_id')); 
        
echo "</pre>"



how shold i deal with?
thanks in advance.

CI 4 and simplexml

$
0
0
Good morning everyone, I have a strange problem with using "simplexml" and codeigniter.

I wrote a function that takes data from an online xml and populates a local mysql database.

I've done several tests and everything works perfectly!

at this point, I loaded the controller into the web server and it gives me this error:

Exception
String could not be parsed as XML

I don't understand the meaning of it, as in the server I have locally, with Ubuntu server and the same version of PHP, it works without giving errors.

Anyone have any idea what it could depend on?

This is my controller:

Code:
    public function scaricaXML($macrocategoria)
    {
        $categorie = new CategorieModel();

        $categoria = $categorie->find($macrocategoria);

        //this is the URL of the XML file
        //$url = 'https://www.nrteam.it/webservicesXML/7572/01526120553/1.0/application_09';
        // Retrieve XML data from the URL
        $xmlData = file_get_contents($categoria['link']);

        // Load XML string into SimpleXMLElement object
        $xml = new SimpleXMLElement($xmlData);


        foreach ($xml->children() as $item) {
            $data[] = [
                'codice' => $item->application_ID,
                'upc' => $item->code,
                'titolo' => $item->description,
                'macrocategoria' => $macrocategoria,
                'categorie' => $item->product_family,
                'per_marca' => $item->application_brand != '' ? $item->application_brand : '',
                'per_modello' => $item->application_model != '' ? $item->application_model : '',
                'anno_inizio' => $item->application_start_year != '' ? $item->application_start_year : '',
                'anno_fine' => $item->application_end_year != '' ? $item->application_end_year : '',
                'prezzo_netto' => $item->price_list_no_VAT,
                'prezzo_ivato' => $item->price_list_with_VAT,
                'netto_venditore' => $item->net_price_dealer_no_VAT,
                'sconto_venditore' => $item->dealer_discount,
                'quantita' => $item->availability == 'in_stock' ? 100 : 0,
                'ean13' => $item->ean13 != '' ? $item->ean13 : '',
                'destock' => $item->destock
            ];
        }

        //inserisco questi dati nel database, usando il model: ScambioModel
        $model = new ScambioModel();
        $sottocateogorie = new SottoCategorieModel();
        foreach ($data as $item) {
            $prodotto = $model->where('codice', $item['codice'])->first();
            if (!$prodotto) {
            //controllo sulla sottocategoria. se $item['product_family'] non è nel database, lo inserisco, altrimenti prendo l'id della sottocategoria e lo inserisco nel campo sottocategoria del prodotto
            $sottocategoria = $sottocateogorie->where('nome', $item['categorie'])->first();
            if (!$sottocategoria) {
                $sottocateogorie->insert(['nome' => $item['categorie'], 'id_categoria' => $macrocategoria]);
                $sottocategoria = $sottocateogorie->where('nome', $item['categorie'])->first();
            }
            $item['categorie'] = $sottocategoria['id'];
            $model->insert($item);
            echo "Prodotto inserito: " . $item['titolo'] . "<br>";
            } else {
            $model->update($prodotto['id'], [
                'prezzo_netto' => $item['prezzo_netto'],
                'prezzo_ivato' => $item['prezzo_ivato'],
                'netto_venditore' => $item['netto_venditore'],
                'quantita' => $item['quantita'],
            ]);

            if ($prodotto['titolo'] != $item['titolo']) {
                $modificaModel = new ModificheModel();
                $modifica = $modificaModel->where('id_prodotto', $prodotto['id'])->first();
                if (!$modifica) {
                $modificaModel->insert([
                    'id_prodotto' => $prodotto['id'],
                    'titolo' => $item['titolo'],
                    'per_marca' => $item['per_marca'],
                    'per_modello' => $item['per_modello']
                ]);
                } else {
                $modificaModel->update($modifica['id'], [
                    'titolo' => $item['titolo'],
                    'per_marca' => $item['per_marca'],
                    'per_modello' => $item['per_modello']
                ]);
                }
            }
            echo "Prodotto aggiornato: " . $item['titolo'] . "<br>";
            }
        }
        echo "Data inserted/updated successfully.";

        //qui và aggiunta la pagina di conferma

    }

hasChanged() says it has changed when it hasn't.

$
0
0
I am using entities. I am checking to see if the new post data has changed when compared to the database. I have about 223 records. I have tested my code and everthing works, however, for one record, it always shows it has changed. I

PHP Code:
if ($OsmSkiResort->hasChanged()){
                echo 
"Changed!</br>";
                
$hasChanged++;
               
print_r(  $OsmSkiResort->toRawArray(true));
            } else {
                echo 
"NoChange</br>";
                
$nothingToUpdate++;
            } 

So the one record that shows as "hasChanged" value of print_r() is below;

https://www.google.com/search?q=%E5%B0%B.....69i57j69

I assume all the % is throwing it off. How can I getChanged() to see this as NOT a change please?

Builder LIKE none option

$
0
0
I would like to be able to use the like builder function without having to have the % wildcard placed for me.
This is for taking user input, so we don't know in advance what they might be.
For instance, $builder->like('2%', 'none') would produce very different results to $builder->like('2', both) ['both' because it's the default is all].
No, using 'after' in the above case will not suffice because we don't know where the % may be required.
We already have both (the default), before and after. Can we add one more option of none?

Unable to use typed variables in a cell

$
0
0
Hi everyone!
I like using Cells in my project, especially the controlled ones. And I'd rather to use typed variables in my project.
But when i try to use typed peroperties in controlled cells, I get 
Code:
Undefined variable $typedVariable

Here is my code (I created a small project just for testing this)
Code:
JustATestCell.php
PHP Code:
<?php

namespace App\Cells;

use 
CodeIgniter\View\Cells\Cell;

class 
JustATestCell extends Cell
{
    public int $typedVariable;


Code:
just_a_test.php
PHP Code:
<div>
    <?= $typedVariable?>
</div> 

Code:
main view file
PHP Code:
...
<?=
    view_cell('JustATestCell', [
            'typedVariable' => 1
        
]);
    ?>
... 

So my question is: what am I doing wrong? Am I supposed not to use typed properties in cells?

Thanks in advance

Trouble loading getID3 library

$
0
0
First post. I've deployed a couple sites running a CI framework, but now I am creating my first from scratch so bare with me. 



I would like to determine the length of a audio/video file after a user upload and a quick search online landed me with the getID3 library. Downloadeded the library (github) and placed it in my ThirdParty directory, but I am having trouble creating a getID3 object.



1) I created a test script my public_html.

Code:
require '../app/ThirdParty/getid3/getid3.php';
$getID3 = new getID3;
if(!file_exists("test.flac")){
    exit("File not found");
}
$file = $getID3->analyze("test.flac");
$duration_string = $file['playtime_string'];
echo $duration_string;

The script runs as expected, it outputs the length of the audio file. Great!



2) I tried loading the getID3 library from my controller 'app/Controllers/Job.php' (Note: showOrderForm functions as normal without getID3 and outputs a form for the user): 



Code:
private function showOrderForm($job){
    require_once APPPATH . "/ThirdParty/getid3/getid3.php";
    $getID3 = new getID3;
    // ...
}


But when I run the controller (while in development mode) I get the following error:

Code:
Class "App\Controllers\getID3" not found


Why is ci4 trying to load a controller?



3) I noticed that the getid3.php does not delcare a namespace, so I added 'namespace GetID3;' to the top of their script. Then modified my controller to include the namespace:



Code:
private function showOrderForm($job){
    require_once APPPATH . "/ThirdParty/getid3/getid3.php";
    $getID3 = new GetID3/getID3;
    // ...
}


but now I get another error:



Code:
Class "GetID3\Exception" not found
class getid3_exception extends Exception
{
    public $message;
}


So it looks like adding a namespace broke the getID3 library. Is there anyway to load this library without going through and adding namespaces to all their files? I understand this may not be a ci4 issue, but their library works outside ci4. I also know that the getID3 library does not follow ci4's naming convention with the Capitization of the class name, would this br the problem (I've tried unsucessfully renaming class names and direcory name).

Any help would be appreciated. Thanks!
~Pard

Multiple Image Sets for Image Display

$
0
0
I am implementing dynamic functions that display different images based on the viewport, I think WP has this functionality, here is my helper code , code  that you can understand, 
PHP Code:
function get_thumbnails($id$title$class null)
{
    $MediaModel = new UploadModel();
    $media $MediaModel->find($id);

    if ($media !== null) {
        $small_image base_url('uploads/' $media['upload_path'] . '/small/' $media['file_name']);
        $medium_image base_url('uploads/' $media['upload_path'] . '/medium/' $media['file_name']);
        $large_image base_url('uploads/' $media['upload_path'] . '/medium/' $media['file_name']);

        $titleAttribute = !empty($title) ? "alt=\"" esc($title) . "\"" "";

        $class $class ?? '';
        return "<img
            src=\"
$small_image\"
            
$titleAttribute
            title=\"" 
esc($title) . "\"
            class=\"
$class rounded-top w-100\"
            style=\"min-height: 250px; object-fit: cover\"
            sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 50vw, 25vw\"
            srcset=\"
$large_image 1200w, $medium_image 600w, $small_image 300w\">";
    }
    return null;


is this the correct way or is there any alternative approach with JavaScript that is better in terms of SEO and performance, after implementing this code I am not seeing any improvements in page speed.

here is my sample page URL , Visit Paros or .. ....

Redirect back working strangely when used with controller generating an image

$
0
0
I have a controller that is generating a captcha and all works fine. There is an issue however using the redirect()->back() which seems to redirect to the last image generated on screen via another controller embedded within the <img> HTML tag.

The captcha is shown on screen fine and is generated through the view as per the code below:-

Code:
<div class="text-center m-0">
<img src="<?php echo base_url('captcha/8/330000/ffffff/1'); ?>" id="captcha" class="captcha" alt="Captcha loading..." />
</div>

The captcha is produced via a controller that extends the BaseController and contains the code below that generates and outputs the captcha in the <img> tag:-

Code:
imagefilledrectangle($image,0,0,200,150,$backgrd); 
imagettftext($image, 30, $angle, 10, 90, $color, $font, $code['rand_code']);
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);

All works perfectly but when I use the redirect()->back() (which I would like to use with withInput(); to retain the form data), the redirect goes to http:{mywebsite}/captcha/8/330000/ffffff/1 which is then displaying the PNG file as a series of uncoded characters. I was using redirect()->to({URI}) before which worked fine but this doesn't retain any of the form data that's passed.

I think I understand why the redirect()->back() is accessing the controller that generated the PNG file as it's the last controller accessed, so does anyone have any ideas on how I could get around this and eliminate that controller from the redirect?

Thanks in advance.

WordPress Plugin Exploited to Steal Credit Card Data from E-commerce Sites

Is there a ready-to-use and production-ready Docker container for CodeIgniter?

$
0
0
Hello everyone,

I am looking for a ready-to-use and production-ready Docker container for a CodeIgniter project. I have an application I am developing and would like to know if anyone already has a configured Docker container that can be used for production.

Specifically, I am looking for a container that:

Includes an optimized web server configuration (Apache or Nginx).
Is prepared to handle CodeIgniter dependency management.
Includes security best practices for production environments.
Has examples or documentation that facilitate customization and deployment.
If anyone has a repository or a link to a Docker image they are already using, or any tips on how to configure a suitable container for production, I would greatly appreciate it.

Thank you!

How to retrive cacheKey generated ?

$
0
0
Hello here, 


I have tried several caching methods on my CI 4.5 project, and the method `$this->cachePage(2500);` is the most efficient (less than 40ms). My question is as follows:

So, I am performing caching with: `$this->cachePage(TIME);`
How can I get the randomly generated cache key created by the CI caching system?

we need this key: 
[Image: dTbxhHp.png]

The key, something like in MD5, I would need it to be able to create a function to delete the cache of the concerned page.

Thank you for your help.
Viewing all 14348 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>