Deadpikle / yamf-php

YAMF (Yet Another MVC Framework) is a small PHP MVC framework designed to let you start using the MVC paradigm quickly without a lot of setup work
MIT License
2 stars 0 forks source link

Packagist/Composer Setup #7

Open Deadpikle opened 5 years ago

Deadpikle commented 5 years ago

I'd like to get this package on Packagist/Composer, but don't know all the steps. I did some work in the packagist-setup branch and got it onto Packagist, but the composer require command didn't work too great, and the setup phase is awful. I need to figure out an easy way to get the user to have the app, init.php, etc. folders/files after the composer require step, and I'm not sure how to do that. I also want to warn the user if those files already exist so that they can fix things manually. Then, I need to figure out if things work. In my one test locally using composer require, I got the files to copy properly, but then the autoload wasn't working properly, and I don't know why.

Deadpikle commented 5 years ago

Well, the Composer autoload pointed Models\ and Controllers\ to the YAMF vendor directories and not the local directory, which isn't what I want... 🤔 I want those namespaces to point to the user's stuff, not YAMF's stuff. I don't know if that is possible, unfortunately. We might need to think of a different solution. Laravel has a separate installer project that downloads the latest laravel package and unzips it in order to get around this. I don't really want to have a separate project just for setup...YAMF is supposed to be small and light!

<?php

// autoload_psr4.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Yamf\\' => array($vendorDir . '/deadpikle/yamf-php/src/Yamf'),
    'Models\\' => array($vendorDir . '/deadpikle/yamf-php/app/models'),
    'Controllers\\' => array($vendorDir . '/deadpikle/yamf-php/app/controllers'),
);