• Xpto

    (@pafcosta)


    Hi All,

    I’m trying to use wordpress as manual of one web app and also to share some private files with the users. The idea is the app retrive the posts and display inside. I tried to use this code in one controler

    try
    {
    spl_autoload_unregister(array(‘YiiBase’,’autoload’));
    echo “xxxx”;
    require(‘/wiki/wp-blog-header.php’);
    echo “xxxx1”;
    /*
    $posts = get_posts(‘order=ASC&orderby=post_title’);
    echo ‘dasd’ . count($posts);
    foreach ($posts as $post) : start_wp();
    the_date(); echo “”;
    the_title();
    the_excerpt();
    endforeach;*/
    spl_autoload_register(array(‘YiiBase’,’autoload’));
    }
    catch (Exception $e) {
    echo “xxxxsss111”;
    spl_autoload_register(array(‘YiiBase’,’autoload’));

    echo var_dump($e);
    Yii::app()->end();
    //throw $e;
    }
    Yii::app()->end();

    But the page fails during the “require”. Can anyone give some ideas, what i’m doing wrong?

    The site structure is:

    https://www.xpto.com => base site app
    https://www.xpto.com/wiki => manual

    THanks

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If require is failing, there must be a problem with your path spec. Try either ‘./wiki/wp-blog-header.php’ or ‘wiki/wp-blog-header.php’. Or something else, depending on where your file is.

    Assuming a *nix server, a starting slash means server file structure root, your site’s root is never the server root. BTW, unless you need a template loaded, you can require wp-load.php instead of wp-blog-header.php.

Viewing 1 replies (of 1 total)
  • The topic ‘YII WordPress’ is closed to new replies.