经过一些研究,无法找到解决问题的方法.我正在使用API,这是我通过composer下载的命名空间.API让它依赖于我允许作曲家为我管理和自动加载.与此分开,我有大约10个类,我已经使用php自动加载spl_autoload_register
.最近,我开始混合这些类来完成一个项目的部分,整个事情已经变成了废话.我的自定义类不能使用作曲家类,反之亦然.有没有一种方法可以用来自动加载两个独立文件夹中的类,并加载两个独立的外载程序.
这是我目前使用的代码.vender/autoload.php与典型的作曲家自动加载器没有什么不同.谢谢你的帮助.
require 'vendor/autoload.php';
require 'functions/general.php';
require 'include/mailgun.php';
function my_autoloader($class) {
require 'classes/' . $class . '.php';
}
spl_autoload_register('my_autoloader');
Run Code Online (Sandbox Code Playgroud) 我理解这是问题,但不管我查了多少教程,我都无法crontab
上班,我正在建立一个网站,依赖于crontab
每晚重置我数据库中的特定设置.
这是我的crontab
档案:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day …
Run Code Online (Sandbox Code Playgroud)