Esempio n. 1
0
 public function runGeneratorCommand($command)
 {
     ob_start();
     $Generator = new AkelosGenerator();
     $Generator->setFileOptions(array('base_path' => AK_FRAMEWORK_DIR));
     $Generator->runCommand($command);
     $result = ob_get_clean();
     //AK::trace($result);
     return $result;
 }
Esempio n. 2
0
 public function test_service_generator()
 {
     $TodoApi = new TodoApi();
     ob_start();
     $Generator = new AkelosGenerator();
     $Generator->runCommand('service Todo');
     ob_end_clean();
     require_once AkConfig::getDir('models') . DS . 'todo_service.php';
     $TodoService = new TodoService();
     foreach (array_keys($TodoApi->getApiMethods()) as $method) {
         $this->assertTrue(method_exists($TodoService, $method));
     }
 }
Esempio n. 3
0
 function test_service_generator()
 {
     $TodoApi =& new TodoApi();
     ob_start();
     require_once(AK_LIB_DIR.DS.'utils'.DS.'generators'.DS.'AkelosGenerator.php');
     $Generator = new AkelosGenerator();
     $Generator->runCommand('service Todo');
     ob_end_clean();
     require_once(AK_MODELS_DIR.DS.'todo_service.php');
     $TodoService =& new TodoService();
     foreach (array_keys($TodoApi->getApiMethods()) as $method){
         $this->assertTrue(method_exists($TodoService, $method));
     }
 }
Esempio n. 4
0
// +----------------------------------------------------------------------+
// | Akelos Framework - http://www.akelos.org                             |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2006, Akelos Media, S.L.  & Bermi Ferrer Martinez |
// | Released under the GNU Lesser General Public License, see LICENSE.txt|
// +----------------------------------------------------------------------+

/**
 * @package AkelosFramework
 * @subpackage Generators
 * @author Bermi Ferrer <bermi a.t akelos c.om>
 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
 */

error_reporting(defined('AK_ERROR_REPORTING_ON_SCRIPTS') ? AK_ERROR_REPORTING_ON_SCRIPTS : 0);
require_once(AK_LIB_DIR.DS.'Ak.php');
require_once(AK_LIB_DIR.DS.'AkObject.php');
require_once(AK_LIB_DIR.DS.'AkInflector.php');
defined('AK_SKIP_DB_CONNECTION') && AK_SKIP_DB_CONNECTION ? ($dsn='') : Ak::db(&$dsn);
array_shift($argv);
$command = join(' ',$argv);

require_once(AK_LIB_DIR.DS.'utils'.DS.'generators'.DS.'AkelosGenerator.php');

$Generator = new AkelosGenerator();
$Generator->runCommand($command);

echo "\n";

?>
Esempio n. 5
0
<?php

# This file is part of the Akelos Framework
# (Copyright) 2004-2010 Bermi Ferrer bermi a t bermilabs com
# See LICENSE and CREDITS for details
$total_args = count($GLOBALS['argv']);
if ($total_args > 5) {
    return;
}
$Generator = new AkelosGenerator();
echo "--help\n";
if ($total_args <= 4) {
    echo join("\n", $Generator->getAvailableGenerators());
}