autoloader

How to use Facebook SDK 4.0 without composer with autoloader

守給你的承諾、 提交于 2019-12-25 03:35:53
问题 I want to send a notification to a Facebook user. I have the following setup example, but can't seem to get anywhere, Keeps giving an error that "Facebook Class not found". <?php session_start(); require_once 'autoload.php'; require_once( 'src/Facebook/FacebookSession.php' ); require_once( 'src/Facebook/FacebookRequest.php' ); use Facebook\FacebookSession; use Facebook\FacebookRequest; $facebook = new Facebook(); $app_id = '654346742464654654'; $app_secret = '--my-secret--'; $app_access_token

PHPExcel Class 'PHPExcel_Worksheet' not found

 ̄綄美尐妖づ 提交于 2019-12-24 13:30:31
问题 I got the following error when importing PHPExcel into my framework: Fatal error: Class 'PHPExcel_Worksheet' not found in /var/www/library/phpexcel.class.php on line 109 I am autoloading my classes including PHPExcel but it looks like PHPExcel uses spl_autoload_register to register any existing autoloader functions with SPL. I also tried echoing the files as they were being loaded and got /var/www/library/PHPExcel/Shared/ZipStreamWrapper.php /var/www/library/PHPExcel/Shared/String.php Fatal

Composer autoloader working in local but not in server

谁说胖子不能爱 提交于 2019-12-24 02:48:05
问题 I'm having trouble finding the reason why composer autoloader is not woking in our server. Made sure composer is installed in the server. I am using it in a plugin in Wordpress. I'm trying to activate the plugin but it's returning an error. In my local the composer autoloader is working fine. All classes are being found. Here's the error I'm getting in the server: Plugin could not be activated because it triggered a fatal error. Fatal error: Class 'App\Settings\Menu' not found in /home

Class autoloader in wordpress plugin

*爱你&永不变心* 提交于 2019-12-23 04:56:17
问题 I want to write a class autoloader to use in a wordpress plugin. This plugin will be installed on multiple sites, and i want to minimize the chance of conflicts with other plugins. The autoloader will be something like this: function __autoload($name) { //some code here } My main issue is, what happens if another class also uses a function like this? I think it will be bound to give problems. What would be the best way to avoid something like that? I am trying to not use namespaces so the

Composer autoloader + slim framework - fatal error: Class 'Slim\Slim' not found?

三世轮回 提交于 2019-12-20 04:22:25
问题 How can I use composer autoloader to load slim? I have it a go below, composer.json: { "autoload": { "psr-4": { "Vendor\\Namespace\\": "" } } } index.php: require dirname(__FILE__).'/vendor/autoload.php'; use \Slim\Slim; Slim::registerAutoloader(); //Instantiate a Slim application: $app = new Slim(); //Define a HTTP GET route: $app->get('/', function () { echo "Hello!"; }); $app->get('/hello/:name/', function ($name) { echo "Hello, $name"; }); //Run the Slim application: $app->run(); error:

How to integrate ezComponents with magento

妖精的绣舞 提交于 2019-12-18 16:57:07
问题 in a 'native' Zend Framework application I would enable the use of ezComponents by adding the autoloader of ezComponents to Zends autoloader: $autoLoader = Zend_Loader_Autoloader::getInstance(); require_once('../library/EZComponents/Base/src/base.php'); $autoLoader->pushAutoloader(array('ezcBase', 'autoload'), 'ezc'); Now, I'm wondering how I could do the same with Magento. Is there a way to extend Varien_Autoload (magentos autoloader) to enable easy integration of ezComponents? OR: Is there

Zend not autoloading models

╄→гoц情女王★ 提交于 2019-12-13 12:41:35
问题 Ok, this is driving me nuts! I have a directory structure as follows: application - modules -- default --- controllers --- models ---- DbTable ---- Cachmapper.php --- views My config file looks like this [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

Mustache_Autoloader missing with Composer

Deadly 提交于 2019-12-13 05:17:00
问题 I dowload the last versión of Mustache (2.7) with Composer, "require": { "mustache/mustache" : "2.7.*", // etc... } but when I try: use Mustache\Mustache_Autoloader; abstract class BaseController { public function __construct() { Mustache_Autoloader::register(); /... } /... } the error.log said: PHP Fatal error: Class 'Mustache\\Mustache_Autoloader' not found in Although, Mustache_Autoloader hasn't namespaces. Composer has: composer/autoload_namespaces.php : return array( 'Mustache' => array(

Autoloader for distributed PHP plugins that includes composer packages

本秂侑毒 提交于 2019-12-12 06:51:45
问题 I am working with a CMS that requires the user to upload extensions. The users do not have access to composer. So I will need to include the dependencies in the distribution itself. Would how I implement it work for autoloading all dependencies? Is this the way to go about this? Here's the simplified directory structure of the distributed extension. (The user is supposed to upload the contents of the upload directory): upload/Eg/ upload/Eg/autoload.php <-- autoloader to load the dependencies

Slim framework - How to autoload Slim/Slim.php instead of using require?

一个人想着一个人 提交于 2019-12-12 03:23:08
问题 How can I autoload Slim/Slim.php instead of using require ? // standard method //require 'ext/Slim/Slim.php'; // autoload method: define ('WEBSITE_DOCROOT', str_replace('\\', '/', dirname(__FILE__)).'/'); // Instance of SplAutoload. $SplAutoload = new SplAutoload(); // Load classes. $SplAutoload->fetch([ 'ext/' // Slim/ is kept under ext/ ]); \Slim\Slim::registerAutoloader(); //Instantiate a Slim application: $app = new \Slim\Slim(); //Define a HTTP GET route: $app->get('/', function () {