Symfony 1.4에 모듈을 만들었습니다. 그것은 예상대로 작동합니다. 그럼에도 불구하고 dev.php 모드 일 때 구문 오류이 표시됩니다.Symfony 1.4 : dev.php 모드에서 오류가 발생했습니다. 비 dev.php 모드에서 작동
보자 :
http://honeylumpi.mobi/dev.php/panelparameter
NOTE: panelparameter is the admin-module that I created.
를 내가 얻을 :
Parse error: syntax error, unexpected T_STRING in /home/lola/hl/honey-lumpi/cache/cms/dev/modules/autoPanelparameter/actions/actions.class.php on line 66
자, 줄에서 내가 얻을 actions.class.php
의 66 :
Warning: stream_get_contents() expects parameter 1 to be resource, null given in /home/lola/hl/honey-lumpi/lib/model/sitebuilder/PanelParameter.php on line 22
그리고 라인을 22PanelParameter.php
:
/**
* Returns the serialized value.
*
* @return string
*/
public function getSerializedValue()
{
$res = parent::getValue();
$retval = stream_get_contents($res); <-- This is line 22!
rewind($res);
return $retval;
}
나는 사실, 널이다, 에코 와서 덧붙였다. 그러나 나는 왜 그런지 모른다. 그 코드는 Symfony에 의해 자동 생성됩니다. 나는 그 문제를 해결하는 방법을 모른다. 다시 모듈은 정상적으로 작동하지만 dev.php에서 오류가 발생합니다. 나는 캐시 삭제 등
편집 : 나는, 내가 생성 모르는 심포니 웹 사이트를 만들기 위해 sitebuilder을 몰랐다
<?php
/**
* Subclass for representing a row from the 'PanelParameter' table.
*
*
*
* @package lib.model
*/
class PanelParameter extends BasePanelParameter
{
private $condition;
/**
* Returns the serialized value.
*
* @return string
*/
public function getSerializedValue()
{
$res = parent::getValue();
$retval = stream_get_contents($res);
rewind($res);
return $retval;
}
/**
* Sets the value already serialized.
*
* @param string $v
*/
public function setSerializedValue ($v)
{
parent::setValue($v);
}
/**
* Returns the value of the parameter.
*
* @return mixed
*/
public function getValue()
{
// get serialized value
$v = $this->getSerializedValue();
// unserialize
$value = @unserialize($v);
// check for error
if (false === $value)
{
if ('b:0;' != $v)
{
if (PHP_VERSION_ID < 50300)
{
gxLog::a(__CLASS__, "cannot unserialize parameter #{$this->id} {$this->name} value:{$v}");
$value = null;
}
else
{
// try to fix array indexes
$cb = create_function('$m', 'return "s:".strlen($m[1]).":\"$m[1]\"";');
$v = preg_replace_callback('/i:([0-9]{12,})/', $cb, $v);
$value = @unserialize($v);
if (false === $value)
{
gxLog::a(__CLASS__, "cannot unserialize parameter #{$this->id} {$this->name} value:{$v}");
$value = null;
}
}
}
}
// return unserialized value
return $value;
}
/**
* Sets the value for the parameter.
*
* @param mixed $v
*/
public function setValue ($v)
{
$value = @serialize($v);
parent::setValue($value);
}
/**
* Returns the name of the parameter.
*
* @return string
*/
public function __toString()
{
return $this->getName();
}
/**
* Returns the condition object.
*
* @return gxSiteCondition
*/
public function getCondition()
{
if (!isset($this->condition))
{
// no condition is true always
$condition = new gxSiteCondition;
$cond = parent::getCond();
if (!is_null($cond))
{
// unserialize
$condition = gxSiteCondition::createFromJson($cond);
}
// store
$this->condition = $condition;
}
return $this->condition;
}
/**
* Sets the condition.
*
* @param gxSiteCondition $c
*/
public function setCondition ($c)
{
if (!($c instanceof gxSiteCondition)) throw new Exception ('parameter is not gxSiteCondition');
// serialize
$cond = $c->toJson();
// store
$this->condition = $c;
// store condition
parent::setCond($cond);
}
/**
* Checks the condition in the provided context.
*
* @param sfContext $context
*/
public function checkCondition (sfContext $context)
{
// get condition
$condition = $this->getCondition();
// evaluate condition
return $condition ? $condition->evaluate($context) : true;
}
/**
* Returns true if the provided condition is contained
* in this object's condition.
*
* @param gxBasicCondition $c
* @return boolean
*/
public function containsCondition (gxSiteCondition $c)
{
// get condition
$condition = $this->getCondition();
// check if contained condition
return $condition ? $condition->contains($c) : true;
}
/**
* Set default value for condition if new and not set.
*
* @param PropelPDO $con
* @return int
*/
public function save (PropelPDO $con = null)
{
if ($this->isNew() && !$this->isColumnModified(PanelParameterPeer::COND))
{
$this->setCondition(new gxSiteCondition);
}
return parent::save($con);
}
/**
* Sets contents of passed object to values from current object.
*
* If desired, this method can also make copies of all associated (fkey referrers)
* objects.
*
* @param object $copyObj An object of PanelParameter (or compatible) type.
* @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
* @throws PropelException
*/
public function copyInto($copyObj, $deepCopy = false)
{
$copyObj->setName($this->name);
$copyObj->setSerializedValue($this->getSerializedValue());
$copyObj->setCond($this->cond);
$copyObj->setPanelId($this->panel_id);
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a pkey column, so set to default value
}
}
어리석은 질문이지만, 심포니 cc를 수행 했습니까? 그리고'sitebuilder'는 무엇입니까? 귀하의 모델 파일이'doctrine' 대신 (또는 propel 용 모델 폴더에서)'sitebuilder' 폴더 안에 있음을 압니다. – j0k
예, symfony cc와 동일한 결과를 보았습니다. Sitebuilder는 0에서 사이트를 동적으로 생성하는 데 사용됩니다. 나는 그것을 만들지 않았다. ** Symfony1.0 **에서 ** Symfony1.4 **로 일부 코드를 마이그레이션 중입니다. 내가 궁금해하는 점은 ** dev.php없이 ** 작동한다는 것입니다. 나는 프로펠 – Kani