OK. Now I get Error: Download of
'http://localhost/gearsTut/manifestTest/test.html' failed, status code 404.

And if I load manifest.php the folder "test" is not listed and test.html is
listed as {"url": "test.html" , "ignoreQuery":
true }

Is this progress?

> -----Original Message-----
> From: gears-users@googlegroups.com [mailto:gears-us...@googlegroups.com]
> On Behalf Of carise
> Sent: Thursday, January 29, 2009 1:43 AM
> To: Gears Users
> Subject: [gears-users] Re: manifest.php folders
> 
> 
> Okay, hm, so the next thing I would do, since the test directory is in
> the same level as manifest.php, we want to exclude it (since it's the
> directory). You can do that in the while loop which is checking the
> version/adding the files to the $files array.
> 
>     if ($file<>'..' && !is_dir($file))
>       $files[]=$file;
> 
> Maybe the 301 error is because Google Gears can't (not sure if that's
> true?) download/capture directories (only files), so when it tries to
> retrieve test, it complains.
> 
> On Jan 28, 5:25 pm, "Tosca Lahiri" <t...@toscalahiri.co.uk> wrote:
> > OK, you have folder/file structure correct.
> >
> > When I try $dirs[1] = dirname($_SERVER['SCRIPT_FILENAME']) . "/test/.";
> and
> > load go_offline.html  I get "Error: Download of
> > 'http://localhost/gearsTut/manifestTest/test'failed, status code 301".
> >
> > When I directly open manifest.php in the browser (FF) I see an entry for
> the
> > folder "test" (which I don't want) and an entry for test.html.
> >
> > {
> >   "betaManifestVersion": 1,
> >   "version": "1233191231",
> >   "entries": [
> >     {"url": "." , "ignoreQuery":
> > true },
> >     {"url": "articleadd.php" , "ignoreQuery":
> > true },
> >     {"url": "articleform.html" , "ignoreQuery":
> > true },
> >     {"url": "articles.php" , "ignoreQuery":
> > true },
> >     {"url": "Copy of manifest.php" , "ignoreQuery":
> > true },
> >     {"url": "db_params.php" , "ignoreQuery":
> > true },
> >     {"url": "gears_init.js" , "ignoreQuery":
> > true },
> >     {"url": "go_offline.html" , "ignoreQuery":
> > true },
> >     {"url": "go_offline2.js" , "ignoreQuery":
> > true },
> >     {"url": "manifest.php" , "ignoreQuery":
> > true },
> >     {"url": "oldgo_offline.js" , "ignoreQuery":
> > true },
> >     {"url": "test" , "ignoreQuery":
> > true },
> >     {"url": "." , "ignoreQuery":
> > true },
> >     {"url": "test.html" , "ignoreQuery":
> > true },
> >  {"url": "manifest.php" , "ignoreQuery": true }
> >   ]
> >
> > }
> >
> > As far as I understand I need the manifest to say {"url":
> "test/test.html" ,
> > "ignoreQuery":true }.
> >
> > So, problems:
> > 1. FF or IE not downloading "test" folder and its contents (302 or 301
> > status codes)
> > 2. manifest.php directly in browser not correctly listing test/test.html
> > 3. Not all files in home directory listed when loading manifest.php in
> > browser.
> >
> > That is a summary of what is and is not happening.
> > What are the next steps do you think?
> > TML
> >
> >
> >
> > > -----Original Message-----
> > > From: gears-users@googlegroups.com [mailto:gears-
> us...@googlegroups.com]
> > > On Behalf Of carise
> > > Sent: Thursday, January 29, 2009 12:52 AM
> > > To: Gears Users
> > > Subject: [gears-users] Re: manifest.php folders
> >
> > > Hmm... ok, I think I understand the situation though I'm not sure why
> > > the code is not working... So you have a directory under the path,
> > > $_SERVER['SCRIPT_FILENAME'], and the directory is called "test"?
> >
> > > Here's another shot in the dark... do you get the same results using:
> >
> > > $dirs[1] = dirname($_SERVER['SCRIPT_FILENAME']) . "/test/.";
> >
> > > (assuming manifest.php and the test/ directory are in the same level)?
> >
> > > On Jan 28, 4:32 pm, TML <t...@toscalahiri.co.uk> wrote:
> > > > Also, dir[0] is not returning ALL  the files in the home directory.
> > > > The files being returned are those listed above. It is returning
> some
> > > > of the php files, some of the html files and some of the js
> > > > files...can't see a logical pattern of those being not listed.
> >
> > > > In Firefox getthing Status Code 301 now.
> > > > TML
> >
> > > > On Jan 29, 12:12 am, TML <t...@toscalahiri.co.uk> wrote:
> >
> > > > > HI carise (and others)
> >
> > > > > I have changed from Firefox to IE. Now in the space where I get
> the
> > > > > status messages when clicking "Capture" and invoke the
> manifest.php I
> > > > > get:
> >
> > > > > Status Message: Error: Download of 'http://localhost/gearsTut/
> > > > > manifestTest/test' failed, status code 302.
> > > > >  Looked this up on Google and it means "Found" and is to do with
> > > > > redirection I think. Not sure of its implications here.
> >
> > > > > TML
> >
> > > > > On Jan 28, 11:57 pm, "Tosca Lahiri" <t...@toscalahiri.co.uk>
wrote:
> >
> > > > > > Hi,
> >
> > > > > > I have files in "C:/Program Files/Apache Software
> > > > > > Foundation/Apache2.2/htdocs/gearsTut/manifestTest - these are
> being
> > > reported
> > > > > > by opening manifest.php in browser. And one file (test.htm)
> > > C:/Program
> > > > > > Files/Apache Software
> > > Foundation/Apache2.2/htdocs/gearsTut/manifestTest/test
> > > > > > . It is test/test.htm that is not being reported.
> >
> > > > > > Using $dirs[1] = "C:/Program Files/Apache Software
> > > > > > Foundation/Apache2.2/htdocs/gearsTut/manifestTest/test/."; the
> > > output is:
> > > > > > {
> > > > > >   "betaManifestVersion": 1,
> > > > > >   "version": "1233157431",
> > > > > >   "entries": [
> > > > > >     {"url": "." , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "articleadd.php" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "articleform.html" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "articles.php" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "db_params.php" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "gears_init.js" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "go_offline.html" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "go_offline2.js" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "manifest.php" , "ignoreQuery":
> > > > > > true },
> > > > > >     {"url": "oldgo_offline.js" , "ignoreQuery":
> > > > > > true },
> > > > > >  {"url": "manifest.php" , "ignoreQuery": true }
> > > > > >   ]
> >
> > > > > > }
> >
> > > > > > What do you think?
> >
> > > > > > TML
> >
> > > > > > > -----Original Message-----
> > > > > > > From: gears-users@googlegroups.com [mailto:gears-
> > > us...@googlegroups.com]
> > > > > > > On Behalf Of carise
> > > > > > > Sent: Wednesday, January 28, 2009 11:32 PM
> > > > > > > To: Gears Users
> > > > > > > Subject: [gears-users] Re: manifest.php folders
> >
> > > > > > > Ok.. So let me ask.
> >
> > > > > > > 1) Is        "C:/Program Files/Apache Software
> > > Foundation/Apache2.2/
> > > > > > > htdocs/gearsTut/manifestTest/test"   the directory that you
> want
> > > to
> > > > > > > get files from?
> >
> > > > > > > If yes, then change the directory name to:
> >
> > > > > > > "C:/Program Files/Apache Software
> > > Foundation/Apache2.2/htdocs/gearsTut/
> > > > > > > manifestTest/test/."       <-- notice the /. after "test".
> >
> > > > > > >http://us3.php.net/manual/en/function.dirname.php(php.net'sdocs
> page
> > > > > > > on using dirname())
> >
> > > > > > > 2) If the above doesn't work, what kind of output are you
> getting
> > > from
> > > > > > > using the above?
> >
> > > > > > > On Jan 28, 3:29 pm, "Tosca Lahiri" <t...@toscalahiri.co.uk>
> wrote:
> > > > > > > > Thanks, but I have tried that and it doesn't work either.
> TML
> >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: gears-users@googlegroups.com [mailto:gears-
> > > > > > > us...@googlegroups.com]
> > > > > > > > > On Behalf Of carise
> > > > > > > > > Sent: Wednesday, January 28, 2009 11:14 PM
> > > > > > > > > To: Gears Users
> > > > > > > > > Subject: [gears-users] Re: manifest.php folders
> >
> > > > > > > > > Sorry, bad explanation on my part.
> >
> > > > > > > > > Have you tried:
> >
> > > > > > > > > $dirs[1] = dirname("C:/Program Files/Apache Software
> > > Foundation/
> > > > > > > > > Apache2.2/htdocs/gearsTut/manifestTest/test");
> >
> > > > > > > > > On Jan 28, 2:12 pm, "Tosca Lahiri"
<t...@toscalahiri.co.uk>
> > > wrote:
> > > > > > > > > > Thanks for the suggestion.
> > > > > > > > > > I have tried:
> > > > > > > > > > $dirs[1] =
> > > dirname("http://localhost/gearsTut/manifestTest/test";,
> > > > > > > > > > "C:/Program Files/Apache Software
> > > > > > > > > >
Foundation/Apache2.2/htdocs/gearsTut/manifestTest/test");
> >
> > > > > > > > > > And:
> > > > > > > > > > $dirs[1] = dirname("/gearsTut/manifestTest/test.",
> > > > > > > > > > "C:/Program Files/Apache Software
> > > > > > > > > >
> Foundation/Apache2.2/htdocs/gearsTut/manifestTest/test.");
> >
> > > > > > > > > > And:
> > > > > > > > > > $dirs[1] = dirname("/gearsTut/manifestTest/test",
> > > > > > > > > > "C:/Program Files/Apache Software
> > > > > > > > > >
Foundation/Apache2.2/htdocs/gearsTut/manifestTest/test");
> >
> > > > > > > > > > But still not listing files in sub directory. I have
> tried
> > > changing
> > > > > > > > > round
> > > > > > > > > > $dirs[0] and $dirs[1] in case only the first dir was
> being
> > > read but
> > > > > > > that
> > > > > > > > > > just gave me the files in the home dir.
> >
> > > > > > > > > > Any more suggestions?
> > > > > > > > > > TML
> >
> > > > > > > > > > > -----Original Message-----
> > > > > > > > > > > From: gears-users@googlegroups.com [mailto:gears-
> > > > > > > > > us...@googlegroups.com]
> > > > > > > > > > > On Behalf Of carise
> > > > > > > > > > > Sent: Wednesday, January 28, 2009 9:48 PM
> > > > > > > > > > > To: Gears Users
> > > > > > > > > > > Subject: [gears-users] Re: manifest.php folders
> >
> > > > > > > > > > > I think the dirname for your home/test directory is
> > > supposed to be
> > > > > > > a
> > > > > > > > > > > filesystem path (e.g.
> > > > > > > "/www/apache/htdocs/gearsTut/manifestTest/test",
> > > > > > > > > > > "C:/apache/htdocs/gearsTut/manifestTest/test").
> Perhaps
> > > give that
> > > > > > > a
> > > > > > > > > > > try?
> >
> > > > > > > > > > > On Jan 28, 1:16 pm, "Tosca Lahiri"
> >
> > <t...@toscalahiri.co.uk>
> >
> > > wrote:
> > > > > > > > > > > > Thanks but it hasn't worked in my example. It
> implodes
> > > the files
> > > > > > > in
> > > > > > > > > the
> > > > > > > > > > > home
> > > > > > > > > > > > directory but not in the home/test directory. Will
> you
> > > look at
> > > > > > > the
> > > > > > > > > code
> > > > > > > > > > > > again please:
> >
> > > > > > > > > > > > $version = 0;
> > > > > > > > > > > > $dirs = array();
> > > > > > > > > > > > $dirs[0] = dirname($_SERVER['SCRIPT_FILENAME']);
> > > > > > > > > > > > $dirs[1] =
> > > > > > > dirname("http://localhost/gearsTut/manifestTest/test/";);
> >
> > > > > > > > > > > > foreach ($dirs as $dir)
> > > > > > > > > > > > {
> > > > > > > > > > > > $handle = opendir($dir);
> > > > > > > > > > > > while (false !== ($file = readdir($handle)))
> > > > > > > > > > > >  {
> > > > > > > > > > > >   if (file_exists("$dir/$file"))
> > > > > > > > > > > >    {
> > > > > > > > > > > >     $v = filemtime("$dir/$file");
> > > > > > > > > > > >     if ($v > $version)
> > > > > > > > > > > >         {
> > > > > > > > > > > >       $version = $v;
> > > > > > > > > > > >     }
> > > > > > > > > > > >     if ($file<>'..')
> > > > > > > > > > > >       $files[]=$file;
> > > > > > > > > > > >   }
> > > > > > > > > > > >  }
> >
> > > > > > > > > > > > }
> >
> > > > > > > > > > > > $entries = array();
> > > > > > > > > > > > foreach ($files as $file)
> > > > > > > > > > > >  {
> > > > > > > > > > > >   array_push($entries, "    {\"url\": \"$file\" ,
> > > > > > > \"ignoreQuery\":
> > > > > > > > > > > > true }");
> > > > > > > > > > > >  }
> > > > > > > > > > > > ?>
> > > > > > > > > > > >  {
> > > > > > > > > > > >   "betaManifestVersion": 1,
> > > > > > > > > > > >
> >
> > ...
> >
> > read more »

Reply via email to