Вопрос

I am trying to retrieve the information inside the "source" but I cant seem to find the correct way to do it.

object(JInstaller)#163 (16) {
["_paths":protected]=>
array(5) {
  ["source"]=>
  string(95) "/var/zpanel/hostdata/desarrollo/public_html/complusoft_net/demo-j2517/tmp/install_53679ce0c6870"

Please note that the path property is protected

Это было полезно?

Решение 2

I have found the answer, I hope this helps other people:

JInstaller::getInstance()->getPath('source');

Другие советы

Straightforward

$obj->_paths["source"]

Of course this only works when _paths is public - for a protected attribute you need a helper method.

public function getPath() {
    return $this->_paths;
}

and can then use something like

$obj->getPath()["source"]

or

$path = $obj->getPath();
$path["source"]

Assuming that you are using Joomla, you would need:

$your_object->getPath('source');
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top