本文整理汇总了PHP中Pluf::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Pluf::start方法的具体用法?PHP Pluf::start怎么用?PHP Pluf::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pluf
的用法示例。
在下文中一共展示了Pluf::start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$m = (require dirname(__FILE__) . '/relations.php');
$GLOBALS['_PX_models'] = array_merge($m, $GLOBALS['_PX_models']);
$GLOBALS['_PX_config']['pluf_use_rowpermission'] = false;
$db = Pluf::db();
$schema = Pluf::factory('Pluf_DB_Schema', $db);
$m1 = new TestModel();
$m2 = new RelatedToTestModel();
$m3 = new RelatedToTestModel2();
$m4 = new TestModelRecurse();
$schema->model = $m1;
$schema->dropTables();
$schema->createTables();
$schema->model = $m2;
$schema->dropTables();
$schema->createTables();
$schema->model = $m3;
$schema->dropTables();
$schema->createTables();
$schema->model = $m4;
$schema->dropTables();
$schema->createTables();
}
示例2: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
Pluf::loadFunction('Pluf_HTTP_URL_buildReverseUrl');
Pluf::loadFunction('Pluf_HTTP_URL_reverse');
$d = new Pluf_Dispatcher();
$d->loadControllers(Pluf::f('app_views'));
}
示例3: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$this->db = Pluf::db();
if ($this->db->engine != 'SQLite') {
$this->markTestSkipped('Only to be run with the SQLite DB engine');
}
}
示例4: setUp
protected function setUp()
{
$this->markTestSkipped('Need to rewrite the form handling.');
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$db = Pluf::db();
$schema = Pluf::factory('Pluf_DB_Schema', $db);
$m1 = new TestFormModel();
$schema->model = $m1;
$schema->dropTables();
$schema->createTables();
}
示例5: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$db = Pluf::db();
$schema = Pluf::factory('Pluf_DB_Schema', $db);
$models = array('Pluf_Group', 'Pluf_User', 'Pluf_Permission', 'Pluf_Message', 'Pluf_RowPermission');
foreach ($models as $model) {
$schema->model = Pluf::factory($model);
$schema->dropTables();
if (true !== ($res = $schema->createTables())) {
throw new Exception($res);
}
}
$perms = array();
for ($i = 1; $i <= 10; $i++) {
$perm = new Pluf_Permission();
$perm->application = 'DummyModel';
$perm->code_name = 'code-' . $i;
$perm->name = 'code-' . $i;
$perm->description = 'code-' . $i;
$perm->create();
$perms[] = clone $perm;
}
$groups = array();
for ($i = 1; $i <= 10; $i++) {
$group = new Pluf_Group();
$group->name = 'Group ' . $i;
$group->description = 'Group ' . $i;
$group->create();
$groups[] = clone $group;
}
$groups[0]->setAssoc($perms[0]);
$groups[0]->setAssoc($perms[1]);
$groups[0]->setAssoc($perms[2]);
$groups[0]->setAssoc($perms[3]);
$groups[1]->setAssoc($perms[0]);
//again perm "1"
$groups[0]->setAssoc($perms[4]);
$groups[0]->setAssoc($perms[5]);
$user = new Pluf_User();
$user->login = 'test';
$user->first_name = 'test';
$user->last_name = 'test';
$user->email = 'toto@example.com';
$user->setPassword('test');
$user->active = true;
if (true !== $user->create()) {
throw new Exception();
}
$user->setAssoc($groups[0]);
$user->setAssoc($groups[1]);
$user->setAssoc($perms[7]);
$user->setAssoc($perms[8]);
}
示例6: __construct
public function __construct()
{
parent::__construct("Test the monotone class.");
$this->tmpdir = sys_get_temp_dir() . "/mtn-test";
$this->dbfile = "{$this->tmpdir}/test.mtn";
set_include_path(get_include_path() . ":../../../pluf-master/src");
require_once "Pluf.php";
Pluf::start(dirname(__FILE__) . "/../conf/idf.php");
// Pluf::f() mocking
$GLOBALS['_PX_config']['mtn_repositories'] = "{$this->tmpdir}/%s.mtn";
}
示例7: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$db = Pluf::db();
$schema = Pluf::factory('Pluf_DB_Schema', $db);
$m1 = new TestFormModel();
$schema->model = $m1;
$schema->dropTables();
$schema->createTables();
for ($i = 1; $i < 11; $i++) {
$m = new TestFormModel();
$m->title = 'My title ' . $i;
$m->description = 'My description ' . $i;
$m->create();
}
}
示例8: strtolower
$config = $app . '/conf/' . strtolower($app) . '.test.php';
}
} else {
echo 'Error: This script can only be run from the command line.' . "\n";
exit(1);
}
echo sprintf('Application: %s ', $app);
if (!file_exists($config)) {
echo sprintf("\n" . 'Error, the config file does not exists: %s' . "\n", $config);
exit(1);
} else {
echo sprintf('(%s)' . "\n", $config);
}
define('IN_UNIT_TESTS', true);
require 'Pluf.php';
Pluf::start($config);
$simple_test = Pluf::f('simple_test_path', false);
if (false == $simple_test) {
e('Error, the path to the simple test framework is not defined.');
e('Download simple test from:');
e(' http://simpletest.sourceforge.net/');
e('Extract the archive on your system and set the "simple_test_path"');
e('configuration variable in your configuration file.');
e('For example: $cfg[\'simple_test_path\'] = \'/home/you/simpletest\'; ');
exit(1);
}
$testfolder = $app . '/Tests/';
if (!file_exists($testfolder)) {
e(sprintf('The test folder does not exists: %s.', $app . '/Tests/'));
exit(1);
}
示例9: dirname
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
/**
* This script will send the notifications after a push in your
* repository.
*/
require dirname(__FILE__) . '/../src/IDF/conf/path.php';
require 'Pluf.php';
Pluf::start(dirname(__FILE__) . '/../src/IDF/conf/idf.php');
Pluf_Dispatcher::loadControllers(Pluf::f('idf_views'));
/**
* [signal]
*
* mtnpostpush.php::run
*
* [sender]
*
* mtnpostpush.php
*
* [description]
*
* This signal allows an application to perform a set of tasks
* after a push to a monotone repository.
*
示例10: dirname
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Plume Framework is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
// Set the include path to have Pluf in it.
// If you have Pluf in your include path, you do not need that
$path_to_Pluf = dirname(__FILE__) . '/../../../src';
$path_to_Todo = dirname(__FILE__) . '/../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path_to_Pluf . PATH_SEPARATOR . $path_to_Todo);
// Load Pluf
require 'Pluf.php';
// Start the framework with the todo app configuration.
Pluf::start($path_to_Todo . '/Todo/conf/todo.php');
// As we are using a dispatcher, we need to load the corresponding
// view controllers. The controllers are just a mapping between the query
// string and corresponding classes and methods.
Pluf_Dispatcher::loadControllers(Pluf::f('todo_urls'));
// Dispatch the call. Note that the use of a dispatcher is not
// mandatory at all, you can create any number of .php file to dispatch
// manually. A dispatcher enables the use of only one index.php file.
Pluf_Dispatcher::dispatch(Pluf_HTTP_URL::getAction());
示例11: set_include_path
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# ***** END LICENSE BLOCK ***** */
/**
* Migration script.
*/
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__));
require 'Pluf.php';
function usage()
{
echo 'Usage examples:' . "\n" . ' Extract all: extracttemplates.php path/to/config.php path/to/outpudir' . "\n";
}
function debug($what)
{
global $debug;
if ($debug) {
echo $what . "\n";
}
}
if ($argc !== 3) {
usage();
die;
}
$conf = $argv[1];
$outputdir = $argv[2];
Pluf::start($conf);
$generator = new Pluf_Translation_Generator();
$generator->generate($outputdir);
echo 'Done', "\n";
示例12: testStart
public function testStart()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$this->assertEquals(true, isset($GLOBALS['_PX_config']));
$this->assertEquals(false, $GLOBALS['_PX_config']['test']);
}
示例13: set_include_path
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '../../src');
require 'Pluf.php';
Pluf::start(dirname(__FILE__) . '/Hello/conf/hello.php');
Pluf_Dispatcher::loadControllers(Pluf::f('hello_urls'));
Pluf_Dispatcher::dispatch(Pluf_HTTP_URL::getAction());
示例14: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
@mkdir($this->output);
}
示例15: setUp
protected function setUp()
{
Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
$this->filter = new Pluf_Text_HTML_Filter();
}