當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Pluf::start方法代碼示例

本文整理匯總了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();
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:25,代碼來源:PlufModelTest.php

示例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'));
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:8,代碼來源:PlufHTTPURLTest.php

示例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');
     }
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:8,代碼來源:PlufDBSchemaSQLiteTest.php

示例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();
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:11,代碼來源:PlufFormTest.php

示例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]);
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:54,代碼來源:PlufUserTest.php

示例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";
 }
開發者ID:burbuja,項目名稱:indefero,代碼行數:11,代碼來源:TestMonotone.php

示例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();
     }
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:16,代碼來源:PlufPaginatorTest.php

示例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);
}
開發者ID:burbuja,項目名稱:pluf,代碼行數:31,代碼來源:testrunner.php

示例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.
 *
開發者ID:burbuja,項目名稱:indefero,代碼行數:31,代碼來源:mtnpostpush.php

示例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());
開發者ID:burbuja,項目名稱:pluf,代碼行數:31,代碼來源:index.php

示例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";
開發者ID:burbuja,項目名稱:pluf,代碼行數:31,代碼來源:extracttemplates.php

示例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']);
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:6,代碼來源:PlufMethodStartTest.php

示例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());
開發者ID:burbuja,項目名稱:pluf,代碼行數:7,代碼來源:index.php

示例14: setUp

 protected function setUp()
 {
     Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
     @mkdir($this->output);
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:5,代碼來源:LatexEquationTest.php

示例15: setUp

 protected function setUp()
 {
     Pluf::start(dirname(__FILE__) . '/../conf/pluf.config.php');
     $this->filter = new Pluf_Text_HTML_Filter();
 }
開發者ID:burbuja,項目名稱:pluf,代碼行數:5,代碼來源:PlufTextHTMLFilter.php


注:本文中的Pluf::start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。