mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
fix консольного генератора плагинов
This commit is contained in:
parent
ea91335ce9
commit
493ffd1719
|
@ -1,4 +1,4 @@
|
||||||
Перейдите в данную папку с помощью консольной команды cd livestreet/engine/console/ и вызовите php ls.
|
Перейдите в данную папку с помощью консольной команды cd livestreet/framework/utilities/console/ и вызовите php ls.
|
||||||
Вы получите краткую справку и существующих командах, например:
|
Вы получите краткую справку и существующих командах, например:
|
||||||
php ls plugin new test
|
php ls plugin new test
|
||||||
Так мы создадим новый плагин с именем Test
|
Так мы создадим новый плагин с именем Test
|
||||||
|
|
|
@ -24,7 +24,7 @@ EOD;
|
||||||
$this->_name = $aArgs[0];
|
$this->_name = $aArgs[0];
|
||||||
|
|
||||||
$path=strtr($aArgs[0],'/\\',DIRECTORY_SEPARATOR);
|
$path=strtr($aArgs[0],'/\\',DIRECTORY_SEPARATOR);
|
||||||
$path=Config::Get('path.root.server').'/plugins/'.$path;
|
$path=Config::Get('path.application.plugins.server').'/'.$path;
|
||||||
if(strpos($path,DIRECTORY_SEPARATOR)===false)
|
if(strpos($path,DIRECTORY_SEPARATOR)===false)
|
||||||
$path='.'.DIRECTORY_SEPARATOR.$path;
|
$path='.'.DIRECTORY_SEPARATOR.$path;
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ class PluginExample extends Plugin {
|
||||||
* Замена экшна ActionIndex на ActionSomepage из папки плагина
|
* Замена экшна ActionIndex на ActionSomepage из папки плагина
|
||||||
*
|
*
|
||||||
* 'template' => array('index.tpl'=>'_my_plugin_index.tpl'),
|
* 'template' => array('index.tpl'=>'_my_plugin_index.tpl'),
|
||||||
* Замена index.tpl из корня скина файлом /plugins/abcplugin/templates/skin/default/my_plugin_index.tpl
|
* Замена index.tpl из корня скина файлом /application/plugins/abcplugin/templates/skin/default/my_plugin_index.tpl
|
||||||
*
|
*
|
||||||
* 'template'=>array('actions/ActionIndex/index.tpl'=>'_actions/ActionTest/index.tpl'),
|
* 'template'=>array('actions/ActionIndex/index.tpl'=>'_actions/ActionTest/index.tpl'),
|
||||||
* Замена index.tpl из скина из папки actions/ActionIndex/ файлом /plugins/abcplugin/templates/skin/default/actions/ActionTest/index.tpl
|
* Замена index.tpl из скина из папки actions/ActionIndex/ файлом /application/plugins/abcplugin/templates/skin/default/actions/ActionTest/index.tpl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class PluginExample extends Plugin {
|
||||||
* 'module' =>array('ModuleTopic'=>'_ModuleTopic'),
|
* 'module' =>array('ModuleTopic'=>'_ModuleTopic'),
|
||||||
*
|
*
|
||||||
* К классу ModuleTopic (/classes/modules/Topic.class.php) добавляются методы из
|
* К классу ModuleTopic (/classes/modules/Topic.class.php) добавляются методы из
|
||||||
* PluginAbcplugin_ModuleTopic (/plugins/abcplugin/classes/modules/Topic.class.php) - новые или замена существующих
|
* PluginAbcplugin_ModuleTopic (/application/plugins/abcplugin/classes/modules/Topic.class.php) - новые или замена существующих
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -40,7 +40,7 @@ class PluginExample extends Plugin {
|
||||||
* 'mapper' =>array('ModuleTopic_MapperTopic' => '_ModuleTopic_MapperTopic'),
|
* 'mapper' =>array('ModuleTopic_MapperTopic' => '_ModuleTopic_MapperTopic'),
|
||||||
*
|
*
|
||||||
* К классу ModuleTopic_MapperTopic (/classes/modules/mapper/Topic.mapper.class.php) добавляются методы из
|
* К классу ModuleTopic_MapperTopic (/classes/modules/mapper/Topic.mapper.class.php) добавляются методы из
|
||||||
* PluginAbcplugin_ModuleTopic_EntityTopic (/plugins/abcplugin/classes/modules/mapper/Topic.mapper.class.php) - новые или замена существующих
|
* PluginAbcplugin_ModuleTopic_EntityTopic (/application/plugins/abcplugin/classes/modules/mapper/Topic.mapper.class.php) - новые или замена существующих
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -48,7 +48,7 @@ class PluginExample extends Plugin {
|
||||||
* 'entity' =>array('ModuleTopic_EntityTopic' => '_ModuleTopic_EntityTopic'),
|
* 'entity' =>array('ModuleTopic_EntityTopic' => '_ModuleTopic_EntityTopic'),
|
||||||
*
|
*
|
||||||
* К классу ModuleTopic_EntityTopic (/classes/modules/entity/Topic.entity.class.php) добавляются методы из
|
* К классу ModuleTopic_EntityTopic (/classes/modules/entity/Topic.entity.class.php) добавляются методы из
|
||||||
* PluginAbcplugin_ModuleTopic_EntityTopic (/plugins/abcplugin/classes/modules/entity/Topic.entity.class.php) - новые или замена существующих
|
* PluginAbcplugin_ModuleTopic_EntityTopic (/application/plugins/abcplugin/classes/modules/entity/Topic.entity.class.php) - новые или замена существующих
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
);
|
);
|
||||||
|
@ -80,4 +80,3 @@ class PluginExample extends Plugin {
|
||||||
//$this->Viewer_AddMenu('blog',Plugin::GetTemplatePath(__CLASS__).'menu.blog.tpl'); // например, задаем свой вид меню
|
//$this->Viewer_AddMenu('blog',Plugin::GetTemplatePath(__CLASS__).'menu.blog.tpl'); // например, задаем свой вид меню
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Order Deny,Allow
|
||||||
|
Deny from all
|
|
@ -25,7 +25,8 @@ class PluginExample_ActionExample extends ActionPlugin {
|
||||||
* Завершение работы экшена
|
* Завершение работы экшена
|
||||||
*/
|
*/
|
||||||
public function EventShutdown() {
|
public function EventShutdown() {
|
||||||
|
/**
|
||||||
|
* Здесь можно прогрузить в шаблон какие-то общие переменные для всех евентов
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -5,4 +5,3 @@ class PluginExample_BlockExample extends Block {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ class PluginExample_HookExample extends Hook {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Хук в начало функции AddTopic() в модуле Topic (файл /classes/modules/topic/Topic.class.php , если этот модуль не переопределен в других плагинах):
|
* Хук в начало функции AddTopic() в модуле Topic (файл /application/classes/modules/topic/Topic.class.php , если этот модуль не переопределен в других плагинах):
|
||||||
*
|
*
|
||||||
* $this->AddHook('module_topic_addtopic_before','func_topic_addtopic_before');
|
* $this->AddHook('module_topic_addtopic_before','func_topic_addtopic_before');
|
||||||
*
|
*
|
||||||
|
@ -20,7 +20,7 @@ class PluginExample_HookExample extends Hook {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Хук в конец функции AddTopic() в модуле Topic (файл /classes/modules/topic/Topic.class.php , если этот модуль не переопределен в других плагинах):
|
* Хук в конец функции AddTopic() в модуле Topic (файл /application/classes/modules/topic/Topic.class.php , если этот модуль не переопределен в других плагинах):
|
||||||
*
|
*
|
||||||
* $this->AddHook('module_topic_addtopic_after','func_topic_addtopic_after');
|
* $this->AddHook('module_topic_addtopic_after','func_topic_addtopic_after');
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,6 +2,14 @@
|
||||||
|
|
||||||
class PluginExample_ModuleExample extends Module {
|
class PluginExample_ModuleExample extends Module {
|
||||||
|
|
||||||
|
protected $oMapper=null;
|
||||||
|
/**
|
||||||
|
* Инициализация модуля. Это обязательный метод
|
||||||
|
*/
|
||||||
|
public function Init() {
|
||||||
|
/**
|
||||||
|
* Создаем объект маппера PluginExample_ModuleExample_MapperExample
|
||||||
|
*/
|
||||||
|
$this->oMapper=Engine::GetMapper(__CLASS__);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class PluginExample_ModuleExample_EntityExample extends Entity
|
class PluginExample_ModuleExample_EntityExample extends Entity {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class PluginExample_ModuleExample_MapperExample extends Mapper
|
class PluginExample_ModuleExample_MapperExample extends Mapper {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Order Deny,Allow
|
||||||
|
Deny from all
|
|
@ -7,7 +7,8 @@ $config = array();
|
||||||
|
|
||||||
// Переопределить имеющуюся переменную в конфиге:
|
// Переопределить имеющуюся переменную в конфиге:
|
||||||
// Переопределение роутера на наш новый Action - добавляем свой урл http://domain.com/example
|
// Переопределение роутера на наш новый Action - добавляем свой урл http://domain.com/example
|
||||||
// Config::Set('router.page.example', 'PluginExample_ActionExample');
|
// Обратите внимание на '$root$' - говорит о том, что конфиг применяется к корневым настройкам движка, а не плагина
|
||||||
|
// $config['$root$']['router']['page']['example'] = 'PluginExample_ActionExample';
|
||||||
|
|
||||||
// Добавить новую переменную:
|
// Добавить новую переменную:
|
||||||
// $config['per_page'] = 15;
|
// $config['per_page'] = 15;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<homepage>http://livestreet.ru</homepage>
|
<homepage>http://livestreet.ru</homepage>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<requires>
|
<requires>
|
||||||
<livestreet>0.5.1</livestreet>
|
<livestreet>1.0</livestreet>
|
||||||
<plugins>
|
<plugins>
|
||||||
</plugins>
|
</plugins>
|
||||||
</requires>
|
</requires>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
Options -Indexes
|
||||||
|
<Files ~ "\.tpl$">
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
|
@ -5,5 +5,3 @@
|
||||||
return array(
|
return array(
|
||||||
'name' => 'text',
|
'name' => 'text',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
|
|
@ -5,5 +5,3 @@
|
||||||
return array(
|
return array(
|
||||||
'name' => 'text',
|
'name' => 'text',
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
|
Loading…
Reference in a new issue