1
I have the following folder structure in my project:
Within app
I have the following structure:
And the following native function of the php
to give auto load in the classes:
<?php
require_once '/app/config.php';
function __autoload($class_name) {
$folders = array(
'class',
);
foreach ($folders as $folders_files) {
$path = ROOT . 'app' . SEPARATOR . $folders_files . SEPARATOR . $class_name . '.php';
var_dump($path);
if (file_exists($path)) {
require_once $path;
} else {
die('File not found: ' . $path);
}
}
}
I would like to know how to ignore the folder twitteroauth and the classes within it. It will be possible?
UPDATE
I tried with spl_autoload_register();
and get the same mistake:
File not found in: C: wamp64 www twitter-login app class Oauthexception.php
<?php
function autoload ($class_name) {
$folders = array(
'class',
);
foreach ($folders as $folders_files) {
$path = ROOT . 'app' . SEPARATOR . $folders_files . SEPARATOR . $class_name . '.php';
if (file_exists($path)) {
require_once $path;
} else {
die('File not found in: ' . $path);
}
}
}
spl_autoload_register("autoload");
Its very good, vlw men, worked aoksokaosk.
– user76271
Arrange it. Buddy
– WillBB