Closed Eighke closed 8 years ago
For the second point, I tried something
https://github.com/Eighke/fof/commit/6404e62f1c06c6a1a20ba2001e45ef2308913bea
What do you think?
For the database I checked a bit more but I have no idea why. :(
The problem is that if you want to create MVC classes you need to talk to the database. This means that you'd either need to store this information in your repository or you'd have to run the CLI tool from inside Joomla!. We chose the latter.
I made some changes a couple of weeks ago which allow you to run the FOF CLI tool either from the root of the site (if the PHAR file is in your path) or from a PHAR file placed inside the CLI directory.
As always, you only need to symlink your component into the Joomla! site before using the CLI tool.
I'm already using the PHAR from the CLI path: I have no access to the database. The CLI is just not working at all for model
and layouts
because it fails to connect to the database.
It is a fresh J! 3.5 website with nothing install on it except FOF3.
I just tried to move it at the root of Joomla but it change nothing. The database is init with the wrong parameters.
https://github.com/akeeba/fof/blob/development/fof/Model/DataModel.php#L712
var_dump($this->getDbo())
class JDatabaseDriverMysqli#11 (23) {
public $name =>
string(6) "mysqli"
public $serverType =>
string(5) "mysql"
protected $connection =>
bool(false)
protected $nameQuote =>
string(1) "`"
protected $nullDate =>
string(19) "0000-00-00 00:00:00"
private $_database =>
string(0) ""
protected $count =>
int(0)
protected $cursor =>
NULL
protected $debug =>
bool(false)
protected $limit =>
int(0)
protected $log =>
array(0) {
}
protected $timings =>
array(0) {
}
protected $callStacks =>
array(0) {
}
protected $offset =>
int(0)
protected $options =>
array(9) {
'driver' =>
string(6) "mysqli"
'host' =>
string(9) "localhost"
'user' =>
string(4) "root"
'password' =>
string(0) ""
'database' =>
string(0) ""
'prefix' =>
NULL
'select' =>
bool(true)
'port' =>
int(3306)
'socket' =>
NULL
}
protected $sql =>
NULL
protected $tablePrefix =>
string(4) "jos_"
protected $utf =>
bool(true)
protected $utf8mb4 =>
bool(false)
protected $errorNum =>
int(0)
protected $errorMsg =>
NULL
protected $transactionDepth =>
int(0)
protected $disconnectHandlers =>
array(0) {
}
}
I won't have any time to debug this in the next couple of weeks. If you can do it and file a PR I'd appreciate it lots!
Ok I'll try next week, we will have long holiday here (songkran).
Hi Nic,
I tried to use the CLI, I have some questions / problems.
It is impossible to generate a Model. It always return
Could not connect to MySQL.
. I tracked the problem and it come from this line https://github.com/akeeba/fof/blob/development/fof/Model/DataModel.php#L712The database was init with default value (root user, no password, no database, etc).
I feel confused.
fof init
allow us to create almost a full component tree, which is great. But when we are using thefof generate
is generate the files directly inside Joomla. Well it is possible to manage that using symlink, but it is a bit confusing at start.Couldn't we generate the MVC directly inside the component tree instead ? Or give a new command to do it
--inside-joomla
something like that? It should be easy changing thebackEndPath
andfrondEndPath
.