Category : namespaces

I am working on a local development using MAMP Pro. As of this morning (Monday), the script installed for searching is not working, although it was working Friday evening when I left. I am getting the following error: PHP Fatal error: Uncaught Error: Class ‘AjaxLiveSearchcorePDO’ not found in /Users/judson/Sites/rptoffice.local/lib/thirdparty/livesearch/Handler.php:275 Line 275: $wtt = $query2->fetch(PDO::FETCH_ASSOC); The ..

Read more

Laravel (currently 8.12 | php 7.4.14) started throwing errors a few days ago when I try to execute a seeder in a subdirectory via Artisan::call. On bash this command works fine: php artisan db:seed –class=DatabaseSeedersTestingStagingTestDataSeeder But I want to execute it as: Artisan::call("db:seed –class=DatabaseSeedersTestingStagingTestDataSeeder"); The result is: Target class [DatabaseSeedersDatabaseSeedersTestingStagingTestDataSeeder] does not exist. Which is ..

Read more

I have several namespaces, which have their own exception handlers. I also have a general script which needs to reference one of exception handlers – the namespace required is held in a global string. namespace myNamespace1; class NewException extends Exception { …. } namespace myNamespace2; class NewException extends Exception { …. } The $ref variable ..

Read more

I have these files: ./src/index.php ./src/analizer.php The analizer.php is a interface: <?php namespace JsonDiffinterface; interface Analizer { public static function validateJson(string $path): bool; } And the index.php contains a class: <?php declare(strict_types=1); namespace JsonDiffmain; use JsonDiffinterfaceAnalizer; class JsonDifference implements Analizer { public static function validateJson(string $path): bool { return true; } public static function processDiff(string ..

Read more

I want to access to my function connectDB() in Db.php, from index.php but it keeps saying : "Undefined function ‘connectDB’". Here’s the codes. Db.php namespace Appkernel; /** * Connect to a DB * * @return mysqli */ function connectDB(): mysqli { $server="localhost"; $user="root"; $pass=""; $db="xp"; $connexion = mysqli_connect($server, $user, $pass, $db); if (!$connexion) die("La connexion ..

Read more