本文整理汇总了PHP中Prado::getPathOfNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP Prado::getPathOfNamespace方法的具体用法?PHP Prado::getPathOfNamespace怎么用?PHP Prado::getPathOfNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prado
的用法示例。
在下文中一共展示了Prado::getPathOfNamespace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _startThemeManager
private function _startThemeManager()
{
$themeManager = new TThemeManager();
$themeManager->BasePath = "System.Wsat.themes";
$url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
$themeManager->BaseUrl = "{$url}/themes";
$themeManager->init(null);
$this->setThemeManager($themeManager);
}
示例2: importZendNamespace
protected function importZendNamespace()
{
if (is_null(Prado::getPathOfAlias('Zend'))) {
$zendBase = !is_null($this->_ZF) ? $this->_ZF . '.*' : 'Application.index.*';
$path = !is_null($this->_ZF) ? $this->_ZF . '.Zend.*' : 'Application.index.Zend.*';
Prado::using($zendBase);
Prado::setPathOfAlias('Zend', Prado::getPathOfNamespace($path));
}
}
示例3: flushMySQLDatabase
function flushMySQLDatabase()
{
$conn = $this->sqlmap->getDbConnection();
$file = Prado::getPathOfNamespace('Application.App_Data.MySQL4.mysql-reset', '.sql');
if (is_file($file)) {
$this->runScript($conn, $file);
} else {
throw new Exception('unable to find script file ' . $file);
}
}
示例4: setOpFile
public function setOpFile($op_file_namespace)
{
$op_file = Prado::getPathOfNamespace($op_file_namespace);
if (empty($op_file)) {
throw new Exception("You need to fix your output folder namespace.");
}
if (!is_dir($op_file)) {
mkdir($op_file, 0777, true);
}
$this->_opFile = $op_file;
}
示例5: getErrorTemplate
/**
* Retrieves the template used for displaying external exceptions.
* This method overrides the parent implementation.
*/
protected function getErrorTemplate($statusCode, $exception)
{
// use our own template for BlogException
if ($exception instanceof BlogException) {
// get the path of the error template file: protected/error.html
$templateFile = Prado::getPathOfNamespace('Application.error', '.html');
return file_get_contents($templateFile);
} else {
// otherwise use the template defined by PRADO
return parent::getErrorTemplate($statusCode, $exception);
}
}
示例6: getBaseDirectory
public function getBaseDirectory()
{
if (is_null($this->_baseDirectory)) {
$path = $this->getManager()->getAssetPath();
if ($path === null || !is_dir($path)) {
$path = Prado::getPathOfNamespace($path);
}
if ($path === null || !is_dir($path)) {
throw new TConfigurationException('invalid asset path "{0}"', $this->getManager()->getAssetPath());
}
$this->_baseDirectory = realpath($path);
}
return $this->_baseDirectory;
}
示例7: saveButtonClicked
public function saveButtonClicked($sender, $param)
{
$dom = new TXmlDocument();
$dom->Encoding = 'utf-8';
$dom->TagName = 'parameters';
$elements = $dom->Elements;
$elements[] = $this->createParameter('SiteTitle', $this->SiteTitle->Text);
$elements[] = $this->createParameter('SiteSubtitle', $this->SiteSubtitle->Text);
$elements[] = $this->createParameter('SiteOwner', $this->SiteOwner->Text);
$elements[] = $this->createParameter('AdminEmail', $this->AdminEmail->Text);
$elements[] = $this->createParameter('MultipleUser', $this->MultipleUser->Checked);
$elements[] = $this->createParameter('AccountApproval', $this->AccountApproval->Checked);
$elements[] = $this->createParameter('PostPerPage', $this->PostPerPage->Text);
$elements[] = $this->createParameter('RecentComments', $this->RecentComments->Text);
$elements[] = $this->createParameter('PostApproval', $this->PostApproval->Checked);
$themeName = $this->ThemeName->SelectedItem->Text;
$elements[] = $this->createParameter('ThemeName', $themeName);
$dom->saveToFile(Prado::getPathOfNamespace(self::CONFIG_FILE, '.xml'));
if ($themeName !== $this->Theme->Name) {
$this->Response->reload();
}
}
示例8: getScriptDeploymentPath
/**
* Gets the editor script base URL by publishing the tarred source via TTarAssetManager.
* @return string URL base path to the published editor script
*/
protected function getScriptDeploymentPath()
{
$tarfile = Prado::getPathOfNamespace('System.3rdParty.TinyMCE.tiny_mce', '.tar');
$md5sum = Prado::getPathOfNamespace('System.3rdParty.TinyMCE.tiny_mce', '.md5');
if ($tarfile === null || $md5sum === null) {
throw new TConfigurationException('htmlarea_tarfile_invalid');
}
$url = $this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum);
$this->copyCustomPlugins($url);
return $url;
}
示例9: setParameterFile
/**
* @param string the parameter file path. It must be in namespace format
* and the file extension is '.xml'.
* @throws TInvalidOperationException if the module is initialized
* @throws TConfigurationException if the file is invalid
*/
public function setParameterFile($value)
{
if ($this->_initialized) {
throw new TInvalidOperationException('parametermodule_parameterfile_unchangeable');
} else {
if (($this->_paramFile = Prado::getPathOfNamespace($value, $this->getApplication()->getConfigurationFileExt())) === null || !is_file($this->_paramFile)) {
throw new TConfigurationException('parametermodule_parameterfile_invalid', $value);
}
}
}
示例10: setDbFile
/**
* @param string database file path (in namespace form)
* @throws TInvalidOperationException if the module is already initialized
* @throws TConfigurationException if the file is not in proper namespace format
*/
public function setDbFile($value)
{
if ($this->_initialized) {
throw new TInvalidOperationException('sqlitecache_dbfile_unchangeable');
} else {
if (($this->_file = Prado::getPathOfNamespace($value, self::DB_FILE_EXT)) === null) {
throw new TConfigurationException('sqlitecache_dbfile_invalid', $value);
}
}
}
示例11: setConfigFile
/**
* @param string external configuration file in namespace format. The file
* must be suffixed with '.xml'.
* @throws TInvalidDataValueException if the file is invalid.
*/
public function setConfigFile($value)
{
if (($this->_configFile = Prado::getPathOfNamespace($value, $this->getApplication()->getConfigurationFileExt())) === null) {
throw new TConfigurationException('urlmapping_configfile_invalid', $value);
}
}
示例12: setBasePath
/**
* @param string root directory (in namespace form) storing pages
* @throws TInvalidOperationException if the service is initialized already or basepath is invalid
*/
public function setBasePath($value)
{
if ($this->_initialized) {
throw new TInvalidOperationException('pageservice_basepath_unchangeable');
} else {
if (($path = Prado::getPathOfNamespace($value)) === null || !is_dir($path)) {
throw new TConfigurationException('pageservice_basepath_invalid', $value);
}
}
$this->_basePath = realpath($path);
}
示例13: setDbFile
public function setDbFile($value)
{
if (($this->_dbFile = Prado::getPathOfNamespace($value, self::DB_FILE_EXT)) === null) {
throw new BlogException(500, 'blogdatamodule_dbfile_invalid', $value);
}
}
示例14: setConfigFile
/**
* @param string external configuration file in namespace format. The file
* must be suffixed with '.xml'.
* @throws TInvalidDataValueException if the file is invalid.
*/
public function setConfigFile($value)
{
if (($this->_configFile = Prado::getPathOfNamespace($value, self::CONFIG_FILE_EXT)) === null) {
throw new TConfigurationException('urlmapping_configfile_invalid', $value);
}
}
示例15: getOutputFile
protected function getOutputFile($app_dir, $namespace)
{
if (is_file($namespace) && strpos($namespace, $app_dir) === 0) {
return $namespace;
}
$file = Prado::getPathOfNamespace($namespace, ".php");
if ($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) {
if (strpos($path, $app_dir) === 0) {
return $file;
}
}
echo '** Output file ' . $file . ' must be within directory ' . $app_dir . "\n";
return false;
}